Repository: antvis/F6 Branch: master Commit: f632a34ab2bb Files: 2383 Total size: 16.2 MB Directory structure: gitextract_n32t9dq7/ ├── .browserslistrc ├── .gitattributes ├── .gitignore ├── .npmignore ├── .prettierrc ├── .stylelintrc.json ├── .travis.yml ├── LICENSE ├── README-zh-CN.md ├── README.md ├── SECURITY.md ├── binding.gyp ├── common/ │ ├── autoinstallers/ │ │ └── rush-prettier/ │ │ └── package.json │ ├── config/ │ │ └── rush/ │ │ ├── .npmrc │ │ ├── .npmrc-publish │ │ ├── .pnpmfile.cjs │ │ ├── artifactory.json │ │ ├── build-cache.json │ │ ├── cobuild.json │ │ ├── command-line.json │ │ ├── common-versions.json │ │ ├── custom-tips.json │ │ ├── experiments.json │ │ ├── pnpm-config.json │ │ ├── repo-state.json │ │ ├── rush-plugins.json │ │ ├── subspaces.json │ │ └── version-policies.json │ ├── git-hooks/ │ │ ├── commit-msg.sample │ │ └── pre-commit │ └── scripts/ │ ├── install-run-rush-pnpm.js │ ├── install-run-rush.js │ ├── install-run-rushx.js │ └── install-run.js ├── eslint.config.js ├── package.json ├── packages/ │ ├── core/ │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── src/ │ │ │ ├── behavior/ │ │ │ │ ├── behavior.ts │ │ │ │ ├── behaviorOption.ts │ │ │ │ └── index.ts │ │ │ ├── element/ │ │ │ │ ├── arrow.ts │ │ │ │ ├── combo.ts │ │ │ │ ├── combos/ │ │ │ │ │ ├── circle.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── rect.ts │ │ │ │ ├── edge.ts │ │ │ │ ├── hull/ │ │ │ │ │ ├── bubbleset.ts │ │ │ │ │ └── convexHull.ts │ │ │ │ ├── index.ts │ │ │ │ ├── marker.ts │ │ │ │ ├── node.ts │ │ │ │ ├── nodes/ │ │ │ │ │ ├── image.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── simple-circle.ts │ │ │ │ │ └── simple-rect.ts │ │ │ │ ├── shape.ts │ │ │ │ ├── shapeBase.ts │ │ │ │ └── xml.ts │ │ │ ├── global.ts │ │ │ ├── graph/ │ │ │ │ ├── controller/ │ │ │ │ │ ├── event.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── item.ts │ │ │ │ │ ├── layout.ts │ │ │ │ │ ├── mode.ts │ │ │ │ │ ├── state.ts │ │ │ │ │ └── view.ts │ │ │ │ └── graph.ts │ │ │ ├── index.ts │ │ │ ├── interface/ │ │ │ │ ├── behavior.ts │ │ │ │ ├── graph.ts │ │ │ │ ├── index.ts │ │ │ │ ├── item.ts │ │ │ │ └── shape.ts │ │ │ ├── item/ │ │ │ │ ├── combo.ts │ │ │ │ ├── edge.ts │ │ │ │ ├── hull.ts │ │ │ │ ├── item.ts │ │ │ │ └── node.ts │ │ │ ├── types/ │ │ │ │ └── index.ts │ │ │ └── util/ │ │ │ ├── base.ts │ │ │ ├── color.ts │ │ │ ├── graphic.ts │ │ │ ├── index.ts │ │ │ ├── letterAspectRatio.ts │ │ │ ├── math.ts │ │ │ ├── path.ts │ │ │ └── validation.ts │ │ ├── tests/ │ │ │ └── unit/ │ │ │ └── index-spec.ts │ │ ├── tsconfig.json │ │ └── vite.config.ts │ ├── element/ │ │ ├── package.json │ │ ├── src/ │ │ │ ├── edges/ │ │ │ │ ├── index.ts │ │ │ │ ├── polyline-util.ts │ │ │ │ ├── polyline.ts │ │ │ │ └── router.ts │ │ │ ├── index.ts │ │ │ └── nodes/ │ │ │ ├── circle.ts │ │ │ ├── diamond.ts │ │ │ ├── donut.ts │ │ │ ├── ellipse.ts │ │ │ ├── image.ts │ │ │ ├── index.ts │ │ │ ├── modelRect.ts │ │ │ ├── rect.ts │ │ │ ├── star.ts │ │ │ └── triangle.ts │ │ ├── tests/ │ │ │ └── unit/ │ │ │ ├── issues-spec.ts │ │ │ └── template-spec.ts │ │ └── vite.config.ts │ ├── examples-alipay/ │ │ ├── app.acss │ │ ├── app.js │ │ ├── app.json │ │ ├── common/ │ │ │ ├── components/ │ │ │ │ ├── block-list/ │ │ │ │ │ ├── block-list.acss │ │ │ │ │ ├── block-list.axml │ │ │ │ │ ├── block-list.js │ │ │ │ │ └── block-list.json │ │ │ │ └── search/ │ │ │ │ ├── search.acss │ │ │ │ ├── search.axml │ │ │ │ ├── search.js │ │ │ │ └── search.json │ │ │ └── utils/ │ │ │ ├── common.js │ │ │ ├── context.js │ │ │ ├── data.js │ │ │ ├── debounce.js │ │ │ └── process.js │ │ ├── mini.project.json │ │ ├── package.json │ │ └── pages/ │ │ ├── animation/ │ │ │ ├── change-position-default/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── custom-animate-position/ │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── edge-edge/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── edge-line-growth/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── node-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── point-in-line/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── state-change-hover/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── elements/ │ │ │ ├── arc/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── area-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── bar-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── built-in-arrows/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── c-circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── c-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── card/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── card-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── circle-with-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── cubic1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── cubic2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── custom-arrows/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── custom-polyline/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── custom-polyline2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── diamond/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── donut/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── edge-bg/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── edge-mul-label/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── ellipse/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── extra-shape/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── image/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── label-len/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── label-len1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── line-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── list/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── loop/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── mode-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── multi-edges/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── node-bg/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── pie-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── point-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── polyline1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── polyline2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── polyline3/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── rect-with-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── stack-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── star/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── triangle/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── general-graph/ │ │ │ ├── basic-FA2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-MDS/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-combo-force/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-concentric/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-dagre/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-force-directed/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-force-directed-drag-fix/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-grid/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── basic-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── circular-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── circular-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── cluster-grid/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── custom-bi-graph/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── dagre/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── dagre-UL/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── dagre-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── dagre-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── data-change/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── degree-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── division-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-bubbles/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-constrained-in-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-directed-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-directed-force-clustering/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-directed-functional-params/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── force-directed-prevent-overlap/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fruchterman/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fruchterman-clustering/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fruchterman-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fruchterman-worker/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── interact-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── layout-timing/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── layout-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── prevent-overlap-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── prevent-overlap-unstrict-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── radial-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── sort-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── spiral-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── subgraph-layout/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── sublayout-pipes/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── index/ │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── interactive/ │ │ │ ├── activate-relations/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── add-child/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── canvas-two-fingers/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── change-data/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── change-members/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── collapse-slibing/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── combo-circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── combo-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── drag-subtree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fix-item/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── hide-item/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── highlight-dark/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── hull/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── move/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── move-animate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── partial-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── set-mode/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── plugins/ │ │ │ ├── bundling/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── donut-transfer/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── edge-filter/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── fisheye/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── menu/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── mini-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── snap-line/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── timebar/ │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ └── index.tsx │ │ │ ├── tool-tip/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── zoom-slider/ │ │ │ ├── data.js │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── scene-case/ │ │ │ ├── custom-flow/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── decision-tree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── donut-transfer/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── knowledge-tree-graph/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── metro-lines/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ └── sankey/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── search/ │ │ │ ├── search.acss │ │ │ ├── search.axml │ │ │ ├── search.js │ │ │ └── search.json │ │ └── tree-graph/ │ │ ├── basic-dendrogram/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── compact-box/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── compact-box-left-align/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── custom-edge-tree/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── custom-side-mind-map/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── custom-tree/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── file-system/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── intend-align-top/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── intended/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── left-mind-map/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── mind-map/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── radial-compact-box/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── radial-dendrogram/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── right-mind-map/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── tb-compact-box/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── tb-dendrogram/ │ │ │ ├── data.js │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ └── tree-edge-label/ │ │ ├── data.js │ │ ├── index.acss │ │ ├── index.axml │ │ ├── index.js │ │ └── index.json │ ├── examples-uniapp/ │ │ ├── .hbuilderx/ │ │ │ └── launch.json │ │ ├── App.vue │ │ ├── components/ │ │ │ └── canvas/ │ │ │ └── canvas.vue │ │ ├── f6/ │ │ │ ├── extends/ │ │ │ │ ├── graph/ │ │ │ │ │ └── treeGraph.js │ │ │ │ └── layout/ │ │ │ │ ├── circularLayout.js │ │ │ │ ├── comboForceLayout.js │ │ │ │ ├── concentricLayout.js │ │ │ │ ├── dagreLayout.js │ │ │ │ ├── forceAtlas2Layout.js │ │ │ │ ├── forceLayout.js │ │ │ │ ├── fruchtermanLayout.js │ │ │ │ ├── gForceLayout.js │ │ │ │ ├── gridLayout.js │ │ │ │ ├── mdsLayout.js │ │ │ │ ├── radialLayout.js │ │ │ │ └── randomLayout.js │ │ │ └── index.js │ │ ├── index.html │ │ ├── main.js │ │ ├── manifest.json │ │ ├── pages/ │ │ │ └── index/ │ │ │ └── index.vue │ │ ├── pages.json │ │ └── uni.scss │ ├── examples-wx/ │ │ ├── app.js │ │ ├── app.json │ │ ├── app.wxss │ │ ├── components/ │ │ │ ├── wx.js │ │ │ ├── wx.json │ │ │ ├── wx.wxml │ │ │ └── wx.wxss │ │ ├── miniprogram_npm/ │ │ │ └── @antv/ │ │ │ ├── f6-plugin/ │ │ │ │ └── f6Plugin.js │ │ │ └── f6-wx/ │ │ │ ├── canvas/ │ │ │ │ ├── canvas.js │ │ │ │ ├── canvas.json │ │ │ │ └── canvas.wxml │ │ │ ├── container/ │ │ │ │ ├── container.js │ │ │ │ ├── container.json │ │ │ │ └── container.wxml │ │ │ ├── extends/ │ │ │ │ ├── graph/ │ │ │ │ │ └── treeGraph.js │ │ │ │ └── layout/ │ │ │ │ ├── circularLayout.js │ │ │ │ ├── comboForceLayout.js │ │ │ │ ├── concentricLayout.js │ │ │ │ ├── dagreLayout.js │ │ │ │ ├── forceAtlas2Layout.js │ │ │ │ ├── forceLayout.js │ │ │ │ ├── fruchtermanLayout.js │ │ │ │ ├── gForceLayout.js │ │ │ │ ├── gridLayout.js │ │ │ │ ├── mdsLayout.js │ │ │ │ ├── radialLayout.js │ │ │ │ └── randomLayout.js │ │ │ └── index.js │ │ ├── package-animation/ │ │ │ └── pages/ │ │ │ └── animation/ │ │ │ ├── change-position-default/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-animate-position/ │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── edge-edge/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── edge-line-growth/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── node-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── point-in-line/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── state-change-hover/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-elements/ │ │ │ └── pages/ │ │ │ └── elements/ │ │ │ ├── arc/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── area-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── bar-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── built-in-arrows/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── c-circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── c-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── card/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── card-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── circle-with-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── cubic1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── cubic2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-arrows/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-polyline/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-polyline2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── diamond/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── donut/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── edge-bg/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── edge-mul-label/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── ellipse/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── extra-shape/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── image/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── label-len/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── label-len1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── line-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── list/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── loop/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── mode-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── multi-edges/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── node-bg/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── pie-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── point-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── polyline1/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── polyline2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── polyline3/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── rect-with-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── stack-chart/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── star/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── triangle/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-general-graph/ │ │ │ └── pages/ │ │ │ └── general-graph/ │ │ │ ├── basic-FA2/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-MDS/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-combo-force/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-concentric/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-dagre/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-force-directed/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-force-directed-drag-fix/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-grid/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── basic-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── circular-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── circular-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── cluster-grid/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-bi-graph/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── dagre/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── dagre-UL/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── dagre-combo/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── dagre-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── data-change/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── degree-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── division-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-bubbles/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-constrained-in-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-directed-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-directed-force-clustering/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-directed-functional-params/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── force-directed-prevent-overlap/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── fruchterman/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── fruchterman-clustering/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── fruchterman-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── interact-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── layout-timing/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── layoutTranslate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── prevent-overlap-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── prevent-overlap-unstrict-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── radial-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── sort-radial/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── spiral-circular/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── subgraph-layout/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── sublayout-pipes/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-interactive/ │ │ │ └── pages/ │ │ │ └── interactive/ │ │ │ ├── activate-relations/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── add-child/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── canvas-two-fingers/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── change-data/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── change-members/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── collapse-slibing/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── combo-circle/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── combo-rect/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── drag-subtree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── fix-item/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── hide-item/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── highlight-dark/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── hull/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── move/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── move-animate/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── partial-node/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── set-mode/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-plugin/ │ │ │ └── pages/ │ │ │ └── plugin/ │ │ │ ├── bundling/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── edge-filter/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── fish-eye/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── legend/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── menu/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── mini-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── snap-line/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── time-bar/ │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── tool-tip/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── zoom-slider/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-scene-case/ │ │ │ └── pages/ │ │ │ └── scene-case/ │ │ │ ├── custom-flow/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── decision-tree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── donut-transfer/ │ │ │ │ ├── data.js │ │ │ │ ├── index.acss │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── knowledge-tree-graph/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── metro-lines/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── sankey/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package-tree-graph/ │ │ │ └── pages/ │ │ │ └── tree-graph/ │ │ │ ├── basic-dendrogram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── compact-box/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── compact-box-left-align/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-edge-tree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-side-mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── custom-tree/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── file-system/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── h-intended/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── intend-align-top/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── left-mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── radial-compact-box/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── radial-dendrogram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── right-mind-map/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── tb-compact-box/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ ├── tb-dendrogram/ │ │ │ │ ├── data.js │ │ │ │ ├── index.js │ │ │ │ ├── index.json │ │ │ │ ├── index.wxml │ │ │ │ └── index.wxss │ │ │ └── tree-edge-label/ │ │ │ ├── data.js │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── package.json │ │ ├── pages/ │ │ │ └── index/ │ │ │ ├── index.js │ │ │ ├── index.json │ │ │ ├── index.wxml │ │ │ └── index.wxss │ │ ├── project.config.json │ │ ├── project.private.config.json │ │ ├── sitemap.json │ │ └── utils/ │ │ ├── common.js │ │ ├── data.js │ │ ├── index.js │ │ └── util.js │ ├── f6/ │ │ ├── .storybook/ │ │ │ ├── main.ts │ │ │ └── preview.ts │ │ ├── package.json │ │ ├── src/ │ │ │ ├── behavior/ │ │ │ │ ├── activate-relations.ts │ │ │ │ ├── click-select.ts │ │ │ │ ├── collapse-expand-combo.ts │ │ │ │ ├── collapse-expand.ts │ │ │ │ ├── create-edge.ts │ │ │ │ ├── drag-canvas.ts │ │ │ │ ├── drag-combo.ts │ │ │ │ ├── drag-node.ts │ │ │ │ ├── index.ts │ │ │ │ ├── mobile-behavior.ts │ │ │ │ ├── tooltip.ts │ │ │ │ └── zoom-canvas.ts │ │ │ ├── element/ │ │ │ │ └── index.ts │ │ │ ├── extends/ │ │ │ │ ├── graph/ │ │ │ │ │ └── treeGraph/ │ │ │ │ │ └── index.ts │ │ │ │ └── layout/ │ │ │ │ ├── circularLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── comboForceLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── concentricLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── dagreLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── forceAtlas2Layout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── forceLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── fruchtermanLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── gForceLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── gridLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── mdsLayout/ │ │ │ │ │ └── index.ts │ │ │ │ ├── radialLayout/ │ │ │ │ │ └── index.ts │ │ │ │ └── randomLayout/ │ │ │ │ └── index.ts │ │ │ ├── global.ts │ │ │ ├── graph/ │ │ │ │ ├── controller/ │ │ │ │ │ ├── event.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── layout.ts │ │ │ │ └── graph.ts │ │ │ ├── index.ts │ │ │ ├── index.umd.ts │ │ │ ├── interface/ │ │ │ │ └── graph.ts │ │ │ ├── layout/ │ │ │ │ └── index.ts │ │ │ ├── plugin/ │ │ │ │ ├── base.ts │ │ │ │ └── index.ts │ │ │ ├── types/ │ │ │ │ └── index.ts │ │ │ └── util/ │ │ │ ├── color.ts │ │ │ ├── index.ts │ │ │ └── layout.ts │ │ ├── stories/ │ │ │ ├── algorithm/ │ │ │ │ ├── dfs/ │ │ │ │ │ ├── data.ts │ │ │ │ │ └── index.tsx │ │ │ │ ├── index.stories.tsx │ │ │ │ └── shortestPath/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── fruchterman/ │ │ │ │ └── index.tsx │ │ │ ├── g-force/ │ │ │ │ └── index.tsx │ │ │ ├── generalGraph/ │ │ │ │ └── dagreConfigurationTranslate/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── index.stories.tsx │ │ │ ├── interactive/ │ │ │ │ └── collapseSlibing/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── nodeDemo/ │ │ │ │ ├── data.ts │ │ │ │ ├── index.tsx │ │ │ │ ├── node.ts │ │ │ │ └── uiNode.ts │ │ │ ├── pluginBundling/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginEdgeFilter/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginFisheye/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginLegend/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginMenu/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginMiniMap/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginTooltip/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── pluginZoomSlider/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── sceneCase/ │ │ │ │ └── mindMap/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ ├── snapLine/ │ │ │ │ ├── data.ts │ │ │ │ └── index.tsx │ │ │ └── uiTest/ │ │ │ ├── data.ts │ │ │ └── index.tsx │ │ └── vite.config.ts │ ├── f6-alipay/ │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── babel.config.js │ │ ├── demo/ │ │ │ ├── app.acss │ │ │ ├── app.js │ │ │ ├── app.json │ │ │ ├── mini.project.json │ │ │ ├── package.json │ │ │ └── pages/ │ │ │ ├── g6/ │ │ │ │ ├── g6.acss │ │ │ │ ├── g6.axml │ │ │ │ ├── g6.js │ │ │ │ └── g6.json │ │ │ ├── image/ │ │ │ │ ├── image.acss │ │ │ │ ├── image.axml │ │ │ │ ├── image.js │ │ │ │ └── image.json │ │ │ ├── native-canvas/ │ │ │ │ ├── index.acss │ │ │ │ ├── index.axml │ │ │ │ ├── index.js │ │ │ │ └── index.json │ │ │ ├── native-test/ │ │ │ │ ├── native-test.acss │ │ │ │ ├── native-test.axml │ │ │ │ ├── native-test.js │ │ │ │ └── native-test.json │ │ │ └── native-test-fullpage/ │ │ │ ├── index.acss │ │ │ ├── index.axml │ │ │ ├── index.js │ │ │ └── index.json │ │ ├── package.json │ │ ├── scripts/ │ │ │ ├── compiler.js │ │ │ └── pub.js │ │ └── src/ │ │ └── container/ │ │ ├── container.axml │ │ ├── container.json │ │ └── container.ts │ ├── f6-rax/ │ │ ├── README.md │ │ ├── build.json │ │ ├── demo/ │ │ │ └── basic.md │ │ ├── package.json │ │ ├── src/ │ │ │ ├── index.ali.tsx │ │ │ ├── index.css │ │ │ └── index.tsx │ │ └── tsconfig.json │ ├── f6-ui/ │ │ ├── package.json │ │ ├── src/ │ │ │ ├── index.ts │ │ │ ├── om/ │ │ │ │ ├── css.ts │ │ │ │ ├── dom.ts │ │ │ │ └── style.ts │ │ │ ├── parser/ │ │ │ │ └── attr-parser.ts │ │ │ ├── ui-node/ │ │ │ │ ├── UIDivNode.ts │ │ │ │ ├── UIImageNode.ts │ │ │ │ ├── UIRootNode.ts │ │ │ │ ├── UIShapeNode.ts │ │ │ │ ├── UITextNode.ts │ │ │ │ ├── base.ts │ │ │ │ ├── factory.ts │ │ │ │ └── index.ts │ │ │ └── utils/ │ │ │ ├── index.ts │ │ │ ├── parser.ts │ │ │ └── ui.ts │ │ └── vite.config.ts │ ├── f6-wx/ │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── package.json │ │ └── src/ │ │ ├── canvas/ │ │ │ ├── canvas.js │ │ │ ├── canvas.json │ │ │ └── canvas.wxml │ │ ├── container/ │ │ │ ├── container.js │ │ │ ├── container.json │ │ │ └── container.wxml │ │ ├── extends/ │ │ │ ├── graph/ │ │ │ │ └── treeGraph.js │ │ │ └── layout/ │ │ │ ├── circularLayout.js │ │ │ ├── comboForceLayout.js │ │ │ ├── concentricLayout.js │ │ │ ├── dagreLayout.js │ │ │ ├── forceAtlas2Layout.js │ │ │ ├── forceLayout.js │ │ │ ├── fruchtermanLayout.js │ │ │ ├── gForceLayout.js │ │ │ ├── gridLayout.js │ │ │ ├── mdsLayout.js │ │ │ ├── radialLayout.js │ │ │ └── randomLayout.js │ │ └── index.js │ ├── hammer/ │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── package.json │ │ ├── src/ │ │ │ ├── hammer.js │ │ │ ├── index.js │ │ │ ├── input/ │ │ │ │ ├── pointerevent.js │ │ │ │ └── touch.js │ │ │ ├── inputjs/ │ │ │ │ ├── compute-delta-xy.js │ │ │ │ ├── compute-input-data.js │ │ │ │ ├── compute-interval-input-data.js │ │ │ │ ├── create-input-instance.js │ │ │ │ ├── get-angle.js │ │ │ │ ├── get-center.js │ │ │ │ ├── get-direction.js │ │ │ │ ├── get-distance.js │ │ │ │ ├── get-rotation.js │ │ │ │ ├── get-scale.js │ │ │ │ ├── get-velocity.js │ │ │ │ ├── input-constructor.js │ │ │ │ ├── input-consts.js │ │ │ │ ├── input-handler.js │ │ │ │ └── simple-clone-input-data.js │ │ │ ├── manager.js │ │ │ ├── recognizerjs/ │ │ │ │ ├── direction-str.js │ │ │ │ ├── get-recognizer-by-name-if-manager.js │ │ │ │ ├── recognizer-constructor.js │ │ │ │ ├── recognizer-consts.js │ │ │ │ └── state-str.js │ │ │ ├── recognizers/ │ │ │ │ ├── attribute.js │ │ │ │ ├── pan.js │ │ │ │ ├── pinch.js │ │ │ │ ├── press.js │ │ │ │ ├── rotate.js │ │ │ │ ├── swipe.js │ │ │ │ └── tap.js │ │ │ ├── touchactionjs/ │ │ │ │ ├── clean-touch-actions.js │ │ │ │ ├── get-touchaction-props.js │ │ │ │ ├── touchaction-Consts.js │ │ │ │ └── touchaction-constructor.js │ │ │ └── utils/ │ │ │ ├── add-event-listeners.js │ │ │ ├── assign.js │ │ │ ├── bind-fn.js │ │ │ ├── bool-or-fn.js │ │ │ ├── deprecate.js │ │ │ ├── each.js │ │ │ ├── extend.js │ │ │ ├── has-parent.js │ │ │ ├── if-undefined.js │ │ │ ├── in-array.js │ │ │ ├── in-str.js │ │ │ ├── inherit.js │ │ │ ├── invoke-array-arg.js │ │ │ ├── merge.js │ │ │ ├── remove-event-listeners.js │ │ │ ├── set-timeout-context.js │ │ │ ├── split-str.js │ │ │ ├── to-array.js │ │ │ ├── unique-array.js │ │ │ ├── unique-id.js │ │ │ └── utils-consts.js │ │ └── vite.config.ts │ ├── plugin/ │ │ ├── package.json │ │ ├── src/ │ │ │ ├── base.ts │ │ │ ├── bundling/ │ │ │ │ └── index.ts │ │ │ ├── edge-filter-lens/ │ │ │ │ └── index.ts │ │ │ ├── fisheye/ │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ ├── legend/ │ │ │ │ ├── index.ts │ │ │ │ └── item.ts │ │ │ ├── menu/ │ │ │ │ └── index.ts │ │ │ ├── minimap/ │ │ │ │ └── index.ts │ │ │ ├── snap-line/ │ │ │ │ └── index.ts │ │ │ ├── time-bar/ │ │ │ │ ├── dispatcher.ts │ │ │ │ ├── index.ts │ │ │ │ ├── type/ │ │ │ │ │ ├── control-bar.ts │ │ │ │ │ ├── slider.ts │ │ │ │ │ ├── tick.ts │ │ │ │ │ └── time-bar.ts │ │ │ │ ├── ui/ │ │ │ │ │ ├── control-bar/ │ │ │ │ │ │ ├── control-btn.ts │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ └── play-btn.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── progress-bar/ │ │ │ │ │ │ ├── index.ts │ │ │ │ │ │ ├── tick.ts │ │ │ │ │ │ └── trend.ts │ │ │ │ │ └── slider/ │ │ │ │ │ ├── simple-slider.ts │ │ │ │ │ ├── slide-ticker.ts │ │ │ │ │ ├── slider-logic.ts │ │ │ │ │ └── trend-slider.ts │ │ │ │ └── utils/ │ │ │ │ ├── const.ts │ │ │ │ ├── path.ts │ │ │ │ └── player.ts │ │ │ ├── tooltip/ │ │ │ │ ├── css.ts │ │ │ │ ├── html.ts │ │ │ │ └── index.ts │ │ │ └── zoom-slider/ │ │ │ └── index.ts │ │ └── vite.config.ts │ └── site/ │ ├── CNAME │ ├── api-extractor.json │ ├── circle-dragging-i/ │ │ ├── 989198863e10b38a@125.js │ │ ├── LICENSE.txt │ │ ├── index.html │ │ ├── index.js │ │ ├── inspector.css │ │ ├── package.json │ │ └── runtime.js │ ├── docs/ │ │ ├── api/ │ │ │ ├── Algorithm.zh.md │ │ │ ├── Behavior.zh.md │ │ │ ├── Event.zh.md │ │ │ ├── Graph.zh.md │ │ │ ├── Group.zh.md │ │ │ ├── Items/ │ │ │ │ ├── comboMethods.zh.md │ │ │ │ ├── comboProperties.zh.md │ │ │ │ ├── edgeMethods.zh.md │ │ │ │ ├── edgeProperties.zh.md │ │ │ │ ├── itemMethods.zh.md │ │ │ │ ├── itemProperties.zh.md │ │ │ │ ├── nodeMethods.zh.md │ │ │ │ └── nodeProperties.zh.md │ │ │ ├── Plugins.zh.md │ │ │ ├── TreeGraph.zh.md │ │ │ ├── Util.zh.md │ │ │ ├── graphFunc/ │ │ │ │ ├── animation.zh.md │ │ │ │ ├── behaviors.zh.md │ │ │ │ ├── calculation.zh.md │ │ │ │ ├── combo.zh.md │ │ │ │ ├── coordinate.zh.md │ │ │ │ ├── data.zh.md │ │ │ │ ├── destroy.zh.md │ │ │ │ ├── download.zh.md │ │ │ │ ├── find.zh.md │ │ │ │ ├── get_set.zh.md │ │ │ │ ├── hull.zh.md │ │ │ │ ├── item.zh.md │ │ │ │ ├── layout.zh.md │ │ │ │ ├── mode.zh.md │ │ │ │ ├── on_off.zh.md │ │ │ │ ├── render.zh.md │ │ │ │ ├── stack.zh.md │ │ │ │ ├── state.zh.md │ │ │ │ ├── transform.zh.md │ │ │ │ └── watermarker.zh.md │ │ │ ├── graphLayout/ │ │ │ │ ├── circular.zh.md │ │ │ │ ├── comboForce.zh.md │ │ │ │ ├── concentric.zh.md │ │ │ │ ├── dagre.zh.md │ │ │ │ ├── force.zh.md │ │ │ │ ├── forceAtlas2.zh.md │ │ │ │ ├── fruchterman.zh.md │ │ │ │ ├── gforce.zh.md │ │ │ │ ├── grid.zh.md │ │ │ │ ├── guide.zh.md │ │ │ │ ├── mds.zh.md │ │ │ │ ├── radial.zh.md │ │ │ │ └── random.zh.md │ │ │ ├── registerItem.zh.md │ │ │ ├── registerLayout.zh.md │ │ │ ├── shapeMethods.zh.md │ │ │ ├── shapeProperties.zh.md │ │ │ ├── treeGraphLayout/ │ │ │ │ ├── compactBox.zh.md │ │ │ │ ├── dendrogram.zh.md │ │ │ │ ├── guide.zh.md │ │ │ │ ├── indented.zh.md │ │ │ │ └── mindmap.zh.md │ │ │ └── treeMethods.zh.md │ │ ├── examples/ │ │ │ ├── algorithm/ │ │ │ │ └── algoDemos/ │ │ │ │ └── index.zh.md │ │ │ ├── case/ │ │ │ │ ├── customTree/ │ │ │ │ │ ├── decisiontree.zh.md │ │ │ │ │ └── knowledgetreegraph.zh.md │ │ │ │ ├── newsDemo/ │ │ │ │ │ ├── index.zh.md │ │ │ │ │ └── metroline.zh.md │ │ │ │ └── simpleCase/ │ │ │ │ ├── customflow.zh.md │ │ │ │ ├── donuttransfer.zh.md │ │ │ │ ├── mindmap.zh.md │ │ │ │ └── sankey.zh.md │ │ │ ├── gallery/ │ │ │ │ └── gallery.zh.md │ │ │ ├── interaction/ │ │ │ │ ├── combo/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── createEdge/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── customBehavior/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── dragCanvasHideItem/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── fitView/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── highlight/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── hull/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── label/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── pagination/ │ │ │ │ │ └── index.zh.md │ │ │ │ ├── partialResponse/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── position/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── select/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── setMode/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── treeBehavior/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ └── zoomCanvasFixItem/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── item/ │ │ │ │ ├── arrows/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── customCombo/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── customEdge/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── customNode/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── defaultCombos/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── defaultEdges/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── defaultNodes/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── label/ │ │ │ │ │ └── index.zh.md │ │ │ │ ├── labelBg/ │ │ │ │ │ └── index.zh.md │ │ │ │ └── multiEdge/ │ │ │ │ └── index.zh.md │ │ │ ├── net/ │ │ │ │ ├── arcDiagram/ │ │ │ │ │ └── index.zh.md │ │ │ │ ├── circular/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── comboForce/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── concentricLayout/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── dagreFlow/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── forceDirected/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── furchtermanLayout/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── gridLayout/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── layoutMechanism/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── mdsLayout/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ └── radialLayout/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── scatter/ │ │ │ │ ├── changePosition/ │ │ │ │ │ └── index.zh.md │ │ │ │ ├── customAnimate/ │ │ │ │ │ └── index.zh.md │ │ │ │ ├── edge/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ ├── node/ │ │ │ │ │ ├── API.zh.md │ │ │ │ │ └── index.zh.md │ │ │ │ └── stateChange/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ └── tree/ │ │ │ ├── compactBox/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── customItemTree/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── dendrogram/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── indented/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ ├── mindmap/ │ │ │ │ ├── API.zh.md │ │ │ │ └── index.zh.md │ │ │ └── radialtree/ │ │ │ ├── API.zh.md │ │ │ └── index.zh.md │ │ └── manual/ │ │ ├── FAQ/ │ │ │ └── faq.zh.md │ │ ├── advanced/ │ │ │ ├── comboTheory.zh.md │ │ │ ├── coordinate-system.zh.md │ │ │ ├── iconfont.zh.md │ │ │ ├── mode-and-custom-behavior.zh.md │ │ │ └── state-new.zh.md │ │ ├── cases/ │ │ │ ├── edgeBundling.zh.md │ │ │ ├── relations.zh.md │ │ │ └── sequenceTime.zh.md │ │ ├── getting-started.zh.md │ │ ├── introduction.zh.md │ │ ├── middle/ │ │ │ ├── animation.zh.md │ │ │ ├── elements/ │ │ │ │ ├── advanced-style/ │ │ │ │ │ ├── gradient.zh.md │ │ │ │ │ ├── set-label-bg.zh.md │ │ │ │ │ ├── texture.zh.md │ │ │ │ │ └── updateText.zh.md │ │ │ │ ├── combos/ │ │ │ │ │ ├── built-in/ │ │ │ │ │ │ ├── circle.zh.md │ │ │ │ │ │ └── rect.zh.md │ │ │ │ │ ├── custom-combo.zh.md │ │ │ │ │ └── defaultCombo.zh.md │ │ │ │ ├── edges/ │ │ │ │ │ ├── arrow.zh.md │ │ │ │ │ ├── built-in/ │ │ │ │ │ │ ├── arc.zh.md │ │ │ │ │ │ ├── cubic.zh.md │ │ │ │ │ │ ├── line.zh.md │ │ │ │ │ │ ├── loop.zh.md │ │ │ │ │ │ ├── polyline.zh.md │ │ │ │ │ │ └── quadratic.zh.md │ │ │ │ │ ├── custom-edge.zh.md │ │ │ │ │ └── defaultEdge.zh.md │ │ │ │ ├── methods/ │ │ │ │ │ ├── edgeVisible.zh.md │ │ │ │ │ ├── elementIndex.zh.md │ │ │ │ │ ├── lock-node.zh.md │ │ │ │ │ ├── multi-line.zh.md │ │ │ │ │ └── updateElement.zh.md │ │ │ │ ├── nodes/ │ │ │ │ │ ├── anchorpoint.zh.md │ │ │ │ │ ├── built-in/ │ │ │ │ │ │ ├── circle.zh.md │ │ │ │ │ │ ├── diamond.zh.md │ │ │ │ │ │ ├── donut.zh.md │ │ │ │ │ │ ├── ellipse.zh.md │ │ │ │ │ │ ├── image.zh.md │ │ │ │ │ │ ├── modelRect.zh.md │ │ │ │ │ │ ├── rect.zh.md │ │ │ │ │ │ ├── star.zh.md │ │ │ │ │ │ └── triangle.zh.md │ │ │ │ │ ├── custom-node.zh.md │ │ │ │ │ ├── defaultNode.zh.md │ │ │ │ │ └── jsx-node.zh.md │ │ │ │ ├── overview.zh.md │ │ │ │ └── shape/ │ │ │ │ ├── graphics-group.zh.md │ │ │ │ ├── shape-and-properties.zh.md │ │ │ │ ├── shape-keyshape.zh.md │ │ │ │ └── transform.zh.md │ │ │ ├── graph.zh.md │ │ │ ├── layout/ │ │ │ │ ├── ai-layout.zh.md │ │ │ │ ├── custom-layout.zh.md │ │ │ │ ├── graph-layout.zh.md │ │ │ │ ├── layout-mechanism.zh.md │ │ │ │ ├── sub-layout-pipe.zh.md │ │ │ │ ├── sub-layout.zh.md │ │ │ │ ├── tree-graph-layout.zh.md │ │ │ │ └── webworker.zh.md │ │ │ ├── overview.zh.md │ │ │ ├── plugins/ │ │ │ │ └── Plugins.zh.md │ │ │ └── states/ │ │ │ ├── bindEvent.zh.md │ │ │ ├── custom-behavior.zh.md │ │ │ ├── defaultBehavior.zh.md │ │ │ ├── mode.zh.md │ │ │ └── state.zh.md │ │ └── tutorial/ │ │ ├── h5/ │ │ │ └── preface.zh.md │ │ ├── mini/ │ │ │ ├── animation.zh.md │ │ │ ├── behavior.zh.md │ │ │ ├── elements.zh.md │ │ │ ├── epilog.zh.md │ │ │ ├── example.zh.md │ │ │ ├── layout.zh.md │ │ │ ├── preface.zh.md │ │ │ └── wechat.zh.md │ │ ├── native/ │ │ │ └── preface.zh.md │ │ └── tutorial.zh.md │ ├── examples/ │ │ └── demo/ │ │ ├── animation/ │ │ │ ├── change-position-default/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── custom-animate-position/ │ │ │ │ └── index.js │ │ │ ├── edge-edge/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── edge-line-growth/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── node-node/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── point-in-line/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── elements/ │ │ │ ├── area-chart/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── built-in-arrows/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── c-circle/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── c-rect/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── card/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── card-node/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── circle/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── circle-with-combo/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── cubic1/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── cubic2/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── custom-arrows/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── custom-polyline/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── custom-polyline2/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── diamond/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── donut/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── edge-bg/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── edge-mul-label/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── ellipse/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── extra-shape/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── image/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── label-len/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── label-len1/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── line-chart/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── list/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── loop/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── mode-rect/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── multi-edges/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── node-bg/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── pie-chart/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── point-chart/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── polyline1/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── polyline2/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── polyline3/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── rect/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── rect-with-combo/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── stack-chart/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── star/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── triangle/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── general-graph/ │ │ │ ├── basic-FA2/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-MDS/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-circular/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-combo-force/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-concentric/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-dagre/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-force-directed/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-force-directed-drag-fix/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-grid/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── basic-radial/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── circular-arc-diagram/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── circular-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── cluster-grid/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── custom-bi-graph/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── dagre/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── dagre-UL/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── dagre-combo/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── dagre-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── data-change/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── degree-circular/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── division-circular/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-bubbles/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-constrained-in-rect/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-directed-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-directed-force-clustering/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-directed-functional-params/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── force-directed-prevent-overlap/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── fruchterman/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── fruchterman-clustering/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── fruchterman-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── fruchterman-worker/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── interact-radial/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── layout-timing/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── layout-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── prevent-overlap-radial/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── prevent-overlap-unstrict-radial/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── radial-configuration-translate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── sort-radial/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── spiral-circular/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── subgraph-layout/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── sublayout-pipes/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── interactive/ │ │ │ ├── activate-relations/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── add-child/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── canvas-two-fingers/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── change-data/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── change-members/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── collapse-slibing/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── combo-circle/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── combo-rect/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── drag-subtree/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── hide-item/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── highlight-dark/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── hull/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── move/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── move-animate/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── partial-node/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── plugins/ │ │ │ ├── bundling/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── donut-transfer/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── edge-filter/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── fisheye/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── menu/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── mini-map/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── snap-line/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── timebar/ │ │ │ │ └── index.js │ │ │ ├── tool-tip/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── zoom-slider/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── scene-case/ │ │ │ ├── custom-flow/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── decision-tree/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── donut-transfer/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── knowledge-tree-graph/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── metro-lines/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ ├── mind-map/ │ │ │ │ ├── data.js │ │ │ │ └── index.js │ │ │ └── sankey/ │ │ │ ├── data.js │ │ │ └── index.js │ │ └── tree-graph/ │ │ ├── basic-dendrogram/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── compact-box/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── compact-box-left-align/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── custom-edge-tree/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── custom-side-mind-map/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── custom-tree/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── file-system/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── intend-align-top/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── intended/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── left-mind-map/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── mind-map/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── radial-compact-box/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── radial-dendrogram/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── right-mind-map/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── tb-compact-box/ │ │ │ ├── data.js │ │ │ └── index.js │ │ ├── tb-dendrogram/ │ │ │ ├── data.js │ │ │ └── index.js │ │ └── tree-edge-label/ │ │ ├── data.js │ │ └── index.js │ ├── gatsby-browser.js │ ├── gatsby-config.js │ ├── gatsby-node.js │ ├── package.json │ └── site/ │ ├── global.less │ ├── locale.json │ └── pages/ │ ├── canvas-menu.tsx │ ├── index.en.tsx │ ├── index.less │ ├── index.zh.tsx │ ├── large-graph-register.tsx │ ├── largegraph.en.tsx │ ├── largegraph.zh.tsx │ └── legend-panel.tsx ├── rush.json └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .browserslistrc ================================================ # Browsers that we support [production staging] > 1% last 2 version ie 11 [development] > 1% last 2 version ================================================ FILE: .gitattributes ================================================ # Don't allow people to merge changes to these generated files, because the result # may be invalid. You need to run "rush update" again. pnpm-lock.yaml merge=text shrinkwrap.yaml merge=binary npm-shrinkwrap.json merge=binary yarn.lock merge=binary # Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic # syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor # may also require a special configuration to allow comments in JSON. # # For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088 # *.json linguist-language=JSON-with-Comments ================================================ FILE: .gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* yarn.lock es .mini-ide/ # lock package-lock.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Typescript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env build dist temp .DS_Store .idea demos lib *.sw* *.un~ # cache *.cache public esm es .github # .storybook .vscode/ stats.json .nx/cache .nx/workspace-data # Logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* .pnpm-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov/ # Coverage directory used by tools like istanbul coverage/ # nyc test coverage .nyc_output/ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt/ # Bower dependency directory (https://bower.io/) bower_components/ # node-waf configuration .lock-wscript/ # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release/ # Dependency directories node_modules/ jspm_packages/ # TypeScript cache *.tsbuildinfo # Optional npm cache directory .npm/ # Optional eslint cache .eslintcache/ # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.development.local .env.test.local .env.production.local .env.local # next.js build output .next/ # Docusaurus cache and generated files .docusaurus/ # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # yarn v2 .yarn/cache/ .yarn/unplugged/ .yarn/build-state.yml .yarn/install-state.gz .pnp.* # OS X temporary files .DS_Store/ # IntelliJ IDEA project files; if you want to commit IntelliJ settings, this recipe may be helpful: # https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore .idea/ *.iml # Visual Studio Code .vscode/ !.vscode/tasks.json !.vscode/launch.json # Rush temporary files common/deploy/ common/temp/ common/autoinstallers/*/.npmrc **/.rush/temp/ *.lock # Common toolchain intermediate files temp/ lib/ lib-amd/ lib-es6/ lib-esnext/ lib-commonjs/ lib-shim/ dist/ dist-storybook/ *.tsbuildinfo # Heft temporary files .cache/ .heft/ pnpm-lock.yaml ================================================ FILE: .npmignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # lock package-lock.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Typescript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .DS_Store # npmignore - content above this line is automatically generated and modifications may be omitted # see npmjs.com/npmignore for more details. test *.sw* *.un~ .idea bin demos docs temp webpack-dev.config.js webpack.config.js public .cache site examples gatsby-browser.js gatsby-config.js ================================================ FILE: .prettierrc ================================================ {} ================================================ FILE: .stylelintrc.json ================================================ { "extends": ["stylelint-prettier/recommended", "stylelint-config-standard"], "customSyntax": "postcss-lit" } ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - '12' env: - NODE_ENV=test addons: apt: packages: - xvfb - libgconf-2-4 install: - export DISPLAY=':99.0' - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - yarn script: - | if [ "$TEST_TYPE" = test ]; then yarn ci && bash <(curl -s https://codecov.io/bash) else yarn $TEST_TYPE fi env: matrix: - TEST_TYPE=lint - TEST_TYPE=test ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2018 Alipay.inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README-zh-CN.md ================================================ # F6:移动端图可视化引擎 ![](https://gw.alipayobjects.com/mdn/rms_5c3b4a/afts/img/A*KV1pSIPeJPAAAAAAAAAAAAAAARQnAQ) [![travis-ci](https://img.shields.io/travis/antvis/f6.svg)](https://travis-ci.org/antvis/f6) [![codecov](https://codecov.io/gh/antvis/f6/branch/master/graph/badge.svg)](https://codecov.io/gh/antvis/f6) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/f6.svg)](https://www.npmjs.com/package/@antv/f6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/f6.svg)](https://npmjs.org/package/@antv/f6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/f6.svg)](http://isitmaintained.com/project/antvis/f6 "Percentage of issues still open") [English](./README-en-US.md) | 简体中文 ## 欢迎扫码体验 img ## 什么是 F6 F6 是一款可以快速、流畅运行于移动设备中的图可视化引擎,通过丰富的布局、组件及分析能力,帮助用户落地跨平台的图可视化应用解决方案。在 H5、小程序等移动端平台上,对包体积、性能有更高的要求,也需要定义一套合适的交互模式。针对以上问题,我们在 G6 的基础上重新设计并构建了 F6。F6 不仅具有基础的关联图绘制、事件、动画,同时内置了常用的移动端交互模式、丰富的布局和分析组件,通过简单的配置即可使用。 img 如果您还没有使用过 F6, 建议通过 [快速上手](https://f6.antv.vision/zh/docs/manual/getting-started) 抢先体验 F6 的魅力。 ## F6 文档 - [F6 入门教程](https://f6.antv.vision/zh/docs/manual/introduction) - [F6 核心概念](https://f6.antv.vision/zh/docs/manual/middle/overview) - [F6 扩展阅读](https://f6.antv.vision/zh/docs/manual/advanced/coordinate-system) - [API](https://f6.antv.vision/zh/docs/api/Graph) - [示例](https://f6.antv.vision/zh/docs/examples/tree/compactBox) ## 安装 ```bash $ npm install @antv/f6 ``` ## 使用 - demo ```js import F6 from "@antv/f6"; import graphData from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; F6.registerLayout("dagreLayout", dagreLayout); F6.registerGraph("TreeGraph", TreeGraph); Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio: pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { this.graph = new F6.TreeGraph({ context: ctx, renderer, width: this.data.width, height: this.data.height, linkCenter: true, modes: { default: ["drag-canvas", "zoom-canvas"], }, defaultNode: { size: 40, }, layout: { type: "compactBox", direction: "RL", getId: function getId(d) { return d.id; }, getHeight: () => { return 26; }, getWidth: () => { return 26; }, getVGap: () => { return 20; }, getHGap: () => { return 30; }, radial: false, }, }); this.graph.node(function (node) { return { label: node.id, }; }); this.graph.data(graphData); this.graph.render(); this.graph.fitView(); }, onTouch(e) { this.graph.emitEvent(e); }, onUnload() { this.graph?.destroy(); }, }); ``` ## 如何开发 ```bash $ npm install -g @microsoft/rush # update dependencies $ rush update # build the packages $ rush build # demo $ cd packages/f6 && rushx storybook ``` 更详细的内容请参考 [快速上手](https://f6.antv.vision/zh/docs/manual/getting-started) 文档。 ## 如何贡献 请让我们知道您要解决或贡献什么,所以在贡献之前请先提交 issues 描述 bug 或建议。 成为一个贡献者前请阅读 代码贡献规范。 ## License MIT license。 ================================================ FILE: README.md ================================================ # F6: A Mobile Graph Visualization Framework in TypeScript. ![](https://gw.alipayobjects.com/mdn/rms_5c3b4a/afts/img/A*KV1pSIPeJPAAAAAAAAAAAAAAARQnAQ) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/f6.svg)](https://www.npmjs.com/package/@antv/f6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/f6.svg)](https://npmjs.org/package/@antv/f6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/f6.svg)](http://isitmaintained.com/project/antvis/f6 "Percentage of issues still open") English | [简体中文](./README-zh-CN.md) ## What is F6 [F6](https://github.com/antvis/f6) is a mobile graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. F6 aims to simplify the relationships, and help people to obtain the insight of relational data. Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily. ![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ) > Powerful Animation and Interactions ## Features - Abundant Built-in Items: Nodes and edges with free configurations; - Steerable Interactions: More than 10 basic interaction behaviors ; - Powerful Layout: More than 10 layout algorithms; - Convenient Components: Outstanding ability and performance; - Friendly User Experience: Complete documents for different levels of user requirements. TypeScript supported. F6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customazation requirements. > Abundant Built-in Items ## Installation ```bash $ npm install @antv/f6 ``` ## Usage - demo ```js import F6 from "@antv/f6"; import graphData from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; F6.registerLayout("dagreLayout", dagreLayout); F6.registerGraph("TreeGraph", TreeGraph); Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio: pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { this.graph = new F6.TreeGraph({ context: ctx, renderer, width: this.data.width, height: this.data.height, linkCenter: true, modes: { default: ["drag-canvas", "zoom-canvas"], }, defaultNode: { size: 40, }, layout: { type: "compactBox", direction: "RL", getId: function getId(d) { return d.id; }, getHeight: () => { return 26; }, getWidth: () => { return 26; }, getVGap: () => { return 20; }, getHGap: () => { return 30; }, radial: false, }, }); this.graph.node(function (node) { return { label: node.id, }; }); this.graph.data(graphData); this.graph.render(); this.graph.fitView(); }, onTouch(e) { this.graph.emitEvent(e); }, onUnload() { this.graph?.destroy(); }, }); ``` For more information of the usage, please refer to [Getting Started](https://antv-f6.gitee.io/en/docs/manual/getting-started). ## Development ```bash $ npm install -g @microsoft/rush # update dependencies $ rush update # build the packages $ rush build # demo $ cd packages/f6 && rushx storybook ``` ## Documents - Tutorial - Middle Guides - Further Reading - API Reference ## How to Contribute Please let us know what you are you going to help. Do check out [issues](https://github.com/antvis/f6/issues) for bug reports or suggestions first. To become a contributor, please follow our [contributing guide](https://github.com/antvis/f6/blob/master/packages/f6/CONTRIBUTING.md). ## License [MIT license](./LICENSE). ================================================ FILE: SECURITY.md ================================================ # Security Policy ## Introduction This security policy outlines how to report and handle security vulnerabilities in our project. ## Reporting a Vulnerability If you discover a potential security vulnerability, please email us at [openwayne@gmail.com](mailto:openwayne@gmail.com) with the details. To protect our users, we request that you do not publicly disclose the vulnerability until it has been addressed. When reporting a vulnerability, please include as much of the following information as possible: - A detailed description of the vulnerability - Steps to reproduce the issue - Any relevant logs or screenshots - Your contact information (optional) We will acknowledge your report within 7 days and provide a preliminary response. ## Response Process Upon receiving a vulnerability report, we will: 1. Acknowledge receipt of the report within 7 days. 2. Assess the severity and impact of the vulnerability. 3. Develop and test a fix. 4. Release a security update once the vulnerability is fixed. 5. If necessary, issue a security advisory to inform users. We aim to address all critical vulnerabilities within 30 days. If a fix takes longer, we will provide updates on the progress to the reporter. ## Security Advisories We will publish all security advisories on the [project's releases page](https://github.com/antvis/F6/releases). Please check this page regularly to ensure your version is up-to-date and secure. ## Responsible Disclosure We ask that all reporters practice responsible disclosure by not publicly disclosing vulnerability details until a fix has been made. We believe responsible disclosure helps ensure the safety of our users while giving the development team adequate time to address the issue. ================================================ FILE: binding.gyp ================================================ { "targets": [ { "target_name": "binding", "sources": [ "src/binding.cc" ] } ] } ================================================ FILE: common/autoinstallers/rush-prettier/package.json ================================================ { "name": "rush-prettier", "version": "1.0.0", "private": true, "dependencies": {}, "repository": "git@github.com:antvis/F6.git", "dependencies": { "prettier": "^3.3.2", "pretty-quick": "^4.0.0" } } ================================================ FILE: common/config/rush/.npmrc ================================================ # Rush uses this file to configure the NPM package registry during installation. It is applicable # to PNPM, NPM, and Yarn package managers. It is used by operations such as "rush install", # "rush update", and the "install-run.js" scripts. # # NOTE: The "rush publish" command uses .npmrc-publish instead. # # Before invoking the package manager, Rush will generate an .npmrc in the folder where installation # is performed. This generated file will omit any config lines that reference environment variables # that are undefined in that session; this avoids problems that would otherwise result due to # a missing variable being replaced by an empty string. # # If "subspacesEnabled" is true in subspaces.json, the generated file will merge settings from # "common/config/rush/.npmrc" and "common/config/subspaces//.npmrc", with the latter taking # precedence. # # * * * SECURITY WARNING * * * # # It is NOT recommended to store authentication tokens in a text file on a lab machine, because # other unrelated processes may be able to read that file. Also, the file may persist indefinitely, # for example if the machine loses power. A safer practice is to pass the token via an # environment variable, which can be referenced from .npmrc using ${} expansion. For example: # # //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN} # registry=https://registry.npmjs.org/ always-auth=false ================================================ FILE: common/config/rush/.npmrc-publish ================================================ # This config file is very similar to common/config/rush/.npmrc, except that .npmrc-publish # is used by the "rush publish" command, as publishing often involves different credentials # and registries than other operations. # # Before invoking the package manager, Rush will copy this file to "common/temp/publish-home/.npmrc" # and then temporarily map that folder as the "home directory" for the current user account. # This enables the same settings to apply for each project folder that gets published. The copied file # will omit any config lines that reference environment variables that are undefined in that session; # this avoids problems that would otherwise result due to a missing variable being replaced by # an empty string. # # * * * SECURITY WARNING * * * # # It is NOT recommended to store authentication tokens in a text file on a lab machine, because # other unrelated processes may be able to read the file. Also, the file may persist indefinitely, # for example if the machine loses power. A safer practice is to pass the token via an # environment variable, which can be referenced from .npmrc using ${} expansion. For example: # # //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN} # ================================================ FILE: common/config/rush/.pnpmfile.cjs ================================================ "use strict"; /** * When using the PNPM package manager, you can use pnpmfile.js to workaround * dependencies that have mistakes in their package.json file. (This feature is * functionally similar to Yarn's "resolutions".) * * For details, see the PNPM documentation: * https://pnpm.js.org/docs/en/hooks.html * * IMPORTANT: SINCE THIS FILE CONTAINS EXECUTABLE CODE, MODIFYING IT IS LIKELY TO INVALIDATE * ANY CACHED DEPENDENCY ANALYSIS. After any modification to pnpmfile.js, it's recommended to run * "rush update --full" so that PNPM will recalculate all version selections. */ module.exports = { hooks: { readPackage, }, }; /** * This hook is invoked during installation before a package's dependencies * are selected. * The `packageJson` parameter is the deserialized package.json * contents for the package that is about to be installed. * The `context` parameter provides a log() function. * The return value is the updated object. */ function readPackage(packageJson, context) { // // The karma types have a missing dependency on typings from the log4js package. // if (packageJson.name === '@types/karma') { // context.log('Fixed up dependencies for @types/karma'); // packageJson.dependencies['log4js'] = '0.6.38'; // } return packageJson; } ================================================ FILE: common/config/rush/artifactory.json ================================================ /** * This configuration file manages Rush integration with JFrog Artifactory services. * More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/artifactory.schema.json", "packageRegistry": { /** * (Required) Set this to "true" to enable Rush to manage tokens for an Artifactory NPM registry. * When enabled, "rush install" will automatically detect when the user's ~/.npmrc * authentication token is missing or expired. And "rush setup" will prompt the user to * renew their token. * * The default value is false. */ "enabled": false, /** * (Required) Specify the URL of your NPM registry. This is the same URL that appears in * your .npmrc file. It should look something like this example: * * https://your-company.jfrog.io/your-project/api/npm/npm-private/ */ "registryUrl": "", /** * A list of custom strings that "rush setup" should add to the user's ~/.npmrc file at the time * when the token is updated. This could be used for example to configure the company registry * to be used whenever NPM is invoked as a standalone command (but it's not needed for Rush * operations like "rush add" and "rush install", which get their mappings from the monorepo's * common/config/rush/.npmrc file). * * NOTE: The ~/.npmrc settings are global for the user account on a given machine, so be careful * about adding settings that may interfere with other work outside the monorepo. */ "userNpmrcLinesToAdd": [ // "@example:registry=https://your-company.jfrog.io/your-project/api/npm/npm-private/" ], /** * (Required) Specifies the URL of the Artifactory control panel where the user can generate * an API key. This URL is printed after the "visitWebsite" message. * It should look something like this example: https://your-company.jfrog.io/ * Specify an empty string to suppress this line entirely. */ "artifactoryWebsiteUrl": "", /** * Uncomment this line to specify the type of credential to save in the user's ~/.npmrc file. * The default is "password", which means the user's API token will be traded in for an * npm password specific to that registry. Optionally you can specify "authToken", which * will save the user's API token as credentials instead. */ // "credentialType": "password", /** * These settings allow the "rush setup" interactive prompts to be customized, for * example with messages specific to your team or configuration. Specify an empty string * to suppress that message entirely. */ "messageOverrides": { /** * Overrides the message that normally says: * "This monorepo consumes packages from an Artifactory private NPM registry." */ // "introduction": "", /** * Overrides the message that normally says: * "Please contact the repository maintainers for help with setting up an Artifactory user account." */ // "obtainAnAccount": "", /** * Overrides the message that normally says: * "Please open this URL in your web browser:" * * The "artifactoryWebsiteUrl" string is printed after this message. */ // "visitWebsite": "", /** * Overrides the message that normally says: * "Your user name appears in the upper-right corner of the JFrog website." */ // "locateUserName": "", /** * Overrides the message that normally says: * "Click 'Edit Profile' on the JFrog website. Click the 'Generate API Key' * button if you haven't already done so previously." */ // "locateApiKey": "" /** * Overrides the message that normally prompts: * "What is your Artifactory user name?" */ // "userNamePrompt": "" /** * Overrides the message that normally prompts: * "What is your Artifactory API key?" */ // "apiKeyPrompt": "" } } } ================================================ FILE: common/config/rush/build-cache.json ================================================ /** * This configuration file manages Rush's build cache feature. * More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/build-cache.schema.json", /** * (Required) EXPERIMENTAL - Set this to true to enable the build cache feature. * * See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature. */ "buildCacheEnabled": false, /** * (Required) Choose where project build outputs will be cached. * * Possible values: "local-only", "azure-blob-storage", "amazon-s3" */ "cacheProvider": "local-only", /** * Setting this property overrides the cache entry ID. If this property is set, it must contain * a [hash] token. * * Other available tokens: * - [projectName] Example: "@my-scope/my-project" * - [projectName:normalize] Example: "my-scope+my-project" * - [phaseName] Example: "_phase:test/api" * - [phaseName:normalize] Example: "_phase:test+api" * - [phaseName:trimPrefix] Example: "test/api" * - [os] Example: "win32" * - [arch] Example: "x64" */ // "cacheEntryNamePattern": "[projectName:normalize]-[phaseName:normalize]-[hash]" /** * Use this configuration with "cacheProvider"="azure-blob-storage" */ "azureBlobStorageConfiguration": { /** * (Required) The name of the the Azure storage account to use for build cache. */ // "storageAccountName": "example", /** * (Required) The name of the container in the Azure storage account to use for build cache. */ // "storageContainerName": "my-container", /** * The Azure environment the storage account exists in. Defaults to AzurePublicCloud. * * Possible values: "AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment" */ // "azureEnvironment": "AzurePublicCloud", /** * An optional prefix for cache item blob names. */ // "blobPrefix": "my-prefix", /** * If set to true, allow writing to the cache. Defaults to false. */ // "isCacheWriteAllowed": true }, /** * Use this configuration with "cacheProvider"="amazon-s3" */ "amazonS3Configuration": { /** * (Required unless s3Endpoint is specified) The name of the bucket to use for build cache. * Example: "my-bucket" */ // "s3Bucket": "my-bucket", /** * (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache. * This should not include any path; use the s3Prefix to set the path. * Examples: "my-bucket.s3.us-east-2.amazonaws.com" or "http://localhost:9000" */ // "s3Endpoint": "https://my-bucket.s3.us-east-2.amazonaws.com", /** * (Required) The Amazon S3 region of the bucket to use for build cache. * Example: "us-east-1" */ // "s3Region": "us-east-1", /** * An optional prefix ("folder") for cache items. It should not start with "/". */ // "s3Prefix": "my-prefix", /** * If set to true, allow writing to the cache. Defaults to false. */ // "isCacheWriteAllowed": true }, /** * Use this configuration with "cacheProvider"="http" */ "httpConfiguration": { /** * (Required) The URL of the server that stores the caches. * Example: "https://build-cacches.example.com/" */ // "url": "https://build-cacches.example.com/", /** * (Optional) The HTTP method to use when writing to the cache (defaults to PUT). * Should be one of PUT, POST, or PATCH. * Example: "PUT" */ // "uploadMethod": "PUT", /** * (Optional) HTTP headers to pass to the cache server. * Example: { "X-HTTP-Company-Id": "109283" } */ // "headers": {}, /** * (Optional) Shell command that prints the authorization token needed to communicate with the * cache server, and exits with exit code 0. This command will be executed from the root of * the monorepo. * Example: { "exec": "node", "args": ["common/scripts/auth.js"] } */ // "tokenHandler": { "exec": "node", "args": ["common/scripts/auth.js"] }, /** * (Optional) Prefix for cache keys. * Example: "my-company-" */ // "cacheKeyPrefix": "", /** * (Optional) If set to true, allow writing to the cache. Defaults to false. */ // "isCacheWriteAllowed": true } } ================================================ FILE: common/config/rush/cobuild.json ================================================ /** * This configuration file manages Rush's cobuild feature. * More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/cobuild.schema.json", /** * (Required) EXPERIMENTAL - Set this to true to enable the cobuild feature. * RUSH_COBUILD_CONTEXT_ID should always be specified as an environment variable with an non-empty string, * otherwise the cobuild feature will be disabled. */ "cobuildFeatureEnabled": false, /** * (Required) Choose where cobuild lock will be acquired. * * The lock provider is registered by the rush plugins. * For example, @rushstack/rush-redis-cobuild-plugin registers the "redis" lock provider. */ "cobuildLockProvider": "redis" } ================================================ FILE: common/config/rush/command-line.json ================================================ /** * This configuration file defines custom commands for the "rush" command-line. * More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json", /** * Custom "commands" introduce new verbs for the command-line. To see the help for these * example commands, try "rush --help", "rush my-bulk-command --help", or * "rush my-global-command --help". */ "commands": [ // { // /** // * (Required) Determines the type of custom command. // * Rush's "bulk" commands are invoked separately for each project. By default, the command will run for // * every project in the repo, according to the dependency graph (similar to how "rush build" works). // * The set of projects can be restricted e.g. using the "--to" or "--from" parameters. // */ // "commandKind": "bulk", // // /** // * (Required) The name that will be typed as part of the command line. This is also the name // * of the "scripts" hook in the project's package.json file (if "shellCommand" is not specified). // * // * The name should be comprised of lower case words separated by hyphens or colons. The name should include an // * English verb (e.g. "deploy"). Use a hyphen to separate words (e.g. "upload-docs"). A group of related commands // * can be prefixed with a colon (e.g. "docs:generate", "docs:deploy", "docs:serve", etc). // * // * Note that if the "rebuild" command is overridden here, it becomes separated from the "build" command // * and will call the "rebuild" script instead of the "build" script. // */ // "name": "my-bulk-command", // // /** // * (Required) A short summary of the custom command to be shown when printing command line // * help, e.g. "rush --help". // */ // "summary": "Example bulk custom command", // // /** // * A detailed description of the command to be shown when printing command line // * help (e.g. "rush --help my-command"). // * If omitted, the "summary" text will be shown instead. // * // * Whenever you introduce commands/parameters, taking a little time to write meaningful // * documentation can make a big difference for the developer experience in your repo. // */ // "description": "This is an example custom command that runs separately for each project", // // /** // * By default, Rush operations acquire a lock file which prevents multiple commands from executing simultaneously // * in the same repo folder. (For example, it would be a mistake to run "rush install" and "rush build" at the // * same time.) If your command makes sense to run concurrently with other operations, // * set "safeForSimultaneousRushProcesses" to true to disable this protection. // * // * In particular, this is needed for custom scripts that invoke other Rush commands. // */ // "safeForSimultaneousRushProcesses": false, // // /** // * (Optional) If the `shellCommand` field is set for a bulk command, Rush will invoke it for each // * selected project; otherwise, Rush will invoke the package.json `"scripts"` entry matching Rush command name. // * // * The string is the path to a script that will be invoked using the OS shell. The working directory will be // * the folder that contains rush.json. If custom parameters are associated with this command, their // * values will be appended to the end of this string. // */ // // "shellCommand": "node common/scripts/my-bulk-command.js", // // /** // * (Required) If true, then this command is safe to be run in parallel, i.e. executed // * simultaneously for multiple projects. Similar to "rush build", regardless of parallelism // * projects will not start processing until their dependencies have completed processing. // */ // "enableParallelism": false, // // /** // * Normally projects will be processed according to their dependency order: a given project will not start // * processing the command until all of its dependencies have completed. This restriction doesn't apply for // * certain operations, for example a "clean" task that deletes output files. In this case // * you can set "ignoreDependencyOrder" to true to increase parallelism. // */ // "ignoreDependencyOrder": false, // // /** // * Normally Rush requires that each project's package.json has a "scripts" entry matching // * the custom command name. To disable this check, set "ignoreMissingScript" to true; // * projects with a missing definition will be skipped. // */ // "ignoreMissingScript": false, // // /** // * When invoking shell scripts, Rush uses a heuristic to distinguish errors from warnings: // * - If the shell script returns a nonzero process exit code, Rush interprets this as "one or more errors". // * Error output is displayed in red, and it prevents Rush from attempting to process any downstream projects. // * - If the shell script returns a zero process exit code but writes something to its stderr stream, // * Rush interprets this as "one or more warnings". Warning output is printed in yellow, but does NOT prevent // * Rush from processing downstream projects. // * // * Thus, warnings do not interfere with local development, but they will cause a CI job to fail, because // * the Rush process itself returns a nonzero exit code if there are any warnings or errors. This is by design. // * In an active monorepo, we've found that if you allow any warnings in your main branch, it inadvertently // * teaches developers to ignore warnings, which quickly leads to a situation where so many "expected" warnings // * have accumulated that warnings no longer serve any useful purpose. // * // * Sometimes a poorly behaved task will write output to stderr even though its operation was successful. // * In that case, it's strongly recommended to fix the task. However, as a workaround you can set // * allowWarningsInSuccessfulBuild=true, which causes Rush to return a nonzero exit code for errors only. // * // * Note: The default value is false. In Rush 5.7.x and earlier, the default value was true. // */ // "allowWarningsInSuccessfulBuild": false, // // /** // * If true then this command will be incremental like the built-in "build" command // */ // "incremental": false, // // /** // * (EXPERIMENTAL) Normally Rush terminates after the command finishes. If this option is set to "true" Rush // * will instead enter a loop where it watches the file system for changes to the selected projects. Whenever a // * change is detected, the command will be invoked again for the changed project and any selected projects that // * directly or indirectly depend on it. // * // * For details, refer to the website article "Using watch mode". // */ // "watchForChanges": false, // // /** // * (EXPERIMENTAL) Disable cache for this action. This may be useful if this command affects state outside of // * projects' own folders. // */ // "disableBuildCache": false // }, // // { // /** // * (Required) Determines the type of custom command. // * Rush's "global" commands are invoked once for the entire repo. // */ // "commandKind": "global", // // "name": "my-global-command", // "summary": "Example global custom command", // "description": "This is an example custom command that runs once for the entire repo", // // "safeForSimultaneousRushProcesses": false, // // /** // * (Required) A script that will be invoked using the OS shell. The working directory will be // * the folder that contains rush.json. If custom parameters are associated with this command, their // * values will be appended to the end of this string. // */ // "shellCommand": "node common/scripts/my-global-command.js", // // /** // * If your "shellCommand" script depends on NPM packages, the recommended best practice is // * to make it into a regular Rush project that builds using your normal toolchain. In cases where // * the command needs to work without first having to run "rush build", the recommended practice // * is to publish the project to an NPM registry and use common/scripts/install-run.js to launch it. // * // * Autoinstallers offer another possibility: They are folders under "common/autoinstallers" with // * a package.json file and shrinkwrap file. Rush will automatically invoke the package manager to // * install these dependencies before an associated command is invoked. Autoinstallers have the // * advantage that they work even in a branch where "rush install" is broken, which makes them a // * good solution for Git hook scripts. But they have the disadvantages of not being buildable // * projects, and of increasing the overall installation footprint for your monorepo. // * // * The "autoinstallerName" setting must not contain a path and must be a valid NPM package name. // * For example, the name "my-task" would map to "common/autoinstallers/my-task/package.json", and // * the "common/autoinstallers/my-task/node_modules/.bin" folder would be added to the shell PATH when // * invoking the "shellCommand". // */ // // "autoinstallerName": "my-task" // } { "name": "prettier", "commandKind": "global", "summary": "Used by the pre-commit Git hook. This command invokes Prettier to reformat staged changes.", "safeForSimultaneousRushProcesses": true, "autoinstallerName": "rush-prettier", // This will invoke common/autoinstallers/rush-prettier/node_modules/.bin/pretty-quick "shellCommand": "pretty-quick --staged" }, { "commandKind": "bulk", "name": "storybook", "summary": "Run Storybook for all projects", "description": "Run Storybook for all projects", "enableParallelism": true, "ignoreDependencyOrder": true, "safeForSimultaneousRushProcesses": true, "shellCommand": "npm run storybook" } ], /** * Custom "parameters" introduce new parameters for specified Rush command-line commands. * For example, you might define a "--production" parameter for the "rush build" command. */ "parameters": [ // { // /** // * (Required) Determines the type of custom parameter. // * A "flag" is a custom command-line parameter whose presence acts as an on/off switch. // */ // "parameterKind": "flag", // // /** // * (Required) The long name of the parameter. It must be lower-case and use dash delimiters. // */ // "longName": "--my-flag", // // /** // * An optional alternative short name for the parameter. It must be a dash followed by a single // * lower-case or upper-case letter, which is case-sensitive. // * // * NOTE: The Rush developers recommend that automation scripts should always use the long name // * to improve readability. The short name is only intended as a convenience for humans. // * The alphabet letters run out quickly, and are difficult to memorize, so *only* use // * a short name if you expect the parameter to be needed very often in everyday operations. // */ // "shortName": "-m", // // /** // * (Required) A long description to be shown in the command-line help. // * // * Whenever you introduce commands/parameters, taking a little time to write meaningful // * documentation can make a big difference for the developer experience in your repo. // */ // "description": "A custom flag parameter that is passed to the scripts that are invoked when building projects", // // /** // * (Required) A list of custom commands and/or built-in Rush commands that this parameter may // * be used with. The parameter will be appended to the shell command that Rush invokes. // */ // "associatedCommands": ["build", "rebuild"] // }, // // { // /** // * (Required) Determines the type of custom parameter. // * A "string" is a custom command-line parameter whose argument is a single text string. // */ // "parameterKind": "string", // "longName": "--my-string", // "description": "A custom string parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // // "argumentName": "SOME_TEXT", // // /** // * If true, this parameter must be included with the command. The default is false. // */ // "required": false // }, // // { // /** // * (Required) Determines the type of custom parameter. // * A "choice" is a custom command-line parameter whose argument must be chosen from a list of // * allowable alternatives (similar to an enum). // */ // "parameterKind": "choice", // "longName": "--my-choice", // "description": "A custom choice parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // "required": false, // // /** // * If a "defaultValue" is specified, then if the Rush command line is invoked without // * this parameter, it will be automatically added with the "defaultValue" as the argument. // * The value must be one of the defined alternatives. // */ // "defaultValue": "vanilla", // // /** // * (Required) A list of alternative argument values that can be chosen for this parameter. // */ // "alternatives": [ // { // /** // * A token that is one of the alternatives that can be used with the choice parameter, // * e.g. "vanilla" in "--flavor vanilla". // */ // "name": "vanilla", // // /** // * A detailed description for the alternative that can be shown in the command-line help. // * // * Whenever you introduce commands/parameters, taking a little time to write meaningful // * documentation can make a big difference for the developer experience in your repo. // */ // "description": "Use the vanilla flavor" // }, // // { // "name": "chocolate", // "description": "Use the chocolate flavor" // }, // // { // "name": "strawberry", // "description": "Use the strawberry flavor" // } // ] // }, // // { // /** // * (Required) Determines the type of custom parameter. // * An "integer" is a custom command-line parameter whose value is an integer number. // */ // "parameterKind": "integer", // "longName": "--my-integer", // "description": "A custom integer parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // "argumentName": "SOME_NUMBER", // "required": false // }, // // { // /** // * (Required) Determines the type of custom parameter. // * An "integerList" is a custom command-line parameter whose argument is an integer. // * The parameter can be specified multiple times to build a list. // * // * For example, if the parameter name is "--my-integer-list", then the custom command // * might be invoked as // * `rush my-global-command --my-integer-list 1 --my-integer-list 2 --my-integer-list 3` // * and the parsed array would be [1,2,3]. // */ // "parameterKind": "integerList", // "longName": "--my-integer-list", // "description": "A custom integer list parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // "argumentName": "SOME_NUMBER", // "required": false // }, // // { // /** // * (Required) Determines the type of custom parameter. // * An "stringList" is a custom command-line parameter whose argument is a text string. // * The parameter can be specified multiple times to build a list. // * // * For example, if the parameter name is "--my-string-list", then the custom command // * might be invoked as // * `rush my-global-command --my-string-list A --my-string-list B --my-string-list C` // * and the parsed array would be [A,B,C]. // */ // "parameterKind": "stringList", // "longName": "--my-string-list", // "description": "A custom string list parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // "argumentName": "SOME_TEXT", // "required": false // }, // // { // /** // * (Required) Determines the type of custom parameter. // * A "choice" is a custom command-line parameter whose argument must be chosen from a list of // * allowable alternatives (similar to an enum). // * The parameter can be specified multiple times to build a list. // * // * For example, if the parameter name is "--my-choice-list", then the custom command // * might be invoked as // * `rush my-global-command --my-string-list vanilla --my-string-list chocolate` // * and the parsed array would be [vanilla,chocolate]. // */ // "parameterKind": "choiceList", // "longName": "--my-choice-list", // "description": "A custom choice list parameter for the \"my-global-command\" custom command", // // "associatedCommands": ["my-global-command"], // "required": false, // // /** // * (Required) A list of alternative argument values that can be chosen for this parameter. // */ // "alternatives": [ // { // /** // * A token that is one of the alternatives that can be used with the choice parameter, // * e.g. "vanilla" in "--flavor vanilla". // */ // "name": "vanilla", // // /** // * A detailed description for the alternative that can be shown in the command-line help. // * // * Whenever you introduce commands/parameters, taking a little time to write meaningful // * documentation can make a big difference for the developer experience in your repo. // */ // "description": "Use the vanilla flavor" // }, // // { // "name": "chocolate", // "description": "Use the chocolate flavor" // }, // // { // "name": "strawberry", // "description": "Use the strawberry flavor" // } // ] // } ] } ================================================ FILE: common/config/rush/common-versions.json ================================================ /** * This configuration file specifies NPM dependency version selections that affect all projects * in a Rush repo. More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/common-versions.schema.json", /** * A table that specifies a "preferred version" for a given NPM package. This feature is typically used * to hold back an indirect dependency to a specific older version, or to reduce duplication of indirect dependencies. * * The "preferredVersions" value can be any SemVer range specifier (e.g. "~1.2.3"). Rush injects these values into * the "dependencies" field of the top-level common/temp/package.json, which influences how the package manager * will calculate versions. The specific effect depends on your package manager. Generally it will have no * effect on an incompatible or already constrained SemVer range. If you are using PNPM, similar effects can be * achieved using the pnpmfile.js hook. See the Rush documentation for more details. * * After modifying this field, it's recommended to run "rush update --full" so that the package manager * will recalculate all version selections. */ "preferredVersions": { /** * When someone asks for "^1.0.0" make sure they get "1.2.3" when working in this repo, * instead of the latest version. */ // "some-library": "1.2.3" }, /** * When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions, * except in cases where different projects specify different version ranges for a given dependency. For older * package managers, this tended to reduce duplication of indirect dependencies. However, it can sometimes cause * trouble for indirect dependencies with incompatible peerDependencies ranges. * * The default value is true. If you're encountering installation errors related to peer dependencies, * it's recommended to set this to false. * * After modifying this field, it's recommended to run "rush update --full" so that the package manager * will recalculate all version selections. */ // "implicitlyPreferredVersions": false, /** * If you would like the version specifiers for your dependencies to be consistent, then * uncomment this line. This is effectively similar to running "rush check" before any * of the following commands: * * rush install, rush update, rush link, rush version, rush publish * * In some cases you may want this turned on, but need to allow certain packages to use a different * version. In those cases, you will need to add an entry to the "allowedAlternativeVersions" * section of the common-versions.json. * * In the case that subspaces is enabled, this setting will take effect at a subspace level. */ // "ensureConsistentVersions": true, /** * The "rush check" command can be used to enforce that every project in the repo must specify * the same SemVer range for a given dependency. However, sometimes exceptions are needed. * The allowedAlternativeVersions table allows you to list other SemVer ranges that will be * accepted by "rush check" for a given dependency. * * IMPORTANT: THIS TABLE IS FOR *ADDITIONAL* VERSION RANGES THAT ARE ALTERNATIVES TO THE * USUAL VERSION (WHICH IS INFERRED BY LOOKING AT ALL PROJECTS IN THE REPO). * This design avoids unnecessary churn in this file. */ "allowedAlternativeVersions": { /** * For example, allow some projects to use an older TypeScript compiler * (in addition to whatever "usual" version is being used by other projects in the repo): */ // "typescript": [ // "~2.4.0" // ] } } ================================================ FILE: common/config/rush/custom-tips.json ================================================ /** * This configuration file allows repo maintainers to configure extra details to be * printed alongside certain Rush messages. More documentation is available on the * Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/custom-tips.schema.json", /** * Custom tips allow you to annotate Rush's console messages with advice tailored for * your specific monorepo. */ "customTips": [ // { // /** // * (REQUIRED) An identifier indicating a message that may be printed by Rush. // * If that message is printed, then this custom tip will be shown. // * The list of available tip identifiers can be found on this page: // * https://rushjs.io/pages/maintainer/custom_tips/ // */ // "tipId": "TIP_RUSH_INCONSISTENT_VERSIONS", // // /** // * (REQUIRED) The message text to be displayed for this tip. // */ // "message": "For additional troubleshooting information, refer this wiki article:\n\nhttps://intranet.contoso.com/docs/pnpm-mismatch" // } ] } ================================================ FILE: common/config/rush/experiments.json ================================================ /** * This configuration file allows repo maintainers to enable and disable experimental * Rush features. More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/experiments.schema.json" /** * By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'. * Set this option to true to pass '--frozen-lockfile' instead for faster installs. */ // "usePnpmFrozenLockfileForRushInstall": true, /** * By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'. * Set this option to true to pass '--prefer-frozen-lockfile' instead to minimize shrinkwrap changes. */ // "usePnpmPreferFrozenLockfileForRushUpdate": true, /** * By default, 'rush update' runs as a single operation. * Set this option to true to instead update the lockfile with `--lockfile-only`, then perform a `--frozen-lockfile` install. * Necessary when using the `afterAllResolved` hook in .pnpmfile.cjs. */ // "usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate": true, /** * If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies. * Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not * cause hash changes. */ // "omitImportersFromPreventManualShrinkwrapChanges": true, /** * If true, the chmod field in temporary project tar headers will not be normalized. * This normalization can help ensure consistent tarball integrity across platforms. */ // "noChmodFieldInTarHeaderNormalization": true, /** * If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings. * This will not replay warnings from the cached build. */ // "buildCacheWithAllowWarningsInSuccessfulBuild": true, /** * If true, build skipping will respect the allowWarningsInSuccessfulBuild flag and skip builds with warnings. * This will not replay warnings from the skipped build. */ // "buildSkipWithAllowWarningsInSuccessfulBuild": true, /** * If true, perform a clean install after when running `rush install` or `rush update` if the * `.npmrc` file has changed since the last install. */ // "cleanInstallAfterNpmrcChanges": true, /** * If true, print the outputs of shell commands defined in event hooks to the console. */ // "printEventHooksOutputToConsole": true, /** * If true, Rush will not allow node_modules in the repo folder or in parent folders. */ // "forbidPhantomResolvableNodeModulesFolders": true, /** * (UNDER DEVELOPMENT) For certain installation problems involving peer dependencies, PNPM cannot * correctly satisfy versioning requirements without installing duplicate copies of a package inside the * node_modules folder. This poses a problem for "workspace:*" dependencies, as they are normally * installed by making a symlink to the local project source folder. PNPM's "injected dependencies" * feature provides a model for copying the local project folder into node_modules, however copying * must occur AFTER the dependency project is built and BEFORE the consuming project starts to build. * The "pnpm-sync" tool manages this operation; see its documentation for details. * Enable this experiment if you want "rush" and "rushx" commands to resync injected dependencies * by invoking "pnpm-sync" during the build. */ // "usePnpmSyncForInjectedDependencies": true, /** * If set to true, Rush will generate a `project-impact-graph.yaml` file in the repository root during `rush update`. */ // "generateProjectImpactGraphDuringRushUpdate": true, /** * If true, when running in watch mode, Rush will check for phase scripts named `_phase::ipc` and run them instead * of `_phase:` if they exist. The created child process will be provided with an IPC channel and expected to persist * across invocations. */ // "useIPCScriptsInWatchMode": true } ================================================ FILE: common/config/rush/pnpm-config.json ================================================ /** * This configuration file provides settings specific to the PNPM package manager. * More documentation is available on the Rush website: https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/pnpm-config.schema.json", /** * If true, then `rush install` and `rush update` will use the PNPM workspaces feature * to perform the install, instead of the old model where Rush generated the symlinks * for each projects's node_modules folder. * * When using workspaces, Rush will generate a `common/temp/pnpm-workspace.yaml` file referencing * all local projects to install. Rush will also generate a `.pnpmfile.cjs` shim which implements * Rush-specific features such as preferred versions. The user's `common/config/rush/.pnpmfile.cjs` * is invoked by the shim. * * This option is strongly recommended. The default value is false. */ "useWorkspaces": true, /** * This setting determines how PNPM chooses version numbers during `rush update`. * For example, suppose `lib-x@3.0.0` depends on `"lib-y": "^1.2.3"` whose latest major * releases are `1.8.9` and `2.3.4`. The resolution mode `lowest-direct` might choose * `lib-y@1.2.3`, wheres `highest` will choose 1.8.9, and `time-based` will pick the * highest compatible version at the time when `lib-x@3.0.0` itself was published (ensuring * that the version could have been tested by the maintainer of "lib-x"). For local workspace * projects, `time-based` instead works like `lowest-direct`, avoiding upgrades unless * they are explicitly requested. Although `time-based` is the most robust option, it may be * slightly slower with registries such as npmjs.com that have not implemented an optimization. * * IMPORTANT: Be aware that PNPM 8.0.0 initially defaulted to `lowest-direct` instead of * `highest`, but PNPM reverted this decision in 8.6.12 because it caused confusion for users. * Rush version 5.106.0 and newer avoids this confusion by consistently defaulting to * `highest` when `resolutionMode` is not explicitly set in pnpm-config.json or .npmrc, * regardless of your PNPM version. * * PNPM documentation: https://pnpm.io/npmrc#resolution-mode * * Possible values are: `highest`, `time-based`, and `lowest-direct`. * The default is `highest`. */ // "resolutionMode": "time-based", /** * This setting determines whether PNPM will automatically install (non-optional) * missing peer dependencies instead of reporting an error. Doing so conveniently * avoids the need to specify peer versions in package.json, but in a large monorepo * this often creates worse problems. The reason is that peer dependency behavior * is inherently complicated, and it is easier to troubleshoot consequences of an explicit * version than an invisible heuristic. The original NPM RFC discussion pointed out * some other problems with this feature: https://github.com/npm/rfcs/pull/43 * IMPORTANT: Without Rush, the setting defaults to true for PNPM 8 and newer; however, * as of Rush version 5.109.0 the default is always false unless `autoInstallPeers` * is specified in pnpm-config.json or .npmrc, regardless of your PNPM version. * PNPM documentation: https://pnpm.io/npmrc#auto-install-peers * The default value is false. */ // "autoInstallPeers": false, /** * If true, then Rush will add the `--strict-peer-dependencies` command-line parameter when * invoking PNPM. This causes `rush update` to fail if there are unsatisfied peer dependencies, * which is an invalid state that can cause build failures or incompatible dependency versions. * (For historical reasons, JavaScript package managers generally do not treat this invalid * state as an error.) * * PNPM documentation: https://pnpm.io/npmrc#strict-peer-dependencies * * The default value is false to avoid legacy compatibility issues. * It is strongly recommended to set `strictPeerDependencies=true`. */ // "strictPeerDependencies": true, /** * Environment variables that will be provided to PNPM. */ // "environmentVariables": { // "NODE_OPTIONS": { // "value": "--max-old-space-size=4096", // "override": false // } // }, /** * Specifies the location of the PNPM store. There are two possible values: * * - `local` - use the `pnpm-store` folder in the current configured temp folder: * `common/temp/pnpm-store` by default. * - `global` - use PNPM's global store, which has the benefit of being shared * across multiple repo folders, but the disadvantage of less isolation for builds * (for example, bugs or incompatibilities when two repos use different releases of PNPM) * * In both cases, the store path can be overridden by the environment variable `RUSH_PNPM_STORE_PATH`. * * The default value is `local`. */ // "pnpmStore": "global", /** * If true, then `rush install` will report an error if manual modifications * were made to the PNPM shrinkwrap file without running `rush update` afterwards. * * This feature protects against accidental inconsistencies that may be introduced * if the PNPM shrinkwrap file (`pnpm-lock.yaml`) is manually edited. When this * feature is enabled, `rush update` will append a hash to the file as a YAML comment, * and then `rush update` and `rush install` will validate the hash. Note that this * does not prohibit manual modifications, but merely requires `rush update` be run * afterwards, ensuring that PNPM can report or repair any potential inconsistencies. * * To temporarily disable this validation when invoking `rush install`, use the * `--bypass-policy` command-line parameter. * * The default value is false. */ // "preventManualShrinkwrapChanges": true, /** * When a project uses `workspace:` to depend on another Rush project, PNPM normally installs * it by creating a symlink under `node_modules`. This generally works well, but in certain * cases such as differing `peerDependencies` versions, symlinking may cause trouble * such as incorrectly satisfied versions. For such cases, the dependency can be declared * as "injected", causing PNPM to copy its built output into `node_modules` like a real * install from a registry. Details here: https://rushjs.io/pages/advanced/injected_deps/ * * When using Rush subspaces, these sorts of versioning problems are much more likely if * `workspace:` refers to a project from a different subspace. This is because the symlink * would point to a separate `node_modules` tree installed by a different PNPM lockfile. * A comprehensive solution is to enable `alwaysInjectDependenciesFromOtherSubspaces`, * which automatically treats all projects from other subspaces as injected dependencies * without having to manually configure them. * * NOTE: Use carefully -- excessive file copying can slow down the `rush install` and * `pnpm-sync` operations if too many dependencies become injected. * * The default value is false. */ // "alwaysInjectDependenciesFromOtherSubspaces": false, /** * Defines the policies to be checked for the `pnpm-lock.yaml` file. */ "pnpmLockfilePolicies": { /** * This policy will cause "rush update" to report an error if `pnpm-lock.yaml` contains * any SHA1 integrity hashes. * * For each NPM dependency, `pnpm-lock.yaml` normally stores an `integrity` hash. Although * its main purpose is to detect corrupted or truncated network requests, this hash can also * serve as a security fingerprint to protect against attacks that would substitute a * malicious tarball, for example if a misconfigured .npmrc caused a machine to accidentally * download a matching package name+version from npmjs.com instead of the private NPM registry. * NPM originally used a SHA1 hash; this was insecure because an attacker can too easily craft * a tarball with a matching fingerprint. For this reason, NPM later deprecated SHA1 and * instead adopted a cryptographically strong SHA512 hash. Nonetheless, SHA1 hashes can * occasionally reappear during "rush update", for example due to missing metadata fallbacks * (https://github.com/orgs/pnpm/discussions/6194) or an incompletely migrated private registry. * The `disallowInsecureSha1` policy prevents this, avoiding potential security/compliance alerts. */ // "disallowInsecureSha1": { // /** // * Enables the "disallowInsecureSha1" policy. The default value is false. // */ // "enabled": true, // // /** // * In rare cases, a private NPM registry may continue to serve SHA1 hashes for very old // * package versions, perhaps due to a caching issue or database migration glitch. To avoid // * having to disable the "disallowInsecureSha1" policy for the entire monorepo, the problematic // * package versions can be individually ignored. The "exemptPackageVersions" key is the // * package name, and the array value lists exact version numbers to be ignored. // */ // "exemptPackageVersions": { // "example1": ["1.0.0"], // "example2": ["2.0.0", "2.0.1"] // } // } }, /** * The "globalOverrides" setting provides a simple mechanism for overriding version selections * for all dependencies of all projects in the monorepo workspace. The settings are copied * into the `pnpm.overrides` field of the `common/temp/package.json` file that is generated * by Rush during installation. * * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, * and `globalOverrides` has lowest precedence. * * PNPM documentation: https://pnpm.io/package_json#pnpmoverrides */ "globalOverrides": { "@antv/f6-hammerjs": "^0.0.2" // "example1": "^1.0.0", // "example2": "npm:@company/example2@^1.0.0" }, /** * The `globalPeerDependencyRules` setting provides various settings for suppressing validation errors * that are reported during installation with `strictPeerDependencies=true`. The settings are copied * into the `pnpm.peerDependencyRules` field of the `common/temp/package.json` file that is generated * by Rush during installation. * * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, * and `globalOverrides` has lowest precedence. * * https://pnpm.io/package_json#pnpmpeerdependencyrules */ "globalPeerDependencyRules": { // "ignoreMissing": ["@eslint/*"], // "allowedVersions": { "react": "17" }, // "allowAny": ["@babel/*"] }, /** * The `globalPackageExtension` setting provides a way to patch arbitrary package.json fields * for any PNPM dependency of the monorepo. The settings are copied into the `pnpm.packageExtensions` * field of the `common/temp/package.json` file that is generated by Rush during installation. * The `globalPackageExtension` setting has similar capabilities as `.pnpmfile.cjs` but without * the downsides of an executable script (nondeterminism, unreliable caching, performance concerns). * * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, * and `globalOverrides` has lowest precedence. * * PNPM documentation: https://pnpm.io/package_json#pnpmpackageextensions */ "globalPackageExtensions": { // "fork-ts-checker-webpack-plugin": { // "dependencies": { // "@babel/core": "1" // }, // "peerDependencies": { // "eslint": ">= 6" // }, // "peerDependenciesMeta": { // "eslint": { // "optional": true // } // } // } }, /** * The `globalNeverBuiltDependencies` setting suppresses the `preinstall`, `install`, and `postinstall` * lifecycle events for the specified NPM dependencies. This is useful for scripts with poor practices * such as downloading large binaries without retries or attempting to invoke OS tools such as * a C++ compiler. (PNPM's terminology refers to these lifecycle events as "building" a package; * it has nothing to do with build system operations such as `rush build` or `rushx build`.) * The settings are copied into the `pnpm.neverBuiltDependencies` field of the `common/temp/package.json` * file that is generated by Rush during installation. * * PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies */ "globalNeverBuiltDependencies": [ // "fsevents" ], /** * The `globalAllowedDeprecatedVersions` setting suppresses installation warnings for package * versions that the NPM registry reports as being deprecated. This is useful if the * deprecated package is an indirect dependency of an external package that has not released a fix. * The settings are copied into the `pnpm.allowedDeprecatedVersions` field of the `common/temp/package.json` * file that is generated by Rush during installation. * * PNPM documentation: https://pnpm.io/package_json#pnpmalloweddeprecatedversions * * If you are working to eliminate a deprecated version, it's better to specify `allowedDeprecatedVersions` * in the package.json file for individual Rush projects. */ "globalAllowedDeprecatedVersions": { // "request": "*" }, /** * (THIS FIELD IS MACHINE GENERATED) The "globalPatchedDependencies" field is updated automatically * by the `rush-pnpm patch-commit` command. It is a dictionary, where the key is an NPM package name * and exact version, and the value is a relative path to the associated patch file. * * PNPM documentation: https://pnpm.io/package_json#pnpmpatcheddependencies */ "globalPatchedDependencies": {}, /** * (USE AT YOUR OWN RISK) This is a free-form property bag that will be copied into * the `common/temp/package.json` file that is generated by Rush during installation. * This provides a way to experiment with new PNPM features. These settings will override * any other Rush configuration associated with a given JSON field except for `.pnpmfile.cjs`. * * USAGE OF THIS SETTING IS NOT SUPPORTED BY THE RUSH MAINTAINERS AND MAY CAUSE RUSH * TO MALFUNCTION. If you encounter a missing PNPM setting that you believe should * be supported, please create a GitHub issue or PR. Note that Rush does not aim to * support every possible PNPM setting, but rather to promote a battle-tested installation * strategy that is known to provide a good experience for large teams with lots of projects. */ "unsupportedPackageJsonSettings": { // "dependencies": { // "not-a-good-practice": "*" // }, // "scripts": { // "do-something": "echo Also not a good practice" // }, // "pnpm": { "futurePnpmFeature": true } } } ================================================ FILE: common/config/rush/repo-state.json ================================================ // DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush. { "preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f" } ================================================ FILE: common/config/rush/rush-plugins.json ================================================ /** * This configuration file manages Rush's plugin feature. */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugins.schema.json", "plugins": [ /** * Each item configures a plugin to be loaded by Rush. */ // { // /** // * The name of the NPM package that provides the plugin. // */ // "packageName": "@scope/my-rush-plugin", // /** // * The name of the plugin. This can be found in the "pluginName" // * field of the "rush-plugin-manifest.json" file in the NPM package folder. // */ // "pluginName": "my-plugin-name", // /** // * The name of a Rush autoinstaller that will be used for installation, which // * can be created using "rush init-autoinstaller". Add the plugin's NPM package // * to the package.json "dependencies" of your autoinstaller, then run // * "rush update-autoinstaller". // */ // "autoinstallerName": "rush-plugins" // } ] } ================================================ FILE: common/config/rush/subspaces.json ================================================ /** * This configuration file manages the experimental "subspaces" feature for Rush, * which allows multiple PNPM lockfiles to be used in a single Rush workspace. * For full documentation, please see https://rushjs.io */ { "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/subspaces.schema.json", /** * Set this flag to "true" to enable usage of subspaces. */ "subspacesEnabled": false, /** * (DEPRECATED) This is a temporary workaround for migrating from an earlier prototype * of this feature: https://github.com/microsoft/rushstack/pull/3481 * It allows subspaces with only one project to store their config files in the project folder. */ "splitWorkspaceCompatibility": false, /** * When a command such as "rush update" is invoked without the "--subspace" or "--to" * parameters, Rush will install all subspaces. In a huge monorepo with numerous subspaces, * this would be extremely slow. Set "preventSelectingAllSubspaces" to true to avoid this * mistake by always requiring selection parameters for commands such as "rush update". */ "preventSelectingAllSubspaces": false, /** * The list of subspace names, which should be lowercase alphanumeric words separated by * hyphens, for example "my-subspace". The corresponding config files will have paths * such as "common/config/subspaces/my-subspace/package-lock.yaml". */ "subspaceNames": [] } ================================================ FILE: common/config/rush/version-policies.json ================================================ /** * This is configuration file is used for advanced publishing configurations with Rush. * More documentation is available on the Rush website: https://rushjs.io */ /** * A list of version policy definitions. A "version policy" is a custom package versioning * strategy that affects "rush change", "rush version", and "rush publish". The strategy applies * to a set of projects that are specified using the "versionPolicyName" field in rush.json. */ [ // { // /** // * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion"). // * // * The "lockStepVersion" mode specifies that the projects will use "lock-step versioning". This // * strategy is appropriate for a set of packages that act as selectable components of a // * unified product. The entire set of packages are always published together, and always share // * the same NPM version number. When the packages depend on other packages in the set, the // * SemVer range is usually restricted to a single version. // */ // "definitionName": "lockStepVersion", // // /** // * (Required) The name that will be used for the "versionPolicyName" field in rush.json. // * This name is also used command-line parameters such as "--version-policy" // * and "--to-version-policy". // */ // "policyName": "MyBigFramework", // // /** // * (Required) The current version. All packages belonging to the set should have this version // * in the current branch. When bumping versions, Rush uses this to determine the next version. // * (The "version" field in package.json is NOT considered.) // */ // "version": "1.0.0", // // /** // * (Required) The type of bump that will be performed when publishing the next release. // * When creating a release branch in Git, this field should be updated according to the // * type of release. // * // * Valid values are: "prerelease", "preminor", "minor", "patch", "major" // */ // "nextBump": "prerelease", // // /** // * (Optional) If specified, all packages in the set share a common CHANGELOG.md file. // * This file is stored with the specified "main" project, which must be a member of the set. // * // * If this field is omitted, then a separate CHANGELOG.md file will be maintained for each // * package in the set. // */ // "mainProject": "my-app", // // /** // * (Optional) If enabled, the "rush change" command will prompt the user for their email address // * and include it in the JSON change files. If an organization maintains multiple repos, tracking // * this contact information may be useful for a service that automatically upgrades packages and // * needs to notify engineers whose change may be responsible for a downstream build break. It might // * also be useful for crediting contributors. Rush itself does not do anything with the collected // * email addresses. The default value is "false". // */ // // "includeEmailInChangeFile": true // }, // // { // /** // * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion"). // * // * The "individualVersion" mode specifies that the projects will use "individual versioning". // * This is the typical NPM model where each package has an independent version number // * and CHANGELOG.md file. Although a single CI definition is responsible for publishing the // * packages, they otherwise don't have any special relationship. The version bumping will // * depend on how developers answer the "rush change" questions for each package that // * is changed. // */ // "definitionName": "individualVersion", // // "policyName": "MyRandomLibraries", // // /** // * (Optional) This can be used to enforce that all packages in the set must share a common // * major version number, e.g. because they are from the same major release branch. // * It can also be used to discourage people from accidentally making "MAJOR" SemVer changes // * inappropriately. The minor/patch version parts will be bumped independently according // * to the types of changes made to each project, according to the "rush change" command. // */ // "lockedMajor": 3, // // /** // * (Optional) When publishing is managed by Rush, by default the "rush change" command will // * request changes for any projects that are modified by a pull request. These change entries // * will produce a CHANGELOG.md file. If you author your CHANGELOG.md manually or announce updates // * in some other way, set "exemptFromRushChange" to true to tell "rush change" to ignore the projects // * belonging to this version policy. // */ // "exemptFromRushChange": false, // // // "includeEmailInChangeFile": true // } ] ================================================ FILE: common/git-hooks/commit-msg.sample ================================================ #!/bin/sh # # This is an example Git hook for use with Rush. To enable this hook, rename this file # to "commit-msg" and then run "rush install", which will copy it from common/git-hooks # to the .git/hooks folder. # # TO LEARN MORE ABOUT GIT HOOKS # # The Git documentation is here: https://git-scm.com/docs/githooks # Some helpful resources: https://githooks.com # # ABOUT THIS EXAMPLE # # The commit-msg hook is called by "git commit" with one argument, the name of the file # that has the commit message. The hook should exit with non-zero status after issuing # an appropriate message if it wants to stop the commit. The hook is allowed to edit # the commit message file. # This example enforces that commit message should contain a minimum amount of # description text. if [ `cat $1 | wc -w` -lt 3 ]; then echo "" echo "Invalid commit message: The message must contain at least 3 words." exit 1 fi ================================================ FILE: common/git-hooks/pre-commit ================================================ #!/bin/sh # Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # Invoke the "rush prettier" custom command to reformat files whenever they # are committed. The command is defined in common/config/rush/command-line.json # and uses the "rush-prettier" autoinstaller. node common/scripts/install-run-rush.js prettier || exit $? ================================================ FILE: common/scripts/install-run-rush-pnpm.js ================================================ // THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED. // // This script is intended for usage in an automated build environment where the Rush command may not have // been preinstalled, or may have an unpredictable version. This script will automatically install the version of Rush // specified in the rush.json configuration file (if not already installed), and then pass a command-line to the // rush-pnpm command. // // An example usage would be: // // node common/scripts/install-run-rush-pnpm.js pnpm-command // // For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/ // // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See the @microsoft/rush package's LICENSE file for details. /******/ (() => { // webpackBootstrap /******/ "use strict"; var __webpack_exports__ = {}; /*!*****************************************************!*\ !*** ./lib-esnext/scripts/install-run-rush-pnpm.js ***! \*****************************************************/ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. require('./install-run-rush'); //# sourceMappingURL=install-run-rush-pnpm.js.map module.exports = __webpack_exports__; /******/ })() ; //# sourceMappingURL=install-run-rush-pnpm.js.map ================================================ FILE: common/scripts/install-run-rush.js ================================================ // THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED. // // This script is intended for usage in an automated build environment where the Rush command may not have // been preinstalled, or may have an unpredictable version. This script will automatically install the version of Rush // specified in the rush.json configuration file (if not already installed), and then pass a command-line to it. // An example usage would be: // // node common/scripts/install-run-rush.js install // // For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/ // // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See the @microsoft/rush package's LICENSE file for details. /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ 657147: /*!*********************!*\ !*** external "fs" ***! \*********************/ /***/ ((module) => { module.exports = require("fs"); /***/ }), /***/ 371017: /*!***********************!*\ !*** external "path" ***! \***********************/ /***/ ((module) => { module.exports = require("path"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!************************************************!*\ !*** ./lib-esnext/scripts/install-run-rush.js ***! \************************************************/ __webpack_require__.r(__webpack_exports__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ 371017); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ 657147); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. /* eslint-disable no-console */ const { installAndRun, findRushJsonFolder, RUSH_JSON_FILENAME, runWithErrorAndStatusCode } = require('./install-run'); const PACKAGE_NAME = '@microsoft/rush'; const RUSH_PREVIEW_VERSION = 'RUSH_PREVIEW_VERSION'; const INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE = 'INSTALL_RUN_RUSH_LOCKFILE_PATH'; function _getRushVersion(logger) { const rushPreviewVersion = process.env[RUSH_PREVIEW_VERSION]; if (rushPreviewVersion !== undefined) { logger.info(`Using Rush version from environment variable ${RUSH_PREVIEW_VERSION}=${rushPreviewVersion}`); return rushPreviewVersion; } const rushJsonFolder = findRushJsonFolder(); const rushJsonPath = path__WEBPACK_IMPORTED_MODULE_0__.join(rushJsonFolder, RUSH_JSON_FILENAME); try { const rushJsonContents = fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(rushJsonPath, 'utf-8'); // Use a regular expression to parse out the rushVersion value because rush.json supports comments, // but JSON.parse does not and we don't want to pull in more dependencies than we need to in this script. const rushJsonMatches = rushJsonContents.match(/\"rushVersion\"\s*\:\s*\"([0-9a-zA-Z.+\-]+)\"/); return rushJsonMatches[1]; } catch (e) { throw new Error(`Unable to determine the required version of Rush from ${RUSH_JSON_FILENAME} (${rushJsonFolder}). ` + `The 'rushVersion' field is either not assigned in ${RUSH_JSON_FILENAME} or was specified ` + 'using an unexpected syntax.'); } } function _getBin(scriptName) { switch (scriptName.toLowerCase()) { case 'install-run-rush-pnpm.js': return 'rush-pnpm'; case 'install-run-rushx.js': return 'rushx'; default: return 'rush'; } } function _run() { const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv; // Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the // appropriate binary inside the rush package to run const scriptName = path__WEBPACK_IMPORTED_MODULE_0__.basename(scriptPath); const bin = _getBin(scriptName); if (!nodePath || !scriptPath) { throw new Error('Unexpected exception: could not detect node path or script path'); } let commandFound = false; let logger = { info: console.log, error: console.error }; for (const arg of packageBinArgs) { if (arg === '-q' || arg === '--quiet') { // The -q/--quiet flag is supported by both `rush` and `rushx`, and will suppress // any normal informational/diagnostic information printed during startup. // // To maintain the same user experience, the install-run* scripts pass along this // flag but also use it to suppress any diagnostic information normally printed // to stdout. logger = { info: () => { }, error: console.error }; } else if (!arg.startsWith('-') || arg === '-h' || arg === '--help') { // We either found something that looks like a command (i.e. - doesn't start with a "-"), // or we found the -h/--help flag, which can be run without a command commandFound = true; } } if (!commandFound) { console.log(`Usage: ${scriptName} [args...]`); if (scriptName === 'install-run-rush-pnpm.js') { console.log(`Example: ${scriptName} pnpm-command`); } else if (scriptName === 'install-run-rush.js') { console.log(`Example: ${scriptName} build --to myproject`); } else { console.log(`Example: ${scriptName} custom-command`); } process.exit(1); } runWithErrorAndStatusCode(logger, () => { const version = _getRushVersion(logger); logger.info(`The ${RUSH_JSON_FILENAME} configuration requests Rush version ${version}`); const lockFilePath = process.env[INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE]; if (lockFilePath) { logger.info(`Found ${INSTALL_RUN_RUSH_LOCKFILE_PATH_VARIABLE}="${lockFilePath}", installing with lockfile.`); } return installAndRun(logger, PACKAGE_NAME, version, bin, packageBinArgs, lockFilePath); }); } _run(); //# sourceMappingURL=install-run-rush.js.map })(); module.exports = __webpack_exports__; /******/ })() ; //# sourceMappingURL=install-run-rush.js.map ================================================ FILE: common/scripts/install-run-rushx.js ================================================ // THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED. // // This script is intended for usage in an automated build environment where the Rush command may not have // been preinstalled, or may have an unpredictable version. This script will automatically install the version of Rush // specified in the rush.json configuration file (if not already installed), and then pass a command-line to the // rushx command. // // An example usage would be: // // node common/scripts/install-run-rushx.js custom-command // // For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/ // // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See the @microsoft/rush package's LICENSE file for details. /******/ (() => { // webpackBootstrap /******/ "use strict"; var __webpack_exports__ = {}; /*!*************************************************!*\ !*** ./lib-esnext/scripts/install-run-rushx.js ***! \*************************************************/ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. require('./install-run-rush'); //# sourceMappingURL=install-run-rushx.js.map module.exports = __webpack_exports__; /******/ })() ; //# sourceMappingURL=install-run-rushx.js.map ================================================ FILE: common/scripts/install-run.js ================================================ // THIS FILE WAS GENERATED BY A TOOL. ANY MANUAL MODIFICATIONS WILL GET OVERWRITTEN WHENEVER RUSH IS UPGRADED. // // This script is intended for usage in an automated build environment where a Node tool may not have // been preinstalled, or may have an unpredictable version. This script will automatically install the specified // version of the specified tool (if not already installed), and then pass a command-line to it. // An example usage would be: // // node common/scripts/install-run.js qrcode@1.2.2 qrcode https://rushjs.io // // For more information, see: https://rushjs.io/pages/maintainer/setup_new_repo/ // // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See the @microsoft/rush package's LICENSE file for details. /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ 679877: /*!************************************************!*\ !*** ./lib-esnext/utilities/npmrcUtilities.js ***! \************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isVariableSetInNpmrcFile": () => (/* binding */ isVariableSetInNpmrcFile), /* harmony export */ "syncNpmrc": () => (/* binding */ syncNpmrc) /* harmony export */ }); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs */ 657147); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ 371017); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. // IMPORTANT - do not use any non-built-in libraries in this file /** * This function reads the content for given .npmrc file path, and also trims * unusable lines from the .npmrc file. * * @returns * The text of the the .npmrc. */ // create a global _combinedNpmrc for cache purpose const _combinedNpmrcMap = new Map(); function _trimNpmrcFile(options) { const { sourceNpmrcPath, linesToPrepend, linesToAppend } = options; const combinedNpmrcFromCache = _combinedNpmrcMap.get(sourceNpmrcPath); if (combinedNpmrcFromCache !== undefined) { return combinedNpmrcFromCache; } let npmrcFileLines = []; if (linesToPrepend) { npmrcFileLines.push(...linesToPrepend); } if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(sourceNpmrcPath)) { npmrcFileLines.push(...fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync(sourceNpmrcPath).toString().split('\n')); } if (linesToAppend) { npmrcFileLines.push(...linesToAppend); } npmrcFileLines = npmrcFileLines.map((line) => (line || '').trim()); const resultLines = []; // This finds environment variable tokens that look like "${VAR_NAME}" const expansionRegExp = /\$\{([^\}]+)\}/g; // Comment lines start with "#" or ";" const commentRegExp = /^\s*[#;]/; // Trim out lines that reference environment variables that aren't defined for (let line of npmrcFileLines) { let lineShouldBeTrimmed = false; //remove spaces before or after key and value line = line .split('=') .map((lineToTrim) => lineToTrim.trim()) .join('='); // Ignore comment lines if (!commentRegExp.test(line)) { const environmentVariables = line.match(expansionRegExp); if (environmentVariables) { for (const token of environmentVariables) { // Remove the leading "${" and the trailing "}" from the token const environmentVariableName = token.substring(2, token.length - 1); // Is the environment variable defined? if (!process.env[environmentVariableName]) { // No, so trim this line lineShouldBeTrimmed = true; break; } } } } if (lineShouldBeTrimmed) { // Example output: // "; MISSING ENVIRONMENT VARIABLE: //my-registry.com/npm/:_authToken=${MY_AUTH_TOKEN}" resultLines.push('; MISSING ENVIRONMENT VARIABLE: ' + line); } else { resultLines.push(line); } } const combinedNpmrc = resultLines.join('\n'); //save the cache _combinedNpmrcMap.set(sourceNpmrcPath, combinedNpmrc); return combinedNpmrc; } function _copyAndTrimNpmrcFile(options) { const { logger, sourceNpmrcPath, targetNpmrcPath, linesToPrepend, linesToAppend } = options; logger.info(`Transforming ${sourceNpmrcPath}`); // Verbose logger.info(` --> "${targetNpmrcPath}"`); const combinedNpmrc = _trimNpmrcFile({ sourceNpmrcPath, linesToPrepend, linesToAppend }); fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync(targetNpmrcPath, combinedNpmrc); return combinedNpmrc; } function syncNpmrc(options) { const { sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger = { // eslint-disable-next-line no-console info: console.log, // eslint-disable-next-line no-console error: console.error }, createIfMissing = false, linesToAppend, linesToPrepend } = options; const sourceNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(sourceNpmrcFolder, !useNpmrcPublish ? '.npmrc' : '.npmrc-publish'); const targetNpmrcPath = path__WEBPACK_IMPORTED_MODULE_1__.join(targetNpmrcFolder, '.npmrc'); try { if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(sourceNpmrcPath) || createIfMissing) { // Ensure the target folder exists if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(targetNpmrcFolder)) { fs__WEBPACK_IMPORTED_MODULE_0__.mkdirSync(targetNpmrcFolder, { recursive: true }); } return _copyAndTrimNpmrcFile({ sourceNpmrcPath, targetNpmrcPath, logger, linesToAppend, linesToPrepend }); } else if (fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(targetNpmrcPath)) { // If the source .npmrc doesn't exist and there is one in the target, delete the one in the target logger.info(`Deleting ${targetNpmrcPath}`); // Verbose fs__WEBPACK_IMPORTED_MODULE_0__.unlinkSync(targetNpmrcPath); } } catch (e) { throw new Error(`Error syncing .npmrc file: ${e}`); } } function isVariableSetInNpmrcFile(sourceNpmrcFolder, variableKey) { const sourceNpmrcPath = `${sourceNpmrcFolder}/.npmrc`; //if .npmrc file does not exist, return false directly if (!fs__WEBPACK_IMPORTED_MODULE_0__.existsSync(sourceNpmrcPath)) { return false; } const trimmedNpmrcFile = _trimNpmrcFile({ sourceNpmrcPath }); const variableKeyRegExp = new RegExp(`^${variableKey}=`, 'm'); return trimmedNpmrcFile.match(variableKeyRegExp) !== null; } //# sourceMappingURL=npmrcUtilities.js.map /***/ }), /***/ 532081: /*!********************************!*\ !*** external "child_process" ***! \********************************/ /***/ ((module) => { module.exports = require("child_process"); /***/ }), /***/ 657147: /*!*********************!*\ !*** external "fs" ***! \*********************/ /***/ ((module) => { module.exports = require("fs"); /***/ }), /***/ 822037: /*!*********************!*\ !*** external "os" ***! \*********************/ /***/ ((module) => { module.exports = require("os"); /***/ }), /***/ 371017: /*!***********************!*\ !*** external "path" ***! \***********************/ /***/ ((module) => { module.exports = require("path"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { /*!*******************************************!*\ !*** ./lib-esnext/scripts/install-run.js ***! \*******************************************/ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "RUSH_JSON_FILENAME": () => (/* binding */ RUSH_JSON_FILENAME), /* harmony export */ "findRushJsonFolder": () => (/* binding */ findRushJsonFolder), /* harmony export */ "getNpmPath": () => (/* binding */ getNpmPath), /* harmony export */ "installAndRun": () => (/* binding */ installAndRun), /* harmony export */ "runWithErrorAndStatusCode": () => (/* binding */ runWithErrorAndStatusCode) /* harmony export */ }); /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! child_process */ 532081); /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fs */ 657147); /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! os */ 822037); /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! path */ 371017); /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/npmrcUtilities */ 679877); // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. /* eslint-disable no-console */ const RUSH_JSON_FILENAME = 'rush.json'; const RUSH_TEMP_FOLDER_ENV_VARIABLE_NAME = 'RUSH_TEMP_FOLDER'; const INSTALL_RUN_LOCKFILE_PATH_VARIABLE = 'INSTALL_RUN_LOCKFILE_PATH'; const INSTALLED_FLAG_FILENAME = 'installed.flag'; const NODE_MODULES_FOLDER_NAME = 'node_modules'; const PACKAGE_JSON_FILENAME = 'package.json'; /** * Parse a package specifier (in the form of name\@version) into name and version parts. */ function _parsePackageSpecifier(rawPackageSpecifier) { rawPackageSpecifier = (rawPackageSpecifier || '').trim(); const separatorIndex = rawPackageSpecifier.lastIndexOf('@'); let name; let version = undefined; if (separatorIndex === 0) { // The specifier starts with a scope and doesn't have a version specified name = rawPackageSpecifier; } else if (separatorIndex === -1) { // The specifier doesn't have a version name = rawPackageSpecifier; } else { name = rawPackageSpecifier.substring(0, separatorIndex); version = rawPackageSpecifier.substring(separatorIndex + 1); } if (!name) { throw new Error(`Invalid package specifier: ${rawPackageSpecifier}`); } return { name, version }; } let _npmPath = undefined; /** * Get the absolute path to the npm executable */ function getNpmPath() { if (!_npmPath) { try { if (_isWindows()) { // We're on Windows const whereOutput = child_process__WEBPACK_IMPORTED_MODULE_0__.execSync('where npm', { stdio: [] }).toString(); const lines = whereOutput.split(os__WEBPACK_IMPORTED_MODULE_2__.EOL).filter((line) => !!line); // take the last result, we are looking for a .cmd command // see https://github.com/microsoft/rushstack/issues/759 _npmPath = lines[lines.length - 1]; } else { // We aren't on Windows - assume we're on *NIX or Darwin _npmPath = child_process__WEBPACK_IMPORTED_MODULE_0__.execSync('command -v npm', { stdio: [] }).toString(); } } catch (e) { throw new Error(`Unable to determine the path to the NPM tool: ${e}`); } _npmPath = _npmPath.trim(); if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(_npmPath)) { throw new Error('The NPM executable does not exist'); } } return _npmPath; } function _ensureFolder(folderPath) { if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(folderPath)) { const parentDir = path__WEBPACK_IMPORTED_MODULE_3__.dirname(folderPath); _ensureFolder(parentDir); fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(folderPath); } } /** * Create missing directories under the specified base directory, and return the resolved directory. * * Does not support "." or ".." path segments. * Assumes the baseFolder exists. */ function _ensureAndJoinPath(baseFolder, ...pathSegments) { let joinedPath = baseFolder; try { for (let pathSegment of pathSegments) { pathSegment = pathSegment.replace(/[\\\/]/g, '+'); joinedPath = path__WEBPACK_IMPORTED_MODULE_3__.join(joinedPath, pathSegment); if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(joinedPath)) { fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(joinedPath); } } } catch (e) { throw new Error(`Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e}`); } return joinedPath; } function _getRushTempFolder(rushCommonFolder) { const rushTempFolder = process.env[RUSH_TEMP_FOLDER_ENV_VARIABLE_NAME]; if (rushTempFolder !== undefined) { _ensureFolder(rushTempFolder); return rushTempFolder; } else { return _ensureAndJoinPath(rushCommonFolder, 'temp'); } } /** * Compare version strings according to semantic versioning. * Returns a positive integer if "a" is a later version than "b", * a negative integer if "b" is later than "a", * and 0 otherwise. */ function _compareVersionStrings(a, b) { const aParts = a.split(/[.-]/); const bParts = b.split(/[.-]/); const numberOfParts = Math.max(aParts.length, bParts.length); for (let i = 0; i < numberOfParts; i++) { if (aParts[i] !== bParts[i]) { return (Number(aParts[i]) || 0) - (Number(bParts[i]) || 0); } } return 0; } /** * Resolve a package specifier to a static version */ function _resolvePackageVersion(logger, rushCommonFolder, { name, version }) { if (!version) { version = '*'; // If no version is specified, use the latest version } if (version.match(/^[a-zA-Z0-9\-\+\.]+$/)) { // If the version contains only characters that we recognize to be used in static version specifiers, // pass the version through return version; } else { // version resolves to try { const rushTempFolder = _getRushTempFolder(rushCommonFolder); const sourceNpmrcFolder = path__WEBPACK_IMPORTED_MODULE_3__.join(rushCommonFolder, 'config', 'rush'); (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__.syncNpmrc)({ sourceNpmrcFolder, targetNpmrcFolder: rushTempFolder, logger }); const npmPath = getNpmPath(); // This returns something that looks like: // ``` // [ // "3.0.0", // "3.0.1", // ... // "3.0.20" // ] // ``` // // if multiple versions match the selector, or // // ``` // "3.0.0" // ``` // // if only a single version matches. const spawnSyncOptions = { cwd: rushTempFolder, stdio: [], shell: _isWindows() }; const platformNpmPath = _getPlatformPath(npmPath); const npmVersionSpawnResult = child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(platformNpmPath, ['view', `${name}@${version}`, 'version', '--no-update-notifier', '--json'], spawnSyncOptions); if (npmVersionSpawnResult.status !== 0) { throw new Error(`"npm view" returned error code ${npmVersionSpawnResult.status}`); } const npmViewVersionOutput = npmVersionSpawnResult.stdout.toString(); const parsedVersionOutput = JSON.parse(npmViewVersionOutput); const versions = Array.isArray(parsedVersionOutput) ? parsedVersionOutput : [parsedVersionOutput]; let latestVersion = versions[0]; for (let i = 1; i < versions.length; i++) { const latestVersionCandidate = versions[i]; if (_compareVersionStrings(latestVersionCandidate, latestVersion) > 0) { latestVersion = latestVersionCandidate; } } if (!latestVersion) { throw new Error('No versions found for the specified version range.'); } return latestVersion; } catch (e) { throw new Error(`Unable to resolve version ${version} of package ${name}: ${e}`); } } } let _rushJsonFolder; /** * Find the absolute path to the folder containing rush.json */ function findRushJsonFolder() { if (!_rushJsonFolder) { let basePath = __dirname; let tempPath = __dirname; do { const testRushJsonPath = path__WEBPACK_IMPORTED_MODULE_3__.join(basePath, RUSH_JSON_FILENAME); if (fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(testRushJsonPath)) { _rushJsonFolder = basePath; break; } else { basePath = tempPath; } } while (basePath !== (tempPath = path__WEBPACK_IMPORTED_MODULE_3__.dirname(basePath))); // Exit the loop when we hit the disk root if (!_rushJsonFolder) { throw new Error(`Unable to find ${RUSH_JSON_FILENAME}.`); } } return _rushJsonFolder; } /** * Detects if the package in the specified directory is installed */ function _isPackageAlreadyInstalled(packageInstallFolder) { try { const flagFilePath = path__WEBPACK_IMPORTED_MODULE_3__.join(packageInstallFolder, INSTALLED_FLAG_FILENAME); if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(flagFilePath)) { return false; } const fileContents = fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync(flagFilePath).toString(); return fileContents.trim() === process.version; } catch (e) { return false; } } /** * Delete a file. Fail silently if it does not exist. */ function _deleteFile(file) { try { fs__WEBPACK_IMPORTED_MODULE_1__.unlinkSync(file); } catch (err) { if (err.code !== 'ENOENT' && err.code !== 'ENOTDIR') { throw err; } } } /** * Removes the following files and directories under the specified folder path: * - installed.flag * - * - node_modules */ function _cleanInstallFolder(rushTempFolder, packageInstallFolder, lockFilePath) { try { const flagFile = path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, INSTALLED_FLAG_FILENAME); _deleteFile(flagFile); const packageLockFile = path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, 'package-lock.json'); if (lockFilePath) { fs__WEBPACK_IMPORTED_MODULE_1__.copyFileSync(lockFilePath, packageLockFile); } else { // Not running `npm ci`, so need to cleanup _deleteFile(packageLockFile); const nodeModulesFolder = path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME); if (fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(nodeModulesFolder)) { const rushRecyclerFolder = _ensureAndJoinPath(rushTempFolder, 'rush-recycler'); fs__WEBPACK_IMPORTED_MODULE_1__.renameSync(nodeModulesFolder, path__WEBPACK_IMPORTED_MODULE_3__.join(rushRecyclerFolder, `install-run-${Date.now().toString()}`)); } } } catch (e) { throw new Error(`Error cleaning the package install folder (${packageInstallFolder}): ${e}`); } } function _createPackageJson(packageInstallFolder, name, version) { try { const packageJsonContents = { name: 'ci-rush', version: '0.0.0', dependencies: { [name]: version }, description: "DON'T WARN", repository: "DON'T WARN", license: 'MIT' }; const packageJsonPath = path__WEBPACK_IMPORTED_MODULE_3__.join(packageInstallFolder, PACKAGE_JSON_FILENAME); fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync(packageJsonPath, JSON.stringify(packageJsonContents, undefined, 2)); } catch (e) { throw new Error(`Unable to create package.json: ${e}`); } } /** * Run "npm install" in the package install folder. */ function _installPackage(logger, packageInstallFolder, name, version, command) { try { logger.info(`Installing ${name}...`); const npmPath = getNpmPath(); const platformNpmPath = _getPlatformPath(npmPath); const result = child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(platformNpmPath, [command], { stdio: 'inherit', cwd: packageInstallFolder, env: process.env, shell: _isWindows() }); if (result.status !== 0) { throw new Error(`"npm ${command}" encountered an error`); } logger.info(`Successfully installed ${name}@${version}`); } catch (e) { throw new Error(`Unable to install package: ${e}`); } } /** * Get the ".bin" path for the package. */ function _getBinPath(packageInstallFolder, binName) { const binFolderPath = path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); const resolvedBinName = _isWindows() ? `${binName}.cmd` : binName; return path__WEBPACK_IMPORTED_MODULE_3__.resolve(binFolderPath, resolvedBinName); } /** * Returns a cross-platform path - windows must enclose any path containing spaces within double quotes. */ function _getPlatformPath(platformPath) { return _isWindows() && platformPath.includes(' ') ? `"${platformPath}"` : platformPath; } function _isWindows() { return os__WEBPACK_IMPORTED_MODULE_2__.platform() === 'win32'; } /** * Write a flag file to the package's install directory, signifying that the install was successful. */ function _writeFlagFile(packageInstallFolder) { try { const flagFilePath = path__WEBPACK_IMPORTED_MODULE_3__.join(packageInstallFolder, INSTALLED_FLAG_FILENAME); fs__WEBPACK_IMPORTED_MODULE_1__.writeFileSync(flagFilePath, process.version); } catch (e) { throw new Error(`Unable to create installed.flag file in ${packageInstallFolder}`); } } function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) { const rushJsonFolder = findRushJsonFolder(); const rushCommonFolder = path__WEBPACK_IMPORTED_MODULE_3__.join(rushJsonFolder, 'common'); const rushTempFolder = _getRushTempFolder(rushCommonFolder); const packageInstallFolder = _ensureAndJoinPath(rushTempFolder, 'install-run', `${packageName}@${packageVersion}`); if (!_isPackageAlreadyInstalled(packageInstallFolder)) { // The package isn't already installed _cleanInstallFolder(rushTempFolder, packageInstallFolder, lockFilePath); const sourceNpmrcFolder = path__WEBPACK_IMPORTED_MODULE_3__.join(rushCommonFolder, 'config', 'rush'); (0,_utilities_npmrcUtilities__WEBPACK_IMPORTED_MODULE_4__.syncNpmrc)({ sourceNpmrcFolder, targetNpmrcFolder: packageInstallFolder, logger }); _createPackageJson(packageInstallFolder, packageName, packageVersion); const command = lockFilePath ? 'ci' : 'install'; _installPackage(logger, packageInstallFolder, packageName, packageVersion, command); _writeFlagFile(packageInstallFolder); } const statusMessage = `Invoking "${packageBinName} ${packageBinArgs.join(' ')}"`; const statusMessageLine = new Array(statusMessage.length + 1).join('-'); logger.info('\n' + statusMessage + '\n' + statusMessageLine + '\n'); const binPath = _getBinPath(packageInstallFolder, packageBinName); const binFolderPath = path__WEBPACK_IMPORTED_MODULE_3__.resolve(packageInstallFolder, NODE_MODULES_FOLDER_NAME, '.bin'); // Windows environment variables are case-insensitive. Instead of using SpawnSyncOptions.env, we need to // assign via the process.env proxy to ensure that we append to the right PATH key. const originalEnvPath = process.env.PATH || ''; let result; try { // `npm` bin stubs on Windows are `.cmd` files // Node.js will not directly invoke a `.cmd` file unless `shell` is set to `true` const platformBinPath = _getPlatformPath(binPath); process.env.PATH = [binFolderPath, originalEnvPath].join(path__WEBPACK_IMPORTED_MODULE_3__.delimiter); result = child_process__WEBPACK_IMPORTED_MODULE_0__.spawnSync(platformBinPath, packageBinArgs, { stdio: 'inherit', windowsVerbatimArguments: false, shell: _isWindows(), cwd: process.cwd(), env: process.env }); } finally { process.env.PATH = originalEnvPath; } if (result.status !== null) { return result.status; } else { throw result.error || new Error('An unknown error occurred.'); } } function runWithErrorAndStatusCode(logger, fn) { process.exitCode = 1; try { const exitCode = fn(); process.exitCode = exitCode; } catch (e) { logger.error('\n\n' + e.toString() + '\n\n'); } } function _run() { const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, rawPackageSpecifier /* qrcode@^1.2.0 */, packageBinName /* qrcode */, ...packageBinArgs /* [-f, myproject/lib] */] = process.argv; if (!nodePath) { throw new Error('Unexpected exception: could not detect node path'); } if (path__WEBPACK_IMPORTED_MODULE_3__.basename(scriptPath).toLowerCase() !== 'install-run.js') { // If install-run.js wasn't directly invoked, don't execute the rest of this function. Return control // to the script that (presumably) imported this file return; } if (process.argv.length < 4) { console.log('Usage: install-run.js @ [args...]'); console.log('Example: install-run.js qrcode@1.2.2 qrcode https://rushjs.io'); process.exit(1); } const logger = { info: console.log, error: console.error }; runWithErrorAndStatusCode(logger, () => { const rushJsonFolder = findRushJsonFolder(); const rushCommonFolder = _ensureAndJoinPath(rushJsonFolder, 'common'); const packageSpecifier = _parsePackageSpecifier(rawPackageSpecifier); const name = packageSpecifier.name; const version = _resolvePackageVersion(logger, rushCommonFolder, packageSpecifier); if (packageSpecifier.version !== version) { console.log(`Resolved to ${name}@${version}`); } return installAndRun(logger, name, version, packageBinName, packageBinArgs); }); } _run(); //# sourceMappingURL=install-run.js.map })(); module.exports = __webpack_exports__; /******/ })() ; //# sourceMappingURL=install-run.js.map ================================================ FILE: eslint.config.js ================================================ import eslintConfigPrettier from "eslint-config-prettier"; import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; import typescriptEslint from "typescript-eslint"; export default [ eslintConfigPrettier, { //extends: ["eslint:recommended", "plugin:prettier/recommended"], plugins: { eslintPluginPrettierRecommended }, rules: {}, files: ["**/*.jsx", "**/*.tsx", "**/*.js", "**/*.ts"], settings: { "import/resolver": { node: { extensions: [".js", ".jsx", ".ts", ".tsx", ".mjs"], }, }, }, }, ...typescriptEslint.configs.recommended, { ignores: ["**/es/", "**/dist/", "**/lib/", "**/node_modules/"], }, ]; ================================================ FILE: package.json ================================================ { "name": "f6", "private": true, "workspaces": [ "packages/core", "packages/hammer", "packages/element", "packages/f6-ui", "packages/plugin", "packages/site", "packages/f6", "packages/f6-alipay", "packages/f6-wx" ], "scripts": { "build:site": "cd ./packages/site && npm run start", "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", "pretty-quick": "pretty-quick", "clean:modules": "rimraf node_modules", "prepare": "simple-git-hooks", "update": "rush update", "build": "rush build", "dev": "cd packages/f6 && npm run storybook" }, "lint-staged": { "*.{js,jsx,tsx,ts,less,md,json}": [ "pretty-quick —-staged" ] }, "devDependencies": { "@eslint/compat": "^1.1.0", "@eslint/js": "^9.5.0", "eslint": "^9.5.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-react": "^7.34.3", "install-peerdeps": "^3.0.3", "jest": "^27.5.1", "lint-staged": "^15.2.7", "node-gyp": "^10.1.0", "postcss-lit": "^1.1.1", "pre-commit": "^1.2.2", "prettier": "3.3.2", "pretty-quick": "^4.0.0", "react-scripts": "3.1.2", "rimraf": "^5.0.7", "simple-git-hooks": "^2.11.1", "stylelint": "^16.6.1", "stylelint-config-standard": "^36.0.1", "stylelint-prettier": "^5.0.0", "typescript-eslint": "^7.13.1" }, "resolutions": { "@types/react": "^16.9.35" }, "repository": "https://github.com/antvis/F6.git", "simple-git-hooks": { "pre-commit": "pretty-quick --staged" } } ================================================ FILE: packages/core/jest.config.js ================================================ module.exports = { preset: "ts-jest", testEnvironment: "node", transform: { "^.+\\.(ts|tsx)$": [ "ts-jest", { tsconfig: "tsconfig.json", }, ], }, testMatch: [ "**/tests/unit/**/*.ts", // Ensure this matches the path to your test files ], // Other configurations... }; ================================================ FILE: packages/core/package.json ================================================ { "name": "@antv/f6-core", "version": "0.0.2", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", "g6", "graph", "graph analysis", "graph editor", "graph visualization", "relational data" ], "homepage": "https://g6.antv.vision", "bugs": { "url": "https://github.com/antvis/f6/issues" }, "repository": { "type": "git", "url": "https://github.com/antvis/f6" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "types": "lib/index.d.ts", "files": [ "package.json", "es", "lib", "dist", "LICENSE", "README.md" ], "scripts": { "build": "vite build", "clean": "rimraf dist", "test": "jest" }, "dependencies": { "@antv/algorithm": "^0.1.8", "@antv/dom-util": "^2.0.1", "@antv/event-emitter": "~0.1.0", "@antv/g-base": "^0.5.9", "@antv/g-math": "^0.1.1", "@antv/g-mobile": "^0.0.13", "@antv/matrix-util": "^3.0.4", "@antv/path-util": "^2.0.3", "@antv/util": "~2.0.5", "ml-matrix": "^6.5.0", "tslib": "^2.1.0", "@vitejs/plugin-react": "~4.3.1" }, "devDependencies": { "vite": "~5.3.1", "@vitejs/plugin-react": "~4.3.1", "jest": "~29.7.0", "@types/jest": "~29.5.12", "ts-jest": "~29.1.5", "typescript": "4.3" } } ================================================ FILE: packages/core/src/behavior/behavior.ts ================================================ import { clone, each, wrapBehavior } from "@antv/util"; import { BehaviorOption } from "../types"; import behaviorOption from "./behaviorOption"; export default class Behavior { // 所有自定义的 Behavior 的实例 private static types = {}; /** * 自定义 Behavior * @param type Behavior 名称 * @param behavior Behavior 定义的方法集合 */ public static registerBehavior(type: string, behavior: BehaviorOption) { if (!behavior) { throw new Error(`please specify handler for this behavior: ${type}`); } const prototype = clone(behaviorOption); Object.assign(prototype, behavior); // eslint-disable-next-line func-names const base = function (cfg: any) { Object.assign(this, this.getDefaultCfg(), cfg); const events = this.getEvents(); this.events = null; const eventsToBind = {}; if (events) { each(events, (handle, event) => { eventsToBind[event] = wrapBehavior(this, handle); }); this.events = eventsToBind; } }; base.prototype = prototype; Behavior.types[type] = base; } public static hasBehavior(type: string) { return !!Behavior.types[type]; } public static getBehavior(type: string) { return Behavior.types[type]; } } ================================================ FILE: packages/core/src/behavior/behaviorOption.ts ================================================ import { each } from "@antv/util"; import { IAbstractGraph } from "../interface/graph"; import { G6Event } from "../types"; // 自定义 Behavior 时候共有的方法 export default { getDefaultCfg() { return {}; }, /** * register event handler, behavior will auto bind events * for example: * return { * click: 'onClick' * } */ getEvents() { return {}; }, updateCfg(cfg: object) { Object.assign(this, cfg); return true; }, shouldBegin() { return true; }, shouldUpdate() { return true; }, shouldEnd() { return true; }, /** * auto bind events when register behavior * @param graph Graph instance */ bind(graph: IAbstractGraph) { const { events } = this; this.graph = graph; if ( this.type === "drag-canvas" || this.type === "brush-select" || this.type === "lasso-select" ) { graph.get("canvas").set("draggable", true); } each(events, (handler: () => void, event: G6Event) => { graph.on(event, handler); }); }, unbind(graph: IAbstractGraph) { const { events } = this; if ( this.type === "drag-canvas" || this.type === "brush-select" || this.type === "lasso-select" ) { graph.get("canvas").set("draggable", false); } each(events, (handler: () => void, event: G6Event) => { graph.off(event, handler); }); }, get(val: string) { return (this as any)[val]; }, set(key: string, val: any) { (this as any)[key] = val; return this; }, }; ================================================ FILE: packages/core/src/behavior/index.ts ================================================ import Behavior from "./behavior"; export default Behavior; ================================================ FILE: packages/core/src/element/arrow.ts ================================================ export default { triangle: (width: number = 10, length: number = 15, d: number = 0) => { const begin = d * 2; const path = `M ${begin},0 L ${begin + length},-${width / 2} L ${ begin + length },${width / 2} Z`; return path; }, vee: (width: number = 15, length: number = 20, d: number = 0) => { const begin = d * 2; const path = `M ${begin},0 L ${begin + length},-${width / 2} L ${begin + (2 * length) / 3},0 L ${begin + length},${width / 2} Z`; return path; }, circle: (r: number = 5, d: number = 0) => { const begin = d * 2; const path = `M ${begin}, 0 a ${r},${r} 0 1,0 ${r * 2},0 a ${r},${r} 0 1,0 ${-r * 2},0`; return path; }, rect: (width: number = 10, length: number = 10, d: number = 0) => { const begin = d * 2; const path = `M ${begin},${-width / 2} L ${begin + length},${-width / 2} L ${begin + length},${width / 2} L ${begin},${width / 2} Z`; return path; }, diamond: (width: number = 15, length: number = 15, d: number = 0) => { const begin = d * 2; const path = `M ${begin},0 L ${begin + length / 2},${-width / 2} L ${begin + length},0 L ${begin + length / 2},${width / 2} Z`; return path; }, triangleRect: ( tWidth: number = 15, tLength: number = 15, rWidth: number = 15, rLength: number = 3, gap: number = 5, d: number = 0, ) => { const begin = d * 2; const rectBegin = begin + tLength + gap; const path = `M ${begin},0 L ${begin + tLength},-${tWidth / 2} L ${ begin + tLength },${tWidth / 2} Z M ${rectBegin}, -${rWidth / 2} L ${rectBegin + rLength} -${rWidth / 2} L ${rectBegin + rLength} ${rWidth / 2} L ${rectBegin} ${rWidth / 2} Z`; return path; }, }; ================================================ FILE: packages/core/src/element/combo.ts ================================================ /** * @fileOverview common combo shape * @author shiwu.wyy@antfin.com */ import { IGroup, IShape } from "@antv/g-base"; import { isArray, isNil, clone } from "@antv/util"; import { ILabelConfig, ShapeOptions } from "../interface/shape"; import { Item, LabelStyle, NodeConfig, ModelConfig, ShapeStyle, } from "../types"; import Global from "../global"; import Shape from "./shape"; import { shapeBase } from "./shapeBase"; const singleCombo: ShapeOptions = { itemType: "combo", // 单个图形的类型 shapeType: "single-combo", /** * Combo 标题文本相对图形的位置,默认为 top * 位置包括: top, bottom, left, right, center * @type {String} */ labelPosition: "top", /** * 标题文本相对偏移,当 labelPosition 不为 center 时有效 * @type {Number} */ refX: Global.comboLabel.refX, refY: Global.comboLabel.refY, options: { style: { stroke: Global.defaultCombo.style.stroke, fill: Global.defaultCombo.style.fill, lineWidth: Global.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: Global.comboLabel.style.fill, fontSize: Global.comboLabel.style.fontSize, }, }, stateStyles: { ...Global.comboStateStyles, }, }, /** * 获取 Combo 宽高 * @internal 返回 Combo 的大小,以 [width, height] 的方式维护 * @param {Object} cfg Combo 的配置项 * @return {Array} 宽高 */ getSize(cfg: ModelConfig): number[] { let size: number | number[] = clone( cfg.size || this.options!.size || Global.defaultCombo.size, ); // size 是数组,若长度为 1,则补长度为 2 if (isArray(size) && size.length === 1) { size = [size[0], size[0]]; } // size 为数字,则转换为数组 if (!isArray(size)) { size = [size, size]; } return size; }, // 私有方法,不希望扩展的 Combo 复写这个方法 getLabelStyleByPosition(cfg: NodeConfig, labelCfg: ILabelConfig): LabelStyle { const labelPosition = labelCfg.position || this.labelPosition; const { style: cfgStyle } = cfg; let padding: number | number[] = cfg.padding || this.options.padding; if (isArray(padding)) padding = padding[0]; let { refX, refY } = labelCfg; // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refX if (isNil(refX)) { refX = this.refX as number; // 不居中时的偏移量 } if (isNil(refY)) { refY = this.refY as number; // 不居中时的偏移量 } const size = this.getSize!(cfg as ModelConfig); const r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2; const dis = r + padding; let style: any; switch (labelPosition) { case "top": style = { x: 0, y: -dis - (refY as number), textBaseline: "bottom", // 文本在图形的上方 textAlign: "center", }; break; case "bottom": style = { x: 0, y: dis + (refY as number), textBaseline: "bottom", textAlign: "center", }; break; case "left": style = { x: -dis + (refX as number), y: 0, textAlign: "left", }; break; case "center": style = { x: 0, y: 0, text: cfg!.label, textAlign: "center", }; break; default: style = { x: dis + (refX as number), y: 0, textAlign: "right", }; break; } style.text = cfg.label; return style; }, drawShape(cfg: NodeConfig, group: IGroup): IShape { const { shapeType } = this; // || this.type,都已经加了 shapeType const style = this.getShapeStyle!(cfg); const shape = group.addShape(shapeType, { attrs: style, draggable: true, name: "combo-shape", }); return shape; }, updateShape(cfg: NodeConfig, item: Item, keyShapeStyle: ShapeStyle) { const keyShape = item.get("keyShape"); const animate = cfg.animate === undefined ? this.options.animate : cfg.animate; if (animate && keyShape.animate) { keyShape.animate(keyShapeStyle, { duration: 200, easing: "easeLinear", }); } else { keyShape.attr({ ...keyShapeStyle, }); } (this as any).updateLabel(cfg, item); // special for some types of nodes }, }; const singleComboDef = { ...shapeBase, ...singleCombo }; Shape.registerCombo("single-combo", singleComboDef); ================================================ FILE: packages/core/src/element/combos/circle.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { Item, ComboConfig, ShapeStyle } from "../../types"; import Global from "../../global"; import Shape from "../shape"; import { ShapeOptions } from "../../interface/shape"; import { isNumber, clone, mix, isArray } from "@antv/util"; // 圆形 Combo Shape.registerCombo( "circle", { // 自定义节点时的配置 options: { size: [Global.defaultCombo.size[0], Global.defaultCombo.size[0]], padding: Global.defaultCombo.padding[0], animate: true, style: { stroke: Global.defaultCombo.style.stroke, fill: Global.defaultCombo.style.fill, lineWidth: Global.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: Global.comboLabel.style.fill, fontSize: Global.comboLabel.style.fontSize, }, refX: 0, refY: 0, }, stateStyles: { ...Global.comboStateStyles, }, }, shapeType: "circle", // 文本位置 labelPosition: "top", drawShape(cfg: ComboConfig, group: IGroup): IShape { const style = this.getShapeStyle!(cfg); delete style.height; delete style.width; const keyShape: IShape = group.addShape("circle", { attrs: style, className: "circle-combo", name: "circle-combo", draggable: true, }); return keyShape; }, /** * 获取 Combo 的样式,供基于该 Combo 自定义时使用 * @param {Object} cfg Combo 数据模型 * @return {Object} Combo 的样式 */ getShapeStyle(cfg: ComboConfig): ShapeStyle { const { style: defaultStyle } = this.options as ComboConfig; let padding: number | number[] = cfg.padding || this.options.padding; if (isArray(padding)) padding = padding[0]; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle, cfg.style); let r: number; if (cfg.fixSize) { r = isNumber(cfg.fixSize) ? cfg.fixSize : cfg.fixSize[0]; } else { const size = (this as ShapeOptions).getSize!(cfg); if (!isNumber(style.r) || isNaN(style.r)) r = size[0] / 2 || Global.defaultCombo.style.r; else r = Math.max(style.r, size[0] / 2) || size[0] / 2; } style.r = r + padding; const styles = { x: 0, y: 0, ...style, }; if (cfg.style) cfg.style.r = r; else { cfg.style = { r }; } return styles; }, update(cfg: ComboConfig, item: Item) { const size = (this as ShapeOptions).getSize!(cfg); let padding: number | number[] = cfg.padding || this.options.padding; if (isArray(padding)) padding = padding[0]; const cfgStyle = clone(cfg.style); let r; if (cfg.fixSize) { r = isNumber(cfg.fixSize) ? cfg.fixSize : cfg.fixSize[0]; } else { r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2; } cfgStyle.r = r + padding; const itemCacheSize = item.get("sizeCache"); if (itemCacheSize) { itemCacheSize.r = cfgStyle.r; } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); const style = mix({}, keyShape.attr(), strokeStyle, cfgStyle); if (cfg.style) cfg.style.r = r; else { cfg.style = { r }; } (this as any).updateShape(cfg, item, style, true); }, }, "single-combo", ); ================================================ FILE: packages/core/src/element/combos/index.ts ================================================ import "./circle"; import "./rect"; ================================================ FILE: packages/core/src/element/combos/rect.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { mix, isNumber, clone, isNil } from "@antv/util"; import { LabelStyle, Item, ComboConfig, ShapeStyle } from "../../types"; import Global from "../../global"; import Shape from "../shape"; import { ILabelConfig, ShapeOptions } from "../../interface/shape"; Shape.registerCombo( "rect", { // 自定义 Combo 时的配置 options: { size: [40, 5], padding: [25, 20, 15, 20], animate: true, style: { radius: 0, stroke: Global.defaultCombo.style.stroke, fill: Global.defaultCombo.style.fill, lineWidth: Global.defaultCombo.style.lineWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.comboLabel.style.fill, fontSize: Global.comboLabel.style.fontSize, }, }, // 连接点,默认为左右 anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: { ...Global.comboStateStyles, }, }, shapeType: "rect", labelPosition: "top", drawShape(cfg: ComboConfig, group: IGroup): IShape { const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("rect", { attrs: style, className: "rect-combo", name: "rect-combo", draggable: true, }); return keyShape; }, // 私有方法,不希望扩展的 Combo 复写这个方法 getLabelStyleByPosition( cfg: ComboConfig, labelCfg: ILabelConfig, ): LabelStyle { const labelPosition = labelCfg.position || this.labelPosition; const { style: cfgStyle } = cfg; let padding = cfg.padding || this.options.padding; if (isNumber(padding)) padding = [padding, padding, padding, padding]; let { refX, refY } = labelCfg; // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refY if (isNil(refX)) { refX = this.refX as number; // 不居中时的偏移量 } if (isNil(refY)) { refY = this.refY as number; // 不居中时的偏移量 } const leftDis = cfgStyle.width / 2 + padding[3]; const topDis = cfgStyle.height / 2 + padding[0]; let style: any; switch (labelPosition) { case "top": style = { x: 0 - leftDis + refX, y: 0 - topDis + refY, textBaseline: "top", // 文本在图形的上方 textAlign: "left", }; break; case "bottom": style = { x: 0, y: topDis + refY, textBaseline: "bottom", textAlign: "center", }; break; case "left": style = { x: 0 - leftDis + refY, y: 0, textAlign: "left", }; break; case "center": style = { x: 0, y: 0, text: cfg!.label, textAlign: "center", }; break; default: style = { x: leftDis + refX, y: 0, textAlign: "right", }; break; } style.text = cfg.label; return style; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: ComboConfig) { const { style: defaultStyle } = this.options as ComboConfig; let padding: number | number[] = cfg.padding || this.options.padding; if (isNumber(padding)) padding = [padding, padding, padding, padding]; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle, cfg.style); const size = (this as ShapeOptions).getSize!(cfg); let width: number; let height: number; const fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize; if (fixSize) { if (isNumber(fixSize)) { width = fixSize; height = fixSize; } else { width = fixSize[0]; height = fixSize[1]; } } else { if (!isNumber(style.width) || isNaN(style.width)) width = size[0] || Global.defaultCombo.style.width; else width = Math.max(style.width, size[0]) || size[0]; if (!isNumber(style.height) || isNaN(style.height)) height = size[1] || Global.defaultCombo.style.height; else height = Math.max(style.height, size[1]) || size[1]; } const x = -width / 2 - padding[3]; const y = -height / 2 - padding[0]; style.width = width + padding[1] + padding[3]; style.height = height + padding[0] + padding[2]; const styles = { x, y, ...style, }; if (!cfg.style) { cfg.style = { width, height, }; } else { cfg.style.width = width; cfg.style.height = height; } return styles; }, update(cfg: ComboConfig, item: Item) { const size = (this as ShapeOptions).getSize!(cfg); let padding: number | number[] = cfg.padding || this.options.padding; if (isNumber(padding)) padding = [padding, padding, padding, padding]; const cfgStyle = clone(cfg.style); let width, height; const fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize; if (fixSize) { if (isNumber(fixSize)) { width = fixSize; height = fixSize; } else { width = fixSize[0]; height = fixSize[1]; } } else { width = Math.max(cfgStyle.width, size[0]) || size[0]; height = Math.max(cfgStyle.height, size[1]) || size[1]; } cfgStyle.width = width + padding[1] + padding[3]; cfgStyle.height = height + padding[0] + padding[2]; const itemCacheSize = item.get("sizeCache"); if (itemCacheSize) { itemCacheSize.width = cfgStyle.width; itemCacheSize.height = cfgStyle.height; } cfgStyle.x = -width / 2 - padding[3]; cfgStyle.y = -height / 2 - padding[0]; // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); const style = mix({}, keyShape.attr(), strokeStyle, cfgStyle); if (cfg.style) { cfg.style.width = width; cfg.style.height = height; } else { cfg.style = { width, height }; } (this as any).updateShape(cfg, item, style, false); }, updateShape(cfg: ComboConfig, item: Item, keyShapeStyle: object) { const keyShape = item.get("keyShape"); const animate = cfg.animate === undefined ? this.options.animate : cfg.animate; if (animate && keyShape.animate) { keyShape.animate(keyShapeStyle, { duration: 200, easing: "easeLinear", }); } else { keyShape.attr({ ...keyShapeStyle, }); } (this as any).updateLabel(cfg, item); }, }, "single-combo", ); ================================================ FILE: packages/core/src/element/edge.ts ================================================ /** * @fileOverview 自定义边 * @description 自定义边中有大量逻辑同自定义节点重复,虽然可以提取成为 mixin ,但是考虑到代码的可读性,还是单独实现。 */ import { IGroup, IShape, IElement, Point } from "@antv/g-base"; import { deepMix, mix, each, isNil, isNumber, isArray } from "@antv/util"; import { ILabelConfig, ShapeOptions } from "../interface/shape"; import { EdgeConfig, EdgeData, IPoint, LabelStyle, ShapeStyle, Item, ModelConfig, } from "../types"; import { getLabelPosition, getLoopCfgs } from "../util/graphic"; import { distance, getCircleCenterByPoints } from "../util/math"; import { getControlPoint, getSpline } from "../util/path"; import Global from "../global"; import Shape from "./shape"; import { shapeBase, CLS_LABEL_BG_SUFFIX } from "./shapeBase"; const CLS_SHAPE = "edge-shape"; // start,end 倒置,center 不变 function revertAlign(labelPosition: string): string { let textAlign = labelPosition; if (labelPosition === "start") { textAlign = "end"; } else if (labelPosition === "end") { textAlign = "start"; } return textAlign; } const singleEdge: ShapeOptions = { itemType: "edge", /** * 文本的位置 * @type {String} */ labelPosition: "center", // start, end, center /** * 文本的 x 偏移 * @type {Number} */ refX: 0, /** * 文本的 y 偏移 * @type {Number} */ refY: 0, /** * 文本是否跟着线自动旋转,默认 false * @type {Boolean} */ labelAutoRotate: false, // 自定义边时的配置 options: { size: Global.defaultEdge.size, style: { x: 0, y: 0, stroke: Global.defaultEdge.style.stroke, lineAppendWidth: Global.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: Global.edgeLabel.style.fill, fontSize: Global.edgeLabel.style.fontSize, }, }, stateStyles: { ...Global.edgeStateStyles, }, }, /** * 获取边的 path * @internal 供扩展的边覆盖 * @param {Array} points 构成边的点的集合 * @return {Array} 构成 path 的数组 */ getPath(points: Point[]): Array> { const path: Array> = []; each(points, (point: Point, index: number) => { if (index === 0) { path.push(["M", point.x, point.y]); } else { path.push(["L", point.x, point.y]); } }); return path; }, getShapeStyle(cfg: EdgeConfig): ShapeStyle { const { style: defaultStyle } = this.options as ModelConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style: ShapeStyle = mix({}, defaultStyle, strokeStyle, cfg.style); const size = cfg.size || Global.defaultEdge.size; cfg = this.getPathPoints!(cfg); const { startPoint, endPoint } = cfg; const controlPoints = this.getControlPoints!(cfg); let points = [startPoint]; // 添加起始点 // 添加控制点 if (controlPoints) { points = points.concat(controlPoints); } // 添加结束点 points.push(endPoint); const path = (this as any).getPath(points); const styles = mix( {}, Global.defaultEdge.style as ShapeStyle, { stroke: Global.defaultEdge.color, lineWidth: size, path, } as ShapeStyle, style, ); return styles; }, updateShapeStyle(cfg: EdgeConfig, item: Item) { const group = item.getContainer(); const strokeStyle: ShapeStyle = { stroke: cfg.color, }; const shape = group.find((element) => element.get("className") === "edge-shape") || item.getKeyShape(); const { size } = cfg; cfg = this.getPathPoints!(cfg); const { startPoint, endPoint } = cfg; const controlPoints = this.getControlPoints!(cfg); // || cfg.controlPoints; let points = [startPoint]; // 添加起始点 // 添加控制点 if (controlPoints) { points = points.concat(controlPoints); } // 添加结束点 points.push(endPoint); const currentAttr = shape.attr(); const previousStyle = mix({}, strokeStyle, currentAttr, cfg.style); const source = cfg.sourceNode; const target = cfg.targetNode; let routeCfg: { [key: string]: unknown } = { radius: previousStyle.radius }; if (!controlPoints) { routeCfg = { source, target, offset: previousStyle.offset, radius: previousStyle.radius, }; } if (currentAttr.endArrow && previousStyle.endArrow === false) { cfg.style.endArrow = { path: "", }; } if (currentAttr.startArrow && previousStyle.startArrow === false) { cfg.style.startArrow = { path: "", }; } const path = (this as any).getPath(points, routeCfg); const style = mix( strokeStyle, shape.attr(), { lineWidth: size, path, }, cfg.style, ); if (shape) { shape.attr(style); } }, getLabelStyleByPosition( cfg: EdgeConfig, labelCfg: ILabelConfig, group?: IGroup, ): LabelStyle { const labelPosition = labelCfg.position || this.labelPosition; // 文本的位置用户可以传入 const style: LabelStyle = {}; const pathShape = group && group.find((element) => element.get("className") === CLS_SHAPE); // 不对 pathShape 进行判空,如果线不存在,说明有问题了 let pointPercent; if (labelPosition === "start") { pointPercent = 0; } else if (labelPosition === "end") { pointPercent = 1; } else { pointPercent = 0.5; } // 偏移量 const offsetX = labelCfg.refX || (this.refX as number); const offsetY = labelCfg.refY || (this.refY as number); // 如果两个节点重叠,线就变成了一个点,这时候label的位置,就是这个点 + 绝对偏移 if ( cfg.startPoint!.x === cfg.endPoint!.x && cfg.startPoint!.y === cfg.endPoint!.y ) { style.x = cfg.startPoint!.x + offsetX; style.y = cfg.startPoint!.y + offsetY; style.text = cfg.label as string; return style; } let autoRotate; if (isNil(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate; else autoRotate = labelCfg.autoRotate; const offsetStyle = getLabelPosition( pathShape, pointPercent, offsetX, offsetY, autoRotate as boolean, ); style.x = offsetStyle.x; style.y = offsetStyle.y; style.rotate = offsetStyle.rotate; style.textAlign = this._getTextAlign!( labelPosition as string, offsetStyle.angle as number, ); style.text = cfg.label as string; return style; }, getLabelBgStyleByPosition( label: IElement, cfg: EdgeConfig, labelCfg?: ILabelConfig, group?: IGroup, ) { if (!label) { return {}; } const bbox = label.getBBox(); const backgroundStyle = labelCfg.style && labelCfg.style.background; if (!backgroundStyle) { return {}; } const { padding } = backgroundStyle; const backgroundWidth = bbox.width + padding[1] + padding[3]; const backgroundHeight = bbox.height + padding[0] + padding[2]; const labelPosition = labelCfg.position || this.labelPosition; const style = { ...backgroundStyle, width: backgroundWidth, height: backgroundHeight, x: bbox.minX - padding[2], y: bbox.minY - padding[0], rotate: 0, }; let autoRotate; if (isNil(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate; else autoRotate = labelCfg.autoRotate; const pathShape = group && group.find((element) => element.get("className") === CLS_SHAPE); // 不对 pathShape 进行判空,如果线不存在,说明有问题了 let pointPercent; if (labelPosition === "start") { pointPercent = 0; } else if (labelPosition === "end") { pointPercent = 1; } else { pointPercent = 0.5; } // 偏移量 const offsetX = labelCfg.refX || (this.refX as number); const offsetY = labelCfg.refY || (this.refY as number); // // 如果两个节点重叠,线就变成了一个点,这时候label的位置,就是这个点 + 绝对偏移 if ( cfg.startPoint!.x === cfg.endPoint!.x && cfg.startPoint!.y === cfg.endPoint!.y ) { style.x = cfg.startPoint!.x + offsetX - backgroundWidth / 2; style.y = cfg.startPoint!.y + offsetY - backgroundHeight / 2; return style; } let offsetStyle = getLabelPosition( pathShape, pointPercent, offsetX - backgroundWidth / 2, offsetY + backgroundHeight / 2, autoRotate, ); const rad = offsetStyle.angle; if (rad > (1 / 2) * Math.PI && rad < ((3 * 1) / 2) * Math.PI) { offsetStyle = getLabelPosition( pathShape, pointPercent, offsetX + backgroundWidth / 2, offsetY + backgroundHeight / 2, autoRotate, ); } if (autoRotate) { style.x = offsetStyle.x; style.y = offsetStyle.y; } style.rotate = offsetStyle.rotate; return style; }, // 获取文本对齐方式 _getTextAlign(labelPosition: string, angle: number): string { let textAlign = "center"; if (!angle) { return labelPosition; } angle = angle % (Math.PI * 2); // 取模 if (labelPosition !== "center") { if ( (angle >= 0 && angle <= Math.PI / 2) || (angle >= (3 / 2) * Math.PI && angle < 2 * Math.PI) ) { textAlign = labelPosition; } else { textAlign = revertAlign(labelPosition); } } return textAlign; }, /** * @internal 获取边的控制点 * @param {Object} cfg 边的配置项 * @return {Array} 控制点的数组 */ getControlPoints(cfg: EdgeConfig): IPoint[] | undefined { return cfg.controlPoints; }, /** * @internal 处理需要重计算点和边的情况 * @param {Object} cfg 边的配置项 * @return {Object} 边的配置项 */ getPathPoints(cfg: EdgeConfig): EdgeConfig { return cfg; }, /** * 绘制边 * @override * @param {Object} cfg 边的配置项 * @param {G.Group} group 边的容器 * @return {IShape} 图形 */ drawShape(cfg: EdgeConfig, group: IGroup): IShape { const shapeStyle = this.getShapeStyle!(cfg); const shape = group.addShape("path", { className: CLS_SHAPE, name: CLS_SHAPE, attrs: shapeStyle, }); return shape; }, drawLabel(cfg: EdgeConfig, group: IGroup): IShape { const { labelCfg: defaultLabelCfg } = this.options as ModelConfig; let defaultFontFamily; if ( typeof window !== "undefined" && typeof window.getComputedStyle !== "undefined" ) defaultFontFamily = window .getComputedStyle(document.body, null) .getPropertyValue("font-family") || "Arial, sans-serif"; else defaultFontFamily = "Arial, sans-serif"; const labelCfg = deepMix( { fontFamily: defaultFontFamily, }, defaultLabelCfg, cfg.labelCfg, ); const labelStyle = this.getLabelStyle!(cfg, labelCfg, group); const rotate = labelStyle.rotate; delete labelStyle.rotate; const label = group.addShape("text", { attrs: labelStyle, name: "text-shape", }); if (rotate) { label.rotateAtStart(rotate); } if (labelStyle.background) { const rect = this.drawLabelBg(cfg, group, label); const labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX; rect.set("classname", labelBgClassname); label.toFront(); } return label; }, drawLabelBg(cfg: ModelConfig, group: IGroup, label: IElement) { const { labelCfg: defaultLabelCfg } = this.options as ModelConfig; const labelCfg = deepMix({}, defaultLabelCfg, cfg.labelCfg); const labelStyle = this.getLabelStyle!(cfg, labelCfg, group); const rotate = labelStyle.rotate; const style = this.getLabelBgStyleByPosition(label, cfg, labelCfg, group); delete style.rotate; const rect = group.addShape("rect", { name: "text-bg-shape", attrs: style, }); if (rotate) rect.rotateAtStart(rotate); return rect; }, }; const singleEdgeDef = { ...shapeBase, ...singleEdge }; Shape.registerEdge("single-edge", singleEdgeDef); // 直线, 不支持控制点 Shape.registerEdge( "line", { // 控制点不生效 getControlPoints() { return undefined; }, }, "single-edge", ); // 直线 Shape.registerEdge( "spline", { getPath(points: Point[]): Array> { const path = getSpline(points); return path; }, }, "single-edge", ); Shape.registerEdge( "arc", { curveOffset: 20, clockwise: 1, getControlPoints(cfg: EdgeConfig): IPoint[] { const { startPoint, endPoint } = cfg; const midPoint = { x: (startPoint.x + endPoint.x) / 2, y: (startPoint.y + endPoint.y) / 2, }; let center; let arcPoint; // 根据给定点计算圆弧 if (cfg.controlPoints !== undefined) { arcPoint = cfg.controlPoints[0]; center = getCircleCenterByPoints(startPoint, arcPoint, endPoint); // 根据控制点和直线关系决定 clockwise值 if (startPoint.x <= endPoint.x && startPoint.y > endPoint.y) { this.clockwise = center.x > arcPoint.x ? 0 : 1; } else if (startPoint.x <= endPoint.x && startPoint.y < endPoint.y) { this.clockwise = center.x > arcPoint.x ? 1 : 0; } else if (startPoint.x > endPoint.x && startPoint.y <= endPoint.y) { this.clockwise = center.y < arcPoint.y ? 0 : 1; } else { this.clockwise = center.y < arcPoint.y ? 1 : 0; } // 若给定点和两端点共线,无法生成圆弧,绘制直线 if ( (arcPoint.x - startPoint.x) / (arcPoint.y - startPoint.y) === (endPoint.x - startPoint.x) / (endPoint.y - startPoint.y) ) { return []; } } else { // 根据直线连线中点的的偏移计算圆弧 // 若用户给定偏移量则根据其计算,否则按照默认偏移值计算 if (cfg.curveOffset === undefined) { cfg.curveOffset = this.curveOffset; } if (isArray(cfg.curveOffset)) { cfg.curveOffset = cfg.curveOffset[0]; } if (cfg.curveOffset < 0) { this.clockwise = 0; } else { this.clockwise = 1; } const vec = { x: endPoint.x - startPoint.x, y: endPoint.y - startPoint.y, }; const edgeAngle = Math.atan2(vec.y, vec.x); arcPoint = { x: cfg.curveOffset * Math.cos(-Math.PI / 2 + edgeAngle) + midPoint.x, y: cfg.curveOffset * Math.sin(-Math.PI / 2 + edgeAngle) + midPoint.y, }; center = getCircleCenterByPoints(startPoint, arcPoint, endPoint); } const radius = distance(startPoint, center); const controlPoints = [{ x: radius, y: radius }]; return controlPoints; }, getPath(points: Point[]): Array> { const path: Array> = []; path.push(["M", points[0].x, points[0].y]); // 控制点与端点共线 if (points.length === 2) { path.push(["L", points[1].x, points[1].y]); } else { path.push([ "A", points[1].x, points[1].y, 0, 0, this.clockwise as number, points[2].x, points[2].y, ]); } return path; }, }, "single-edge", ); Shape.registerEdge( "quadratic", { curvePosition: 0.5, // 弯曲的默认位置 curveOffset: -20, // 弯曲度,沿着 startPoint, endPoint 的垂直向量(顺时针)方向,距离线的距离,距离越大越弯曲 getControlPoints(cfg: EdgeConfig): IPoint[] { let { controlPoints } = cfg; // 指定controlPoints if (!controlPoints || !controlPoints.length) { const { startPoint, endPoint } = cfg; if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset; if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition; if (isArray(this.curveOffset)) cfg.curveOffset = cfg.curveOffset[0]; if (isArray(this.curvePosition)) cfg.curvePosition = cfg.curveOffset[0]; const innerPoint = getControlPoint( startPoint as Point, endPoint as Point, cfg.curvePosition as number, cfg.curveOffset as number, ); controlPoints = [innerPoint]; } return controlPoints; }, getPath(points: Point[]): Array> { const path = []; path.push(["M", points[0].x, points[0].y]); path.push(["Q", points[1].x, points[1].y, points[2].x, points[2].y]); return path; }, }, "single-edge", ); Shape.registerEdge( "cubic", { curvePosition: [1 / 2, 1 / 2], curveOffset: [-20, 20], getControlPoints(cfg: EdgeConfig): IPoint[] { let { controlPoints } = cfg; // 指定 controlPoints if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset; if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition; if (isNumber(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset]; if (isNumber(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition]; if (!controlPoints || !controlPoints.length || controlPoints.length < 2) { const { startPoint, endPoint } = cfg; const innerPoint1 = getControlPoint( startPoint as Point, endPoint as Point, cfg.curvePosition[0], cfg.curveOffset[0], ); const innerPoint2 = getControlPoint( startPoint as Point, endPoint as Point, cfg.curvePosition[1], cfg.curveOffset[1], ); controlPoints = [innerPoint1, innerPoint2]; } return controlPoints; }, getPath(points: Point[]): Array> { const path = []; path.push(["M", points[0].x, points[0].y]); path.push([ "C", points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y, ]); return path; }, }, "single-edge", ); // 垂直方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点 Shape.registerEdge( "cubic-vertical", { curvePosition: [1 / 2, 1 / 2], minCurveOffset: [0, 0], curveOffset: undefined, getControlPoints(cfg: EdgeConfig): IPoint[] { const { startPoint, endPoint } = cfg; if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition; if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset; if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset; if (isNumber(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset]; if (isNumber(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset]; if (isNumber(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition]; const yDist = endPoint!.y - startPoint!.y; let curveOffset: number[] = [0, 0]; if (cfg.curveOffset) { curveOffset = cfg.curveOffset; } else if (Math.abs(yDist) < Math.abs(cfg.minCurveOffset[0])) { curveOffset = cfg.minCurveOffset; } const innerPoint1 = { x: startPoint!.x, y: startPoint!.y + yDist * (this as any).curvePosition[0] + curveOffset[0], }; const innerPoint2 = { x: endPoint!.x, y: endPoint!.y - yDist * (this as any).curvePosition[1] + curveOffset[1], }; return [innerPoint1, innerPoint2]; }, }, "cubic", ); // 水平方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点 Shape.registerEdge( "cubic-horizontal", { curvePosition: [1 / 2, 1 / 2], minCurveOffset: [0, 0], curveOffset: undefined, getControlPoints(cfg: EdgeConfig): IPoint[] { const { startPoint, endPoint } = cfg; if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition; if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset; if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset; if (isNumber(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset]; if (isNumber(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset]; if (isNumber(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition]; const xDist = endPoint!.x - startPoint!.x; let curveOffset: number[] = [0, 0]; if (cfg.curveOffset) { curveOffset = cfg.curveOffset; } else if (Math.abs(xDist) < Math.abs(cfg.minCurveOffset[0])) { curveOffset = cfg.minCurveOffset; } const innerPoint1 = { x: startPoint!.x + xDist * (this as any).curvePosition[0] + curveOffset[0], y: startPoint!.y, }; const innerPoint2 = { x: endPoint!.x - xDist * (this as any).curvePosition[1] + curveOffset[1], y: endPoint!.y, }; const controlPoints = [innerPoint1, innerPoint2]; return controlPoints; }, }, "cubic", ); Shape.registerEdge( "loop", { getPathPoints(cfg: ModelConfig): EdgeData { return getLoopCfgs(cfg as EdgeData); }, getControlPoints(cfg: EdgeConfig): IPoint[] | undefined { return cfg.controlPoints; }, afterDraw(cfg: EdgeConfig) { cfg.controlPoints = undefined; }, afterUpdate(cfg: EdgeConfig) { cfg.controlPoints = undefined; }, }, "cubic", ); ================================================ FILE: packages/core/src/element/hull/bubbleset.ts ================================================ import { IPoint, IBBox, Item, BubblesetCfg } from "../../types"; import { squareDist, pointLineSquareDist, itemIntersectByLine, getPointsCenter, fractionToLine, isPointsOverlap, pointRectSquareDist, Line, isPointInPolygon, } from "../../util/math"; const defaultOps = { maxRoutingIterations: 100, // number of times to run the algorithm to refine the path finding in difficult areas maxMarchingIterations: 100, // number of times to refine the boundary pixelGroupSize: 2, // the resolution of the algorithm in square pixels edgeR0: 10, // the distance from edges at which energy is 1 (full influence) edgeR1: 10, // the distance from edges at which energy is 0 (no influence) nodeR0: 5, // the distance from nodes which energy is 1 (full influence) nodeR1: 10, // the distance from nodes at which energy is 0 (no influence) morphBuffer: 5, // DEFAULT_NODE_R0; the amount of space to move the virtual edge when wrapping around obstacles threshold: 0.001, skip: 16, nodeInfluenceFactor: 1, edgeInfluenceFactor: 1, negativeNodeInfluenceFactor: -0.5, }; /** * Marching square algorithm for traching the contour of a pixel group * https://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/ * @param potentialArea * @param threshold */ function MarchingSquares(contour, potentialArea, threshold) { let marched = false; const getVal = (x: number, y: number) => { return potentialArea.cells[x + y * potentialArea.width]; }; const getState = (x: number, y: number) => { let squareVal = 0; if (getVal(x - 1, y - 1) >= threshold) { squareVal += 1; } if (getVal(x, y - 1) > threshold) { squareVal += 2; } if (getVal(x - 1, y) > threshold) { squareVal += 4; } if (getVal(x, y) > threshold) { squareVal += 8; } return squareVal; }; const doMarch = (xPos: number, yPos: number) => { let x = xPos; let y = yPos; let prevX; let prevY; for (let i = 0; i < potentialArea.width * potentialArea.height; i++) { prevX = x; prevY = y; if (contour.findIndex((item) => item.x === x && item.y === y) > -1) { if (contour[0].x !== x || contour[0].y !== y) { // encountered a loop but haven't returned to start: change direction using conditionals and continue back to start } else { return true; } } else { contour.push({ x, y }); } const state = getState(x, y); // assign the move direction according to state of the square switch (state) { case -1: console.warn("Marched out of bounds"); return true; case 0: case 3: case 2: case 7: x++; // go right break; case 12: case 14: case 4: x--; // go left break; case 6: // go left if come from up else go right if (prevX === 0) { if (prevY === -1) { x -= 1; } else { x += 1; } } break; case 1: case 13: case 5: y--; // go up break; case 9: // go up if come from right else go down if (prevX === 1) { if (prevY === 0) { y -= 1; } else { y += 1; } } break; case 10: case 8: case 11: y++; // go down break; default: console.warn(`Marching squares invalid state: ${state}`); return true; } } }; this.march = () => { for (let x = 0; x < potentialArea.width && !marched; x += 1) { for (let y = 0; y < potentialArea.height && !marched; y += 1) { if (getVal(x, y) > threshold && getState(x, y) !== 15) { marched = doMarch(x, y); } } } return marched; }; } /** * Space partition & assign value to each cell * @param points */ const initGridCells = ( width: number, height: number, pixelGroupSize: number, ) => { const scaleWidth = Math.ceil(width / pixelGroupSize); const scaleHeight = Math.ceil(height / pixelGroupSize); const gridCells = new Float32Array( Math.max(0, scaleWidth * scaleHeight), ).fill(0); return { cells: gridCells, width: scaleWidth, height: scaleHeight, }; }; /** * Find the optimal already visited member to item; Optimal: minimize cost(j) = distance(i,j) ∗ countObstacles(i,j) * @param item * @param visited */ const pickBestNeighbor = ( item: Item, visited: Item[], nonMembers: Item[], ): Item | null => { let closestNeighbour = null; let minCost = Number.POSITIVE_INFINITY; visited.forEach((neighbourItem) => { const itemP = { x: item.getModel().x, y: item.getModel().y }; const neighbourItemP = { x: neighbourItem.getModel().x, y: neighbourItem.getModel().y, }; const dist = squareDist(itemP, neighbourItemP); const directLine = new Line( itemP.x, itemP.y, neighbourItemP.x, neighbourItemP.y, ); const numberObstacles = nonMembers.reduce((count, _item) => { if (fractionToLine(_item, directLine) > 0) { return count + 1; } return count; }, 0); if (dist * (numberObstacles + 1) ** 2 < minCost) { closestNeighbour = neighbourItem; minCost = dist * (numberObstacles + 1) ** 2; } }); return closestNeighbour; }; /** * 返回和线相交的item中,离边的起点最近的item * @param items * @param line */ const getIntersectItem = (items: Item[], line: Line): Item | null => { let minDistance = Number.POSITIVE_INFINITY; let closestItem = null; items.forEach((item) => { const distance = fractionToLine(item, line); // find closest intersection if (distance >= 0 && distance < minDistance) { closestItem = item; minDistance = distance; } }); return closestItem; }; /** * Modify the directLine and Route virtual edges around obstacles */ const computeRoute = ( directLine: Line, nonMembers: Item[], maxRoutingIterations: number, morphBuffer: number, ): Line[] => { const checkedLines: Line[] = []; const linesToCheck: Line[] = []; linesToCheck.push(directLine); let hasIntersection = true; let iterations = 0; const pointExists = (point: IPoint, lines: Line[]) => { let flag = false; lines.forEach((line) => { if (flag) return; if ( isPointsOverlap(point, { x: line.x1, y: line.y1 }) || isPointsOverlap(point, { x: line.x2, y: line.y2 }) ) { flag = true; } }); return flag; }; const isPointInNonMembers = (point: IPoint, _nonMembers: Item[]) => { for (const item of _nonMembers) { const bbox = item.getBBox(); const itemContour = [ [bbox.x, bbox.y], [bbox.x + bbox.width, bbox.y], [bbox.x, bbox.y + bbox.height], [bbox.x + bbox.width, bbox.y + bbox.height], ]; if (isPointInPolygon(itemContour, point.x, point.y)) { return true; } } return false; }; // outer loop end when no more intersections or out of iterations while (hasIntersection && iterations < maxRoutingIterations) { hasIntersection = false; // inner loop end when out of lines or found an intersection while (!hasIntersection && linesToCheck.length) { const line = linesToCheck.pop(); const closestItem = getIntersectItem(nonMembers, line); if (closestItem) { const [intersections, countIntersections] = itemIntersectByLine( closestItem, line, ); // if line passes through item if (countIntersections === 2) { const testReroute = (isFirst: boolean) => { let tempMorphBuffer = morphBuffer; let virtualNode = rerouteLine( closestItem, tempMorphBuffer, intersections, isFirst, ); // test the virtualNode already exists let exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines); let pointInside = isPointInNonMembers(virtualNode, nonMembers); while (!exist && pointInside && tempMorphBuffer >= 1) { // try a smaller buffer tempMorphBuffer /= 1.5; virtualNode = rerouteLine( closestItem, tempMorphBuffer, intersections, isFirst, ); exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines); pointInside = isPointInNonMembers(virtualNode, nonMembers); } // 第二次route时不要求pointInside if (virtualNode && !exist && (!isFirst || !pointInside)) { // add 2 rerouted lines to check linesToCheck.push( new Line(line.x1, line.y1, virtualNode.x, virtualNode.y), ); linesToCheck.push( new Line(virtualNode.x, virtualNode.y, line.x2, line.y2), ); hasIntersection = true; } }; testReroute(true); if (!hasIntersection) { // if we didn't find a valid point around the first corner, try the second testReroute(false); } } } // no intersection found, mark this line as completed if (!hasIntersection) { checkedLines.push(line); } iterations += 1; } } // 加入剩余的线 while (linesToCheck.length) { checkedLines.push(linesToCheck.pop()); } return checkedLines; }; /** * Connect item with visited members using direct line or virtual edges */ function getRoute( item: Item, nonMembers: Item[], visited: Item[], maxRoutingIterations: number, morphBuffer: number, ) { const optimalNeighbor = pickBestNeighbor(item, visited, nonMembers); if (optimalNeighbor === null) { return []; } // merge the consecutive lines const mergeLines = (checkedLines: Line[]): Line[] => { const finalRoute: Line[] = []; while (checkedLines.length > 0) { const line1 = checkedLines.pop()!; if (checkedLines.length === 0) { finalRoute.push(line1); break; } const line2 = checkedLines.pop()!; const mergeLine = new Line(line1.x1, line1.y1, line2.x2, line2.y2); const closestItem = getIntersectItem(nonMembers, mergeLine); // merge most recent line and previous line if (!closestItem) { checkedLines.push(mergeLine); } else { finalRoute.push(line1); checkedLines.push(line2); } } return finalRoute; }; const directLine = new Line( item.getModel().x, item.getModel().y, optimalNeighbor.getModel().x, optimalNeighbor.getModel().y, ); const checkedLines = computeRoute( directLine, nonMembers, maxRoutingIterations, morphBuffer, ); const finalRoute = mergeLines(checkedLines); return finalRoute; } /** * Calculate the countor that includes the selected items and exclues the non-selected items * @param graph * @param members * @param nonMembers * @param options */ export const genBubbleSet = ( members: Item[], nonMembers: Item[], ops?: BubblesetCfg, ) => { // eslint-disable-next-line no-redeclare const options = Object.assign(defaultOps, ops); const centroid = getPointsCenter( members.map((item) => ({ x: item.getModel().x, y: item.getModel().y })), ); // 按照到中心距离远近排序 members = members.sort( (a, b) => squareDist({ x: a.getModel().x, y: a.getModel().y }, centroid) - squareDist({ x: b.getModel().x, y: b.getModel().y }, centroid), ); const visited: Item[] = []; const virtualEdges: Line[] = []; members.forEach((item) => { const lines = getRoute( item, nonMembers, visited, options.maxRoutingIterations, options.morphBuffer, ); lines.forEach((l) => { virtualEdges.push(l); }); visited.push(item); }); // 由于edge也可以作为member和nonMember传入,暂时不考虑把edges作为参数传入genBubbleSet // edges && edges.forEach(e => { // virtualEdges.push(new Line(e.getSource().getModel().x, e.getSource().getModel().y, e.getTarget().getModel().x, e.getTarget().getModel().y)); // }); const activeRegion = getActiveRregion(members, virtualEdges, options.nodeR0); const potentialArea = initGridCells( activeRegion.width, activeRegion.height, options.pixelGroupSize, ); // Use march squares to generate contour let contour = []; let hull = []; for ( let iterations = 0; iterations < options.maxMarchingIterations; iterations++ ) { fillPotentialArea( members, nonMembers, virtualEdges, activeRegion, potentialArea, options, ); contour = []; hull = []; if (!new MarchingSquares(contour, potentialArea, options.threshold).march()) continue; const marchedPath = contour.map((point) => ({ x: Math.round(point.x * options.pixelGroupSize + activeRegion.minX), y: Math.round(point.y * options.pixelGroupSize + activeRegion.minY), })); // const marchedPath = marchingSquares(potentialArea, options.threshold).map(point => ({ x: Math.round(point.x * options.pixelGroupSize + activeRegion.minX), y: Math.round(point.y * options.pixelGroupSize + activeRegion.minY) })) if (marchedPath) { let size = marchedPath.length; if (options.skip > 1) { size = Math.floor(marchedPath.length / options.skip); // if we reduced too much (fewer than three points in reduced surface) reduce skip and try again while (size < 3 && options.skip > 1) { options.skip -= 1; size = Math.floor(marchedPath.length / options.skip); } } // copy hull values for (let i = 0, j = 0; j < size; j += 1, i += options.skip) { hull.push({ x: marchedPath[i].x, y: marchedPath[i].y }); } } const isContourValid = () => { for (const item of members) { const hullPoints = hull.map((point) => [point.x, point.y]); if ( !isPointInPolygon( hullPoints, item.getBBox().centerX, item.getBBox().centerY, ) ) return false; } // 不强制要求所有nonMembers都没有包含在内 // for (const item of nonMembers) { // if (isPointInPolygon({ x: item.getBBox().centerX, y: item.getBBox().centerY }, contour)) return false // } return true; }; if (hull && isContourValid()) { return hull; } // update parameters for next iteraction options.threshold *= 0.9; if (iterations <= options.maxMarchingIterations * 0.5) { options.memberInfluenceFactor *= 1.2; options.edgeInfluenceFactor *= 1.2; } else if ( options.nonMemberInfluenceFactor !== 0 && nonMembers.length > 0 ) { // after half the iterations, start increasing positive energy and lowering the threshold options.nonMemberInfluenceFactor *= 0.8; } else { break; } } return hull; }; /** * unionboundingbox * @param members * @param edges */ function getActiveRregion( members: Item[], edges: Line[], offset: number, ): IBBox { const activeRegion = { minX: Number.POSITIVE_INFINITY, minY: Number.POSITIVE_INFINITY, maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, width: 0, height: 0, x: 0, y: 0, }; const bboxes = []; members.forEach((item) => { bboxes.push(item.getBBox()); }); edges.forEach((l) => { bboxes.push(l.getBBox()); }); for (const bbox of bboxes) { activeRegion.minX = (bbox.minX < activeRegion.minX ? bbox.minX : activeRegion.minX) - offset; activeRegion.minY = (bbox.minY < activeRegion.minY ? bbox.minY : activeRegion.minY) - offset; activeRegion.maxX = (bbox.maxX > activeRegion.maxX ? bbox.maxX : activeRegion.maxX) + offset; activeRegion.maxY = (bbox.maxY > activeRegion.maxY ? bbox.maxY : activeRegion.maxY) + offset; } activeRegion.width = activeRegion.maxX - activeRegion.minX; activeRegion.height = activeRegion.maxY - activeRegion.minY; activeRegion.x = activeRegion.minX; activeRegion.y = activeRegion.minY; return activeRegion; } function fillPotentialArea( members: Item[], nonMembers: Item[], edges: Line[], activeRegion: IBBox, potentialArea, options: BubblesetCfg, ) { function pos2GridIx(x, offset) { const gridIx = Math.floor((x - offset) / options.pixelGroupSize); return gridIx < 0 ? 0 : gridIx; } function gridIx2Pos(x, offset) { return x * options.pixelGroupSize + offset; } // using inverse a for numerical stability const nodeInfA = (options.nodeR0 - options.nodeR1) * (options.nodeR0 - options.nodeR1); const edgeInfA = (options.edgeR0 - options.edgeR1) * (options.edgeR0 - options.edgeR1); const getAffectedRegion = (bbox, thresholdR) => { const startX = Math.min( pos2GridIx(bbox.minX, thresholdR + activeRegion.minX), potentialArea.width, ); const startY = Math.min( pos2GridIx(bbox.minY, thresholdR + activeRegion.minY), potentialArea.height, ); const endX = Math.min( pos2GridIx(bbox.maxX, -thresholdR + activeRegion.minX), potentialArea.width, ); const endY = Math.min( pos2GridIx(bbox.maxY, -thresholdR + activeRegion.minY), potentialArea.height, ); return [startX, startY, endX, endY]; }; const addItemInfluence = (item: Item, influenceFactor: number) => { const bbox = item.getBBox(); const [startX, startY, endX, endY] = getAffectedRegion( bbox, options.nodeR1, ); // calculate item influence for each cell for (let y = startY; y < endY; y += 1) { for (let x = startX; x < endX; x += 1) { if ( influenceFactor < 0 && potentialArea[x + y * potentialArea.width] <= 0 ) { continue; } const tempX = gridIx2Pos(x, activeRegion.minX); const tempY = gridIx2Pos(y, activeRegion.minY); const distanceSq = pointRectSquareDist( { x: tempX, y: tempY }, { x: bbox.minX, y: bbox.minY, width: bbox.width, height: bbox.height, }, ); if (distanceSq < options.nodeR1 ** 2) { const dr = Math.sqrt(distanceSq) - options.nodeR1; potentialArea.cells[x + y * potentialArea.width] += influenceFactor * dr * dr; } } } }; const addEdgeInfluence = (line: Line, influenceFactor: number) => { const bbox = line.getBBox(); const [startX, startY, endX, endY] = getAffectedRegion( bbox, options.edgeR1, ); // for every point in active part of potentialArea, calculate distance to nearest point on line and add influence for (let y = startY; y < endY; y += 1) { for (let x = startX; x < endX; x += 1) { if ( influenceFactor < 0 && potentialArea.cells[x + y * potentialArea.width] <= 0 ) { continue; } const tempX = gridIx2Pos(x, activeRegion.minX); const tempY = gridIx2Pos(y, activeRegion.minY); const minDistanceSq = pointLineSquareDist({ x: tempX, y: tempY }, line); // only influence if less than r1 if (minDistanceSq < options.edgeR1 ** 2) { const mdr = Math.sqrt(minDistanceSq) - options.edgeR1; potentialArea.cells[x + y * potentialArea.width] += influenceFactor * mdr * mdr; } } } }; if (options.nodeInfluenceFactor) { members.forEach((item) => { addItemInfluence(item, options.nodeInfluenceFactor / nodeInfA); }); } if (options.edgeInfluenceFactor) { edges.forEach((edge) => { addEdgeInfluence(edge, options.edgeInfluenceFactor / edgeInfA); }); } if (options.negativeNodeInfluenceFactor) { nonMembers.forEach((item) => { addItemInfluence(item, options.negativeNodeInfluenceFactor / nodeInfA); }); } } function rerouteLine( item, buffer: number, intersections: IPoint[], wrapNormal: boolean, ): IPoint { const bbox = item.getBBox(); const [topIntersect, leftIntersect, bottomIntersect, rightIntersect] = intersections; const cornerPos = { topLeft: { x: bbox.minX - buffer, y: bbox.minY - buffer }, topRight: { x: bbox.maxX + buffer, y: bbox.minY - buffer }, bottomLeft: { x: bbox.minX - buffer, y: bbox.maxY + buffer }, bottomRight: { x: bbox.maxX + buffer, y: bbox.maxY + buffer }, }; const totalArea = bbox.height * bbox.width; function calcHalfArea(intersect1, intersect2) { return ( bbox.width * ((intersect1.y - bbox.minY + (intersect2.y - bbox.minY)) * 0.5) ); } // 根据线和boundingbox相交的情况,确定control point的位置 if (leftIntersect) { // 相交区域有三角形 if (topIntersect) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight; if (bottomIntersect) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight; // 相交区域分成上下两个梯形,比较面积 const topArea = calcHalfArea(leftIntersect, rightIntersect); if (topArea < totalArea * 0.5) { if (leftIntersect.y > rightIntersect.y) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight; return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft; } if (leftIntersect.y < rightIntersect.y) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight; return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft; } if (rightIntersect) { if (topIntersect) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft; if (bottomIntersect) return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft; } // 相交区域分成左右两个梯形 const leftArea = calcHalfArea(topIntersect, bottomIntersect); if (leftArea < totalArea * 0.5) { if (topIntersect.x > bottomIntersect.x) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight; return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight; } if (topIntersect.x < bottomIntersect.x) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft; return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft; } ================================================ FILE: packages/core/src/element/hull/convexHull.ts ================================================ import { IPoint, Item } from "../../types"; /** * Use cross product to judge the direction of the turn. * Returns a positive value, if OAB makes a clockwise turn, * negative for counter-clockwise turn, and zero if the points are collinear. */ export const cross = (a: IPoint, b: IPoint, o: IPoint) => { return (a.y - o.y) * (b.x - o.x) - (a.x - o.x) * (b.y - o.y); }; /** * Generate a convex hull of given points. Andrew's monotone chain algorithm. * @param points An array of [x, y] representing the coordinates of points. * @return a list of vertices of the convex hull in counter-clockwise order, */ export const genConvexHull = (items: Item[]) => { const points: IPoint[] = items.map((item) => ({ x: item.getModel().x, y: item.getModel().y, })); points.sort((a, b) => { return a.x === b.x ? a.y - b.y : a.x - b.x; }); if (points.length === 1) { return points; } // build the lower hull const lower = []; for (let i = 0; i < points.length; i++) { while ( lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points[i]) <= 0 ) { lower.pop(); } lower.push(points[i]); } // build the upper hull const upper = []; for (let i = points.length - 1; i >= 0; i--) { while ( upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points[i]) <= 0 ) { upper.pop(); } upper.push(points[i]); } upper.pop(); lower.pop(); const strictHull = lower.concat(upper); return strictHull; }; ================================================ FILE: packages/core/src/element/index.ts ================================================ import Shape from "./shape"; import "./node"; import "./edge"; import "./combo"; import "./combos"; import "./nodes"; export { default as Arrow } from "./arrow"; export { default as Marker } from "./marker"; export default Shape; ================================================ FILE: packages/core/src/element/marker.ts ================================================ export default { collapse: (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x + r - 4, y], ]; }, expand: (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }, upTriangle: (x, y, r) => { const l1 = r * Math.cos(Math.PI / 6); const l2 = r * Math.sin(Math.PI / 6); return [ ["M", x - l1, y + l2], ["L", x + l1, y + l2], ["L", x, y - r], ["Z"], ]; }, downTriangle: (x, y, r) => { const l1 = r * Math.cos(Math.PI / 6); const l2 = r * Math.sin(Math.PI / 6); return [ ["M", x - l1, y - l2], ["L", x + l1, y - l2], ["L", x, y + r], ["Z"], ]; }, }; ================================================ FILE: packages/core/src/element/node.ts ================================================ /** * @fileOverview common node shape * @author huangtonger@aliyun.com */ import { IGroup, IShape, IElement } from "@antv/g-base"; import { isArray, isNil, mix } from "@antv/util"; import { ILabelConfig, ShapeOptions } from "../interface/shape"; import { Item, LabelStyle, NodeConfig, ModelConfig } from "../types"; import { formatPadding } from "../util/base"; import Global from "../global"; import Shape from "./shape"; import { shapeBase } from "./shapeBase"; const singleNode: ShapeOptions = { itemType: "node", // 单个图形的类型 shapeType: "single-node", /** * 文本相对图形的位置,默认以中心点 * 位置包括: top, bottom, left, right, center * @type {String} */ labelPosition: "center", /** * 文本相对偏移,当 labelPosition 不为 center 时有效 * @type {Number} */ offset: Global.nodeLabel.offset, /** * 获取节点宽高 * @internal 返回节点的大小,以 [width, height] 的方式维护 * @param {Object} cfg 节点的配置项 * @return {Array} 宽高 */ getSize(cfg: ModelConfig): number[] { let size: number | number[] = cfg.size || this.getOptions({})!.size || Global.defaultNode.size; // size 是数组,但长度为1,则补长度为2 if (isArray(size) && size.length === 1) { size = [size[0], size[0]]; } // size 为数字,则转换为数组 if (!isArray(size)) { size = [size, size]; } return size; }, // 私有方法,不希望扩展的节点复写这个方法 getLabelStyleByPosition(cfg: NodeConfig, labelCfg: ILabelConfig): LabelStyle { const labelPosition = labelCfg.position || this.labelPosition; // 默认的位置(最可能的情形),所以放在最上面 if (labelPosition === "center") { return { x: 0, y: 0, text: cfg!.label as string }; } let { offset } = labelCfg; if (isNil(offset)) { // 考虑 offset = 0 的场景,不用用 labelCfg.offset || Global.nodeLabel.offset offset = this.offset as number; // 不居中时的偏移量 } const size = this.getSize!(cfg as ModelConfig); const width = size[0]; const height = size[1]; let style: any; switch (labelPosition) { case "top": style = { x: 0, y: 0 - height / 2 - (offset as number), textBaseline: "bottom", // 文本在图形的上面 }; break; case "bottom": style = { x: 0, y: height / 2 + (offset as number), textBaseline: "top", }; break; case "left": style = { x: 0 - width / 2 - (offset as number), y: 0, textAlign: "right", }; break; default: style = { x: width / 2 + (offset as number), y: 0, textAlign: "left", }; break; } style.text = cfg.label; return style; }, getLabelBgStyleByPosition( label: IElement, cfg: ModelConfig, labelCfg?: ILabelConfig, group?: IGroup, ) { if (!label) { return {}; } const bbox = label.getBBox(); const backgroundStyle = labelCfg.style && labelCfg.style.background; if (!backgroundStyle) { return {}; } const padding = formatPadding(backgroundStyle.padding); const backgroundWidth = bbox.width + padding[1] + padding[3]; const backgroundHeight = bbox.height + padding[0] + padding[2]; let { offset } = labelCfg; if (isNil(offset)) { // 考虑 offset = 0 的场景,不用用 labelCfg.offset || Global.nodeLabel.offset offset = this.offset as number; // 不居中时的偏移量 } let style: any; style = { x: bbox.minX - padding[3], y: bbox.minY - padding[0], }; style = { ...style, ...backgroundStyle, width: backgroundWidth, height: backgroundHeight, }; return style; }, drawShape(cfg: NodeConfig, group: IGroup): IShape { const { shapeType } = this; // || this.type,都已经加了 shapeType const style = this.getShapeStyle!(cfg); const shape = group.addShape(shapeType, { attrs: style, draggable: true, name: "node-shape", }); return shape; }, /** * 更新linkPoints * @param {Object} cfg 节点数据配置项 * @param {Group} group Item所在的group */ updateLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints: defaultLinkPoints } = this.getOptions( cfg, ) as ModelConfig; const markLeft = group.find( (element) => element.get("className") === "link-point-left", ); const markRight = group.find( (element) => element.get("className") === "link-point-right", ); const markTop = group.find( (element) => element.get("className") === "link-point-top", ); const markBottom = group.find( (element) => element.get("className") === "link-point-bottom", ); let currentLinkPoints; if (markLeft) { currentLinkPoints = markLeft.attr(); } if (markRight && !currentLinkPoints) { currentLinkPoints = markRight.attr(); } if (markTop && !currentLinkPoints) { currentLinkPoints = markTop.attr(); } if (markBottom && !currentLinkPoints) { currentLinkPoints = markBottom.attr(); } if (!currentLinkPoints) currentLinkPoints = defaultLinkPoints; const linkPoints = mix({}, currentLinkPoints, cfg.linkPoints); const { fill: markFill, stroke: markStroke, lineWidth: borderWidth, } = linkPoints; let markSize = linkPoints.size / 2; if (!markSize) markSize = linkPoints.r; const { left, right, top, bottom } = cfg.linkPoints ? cfg.linkPoints : { left: undefined, right: undefined, top: undefined, bottom: undefined, }; const size = this.getSize!(cfg); const width = size[0]; const height = size[1]; const styles = { r: markSize, fill: markFill, stroke: markStroke, lineWidth: borderWidth, }; if (markLeft) { if (!left && left !== undefined) { markLeft.remove(); } else { markLeft.attr({ ...styles, x: -width / 2, y: 0, }); } } else if (left) { group.addShape("circle", { attrs: { ...styles, x: -width / 2, y: 0, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (markRight) { if (!right && right !== undefined) { markRight.remove(); } markRight.attr({ ...styles, x: width / 2, y: 0, }); } else if (right) { group.addShape("circle", { attrs: { ...styles, x: width / 2, y: 0, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (markTop) { if (!top && top !== undefined) { markTop.remove(); } markTop.attr({ ...styles, x: 0, y: -height / 2, }); } else if (top) { group.addShape("circle", { attrs: { ...styles, x: 0, y: -height / 2, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (markBottom) { if (!bottom && bottom !== undefined) { markBottom.remove(); } else { markBottom.attr({ ...styles, x: 0, y: height / 2, }); } } else if (bottom) { group.addShape("circle", { attrs: { ...styles, x: 0, y: height / 2, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, updateShape( cfg: NodeConfig, item: Item, keyShapeStyle: object, hasIcon: boolean, ) { const keyShape = item.get("keyShape"); keyShape.attr({ ...keyShapeStyle, }); (this as any).updateLabel(cfg, item); // special for some types of nodes if (hasIcon) { (this as any).updateIcon(cfg, item); } }, updateIcon(cfg: NodeConfig, item: Item) { const group = item.getContainer(); const { icon } = this.getOptions(cfg) as NodeConfig; const { show } = cfg.icon ? cfg.icon : { show: undefined }; const iconShape = group.find( (element) => element.get("className") === `${this.type}-icon`, ); if (iconShape) { // 若原先存在 icon if (show || show === undefined) { // 若传入 show: true, 或没有设置,则更新原有的 icon 样式 const iconConfig = mix({}, iconShape.attr(), icon); const { width: w, height: h } = iconConfig; iconShape.attr({ ...iconConfig, x: -w / 2, y: -h / 2, }); } else { // 若传入了 show: false 则删除原先的 icon iconShape.remove(); } } else if (show) { // 如果原先不存在 icon,但传入了 show: true,则新增 icon const { width: w, height: h } = icon; group.addShape("image", { attrs: { ...icon, x: -w! / 2, y: -h! / 2, }, className: `${this.type}-icon`, name: `${this.type}-icon`, }); // to ensure the label is on the top of all the shapes const labelShape = group.find( (element) => element.get("className") === `node-label`, ); if (labelShape) { labelShape.toFront(); } } }, }; const singleNodeDef = { ...shapeBase, ...singleNode }; Shape.registerNode("single-node", singleNodeDef); ================================================ FILE: packages/core/src/element/nodes/image.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import Shape from "../shape"; import { NodeConfig, Item } from "../../types"; /** * 基本的图片,可以添加文本,默认文本在图片的下面 */ Shape.registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: false, type: "circle", // circle r: 50, // ellipse rx: 50, ry: 35, // rect width: 50, height: 35, // polygon points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], // path path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], // 坐标 x: 0, y: 0, // clip 的属性样式 // style: { // lineWidth: 1 // }, }, }, shapeType: "image", labelPosition: "bottom", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { shapeType } = this; // || this.type,都已经加了 shapeType const style = this.getShapeStyle!(cfg); delete style.fill; const shape = group.addShape(shapeType, { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); (this as any).drawClip(cfg, shape); return shape; }, drawClip(cfg: NodeConfig, shape: IShape) { const { clipCfg: clip } = this.getOptions(cfg); if (!clip.show) { return; } // 支持 circle、rect、ellipse、Polygon 及自定义 path clip const { type, x, y, style } = clip; if (type === "circle") { const { r } = clip; shape.setClip({ type: "circle", attrs: { r, x, y, ...style, }, }); } else if (type === "rect") { const { width, height } = clip; const rectX = x - width / 2; const rectY = y - height / 2; shape.setClip({ type: "rect", attrs: { x: rectX, y: rectY, width, height, ...style, }, }); } else if (type === "ellipse") { const { rx, ry } = clip; shape.setClip({ type: "ellipse", attrs: { x, y, rx, ry, ...style, }, }); } else if (type === "polygon") { const { points } = clip; shape.setClip({ type: "polygon", attrs: { points, ...style, }, }); } else if (type === "path") { const { path } = clip; shape.setClip({ type: "path", attrs: { path, ...style, }, }); } }, getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg); const size = this.getSize!(cfg); const { img } = this.getOptions(cfg); let width = size[0]; let height = size[1]; if (defaultStyle) { width = defaultStyle.width || size[0]; height = defaultStyle.height || size[1]; } const style = { x: -width / 2, // 节点的位置在上层确定,所以这里仅使用相对位置即可 y: -height / 2, width, height, img, ...defaultStyle, }; return style; }, updateShapeStyle(cfg: NodeConfig, item: Item) { const group = item.getContainer(); const shapeClassName = `${this.itemType}-shape`; const shape = group.find((element) => element.get("className") === shapeClassName) || item.getKeyShape(); const shapeStyle = this.getShapeStyle!(cfg); if (shape) { shape.attr(shapeStyle); } }, }, "single-node", ); ================================================ FILE: packages/core/src/element/nodes/index.ts ================================================ import "./simple-circle"; import "./simple-rect"; import "./image"; ================================================ FILE: packages/core/src/element/nodes/simple-circle.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { deepMix } from "@antv/util"; import { Item, NodeConfig, ShapeStyle } from "../../types"; import Global from "../../global"; import Shape from "../shape"; import { ShapeOptions } from "../../interface/shape"; // 带有图标的圆,可用于拓扑图中 Shape.registerNode( "simple-circle", { // 自定义节点时的配置 options: { size: Global.defaultNode.size, style: { x: 0, y: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "simple-circle", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const style = this.getShapeStyle!(cfg); const keyShape: IShape = group.addShape("circle", { attrs: style, className: `${this.type}-keyShape`, draggable: true, }); return keyShape; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig): ShapeStyle { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = deepMix({}, defaultStyle, strokeStyle); const size = (this as ShapeOptions).getSize!(cfg); const r = size[0] / 2; const styles = { x: 0, y: 0, r, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const size = (this as ShapeOptions).getSize!(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, r: size[0] / 2, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); const style = deepMix({}, keyShape.attr(), strokeStyle, cfg.style); (this as any).updateShape(cfg, item, style, true); }, }, "single-node", ); ================================================ FILE: packages/core/src/element/nodes/simple-rect.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { mix } from "@antv/util"; import { Item, NodeConfig, ShapeStyle } from "../../types"; import Global from "../../global"; import Shape from "../shape"; import { ShapeOptions } from "../../interface/shape"; Shape.registerNode( "simple-rect", { // 自定义节点时的配置 options: { size: [100, 30], style: { radius: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 连接点,默认为左右 // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }] anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "simple-rect", labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("rect", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); return keyShape; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle); const size = (this as ShapeOptions).getSize!(cfg); const width = style.width || size[0]; const height = style.height || size[1]; const styles = { x: -width / 2, y: -height / 2, width, height, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const keyShape = item.get("keyShape"); if (!cfg.size) { size[0] = keyShape.attr("width") || defaultStyle.width; size[1] = keyShape.attr("height") || defaultStyle.height; } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, x: -size[0] / 2, y: -size[1] / 2, width: size[0], height: size[1], }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, false); }, }, "single-node", ); ================================================ FILE: packages/core/src/element/shape.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { upperFirst } from "@antv/util"; import { ShapeOptions, ShapeDefine } from "../interface/shape"; import { IPoint, Item, ModelConfig, NodeConfig, EdgeConfig } from "../types"; import { createNodeFromXML } from "./xml"; const cache: { [key: string]: string; } = {}; // ucfirst 开销过大,进行缓存 // 首字母大写 function ucfirst(str: string) { if (!cache[str]) { cache[str] = upperFirst(str); } return cache[str]; } /** * 工厂方法的基类 * @type Shape.FactoryBase */ export const ShapeFactoryBase = { /** * 默认的形状,当没有指定/匹配 shapeType 时,使用默认的 * @type {String} */ defaultShapeType: "defaultType", /** * 形状的 className,用于搜索 * @type {String} */ className: null, /** * 获取绘制 Shape 的工具类,无状态 * @param {String} type 类型 * @return {Shape} 工具类 */ getShape(type?: string): ShapeOptions { const self = this as any; const shape = self[type!] || self[self.defaultShapeType] || self["simple-circle"]; return shape; }, /** * 绘制图形 * @param {String} type 类型 * @param {Object} cfg 配置项 * @param {G.Group} group 图形的分组 * @return {IShape} 图形对象 */ draw(type: string, cfg: ModelConfig, group: IGroup): IShape { const shape = this.getShape(type); const rst = shape.draw!(cfg, group); if (shape.afterDraw) { shape.afterDraw(cfg, group, rst); } return rst; }, /** * 更新 * @param {String} type 类型 * @param {Object} cfg 配置项 * @param {G6.Item} item 节点、边、分组等 */ baseUpdate(type: string, cfg: ModelConfig, item: Item) { const shape = this.getShape(type); if (shape.update) { // 防止没定义 update 函数 shape.update(cfg, item); } if (shape.afterUpdate) { shape.afterUpdate(cfg, item); } }, /** * 设置状态 * @param {String} type 类型 * @param {String} name 状态名 * @param {String | Boolean} value 状态值 * @param {G6.Item} item 节点、边、分组等 */ setState(type: string, name: string, value: string | boolean, item: Item) { const shape = this.getShape(type); // 调用 shape/shapeBase.ts 中的 setState 方法 shape.setState!(name, value, item); }, /** * 是否允许更新,不重新绘制图形 * @param {String} type 类型 * @return {Boolean} 是否允许使用更新 */ shouldUpdate(type: string): boolean { const shape = this.getShape(type); return !!shape.update; }, getControlPoints(type: string, cfg: ModelConfig): IPoint[] | undefined { const shape = this.getShape(type); return shape.getControlPoints!(cfg); }, /** * 获取控制点 * @param {String} type 节点、边类型 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getAnchorPoints(type: string, cfg: ModelConfig): number[][] | undefined { const shape = this.getShape(type); return shape.getAnchorPoints!(cfg); }, }; /** * 元素的框架 */ const ShapeFramework = { // 默认样式及配置 options: {}, /** * 绘制 */ draw(cfg, group) { return this.drawShape(cfg, group); }, /** * 绘制 */ drawShape(/* cfg, group */) {}, /** * 绘制完成后的操作,便于用户继承现有的节点、边 */ afterDraw(/* cfg, group */) {}, // update(cfg, item) // 默认不定义 afterUpdate(/* cfg, item */) {}, /** * 设置节点、边状态 */ setState(/* name, value, item */) {}, /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getControlPoints(cfg: NodeConfig | EdgeConfig) { return cfg.controlPoints; }, /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getAnchorPoints(cfg: NodeConfig | EdgeConfig) { const { anchorPoints: defaultAnchorPoints } = this.options as any; const anchorPoints = cfg.anchorPoints || defaultAnchorPoints; return anchorPoints; }, /* 如果没定义 update 方法,每次都调用 draw 方法 update(cfg, item) { } */ }; export default class Shape { public static Node: any; public static Edge: any; public static Combo: any; public static registerFactory(factoryType: string, cfg: object): object { const className = ucfirst(factoryType); const factoryBase = ShapeFactoryBase; const shapeFactory = { ...factoryBase, ...cfg } as any; (Shape as any)[className] = shapeFactory; shapeFactory.className = className; return shapeFactory; } public static getFactory(factoryType: string) { const className = ucfirst(factoryType); return (Shape as any)[className]; } public static registerNode( shapeType: string, nodeDefinition: ShapeOptions | ShapeDefine, extendShapeType?: string, ) { const shapeFactory = Shape.Node; let shapeObj; if ( typeof nodeDefinition === "string" || typeof nodeDefinition === "function" ) { const autoNodeDefinition = createNodeFromXML(nodeDefinition); shapeObj = { ...shapeFactory.getShape("single-node"), ...autoNodeDefinition, }; } else if (nodeDefinition.jsx) { const { jsx } = nodeDefinition; const autoNodeDefinition = createNodeFromXML(jsx); shapeObj = { ...shapeFactory.getShape("single-node"), ...autoNodeDefinition, ...nodeDefinition, }; } else { shapeFactory.getShape(extendShapeType); const extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework; shapeObj = { ...extendShape, ...nodeDefinition }; } shapeObj.type = shapeType; shapeObj.itemType = "node"; shapeFactory[shapeType] = shapeObj; return shapeObj; } public static registerEdge( shapeType: string, edgeDefinition: ShapeOptions, extendShapeType?: string, ) { const shapeFactory = Shape.Edge; const extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework; const shapeObj = { ...extendShape, ...edgeDefinition }; shapeObj.type = shapeType; shapeObj.itemType = "edge"; shapeFactory[shapeType] = shapeObj; return shapeObj; } public static registerCombo( shapeType: string, comboDefinition: ShapeOptions, extendShapeType?: string, ) { const shapeFactory = Shape.Combo; const extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework; const shapeObj = { ...extendShape, ...comboDefinition }; shapeObj.type = shapeType; shapeObj.itemType = "combo"; shapeFactory[shapeType] = shapeObj; return shapeObj; } } // 注册 Node 的工厂方法 Shape.registerFactory("node", { defaultShapeType: "circle", }); // 注册 Edge 的工厂方法 Shape.registerFactory("edge", { defaultShapeType: "line", }); // 注册 Combo 的工厂方法 Shape.registerFactory("combo", { defaultShapeType: "circle", }); ================================================ FILE: packages/core/src/element/shapeBase.ts ================================================ /** * @fileOverview 自定义节点和边的过程中,发现大量重复代码 * @author dxq613@gmail.com */ import { IGroup, IShape, IElement } from "@antv/g-base"; import { ShapeOptions, ILabelConfig } from "../interface/shape"; import { IPoint, Item, LabelStyle, ShapeStyle, ModelConfig, EdgeConfig, } from "../types"; import Global from "../global"; import { ext } from "@antv/matrix-util"; import { deepMix, each, mix, isBoolean, isPlainObject, clone, } from "@antv/util"; import { cloneBesidesImg } from "../util/graphic"; const transform = ext.transform; const CLS_SHAPE_SUFFIX = "-shape"; const CLS_LABEL_SUFFIX = "-label"; const ARROWS = ["startArrow", "endArrow"]; const SHAPE_DEFAULT_ATTRS = { lineWidth: 1, stroke: undefined, fill: undefined, lineAppendWidth: 1, opacity: undefined, strokeOpacity: undefined, fillOpacity: undefined, x: 0, y: 0, r: 10, width: 20, height: 20, shadowColor: undefined, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }; const PATH_SHAPE_DEFAULT_ATTRS = { lineWidth: 1, stroke: "#000", lineDash: undefined, startArrow: false, endArrow: false, opacity: undefined, strokeOpacity: undefined, fillOpacity: undefined, shadowColor: undefined, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }; const SHAPES_DEFAULT_ATTRS = { edge: PATH_SHAPE_DEFAULT_ATTRS, node: SHAPE_DEFAULT_ATTRS, combo: SHAPE_DEFAULT_ATTRS, }; export const CLS_LABEL_BG_SUFFIX = "-label-bg"; // 单个 shape 带有一个 label,共用这段代码 export const shapeBase: ShapeOptions = { // 默认样式及配置 options: {}, itemType: "", // node, edge, combo 等 /** * 形状的类型,例如 circle,ellipse,polyline... */ type: "", getCustomConfig(cfg: ModelConfig): ModelConfig { return {}; }, getOptions(cfg: ModelConfig): ModelConfig { return deepMix( { // 解决局部渲染导致的文字移动残影问题 labelCfg: { style: { fontFamily: typeof window !== "undefined" && window.getComputedStyle ? window .getComputedStyle(document.body, null) .getPropertyValue("font-family") || "Arial, sans-serif" : "Arial, sans-serif", }, }, descriptionCfg: { style: { fontFamily: typeof window !== "undefined" && window.getComputedStyle ? window .getComputedStyle(document.body, null) .getPropertyValue("font-family") || "Arial, sans-serif" : "Arial, sans-serif", }, }, }, this.options, this.getCustomConfig(cfg) || {}, cfg, ); }, /** * 绘制节点/边,包含文本 * @override * @param {Object} cfg 节点的配置项 * @param {G.Group} group 节点的容器 * @return {IShape} 绘制的图形 */ draw(cfg: ModelConfig, group: IGroup): IShape { const shape: IShape = this.drawShape!(cfg, group); shape.set("className", this.itemType + CLS_SHAPE_SUFFIX); if (cfg.label) { const label = this.drawLabel!(cfg, group); label.set("className", this.itemType + CLS_LABEL_SUFFIX); } return shape; }, /** * 绘制完成后的操作,便于用户继承现有的节点、边 * @param cfg * @param group * @param keyShape */ afterDraw(cfg?: ModelConfig, group?: IGroup, keyShape?: IShape) {}, drawShape(cfg?: ModelConfig, group?: IGroup): IShape { return null as any; }, drawLabel(cfg: ModelConfig, group: IGroup): IShape { const { labelCfg: defaultLabelCfg } = this.getOptions(cfg) as ModelConfig; // image的情况下有可能为null const labelCfg = (defaultLabelCfg || {}) as ILabelConfig; const labelStyle = this.getLabelStyle!(cfg, labelCfg, group); const rotate = labelStyle.rotate; delete labelStyle.rotate; const label = group.addShape("text", { attrs: labelStyle, draggable: true, className: "text-shape", name: "text-shape", }); if (rotate) { const labelBBox = label.getBBox(); let labelMatrix = label.getMatrix(); if (!labelMatrix) { labelMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } if (labelStyle.rotateCenter) { switch (labelStyle.rotateCenter) { case "center": labelMatrix = transform(labelMatrix, [ ["t", -labelBBox.width / 2, -labelBBox.height / 2], ["r", rotate], ["t", labelBBox.width / 2, labelBBox.height / 2], ]); break; case "lefttop": labelMatrix = transform(labelMatrix, [ ["t", -labelStyle.x!, -labelStyle.y!], ["r", rotate], ["t", labelStyle.x, labelStyle.y], ]); break; case "leftcenter": labelMatrix = transform(labelMatrix, [ ["t", -labelStyle.x!, -labelStyle.y! - labelBBox.height / 2], ["r", rotate], ["t", labelStyle.x, labelStyle.y! + labelBBox.height / 2], ]); break; default: labelMatrix = transform(labelMatrix, [ ["t", -labelBBox.width / 2, -labelBBox.height / 2], ["r", rotate], ["t", labelBBox.width / 2, labelBBox.height / 2], ]); break; } } else { labelMatrix = transform(labelMatrix, [ ["t", -labelStyle.x!, -labelStyle.y! - labelBBox.height / 2], ["r", rotate], ["t", labelStyle.x, labelStyle.y! + labelBBox.height / 2], ]); } label.setMatrix(labelMatrix); } if (labelStyle.background) { const rect = this.drawLabelBg(cfg, group, label); const labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX; rect.set("classname", labelBgClassname); label.toFront(); } return label; }, drawLabelBg(cfg: ModelConfig, group: IGroup, label: IElement) { const { labelCfg: defaultLabelCfg } = this.options as ModelConfig; const labelCfg = mix({}, defaultLabelCfg, cfg.labelCfg) as ILabelConfig; const style = this.getLabelBgStyleByPosition(label, cfg, labelCfg, group); const rect = group.addShape("rect", { name: "text-bg-shape", attrs: style, }); return rect; }, getLabelStyleByPosition( cfg: ModelConfig, labelCfg?: ILabelConfig, group?: IGroup, ): LabelStyle { return { text: cfg.label as string }; }, getLabelBgStyleByPosition( label: IElement, cfg: ModelConfig, labelCfg?: ILabelConfig, group?: IGroup, ): LabelStyle { return {}; }, /** * 获取文本的配置项 * @param cfg 节点的配置项 * @param labelCfg 文本的配置项 * @param group 父容器,label 的定位可能与图形相关 */ getLabelStyle( cfg: ModelConfig, labelCfg: ILabelConfig, group: IGroup, ): LabelStyle { const calculateStyle = this.getLabelStyleByPosition!(cfg, labelCfg, group); const attrName = `${this.itemType}Label`; // 取 nodeLabel,edgeLabel 的配置项 const defaultStyle = (Global as any)[attrName] ? (Global as any)[attrName].style : null; const labelStyle = { ...defaultStyle, ...calculateStyle, ...labelCfg.style, }; return labelStyle; }, /** * 获取图形的配置项 * @param cfg */ getShapeStyle(cfg: ModelConfig): ShapeStyle { return cfg.style!; }, /** * 更新节点,包含文本 * @override * @param {Object} cfg 节点/边的配置项 * @param {G6.Item} item 节点/边 */ update(cfg: ModelConfig, item: Item) { (this as any).updateShapeStyle(cfg, item); (this as any).updateLabel(cfg, item); }, updateShapeStyle(cfg: ModelConfig, item: Item) { const group = item.getContainer(); const shape = item.getKeyShape(); const shapeStyle = mix({}, shape.attr(), cfg.style); for (const key in shapeStyle) { const style = shapeStyle[key]; if (isPlainObject(style)) { // 更新图元素样式,支持更新子元素 const subShape = group.find((element) => element.get("name") === key); if (subShape) { subShape.attr(style); } } else { shape.attr({ [key]: style, }); } } }, updateLabel(cfg: ModelConfig, item: Item) { const group = item.getContainer(); const { labelCfg: defaultLabelCfg } = this.getOptions({}) as ModelConfig; const labelClassName = this.itemType + CLS_LABEL_SUFFIX; const label = group.find( (element) => element.get("className") === labelClassName, ); const labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX; let labelBg = group.find( (element) => element.get("classname") === labelBgClassname, ); // 防止 cfg.label = "" 的情况 if (cfg.label || cfg.label === "") { // 若传入的新配置中有 label,(用户没传入但原先有 label,label 也会有值) if (!label) { // 若原先不存在 label,则绘制一个新的 label const newLabel = this.drawLabel!(cfg, group); newLabel.set("className", labelClassName); } else { // 若原先存在 label,则更新样式。与 getLabelStyle 不同在于这里需要融合当前 label 的样式 // 用于融合 style 以外的属性:position, offset, ... let currentLabelCfg = {} as any; if (item.getModel) { currentLabelCfg = item.getModel().labelCfg; } // 这里不能去掉 const labelCfg = deepMix( {}, defaultLabelCfg, currentLabelCfg, cfg.labelCfg, ); // 获取位置信息 const calculateStyle = (this as any).getLabelStyleByPosition( cfg, labelCfg, group, ); // 取 nodeLabel,edgeLabel 的配置项 const cfgStyle = cfg.labelCfg ? cfg.labelCfg.style : undefined; const cfgBgStyle = labelCfg.style && labelCfg.style.background; // 需要融合当前 label 的样式 label.attr()。不再需要全局/默认样式,因为已经应用在当前的 label 上 const labelStyle = { ...label.attr(), ...calculateStyle, ...cfgStyle }; const rotate = labelStyle.rotate; delete labelStyle.rotate; // 计算 label 的旋转矩阵 if (rotate) { // if G 4.x define the rotateAtStart, use it directly instead of using the following codes let rotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; rotateMatrix = transform(rotateMatrix, [ ["t", -labelStyle.x, -labelStyle.y], ["r", rotate], ["t", labelStyle.x, labelStyle.y], ]); label.resetMatrix(); label.attr({ ...labelStyle, matrix: rotateMatrix }); } else { label.resetMatrix(); label.attr(labelStyle); } if (!labelBg) { if (labelStyle.background) { labelBg = this.drawLabelBg(cfg, group, label); labelBg.set("classname", labelBgClassname); label.toFront(); } } else if (labelStyle.background) { const calculateBgStyle = (this as any).getLabelBgStyleByPosition( label, cfg, labelCfg, group, ); const labelBgStyle = { ...calculateBgStyle, ...cfgBgStyle }; labelBg.resetMatrix(); if (rotate) { let bgRotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; bgRotateMatrix = transform(bgRotateMatrix, [ ["t", -labelBgStyle.x, -labelBgStyle.y], ["r", rotate], ["t", labelBgStyle.x, labelBgStyle.y], ]); labelBgStyle.matrix = bgRotateMatrix; } labelBg.attr(labelBgStyle); } else { group.removeChild(labelBg); } } } }, // update(cfg, item) // 默认不定义 afterUpdate(cfg?: ModelConfig, item?: Item) {}, /** * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现 * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法 * @override * @param {String} name 状态名称 * @param {String | Boolean} value 状态值 * @param {G6.Item} item 节点 */ setState(name: string, value: string | boolean, item: Item) { const shape: IShape = item.get("keyShape"); if (!shape || shape.destroyed) return; const type = item.getType(); const stateName = isBoolean(value) ? name : `${name}:${value}`; const shapeStateStyle = this.getStateStyle(stateName, item); const itemStateStyle = item.getStateStyle(stateName); // const originStyle = item.getOriginStyle(); // 不允许设置一个不存在的状态 if (!itemStateStyle && !shapeStateStyle) { return; } // 要设置或取消的状态的样式 // 当没有 state 状态时,默认使用 model.stateStyles 中的样式 const styles = mix({}, itemStateStyle || shapeStateStyle); const group = item.getContainer(); // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值。使用对象检索更快 const keptAttrs: any = { x: 1, y: 1, cx: 1, cy: 1 }; if (type === "combo") { keptAttrs.r = 1; keptAttrs.width = 1; keptAttrs.height = 1; } if (value) { // style 为要设置的状态的样式 for (const key in styles) { const style = styles[key]; if (isPlainObject(style) && !ARROWS.includes(key)) { const subShape = group.find((element) => element.get("name") === key); if (subShape) { subShape.attr(style); } } else { // 非纯对象,则认为是设置到 keyShape 上面的 shape.attr({ [key]: style, }); } } } else { // 所有生效的 state 的样式 const enableStatesStyle = cloneBesidesImg(item.getCurrentStatesStyle()); const model = item.getModel(); // 原始样式 const originStyle = mix( {}, model.style, cloneBesidesImg(item.getOriginStyle()), ); const keyShapeName = shape.get("name"); // cloning shape.attr(), keys.forEach to avoid cloning the img attr, which leads to maximum clone heap #2383 // const keyShapeStyles = clone(shape.attr()) const shapeAttrs = shape.attr(); const keyShapeStyles = {}; Object.keys(shapeAttrs).forEach((key) => { if (key === "img") return; const attr = shapeAttrs[key]; if (attr && typeof attr === "object") { keyShapeStyles[key] = clone(attr); } else { keyShapeStyles[key] = attr; } }); // 已有样式 - 要取消的状态的样式 const filtetDisableStatesStyle: any = {}; // styles 为要取消的状态的样式 for (const p in styles) { const style = styles[p]; if (isPlainObject(style) && !ARROWS.includes(p)) { const subShape = group.find((element) => element.get("name") === p); if (subShape) { const subShapeStyles = clone(subShape.attr()); each(style, (v, key) => { if ( p === keyShapeName && keyShapeStyles[key] && !keptAttrs[key] ) { delete keyShapeStyles[key]; const value = originStyle[p][key] || SHAPES_DEFAULT_ATTRS[type][key]; shape.attr(key, value); } else if (subShapeStyles[key] || subShapeStyles[key] === 0) { delete subShapeStyles[key]; const value = originStyle[p][key] || SHAPES_DEFAULT_ATTRS[type][key]; subShape.attr(key, value); } }); filtetDisableStatesStyle[p] = subShapeStyles; } } else { if (keyShapeStyles[p] && !keptAttrs[p]) { delete keyShapeStyles[p]; const value = originStyle[p] || (originStyle[keyShapeName] ? originStyle[keyShapeName][p] : undefined) || SHAPES_DEFAULT_ATTRS[type][p]; shape.attr(p, value); } } } // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值后, // 如果 keyShape 有 name 属性,则 filtetDisableStatesStyle 的格式为 { keyShapeName: {} } // 否则为普通对象 if (!keyShapeName) { mix(filtetDisableStatesStyle, keyShapeStyles); } else { filtetDisableStatesStyle[keyShapeName] = keyShapeStyles; } for (const key in enableStatesStyle) { if (keptAttrs[key]) continue; const enableStyle = enableStatesStyle[key]; if (!isPlainObject(enableStyle) || ARROWS.includes(key)) { // 把样式属性merge到keyShape中 if (!keyShapeName) { mix(originStyle, { [key]: enableStyle, }); } else { mix(originStyle[keyShapeName], { [key]: enableStyle, }); delete originStyle[key]; } delete enableStatesStyle[key]; } } const originstyles = {}; deepMix( originstyles, originStyle, filtetDisableStatesStyle, enableStatesStyle, ); let keyShapeSetted = false; for (const originKey in originstyles) { const style = originstyles[originKey]; if (isPlainObject(style) && !ARROWS.includes(originKey)) { const subShape = group.find( (element) => element.get("name") === originKey, ); if (subShape) { if (originKey === keyShapeName) { if (type === "combo") { delete (style as any).r; delete (style as any).width; delete (style as any).height; } keyShapeSetted = true; } subShape.attr(style); } } else if (!keyShapeSetted) { const value = style || SHAPES_DEFAULT_ATTRS[type][originKey]; // 当更新 combo 状态时,当不存在 keyShapeName 时候,则认为是设置到 keyShape 上面的 if (type === "combo") { if (!keyShapeName) { shape.attr({ [originKey]: value, }); } } else { shape.attr({ [originKey]: value, }); } } } } }, /** * 获取不同状态下的样式 * * @param {string} name 状态名称 * @param {Item} item Node或Edge的实例 * @return {object} 样式 */ getStateStyle(name: string, item: Item): ShapeStyle { const model = item.getModel(); const type = item.getType(); const { stateStyles, style = {} } = this.getOptions(model); const modelStateStyle = model.stateStyles ? model.stateStyles[name] : stateStyles && stateStyles[name]; if (type === "combo") { return clone(modelStateStyle); } return mix({}, style, modelStateStyle); }, /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getControlPoints(cfg: EdgeConfig): IPoint[] | undefined { return cfg.controlPoints; }, /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 锚点的数组,如果为 null,则没有锚点 */ getAnchorPoints(cfg: ModelConfig): number[][] | undefined { const { anchorPoints } = this.getOptions(cfg) as ModelConfig; return anchorPoints; }, }; ================================================ FILE: packages/core/src/element/xml.ts ================================================ /** * @fileOverview 从xml建立自定义Node,包含update * @author xuzhi.mxz@antfin.com */ import { get } from "@antv/util"; import { getTextSize } from "../util/graphic"; /** * 一种更宽松的JSON 解析,如果遇到不符合规范的字段会直接转为字符串 * @param text json 内容 */ function looseJSONParse(text) { if (typeof text !== "string") { return text; } const safeParse = (str) => { if (typeof str !== "string") { return str; } try { return JSON.parse(str.trim()); } catch (e) { return str.trim(); } }; const firstAttempt = safeParse(text); if (typeof firstAttempt !== "string") { return firstAttempt; } const tail = (arr) => arr[arr.length - 1]; const str = text.trim(); const objectStack = []; const syntaxStack = []; const isLastPair = (...syntaxes) => syntaxes.some((syntax) => tail(syntaxStack) === syntax); const getValueStore = () => tail(objectStack); let rst = null; let i = 0; let temp = ""; while (i < str.length) { const nowChar = str[i]; const isInString = isLastPair('"', "'"); if (!isInString && !nowChar.trim()) { i += 1; continue; } const isLastTranslate = str[i - 1] === "\\"; const isInObject = isLastPair("}"); const isInArray = isLastPair("]"); const isWaitingValue = isLastPair(","); const tempArr = getValueStore(); if (isInString) { if (tail(syntaxStack) === nowChar && !isLastTranslate) { syntaxStack.pop(); const value = safeParse(temp); tempArr.push(value); rst = value; temp = ""; } else { temp += nowChar; } } else if (isInArray && nowChar === ",") { if (temp) { tempArr.push(safeParse(temp)); temp = ""; } } else if (isInObject && nowChar === ":") { syntaxStack.push(","); if (temp) { tempArr.push(temp); temp = ""; } } else if (isWaitingValue && nowChar === ",") { if (temp) { tempArr.push(safeParse(temp)); temp = ""; } syntaxStack.pop(); } else if (nowChar === "}" && (isInObject || isWaitingValue)) { if (temp) { tempArr.push(safeParse(temp)); temp = ""; } if (isWaitingValue) { syntaxStack.pop(); } const obj = {}; for (let c = 1; c < tempArr.length; c += 2) { obj[tempArr[c - 1]] = tempArr[c]; } objectStack.pop(); if (objectStack.length) { tail(objectStack).push(obj); } syntaxStack.pop(); rst = obj; } else if (nowChar === "]" && isInArray) { if (temp) { tempArr.push(safeParse(temp)); temp = ""; } objectStack.pop(); if (objectStack.length) { tail(objectStack).push(tempArr); } syntaxStack.pop(); rst = tempArr; } else if (nowChar === "{") { objectStack.push([]); syntaxStack.push("}"); } else if (nowChar === "[") { objectStack.push([]); syntaxStack.push("]"); } else if (nowChar === '"') { syntaxStack.push('"'); } else if (nowChar === "'") { syntaxStack.push("'"); } else { temp += nowChar; } i += 1; } return rst || temp; } /** * 内部用于最终实际渲染的结构 */ interface NodeInstructure { type: string; attrs: { [key: string]: any }; children: NodeInstructure[]; bbox: { x: number; y: number; width: number; height: number; }; } const keyConvert = (str) => str.split("-").reduce((a, b) => a + b.charAt(0).toUpperCase() + b.slice(1)); /** * 简单的一个{{}}模板渲染,不包含任何复杂语法 * @param xml */ export const xmlDataRenderer = (xml: string) => (data) => { const len = xml.length; const arr = []; let i = 0; let tmp = ""; while (i < len) { if (xml[i] === "{" && xml[i + 1] === "{") { arr.push(tmp); tmp = ""; i += 2; } else if (xml[i] === "}" && xml[i + 1] === "}") { if (arr.length) { const last = arr.pop(); tmp = get(data, tmp, last.endsWith("=") ? `"{${tmp}}"` : tmp); arr.push(last + tmp); } i += 2; tmp = ""; } else { tmp += xml[i]; i += 1; } } arr.push(tmp); return arr .map((e, index) => arr[index - 1] && arr[index - 1].endsWith("=") ? `"{${e}}"` : e, ) .join(""); }; /** * 解析XML,并转化为相应的JSON结构 * @param xml xml解析后的节点 */ export function parseXML(xml: HTMLElement, cfg) { let attrs = {} as { [key: string]: any }; const keys = (xml.getAttributeNames && xml.getAttributeNames()) || ([] as string[]); const children = xml.children && Array.from(xml.children).map((e) => parseXML(e as HTMLElement, cfg)); const rst = {} as { [key: string]: any } & NodeInstructure; const tagName = xml.tagName ? xml.tagName.toLowerCase() : "group"; if (tagName === "text") { attrs.text = xml.innerText; } rst.type = tagName; if (tagName === "img") { rst.type = "image"; } Array.from(keys).forEach((k) => { const key = keyConvert(k); const val = xml.getAttribute(k); try { if (key === "style" || key === "attrs") { const style = looseJSONParse(val); attrs = { ...attrs, ...style, }; } else { rst[key] = looseJSONParse(val); } } catch (e) { if (key === "style") { throw e; } rst[key] = val; } }); rst.attrs = attrs; if (cfg && cfg.style && rst.name && typeof cfg.style[rst.name] === "object") { rst.attrs = { ...rst.attrs, ...cfg.style[rst.name], }; } if (cfg && cfg.style && rst.keyshape) { rst.attrs = { ...rst.attrs, ...cfg.style, }; } if (children.length) { rst.children = children; } return rst; } /** * 根据偏移量和内部节点最终的bounding box来得出该shape最终的bbox */ export function getBBox( node: NodeInstructure, offset: { x: number; y: number }, chilrenBBox: { width: number; height: number }, ) { const { attrs = {} } = node; const bbox = { x: offset.x || 0, y: offset.y || 0, width: chilrenBBox.width || 0, height: chilrenBBox.height || 0, }; let shapeHeight, shapeWidth; switch (node.type) { case "maker": case "circle": if (attrs.r) { shapeWidth = 2 * attrs.r; shapeHeight = 2 * attrs.r; } break; case "text": if (attrs.text) { shapeWidth = getTextSize(attrs.text, attrs.fontSize || 12)[0]; shapeHeight = 16; bbox.y += shapeHeight; bbox.height = shapeHeight; bbox.width = shapeWidth; node.attrs = { fontSize: 12, fill: "#000", ...attrs, }; } break; default: if (attrs.width) { shapeWidth = attrs.width; } if (attrs.height) { shapeHeight = attrs.height; } } if (shapeHeight >= 0) { bbox.height = shapeHeight; } if (shapeWidth >= 0) { bbox.width = shapeWidth; } if (attrs.marginTop) { bbox.y += attrs.marginTop; } if (attrs.marginLeft) { bbox.x += attrs.marginLeft; } return bbox; } /** * 把从xml计算出的结构填上位置信息,补全attrs * @param target * @param lastOffset */ export function generateTarget( target: NodeInstructure, lastOffset = { x: 0, y: 0 }, ) { const defaultBbox = { x: 0, y: 0, width: 0, height: 0, ...lastOffset, }; if (target.children?.length) { const { attrs = {} } = target; const { marginTop } = attrs; const offset = { ...lastOffset }; if (marginTop) { offset.y += marginTop; } for (let index = 0; index < target.children.length; index++) { target.children[index].attrs.key = `${attrs.key || "root"} -${index} `; const node = generateTarget(target.children[index], offset); if (node.bbox) { const { bbox } = node; if (node.attrs.next === "inline") { offset.x += node.bbox.width; } else { offset.y += node.bbox.height; } if (bbox.width + bbox.x > defaultBbox.width) { defaultBbox.width = bbox.width + bbox.x; } if (bbox.height + bbox.y > defaultBbox.height) { defaultBbox.height = bbox.height + bbox.y; } } } } target.bbox = getBBox(target, lastOffset, defaultBbox); target.attrs = { ...target.attrs, ...target.bbox, }; return target; } /** * 对比前后两个最终计算出来的node,并对比出最小改动, * 动作: 'add' 添加节点 | ’delete‘ 删除节点 | ’change‘ 改变节点attrs | 'restructure' 重构节点 * @param nowTarget * @param formerTarget */ export function compareTwoTarget( nowTarget: NodeInstructure, formerTarget: NodeInstructure, ) { const { type } = nowTarget || {}; const { key } = formerTarget?.attrs || {}; if (key && nowTarget) { nowTarget.attrs.key = key; } if (!nowTarget && formerTarget) { return { action: "delete", val: formerTarget, type, key, }; } if (nowTarget && !formerTarget) { return { action: "add", val: nowTarget, type, }; } if (!nowTarget && !formerTarget) { return { action: "same", type, }; } const children = []; if (nowTarget.children?.length > 0 || formerTarget.children?.length > 0) { const length = Math.max( nowTarget.children?.length, formerTarget.children?.length, ); const formerChilren = formerTarget.children || []; const nowChilren = nowTarget.children || []; for (let index = 0; index < length; index += 1) { children.push(compareTwoTarget(nowChilren[index], formerChilren[index])); } } const formerKeys = Object.keys(formerTarget.attrs); const nowKeys = Object.keys(nowTarget.attrs); if (formerTarget.type !== nowTarget.type) { return { action: "restructure", nowTarget, formerTarget, key, children, }; } if ( formerKeys .filter((e) => e !== "children") .some( (e) => nowTarget.attrs[e] !== formerTarget.attrs[e] || !nowKeys.includes(e), ) ) { return { action: "change", val: nowTarget, children, type, key, }; } return { action: "same", children, type, key, }; } /** * 根据xml或者返回xml的函数构建自定义节点的结构 * @param gen */ export function createNodeFromXML(gen: string | ((node: any) => string)) { const structures = {}; const compileXML = (cfg) => { const rawStr = typeof gen === "function" ? gen(cfg) : gen; const target = xmlDataRenderer(rawStr)(cfg); // TODO 这里需要一个patch #16 const xmlParser = document.createElement("div"); xmlParser.innerHTML = target; const xml = xmlParser.children[0] as HTMLElement; const result = generateTarget(parseXML(xml, cfg)); xmlParser.remove(); return result; }; return { draw(cfg, group) { const resultTarget = compileXML(cfg); let keyshape = group; const renderTarget = (target) => { const { attrs = {}, bbox, type, children, ...rest } = target; if (target.type !== "group") { const shape = group.addShape(target.type, { attrs, origin: { bbox, type, children, }, ...rest, }); if (target.keyshape) { keyshape = shape; } } if (target.children) { target.children.forEach((n) => renderTarget(n)); } }; renderTarget(resultTarget); structures[cfg.id] = [resultTarget]; return keyshape; }, update(cfg, node) { if (!structures[cfg.id]) { structures[cfg.id] = []; } const container = node.getContainer(); const children = container.get("children"); const newTarget = compileXML(cfg); const lastTarget = structures[cfg.id].pop(); const diffResult = compareTwoTarget(newTarget, lastTarget); const addShape = (shape) => { if (shape.type !== "group") { container.addShape(shape.type, { attrs: shape.attrs }); } if (shape.children?.length) { shape.children.map((e) => addShape(e)); } }; const delShape = (shape) => { const targetShape = children.find( (e) => e.attrs.key === shape.attrs.key, ); if (targetShape) { container.removeChild(targetShape); } if (shape.children?.length) { shape.children.map((e) => delShape(e)); } }; const updateTarget = (target) => { const { key } = target; if (target.type !== "group") { const targetShape = children.find((e) => e.attrs.key === key); switch (target.action) { case "change": if (targetShape) { const originAttr = target.val.keyshape ? node.getOriginStyle() : {}; targetShape.attr({ ...originAttr, ...target.val.attrs }); } break; case "add": addShape(target.val); break; case "delete": delShape(target.val); break; case "restructure": delShape(target.formerTarget); addShape(target.nowTarget); break; default: break; } } if (target.children) { target.children.forEach((n) => updateTarget(n)); } }; updateTarget(diffResult); structures[cfg.id].push(newTarget); }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0], ]; }, }; } ================================================ FILE: packages/core/src/global.ts ================================================ const subjectColor = "rgb(95, 149, 255)"; const backColor = "rgb(255, 255, 255)"; const textColor = "rgb(0, 0, 0)"; const activeFill = "rgb(247, 250, 255)"; const nodeMainFill = "rgb(239, 244, 255)"; const comboFill = "rgb(253, 253, 253)"; const disabledFill = "rgb(250, 250, 250)"; const edgeMainStroke = "rgb(224, 224, 224)"; const edgeInactiveStroke = "rgb(234, 234, 234)"; const edgeDisablesStroke = "rgb(245, 245, 245)"; const inactiveStroke = "rgb(191, 213, 255)"; const highlightStroke = "#4572d9"; const highlightFill = "rgb(223, 234, 255)"; const colorSet = { // for nodes mainStroke: subjectColor, mainFill: nodeMainFill, activeStroke: subjectColor, activeFill, inactiveStroke, inactiveFill: activeFill, selectedStroke: subjectColor, selectedFill: backColor, highlightStroke, highlightFill, disableStroke: edgeMainStroke, disableFill: disabledFill, // for edges edgeMainStroke, edgeActiveStroke: subjectColor, edgeInactiveStroke, edgeSelectedStroke: subjectColor, edgeHighlightStroke: subjectColor, edgeDisableStroke: edgeDisablesStroke, // for combos comboMainStroke: edgeMainStroke, comboMainFill: comboFill, comboActiveStroke: subjectColor, comboActiveFill: activeFill, comboInactiveStroke: edgeMainStroke, comboInactiveFill: comboFill, comboSelectedStroke: subjectColor, comboSelectedFill: comboFill, comboHighlightStroke: highlightStroke, // 'rgb(53, 119, 222)', // TODO: how to generate it ??? comboHighlightFill: comboFill, comboDisableStroke: edgeInactiveStroke, comboDisableFill: disabledFill, }; export default { version: "0.0.2", rootContainerClassName: "root-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, // 节点的默认文本不居中时的偏移量 }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: colorSet.mainStroke, fill: nodeMainFill, }, size: 20, color: colorSet.mainStroke, linkPoints: { size: 8, lineWidth: 1, fill: colorSet.activeFill, stroke: colorSet.activeStroke, }, }, // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 nodeStateStyles: { active: { fill: colorSet.activeFill, stroke: colorSet.activeStroke, lineWidth: 2, shadowColor: colorSet.mainStroke, shadowBlur: 10, }, selected: { fill: colorSet.selectedFill, stroke: colorSet.selectedStroke, lineWidth: 4, shadowColor: colorSet.selectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { fill: colorSet.highlightFill, stroke: colorSet.highlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500, }, }, inactive: { fill: colorSet.inactiveFill, stroke: colorSet.inactiveStroke, lineWidth: 1, }, disable: { fill: colorSet.disableFill, stroke: colorSet.disableStroke, lineWidth: 1, }, }, edgeLabel: { style: { fill: textColor, textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: colorSet.edgeMainStroke, lineAppendWidth: 2, }, color: colorSet.edgeMainStroke, }, // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 edgeStateStyles: { active: { stroke: colorSet.edgeActiveStroke, lineWidth: 1, }, selected: { stroke: colorSet.edgeSelectedStroke, lineWidth: 2, shadowColor: colorSet.edgeSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { stroke: colorSet.edgeHighlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500, }, }, inactive: { stroke: colorSet.edgeInactiveStroke, lineWidth: 1, }, disable: { stroke: colorSet.edgeDisableStroke, lineWidth: 1, }, }, comboLabel: { style: { fill: textColor, // textAlign: 'center', textBaseline: "middle", fontSize: 12, }, refY: 10, // Combo 的默认文本不居中时的偏移量 refX: 10, // Combo 的默认文本不居中时的偏移量 }, defaultCombo: { type: "circle", style: { fill: colorSet.comboMainFill, lineWidth: 1, stroke: colorSet.comboMainStroke, r: 5, width: 20, height: 10, }, size: [20, 5], color: colorSet.comboMainStroke, padding: [25, 20, 15, 20], }, // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 comboStateStyles: { active: { stroke: colorSet.comboActiveStroke, lineWidth: 1, fill: colorSet.comboActiveFill, }, selected: { stroke: colorSet.comboSelectedStroke, lineWidth: 2, fill: colorSet.comboSelectedFill, shadowColor: colorSet.comboSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { stroke: colorSet.comboHighlightStroke, lineWidth: 2, fill: colorSet.comboHighlightFill, "text-shape": { fontWeight: 500, }, }, inactive: { stroke: colorSet.comboInactiveStroke, fill: colorSet.comboInactiveFill, lineWidth: 1, }, disable: { stroke: colorSet.comboDisableStroke, fill: colorSet.comboDisableFill, lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, }; ================================================ FILE: packages/core/src/graph/controller/event.ts ================================================ import { IAbstractGraph } from "../../interface/graph"; export default abstract class EventController { protected graph: IAbstractGraph; public destroyed: boolean; constructor(graph: IAbstractGraph) { this.graph = graph; this.destroyed = false; this.initEvents(); } // 初始化 G6 中的事件 protected abstract initEvents(): void; public abstract destroy(): void; } ================================================ FILE: packages/core/src/graph/controller/index.ts ================================================ export { default as ModeController } from "./mode"; export { default as ViewController } from "./view"; export { default as ItemController } from "./item"; export { default as StateController } from "./state"; ================================================ FILE: packages/core/src/graph/controller/item.ts ================================================ import { IGroup } from "@antv/g-base"; import { clone, deepMix, each, isArray, isObject, isString, upperFirst, } from "@antv/util"; import Edge from "../../item/edge"; import Node from "../../item/node"; import Combo from "../../item/combo"; import { EdgeConfig, Item, ITEM_TYPE, ModelConfig, NodeConfig, NodeMap, ComboTree, ComboConfig, } from "../../types"; import { IAbstractGraph } from "../../interface/graph"; import { IEdge, INode, ICombo } from "../../interface/item"; import { traverseTreeUp, traverseTree, getComboBBox, shouldRefreshEdge, } from "../../util/graphic"; const NODE = "node"; const EDGE = "edge"; const VEDGE = "vedge"; const COMBO = "combo"; const CFG_PREFIX = "default"; const MAPPER_SUFFIX = "Mapper"; const STATE_SUFFIX = "stateStyles"; type Id = string | Item | undefined; export default class ItemController { private graph: IAbstractGraph; public destroyed: boolean; constructor(graph: IAbstractGraph) { this.graph = graph; this.destroyed = false; } /** * 增加 Item 实例 * * @param {ITEM_TYPE} type 实例类型,node 或 edge * @param {(NodeConfig & EdgeConfig)} model 数据模型 * @returns {(Item)} * @memberof ItemController */ public addItem(type: ITEM_TYPE, model: ModelConfig) { const { graph } = this; const vType = type === VEDGE ? EDGE : type; const parent: IGroup = graph.get(`${vType}Group`) || graph.get("group"); const upperType = upperFirst(vType); let item: Item | null = null; // 获取 this.get('styles') 中的值 let styles = graph.get(vType + upperFirst(STATE_SUFFIX)) || {}; const defaultModel = graph.get(CFG_PREFIX + upperType); if (model[STATE_SUFFIX]) { // 设置 this.get('styles') 中的值 styles = model[STATE_SUFFIX]; } if (defaultModel) { // 很多布局会直接修改原数据模型,所以不能用 merge 的形式,逐个写入原 model 中 each(defaultModel, (val, cfg) => { if (isObject(val) && !isArray(val)) { model[cfg] = deepMix({}, val, model[cfg]); } else if (isArray(val)) { model[cfg] = model[cfg] || clone(defaultModel[cfg]); } else { model[cfg] = model[cfg] || defaultModel[cfg]; } }); } const mapper = graph.get(vType + MAPPER_SUFFIX); if (mapper) { const mappedModel = mapper(model); if (mappedModel[STATE_SUFFIX]) { // 设置 this.get('styles') 中的值 styles = mappedModel[STATE_SUFFIX]; delete mappedModel[STATE_SUFFIX]; } // 如果配置了 defaultEdge 或 defaultNode,则将默认配置的数据也合并进去 each(mappedModel, (val, cfg) => { if (isObject(val) && !isArray(val)) { model[cfg] = deepMix({}, model[cfg], val); } else { model[cfg] = mappedModel[cfg] || model[cfg]; } }); } graph.emit("beforeadditem", { type, model }); if (type === EDGE || type === VEDGE) { let source: Id; let target: Id; source = (model as EdgeConfig).source; // eslint-disable-line prefer-destructuring target = (model as EdgeConfig).target; // eslint-disable-line prefer-destructuring if (source && isString(source)) { source = graph.findById(source); } if (target && isString(target)) { target = graph.findById(target); } if (!source || !target) { console.warn( `The source or target node of edge ${model.id} does not exist!`, ); return; } if ((source as Item).getType && (source as Item).getType() === "combo") { model.isComboEdge = true; // graph.updateCombo(source as ICombo); } if ((target as Item).getType && (target as Item).getType() === "combo") { model.isComboEdge = true; // graph.updateCombo(target as ICombo); } item = new Edge({ model, source, target, styles, linkCenter: graph.get("linkCenter"), group: parent.addGroup(), }); } else if (type === NODE) { item = new Node({ model, styles, group: parent.addGroup(), }); } else if (type === COMBO) { const children: ComboTree[] = (model as ComboConfig).children; const comboBBox = getComboBBox(children, graph); if (!isNaN(comboBBox.x)) model.x = comboBBox.x; else if (isNaN(model.x)) model.x = Math.random() * 100; if (!isNaN(comboBBox.y)) model.y = comboBBox.y; else if (isNaN(model.y)) model.y = Math.random() * 100; const comboGroup = parent.addGroup(); comboGroup.setZIndex((model as ComboConfig).depth as number); item = new Combo({ model, styles, bbox: model.collapsed ? getComboBBox([], graph) : comboBBox, group: comboGroup, }); const comboModel = item.getModel(); (children || []).forEach((child) => { const childItem = graph.findById(child.id) as ICombo | INode; (item as ICombo).addChild(childItem); child.depth = (comboModel.depth as number) + 2; }); // collapse the combo if the collapsed is true in the model if (model.collapsed) { setTimeout(() => { graph.collapseCombo(item as ICombo); }, 16); } } if (item) { graph.get(`${type}s`).push(item); graph.get("itemMap")[item.get("id")] = item; graph.emit("afteradditem", { item, model }); // eslint-disable-next-line consistent-return return item as T; } } /** * 更新节点或边 * * @param {Item} item ID 或 实例 * @param {(EdgeConfig | Partial)} cfg 数据模型 * @returns * @memberof ItemController */ public updateItem( item: Item | string, cfg: EdgeConfig | Partial, ) { const { graph } = this; if (isString(item)) { item = graph.findById(item) as Item; } if (!item || item.destroyed) { return; } // 更新的 item 的类型 let type = ""; if (item.getType) type = item.getType(); const mapper = graph.get(type + MAPPER_SUFFIX); const model = item.getModel(); const isOnlyMove = item.isOnlyMove(cfg); if (mapper) { const result: ModelConfig = deepMix({}, model, cfg); const mappedModel: ModelConfig = mapper(result); // 将 update 时候用户传入的参数与mapperModel做deepMix,以便复用之前设置的参数值 const newModel: ModelConfig = deepMix({}, model, mappedModel, cfg); if (mappedModel[STATE_SUFFIX]) { item.set("styles", newModel[STATE_SUFFIX]); delete newModel[STATE_SUFFIX]; } each(newModel, (val, key) => { cfg[key] = val; }); } else { // merge update传进来的对象参数,model中没有的数据不做处理,对象和字符串值也不做处理,直接替换原来的 each(cfg, (val, key) => { if (model[key]) { if (isObject(val) && !isArray(val)) { cfg[key] = { ...(model[key] as Object), ...(cfg[key] as Object) }; } } }); } // emit beforeupdateitem 事件 graph.emit("beforeupdateitem", { item, cfg }); if (type === EDGE) { // 若是边要更新source || target, 为了不影响示例内部model,并且重新计算startPoint和endPoint,手动设置 if (cfg.source) { let source: INode = cfg.source as INode; if (isString(source)) { source = graph.findById(source) as INode; } (item as IEdge).setSource(source); } if (cfg.target) { let target: INode = cfg.target as INode; if (isString(target)) { target = graph.findById(target) as INode; } (item as IEdge).setTarget(target); } item.update(cfg); } // item.update(cfg); if (type === NODE || type === COMBO) { item.update(cfg, isOnlyMove); const edges: IEdge[] = (item as INode).getEdges(); const refreshEdge = shouldRefreshEdge(cfg)!; if (refreshEdge && type === NODE) each(edges, (edge: IEdge) => { edge.refresh(); }); else if (refreshEdge && type === COMBO) { const shapeFactory = item.get("shapeFactory"); const shapeType = (model.type as string) || "circle"; const comboAnimate = model.animate === undefined || cfg.animate === undefined ? shapeFactory[shapeType]?.options?.animate : model.animate || cfg.animate; if (comboAnimate) { setTimeout(() => { if (!item || (item as ICombo).destroyed) return; const keyShape = (item as ICombo).getKeyShape(); if (!keyShape || keyShape.destroyed) return; each(edges, (edge: IEdge) => { if (edge && !edge.destroyed) edge.refresh(); }); }, 201); } else { each(edges, (edge: IEdge) => { edge.refresh(); }); } } } graph.emit("afterupdateitem", { item, cfg }); } /** * 根据 combo 的子元素更新 combo 的位置及大小 * * @param {ICombo} combo ID 或 实例 * @returns * @memberof ItemController */ public updateCombo(combo: ICombo | string, children: ComboTree[]) { const { graph } = this; if (isString(combo)) { combo = graph.findById(combo) as ICombo; } if (!combo || combo.destroyed) { return; } const model = combo.getModel(); const comboBBox = getComboBBox(model.collapsed ? [] : children, graph); combo.set("bbox", comboBBox); combo.update({ x: comboBBox.x, y: comboBBox.y, }); const shapeFactory = combo.get("shapeFactory"); const shapeType = (model.type as string) || "circle"; const comboAnimate = model.animate === undefined ? shapeFactory[shapeType]?.options?.animate : model.animate; if (comboAnimate) { setTimeout(() => { if (!combo || (combo as ICombo).destroyed) return; const keyShape = (combo as ICombo).getKeyShape(); if (!keyShape || keyShape.destroyed) return; (combo as ICombo).getShapeCfg(model); // 更新 combo 缓存的 size this.updateComboEdges(combo as ICombo); }, 201); } else { this.updateComboEdges(combo as ICombo); } } private updateComboEdges(combo: ICombo) { const combEdges = combo.getEdges() || []; for (let i = 0; i < combEdges.length; i++) { const edge = combEdges[i]; if (edge && !edge.destroyed) { const edgeSF = edge.get("shapeFactory"); const edgeCfg = edge.getShapeCfg(edge.getModel()); const edgeGroup = edge.getContainer(); edgeGroup.clear(); const keyShape = edgeSF.draw(edgeCfg.type, edgeCfg, edgeGroup); edge.set("keyShape", keyShape); keyShape.set("isKeyShape", true); keyShape.set("draggable", true); edge.setOriginStyle(); } } } /** * 收起 combo,隐藏相关元素 */ public collapseCombo(combo: ICombo | string) { const graph = this.graph; if (isString(combo)) { combo = graph.findById(combo) as ICombo; } const children = (combo as ICombo).getChildren(); children.nodes.forEach((node) => { graph.hideItem(node); }); children.combos.forEach((c) => { graph.hideItem(c); }); } /** * 展开 combo,相关元素出现 * 若子 combo 原先是收起状态,则保持它的收起状态 */ public expandCombo(combo: ICombo | string) { const graph = this.graph; if (isString(combo)) { combo = graph.findById(combo) as ICombo; } const children = (combo as ICombo).getChildren(); children.nodes.forEach((node) => { graph.showItem(node); }); children.combos.forEach((c) => { if (c.getModel().collapsed) { c.show(); } else { graph.showItem(c); } }); } /** * 删除指定的节点或边 * * @param {Item} item item ID 或实例 * @returns {void} * @memberof ItemController */ public removeItem(item: Item | string): void { const { graph } = this; if (isString(item)) { item = graph.findById(item); } if (!item || item.destroyed) { return; } const itemModel = clone(item.getModel()); graph.emit("beforeremoveitem", { item: itemModel }); let type = ""; if (item.getType) type = item.getType(); const items = graph.get(`${type}s`); const index = items.indexOf(item); if (index > -1) items.splice(index, 1); if (type === EDGE) { const vitems = graph.get(`v${type}s`); const vindex = vitems.indexOf(item); if (vindex > -1) vitems.splice(vindex, 1); } const itemId: string = item.get("id"); const itemMap: NodeMap = graph.get("itemMap"); delete itemMap[itemId]; const comboTrees = graph.get("comboTrees"); const id = item.get("id"); if (type === NODE) { const comboId = item.getModel().comboId as string; if (comboTrees && comboId) { let brothers = comboTrees; let found = false; // the flag to terminate the forEach circulation // remove the node from the children array of its parent fromt he tree comboTrees.forEach((ctree) => { if (found) return; traverseTree(ctree, (combo) => { if (combo.id === id && brothers) { const bidx = brothers.indexOf(combo); brothers.splice(bidx, 1); found = true; return false; // terminate the traverse } brothers = combo.children; return true; }); }); } // 若移除的是节点,需要将与之相连的边一同删除 const edges = (item as INode).getEdges(); for (let i = edges.length - 1; i >= 0; i--) { graph.removeItem(edges[i], false); } if (comboId) graph.updateCombo(comboId); } else if (type === COMBO) { const parentId = item.getModel().parentId as string; let comboInTree; // find the subtree rooted at the item to be removed let found = false; // the flag to terminate the forEach circulation (comboTrees || []).forEach((ctree) => { if (found) return; traverseTree(ctree, (combo) => { if (combo.id === id) { comboInTree = combo; found = true; return false; // terminate the traverse } return true; }); }); comboInTree.removed = true; if (comboInTree && comboInTree.children) { comboInTree.children.forEach((child) => { this.removeItem(child.id); }); } // 若移除的是 combo,需要将与之相连的边一同删除 const edges = (item as ICombo).getEdges(); for (let i = edges.length; i >= 0; i--) { graph.removeItem(edges[i], false); } if (parentId) graph.updateCombo(parentId); } item.destroy(); graph.emit("afterremoveitem", { item: itemModel }); } /** * 更新 item 状态 * * @param {Item} item Item 实例 * @param {string} state 状态名称 * @param {boolean} value 是否启用状态或状态值 * @returns {void} * @memberof ItemController */ public setItemState( item: Item, state: string, value: string | boolean, ): void { const { graph } = this; let stateName = state; if (isString(value)) { stateName = `${state}:${value}`; } // 已经存在要设置的 state,或不存在 state 的样式为 undefined if ( (item.hasState(stateName) === value && value) || // 当该状态已经存在且现在需要设置为 true 时,不需要继续。当该状态不存在,且设置为 false 时,需要继续 (isString(value) && item.hasState(stateName)) ) { // 当该状态 value 是字符串,且已经存在该状态,不需要继续 return; } graph.emit("beforeitemstatechange", { item, state: stateName, enabled: value, }); item.setState(state, value); graph.autoPaint(); graph.emit("afteritemstatechange", { item, state: stateName, enabled: value, }); } /** * 将指定状态的优先级提升为最高优先级 * @param {Item} item 元素id或元素实例 * @param state 状态名称 */ public priorityState(item: Item | string, state: string): void { const { graph } = this; let currentItem = item; if (isString(item)) { currentItem = graph.findById(item); } // 先取消已有的 state this.setItemState(currentItem as Item, state, false); // 再设置state,则此时该优先级为最高 this.setItemState(currentItem as Item, state, true); } /** * 清除所有指定的状态 * * @param {Item} item Item 实例 * @param {string[]} states 状态名称集合 * @memberof ItemController */ public clearItemStates( item: Item | string, states?: string | string[], ): void { const { graph } = this; if (isString(item)) { item = graph.findById(item); } graph.emit("beforeitemstatesclear", { item, states }); item.clearStates(states); graph.emit("afteritemstatesclear", { item, states }); } /** * 刷新指定的 Item * * @param {Item} item Item ID 或 实例 * @memberof ItemController */ public refreshItem(item: Item | string): void { const { graph } = this; if (isString(item)) { item = graph.findById(item); } graph.emit("beforeitemrefresh", { item }); // 调用 Item 的 refresh 方法,实现刷新功能 item.refresh(); graph.emit("afteritemrefresh", { item }); } /** * 根据 graph 上用 combos 数据生成的 comboTree 来增加所有 combos * * @param {ComboTree[]} comboTrees graph 上用 combos 数据生成的 comboTree * @param {ComboConfig[]} comboModels combos 数据 * @memberof ItemController */ public addCombos(comboTrees: ComboTree[], comboModels: ComboConfig[]) { const { graph } = this; (comboTrees || []).forEach((ctree: ComboTree) => { traverseTreeUp(ctree, (child) => { let comboModel; comboModels.forEach((model) => { if (model.id === child.id) { model.children = child.children; model.depth = child.depth; comboModel = model; } }); if (comboModel) { this.addItem("combo", comboModel); } return true; }); }); const comboGroup = graph.get("comboGroup"); if (comboGroup) comboGroup.sort(); } /** * 改变Item的显示状态 * * @param {Item} item Item ID 或 实例 * @param {boolean} visible 是否显示 * @memberof ItemController */ public changeItemVisibility(item: Item | string, visible: boolean): Item { const { graph } = this; if (isString(item)) { item = graph.findById(item); } if (!item) { console.warn("The item to be shown or hidden does not exist!"); return; } graph.emit("beforeitemvisibilitychange", { item, visible }); item.changeVisibility(visible); if (item.getType && item.getType() === NODE) { const edges = (item as INode).getEdges(); each(edges, (edge: IEdge) => { // 若隐藏节点,则将与之关联的边也隐藏 // 若显示节点,则将与之关联的边也显示,但是需要判断边两端的节点都是可见的 if ( visible && !(edge.get("source").isVisible() && edge.get("target").isVisible()) ) { return; } this.changeItemVisibility(edge, visible); }); } else if (item.getType && item.getType() === COMBO) { const comboTrees = graph.get("comboTrees"); const id = item.get("id"); let children = []; let found = false; // flag the terminate the forEach (comboTrees || []).forEach((ctree) => { if (found) return; if (!ctree.children || ctree.children.length === 0) return; traverseTree(ctree, (combo) => { if (combo.id === id) { children = combo.children; found = true; return false; // terminate the traverse } return true; }); }); if (children && (!visible || (visible && !item.getModel().collapsed))) { children.forEach((child) => { const childItem = graph.findById(child.id); this.changeItemVisibility(childItem, visible); }); } const edges = (item as INode).getEdges(); each(edges, (edge: IEdge) => { // 若隐藏 combo,则将与 combo 本身关联的边也隐藏 // 若显示 combo,则将与 combo 本身关联的边也显示,但是需要判断边两端的节点都是可见的 if ( visible && !(edge.get("source").isVisible() && edge.get("target").isVisible()) ) { return; } this.changeItemVisibility(edge, visible); }); } graph.emit("afteritemvisibilitychange", { item, visible }); return item; } public destroy() { (this.graph as IAbstractGraph | null) = null; this.destroyed = true; } } ================================================ FILE: packages/core/src/graph/controller/layout.ts ================================================ import { isFunction, groupBy } from "@antv/util"; import { isNaN, calculationItemsBBox } from "../../util/base"; import { GraphData } from "../../types"; import { IAbstractGraph } from "../../interface/graph"; export default abstract class LayoutController { public graph: IAbstractGraph; public destroyed: boolean; protected layoutCfg; protected layoutType: string | string[]; protected layoutMethods; protected data; constructor(graph: IAbstractGraph) { this.graph = graph; this.layoutCfg = graph.get("layout") || {}; this.layoutType = this.getLayoutType(); this.layoutMethods = []; this.initLayout(); } // eslint-disable-next-line class-methods-use-this protected initLayout() { // no data before rendering } public getLayoutType(): string | string[] { return this.getLayoutCfgType(this.layoutCfg); } protected getLayoutCfgType(layoutCfg): string | string[] { const type = layoutCfg.type; // type should be top priority if (type) { return type; } const pipes = layoutCfg.pipes; if (Array.isArray(pipes)) { return pipes.map((pipe) => pipe?.type || ""); } return null; } protected isLayoutTypeSame(cfg): boolean { const current = this.getLayoutCfgType(cfg); // already has pipes if (Array.isArray(this.layoutType)) { return this.layoutType.every((type, index) => type === current[index]); } return cfg?.type === this.layoutType; } /** * @param {function} success callback * @return {boolean} 是否使用web worker布局 */ public abstract layout(success?: () => void): boolean; // 绘制 public refreshLayout() { const { graph } = this; if (!graph) return; if (graph.get("animate")) { graph.positionsAnimate(); } else { graph.refreshPositions(); } } // 更新布局参数 public abstract updateLayoutCfg(cfg); // 更换布局 public changeLayout(cfg) { this.layoutCfg = cfg; this.destoryLayoutMethods(); this.layout(); } // 更换数据 public changeData() { this.destoryLayoutMethods(); this.layout(); } public destoryLayoutMethods() { const { layoutMethods } = this; layoutMethods?.forEach((layoutMethod) => { layoutMethod.destroy(); }); this.layoutMethods = []; } // 销毁布局,不能使用 this.destroy,因为 controller 还需要被使用,只是把布局算法销毁 public destroyLayout() { const { graph } = this; this.destoryLayoutMethods(); graph.set("layout", undefined); this.layoutCfg = undefined; this.layoutType = undefined; this.layoutMethods = undefined; } // 从 this.graph 获取数据 public setDataFromGraph(): GraphData { const nodes = []; const hiddenNodes = []; const edges = []; const hiddenEdges = []; const comboEdges = []; const combos = []; const hiddenCombos = []; const nodeItems = this.graph.getNodes(); const edgeItems = this.graph.getEdges(); const comboItems = this.graph.getCombos(); const nodeLength = nodeItems.length; for (let i = 0; i < nodeLength; i++) { const nodeItem = nodeItems[i]; if (!nodeItem || nodeItem.destroyed) continue; const model = nodeItem.getModel(); if (!nodeItem.isVisible()) { hiddenNodes.push(model); continue; } nodes.push(model); } const edgeLength = edgeItems.length; for (let i = 0; i < edgeLength; i++) { const edgeItem = edgeItems[i]; if (!edgeItem || edgeItem.destroyed) continue; const model = edgeItem.getModel(); if (!edgeItem.isVisible()) { hiddenEdges.push(model); continue; } if (!model.isComboEdge) edges.push(model); else comboEdges.push(model); } const comboLength = comboItems.length; for (let i = 0; i < comboLength; i++) { const comboItem = comboItems[i]; if (comboItem.destroyed) continue; const model = comboItem.getModel(); if (!comboItem.isVisible()) { hiddenEdges.push(model); continue; } combos.push(model); } return { nodes, hiddenNodes, edges, hiddenEdges, combos, hiddenCombos, comboEdges, } as GraphData; } protected reLayoutMethod(layoutMethod, layoutCfg): Promise { return new Promise((reslove, reject) => { const { graph } = this; const layoutType = layoutCfg?.type; // 每个布局方法都需要注册 layoutCfg.onLayoutEnd = () => { graph.emit("aftersublayout", { type: layoutType }); reslove(); }; layoutMethod.init(this.data); if (layoutType === "force") { layoutMethod.ticking = false; layoutMethod.forceSimulation.stop(); } graph.emit("beforesublayout", { type: layoutType }); layoutMethod.execute(); if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd(); }); } // 重新布局 public relayout(reloadData?: boolean) { const { graph, layoutMethods, layoutCfg } = this; if (reloadData) { this.data = this.setDataFromGraph(); const { nodes } = this.data; if (!nodes) { return false; } this.initPositions(layoutCfg.center, nodes); } graph.emit("beforelayout"); let start = Promise.resolve(); layoutMethods?.forEach((layoutMethod: any, index: number) => { const currentCfg = layoutCfg[index]; start = start.then(() => this.reLayoutMethod(layoutMethod, currentCfg)); }); start .then(() => { if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd(); }) .catch((error) => { console.warn("relayout failed", error); }); } // 筛选参与布局的nodes和edges protected filterLayoutData(data, cfg) { const { nodes, edges, ...rest } = data; if (!nodes) { return data; } let nodesFilter; let edegsFilter; if (isFunction(cfg?.nodesFilter)) { nodesFilter = cfg.nodesFilter; } else { nodesFilter = () => true; } if (isFunction(cfg?.edgesFilter)) { edegsFilter = cfg.edgesFilter; } else { const nodesMap = nodes.reduce((acc, cur) => { acc[cur.id] = true; return acc; }, {}); edegsFilter = (edge) => { return nodesMap[edge.source] && nodesMap[edge.target]; }; } return { nodes: nodes.filter(nodesFilter), edges: edges.filter(edegsFilter), ...rest, }; } protected getLayoutBBox(nodes) { const { graph } = this; const graphGroupNodes = groupBy(graph.getNodes(), (n: any) => { return n.getModel().layoutOrder; }); const layoutNodes = Object.values(graphGroupNodes).map((value) => { const bbox: any = calculationItemsBBox(value as any); bbox.size = [bbox.width, bbox.height]; return bbox; }); const groupNodes = Object.values(groupBy(nodes, "layoutOrder")); return { groupNodes, layoutNodes, }; } // 控制布局动画 // eslint-disable-next-line class-methods-use-this public layoutAnimate() {} // 将当前节点的平均中心移动到原点 public moveToZero() { const { graph } = this; const data = graph.get("data"); const { nodes } = data; if (nodes[0].x === undefined || nodes[0].x === null || isNaN(nodes[0].x)) { return; } const meanCenter = [0, 0]; const nodeLength = nodes.length; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; meanCenter[0] += node.x; meanCenter[1] += node.y; } meanCenter[0] /= nodes.length; meanCenter[1] /= nodes.length; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; node.x -= meanCenter[0]; node.y -= meanCenter[1]; } } // 初始化节点到 center 附近 public initPositions(center, nodes): boolean { const { graph } = this; if (!nodes) { return false; } const nodeLength = nodes ? nodes.length : 0; if (!nodeLength) return; const width = graph.get("width") * 0.85; const height = graph.get("height") * 0.85; const horiNum = Math.ceil(Math.sqrt(nodeLength) * (width / height)); const vertiNum = Math.ceil(nodeLength / horiNum); let horiGap = width / (horiNum - 1); let vertiGap = height / (vertiNum - 1); if (!isFinite(horiGap) || !horiGap) horiGap = 0; if (!isFinite(vertiGap) || !horiGap) vertiGap = 0; const beginX = center[0] - width / 2; const beginY = center[1] - height / 2; let allHavePos = true; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; if (isNaN(node.x)) { allHavePos = false; node.x = (i % horiNum) * horiGap + beginX; } if (isNaN(node.y)) { allHavePos = false; node.y = Math.floor(i / horiNum) * vertiGap + beginY; } } return allHavePos; } public destroy() { this.graph = null; this.destoryLayoutMethods(); this.destroyed = true; } public onTick(timestamp: number) { this.layoutMethods?.forEach((layoutMethod) => { layoutMethod?.onTick?.(timestamp); }); } } ================================================ FILE: packages/core/src/graph/controller/mode.ts ================================================ import { each, isArray, isString } from "@antv/util"; import Behavior from "../../behavior/behavior"; import { IBehaviorOption } from "../../interface/behavior"; import { IAbstractGraph } from "../../interface/graph"; import { ModeType, Modes } from "../../types"; export default class ModeController { private graph: IAbstractGraph; public destroyed: boolean; /** * modes = { * default: [ 'drag-node', 'zoom-canvas' ], * edit: [ 'drag-canvas', { * type: 'brush-select', * trigger: 'ctrl' * }] * } * * @private * @type {Modes} * @memberof Mode */ public modes: Modes; /** * mode = 'drag-node' * * @private * @type {string} * @memberof Mode */ public mode: string; private currentBehaves: IBehaviorOption[]; constructor(graph: IAbstractGraph) { this.graph = graph; this.destroyed = false; this.modes = graph.get("modes") || { default: [], }; this.formatModes(); this.mode = graph.get("defaultMode") || "default"; this.currentBehaves = []; this.setMode(this.mode); } private formatModes() { const { modes } = this; each(modes, (mode) => { each(mode, (behavior, i) => { if (isString(behavior)) { mode[i] = { type: behavior }; } }); }); } private setBehaviors(mode: string) { const { graph } = this; const behaviors = this.modes[mode]; const behaves: IBehaviorOption[] = []; let behave: IBehaviorOption; each(behaviors || [], (behavior) => { const BehaviorInstance = Behavior.getBehavior(behavior.type || behavior); if (!BehaviorInstance) { return; } behave = new BehaviorInstance(behavior); if (behave) { behave.bind(graph as IAbstractGraph); behaves.push(behave); } }); this.currentBehaves = behaves; } private static mergeBehaviors( modeBehaviors: ModeType[], behaviors: ModeType[], ): ModeType[] { each(behaviors, (behavior) => { if (modeBehaviors.indexOf(behavior) < 0) { if (isString(behavior)) { behavior = { type: behavior }; } modeBehaviors.push(behavior); } }); return modeBehaviors; } private static filterBehaviors( modeBehaviors: ModeType[], behaviors: ModeType[], ): ModeType[] { const result: ModeType[] = []; modeBehaviors.forEach((behavior) => { let type: string = ""; if (isString(behavior)) { type = behavior; } else { // eslint-disable-next-line prefer-destructuring type = behavior.type; } if (behaviors.indexOf(type) < 0) { result.push(behavior); } }); return result; } public setMode(mode: string) { const { modes, graph } = this; const current = mode; const behaviors = modes[current]; if (!behaviors) { return; } graph.emit("beforemodechange", { mode }); each(this.currentBehaves, (behave) => { if (behave.delegate) behave.delegate.remove(); behave.unbind(graph); }); this.setBehaviors(current); graph.emit("aftermodechange", { mode }); this.mode = mode; } public getMode(): string { return this.mode; } /** * 动态增加或删除 Behavior * * @param {ModeType[]} behaviors * @param {(ModeType[] | ModeType)} modes * @param {boolean} isAdd * @returns {Mode} * @memberof Mode */ public manipulateBehaviors( behaviors: ModeType[] | ModeType, modes: string[] | string, isAdd: boolean, ): ModeController { let behaves: ModeType[]; if (!isArray(behaviors)) { behaves = [behaviors]; } else { behaves = behaviors; } if (isArray(modes)) { each(modes, (mode) => { if (!this.modes[mode]) { if (isAdd) { this.modes[mode] = behaves; } } else if (isAdd) { this.modes[mode] = ModeController.mergeBehaviors( this.modes[mode] || [], behaves, ); } else { this.modes[mode] = ModeController.filterBehaviors( this.modes[mode] || [], behaves, ); } }); return this; } let currentMode = modes; if (!modes) { currentMode = this.mode; // isString(this.mode) ? this.mode : this.mode.type } if (!this.modes[currentMode]) { if (isAdd) { this.modes[currentMode] = behaves; } } if (isAdd) { this.modes[currentMode] = ModeController.mergeBehaviors( this.modes[currentMode] || [], behaves, ); } else { this.modes[currentMode] = ModeController.filterBehaviors( this.modes[currentMode] || [], behaves, ); } this.setMode(this.mode); return this; } /** * 更新行为参数 * @param {string | ModeOption | ModeType} behavior 需要更新的行为 * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default * @return {Graph} Graph */ public updateBehavior( behavior: string | ModeType, newCfg: object, mode?: string, ): ModeController { if (isString(behavior)) { behavior = { type: behavior }; } let behaviorSet = []; if (!mode || mode === this.mode || mode === "default") { behaviorSet = this.currentBehaves; if (!behaviorSet || !behaviorSet.length) { console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ); return this; } const length = behaviorSet.length; for (let i = 0; i < length; i++) { const behave = behaviorSet[i]; if (behave.type === behavior.type) { behave.updateCfg(newCfg); return this; } if (i === length - 1) console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } else { behaviorSet = this.modes[mode]; if (!behaviorSet || !behaviorSet.length) { console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ); return this; } const length = behaviorSet.length; for (let i = 0; i < length; i++) { let behave = behaviorSet[i]; if (behave.type === behavior.type || behave === behavior.type) { if (behave === behavior.type) behave = { type: behave }; Object.assign(behave, newCfg); behaviorSet[i] = behave; return this; } if (i === length - 1) console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } return this; } public destroy() { (this.graph as IAbstractGraph | null) = null; (this.modes as Modes | null) = null; (this.currentBehaves as IBehaviorOption[] | null) = null; this.destroyed = true; } } ================================================ FILE: packages/core/src/graph/controller/state.ts ================================================ import { each, isString } from "@antv/util"; import { Item, States } from "../../types"; import { IAbstractGraph } from "../../interface/graph"; import { INode } from "../../interface/item"; interface CachedStates { enabled: States; disabled: States; } let timer: any = null; export default class StateController { private graph: IAbstractGraph; private cachedStates: CachedStates; public destroyed: boolean; constructor(graph: IAbstractGraph) { this.graph = graph; /** * this.cachedStates = { * enabled: { * hover: [Node] * }, * disabled: {} * } */ this.cachedStates = { enabled: {}, disabled: {}, }; this.destroyed = false; } /** * 检查 cache 的可用性 * * @private * @param {Item} item * @param {string} state * @param {object} cache * @returns * @memberof State */ private static checkCache( item: Item, state: string, cache: { [key: string]: any }, ) { if (!cache[state]) { return; } const index = cache[state].indexOf(item); if (index >= 0) { cache[state].splice(index, 1); } } /** * 缓存 state * * @private * @param {Item} item Item 实例 * @param {string} state 状态名称 * @param {object} states * @memberof State */ private static cacheState(item: Item, state: string, states: States) { if (!states[state]) { states[state] = []; } states[state].push(item as INode); } /** * 更新 Item 的状态 * * @param {Item} item Item实例 * @param {string} state 状态名称 * @param {boolean} enabled 状态是否可用 * @memberof State */ public updateState(item: Item, state: string, enabled: boolean) { const { checkCache, cacheState } = StateController; if (item.destroyed) { return; } const { cachedStates } = this; const enabledStates = cachedStates.enabled; const disabledStates = cachedStates.disabled; if (enabled) { checkCache(item, state, disabledStates); cacheState(item, state, enabledStates); } else { checkCache(item, state, enabledStates); cacheState(item, state, disabledStates); } if (timer) { clearTimeout(timer); } timer = setTimeout(() => { timer = null; this.updateGraphStates(); }, 16); } /** * 批量更新 states,兼容 updateState,支持更新一个 state * * @param {Item} item * @param {(string | string[])} states * @param {boolean} enabled * @memberof State */ public updateStates(item: Item, states: string | string[], enabled: boolean) { if (isString(states)) { this.updateState(item, states, enabled); } else { states.forEach((state) => { this.updateState(item, state, enabled); }); } } /** * 更新 states * * @memberof State */ public updateGraphStates() { const states = this.graph.get("states") as States; const { cachedStates } = this; each(cachedStates.disabled, (val, key) => { if (states[key]) { states[key] = states[key].filter( (item) => val.indexOf(item) < 0 && !val.destroyed, ); } }); each(cachedStates.enabled, (val: INode[], key) => { if (!states[key]) { states[key] = val; } else { const map: { [key: string]: boolean } = {}; states[key].forEach((item) => { if (!item.destroyed) { map[item.get("id")] = true; } }); val.forEach((item: Item) => { if (!item.destroyed) { const id = item.get("id"); if (!map[id]) { map[id] = true; states[key].push(item as INode); } } }); } }); this.graph.emit("graphstatechange", { states }); this.cachedStates = { enabled: {}, disabled: {}, }; } public destroy() { (this.graph as IAbstractGraph | null) = null; (this.cachedStates as CachedStates | null) = null; if (timer) { clearTimeout(timer); } timer = null; this.destroyed = true; } } ================================================ FILE: packages/core/src/graph/controller/view.ts ================================================ import { AbstractCanvas } from "@antv/g-base"; import { Point, IGroup } from "@antv/g-base"; import { isNumber, isString } from "@antv/util"; import { modifyCSS } from "@antv/dom-util"; import { Item, Matrix, Padding, GraphAnimateConfig, IEdge } from "../../types"; import { formatPadding } from "../../util/base"; import { applyMatrix, invertMatrix } from "../../util/math"; import { IAbstractGraph } from "../../interface/graph"; export default class ViewController { private graph: IAbstractGraph; public destroyed: boolean = false; constructor(graph: IAbstractGraph) { this.graph = graph; this.destroyed = false; } // get view center coordinate private getViewCenter(): Point { const padding = this.getFormatPadding(); const { graph } = this; const width: number = this.graph.get("width"); const height: number = graph.get("height"); return { x: (width - padding[1] - padding[3]) / 2 + padding[3], y: (height - padding[0] - padding[2]) / 2 + padding[0], }; } public fitCenter() { const { graph } = this; const group: IGroup = graph.get("group"); group.resetMatrix(); const bbox = group.getCanvasBBox(); if (bbox.width === 0 || bbox.height === 0) return; const viewCenter = this.getViewCenter(); const groupCenter: Point = { x: bbox.x + bbox.width / 2, y: bbox.y + bbox.height / 2, }; graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y); } // fit view graph public fitView() { const { graph } = this; const padding = this.getFormatPadding(); const width: number = graph.get("width"); const height: number = graph.get("height"); const group: IGroup = graph.get("group"); group.resetMatrix(); const bbox = group.getCanvasBBox(); if (bbox.width === 0 || bbox.height === 0) return; const viewCenter = this.getViewCenter(); const groupCenter: Point = { x: bbox.x + bbox.width / 2, y: bbox.y + bbox.height / 2, }; graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y); const w = (width - padding[1] - padding[3]) / bbox.width; const h = (height - padding[0] - padding[2]) / bbox.height; let ratio = w; if (w > h) { ratio = h; } graph.zoom(ratio, viewCenter); } public getFormatPadding(): number[] { const padding = this.graph.get("fitViewPadding") as Padding; return formatPadding(padding); } public focusPoint( point: Point, animate?: boolean, animateCfg?: GraphAnimateConfig, ) { const viewCenter = this.getViewCenter(); const modelCenter = this.getPointByCanvas(viewCenter.x, viewCenter.y); let viewportMatrix: Matrix = this.graph.get("group").getMatrix(); if (!viewportMatrix) viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; if (animate) { const dx = (modelCenter.x - point.x) * viewportMatrix[0]; const dy = (modelCenter.y - point.y) * viewportMatrix[4]; let lastX = 0; let lastY = 0; let newX = 0; let newY = 0; // 动画每次平移一点,直到目标位置 this.graph.get("canvas").animate( (ratio) => { newX = dx * ratio; newY = dy * ratio; this.graph.translate(newX - lastX, newY - lastY); lastX = newX; lastY = newY; }, { ...animateCfg, }, ); } else { this.graph.translate( (modelCenter.x - point.x) * viewportMatrix[0], (modelCenter.y - point.y) * viewportMatrix[4], ); } } /** * 将 Canvas 坐标转成视口坐标 * @param canvasX canvas x 坐标 * @param canvasY canvas y 坐标 */ public getPointByCanvas(canvasX: number, canvasY: number): Point { let viewportMatrix: Matrix = this.graph.get("group").getMatrix(); if (!viewportMatrix) { viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } const point = invertMatrix({ x: canvasX, y: canvasY }, viewportMatrix); return point; } /** * 将页面坐标转成视口坐标 * @param clientX 页面 x 坐标 * @param clientY 页面 y 坐标 */ public getPointByClient(clientX: number, clientY: number): Point { const canvas: AbstractCanvas = this.graph.get("canvas"); const canvasPoint: Point = canvas.getPointByClient(clientX, clientY); return this.getPointByCanvas(canvasPoint.x, canvasPoint.y); } /** * 将视口坐标转成页面坐标 * @param x 视口 x 坐标 * @param y 视口 y 坐标 */ public getClientByPoint(x: number, y: number): Point { const canvas: AbstractCanvas = this.graph.get("canvas"); const canvasPoint = this.getCanvasByPoint(x, y); const point = canvas.getClientByPoint(canvasPoint.x, canvasPoint.y); return { x: point.x, y: point.y }; } /** * 将视口坐标转成 Canvas 坐标 * @param x 视口 x 坐标 * @param y 视口 y 坐标 */ public getCanvasByPoint(x: number, y: number): Point { let viewportMatrix: Matrix = this.graph.get("group").getMatrix(); if (!viewportMatrix) { viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } return applyMatrix({ x, y }, viewportMatrix); } /** * 将元素移动到画布中心 * @param item Item 实例或 id * @param {boolean} animate 是否带有动画地移动 * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项 */ public focus( item: string | Item, animate?: boolean, animateCfg?: GraphAnimateConfig, ) { if (isString(item)) { item = this.graph.findById(item); } if (item) { let x = 0, y = 0; if (item.getType && item.getType() === "edge") { const sourceMatrix: IGroup = (item as IEdge) .getSource() .get("group") .getMatrix(); const targetMatrix: IGroup = (item as IEdge) .getTarget() .get("group") .getMatrix(); if (sourceMatrix && targetMatrix) { x = (sourceMatrix[6] + targetMatrix[6]) / 2; y = (sourceMatrix[7] + targetMatrix[7]) / 2; } else if (sourceMatrix || targetMatrix) { x = sourceMatrix ? sourceMatrix[6] : targetMatrix[6]; y = sourceMatrix ? sourceMatrix[7] : targetMatrix[7]; } } else { const group: IGroup = item.get("group"); let matrix: Matrix = group.getMatrix(); if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; x = matrix[6]; y = matrix[7]; } // 用实际位置而不是model中的x,y,防止由于拖拽等的交互导致model的x,y并不是当前的x,y this.focusPoint({ x, y }, animate, animateCfg); } } /** * 改变 canvas 画布的宽度和高度 * @param width canvas 宽度 * @param height canvas 高度 */ public changeSize(width: number, height: number) { const { graph } = this; if (!isNumber(width) || !isNumber(height)) { throw Error( "invalid canvas width & height, please make sure width & height type is number", ); } graph.set({ width, height }); const canvas: AbstractCanvas = graph.get("canvas"); canvas.changeSize(width, height); // change the size of grid plugin if it exists on graph const plugins = graph.get("plugins"); plugins.forEach((plugin) => { if (plugin.get("gridContainer")) { const minZoom = graph.get("minZoom"); modifyCSS(plugin.get("container"), { width: `${width}px`, height: `${height}px`, }); modifyCSS(plugin.get("gridContainer"), { width: `${width / minZoom}px`, height: `${height / minZoom}px`, left: 0, top: 0, }); } }); } public destroy() { (this.graph as IAbstractGraph | null) = null; this.destroyed = false; } } ================================================ FILE: packages/core/src/graph/graph.ts ================================================ import EventEmitter from "@antv/event-emitter"; import { ICanvas, IGroup, Point } from "@antv/g-base"; import { requestAnimationFrame, clearAnimationFrame, } from "@antv/g-mobile/esm/util/time"; import { ext } from "@antv/matrix-util"; import { clone, deepMix, each, isPlainObject, isString } from "@antv/util"; import { getDegree, getAdjMatrix as getAdjacentMatrix, Stack, floydWarshall, } from "@antv/algorithm"; import { IAbstractGraph } from "../interface/graph"; import { IEdge, INode, ICombo } from "../interface/item"; import { GraphAnimateConfig, GraphOptions, EdgeConfig, GraphData, Item, ITEM_TYPE, ModelConfig, NodeConfig, NodeMap, Padding, TreeGraphData, ComboConfig, ModeOption, ModeType, States, ComboTree, HullCfg, IG6GraphEvent, } from "../types"; import { move } from "../util/math"; import { dataValidation, singleDataValidation } from "../util/validation"; import Global from "../global"; import { ItemController, ModeController, StateController, ViewController, } from "./controller"; import { plainCombosToTrees, traverseTree, reconstructTree, traverseTreeUp, } from "../util/graphic"; import Hull from "../item/hull"; const { transform } = ext; const NODE = "node"; export interface PrivateGraphOption extends GraphOptions { data: GraphData; // capture event event: boolean; nodes: NodeConfig[]; edges: EdgeConfig[]; vedges: EdgeConfig[]; combos: ComboConfig[]; itemMap: NodeMap; callback: () => void; /** * 格式: * { * hover: [Node, Node], * selected: [Node] * } */ states: States; } export default abstract class AbstractGraph extends EventEmitter implements IAbstractGraph { protected animating: boolean; protected cfg: GraphOptions & { [key: string]: any }; public destroyed: boolean; // undo 栈 protected undoStack: Stack; // redo 栈 protected redoStack: Stack; // requestAnimationFrame 引用 protected timeIndex: number; constructor(cfg: GraphOptions) { super(); this.cfg = deepMix(this.getDefaultCfg(), cfg); this.init(); this.animating = false; this.destroyed = false; // 启用 stack 后,实例化 undoStack 和 redoStack if (this.cfg.enabledStack) { // 实例化 undo 和 redo 栈 this.undoStack = new Stack(this.cfg.maxStep); this.redoStack = new Stack(this.cfg.maxStep); } } protected init() { this.initCanvas(); // instance controller const viewController = new ViewController(this); const modeController = new ModeController(this); const itemController = new ItemController(this); const stateController = new StateController(this); this.set({ viewController, modeController, itemController, stateController, }); // 初始化布局机制 this.initLayoutController(); // 初始化事件机制 this.initEventController(); this.initGroups(); /** 初始化插件 */ this.initPlugins(); this.timeIndex = requestAnimationFrame(this.onTick.bind(this)); } protected abstract initLayoutController(): void; protected abstract initEventController(): void; /** * initCanvas 需要在 PC 和 Mobile 分别实现 */ protected abstract initCanvas(): void; /** * initPlugins 需要在 PC 和 Mobile 分别实现 */ protected abstract initPlugins(): void; // 初始化所有 Group protected initGroups(): void { const canvas: ICanvas = this.get("canvas"); const el: HTMLElement = this.get("canvas").get("el"); const { id } = el; const group: IGroup = canvas.addGroup({ id: `${id}-root`, className: Global.rootContainerClassName, }); if (this.get("groupByTypes")) { const edgeGroup: IGroup = group.addGroup({ id: `${id}-edge`, className: Global.edgeContainerClassName, }); const nodeGroup: IGroup = group.addGroup({ id: `${id}-node`, className: Global.nodeContainerClassName, }); const comboGroup: IGroup = group.addGroup({ id: `${id}-combo`, className: Global.comboContainerClassName, }); // 用于存储自定义的群组 comboGroup.toBack(); this.set({ nodeGroup, edgeGroup, comboGroup }); } const delegateGroup: IGroup = group.addGroup({ id: `${id}-delegate`, className: Global.delegateContainerClassName, }); this.set({ delegateGroup }); this.set("group", group); } // eslint-disable-next-line class-methods-use-this public getDefaultCfg(): Partial { return { /** * Container could be dom object or dom id */ container: undefined, /** * Canvas width * unit pixel if undefined force fit width */ width: undefined, /** * Canvas height * unit pixel if undefined force fit height */ height: undefined, /** * renderer canvas or svg * @type {string} */ renderer: "canvas", /** * control graph behaviors */ modes: {}, /** * 注册插件 */ plugins: [], /** * source data */ data: {}, /** * Fit view padding (client scale) */ fitViewPadding: 10, /** * Minimum scale size */ minZoom: 0.2, /** * Maxmum scale size */ maxZoom: 10, /** * capture events */ event: true, /** * group node & edges into different graphic groups */ groupByTypes: true, /** * determine if it's a directed graph */ directed: false, /** * when data or shape changed, should canvas draw automatically */ autoPaint: true, /** * store all the node instances */ nodes: [], /** * store all the edge instances */ edges: [], /** * store all the combo instances */ combos: [], /** * store all the edge instances which are virtual edges related to collapsed combo */ vedges: [], /** * all the instances indexed by id */ itemMap: {}, /** * 边直接连接到节点的中心,不再考虑锚点 */ linkCenter: false, /** * 默认的节点配置,data 上定义的配置会覆盖这些配置。例如: * defaultNode: { * type: 'rect', * size: [60, 40], * style: { * //... 样式配置项 * } * } * 若数据项为 { id: 'node', x: 100, y: 100 } * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'rect', size: [60, 40] } * 若数据项为 { id: 'node', x: 100, y: 100, type: 'circle' } * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'circle', size: [60, 40] } */ defaultNode: {}, /** * 默认边配置,data 上定义的配置会覆盖这些配置。用法同 defaultNode */ defaultEdge: {}, /** * 节点默认样式,也可以添加状态样式 * 例如: * const graph = new G6.Graph({ * nodeStateStyles: { * selected: { fill: '#ccc', stroke: '#666' }, * active: { lineWidth: 2 } * }, * ... * }); * */ nodeStateStyles: {}, /** * 边默认样式,用法同nodeStateStyle */ edgeStateStyles: {}, /** * graph 状态 */ states: {}, /** * 是否启用全局动画 */ animate: false, /** * 动画设置,仅在 animate 为 true 时有效 */ animateCfg: { /** * 帧回调函数,用于自定义节点运动路径,为空时线性运动 */ onFrame: undefined, /** * 动画时长(ms) */ duration: 500, /** * 指定动画动效 */ easing: "easeLinear", }, callback: undefined, // 默认不启用 undo & redo 功能 enabledStack: false, // 只有当 enabledStack 为 true 时才起作用 maxStep: 10, // 存储图上的 tooltip dom,方便销毁 tooltips: [], }; } /** * 将值设置到 this.cfg 变量上面 * @param key 键 或 对象值 * @param val 值 */ public set(key: string | object, val?: T): AbstractGraph { if (isPlainObject(key)) { this.cfg = { ...this.cfg, ...key }; } else { this.cfg[key] = val; } return this; } /** * 获取 this.cfg 中的值 * @param key 键 */ public get(key: string) { return this.cfg[key]; } /** * 获取 graph 的根图形分组 * @return 根 group */ public getGroup(): IGroup { return this.get("group"); } /** * 获取 graph 的 DOM 容器 * @return DOM 容器 */ public getContainer(): HTMLElement { return this.get("container"); } /** * 获取 graph 的最小缩放比例 * @return minZoom */ public getMinZoom(): number { return this.get("minZoom"); } /** * 设置 graph 的最小缩放比例 * @return minZoom */ public setMinZoom(ratio: number) { return this.set("minZoom", ratio); } /** * 获取 graph 的最大缩放比例 * @param maxZoom */ public getMaxZoom(): number { return this.get("maxZoom"); } /** * 设置 graph 的最大缩放比例 * @param maxZoom */ public setMaxZoom(ratio: number) { return this.set("maxZoom", ratio); } /** * 获取 graph 的宽度 * @return width */ public getWidth(): number { return this.get("width"); } /** * 获取 graph 的高度 * @return width */ public getHeight(): number { return this.get("height"); } /** * 清理元素多个状态 * @param {string|Item} item 元素id或元素实例 * @param {string[]} states 状态 */ public clearItemStates( item: Item | string, states?: string[] | string, ): void { if (isString(item)) { item = this.findById(item); } const itemController: ItemController = this.get("itemController"); if (!states) { states = item.get("states"); } itemController.clearItemStates(item, states); const stateController: StateController = this.get("stateController"); stateController.updateStates(item, states, false); } /** * 设置各个节点样式,以及在各种状态下节点 keyShape 的样式。 * 若是自定义节点切在各种状态下 * graph.node(node => { * return { * type: 'rect', * label: node.id, * style: { fill: '#666' }, * stateStyles: { * selected: { fill: 'blue' }, * custom: { fill: 'green' } * } * } * }); * @param {function} nodeFn 指定每个节点样式 */ public node(nodeFn: (config: NodeConfig) => Partial): void { if (typeof nodeFn === "function") { this.set("nodeMapper", nodeFn); } } /** * 设置各个边样式 * @param {function} edgeFn 指定每个边的样式,用法同 node */ public edge(edgeFn: (config: EdgeConfig) => Partial): void { if (typeof edgeFn === "function") { this.set("edgeMapper", edgeFn); } } /** * 设置各个 combo 的配置 * @param comboFn */ public combo(comboFn: (config: ComboConfig) => Partial): void { if (typeof comboFn === "function") { this.set("comboMapper", comboFn); } } /** * 根据 ID 查询图元素实例 * @param id 图元素 ID */ public findById(id: string): Item { return this.get("itemMap")[id]; } /** * 根据对应规则查找单个元素 * @param {ITEM_TYPE} type 元素类型(node | edge | group) * @param {(item: T, index: number) => T} fn 指定规则 * @return {T} 元素实例 */ public find( type: ITEM_TYPE, fn: (item: T, index?: number) => boolean, ): T | undefined { let result: T | undefined; const items = this.get(`${type}s`); // eslint-disable-next-line consistent-return each(items, (item, i) => { if (fn(item, i)) { result = item; return result; } }); return result; } /** * 查找所有满足规则的元素 * @param {string} type 元素类型(node|edge) * @param {string} fn 指定规则 * @return {array} 元素实例 */ public findAll( type: ITEM_TYPE, fn: (item: T, index?: number) => boolean, ): T[] { const result: T[] = []; each(this.get(`${type}s`), (item, i) => { if (fn(item, i)) { result.push(item); } }); return result; } /** * 查找所有处于指定状态的元素 * @param {string} type 元素类型(node|edge) * @param {string} state 状态 * @return {object} 元素实例 */ public findAllByState(type: ITEM_TYPE, state: string): T[] { return this.findAll(type, (item) => item.hasState(state)); } /** * 平移画布 * @param dx 水平方向位移 * @param dy 垂直方向位移 */ public translate(dx: number, dy: number): void { const group: IGroup = this.get("group"); let matrix = clone(group.getMatrix()); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } matrix = transform(matrix, [["t", dx, dy]]); group.setMatrix(matrix); this.emit("viewportchange", { action: "translate", matrix: group.getMatrix(), }); this.autoPaint(); } /** * 平移画布到某点 * @param {number} x 水平坐标 * @param {number} y 垂直坐标 */ public moveTo(x: number, y: number): void { const group: IGroup = this.get("group"); move(group, { x, y }); this.emit("viewportchange", { action: "move", matrix: group.getMatrix() }); } /** * 调整视口适应视图 * @param {object} padding 四周围边距 */ public fitView(padding?: Padding): void { if (padding) { this.set("fitViewPadding", padding); } const viewController: ViewController = this.get("viewController"); viewController.fitView(); this.autoPaint(); } /** * 调整视口适应视图,不缩放,仅将图 bbox 中心对齐到画布中心 */ public fitCenter(): void { const viewController: ViewController = this.get("viewController"); viewController.fitCenter(); this.autoPaint(); } /** * 新增行为 * @param {string | ModeOption | ModeType[]} behaviors 添加的行为 * @param {string | string[]} modes 添加到对应的模式 * @return {Graph} Graph */ public addBehaviors( behaviors: string | ModeOption | ModeType[], modes: string | string[], ): AbstractGraph { const modeController: ModeController = this.get("modeController"); modeController.manipulateBehaviors(behaviors, modes, true); return this; } /** * 移除行为 * @param {string | ModeOption | ModeType[]} behaviors 移除的行为 * @param {string | string[]} modes 从指定的模式中移除 * @return {Graph} Graph */ public removeBehaviors( behaviors: string | ModeOption | ModeType[], modes: string | string[], ): AbstractGraph { const modeController: ModeController = this.get("modeController"); modeController.manipulateBehaviors(behaviors, modes, false); return this; } /** * 更新行为参数 * @param {string | ModeOption | ModeType} behavior 需要更新的行为 * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default * @return {Graph} Graph */ public updateBehavior( behavior: string, newCfg: object, mode?: string, ): AbstractGraph { const modeController: ModeController = this.get("modeController"); modeController.updateBehavior(behavior, newCfg, mode); return this; } /** * 伸缩窗口 * @param ratio 伸缩比例 * @param center 以center的x, y坐标为中心缩放 */ public zoom(ratio: number, center?: Point): void { const group: IGroup = this.get("group"); let matrix = clone(group.getMatrix()); const minZoom: number = this.get("minZoom"); const maxZoom: number = this.get("maxZoom"); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } if (center) { matrix = transform(matrix, [ ["t", -center.x, -center.y], ["s", ratio, ratio], ["t", center.x, center.y], ]); } else { matrix = transform(matrix, [["s", ratio, ratio]]); } if ((minZoom && matrix[0] < minZoom) || (maxZoom && matrix[0] > maxZoom)) { return; } // matrix = [2, 0, 0, 0, 2, 0, -125, -125, 1]; group.setMatrix(matrix); this.emit("viewportchange", { action: "zoom", matrix }); this.autoPaint(); } /** * 伸缩视口到一固定比例 * @param {number} toRatio 伸缩比例 * @param {Point} center 以center的x, y坐标为中心缩放 */ public zoomTo(toRatio: number, center?: Point): void { const ratio = toRatio / this.getZoom(); this.zoom(ratio, center); } /** * 将元素移动到视口中心 * @param {Item} item 指定元素 * @param {boolean} animate 是否带有动画地移动 * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项 */ public focusItem( item: Item | string, animate?: boolean, animateCfg?: GraphAnimateConfig, ): void { const viewController: ViewController = this.get("viewController"); let isAnimate = false; if (animate) isAnimate = true; else if (animate === undefined) isAnimate = this.get("animate"); let curAniamteCfg = {} as GraphAnimateConfig; if (animateCfg) curAniamteCfg = animateCfg; else if (animateCfg === undefined) curAniamteCfg = this.get("animateCfg"); viewController.focus(item, isAnimate, curAniamteCfg); this.autoPaint(); } /** * 自动重绘 * @internal 仅供内部更新机制调用,外部根据需求调用 render 或 paint 接口 */ public autoPaint(): void { if (this.get("autoPaint")) { this.paint(); } } /** * 仅画布重新绘制 */ public paint(): void { this.emit("beforepaint"); this.get("canvas").draw(); this.emit("afterpaint"); } /** * 将屏幕坐标转换为视口坐标 * @param {number} clientX 屏幕x坐标 * @param {number} clientY 屏幕y坐标 * @return {Point} 视口坐标 */ public getPointByClient(clientX: number, clientY: number): Point { const viewController: ViewController = this.get("viewController"); return viewController.getPointByClient(clientX, clientY); } /** * 将绘制坐标转换为屏幕坐标 * @param {number} x 绘制坐标 x * @param {number} y 绘制坐标 y * @return {Point} 绘制坐标 */ public getClientByPoint(x: number, y: number): Point { const viewController: ViewController = this.get("viewController"); return viewController.getClientByPoint(x, y); } /** * 将画布坐标转换为绘制坐标 * @param {number} canvasX 画布 x 坐标 * @param {number} canvasY 画布 y 坐标 * @return {object} 绘制坐标 */ public getPointByCanvas(canvasX: number, canvasY: number): Point { const viewController: ViewController = this.get("viewController"); return viewController.getPointByCanvas(canvasX, canvasY); } /** * 将绘制坐标转换为画布坐标 * @param {number} x 绘制坐标 x * @param {number} y 绘制坐标 y * @return {object} 画布坐标 */ public getCanvasByPoint(x: number, y: number): Point { const viewController: ViewController = this.get("viewController"); return viewController.getCanvasByPoint(x, y); } /** * 获取图内容的中心绘制坐标 * @return {object} 中心绘制坐标 */ public getGraphCenterPoint(): Point { const bbox = this.get("group").getCanvasBBox(); return { x: (bbox.minX + bbox.maxX) / 2, y: (bbox.minY + bbox.maxY) / 2, }; } /** * 获取视口中心绘制坐标 * @return {object} 视口中心绘制坐标 */ public getViewPortCenterPoint(): Point { return this.getPointByCanvas(this.get("width") / 2, this.get("height") / 2); } /** * 显示元素 * @param {Item} item 指定元素 * @param {boolean} stack 本次操作是否入栈,默认为 true */ public showItem(item: Item | string, stack: boolean = true): void { const itemController: ItemController = this.get("itemController"); const object = itemController.changeItemVisibility(item, true); if (stack && this.get("enabledStack")) { const id = object.getID(); const type = object.getType(); const before: GraphData = {}; const after: GraphData = {}; switch (type) { case "node": before.nodes = [{ id, visible: false }]; after.nodes = [{ id, visible: true }]; break; case "edge": before.nodes = [{ id, visible: false }]; after.edges = [{ id, visible: true }]; break; case "combo": before.nodes = [{ id, visible: false }]; after.combos = [{ id, visible: true }]; break; default: break; } this.pushStack("visible", { before, after }); } } /** * 隐藏元素 * @param {Item} item 指定元素 * @param {boolean} stack 本次操作是否入栈,默认为 true */ public hideItem(item: Item | string, stack: boolean = true): void { const itemController: ItemController = this.get("itemController"); const object = itemController.changeItemVisibility(item, false); if (stack && this.get("enabledStack")) { const id = object.getID(); const type = object.getType(); const before: GraphData = {}; const after: GraphData = {}; switch (type) { case "node": before.nodes = [{ id, visible: true }]; after.nodes = [{ id, visible: false }]; break; case "edge": before.nodes = [{ id, visible: true }]; after.edges = [{ id, visible: false }]; break; case "combo": before.nodes = [{ id, visible: true }]; after.combos = [{ id, visible: false }]; break; default: break; } this.pushStack("visible", { before, after }); } } /** * 刷新元素 * @param {string|object} item 元素id或元素实例 */ public refreshItem(item: Item | string) { const itemController: ItemController = this.get("itemController"); itemController.refreshItem(item); } /** * 设置是否在更新/刷新后自动重绘 * @param {boolean} auto 自动重绘 */ public setAutoPaint(auto: boolean): void { const self = this; self.set("autoPaint", auto); const canvas: ICanvas = self.get("canvas"); canvas.set("autoDraw", auto); } /** * 删除元素 * @param {Item} item 元素id或元素实例 * @param {boolean} stack 本次操作是否入栈,默认为 true */ public remove(item: Item | string, stack: boolean = true): void { this.removeItem(item, stack); } /** * 删除元素 * @param {Item} item 元素id或元素实例 * @param {boolean} stack 本次操作是否入栈,默认为 true */ public removeItem(item: Item | string, stack: boolean = true): void { let nodeItem = item; if (isString(item)) nodeItem = this.findById(item as string); if (!nodeItem && isString(item)) { console.warn("The item to be removed does not exist!"); } else if (nodeItem) { let type = ""; if ((nodeItem as Item).getType) type = (nodeItem as Item).getType(); // 将删除的元素入栈 if (stack && this.get("enabledStack")) { const deletedModel = { ...(nodeItem as Item).getModel(), itemType: type, }; const before: GraphData = {}; switch (type) { case "node": { before.nodes = [deletedModel as NodeConfig]; before.edges = []; const edges = (nodeItem as INode).getEdges(); for (let i = edges.length - 1; i >= 0; i--) { before.edges.push({ ...edges[i].getModel(), itemType: "edge", }); } break; } case "edge": before.edges = [deletedModel as EdgeConfig]; break; case "combo": before.combos = [deletedModel as ComboConfig]; break; default: break; } this.pushStack("delete", { before, after: {}, }); } if (type === "node") { const model = (nodeItem as INode).getModel(); // 如果删除的是节点,且该节点存在于某个 Combo 中,则需要先将 node 从 combo 中移除,否则删除节点后,操作 combo 会出错 if (model.comboId) { this.updateComboTree(nodeItem as INode); } } const itemController: ItemController = this.get("itemController"); itemController.removeItem(nodeItem); if (type === "combo") { const newComboTrees = reconstructTree(this.get("comboTrees")); this.set("comboTrees", newComboTrees); } } } /** * 新增元素 * @param {ITEM_TYPE} type 元素类型(node | edge) * @param {ModelConfig} model 元素数据模型 * @param {boolean} stack 本次操作是否入栈,默认为 true * @param {boolean} sortCombo 本次操作是否需要更新 combo 层级顺序,内部参数,用户在外部使用 addItem 时始终时需要更新 * @return {Item} 元素实例 */ public addItem( type: ITEM_TYPE, model: ModelConfig, stack: boolean = true, sortCombo: boolean = true, ) { const currentComboSorted = this.get("comboSorted"); this.set("comboSorted", currentComboSorted && !sortCombo); const itemController: ItemController = this.get("itemController"); // 添加节点、边或combo之前,先验证数据是否符合规范 if (!singleDataValidation(type, model)) { return false; } if (model.id && this.findById(model.id as string)) { console.warn( `This item exists already. Be sure the id %c${model.id}%c is unique.`, "font-size: 20px; color: red;", "", ); return; } let item; let comboTrees = this.get("comboTrees"); if (!comboTrees) comboTrees = []; if (type === "combo") { const itemMap = this.get("itemMap"); let foundParent = false; comboTrees.forEach((ctree: ComboTree) => { if (foundParent) return; // terminate the forEach after the tree containing the item is done traverseTreeUp(ctree, (child) => { // find the parent if (model.parentId === child.id) { foundParent = true; const newCombo: ComboTree = { id: model.id as string, depth: child.depth + 2, ...model, }; if (child.children) child.children.push(newCombo); else child.children = [newCombo]; model.depth = newCombo.depth; item = itemController.addItem(type, model) as ICombo; } const childItem = itemMap[child.id]; // after the parent is found, update all the ancestors if ( foundParent && childItem && childItem.getType && childItem.getType() === "combo" ) { itemController.updateCombo(childItem, child.children); } return true; }); }); // if the parent is not found, add it to the root if (!foundParent) { const newCombo: ComboTree = { id: model.id as string, depth: 0, ...model, }; model.depth = newCombo.depth; comboTrees.push(newCombo); item = itemController.addItem(type, model) as ICombo; } this.set("comboTrees", comboTrees); } else if (type === "node" && isString(model.comboId) && comboTrees) { const parentCombo = this.findById(model.comboId as string); if ( parentCombo && parentCombo.getType && parentCombo.getType() !== "combo" ) { console.warn( `'${model.comboId}' is not a id of a combo in the graph, the node will be added without combo.`, ); } item = itemController.addItem(type, model); const itemMap = this.get("itemMap"); let foundParent = false, foundNode = false; (comboTrees || []).forEach((ctree: ComboTree) => { if (foundNode || foundParent) return; // terminate the forEach traverseTreeUp(ctree, (child) => { if (child.id === model.id) { // if the item exists in the tree already, terminate foundNode = true; return false; } if (model.comboId === child.id && !foundNode) { // found the parent, add the item to the children of its parent in the tree foundParent = true; const cloneNode = clone(model); cloneNode.itemType = "node"; if (child.children) child.children.push(cloneNode as any); else child.children = [cloneNode as any]; cloneNode.depth = child.depth + 1; } // update the size of all the ancestors if ( foundParent && itemMap[child.id].getType && itemMap[child.id].getType() === "combo" ) { itemController.updateCombo(itemMap[child.id], child.children); } return true; }); }); } else { item = itemController.addItem(type, model); } if ( (type === "node" && model.comboId) || (type === "combo" && model.parentId) ) { // add the combo to the parent's children array const parentCombo = this.findById( (model.comboId as string) || (model.parentId as string), ) as ICombo; if ( parentCombo && parentCombo.getType && parentCombo.getType() === "combo" ) parentCombo.addChild(item); } const combos = this.get("combos"); if (combos && combos.length > 0) { this.sortCombos(); } this.autoPaint(); if (stack && this.get("enabledStack")) { const addedModel = { ...item.getModel(), itemType: type, }; const after: GraphData = {}; switch (type) { case "node": after.nodes = [addedModel]; break; case "edge": after.edges = [addedModel]; break; case "combo": after.combos = [addedModel]; break; default: break; } this.pushStack("add", { before: {}, after, }); } return item; } /** * 新增元素 * @param {ITEM_TYPE} type 元素类型(node | edge) * @param {ModelConfig} model 元素数据模型 * @param {boolean} stack 本次操作是否入栈,默认为 true * @return {Item} 元素实例 */ public add( type: ITEM_TYPE, model: ModelConfig, stack: boolean = true, sortCombo: boolean = true, ): Item { return this.addItem(type, model, stack, sortCombo); } /** * 更新元素 * @param {Item} item 元素id或元素实例 * @param {Partial | EdgeConfig} cfg 需要更新的数据 */ public updateItem( item: Item | string, cfg: Partial | EdgeConfig, stack: boolean = true, ): void { const itemController: ItemController = this.get("itemController"); let currentItem; if (isString(item)) { currentItem = this.findById(item as string); } else { currentItem = item; } const UnupdateModel = clone(currentItem.getModel()); let type = ""; if (currentItem.getType) type = currentItem.getType(); const states = [...currentItem.getStates()]; if (type === "combo") { each(states, (state) => this.setItemState(currentItem, state, false)); } itemController.updateItem(currentItem, cfg); if (type === "combo") { each(states, (state) => this.setItemState(currentItem, state, true)); } if (stack && this.get("enabledStack")) { const before = { nodes: [], edges: [], combos: [] }; const after = { nodes: [], edges: [], combos: [] }; const afterModel = { id: UnupdateModel.id, ...cfg, }; switch (type) { case "node": before.nodes.push(UnupdateModel); after.nodes.push(afterModel); break; case "edge": before.edges.push(UnupdateModel); after.edges.push(afterModel); break; case "combo": before.combos.push(UnupdateModel); after.combos.push(afterModel); break; default: break; } if (type === "node") { before.nodes.push(UnupdateModel); } this.pushStack("update", { before, after }); } } /** * 更新元素 * @param {Item} item 元素id或元素实例 * @param {Partial | EdgeConfig} cfg 需要更新的数据 * @param {boolean} stack 本次操作是否入栈,默认为 true */ public update( item: Item | string, cfg: Partial | EdgeConfig, stack: boolean = true, ): void { this.updateItem(item, cfg, stack); } /** * 设置元素状态 * @param {Item} item 元素id或元素实例 * @param {string} state 状态名称 * @param {string | boolean} value 是否启用状态 或 状态值 */ public setItemState( item: Item | string, state: string, value: string | boolean, ): void { if (isString(item)) { item = this.findById(item as string); } const itemController: ItemController = this.get("itemController"); itemController.setItemState(item, state, value); const stateController: StateController = this.get("stateController"); if (isString(value)) { stateController.updateState(item, `${state}:${value}`, true); } else { stateController.updateState(item, state, value); } } /** * 将指定状态的优先级提升为最高优先级 * @param {Item} item 元素id或元素实例 * @param state 状态名称 */ public priorityState(item: Item | string, state: string): void { const itemController: ItemController = this.get("itemController"); itemController.priorityState(item, state); } /** * 设置视图初始化数据 * @param {GraphData} data 初始化数据 */ public data(data?: GraphData | TreeGraphData): void { dataValidation(data); this.set("data", data); } /** * 根据data接口的数据渲染视图 */ public render(): void { const self = this; this.set("comboSorted", false); const data: GraphData = this.get("data"); if (this.get("enabledStack")) { // render 之前清空 redo 和 undo 栈 this.clearStack(); } if (!data) { throw new Error("data must be defined first"); } const { nodes = [], edges = [], combos = [] } = data; this.clear(true); this.emit("beforerender"); each(nodes, (node: NodeConfig) => { self.add("node", node, false, false); }); // process the data to tree structure if (combos && combos.length !== 0) { const comboTrees = plainCombosToTrees(combos, nodes); this.set("comboTrees", comboTrees); // add combos self.addCombos(combos); } each(edges, (edge: EdgeConfig) => { self.add("edge", edge, false, false); }); const animate = self.get("animate"); if (self.get("fitView") || self.get("fitCenter")) { self.set("animate", false); } // layout const layoutController = self.get("layoutController"); if (layoutController) { layoutController.layout(success); // 布局后立即初始化边的数据 this.refreshPositions(); if (this.destroyed) return; } else { if (self.get("fitView")) { self.fitView(); } if (self.get("fitCenter")) { self.fitCenter(); } self.emit("afterrender"); self.set("animate", animate); } // 将在 onLayoutEnd 中被调用 function success() { // fitView 与 fitCenter 共存时,fitView 优先,fitCenter 不再执行 if (self.get("fitView")) { self.fitView(); } else if (self.get("fitCenter")) { self.fitCenter(); } self.autoPaint(); self.emit("afterrender"); if (self.get("fitView") || self.get("fitCenter")) { self.set("animate", animate); } } if (!this.get("groupByTypes")) { if (combos && combos.length !== 0) { this.sortCombos(); } else { // 为提升性能,选择数量少的进行操作 if (data.nodes && data.edges && data.nodes.length < data.edges.length) { const nodesArr = this.getNodes(); // 遍历节点实例,将所有节点提前。 nodesArr.forEach((node) => { node.toFront(); }); } else { const edgesArr = this.getEdges(); // 遍历节点实例,将所有节点提前。 edgesArr.forEach((edge) => { edge.toBack(); }); } } } if (this.get("enabledStack")) { this.pushStack("render"); } } /** * 接收数据进行渲染 * @Param {Object} data 初始化数据 */ public read(data: GraphData) { this.data(data); this.render(); } // 比较item protected diffItems( type: ITEM_TYPE, items: { nodes: INode[]; edges: IEdge[] }, models: NodeConfig[] | EdgeConfig[], ) { const self = this; let item: INode; const itemMap: NodeMap = this.get("itemMap"); each(models, (model) => { item = itemMap[model.id]; if (item) { if (self.get("animate") && type === NODE) { let containerMatrix = item.getContainer().getMatrix(); if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; item.set("originAttrs", { x: containerMatrix[6], y: containerMatrix[7], }); } self.updateItem(item, model, false); } else { item = self.addItem(type, model, false); } if (item) (items as { [key: string]: any[] })[`${type}s`].push(item); }); } /** * 更改源数据,根据新数据重新渲染视图 * @param {GraphData | TreeGraphData} data 源数据 * @param {boolean} 是否入栈,默认为true * @return {object} this */ public changeData( data?: GraphData | TreeGraphData, stack: boolean = true, ): AbstractGraph { const self = this; if (!dataValidation(data)) { return this; } if (stack && this.get("enabledStack")) { this.pushStack("changedata", { before: self.save(), after: data, }); } this.set("comboSorted", false); // 删除 hulls this.removeHulls(); // 更改数据源后,取消所有状态 this.getNodes().map((node) => self.clearItemStates(node)); this.getEdges().map((edge) => self.clearItemStates(edge)); const canvas: ICanvas = this.get("canvas"); const localRefresh: boolean = canvas.get("localRefresh"); canvas.set("localRefresh", false); if (!self.get("data")) { self.data(data); self.render(); } const itemMap: NodeMap = this.get("itemMap"); const items: { nodes: INode[]; edges: IEdge[]; } = { nodes: [], edges: [], }; const combosData = (data as GraphData).combos; if (combosData) { const comboTrees = plainCombosToTrees( combosData, (data as GraphData).nodes, ); this.set("comboTrees", comboTrees); } this.diffItems("node", items, (data as GraphData).nodes!); each(itemMap, (item: INode & IEdge & ICombo, id: number) => { itemMap[id].getModel().depth = 0; if (item.getType && item.getType() === "edge") return; if (item.getType && item.getType() === "combo") { delete itemMap[id]; item.destroy(); } else if (items.nodes.indexOf(item) < 0) { delete itemMap[id]; self.remove(item, false); } }); // clear the destroyed combos here to avoid removing sub nodes before removing the parent combo const comboItems = this.getCombos(); const combosLength = comboItems.length; for (let i = combosLength - 1; i >= 0; i--) { if (comboItems[i].destroyed) { comboItems.splice(i, 1); } } // process the data to tree structure if (combosData) { // add combos self.addCombos(combosData); if (!this.get("groupByTypes")) { this.sortCombos(); } } this.diffItems("edge", items, (data as GraphData).edges!); each(itemMap, (item: INode & IEdge & ICombo, id: number) => { if ( item.getType && (item.getType() === "node" || item.getType() === "combo") ) return; if (items.edges.indexOf(item) < 0) { delete itemMap[id]; self.remove(item, false); } }); this.set({ nodes: items.nodes, edges: items.edges }); const layoutController = this.get("layoutController"); if (layoutController) { layoutController.changeData(); if (self.get("animate") && !layoutController.getLayoutType()) { // 如果没有指定布局 self.positionsAnimate(); } else { self.autoPaint(); } } setTimeout(() => { canvas.set("localRefresh", localRefresh); }, 16); return this; } /** * 私有方法,在 render 和 changeData 的时候批量添加数据中所有平铺的 combos * @param {ComboConfig[]} combos 平铺的 combos 数据 */ protected addCombos(combos: ComboConfig[]) { const self = this; const comboTrees = self.get("comboTrees"); const itemController: ItemController = this.get("itemController"); itemController.addCombos(comboTrees, combos); } /** * 根据已经存在的节点或 combo 创建新的 combo * @param combo combo ID 或 Combo 配置 * @param children 添加到 Combo 中的元素,包括节点和 combo */ public createCombo(combo: string | ComboConfig, children: string[]): void { this.set("comboSorted", false); // step 1: 创建新的 Combo let comboId = ""; let comboConfig: ComboConfig; if (!combo) return; if (isString(combo)) { comboId = combo; comboConfig = { id: combo, }; } else { comboId = combo.id; if (!comboId) { console.warn( "Create combo failed. Please assign a unique string id for the adding combo.", ); return; } comboConfig = combo; } // step2: 更新 children,根据类型添加 comboId 或 parentId const trees: ComboTree[] = children.map((elementId) => { const item = this.findById(elementId); const model = item.getModel(); let type = ""; if (item.getType) type = item.getType(); const cItem: ComboTree = { id: item.getID(), itemType: type as "node" | "combo", }; if (type === "combo") { (cItem as ComboConfig).parentId = comboId; model.parentId = comboId; } else if (type === "node") { (cItem as NodeConfig).comboId = comboId; model.comboId = comboId; } return cItem; }); comboConfig.children = trees; // step 3: 添加 Combo,addItem 时会将子将元素添加到 Combo 中 this.addItem("combo", comboConfig, false); this.set("comboSorted", false); // step4: 更新 comboTrees 结构 const comboTrees = this.get("comboTrees"); (comboTrees || []).forEach((ctree) => { traverseTreeUp(ctree, (child) => { if (child.id === comboId) { child.itemType = "combo"; child.children = trees as ComboTree[]; return false; } return true; }); }); if (comboTrees) { this.sortCombos(); } } /** * 解散 combo * @param {String | INode | ICombo} combo 需要被解散的 Combo item 或 id */ public uncombo(combo: string | ICombo) { const self = this; let comboItem: ICombo = combo as ICombo; if (isString(combo)) { comboItem = this.findById(combo) as ICombo; } if (!comboItem || (comboItem.getType && comboItem.getType() !== "combo")) { console.warn("The item is not a combo!"); return; } const parentId = comboItem.getModel().parentId; let comboTrees = self.get("comboTrees"); if (!comboTrees) comboTrees = []; const itemMap = this.get("itemMap"); const comboId = comboItem.get("id"); let treeToBeUncombo; let brothers = []; const comboItems = this.get("combos"); const parentItem = this.findById(parentId as string) as ICombo; comboTrees.forEach((ctree) => { if (treeToBeUncombo) return; // terminate the forEach traverseTreeUp(ctree, (subtree) => { // find the combo to be uncomboed, delete the combo from map and cache if (subtree.id === comboId) { treeToBeUncombo = subtree; // delete the related edges const edges = comboItem.getEdges(); edges.forEach((edge) => { this.removeItem(edge, false); }); const index = comboItems.indexOf(combo); comboItems.splice(index, 1); delete itemMap[comboId]; comboItem.destroy(); } // find the parent to remove the combo from the combo's brothers array and add the combo's children to the combo's brothers array in the tree if (parentId && treeToBeUncombo && subtree.id === parentId) { parentItem.removeCombo(comboItem); brothers = subtree.children; // the combo's brothers // remove the combo from its brothers array const index = brothers.indexOf(treeToBeUncombo); if (index !== -1) { brothers.splice(index, 1); } // append the combo's children to the combo's brothers array treeToBeUncombo.children.forEach((child) => { const item = this.findById(child.id) as ICombo | INode; const childModel = item.getModel(); if (item.getType && item.getType() === "combo") { child.parentId = parentId; delete child.comboId; childModel.parentId = parentId; // update the parentId of the model delete childModel.comboId; } else if (item.getType && item.getType() === "node") { child.comboId = parentId; childModel.comboId = parentId; // update the parentId of the model } parentItem.addChild(item); brothers.push(child); }); return false; } return true; }); }); // if the parentId is not found, remove the combo from the roots if (!parentId && treeToBeUncombo) { const index = comboTrees.indexOf(treeToBeUncombo); comboTrees.splice(index, 1); // modify the parentId of the children treeToBeUncombo.children.forEach((child) => { child.parentId = undefined; const childModel = this.findById(child.id).getModel(); delete childModel.parentId; // update the parentId of the model delete childModel.comboId; // update the comboId of the model if (child.itemType !== "node") comboTrees.push(child); }); } } /** * 根据节点的 bbox 更新所有 combos 的绘制,包括 combos 的位置和范围 */ public updateCombos() { const self = this; const comboTrees = this.get("comboTrees"); const itemController: ItemController = self.get("itemController"); const itemMap = self.get("itemMap"); (comboTrees || []).forEach((ctree: ComboTree) => { traverseTreeUp(ctree, (child) => { if (!child) { return true; } const childItem = itemMap[child.id]; if (childItem && childItem.getType && childItem.getType() === "combo") { // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式 const states = [...childItem.getStates()]; each(states, (state) => this.setItemState(childItem, state, false)); // 更新具体的 Combo itemController.updateCombo(childItem, child.children); // 更新 Combo 后,还原已有的状态 each(states, (state) => this.setItemState(childItem, state, true)); } return true; }); }); self.sortCombos(); } /** * 根据节点的 bbox 更新 combo 及其祖先 combos 的绘制,包括 combos 的位置和范围 * @param {String | ICombo} combo 需要被更新的 Combo 或 id,若指定,则该 Combo 及所有祖先 Combod 都会被更新 */ public updateCombo(combo: string | ICombo) { const self = this; let comboItem: ICombo = combo as ICombo; let comboId; if (isString(combo)) { comboItem = this.findById(combo) as ICombo; } if (!comboItem || (comboItem.getType && comboItem.getType() !== "combo")) { console.warn("The item to be updated is not a combo!"); return; } comboId = comboItem.get("id"); const comboTrees = this.get("comboTrees"); const itemController: ItemController = self.get("itemController"); const itemMap = self.get("itemMap"); (comboTrees || []).forEach((ctree: ComboTree) => { traverseTreeUp(ctree, (child) => { if (!child) { return true; } const childItem = itemMap[child.id]; if ( comboId === child.id && childItem && childItem.getType && childItem.getType() === "combo" ) { // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式 const states = [...childItem.getStates()]; // || !item.getStateStyle(stateName) each(states, (state) => { if (childItem.getStateStyle(state)) { this.setItemState(childItem, state, false); } }); // 更新具体的 Combo itemController.updateCombo(childItem, child.children); // 更新 Combo 后,还原已有的状态 each(states, (state) => { if (childItem.getStateStyle(state)) { this.setItemState(childItem, state, true); } }); if (comboId) comboId = child.parentId; } return true; }); }); } /** * 更新树结构,例如移动子树等 * @param {String | INode | ICombo} item 需要被更新的 Combo 或 节点 id * @param {string | undefined} parentId 新的父 combo id,undefined 代表没有父 combo */ public updateComboTree( item: string | INode | ICombo, parentId?: string | undefined, stack: boolean = true, ) { const self = this; this.set("comboSorted", false); let uItem: INode | ICombo; if (isString(item)) { uItem = self.findById(item) as INode | ICombo; } else { uItem = item as INode | ICombo; } const model = uItem.getModel(); const oldParentId = (model.comboId as string) || (model.parentId as string); let type = ""; if (uItem.getType) type = uItem.getType(); // 若 item 是 Combo,且 parentId 是其子孙 combo 的 id,则警告并终止 if (parentId && type === "combo") { const comboTrees = this.get("comboTrees"); let valid = true; let itemSubTree; (comboTrees || []).forEach((ctree) => { if (itemSubTree) return; traverseTree(ctree, (subTree) => { if (itemSubTree) return; // 找到从 item 开始的子树 if (subTree.id === uItem.getID()) { itemSubTree = subTree; } return true; }); }); // 在以 item 为根的子树中寻找与 parentId 相同的后继元素 traverseTree(itemSubTree, (subTree) => { if (subTree.id === parentId) { valid = false; return false; } return true; }); // parentId 是 item 的一个后继元素,不能进行更新 if (!valid) { console.warn( "Failed to update the combo tree! The parentId points to a descendant of the combo!", ); return; } } if (stack && this.get("enabledStack")) { const beforeData: GraphData = {}, afterData: GraphData = {}; if (type === "combo") { beforeData.combos = [ { id: model.id, parentId: (model as ComboConfig).parentId, }, ]; afterData.combos = [ { id: model.id, parentId, }, ]; } else if (type === "node") { beforeData.nodes = [ { id: model.id, parentId: (model as NodeConfig).comboId, }, ]; afterData.nodes = [ { id: model.id, parentId, }, ]; } this.pushStack("updateComboTree", { before: beforeData, after: afterData, }); } // 当 combo 存在 parentId 或 comboId 时,才将其移除 if (model.parentId || model.comboId) { const combo = this.findById( (model.parentId || model.comboId) as string, ) as ICombo; if (combo) { combo.removeChild(uItem); } } if (type === "combo") { model.parentId = parentId; } else if (type === "node") { model.comboId = parentId; } // 只有当移入到指定 combo 时才添加 if (parentId) { const parentCombo = this.findById(parentId) as ICombo; if (parentCombo) { // 将元素添加到 parentCombo 中 parentCombo.addChild(uItem as ICombo | INode); } } // 如果原先有父亲 combo,则从原父 combo 的子元素数组中删除 if (oldParentId) { const parentCombo = this.findById(oldParentId) as ICombo; if (parentCombo) { // 将元素从 parentCombo 中移除 parentCombo.removeChild(uItem as ICombo | INode); } } const newComboTrees = reconstructTree( this.get("comboTrees"), model.id, parentId, ); this.set("comboTrees", newComboTrees); this.updateCombos(); } /** * 导出图数据 * @return {object} data */ public save(): GraphData | TreeGraphData { const nodes: NodeConfig[] = []; const edges: EdgeConfig[] = []; const combos: ComboConfig[] = []; each(this.get("nodes"), (node: INode) => { nodes.push(node.getModel() as NodeConfig); }); each(this.get("edges"), (edge: IEdge) => { edges.push(edge.getModel() as EdgeConfig); }); each(this.get("combos"), (combo: ICombo) => { combos.push(combo.getModel() as ComboConfig); }); return { nodes, edges, combos }; } /** * 改变画布大小 * @param {number} width 画布宽度 * @param {number} height 画布高度 * @return {object} this */ public changeSize(width: number, height: number): AbstractGraph { const viewController: ViewController = this.get("viewController"); viewController.changeSize(width, height); return this; } /** * 当源数据在外部发生变更时,根据新数据刷新视图。但是不刷新节点位置 */ public refresh(): void { const self = this; self.emit("beforegraphrefresh"); if (self.get("animate")) { self.positionsAnimate(); } else { const nodes: INode[] = self.get("nodes"); const edges: IEdge[] = self.get("edges"); const vedges: IEdge[] = self.get("edges"); each(nodes, (node: INode) => { node.refresh(); }); each(edges, (edge: IEdge) => { edge.refresh(); }); each(vedges, (vedge: IEdge) => { vedge.refresh(); }); } self.emit("aftergraphrefresh"); self.autoPaint(); } /** * 获取当前图中所有节点的item实例 * @return {INode} item数组 */ public getNodes(): INode[] { return this.get("nodes"); } /** * 获取当前图中所有边的item实例 * @return {IEdge} item数组 */ public getEdges(): IEdge[] { return this.get("edges"); } /** * 获取图中所有的 combo 实例 */ public getCombos(): ICombo[] { return this.get("combos"); } /** * 获取指定 Combo 中所有的节点 * @param comboId combo ID */ public getComboChildren(combo: string | ICombo): { nodes: INode[]; combos: ICombo[]; } { if (isString(combo)) { combo = this.findById(combo) as ICombo; } if (!combo || (combo.getType && combo.getType() !== "combo")) { console.warn("The combo does not exist!"); return; } return combo.getChildren(); } /** * 根据 graph 上的 animateCfg 进行视图中节点位置动画接口 */ public positionsAnimate(): void { const self = this; self.emit("beforeanimate"); const animateCfg: GraphAnimateConfig = self.get("animateCfg"); const { onFrame } = animateCfg; const nodes = self.getNodes(); const toNodes = nodes.map((node) => { const model = node.getModel(); return { id: model.id, x: model.x, y: model.y, }; }); if (self.isAnimating()) { self.stopAnimate(); } const canvas: ICanvas = self.get("canvas"); canvas.animate( (ratio: number) => { each(toNodes, (data) => { const node: Item = self.findById(data.id); if (!node || node.destroyed) { return; } let originAttrs: Point = node.get("originAttrs"); const model: NodeConfig = node.get("model"); if (!originAttrs) { let containerMatrix = node.getContainer().getMatrix(); if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; originAttrs = { x: containerMatrix[6], y: containerMatrix[7], }; node.set("originAttrs", originAttrs); } if (onFrame) { const attrs = onFrame(node, ratio, data, originAttrs); node.set("model", Object.assign(model, attrs)); } else { model.x = originAttrs.x + (data.x - originAttrs.x) * ratio; model.y = originAttrs.y + (data.y - originAttrs.y) * ratio; } }); self.refreshPositions(); }, { duration: animateCfg.duration, easing: animateCfg.easing, callback: () => { each(nodes, (node: INode) => { node.set("originAttrs", null); }); if (animateCfg.callback) { animateCfg.callback(); } self.emit("afteranimate"); self.animating = false; }, }, ); } /** * 当节点位置在外部发生改变时,刷新所有节点位置,重计算边 */ public refreshPositions() { const self = this; self.emit("beforegraphrefreshposition"); const nodes: INode[] = self.get("nodes"); const edges: IEdge[] = self.get("edges"); const vedges: IEdge[] = self.get("vedges"); const combos: ICombo[] = self.get("combos"); let model: NodeConfig; const updatedNodes: { [key: string]: boolean } = {}; each(nodes, (node: INode) => { model = node.getModel() as NodeConfig; const originAttrs = node.get("originAttrs"); if ( originAttrs && model.x === originAttrs.x && model.y === originAttrs.y ) { return; } const changed = node.updatePosition({ x: model.x!, y: model.y! }); updatedNodes[model.id] = changed; if (model.comboId) updatedNodes[model.comboId] = updatedNodes[model.comboId] || changed; }); if (combos && combos.length !== 0) { self.updateCombos(); } each(edges, (edge: IEdge) => { const sourceModel = edge.getSource().getModel(); const target = edge.getTarget(); // 避免 target 是纯对象的情况下调用 getModel 方法 // 拖动生成边的时候 target 会是纯对象 if (!isPlainObject(target)) { const targetModel = (target as INode | ICombo).getModel(); if ( updatedNodes[sourceModel.id as string] || updatedNodes[targetModel.id as string] || edge.getModel().isComboEdge ) { edge.refresh(); } } }); each(vedges, (vedge: IEdge) => { vedge.refresh(); }); self.emit("aftergraphrefreshposition"); self.autoPaint(); } public stopAnimate(): void { this.get("canvas").stopAnimate(); } public isAnimating(): boolean { return this.animating; } /** * 获取当前视口伸缩比例 * @return {number} 比例 */ public getZoom(): number { const matrix = this.get("group").getMatrix(); return matrix ? matrix[0] : 1; } /** * 获取当前的行为模式 * @return {string} 当前行为模式 */ public getCurrentMode(): string { const modeController: ModeController = this.get("modeController"); return modeController.getMode(); } /** * 切换行为模式 * @param {string} mode 指定模式 * @return {object} this */ public setMode(mode: string): AbstractGraph { const modeController: ModeController = this.get("modeController"); modeController.setMode(mode); return this; } /** * 清除画布元素 * @return {object} this */ public clear(avoidEmit: boolean = false): AbstractGraph { const canvas: ICanvas = this.get("canvas"); canvas.clear(); this.initGroups(); // 清空画布时同时清除数据 this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [], }); if (!avoidEmit) this.emit("afterrender"); return this; } /** * 更换布局配置项 * @param {object} cfg 新布局配置项 * 若 cfg 含有 type 字段或为 String 类型,且与现有布局方法不同,则更换布局 * 若 cfg 不包括 type ,则保持原有布局方法,仅更新布局配置项 */ public updateLayout(cfg: any): void { const layoutController = this.get("layoutController"); if (isString(cfg)) { cfg = { type: cfg, }; } const oriLayoutCfg = this.get("layout"); const layoutCfg: any = {}; Object.assign(layoutCfg, oriLayoutCfg, cfg); this.set("layout", layoutCfg); if ( layoutController.isLayoutTypeSame(layoutCfg) && layoutCfg.gpuEnabled === oriLayoutCfg.gpuEnabled ) { // no type or same type, or switch the gpu and cpu, update layout layoutController.updateLayoutCfg(layoutCfg); } else { // has different type, change layout layoutController.changeLayout(layoutCfg); } } /** * 销毁布局,changeData 时不会再使用原来的布局方法对新数据进行布局 */ public destroyLayout(): void { const layoutController = this.get("layoutController"); layoutController.destroyLayout(); } /** * 重新以当前示例中配置的属性进行一次布局 */ public layout(): void { const layoutController = this.get("layoutController"); const layoutCfg = this.get("layout"); if (!layoutCfg || !layoutController) return; if (layoutCfg.workerEnabled) { // 如果使用web worker布局 layoutController.layout(); return; } if (layoutController.layoutMethod) { layoutController.relayout(true); } else { layoutController.layout(); } } /** * 收起指定的 combo * @param {string | ICombo} combo combo ID 或 combo item */ public collapseCombo(combo: string | ICombo): void { if (isString(combo)) { combo = this.findById(combo) as ICombo; } if (!combo) { console.warn("The combo to be collapsed does not exist!"); return; } this.emit("beforecollapseexpandcombo", { action: "expand", item: combo }); const comboModel = combo.getModel(); const itemController: ItemController = this.get("itemController"); itemController.collapseCombo(combo); comboModel.collapsed = true; // add virtual edges const edges = this.getEdges().concat(this.get("vedges")); // find all the descendant nodes and combos let cnodes = []; let ccombos = []; const comboTrees = this.get("comboTrees"); let found = false; (comboTrees || []).forEach((ctree) => { if (found) return; // if the combo is found, terminate the forEach traverseTree(ctree, (subTree) => { // if the combo is found and it is traversing the other branches, terminate if (found && subTree.depth <= comboModel.depth) return false; // if the combo is found if (comboModel.id === subTree.id) found = true; if (found) { // if the combo is found, concat the descendant nodes and combos const item = this.findById(subTree.id) as ICombo; if (item && item.getType && item.getType() === "combo") { cnodes = cnodes.concat(item.getNodes()); ccombos = ccombos.concat(item.getCombos()); } } return true; }); }); const edgeWeightMap = {}; const addedVEdges = []; edges.forEach((edge) => { if (edge.isVisible() && !edge.getModel().isVEdge) return; let source = edge.getSource(); let target = edge.getTarget(); if ( ((cnodes.includes(source) || ccombos.includes(source)) && !cnodes.includes(target) && !ccombos.includes(target)) || source.getModel().id === comboModel.id ) { const edgeModel = edge.getModel(); if (edgeModel.isVEdge) { this.removeItem(edge, false); return; } let targetModel = target.getModel(); while (!target.isVisible()) { target = this.findById( (targetModel.parentId as string) || (targetModel.comboId as string), ) as ICombo; if (!target || (!targetModel.parentId && !targetModel.comboId)) return; // all the ancestors are hidden, then ignore the edge targetModel = target.getModel(); } const targetId = targetModel.id; if (edgeWeightMap[`${comboModel.id}-${targetId}`]) { edgeWeightMap[`${comboModel.id}-${targetId}`] += edgeModel.size || 1; return; } // the source is in the combo, the target is not const vedge = this.addItem( "vedge", { source: comboModel.id, target: targetId, isVEdge: true, }, false, ); edgeWeightMap[`${comboModel.id}-${targetId}`] = edgeModel.size || 1; addedVEdges.push(vedge); } else if ( (!cnodes.includes(source) && !ccombos.includes(source) && (cnodes.includes(target) || ccombos.includes(target))) || target.getModel().id === comboModel.id ) { const edgeModel = edge.getModel(); if (edgeModel.isVEdge) { this.removeItem(edge, false); return; } let sourceModel = source.getModel(); while (!source.isVisible()) { source = this.findById( (sourceModel.parentId as string) || (sourceModel.comboId as string), ) as ICombo; if (!source || (!sourceModel.parentId && !sourceModel.comboId)) return; // all the ancestors are hidden, then ignore the edge sourceModel = source.getModel(); } const sourceId = sourceModel.id; if (edgeWeightMap[`${sourceId}-${comboModel.id}`]) { edgeWeightMap[`${sourceId}-${comboModel.id}`] += edgeModel.size || 1; return; } // the target is in the combo, the source is not const vedge = this.addItem( "vedge", { target: comboModel.id, source: sourceId, isVEdge: true, }, false, ); edgeWeightMap[`${sourceId}-${comboModel.id}`] = edgeModel.size || 1; addedVEdges.push(vedge); } }); // update the width of the virtual edges, which is the sum of merged actual edges // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges addedVEdges.forEach((vedge) => { const vedgeModel = vedge.getModel(); this.updateItem( vedge, { size: edgeWeightMap[`${vedgeModel.source}-${vedgeModel.target}`], }, false, ); }); this.emit("aftercollapseexpandcombo", { action: "collapse", item: combo }); } /** * 展开指定的 combo * @param {string | ICombo} combo combo ID 或 combo item */ public expandCombo(combo: string | ICombo): void { if (isString(combo)) { combo = this.findById(combo) as ICombo; } if (!combo || (combo.getType && combo.getType() !== "combo")) { console.warn("The combo to be collapsed does not exist!"); return; } this.emit("beforecollapseexpandcombo", { action: "expand", item: combo }); const comboModel = combo.getModel(); const itemController: ItemController = this.get("itemController"); itemController.expandCombo(combo); comboModel.collapsed = false; // add virtual edges const edges = this.getEdges().concat(this.get("vedges")); // find all the descendant nodes and combos let cnodes = []; let ccombos = []; const comboTrees = this.get("comboTrees"); let found = false; (comboTrees || []).forEach((ctree) => { if (found) return; // if the combo is found, terminate traverseTree(ctree, (subTree) => { // if the combo is found and it is traversing the other branches, terminate if (found && subTree.depth <= comboModel.depth) return false; if (comboModel.id === subTree.id) found = true; if (found) { const item = this.findById(subTree.id) as ICombo; if (item && item.getType && item.getType() === "combo") { cnodes = cnodes.concat(item.getNodes()); ccombos = ccombos.concat(item.getCombos()); } } return true; }); }); const edgeWeightMap = {}; const addedVEdges = {}; edges.forEach((edge) => { if (edge.isVisible() && !edge.getModel().isVEdge) return; let source = edge.getSource(); let target = edge.getTarget(); let sourceId = source.get("id"); let targetId = target.get("id"); if ( ((cnodes.includes(source) || ccombos.includes(source)) && !cnodes.includes(target) && !ccombos.includes(target)) || sourceId === comboModel.id ) { // the source is in the combo, the target is not // ignore the virtual edges if (edge.getModel().isVEdge) { this.removeItem(edge, false); return; } let targetModel = target.getModel(); // find the nearest visible ancestor while (!target.isVisible()) { target = this.findById( (targetModel.comboId as string) || (targetModel.parentId as string), ) as ICombo; if (!target || (!targetModel.parentId && !targetModel.comboId)) { return; // if all the ancestors of the oppsite are all hidden, ignore the edge } targetModel = target.getModel(); } targetId = targetModel.id; let sourceModel = source.getModel(); // find the nearest visible ancestor while (!source.isVisible()) { source = this.findById( (sourceModel.comboId as string) || (sourceModel.parentId as string), ) as ICombo; if (!source || (!sourceModel.parentId && !sourceModel.comboId)) { return; // if all the ancestors of the oppsite are all hidden, ignore the edge } if ( sourceModel.comboId === comboModel.id || sourceModel.parentId === comboModel.id ) { break; // if the next ancestor is the combo, break the while } sourceModel = source.getModel(); } sourceId = sourceModel.id; if (targetId) { const vedgeId = `${sourceId}-${targetId}`; // update the width of the virtual edges, which is the sum of merged actual edges // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges if (edgeWeightMap[vedgeId]) { edgeWeightMap[vedgeId] += edge.getModel().size || 1; this.updateItem( addedVEdges[vedgeId], { size: edgeWeightMap[vedgeId], }, false, ); return; } const vedge = this.addItem( "vedge", { source: sourceId, target: targetId, isVEdge: true, }, false, ); edgeWeightMap[vedgeId] = edge.getModel().size || 1; addedVEdges[vedgeId] = vedge; } } else if ( (!cnodes.includes(source) && !ccombos.includes(source) && (cnodes.includes(target) || ccombos.includes(target))) || targetId === comboModel.id ) { // the target is in the combo, the source is not // ignore the virtual edges if (edge.getModel().isVEdge) { this.removeItem(edge, false); return; } let sourceModel = source.getModel(); // find the nearest visible ancestor while (!source.isVisible()) { source = this.findById( (sourceModel.comboId as string) || (sourceModel.parentId as string), ) as ICombo; if (!source || (!sourceModel.parentId && !sourceModel.comboId)) { return; // if all the ancestors of the oppsite are all hidden, ignore the edge } sourceModel = source.getModel(); } sourceId = sourceModel.id; let targetModel = target.getModel(); // find the nearest visible ancestor while (!target.isVisible()) { target = this.findById( (targetModel.comboId as string) || (targetModel.parentId as string), ) as ICombo; if (!target || (!targetModel.parentId && !targetModel.comboId)) { return; // if all the ancestors of the oppsite are all hidden, ignore the edge } if ( targetModel.comboId === comboModel.id || targetModel.parentId === comboModel.id ) { break; // if the next ancestor is the combo, break the while } targetModel = target.getModel(); } targetId = targetModel.id; if (sourceId) { const vedgeId = `${sourceId}-${targetId}`; // update the width of the virtual edges, which is the sum of merged actual edges // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges if (edgeWeightMap[vedgeId]) { edgeWeightMap[vedgeId] += edge.getModel().size || 1; this.updateItem( addedVEdges[vedgeId], { size: edgeWeightMap[vedgeId], }, false, ); return; } const vedge = this.addItem( "vedge", { target: targetId, source: sourceId, isVEdge: true, }, false, ); edgeWeightMap[vedgeId] = edge.getModel().size || 1; addedVEdges[vedgeId] = vedge; } } else if ( (cnodes.includes(source) || ccombos.includes(source)) && (cnodes.includes(target) || ccombos.includes(target)) ) { // both source and target are in the combo, if the target and source are both visible, show the edge if (source.isVisible() && target.isVisible()) { edge.show(); } } }); this.emit("aftercollapseexpandcombo", { action: "expand", item: combo }); } public collapseExpandCombo(combo: string | ICombo) { if (isString(combo)) { combo = this.findById(combo) as ICombo; } if (!combo || (combo.getType && combo.getType() !== "combo")) return; const comboModel = combo.getModel(); // if one ancestor combo of the combo is collapsed, it should not be collapsed or expanded let parentItem = this.findById(comboModel.parentId as string); while (parentItem) { const parentModel = parentItem.getModel(); if (parentModel.collapsed) { console.warn( `Fail to expand the combo since it's ancestor combo is collapsed.`, ); parentItem = undefined; return; } parentItem = this.findById(parentModel.parentId as string); } const collapsed = comboModel.collapsed; // 该群组已经处于收起状态,需要展开 if (collapsed) { this.expandCombo(combo); } else { this.collapseCombo(combo); } this.updateCombo(combo); } /** * 根据 comboTree 结构整理 Combo 相关的图形绘制层级,包括 Combo 本身、节点、边 * @param {GraphData} data 数据 */ protected sortCombos() { const comboSorted = this.get("comboSorted"); if (comboSorted) return; this.set("comboSorted", true); const depthMap = []; const dataDepthMap = {}; const comboTrees = this.get("comboTrees"); (comboTrees || []).forEach((cTree) => { traverseTree(cTree, (child) => { if (depthMap[child.depth]) depthMap[child.depth].push(child.id); else depthMap[child.depth] = [child.id]; dataDepthMap[child.id] = child.depth; return true; }); }); const edges = this.getEdges().concat(this.get("vedges")); (edges || []).forEach((edgeItem) => { const edge = edgeItem.getModel(); const sourceDepth: number = dataDepthMap[edge.source as string] || 0; const targetDepth: number = dataDepthMap[edge.target as string] || 0; const depth = Math.max(sourceDepth, targetDepth); if (depthMap[depth]) depthMap[depth].push(edge.id); else depthMap[depth] = [edge.id]; }); depthMap.forEach((array) => { if (!array || !array.length) return; for (let i = array.length - 1; i >= 0; i--) { const item = this.findById(array[i]); if (item) item.toFront(); } }); } /** * 获取节点所有的邻居节点 * * @param {(string | INode)} node 节点 ID 或实例 * @returns {INode[]} * @memberof IAbstractGraph */ public getNeighbors( node: string | INode, type?: "source" | "target" | undefined, ): INode[] { let item = node as INode; if (isString(node)) { item = this.findById(node) as INode; } return item.getNeighbors(type); } /** * 获取 node 的度数 * * @param {(string | INode)} node 节点 ID 或实例 * @param {('in' | 'out' | 'total' | 'all' | undefined)} 度数类型,in 入度,out 出度,total 总度数,all 返回三种类型度数的对象 * @returns {Number | Object} 该节点的度数 * @memberof IAbstractGraph */ public getNodeDegree( node: string | INode, type: "in" | "out" | "total" | "all" | undefined = undefined, refresh: boolean = false, ): Number | Object { let item = node as INode; if (isString(node)) { item = this.findById(node) as INode; } let degrees = this.get("degrees"); if (!degrees || refresh) { degrees = getDegree(this.save() as any); this.set("degrees", degrees); } const nodeDegrees = degrees[item.getID()]; let res = 0; // 如果是通过 addItem 后面新增加的节点,此时它的所有度数都为 0 if (!nodeDegrees) { return 0; } switch (type) { case "in": res = nodeDegrees.inDegree; break; case "out": res = nodeDegrees.outDegree; break; case "all": res = nodeDegrees; break; default: res = nodeDegrees.degree; break; } return res; } public getUndoStack() { return this.undoStack; } public getRedoStack() { return this.redoStack; } /** * 获取 undo 和 redo 栈的数据 */ public getStackData() { if (!this.get("enabledStack")) { return null; } return { undoStack: this.undoStack.toArray(), redoStack: this.redoStack.toArray(), }; } /** * 清空 undo stack & redo stack */ public clearStack() { if (this.get("enabledStack")) { this.undoStack.clear(); this.redoStack.clear(); } } /** * 将操作类型和操作数据入栈 * @param action 操作类型 * @param data 入栈的数据 * @param stackType 栈的类型 */ public pushStack( action: string = "update", data?: unknown, stackType: string = "undo", ) { if (!this.get("enabledStack")) { console.warn( "请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !", ); return; } const stackData = data ? clone(data) : { before: {}, after: clone(this.save()), }; if (stackType === "redo") { this.redoStack.push({ action, data: stackData, }); } else { this.undoStack.push({ action, data: stackData, }); } this.emit("stackchange", { undoStack: this.undoStack, redoStack: this.redoStack, }); } /** * 获取邻接矩阵 * * @param {boolean} cache 是否使用缓存的 * @param {boolean} directed 是否是有向图,默认取 graph.directed * @returns {Matrix} 邻接矩阵 * @memberof IAbstractGraph */ public getAdjMatrix( cache: boolean = true, directed?: boolean, ): Number | Object { if (directed === undefined) directed = this.get("directed"); let currentAdjMatrix = this.get("adjMatrix"); if (!currentAdjMatrix || !cache) { currentAdjMatrix = getAdjacentMatrix(this.save() as any, directed); this.set("adjMatrix", currentAdjMatrix); } return currentAdjMatrix; } /** * 获取最短路径矩阵 * * @param {boolean} cache 是否使用缓存的 * @param {boolean} directed 是否是有向图,默认取 graph.directed * @returns {Matrix} 最短路径矩阵 * @memberof IAbstractGraph */ public getShortestPathMatrix( cache: boolean = true, directed?: boolean, ): Number | Object { if (directed === undefined) directed = this.get("directed"); let currentAdjMatrix = this.get("adjMatrix"); let currentShourtestPathMatrix = this.get("shortestPathMatrix"); if (!currentAdjMatrix || !cache) { currentAdjMatrix = getAdjacentMatrix(this.save() as any, directed); this.set("adjMatrix", currentAdjMatrix); } if (!currentShourtestPathMatrix || !cache) { currentShourtestPathMatrix = floydWarshall(this.save() as any, directed); this.set("shortestPathMatrix", currentShourtestPathMatrix); } return currentShourtestPathMatrix; } /** * 重新定义监听函数,复写参数类型 */ public on( eventName: string, callback: (e: T) => void, once?: boolean, ): this { return super.on(eventName, callback, once); } /** * 销毁画布 */ public destroy() { this.clear(); clearAnimationFrame(this.timeIndex); // 清空栈数据 this.clearStack(); this.get("itemController").destroy(); this.get("modeController").destroy(); this.get("viewController").destroy(); this.get("stateController").destroy(); this.get("canvas").destroy(); (this.cfg as any) = null; this.destroyed = true; this.redoStack = null; this.undoStack = null; } /** * 创建凸包或凹包轮廓 * @param cfg HullCfg 轮廓配置项 */ public createHull(cfg: HullCfg) { if (!cfg.members || cfg.members.length < 1) { console.warn("Create hull failed! The members is empty."); return; } let parent = this.get("hullGroup"); let hullMap = this.get("hullMap"); if (!hullMap) { hullMap = {}; this.set("hullMap", hullMap); } if (!parent || parent.get("destroyed")) { parent = this.get("group").addGroup({ id: "hullGroup", }); parent.toBack(); this.set("hullGroup", parent); } if (hullMap[cfg.id]) { console.warn("Existed hull id."); return hullMap[cfg.id]; } const group = parent.addGroup({ id: `${cfg.id}-container`, }); const hull = new Hull(this, { ...cfg, group, }); const hullId = hull.id; hullMap[hullId] = hull; return hull; } /** * 获取当前 graph 中存在的包裹轮廓 * @return {[key: string]: Hull} Hull 的 map,hullId 对应的 hull 实例 */ public getHulls(): { [key: string]: Hull } { return this.get("hullMap"); } /** * 根据 hullId 获取对应的 hull * @return Hull */ public getHullById(hullId: string): Hull { return this.get("hullMap")[hullId]; } public removeHull(hull: Hull | string) { let hullInstance: Hull; if (isString(hull)) { hullInstance = this.getHullById(hull); } else { hullInstance = hull; } const hullMap = this.get("hullMap"); delete hullMap[hullInstance.id]; hullInstance.destroy(); } public removeHulls() { const hulls = this.getHulls(); if (!hulls || !Object.keys(hulls).length) return; Object.keys(hulls).forEach((key) => { const hull = hulls[key]; hull.destroy(); }); this.set("hullMap", {}); } public onTick(timestamp: number): void { const layoutController = this.get("layoutController"); if (layoutController) { layoutController.onTick(timestamp); this.timeIndex = requestAnimationFrame(this.onTick.bind(this)); } } } ================================================ FILE: packages/core/src/index.ts ================================================ import Behavior from "./behavior"; import AbstractGraph from "./graph/graph"; import Shape, { Arrow, Marker } from "./element"; import { IBehavior } from "./types"; import Global from "./global"; import Util from "./util"; // 用于 PC 和 Mobile 端分别实现 layout 和 updateLayoutCfg 方法 import AbstractLayout from "./graph/controller/layout"; import AbstractEvent from "./graph/controller/event"; import Node from "./item/node"; import Edge from "./item/edge"; import Hull from "./item/hull"; import Combo from "./item/combo"; const registerNode = Shape.registerNode; const registerEdge = Shape.registerEdge; const registerCombo = Shape.registerCombo; const registerBehavior = (Behavior as IBehavior).registerBehavior; const BaseGlobal = Global; export * from "./types"; export { Arrow, Shape, Node, Edge, Combo, Hull, Marker, registerNode, registerCombo, AbstractGraph, Util, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, }; export default { version: Global.version, AbstractGraph, BaseGlobal, Util, Shape, Node, Edge, Combo, Hull, registerNode: Shape.registerNode, registerEdge: Shape.registerEdge, registerCombo: Shape.registerCombo, registerBehavior: (Behavior as IBehavior).registerBehavior, Arrow, Marker, AbstractLayout, AbstractEvent, }; ================================================ FILE: packages/core/src/interface/behavior.ts ================================================ import { Event as GraphEvent, ICanvas } from "@antv/g-base"; import { G6Event, IG6GraphEvent, IShapeBase, Item, BehaviorOption, } from "../types"; import { IAbstractGraph } from "./graph"; export interface IBehavior { registerBehavior: (type: string, behavior: BehaviorOption) => void; hasBehavior: (type: string) => boolean; getBehavior: (type: string) => any; } export interface IBehaviorOption { type: string; getEvents: () => { [key in G6Event]?: string; }; updateCfg: (cfg: object) => {}; getDefaultCfg?: () => object; shouldBegin?: (e?: IG6GraphEvent) => boolean; shouldUpdate?: (e?: IG6GraphEvent) => boolean; shouldEnd?: (e?: IG6GraphEvent) => boolean; bind?: (e: IAbstractGraph) => void; unbind?: (e: IAbstractGraph) => void; } export class G6GraphEvent extends GraphEvent implements IG6GraphEvent { public item: Item; public canvasX: number; public canvasY: number; public clientX: number; public clientY: number; public detail: number; public target!: IShapeBase & ICanvas; [key: string]: unknown; constructor(type: string, event: IG6GraphEvent) { super(type, event); this.item = event.item; this.canvasX = event.canvasX; this.canvasY = event.canvasY; this.detail = event.detail; } } ================================================ FILE: packages/core/src/interface/graph.ts ================================================ import EventEmitter from "@antv/event-emitter"; import { IGroup, Point } from "@antv/g-base"; import Graph from "../graph/graph"; import { EdgeConfig, GraphData, Item, ITEM_TYPE, ModelConfig, NodeConfig, Padding, TreeGraphData, LayoutConfig, GraphOptions, ModeOption, ModeType, ComboConfig, GraphAnimateConfig, StackData, HullCfg, IG6GraphEvent, } from "../types"; import { IEdge, INode, ICombo } from "./item"; import Hull from "../item/hull"; import { Stack } from "@antv/algorithm"; export interface IAbstractGraph extends EventEmitter { getDefaultCfg: () => Partial; get: (key: string) => T; set: (key: string | object, value?: T) => Graph; findById: (id: string) => Item; translate: (dx: number, dy: number) => void; zoom: (ratio: number, center?: Point) => void; /** * 获取 graph 的根图形分组 * @return 根 group */ getGroup: () => IGroup; /** * 获取 graph 的 DOM 容器 * @return DOM 容器 */ getContainer: () => HTMLElement; /** * 获取 graph 的最小缩放比例 * @return minZoom */ getMinZoom: () => number; /** * 设置 graph 的最小缩放比例 * @return minZoom */ setMinZoom: (ratio: number) => void; /** * 获取 graph 的最大缩放比例 * @param maxZoom */ getMaxZoom: () => number; /** * 设置 graph 的最大缩放比例 * @param maxZoom */ setMaxZoom: (ratio: number) => void; /** * 获取 graph 的宽度 * @return width */ getWidth: () => number; /** * 获取 graph 的高度 * @return height */ getHeight: () => number; /** * 将屏幕坐标转换为视口坐标 * @param {number} clientX 屏幕 x 坐标 * @param {number} clientY 屏幕 y 坐标 * @return {Point} 视口坐标 */ getPointByClient: (clientX: number, clientY: number) => Point; /** * 将视口坐标转换为屏幕坐标 * @param {number} x 视口x坐标 * @param {number} y 视口y坐标 * @return {object} 视口坐标 */ getClientByPoint: (x: number, y: number) => Point; /** * 将画布坐标转换为视口坐标 * @param {number} canvasX 画布 x 坐标 * @param {number} canvasY 画布 y 坐标 * @return {Point} 视口坐标 */ getPointByCanvas: (canvasX: number, canvasY: number) => Point; /** * 将视口坐标转换为画布坐标 * @param {number} x 视口 x 坐标 * @param {number} y 视口 y 坐标 * @return {Point} 画布坐标 */ getCanvasByPoint: (x: number, y: number) => Point; /** * 获取图内容的中心绘制坐标 * @return {object} 中心绘制坐标 */ getGraphCenterPoint: () => Point; /** * 获取视口中心绘制坐标 * @return {object} 视口中心绘制坐标 */ getViewPortCenterPoint: () => Point; /** * 设置是否在更新/刷新后自动重绘 * @param {boolean} auto 自动重绘 */ setAutoPaint: (auto: boolean) => void; /** * 显示元素 * @param {Item} item 指定元素 * @param {boolean} stack 本次操作是否入栈,默认为 true */ showItem: (item: Item | string, stack?: boolean) => void; /** * 隐藏元素 * @param {Item} item 指定元素 * @param {boolean} stack 本次操作是否入栈,默认为 true */ hideItem: (item: Item | string, stack?: boolean) => void; /** * 仅画布重新绘制 */ paint: () => void; /** * 自动重绘 */ autoPaint: () => void; /** * 刷新元素 * @param {Item} item 元素id或元素实例 */ refreshItem: (item: Item | string) => void; /** * 将元素移动到视口中心 * @param {Item} item 指定元素 * @param {boolean} animate 是否带有动画地移动 * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项 */ focusItem: ( item: Item | string, animate?: boolean, animateCfg?: GraphAnimateConfig, ) => void; /** * 调整视口适应视图 * @param {Padding} padding 四周围边距 */ fitView: (padding?: Padding) => void; /** * 调整视口适应视图,不缩放,仅将图 bbox 中心对齐到画布中心 */ fitCenter: () => void; /** * 伸缩视口到一固定比例 * @param {number} toRatio 伸缩比例 * @param {Point} center 以center的x, y坐标为中心缩放 */ zoomTo: (toRatio: number, center?: Point) => void; /** * 删除元素 * @param {Item} item 元素id或元素实例 * @param {boolean} stack 本次操作是否入栈,默认为 true */ removeItem: (item: Item | string, stack?: boolean) => void; /** * 删除元素 * @param {Item} item 元素id或元素实例 * @param {boolean} stack 本次操作是否入栈,默认为 true */ remove: (item: Item | string, stack?: boolean) => void; /** * 新增元素 * @param {string} type 元素类型(node | edge) * @param {ModelConfig} model 元素数据模型 * @param {boolean} stack 本次操作是否入栈,默认为 true * @return {Item} 元素实例 */ addItem: (type: ITEM_TYPE, model: ModelConfig, stack?: boolean) => Item; add: (type: ITEM_TYPE, model: ModelConfig, stack?: boolean) => Item; /** * 更新元素 * @param {Item} item 元素id或元素实例 * @param {EdgeConfig | NodeConfig} cfg 需要更新的数据 * @param {boolean} stack 本次操作是否入栈,默认为 true */ updateItem: ( item: Item | string, cfg: Partial | EdgeConfig, stack?: boolean, ) => void; update: ( item: Item | string, cfg: Partial | EdgeConfig, stack?: boolean, ) => void; /** * 更新 Combo 结构,例如移动子树等 * @param {string | INode | ICombo} item 需要被更新的 Combo 或 节点 id * @param {string | undefined} parentId 新的父 combo id,undefined 代表没有父 combo */ updateComboTree: ( item: string | INode | ICombo, parentId?: string | undefined, stack?: boolean, ) => void; /** * 解散 combo * @param {String | ICombo} item 需要被解散的 Combo item 或 id */ uncombo: (item: string | ICombo) => void; /** * 根据已经存在的节点或 combo 创建新的 combo * @param combo combo ID 或 Combo 配置 * @param elements 添加到 Combo 中的元素,包括节点和 combo */ createCombo: (combo: string | ComboConfig, elements: string[]) => void; /** * 设置元素状态 * @param {Item} item 元素id或元素实例 * @param {string} state 状态名称 * @param {boolean} value 是否启用状态或状态值 */ setItemState: ( item: Item | string, state: string, value: string | boolean, ) => void; /** * 将指定状态的优先级提升为最高优先级 * @param {Item} item 元素id或元素实例 * @param state 状态名称 */ priorityState: (item: Item | string, state: string) => void; /** * 设置视图初始化数据 * @param {GraphData} data 初始化数据 */ data: (data?: GraphData | TreeGraphData) => void; /** * 当源数据在外部发生变更时,根据新数据刷新视图。但是不刷新节点位置 */ refresh: () => void; /** * 根据 graph 上的 animateCfg 进行视图中节点位置动画接口 */ positionsAnimate: () => void; /** * 当节点位置在外部发生改变时,刷新所有节点位置,重计算边 */ refreshPositions: () => void; /** * 根据data接口的数据渲染视图 */ render: () => void; /** * 获取当前图中所有节点的item实例 */ getNodes: () => INode[]; /** * 获取当前图中所有边的item实例 */ getEdges: () => IEdge[]; /** * 获取当前图中所有 combo 的实例 */ getCombos: () => ICombo[]; /** * 获取节点所有的邻居节点,有向图中效果同无向图 * * @param {(string | INode)} node 节点 ID 或实例 * @returns {INode[]} * @memberof IAbstractGraph */ getNeighbors: ( node: string | INode, type?: "source" | "target" | undefined, ) => INode[]; /** * 获取 node 的度数 * * @param {(string | INode)} node 节点 ID 或实例 * @param {('in' | 'out' | 'total' | 'all' | undefined)} 度数类型,in 入度,out 出度,total 总度数,all 返回三种类型度数的对象 * @returns {Number | Object} 该节点的度数 * @memberof IAbstractGraph */ getNodeDegree: ( node: string | INode, type?: "in" | "out" | "total" | "all" | undefined, refresh?: boolean, ) => Number | Object; /** * 获取指定 combo 中所有的节点 * @param comboId Combo ID 或 combo 实例 */ getComboChildren: (combo: string | ICombo) => { nodes: INode[]; combos: ICombo[]; }; /** * 获取当前视口伸缩比例 * @return {number} 比例 */ getZoom: () => number; /** * 获取当前的行为模式 */ getCurrentMode: () => string; /** * 切换行为模式 * @param {string} mode 指定模式 */ setMode: (mode: string) => Graph; isAnimating: () => boolean; stopAnimate: () => void; /** * 新增行为 * @param {string | ModeOption | ModeType[]} behaviors 添加的行为 * @param {string | string[]} modes 添加到对应的模式 * @return {Graph} Graph */ addBehaviors: ( behaviors: string | ModeOption | ModeType[], modes: string | string[], ) => Graph; /** * 移除行为 * @param {string | ModeOption | ModeType[]} behaviors 移除的行为 * @param {string | string[]} modes 从指定的模式中移除 * @return {Graph} Graph */ removeBehaviors: ( behaviors: string | ModeOption | ModeType[], modes: string | string[], ) => Graph; /** * 更新行为参数 * @param {string} behavior 需要更新的行为 * @param {object} newCfg 需要更新的参数 * @param {string} mode 指定的模式中的行为,不指定则为 default * @return {Graph} Graph */ updateBehavior: (behavior: string, newCfg: object, mode?: string) => Graph; /** * 清除画布元素 */ clear: (avoidEmit?: boolean) => Graph; /** * 接收数据进行渲染 * @Param {GraphData} data 初始化数据 */ read: (data: GraphData) => void; /** * 更改源数据,根据新数据重新渲染视图 * @param {GraphData | TreeGraphData} data 源数据 * @param {boolean} 是否入栈,默认为true * @return {object} this */ changeData: (data?: GraphData | TreeGraphData, stack?: boolean) => Graph; /** * 导出图数据 * @return {GraphData} data */ save: () => TreeGraphData | GraphData; /** * 改变画布大小 * @param {number} width 画布宽度 * @param {number} height 画布高度 * @return {Graph} this */ changeSize: (width: number, height: number) => Graph; /** * 清理元素多个状态 * @param {string|Item} item 元素id或元素实例 * @param {string | string[]} states 状态 */ clearItemStates: (item: Item | string, states?: string | string[]) => void; /** * 设置各个节点样式,以及在各种状态下节点 keyShape 的样式。 * 若是自定义节点切在各种状态下 * graph.node(node => { * return { * { * type: 'rect', * label: node.id, * style: { fill: '#666' }, * stateStyles: { * selected: { fill: 'blue' }, * custom: { fill: 'green' } * } * } * } * }); * @param {function} nodeFn 指定每个节点样式 */ node: (nodeFn: (config: NodeConfig) => Partial) => void; /** * 设置各个边样式 * @param {function} edgeFn 指定每个边的样式,用法同 node */ edge: (edgeFn: (config: EdgeConfig) => Partial) => void; /** * 设置每个 combo 的配置 * @param comboFn 指定每个 combo 的配置 */ combo: (comboFn: (config: ComboConfig) => Partial) => void; /** * 平移画布到某点 * @param {number} x 水平坐标 * @param {number} y 垂直坐标 */ moveTo: (x: number, y: number) => void; /** * 根据对应规则查找单个元素 * @param {ITEM_TYPE} type 元素类型(node | edge | group) * @param {(item: T, index: number) => T} fn 指定规则 * @return {T} 元素实例 */ find: ( type: ITEM_TYPE, fn: (item: T, index?: number) => boolean, ) => T | undefined; /** * 查找所有满足规则的元素 * @param {string} type 元素类型(node|edge) * @param {string} fn 指定规则 * @return {array} 元素实例 */ findAll: ( type: ITEM_TYPE, fn: (item: T, index?: number) => boolean, ) => T[]; /** * 查找所有处于指定状态的元素 * @param {string} type 元素类型(node|edge) * @param {string} state z状态 * @return {object} 元素实例 */ findAllByState: (type: ITEM_TYPE, state: string) => T[]; /** * 更换布局配置项 * @param {object} cfg 新布局配置项 * 若 cfg 含有 type 字段或为 String 类型,且与现有布局方法不同,则更换布局 * 若 cfg 不包括 type ,则保持原有布局方法,仅更新布局配置项 */ updateLayout: (cfg: LayoutConfig) => void; /** * 重新以当前示例中配置的属性进行一次布局 */ layout: () => void; /** * 收起指定的 Combo * @param comboId combo ID 或 combo 实例 */ collapseCombo: (combo: string | ICombo) => void; /** * 展开指定的 Combo * @param combo combo ID 或 combo 实例 */ expandCombo: (combo: string | ICombo) => void; /** * 展开或收缩指定的 Combo * @param comboId combo ID 或 combo 实例 */ collapseExpandCombo: (combo: string | ICombo) => void; /** * 根据节点的 bbox 更新所有 combos 的绘制,包括 combos 的位置和范围 */ updateCombos: () => void; /** * 获取 undo stack */ getUndoStack: () => Stack; /** * 获取 redo stack */ getRedoStack: () => Stack; /** * 获取 undo 和 redo 栈的数据 */ getStackData: () => { undoStack: StackData[]; redoStack: StackData[]; }; /** * 清空 undo stack & redo stack */ clearStack: () => void; /** * 将操作类型和操作数据入栈 * @param action 操作类型 * @param data 入栈的数据 * @param stackType 入栈的类型 */ pushStack: ( action?: string, data?: unknown, stackType?: "redo" | "undo", ) => void; /** * 根据节点的 bbox 更新 combo 及其祖先 combos 的绘制,包括 combos 的位置和范围 * @param combo 需要更新的 combo */ updateCombo: (combo: string | ICombo) => void; /** * 获取邻接矩阵 * * @param {boolean} cache 是否使用缓存的 * @param {boolean} directed 是否是有向图,默认取 graph.directed * @returns {Matrix} 邻接矩阵 * @memberof IAbstractGraph */ getAdjMatrix: (cache: boolean, directed?: boolean) => Number | Object; /** * 获取最短路径矩阵 * * @param {boolean} cache 是否使用缓存的 * @param {boolean} directed 是否是有向图,默认取 graph.directed * @returns {Matrix} 最短路径矩阵 * @memberof IAbstractGraph */ getShortestPathMatrix: ( cache: boolean, directed?: boolean, ) => Number | Object; /** * 创建凸包或凹包轮廓 * @param cfg HullCfg 轮廓配置项 */ createHull: (cfg: HullCfg) => void; /** * 获取当前 graph 中存在的包裹轮廓 * @return {[key: string]: Hull} Hull 的 map,hullId 对应的 hull 实例 */ getHulls: () => { [key: string]: Hull }; /** * 根据 hullId 获取对应的 hull * @return Hull */ getHullById: (hullId: string) => Hull; /** * 根据 hullId 删除 Hull */ removeHull: (hull: Hull | string) => void; /** * 删除所有 Hulls */ removeHulls: () => void; /** * 重新定义监听函数,复写参数类型 */ on: ( eventName: string, callback: (e: T) => void, once?: boolean, ) => this; /** * 销毁画布 */ destroy: () => void; /** * 每一帧回调 */ onTick: (timestamp: number) => void; } ================================================ FILE: packages/core/src/interface/index.ts ================================================ export * from "./graph"; export * from "./behavior"; export * from "./item"; export * from "./shape"; ================================================ FILE: packages/core/src/interface/item.ts ================================================ /* eslint @typescript-eslint/no-use-before-define: 0 */ import { IGroup, Point } from "@antv/g-base"; import { IBBox, IPoint, IShapeBase, Item, ModelConfig, NodeConfig, EdgeConfig, ModelStyle, ShapeStyle, Indexable, ComboConfig, ITEM_TYPE, TreeGraphData, } from "../types"; // item 的配置项 export type IItemBaseConfig = Partial<{ /** * id */ id: string; /** * 类型 */ type: "item" | "node" | "edge" | "combo" | "vedge"; /** * data model */ model: ModelConfig; /** * G Group */ group: IGroup; /** * is open animate */ animate: boolean; /** * visible - not group visible */ visible: boolean; /** * locked - lock node */ locked: boolean; /** * capture event */ event: boolean; /** * key shape to calculate item's bbox */ keyShape: IShapeBase; /** * item's states, such as selected or active * @type Array */ states: string[]; /** * Item 的样式 */ styles: ModelStyle; source: string | Item; target: string | Item; linkCenter: boolean; }> & Indexable; export interface IItemBase { _cfg: IItemBaseConfig | null; destroyed: boolean; isItem: () => boolean; setOriginStyle: () => void; getShapeStyleByName: (name?: string) => ShapeStyle; /** * 获取当前元素的所有状态 * @return {Array} 元素的所有状态 */ getStates: () => string[]; /** * 当前元素是否处于某状态 * @param {String} state 状态名 * @return {Boolean} 是否处于某状态 */ hasState: (state: string) => boolean; getStateStyle: (state: string) => ShapeStyle; getOriginStyle: () => ShapeStyle; getCurrentStatesStyle: () => ShapeStyle; /** * 更改元素状态, visible 不属于这个范畴 * @internal 仅提供内部类 graph 使用 * @param {String} state 状态名 * @param {Boolean} value 节点状态值 */ setState: (state: string, value: string | boolean) => void; clearStates: (states?: string | string[]) => void; /** * 节点的图形容器 * @return {G.Group} 图形容器 */ getContainer: () => IGroup; /** * 节点的关键形状,用于计算节点大小,连线截距等 * @return {IShapeBase} 关键形状 */ getKeyShape: () => IShapeBase; /** * 节点 / 边 / Combo 的数据模型 * @return {Object} 数据模型 */ getModel: () => NodeConfig | EdgeConfig | ComboConfig | TreeGraphData; /** * 节点类型 * @return {string} 节点的类型 */ getType: () => ITEM_TYPE; /** * 获取 Item 的ID */ getID: () => string; getShapeCfg: (model: ModelConfig) => ModelConfig; /** * 刷新一般用于处理几种情况 * 1. item model 在外部被改变 * 2. 边的节点位置发生改变,需要重新计算边 * * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新 */ refresh: () => void; /** * 将更新应用到 model 上,刷新属性 * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口 * @param {Object} cfg 配置项,可以是增量信息 * @param {boolean} onlyMove 是否仅移动,只有 node 和 combo 可能是 true */ update: (cfg: ModelConfig, onlyMove?: boolean) => void; /** * 更新元素内容,样式 */ updateShape: () => void; /** * 更新位置,避免整体重绘 * @param {object} cfg 待更新数据 */ updatePosition: (cfg: Point) => boolean; /** * 绘制元素 */ draw: () => void; /** * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内 */ getBBox: () => IBBox; /** * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内 */ getCanvasBBox: () => IBBox; /** * 将元素放到最前面 */ toFront: () => void; /** * 将元素放到最后面 */ toBack: () => void; /** * 显示元素 */ show: () => void; /** * 隐藏元素 */ hide: () => void; /** * 更改是否显示 * @param {Boolean} visible 是否显示 */ changeVisibility: (visible: boolean) => void; /** * 是否捕获及触发该元素的交互事件 * @param {Boolean} enable 标识位 */ enableCapture: (enable: boolean) => void; isVisible: () => boolean; isOnlyMove: (cfg: ModelConfig) => boolean; get: (key: string) => T; set: (key: string, value: T) => void; destroy: () => void; } export interface IEdge extends IItemBase { setSource: (source: INode | ICombo) => void; setTarget: (target: INode | ICombo) => void; getSource: () => INode | ICombo; getTarget: () => INode | ICombo; } export interface INode extends IItemBase { /** * 获取从节点关联的所有边 * @return {Array} 边的集合 */ getEdges: () => IEdge[]; /** * 获取引入节点的边 target == this * @return {Array} 边的集合 */ getInEdges: () => IEdge[]; /** * 获取从节点引出的边 source == this * @return {Array} 边的集合 */ getOutEdges: () => IEdge[]; /** * 根据锚点的索引获取连接点 * @param {Number} index 索引 * @return {Object} 连接点 {x,y} */ getLinkPointByAnchor: (index: number) => IPoint; /** * 获取连接点 * @param {Object} point 节点外面的一个点,用于计算交点、最近的锚点 * @return {Object} 连接点 {x,y} */ getLinkPoint: (point: IPoint) => IPoint | null; /** * 添加边 * @param {Edge} edge 边 */ addEdge: (edge: IEdge) => void; /** * 移除边 * @param {Edge} edge 边 */ removeEdge: (edge: IEdge) => void; /** * 获取锚点的定义 * @return {array} anchorPoints, {x,y,...cfg} */ getAnchorPoints: () => IPoint[] | number[][]; hasLocked: () => boolean; lock: () => void; unlock: () => void; /** * 获取节点所有的邻居节点 * * @returns {INode[]} * @memberof INode */ getNeighbors: (type?: "source" | "target" | undefined) => INode[]; } export interface ICombo extends INode { /** * 获取 Combo 中所有的子元素,包括 Combo、Node 及 Edge */ getChildren: () => { nodes: INode[]; combos: ICombo[] }; /** * 获取 Combo 中所有节点 */ getNodes: () => INode[]; /** * 获取 Combo 中所有子 combo */ getCombos: () => INode[]; /** * 向 Combo 中增加 combo * @param item 节点或 combo 的 Item 实例 * @return boolean 添加成功返回 true,否则返回 false */ addChild: (item: INode | ICombo) => boolean; /** * 向 Combo 中增加 combo * @param combo Combo 实例 * @return boolean 添加成功返回 true,否则返回 false */ addCombo: (combo: ICombo) => boolean; /** * 向 Combo 中添加节点 * @param node 节点实例 * @return boolean 添加成功返回 true,否则返回 false */ addNode: (node: string | INode) => boolean; /** * 从 Combo 中移除子元素 * @param item Combo 或 Node 实例 * @return boolean 添加成功返回 true,否则返回 false */ removeChild: (item: ICombo | INode) => boolean; /** * 从 Combo 中移除指定的 combo * @param combo Combo 实例 * @return boolean 移除成功返回 true,否则返回 false */ removeCombo: (combo: ICombo) => boolean; /** * 向 Combo 中移除指定的节点 * @param node 节点实例 * @return boolean 移除成功返回 true,否则返回 false */ removeNode: (node: INode) => boolean; } ================================================ FILE: packages/core/src/interface/shape.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { IPoint, Item, LabelStyle, ModelConfig } from "../types"; export type ILabelConfig = Partial<{ position: string; offset: number; refX: number; refY: number; autoRotate: boolean; style: LabelStyle; }>; export type ShapeDefine = string | ((cfg: ModelConfig) => string); export type ShapeOptions = Partial<{ options: ModelConfig; /** * 形状的类型,例如 circle,ellipse,polyline... */ type: string; itemType: string; shapeType: string; labelPosition: string; labelAutoRotate: boolean; jsx: ShapeDefine; [key: string]: any; /** * 绘制 */ draw: (cfg?: ModelConfig, group?: IGroup) => IShape; getCustomConfig: (cfg: ModelConfig) => ModelConfig; drawShape: (cfg?: ModelConfig, group?: IGroup) => IShape; drawLabel: (cfg: ModelConfig, group: IGroup) => IShape; getLabelStyleByPosition: ( cfg: ModelConfig, labelCfg: ILabelConfig, group?: IGroup, ) => LabelStyle; getLabelStyle: ( cfg: ModelConfig, labelCfg: ILabelConfig, group: IGroup, ) => LabelStyle; /** * 绘制完成后的操作,便于用户继承现有的节点、边 */ afterDraw: (cfg?: ModelConfig, group?: IGroup, rst?: IShape) => void; afterUpdate: (cfg?: ModelConfig, item?: Item) => void; /** * 设置节点、边状态 */ setState: (name?: string, value?: string | boolean, item?: Item) => void; /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getControlPoints: (cfg: ModelConfig) => IPoint[] | undefined; /** * 获取控制点 * @param {Object} cfg 节点、边的配置项 * @return {Array|null} 控制点的数组,如果为 null,则没有控制点 */ getAnchorPoints: (cfg?: ModelConfig) => number[][] | undefined; // 如果没定义 update 方法,每次都调用 draw 方法 update: (cfg: ModelConfig, item: Item) => void; // 获取节点的大小,只对节点起效 getSize: (cfg: ModelConfig) => number[]; // 获取路径 // getPath: (cfg?: ModelConfig) => Array> // getPath: (points?: Point[]) => Array> // getPath: (points: Point[], routeCfg) => Array> | string // getPath: (...args: Point[] | object[] | ModelConfig[]) => Array> | string // 获取文本对齐方式,只对边起效 _getTextAlign: (labelPosition: string, angle: number) => string; /** * @internal 处理需要重计算点和边的情况 * @param {Object} cfg 边的配置项 * @return {Object} 边的配置项 */ getPathPoints: (cfg: ModelConfig) => ModelConfig; // [key: string]: (...args: string[] | number[] | object[] | ModelConfig[]) => unknown }>; ================================================ FILE: packages/core/src/item/combo.ts ================================================ import { IGroup } from "@antv/g-base"; import { ICombo, INode, IItemBaseConfig } from "../interface/item"; import Node from "./node"; import { ComboConfig, IBBox, IShapeBase, ModelConfig } from "../types"; import Global from "../global"; import { getBBox } from "../util/graphic"; import { isNumber } from "@antv/util"; const CACHE_BBOX = "bboxCache"; const CACHE_CANVAS_BBOX = "bboxCanvasCache"; const CACHE_SIZE = "sizeCache"; const CACHE_ANCHOR_POINTS = "anchorPointsCache"; export default class Combo extends Node implements ICombo { public getDefaultCfg() { return { type: "combo", nodes: [], edges: [], combos: [], }; } public getShapeCfg(model: ModelConfig): ModelConfig { const styles = this.get("styles"); const bbox = this.get("bbox"); if (styles && bbox) { // merge graph的item样式与数据模型中的样式 const newModel = model; const size = { r: Math.hypot(bbox.height, bbox.width) / 2 || Global.defaultCombo.size[0] / 2, width: bbox.width || Global.defaultCombo.size[0], height: bbox.height || Global.defaultCombo.size[1], }; newModel.style = { ...styles, ...model.style, ...size }; const padding = model.padding || Global.defaultCombo.padding; if (isNumber(padding)) { size.r += padding; size.width += padding * 2; size.height += padding * 2; } else { size.r += padding[0]; size.width += padding[1] + padding[3] || padding[1] * 2; size.height += padding[0] + padding[2] || padding[0] * 2; } this.set(CACHE_SIZE, size); return newModel; } return model; } /** * 根据 keyshape 计算包围盒 */ public calculateCanvasBBox(): IBBox { if (this.destroyed) return; const keyShape: IShapeBase = this.get("keyShape"); const group: IGroup = this.get("group"); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒 const bbox = getBBox(keyShape, group); bbox.centerX = (bbox.minX + bbox.maxX) / 2; bbox.centerY = (bbox.minY + bbox.maxY) / 2; const cacheSize = this.get(CACHE_SIZE); const cacheBBox = this.get(CACHE_BBOX) || {}; const oriX = cacheBBox.x; const oriY = cacheBBox.x; if (cacheSize) { cacheSize.width = Math.max(cacheSize.width, bbox.width); cacheSize.height = Math.max(cacheSize.height, bbox.height); const type: string = keyShape.get("type"); if (type === "circle") { bbox.width = cacheSize.r * 2; bbox.height = cacheSize.r * 2; } else { bbox.width = cacheSize.width; bbox.height = cacheSize.height; } bbox.minX = bbox.centerX - bbox.width / 2; bbox.minY = bbox.centerY - bbox.height / 2; bbox.maxX = bbox.centerX + bbox.width / 2; bbox.maxY = bbox.centerY + bbox.height / 2; } else { bbox.width = bbox.maxX - bbox.minX; bbox.height = bbox.maxY - bbox.minY; bbox.centerX = (bbox.minX + bbox.maxX) / 2; bbox.centerY = (bbox.minY + bbox.maxY) / 2; } bbox.x = bbox.minX; bbox.y = bbox.minY; if (bbox.x !== oriX || bbox.y !== oriY) this.set(CACHE_ANCHOR_POINTS, null); return bbox; } /** * 获取 Combo 中所有的子元素,包括 Combo、Node 及 Edge */ public getChildren(): { nodes: INode[]; combos: ICombo[] } { const self = this; return { nodes: self.getNodes(), combos: self.getCombos(), }; } /** * 获取 Combo 中所有子节点 */ getNodes(): INode[] { const self = this; return self.get("nodes"); } /** * 获取 Combo 中所有子 combo */ getCombos(): ICombo[] { const self = this; return self.get("combos"); } /** * 向 Combo 中增加子 combo 或 node * @param item Combo 或节点实例 * @return boolean 添加成功返回 true,否则返回 false */ addChild(item: ICombo | INode): boolean { const self = this; const itemType = item.getType(); switch (itemType) { case "node": self.addNode(item); break; case "combo": self.addCombo(item as ICombo); break; default: console.warn( "Only node or combo items are allowed to be added into a combo", ); return false; } return true; } /** * 向 Combo 中增加 combo * @param combo Combo 实例 * @return boolean 添加成功返回 true,否则返回 false */ addCombo(combo: ICombo): boolean { const self = this; self.get("combos").push(combo); return true; } /** * 向 Combo 中添加节点 * @param node 节点实例 * @return boolean 添加成功返回 true,否则返回 false */ addNode(node: string | INode): boolean { const self = this; self.get("nodes").push(node); return true; } /** * 向 Combo 中增加子 combo 或 node * @param item Combo 或节点实例 * @return boolean 添加成功返回 true,否则返回 false */ removeChild(item: ICombo | INode): boolean { const self = this; const itemType = item.getType(); switch (itemType) { case "node": self.removeNode(item); break; case "combo": self.removeCombo(item as ICombo); break; default: console.warn( "Only node or combo items are allowed to be added into a combo", ); return false; } return true; } /** * 从 Combo 中移除指定的 combo * @param combo Combo 实例 * @return boolean 移除成功返回 true,否则返回 false */ removeCombo(combo: ICombo): boolean { if (!combo) return; const combos = this.getCombos(); const index = combos.indexOf(combo); if (index > -1) { combos.splice(index, 1); return true; } return false; } /** * 向 Combo 中移除指定的节点 * @param node 节点实例 * @return boolean 移除成功返回 true,否则返回 false */ removeNode(node: INode): boolean { if (!node) return; const nodes = this.getNodes(); const index = nodes.indexOf(node); if (index > -1) { nodes.splice(index, 1); return true; } return false; } public isOnlyMove(cfg?: any): boolean { return false; } /** * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内 * @return {Object} 包含 x,y,width,height, centerX, centerY */ public getBBox(): IBBox { this.set(CACHE_CANVAS_BBOX, null); const bbox: IBBox = this.calculateCanvasBBox(); return bbox; } public clearCache() { this.set(CACHE_BBOX, null); // 清理缓存的 bbox this.set(CACHE_CANVAS_BBOX, null); this.set(CACHE_ANCHOR_POINTS, null); } public destroy() { if (!this.destroyed) { const animate = this.get("animate"); const group: IGroup = this.get("group"); if (animate) { group.stopAnimate(); } this.clearCache(); this.set(CACHE_SIZE, null); this.set("bbox", null); group.remove(); (this._cfg as IItemBaseConfig | null) = null; this.destroyed = true; } } } ================================================ FILE: packages/core/src/item/edge.ts ================================================ import { isString, isPlainObject, isNil, mix } from "@antv/util"; import { IEdge, INode, ICombo } from "../interface/item"; import { EdgeConfig, IPoint, NodeConfig, SourceTarget, Indexable, } from "../types"; import Item from "./item"; import Node from "./node"; const END_MAP: Indexable = { source: "start", target: "end" }; const ITEM_NAME_SUFFIX = "Node"; // 端点的后缀,如 sourceNode, targetNode const POINT_NAME_SUFFIX = "Point"; // 起点或者结束点的后缀,如 startPoint, endPoint const ANCHOR_NAME_SUFFIX = "Anchor"; export default class Edge extends Item implements IEdge { protected getDefaultCfg() { return { type: "edge", sourceNode: null, targetNode: null, startPoint: null, endPoint: null, linkCenter: false, }; } private setEnd(name: SourceTarget, value: INode) { const pointName = END_MAP[name] + POINT_NAME_SUFFIX; const itemName = name + ITEM_NAME_SUFFIX; const preItem = this.get(itemName); if (preItem && !preItem.destroyed) { // 如果之前存在节点,则移除掉边 preItem.removeEdge(this); } if (isPlainObject(value)) { // 如果设置成具体的点,则清理节点 this.set(pointName, value); this.set(itemName, null); } else { (value as any).addEdge(this); this.set(itemName, value); this.set(pointName, null); } } /** * 获取连接点的坐标 * @param name source | target * @param model 边的数据模型 * @param controlPoints 控制点 */ private getLinkPoint( name: SourceTarget, model: EdgeConfig, controlPoints: IPoint[], ): IPoint { const pointName = END_MAP[name] + POINT_NAME_SUFFIX; const itemName = name + ITEM_NAME_SUFFIX; let point = this.get(pointName); if (!point) { const item = this.get(itemName); const anchorName = name + ANCHOR_NAME_SUFFIX; const prePoint = this.getPrePoint(name, controlPoints); const anchorIndex = model[anchorName]; if (!isNil(anchorIndex)) { // 如果有锚点,则使用锚点索引获取连接点 point = item.getLinkPointByAnchor(anchorIndex); } // 如果锚点没有对应的点或者没有锚点,则直接计算连接点 point = point || item.getLinkPoint(prePoint); if (!isNil(point.index)) { this.set(`${name}AnchorIndex`, point.index); } } return point; } /** * 获取同端点进行连接的点,计算交汇点 * @param name * @param controlPoints */ private getPrePoint( name: SourceTarget, controlPoints: IPoint[], ): NodeConfig | IPoint { if (controlPoints && controlPoints.length) { const index = name === "source" ? 0 : controlPoints.length - 1; return controlPoints[index]; } const oppositeName = name === "source" ? "target" : "source"; // 取另一个节点的位置 return this.getEndPoint(oppositeName); } /** * 获取端点的位置 * @param name */ private getEndPoint(name: SourceTarget): NodeConfig | IPoint { const itemName = name + ITEM_NAME_SUFFIX; const pointName = END_MAP[name] + POINT_NAME_SUFFIX; const item = this.get(itemName); // 如果有端点,直接使用 model if (item) { return item.get("model"); } // 否则直接使用点 return this.get(pointName); } /** * 通过端点的中心获取控制点 * @param model */ private getControlPointsByCenter(model: EdgeConfig) { const sourcePoint = this.getEndPoint("source"); const targetPoint = this.getEndPoint("target"); const shapeFactory = this.get("shapeFactory"); const type = model.type; return shapeFactory.getControlPoints(type, { startPoint: sourcePoint, endPoint: targetPoint, }); } private getEndCenter(name: SourceTarget): IPoint { const itemName = name + ITEM_NAME_SUFFIX; const pointName = END_MAP[name] + POINT_NAME_SUFFIX; const item = this.get(itemName); // 如果有端点,直接使用 model if (item) { const bbox = item.getBBox(); return { x: bbox.centerX, y: bbox.centerY, }; } // 否则直接使用点 return this.get(pointName); } protected init() { super.init(); // 初始化两个端点 this.setSource(this.get("source")); this.setTarget(this.get("target")); } public getShapeCfg(model: EdgeConfig): EdgeConfig { const self = this; const linkCenter: boolean = self.get("linkCenter"); // 如果连接到中心,忽视锚点、忽视控制点 const cfg = super.getShapeCfg(model) as EdgeConfig; if (linkCenter) { cfg.startPoint = self.getEndCenter("source"); cfg.endPoint = self.getEndCenter("target"); } else { const controlPoints = cfg.controlPoints || self.getControlPointsByCenter(cfg); cfg.startPoint = self.getLinkPoint("source", model, controlPoints); cfg.endPoint = self.getLinkPoint("target", model, controlPoints); } cfg.sourceNode = self.get("sourceNode"); cfg.targetNode = self.get("targetNode"); return cfg; } /** * 获取边的数据模型 */ public getModel(): EdgeConfig { const out: EdgeConfig = this.get("model"); const sourceItem = this.get(`source${ITEM_NAME_SUFFIX}`); const targetItem = this.get(`target${ITEM_NAME_SUFFIX}`); if (sourceItem) { delete out[`source${ITEM_NAME_SUFFIX}`]; } else { out.source = this.get(`start${POINT_NAME_SUFFIX}`); } if (targetItem) { delete out[`target${ITEM_NAME_SUFFIX}`]; } else { out.target = this.get(`end${POINT_NAME_SUFFIX}`); } if (!isString(out.source) && !isPlainObject(out.source)) { out.source = (out.source as any).getID(); } if (!isString(out.target) && !isPlainObject(out.target)) { out.target = (out.target as any).getID(); } return out; } public setSource(source: INode | ICombo) { this.setEnd("source", source); this.set("source", source); } public setTarget(target: INode | ICombo) { this.setEnd("target", target); this.set("target", target); } public getSource(): INode | ICombo { return this.get("source"); } public getTarget(): INode | ICombo { return this.get("target"); } public updatePosition() { return false; } /** * 边不需要重计算容器位置,直接重新计算 path 位置 * @param {object} cfg 待更新数据 */ public update(cfg: EdgeConfig, onlyMove: boolean = false) { const model: EdgeConfig = this.get("model"); const oriVisible = model.visible; const cfgVisible = cfg.visible; if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible); const styles = this.get("styles"); if (cfg.stateStyles) { // 更新 item 时更新 this.get('styles') 中的值 const { stateStyles } = cfg; mix(styles, stateStyles); delete cfg.stateStyles; } Object.assign(model, cfg); this.updateShape(); this.afterUpdate(); this.clearCache(); } public destroy() { const sourceItem: Node = this.get(`source${ITEM_NAME_SUFFIX}`); const targetItem: Node = this.get(`target${ITEM_NAME_SUFFIX}`); if (sourceItem && !sourceItem.destroyed) { sourceItem.removeEdge(this); } if (targetItem && !targetItem.destroyed) { targetItem.removeEdge(this); } super.destroy(); } } ================================================ FILE: packages/core/src/item/hull.ts ================================================ import { IGroup } from "@antv/g-base"; import { deepMix, isString } from "@antv/util"; import { parsePathString } from "@antv/path-util"; import { Item, BubblesetCfg, HullCfg } from "../types"; import { pathToPoints, getClosedSpline, roundedHull, paddedHull, } from "../util/path"; import { isPolygonsIntersect } from "../util/math"; import { IAbstractGraph } from "../interface/graph"; import { genConvexHull } from "../element/hull/convexHull"; import { genBubbleSet } from "../element/hull/bubbleset"; /** * 用于包裹内部的成员的轮廓。 * convex hull(凸包):http://geomalgorithms.com/a10-_hull-1.html#Monotone%20Chain * bubble: 使用 bubbleset算法,refer: http://vialab.science.uoit.ca/wp-content/papercite-data/pdf/col2009c.pdf * 通过配置 padding 可以调节包裹轮廓对节点的松紧程度 */ export default class Hull { id: string; graph: IAbstractGraph; cfg: any; path: any[][]; group: IGroup; members: Item[]; nonMembers: Item[]; padding: number; bubbleCfg: Partial; type: string; constructor(graph: IAbstractGraph, cfg: HullCfg) { this.cfg = deepMix(this.getDefaultCfg(), cfg); this.graph = graph; this.id = this.cfg.id; this.group = this.cfg.group; this.members = this.cfg.members.map((item) => isString(item) ? graph.findById(item) : item, ); this.nonMembers = this.cfg.nonMembers.map((item) => isString(item) ? graph.findById(item) : item, ); this.setPadding(); this.setType(); this.path = this.calcPath(this.members, this.nonMembers); this.render(); } public getDefaultCfg(): HullCfg { return { id: "g6-hull", type: "round-convex", // 'round-convex' /'smooth-convex' / 'bubble' members: [], nonMembers: [], style: { fill: "lightblue", stroke: "blue", opacity: 0.2, }, padding: 10, }; } setPadding() { const nodeSize = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2; this.padding = this.cfg.padding > 0 ? this.cfg.padding + nodeSize : 10 + nodeSize; this.cfg.bubbleCfg = { nodeR0: this.padding - nodeSize, nodeR1: this.padding - nodeSize, morphBuffer: this.padding - nodeSize, }; } setType() { this.type = this.cfg.type; if (this.members.length < 3) { this.type = "round-convex"; } if ( this.type !== "round-convex" && this.type !== "smooth-convex" && this.type !== "bubble" ) { console.warn( "The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.", ); this.type = "round-convex"; } } calcPath(members: Item[], nonMembers: Item[]) { let contour, path, hull; switch (this.type) { case "round-convex": contour = genConvexHull(members); hull = roundedHull( contour.map((p) => [p.x, p.y]), this.padding, ); path = parsePathString(hull); break; case "smooth-convex": contour = genConvexHull(members); if (contour.length === 2) { hull = roundedHull( contour.map((p) => [p.x, p.y]), this.padding, ); path = parsePathString(hull); } else if (contour.length > 2) { hull = paddedHull( contour.map((p) => [p.x, p.y]), this.padding, ); path = getClosedSpline(hull); } break; case "bubble": contour = genBubbleSet(members, nonMembers, this.cfg.bubbleCfg); path = contour.length >= 2 && getClosedSpline(contour); break; default: } return path; } render() { this.group.addShape("path", { attrs: { path: this.path, ...this.cfg.style, }, id: this.id, name: this.cfg.id, }); this.group.toBack(); } /** * 增加hull的成员,同时如果该成员原先在nonMembers中,则从nonMembers中去掉 * @param item 节点实例 * @return boolean 添加成功返回 true,否则返回 false */ public addMember(item: Item | string): boolean { if (!item) return; if (isString(item)) item = this.graph.findById(item); this.members.push(item); const index = this.nonMembers.indexOf(item); if (index > -1) { this.nonMembers.splice(index, 1); } this.updateData(this.members, this.nonMembers); return true; } /** * 增加hull需要排除的节点,同时如果该成员原先在members中,则从members中去掉 * @param item 节点实例 * @return boolean 添加成功返回 true,否则返回 false */ public addNonMember(item: Item | string): boolean { if (!item) return; if (isString(item)) item = this.graph.findById(item); this.nonMembers.push(item); const index = this.members.indexOf(item); if (index > -1) { this.members.splice(index, 1); } this.updateData(this.members, this.nonMembers); return true; } /** * 移除hull中的成员 * @param node 节点实例 * @return boolean 移除成功返回 true,否则返回 false */ public removeMember(item: Item | string): boolean { if (!item) return; if (isString(item)) item = this.graph.findById(item); const index = this.members.indexOf(item); if (index > -1) { this.members.splice(index, 1); this.updateData(this.members, this.nonMembers); return true; } return false; } /** * @param node 节点实例 * @return boolean 移除成功返回 true,否则返回 false */ public removeNonMember(item: Item | string): boolean { if (!item) return; if (isString(item)) item = this.graph.findById(item); const index = this.nonMembers.indexOf(item); if (index > -1) { this.nonMembers.splice(index, 1); this.updateData(this.members, this.nonMembers); return true; } return false; } public updateData(members: Item[] | string[], nonMembers: string[] | Item[]) { this.group.findById(this.id).remove(); if (members) this.members = (members as any[]).map((item) => isString(item) ? this.graph.findById(item) : item, ); if (nonMembers) this.nonMembers = (nonMembers as any[]).map((item) => isString(item) ? this.graph.findById(item) : item, ); this.path = this.calcPath(this.members, this.nonMembers); this.render(); } public updateStyle(cfg: HullCfg["style"]) { const path = this.group.findById(this.id); path.attr({ ...cfg, }); } /** * 更新 hull * @param cfg hull 配置项 */ public updateCfg(cfg: Partial) { this.cfg = deepMix(this.cfg, cfg); this.id = this.cfg.id; this.group = this.cfg.group; if (cfg.members) { this.members = this.cfg.members.map((item) => isString(item) ? this.graph.findById(item) : item, ); } if (cfg.nonMembers) { this.nonMembers = this.cfg.nonMembers.map((item) => isString(item) ? this.graph.findById(item) : item, ); } // TODO padding 设置太大,会影响到 contain 结果 this.setPadding(); this.setType(); this.path = this.calcPath(this.members, this.nonMembers); this.render(); } /** * 判断是否在hull内部 * @param item */ public contain(item: Item | string): boolean { let nodeItem: Item; if (isString(item)) { nodeItem = this.graph.findById(item); } else { nodeItem = item; } let shapePoints; const shape = nodeItem.getKeyShape(); if (nodeItem.get("type") === "path") { shapePoints = pathToPoints(shape.attr("path")); } else { const shapeBBox = shape.getCanvasBBox(); shapePoints = [ [shapeBBox.minX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.maxY], [shapeBBox.minX, shapeBBox.maxY], ]; } shapePoints = shapePoints.map((canvasPoint) => { const point = this.graph.getPointByCanvas(canvasPoint[0], canvasPoint[1]); return [point.x, point.y]; }); return isPolygonsIntersect(shapePoints, pathToPoints(this.path)); } public destroy() { this.group.remove(); this.cfg = null; } } ================================================ FILE: packages/core/src/item/item.ts ================================================ import { IGroup } from "@antv/g-base"; import { each, isNil, isPlainObject, isString, isBoolean, mix, deepMix, clone, } from "@antv/util"; import { IItemBase, IItemBaseConfig } from "../interface/item"; import Shape from "../element/shape"; import { IBBox, IPoint, IShapeBase, ModelConfig, ShapeStyle, Indexable, NodeConfig, EdgeConfig, ComboConfig, ITEM_TYPE, } from "../types"; import { getBBox } from "../util/graphic"; import { translate } from "../util/math"; import { uniqueId } from "../util/base"; const CACHE_BBOX = "bboxCache"; const CACHE_CANVAS_BBOX = "bboxCanvasCache"; const ARROWS = ["startArrow", "endArrow"]; export default class ItemBase implements IItemBase { public _cfg: IItemBaseConfig & { [key: string]: unknown; } = {}; public destroyed: boolean = false; constructor(cfg: IItemBaseConfig) { const defaultCfg: IItemBaseConfig = { /** * id * @type {string} */ id: undefined, /** * 类型 * @type {string} */ type: "item", /** * data model * @type {object} */ model: {} as ModelConfig, /** * g group * @type {G.Group} */ group: undefined, /** * is open animate * @type {boolean} */ animate: false, /** * visible - not group visible * @type {boolean} */ visible: true, /** * locked - lock node * @type {boolean} */ locked: false, /** * capture event * @type {boolean} */ event: true, /** * key shape to calculate item's bbox * @type object */ keyShape: undefined, /** * item's states, such as selected or active * @type Array */ states: [], }; this._cfg = Object.assign(defaultCfg, this.getDefaultCfg(), cfg); const model = this.get("model"); let { id } = model; const itemType = this.get("type"); if (!id) { id = uniqueId(itemType); this.get("model").id = id; } this.set("id", id); const { group } = cfg; if (group) { group.set("item", this); group.set("id", id); } this.init(); this.draw(); const shapeType = (model.shape as string) || (model.type as string) || (itemType === "edge" ? "line" : "circle"); const shapeFactory = this.get("shapeFactory"); if (shapeFactory && shapeFactory[shapeType]) { const { options } = shapeFactory[shapeType]; // merge the stateStyles from item and shape if (options && options.stateStyles) { let styles = this.get("styles") || model.stateStyles; styles = deepMix({}, options.stateStyles, styles); this.set("styles", styles); } } } /** * 根据 keyshape 计算包围盒 */ private calculateBBox(): IBBox { const keyShape: IShapeBase = this.get("keyShape"); const group: IGroup = this.get("group"); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒 const bbox = getBBox(keyShape, group); bbox.x = bbox.minX; bbox.y = bbox.minY; bbox.width = bbox.maxX - bbox.minX; bbox.height = bbox.maxY - bbox.minY; bbox.centerX = (bbox.minX + bbox.maxX) / 2; bbox.centerY = (bbox.minY + bbox.maxY) / 2; return bbox; } /** * 根据 keyshape 计算包围盒 */ public calculateCanvasBBox(): IBBox { const keyShape: IShapeBase = this.get("keyShape"); const group: IGroup = this.get("group"); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒 const bbox = getBBox(keyShape, group); bbox.x = bbox.minX; bbox.y = bbox.minY; bbox.width = bbox.maxX - bbox.minX; bbox.height = bbox.maxY - bbox.minY; bbox.centerX = (bbox.minX + bbox.maxX) / 2; bbox.centerY = (bbox.minY + bbox.maxY) / 2; return bbox; } /** * draw shape */ private drawInner() { const self = this; const shapeFactory = self.get("shapeFactory"); const group: IGroup = self.get("group"); const model: ModelConfig = self.get("model"); group.clear(); const visible = model.visible; if (visible !== undefined && !visible) self.changeVisibility(visible); if (!shapeFactory) { return; } self.updatePosition(model); const cfg = self.getShapeCfg(model); // 可能会附加额外信息 const shapeType = cfg.type as string; const keyShape: IShapeBase = shapeFactory.draw(shapeType, cfg, group); if (keyShape) { self.set("keyShape", keyShape); keyShape.set("isKeyShape", true); keyShape.set("draggable", true); } this.setOriginStyle(); // 防止由于用户外部修改 model 中的 shape 导致 shape 不更新 this.set("currentShape", shapeType); this.restoreStates(shapeFactory, shapeType!); } /** * 设置图元素原始样式 * @param keyShape 图元素 keyShape * @param group Group 容器 */ public setOriginStyle() { const group: IGroup = this.get("group"); const children = group.get("children"); const keyShape: IShapeBase = this.getKeyShape(); const self = this; const keyShapeName = keyShape.get("name"); if (!this.get("originStyle")) { // 第一次 set originStyle,直接拿首次渲染所有图形的 attrs const originStyles = {}; each(children, (child) => { const shapeType = child.get("type"); const name = child.get("name"); if (name && name !== keyShapeName) { originStyles[name] = shapeType !== "image" ? clone(child.attr()) : self.getShapeStyleByName(name); } else { // !name || name === keyShape const keyShapeStyle: ShapeStyle = self.getShapeStyleByName(); // 可优化,需要去除 child.attr 中其他 shape 名的对象 if (keyShapeStyle.path) delete keyShapeStyle.path; if (keyShapeStyle.matrix) delete keyShapeStyle.matrix; if (!keyShapeName) { Object.assign(originStyles, keyShapeStyle); } else { // 若 keyShape 有 name 且 !name,这个图形不是 keyShape,给这个图形一个 name if (!name) { const shapeName = uniqueId("shape"); child.set("name", shapeName); originStyles[shapeName] = shapeType !== "image" ? clone(child.attr()) : self.getShapeStyleByName(name); } else originStyles[keyShapeName] = keyShapeStyle; } } }); self.set("originStyle", originStyles); } else { // 第二次 set originStyles,需要找到不是 stateStyles 的样式,更新到 originStyles 中 // 上一次设置的 originStyle,是初始的 shape attrs const styles: ShapeStyle = this.getOriginStyle(); // let styles: ShapeStyle = {}; if (keyShapeName && !styles[keyShapeName]) styles[keyShapeName] = {}; // 获取当前状态样式 const currentStatesStyle = this.getCurrentStatesStyle(); // 遍历当前所有图形的 attrs,找到不是 stateStyles 的样式更新到 originStyles 中 each(children, (child) => { const name = child.get("name"); const shapeAttrs = child.attr(); if (name && name !== keyShapeName) { // 有 name 的非 keyShape 图形 const shapeStateStyle = currentStatesStyle[name]; if (!styles[name]) styles[name] = {}; if (shapeStateStyle) { Object.keys(shapeAttrs).forEach((key) => { const value = shapeAttrs[key]; if (value !== shapeStateStyle[key]) styles[name][key] = value; }); } else { styles[name] = child.get("type") !== "image" ? clone(shapeAttrs) : self.getShapeStyleByName(name); } } else { const shapeAttrs = child.attr(); const keyShapeStateStyles = { ...currentStatesStyle, ...currentStatesStyle[keyShapeName], }; Object.keys(shapeAttrs).forEach((key) => { const value = shapeAttrs[key]; // 如果是对象且不是 arrow,则是其他 shape 的样式 // if (isPlainObject(value) && ARROWS.indexOf(name) === -1) return; if (keyShapeStateStyles[key] !== value) { if (keyShapeName) styles[keyShapeName][key] = value; else styles[key] = value; } }); } }); if (styles.path) delete styles.path; if (styles.matrix) delete styles.matrix; if (styles.x) delete styles.x; if (styles.y) delete styles.y; if (styles[keyShapeName] && styles[keyShapeName].x) delete styles[keyShapeName].x; if (styles[keyShapeName] && styles[keyShapeName].y) delete styles[keyShapeName].y; self.set("originStyle", styles); } } /** * restore shape states * @param shapeFactory * @param shapeType */ private restoreStates(shapeFactory: any, shapeType: string) { const self = this; const states: string[] = self.get("states"); each(states, (state) => { shapeFactory.setState(shapeType, state, true, self); }); } protected init() { const shapeFactory = Shape.getFactory(this.get("type")); this.set("shapeFactory", shapeFactory); } /** * 获取属性 * @internal 仅内部类使用 * @param {String} key 属性名 * @return {object | string | number} 属性值 */ public get(key: string): T { return this._cfg[key] as T; } /** * 设置属性 * @internal 仅内部类使用 * @param {String|Object} key 属性名,也可以是对象 * @param {object | string | number} val 属性值 */ public set(key: string | object, val?: unknown): void { if (isPlainObject(key)) { this._cfg = { ...this._cfg, ...key }; } else { this._cfg[key] = val; } } protected getDefaultCfg() { return {}; } /** * 更新/刷新等操作后,清除 cache */ protected clearCache() { this.set(CACHE_BBOX, null); this.set(CACHE_CANVAS_BBOX, null); } /** * 渲染前的逻辑,提供给子类复写 */ protected beforeDraw() {} /** * 渲染后的逻辑,提供给子类复写 */ protected afterDraw() {} /** * 更新后做一些工作 */ protected afterUpdate() {} /** * draw shape */ public draw() { this.beforeDraw(); this.drawInner(); this.afterDraw(); } public getShapeStyleByName(name?: string): ShapeStyle { const group: IGroup = this.get("group"); let currentShape: IShapeBase; if (name) { currentShape = group.find( (element) => element.get("name") === name, ) as IShapeBase; } else { currentShape = this.getKeyShape(); } if (currentShape) { const styles: ShapeStyle & Indexable = {}; each(currentShape.attr(), (val, key) => { // 修改 img 通过 updateItem 实现 if (key !== "img") { styles[key] = val; } }); return styles; } return {}; } public getShapeCfg(model: ModelConfig): ModelConfig { const styles = this.get("styles"); if (styles) { // merge graph的item样式与数据模型中的样式 const newModel = model; newModel.style = { ...styles, ...model.style }; return newModel; } return model; } /** * 获取指定状态的样式,去除了全局样式 * @param state 状态名称 */ public getStateStyle(state: string) { const styles = this.get("styles"); const stateStyle = styles && styles[state]; return stateStyle; } /** * get keyshape style */ public getOriginStyle(): ShapeStyle { return this.get("originStyle"); } public getCurrentStatesStyle(): ShapeStyle { const self = this; let styles = {}; const states = self.getStates(); if (!states || !states.length) { return this.getOriginStyle(); } each(self.getStates(), (state) => { styles = Object.assign(styles, self.getStateStyle(state)); }); return styles; } /** * 更改元素状态, visible 不属于这个范畴 * @internal 仅提供内部类 graph 使用 * @param {String} state 状态名 * @param {Boolean} value 节点状态值 */ public setState(state: string, value: string | boolean) { const states: string[] = this.get("states"); const shapeFactory = this.get("shapeFactory"); let stateName = state; let filterStateName = state; if (isString(value)) { stateName = `${state}:${value}`; filterStateName = `${state}:`; } let newStates = states; if (isBoolean(value)) { const index = states.indexOf(filterStateName); if (value) { if (index > -1) { return; } states.push(stateName); } else if (index > -1) { states.splice(index, 1); } } else if (isString(value)) { // 过滤掉 states 中 filterStateName 相关的状态 const filterStates = states.filter((name) => name.includes(filterStateName), ); if (filterStates.length > 0) { this.clearStates(filterStates); } newStates = newStates.filter((name) => !name.includes(filterStateName)); newStates.push(stateName); this.set("states", newStates); } if (shapeFactory) { const model: ModelConfig = this.get("model"); const type = model.type; // 调用 shape/shape.ts 中的 setState shapeFactory.setState(type, state, value, this); } } /** * 清除指定的状态,如果参数为空,则不做任务处理 * @param states 状态名称 */ public clearStates(states?: string | string[]) { const self = this; const originStates = self.getStates(); const shapeFactory = self.get("shapeFactory"); const model: ModelConfig = self.get("model"); const shape = model.type; if (!states) { states = originStates; } if (isString(states)) { states = [states]; } const newStates = originStates.filter( (state) => states.indexOf(state) === -1, ); self.set("states", newStates); states.forEach((state) => { shapeFactory.setState(shape, state, false, self); }); } /** * 节点的图形容器 * @return {G.Group} 图形容器 */ public getContainer(): IGroup { return this.get("group"); } /** * 节点的关键形状,用于计算节点大小,连线截距等 * @return {IShapeBase} 关键形状 */ public getKeyShape(): IShapeBase { return this.get("keyShape"); } /** * 节点数据模型 * @return {Object} 数据模型 */ public getModel(): NodeConfig | EdgeConfig | ComboConfig { return this.get("model"); } /** * 节点类型 * @return {string} 节点的类型 */ public getType(): ITEM_TYPE { return this.get("type"); } /** * 获取 Item 的ID */ public getID(): string { return this.get("id"); } /** * 是否是 Item 对象,悬空边情况下进行判定 */ public isItem(): boolean { return true; } /** * 获取当前元素的所有状态 * @return {Array} 元素的所有状态 */ public getStates(): string[] { return this.get("states"); } /** * 当前元素是否处于某状态 * @param {String} state 状态名 * @return {Boolean} 是否处于某状态 */ public hasState(state: string): boolean { const states = this.getStates(); return states.indexOf(state) >= 0; } /** * 刷新一般用于处理几种情况 * 1. item model 在外部被改变 * 2. 边的节点位置发生改变,需要重新计算边 * * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新 */ public refresh() { const model: ModelConfig = this.get("model"); // 更新元素位置 this.updatePosition(model); // 更新元素内容,样式 this.updateShape(); // 做一些更新之后的操作 this.afterUpdate(); // 清除缓存 this.clearCache(); } public isOnlyMove(cfg?: ModelConfig): boolean { return false; } /** * 将更新应用到 model 上,刷新属性 * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口 * @param {Object} cfg 配置项,可以是增量信息 */ public update(cfg: ModelConfig, onlyMove: boolean = false) { const model: ModelConfig = this.get("model"); const oriVisible = model.visible; const cfgVisible = cfg.visible; if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible); const originPosition: IPoint = { x: model.x!, y: model.y! }; cfg.x = isNaN(cfg.x) ? model.x : cfg.x; cfg.y = isNaN(cfg.y) ? model.y : cfg.y; const styles = this.get("styles"); if (cfg.stateStyles) { // 更新 item 时更新 this.get('styles') 中的值 const { stateStyles } = cfg; mix(styles, stateStyles); delete cfg.stateStyles; } // 直接将更新合到原数据模型上,可以保证用户在外部修改源数据然后刷新时的样式符合期待。 Object.assign(model, cfg); // isOnlyMove 仅用于node // const onlyMove = this.isOnlyMove(cfg); // 仅仅移动位置时,既不更新,也不重绘 if (onlyMove) { this.updatePosition(cfg); } else { // 如果 x,y 有变化,先重置位置 if (originPosition.x !== cfg.x || originPosition.y !== cfg.y) { this.updatePosition(cfg); } this.updateShape(); } this.afterUpdate(); this.clearCache(); } /** * 更新元素内容,样式 */ public updateShape() { const shapeFactory = this.get("shapeFactory"); const model = this.get("model"); const shape = model.type; // 判定是否允许更新 // 1. 注册的节点允许更新 // 2. 更新后的 shape 等于原先的 shape if ( shapeFactory.shouldUpdate(shape) && shape === this.get("currentShape") ) { const updateCfg = this.getShapeCfg(model); shapeFactory.baseUpdate(shape, updateCfg, this); // 更新完以后重新设置原始样式 this.setOriginStyle(); } else { // 如果不满足上面两种状态,重新绘制 this.draw(); } // 更新后重置节点状态 this.restoreStates(shapeFactory, shape); } /** * 更新位置,避免整体重绘 * @param {object} cfg 待更新数据 */ public updatePosition(cfg: ModelConfig): boolean { const model: ModelConfig = this.get("model"); const x = isNil(cfg.x) ? model.x : cfg.x; const y = isNil(cfg.y) ? model.y : cfg.y; const group: IGroup = this.get("group"); if (isNil(x) || isNil(y)) { return false; } model.x = x; model.y = y; const matrix = group.getMatrix(); if (matrix && matrix[6] === x && matrix[7] === y) return false; group.resetMatrix(); // G 4.0 element 中移除了矩阵相关方法,详见https://www.yuque.com/antv/blog/kxzk9g#4rMMV translate(group, { x: x!, y: y! }); this.clearCache(); // 位置更新后需要清除缓存 return true; } /** * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内 * @return {Object} 包含 x,y,width,height, centerX, centerY */ public getBBox(): IBBox { // 计算 bbox 开销有些大,缓存 let bbox: IBBox = this.get(CACHE_BBOX); if (!bbox) { bbox = this.calculateBBox(); this.set(CACHE_BBOX, bbox); } return bbox; } /** * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内 * @return {Object} 包含 x,y,width,height, centerX, centerY */ public getCanvasBBox(): IBBox { // 计算 bbox 开销有些大,缓存 let bbox: IBBox = this.get(CACHE_CANVAS_BBOX); if (!bbox) { bbox = this.calculateCanvasBBox(); this.set(CACHE_CANVAS_BBOX, bbox); } return bbox; } /** * 将元素放到最前面 */ public toFront() { const group: IGroup = this.get("group"); group.toFront(); } /** * 将元素放到最后面 */ public toBack() { const group: IGroup = this.get("group"); group.toBack(); } /** * 显示元素 */ public show() { this.changeVisibility(true); } /** * 隐藏元素 */ public hide() { this.changeVisibility(false); } /** * 更改是否显示 * @param {Boolean} visible 是否显示 */ public changeVisibility(visible: boolean) { const group: IGroup = this.get("group"); if (visible) { group.show(); } else { group.hide(); } this.set("visible", visible); } /** * 元素是否可见 * @return {Boolean} 返回该元素是否可见 */ public isVisible(): boolean { return this.get("visible"); } /** * 是否拾取及出发该元素的交互事件 * @param {Boolean} enable 标识位 */ public enableCapture(enable: boolean) { const group: IGroup = this.get("group"); if (group) { group.set("capture", enable); } } public destroy() { if (!this.destroyed) { const animate = this.get("animate"); const group: IGroup = this.get("group"); if (animate) { group.stopAnimate(); } this.clearCache(); group.remove(); (this._cfg as IItemBaseConfig | null) = null; this.destroyed = true; } } } ================================================ FILE: packages/core/src/item/node.ts ================================================ import { each, isNil, mix } from "@antv/util"; import { IEdge, INode } from "../interface/item"; import { IPoint, IShapeBase, ModelConfig, NodeConfig } from "../types"; import { getBBox } from "../util/graphic"; import { distance, getCircleIntersectByPoint, getEllipseIntersectByPoint, getRectIntersectByPoint, } from "../util/math"; import Item from "./item"; const CACHE_ANCHOR_POINTS = "anchorPointsCache"; const CACHE_BBOX = "bboxCache"; export default class Node extends Item implements INode { public getNearestPoint(points: IPoint[], curPoint: IPoint): IPoint { let index = 0; let nearestPoint = points[0]; let minDistance = distance(points[0], curPoint); for (let i = 0; i < points.length; i++) { const point = points[i]; const dis = distance(point, curPoint); if (dis < minDistance) { nearestPoint = point; minDistance = dis; index = i; } } nearestPoint.anchorIndex = index; return nearestPoint; } public getDefaultCfg() { return { type: "node", edges: [], }; } /** * 获取从节点关联的所有边 */ public getEdges(): IEdge[] { return this.get("edges"); } /** * 获取所有的入边 */ public getInEdges(): IEdge[] { const self = this; return this.get("edges").filter( (edge: IEdge) => edge.get("target") === self, ); } /** * 获取所有的出边 */ public getOutEdges(): IEdge[] { const self = this; return this.get("edges").filter( (edge: IEdge) => edge.get("source") === self, ); } /** * 获取节点的邻居节点 * * @returns {INode[]} * @memberof Node */ public getNeighbors(type?: "target" | "source" | undefined): INode[] { const edges = this.get("edges") as IEdge[]; if (type === "target") { // 当前节点为 source,它所指向的目标节点 const neighhborsConverter = (edge: IEdge) => { return edge.getSource() === this; }; return edges.filter(neighhborsConverter).map((edge) => edge.getTarget()); } if (type === "source") { // 当前节点为 target,它所指向的源节点 const neighhborsConverter = (edge: IEdge) => { return edge.getTarget() === this; }; return edges.filter(neighhborsConverter).map((edge) => edge.getSource()); } // 若未指定 type ,则返回所有邻居 const neighhborsConverter = (edge: IEdge) => { return edge.getSource() === this ? edge.getTarget() : edge.getSource(); }; return edges.map(neighhborsConverter); } /** * 根据锚点的索引获取连接点 * @param {Number} index 索引 */ public getLinkPointByAnchor(index: number): IPoint { const anchorPoints = this.getAnchorPoints(); return anchorPoints[index]; } /** * 获取连接点 * @param point */ public getLinkPoint(point: IPoint): IPoint | null { const keyShape: IShapeBase = this.get("keyShape"); const type: string = keyShape.get("type"); const itemType: string = this.get("type"); let centerX; let centerY; const bbox = this.getBBox(); if (itemType === "combo") { centerX = bbox.centerX || (bbox.maxX + bbox.minX) / 2; centerY = bbox.centerY || (bbox.maxY + bbox.minY) / 2; } else { centerX = bbox.centerX; centerY = bbox.centerY; } const anchorPoints = this.getAnchorPoints(); let intersectPoint: IPoint | null; switch (type) { case "circle": intersectPoint = getCircleIntersectByPoint( { x: centerX!, y: centerY!, r: bbox.width / 2, }, point, ); break; case "ellipse": intersectPoint = getEllipseIntersectByPoint( { x: centerX!, y: centerY!, rx: bbox.width / 2, ry: bbox.height / 2, }, point, ); break; default: intersectPoint = getRectIntersectByPoint(bbox, point); } let linkPoint = intersectPoint; // 如果存在锚点,则使用交点计算最近的锚点 if (anchorPoints.length) { if (!linkPoint) { // 如果计算不出交点 linkPoint = point; } linkPoint = this.getNearestPoint(anchorPoints, linkPoint); } if (!linkPoint) { // 如果最终依然没法找到锚点和连接点,直接返回中心点 linkPoint = { x: centerX, y: centerY } as IPoint; } return linkPoint; } /** * 获取锚点的定义 * @return {array} anchorPoints */ public getAnchorPoints(): IPoint[] { let anchorPoints: IPoint[] = this.get(CACHE_ANCHOR_POINTS); if (!anchorPoints) { anchorPoints = []; const shapeFactory = this.get("shapeFactory"); const bbox = this.getBBox(); const model: NodeConfig = this.get("model"); const shapeCfg = this.getShapeCfg(model); const type = model.type; const points = shapeFactory.getAnchorPoints(type, shapeCfg) || []; each(points, (pointArr, index) => { const point = { x: bbox.minX + pointArr[0] * bbox.width, y: bbox.minY + pointArr[1] * bbox.height, anchorIndex: index, }; anchorPoints.push(point); }); this.set(CACHE_ANCHOR_POINTS, anchorPoints); } return anchorPoints; } /** * add edge * @param edge Edge instance */ public addEdge(edge: IEdge) { this.get("edges").push(edge); } /** * 锁定节点 */ public lock() { this.set("locked", true); } /** * 解锁锁定的节点 */ public unlock() { this.set("locked", false); } public hasLocked(): boolean { return this.get("locked"); } /** * 移除边 * @param {Edge} edge 边 */ public removeEdge(edge: IEdge) { const edges = this.getEdges(); const index = edges.indexOf(edge); if (index > -1) { edges.splice(index, 1); } } public clearCache() { this.set(CACHE_BBOX, null); // 清理缓存的 bbox this.set(CACHE_ANCHOR_POINTS, null); } /** * 是否仅仅移动节点,其他属性没变化 * @param cfg 节点数据模型 */ public isOnlyMove(cfg: ModelConfig): boolean { if (!cfg) { return false; } const existX = !isNil(cfg.x); const existY = !isNil(cfg.y); const keys = Object.keys(cfg); // 仅有一个字段,包含 x 或者 包含 y // 两个字段,同时有 x,同时有 y return ( (keys.length === 1 && (existX || existY)) || (keys.length === 2 && existX && existY) ); } } ================================================ FILE: packages/core/src/types/index.ts ================================================ /* eslint @typescript-eslint/no-use-before-define: 0 */ import { IGroup, Event as GraphEvent, BBox, AnimateCfg, ICanvas, IShape, } from "@antv/g-base"; import Node from "../item/node"; import { IAbstractGraph } from "../interface/graph"; import { IEdge, INode, ICombo } from "../interface/item"; import { ILabelConfig } from "../interface/shape"; export * from "../interface"; // Node Edge Combo 实例 export type Item = INode | IEdge | ICombo; export interface IG6GraphEvent extends GraphEvent { item: Item | null; canvasX: number; canvasY: number; clientX: number; clientY: number; x: number; y: number; detail: number; key?: string; target: IShapeBase & ICanvas; [key: string]: unknown; } // Math types export interface IPoint { x: number; y: number; // 获取连接点时使用 anchorIndex?: number; [key: string]: number | undefined; } export type IPointTuple = [number, number]; export type Matrix = number[]; export interface IBBox extends BBox { centerX?: number; centerY?: number; [key: string]: number | undefined; } export type Padding = number | string | number[]; export interface ArrowConfig { d?: number; path?: string; stroke?: string; fill?: string; } // Shape types export type ShapeStyle = Partial<{ x: number; y: number; r: number; radius: number; width: number; height: number; offset: number | number[]; stroke: string | null; strokeOpacity: number; fill: string | null; fillOpacity: number; lineWidth: number; lineAppendWidth: number; lineDash: number[]; path: string | object[]; points: object[]; matrix: number[]; opacity: number; size: number | number[]; endArrow: boolean | ArrowConfig; startArrow: boolean | ArrowConfig; shadowColor: string; shadowBlur: number; shadowOffsetX: number; shadowOffsetY: number; cursor: string; position: string; fontSize: number; keepVisualSize: boolean; // support more properties [key: string]: any; }>; export interface IShapeBase extends IShape { isKeyShape: boolean; } export interface IRect extends IPoint { width: number; height: number; } export interface ICircle extends IPoint { r: number; } export interface IEllipse extends IPoint { rx: number; ry: number; } export type SourceTarget = "source" | "target"; // 自环边配置 export type LoopConfig = Partial<{ dist: number; position: string; // 如果逆时针画,交换起点和终点 clockwise: boolean; }>; export interface LayoutConfig { type?: string; gpuEnabled?: boolean; workerEnabled?: boolean; // 只有当 workerEnabled 为 true 时才生效 workerScriptURL?: string; onLayoutEnd?: () => void; [key: string]: unknown; } export interface ModeOption { type: string; delegate?: boolean; delegateStyle?: object; updateEdge?: boolean; trigger?: string; enableDelegate?: boolean; maxZoom?: number; minZoom?: number; enableOptimize?: boolean; enableDebounce?: boolean; allowDragOnItem?: boolean; optimizeZoom?: number; multiple?: boolean; activeState?: string; inactiveState?: string; comboActiveState?: string; selectedState?: string; onlyChangeComboSize?: boolean; includeEdges?: boolean; direction?: "x" | "y"; scalableRange?: number; offset?: number; sensitivity?: number; fixSelectedItems?: Partial<{ fixAll: boolean; fixLineWidth: boolean; fixLabel: boolean; fixState: string; }>; key?: string | undefined; edgeConfig?: EdgeConfig; functionName?: string; functionParams?: any[]; relayout?: boolean; brushStyle?: object; zoomKey?: "shift" | "ctrl" | "alt" | "control"; shouldUpdate?: (e: IG6GraphEvent) => boolean; shouldBegin?: (e: IG6GraphEvent) => boolean; shouldEnd?: (e: IG6GraphEvent) => boolean; onChange?: (item?: Item, judge?: boolean) => unknown; onSelect?: (selectedNodes?: Item[], selectedEdges?: Item[]) => unknown; onDeselect?: (selectedNodes?: Item[], selectedEdges?: Item[]) => unknown; formatText?: (data: { [key: string]: unknown }) => string; } export type ModeType = string | ModeOption; export interface Modes { default?: ModeType[]; [key: string]: ModeType[] | undefined; } // Graph 配置项中 state 的类型 export interface States { [key: string]: INode[]; } export interface StateStyles { [key: string]: | ShapeStyle | { [key: string]: ShapeStyle; }; } // model types (node edge group) export type ModelStyle = Partial<{ [key: string]: unknown; style: ShapeStyle; stateStyles: StateStyles; }>; export interface GraphOptions { /** * 图的 DOM 容器,可以传入该 DOM 的 id 或者直接传入容器的 HTML 节点对象 */ container: string | HTMLElement; /** * 指定画布宽度,单位为 'px',可选,默认为容器宽度 */ width?: number; /** * 指定画布高度,单位为 'px',可选,默认为容器宽度 */ height?: number; /** * renderer canvas or svg */ renderer?: string; fitView?: boolean; fitCenter?: boolean; layout?: LayoutConfig; /** * 图适应画布时,指定四周的留白。 * 可以是一个值, 例如:fitViewPadding: 20 * 也可以是一个数组,例如:fitViewPadding: [20, 40, 50,20] * 当指定一个值时,四边的边距都相等,当指定数组时,数组内数值依次对应 上,右,下,左四边的边距。 */ fitViewPadding?: Padding; /** * 各种元素是否在一个分组内,决定节点和边的层级问题,默认情况下所有的节点在一个分组中,所有的边在一个分组中,当这个参数为 false 时,节点和边的层级根据生成的顺序确定。 * 默认值:true */ groupByTypes?: boolean; // 是否有向图 directed?: boolean; groupStyle?: { style?: { [key: string]: ShapeStyle; }; }; /** * 当图中元素更新,或视口变换时,是否自动重绘。建议在批量操作节点时关闭,以提高性能,完成批量操作后再打开,参见后面的 setAutoPaint() 方法。 * 默认值:true */ autoPaint?: boolean; /** * 设置画布的模式。详情可见G6中的Mode文档。 */ modes?: Modes; /** * 默认状态下节点的配置,比如 type, size, color。会被写入的 data 覆盖。 */ defaultNode?: Partial<{ type: string; size: number | number[]; color: string; }> & ModelStyle; /** * 默认状态下边的配置,比如 type, size, color。会被写入的 data 覆盖。 */ defaultEdge?: Partial<{ type: string; size: number | number[]; color: string; }> & ModelStyle; /** * Combo 默认配置 */ defaultCombo?: Partial<{ type: string; size: number | number[]; color: string; }> & ModelStyle; nodeStateStyles?: StateStyles; edgeStateStyles?: StateStyles; // Combo 状态样式 comboStateStyles?: StateStyles; /** * 向 graph 注册插件。插件机制请见:plugin */ plugins?: any[]; /** * 是否启用全局动画。 */ animate?: boolean; /** * 动画配置项,仅在animate为true时有效。 */ animateCfg?: GraphAnimateConfig; /** * 最小缩放比例 * 默认值 0.2 */ minZoom?: number; /** * 最大缩放比例 * 默认值 10 */ maxZoom?: number; groupType?: string; /** * Edge 是否连接到节点中间 */ linkCenter?: boolean; /** * 是否启用 stack,即是否开启 redo & undo 功能 */ enabledStack?: boolean; /** * redo & undo 最大步数, 只有当 enabledStack 为 true 时才起作用 */ maxStep?: number; /** * 存储图上的 tooltip dom,方便销毁 */ tooltips?: []; pixelRatio?: number; } export type LabelStyle = Partial<{ rotate: number; textAlign: "center" | "start" | "end" | "left" | "right"; angle: number; x: number; y: number; text: string; stroke: string | null; opacity: number; fontSize: number; fontStyle: "normal" | "italic" | "oblique"; fontWeight?: "normal" | "bold" | "bolder" | "lighter" | number; fill: string | null; rotateCenter: string; lineWidth: number; shadowColor: string; shadowBlur: number; shadowOffsetX?: number; shadowOffsetY?: number; position: string; textBaseline: | "top" | "middle" | "bottom" | "hanging" | "alphabetic" | "ideographic"; offset: number; background?: { fill?: string; stroke?: string; lineWidth?: number; radius?: number[] | number; padding?: number[] | number; }; }>; export type Easeing = | "easeLinear" | "easePolyIn" | "easePolyOut" | "easePolyInOut" | "easeQuad" | "easeQuadIn" | "easeQuadOut" | "easeQuadInOut" | string; export interface ModelConfig extends ModelStyle { // 节点或边的类型 type?: string; label?: string | LabelStyle; labelCfg?: ILabelConfig; x?: number; y?: number; size?: number | number[]; color?: string; anchorPoints?: number[][]; startPoint?: { x: number; y: number; }; endPoint?: { x: number; y: number; }; visible?: boolean; } export interface TreeGraphData { id: string; label?: string; x?: number; y?: number; children?: TreeGraphData[]; data?: ModelConfig; side?: "left" | "right"; depth?: number; collapsed?: boolean; style?: | ShapeStyle | { [key: string]: ShapeStyle; }; stateStyles?: StateStyles; [key: string]: unknown; } export interface NodeConfig extends ModelConfig { id: string; groupId?: string; comboId?: string; children?: TreeGraphData[]; description?: string; descriptionCfg?: { style?: object; [key: string]: any; }; img?: string; innerR?: number; direction?: string; preRect?: { show?: boolean; [key: string]: any; }; logoIcon?: { show?: boolean; [key: string]: any; }; stateIcon?: { show?: boolean; [key: string]: any; }; linkPoints?: { top?: boolean; right?: boolean; bottom?: boolean; left?: boolean; size?: number; lineWidth?: number; fill?: string; stroke?: string; r?: number; [key: string]: any; }; icon?: { show?: boolean; // icon的地址,字符串类型 img?: string; text?: string; width?: number; height?: number; offset?: number; }; clipCfg?: { show?: boolean; type?: string; // circle r?: number; // ellipse rx?: number; ry?: number; // rect width?: number; height?: number; // polygon points?: number[][]; // path path?: Array>; // 坐标 x?: number; y?: number; // clip 的属性样式 // style?: ShapeStyle }; } export interface ComboTree { id: string; label?: string | LabelStyle; children?: ComboTree[]; depth?: number; parentId?: string; removed?: boolean; itemType?: "node" | "combo"; [key: string]: unknown; } export interface ComboConfig extends ModelConfig { id: string; parentId?: string; children?: ComboTree[]; depth?: number; padding?: number | number[]; collapseIcon?: Partial<{ show: boolean; collapseSymbol: any; expandSymbol: any; r: number; lineWidth: number; stroke: string; offsetX: number; offsetY: number; }>; } export interface EdgeConfig extends ModelConfig { id?: string; source?: string; target?: string; sourceNode?: Node; targetNode?: Node; startPoint?: IPoint; endPoint?: IPoint; controlPoints?: IPoint[]; curveOffset?: number | number[]; minCurveOffset?: number | number[]; // loop edge config loopCfg?: LoopConfig; labelCfg?: ILabelConfig; curvePosition?: number | number[]; } export type EdgeData = EdgeConfig & { sourceNode: Node; targetNode: Node; startPoint: IPoint; endPoint: IPoint; }; export interface NodeMap { [key: string]: INode; } export interface NodeConfigMap { [key: string]: NodeConfig; } export interface GraphData { nodes?: NodeConfig[]; edges?: EdgeConfig[]; combos?: ComboConfig[]; [key: string]: any; } export interface GraphAnimateConfig extends AnimateCfg { /** * 回调函数,用于自定义节点运动路径。 */ onFrame?: ( item: Item, ratio: number, data?: GraphData, originAttrs?: ShapeStyle, ) => unknown; } export interface GroupNodeIds { [key: string]: string[]; } // Behavior type file export enum G6Event { // common events CLICK = "click", DBLCLICK = "dblclick", TAP = "tap", DBLTAP = "dbltap", DRAGSTART = "dragstart", DRAGEND = "dragend", DRAG = "drag", DRAGENTER = "dragenter", DRAGLEAVE = "dragleave", DRAGOVER = "dragover", DRAGOUT = "dragout", DDROP = "drop", PINCHSTART = "pinchstart", PINCHMOVE = "pinchmove", PANSTART = "panstart", PANMOVE = "panmove", PANEND = "panend", PRESS = "press", ACTION_END = "actionend", // touch events TOUCHSTART = "touchstart", TOUCHMOVE = "touchmove", TOUCHEND = "touchend", CANVAS_TOUCHSTART = "canvas:touchstart", CANVAS_TOUCHMOVE = "canvas:touchmove", CANVAS_TOUCHEND = "canvas:touchend", NODE_TOUCHSTART = "node:touchstart", NODE_TOUCHMOVE = "node:touchmove", NODE_TOUCHEND = "node:touchend", COMBO_TOUCHSTART = "combo:touchstart", COMBO_TOUCHMOVE = "combo:touchmove", COMBO_TOUCHEND = "combo:touchend", EDGE_TOUCHSTART = "edge:touchstart", EDGE_TOUCHMOVE = "edge:touchmove", EDGE_TOUCHEND = "edge:touchend", // node events NODE_CLICK = "node:click", NODE_DBLCLICK = "node:dblclick", NODE_DROP = "node:drop", NODE_DRAGOVER = "node:dragover", NODE_DRAGENTER = "node:dragenter", NODE_DRAGLEAVE = "node:dragleave", NODE_DRAGSTART = "node:dragstart", NODE_DRAG = "node:drag", NODE_DRAGEND = "node:dragend", NODE_TAP = "node:tap", NODE_DBLTAP = "node:dbltap", NODE_PANSTART = "node:panstart", NODE_PANMOVE = "node:panmove", NODE_PANEND = "node:panend", NODE_PRESS = "node:press", // combo, extends from nodes COMBO_CLICK = "combo:click", COMBO_DBLCLICK = "combo:dblclick", COMBO_DROP = "combo:drop", COMBO_DRAGOVER = "combo:dragover", COMBO_DRAGENTER = "combo:dragenter", COMBO_DRAGLEAVE = "combo:dragleave", COMBO_DRAGSTART = "combo:dragstart", COMBO_DRAG = "combo:drag", COMBO_DRAGEND = "combo:dragend", COMBO_TAP = "combo:tap", COMBO_DBLTAP = "combo:dbltap", COMBO_PANSTART = "combo:panstart", COMBO_PANMOVE = "combo:panmove", COMBO_PANEND = "combo:panend", COMBO_PRESS = "combo:press", // edge events EDGE_CLICK = "edge:click", EDGE_DBLCLICK = "edge:dblclick", EDGE_DROP = "edge:drop", EDGE_DRAGOVER = "edge:dragover", EDGE_DRAGENTER = "edge:dragenter", EDGE_DRAGLEAVE = "edge:dragleave", EDGE_TAP = "edge:tap", EDGE_DBLTAP = "edge:dbltap", EDGE_PRESS = "edge:press", // canvas events CANVAS_CLICK = "canvas:click", CANVAS_DBLCLICK = "canvas:dblclick", CANVAS_DROP = "canvas:drop", CANVAS_DRAGENTER = "canvas:dragenter", CANVAS_DRAGLEAVE = "canvas:dragleave", CANVAS_DRAGSTART = "canvas:dragstart", CANVAS_DRAG = "canvas:drag", CANVAS_DRAGEND = "canvas:dragend", CANVAS_TAP = "canvas:tap", CANVAS_DBLTAP = "canvas:dbltap", CANVAS_PANSTART = "canvas:panstart", CANVAS_PANMOVE = "canvas:panmove", CANVAS_PANEND = "canvas:panend", CANVAS_PRESS = "canvas:press", // timing events BEFORERENDER = "beforerender", AFTERRENDER = "afterrender", BEFOREADDITEM = "beforeadditem", AFTERADDITEM = "afteradditem", BEFOREREMOVEITEM = "beforeremoveitem", AFTERREMOVEITEM = "afterremoveitem", BEFOREUPDATEITEM = "beforeupdateitem", AFTERUPDATEITEM = "afterupdateitem", BEFOREITEMVISIBILITYCHANGE = "beforeitemvisibilitychange", AFTERITEMVISIBILITYCHANGE = "afteritemvisibilitychange", BEFOREITEMSTATECHANGE = "beforeitemstatechange", AFTERITEMSTATECHANGE = "afteritemstatechange", BEFOREITEMREFRESH = "beforeitemrefresh", AFTERITEMREFRESH = "afteritemrefresh", BEFOREITEMSTATESCLEAR = "beforeitemstatesclear", AFTERITEMSTATESCLEAR = "afteritemstatesclear", BEFOREMODECHANGE = "beforemodechange", AFTERMODECHANGE = "aftermodechange", BEFORELAYOUT = "beforelayout", AFTERLAYOUT = "afterlayout", BEFORECREATEEDGE = "beforecreateedge", AFTERCREATEEDGE = "aftercreateedge", BEFOREGRAPHREFRESHPOSITION = "beforegraphrefreshposition", AFTERGRAPHREFRESHPOSITION = "aftergraphrefreshposition", BEFOREGRAPHREFRESH = "beforegraphrefresh", AFTERGRAPHREFRESH = "aftergraphrefresh", BEFOREANIMATE = "beforeanimate", AFTERANIMATE = "afteranimate", BEFOREPAINT = "beforepaint", AFTERPAINT = "afterpaint", BEFORECOLLAPSEEXPANDCOMBO = "beforecollapseexpandcombo", AFTERCOLLAPSEEXPANDCOMBO = "aftercollapseexpandcombo", GRAPHSTATECHANGE = "graphstatechange", AFTERACTIVATERELATIONS = "afteractivaterelations", NODESELECTCHANGE = "nodeselectchange", TOOLTIPCHANGE = "tooltipchange", WHEELZOOM = "wheelzoom", VIEWPORTCHANGE = "viewportchange", DRAGNODEEND = "dragnodeend", STACKCHANGE = "stackchange", } export type DefaultBehaviorType = IG6GraphEvent | string | number | object; export interface BehaviorOption { getEvents: () => { [key in G6Event]?: string; }; getDefaultCfg?: () => object; shouldBegin?: (e?: IG6GraphEvent) => boolean; shouldUpdate?: (e?: IG6GraphEvent) => boolean; shouldEnd?: (e?: IG6GraphEvent) => boolean; bind?: (e: IAbstractGraph) => void; unbind?: (e: IAbstractGraph) => void; [key: string]: unknown; } export type IEvent = Record; // eslint-disable-next-line @typescript-eslint/naming-convention export type ITEM_TYPE = "node" | "edge" | "combo" | "vedge"; export type NodeIdxMap = { [key: string]: number; }; // 触发 viewportchange 事件的参数 export interface ViewPortEventParam { action: string; matrix: Matrix; } export interface Indexable { [key: string]: T; } // 图算法回调方法接口定义 export interface IAlgorithmCallbacks { enter?: (param: { current: INode; previous: INode }) => void; leave?: (param: { current: INode; previous?: INode }) => void; allowTraversal?: (param: { previous?: INode; current?: INode; next: INode; }) => boolean; } // 栈中数据格式 export interface StackData { action: string; data: GraphData; } export interface BubblesetCfg { morphBuffer?: number; // DEFAULT_NODE_R0; the amount of space to move the virtual edge when wrapping around obstacles pixelGroupSize?: number; // the resolution of the algorithm in square pixels, 4 by default maxMarchingIterations?: number; // number of times to refine the boundary, 100 by default maxRoutingIterations?: number; // number of times to run the algorithm to refine the path finding in difficult areas nodeR0?: number; // the distance from nodes which energy is 1 (full influence) nodeR1?: number; // the distance from nodes at which energy is 0 (no influence) edgeR0?: number; // the distance from edges at which energy is 1 (full influence) edgeR1?: number; // the distance from edges at which energy is 0 (no influence) nodeInfluenceFactor?: number; // node influence factor negativeNodeInfluenceFactor?: number; // negativeNode influence factor edgeInfluenceFactor?: number; // edge influence factor memberInfluenceFactor?: number; // member influence factor nonMemberInfluenceFactor?: number; // nonMember influence factor } export type TimeBarType = "trend" | "simple" | "tick"; export interface HullCfg { id: string; members?: Item[] | string[]; // 节点实例或节点 Id 数组 nonMembers?: Item[] | string[]; group?: IGroup; type?: string; // 'round-convex'(圆角凸包) /'smooth-convex'(平滑凸包) / 'bubble'(平滑凹包), padding?: number; // 轮廓边缘和内部成员间距 style?: { fill?: string; stroke?: string; opacity?: number; }; bubbleCfg?: BubblesetCfg; // 用于更精细控制bubble的效果(点和边轮廓的松弛程度,轮廓粒度),一般不需要配置 update?: string; } ================================================ FILE: packages/core/src/util/base.ts ================================================ import { isString, isNumber, isNil, isArray } from "@antv/util"; import { G6GraphEvent } from "../interface/behavior"; import { IG6GraphEvent, Padding, Matrix, Item } from "../types"; export const uniqueId = (type: string): string => { return `${type}-${Math.random()}${Date.now()}`; }; /** * turn padding into [top, right, bottom, right] * @param {Number|Array} padding input padding * @return {array} output */ export const formatPadding = (padding: Padding): number[] => { let top = 0; let left = 0; let right = 0; let bottom = 0; if (isNumber(padding)) { top = left = right = bottom = padding; } else if (isString(padding)) { const intPadding = parseInt(padding, 10); top = left = right = bottom = intPadding; } else if (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]; }; /** * clone event * @param e */ export const cloneEvent = (e: IG6GraphEvent): IG6GraphEvent => { const event = new G6GraphEvent(e.type, e); event.clientX = e.clientX; event.clientY = e.clientY; event.x = e.x; event.y = e.y; event.target = e.target; event.currentTarget = e.currentTarget; event.bubbles = true; (event.item as Item | null) = e.item; return event; }; /** * 判断 viewport 是否改变,通过和单位矩阵对比 * @param matrix Viewport 的 Matrix */ export const isViewportChanged = (matrix: Matrix) => { // matrix 为 null, 则说明没有变化 if (!matrix) { return false; } const MATRIX_LEN = 9; const ORIGIN_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1]; for (let i = 0; i < MATRIX_LEN; i++) { if (matrix[i] !== ORIGIN_MATRIX[i]) { return true; } } return false; }; export const isNaN = (input: any) => Number.isNaN(Number(input)); /** * 计算一组 Item 的 BBox * @param items 选中的一组Item,可以是 node 或 combo */ export const calculationItemsBBox = (items: Item[]) => { let minx = Infinity; let maxx = -Infinity; let miny = Infinity; let maxy = -Infinity; // 获取已节点的所有最大最小x y值 for (let i = 0; i < items.length; i++) { const element = items[i]; const bbox = element.getBBox(); const { minX, minY, maxX, maxY } = bbox; if (minX < minx) { minx = minX; } if (minY < miny) { miny = minY; } if (maxX > maxx) { maxx = maxX; } if (maxY > maxy) { maxy = maxY; } } const x = Math.floor(minx); const y = Math.floor(miny); const width = Math.ceil(maxx) - Math.floor(minx); const height = Math.ceil(maxy) - Math.floor(miny); return { x, y, width, height, minX: minx, minY: miny, maxX: maxx, maxY: maxy, }; }; /** * 若 edges 中存在两端点相同的边,使用 quadratic 边并自动计算 curveOffset 使它们不相互重叠 * 文档: https://g6.antv.vision/en/docs/api/Util * @param edges 边数据集合 * @param offsetDiff 相邻两边的 offset 之差 * @param multiEdgeType * @param singleEdgeType * @param loopEdgeType */ export const processParallelEdges = ( edges, offsetDiff = 15, multiEdgeType: string = "quadratic", singleEdgeType: string = undefined, loopEdgeType: string = undefined, ) => { const len = edges.length; const cod = offsetDiff * 2; const loopPosition = [ "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ]; const edgeMap = {}; const tags = []; const reverses = {}; for (let i = 0; i < len; i++) { const edge = edges[i]; const { source, target } = edge; const sourceTarget = `${source}-${target}`; if (tags[i]) continue; if (!edgeMap[sourceTarget]) { edgeMap[sourceTarget] = []; } tags[i] = true; edgeMap[sourceTarget].push(edge); for (let j = 0; j < len; j++) { if (i === j) continue; const sedge = edges[j]; const src = sedge.source; const dst = sedge.target; // 两个节点之间共同的边 // 第一条的source = 第二条的target // 第一条的target = 第二条的source if (!tags[j]) { if (source === dst && target === src) { edgeMap[sourceTarget].push(sedge); tags[j] = true; reverses[`${src}|${dst}|${edgeMap[sourceTarget].length - 1}`] = true; } else if (source === src && target === dst) { edgeMap[sourceTarget].push(sedge); tags[j] = true; } } } } for (const key in edgeMap) { const arcEdges = edgeMap[key]; const { length } = arcEdges; for (let k = 0; k < length; k++) { const current = arcEdges[k]; if (current.source === current.target) { if (loopEdgeType) current.type = loopEdgeType; // 超过8条自环边,则需要重新处理 current.loopCfg = { position: loopPosition[k % 8], dist: Math.floor(k / 8) * 20 + 50, }; continue; } if (length === 1 && singleEdgeType && current.source !== current.target) { current.type = singleEdgeType; continue; } current.type = multiEdgeType; const sign = (k % 2 === 0 ? 1 : -1) * (reverses[`${current.source}|${current.target}|${k}`] ? -1 : 1); if (length % 2 === 1) { current.curveOffset = sign * Math.ceil(k / 2) * cod; } else { current.curveOffset = sign * (Math.floor(k / 2) * cod + offsetDiff); } } } return edges; }; ================================================ FILE: packages/core/src/util/color.ts ================================================ export const defaultSubjectColors = [ "#5F95FF", // blue "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4", ]; ================================================ FILE: packages/core/src/util/graphic.ts ================================================ import { IGroup, BBox } from "@antv/g-base"; import { vec2 } from "@antv/matrix-util"; import Global from "../global"; import { EdgeData, IBBox, IPoint, IShapeBase, LabelStyle, NodeConfig, ComboTree, ComboConfig, } from "../types"; import { applyMatrix } from "./math"; import letterAspectRatio from "./letterAspectRatio"; import { isString, clone, isNumber, isObject } from "@antv/util"; import { IAbstractGraph } from "../interface/graph"; const { PI, sin, cos } = Math; // 一共支持8个方向的自环,每个环占的角度是45度,在计算时再二分,为22.5度 const SELF_LINK_SIN: number = sin(PI / 8); const SELF_LINK_COS: number = cos(PI / 8); export const getBBox = (element: IShapeBase, group: IGroup): IBBox => { const bbox = element.getBBox(); let leftTop: IPoint = { x: bbox.minX, y: bbox.minY, }; let rightBottom: IPoint = { x: bbox.maxX, y: bbox.maxY, }; // 根据父元素变换矩阵 if (group) { let matrix = group.getMatrix(); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } leftTop = applyMatrix(leftTop, matrix); rightBottom = applyMatrix(rightBottom, matrix); } const { x: lx, y: ly } = leftTop; const { x: rx, y: ry } = rightBottom; return { x: lx, y: ly, minX: lx, minY: ly, maxX: rx, maxY: ry, width: rx - lx, height: ry - ly, }; }; /** * get loop edge config * @param cfg edge config */ export const getLoopCfgs = (cfg: EdgeData): EdgeData => { const item = cfg.sourceNode || cfg.targetNode; const container: IGroup = item.get("group"); let containerMatrix = container.getMatrix(); if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; const keyShape: IShapeBase = item.getKeyShape(); const bbox: IBBox = keyShape.getBBox(); const loopCfg = cfg.loopCfg || {}; // 距离keyShape边的最高距离 const dist: number = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2; // 自环边与keyShape的相对位置关系 const position: string = loopCfg.position || Global.defaultLoopPosition; // 中心取group上真实位置 const center = [containerMatrix[6], containerMatrix[7]]; let startPoint = [cfg.startPoint.x, cfg.startPoint.y]; let endPoint = [cfg.endPoint.x, cfg.endPoint.y]; let rstart = bbox.height / 2; let rend = bbox.height / 2; let sinDeltaStart = rstart * SELF_LINK_SIN; let cosDeltaStart = rstart * SELF_LINK_COS; let sinDeltaEnd = rend * SELF_LINK_SIN; let cosDeltaEnd = rend * SELF_LINK_COS; // 如果定义了锚点的,直接用锚点坐标,否则,根据自环的 cfg 计算 if (startPoint[0] === endPoint[0] && startPoint[1] === endPoint[1]) { switch (position) { case "top": startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart]; endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd]; break; case "top-right": rstart = bbox.height / 2; rend = bbox.width / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] + sinDeltaStart, center[1] - cosDeltaStart]; endPoint = [center[0] + cosDeltaEnd, center[1] - sinDeltaEnd]; break; case "right": rstart = bbox.width / 2; rend = bbox.width / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] + cosDeltaStart, center[1] - sinDeltaStart]; endPoint = [center[0] + cosDeltaEnd, center[1] + sinDeltaEnd]; break; case "bottom-right": rstart = bbox.width / 2; rend = bbox.height / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] + cosDeltaStart, center[1] + sinDeltaStart]; endPoint = [center[0] + sinDeltaEnd, center[1] + cosDeltaEnd]; break; case "bottom": rstart = bbox.height / 2; rend = bbox.height / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] + sinDeltaStart, center[1] + cosDeltaStart]; endPoint = [center[0] - sinDeltaEnd, center[1] + cosDeltaEnd]; break; case "bottom-left": rstart = bbox.height / 2; rend = bbox.width / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] - sinDeltaStart, center[1] + cosDeltaStart]; endPoint = [center[0] - cosDeltaEnd, center[1] + sinDeltaEnd]; break; case "left": rstart = bbox.width / 2; rend = bbox.width / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] - cosDeltaStart, center[1] + sinDeltaStart]; endPoint = [center[0] - cosDeltaEnd, center[1] - sinDeltaEnd]; break; case "top-left": rstart = bbox.width / 2; rend = bbox.height / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] - cosDeltaStart, center[1] - sinDeltaStart]; endPoint = [center[0] - sinDeltaEnd, center[1] - cosDeltaEnd]; break; default: rstart = bbox.width / 2; rend = bbox.width / 2; sinDeltaStart = rstart * SELF_LINK_SIN; cosDeltaStart = rstart * SELF_LINK_COS; sinDeltaEnd = rend * SELF_LINK_SIN; cosDeltaEnd = rend * SELF_LINK_COS; startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart]; endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd]; } // 如果逆时针画,交换起点和终点 if (loopCfg.clockwise === false) { const swap = [startPoint[0], startPoint[1]]; startPoint = [endPoint[0], endPoint[1]]; endPoint = [swap[0], swap[1]]; } } const startVec: vec2 = [startPoint[0] - center[0], startPoint[1] - center[1]]; let scaleRateStart = (rstart + dist) / rstart; let scaleRateEnd = (rend + dist) / rend; if (loopCfg.clockwise === false) { scaleRateStart = (rend + dist) / rend; scaleRateEnd = (rstart + dist) / rstart; } const startExtendVec = vec2.scale([0, 0], startVec, scaleRateStart); const controlPoint1 = [ center[0] + startExtendVec[0], center[1] + startExtendVec[1], ]; const endVec: vec2 = [endPoint[0] - center[0], endPoint[1] - center[1]]; const endExtendVec = vec2.scale([0, 0], endVec, scaleRateEnd); const controlPoint2 = [ center[0] + endExtendVec[0], center[1] + endExtendVec[1], ]; cfg.startPoint = { x: startPoint[0], y: startPoint[1] }; cfg.endPoint = { x: endPoint[0], y: endPoint[1] }; cfg.controlPoints = [ { x: controlPoint1[0], y: controlPoint1[1] }, { x: controlPoint2[0], y: controlPoint2[1] }, ]; return cfg; }; /** * 根据 label 所在线条的位置百分比,计算 label 坐标 * @param {object} pathShape G 的 path 实例,一般是 Edge 实例的 keyShape * @param {number} percent 范围 0 - 1 的线条百分比 * @param {number} refX x 轴正方向为基准的 label 偏移 * @param {number} refY y 轴正方向为基准的 label 偏移 * @param {boolean} rotate 是否根据线条斜率旋转文本 * @return {object} 文本的 x, y, 文本的旋转角度 */ export const getLabelPosition = ( pathShape, percent: number, refX: number, refY: number, rotate: boolean, ): LabelStyle => { const TAN_OFFSET = 0.0001; let vector: number[][] = []; const point: IPoint = pathShape.getPoint(percent); if (point === null) { return { x: 0, y: 0, angle: 0, }; } // 头尾最可能,放在最前面,使用 g path 上封装的方法 if (percent < TAN_OFFSET) { vector = pathShape.getStartTangent().reverse(); } else if (percent > 1 - TAN_OFFSET) { vector = pathShape.getEndTangent(); } else { // 否则取指定位置的点,与少量偏移的点,做微分向量 const offsetPoint: IPoint = pathShape.getPoint(percent + TAN_OFFSET); vector.push([point.x, point.y]); vector.push([offsetPoint.x, offsetPoint.y]); } let rad: number = Math.atan2( vector[1][1] - vector[0][1], vector[1][0] - vector[0][0], ); if (rad < 0) { rad += PI * 2; } if (refX) { point.x += cos(rad) * refX; point.y += sin(rad) * refX; } if (refY) { // 默认方向是 x 轴正方向,法线是 求出角度 - 90° let normal = rad - PI / 2; // 若法线角度在 y 轴负方向,切到正方向,保证 refY 相对于 y 轴正方向 if (rad > (1 / 2) * PI && rad < ((3 * 1) / 2) * PI) { normal -= PI; } point.x += cos(normal) * refY; point.y += sin(normal) * refY; } const result = { x: point.x, y: point.y, angle: rad, }; if (rotate) { if (rad > (1 / 2) * PI && rad < ((3 * 1) / 2) * PI) { rad -= PI; } return { rotate: rad, ...result, }; } return result; }; /** * depth first traverse, from root to leaves, children in inverse order * if the fn returns false, terminate the traverse */ const traverse = ( data: T, fn: (param: T) => boolean, ) => { if (fn(data) === false) { return false; } if (data && data.children) { for (let i = data.children.length - 1; i >= 0; i--) { if (!traverse(data.children[i], fn)) return false; } } return true; }; /** * depth first traverse, from leaves to root, children in inverse order * if the fn returns false, terminate the traverse */ const traverseUp = ( data: T, fn: (param: T) => boolean, ) => { if (data && data.children) { for (let i = data.children.length - 1; i >= 0; i--) { if (!traverseUp(data.children[i], fn)) return; } } if (fn(data) === false) { return false; } return true; }; /** * depth first traverse, from root to leaves, children in inverse order * if the fn returns false, terminate the traverse */ export const traverseTree = ( data: T, fn: (param: T) => boolean, ) => { if (typeof fn !== "function") { return; } traverse(data, fn); }; /** * depth first traverse, from leaves to root, children in inverse order * if the fn returns false, terminate the traverse */ export const traverseTreeUp = ( data: T, fn: (param: T) => boolean, ) => { if (typeof fn !== "function") { return; } traverseUp(data, fn); }; /** * * @param letter the letter * @param fontSize * @return the letter's width */ export const getLetterWidth = (letter, fontSize) => { return fontSize * (letterAspectRatio[letter] || 1); }; /** * * @param text the text * @param fontSize * @return the text's size */ export const getTextSize = (text: string, fontSize: number) => { let width = 0; const pattern = new RegExp("[\u{4E00}-\u{9FA5}]+"); text.split("").forEach((letter) => { if (pattern.test(letter)) { // 中文字符 width += fontSize; } else { width += getLetterWidth(letter, fontSize); } }); return [width, fontSize]; }; /** * construct the trees from combos data * @param array the combos array * @param nodes the nodes array * @return the tree */ export const plainCombosToTrees = ( array: ComboConfig[], nodes?: NodeConfig[], ) => { const result: ComboTree[] = []; const addedMap = {}; const modelMap = {}; array.forEach((d) => { modelMap[d.id] = d; }); array.forEach((d, i) => { const cd = clone(d); cd.itemType = "combo"; cd.children = undefined; if (cd.parentId === cd.id) { console.warn( `The parentId for combo ${cd.id} can not be the same as the combo's id`, ); delete cd.parentId; } else if (cd.parentId && !modelMap[cd.parentId]) { console.warn(`The parent combo for combo ${cd.id} does not exist!`); delete cd.parentId; } let mappedObj = addedMap[cd.id]; if (mappedObj) { cd.children = mappedObj.children; addedMap[cd.id] = cd; mappedObj = cd; if (!mappedObj.parentId) { result.push(mappedObj); return; } const mappedParent = addedMap[mappedObj.parentId]; if (mappedParent) { if (mappedParent.children) mappedParent.children.push(cd); else mappedParent.children = [cd]; } else { const parent = { id: mappedObj.parentId, children: [mappedObj], }; addedMap[mappedObj.parentId] = parent; addedMap[cd.id] = cd; } return; } if (isString(d.parentId)) { const parent = addedMap[d.parentId]; if (parent) { if (parent.children) parent.children.push(cd); else parent.children = [cd]; addedMap[cd.id] = cd; } else { const pa = { id: d.parentId, children: [cd], }; addedMap[pa.id] = pa; addedMap[cd.id] = cd; } } else { result.push(cd); addedMap[cd.id] = cd; } }); // proccess the nodes const nodeMap = {}; (nodes || []).forEach((node) => { nodeMap[node.id] = node; const combo = addedMap[node.comboId as string]; if (combo) { const cnode: NodeConfig = { id: node.id, comboId: node.comboId as string, }; if (combo.children) combo.children.push(cnode); else combo.children = [cnode]; cnode.itemType = "node"; addedMap[node.id] = cnode; } }); // assign the depth for each element let maxDepth = 0; result.forEach((tree: ComboTree) => { tree.depth = maxDepth + 10; traverse(tree, (child) => { let parent; const itemType = addedMap[child.id].itemType; if (itemType === "node") { parent = addedMap[child.comboId as string]; } else { parent = addedMap[child.parentId]; } if (parent) { if (itemType === "node") child.depth = maxDepth + 1; else child.depth = maxDepth + 10; } else { child.depth = maxDepth + 10; } if (maxDepth < child.depth) maxDepth = child.depth; const oriNodeModel = nodeMap[child.id]; if (oriNodeModel) { oriNodeModel.depth = child.depth; } return true; }); }); return result; }; export const reconstructTree = ( trees: ComboTree[], subtreeId?: string, newParentId?: string | undefined, ): ComboTree[] => { let brothers = trees; let subtree; const comboChildsMap = { root: { children: trees, }, }; let foundSubTree = false; let oldParentId = "root"; (trees || []).forEach((tree) => { if (foundSubTree) return; if (tree.id === subtreeId) { subtree = tree; if (tree.itemType === "combo") { subtree.parentId = newParentId; } else { subtree.comboId = newParentId; } foundSubTree = true; return; } traverseTree(tree, (child: any) => { comboChildsMap[child.id] = { children: child.children, }; // store the old parent id to delete the subtree from the old parent's children in next recursion brothers = comboChildsMap[child.parentId || child.comboId || "root"].children; if (child && (child.removed || subtreeId === child.id) && brothers) { oldParentId = child.parentId || child.comboId || "root"; subtree = child; // re-assign the parentId or comboId for the moved subtree if (child.itemType === "combo") { subtree.parentId = newParentId; } else { subtree.comboId = newParentId; } foundSubTree = true; return false; } return true; }); }); brothers = comboChildsMap[oldParentId].children; const index = brothers ? brothers.indexOf(subtree) : -1; if (index > -1) brothers.splice(index, 1); // 如果遍历完整棵树还没有找到,说明之前就不在树中 if (!foundSubTree) { subtree = { id: subtreeId, itemType: "node", comboId: newParentId, }; comboChildsMap[subtreeId] = { children: undefined, }; } // append to new parent if (subtreeId) { let found = false; // newParentId is undefined means the subtree will have no parent if (newParentId) { let newParentDepth = 0; (trees || []).forEach((tree) => { if (found) return; // terminate traverseTree(tree, (child: any) => { // append subtree to the new parent ans assign the depth to the subtree if (newParentId === child.id) { found = true; if (child.children) child.children.push(subtree); else child.children = [subtree]; newParentDepth = child.depth; if (subtree.itemType === "node") subtree.depth = newParentDepth + 2; else subtree.depth = newParentDepth + 1; return false; // terminate } return true; }); }); } else if ((!newParentId || !found) && subtree.itemType !== "node") { // if the newParentId is undefined or it is not found in the tree, add the subTree to the root trees.push(subtree); } // update the depth of the subtree and its children from the subtree let currentDepth = subtree.depth; traverseTree(subtree, (child: any) => { if (child.itemType === "node") currentDepth += 2; else currentDepth += 1; child.depth = currentDepth; return true; }); } return trees; }; export const getComboBBox = ( children: ComboTree[], graph: IAbstractGraph, ): BBox => { const comboBBox = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity, x: undefined, y: undefined, width: undefined, height: undefined, centerX: undefined, centerY: undefined, }; if (!children || children.length === 0) { return comboBBox; } children.forEach((child) => { const childItem = graph.findById(child.id); if (!childItem || !childItem.isVisible()) return; // ignore hidden children childItem.set("bboxCanvasCache", undefined); const childBBox = childItem.getCanvasBBox(); if (childBBox.x && comboBBox.minX > childBBox.minX) comboBBox.minX = childBBox.minX; if (childBBox.y && comboBBox.minY > childBBox.minY) comboBBox.minY = childBBox.minY; if (childBBox.x && comboBBox.maxX < childBBox.maxX) comboBBox.maxX = childBBox.maxX; if (childBBox.y && comboBBox.maxY < childBBox.maxY) comboBBox.maxY = childBBox.maxY; }); comboBBox.x = (comboBBox.minX + comboBBox.maxX) / 2; comboBBox.y = (comboBBox.minY + comboBBox.maxY) / 2; comboBBox.width = comboBBox.maxX - comboBBox.minX; comboBBox.height = comboBBox.maxY - comboBBox.minY; comboBBox.centerX = (comboBBox.minX + comboBBox.maxX) / 2; comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2; Object.keys(comboBBox).forEach((key) => { if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) { comboBBox[key] = undefined; } }); return comboBBox; }; export const shouldRefreshEdge = (cfg) => { let refreshEdge = isNumber(cfg.x) || isNumber(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size; if (cfg.style) refreshEdge = refreshEdge || isNumber(cfg.style.r) || isNumber(cfg.style.width) || isNumber(cfg.style.height) || isNumber(cfg.style.rx) || isNumber(cfg.style.ry); return refreshEdge; }; export const cloneBesidesImg = (obj) => { const clonedObj = {}; Object.keys(obj).forEach((key1) => { const obj2 = obj[key1]; if (isObject(obj2)) { const clonedObj2 = {}; Object.keys(obj2).forEach((key2) => { const v = obj2[key2]; if (key2 === "img" && !isString(v)) return; clonedObj2[key2] = clone(v); }); clonedObj[key1] = clonedObj2; } else { clonedObj[key1] = clone(obj2); } }); return clonedObj; }; ================================================ FILE: packages/core/src/util/index.ts ================================================ import * as MathUtil from "./math"; import * as GraphicUtil from "./graphic"; import * as PathUtil from "./path"; import * as BaseUtil from "./base"; import * as ColorUtil from "./color"; import { ext, mat3 } from "@antv/matrix-util"; const transform = ext.transform; const Util = { ...BaseUtil, ...GraphicUtil, ...PathUtil, ...MathUtil, ...ColorUtil, transform, mat3, }; export default Util; ================================================ FILE: packages/core/src/util/letterAspectRatio.ts ================================================ export default { " ": 0.3329986572265625, a: 0.5589996337890625, A: 0.6569992065429687, b: 0.58599853515625, B: 0.6769989013671875, c: 0.5469985961914062, C: 0.7279998779296875, d: 0.58599853515625, D: 0.705999755859375, e: 0.554998779296875, E: 0.63699951171875, f: 0.37299957275390627, F: 0.5769989013671875, g: 0.5909988403320312, G: 0.7479995727539063, h: 0.555999755859375, H: 0.7199996948242188, i: 0.255999755859375, I: 0.23699951171875, j: 0.26699981689453123, J: 0.5169998168945312, k: 0.5289993286132812, K: 0.6899993896484375, l: 0.23499908447265624, L: 0.5879989624023437, m: 0.854998779296875, M: 0.8819992065429687, n: 0.5589996337890625, N: 0.7189987182617188, o: 0.58599853515625, O: 0.7669998168945312, p: 0.58599853515625, P: 0.6419998168945312, q: 0.58599853515625, Q: 0.7669998168945312, r: 0.3649993896484375, R: 0.6759994506835938, s: 0.504998779296875, S: 0.6319992065429687, t: 0.354998779296875, T: 0.6189987182617187, u: 0.5599990844726562, U: 0.7139999389648437, v: 0.48199920654296874, V: 0.6389999389648438, w: 0.754998779296875, W: 0.929998779296875, x: 0.5089996337890625, X: 0.63699951171875, y: 0.4959991455078125, Y: 0.66199951171875, z: 0.48699951171875, Z: 0.6239990234375, "0": 0.6, "1": 0.40099945068359377, "2": 0.6, "3": 0.6, "4": 0.6, "5": 0.6, "6": 0.6, "7": 0.5469985961914062, "8": 0.6, "9": 0.6, "[": 0.3329986572265625, "]": 0.3329986572265625, ",": 0.26399993896484375, ".": 0.26399993896484375, ";": 0.26399993896484375, ":": 0.26399993896484375, "{": 0.3329986572265625, "}": 0.3329986572265625, "\\": 0.5, "|": 0.19499969482421875, "=": 0.604998779296875, "+": 0.604998779296875, "-": 0.604998779296875, _: 0.5, "`": 0.3329986572265625, " ~": 0.8329986572265625, "!": 0.3329986572265625, "@": 0.8579986572265625, "#": 0.6, $: 0.6, "%": 0.9699996948242188, "^": 0.517999267578125, "&": 0.7259994506835937, "*": 0.505999755859375, "(": 0.3329986572265625, ")": 0.3329986572265625, "<": 0.604998779296875, ">": 0.604998779296875, "/": 0.5, "?": 0.53699951171875, }; ================================================ FILE: packages/core/src/util/math.ts ================================================ import { Point, IGroup } from "@antv/g-base"; import { mat3, vec3, ext, vec2 } from "@antv/matrix-util"; import { isArray, each } from "@antv/util"; import { GraphData, ICircle, IEllipse, IRect, Matrix, EdgeConfig, NodeIdxMap, IBBox, Item, IPoint, } from "../types"; const transform = ext.transform; /** * 对比对象,用于对象数组排序 * @param {string} attributeName 排序依据的字段名称 * @param {number} min 最小值 * @param {number} max 最大值 * @return {boolean} bool 布尔 */ export const compare = (attributeName: string) => { return (m, n) => { return m[attributeName] - n[attributeName]; }; }; /** * 是否在区间内 * @param {number} value 值 * @param {number} min 最小值 * @param {number} max 最大值 * @return {boolean} bool 布尔 */ const isBetween = (value: number, min: number, max: number) => value >= min && value <= max; /** * 获取两条线段的交点 * @param {Point} p0 第一条线段起点 * @param {Point} p1 第一条线段终点 * @param {Point} p2 第二条线段起点 * @param {Point} p3 第二条线段终点 * @return {Point} 交点 */ export const getLineIntersect = ( p0: Point, p1: Point, p2: Point, p3: Point, ): Point | null => { const tolerance = 0.0001; const E: Point = { x: p2.x - p0.x, y: p2.y - p0.y, }; const D0: Point = { x: p1.x - p0.x, y: p1.y - p0.y, }; const D1: Point = { x: p3.x - p2.x, y: p3.y - p2.y, }; const kross: number = D0.x * D1.y - D0.y * D1.x; const sqrKross: number = kross * kross; const invertKross: number = 1 / kross; const sqrLen0: number = D0.x * D0.x + D0.y * D0.y; const sqrLen1: number = D1.x * D1.x + D1.y * D1.y; if (sqrKross > tolerance * sqrLen0 * sqrLen1) { const s = (E.x * D1.y - E.y * D1.x) * invertKross; const t = (E.x * D0.y - E.y * D0.x) * invertKross; if (!isBetween(s, 0, 1) || !isBetween(t, 0, 1)) return null; return { x: p0.x + s * D0.x, y: p0.y + s * D0.y, }; } return null; }; /** * point and rectangular intersection point * @param {IRect} rect rect * @param {Point} point point * @return {PointPoint} rst; */ export const getRectIntersectByPoint = ( rect: IRect, point: Point, ): Point | null => { const { x, y, width, height } = rect; const cx = x + width / 2; const cy = y + height / 2; const points: Point[] = []; const center: Point = { x: cx, y: cy, }; points.push({ x, y, }); points.push({ x: x + width, y, }); points.push({ x: x + width, y: y + height, }); points.push({ x, y: y + height, }); points.push({ x, y, }); let rst: Point | null = null; for (let i = 1; i < points.length; i++) { rst = getLineIntersect(points[i - 1], points[i], center, point); if (rst) { break; } } return rst; }; /** * get point and circle inIntersect * @param {ICircle} circle 圆点,x,y,r * @param {Point} point 点 x,y * @return {Point} applied point */ export const getCircleIntersectByPoint = ( circle: ICircle, point: Point, ): Point | null => { const { x: cx, y: cy, r } = circle; const { x, y } = point; const dx = x - cx; const dy = y - cy; const d = Math.sqrt(dx * dx + dy * dy); if (d < r) { return null; } const signX = Math.sign(dx); const signY = Math.sign(dy); const angle = Math.atan(dy / dx); return { x: cx + Math.abs(r * Math.cos(angle)) * signX, y: cy + Math.abs(r * Math.sin(angle)) * signY, }; }; /** * get point and ellipse inIntersect * @param {Object} ellipse 椭圆 x,y,rx,ry * @param {Object} point 点 x,y * @return {object} applied point */ export const getEllipseIntersectByPoint = ( ellipse: IEllipse, point: Point, ): Point => { const a = ellipse.rx; const b = ellipse.ry; const cx = ellipse.x; const cy = ellipse.y; const dx = point.x - cx; const dy = point.y - cy; // 直接通过 x,y 求夹角,求出来的范围是 -PI, PI let angle = Math.atan2(dy / b, dx / a); if (angle < 0) { angle += 2 * Math.PI; // 转换到 0,2PI } return { x: cx + a * Math.cos(angle), y: cy + b * Math.sin(angle), }; }; /** * coordinate matrix transformation * @param {number} point coordinate * @param {Matrix} matrix matrix * @param {number} tag could be 0 or 1 * @return {Point} transformed point */ export const applyMatrix = ( point: Point, matrix: Matrix, tag: 0 | 1 = 1, ): Point => { const vector: vec3 = [point.x, point.y, tag]; if (!matrix || isNaN(matrix[0])) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } vec3.transformMat3(vector, vector, matrix as mat3); return { x: vector[0], y: vector[1], }; }; /** * coordinate matrix invert transformation * @param {number} point coordinate * @param {number} matrix matrix * @param {number} tag could be 0 or 1 * @return {object} transformed point */ export const invertMatrix = ( point: Point, matrix: Matrix, tag: 0 | 1 = 1, ): Point => { if (!matrix || isNaN(matrix[0])) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } let inversedMatrix = mat3.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], matrix as mat3); if (!inversedMatrix) { inversedMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } const vector: vec3 = [point.x, point.y, tag]; vec3.transformMat3(vector, vector, inversedMatrix); return { x: vector[0], y: vector[1], }; }; /** * * @param p1 First coordinate * @param p2 second coordinate * @param p3 three coordinate */ export const getCircleCenterByPoints = ( p1: Point, p2: Point, p3: Point, ): Point => { const a = p1.x - p2.x; const b = p1.y - p2.y; const c = p1.x - p3.x; const d = p1.y - p3.y; const e = (p1.x * p1.x - p2.x * p2.x - p2.y * p2.y + p1.y * p1.y) / 2; const f = (p1.x * p1.x - p3.x * p3.x - p3.y * p3.y + p1.y * p1.y) / 2; const denominator = b * c - a * d; return { x: -(d * e - b * f) / denominator, y: -(a * f - c * e) / denominator, }; }; /** * get distance by two points * @param p1 first point * @param p2 second point */ export const distance = (p1: Point, p2: Point): number => { const vx = p1.x - p2.x; const vy = p1.y - p2.y; return Math.sqrt(vx * vx + vy * vy); }; /** * scale matrix * @param matrix [ [], [], [] ] * @param ratio */ export const scaleMatrix = (matrix: Matrix[], ratio: number) => { const result: Matrix[] = []; matrix.forEach((row) => { const newRow: number[] = []; row.forEach((v) => { newRow.push(v * ratio); }); result.push(newRow); }); return result; }; /** * Floyd Warshall algorithm for shortest path distances matrix * @param {array} adjMatrix adjacency matrix * @return {array} distances shortest path distances matrix */ export const floydWarshall = (adjMatrix: Matrix[]): Matrix[] => { // initialize const dist: Matrix[] = []; const size = adjMatrix.length; for (let i = 0; i < size; i += 1) { dist[i] = []; for (let j = 0; j < size; j += 1) { if (i === j) { dist[i][j] = 0; } else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) { dist[i][j] = Infinity; } else { dist[i][j] = adjMatrix[i][j]; } } } // floyd for (let k = 0; k < size; k += 1) { for (let i = 0; i < size; i += 1) { for (let j = 0; j < size; j += 1) { if (dist[i][j] > dist[i][k] + dist[k][j]) { dist[i][j] = dist[i][k] + dist[k][j]; } } } } return dist; }; /** * get adjacency matrix * @param data graph data * @param directed whether it's a directed graph */ export const getAdjMatrix = (data: GraphData, directed: boolean): Matrix[] => { const { nodes, edges } = data; const matrix: Matrix[] = []; // map node with index in data.nodes const nodeMap: { [key: string]: number; } = {}; if (!nodes) { throw new Error("invalid nodes data!"); } if (nodes) { nodes.forEach((node, i) => { nodeMap[node.id] = i; const row: number[] = []; matrix.push(row); }); } if (edges) { edges.forEach((e) => { const { source, target } = e; const sIndex = nodeMap[source as string]; const tIndex = nodeMap[target as string]; matrix[sIndex][tIndex] = 1; if (!directed) { matrix[tIndex][sIndex] = 1; } }); } return matrix; }; /** * 平移group * @param group Group 实例 * @param vec 移动向量 */ export const translate = (group: IGroup, vec: Point) => { group.translate(vec.x, vec.y); }; /** * 移动到指定坐标点 * @param group Group 实例 * @param point 移动到的坐标点 */ export const move = (group: IGroup, point: Point) => { let matrix: Matrix = group.getMatrix(); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } const bbox = group.getCanvasBBox(); const vx = point.x - bbox.minX; const vy = point.y - bbox.minY; const movedMatrix = transform(matrix, [["t", vx, vy]]); group.setMatrix(movedMatrix); }; /** * 缩放 group * @param group Group 实例 * @param point 在x 和 y 方向上的缩放比例 */ export const scale = (group: IGroup, ratio: number | number[]) => { let matrix: Matrix = group.getMatrix(); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } let scaleXY = ratio; if (!isArray(ratio)) { scaleXY = [ratio, ratio]; } if (isArray(ratio) && ratio.length === 1) { scaleXY = [ratio[0], ratio[0]]; } matrix = transform(matrix, [ ["s", (scaleXY as number[])[0], (scaleXY as number[])[1]], ]); group.setMatrix(matrix); }; /** * * @param group Group 实例 * @param ratio 选择角度 */ export const rotate = (group: IGroup, angle: number) => { let matrix: Matrix = group.getMatrix(); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } matrix = transform(matrix, [["r", angle]]); group.setMatrix(matrix); }; export const getDegree = ( n: number, nodeIdxMap: NodeIdxMap, edges: EdgeConfig[], ): number[] => { const degrees: number[] = []; for (let i = 0; i < n; i++) { degrees[i] = 0; } edges.forEach((e) => { if (e.source) { degrees[nodeIdxMap[e.source]] += 1; } if (e.target) { degrees[nodeIdxMap[e.target]] += 1; } }); return degrees; }; // 判断点Q是否在p1和p2的线段上 function onSegment(p1, p2, q) { if ( (q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) && Math.min(p1[0], p2[0]) <= q[0] && q[0] <= Math.max(p1[0], p2[0]) && Math.min(p1[1], p2[1]) <= q[1] && q[1] <= Math.max(p1[1], p2[1]) ) { return true; } return false; } /** * 判断点P在多边形内-射线法. Borrow from https://github.com/antvis/util/blob/master/packages/path-util/src/point-in-polygon.ts * @param points * @param x * @param y */ export const isPointInPolygon = (points: number[][], x: number, y: number) => { let isHit = false; const n = points.length; // 判断两个double在eps精度下的大小关系 const tolerance = 1e-6; function dcmp(xValue) { if (Math.abs(xValue) < tolerance) { return 0; } return xValue < 0 ? -1 : 1; } if (n <= 2) { // svg 中点小于 3 个时,不显示,也无法被拾取 return false; } for (let i = 0; i < n; i++) { const p1 = points[i]; const p2 = points[(i + 1) % n]; if (onSegment(p1, p2, [x, y])) { // 点在多边形一条边上 return true; } // 前一个判断min(p1[1],p2[1]) 0 !== dcmp(p2[1] - y) > 0 && dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0 ) { isHit = !isHit; } } return isHit; }; // 判断两个BBox是否相交 export const intersectBBox = (box1: Partial, box2: Partial) => { return !( box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY ); }; const lineIntersectPolygon = (lines, line) => { let isIntersect = false; each(lines, (l) => { if (getLineIntersect(l.from, l.to, line.from, line.to)) { isIntersect = true; return false; } }); return isIntersect; }; /** * 判断两个polygon是否相交。 * borrow from @antv/path-util * @param points1 polygon1的顶点数组 * @param points2 polygon2的顶点数组 */ export const isPolygonsIntersect = ( points1: number[][], points2: number[][], ): boolean => { type BBox = Partial; const getBBox = (points): BBox => { const xArr = points.map((p) => p[0]); const yArr = points.map((p) => p[1]); return { minX: Math.min.apply(null, xArr), maxX: Math.max.apply(null, xArr), minY: Math.min.apply(null, yArr), maxY: Math.max.apply(null, yArr), }; }; const parseToLines = (points: number[][]) => { const lines = []; const count = points.length; for (let i = 0; i < count - 1; i++) { const point = points[i]; const next = points[i + 1]; lines.push({ from: { x: point[0], y: point[1], }, to: { x: next[0], y: next[1], }, }); } if (lines.length > 1) { const first = points[0]; const last = points[count - 1]; lines.push({ from: { x: last[0], y: last[1], }, to: { x: first[0], y: first[1], }, }); } return lines; }; // 空数组,或者一个点返回 false if (points1.length < 2 || points2.length < 2) { return false; } const bbox1 = getBBox(points1); const bbox2 = getBBox(points2); // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况 if (!intersectBBox(bbox1, bbox2)) { return false; } let isIn = false; // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回 each(points2, (point) => { if (isPointInPolygon(points1, point[0], point[1])) { isIn = true; return false; } }); if (isIn) { return true; } each(points1, (point) => { if (isPointInPolygon(points2, point[0], point[1])) { isIn = true; return false; } }); if (isIn) { return true; } const lines1 = parseToLines(points1); const lines2 = parseToLines(points2); let isIntersect = false; each(lines2, (line) => { if (lineIntersectPolygon(lines1, line)) { isIntersect = true; return false; } }); return isIntersect; }; export class Line { public x1: number; public y1: number; public x2: number; public y2: number; constructor(x1: number, y1: number, x2: number, y2: number) { this.x1 = x1; this.y1 = y1; this.x2 = x2; this.y2 = y2; } public getBBox() { const minX = Math.min(this.x1, this.x2); const minY = Math.min(this.y1, this.y2); const maxX = Math.max(this.x1, this.x2); const maxY = Math.max(this.y1, this.y2); const res = { x: minX, y: minY, minX, minY, maxX, maxY, width: maxX - minX, height: maxY - minY, }; return res; } } export const getBBoxBoundLine = (bbox: IBBox, direction: string) => { const bounds = { top: [bbox.minX, bbox.minY, bbox.maxX, bbox.minY], left: [bbox.minX, bbox.minY, bbox.minX, bbox.maxY], bottom: [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY], right: [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY], }; return bounds[direction]; }; /** * 计算两条线段相交时,相交点对第一条线段上的分割比例 */ const fractionAlongLineA = (la: Line, lb: Line) => { const uaT = (lb.x2 - lb.x1) * (la.y1 - lb.y1) - (lb.y2 - lb.y1) * (la.x1 - lb.x1); const ubT = (la.x2 - la.x1) * (la.y1 - lb.y1) - (la.y2 - la.y1) * (la.x1 - lb.x1); const uB = (lb.y2 - lb.y1) * (la.x2 - la.x1) - (lb.x2 - lb.x1) * (la.y2 - la.y1); if (uB) { const ua = uaT / uB; const ub = ubT / uB; if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) { return ua; } } return Number.POSITIVE_INFINITY; }; export const itemIntersectByLine = ( item: Item, line: Line, ): [IPoint[], number] => { const directions = ["top", "left", "bottom", "right"]; const bbox = item.getBBox(); let countIntersections = 0; const intersections = []; for (let i = 0; i < 4; i++) { const [x1, y1, x2, y2] = getBBoxBoundLine(bbox, directions[i]); intersections[i] = getLineIntersect( { x: line.x1, y: line.y1 }, { x: line.x2, y: line.y2 }, { x: x1, y: y1 }, { x: x2, y: y2 }, ); if (intersections[i]) { countIntersections += 1; } } return [intersections, countIntersections]; }; export const fractionToLine = (item: Item, line: Line) => { const directions = ["top", "left", "bottom", "right"]; const bbox = item.getBBox(); let minDistance = Number.POSITIVE_INFINITY; let countIntersections = 0; for (let i = 0; i < 4; i++) { const [x1, y1, x2, y2] = getBBoxBoundLine(bbox, directions[i]); let testDistance = fractionAlongLineA(line, new Line(x1, y1, x2, y2)); testDistance = Math.abs(testDistance - 0.5); if (testDistance >= 0 && testDistance <= 1) { countIntersections += 1; minDistance = testDistance < minDistance ? testDistance : minDistance; } } if (countIntersections === 0) return -1; return minDistance; }; export const getPointsCenter = (points: IPoint[]): IPoint => { let centerX = 0; let centerY = 0; if (points.length > 0) { for (const point of points) { centerX += point.x; centerY += point.y; } centerX /= points.length; centerY /= points.length; } return { x: centerX, y: centerY }; }; export const squareDist = (a: IPoint, b: IPoint): number => { return (a.x - b.x) ** 2 + (a.y - b.y) ** 2; }; export const pointLineSquareDist = (point: IPoint, line: Line) => { const x1 = line.x1; const y1 = line.y1; const x2 = line.x2 - x1; const y2 = line.y2 - y1; let px = point.x - x1; let py = point.y - y1; let dotprod = px * x2 + py * y2; let projlenSq; if (dotprod <= 0) { projlenSq = 0; } else { px = x2 - px; py = y2 - py; dotprod = px * x2 + py * y2; if (dotprod <= 0) { projlenSq = 0; } else { projlenSq = (dotprod * dotprod) / (x2 * x2 + y2 * y2); } } let lenSq = px * px + py * py - projlenSq; if (lenSq < 0) { lenSq = 0; } return lenSq; }; export const isPointsOverlap = (p1, p2, e = 1e-3) => { return (p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2 < e ** 2; }; /** * 点到矩形的距离的平方:矩形内部点视作距离为0,外部的点若投影落在矩形边上则为点到矩形边的最近的垂直距离,否则为点到矩形顶点的距离, * @param point IPoint * @param rect IRect */ export const pointRectSquareDist = (point: Point, rect: IRect) => { const isLeft = point.x < rect.x; const isRight = point.x > rect.x + rect.width; const isTop = point.y > rect.y + rect.height; const isBottom = point.y < rect.y; const isPointOutside = isLeft || isRight || isTop || isBottom; if (!isPointOutside) { return 0; } if (isTop && !isLeft && !isRight) { return (rect.y + rect.height - point.y) ** 2; } if (isBottom && !isLeft && !isRight) { return (point.y - rect.y) ** 2; } if (isLeft && !isTop && !isBottom) { return (rect.x - point.x) ** 2; } if (isRight && !isTop && !isBottom) { return (rect.x + rect.width - point.x) ** 2; } const dx = Math.min( Math.abs(rect.x - point.x), Math.abs(rect.x + rect.width - point.x), ); const dy = Math.min( Math.abs(rect.y - point.y), Math.abs(rect.y + rect.height - point.y), ); return dx * dx + dy * dy; }; /** * point to line distance * @param {array} line 线的四个顶点 [x1, y1, x2, y2] * @param {object} point 坐标点 {x, y} * @return {Number|NaN} distance */ export const pointLineDistance = (line, point) => { const [x1, y1, x2, y2] = line; const { x, y } = point; const d = [x2 - x1, y2 - y1]; if (vec2.exactEquals(d as any, [0, 0])) { return NaN; } const u = [-d[1], d[0]]; // @ts-ignore vec2.normalize(u, u); const a = [x - x1, y - y1]; // @ts-ignore return Math.abs(vec2.dot(a, u)); }; ================================================ FILE: packages/core/src/util/path.ts ================================================ import { vec2 } from "@antv/matrix-util"; import { catmullRom2Bezier } from "@antv/path-util"; import { IPoint } from "../types"; /** * 替换字符串中的字段 * @param {String} str 模版字符串 * @param {Object} o json data */ const substitute = (str: string, o: any): string => { if (!str || !o) { return str; } return str.replace(/\\?\{([^{}]+)\}/g, (match: string, name: string) => { if (match.charAt(0) === "\\") { return match.slice(1); } let res = o[name]; if (res === 0) res = "0"; return res || ""; }); }; /** * 给定坐标获取三次贝塞尔曲线的 M 及 C 值 * @param points coordinate set */ export const getSpline = (points: IPoint[]) => { const data: number[] = []; if (points.length < 2) { throw new Error( `point length must largn than 2, now it's ${points.length}`, ); } for (const point of points) { const { x, y } = point; data.push(x); data.push(y); } const spliePath = catmullRom2Bezier(data); spliePath.unshift(["M", points[0].x, points[0].y]); return spliePath; }; /** * 根据起始点、相对位置、偏移量计算控制点 * @param {IPoint} startPoint 起始点,包含 x,y * @param {IPoint} endPoint 结束点, 包含 x,y * @param {Number} percent 相对位置,范围 0-1 * @param {Number} offset 偏移量 * @return {IPoint} 控制点,包含 x,y */ export const getControlPoint = ( startPoint: IPoint, endPoint: IPoint, percent: number = 0, offset: number = 0, ): IPoint => { const point: IPoint = { x: (1 - percent) * startPoint.x + percent * endPoint.x, y: (1 - percent) * startPoint.y + percent * endPoint.y, }; let tangent: vec2 = [0, 0]; vec2.normalize(tangent, [ endPoint.x - startPoint.x, endPoint.y - startPoint.y, ]); if (!tangent || (!tangent[0] && !tangent[1])) { tangent = [0, 0]; } const perpendicular = [-tangent[1] * offset, tangent[0] * offset]; // 垂直向量 point.x += perpendicular[0]; point.y += perpendicular[1]; return point; }; /** * 点集转化为Path多边形 * @param {Array} points 点集 * @param {Boolen} z 是否封闭 * @return {Array} Path */ export const pointsToPolygon = ( points: IPoint[] | ({ x: number; y: number } | string)[], z?: boolean, ): string => { const { length } = points; if (!length) { return ""; } let path = ""; let str = ""; for (let i = 0; i < length; i++) { const item = points[i]; if (i === 0) { str = "M{x} {y}"; } else { str = "L{x} {y}"; } path += substitute(str, item); } if (z) { path += "Z"; } return path; }; export const pathToPoints = (path: any[]) => { const points = []; path.forEach((seg) => { const command = seg[0]; if (command !== "A") { for (let i = 1; i < seg.length; i = i + 2) { points.push([seg[i], seg[i + 1]]); } } else { const length = seg.length; points.push([seg[length - 2], seg[length - 1]]); } }); return points; }; /** * 生成平滑的闭合曲线 * @param points */ export const getClosedSpline = (points: IPoint[]) => { if (points.length < 2) { throw new Error( `point length must largn than 2, now it's ${points.length}`, ); } const first = points[0]; const second = points[1]; const last = points[points.length - 1]; const lastSecond = points[points.length - 2]; points.unshift(last); points.unshift(lastSecond); points.push(first); points.push(second); const closedPath = []; for (let i = 1; i < points.length - 2; i += 1) { const x0 = points[i - 1].x; const y0 = points[i - 1].y; const x1 = points[i].x; const y1 = points[i].y; const x2 = points[i + 1].x; const y2 = points[i + 1].y; const x3 = i !== points.length - 2 ? points[i + 2].x : x2; const y3 = i !== points.length - 2 ? points[i + 2].y : y2; const cp1x = x1 + (x2 - x0) / 6; const cp1y = y1 + (y2 - y0) / 6; const cp2x = x2 - (x3 - x1) / 6; const cp2y = y2 - (y3 - y1) / 6; closedPath.push(["C", cp1x, cp1y, cp2x, cp2y, x2, y2]); } closedPath.unshift(["M", last.x, last.y]); return closedPath; }; const vecScaleTo = (v: vec2, length: number) => { // Vector with direction of v with specified length return vec2.scale([0, 0], vec2.normalize([0, 0], v), length); }; const unitNormal = (p0: vec2, p1: vec2): vec2 => { // Returns the unit normal to the line segment from p0 to p1. const n = [p0[1] - p1[1], p1[0] - p0[0]]; const nLength = Math.sqrt(n[0] * n[0] + n[1] * n[1]); if (nLength === 0) { throw new Error("p0 should not be equal to p1"); } return [n[0] / nLength, n[1] / nLength]; }; const vecFrom = (p0: vec2, p1: vec2): vec2 => { // Vector from p0 to p1 return [p1[0] - p0[0], p1[1] - p0[1]] as vec2; }; /** * 传入的节点作为多边形顶点,生成有圆角的多边形 * @param polyPoints 多边形顶点 * @param padding 在原多边形基础上增加最终轮廓和原多边形的空白间隔 */ export function roundedHull(polyPoints: vec2[], padding: number) { // The rounded hull path around a single point const roundedHull1 = (points: vec2[]) => { const p1 = [points[0][0], points[0][1] - padding]; const p2 = [points[0][0], points[0][1] + padding]; return `M ${p1} A ${padding},${padding},0,0,0,${p2} A ${padding},${padding},0,0,0,${p1}`; }; // The rounded hull path around two points const roundedHull2 = (points: vec2[]) => { const offsetVector = vec2.scale( [0, 0], unitNormal(points[0], points[1]), padding, ); const invOffsetVector = vec2.scale([0, 0], offsetVector, -1); const p0 = vec2.add([0, 0], points[0], offsetVector); const p1 = vec2.add([0, 0], points[1], offsetVector); const p2 = vec2.add([0, 0], points[1], invOffsetVector); const p3 = vec2.add([0, 0], points[0], invOffsetVector); return `M ${p0} L ${p1} A ${[padding, padding, "0,0,0", p2].join( ",", )} L ${p3} A ${[padding, padding, "0,0,0", p0].join(",")}`; }; // 特殊情况处理:节点数小于等于2 if (!polyPoints || polyPoints.length < 1) return ""; if (polyPoints.length === 1) return roundedHull1(polyPoints); if (polyPoints.length === 2) return roundedHull2(polyPoints); let segments = new Array(polyPoints.length); // Calculate each offset (outwards) segment of the convex hull. for (let segmentIndex = 0; segmentIndex < segments.length; ++segmentIndex) { const p0 = segmentIndex === 0 ? polyPoints[polyPoints.length - 1] : polyPoints[segmentIndex - 1]; const p1 = polyPoints[segmentIndex]; // Compute the offset vector for the line segment, with length = padding. const offset = vec2.scale([0, 0], unitNormal(p0, p1), padding); segments[segmentIndex] = [ vec2.add([0, 0], p0, offset), vec2.add([0, 0], p1, offset), ]; } const arcData = `A ${[padding, padding, "0,0,0,"].join(",")}`; segments = segments.map((segment, index) => { let pathFragment = ""; if (index === 0) { pathFragment = `M ${segments[segments.length - 1][1]} `; } pathFragment += `${arcData + segment[0]} L ${segment[1]}`; return pathFragment; }); return segments.join(" "); } /** * 传入的节点作为多边形顶点,生成平滑的闭合多边形 * @param polyPoints * @param padding */ export function paddedHull(polyPoints: vec2[], padding: number) { const pointCount = polyPoints.length; const smoothHull1 = (points) => { // Returns the path for a circular hull around a single point. const p1 = [points[0][0], points[0][1] - padding]; const p2 = [points[0][0], points[0][1] + padding]; return `M ${p1} A ${[padding, padding, "0,0,0", p2].join(",")} A ${[ padding, padding, "0,0,0", p1, ].join(",")}`; }; // Returns the path for a rounded hull around two points. const smoothHull2 = (points) => { const v = vecFrom(points[0], points[1]); const extensionVec = vecScaleTo(v, padding); const extension0 = vec2.add( [0, 0], points[0], vec2.scale([0, 0], extensionVec, -1), ); const extension1 = vec2.add([0, 0], points[1], extensionVec); const tangentHalfLength = 1.2 * padding; const controlDelta = vecScaleTo( vec2.normalize([0, 0], v), tangentHalfLength, ); const invControlDelta = vec2.scale([0, 0], controlDelta, -1); const control0 = vec2.add([0, 0], extension0, invControlDelta); const control1 = vec2.add([0, 0], extension1, invControlDelta); const control3 = vec2.add([0, 0], extension0, controlDelta); // return [ // ['M', extension0[0], extension0[1]], // ['C', control0, control1, extension1], // ['S', control3, extension0], // 'Z', // ]; return `M ${extension0} C ${[control0, control1, extension1].join( ",", )} S ${[control3, extension0].join(",")} Z`; }; // Handle special cases if (!polyPoints || pointCount < 1) return ""; if (pointCount === 1) return smoothHull1(polyPoints); if (pointCount === 2) return smoothHull2(polyPoints); const hullPoints = polyPoints.map((point, index) => { const pNext = polyPoints[(index + 1) % pointCount]; return { p: point, v: vec2.normalize([0, 0], vecFrom(point, pNext)), }; }); // Compute the expanded hull points, and the nearest prior control point for each. for (let i = 0; i < hullPoints.length; ++i) { const priorIndex = i > 0 ? i - 1 : pointCount - 1; const extensionVec = vec2.normalize( [0, 0], vec2.add( [0, 0], hullPoints[priorIndex].v, vec2.scale([0, 0], hullPoints[i].v, -1), ), ); hullPoints[i].p = vec2.add( [0, 0], hullPoints[i].p as vec2, vec2.scale([0, 0], extensionVec, padding), ); } return hullPoints.map((obj) => { const point = obj.p; return { x: point[0], y: point[1] }; }); } ================================================ FILE: packages/core/src/util/validation.ts ================================================ import { isString, isPlainObject } from "@antv/util"; import { GraphData, TreeGraphData, NodeConfig, EdgeConfig, ComboConfig, ITEM_TYPE, } from "../types"; import { traverseTree } from "./graphic"; /** * 验证关系图或树图数据的合法性,必须符合以下规则才会渲染图: * 1. 必须传入数据 * 2. 节点的 ID 必须为字符串,暂不支持数字类型,如果支持数字类型,会出现类似 123 与 '123' 是否相等的问题 * 3. 边的 source 和 target 值必须在节点 ID 中存在 * @param data 关系图或树图数据 * @return boolean 全部验证通过返回 true,否则返回 false */ export const dataValidation = (data?: GraphData | TreeGraphData): boolean => { // 1. 必须传入数据 if (!data) { console.error("G6 Error Tips: the data must be defined"); return false; } // 2. 节点的 ID 必须为字符串或数字类型 const { nodes, edges, combos = [] } = data; if (!nodes && !edges) { let validated = true; // 不存在 nodes 和 edges,则说明是 TreeGraphData,按 TreeGraphData 规则验证 traverseTree(data as TreeGraphData, (param) => { if (!isString(param.id)) { validated = false; return false; } return true; }); return validated; } const nonNode = ((nodes as NodeConfig[]) || []).find( (node) => !isString(node.id), ); if (nonNode) { console.warn( `G6 Warning Tips: missing 'id' property, or %c${nonNode.id}%c is not a string.`, "font-size: 20px; color: red;", "", ); return false; } // 3. 边的 source 和 target 必须存在于节点 或 Combo中 const nodeIds = ((nodes as NodeConfig[]) || []).map((node) => node.id); const comboIds = (combos as ComboConfig[]).map((combo) => combo.id); const ids = [...nodeIds, ...comboIds]; const nonEdges = ((edges as EdgeConfig[]) || []).find( (edge) => !ids.includes(edge.source) || !ids.includes(edge.target), ); if (nonEdges) { console.warn( `G6 Warning Tips: The source %c${nonEdges.source}%c or the target %c${nonEdges.target}%c of the edge do not exist in the nodes or combos.`, "font-size: 20px; color: red;", "", "font-size: 20px; color: red;", "", ); return false; } return true; }; /** * 验证添加节点、边或从combo时的数据 * @param type 节点、边或从combo * @param data 添加的单条数据 * @return boolean 全部验证通过返回 true,否则返回 false */ export const singleDataValidation = ( type: ITEM_TYPE, data: NodeConfig | EdgeConfig | ComboConfig, ): boolean => { if (type === "node" || type === "combo") { // 必须有 id 字段,且id必须为字符串类型 if (data.id && !isString(data.id)) { console.warn( `G6 Warning Tips: missing 'id' property, or the 'id' %c${data.id}%c is not a string.`, "font-size: 20px; color: red;", "", ); return false; } } else if (type === "edge") { // 必须有 source 和 target 字段 if (!(data as EdgeConfig).source || !(data as EdgeConfig).target) { console.warn( `G6 Warning Tips: missing 'source' or 'target' for the edge.`, ); return false; } } return true; }; ================================================ FILE: packages/core/tests/unit/index-spec.ts ================================================ import { version } from "../../package.json"; import Global from "../../src/global"; describe("G6 version", () => { it("export", () => { expect(Global.version).toBe(version); }); }); ================================================ FILE: packages/core/tsconfig.json ================================================ { "compilerOptions": { "module": "commonjs", "target": "es5", "lib": ["es5", "es6", "dom", "es2016"], "esModuleInterop": true, "allowJs": true, "resolveJsonModule": true, // Enable this to import JSON modules "moduleResolution": "node" // This often needs to be set as well }, "include": ["src/**/*.ts", "tests/**/*.ts"] } ================================================ FILE: packages/core/vite.config.ts ================================================ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "src"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), // 入口文件 name: "f6-core", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6-core", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/element/package.json ================================================ { "name": "@antv/f6-element", "version": "0.0.1", "description": "A Graph Visualization Framework in JavaScript", "keywords": [ "antv", "g6", "graph", "graph analysis", "graph editor", "graph visualization", "relational data" ], "homepage": "https://g6.antv.vision", "bugs": { "url": "https://github.com/antvis/g6/issues" }, "repository": { "type": "git", "url": "https://github.com/antvis/g6" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "files": [ "package.json", "es", "lib", "dist", "LICENSE", "README.md" ], "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "types": "lib/index.d.ts", "scripts": { "clean": "rimraf dist", "build": "vite build" }, "dependencies": { "@antv/g-base": "^0.5.9", "@antv/f6-core": "workspace:*", "@antv/util": "~2.0.5" }, "devDependencies": { "vite": "~5.3.1", "@vitejs/plugin-react": "~4.3.1" } } ================================================ FILE: packages/element/src/edges/index.ts ================================================ import "./polyline"; ================================================ FILE: packages/element/src/edges/polyline-util.ts ================================================ import { each } from "@antv/util"; import { INode, ICombo } from "@antv/f6-core"; import { Point } from "@antv/g-base"; export interface PolyPoint { x: number; y: number; id?: string; } export type PBBox = Partial<{ x: number; y: number; minX: number; minY: number; maxX: number; maxY: number; height: number; width: number; centerX: number; centerY: number; }>; export const getBBoxFromPoint = (point: PolyPoint): PBBox => { const { x, y } = point; return { x, y, centerX: x, centerY: y, minX: x, minY: y, maxX: x, maxY: y, height: 0, width: 0, }; }; export const getBBoxFromPoints = (points: PolyPoint[] = []): PBBox => { const xs: number[] = []; const ys: number[] = []; points.forEach((p) => { xs.push(p.x); ys.push(p.y); }); const minX = Math.min.apply(Math, xs); const maxX = Math.max.apply(Math, xs); const minY = Math.min.apply(Math, ys); const maxY = Math.max.apply(Math, ys); return { centerX: (minX + maxX) / 2, centerY: (minY + maxY) / 2, maxX, maxY, minX, minY, height: maxY - minY, width: maxX - minX, }; }; export const isBBoxesOverlapping = (b1: PBBox, b2: PBBox) => Math.abs(b1.centerX - b2.centerX) * 2 < b1.width + b2.width && Math.abs(b1.centerY - b2.centerY) * 2 < b1.height + b2.height; export const filterConnectPoints = (points: PolyPoint[]): PolyPoint[] => { // pre-process: remove duplicated points const result: any[] = []; const pointsMap: any = {}; const pointsLength = points.length; for (let i = pointsLength - 1; i >= 0; i--) { const p = points[i]; p.id = `${p.x}|||${p.y}`; pointsMap[p.id] = p; result.push(p); } return result; }; export const simplifyPolyline = (points: PolyPoint[]): PolyPoint[] => { return filterConnectPoints(points); }; export const getSimplePolyline = ( sPoint: PolyPoint, tPoint: PolyPoint, ): PolyPoint[] => [sPoint, { x: sPoint.x, y: tPoint.y }, tPoint]; export const getExpandedBBox = (bbox: any, offset: number): PBBox => { if (bbox.width || bbox.height) { return { centerX: bbox.centerX, centerY: bbox.centerY, minX: bbox.minX - offset, minY: bbox.minY - offset, maxX: bbox.maxX + offset, maxY: bbox.maxY + offset, height: bbox.height + 2 * offset, width: bbox.width + 2 * offset, }; } // when it is a point return bbox; }; export const isHorizontalPort = ( port: PolyPoint, bbox: PBBox, ): boolean | number => { const dx = Math.abs(port.x - bbox.centerX); const dy = Math.abs(port.y - bbox.centerY); if (dx === 0 && dy === 0) return 0; return dx / bbox.width > dy / bbox.height; }; export const getExpandedBBoxPoint = ( bbox: any, // 将原来节点 bbox 扩展了 offset 后的 bbox,且被 gridSize 格式化 point: PolyPoint, // 被 gridSize 格式化后的位置(anchorPoint) anotherPoint: PolyPoint, // 另一端被 gridSize 格式化后的位置 ): PolyPoint => { const isHorizontal = isHorizontalPort(point, bbox); if (isHorizontal === 0) { // 说明锚点是节点中心,linkCenter: true。需要根据两个节点的相对关系决定方向 let x = bbox.centerX; let y = bbox.centerY; if (anotherPoint.y < point.y) { // 另一端在左上/右上方时,总是从上方走 y = bbox.minY; } else if (anotherPoint.x > point.x) { // 另一端在右下方,往右边走 x = bbox.maxX; } else if (anotherPoint.x < point.x) { // 另一端在左下方,往左边走 x = bbox.minX; } else if (anotherPoint.x === point.x) { // 另一段在正下方,往下走 y = bbox.maxY; } return { x, y }; } if (isHorizontal) { return { x: point.x > bbox.centerX ? bbox.maxX : bbox.minX, y: point.y, }; } return { x: point.x, y: point.y > bbox.centerY ? bbox.maxY : bbox.minY, }; }; /** * * @param b1 * @param b2 */ export const mergeBBox = (b1: PBBox, b2: PBBox): PBBox => { const minX = Math.min(b1.minX, b2.minX); const minY = Math.min(b1.minY, b2.minY); const maxX = Math.max(b1.maxX, b2.maxX); const maxY = Math.max(b1.maxY, b2.maxY); return { centerX: (minX + maxX) / 2, centerY: (minY + maxY) / 2, minX, minY, maxX, maxY, height: maxY - minY, width: maxX - minX, }; }; export const getPointsFromBBox = (bbox: PBBox): PolyPoint[] => { // anticlockwise // const { minX, minY, maxX, maxY } = bbox; return [ { x: bbox.minX, y: bbox.minY, }, { x: bbox.maxX, y: bbox.minY, }, { x: bbox.maxX, y: bbox.maxY, }, { x: bbox.minX, y: bbox.maxY, }, ]; }; export const isPointOutsideBBox = (point: PolyPoint, bbox: PBBox): boolean => { const { x, y } = point; return x < bbox.minX || x > bbox.maxX || y < bbox.minY || y > bbox.maxY; }; export const getBBoxXCrossPoints = (bbox: PBBox, x: number): PolyPoint[] => { if (x < bbox.minX || x > bbox.maxX) { return []; } return [ { x, y: bbox.minY, }, { x, y: bbox.maxY, }, ]; }; export const getBBoxYCrossPoints = (bbox: PBBox, y: number): PolyPoint[] => { if (y < bbox.minY || y > bbox.maxY) { return []; } return [ { x: bbox.minX, y, }, { x: bbox.maxX, y, }, ]; }; export const getBBoxCrossPointsByPoint = ( bbox: PBBox, point: PolyPoint, ): PolyPoint[] => getBBoxXCrossPoints(bbox, point.x).concat(getBBoxYCrossPoints(bbox, point.y)); /** * 曼哈顿距离 */ export const distance = (p1: PolyPoint, p2: PolyPoint): number => Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y); /** * 如果 points 中的一个节点 x 与 p 相等,则消耗 -2。y 同 * 即优先选择和 points 在同一水平线 / 垂直线上的点 */ // eslint-disable-next-line @typescript-eslint/naming-convention export const _costByPoints = (p: PolyPoint, points: PolyPoint[]): number => { const offset = -2; let result = 0; points.forEach((point) => { if (point) { if (p.x === point.x) { result += offset; } if (p.y === point.y) { result += offset; } } }); return result; }; /** * ps 经过 p 到 pt 的距离,减去其他路过节点造成的消耗 */ export const heuristicCostEstimate = ( p: PolyPoint, ps: PolyPoint, pt: PolyPoint, source?: PolyPoint, target?: PolyPoint, ): number => distance(p, ps) + distance(p, pt) + _costByPoints(p, [ps, pt, source!, target!]); export const reconstructPath = ( pathPoints: PolyPoint[], pointById: any, cameFrom: any, currentId: string, iterator: number = 0, ) => { pathPoints.unshift(pointById[currentId]); if ( cameFrom[currentId] && cameFrom[currentId] !== currentId && iterator <= 100 ) { reconstructPath( pathPoints, pointById, cameFrom, cameFrom[currentId], iterator + 1, ); } }; /** * 从 arr 中删去 item */ export const removeFrom = (arr: PolyPoint[], item: PolyPoint) => { const index = arr.indexOf(item); if (index > -1) { arr.splice(index, 1); } }; export const isSegmentsIntersected = ( p0: PolyPoint, p1: PolyPoint, p2: PolyPoint, p3: PolyPoint, ): boolean => { const v1x = p2.x - p0.x; const v1y = p2.y - p0.y; const v2x = p3.x - p0.x; const v2y = p3.y - p0.y; const v3x = p2.x - p1.x; const v3y = p2.y - p1.y; const v4x = p3.x - p1.x; const v4y = p3.y - p1.y; const pd1 = v1x * v2y - v1y * v2x; const pd2 = v3x * v4y - v3y * v4x; const pd3 = v1x * v3y - v1y * v3x; const pd4 = v2x * v4y - v2y * v4x; return pd1 * pd2 <= 0 && pd3 * pd4 <= 0; }; export const isSegmentCrossingBBox = ( p1: PolyPoint, p2: PolyPoint, bbox: PBBox, ): boolean => { if (bbox.width || bbox.height) { const [pa, pb, pc, pd] = getPointsFromBBox(bbox); return ( isSegmentsIntersected(p1, p2, pa, pb) || isSegmentsIntersected(p1, p2, pa, pd) || isSegmentsIntersected(p1, p2, pb, pc) || isSegmentsIntersected(p1, p2, pc, pd) ); } return false; }; /** * 在 points 中找到满足 x 或 y 和 point 的 x 或 y 相等,且与 point 连线不经过 bbox1 与 bbox2 的点 */ export const getNeighborPoints = ( points: PolyPoint[], point: PolyPoint, bbox1: PBBox, bbox2: PBBox, ): PolyPoint[] => { const neighbors: Point[] = []; points.forEach((p) => { if (p === point) return; if (p.x === point.x || p.y === point.y) { if ( isSegmentCrossingBBox(p, point, bbox1) || isSegmentCrossingBBox(p, point, bbox2) ) return; neighbors.push(p); } }); return filterConnectPoints(neighbors); }; export const pathFinder = ( points: PolyPoint[], start: PolyPoint, goal: any, sBBox: PBBox, tBBox: PBBox, os: any, ot: any, ): PolyPoint[] => { // A-Star Algorithm const closedSet: any = []; const openSet = [start]; const cameFrom: { [key: string]: any; } = {}; const gScore: { [key: string]: number; } = {}; // all default values are Infinity const fScore: { [key: string]: number; } = {}; // all default values are Infinity gScore[start.id] = 0; fScore[start.id] = heuristicCostEstimate(start, goal, start); const pointById: { [key: string]: PolyPoint; } = {}; points.forEach((p) => { pointById[p.id] = p; }); let current, lowestFScore; while (openSet.length) { current = undefined; lowestFScore = Infinity; // 找到 openSet 中 fScore 最小的点 openSet.forEach((p: any) => { if (fScore[p.id] <= lowestFScore) { lowestFScore = fScore[p.id]; current = p; } }); // 若 openSet 中 fScore 最小的点就是终点 if (current === goal) { // ending condition const pathPoints: any = []; reconstructPath(pathPoints, pointById, cameFrom, goal.id); return pathPoints; } removeFrom(openSet, current); closedSet.push(current); getNeighborPoints(points, current, sBBox, tBBox).forEach((neighbor) => { if (closedSet.indexOf(neighbor) !== -1) { return; } if (openSet.indexOf(neighbor) === -1) { openSet.push(neighbor); } const tentativeGScore = fScore[current.id] + distance(current, neighbor); // + distance(neighbor, goal); if (gScore[neighbor.id] && tentativeGScore >= gScore[neighbor.id]) { return; } cameFrom[neighbor.id] = current.id; gScore[neighbor.id] = tentativeGScore; fScore[neighbor.id] = gScore[neighbor.id] + heuristicCostEstimate(neighbor, goal, start, os, ot); }); } // throw new Error('Cannot find path'); return [start, goal]; }; export const isBending = ( p0: PolyPoint, p1: PolyPoint, p2: PolyPoint, ): boolean => !((p0.x === p1.x && p1.x === p2.x) || (p0.y === p1.y && p1.y === p2.y)); export const getBorderRadiusPoints = ( p0: PolyPoint, p1: PolyPoint, p2: PolyPoint, r: number, ): PolyPoint[] => { const d0 = distance(p0, p1); const d1 = distance(p2, p1); if (d0 < r) { r = d0; } if (d1 < r) { r = d1; } const ps = { x: p1.x - (r / d0) * (p1.x - p0.x), y: p1.y - (r / d0) * (p1.y - p0.y), }; const pt = { x: p1.x - (r / d1) * (p1.x - p2.x), y: p1.y - (r / d1) * (p1.y - p2.y), }; return [ps, pt]; }; export const getPathWithBorderRadiusByPolyline = ( points: PolyPoint[], borderRadius: number, ): string => { const pathSegments: string[] = []; const startPoint = points[0]; pathSegments.push(`M${startPoint.x} ${startPoint.y}`); points.forEach((p, i) => { const p1 = points[i + 1]; const p2 = points[i + 2]; if (p1 && p2) { if (isBending(p, p1, p2)) { const [ps, pt] = getBorderRadiusPoints(p, p1, p2, borderRadius); pathSegments.push(`L${ps.x} ${ps.y}`); pathSegments.push(`Q${p1.x} ${p1.y} ${pt.x} ${pt.y}`); pathSegments.push(`L${pt.x} ${pt.y}`); } else { pathSegments.push(`L${p1.x} ${p1.y}`); } } else if (p1) { pathSegments.push(`L${p1.x} ${p1.y}`); } }); return pathSegments.join(""); }; export const getPolylinePoints = ( start: PolyPoint, end: PolyPoint, sNode: INode | ICombo, tNode: INode | ICombo, offset: number, ): PolyPoint[] => { let sBBox: PBBox, tBBox: PBBox; if (!sNode || !sNode.getType()) { sBBox = getBBoxFromPoint(start); } else if (sNode.getType() === "combo") { const sNodeKeyShape = sNode.getKeyShape(); sBBox = sNodeKeyShape.getCanvasBBox() || (getBBoxFromPoint(start) as PBBox); sBBox.centerX = (sBBox.minX + sBBox.maxX) / 2; sBBox.centerY = (sBBox.minY + sBBox.maxY) / 2; } else { sBBox = sNode.getBBox(); } if (!tNode || !tNode.getType()) { tBBox = getBBoxFromPoint(end); } else if (tNode.getType() === "combo") { const tKeyShapeBBox = tNode.getKeyShape().getBBox(); if (tKeyShapeBBox) { const { x: tx, y: ty } = tNode.getModel(); tBBox = { x: tx, y: ty, width: tKeyShapeBBox.width, height: tKeyShapeBBox.height, minX: tKeyShapeBBox.minX + tx, maxX: tKeyShapeBBox.maxX + tx, minY: tKeyShapeBBox.minY + ty, maxY: tKeyShapeBBox.maxY + ty, }; tBBox.centerX = (tBBox.minX + tBBox.maxX) / 2; tBBox.centerY = (tBBox.minY + tBBox.maxY) / 2; } else { tBBox = getBBoxFromPoint(end) as PBBox; } } else { tBBox = tNode && tNode.getBBox(); } // if (isBBoxesOverlapping(sBBox, tBBox)) { // // source and target nodes are overlapping // return simplifyPolyline(getSimplePolyline(start, end)); // } const sxBBox = getExpandedBBox(sBBox, offset); const txBBox = getExpandedBBox(tBBox, offset); // if (isBBoxesOverlapping(sxBBox, txBBox)) { // // the expanded bounding boxes of source and target nodes are overlapping // return simplifyPolyline(getSimplePolyline(start, end)); // } const sPoint = getExpandedBBoxPoint(sxBBox, start, end); const tPoint = getExpandedBBoxPoint(txBBox, end, start); const lineBBox = getBBoxFromPoints([sPoint, tPoint]); const sMixBBox = mergeBBox(sxBBox, lineBBox); const tMixBBox = mergeBBox(txBBox, lineBBox); let connectPoints: any = []; connectPoints = connectPoints .concat( getPointsFromBBox(sMixBBox), // .filter(p => !isPointIntersectBBox(p, txBBox)) ) .concat( getPointsFromBBox(tMixBBox), // .filter(p => !isPointIntersectBBox(p, sxBBox)) ); const centerPoint = { x: (start.x + end.x) / 2, y: (start.y + end.y) / 2, }; [lineBBox, sMixBBox, tMixBBox].forEach((bbox: PBBox) => { connectPoints = connectPoints.concat( getBBoxCrossPointsByPoint(bbox, centerPoint).filter( (p) => isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox), ), ); }); [ { x: sPoint.x, y: tPoint.y, }, { x: tPoint.x, y: sPoint.y, }, ].forEach((p) => { // impossible!! if ( isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox) // && // isPointInsideBBox(p, sMixBBox) && isPointInsideBBox(p, tMixBBox) ) { connectPoints.push(p); } }); connectPoints.unshift(sPoint); connectPoints.push(tPoint); // filter out dulplicated points in connectPoints connectPoints = filterConnectPoints(connectPoints); // , sxBBox, txBBox, outerBBox const pathPoints = pathFinder( connectPoints, sPoint, tPoint, sBBox, tBBox, start, end, ); pathPoints.unshift(start); pathPoints.push(end); return simplifyPolyline(pathPoints); }; ================================================ FILE: packages/element/src/edges/polyline.ts ================================================ import { Point, IGroup } from "@antv/g-base"; import { mix, each, isArray, isString } from "@antv/util"; import { registerEdge, ShapeStyle, EdgeConfig, Item, INode, Util, BaseGlobal as Global, } from "@antv/f6-core"; import { getPathWithBorderRadiusByPolyline, getPolylinePoints, } from "./polyline-util"; import { RouterCfg, pathFinder } from "./router"; // 折线 registerEdge( "polyline", { options: { color: Global.defaultEdge.color, size: Global.defaultEdge.size, style: { radius: 0, offset: 15, x: 0, y: 0, stroke: Global.defaultEdge.style.stroke, lineAppendWidth: Global.defaultEdge.style.lineAppendWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.edgeLabel.style.fill, fontSize: Global.edgeLabel.style.fontSize, }, }, routeCfg: { obstacles: [], // 希望边绕过的障碍节点 maxAllowedDirectionChange: Math.PI, // 允许的最大转角,弧度制 maximumLoops: 500, gridSize: 10, // 指定精度 }, stateStyles: { ...Global.edgeStateStyles, }, }, shapeType: "polyline", // 文本位置 labelPosition: "center", drawShape(cfg: EdgeConfig, group: IGroup) { const shapeStyle = (this as any).getShapeStyle(cfg); if (shapeStyle.radius === 0) delete shapeStyle.radius; const keyShape = group.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: shapeStyle, }); return keyShape; }, getShapeStyle(cfg: EdgeConfig): ShapeStyle { const { style: defaultStyle } = this.options; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; const style: ShapeStyle = mix({}, defaultStyle, strokeStyle, cfg.style); cfg = (this as any).getPathPoints(cfg); this.radius = style.radius; this.offset = style.offset; const { startPoint, endPoint } = cfg; const controlPoints = (this as any).getControlPoints(cfg); let points = [startPoint]; // 添加起始点 // 添加控制点 if (controlPoints) { points = points.concat(controlPoints); } // 添加结束点 points.push(endPoint); const source = cfg.sourceNode; const target = cfg.targetNode; const radius = style.radius; const { routeCfg: defaultRouteCfg } = this.options; const routeCfg = mix({}, defaultRouteCfg, cfg.routeCfg); routeCfg.offset = style.offset; let path = (this as any).getPath( points, source, target, radius, routeCfg, ); if ( (isArray(path) && path.length <= 1) || (isString(path) && path.indexOf("L") === -1) ) { path = "M0 0, L0 0"; } if ( isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y) ) { path = "M0 0, L0 0"; } const attrs: ShapeStyle = mix( {}, Global.defaultEdge.style as ShapeStyle, style, { lineWidth: cfg.size, path, } as ShapeStyle, ); return attrs; }, updateShapeStyle(cfg: EdgeConfig, item: Item) { const group = item.getContainer(); if (!item.isVisible()) return; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; const shape = group.find((element) => element.get("className") === "edge-shape") || item.getKeyShape(); const { size } = cfg; cfg = this.getPathPoints!(cfg); const { startPoint, endPoint } = cfg; const controlPoints = this.getControlPoints!(cfg); // || cfg.controlPoints; let points = [startPoint]; // 添加起始点 // 添加控制点 if (controlPoints) { points = points.concat(controlPoints); } // 添加结束点 points.push(endPoint); const currentAttr = shape.attr(); const previousStyle = mix({}, strokeStyle, currentAttr, cfg.style); const source = cfg.sourceNode; const target = cfg.targetNode; const radius = previousStyle.radius; const { routeCfg: defaultRouteCfg } = this.options; const routeCfg = mix({}, defaultRouteCfg, cfg.routeCfg); routeCfg.offset = previousStyle.offset; let path = (this as any).getPath( points, source, target, radius, routeCfg, ); if ( (isArray(path) && path.length <= 1) || (isString(path) && path.indexOf("L") === -1) ) { path = "M0 0, L0 0"; } if ( isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y) ) { path = "M0 0, L0 0"; } if (currentAttr.endArrow && previousStyle.endArrow === false) { cfg.style.endArrow = { path: "", }; } if (currentAttr.startArrow && previousStyle.startArrow === false) { cfg.style.startArrow = { path: "", }; } const style = mix( strokeStyle, shape.attr(), { lineWidth: size, path, }, cfg.style, ); if (shape) { shape.attr(style); } }, getPath( points: Point[], source: INode, target: INode, radius: number, routeCfg?: RouterCfg, ): Array> | string { const { offset, simple } = routeCfg; // 指定了控制点 if (!offset || points.length > 2) { if (radius) { return getPathWithBorderRadiusByPolyline(points, radius); } const pathArray: Array> = []; each(points, (point, index) => { if (index === 0) { pathArray.push(["M", point.x, point.y]); } else { pathArray.push(["L", point.x, point.y]); } }); return pathArray; } // 未指定控制点 const polylinePoints = simple ? getPolylinePoints( points[points.length - 1], points[0], target, source, offset, ) : pathFinder( points[0], points[points.length - 1], source, target, routeCfg, ); if (!polylinePoints || !polylinePoints.length) return "M0 0, L0 0"; if (radius) { const res = getPathWithBorderRadiusByPolyline(polylinePoints, radius); return res; } const res = Util.pointsToPolygon(polylinePoints); return res; }, }, "single-edge", ); ================================================ FILE: packages/element/src/edges/router.ts ================================================ /** * 通过配置不同的 costFunc, distFunc, constraints 可以得到不同效果的 router * generalRouter: 不限制搜索时的移动方向,避开障碍即可 * orthogonal: 线必须沿着竖直或水平方向(4个方向) * octolinearRouter: 线沿着竖直、水平、对角线方向(8个方向) */ import { INode, Item, Util } from "@antv/f6-core"; import { deepMix } from "@antv/util"; import { getExpandedBBox, getExpandedBBoxPoint, PolyPoint, getPolylinePoints, simplifyPolyline, isSegmentCrossingBBox, } from "./polyline-util"; export interface RouterCfg { offset?: number; // 连线和点的间距 gridSize?: number; obstacles?: Item[]; maxAllowedDirectionChange?: number; // 允许的最大转角,弧度制 directions?: any[]; // 允许的边的方向 startDirections?: string[]; // 边从点出发的方向(e.g. 从上拐 / 从下拐) penalties?: {}; // 附加的分数 simple?: boolean; distFunc?: (p1: PolyPoint, p2: PolyPoint) => number; fallbackRoute?: ( p1: PolyPoint, p2: PolyPoint, startNode?: INode, endNode?: INode, cfg?: RouterCfg, ) => PolyPoint[]; // 若找不到符合要求的路径时的退化路径方案 maximumLoops?: number; } const manhattanDist = (p1: PolyPoint, p2: PolyPoint): number => Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y); const eucliDist = (p1: PolyPoint, p2: PolyPoint): number => Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2); const straightPath = (start: PolyPoint, end: PolyPoint): PolyPoint[] => { // console.warn('fallbackRoute: straight path'); return [start, end]; }; const simplePolyline = ( start: PolyPoint, end: PolyPoint, startNode: INode, endNode: INode, cfg: RouterCfg, ) => { return simplifyPolyline( getPolylinePoints(start, end, startNode, endNode, cfg.offset), ); }; // getPolylinePoints const defaultCfg: RouterCfg = { offset: 20, maxAllowedDirectionChange: Math.PI / 2, maximumLoops: 2000, gridSize: 10, directions: [ { stepX: 1, stepY: 0 }, // right { stepX: -1, stepY: 0 }, // left { stepX: 0, stepY: 1 }, // bottom { stepX: 0, stepY: -1 }, // top ], get penalties() { return { 0: 0, 45: this.gridSize / 2, 90: this.gridSize / 2, }; }, distFunc: manhattanDist, fallbackRoute: simplePolyline, }; export const octolinearCfg: RouterCfg = { maxAllowedDirectionChange: Math.PI / 4, // 8 个方向: 上下左右 + 45度斜线方向 directions: [ { stepX: 1, stepY: 0 }, { stepX: 1, stepY: 1 }, { stepX: 0, stepY: 1 }, { stepX: -1, stepY: 1 }, { stepX: -1, stepY: 0 }, { stepX: -1, stepY: -1 }, { stepX: 0, stepY: -1 }, { stepX: 1, stepY: -1 }, ], distFunc: eucliDist, fallbackRoute: straightPath, }; const pos2GridIx = (pos: number, gridSize: number) => { const gridIx = Math.round(Math.abs(pos / gridSize)); const sign = pos < 0 ? -1 : 1; return gridIx < 0 ? 0 : sign * gridIx; }; const getObstacleMap = (items: Item[], gridSize: number, offset: number) => { const map = {}; items.forEach((item: Item) => { // create-edge 时,当边类型为 polyline 时 endNode 为 null if (!item) return; const bbox = getExpandedBBox(item.getBBox(), offset); for ( let x = pos2GridIx(bbox.minX, gridSize); x <= pos2GridIx(bbox.maxX, gridSize); x += 1 ) { for ( let y = pos2GridIx(bbox.minY, gridSize); y <= pos2GridIx(bbox.maxY, gridSize); y += 1 ) { map[`${x}|||${y}`] = true; } } }); return map; }; /** * 方向角:计算从 p1 到 p2 的射线与水平线形成的夹角度数(顺时针从右侧0°转到该射线的角度) * @param p1 PolyPoint * @param p2 PolyPoint */ const getDirectionAngle = (p1: PolyPoint, p2: PolyPoint) => { const deltaX = p2.x - p1.x; const deltaY = p2.y - p1.y; if (deltaX || deltaY) { return Math.atan2(deltaY, deltaX); } return 0; }; /** * 方向角的改变,取小于180度角 * @param angle1 * @param angle2 */ const getAngleDiff = (angle1: number, angle2: number) => { const directionChange = Math.abs(angle1 - angle2); return directionChange > Math.PI ? 2 * Math.PI - directionChange : directionChange; // return directionChange > 180 ? 360 - directionChange : directionChange; }; // Path finder // const estimateCost = (from: PolyPoint, endPoints: PolyPoint[], distFunc) => { let min = Infinity; for (let i = 0, len = endPoints.length; i < len; i++) { const cost = distFunc(from, endPoints[i]); if (cost < min) { min = cost; } } return min; }; // 计算考虑 offset 后的 BBox 上的连接点 const getBoxPoints = ( point: PolyPoint, // 被 gridSize 格式化后的位置(anchorPoint) oriPoint: PolyPoint, // 未被 gridSize 格式化的位置(anchorPoint) node: INode, // 原始节点,用于获取 bbox anotherPoint: PolyPoint, // 另一端被 gridSize 格式化后的位置 cfg: RouterCfg, ): PolyPoint[] => { const points = []; // create-edge 生成边的过程中,endNode 为 null if (!node) { return [point]; } const { directions, offset } = cfg; const bbox = node.getBBox(); const isInside = oriPoint.x > bbox.minX && oriPoint.x < bbox.maxX && oriPoint.y > bbox.minY && oriPoint.y < bbox.maxY; const expandBBox = getExpandedBBox(bbox, offset); for (const i in expandBBox) { expandBBox[i] = pos2GridIx(expandBBox[i], cfg.gridSize); } if (isInside) { // 如果 anchorPoint 在节点内部,允许第一段线穿过节点 for (const dir of directions) { const bounds = [ [ { x: expandBBox.minX, y: expandBBox.minY, }, { x: expandBBox.maxX, y: expandBBox.minY, }, ], [ { x: expandBBox.minX, y: expandBBox.minY, }, { x: expandBBox.minX, y: expandBBox.maxY, }, ], [ { x: expandBBox.maxX, y: expandBBox.minY, }, { x: expandBBox.maxX, y: expandBBox.maxY, }, ], [ { x: expandBBox.minX, y: expandBBox.maxY, }, { x: expandBBox.maxX, y: expandBBox.maxY, }, ], ]; for (let i = 0; i < 4; i++) { const boundLine = bounds[i]; const insterctP = Util.getLineIntersect( point, { x: point.x + dir.stepX * expandBBox.width, y: point.y + dir.stepY * expandBBox.height, }, boundLine[0], boundLine[1], ) as PolyPoint; if (insterctP && !isSegmentCrossingBBox(point, insterctP, bbox)) { insterctP.id = `${insterctP.x}|||${insterctP.y}`; points.push(insterctP); } } } return points; } // 如果 anchorPoint 在节点上,只有一个可选方向 const insterctP = getExpandedBBoxPoint(expandBBox, point, anotherPoint); insterctP.id = `${insterctP.x}|||${insterctP.y}`; return [insterctP]; }; const getDirectionChange = ( current: PolyPoint, neighbor: PolyPoint, cameFrom: { [key: string]: { id: string; x: number; y: number; }; }, scaleStartPoint: PolyPoint, ): number => { const directionAngle = getDirectionAngle(current, neighbor); if (!cameFrom[current.id]) { const startAngle = getDirectionAngle(scaleStartPoint, current); return getAngleDiff(startAngle, directionAngle); } const prevDirectionAngle = getDirectionAngle( { x: cameFrom[current.id].x, y: cameFrom[current.id].y, }, current, ); return getAngleDiff(prevDirectionAngle, directionAngle); }; const getControlPoints = ( current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize, ) => { const controlPoints = [endPoint]; let currentId = current.id; let currentX = current.x; let currentY = current.y; const lastPoint = { x: currentX, y: currentY, id: currentId, }; if (getDirectionChange(lastPoint, scaleEndPoint, cameFrom, scaleStartPoint)) { // if (scaleEndPoint.x === endPoint.x && scaleEndPoint.y === endPoint.y) // controlPoints.unshift({ // x: endPoint.x, // y: endPoint.y // }) // else // controlPoints.unshift({ // x: lastPoint.x * gridSize, // y: lastPoint.y * gridSize, // }); controlPoints.unshift({ x: scaleEndPoint.x === endPoint.x ? endPoint.x : lastPoint.x * gridSize, y: scaleEndPoint.y === endPoint.y ? endPoint.y : lastPoint.y * gridSize, }); } while (cameFrom[currentId] && cameFrom[currentId].id !== currentId) { const point = { x: currentX, y: currentY, id: currentId, }; const preId = cameFrom[currentId].id; const preX = cameFrom[currentId].x; const preY = cameFrom[currentId].y; const prePoint = { x: preX, y: preY, id: preId, }; const directionChange = getDirectionChange( prePoint, point, cameFrom, scaleStartPoint, ); if (directionChange) { // if (prePoint.x === point.x && prePoint.y === point.y) // controlPoints.unshift({ // x: controlPoints[0].x, // y: controlPoints[0].y // }) // else // controlPoints.unshift({ // x: prePoint.x * gridSize, // y: prePoint.y * gridSize, // }); controlPoints.unshift({ x: prePoint.x === point.x ? controlPoints[0].x : prePoint.x * gridSize, y: prePoint.y === point.y ? controlPoints[0].y : prePoint.y * gridSize, }); } currentId = preId; currentX = preX; currentY = preY; } // 和startNode对齐 const firstPoint = { x: currentX, y: currentY, id: currentId, }; // if (firstPoint.x === scaleStartPoint.x && firstPoint.y === scaleStartPoint.y) { // controlPoints[0].x = startPoint.x; // controlPoints[0].y = startPoint.y; // } controlPoints[0].x = firstPoint.x === scaleStartPoint.x ? startPoint.x : controlPoints[0].x; controlPoints[0].y = firstPoint.y === scaleStartPoint.y ? startPoint.y : controlPoints[0].y; controlPoints.unshift(startPoint); return controlPoints; }; export const pathFinder = ( startPoint: PolyPoint, endPoint: PolyPoint, startNode: INode, endNode: INode, routerCfg?: RouterCfg, ): PolyPoint[] => { if (isNaN(startPoint.x) || isNaN(endPoint.x)) return []; const cfg: RouterCfg = deepMix(defaultCfg, routerCfg); cfg.obstacles = cfg.obstacles || []; const gridSize = cfg.gridSize; const map = getObstacleMap( cfg.obstacles.concat([startNode, endNode]), gridSize, cfg.offset, ); const scaleStartPoint = { x: pos2GridIx(startPoint.x, gridSize), y: pos2GridIx(startPoint.y, gridSize), }; const scaleEndPoint = { x: pos2GridIx(endPoint.x, gridSize), y: pos2GridIx(endPoint.y, gridSize), }; startPoint.id = `${scaleStartPoint.x}|||${scaleStartPoint.y}`; endPoint.id = `${scaleEndPoint.x}|||${scaleEndPoint.y}`; const startPoints = getBoxPoints( scaleStartPoint, startPoint, startNode, scaleEndPoint, cfg, ); const endPoints = getBoxPoints( scaleEndPoint, endPoint, endNode, scaleStartPoint, cfg, ); startPoints.forEach((point) => { delete map[point.id]; }); endPoints.forEach((point) => { delete map[point.id]; }); const openSet = {}; const closedSet = {}; const cameFrom: { [key: string]: { id: string; x: number; y: number; }; } = {}; // 从起点到当前点已产生的 cost, default: Infinity const gScore: { [key: string]: number; } = {}; // 起点经过当前点到达终点预估的 cost, default: Infinity const fScore: { [key: string]: number; } = {}; // initialize for (let i = 0; i < startPoints.length; i++) { const firstStep = startPoints[i]; openSet[firstStep.id] = firstStep; // cameFrom[firstStep.id] = startPoint.id; gScore[firstStep.id] = 0; fScore[firstStep.id] = estimateCost(firstStep, endPoints, cfg.distFunc); } let remainLoops = cfg.maximumLoops; const penalties = cfg.penalties; let current, curCost, direction, neighbor, neighborCost, costFromStart, directionChange; while (Object.keys(openSet).length > 0 && remainLoops > 0) { current = undefined; curCost = Infinity; // 找到 openSet 中 fScore 最小的点 Object.keys(openSet).forEach((key) => { const id = openSet[key].id; if (fScore[id] <= curCost) { curCost = fScore[id]; current = openSet[id]; } }); if (!current) break; // 如果 fScore 最小的点就是终点 if ( endPoints.findIndex( (point) => point.x === current.x && point.y === current.y, ) > -1 ) { return getControlPoints( current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize, ); } delete openSet[current.id]; closedSet[current.id] = true; // 获取符合条件的下一步的候选连接点 // 沿候选方向走一步 for (let i = 0; i < cfg.directions.length; i++) { direction = cfg.directions[i]; neighbor = { x: current.x + direction.stepX, y: current.y + direction.stepY, id: `${Math.round(current.x) + direction.stepX}|||${ Math.round(current.y) + direction.stepY }`, }; if (closedSet[neighbor.id]) continue; directionChange = getDirectionChange( current, neighbor, cameFrom, scaleStartPoint, ); if (directionChange > cfg.maxAllowedDirectionChange) continue; if (map[neighbor.id]) continue; // 如果交叉则跳过 // 将候选点加入 openSet, 并计算每个候选点的 cost if (!openSet[neighbor.id]) { openSet[neighbor.id] = neighbor; } neighborCost = cfg.distFunc(current, neighbor) + (isNaN(penalties[directionChange]) ? gridSize : penalties[directionChange]); costFromStart = gScore[current.id] + neighborCost; if (gScore[neighbor.id] && costFromStart >= gScore[neighbor.id]) { continue; } cameFrom[neighbor.id] = current; gScore[neighbor.id] = costFromStart; fScore[neighbor.id] = costFromStart + estimateCost(neighbor, endPoints, cfg.distFunc); } remainLoops -= 1; } return cfg.fallbackRoute(startPoint, endPoint, startNode, endNode, cfg); }; ================================================ FILE: packages/element/src/index.ts ================================================ import "./nodes"; import "./edges"; ================================================ FILE: packages/element/src/nodes/circle.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, } from "@antv/f6-core"; import { deepMix } from "@antv/util"; // 带有图标的圆,可用于拓扑图中 registerNode( "circle", { // 自定义节点时的配置 options: { size: Global.defaultNode.size, style: { x: 0, y: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "circle", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon: defaultIcon = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const icon = deepMix({}, defaultIcon, cfg.icon); const keyShape: IShape = group.addShape("circle", { attrs: style, className: `${this.type}-keyShape`, draggable: true, }); const { width, height, show, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { group.addShape("image", { attrs: { x: -width / 2, y: -height / 2, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = this.getSize!(cfg); const r = size[0] / 2; if (left) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: -r, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (right) { // right circle group.addShape("circle", { attrs: { ...markStyle, x: r, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (top) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: -r, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (bottom) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: r, r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig): ShapeStyle { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = deepMix({}, defaultStyle, strokeStyle); const size = (this as ShapeOptions).getSize!(cfg); const r = size[0] / 2; const styles = { x: 0, y: 0, r, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); const size = (this as ShapeOptions).getSize!(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, r: size[0] / 2, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); const style = deepMix({}, keyShape.attr(), strokeStyle, cfg.style); (this as any).updateShape(cfg, item, style, true); (this as any).updateLinkPoints(cfg, group); }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/diamond.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, BaseGlobal as Global, } from "@antv/f6-core"; import { mix } from "@antv/util"; // 菱形shape registerNode( "diamond", { // 自定义节点时的配置 options: { size: [80, 80], style: { stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "diamond", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("path", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); const { width: w, height: h, show, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { group.addShape("image", { attrs: { x: -w! / 2, y: -h! / 2, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = this.getSize!(cfg); const width = size[0]; const height = size[1]; if (left) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: -width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (right) { // right circle group.addShape("circle", { attrs: { ...markStyle, x: width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (top) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: -height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (bottom) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, getPath(cfg: NodeConfig): Array> { const size = this.getSize!(cfg); const width = size[0]; const height = size[1]; const path = [ ["M", 0, -height / 2], // 上部顶点 ["L", width / 2, 0], // 右侧点 ["L", 0, height / 2], // 下部 ["L", -width / 2, 0], // 左侧 ["Z"], // 封闭 ]; return path; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig): ShapeStyle { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle); const path = (this as any).getPath(cfg); const styles = { path, ...style }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const path = (this as any).getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, path, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, true); (this as any).updateLinkPoints(cfg, group); }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/donut.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, Util, } from "@antv/f6-core"; import { deepMix, isNumber, isArray } from "@antv/util"; const { defaultSubjectColors } = Util; // 饼图节点 registerNode( "donut", { // 自定义节点时的配置 options: { size: Global.defaultNode.size, style: { x: 0, y: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "circle", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon: defaultIcon = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const icon = deepMix({}, defaultIcon, cfg.icon); const keyShape: IShape = group.addShape("circle", { attrs: style, className: `${this.type}-keyShape`, draggable: true, name: `${this.type}-keyShape`, }); const { width, height, show, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { group.addShape("image", { attrs: { x: -width / 2, y: -height / 2, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } const donutR = keyShape.attr("r"); const innerR = 0.6 * donutR; // 甜甜圈的内环半径 const arcR = (donutR + innerR) / 2; // 内环半径与外环半径的平均值 const { donutAttrs = {}, donutColorMap = {} } = cfg as any; const attrNum = Object.keys(donutAttrs).length; if (donutAttrs && attrNum > 1) { const attrs: any[] = []; let totalValue = 0; Object.keys(donutAttrs).forEach((name) => { const value = donutAttrs[name] || 0; if (!isNumber(value)) return; attrs.push({ key: name, value, color: donutColorMap[name], }); totalValue += value; }); if (totalValue) { const lineWidth = donutR - innerR; if (attrNum === 1) { group.addShape("circle", { attrs: { r: arcR, x: 0, y: 0, stroke: attrs[0].color || defaultSubjectColors[0], lineWidth, }, name: `fan-shape-0`, }); return; } let arcBegin = [arcR, 0]; let beginAngle = 0; attrs.forEach((attr, i) => { let percent = attr.value / totalValue; if (percent < 0.001) return; if (percent > 0.999) percent = 1; if (percent === 1) { group.addShape("circle", { attrs: { r: arcR, x: 0, y: 0, stroke: attr.color || defaultSubjectColors[i % defaultSubjectColors.length], lineWidth, }, name: `fan-shape-${i}`, }); return; } attr.percent = percent; attr.angle = percent * Math.PI * 2; attr.beginAgnle = beginAngle; beginAngle += attr.angle; attr.endAngle = beginAngle; attr.arcBegin = arcBegin; attr.arcEnd = [ arcR * Math.cos(attr.endAngle), -arcR * Math.sin(attr.endAngle), ]; const isBig = attr.angle > Math.PI ? 1 : 0; const path = [ ["M", attr.arcBegin[0], attr.arcBegin[1]], ["A", arcR, arcR, 0, isBig, 0, attr.arcEnd[0], attr.arcEnd[1]], ["L", attr.arcEnd[0], attr.arcEnd[1]], ]; group.addShape("path", { attrs: { path, lineWidth, stroke: attr.color || defaultSubjectColors[i % defaultSubjectColors.length], }, name: `fan-shape-${i}`, }); arcBegin = attr.arcEnd; }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, update: undefined, }, "circle", ); ================================================ FILE: packages/element/src/nodes/ellipse.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, BaseGlobal as Global, } from "@antv/f6-core"; import { mix } from "@antv/util"; /** * 基本的椭圆,可以添加文本,默认文本居中 */ registerNode( "ellipse", { // 自定义节点时的配置 options: { size: [80, 40], style: { x: 0, y: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "ellipse", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("ellipse", { attrs: style, className: "ellipse-keyShape", name: "ellipse-keyShape", draggable: true, }); const { width, height, show, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { group.addShape("image", { attrs: { x: -width! / 2, y: -height! / 2, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = this.getSize!(cfg); const rx = size[0] / 2; const ry = size[1] / 2; if (left) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: -rx, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (right) { // right circle group.addShape("circle", { attrs: { ...markStyle, x: rx, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (top) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: -ry, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (bottom) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: ry, r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig): ShapeStyle { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle); const size = this.getSize!(cfg); const rx = size[0] / 2; const ry = size[1] / 2; const styles = { x: 0, y: 0, rx, ry, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const size = this.getSize!(cfg); const strokeStyle = { stroke: cfg.color, rx: size[0] / 2, ry: size[1] / 2, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, true); (this as any).updateLinkPoints(cfg, group); }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/image.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig } from "@antv/f6-core"; /** * 基本的图片,可以添加文本,默认文本在图片的下面 */ registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: false, type: "circle", // circle r: 50, // ellipse rx: 50, ry: 35, // rect width: 50, height: 35, // polygon points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], // path path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], // 坐标 x: 0, y: 0, // clip 的属性样式 // style: { // lineWidth: 1 // }, }, }, shapeType: "image", labelPosition: "bottom", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { shapeType } = this; // || this.type,都已经加了 shapeType const style = this.getShapeStyle!(cfg); delete style.fill; const shape = group.addShape(shapeType, { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); (this as any).drawClip(cfg, shape); return shape; }, drawClip(cfg: NodeConfig, shape: IShape) { const { clipCfg: clip } = this.getOptions(cfg); if (!clip.show) { return; } // 支持 circle、rect、ellipse、Polygon 及自定义 path clip const { type, x, y, style } = clip; if (type === "circle") { const { r } = clip; shape.setClip({ type: "circle", attrs: { r, x, y, ...style, }, }); } else if (type === "rect") { const { width, height } = clip; const rectX = x - width / 2; const rectY = y - height / 2; shape.setClip({ type: "rect", attrs: { x: rectX, y: rectY, width, height, ...style, }, }); } else if (type === "ellipse") { const { rx, ry } = clip; shape.setClip({ type: "ellipse", attrs: { x, y, rx, ry, ...style, }, }); } else if (type === "polygon") { const { points } = clip; shape.setClip({ type: "polygon", attrs: { points, ...style, }, }); } else if (type === "path") { const { path } = clip; shape.setClip({ type: "path", attrs: { path, ...style, }, }); } }, getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg); const size = this.getSize!(cfg); const { img } = this.getOptions(cfg); let width = size[0]; let height = size[1]; if (defaultStyle) { width = defaultStyle.width || size[0]; height = defaultStyle.height || size[1]; } const style = { x: -width / 2, // 节点的位置在上层确定,所以这里仅使用相对位置即可 y: -height / 2, width, height, img, ...defaultStyle, }; return style; }, updateShapeStyle(cfg: NodeConfig, item: Item) { const group = item.getContainer(); const shapeClassName = `${this.itemType}-shape`; const shape = group.find((element) => element.get("className") === shapeClassName) || item.getKeyShape(); const shapeStyle = this.getShapeStyle!(cfg); if (shape) { shape.attr(shapeStyle); } }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/index.ts ================================================ import "./circle"; import "./rect"; import "./ellipse"; import "./diamond"; import "./triangle"; import "./modelRect"; import "./star"; import "./donut"; // import './image'; ================================================ FILE: packages/element/src/nodes/modelRect.ts ================================================ import { mix, isString } from "@antv/util"; import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, } from "@antv/f6-core"; registerNode( "modelRect", { // 自定义节点时的配置 options: { size: [185, 70], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: Global.defaultNode.style.lineWidth, fillOpacity: 1, }, // 文本样式配置 labelCfg: { style: { fill: "#595959", fontSize: 14, }, offset: 30, // 距离左侧的 offset,没有设置 y 轴上移动的配置 }, descriptionCfg: { style: { fontSize: 12, fill: "#bfbfbf", }, paddingTop: 0, }, preRect: { show: true, width: 4, fill: "#40a9ff", radius: 2, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, // 节点中icon配置 logoIcon: { // 是否显示icon,值为 false 则不渲染icon show: true, x: 0, y: 0, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, // 用于调整图标的左右位置 offset: 0, }, // 节点中表示状态的icon配置 stateIcon: { // 是否显示icon,值为 false 则不渲染icon show: true, x: 0, y: 0, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, // 用于调整图标的左右位置 offset: -5, }, // 连接点,默认为左右 // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }] anchorPoints: [ [0, 0.5], [1, 0.5], ], }, shapeType: "modelRect", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { preRect = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; const height = size[1]; const keyShape = group.addShape("rect", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); const { show: preRectShow, ...preRectStyle } = preRect; if (preRectShow) { group.addShape("rect", { attrs: { x: -width / 2, y: -height / 2, height, ...preRectStyle, }, className: "pre-rect", name: "pre-rect", draggable: true, }); } (this as any).drawLogoIcon(cfg, group); (this as any).drawStateIcon(cfg, group); (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制模型矩形左边的logo图标 * @param {Object} cfg 数据配置项 * @param {Group} group Group实例 */ drawLogoIcon(cfg: NodeConfig, group: IGroup) { const { logoIcon = {} } = this.getOptions(cfg) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; if (logoIcon.show) { const { width: w, height: h, x, y, offset, text, ...logoIconStyle } = logoIcon; if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...logoIconStyle, }, className: "rect-logo-icon", name: "rect-logo-icon", draggable: true, }); } else { group.addShape("image", { attrs: { ...logoIconStyle, x: x || -width / 2 + (w as number) + (offset as number), y: y || -(h as number) / 2, width: w, height: h, }, className: "rect-logo-icon", name: "rect-logo-icon", draggable: true, }); } } }, /** * 绘制模型矩形右边的状态图标 * @param {Object} cfg 数据配置项 * @param {Group} group Group实例 */ drawStateIcon(cfg: NodeConfig, group: IGroup) { const { stateIcon = {} } = this.getOptions(cfg) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; if (stateIcon.show) { const { width: w, height: h, x, y, offset, text, ...iconStyle } = stateIcon; if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...iconStyle, }, className: "rect-state-icon", name: "rect-state-icon", draggable: true, }); } else { group.addShape("image", { attrs: { ...iconStyle, x: x || width / 2 - (w as number) + (offset as number), y: y || -(h as number) / 2, width: w, height: h, }, className: "rect-state-icon", name: "rect-state-icon", draggable: true, }); } } }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; const height = size[1]; if (left) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: -width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (right) { // right circle group.addShape("circle", { attrs: { ...markStyle, x: width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (top) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: -height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (bottom) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, drawLabel(cfg: NodeConfig, group: IGroup): IShape { const { labelCfg = {}, logoIcon = {}, descriptionCfg = {}, } = this.getOptions(cfg) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; let label = null; const { show, width: w } = logoIcon; let offsetX = -width / 2 + labelCfg.offset; if (show) { offsetX = -width / 2 + (w as number) + labelCfg.offset; } const { style: fontStyle } = labelCfg; const { style: descriptionStyle, paddingTop: descriptionPaddingTop } = descriptionCfg; if (isString(cfg.description)) { label = group.addShape("text", { attrs: { ...fontStyle, x: offsetX, y: -5, text: cfg.label, }, className: "text-shape", name: "text-shape", draggable: true, }); group.addShape("text", { attrs: { ...descriptionStyle, x: offsetX, y: 17 + ((descriptionPaddingTop as any) || 0), text: cfg.description, }, className: "rect-description", name: "rect-description", draggable: true, }); } else { label = group.addShape("text", { attrs: { ...fontStyle, x: offsetX, y: 7, text: cfg.label, }, className: "text-shape", name: "text-shape", draggable: true, }); } return label; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style: ShapeStyle = mix({}, defaultStyle, strokeStyle); const size = (this as ShapeOptions).getSize!(cfg); const width = style.width || size[0]; const height = style.height || size[1]; const styles = { x: -width / 2, y: -height / 2, width, height, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const { style = {}, labelCfg = {}, descriptionCfg = {}, } = this.getOptions(cfg) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; const height = size[1]; const keyShape = item.get("keyShape"); keyShape.attr({ ...style, x: -width / 2, y: -height / 2, width, height, }); const group = item.getContainer(); const logoIconShape = group.find( (element) => element.get("className") === "rect-logo-icon", ); const currentLogoIconAttr = logoIconShape ? logoIconShape.attr() : {}; const logoIcon = mix({}, currentLogoIconAttr, cfg.logoIcon); let { width: w } = logoIcon; if (w === undefined) { w = (this as any).options.logoIcon.width; } const show = cfg.logoIcon ? cfg.logoIcon.show : undefined; const { offset } = labelCfg; let offsetX = -width / 2 + w + offset; if (!show && show !== undefined) { offsetX = -width / 2 + offset; } const label = group.find( (element) => element.get("className") === "node-label", ); const description = group.find( (element) => element.get("className") === "rect-description", ); if (cfg.label) { if (!label) { group.addShape("text", { attrs: { ...labelCfg.style, x: offsetX, y: cfg.description ? -5 : 7, text: cfg.label, }, className: "node-label", name: "node-label", draggable: true, }); } else { const cfgStyle = cfg.labelCfg ? cfg.labelCfg.style : {}; const labelStyle = mix({}, label.attr(), cfgStyle); if (cfg.label) labelStyle.text = cfg.label; labelStyle.x = offsetX; if (isString(cfg.description)) labelStyle.y = -5; if (description) { description.resetMatrix(); description.attr({ x: offsetX, }); } label.resetMatrix(); label.attr(labelStyle); } } if (isString(cfg.description)) { const { paddingTop } = descriptionCfg; if (!description) { group.addShape("text", { attrs: { ...descriptionCfg.style, x: offsetX, y: 17 + ((paddingTop as any) || 0), text: cfg.description, }, className: "rect-description", name: "rect-description", draggable: true, }); } else { const cfgStyle = cfg.descriptionCfg ? cfg.descriptionCfg.style : {}; const descriptionStyle = mix({}, description.attr(), cfgStyle); if (isString(cfg.description)) descriptionStyle.text = cfg.description; descriptionStyle.x = offsetX; description.resetMatrix(); description.attr({ ...descriptionStyle, y: 17 + ((paddingTop as any) || 0), }); } } const preRectShape = group.find( (element) => element.get("className") === "pre-rect", ); if (preRectShape) { const preRect = mix({}, preRectShape.attr(), cfg.preRect); preRectShape.attr({ ...preRect, x: -width / 2, y: -height / 2, height, }); } if (logoIconShape) { if (!show && show !== undefined) { logoIconShape.remove(); } else { const { width: logoW, height: h, x, y, offset: logoOffset, ...logoIconStyle } = logoIcon; logoIconShape.attr({ ...logoIconStyle, x: x || -width / 2 + logoW + logoOffset, y: y || -h / 2, width: logoW, height: h, }); } } else if (show) { (this as any).drawLogoIcon(cfg, group); } const stateIconShape = group.find( (element) => element.get("className") === "rect-state-icon", ); const currentStateIconAttr = stateIconShape ? stateIconShape.attr() : {}; const stateIcon = mix({}, currentStateIconAttr, cfg.stateIcon); if (stateIconShape) { if (!stateIcon.show && stateIcon.show !== undefined) { stateIconShape.remove(); } const { width: stateW, height: h, x, y, offset: stateOffset, ...stateIconStyle } = stateIcon; stateIconShape.attr({ ...stateIconStyle, x: x || width / 2 - stateW + stateOffset, y: y || -h / 2, width: stateW, height: h, }); } else if (stateIcon.show) { (this as any).drawStateIcon(cfg, group); } (this as any).updateLinkPoints(cfg, group); }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/rect.ts ================================================ import { mix } from "@antv/util"; import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, } from "@antv/f6-core"; registerNode( "rect", { // 自定义节点时的配置 options: { size: [100, 30], style: { radius: 0, stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, // 文本样式配置 labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, // 连接点,默认为左右 // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }] anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "rect", labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("rect", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = (this as ShapeOptions).getSize!(cfg); const width = size[0]; const height = size[1]; if (left) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: -width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } if (right) { // right circle group.addShape("circle", { attrs: { ...markStyle, x: width / 2, y: 0, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } if (top) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: -height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } if (bottom) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: 0, y: height / 2, r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle); const size = (this as ShapeOptions).getSize!(cfg); const width = style.width || size[0]; const height = style.height || size[1]; const styles = { x: -width / 2, y: -height / 2, width, height, ...style, }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const size = (this as ShapeOptions).getSize!(cfg); const keyShape = item.get("keyShape"); if (!cfg.size) { size[0] = keyShape.attr("width") || defaultStyle.width; size[1] = keyShape.attr("height") || defaultStyle.height; } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, x: -size[0] / 2, y: -size[1] / 2, width: size[0], height: size[1], }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, false); (this as any).updateLinkPoints(cfg, group); }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/star.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, } from "@antv/f6-core"; import { mix } from "@antv/util"; // 五角星shape registerNode( "star", { // 自定义节点时的配置 options: { size: 60, style: { stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "star", // 文本位置 labelPosition: "center", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon = {} } = this.getOptions(cfg) as NodeConfig; const style = this.getShapeStyle!(cfg); const keyShape = group.addShape("path", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); const { width: w, height: h, show, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { group.addShape("image", { attrs: { x: -w! / 2, y: -h! / 2, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {} } = this.getOptions(cfg) as NodeConfig; const { top, left, right, leftBottom, rightBottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = (this as ShapeOptions).getSize!(cfg); const outerR = size[0]; if (right) { // right circle // up down left right 四个方向的坐标均不相同 const x1 = Math.cos(((18 + 72 * 0) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * 0) / 180) * Math.PI) * outerR; group.addShape("circle", { attrs: { ...markStyle, x: x1, y: -y1, r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", }); } if (top) { // up down left right 四个方向的坐标均不相同 const x1 = Math.cos(((18 + 72 * 1) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * 1) / 180) * Math.PI) * outerR; // top circle group.addShape("circle", { attrs: { ...markStyle, x: x1, y: -y1, r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", }); } if (left) { // up down left right 四个方向的坐标均不相同 const x1 = Math.cos(((18 + 72 * 2) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * 2) / 180) * Math.PI) * outerR; // left circle group.addShape("circle", { attrs: { ...markStyle, x: x1, y: -y1, r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", }); } if (leftBottom) { // up down left right 四个方向的坐标均不相同 const x1 = Math.cos(((18 + 72 * 3) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * 3) / 180) * Math.PI) * outerR; // left bottom circle group.addShape("circle", { attrs: { ...markStyle, x: x1, y: -y1, r: markSize / 2 || markR || 5, }, className: "link-point-left-bottom", name: "link-point-left-bottom", }); } if (rightBottom) { // up down left right 四个方向的坐标均不相同 const x1 = Math.cos(((18 + 72 * 4) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * 4) / 180) * Math.PI) * outerR; // left bottom circle group.addShape("circle", { attrs: { ...markStyle, x: x1, y: -y1, r: markSize / 2 || markR || 5, }, className: "link-point-right-bottom", name: "link-point-right-bottom", }); } }, getPath(cfg: NodeConfig) { const size = (this as ShapeOptions).getSize!(cfg); const outerR = size[0]; const defaultInnerR = (outerR * 3) / 8; const innerR = cfg.innerR || defaultInnerR; const path = []; for (let i = 0; i < 5; i++) { const x1 = Math.cos(((18 + 72 * i) / 180) * Math.PI) * outerR; const y1 = Math.sin(((18 + 72 * i) / 180) * Math.PI) * outerR; const x2 = Math.cos(((54 + 72 * i) / 180) * Math.PI) * innerR; const y2 = Math.sin(((54 + 72 * i) / 180) * Math.PI) * innerR; if (i === 0) { path.push(["M", x1, -y1]); } else { path.push(["L", x1, -y1]); } path.push(["L", x2, -y2]); } path.push(["Z"]); return path; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig): ShapeStyle { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖原来默认的 stroke 属性。但 cfg 中但 stroke 属性优先级更高 const style = mix({}, defaultStyle, strokeStyle); const path = (this as any).getPath(cfg); const styles = { path, ...style }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const path = (this as any).getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, path, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, true); (this as any).updateLinkPoints(cfg, group); }, /** * 更新linkPoints * @param {Object} cfg 节点数据配置项 * @param {Group} group Item所在的group */ updateLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints: defaultLinkPoints } = this.getOptions( {}, ) as NodeConfig; const markLeft = group.find( (element) => element.get("className") === "link-point-left", ); const markRight = group.find( (element) => element.get("className") === "link-point-right", ); const markTop = group.find( (element) => element.get("className") === "link-point-top", ); const markLeftBottom = group.find( (element) => element.get("className") === "link-point-left-bottom", ); const markRightBottom = group.find( (element) => element.get("className") === "link-point-right-bottom", ); let currentLinkPoints = defaultLinkPoints; const existLinkPoint = markLeft || markRight || markTop || markLeftBottom || markRightBottom; if (existLinkPoint) { currentLinkPoints = existLinkPoint.attr(); } const linkPoints = mix({}, currentLinkPoints, cfg.linkPoints); const { fill: markFill, stroke: markStroke, lineWidth: borderWidth, } = linkPoints; let markSize = linkPoints.size / 2; if (!markSize) markSize = linkPoints.r; const { left, right, top, leftBottom, rightBottom } = cfg.linkPoints ? cfg.linkPoints : { left: undefined, right: undefined, top: undefined, leftBottom: undefined, rightBottom: undefined, }; const size = (this as ShapeOptions).getSize!(cfg); const outerR = size[0]; const styles = { r: markSize, fill: markFill, stroke: markStroke, lineWidth: borderWidth, }; let x = Math.cos(((18 + 72 * 0) / 180) * Math.PI) * outerR; let y = Math.sin(((18 + 72 * 0) / 180) * Math.PI) * outerR; if (markRight) { if (!right && right !== undefined) { markRight.remove(); } else { markRight.attr({ ...styles, x, y: -y, }); } } else if (right) { group.addShape("circle", { attrs: { ...styles, x, y: -y, }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } x = Math.cos(((18 + 72 * 1) / 180) * Math.PI) * outerR; y = Math.sin(((18 + 72 * 1) / 180) * Math.PI) * outerR; if (markTop) { if (!top && top !== undefined) { markTop.remove(); } else { markTop.attr({ ...styles, x, y: -y, }); } } else if (top) { group.addShape("circle", { attrs: { ...styles, x, y: -y, }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } x = Math.cos(((18 + 72 * 2) / 180) * Math.PI) * outerR; y = Math.sin(((18 + 72 * 2) / 180) * Math.PI) * outerR; if (markLeft) { if (!left && left !== undefined) { markLeft.remove(); } else { markLeft.attr({ ...styles, x, y: -y, }); } } else if (left) { group.addShape("circle", { attrs: { ...styles, x, y: -y, }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } x = Math.cos(((18 + 72 * 3) / 180) * Math.PI) * outerR; y = Math.sin(((18 + 72 * 3) / 180) * Math.PI) * outerR; if (markLeftBottom) { if (!leftBottom && leftBottom !== undefined) { markLeftBottom.remove(); } else { markLeftBottom.attr({ ...styles, x, y: -y, }); } } else if (leftBottom) { group.addShape("circle", { attrs: { ...styles, x, y: -y, }, className: "link-point-left-bottom", name: "link-point-left-bottom", isAnchorPoint: true, }); } x = Math.cos(((18 + 72 * 4) / 180) * Math.PI) * outerR; y = Math.sin(((18 + 72 * 4) / 180) * Math.PI) * outerR; if (markRightBottom) { if (!rightBottom && rightBottom !== undefined) { markLeftBottom.remove(); } else { markRightBottom.attr({ ...styles, x, y: -y, }); } } else if (rightBottom) { group.addShape("circle", { attrs: { ...styles, x, y: -y, }, className: "link-point-right-bottom", name: "link-point-right-bottom", isAnchorPoint: true, }); } }, }, "single-node", ); ================================================ FILE: packages/element/src/nodes/triangle.ts ================================================ import { IGroup, IShape } from "@antv/g-base"; import { registerNode, Item, NodeConfig, ShapeStyle, ShapeOptions, BaseGlobal as Global, ModelConfig, } from "@antv/f6-core"; import { mix } from "@antv/util"; // 三角形 registerNode( "triangle", { // 自定义节点时的配置 options: { size: 40, direction: "up", style: { stroke: Global.defaultNode.style.stroke, fill: Global.defaultNode.style.fill, lineWidth: Global.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: Global.nodeLabel.style.fill, fontSize: Global.nodeLabel.style.fontSize, }, offset: 15, }, // 节点上左右上下四个方向上的链接circle配置 linkPoints: { top: false, right: false, bottom: false, left: false, // circle的大小 size: Global.defaultNode.linkPoints.size, lineWidth: Global.defaultNode.linkPoints.lineWidth, fill: Global.defaultNode.linkPoints.fill, stroke: Global.defaultNode.linkPoints.stroke, }, // 节点中icon配置 icon: { // 是否显示icon,值为 false 则不渲染icon show: false, // icon的地址,字符串类型 img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, offset: 6, }, stateStyles: { ...Global.nodeStateStyles, }, }, shapeType: "triangle", // 文本位置 labelPosition: "bottom", drawShape(cfg: NodeConfig, group: IGroup): IShape { const { icon = {}, direction: defaultDirection } = this.getOptions( cfg, ) as NodeConfig; const style = this.getShapeStyle!(cfg); const direction = cfg.direction || defaultDirection; const keyShape = group.addShape("path", { attrs: style, className: `${this.type}-keyShape`, name: `${this.type}-keyShape`, draggable: true, }); const { width: w, height: h, show, offset, text } = icon; if (show) { if (text) { group.addShape("text", { attrs: { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } else { let iconW = -w! / 2; let iconH = -h! / 2; if (direction === "up" || direction === "down") { iconH += offset; } if (direction === "left" || direction === "right") { iconW += offset; } group.addShape("image", { attrs: { x: iconW, y: iconH, ...icon, }, className: `${this.type}-icon`, name: `${this.type}-icon`, draggable: true, }); } } (this as any).drawLinkPoints(cfg, group); return keyShape; }, /** * 绘制节点上的LinkPoints * @param {Object} cfg data数据配置项 * @param {Group} group Group实例 */ drawLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints = {}, direction: defaultDirection } = this.getOptions( cfg, ) as NodeConfig; const direction = cfg.direction || defaultDirection; const { top, left, right, bottom, size: markSize, r: markR, ...markStyle } = linkPoints; const size = (this as ShapeOptions).getSize!(cfg); const len = size[0]; if (left) { // up down left right 四个方向的坐标均不相同 let leftPos = null; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); if (direction === "up") { leftPos = [-r, diffY]; } else if (direction === "down") { leftPos = [-r, -diffY]; } else if (direction === "left") { leftPos = [-r, r - diffY]; } if (leftPos) { // left circle group.addShape("circle", { attrs: { ...markStyle, x: leftPos[0], y: leftPos[1], r: markSize / 2 || markR || 5, }, className: "link-point-left", name: "link-point-left", }); } } if (right) { // right circle // up down left right 四个方向的坐标均不相同 let rightPos = null; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); if (direction === "up") { rightPos = [r, diffY]; } else if (direction === "down") { rightPos = [r, -diffY]; } else if (direction === "right") { rightPos = [r, r - diffY]; } if (rightPos) { group.addShape("circle", { attrs: { ...markStyle, x: rightPos[0], y: rightPos[1], r: markSize / 2 || markR || 5, }, className: "link-point-right", name: "link-point-right", }); } } if (top) { // up down left right 四个方向的坐标均不相同 let topPos = null; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); if (direction === "up") { topPos = [r - diffY, -diffY]; } else if (direction === "left") { topPos = [r, -diffY]; } else if (direction === "right") { topPos = [-r, -diffY]; } if (topPos) { // top circle group.addShape("circle", { attrs: { ...markStyle, x: topPos[0], y: topPos[1], r: markSize / 2 || markR || 5, }, className: "link-point-top", name: "link-point-top", }); } } if (bottom) { // up down left right 四个方向的坐标均不相同 let bottomPos = null; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); if (direction === "down") { bottomPos = [-r + diffY, diffY]; } else if (direction === "left") { bottomPos = [r, diffY]; } else if (direction === "right") { bottomPos = [-r, diffY]; } if (bottomPos) { // bottom circle group.addShape("circle", { attrs: { ...markStyle, x: bottomPos[0], y: bottomPos[1], r: markSize / 2 || markR || 5, }, className: "link-point-bottom", name: "link-point-bottom", }); } } }, getPath(cfg: ModelConfig) { const { direction: defaultDirection } = this.getOptions( cfg, ) as NodeConfig; const direction = cfg.direction || defaultDirection; const size = (this as ShapeOptions).getSize!(cfg); const len = size[0]; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); let path = [ ["M", -r, diffY], ["L", 0, -diffY], ["L", r, diffY], ["Z"], // 封闭 ]; if (direction === "down") { path = [ ["M", -r, -diffY], ["L", r, -diffY], ["L", 0, diffY], ["Z"], // 封闭 ]; } else if (direction === "left") { path = [ ["M", -r, r - diffY], ["L", r, -r], ["L", r, r], ["Z"], // 封闭 ]; } else if (direction === "right") { path = [ ["M", r, r - diffY], ["L", -r, r], ["L", -r, -r], ["Z"], // 封闭 ]; } return path; }, /** * 获取节点的样式,供基于该节点自定义时使用 * @param {Object} cfg 节点数据模型 * @return {Object} 节点的样式 */ getShapeStyle(cfg: NodeConfig) { const { style: defaultStyle } = this.getOptions(cfg) as NodeConfig; const strokeStyle: ShapeStyle = { stroke: cfg.color, }; // 如果设置了color,则覆盖默认的stroke属性 const style = mix({}, defaultStyle, strokeStyle); const path = (this as any).getPath(cfg); const styles = { path, ...style }; return styles; }, update(cfg: NodeConfig, item: Item) { const group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式 const { style: defaultStyle } = this.getOptions({}) as NodeConfig; const path = (this as any).getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。 const strokeStyle = { stroke: cfg.color, path, }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。 const keyShape = item.get("keyShape"); let style = mix({}, defaultStyle, keyShape.attr(), strokeStyle); style = mix(style, cfg.style); (this as any).updateShape(cfg, item, style, true); (this as any).updateLinkPoints(cfg, group); }, /** * 更新linkPoints * @param {Object} cfg 节点数据配置项 * @param {Group} group Item所在的group */ updateLinkPoints(cfg: NodeConfig, group: IGroup) { const { linkPoints: defaultLinkPoints, direction: defaultDirection } = this.getOptions({}) as NodeConfig; const direction = cfg.direction || defaultDirection; const markLeft = group.find( (element) => element.get("className") === "link-point-left", ); const markRight = group.find( (element) => element.get("className") === "link-point-right", ); const markTop = group.find( (element) => element.get("className") === "link-point-top", ); const markBottom = group.find( (element) => element.get("className") === "link-point-bottom", ); let currentLinkPoints = defaultLinkPoints; const existLinkPoint = markLeft || markRight || markTop || markBottom; if (existLinkPoint) { currentLinkPoints = existLinkPoint.attr(); } const linkPoints = mix({}, currentLinkPoints, cfg.linkPoints); const { fill: markFill, stroke: markStroke, lineWidth: borderWidth, } = linkPoints; let markSize = linkPoints.size / 2; if (!markSize) markSize = linkPoints.r; const { left, right, top, bottom } = cfg.linkPoints ? cfg.linkPoints : { left: undefined, right: undefined, top: undefined, bottom: undefined, }; const size = (this as ShapeOptions).getSize!(cfg); const len = size[0]; const styles = { r: markSize, fill: markFill, stroke: markStroke, lineWidth: borderWidth, }; let leftPos = null; const diffY = len * Math.sin((1 / 3) * Math.PI); const r = len * Math.sin((1 / 3) * Math.PI); if (direction === "up") { leftPos = [-r, diffY]; } else if (direction === "down") { leftPos = [-r, -diffY]; } else if (direction === "left") { leftPos = [-r, r - diffY]; } if (leftPos) { if (markLeft) { if (!left && left !== undefined) { markLeft.remove(); } else { markLeft.attr({ ...styles, x: leftPos[0], y: leftPos[1], }); } } else if (left) { group.addShape("circle", { attrs: { ...styles, x: leftPos[0], y: leftPos[1], }, className: "link-point-left", name: "link-point-left", isAnchorPoint: true, }); } } let rightPos = null; if (direction === "up") { rightPos = [r, diffY]; } else if (direction === "down") { rightPos = [r, -diffY]; } else if (direction === "right") { rightPos = [r, r - diffY]; } if (rightPos) { if (markRight) { if (!right && right !== undefined) { markRight.remove(); } else { markRight.attr({ ...styles, x: rightPos[0], y: rightPos[1], }); } } else if (right) { group.addShape("circle", { attrs: { ...styles, x: rightPos[0], y: rightPos[1], }, className: "link-point-right", name: "link-point-right", isAnchorPoint: true, }); } } let topPos = null; if (direction === "up") { topPos = [r - diffY, -diffY]; } else if (direction === "left") { topPos = [r, -diffY]; } else if (direction === "right") { topPos = [-r, -diffY]; } if (topPos) { if (markTop) { if (!top && top !== undefined) { markTop.remove(); } else { // top circle markTop.attr({ ...styles, x: topPos[0], y: topPos[1], }); } } else if (top) { group.addShape("circle", { attrs: { ...styles, x: topPos[0], y: topPos[1], }, className: "link-point-top", name: "link-point-top", isAnchorPoint: true, }); } } let bottomPos = null; if (direction === "down") { bottomPos = [-r + diffY, diffY]; } else if (direction === "left") { bottomPos = [r, diffY]; } else if (direction === "right") { bottomPos = [-r, diffY]; } if (bottomPos) { if (markBottom) { if (!bottom && bottom !== undefined) { markBottom.remove(); } else { markBottom.attr({ ...styles, x: bottomPos[0], y: bottomPos[1], }); } } else if (bottom) { group.addShape("circle", { attrs: { ...styles, x: bottomPos[0], y: bottomPos[1], }, className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: true, }); } } }, }, "single-node", ); ================================================ FILE: packages/element/tests/unit/issues-spec.ts ================================================ import G6 from "@antv/g6"; const div = document.createElement("div"); div.id = "container"; document.body.appendChild(div); describe("edge click state", () => { it("edge ", () => { G6.registerBehavior("active-edge", { getEvents() { return { "edge:click": "onEdgeSelect", "edge:mouseenter": "onEdgeHover", "edge:mouseleave": "onEdgeLeave", "canvas:mousedown": "clearSelectedEdge", }; }, onEdgeSelect(evt) { const item = evt.item; if (item.hasState("select")) { this.graph.setItemState(item, "select", false); return; } this.graph.setItemState(item, "select", true); }, onEdgeHover(evt) { const item = evt.item; if (item.hasState("select")) { return false; } this.graph.setItemState(item, "hover", true); }, onEdgeLeave(evt) { const item = evt.item; this.graph.setItemState(item, "hover", false); }, clearSelectedEdge(evt) { const edges = this.graph.findAllByState("edge", "select"); edges.forEach((edge) => { this.graph.setItemState(edge, "select", false); }); }, }); const graph = new G6.Graph({ container: "container", width: 500, height: 500, defaultEdge: { type: "line", style: { stroke: "#24A0FF", radius: 4, offset: 15, lineWidth: 2, lineAppendWidth: 4, cursor: "pointer", endArrow: { path: "M 0,0 L 7,3 L 5,0 L 7,-3 Z", fill: "#24A0FF", }, }, }, edgeStateStyles: { hover: { stroke: "#0ff", endArrow: { fill: "#FF7868", }, }, select: { stroke: "#FF7868", endArrow: { fill: "#FF7868", }, }, }, modes: { default: ["drag-node", "active-edge"], }, }); graph.read({ nodes: [ { id: "1", x: 100, y: 100 }, { id: "2", x: 100, y: 220 }, ], edges: [{ source: "1", target: "2" }], }); }); }); describe("dragenter dragleave", () => { const data = { nodes: [ { id: "node1", x: 100, y: 100, }, { id: "node2", x: 200, y: 100, }, ], edges: [], }; const graph = new G6.Graph({ container: "container", width: 500, height: 500, modes: { default: ["drag-node"], }, }); graph.data(data); graph.render(); it("dragenter", () => { graph.on("node:dragenter", (e) => { // console.log('dragenter'); }); graph.on("node:dragleave", (e) => { // console.log('dragleave'); }); graph.on("node:mouseenter", (e) => { // console.log('mouseenter'); }); graph.on("node:mouseleave", (e) => { // console.log('mouseleave'); }); graph.on("node:dragover", (e) => { // console.log('dragover'); }); }); graph.destroy(); }); // closes: #1026 describe("empty data array + fitview", () => { const data = { nodes: [], edges: [], }; const graph = new G6.Graph({ container: "container", width: 500, height: 500, fitView: true, }); graph.data(data); it("empty data array + fitview", () => { graph.render(); graph.destroy(); }); }); // closes: #1301 describe("change data with rect node", () => { const data = { nodes: [ { name: "source", id: "source", label: "source", type: "rect", x: 100, y: 100, //size: [60, 60], style: { width: 60, height: 20, }, }, ], edges: [], }; const graph = new G6.Graph({ container: "container", width: 500, height: 500, }); graph.data(data); it("change data", () => { graph.render(); graph.changeData(data); graph.destroy(); }); }); describe("cubic with layout", () => { const data = { nodes: [ { id: "1", label: "冲压", degree: 1, // x: 0, // y: 0 // x: 100, // y: 300 }, { id: "2", label: "电镀", degree: 2, // x: 0, // y: 0 // x: 600, // y: 300 }, ], edges: [ { source: "1", target: "2", }, ], }; const dashArray = [ [0, 1], [0, 2], [1, 2], [0, 1, 1, 2], [0, 2, 1, 2], [1, 2, 1, 2], [2, 2, 1, 2], [3, 2, 1, 2], [4, 2, 1, 2], ]; const lineDash = [4, 2, 1, 2]; const interval = 9; // lineDash 的和 G6.registerEdge( "line-dash", { afterDraw(cfg, group) { // 获得该边的第一个图形,这里是边的 path const shape = group.get("children")[0]; // 获得边的 path 的总长度 const length = shape.getTotalLength(); let totalArray = []; // 计算出整条线的 lineDash for (let i = 0; i < length; i += interval) { totalArray = totalArray.concat(lineDash); } let index = 0; // 边 path 图形的动画 shape.animate( (ratio) => { const cfg = { lineDash: dashArray[index].concat(totalArray), }; // 每次移动 1 index = (index + 1) % interval; // 返回需要修改的参数集,这里只修改了 lineDash return cfg; }, { repeat: true, duration: 3000, }, ); // 一次动画的时长为 3000 }, }, "cubic", ); // 该自定义边继承了内置三阶贝塞尔曲线边 cubic const graph = new G6.Graph({ container: "container", width: 500, height: 500, //animate: true, defaultEdge: { size: 2, type: "line-dash", //'line',//'line-dash',// color: "rgb(150, 150, 150)", }, layout: { type: "dagre", rankdir: "LR", nodesep: 30, //controlPoints: false // ranksep: 100 }, }); it("change data", () => { graph.data(data); graph.render(); graph.destroy(); }); }); describe("changdata states", () => { it("changeData", () => { const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const width = 500; const height = 500; const graph = new G6.Graph({ container: "container", width, height, modes: { default: ["activate-relations", "drag-canvas", "drag-node"], }, layout: { type: "circular", }, nodeStateStyles: { active: { stroke: "red", }, }, edgeStateStyles: { active: { stroke: "#000", opacity: 1, }, inactive: { color: "#969696", opacity: 0.5, }, }, animate: true, defaultNode: { size: 20, style: { lineWidth: 2, fill: "rgb(239, 244, 255)", stroke: "rgb(95, 149, 255)", }, }, defaultEdge: { size: 1, color: "rgb(150, 150, 150)", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "rgb(150, 150, 150)", }, }, }, }); graph.data(data); graph.render(); const node1 = graph.findById("1"); graph.setItemState(node1, "active", true); const edge1 = graph.getEdges()[0]; graph.setItemState(edge1, "active", true); expect(graph.findAllByState("node", "active").length).toBe(1); expect(graph.findAllByState("edge", "active").length).toBe(1); graph.changeData(data); expect(graph.findAllByState("node", "active").length).toBe(0); expect(graph.findAllByState("edge", "active").length).toBe(0); graph.destroy(); }); }); describe("defaultStyle states", () => { it("label", () => { const data = { nodes: [ { id: "node1", label: "node1", x: 100, y: 100, }, ], }; const graph = new G6.Graph({ container: "container", width: 500, height: 500, defaultEdge: { color: "rgb(150, 150, 150)", lineAppendWidth: 3, }, defaultNode: { style: { fill: "#DEE9FF", stroke: "rgb(95, 149, 255)", }, }, nodeStateStyles: { hover: { lineWidth: 5, fillOpacity: 1, "text-shape": { fontSize: 20, fill: "#003a8c", }, }, }, edgeStateStyles: { hover: { lineWidth: 3, }, }, }); graph.data(data); graph.render(); graph.on("node:mouseenter", function (evt) { const node = evt.item; const model = node.getModel(); model.oriLabel = model.label; graph.setItemState(node, "hover", true); graph.updateItem(node, { label: "hover 后 " + model.id, labelCfg: { style: { fill: "blue", }, }, }); }); graph.on("node:mouseleave", function (evt) { const node = evt.item; const model = node.getModel(); graph.setItemState(node, "hover", false); graph.updateItem(node, { label: model.oriLabel, style: { "text-shape": { fill: "red", }, }, labelCfg: { style: { fill: "red", }, }, }); }); graph.on("edge:mouseenter", function (evt) { const edge = evt.item; const model = edge.getModel(); model.oriLabel = model.label; graph.setItemState(edge, "hover", true); graph.updateItem(edge, { label: "hover 后", labelCfg: { style: { fill: "#003a8c", }, }, }); }); graph.on("edge:mouseleave", function (evt) { const edge = evt.item; graph.setItemState(edge, "hover", false); graph.updateItem(edge, { label: "hover 前的边文本", labelCfg: { style: { fill: "#555", }, }, }); }); // graph.destroy() }); }); ================================================ FILE: packages/element/tests/unit/template-spec.ts ================================================ describe("template", () => { const el = document.createElement("div"); el.id = "test-div-id"; el.innerHTML = "hello g6"; document.querySelector("body").appendChild(el); it("div content", () => { expect(document.querySelector("#test-div-id").innerHTML).toBe("hello g6"); }); }); ================================================ FILE: packages/element/vite.config.ts ================================================ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "src"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), // 入口文件 name: "f6-element", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6-element", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/examples-alipay/app.acss ================================================ .container { min-height: 100%; } .content { width: 100%; } .tiny-button { font-size: 28rpx; padding: 0 0.7em; line-height: 60rpx; text-align: center; border-radius: 4rpx; } ================================================ FILE: packages/examples-alipay/app.js ================================================ App({ globalData: {}, async onLaunch() { console.log("app onLaunch"); /** * RPC 调用示例 */ my.call( "rpc", { operationType: "alipay.xx", requestData: [{}], headers: {}, }, function (result) { console.log(result); }, ); }, onShow() { console.log("app onShow"); }, }); ================================================ FILE: packages/examples-alipay/app.json ================================================ { "pages": [ "pages/index/index", "pages/search/search", "pages/tree-graph/compact-box/index", "pages/tree-graph/tb-compact-box/index", "pages/tree-graph/compact-box-left-align/index", "pages/tree-graph/mind-map/index", "pages/tree-graph/right-mind-map/index", "pages/tree-graph/left-mind-map/index", "pages/tree-graph/custom-side-mind-map/index", "pages/tree-graph/file-system/index", "pages/tree-graph/intend-align-top/index", "pages/tree-graph/intended/index", "pages/tree-graph/basic-dendrogram/index", "pages/tree-graph/tb-dendrogram/index", "pages/tree-graph/radial-dendrogram/index", "pages/tree-graph/radial-compact-box/index", "pages/tree-graph/custom-edge-tree/index", "pages/tree-graph/tree-edge-label/index", "pages/tree-graph/custom-tree/index", "pages/general-graph/basic-force-directed/index", "pages/general-graph/basic-FA2/index", "pages/general-graph/force-directed-prevent-overlap/index", "pages/general-graph/force-directed-force-clustering/index", "pages/general-graph/force-directed-functional-params/index", "pages/general-graph/basic-force-directed-drag-fix/index", "pages/general-graph/force-directed-configuration-translate/index", "pages/general-graph/force-bubbles/index", "pages/general-graph/force-constrained-in-rect/index", "pages/general-graph/basic-dagre/index", "pages/general-graph/dagre-combo/index", "pages/general-graph/dagre-UL/index", "pages/general-graph/dagre/index", "pages/general-graph/dagre-configuration-translate/index", "pages/general-graph/fruchterman/index", "pages/general-graph/fruchterman-clustering/index", "pages/general-graph/fruchterman-configuration-translate/index", "pages/general-graph/fruchterman-worker/index", "pages/general-graph/basic-radial/index", "pages/general-graph/prevent-overlap-radial/index", "pages/general-graph/prevent-overlap-unstrict-radial/index", "pages/general-graph/interact-radial/index", "pages/general-graph/radial-configuration-translate/index", "pages/general-graph/sort-radial/index", "pages/general-graph/degree-circular/index", "pages/general-graph/spiral-circular/index", "pages/general-graph/basic-circular/index", "pages/general-graph/division-circular/index", "pages/general-graph/circular-configuration-translate/index", "pages/general-graph/basic-grid/index", "pages/general-graph/cluster-grid/index", "pages/general-graph/basic-concentric/index", "pages/general-graph/basic-MDS/index", "pages/general-graph/basic-arc-diagram/index", "pages/general-graph/circular-arc-diagram/index", "pages/general-graph/basic-combo-force/index", "pages/general-graph/layout-translate/index", "pages/general-graph/subgraph-layout/index", "pages/general-graph/data-change/index", "pages/general-graph/custom-bi-graph/index", "pages/general-graph/layout-timing/index", "pages/elements/circle/index", "pages/elements/donut/index", "pages/elements/ellipse/index", "pages/elements/rect/index", "pages/elements/mode-rect/index", "pages/elements/diamond/index", "pages/elements/star/index", "pages/elements/triangle/index", "pages/elements/image/index", "pages/elements/polyline1/index", "pages/elements/polyline2/index", "pages/elements/polyline3/index", "pages/elements/cubic1/index", "pages/elements/cubic2/index", "pages/elements/arc/index", "pages/elements/loop/index", "pages/elements/circle-with-combo/index", "pages/elements/rect-with-combo/index", "pages/elements/built-in-arrows/index", "pages/elements/custom-arrows/index", "pages/elements/card/index", "pages/elements/card-node/index", "pages/elements/area-chart/index", "pages/elements/stack-chart/index", "pages/elements/line-chart/index", "pages/elements/bar-chart/index", "pages/elements/point-chart/index", "pages/elements/pie-chart/index", "pages/elements/list/index", "pages/elements/extra-shape/index", "pages/elements/custom-polyline/index", "pages/elements/custom-polyline2/index", "pages/elements/edge-mul-label/index", "pages/elements/c-circle/index", "pages/elements/c-rect/index", "pages/elements/label-len/index", "pages/elements/label-len1/index", "pages/elements/node-bg/index", "pages/elements/edge-bg/index", "pages/elements/multi-edges/index", "pages/interactive/highlight-dark/index", "pages/interactive/drag-subtree/index", "pages/interactive/collapse-slibing/index", "pages/interactive/change-data/index", "pages/interactive/add-child/index", "pages/interactive/combo-circle/index", "pages/interactive/combo-rect/index", "pages/interactive/move-animate/index", "pages/interactive/move/index", "pages/interactive/partial-node/index", "pages/interactive/set-mode/index", "pages/interactive/canvas-two-fingers/index", "pages/interactive/hide-item/index", "pages/interactive/fix-item/index", "pages/interactive/hull/index", "pages/interactive/change-members/index", "pages/animation/node-node/index", "pages/animation/point-in-line/index", "pages/animation/edge-edge/index", "pages/animation/edge-line-growth/index", "pages/animation/state-change-hover/index", "pages/animation/change-position-default/index", "pages/animation/custom-animate-position/index", "pages/scene-case/knowledge-tree-graph/index", "pages/scene-case/metro-lines/index", "pages/scene-case/custom-flow/index", "pages/scene-case/sankey/index", "pages/plugins/tool-tip/index", "pages/plugins/donut-transfer/index", "pages/plugins/edge-filter/index", "pages/plugins/fisheye/index", "pages/plugins/timebar/index", "pages/plugins/zoom-slider/index", "pages/plugins/bundling/index", "pages/plugins/menu/index", "pages/plugins/snap-line/index", "pages/plugins/mini-map/index" ], "window": { "defaultTitle": "F6移动端DEMO", "allowsBounceVertical": "NO", "canPullDown": "NO" } } ================================================ FILE: packages/examples-alipay/common/components/block-list/block-list.acss ================================================ .block-list-container { width: 100%; display: flex; justify-content: center; background-color: #fff; } .block-list { display: flex; justify-content: start; flex-wrap: wrap; width: 100%; padding-bottom: 20rpx; } .block-item { height: 50rpx; margin-right: 20rpx; margin-bottom: 20rpx; display: flex; justify-content: center; align-items: center; color: #333; font-size: 24rpx; background-color: rgba(245, 245, 245, 0.71); padding: 0 18rpx; } ================================================ FILE: packages/examples-alipay/common/components/block-list/block-list.axml ================================================ {{item.name}} {{item.name}} ================================================ FILE: packages/examples-alipay/common/components/block-list/block-list.js ================================================ Component({ methods: { onItemTap(e) { const { onItemTap } = this.props; const { name } = e.target.dataset; if (onItemTap) { onItemTap({ name }); } }, }, }); ================================================ FILE: packages/examples-alipay/common/components/block-list/block-list.json ================================================ { "component": true } ================================================ FILE: packages/examples-alipay/common/components/search/search.acss ================================================ page { background-color: #fff; } .page { padding: 0; } .search-bar { position: sticky; top: 0; background-color: #fff; z-index: 2; padding-top: 14rpx; overflow: hidden; } .am-search-input { height: 35px; line-height: 35px; } .am-search-synthetic { height: 35px; line-height: 35px; } .am-search-value { height: 35px; } .am-search-clear { height: 35px; width: 35px; } .am-search-cancel { color: #333; } .search-bar .am-search-input { background-color: rgba(0, 0, 0, 0.05); } .search-container { box-sizing: border-box; padding: 20px 12px; } .history { position: relative; padding-left: 2px; padding-bottom: 1px; color: #333; font-size: 36rpx; font-weight: bold; } .history .clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 40rpx; width: 40rpx; background-image: url('/image/clear.png'); background-size: 50%; background-position: center; background-repeat: no-repeat; } .history-list { margin-top: 10px; } .hot { padding-left: 2px; padding-bottom: 2px; color: #333; font-size: 36rpx; font-weight: bold; } .hot-list { margin-top: 10px; } .search-results { padding: 16px 12 0 0; } .component-name { color: #333; margin-right: 10rpx; } .thumb { height: 60rpx; width: 60rpx; margin-right: 30rpx; } .component .am-list-line-bottom::after { left: auto; right: 0; width: calc(100% - 80rpx); } .am-list-body::before { display: none; } .am-list-body::after { display: none; } .list-header { height: 100rpx; display: flex; align-items: center; background-color: #fff; color: #333; font-weight: bold; font-size: 34rpx; } .am-list-header { padding: 8px 16px 0; } .no-search-result { height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; } .no-search-result image { width: 87rpx; height: 87rpx; } .no-search-result text { margin-top: 37rpx; color: #999; font-size: 28rpx; } .am-list-text-wrapper { width: 100%; } ================================================ FILE: packages/examples-alipay/common/components/search/search.axml ================================================ 历史 热门 未找到搜索结果 组件 {{item.name}} API {{item.name}} ================================================ FILE: packages/examples-alipay/common/components/search/search.js ================================================ import { debounce } from "../../../common/utils/common"; import { componentList } from "../../../utils/process"; // 搜索推荐 const apiList = []; Page({ data: { value: "", history: my.getStorageSync({ key: "searchHistory" }).data || [], hot: [ { name: "知识图谱树", url: "../../SceneCase/knowledgeTreeGraph/index" }, { name: "基本弧线图", url: "../../GeneralGraph/basicArcDiagram/index" }, { name: "FA气泡图", url: "../../GeneralGraph/forceBubbles/index" }, { name: "无到有的边", url: "../../Animation/edge_lineGrowth/index" }, { name: "自定义流向图", url: "../../SceneCase/customFlow/index" }, { name: "生态树", url: "../../TreeGraph/BasicDendrogram/index" }, { name: "自定义树中的边", url: "../../TreeGraph/customEdgeTree/index" }, { name: "基本同心圆布局", url: "../../GeneralGraph/basicConcentric/index", }, { name: "布局切换", url: "../../GeneralGraph/layoutTranslate/index" }, ], componentSuggestions: [], apiSuggestions: [], }, onLoad() { this.setData({ history: my.getStorageSync({ key: "searchHistory" }).data, }); console.log(my.getStorageSync({ key: "searchHistory" }).data); this.onInput = debounce(this.onInput.bind(this), 400); my.setNavigationBar({ borderBottomColor: "#fff", }); }, clear() { my.confirm({ content: "确定删除相关历史?", success: (res) => { if (res.confirm) { my.clearStorage(); this.setData({ history: [], }); } }, }); }, onInput(keyword) { this.setData({ value: keyword, }); const regExp = /[A-Za-z]/; if (keyword === "" || (regExp.test(keyword) && keyword.length === 1)) { this.setData({ componentSuggestions: [], apiSuggestions: [], }); return; } const componentSuggestions = []; const apiSuggestions = []; for (let i = 0; i < componentList.length; i++) { if ( componentList[i].suggestion .toLocaleLowerCase() .indexOf(keyword.toLocaleLowerCase()) !== -1 ) { componentSuggestions.push(componentList[i]); } } for (let i = 0; i < apiList.length; i++) { if ( apiList[i].suggestion .toLocaleLowerCase() .indexOf(keyword.toLocaleLowerCase()) !== -1 ) { apiSuggestions.push(apiList[i]); } } this.setData({ componentSuggestions, apiSuggestions }); }, onClear() { this.setData({ value: "", }); }, onCancel() { this.setData({ componentSuggestions: [], apiSuggestions: [], value: "", }); my.navigateBack(); }, onItemTap({ name }) { this.setData({ value: name, }); this.onInput(name); }, onListItemTap(e) { const { name, url } = e.target.dataset; this.addToHistory(name); console.log(url); my.navigateTo({ url }); }, addToHistory(keyword) { const searchHistory = my.getStorageSync({ key: "searchHistory" }).data || []; let index = -1; for (let i = 0; i < searchHistory.length; i++) { if (searchHistory[i].name === keyword) { index = i; break; } } let history = []; if (searchHistory.length >= 8) { if (index === -1) { history = [{ name: keyword }, ...searchHistory.slice(0, 7)]; } else { searchHistory.splice(index, 1).slice(0, 7); history = [{ name: keyword }, ...searchHistory]; } } else if (index === -1) { history = [{ name: keyword }, ...searchHistory]; } else { searchHistory.splice(index, 1); history = [{ name: keyword }, ...searchHistory]; } my.setStorageSync({ key: "searchHistory", data: history, }); this.setData({ history, }); }, }); ================================================ FILE: packages/examples-alipay/common/components/search/search.json ================================================ { "defaultTitle": "搜索", "transparentTitle": "none", "allowsBounceVertical": "NO", "usingComponents": { "search-bar": "mini-ali-ui/es/search-bar/index", "block-list": "../block-list/block-list", "list": "mini-ali-ui/es/list/index", "list-item": "mini-ali-ui/es/list/list-item/index" } } ================================================ FILE: packages/examples-alipay/common/utils/common.js ================================================ function strLen(str = "") { let len = 0; for (let i = 0; i < str.length; i++) { if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) { len += 1; } else { len += 2; } } return len; } function measureText(text, font) { let fontSize = 12; if (font) { fontSize = parseInt(font.split(" ")[3], 10); } fontSize /= 2; return { width: strLen(text) * fontSize, }; } function processSearchData(all_data) { const all_result = []; all_data.forEach((obj) => { const { name: groupName, thumb, nameEn, detailList } = obj; detailList.forEach((detail) => { const { name, path: tmpPath } = detail; const suggestion = nameEn + groupName + name; const path = tmpPath.replace(/../, "/pages"); const result = { name, thumb, path, suggestion, }; all_result.push(result); }); }); return all_result; } // 防抖 function debounce(fn, wait) { let timeout; return function () { const ctx = this; const args = arguments; clearTimeout(timeout); timeout = setTimeout(function () { fn.apply(ctx, args); }, wait); }; } export { measureText, processSearchData, debounce }; ================================================ FILE: packages/examples-alipay/common/utils/context.js ================================================ import { measureText } from "./common"; /** * 部分小程序context会缺少函数,补上 */ function wrapContext(ctx) { if (!ctx) return; if (!ctx.measureText) { ctx.measureText = measureText; } return ctx; } export { wrapContext }; ================================================ FILE: packages/examples-alipay/common/utils/data.js ================================================ // 下面是第一个tab中的内容 export const treeGraphContainer = [ { name: "紧凑树", thumb: "/common/images/icon/compactbox.png", nameEn: "CompactTree", detailList: [ { name: "紧凑树", path: "../tree-graph/compact-box/index", }, { name: "至上而下的紧凑树", path: "../tree-graph/tb-compact-box/index", }, { name: "节点左对齐的紧凑树", path: "../tree-graph/compact-box-left-align/index", }, ], }, { name: "生态树", thumb: "/common/images/icon/dendrogram.png", nameEn: "Dendrogram", detailList: [ { name: "生态树", path: "../tree-graph/basic-dendrogram/index", }, { name: "至上而下的生态树", path: "../tree-graph/tb-dendrogram/index", }, ], }, { name: "脑图树", thumb: "/common/images/icon/mind.png", nameEn: "MindMap", detailList: [ { name: "子节点自动两侧分布", path: "../tree-graph/mind-map/index", }, { name: "子节点右侧分布", path: "../tree-graph/right-mind-map/index", }, { name: "子节点左侧分布", path: "../tree-graph/left-mind-map/index", }, { name: "自定义子节点分布", path: "../tree-graph/custom-side-mind-map/index", }, ], }, { name: "缩进树", thumb: "/common/images/icon/indent.png", nameEn: "Intend", path: "/page/component/movable-view/movable-view", detailList: [ { name: "文件系统", path: "../tree-graph/file-system/index", }, { name: "顶部对齐", path: "../tree-graph/intend-align-top/index", }, { name: "子节点两侧分布", path: "../tree-graph/intended/index", }, ], }, { name: "辐射树", thumb: "/common/images/icon/radial.png", nameEn: "Radial", detailList: [ { name: "生态辐射树", path: "../tree-graph/radial-dendrogram/index", }, { name: "紧凑辐射树", path: "../tree-graph/radial-compact-box/index", }, ], }, { name: "定制样式树", thumb: "/common/images/icon/dingzhi.png", nameEn: "Custom", detailList: [ { name: "自定义树中的边", path: "../tree-graph/custom-edge-tree/index", }, { name: "树边上的标签", path: "../tree-graph/tree-edge-label/index", }, { name: "复杂树样式", path: "../tree-graph/custom-tree/index", }, ], }, ]; export const generalGraphContainer = [ { name: "力导向图", thumb: "/common/images/icon/fa.png", nameEn: "ForceAtalas", detailList: [ { name: "FA布局及节点拖拽", path: "../general-graph/basic-force-directed/index", }, { name: "FA2布局", path: "../general-graph/basic-FA2/index", }, { name: "FA布局防止节点重叠", path: "../general-graph/force-directed-prevent-overlap/index", }, { name: "FA布局聚类", path: "../general-graph/force-directed-force-clustering/index", }, { name: "定制不同节点的参数", path: "../general-graph/force-directed-functional-params/index", }, { name: "固定被拖拽节点", path: "../general-graph/basic-force-directed-drag-fix/index", }, { name: "FA布局参数动态变化", path: "../general-graph/force-directed-configuration-translate/index", }, { name: "FA气泡图", path: "../general-graph/force-bubbles/index", }, { name: "约束在范围内布局", path: "../general-graph/force-constrained-in-rect/index", }, { name: "Combo FA布局", path: "../general-graph/basic-combo-force/index", }, ], }, { name: "流程图", thumb: "/common/images/icon/dagre.png", nameEn: "Dagre", detailList: [ { name: "流程图", path: "../general-graph/basic-dagre/index", }, { name: "带有Combo的流程图", path: "../general-graph/dagre-combo/index", }, { name: "自左向右的流程图", path: "../general-graph/dagre/index", }, { name: "自左向右的流程图对齐", path: "../general-graph/dagre-UL/index", }, { name: "布局参数动态变化", path: "../general-graph/dagre-configuration-translate/index", }, ], }, { name: "Fruchterman图", thumb: "/common/images/icon/terms.png", nameEn: "Fruchterman", detailList: [ { name: "基本Fruchterman", path: "../general-graph/fruchterman/index", }, { name: "Fruchterman聚类", path: "../general-graph/fruchterman-clustering/index", }, { name: "参数动态变化", path: "../general-graph/fruchterman-configuration-translate/index", }, ], }, { name: "辐射图", thumb: "/common/images/icon/radial.png", nameEn: "Radial", detailList: [ { name: "基本辐射布局", path: "../general-graph/basic-radial/index", }, { name: "防止节点重叠的严格辐射布局", path: "../general-graph/prevent-overlap-radial/index", }, { name: "防止节点重叠的非严格辐射布局", path: "../general-graph/prevent-overlap-unstrict-radial/index", }, { name: "交互扩展节点的辐射布局", path: "../general-graph/interact-radial/index", }, { name: "布局参数动态变化", path: "../general-graph/radial-configuration-translate/index", }, { name: "同层节点按照指定字段聚类", path: "../general-graph/sort-radial/index", }, ], }, { name: "环形图", thumb: "/common/images/icon/circle.png", nameEn: "Circle", detailList: [ { name: "基本环形布局", path: "../general-graph/basic-circular/index", }, { name: "按节点度数排序", path: "../general-graph/degree-circular/index", }, { name: "螺旋线布局", path: "../general-graph/spiral-circular/index", }, { name: "分割环形布局", path: "../general-graph/division-circular/index", }, { name: "参数动态变化", path: "../general-graph/circular-configuration-translate/index", }, ], }, { name: "网格图", thumb: "/common/images/icon/grid.png", nameEn: "Grid", detailList: [ { name: "基本网格布局", path: "../general-graph/basic-grid/index", }, { name: "指定排序方式的网格布局", path: "../general-graph/cluster-grid/index", }, ], }, { name: "同心圆", thumb: "/common/images/icon/concentric.png", nameEn: "Concentric", detailList: [ { name: "基本同心圆布局", path: "../general-graph/basic-concentric/index", }, ], }, { name: "降维图", thumb: "/common/images/icon/degree.png", nameEn: "MDS", detailList: [ { name: "基本降维布局图", path: "../general-graph/basic-MDS/index", }, ], }, { name: "弧线图", thumb: "/common/images/icon/arc.png", nameEn: "Arc Diagram ", detailList: [ { name: "基本弧线图", path: "../general-graph/basic-arc-diagram/index", }, { name: "环形弧线图", path: "../general-graph/circular-arc-diagram/index", }, ], }, { name: "布局机制", thumb: "/common/images/icon/buju.png", nameEn: "Layout", detailList: [ { name: "布局切换", path: "../general-graph/layout-translate/index", }, { name: "子图布局", path: "../general-graph/subgraph-layout/index", }, // { // name: '流水线子图布局', // path: '../general-graph/sublayoutPipes/index', // }, { name: "数据动态切换", path: "../general-graph/data-change/index", }, { name: "自定义二分图布局", path: "../general-graph/custom-bi-graph/index", }, { name: "布局时机监听", path: "../general-graph/layout-timing/index", }, ], }, ]; export const basicElementContainer = [ { name: "内置节点", thumb: "/common/images/icon/node.png", nameEn: "Node", detailList: [ { name: "圆形", path: "../elements/circle/index", }, { name: "甜甜圈", path: "../elements/donut/index", }, { name: "椭圆", path: "../elements/ellipse/index", }, { name: "矩形", path: "../elements/rect/index", }, { name: "模态矩形", path: "../elements/mode-rect/index", }, { name: "模态菱形", path: "../elements/diamond/index", }, { name: "五角星", path: "../elements/star/index", }, { name: "三角形", path: "../elements/triangle/index", }, { name: "图片", path: "../elements/image/index", }, ], }, { name: "内置边", thumb: "/common/images/icon/defaultEdge.png", nameEn: "Edge", detailList: [ { name: "折线1", path: "../elements/polyline1/index", }, { name: "折线2", path: "../elements/polyline2/index", }, { name: "折线3", path: "../elements/polyline3/index", }, { name: "三次贝塞尔曲线-垂直", path: "../elements/cubic1/index", }, { name: "三次贝塞尔曲线-水平", path: "../elements/cubic2/index", }, { name: "弧线", path: "../elements/arc/index", }, { name: "自环边", path: "../elements/loop/index", }, ], }, { name: "内置组合", thumb: "/common/images/icon/combo.png", nameEn: "Combo", detailList: [ { name: "圆形", path: "../elements/circle-with-combo/index", }, { name: "矩形", path: "../elements/rect-with-combo/index", }, ], }, { name: "边的箭头", thumb: "/common/images/icon/arrow.png", nameEn: "Arrow", detailList: [ { name: "默认内置箭头", path: "../elements/built-in-arrows/index", }, { name: "自定义箭头", path: "../elements/custom-arrows/index", }, ], }, { name: "自定义节点", thumb: "/common/images/icon/customNode.png", nameEn: "CustomNode", detailList: [ { name: "卡片", path: "../elements/card/index", }, { name: "卡片2", path: "../elements/card-node/index", }, { name: "面积图节点", path: "../elements/area-chart/index", }, { name: "堆叠图节点", path: "../elements/stack-chart/index", }, { name: "折线图节点", path: "../elements/line-chart/index", }, { name: "南丁格尔图节点", path: "../elements/bar-chart/index", }, { name: "点线图节点", path: "../elements/point-chart/index", }, { name: "饼图节点", path: "../elements/pie-chart/index", }, { name: "列表", path: "../elements/list/index", }, ], }, { name: "自定义边", thumb: "/common/images/icon/customEdge.png", nameEn: "CustomEdge", detailList: [ { name: "添加额外图形", path: "../elements/extra-shape/index", }, { name: "自定义折线", path: "../elements/custom-polyline/index", }, { name: "自定义折线2", path: "../elements/custom-polyline2/index", }, { name: "多标签边", path: "../elements/edge-mul-label/index", }, ], }, { name: "自定义组合", thumb: "/common/images/icon/customCombo.png", nameEn: "CustomCombo", detailList: [ { name: "带有Marker的圆", path: "../elements/c-circle/index", }, { name: "带有Marker的矩形", path: "../elements/c-rect/index", }, ], }, { name: "超长文本", thumb: "/common/images/icon/article.png", nameEn: "Long", detailList: [ { name: "文本超长", path: "../elements/label-len/index", }, { name: "使用换行符处理", path: "../elements/label-len1/index", }, ], }, { name: "文本背景", thumb: "/common/images/icon/background.png", nameEn: "Background", detailList: [ { name: "节点文本背景", path: "../elements/node-bg/index", }, { name: "边上文本背景", path: "../elements/edge-bg/index", }, ], }, { name: "多边定点", thumb: "/common/images/icon/multiedges.png", nameEn: "Multiple", detailList: [ { name: "两节点间存在多条边", path: "../elements/multi-edges/index", }, ], }, ]; export const basicInteractiveContainer = [ // { // name: '高亮', // thumb: '/common/images/icon/button.png', // nameEn: 'HighLight', // detailList: [ // { // name: '内置的高亮节点', // path: '../interactive/activateRelations/index', // }, // { // name: '自定义高亮', // path: '../interactive/highlightDark/index', // }, // ], // }, { name: "自定义树图交互", thumb: "/common/images/icon/interact.png", nameEn: "Tree-Graph", detailList: [ { name: "拖拽子树改变结构", path: "../interactive/drag-subtree/index", }, { name: "合并同类兄弟节点", path: "../interactive/collapse-slibing/index", }, { name: "使用changeData", path: "../interactive/change-data/index", }, { name: "使用addChild", path: "../interactive/add-child/index", }, ], }, { name: "节点分组", thumb: "/common/images/icon/label.png", nameEn: "Combo", detailList: [ { name: "圆形组合", path: "../interactive/combo-circle/index", }, { name: "矩形组合", path: "../interactive/combo-rect/index", }, ], }, { name: "节点集轮廓包裹", thumb: "/common/images/icon/textarea.png", nameEn: "Hull", detailList: [ { name: "用轮廓包裹节点集合", path: "../interactive/hull/index", }, { name: "修改包裹内部成员", path: "../interactive/change-members/index", }, ], }, { name: "聚集一个节点", thumb: "/common/images/icon/radio.png", nameEn: "Move", detailList: [ { name: "点击节点移动", path: "../interactive/move/index", }, { name: "点击节点动画", path: "../interactive/move-animate/index", }, ], }, { name: "响应区域事件", thumb: "/common/images/icon/checkbox.png", nameEn: "Response", detailList: [ { name: "响应节点中部分区域", path: "../interactive/partial-node/index", }, ], }, { name: "切换模式增加点和边", thumb: "/common/images/icon/switch.png", nameEn: "Switch", detailList: [ { name: "设置交互模式", path: "../interactive/set-mode/index", }, ], }, { name: "自定义交互", thumb: "/common/images/icon/slider.png", nameEn: "CustomInteraction", detailList: [ { name: "两指平移画布", path: "../interactive/canvas-two-fingers/index", }, ], }, { name: "画布交互", thumb: "/common/images/icon/picker-view.png", nameEn: "Canvas", detailList: [ { name: "缩放画布时固定元素", path: "../interactive/fix-item/index", }, { name: "拖拽画布时候隐藏", path: "../interactive/hide-item/index", }, ], }, ]; export const aminationContainer = [ { name: "节点动画", thumb: "/common/images/icon/nodeAminate.png", nameEn: "NodeAnimate", detailList: [ { name: "节点动画", path: "../animation/node-node/index", }, ], }, { name: "边动画", thumb: "/common/images/icon/edgeMove.png", nameEn: "EdgeAnimate", detailList: [ { name: "圆点沿边运动", path: "../animation/point-in-line/index", }, { name: "虚线运动", path: "../animation/edge-edge/index", }, { name: "无到有的边", path: "../animation/edge-line-growth/index", }, ], }, { name: "状态切换", thumb: "/common/images/icon/change.png", nameEn: "Change", detailList: [ { name: "状态与动画", path: "../animation/state-change-hover/index", }, ], }, { name: "节点移动动画", thumb: "/common/images/icon/nodeMove.png", nameEn: "NodeMove", detailList: [ { name: "节点移动动画", path: "../animation/change-position-default/index", }, ], }, { name: "自定义动画", thumb: "/common/images/icon/navigator.png", nameEn: "CustomAminate", detailList: [ { name: "自定义动画", path: "../animation/custom-animate-position/index", }, ], }, ]; // 下面是第二个tab内容 export const customizeTree = [ { name: "自定义树图", thumb: "/common/images/icon/radial.png", nameEn: "Custom", detailList: [ // { // name: '决策树', // path: '../scene-case/decision-tree/index', // }, { name: "知识图谱树", path: "../scene-case/knowledge-tree-graph/index", }, ], }, ]; export const classicCace = [ { name: "经典案例", thumb: "/common/images/icon/classic.png", nameEn: "Classic", detailList: [ { name: "自定义流向图", path: "../scene-case/custom-flow/index", }, // { // name: '桑基图', // path: '../scene-case/sankey/index', // }, // { // name: '思维导图', // path: '../scene-case/mind-map/index', // }, // { // name: '甜甜圈转账图', // path: '../scene-case/donut-transfer/index', // }, ], }, ]; export const newsMapVisualize = [ { name: "新闻图可视化", thumb: "/common/images/icon/news.png", nameEn: "News", detailList: [ { name: "地铁路线图", path: "../scene-case/metro-lines/index", }, ], }, ]; export const plugins = [ { name: "提示框", nameEn: "Tooltip", detailList: [ { name: "Tooltip", path: "../plugins/tool-tip/index", }, ], }, { name: "图例", nameEn: "Legend", detailList: [ { name: "Legend", path: "../plugins/donut-transfer/index", }, ], }, { name: "边过滤", nameEn: "EdgeFilter", detailList: [ { name: "EdgeFilter", path: "../plugins/edge-filter/index", }, ], }, { name: "鱼眼", nameEn: "Fisheye", detailList: [ { name: "Fisheye", path: "../plugins/fisheye/index", }, ], }, { name: "时间轴", nameEn: "Timebar", detailList: [ { name: "Timebar", path: "../plugins/timebar/index", }, ], }, { name: "缩放轴", nameEn: "ZoomSlider", detailList: [ { name: "ZoomSlider", path: "../plugins/zoom-slider/index", }, ], }, { name: "边绑定", nameEn: "Bundling", detailList: [ { name: "Bundling", path: "../plugins/bundling/index", }, ], }, { name: "上下文菜单", nameEn: "Menu", detailList: [ { name: "Menu", path: "../plugins/menu/index", }, ], }, { name: "对齐线", nameEn: "SnapLine", detailList: [ { name: "SnapLine", path: "../plugins/snap-line/index", }, ], }, { name: "minimap", nameEn: "minimap", detailList: [ { name: "minimap", path: "../plugins/mini-map/index", }, ], }, ]; // 控制搜索框下面的热搜词 export const hot = [ { name: "知识图谱树", url: "../scene-case/knowledge-tree-graph/index" }, { name: "基本弧线图", url: "../general-graph/basic-arc-diagram/index" }, { name: "FA气泡图", url: "../general-graph/force-bubbles/index" }, { name: "无到有的边", url: "../animation/edge_line-growth/index" }, { name: "自定义流向图", url: "../scene-case/custom-flow/index" }, { name: "生态树", url: "../tree-graph/basic-dendrogram/index" }, { name: "自定义树中的边", url: "../tree-graph/custom-edge-tree/index" }, { name: "基本同心圆布局", url: "../general-graph/basic-concentric/index" }, { name: "布局切换", url: "../general-graph/layout-translate/index" }, ]; export const tabs = ["基础能力", "拓展能力"]; ================================================ FILE: packages/examples-alipay/common/utils/debounce.js ================================================ export default function debounce(fn, wait) { let timeout; return function () { const ctx = this; const args = arguments; clearTimeout(timeout); timeout = setTimeout(function () { fn.apply(ctx, args); }, wait); }; } ================================================ FILE: packages/examples-alipay/common/utils/process.js ================================================ import { processSearchData } from "./common"; import { treeGraphContainer, generalGraphContainer, basicElementContainer, basicInteractiveContainer, aminationContainer, customizeTree, classicCace, newsMapVisualize, } from "./data"; const all_data = [ ...treeGraphContainer, ...generalGraphContainer, ...basicElementContainer, ...basicInteractiveContainer, ...aminationContainer, ...customizeTree, ...classicCace, ...newsMapVisualize, ]; // 搜索数据 const componentList = processSearchData(all_data); export { componentList }; ================================================ FILE: packages/examples-alipay/mini.project.json ================================================ { "enableAppxNg": true, "enableNodeModuleBabelTransform": true, "node_modules_es6_whitelist": ["@antv/f6"], "component2": true, "exclude": ["dist/**/*"] } ================================================ FILE: packages/examples-alipay/package.json ================================================ { "name": "alipay", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@antv/f6": "^0.0.15", "@antv/f6-alipay": "^0.0.7", "@antv/f6-plugin": "^1.0.3", "mini-ali-ui": "^1.3.8" }, "repository": "git@github.com:antvis/F6.git" } ================================================ FILE: packages/examples-alipay/pages/animation/change-position-default/data.js ================================================ export default { nodes: [ { id: "a", x: 200, y: 100, style: { fill: "#5B8FF9", stroke: null }, }, { id: "b", x: 100, y: 200, style: { fill: "#5AD8A6", stroke: null }, }, { id: "c", x: 300, y: 200, style: { fill: "#5D7092", stroke: null }, }, ], edges: [ { id: "a2b", source: "a", target: "b", }, { id: "a2c", source: "a", target: "c", }, ], }; ================================================ FILE: packages/examples-alipay/pages/animation/change-position-default/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/change-position-default/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/change-position-default/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * changePosition#default */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, animate: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setInterval(() => { data.nodes.forEach((node) => { node.x += Math.random() * 50 - 25; node.y += Math.random() * 50 - 25; }); this.graph.changeData(data); }, 600); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/change-position-default/index.json ================================================ { "defaultTitle": "节点移动动画", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/custom-animate-position/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/custom-animate-position/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/custom-animate-position/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; /** * customAnimate#position */ const r = 50; const radius = Math.PI; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, animate: true, animateCfg: { duration: 1000, onFrame(node, ratio, toAttrs, fromAttrs) { const current = radius * ratio; let { x } = fromAttrs; let { y } = fromAttrs; if (fromAttrs.x > toAttrs.x) { x = x - r + r * Math.cos(current); y += r * Math.sin(current); } else { x = x + r - r * Math.cos(current); y -= r * Math.sin(current); } return { x, y }; }, }, }); // 加入两个节点 const node1 = this.graph.addItem("node", { id: "node1", x: 100, y: 100, type: "circle", style: { fill: "#5B8FF9", lineWidth: 0 }, }); const node2 = this.graph.addItem("node", { id: "node2", x: 200, y: 100, type: "circle", style: { fill: "#5AD8A6", lineWidth: 0 }, }); // 循环动画 let count = 0; setInterval(() => { if (count % 2 === 0) { node1.get("model").x = 200; node2.get("model").x = 100; } else { node1.get("model").x = 100; node2.get("model").x = 200; } count++; this.graph.refresh(); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/custom-animate-position/index.json ================================================ { "defaultTitle": "自定义动画", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/edge-edge/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/animation/edge-edge/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/edge-edge/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/edge-edge/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * edge#edge */ const lineDash = [4, 2, 1, 2]; F6.registerEdge( "line-dash", { afterDraw(cfg, group) { // get the first shape in the group, it is the edge's path here= const shape = group.get("children")[0]; let index = 0; // Define the animation shape.animate( () => { index++; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // returns the modified configurations here, lineDash and lineDashOffset here return res; }, { repeat: true, // whether executes the animation repeatly duration: 3000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "line-dash", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/edge-edge/index.json ================================================ { "defaultTitle": "虚线运动", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/edge-line-growth/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/animation/edge-line-growth/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/edge-line-growth/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/edge-line-growth/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * edge#lineGrowth */ F6.registerEdge( "line-growth", { afterDraw(_, group) { const shape = group.get("children")[0]; const length = shape.getTotalLength(); console.log(_); shape.animate( (ratio) => { // the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations const startLen = ratio * length; // Calculate the lineDash const cfg = { lineDash: [startLen, length - startLen], }; return cfg; }, { repeat: true, // Whether executes the animation repeatly duration: 2000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "line-growth", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/edge-line-growth/index.json ================================================ { "defaultTitle": "无到有的边", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/node-node/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, type: "circle-animate", size: 20, label: "Scale Animation", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, type: "background-animate", color: "#40a9ff", size: 20, label: "Background Animation", labelCfg: { position: "left", offset: 10, }, }, { id: "node3", x: 400, y: 100, size: [40, 40], type: "inner-animate", img: "data:image/webp;base64,UklGRq4FAABXRUJQVlA4IKIFAABwHwCdASo8ADwAPiEMhEGhhv6rQAYAgS2NHsdCq/4D8AOoA64OEUAj/XPxVwyvRGvyO/gGxN/t3oK/1X6zesX3L/p/RP/2HCgKAB9AGeAbCB+AGwAbQBtA/8c/m/4PYHTonm+SzRH6B9sv2i/rOZC+G/ln9l/ML/GdoD7APcA/TD+09QDzAfrX+vHYM9AD+Uf0zrAPQA/bH0vv2t+CH9qf2R+A39e6X098/I7IAcLcs8Gjmc/9T7gPbX9H+wJ+rPVV9En9ZmBI5oUiYhkYHIVjRr9hzCTPcV5Rs/wjjIHkxPgtr/3ALZSuUm146HHwqQVA23hnnqH/4aJ/k4v4hU6RBZ0AAAD+//8ARPyL9yWIlAbWBAD0oKSqlYWreuRa3Oj02u+TvSQS8iwMYewUYTWLDNp9wOlFJaWnqE+za35UwUXuDAT6T0I4fwY+u+qrRVhl+S1ir4X7BQiNswug5AX+MjQcXEeUwfSIEUT+DFPCr+BUiwTbFxLni7fv61vRbmXoauLz4tiqOFTzEGP8tNXP5+H7mZVGfNjIxapT3FGUtqBdp/SD5cTOYOkn2fawkpqpCSqf2+CfiGWtIF673fEzlk/hIbWDhQ81C/ddxLn609d/5efckbdZ8HZbhhVmM82/Uat7CFmw1SH5xCxRxEEhjpf1EP1Xn5q9VZfm1+OFTab/MN67Xha8K//5oVBlMgZALE653X0fas/+2xMqiyCu5Wa7PHsCwbBwqROfNmzi4LPOTjkFPHVKDD1Nfj4/sul6cANdF68rf2jszlyZsUUoLTP7H3swSroc3ssNXSRVAcYd7+iBZpfoAYWvKgnr+Hv62fHZX5ZbjYbYzVjq6fsXkubto858NuUx4+ILb5y7dP6W3/IYVeUSF0yZseKIZhOMs9BBf5uB2Y3Ott//+1OG7hYINzcqigrzWAOJbSmVw3G0ULywkobx+rvfk8VmZFzQGgP/+4T74mp/vsZyM1NLguiTO2gNO05tcpXwveq5mrcweXrJ/bRZDmU2KBrnXhkXq+735c+UHTFq4h4jMOPm5shKioB6XaqhUf3DJlMg8937g/SKjrgD0H5sNm0/k4FfilBbcrsjc3dd6cwEYJo3CNhe3SpNJ2geNXyV4/hq/BZXZ1kiVknjmf5cUx7Tv/9Sb+fQ/DgAsRNSz1wiVodiLjP7aVrkxbWx5gJ8U/j0o1Ipm/nyDZRPrQXmbPAcy1eDDejxTDBKe42ElHpC2QlFdhOedsp4i9QVjt8EqWGy1YzPaGqZhCVg/LWt8/+4BmiCzNGtpR21MGJf4kI/n/1sbe36e1QBCBAx4EVfTM82ZM2lh0P189e7eY0A3NzXWVrUek8SEn+DYYCQeEaC5hDHGreFHT1baY6KyrFx3G9oMm3fLrCqmNjFRnZa3LB/5m8FgCpq9B/1OCLRE5GzVTZnVzj/4V38PgCIpX16Kznijf01+MkDeS9oCF2hEXQ9tr+mPLrjGy4Cg5fyLgyCj1fUq33nMf79Svli2h83m3gqkoxJcXvBetFQP8V/gRjBNGmFXK5TfwLhbolWEjDqUGK3n+hxzQLif9zreYO88EIRTUNbzE1/Sn7rBEtjB0uawNje5OubWsB62SOlMZoZpxrDbMb4UvQrODPhSafmhcYe9zm/dHxssMfUthhDKjyMhoRhngPjbzfGXmIV2Omgrn/zbefK/PawUGSH6x4Qk4HCN4/X8S+XCf51JJtOQeHST/yfwg69uMkE07SONnhGUrL6j5oQn6JI+zkaH/H/P/Ti/pfOTfAWxQNiMvWX08mqbuUweFSQ/G5YUP/uCvZAXutf1+Nhl2jj/n4/fPOihPjwvfFnnjOaQvs9PSpF33d+396LASZ3IID/4UP4pf9eOMXw82ccoUUUHX6MfBWyBDvARCrdPmerUwKwW+lBIAe1dsAAAA==", label: "Image Rotate", labelCfg: { position: "right", }, }, { id: "node4", x: 300, y: 300, type: "rect", label: "No Animation", labelCfg: { position: "bottom", }, }, ], edges: [ { source: "node1", target: "node2", }, { source: "node3", target: "node2", }, { source: "node2", target: "node4", }, ], }; ================================================ FILE: packages/examples-alipay/pages/animation/node-node/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/node-node/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/node-node/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * node#node */ const { Util } = F6; // // Scale Animation F6.registerNode( "circle-animate", { afterDraw(cfg, group) { const shape = group.get("children")[0]; shape.animate( (ratio) => { const diff = ratio <= 0.5 ? ratio * 10 : (1 - ratio) * 10; return { r: cfg.size / 2 + diff, }; }, { repeat: true, duration: 3000, easing: "easeCubic", }, ); }, }, "circle", ); // Background Animation F6.registerNode( "background-animate", { afterDraw(cfg, group) { const r = cfg.size / 2; const back1 = group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back1-shape", }); const back2 = group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back2-shape", }); const back3 = group.addShape("circle", { zIndex: -1, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back3-shape", }); group.sort(); // Sort according to the zIndex back1.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 0, repeat: true, // repeat }, ); // no delay back2.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 1000, repeat: true, // repeat }, ); // 1s delay back3.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 2000, repeat: true, // repeat }, ); // 3s delay }, }, "circle", ); // // Image animation F6.registerNode( "inner-animate", { afterDraw(cfg, group) { const { size } = cfg; const width = size[0] - 12; const height = size[1] - 12; const image = group.addShape("image", { attrs: { x: -width / 2, y: -height / 2, width, height, img: cfg.img, }, name: "image-shape", }); image.animate( (ratio) => { const toMatrix = Util.transform( [1, 0, 0, 0, 1, 0, 0, 0, 1], [["r", ratio * Math.PI * 2]], ); return { matrix: toMatrix, }; }, { repeat: true, duration: 3000, easing: "easeCubic", }, ); }, }, "rect", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { lineWidth: 1, stroke: "#b5b5b5", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/node-node/index.json ================================================ { "defaultTitle": "节点动画", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/point-in-line/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/animation/point-in-line/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/point-in-line/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/point-in-line/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * pointInLine */ F6.registerEdge( "circle-running", { afterDraw(cfg, group) { // get the first shape in the group, it is the edge's path here= const shape = group.get("children")[0]; // the start position of the edge's path const startPoint = shape.getPoint(0); // add red circle shape const circle = group.addShape("circle", { attrs: { x: startPoint.x, y: startPoint.y, fill: "#1890ff", r: 3, }, name: "circle-shape", }); // animation for the red circle circle.animate( (ratio) => { // the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations // get the position on the edge according to the ratio const tmpPoint = shape.getPoint(ratio); // returns the modified configurations here, x and y here return { x: tmpPoint.x, y: tmpPoint.y, }; }, { repeat: true, // Whether executes the animation repeatly duration: 3000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "circle-running", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/point-in-line/index.json ================================================ { "defaultTitle": "圆点沿边运动", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/animation/state-change-hover/data.js ================================================ const nodes = []; const edges = []; // Center node const centerNode = { id: "center", x: 500, y: 300, type: "center-node", size: 20, }; nodes.push(centerNode); // Add 4 nodes on the left for (let i = 0; i < 4; i++) { const id = `left${i}`; nodes.push({ id, x: 250, y: (i + 1) * 100 + 50, type: "leaf-node", }); edges.push({ source: id, target: "center", type: "can-running" }); } // Add 6 nodes on the right for (let i = 0; i < 6; i++) { const id = `right${i}`; nodes.push({ id, x: 750, y: i * 100 + 50, type: "leaf-node", }); edges.push({ source: "center", target: id, type: "can-running" }); } export { nodes, edges }; ================================================ FILE: packages/examples-alipay/pages/animation/state-change-hover/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/animation/state-change-hover/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/animation/state-change-hover/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { nodes, edges } from "./data"; /** * stateChange_hover */ F6.registerNode( "leaf-node", { afterDraw(cfg, group) { group.addShape("circle", { attrs: { x: 0, y: 0, r: 5, fill: cfg.color || "#5B8FF9", }, name: "circle-shape", }); }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "circle", ); F6.registerNode( "center-node", { afterDraw(cfg, group) { const r = cfg.size / 2; group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r: r + 10, fill: "gray", opacity: 0.4, }, name: "circle-shape1", }); group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r: r + 20, fill: "gray", opacity: 0.2, }, name: "circle-shape2", }); group.sort(); }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "circle", ); // lineDash array const lineDash = [4, 2, 1, 2]; F6.registerEdge( "can-running", { setState(name, value, item) { const shape = item.get("keyShape"); if (name === "running") { if (value) { let index = 0; shape.animate( () => { index += 1; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // return the params for this frame return res; }, { repeat: true, duration: 3000, }, ); } else { shape.stopAnimate(); shape.attr("lineDash", null); } } }, }, "cubic-horizontal", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); this.graph.data({ nodes, edges }); this.graph.render(); this.graph.fitView(); this.graph.on("node:tap", (ev) => { const node = ev.item; const edges_ = node.getEdges(); edges_.forEach((edge) => this.graph.setItemState(edge, "running", true)); }); // this.graph.on('node:dbltap', (ev) => { // console.log('点击了') // const node = ev.item; // const edges_ = node.getEdges(); // edges_.forEach((edge) => this.graph.setItemState(edge, 'running', false)); // }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/animation/state-change-hover/index.json ================================================ { "defaultTitle": "状态与动画", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/arc/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 250, }, ], edges: [ // Built-in arc edges { id: "edge0", source: "0", target: "1", label: "curveOffset = 20", curveOffset: 20, }, { id: "edge1", source: "0", target: "1", label: "curveOffset = 50", // the bending degree curveOffset: 50, }, { id: "edge2", source: "0", target: "1", label: "curveOffset = -50", // the bending degree curveOffset: -50, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/arc/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/arc/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/arc/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * arc */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { // 支持的 behavior default: ["drag-node"], }, defaultEdge: { type: "arc", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, labelCfg: { autoRotate: true, refY: -10, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/arc/index.json ================================================ { "defaultTitle": "弧线", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/area-chart/data.js ================================================ export default { nodes: [ { id: "nodeD", x: 150, y: 150, label: "Area1", type: "area", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5ad8a6" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#ff99c3" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#6dc8ec" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#269a99" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, { id: "nodeD2", x: 500, y: 150, label: "Area2", type: "area", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeD", target: "nodeD2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/area-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/area-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/area-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * areaChart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerNode("area", { draw(cfg, group) { const baseR = 30; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 6; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#bae7ff", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5)) / 360; const tempIncValues = [baseR, baseR, baseR, baseR, baseR]; const allRs = []; cfg.details.forEach((cat) => { const oneRs = []; cat.values.forEach((v, i) => { const R = tempIncValues[i] + v * 0.4; oneRs.push(R); tempIncValues[i] = R; }); allRs.push(oneRs); }); const strokeColors = [ "rgba(91, 143, 249,1)", "rgba(90, 216, 166,1)", "rgba(246, 189, 22,1)", "rgba(232, 104, 74,1)", "rgba(255, 157, 77,1)", ]; const fillColors = [ "rgba(91, 143, 249,0.5)", "rgba(90, 216, 166,0.5)", "rgba(246, 189, 22,0.5)", "rgba(232, 104, 74,0.5)", "rgba(255, 157, 77,0.5)", ]; allRs.reverse().forEach((Rs, index) => { let curAngle = 0; const poss = []; Rs.forEach((r) => { const xPos = r * Math.cos(curAngle); const yPos = r * Math.sin(curAngle); curAngle += everyIncAngle; poss.push([xPos, yPos]); }); const Ls = poss.map((p, i) => { if (i === 0) { return ["M", ...p]; } return ["L", ...p]; }); group.addShape("path", { attrs: { path: [ ...Ls, ["Z"], // close the path ], stroke: strokeColors[index], fill: fillColors[index], }, name: "path-shape1", }); }); let nowAngle2 = 0; const everyIncAngleCat = (2 * Math.PI * (360 / 5)) / 360; for (let i = 0; i < 5; i++) { const r = 30 + 60; const xPos = r * Math.cos(nowAngle2); const yPos = r * Math.sin(nowAngle2); group.addShape("path", { attrs: { path: [ ["M", 0, 0], ["L", xPos, yPos], ], lineDash: [4, 4], stroke: "darkgray", }, name: "path-shape2", }); nowAngle2 += everyIncAngleCat; } // add a circle with the same filling color with background group.addShape("circle", { // attrs: style attrs: { x: 0, // 居中 y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { // attrs: style attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/area-chart/index.json ================================================ { "defaultTitle": "面积图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/bar-chart/data.js ================================================ export default { nodes: [ { id: "nodeA", x: 150, y: 150, label: "Bar1", type: "circleBar", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeA2", x: 500, y: 150, label: "Bar2", type: "circleBar", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeA", target: "nodeA2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/bar-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/bar-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/bar-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * barChart:使用G自定义的南丁格尔图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); const getPath = (cx, cy, rs, re, startAngle, endAngle, clockwise) => { const flag1 = clockwise ? 1 : 0; const flag2 = clockwise ? 0 : 1; return [ ["M", Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy], ["L", Math.cos(startAngle) * re + cx, Math.sin(startAngle) * re + cy], [ "A", re, re, 0, 0, flag1, Math.cos(endAngle) * re + cx, Math.sin(endAngle) * re + cy, ], ["L", Math.cos(endAngle) * rs + cx, Math.sin(endAngle) * rs + cy], [ "A", rs, rs, 0, 0, flag2, Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy, ], ["Z"], ]; }; F6.registerNode("circleBar", { draw(cfg, group) { /* G: Fan x: the circle center of the fan y: the circle center of the fan rs: inner radius re: outer radius startAngle: start angle endAngle: end angle clockwise: render clockwisely if it is true */ const baseR = 30; let nowAngle = 0; const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { cat.values.forEach((item) => { const re = item + baseR; const path0 = getPath( 0, 0, baseR, item + baseR, nowAngle, (nowAngle += everyIncAngle), false, ); const fan = group.addShape("path", { attrs: { path: path0, stroke: "darkgray", fill: cat.color, }, name: "path-shape", }); // behavior animation fan.on("mouseenter", () => { fan.animate( { re: re + 8, }, { repeat: false, duration: 300, }, ); }); fan.on("mouseleave", () => { fan.animate( { re, }, { repeat: false, duration: 300, }, ); }); // set the name fan.set("name", "littleCircle"); }); }); group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/bar-chart/index.json ================================================ { "defaultTitle": "南丁格尔图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/built-in-arrows/data.js ================================================ import F6 from "@antv/f6"; // 需要用到箭头 const data = { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 50, }, { id: "2", x: 150, y: 100, }, { id: "3", x: 350, y: 100, }, { id: "4", x: 150, y: 150, }, { id: "5", x: 350, y: 150, }, { id: "6", x: 150, y: 200, }, { id: "7", x: 350, y: 200, }, { id: "8", x: 150, y: 250, }, { id: "9", x: 350, y: 250, }, { id: "10", x: 150, y: 300, }, { id: "11", x: 350, y: 300, }, { id: "12", x: 150, y: 350, }, { id: "13", x: 350, y: 350, }, { id: "14", x: 150, y: 400, }, { id: "15", x: 350, y: 400, }, ], edges: [ { id: "edge0", source: "0", target: "1", label: "default arrow", style: { endArrow: true, }, }, { id: "edge1", source: "2", target: "3", label: "triangle arrow", style: { endArrow: { path: F6.Arrow.triangle(), }, }, }, { id: "edge2", source: "4", target: "5", label: "vee arrow", style: { endArrow: { path: F6.Arrow.vee(), }, }, }, { id: "edge3", source: "6", target: "7", label: "circle arrow", style: { endArrow: { path: F6.Arrow.circle(5, 3), d: 3, }, }, }, { id: "edge4", source: "8", target: "9", label: "diamond arrow", style: { endArrow: { path: F6.Arrow.diamond(10, 10, 3), d: 3, }, }, }, { id: "edge5", source: "10", target: "11", label: "rect arrow", style: { endArrow: { path: F6.Arrow.rect(10, 10, 3), d: 3, }, }, }, { id: "edge6", source: "12", target: "13", label: "rect arrow 2", style: { endArrow: { path: F6.Arrow.rect(10, 2, 5), d: 5, }, }, }, { id: "edge7", source: "14", target: "15", label: "triangleRect arrow", style: { endArrow: { path: F6.Arrow.triangleRect(10, 10, 10, 2, 4), }, }, }, ], }; data.edges.forEach((edge) => { edge.style.stroke = "#F6BD16"; console.log(edge.style.endArrow); if (edge.id !== "edge0") edge.style.endArrow.fill = "#F6BD16"; }); export default data; ================================================ FILE: packages/examples-alipay/pages/elements/built-in-arrows/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/built-in-arrows/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/built-in-arrows/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * built in arrows */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { size: 15, style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, modes: { // behaviors default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/built-in-arrows/index.json ================================================ { "defaultTitle": "默认内置箭头", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/c-circle/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 200, comboId: "combo1" }, { id: "node2", x: 300, y: 200, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/c-circle/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/c-circle/index.axml ================================================ Click the bottom marker to collapse/expand the combo. ================================================ FILE: packages/examples-alipay/pages/elements/c-circle/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * cCircle */ // The symbols for the marker inside the combo const collapseIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const expandIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; F6.registerCombo( "cCircle", { drawShape: function draw(cfg, group) { const self = this; // Get the shape style, where the style.r corresponds to the R in the Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); // Add a circle shape as keyShape which is the same as the extended 'circle' type Combo const circle = group.addShape("circle", { attrs: { ...style, x: 0, y: 0, r: style.r, }, draggable: true, name: "combo-keyShape", }); // Add the marker on the bottom group.addShape("marker", { attrs: { ...style, fill: "#fff", opacity: 1, x: 0, y: style.r, r: 10, symbol: collapseIcon, }, draggable: true, name: "combo-marker-shape", }); return circle; }, // Define the updating logic for the marker afterUpdate: function afterUpdate(cfg, combo) { const self = this; // Get the shape style, where the style.r corresponds to the R in the Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); const group = combo.get("group"); // Find the marker shape in the graphics group of the Combo const marker = group.find( (ele) => ele.get("name") === "combo-marker-shape", ); // Update the marker shape marker.attr({ x: 0, y: style.r, // The property 'collapsed' in the combo data represents the collapsing state of the Combo // Update the symbol according to 'collapsed' symbol: cfg.collapsed ? expandIcon : collapseIcon, }); }, }, "circle", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, // Configure the combos globally defaultCombo: { // The type of the combos. You can also assign type in the data of combos type: "cCircle", labelCfg: { refY: 2, }, // ... Other global configurations for combos }, modes: { default: ["drag-combo", "drag-node", "drag-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // collapse/expand when click the marker this.graph.on("combo:tap", (e) => { if (e.target.get("name") === "combo-marker-shape") { // graph.collapseExpandCombo(e.item.getModel().id); this.graph.collapseExpandCombo(e.item); if (this.graph.get("layout")) this.graph.layout(); else this.graph.refreshPositions(); } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/c-circle/index.json ================================================ { "defaultTitle": "带有Marker的圆", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/c-rect/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 200, comboId: "combo1" }, { id: "node2", x: 300, y: 200, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/c-rect/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/c-rect/index.axml ================================================ Click the bottom marker to collapse/expand the combo. ================================================ FILE: packages/examples-alipay/pages/elements/c-rect/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * cRect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); // The symbols for the marker inside the combo const collapseIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const expandIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; F6.registerCombo( "cRect", { drawShape: function drawShape(cfg, group) { const self = this; // Get the padding from the configuration cfg.padding = cfg.padding || [50, 20, 20, 20]; // Get the shape's style, where the style.width and style.height correspond to the width and height in the figure of Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); // Add a rect shape as the keyShape which is the same as the extended rect Combo const rect = group.addShape("rect", { attrs: { ...style, x: -style.width / 2 - (cfg.padding[3] - cfg.padding[1]) / 2, y: -style.height / 2 - (cfg.padding[0] - cfg.padding[2]) / 2, width: style.width, height: style.height, }, draggable: true, name: "combo-keyShape", }); // Add the circle on the right group.addShape("marker", { attrs: { ...style, fill: "#fff", opacity: 1, // cfg.style.width and cfg.style.heigth correspond to the innerWidth and innerHeight in the figure of Illustration of Built-in Rect Combo x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, r: 10, symbol: collapseIcon, }, draggable: true, name: "combo-marker-shape", }); return rect; }, // Define the updating logic of the right circle afterUpdate: function afterUpdate(cfg, combo) { const group = combo.get("group"); // Find the circle shape in the graphics group of the Combo by name const marker = group.find( (ele) => ele.get("name") === "combo-marker-shape", ); // Update the position of the right circle marker.attr({ // cfg.style.width and cfg.style.heigth correspond to the innerWidth and innerHeight in the figure of Illustration of Built-in Rect Combo x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, // The property 'collapsed' in the combo data represents the collapsing state of the Combo // Update the symbol according to 'collapsed' symbol: cfg.collapsed ? expandIcon : collapseIcon, }); }, }, "rect", ); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, // Configure the combos globally defaultCombo: { // The type of the combos. You can also assign type in the data of combos type: "cRect", // ... Other global configurations for combos }, modes: { default: ["drag-combo", "drag-node", "drag-canvas"], }, }); // collapse/expand when click the marker this.graph.on("combo:tap", (e) => { if (e.target.get("name") === "combo-marker-shape") { // graph.collapseExpandCombo(e.item.getModel().id); this.graph.collapseExpandCombo(e.item); if (this.graph.get("layout")) this.graph.layout(); else this.graph.refreshPositions(); } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/c-rect/index.json ================================================ { "defaultTitle": "带有Marker的矩形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/card/data.js ================================================ export default { nodes: [ { name: "cardNodeApp", ip: "127.0.0.1", nodeError: true, dataType: "root", keyInfo: "this is a card node info", x: 100, y: 50, }, { name: "cardNodeApp", ip: "127.0.0.1", nodeError: false, dataType: "subRoot", keyInfo: "this is sub root", x: 100, y: 150, }, { name: "cardNodeApp", ip: "127.0.0.1", nodeError: false, dataType: "subRoot", keyInfo: "this is sub root", x: 100, y: 250, children: [ { name: "sub", }, ], }, ], edges: [], }; ================================================ FILE: packages/examples-alipay/pages/elements/card/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/card/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/card/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * card */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const ERROR_COLOR = "#F5222D"; const getNodeConfig = (node) => { if (node.nodeError) { return { basicColor: ERROR_COLOR, fontColor: "#FFF", borderColor: ERROR_COLOR, bgColor: "#E66A6C", }; } let config = { basicColor: "#5B8FF9", fontColor: "#5B8FF9", borderColor: "#5B8FF9", bgColor: "#C6E5FF", }; switch (node.type) { case "root": { config = { basicColor: "#E3E6E8", fontColor: "rgba(0,0,0,0.85)", borderColor: "#E3E6E8", bgColor: "#5b8ff9", }; break; } default: break; } return config; }; const COLLAPSE_ICON = function COLLAPSE_ICON(x, y, r) { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const EXPAND_ICON = function EXPAND_ICON(x, y, r) { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; const nodeBasicMethod = { createNodeBox: (group, config, w, h, isRoot) => { /* 最外面的大矩形 */ const container = group.addShape("rect", { attrs: { x: 0, y: 0, width: w, heigh: h, }, name: "big-rect-shape", }); if (!isRoot) { /* 左边的小圆点 */ group.addShape("circle", { attrs: { x: 3, y: h / 2, r: 6, fill: config.basicColor, }, name: "left-dot-shape", }); } /* 矩形 */ group.addShape("rect", { attrs: { x: 3, y: 0, width: w - 19, height: h, fill: config.bgColor, stroke: config.borderColor, radius: 2, cursor: "pointer", }, name: "rect-shape", }); /* 左边的粗线 */ group.addShape("rect", { attrs: { x: 3, y: 0, width: 3, height: h, fill: config.basicColor, radius: 1.5, }, name: "left-border-shape", }); return container; }, /* 生成树上的 marker */ createNodeMarker: (group, collapsed, x, y) => { group.addShape("circle", { attrs: { x, y, r: 13, fill: "rgba(47, 84, 235, 0.05)", opacity: 0, zIndex: -2, }, name: "collapse-icon-bg", }); group.addShape("marker", { attrs: { x, y, r: 7, symbol: collapsed ? EXPAND_ICON : COLLAPSE_ICON, stroke: "rgba(0,0,0,0.25)", fill: "rgba(0,0,0,0)", lineWidth: 1, cursor: "pointer", }, name: "collapse-icon", }); }, afterDraw: (cfg, group) => { /* 操作 marker 的背景色显示隐藏 */ const icon = group.find( (element) => element.get("name") === "collapse-icon", ); if (icon) { const bg = group.find( (element) => element.get("name") === "collapse-icon-bg", ); icon.on("mouseenter", () => { bg.attr("opacity", 1); this.graph.get("canvas").draw(); }); icon.on("mouseleave", () => { bg.attr("opacity", 0); this.graph.get("canvas").draw(); }); } /* ip 显示 */ const ipBox = group.find((element) => element.get("name") === "ip-box"); if (ipBox) { /* ip 复制的几个元素 */ const ipLine = group.find( (element) => element.get("name") === "ip-cp-line", ); const ipBG = group.find( (element) => element.get("name") === "ip-cp-bg", ); const ipIcon = group.find( (element) => element.get("name") === "ip-cp-icon", ); const ipCPBox = group.find( (element) => element.get("name") === "ip-cp-box", ); const onMouseEnter = () => { ipLine.attr("opacity", 1); ipBG.attr("opacity", 1); ipIcon.attr("opacity", 1); this.graph.get("canvas").draw(); }; const onMouseLeave = () => { ipLine.attr("opacity", 0); ipBG.attr("opacity", 0); ipIcon.attr("opacity", 0); this.graph.get("canvas").draw(); }; ipBox.on("mouseenter", () => { onMouseEnter(); }); ipBox.on("mouseleave", () => { onMouseLeave(); }); ipCPBox.on("mouseenter", () => { onMouseEnter(); }); ipCPBox.on("mouseleave", () => { onMouseLeave(); }); ipCPBox.on("click", () => {}); } }, setState: (name, value, item) => { const hasOpacityClass = [ "ip-cp-line", "ip-cp-bg", "ip-cp-icon", "ip-cp-box", "ip-box", "collapse-icon-bg", ]; const group = item.getContainer(); const childrens = group.get("children"); this.graph.setAutoPaint(false); if (name === "emptiness") { if (value) { childrens.forEach((shape) => { if (hasOpacityClass.indexOf(shape.get("name")) > -1) { return; } shape.attr("opacity", 0.4); }); } else { childrens.forEach((shape) => { if (hasOpacityClass.indexOf(shape.get("name")) > -1) { return; } shape.attr("opacity", 1); }); } } this.graph.setAutoPaint(true); }, }; F6.registerNode("card-node", { draw: (cfg, group) => { const config = getNodeConfig(cfg); const isRoot = cfg.dataType === "root"; const { nodeError } = cfg; /* the biggest rect */ const container = nodeBasicMethod.createNodeBox( group, config, 243, 64, isRoot, ); if (cfg.dataType !== "root") { /* the type text */ group.addShape("text", { attrs: { text: cfg.dataType, x: 3, y: -10, fontSize: 12, textAlign: "left", textBaseline: "middle", fill: "rgba(0,0,0,0.65)", }, name: "type-text-shape", }); } if (cfg.ip) { /* ip start */ /* ipBox */ const ipRect = group.addShape("rect", { attrs: { fill: nodeError ? null : "#FFF", stroke: nodeError ? "rgba(255,255,255,0.65)" : null, radius: 2, cursor: "pointer", }, name: "ip-container-shape", }); /* ip */ const ipText = group.addShape("text", { attrs: { text: cfg.ip, x: 0, y: 19, fontSize: 12, textAlign: "left", textBaseline: "middle", fill: nodeError ? "rgba(255,255,255,0.85)" : "rgba(0,0,0,0.65)", cursor: "pointer", }, name: "ip-text-shape", }); const ipBBox = ipText.getBBox(); /* the distance from the IP to the right is 12px */ ipText.attr({ x: 224 - 12 - ipBBox.width, }); /* ipBox */ ipRect.attr({ x: 224 - 12 - ipBBox.width - 4, y: ipBBox.minY - 5, width: ipBBox.width + 8, height: ipBBox.height + 10, }); /* a transparent shape on the IP for click listener */ group.addShape("rect", { attrs: { stroke: "", cursor: "pointer", x: 224 - 12 - ipBBox.width - 4, y: ipBBox.minY - 5, width: ipBBox.width + 8, height: ipBBox.height + 10, fill: "#fff", opacity: 0, }, name: "ip-box", }); /* copyIpLine */ group.addShape("rect", { attrs: { x: 194, y: 7, width: 1, height: 24, fill: "#E3E6E8", opacity: 0, }, name: "ip-cp-line", }); /* copyIpBG */ group.addShape("rect", { attrs: { x: 195, y: 8, width: 22, height: 22, fill: "#FFF", cursor: "pointer", opacity: 0, }, name: "ip-cp-bg", }); /* copyIpIcon */ group.addShape("image", { attrs: { x: 200, y: 13, height: 12, width: 10, img: "https://os.alipayobjects.com/rmsportal/DFhnQEhHyPjSGYW.png", cursor: "pointer", opacity: 0, }, name: "ip-cp-icon", }); /* a transparent rect on the icon area for click listener */ group.addShape("rect", { attrs: { x: 195, y: 8, width: 22, height: 22, fill: "#FFF", cursor: "pointer", opacity: 0, }, name: "ip-cp-box", tooltip: "Copy the IP", }); /* ip end */ } /* name */ group.addShape("text", { attrs: { text: cfg.name, x: 19, y: 19, fontSize: 14, fontWeight: 700, textAlign: "left", textBaseline: "middle", fill: config.fontColor, cursor: "pointer", }, name: "name-text-shape", }); /* the description text */ group.addShape("text", { attrs: { text: cfg.keyInfo, x: 19, y: 45, fontSize: 14, textAlign: "left", textBaseline: "middle", fill: config.fontColor, cursor: "pointer", }, name: "bottom-text-shape", }); if (nodeError) { group.addShape("text", { attrs: { x: 191, y: 62, text: "⚠️", fill: "#000", fontSize: 18, }, name: "error-text-shape", }); } const hasChildren = cfg.children && cfg.children.length > 0; if (hasChildren) { nodeBasicMethod.createNodeMarker(group, cfg.collapsed, 236, 32); } return container; }, afterDraw: nodeBasicMethod.afterDraw, setState: nodeBasicMethod.setState, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-node"], }, defaultNode: { type: "card-node", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/card/index.json ================================================ { "defaultTitle": "卡片", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/card-node/data.js ================================================ export default { nodes: [ { title: "node1", error: true, nodeType: "a", id: "node1", nodeLevel: 2, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], x: 100, y: 100, }, { title: "node2", error: false, nodeType: "b", id: "node2", nodeLevel: 0, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], x: 100, y: 200, }, { title: "node3", error: false, nodeType: "a", id: "node3", nodeLevel: 3, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], collapse: true, x: 100, y: 300, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/card-node/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/card-node/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/card-node/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * cardNode */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const ICON_MAP = { a: "https://gw.alipayobjects.com/mdn/rms_8fd2eb/afts/img/A*0HC-SawWYUoAAAAAAAAAAABkARQnAQ", b: "https://gw.alipayobjects.com/mdn/rms_8fd2eb/afts/img/A*sxK0RJ1UhNkAAAAAAAAAAABkARQnAQ", }; F6.registerNode( "card-node", { drawShape: function drawShape(cfg, group) { const color = cfg.error ? "#F4664A" : "#30BF78"; const r = 2; const shape = group.addShape("rect", { attrs: { x: 0, y: 0, width: 200, height: 60, stroke: color, radius: r, }, name: "main-box", draggable: true, }); group.addShape("rect", { attrs: { x: 0, y: 0, width: 200, height: 20, fill: color, radius: [r, r, 0, 0], }, name: "title-box", draggable: true, }); // left icon group.addShape("image", { attrs: { x: 4, y: 2, height: 16, width: 16, cursor: "pointer", img: ICON_MAP[cfg.nodeType || "app"], }, name: "node-icon", }); // title text group.addShape("text", { attrs: { textBaseline: "top", y: 2, x: 24, lineHeight: 20, text: cfg.title, fill: "#fff", }, name: "title", }); if (cfg.nodeLevel > 0) { group.addShape("marker", { attrs: { x: 184, y: 30, r: 6, cursor: "pointer", symbol: cfg.collapse ? F6.Marker.expand : F6.Marker.collapse, stroke: "#666", lineWidth: 1, }, name: "collapse-icon", }); } // The content list cfg.panels.forEach((item, index) => { // name text group.addShape("text", { attrs: { textBaseline: "top", y: 25, x: 24 + index * 60, lineHeight: 20, text: item.title, fill: "rgba(0,0,0, 0.4)", }, name: `index-title-${index}`, }); // value text group.addShape("text", { attrs: { textBaseline: "top", y: 42, x: 24 + index * 60, lineHeight: 20, text: item.value, fill: "#595959", }, name: `index-title-${index}`, }); }); return shape; }, }, "single-node", ); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "card-node", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/card-node/index.json ================================================ { "defaultTitle": "卡片2", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/circle/data.js ================================================ export default { nodes: [ { id: "circle", label: "Circle", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/circle/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/circle/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/circle/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * circle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type */ type: "circle", /* node size */ size: [60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/circle/index.json ================================================ { "defaultTitle": "圆形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/circle-with-combo/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 150, comboId: "combo", }, { id: "node2", x: 350, y: 150, comboId: "combo", }, ], combos: [ { id: "combo", label: "Combo", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/circle-with-combo/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/circle-with-combo/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/circle-with-combo/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * circleWithCombo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", ], }, defaultCombo: { type: "circle", /* style for the keyShape */ // style: { // lineWidth: 1, // }, labelCfg: { /* label's offset to the keyShape */ // refY: 10, /* label's position, options: center, top, bottom, left, right */ position: "top", /* label's style */ // style: { // fontSize: 18, // }, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ /* you can extend it or override it as you want */ // comboStateStyles: { // active: { // fill: '#f00', // opacity: 0.5 // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/circle-with-combo/index.json ================================================ { "defaultTitle": "圆形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/cubic1/data.js ================================================ export default { nodes: [ { id: "node0", x: 200, y: 10, size: 20, }, { id: "node1", x: 200, y: 50, label: "1222", type: "my-rect", }, { id: "node2", x: 150, y: 150, type: "my-rect", }, { id: "node3", x: 250, y: 150, type: "my-rect", }, { id: "node4", x: 200, y: 250, type: "my-rect", }, ], edges: [ { source: "node0", target: "node1", }, { source: "node1", target: "node2", }, { source: "node1", target: "node3", }, { source: "node2", target: "node4", }, { source: "node3", target: "node4", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/cubic1/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/cubic1/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/cubic1/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * cubic1 */ F6.registerNode( "my-rect", { getAnchorPoints: function getAnchorPoints() { return [ [0.5, 0], [0.5, 1], ]; }, }, "rect", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "cubic-vertical", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/cubic1/index.json ================================================ { "defaultTitle": "三次贝塞尔曲线-垂直", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/cubic2/data.js ================================================ export default { nodes: [ { id: "node5", x: 150, y: 200, label: "5", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node6", x: 300, y: 150, label: "6", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node7", x: 300, y: 250, label: "7", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node5", target: "node6", type: "cubic-horizontal", }, { source: "node5", target: "node7", type: "cubic-horizontal", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/cubic2/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/cubic2/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/cubic2/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * cubic2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "cubic-horizontal", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/cubic2/index.json ================================================ { "defaultTitle": "三次贝塞尔曲线-水平", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/custom-arrows/data.js ================================================ const data = { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 50, }, { id: "2", x: 150, y: 100, }, { id: "3", x: 350, y: 100, }, ], edges: [ { id: "edge0", source: "0", target: "1", label: "custom arrow 1", style: { endArrow: { path: "M 3,-5 L 3,5 L 15,10 L 15,-10 Z", }, }, }, { id: "edge1", source: "2", target: "3", label: "custom arrow 2", style: { endArrow: { path: "M0,0 L10,4 L14,14 L18,4 L28,0 L18,-4 L14,-14 L10,-4 Z", }, }, }, ], }; data.edges.forEach((edge) => { edge.style.stroke = "#F6BD16"; console.log(edge.style.endArrow); edge.style.endArrow.fill = "#F6BD16"; }); export default data; ================================================ FILE: packages/examples-alipay/pages/elements/custom-arrows/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/custom-arrows/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/custom-arrows/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * custom Arrows */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { size: 15, style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, modes: { // behaviors default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/custom-arrows/index.json ================================================ { "defaultTitle": "自定义箭头", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline/data.js ================================================ export default { nodes: [ { id: "7", x: 150, y: 100, size: 40, anchorPoints: [ [1, 0.5], [1, 0], ], }, { id: "8", x: 300, y: 200, size: 40, anchorPoints: [ [0, 0.5], [0, 1], ], }, ], edges: [ { source: "7", target: "8", sourceAnchor: 0, targetAnchor: 0, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * customPolyline */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); // 注册边 F6.registerEdge( "line-arrow", { getPath(points) { const startPoint = points[0]; const endPoint = points[1]; return [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, endPoint.y], ["L", endPoint.x, endPoint.y], ]; }, getShapeStyle(cfg) { const { startPoint } = cfg; const { endPoint } = cfg; const controlPoints = this.getControlPoints(cfg); let points = [startPoint]; // the start point // the control points if (controlPoints) { points = points.concat(controlPoints); } // the end point points.push(endPoint); const path = this.getPath(points); const style = Object.assign( {}, F6.Global.defaultEdge.style, { stroke: "#BBB", lineWidth: 1, path, }, cfg.style, ); return style; }, }, "line", ); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultNode: { type: "circle", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, linkPoints: { left: true, right: true, fill: "#fff", stroke: "#1890FF", size: 3, }, }, defaultEdge: { type: "line-arrow", style: { stroke: "#F6BD16", startArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, endArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline/index.json ================================================ { "defaultTitle": "自定义折线", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline2/data.js ================================================ export default { nodes: [ { id: "7", x: 150, y: 100, size: 40, anchorPoints: [ [1, 0.5], [1, 0], ], }, { id: "8", x: 300, y: 200, size: 40, anchorPoints: [ [0, 0.5], [0, 1], ], }, ], edges: [ { source: "7", target: "8", sourceAnchor: 0, targetAnchor: 0, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline2/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline2/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline2/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * customPolyline2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerEdge("line-arrow", { options: { style: { stroke: "#ccc", }, }, draw: function draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const stroke = (cfg.style && cfg.style.stroke) || this.options.style.stroke; const startArrow = (cfg.style && cfg.style.startArrow) || undefined; const endArrow = (cfg.style && cfg.style.endArrow) || undefined; const keyShape = group.addShape("path", { attrs: { path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, endPoint.y], ["L", endPoint.x, endPoint.y], ], stroke, lineWidth: 1, startArrow, endArrow, }, className: "edge-shape", name: "edge-shape", }); return keyShape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultNode: { type: "circle", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, linkPoints: { left: true, right: true, fill: "#fff", stroke: "#1890FF", size: 3, }, }, defaultEdge: { type: "line-arrow", style: { stroke: "#F6BD16", startArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, endArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/custom-polyline2/index.json ================================================ { "defaultTitle": "自定义折线2", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/diamond/data.js ================================================ export default { nodes: [ { id: "diamond", label: "Diamond", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/diamond/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/diamond/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/diamond/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * diamond */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type */ type: "diamond", /* node size */ size: [80, 60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/diamond/index.json ================================================ { "defaultTitle": "模态菱形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/donut/data.js ================================================ export default { nodes: [ { id: "donut", label: "Donut", x: 250, y: 150, // the attributes for drawing donut donutAttrs: { prop1: 10, prop2: 20, prop3: 25, }, // the color map for drawing donut donutColorMap: { prop1: "#8eaade", prop2: "#5c7cb8", prop3: "#1e3f7d", }, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/donut/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/donut/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/donut/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * donut */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, fitViewPadding: 60, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type, the priority is lower than the type in the node data */ type: "donut", /* node size */ size: 60, /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ // linkPoints: { // top: true, // right: true, // bottom: true, // left: true, // /* linkPoints' size, 8 by default */ // // size: 5, // /* linkPoints' style */ // // fill: '#ccc', // // stroke: '#333', // // lineWidth: 2, // }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/donut/index.json ================================================ { "defaultTitle": "甜甜圈", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/edge-bg/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 250, y: 200, label: "node2", }, { id: "node3", x: 100, y: 350, label: "node3", }, ], edges: [ { source: "node1", target: "node2", label: "edge 1", }, { source: "node2", target: "node3", label: "edge 2", }, { source: "node3", target: "node1", label: "edge 3", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/edge-bg/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/edge-bg/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/edge-bg/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * edgeBg */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "circle", labelCfg: { position: "bottom", }, }, defaultEdge: { labelCfg: { autoRotate: true, style: { fill: "#1890ff", fontSize: 14, background: { fill: "#ffffff", stroke: "#9EC9FF", padding: [2, 2, 2, 2], radius: 2, }, }, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/edge-bg/index.json ================================================ { "defaultTitle": "边上文本背景", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/edge-mul-label/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "node1", }, { id: "node2", x: 300, y: 100, label: "node2", }, ], edges: [ { source: "node1", target: "node2", // The left and right labels label: ["hello", "world"], }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/edge-mul-label/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/edge-mul-label/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/edge-mul-label/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 多标签边 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerEdge("multipleLabelsEdge", { options: { style: { stroke: "#000", }, }, labelAutoRotate: true, draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const stroke = (cfg.style && cfg.style.stroke) || this.options.style.stroke; const shape = group.addShape("path", { attrs: { stroke, path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x, endPoint.y], ], }, name: "path-shape", }); if (cfg.label && cfg.label.length) { // the left label group.addShape("text", { attrs: { text: cfg.label[0], fill: "#595959", textAlign: "start", textBaseline: "middle", x: startPoint.x, y: startPoint.y - 10, }, name: "left-text-shape", }); if (cfg.label.length > 1) { // the right label group.addShape("text", { attrs: { text: cfg.label[1], fill: "#595959", textAlign: "end", textBaseline: "middle", x: endPoint.x, y: endPoint.y - 10, }, name: "right-text-shape", }); } } // return the keyShape return shape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: [ { type: "drag-node", delegate: false, }, "drag-canvas", { type: "zoom-canvas", sensitivity: 0.5, }, ], }, defaultNode: { type: "circle", size: [50], linkPoints: { left: true, right: true, }, }, defaultEdge: { type: "multipleLabelsEdge", style: { stroke: "#F6BD16", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/edge-mul-label/index.json ================================================ { "defaultTitle": "多标签边", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/ellipse/data.js ================================================ export default { nodes: [ { id: "ellipse", label: "Ellipse", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/ellipse/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/ellipse/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/ellipse/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * ellipse */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "ellipse", size: [80, 50], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/ellipse/index.json ================================================ { "defaultTitle": "椭圆", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/extra-shape/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, }, { id: "node2", x: 300, y: 100, }, { id: "node3", x: 300, y: 200, }, ], edges: [ { source: "node1", target: "node2", midPointColor: "#f00", quatileColor: "#f00", }, { source: "node1", target: "node3", midPointColor: "#0f0", quatileColor: "#0f0", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/extra-shape/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/extra-shape/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/extra-shape/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * extraShapes */ // 注册边 F6.registerEdge( "extra-shape-edge", { afterDraw(cfg, group) { // get the first shape in the graphics group of this edge, it is the path of the edge here // 获取图形组中的第一个图形,在这里就是边的路径图形 const shape = group.get("children")[0]; // get the coordinate of the mid point on the path // 获取路径图形的中点坐标 const midPoint = shape.getPoint(0.5); const rectColor = cfg.midPointColor || "#333"; // add a rect on the mid point of the path. note that the origin of a rect shape is on its lefttop // 在中点增加一个矩形,注意矩形的原点在其左上角 group.addShape("rect", { attrs: { width: 10, height: 10, fill: rectColor || "#333", // x and y should be minus width / 2 and height / 2 respectively to translate the center of the rect to the midPoint // x 和 y 分别减去 width / 2 与 height / 2,使矩形中心在 midPoint 上 x: midPoint.x - 5, y: midPoint.y - 5, }, }); // get the coordinate of the quatile on the path // 获取路径上的四分位点坐标 const quatile = shape.getPoint(0.25); const quatileColor = cfg.quatileColor || "#333"; // add a circle on the quatile of the path // 在四分位点上放置一个圆形 group.addShape("circle", { attrs: { r: 5, fill: quatileColor || "#333", x: quatile.x, y: quatile.y, }, }); }, update: undefined, }, "cubic", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultEdge: { type: "extra-shape-edge", style: { stroke: "#F6BD16", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/extra-shape/index.json ================================================ { "defaultTitle": "添加额外图形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/image/data.js ================================================ export default { nodes: [ { id: "image", img: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/image/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/image/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/image/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * image */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "image", size: [260, 80], clipCfg: { show: false, // Clip type options: circle, ellipse, rect, path type: "circle", // circle r: 30, // clip style style: { lineWidth: 1, }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/image/index.json ================================================ { "defaultTitle": "图片", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/label-len/data.js ================================================ import F6 from "@antv/f6"; const globalFontSize = 12; const fittingString = (str, maxWidth, fontSize) => { const ellipsis = "..."; const ellipsisLength = F6.Util.getTextSize(ellipsis, fontSize)[0]; let currentWidth = 0; let res = str; const pattern = new RegExp("[\u4E00-\u9FA5]+"); // distinguish the Chinese charactors and letters str.split("").forEach((letter, i) => { if (currentWidth > maxWidth - ellipsisLength) return; if (pattern.test(letter)) { // Chinese charactors currentWidth += fontSize; } else { // get the width of single letter according to the fontSize currentWidth += F6.Util.getLetterWidth(letter, fontSize); } if (currentWidth > maxWidth - ellipsisLength) { res = `${str.substr(0, i)}${ellipsis}`; } }); return res; }; const data = { nodes: [ { x: 100, y: 100, size: 40, label: "This label is too long to be displayed", id: "node1", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { x: 300, y: 100, size: 80, label: "This label is also too long to be displayed", id: "node2", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node1", target: "node2", label: "This label is too long to be displayed", labelCfg: { refY: 20, style: { fontSize: globalFontSize, }, }, style: { endArrow: true, }, }, ], }; // Modify the label in the data data.nodes.forEach(function (node) { node.label = fittingString(node.label, node.size, globalFontSize); }); data.edges.forEach(function (edge) { edge.label = fittingString(edge.label, 120, globalFontSize); }); export default data; ================================================ FILE: packages/examples-alipay/pages/elements/label-len/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/label-len/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/label-len/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * labelLen */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, labelCfg: { style: { fontSize: 12, }, }, }, defaultEdge: { color: "#F6BD16", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/label-len/index.json ================================================ { "defaultTitle": "文本超长", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/label-len1/data.js ================================================ import F6 from "@antv/f6"; const fittingString = (str, maxWidth, fontSize) => { let currentWidth = 0; let res = str; const pattern = new RegExp("[\u4E00-\u9FA5]+"); // distinguish the Chinese charactors and letters str.split("").forEach((letter, i) => { if (currentWidth > maxWidth) return; if (pattern.test(letter)) { // Chinese charactors currentWidth += fontSize; } else { // get the width of single letter according to the fontSize currentWidth += F6.Util.getLetterWidth(letter, fontSize); } if (currentWidth > maxWidth) { res = `${str.substr(0, i)}\n${str.substr(i)}`; } }); return res; }; const globalFontSize = 12; const data = { nodes: [ { x: 100, y: 100, label: fittingString( "Break the line if it is too long", 80, globalFontSize, ), id: "node1", labelCfg: { position: "bottom", }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { x: 300, y: 100, label: fittingString( "Break the line if it is too long", 80, globalFontSize, ), id: "node2", labelCfg: { position: "bottom", }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node1", target: "node2", label: fittingString( "Break the line if it is too long", 100, globalFontSize, ), labelCfg: { refY: 20, }, style: { endArrow: true, }, }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/elements/label-len1/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/label-len1/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/label-len1/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * labelLen1 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { color: "#F6BD16", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/label-len1/index.json ================================================ { "defaultTitle": "使用换行符处理", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/line-chart/data.js ================================================ export default { nodes: [ { id: "nodeB", x: 150, y: 150, label: "Line1", type: "circleLine", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeB2", x: 500, y: 150, label: "Line2", type: "circleLine", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 50, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [50, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 50, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeB", target: "nodeB2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/line-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/line-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/line-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * lineChart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerNode("circleLine", { draw(cfg, group) { const baseR = 30; let nowAngle = 0; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 5; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#bae7ff", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { // 计算一系列点的位置 const postions = []; cat.values.forEach((item, index) => { const r = baseR + item; const xPos = r * Math.cos(nowAngle); const yPos = r * Math.sin(nowAngle); nowAngle += everyIncAngle; postions.push([xPos, yPos]); if (index === 4) { const r_ = baseR + item; const xPos_ = r_ * Math.cos(nowAngle); const yPos_ = r_ * Math.sin(nowAngle); postions.push([xPos_, yPos_]); } }); const pathArrayL = postions.map((item) => ["L", ...item]); // add the connecting line group.addShape("path", { attrs: { path: [ ["M", 0, 0], // the top vertex ...pathArrayL, ["Z"], // close the path ], stroke: cat.color, }, name: "path-shape", }); postions.forEach((pos, index) => { if (index !== 5) { const littleCircle = group.addShape("circle", { // attrs: style attrs: { x: pos[0], y: pos[1], r: 2, fill: "black", stroke: cat.color, cursor: "pointer", }, name: "circle-shape", }); // 加上交互动画 littleCircle.on("mouseenter", function () { littleCircle.animate( { r: 5, }, { repeat: false, duration: 200, }, ); }); littleCircle.on("mouseleave", function () { littleCircle.animate( { r: 2, }, { repeat: false, duration: 200, }, ); }); // set the name littleCircle.set("name", "littleCircle"); } }); }); // add a circle with the same color with the background color group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, // 居中 y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/line-chart/index.json ================================================ { "defaultTitle": "折线图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/list/data.js ================================================ export default { nodes: [ { id: "shape2", x: 0, y: 0, type: "expandNode", name: "网站引流", values: [ { key: "曝光率", value: "19.09", }, { key: "流入UV", value: "910", }, { key: "点击率", value: "90", }, { key: "占比", value: "90", }, ], properties: [ { name: "搜索", value1: "102", value2: "102", value3: "102", value4: "102", }, { name: "扫一扫", value1: "102", value2: "102", value3: "102", value4: "102", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/list/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/list/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/list/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * list:列表 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerNode("expandNode", { draw: function draw(cfg, group) { const mainGroup = group.addGroup({ id: "main-group", }); const keyShape = mainGroup.addShape("rect", { attrs: { x: 0, y: 0, width: 100 + 60 * cfg.values.length, height: 50, fill: "#C6E5FF", }, name: "key-rect-shape", }); // name text mainGroup.addShape("text", { attrs: { text: cfg.name, fill: "#000", width: 130, x: 10, y: 32, }, name: "name-text-shape", }); const subGroup = group.addGroup({ id: "sub-group", }); cfg.values.forEach(function (data, index) { subGroup.addShape("rect", { attrs: { x: 110 + index * 60, y: 0, width: 50, height: 50, }, name: "rect-shape", }); subGroup.addShape("text", { attrs: { text: data.key, fill: "#000", x: 130 + index * 60, y: 20, fontSize: 10, textBaseline: "middle", className: "sub-group-text", }, name: "sub-text-shape1", }); subGroup.addShape("text", { attrs: { text: data.value, fill: "#000", x: 130 + index * 60, y: 30, fontSize: 10, textBaseline: "middle", textAlign: "left", className: "sub-group-text", }, name: "name-text-shape2", }); }); const listGroup = group.addGroup({ id: "detail-list-group", }); listGroup.addShape("rect", { attrs: { width: 100 + 60 * cfg.values.length - 70, height: 30 * cfg.properties.length + 20, fill: "#fff", x: 70, y: 30, }, name: "list-rect-shape1", }); const rectWidth = 100 + 60 * cfg.values.length - 80; cfg.properties.forEach(function (property, index) { listGroup.addShape("rect", { attrs: { width: rectWidth, height: 30, fill: "#9EC9FF", x: 80, y: 40 * index + 40, }, name: "list-rect-shape2", }); let count = 0; for (const p in property) { // 每个rect中添加5个文本 listGroup.addShape("text", { attrs: { text: property[p], fill: "#000", x: 85 + count * (rectWidth / cfg.values.length) - count * 10, y: 40 * index + 40 + 15, fontSize: 10, textBaseline: "middle", textAlign: "left", }, name: "text-shape", }); count++; } }); listGroup.hide(); return keyShape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, modes: { default: ["drag-canvas"], }, }); this.graph.on("node:tap", function (evt) { const { target } = evt; const parentGroup = target.get("parent").get("parent"); const detailGroup = parentGroup.findById("detail-list-group"); // 将sub-group中的内容网上移动一段距离 const subGroup = parentGroup.findById("sub-group"); const keyTexts = subGroup.findAll(function (item) { return item.attr("className") === "sub-group-text"; }); const isVisible = detailGroup.get("visible"); if (isVisible) { detailGroup.hide(); keyTexts.forEach(function (text) { const top = text.attr("y"); text.attr("y", top + 10); }); } else { keyTexts.forEach(function (text) { const top = text.attr("y"); text.attr("y", top - 10); }); detailGroup.show(); } this.graph.paint(); }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/list/index.json ================================================ { "defaultTitle": "列表", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/loop/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 150, }, { id: "1", x: 350, y: 150, }, ], edges: [ // 内置 loop { source: "0", target: "0", }, { source: "1", target: "1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/loop/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/loop/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/loop/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * loop */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // 支持的 behavior default: ["drag-node"], }, defaultEdge: { type: "loop", /* you can configure the global edge style as following lines */ style: { // stroke: '#F6BD16', endArrow: { path: "M 0,0 L 20,10 L 20,-10 Z", fill: "#eee", }, }, // 更多关于 loop 的配置请参考http://antv.alipay.com/zh/docs/manual/middle/elements/edges/loop/#%E8%87%AA%E7%8E%AF%E7%89%B9%E6%AE%8A%E9%85%8D%E7%BD%AE-loopcfg loopCfg: { position: "top", }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/loop/index.json ================================================ { "defaultTitle": "自环边", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/mode-rect/data.js ================================================ export default { nodes: [ { id: "rect1", label: "rect1", description: "description, hidden when undefined", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/mode-rect/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/mode-rect/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/mode-rect/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * modeRect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, defaultNode: { type: "modelRect", size: [270, 80], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: 1, fillOpacity: 1, }, // label configurations labelCfg: { style: { fill: "#595959", fontSize: 14, }, offset: 30, }, // left rect preRect: { show: true, width: 4, fill: "#40a9ff", radius: 2, }, // configurations for the four linkpoints linkPoints: { top: false, right: false, bottom: false, left: false, // the size of the linkpoints' circle size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, // configurations for the icon logoIcon: { // whether to show the icon show: true, x: 0, y: 0, // the image url for the icon, string type img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, // adjust the offset along x-axis for the icon offset: 0, }, // configurations for state icon stateIcon: { // whether to show the icon show: true, x: 0, y: 0, // the image url for the icon, string type img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, // adjust hte offset along x-axis for the icon offset: -5, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { hover: { lineWidth: 2, stroke: "#1890ff", fill: "#e6f7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "hover", true); }); // this.graph.on('canvas:tap', (evt) => { // const { item } = evt; // this.graph.setItemState(item, 'hover', false); // }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/mode-rect/index.json ================================================ { "defaultTitle": "模态矩形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/multi-edges/data.js ================================================ const data = { nodes: [ { id: "node1", x: 50, y: 350, label: "A", }, { id: "node2", x: 250, y: 150, label: "B", }, { id: "node3", x: 450, y: 350, label: "C", }, ], edges: [], }; for (let i = 0; i < 10; i++) { data.edges.push({ source: "node1", target: "node2", label: `${i}th edge of A-B`, }); } for (let i = 0; i < 5; i++) { data.edges.push({ source: "node2", target: "node3", label: `${i}th edge of B-C`, }); } export default data; ================================================ FILE: packages/examples-alipay/pages/elements/multi-edges/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/multi-edges/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/multi-edges/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * multiEdges */ F6.Util.processParallelEdges(data.edges); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // the edges are linked to the center of source and target ndoes linkCenter: true, defaultNode: { type: "circle", size: [40], color: "#5B8FF9", style: { fill: "#9EC9FF", lineWidth: 3, }, labelCfg: { style: { fill: "#000", fontSize: 14, }, }, }, defaultEdge: { type: "quadratic", labelCfg: { autoRotate: true, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/multi-edges/index.json ================================================ { "defaultTitle": "两节点间存在多条边", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/node-bg/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 250, y: 200, label: "node2", }, { id: "node3", x: 100, y: 350, label: "node3", }, ], edges: [ { source: "node1", target: "node2", label: "edge 1", }, { source: "node2", target: "node3", label: "edge 2", }, { source: "node3", target: "node1", label: "edge 3", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/node-bg/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/node-bg/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/node-bg/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * nodeBg */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "circle", labelCfg: { style: { fill: "#1890ff", fontSize: 14, background: { fill: "#ffffff", stroke: "#9EC9FF", padding: [2, 2, 2, 2], radius: 2, }, }, position: "bottom", }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/node-bg/index.json ================================================ { "defaultTitle": "节点文本背景", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/pie-chart/data.js ================================================ export default { nodes: [ { id: "pie1", size: 80, inDegree: 80, degree: 360, x: 150, y: 150, }, { id: "pie2", size: 80, inDegree: 280, degree: 360, x: 350, y: 150, }, ], edges: [ { source: "pie1", target: "pie2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/pie-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/pie-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/pie-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * pieChart:使用G自定义的饼图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); const lightBlue = "#5b8ff9"; const lightOrange = "#5ad8a6"; // register a pie chart node F6.registerNode("pie-node", { draw: (cfg, group) => { const radius = cfg.size / 2; // node radius const inPercentage = cfg.inDegree / cfg.degree; // the ratio of indegree to outdegree const inAngle = inPercentage * Math.PI * 2; // the anble for the indegree fan const inArcEnd = [ radius * Math.cos(inAngle), -radius * Math.sin(inAngle), ]; // the end position for the in-degree fan let isInBigArc = 0; let isOutBigArc = 1; if (inAngle > Math.PI) { isInBigArc = 1; isOutBigArc = 0; } // fan shape for the in degree const fanIn = group.addShape("path", { attrs: { path: [ ["M", radius, 0], ["A", radius, radius, 0, isInBigArc, 0, inArcEnd[0], inArcEnd[1]], ["L", 0, 0], ["Z"], ], lineWidth: 0, fill: lightOrange, }, name: "in-fan-shape", }); // draw the fan shape group.addShape("path", { attrs: { path: [ ["M", inArcEnd[0], inArcEnd[1]], ["A", radius, radius, 0, isOutBigArc, 0, radius, 0], ["L", 0, 0], ["Z"], ], lineWidth: 0, fill: lightBlue, }, name: "out-fan-shape", }); // 返回 keyshape return fanIn; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, defaultNode: { type: "pie-node", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/pie-chart/index.json ================================================ { "defaultTitle": "饼图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/point-chart/data.js ================================================ export default { nodes: [ { id: "nodeC", x: 150, y: 150, label: "Point2", type: "justPoints", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeC2", x: 500, y: 150, label: "Point2", type: "justPoints", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 50, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [50, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 50, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeC", target: "nodeC2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/point-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/point-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/point-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * pointChart:使用G自定义的点线图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerNode("justPoints", { draw(cfg, group) { const baseR = 30; let nowAngle = 0; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 5; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#5ad8a6", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; nowAngle += everyIncAngle / 2; cfg.details.forEach((cat) => { // Calculate the positions for vertexes const postions = []; cat.values.forEach((item, index) => { const r = baseR + item; const xPos = r * Math.cos(nowAngle); const yPos = r * Math.sin(nowAngle); nowAngle += everyIncAngle; postions.push([xPos, yPos]); if (index === 4) { const r_ = baseR + item; const xPos_ = r_ * Math.cos(nowAngle); const yPos_ = r_ * Math.sin(nowAngle); postions.push([xPos_, yPos_]); } }); // add marks postions.forEach((pos, index) => { if (index !== 5) { group.addShape("circle", { attrs: { x: pos[0], y: pos[1], r: 3, lineWidth: 2, stroke: cat.color, }, name: "circle-marker-shape", }); } }); }); let nowAngle2 = 0; const everyIncAngleCat = (2 * Math.PI * (360 / 5)) / 360; for (let i = 0; i < 5; i++) { const r = 30 + 50; const xPos = r * Math.cos(nowAngle2); const yPos = r * Math.sin(nowAngle2); group.addShape("path", { attrs: { path: [ ["M", 0, 0], ["L", xPos, yPos], ], lineDash: [4, 4], stroke: "#5ad8a6", }, name: "path-shape", }); nowAngle2 += everyIncAngleCat; } // add a circle with the same color with the background color group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "#fff", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/point-chart/index.json ================================================ { "defaultTitle": "点线图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/polyline1/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 100, }, { id: "1", x: 350, y: 300, }, ], edges: [ // Built-in polyline { source: "0", target: "1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/polyline1/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/polyline1/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/polyline1/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * polyline1 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "polyline", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/polyline1/index.json ================================================ { "defaultTitle": "折线1", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/polyline2/data.js ================================================ export default { nodes: [ { id: "2", x: 150, y: 150, }, { id: "3", x: 350, y: 250, }, ], edges: [ { source: "2", target: "3", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/polyline2/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/polyline2/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/polyline2/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * polyline2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "polyline", /* configure the bending radius and min distance to the end nodes */ style: { radius: 10, offset: 30, endArrow: true, /* and other styles */ // stroke: '#F6BD16', }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/polyline2/index.json ================================================ { "defaultTitle": "折线2", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/polyline3/data.js ================================================ export default { nodes: [ { id: "4", x: 150, y: 100, }, { id: "5", x: 350, y: 250, }, ], edges: [ { source: "4", target: "5", // assign the control points to control the bending positions controlPoints: [ { x: 260, y: 80, }, { x: 320, y: 50, }, { x: 390, y: 110, }, { x: 420, y: 110, }, { x: 420, y: 140, }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/polyline3/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/polyline3/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/polyline3/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * polyline3 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { // behavior default: ["drag-node"], }, defaultEdge: { type: "polyline", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/polyline3/index.json ================================================ { "defaultTitle": "折线3", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/rect/data.js ================================================ export default { nodes: [ { id: "rect", label: "rect", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/rect/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/rect/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/rect/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "rect", size: [80, 50], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "center", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/rect/index.json ================================================ { "defaultTitle": "矩形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/rect-with-combo/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 150, comboId: "combo", }, { id: "node2", x: 350, y: 150, comboId: "combo", }, ], combos: [ { id: "combo", label: "Combo", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/rect-with-combo/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/rect-with-combo/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/rect-with-combo/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * rectWithCombo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", ], }, defaultCombo: { type: "rect", size: [50, 50], /* style for the keyShape */ // style: { // lineWidth: 1, // }, labelCfg: { /* label's offset to the keyShape */ // refY: 10, /* label's position, options: center, top, bottom, left, right */ position: "top", /* label's style */ // style: { // fontSize: 18, // }, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ /* you can extend it or override it as you want */ // comboStateStyles: { // active: { // fill: '#f00', // opacity: 0.5 // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/rect-with-combo/index.json ================================================ { "defaultTitle": "矩形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/stack-chart/data.js ================================================ export default { nodes: [ { id: "nodeF", x: 150, y: 150, label: "StackedBar1", type: "stacked-bar-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeF2", x: 500, y: 150, label: "StackedBar2", type: "stacked-bar-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeF", target: "nodeF2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/stack-chart/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/stack-chart/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/stack-chart/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * stackChart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); const getPath = (cx, cy, rs, re, startAngle, endAngle, clockwise) => { const flag1 = clockwise ? 1 : 0; const flag2 = clockwise ? 0 : 1; return [ ["M", Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy], ["L", Math.cos(startAngle) * re + cx, Math.sin(startAngle) * re + cy], [ "A", re, re, 0, 0, flag1, Math.cos(endAngle) * re + cx, Math.sin(endAngle) * re + cy, ], ["L", Math.cos(endAngle) * rs + cx, Math.sin(endAngle) * rs + cy], [ "A", rs, rs, 0, 0, flag2, Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy, ], ["Z"], ]; }; // Custom stacked bar chart node F6.registerNode("stacked-bar-node", { draw(cfg, group) { /* G: Fan x: the circle center of the fan y: the circle center of the fan rs: inner radius re: outer radius startAngle: start angle endAngle: end angle clockwise: render clockwisely if it is true */ const baseR = 30; let nowAngle = 0; const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { cat.values.forEach((item) => { const baseNbr = Math.ceil(item / 10); const baseIncR = 7; let nowStartR = baseR; const last = item % 10; const endAngle = nowAngle + everyIncAngle; for (let i = 0; i < baseNbr; i++) { const path0 = getPath( 0, 0, nowStartR, nowStartR + baseIncR, nowAngle, endAngle, false, ); group.addShape("path", { attrs: { path: path0, stroke: "darkgray", fill: cat.color, }, name: "path-shape1", }); nowStartR = nowStartR + baseIncR + 2; if (i === baseNbr - 1 && last !== 0) { const path1 = getPath( 0, 0, nowStartR, nowStartR + (baseIncR * last) / 10, nowAngle, endAngle, false, ); group.addShape("path", { attrs: { path: path1, stroke: "darkgray", fill: cat.color, }, name: "path-shape2", }); } } nowAngle = endAngle; }); }); group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/stack-chart/index.json ================================================ { "defaultTitle": "堆叠图节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/star/data.js ================================================ export default { nodes: [ { id: "star", label: "Star", x: 250, y: 200, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/star/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/star/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/star/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * star */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type */ type: "star", /* node size */ size: [60, 60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/star/index.json ================================================ { "defaultTitle": "五角星", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/elements/triangle/data.js ================================================ export default { nodes: [ { id: "circle", label: "Triangle", x: 250, y: 200, }, ], }; ================================================ FILE: packages/examples-alipay/pages/elements/triangle/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/elements/triangle/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/elements/triangle/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * triangle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type */ type: "triangle", /* node size */ size: [40], direction: "up", /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: true, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/elements/triangle/index.json ================================================ { "defaultTitle": "三角形", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-FA2/data.js ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-FA2/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-FA2/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-FA2/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import forceAtlas2 from "@antv/f6/dist/extends/layout/forceAtlas2Layout"; /** * 基本 Force Atlas 2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("forceAtlas2", forceAtlas2); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "forceAtlas2", preventOverlap: true, kr: 10, center: [250, 250], }, defaultNode: { size: 20, }, }); data.nodes.forEach((node) => { node.x = Math.random() * 1; }); this.graph.on("afterlayout", () => { this.graph.fitView(); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-FA2/index.json ================================================ { "defaultTitle": "力导向布局2", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-MDS/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-MDS/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-MDS/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-MDS/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import mds from "@antv/f6/dist/extends/layout/mdsLayout"; /** * basicMDS */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-node"], }, layout: { type: "mds", linkDistance: 100, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-MDS/index.json ================================================ { "defaultTitle": "基本降维布局图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-arc-diagram/data.js ================================================ export default { nodes: [ { id: "0", name: "analytics.cluster", cluster: "analytics", value: 21, }, { id: "1", name: "analytics.graph", cluster: "analytics", value: 34, }, { id: "2", name: "analytics.optimization", cluster: "analytics", value: 8, }, { id: "3", name: "animate", cluster: "animate", value: 40, }, { id: "4", name: "animate.interpolate", cluster: "animate", value: 18, }, { id: "5", name: "data.converters", cluster: "data", value: 25, }, { id: "6", name: "data", cluster: "data", value: 10, }, { id: "7", name: "display", cluster: "display", value: 4, }, { id: "8", name: "flex", cluster: "flex", value: 6, }, { id: "9", name: "physics", cluster: "physics", value: 22, }, { id: "10", name: "query", cluster: "query", value: 67, }, { id: "11", name: "query.methods", cluster: "query", value: 71, }, { id: "12", name: "scale", cluster: "scale", value: 33, }, { id: "13", name: "util", cluster: "util", value: 23, }, { id: "14", name: "util.heap", cluster: "util", value: 2, }, { id: "15", cluster: "util", name: "util.math", value: 2, }, { id: "16", name: "util.palette", cluster: "util", value: 5, }, { id: "17", name: "vis.axis", cluster: "vis", value: 24, }, { id: "18", name: "vis.controls", cluster: "vis", value: 28, }, { id: "19", name: "vis.data", cluster: "vis", value: 70, }, { id: "20", name: "vis.data.render", cluster: "vis", value: 11, }, { id: "21", name: "vis.events", cluster: "vis", value: 8, }, { id: "22", name: "vis.legend", cluster: "vis", value: 27, }, { id: "23", name: "vis.operator.distortion", cluster: "vis", value: 9, }, { id: "24", name: "vis.operator.encoder", cluster: "vis", value: 30, }, { id: "25", name: "vis.operator.filter", cluster: "vis", value: 17, }, { id: "26", name: "vis.operator", cluster: "vis", value: 27, }, { id: "27", name: "vis.operator.label", cluster: "vis", value: 18, }, { id: "28", name: "vis.operator.layout", cluster: "vis", value: 91, }, { id: "29", name: "vis", cluster: "vis", value: 13, }, ], edges: [ { source: "10", target: "10", sourceWeight: 61, targetWeight: 61, }, { source: "11", target: "11", sourceWeight: 39, targetWeight: 39, }, { source: "3", target: "3", sourceWeight: 30, targetWeight: 30, }, { source: "19", target: "19", sourceWeight: 26, targetWeight: 26, }, { source: "13", target: "13", sourceWeight: 23, targetWeight: 23, }, { source: "9", target: "9", sourceWeight: 22, targetWeight: 22, }, { source: "12", target: "12", sourceWeight: 19, targetWeight: 19, }, { source: "28", target: "19", sourceWeight: 34, targetWeight: 0, }, { source: "4", target: "4", sourceWeight: 16, targetWeight: 16, }, { source: "11", target: "10", sourceWeight: 32, targetWeight: 0, }, { source: "28", target: "28", sourceWeight: 14, targetWeight: 14, }, { source: "18", target: "18", sourceWeight: 12, targetWeight: 12, }, { source: "26", target: "26", sourceWeight: 11, targetWeight: 11, }, { source: "28", target: "13", sourceWeight: 20, targetWeight: 0, }, { source: "5", target: "6", sourceWeight: 17, targetWeight: 2, }, { source: "19", target: "13", sourceWeight: 17, targetWeight: 0, }, { source: "17", target: "17", sourceWeight: 7, targetWeight: 7, }, { source: "6", target: "6", sourceWeight: 7, targetWeight: 7, }, { source: "12", target: "13", sourceWeight: 14, targetWeight: 0, }, { source: "1", target: "19", sourceWeight: 14, targetWeight: 0, }, { source: "5", target: "5", sourceWeight: 7, targetWeight: 7, }, { source: "21", target: "19", sourceWeight: 6, targetWeight: 4, }, { source: "25", target: "19", sourceWeight: 10, targetWeight: 0, }, { source: "0", target: "0", sourceWeight: 5, targetWeight: 5, }, { source: "3", target: "13", sourceWeight: 9, targetWeight: 0, }, { source: "20", target: "19", sourceWeight: 5, targetWeight: 4, }, { source: "19", target: "12", sourceWeight: 9, targetWeight: 0, }, { source: "0", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "24", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "22", target: "22", sourceWeight: 4, targetWeight: 4, }, { source: "24", target: "24", sourceWeight: 4, targetWeight: 4, }, { source: "26", target: "3", sourceWeight: 7, targetWeight: 0, }, { source: "24", target: "16", sourceWeight: 7, targetWeight: 0, }, { source: "16", target: "16", sourceWeight: 3, targetWeight: 3, }, { source: "10", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "7", target: "7", sourceWeight: 3, targetWeight: 3, }, { source: "22", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "20", target: "20", sourceWeight: 3, targetWeight: 3, }, { source: "1", target: "26", sourceWeight: 6, targetWeight: 0, }, { source: "27", target: "19", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "12", sourceWeight: 6, targetWeight: 0, }, { source: "22", target: "7", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "3", sourceWeight: 6, targetWeight: 0, }, { source: "17", target: "7", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "27", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "3", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "29", sourceWeight: 3, targetWeight: 2, }, { source: "22", target: "16", sourceWeight: 5, targetWeight: 0, }, { source: "18", target: "21", sourceWeight: 4, targetWeight: 0, }, { source: "22", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "23", target: "23", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "29", sourceWeight: 2, targetWeight: 2, }, { source: "28", target: "17", sourceWeight: 4, targetWeight: 0, }, { source: "15", target: "15", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "27", target: "27", sourceWeight: 2, targetWeight: 2, }, { source: "14", target: "14", sourceWeight: 2, targetWeight: 2, }, { source: "18", target: "29", sourceWeight: 3, targetWeight: 1, }, { source: "25", target: "26", sourceWeight: 3, targetWeight: 0, }, { source: "28", target: "9", sourceWeight: 3, targetWeight: 0, }, { source: "27", target: "7", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "12", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "18", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "20", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "19", target: "6", sourceWeight: 3, targetWeight: 0, }, { source: "29", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "25", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "28", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "24", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "16", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "21", sourceWeight: 2, targetWeight: 0, }, { source: "21", target: "21", sourceWeight: 1, targetWeight: 1, }, { source: "29", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "4", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "8", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "2", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "1", sourceWeight: 1, targetWeight: 1, }, { source: "23", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "23", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "0", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "21", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "3", target: "4", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "26", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "17", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "5", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "12", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "20", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "21", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "6", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "1", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "6", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "25", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "7", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "0", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "19", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "29", sourceWeight: 1, targetWeight: 0, }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-arc-diagram/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-arc-diagram/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-arc-diagram/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import mds from "@antv/f6/dist/extends/layout/mdsLayout"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 定义颜色 const colors = [ "rgb(91, 143, 249)", "rgb(90, 216, 166)", "rgb(93, 112, 146)", "rgb(246, 189, 22)", "rgb(232, 104, 74)", "rgb(109, 200, 236)", "rgb(146, 112, 202)", "rgb(255, 157, 77)", "rgb(38, 154, 153)", "rgb(227, 137, 163)", ]; // 后面会用到的函数 function scaleNodeProp(nodes, propName, refPropName, dataRange, outRange) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; nodes.forEach(function (n) { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; }); } // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = `source: ${model.sourceName}
target: ${model.targetName}`; return text; }, }, ], }, defaultNode: { style: { opacity: 0.8, lineWidth: 1, stroke: "#999", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { opacity: 0.6, lineAppendWidth: 3, }, }, }); // 处理数据 const { edges } = data; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; const n = nodes.length; const horiPadding = 10; const begin = [horiPadding, height * 0.7]; const end = [width - horiPadding, height * 0.7]; const xLength = end[0] - begin[0]; const yLength = end[1] - begin[1]; const xSep = xLength / n; const ySep = yLength / n; nodes.forEach(function (node, i) { node.x = begin[0] + i * xSep; node.y = begin[1] + i * ySep; nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const id = clusterMap.get(node.cluster); if (node.style) { node.style.fill = colors[id % colors.length]; } else { node.style = { fill: colors[id % colors.length], }; } // label node.label = node.name; node.labelCfg = { position: "bottom", offset: 5, style: { rotate: Math.PI / 2, textAlign: "start", }, }; }); edges.forEach((edge) => { edge.type = "arc"; const source = nodeMap.get(edge.source); const target = nodeMap.get(edge.target); const endsSepStep = (target.x - source.x) / xSep; const sign = endsSepStep < 0 ? -1 : 1; const curveOffset = sign * 10 * Math.ceil(Math.abs(endsSepStep)); edge.curveOffset = curveOffset; edge.color = source.style.fill; edge.sourceName = source.name; edge.targetName = target.name; }); // map the value to node size let maxValue = -9999; let minValue = 9999; nodes.forEach(function (k) { if (maxValue < k.value) maxValue = k.value; if (minValue > k.value) minValue = k.value; }); const sizeRange = [3, 25]; const sizeDataRange = [minValue, maxValue]; scaleNodeProp(nodes, "size", "value", sizeDataRange, sizeRange); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-arc-diagram/index.json ================================================ { "defaultTitle": "基本弧线图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-circular/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-circular/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-circular/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; /** * basicCircular布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-circular/index.json ================================================ { "defaultTitle": "基本环形布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-combo-force/data.js ================================================ export default { nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-combo-force/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-combo-force/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-combo-force/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import comboforce from "@antv/f6/dist/extends/layout/comboForceLayout"; /** * basicComboForce */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("comboforce", comboforce); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, minZoom: 0.00000001, layout: { type: "comboforce", nodeSpacing: (d) => { if (d.id == "0") return 100; return 10; }, }, defaultNode: { size: 15, color: "#5B8FF9", style: { lineWidth: 2, fill: "#C6E5FF", }, }, defaultEdge: { size: 2, color: "#e2e2e2", }, modes: { default: ["drag-combo", "drag-node", "drag-canvas", "zoom-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-combo-force/index.json ================================================ { "defaultTitle": "Combo力导向布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-concentric/data.js ================================================ export default { nodes: [ { id: "HIRA", altered: 0, rank: 148, cited: 53, uniprotdesc: "Cooperates with ASF1A to promote replication-independentchromatin assembly. Required for the periodic repression ofhistone gene transcription during the cell cycle. Required for theformation of senescence-associated heterochromatin foci (SAHF) andefficient senescence-associated cell cycle exit.", isseed: false, uniprot: "P54198", isvalid: true, importance: 3, ox: 539.5, oy: 641.7372431003224, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SERPINE1", altered: 0, rank: 5, cited: 7063, uniprotdesc: "Serine protease inhibitor. This inhibitor acts as 'bait'for tissue plasminogen activator, urokinase, protein C andmatriptase-3/TMPRSS7. Its rapid interaction with PLAT may functionas a major control point in the regulation of fibrinolysis.", isseed: false, uniprot: "P05121", isvalid: true, importance: 3, ox: 670.4301869950953, oy: 229.70989985711336, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FAS", altered: 0, rank: 38, cited: 1011, uniprotdesc: "Receptor for TNFSF6/FASLG. The adapter molecule FADDrecruits caspase-8 to the activated receptor. The resulting death-inducing signaling complex (DISC) performs caspase-8 proteolyticactivation which initiates the subsequent cascade of caspases(aspartate-specific cysteine proteases) mediating apoptosis. FAS-mediated apoptosis may have a role in the induction of peripheraltolerance, in the antigen-stimulated suicide of mature T-cells, orboth. The secreted isoforms 2 to 6 block apoptosis (in vitro).", isseed: false, uniprot: "P25445", isvalid: true, importance: 3, ox: 771.3915110914829, oy: 613.8066148172879, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "H1F0", altered: 0, rank: 179, cited: 8, uniprotdesc: "Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structures. The H1F0 histonesare found in cells that are in terminal stages of differentiationor that have low rates of cell division.", isseed: false, uniprot: "P07305", isvalid: true, importance: 3, ox: 396.564243092928, oy: 545.1295331255458, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2", altered: 0, rank: 42, cited: 859, uniprotdesc: "Serine/threonine-protein kinase which is required forcheckpoint-mediated cell cycle arrest, activation of DNA repairand apoptosis in response to the presence of DNA double-strandbreaks. May also negatively regulate cell cycle progression duringunperturbed cell cycles. Following activation, phosphorylatesnumerous effectors preferentially at the consensus sequence [L-X-R-X-X-S/T]. Regulates cell cycle checkpoint arrest throughphosphorylation of CDC25A, CDC25B and CDC25C, inhibiting theiractivity. Inhibition of CDC25 phosphatase activity leads toincreased inhibitory tyrosine phosphorylation of CDK-cyclincomplexes and blocks cell cycle progression. May alsophosphorylate NEK6 which is involved in G2/M cell cycle arrest.Regulates DNA repair through phosphorylation of BRCA2, enhancingthe association of RAD51 with chromatin which promotes DNA repairby homologous recombination. Also stimulates the transcription ofgenes involved in DNA repair (including BRCA2) through thephosphorylation and activation of the transcription factor FOXM1.Regulates apoptosis through the phosphorylation of p53/TP53, MDM4and PML. Phosphorylation of p53/TP53 at 'Ser-20' by CHEK2 mayalleviate inhibition by MDM2, leading to accumulation of activep53/TP53. Phosphorylation of MDM4 may also reduce degradation ofp53/TP53. Also controls the transcription of pro-apoptotic genesthrough phosphorylation of the transcription factor E2F1. Tumorsuppressor, it may also have a DNA damage-independent function inmitotic spindle assembly by phosphorylating BRCA1. Its absence maybe a cause of the chromosomal instability observed in some cancercells. ", isseed: false, uniprot: "O96017", isvalid: true, importance: 3, ox: 665.61605725324, oy: 327.88536532731405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "COL18A1", altered: 0, rank: 157, cited: 30, uniprotdesc: "COLA18A probably plays a major role in determining theretinal structure as well as in the closure of the neural tube.Endostatin potently inhibits endothelial cellproliferation and angiogenesis. May inhibit angiogenesis bybinding to the heparan sulfate proteoglycans involved in growthfactor signaling.", isseed: false, uniprot: "P39060", isvalid: true, importance: 3, ox: 315.495548442639, oy: 356.3503242429216, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP", altered: 0, rank: 24, cited: 2442, uniprotdesc: "Acetylates histones, giving a specific tag fortranscriptional activation. Also acetylates non-histone proteins,like NCOA3 and FOXO1. Binds specifically to phosphorylated CREBand enhances its transcriptional activity toward cAMP-responsivegenes. Acts as a coactivator of ALX1 in the presence of EP300.Acts as a circadian transcriptional coactivator which enhances theactivity of the circadian transcriptional activators: NPAS2-ARNTL/BMAL1 and CLOCK-ARNTL/BMAL1 heterodimers.", isseed: false, uniprot: "Q92793", isvalid: true, importance: 3, ox: 468.2392322240752, oy: 311.08612174318614, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FDXR", altered: 0, rank: 147, cited: 54, uniprotdesc: "Serves as the first electron transfer protein in all themitochondrial P450 systems. Including cholesterol side chaincleavage in all steroidogenic tissues, steroid 11-betahydroxylation in the adrenal cortex, 25-OH-vitamin D3-24hydroxylation in the kidney, and sterol C-27 hydroxylation in theliver.", isseed: false, uniprot: "P22570", isvalid: true, importance: 3, ox: 614.0116881932149, oy: 209.57981996234878, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SMYD2", altered: 0, rank: 175, cited: 12, uniprotdesc: "Protein-lysine N-methyltransferase that methylates bothhistones and non-histone proteins, including p53/TP53 and RB1.Specifically methylates histone H3 'Lys-4' (H3K4me) anddimethylates histone H3 'Lys-36' (H3K36me2). Shows even highermethyltransferase activity on p53/TP53. Monomethylates 'Lys-370'of p53/TP53, leading to decreased DNA-binding activity andsubsequent transcriptional regulation activity of p53/TP53.Monomethylates RB1 at 'Lys-860'. ", isseed: false, uniprot: "Q9NRG4", isvalid: true, importance: 3, ox: 799.3458853307084, oy: 560.8271840491047, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR", altered: 0, rank: 52, cited: 628, uniprotdesc: "Serine/threonine protein kinase which activatescheckpoint signaling upon genotoxic stresses such as ionizingradiation (IR), ultraviolet light (UV), or DNA replicationstalling, thereby acting as a DNA damage sensor. Recognizes thesubstrate consensus sequence [ST]-Q. Phosphorylates BRCA1, CHEK1,MCM2, RAD17, RPA2, SMC1 and p53/TP53, which collectively inhibitDNA replication and mitosis and promote DNA repair, recombinationand apoptosis. Phosphorylates 'Ser-139' of histone variantH2AX/H2AFX at sites of DNA damage, thereby regulating DNA damageresponse mechanism. Required for FANCD2 ubiquitination. Criticalfor maintenance of fragile site stability and efficient regulationof centrosome duplication. ", isseed: false, uniprot: "Q13535", isvalid: true, importance: 3, ox: 696.7065384003552, oy: 570.6754072575451, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HGF", altered: 0, rank: 4, cited: 7554, uniprotdesc: "Potent mitogen for mature parenchymal hepatocyte cells,seems to be a hepatotrophic factor, and acts as a growth factorfor a broad spectrum of tissues and cell types. Activating ligandfor the receptor tyrosine kinase MET by binding to it andpromoting its dimerization. ", isseed: false, uniprot: "P14210", isvalid: true, importance: 3, ox: 732.163947642761, oy: 659.0776363377252, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM", altered: 0, rank: 25, cited: 2298, uniprotdesc: "Serine/threonine protein kinase which activatescheckpoint signaling upon double strand breaks (DSBs), apoptosisand genotoxic stresses such as ionizing ultraviolet A light (UVA),thereby acting as a DNA damage sensor. Recognizes the substrateconsensus sequence [ST]-Q. Phosphorylates 'Ser-139' of histonevariant H2AX/H2AFX at double strand breaks (DSBs), therebyregulating DNA damage response mechanism. Also plays a role inpre-B cell allelic exclusion, a process leading to expression of asingle immunoglobulin heavy chain allele to enforce clonality andmonospecific recognition by the B-cell antigen receptor (BCR)expressed on individual B-lymphocytes. After the introduction ofDNA breaks by the RAG complex on one immunoglobulin allele, actsby mediating a repositioning of the second allele topericentromeric heterochromatin, preventing accessibility to theRAG complex and recombination of the second allele. Also involvedin signal transduction and cell cycle control. May function as atumor suppressor. Necessary for activation of ABL1 and SAPK.Phosphorylates DYRK2, CHEK2, p53/TP53, FANCD2, NFKBIA, BRCA1,CTIP, nibrin (NBN), TERF1, RAD9 and DCLRE1C. May play a role invesicle and/or protein transport. Could play a role in T-celldevelopment, gonad and neurological function. Plays a role inreplication-dependent histone mRNA degradation. Binds DNA ends.Phosphorylation of DYRK2 in nucleus in response to genotoxicstress prevents its MDM2-mediated ubiquitination and subsequentproteasome degradation. Phosphorylates ATF2 which stimulates itsfunction in DNA damage response. ", isseed: false, uniprot: "Q13315", isvalid: true, importance: 3, ox: 723.6214512404813, oy: 517.2928623066505, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP63", altered: 0, rank: 37, cited: 1171, uniprotdesc: "Acts as a sequence specific DNA binding transcriptionalactivator or repressor. The isoforms contain a varying set oftransactivation and auto-regulating transactivation inhibitingdomains thus showing an isoform specific activity. Isoform 2activates RIPK4 transcription. May be required in conjunction withTP73/p73 for initiation of p53/TP53 dependent apoptosis inresponse to genotoxic insults and the presence of activatedoncogenes. Involved in Notch signaling by probably inducing JAG1and JAG2. Plays a role in the regulation of epithelialmorphogenesis. The ratio of DeltaN-type and TA*-type isoforms maygovern the maintenance of epithelial stem cell compartments andregulate the initiation of epithelial stratification from theundifferentiated embryonal ectoderm. Required for limb formationfrom the apical ectodermal ridge. Activates transcription of thep21 promoter. ", isseed: false, uniprot: "Q9H3D4", isvalid: true, importance: 3, ox: 554.5, oy: 495.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GPX1", altered: 0, rank: 13, cited: 3644, uniprotdesc: "Protects the hemoglobin in erythrocytes from oxidativebreakdown.", isseed: false, uniprot: "P07203", isvalid: true, importance: 3, ox: 412.4474306913114, oy: 244.4618875964815, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TRIAP1", altered: 0, rank: 183, cited: 7, uniprotdesc: "Involved in the modulation of the mitochondrialapoptotic pathway by ensuring the accumulation of cardiolipin (CL)in mitochondrial membranes. In vitro, the TRIAP1:PRELID1 complexmediates the transfer of phosphatidic acid (PA) between liposomesand probably functions as a PA transporter across themitochondrion intermembrane space to provide PA for CL synthesisin the inner membrane. Mediates cell survival by inhibitingactivation of caspase-9 which prevents induction of apoptosis.", isseed: false, uniprot: "O43715", isvalid: true, importance: 3, ox: 554.5, oy: 202.751489857487, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1E", altered: 0, rank: 167, cited: 19, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P10412", isvalid: true, importance: 3, ox: 509.931522689569, oy: 636.667218490667, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1D", altered: 0, rank: 184, cited: 6, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16402", isvalid: true, importance: 3, ox: 385.3785487595187, oy: 517.2928623066505, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1C", altered: 0, rank: 174, cited: 13, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16403", isvalid: true, importance: 3, ox: 379.058170659647, oy: 487.9662051382201, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1B", altered: 0, rank: 96, cited: 209, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16401", isvalid: true, importance: 3, ox: 381.59546915616875, oy: 428.2362230943135, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1A", altered: 0, rank: 173, cited: 13, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "Q02539", isvalid: true, importance: 3, ox: 443.3839427467599, oy: 327.88536532731405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53", altered: 0, rank: 0, cited: 24824, uniprotdesc: "Acts as a tumor suppressor in many tumor types; inducesgrowth arrest or apoptosis depending on the physiologicalcircumstances and cell type. Involved in cell cycle regulation asa trans-activator that acts to negatively regulate cell divisionby controlling a set of genes required for this process. One ofthe activated genes is an inhibitor of cyclin-dependent kinases.Apoptosis induction seems to be mediated either by stimulation ofBAX and FAS antigen expression, or by repression of Bcl-2expression. In cooperation with mitochondrial PPIF is involved inactivating oxidative stress-induced necrosis; the function islargely independent of transcription. Induces the transcription oflong intergenic non-coding RNA p21 (lincRNA-p21) and lincRNA-Mkln1. LincRNA-p21 participates in TP53-dependent transcriptionalrepression leading to apoptosis and seem to have to effect oncell-cycle regulation. Implicated in Notch signaling cross-over.Prevents CDK7 kinase activity when associated to CAK complex inresponse to DNA damage, thus stopping cell cycle progression.Isoform 2 enhances the transactivation activity of isoform 1 fromsome but not all TP53-inducible promoters. Isoform 4 suppressestransactivation activity and impairs growth suppression mediatedby isoform 1. Isoform 7 inhibits isoform 1-mediated apoptosis.", isseed: true, uniprot: "P04637", isvalid: true, importance: 4, ox: 554.5, oy: 465.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GADD45A", altered: 0, rank: 98, cited: 198, uniprotdesc: "In T-cells, functions as a regulator of p38 MAPKs byinhibiting p88 phosphorylation and activity (By similarity). Mightaffect PCNA interaction with some CDK (cell division proteinkinase) complexes; stimulates DNA excision repair in vitro andinhibits entry of cells into S phase. ", isseed: false, uniprot: "P24522", isvalid: true, importance: 3, ox: 554.5, oy: 375.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML", altered: 0, rank: 35, cited: 1300, uniprotdesc: "Functions via its association with PML-nuclear bodies(PML-NBs) in a wide range of important cellular processes,including tumor suppression, transcriptional regulation,apoptosis, senescence, DNA damage response, and viral defensemechanisms. Acts as the scaffold of PML-NBs allowing otherproteins to shuttle in and out, a process which is regulated bySUMO-mediated modifications and interactions. Isoform PML-4 has amultifaceted role in the regulation of apoptosis and growthsuppression: activates RB1 and inhibits AKT1 via interactions withPP1 and PP2A phosphatases respectively, negatively affects thePI3K pathway by inhibiting MTOR and activating PTEN, andpositively regulates p53/TP53 by acting at different levels (bypromoting its acetylation and phosphorylation and by inhibitingits MDM2-dependent degradation). Isoform PML-4 also: acts as atranscriptional repressor of TBX2 during cellular senescence andthe repression is dependent on a functional RBL2/E2F4 repressorcomplex, regulates double-strand break repair in gamma-irradiation-induced DNA damage responses via its interaction withWRN, acts as a negative regulator of telomerase by interactingwith TERT, and regulates PER2 nuclear localization and circadianfunction. Isoform PML-6 inhibits specifically the activity of thetetrameric form of PKM. The nuclear isoforms (isoform PML-1,isoform PML-2, isoform PML-3, isoform PML-4 and isoform PML-5) inconcert with SATB1 are involved in local chromatin-loop remodelingand gene expression regulation at the MHC-I locus. Isoform PML-2is required for efficient IFN-gamma induced MHC II genetranscription via regulation of CIITA. Cytoplasmic PML is involvedin the regulation of the TGF-beta signaling pathway. PML alsoregulates transcription activity of ELF4 and can act as animportant mediator for TNF-alpha- and IFN-alpha-mediatedinhibition of endothelial cell network formation and migration.Exhibits antiviral activity against both DNA and RNAviruses. The antiviral activity can involve one or severalisoform(s) and can be enhanced by the permanent PML-NB-associatedprotein DAXX or by the recruitment of p53/TP53 within thesestructures. Isoform PML-4 restricts varicella zoster virus (VZV)via sequestration of virion capsids in PML-NBs thereby preventingtheir nuclear egress and inhibiting formation of infectious virusparticles. The sumoylated isoform PML-4 restricts rabies virus byinhibiting viral mRNA and protein synthesis. The cytoplasmicisoform PML-14 can restrict herpes simplex virus-1 (HHV-1)replication by sequestering the viral E3 ubiquitin-protein ligaseICP0 in the cytoplasm. Isoform PML-6 shows restriction activitytowards human cytomegalovirus (HCMV) and influenza A virus strainsPR8(H1N1) and ST364(H3N2). Sumoylated isoform PML-4 and isoformPML-12 show antiviral activity against encephalomyocarditis virus(EMCV) by promoting nuclear sequestration of viral polymerase(P3D-POL) within PML NBs. Isoform PML-3 exhibits antiviralactivity against poliovirus by inducing apoptosis in infectedcells through the recruitment and the activation of p53/TP53 inthe PML-NBs. Isoform PML-3 represses human foamy virus (HFV)transcription by complexing the HFV transactivator, bel1/tas,preventing its binding to viral DNA. PML may positively regulateinfectious hepatitis C viral (HCV) production and isoform PML-2may enhance adenovirus transcription.", isseed: false, uniprot: "P29590", isvalid: true, importance: 3, ox: 554.5, oy: 555.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1", altered: 0, rank: 36, cited: 1235, uniprotdesc: "Ubiquitin-like protein that can be covalently attachedto proteins as a monomer or a lysine-linked polymer. Covalentattachment via an isopeptide bond to its substrates requires prioractivation by the E1 complex SAE1-SAE2 and linkage to the E2enzyme UBE2I, and can be promoted by E3 ligases such as PIAS1-4,RANBP2 or CBX4. This post-translational modification on lysineresidues of proteins plays a crucial role in a number of cellularprocesses such as nuclear transport, DNA replication and repair,mitosis and signal transduction. Involved for instance intargeting RANGAP1 to the nuclear pore complex protein RANBP2.Polymeric SUMO1 chains are also susceptible to polyubiquitinationwhich functions as a signal for proteasomal degradation ofmodified proteins. May also regulate a network of genes involvedin palate development. ", isseed: false, uniprot: "P63165", isvalid: true, importance: 3, ox: 554.5, oy: 288.62556472004735, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA", altered: 0, rank: 146, cited: 55, uniprotdesc: "PP2A is the major phosphatase for microtubule-associatedproteins (MAPs). PP2A can modulate the activity of phosphorylase Bkinase casein kinase 2, mitogen-stimulated S6 kinase, and MAP-2kinase. Cooperates with SGOL2 to protect centromeric cohesin fromseparase-mediated cleavage in oocytes specifically during meiosisI (By similarity). Can dephosphorylate SV40 large T antigen andp53/TP53. Activates RAF1 by dephosphorylating it at 'Ser-259'.", isseed: false, uniprot: "P67775", isvalid: true, importance: 3, ox: 727.4045308438311, oy: 428.2362230943131, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB", altered: 0, rank: 185, cited: 6, uniprotdesc: "PP2A can modulate the activity of phosphorylase B kinasecasein kinase 2, mitogen-stimulated S6 kinase, and MAP-2 kinase.", isseed: false, uniprot: "P62714", isvalid: true, importance: 3, ox: 584.3919246562758, oy: 291.16974245431265, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1", altered: 0, rank: 78, cited: 330, uniprotdesc: "Catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Regulates lipid synthesis byphosphorylating and inactivating lipid metabolic enzymes such asACACA, ACACB, GYS1, HMGCR and LIPE; regulates fatty acid andcholesterol synthesis by phosphorylating acetyl-CoA carboxylase(ACACA and ACACB) and hormone-sensitive lipase (LIPE) enzymes,respectively. Regulates insulin-signaling and glycolysis byphosphorylating IRS1, PFKFB2 and PFKFB3. AMPK stimulates glucoseuptake in muscle by increasing the translocation of the glucosetransporter SLC2A4/GLUT4 to the plasma membrane, possibly bymediating phosphorylation of TBC1D4/AS160. Regulates transcriptionand chromatin structure by phosphorylating transcriptionregulators involved in energy metabolism such as CRTC2/TORC2,FOXO3, histone H2B, HDAC5, MEF2C, MLXIPL/ChREBP, EP300, HNF4A,p53/TP53, SREBF1, SREBF2 and PPARGC1A. Acts as a key regulator ofglucose homeostasis in liver by phosphorylating CRTC2/TORC2,leading to CRTC2/TORC2 sequestration in the cytoplasm. In responseto stress, phosphorylates 'Ser-36' of histone H2B (H2BS36ph),leading to promote transcription. Acts as a key regulator of cellgrowth and proliferation by phosphorylating TSC2, RPTOR andATG1/ULK1: in response to nutrient limitation, negativelyregulates the mTORC1 complex by phosphorylating RPTOR component ofthe mTORC1 complex and by phosphorylating and activating TSC2. Inresponse to nutrient limitation, promotes autophagy byphosphorylating and activating ATG1/ULK1. AMPK also acts as aregulator of circadian rhythm by mediating phosphorylation ofCRY1, leading to destabilize it. May regulate the Wnt signalingpathway by phosphorylating CTNNB1, leading to stabilize it. Alsohas tau-protein kinase activity: in response to amyloid beta A4protein (APP) exposure, activated by CAMKK2, leading tophosphorylation of MAPT/TAU; however the relevance of such dataremains unclear in vivo. Also phosphorylates CFTR, EEF2K, KLC1,NOS3 and SLC12A1. ", isseed: false, uniprot: "Q13131", isvalid: true, importance: 3, ox: 731.2150654362375, oy: 457.9932361520795, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2", altered: 0, rank: 29, cited: 2074, uniprotdesc: "Catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Regulates lipid synthesis byphosphorylating and inactivating lipid metabolic enzymes such asACACA, ACACB, GYS1, HMGCR and LIPE; regulates fatty acid andcholesterol synthesis by phosphorylating acetyl-CoA carboxylase(ACACA and ACACB) and hormone-sensitive lipase (LIPE) enzymes,respectively. Regulates insulin-signaling and glycolysis byphosphorylating IRS1, PFKFB2 and PFKFB3. AMPK stimulates glucoseuptake in muscle by increasing the translocation of the glucosetransporter SLC2A4/GLUT4 to the plasma membrane, possibly bymediating phosphorylation of TBC1D4/AS160. Regulates transcriptionand chromatin structure by phosphorylating transcriptionregulators involved in energy metabolism such as CRTC2/TORC2,FOXO3, histone H2B, HDAC5, MEF2C, MLXIPL/ChREBP, EP300, HNF4A,p53/TP53, SREBF1, SREBF2 and PPARGC1A. Acts as a key regulator ofglucose homeostasis in liver by phosphorylating CRTC2/TORC2,leading to CRTC2/TORC2 sequestration in the cytoplasm. In responseto stress, phosphorylates 'Ser-36' of histone H2B (H2BS36ph),leading to promote transcription. Acts as a key regulator of cellgrowth and proliferation by phosphorylating TSC2, RPTOR andATG1/ULK1: in response to nutrient limitation, negativelyregulates the mTORC1 complex by phosphorylating RPTOR component ofthe mTORC1 complex and by phosphorylating and activating TSC2. Inresponse to nutrient limitation, promotes autophagy byphosphorylating and activating ATG1/ULK1. AMPK also acts as aregulator of circadian rhythm by mediating phosphorylation ofCRY1, leading to destabilize it. May regulate the Wnt signalingpathway by phosphorylating CTNNB1, leading to stabilize it. Alsophosphorylates CFTR, EEF2K, KLC1, NOS3 and SLC12A1.", isseed: false, uniprot: "P54646", isvalid: true, importance: 3, ox: 613.4239130642807, oy: 298.7290842958664, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11", altered: 0, rank: 127, cited: 81, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK11 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors. Accordingly, p38 MAPKsphosphorylate a broad range of proteins and it has been estimatedthat they may have approximately 200 to 300 substrates each.MAPK11 functions are mostly redundant with those of MAPK14. Someof the targets are downstream kinases which are activated throughphosphorylation and further phosphorylate additional targets.RPS6KA5/MSK1 and RPS6KA4/MSK2 can directly phosphorylate andactivate transcription factors such as CREB1, ATF1, the NF-kappa-Bisoform RELA/NFKB3, STAT1 and STAT3, but can also phosphorylatehistone H3 and the nucleosomal protein HMGN1. RPS6KA5/MSK1 andRPS6KA4/MSK2 play important roles in the rapid induction ofimmediate-early genes in response to stress or mitogenic stimuli,either by inducing chromatin remodeling or by recruiting thetranscription machinery. On the other hand, two other kinasetargets, MAPKAPK2/MK2 and MAPKAPK3/MK3, participate in the controlof gene expression mostly at the post-transcriptional level, byphosphorylating ZFP36 (tristetraprolin) and ELAVL1, and byregulating EEF2K, which is important for the elongation of mRNAduring translation. MKNK1/MNK1 and MKNK2/MNK2, two other kinasesactivated by p38 MAPKs, regulate protein synthesis byphosphorylating the initiation factor EIF4E2. In the cytoplasm,the p38 MAPK pathway is an important regulator of proteinturnover. For example, CFLAR is an inhibitor of TNF-inducedapoptosis whose proteasome-mediated degradation is regulated byp38 MAPK phosphorylation. Ectodomain shedding of transmembraneproteins is regulated by p38 MAPKs as well. In response toinflammatory stimuli, p38 MAPKs phosphorylate the membrane-associated metalloprotease ADAM17. Such phosphorylation isrequired for ADAM17-mediated ectodomain shedding of TGF-alphafamily ligands, which results in the activation of EGFR signalingand cell proliferation. Additional examples of p38 MAPK substratesare the FGFR1. FGFR1 can be translocated from the extracellularspace into the cytosol and nucleus of target cells, and regulatesprocesses such as rRNA synthesis and cell growth. FGFR1translocation requires p38 MAPK activation. In the nucleus, manytranscription factors are phosphorylated and activated by p38MAPKs in response to different stimuli. Classical examples includeATF1, ATF2, ATF6, ELK1, PTPRH, DDIT3, TP53/p53 and MEF2C andMEF2A. The p38 MAPKs are emerging as important modulators of geneexpression by regulating chromatin modifiers and remodelers. Thepromoters of several genes involved in the inflammatory response,such as IL6, IL8 and IL12B, display a p38 MAPK-dependentenrichment of histone H3 phosphorylation on 'Ser-10' (H3S10ph) inLPS-stimulated myeloid cells. This phosphorylation enhances theaccessibility of the cryptic NF-kappa-B-binding sites markingpromoters for increased NF-kappa-B recruitment.", isseed: false, uniprot: "Q15759", isvalid: true, importance: 3, ox: 640.7607677759248, oy: 311.0861217431862, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP73", altered: 0, rank: 116, cited: 124, uniprotdesc: "Participates in the apoptotic response to DNA damage.Isoforms containing the transactivation domain are pro-apoptotic,isoforms lacking the domain are anti-apoptotic and block thefunction of p53 and transactivating p73 isoforms. May be a tumorsuppressor protein. ", isseed: false, uniprot: "O15350", isvalid: true, importance: 3, ox: 554.5, oy: 435.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CCNB1", altered: 0, rank: 62, cited: 491, uniprotdesc: "Essential for the control of the cell cycle at the G2/M(mitosis) transition. ", isseed: false, uniprot: "P14635", isvalid: true, importance: 3, ox: 455.45477593090067, oy: 612.0421763339963, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12", altered: 0, rank: 131, cited: 79, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK12 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors such as ELK1 and ATF2.Accordingly, p38 MAPKs phosphorylate a broad range of proteins andit has been estimated that they may have approximately 200 to 300substrates each. Some of the targets are downstream kinases suchas MAPKAPK2, which are activated through phosphorylation andfurther phosphorylate additional targets. Plays a role in myoblastdifferentiation and also in the down-regulation of cyclin D1 inresponse to hypoxia in adrenal cells suggesting MAPK12 may inhibitcell proliferation while promoting differentiation. PhosphorylatesDLG1. Following osmotic shock, MAPK12 in the cell nucleusincreases its association with nuclear DLG1, thereby causingdissociation of DLG1-SFPQ complexes. This function is independentof its catalytic activity and could affect mRNA processing and/orgene transcription to aid cell adaptation to osmolarity changes inthe environment. Regulates UV-induced checkpoint signaling andrepair of UV-induced DNA damage and G2 arrest after gamma-radiation exposure. MAPK12 is involved in the regulation of SLC2A1expression and basal glucose uptake in L6 myotubes; and negativelyregulates SLC2A4 expression and contraction-mediated glucoseuptake in adult skeletal muscle. C-Jun (JUN) phosphorylation isstimulated by MAPK14 and inhibited by MAPK12, leading to adistinct AP-1 regulation. MAPK12 is required for the normalkinetochore localization of PLK1, prevents chromosomal instabilityand supports mitotic cell viability. MAPK12-signaling is alsopositively regulating the expansion of transient amplifyingmyogenic precursor cells during muscle growth and regeneration.", isseed: false, uniprot: "P53778", isvalid: true, importance: 3, ox: 569.5000000000001, oy: 641.7372431003224, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13", altered: 0, rank: 126, cited: 88, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK13 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors such as ELK1 and ATF2.Accordingly, p38 MAPKs phosphorylate a broad range of proteins andit has been estimated that they may have approximately 200 to 300substrates each. MAPK13 is one of the less studied p38 MAPKisoforms. Some of the targets are downstream kinases such asMAPKAPK2, which are activated through phosphorylation and furtherphosphorylate additional targets. Plays a role in the regulationof protein translation by phosphorylating and inactivating EEF2K.Involved in cytoskeletal remodeling through phosphorylation ofMAPT and STMN1. Mediates UV irradiation induced up-regulation ofthe gene expression of CXCL14. Plays an important role in theregulation of epidermal keratinocyte differentiation, apoptosisand skin tumor development. Phosphorylates the transcriptionalactivator MYB in response to stress which leads to rapid MYBdegradation via a proteasome-dependent pathway. MAPK13 alsophosphorylates and down-regulates PRKD1 during regulation ofinsulin secretion in pancreatic beta cells.", isseed: false, uniprot: "O15264", isvalid: true, importance: 3, ox: 687.2747400718758, oy: 348.6435313966404, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14", altered: 0, rank: 23, cited: 2528, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK14 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors. Accordingly, p38 MAPKsphosphorylate a broad range of proteins and it has been estimatedthat they may have approximately 200 to 300 substrates each. Someof the targets are downstream kinases which are activated throughphosphorylation and further phosphorylate additional targets.RPS6KA5/MSK1 and RPS6KA4/MSK2 can directly phosphorylate andactivate transcription factors such as CREB1, ATF1, the NF-kappa-Bisoform RELA/NFKB3, STAT1 and STAT3, but can also phosphorylatehistone H3 and the nucleosomal protein HMGN1. RPS6KA5/MSK1 andRPS6KA4/MSK2 play important roles in the rapid induction ofimmediate-early genes in response to stress or mitogenic stimuli,either by inducing chromatin remodeling or by recruiting thetranscription machinery. On the other hand, two other kinasetargets, MAPKAPK2/MK2 and MAPKAPK3/MK3, participate in the controlof gene expression mostly at the post-transcriptional level, byphosphorylating ZFP36 (tristetraprolin) and ELAVL1, and byregulating EEF2K, which is important for the elongation of mRNAduring translation. MKNK1/MNK1 and MKNK2/MNK2, two other kinasesactivated by p38 MAPKs, regulate protein synthesis byphosphorylating the initiation factor EIF4E2. MAPK14 interactsalso with casein kinase II, leading to its activation throughautophosphorylation and further phosphorylation of TP53/p53. Inthe cytoplasm, the p38 MAPK pathway is an important regulator ofprotein turnover. For example, CFLAR is an inhibitor of TNF-induced apoptosis whose proteasome-mediated degradation isregulated by p38 MAPK phosphorylation. In a similar way, MAPK14phosphorylates the ubiquitin ligase SIAH2, regulating its activitytowards EGLN3. MAPK14 may also inhibit the lysosomal degradationpathway of autophagy by interfering with the intracellulartrafficking of the transmembrane protein ATG9. Another function ofMAPK14 is to regulate the endocytosis of membrane receptors bydifferent mechanisms that impinge on the small GTPase RAB5A. Inaddition, clathrin-mediated EGFR internalization induced byinflammatory cytokines and UV irradiation depends on MAPK14-mediated phosphorylation of EGFR itself as well as of RAB5Aeffectors. Ectodomain shedding of transmembrane proteins isregulated by p38 MAPKs as well. In response to inflammatorystimuli, p38 MAPKs phosphorylate the membrane-associatedmetalloprotease ADAM17. Such phosphorylation is required forADAM17-mediated ectodomain shedding of TGF-alpha family ligands,which results in the activation of EGFR signaling and cellproliferation. Another p38 MAPK substrate is FGFR1. FGFR1 can betranslocated from the extracellular space into the cytosol andnucleus of target cells, and regulates processes such as rRNAsynthesis and cell growth. FGFR1 translocation requires p38 MAPKactivation. In the nucleus, many transcription factors arephosphorylated and activated by p38 MAPKs in response to differentstimuli. Classical examples include ATF1, ATF2, ATF6, ELK1, PTPRH,DDIT3, TP53/p53 and MEF2C and MEF2A. The p38 MAPKs are emerging asimportant modulators of gene expression by regulating chromatinmodifiers and remodelers. The promoters of several genes involvedin the inflammatory response, such as IL6, IL8 and IL12B, displaya p38 MAPK-dependent enrichment of histone H3 phosphorylation on'Ser-10' (H3S10ph) in LPS-stimulated myeloid cells. Thisphosphorylation enhances the accessibility of the cryptic NF-kappa-B-binding sites marking promoters for increased NF-kappa-Brecruitment. Phosphorylates CDC25B and CDC25C which is requiredfor binding to 14-3-3 proteins and leads to initiation of a G2delay after ultraviolet radiation. Phosphorylates TIAR followingDNA damage, releasing TIAR from GADD45A mRNA and preventing mRNAdegradation. The p38 MAPKs may also have kinase-independent roles,which are thought to be due to the binding to targets in theabsence of phosphorylation. Protein O-Glc-N-acylation catalyzed bythe OGT is regulated by MAPK14, and, although OGT does not seem tobe phosphorylated by MAPK14, their interaction increases uponMAPK14 activation induced by glucose deprivation. This interactionmay regulate OGT activity by recruiting it to specific targetssuch as neurofilament H, stimulating its O-Glc-N-acylation.Required in mid-fetal development for the growth of embryo-derivedblood vessels in the labyrinth layer of the placenta. Also playsan essential role in developmental and stress-inducederythropoiesis, through regulation of EPO gene expression. IsoformMXI2 activation is stimulated by mitogens and oxidative stress andonly poorly phosphorylates ELK1 and ATF2. Isoform EXIP may play arole in the early onset of apoptosis. Phosphorylates S100A9 at'Thr-113'. ", isseed: false, uniprot: "Q16539", isvalid: true, importance: 3, ox: 705.1137353610045, oy: 372.7634453076487, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2", altered: 0, rank: 189, cited: 4, uniprotdesc: "Non-catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Beta non-catalytic subunit acts as ascaffold on which the AMPK complex assembles, via its C-terminusthat bridges alpha (PRKAA1 or PRKAA2) and gamma subunits (PRKAG1,PRKAG2 or PRKAG3).", isseed: false, uniprot: "O43741", isvalid: true, importance: 3, ox: 718.6198477055347, oy: 399.5512210521357, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1", altered: 0, rank: 73, cited: 368, uniprotdesc: "Non-catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Beta non-catalytic subunit acts as ascaffold on which the AMPK complex assembles, via its C-terminusthat bridges alpha (PRKAA1 or PRKAA2) and gamma subunits (PRKAG1,PRKAG2 or PRKAG3).", isseed: false, uniprot: "Q9Y478", isvalid: true, importance: 3, ox: 476.5577136594006, oy: 420.49999999999994, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300", altered: 0, rank: 19, cited: 2835, uniprotdesc: "Functions as histone acetyltransferase and regulatestranscription via chromatin remodeling. Acetylates all four corehistones in nucleosomes. Histone acetylation gives an epigenetictag for transcriptional activation. Mediates cAMP-gene regulationby binding specifically to phosphorylated CREB protein. Mediatesacetylation of histone H3 at 'Lys-122' (H3K122ac), a modificationthat localizes at the surface of the histone octamer andstimulates transcription, possibly by promoting nucleosomeinstability. Mediates acetylation of histone H3 at 'Lys-27'(H3K27ac). Also functions as acetyltransferase for nonhistonetargets. Acetylates 'Lys-131' of ALX1 and acts as its coactivatorin the presence of CREBBP. Acetylates SIRT2 and is proposed toindirectly increase the transcriptional activity of TP53 throughacetylation and subsequent attenuation of SIRT2 deacetylasefunction. Acetylates HDAC1 leading to its inactivation andmodulation of transcription. Acts as a TFAP2A-mediatedtranscriptional coactivator in presence of CITED2. Plays a role asa coactivator of NEUROD1-dependent transcription of the secretinand p21 genes and controls terminal differentiation of cells inthe intestinal epithelium. Promotes cardiac myocyte enlargement.Can also mediate transcriptional repression. Binds to and may beinvolved in the transforming capacity of the adenovirus E1Aprotein. In case of HIV-1 infection, it is recruited by the viralprotein Tat. Regulates Tat's transactivating activity and may helpinducing chromatin remodeling of proviral genes. Acetylates FOXO1and enhances its transcriptional activity. Acetylates BCL6 wichdisrupts its ability to recruit histone deacetylases and hindersits transcriptional repressor activity. Participates in CLOCK orNPAS2-regulated rhythmic gene transcription; exhibits a circadianassociation with CLOCK or NPAS2, correlating with increase inPER1/2 mRNA and histone H3 acetylation on the PER1/2 promoter.Acetylates MTA1 at 'Lys-626' which is essential for itstranscriptional coactivator activity (PubMed:10733570,PubMed:11430825, PubMed:11701890, PubMed:12402037,PubMed:12586840, PubMed:12929931, PubMed:14645221,PubMed:15186775, PubMed:15890677, PubMed:16617102,PubMed:16762839, PubMed:18722353, PubMed:18995842,PubMed:23415232, PubMed:23911289, PubMed:23934153,PubMed:8945521). Acetylates XBP1 isoform 2; acetylation increasesprotein stability of XBP1 isoform 2 and enhances itstranscriptional activity (By similarity).", isseed: false, uniprot: "Q09472", isvalid: true, importance: 3, ox: 476.5577136594005, oy: 510.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1", altered: 0, rank: 125, cited: 89, uniprotdesc: "Associated to surface IgM-receptor; may be involved insignal transduction. Involved in regulation of the catalyticactivity of the phosphatases PP2A, PP4 and PP6 by protecting theirpartially folded catalytic subunits from degradativepolyubiquitination until they associate with regulatory subunits.", isseed: false, uniprot: "P78318", isvalid: true, importance: 3, ox: 729.941829340353, oy: 487.96620513822, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11", altered: 0, rank: 188, cited: 5, uniprotdesc: "Substrate recognition component of a SCF (SKP1-CUL1-F-box protein) E3 ubiquitin-protein ligase complex which mediatesthe ubiquitination and subsequent proteasomal degradation oftarget proteins, such as DTL/CDT2, BCL6 and PRDM1/BLIMP1. TheSCF(FBXO11) complex mediates ubiquitination and degradation ofBCL6, thereby playing a role in the germinal center B-cellsterminal differentiation toward memory B-cells and plasma cells.The SCF(FBXO11) complex also mediates ubiquitination anddegradation of DTL, an important step for the regulation of TGF-beta signaling, cell migration and the timing of the cell-cycleprogression and exit. Binds to and neddylates phosphorylatedp53/TP53, inhibiting its transcriptional activity. SCF(FBXO11)does not seem to direct ubiquitination of p53/TP53.", isseed: false, uniprot: "Q86XK2", isvalid: true, importance: 3, ox: 481.64519932573637, oy: 626.6730246484053, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1", altered: 0, rank: 54, cited: 617, uniprotdesc: "DNA binding proteins that associates with chromatin andhas the ability to bend DNA. Binds preferentially single-strandedDNA. Involved in V(D)J recombination by acting as a cofactor ofthe RAG complex. Acts by stimulating cleavage and RAG proteinbinding at the 23 bp spacer of conserved recombination signalsequences (RSS). Heparin-binding protein that has a role in theextension of neurite-type cytoplasmic processes in developingcells (By similarity). ", isseed: false, uniprot: "P09429", isvalid: true, importance: 3, ox: 712.435756907072, oy: 545.1295331255459, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NEDD8", altered: 0, rank: 205, cited: 236, uniprotdesc: "Ubiquitin-like protein which plays an important role incell cycle control and embryogenesis. Covalent attachment to itssubstrates requires prior activation by the E1 complex UBE1C-APPBP1 and linkage to the E2 enzyme UBE2M. Attachment of NEDD8 tocullins activates their associated E3 ubiquitin ligase activity,and thus promotes polyubiquitination and proteasomal degradationof cyclins and other regulatory proteins.", isseed: false, uniprot: "Q15843", isvalid: true, importance: 2, ox: 432.1137033013474, oy: 593.195576415127, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ASF1A", altered: 0, rank: 161, cited: 27, uniprotdesc: "Histone chaperone that facilitates histone depositionand histone exchange and removal during nucleosome assembly anddisassembly. Cooperates with chromatin assembly factor 1 (CAF-1)to promote replication-dependent chromatin assembly and with HIRAto promote replication-independent chromatin assembly. Requiredfor the formation of senescence-associated heterochromatin foci(SAHF) and efficient senescence-associated cell cycle exit.", isseed: false, uniprot: "Q9Y294", isvalid: true, importance: 3, ox: 412.29346159964496, oy: 570.6754072575452, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT8", altered: 0, rank: 199, cited: 0, uniprotdesc: "Histone acetyltransferase which may be involved intranscriptional activation. May influence the function of ATM. Aspart of the MSL complex it is involved in acetylation ofnucleosomal histone H4 producing specifically H4K16ac. As part ofthe NSL complex it may be involved in acetylation of nucleosomalhistone H4 on several lysine residues. That activity is lessspecific than the one of the MSL complex. Can also acetylateTP53/p53 at 'Lys-120'. ", isseed: false, uniprot: "Q9H7Z6", isvalid: true, importance: 3, ox: 452.21985952208775, oy: 707.5238675129558, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT", altered: 0, rank: 43, cited: 858, uniprotdesc: "May play a role in microtubule-mediated transport orvesicle function.", isseed: false, uniprot: "P42858", isvalid: true, importance: 3, ox: 632.4422863405995, oy: 510.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN", altered: 0, rank: 53, cited: 621, uniprotdesc: "Multifunctional enzyme that has both magnesium and ATP-dependent DNA-helicase activity and 3'->5' exonuclease activitytowards double-stranded DNA with a 5'-overhang. Has no nucleaseactivity towards single-stranded DNA or blunt-ended double-stranded DNA. Binds preferentially to DNA substrates containingalternate secondary structures, such as replication forks andHolliday junctions. May play an important role in the dissociationof joint DNA molecules that can arise as products of homologousrecombination, at stalled replication forks or during DNA repair.Alleviates stalling of DNA polymerases at the site of DNA lesions.Important for genomic integrity. Plays a role in the formation ofDNA replication focal centers; stably associates with focielements generating binding sites for RP-A (By similarity). Playsa role in double-strand break repair after gamma-irradiation.", isseed: false, uniprot: "Q14191", isvalid: true, importance: 3, ox: 676.8862966986526, oy: 593.1955764151269, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDKN1A", altered: 0, rank: 9, cited: 4784, uniprotdesc: "May be the important intermediate by which p53/TP53mediates its role as an inhibitor of cellular proliferation inresponse to DNA damage. Binds to and inhibits cyclin-dependentkinase activity, preventing phosphorylation of critical cyclin-dependent kinase substrates and blocking cell cycle progression.Functions in the nuclear localization and assembly of cyclin D-CDK4 complex and promotes its kinase activity towards RB1. Athigher stoichiometric ratios, inhibits the kinase activity of thecyclin D-CDK4 complex. ", isseed: false, uniprot: "P38936", isvalid: true, importance: 3, ox: 653.5452240690994, oy: 612.0421763339962, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PLK3", altered: 0, rank: 115, cited: 130, uniprotdesc: "Serine/threonine-protein kinase involved in cell cycleregulation, response to stress and Golgi disassembly. Polo-likekinases act by binding and phosphorylating proteins are thatalready phosphorylated on a specific motif recognized by the POLObox domains. Phosphorylates ATF2, BCL2L1, CDC25A, CDC25C, CHEK2,HIF1A, JUN, p53/TP53, p73/TP73, PTEN, TOP2A and VRK1. Involved incell cycle regulation: required for entry into S phase andcytokinesis. Phosphorylates BCL2L1, leading to regulate the G2checkpoint and progression to cytokinesis during mitosis. Plays akey role in response to stress: rapidly activated upon stressstimulation, such as ionizing radiation, reactive oxygen species(ROS), hyperosmotic stress, UV irradiation and hypoxia. Involvedin DNA damage response and G1/S transition checkpoint byphosphorylating CDC25A, p53/TP53 and p73/TP73. Phosphorylatesp53/TP53 in response to reactive oxygen species (ROS), therebypromoting p53/TP53-mediated apoptosis. Phosphorylates CHEK2 inresponse to DNA damage, promoting the G2/M transition checkpoint.Phosphorylates the transcription factor p73/TP73 in response toDNA damage, leading to inhibit p73/TP73-mediated transcriptionalactivation and pro-apoptotic functions. Phosphorylates HIF1A andJUN is response to hypoxia. Phosphorylates ATF2 followinghyperosmotic stress in corneal epithelium. Also involved in Golgidisassembly during the cell cycle: part of a MEK1/MAP2K1-dependentpathway that induces Golgi fragmentation during mitosis bymediating phosphorylation of VRK1. May participate in endomitoticcell cycle, a form of mitosis in which both karyokinesis andcytokinesis are interrupted and is a hallmark of megakaryocytedifferentiation, via its interaction with CIB1.", isseed: false, uniprot: "Q9H4B4", isvalid: true, importance: 3, ox: 377.7849345637625, oy: 457.9932361520796, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DYRK1A", altered: 0, rank: 128, cited: 81, uniprotdesc: "May play a role in a signaling pathway regulatingnuclear functions of cell proliferation. Modulates alternativesplicing by phosphorylating the splice factor SRSF6 (Bysimilarity). Phosphorylates serine, threonine and tyrosineresidues in its sequence and in exogenous substrates such as CRY2,FOXO1, SRSF6 and SIRT1. Exhibits a sugstrate preference forproline at position P+1 and arginine at position P-3.", isseed: false, uniprot: "Q13627", isvalid: true, importance: 3, ox: 584.451073117784, oy: 204.46415418337006, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1", altered: 0, rank: 177, cited: 11, uniprotdesc: "AMP/ATP-binding subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Gamma non-catalytic subunit mediatesbinding to AMP, ADP and ATP, leading to activate or inhibit AMPK:AMP-binding results in allosteric activation of alpha catalyticsubunit (PRKAA1 or PRKAA2) both by inducing phosphorylation andpreventing dephosphorylation of catalytic subunits. ADP alsostimulates phosphorylation, without stimulating alreadyphosphorylated catalytic subunit. ATP promotes dephosphorylationof catalytic subunit, rendering the AMPK enzyme inactive.", isseed: false, uniprot: "P54619", isvalid: true, importance: 3, ox: 627.3548006742639, oy: 626.6730246484052, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP6", altered: 0, rank: 104, cited: 161, uniprotdesc: "Involved in the activation cascade of caspasesresponsible for apoptosis execution. Cleaves poly(ADP-ribose)polymerase in vitro, as well as lamins. Overexpression promotesprogrammed cell death.", isseed: false, uniprot: "P55212", isvalid: true, importance: 3, ox: 642.7964774016498, oy: 218.03179666759164, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAX", altered: 0, rank: 158, cited: 28, uniprotdesc: "Transcription regulator. Forms a sequence-specific DNA-binding protein complex with MYC or MAD which recognizes the coresequence 5'-CAC[GA]TG-3'. The MYC:MAX complex is a transcriptionalactivator, whereas the MAD:MAX complex is a repressor. May represstranscription via the recruitment of a chromatin remodelingcomplex containing H3 'Lys-9' histone methyltransferase activity.", isseed: false, uniprot: "P61244", isvalid: true, importance: 3, ox: 524.5489268822162, oy: 204.46415418337, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FOS", altered: 0, rank: 61, cited: 496, uniprotdesc: "Nuclear phosphoprotein which forms a tight but non-covalently linked complex with the JUN/AP-1 transcription factor.In the heterodimer, FOS and JUN/AP-1 basic regions each seems tointeract with symmetrical DNA half sites. On TGF-beta activation,forms a multimeric SMAD3/SMAD4/JUN/FOS complex at the AP1/SMAD-binding site to regulate TGF-beta-mediated signaling. Has acritical function in regulating the development of cells destinedto form and maintain the skeleton. It is thought to have animportant role in signal transduction, cell proliferation anddifferentiation. In growing cells, activates phospholipidsynthesis, possibly by activating CDS1 and PI4K2A. This activityrequires Tyr-dephosphorylation and association with theendoplasmic reticulum. ", isseed: false, uniprot: "P01100", isvalid: true, importance: 3, ox: 696.5525693086885, oy: 244.46188759648143, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53I3", altered: 0, rank: 152, cited: 39, uniprotdesc: "May be involved in the generation of reactive oxygenspecies (ROS). Has low NADPH-dependent beta-naphthoquinonereductase activity, with a preference for 1,2-beta-naphthoquinoneover 1,4-beta-naphthoquinone. Has low NADPH-dependent diaminereductase activity (in vitro). ", isseed: false, uniprot: "Q53FA7", isvalid: true, importance: 3, ox: 720.823079139937, oy: 262.0954451652557, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT1", altered: 0, rank: 206, cited: 189, uniprotdesc: "Arginine methyltransferase that methylates (mono andasymmetric dimethylation) the guanidino nitrogens of arginylresidues present in proteins such as ESR1, histone H2, H3 and H4,PIAS1, HNRNPA1, HNRNPD, NFATC2IP, SUPT5H, TAF15 and EWS.Constitutes the main enzyme that mediates monomethylation andasymmetric dimethylation of histone H4 'Arg-4' (H4R3me1 andH4R3me2a, respectively), a specific tag for epigenetictranscriptional activation. Together with dimethylated PIAS1,represses STAT1 transcriptional activity, in the late phase ofinterferon gamma (IFN-gamma) signaling. May be involved in theregulation of TAF15 transcriptional activity, act as an activatorof estrogen receptor (ER)-mediated transactivation, play a keyrole in neurite outgrowth and act as a negative regulator ofmegakaryocytic differentiation, by modulating p38 MAPK pathway.Methylates FOXO1 and retains it in the nucleus increasing itstranscriptional activity. ", isseed: false, uniprot: "Q99873", isvalid: true, importance: 2, ox: 742.9253132762292, oy: 282.3806921734763, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PCBP4", altered: 0, rank: 165, cited: 20, uniprotdesc: "Single-stranded nucleic acid binding protein that bindspreferentially to oligo dC. ", isseed: false, uniprot: "P57723", isvalid: true, importance: 3, ox: 762.5711352945876, oy: 305.05317940410396, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT5", altered: 0, rank: 118, cited: 111, uniprotdesc: "Arginine methyltransferase that can both catalyze theformation of omega-N monomethylarginine (MMA) and symmetricaldimethylarginine (sDMA), with a preference for the formation ofMMA. Specifically mediates the symmetrical dimethylation ofarginine residues in the small nuclear ribonucleoproteins Sm D1(SNRPD1) and Sm D3 (SNRPD3); such methylation being required forthe assembly and biogenesis of snRNP core particles. MethylatesSUPT5H. Mono- and dimethylates arginine residues of myelin basicprotein (MBP) in vitro. Plays a role in the assembly of snRNP coreparticles. May play a role in cytokine-activated transductionpathways. Negatively regulates cyclin E1 promoter activity andcellular proliferation. May regulate the SUPT5H transcriptionalelongation properties. May be part of a pathway that is connectedto a chloride current, possibly through cytoskeletalrearrangement. Methylates histone H2A and H4 'Arg-3' during germcell development. Methylates histone H3 'Arg-8', which may represstranscription. Methylates the Piwi proteins (PIWIL1, PIWIL2 andPIWIL4), methylation of Piwi proteins being required for theinteraction with Tudor domain-containing proteins and subsequentlocalization to the meiotic nuage. Methylates RPS10. AttenuatesEGF signaling through the MAPK1/MAPK3 pathway acting at 2 levels.First, monomethylates EGFR; this enhances EGFR 'Tyr-1197'phosphorylation and PTPN6 recruitment, eventually leading toreduced SOS1 phosphorylation. Second, methylates RAF1 and probablyBRAF, hence destabilizing these 2 signaling proteins and reducingtheir catalytic activity. Required for induction of E-selectin andVCAM-1, on the endothelial cells surface at sites of inflammation.Methylates HOXA9. Methylates and regulates SRGAP2 which isinvolved in cell migration and differentiation. Acts as atranscriptional corepressor in CRY1-mediated repression of thecore circadian component PER1 by regulating the H4R3 dimethylationat the PER1 promoter. ", isseed: false, uniprot: "O14744", isvalid: true, importance: 3, ox: 779.5044318605908, oy: 329.8173363129873, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "E4F1", altered: 0, rank: 150, cited: 47, uniprotdesc: "May function as a transcriptional repressor. May alsofunction as a ubiquitin ligase mediating ubiquitination ofchromatin-associated TP53. Functions in cell survival andproliferation through control of the cell cycle. Functions in thep53 and pRB tumor suppressor pathways and regulates the cyclinCCNA2 transcription.Identified as a cellular target of the adenoviraloncoprotein E1A, it is required for both transcriptionalactivation and repression of viral genes.", isseed: false, uniprot: "Q66K89", isvalid: true, importance: 3, ox: 793.504451557361, oy: 356.35032424292166, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP1", altered: 0, rank: 64, cited: 473, uniprotdesc: "Thiol protease that cleaves IL-1 beta between an Asp andan Ala, releasing the mature cytokine which is involved in avariety of inflammatory processes. Important for defense againstpathogens. Cleaves and activates sterol regulatory element bindingproteins (SREBPs). Can also promote apoptosis.", isseed: false, uniprot: "P29466", isvalid: true, importance: 3, ox: 804.3886827178802, oy: 384.3062451192652, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCA", altered: 0, rank: 84, cited: 275, uniprotdesc: "Calcium-activated, phospholipid- and diacylglycerol(DAG)-dependent serine/threonine-protein kinase that is involvedin positive and negative regulation of cell proliferation,apoptosis, differentiation, migration and adhesion, tumorigenesis,cardiac hypertrophy, angiogenesis, platelet function andinflammation, by directly phosphorylating targets such as RAF1,BCL2, CSPG4, TNNT2/CTNT, or activating signaling cascade involvingMAPK1/3 (ERK1/2) and RAP1GAP. Involved in cell proliferation andcell growth arrest by positive and negative regulation of the cellcycle. Can promote cell growth by phosphorylating and activatingRAF1, which mediates the activation of the MAPK/ERK signalingcascade, and/or by up-regulating CDKN1A, which facilitates activecyclin-dependent kinase (CDK) complex formation in glioma cells.In intestinal cells stimulated by the phorbol ester PMA, cantrigger a cell cycle arrest program which is associated with theaccumulation of the hyper-phosphorylated growth-suppressive formof RB1 and induction of the CDK inhibitors CDKN1A and CDKN1B.Exhibits anti-apoptotic function in glioma cells and protects themfrom apoptosis by suppressing the p53/TP53-mediated activation ofIGFBP3, and in leukemia cells mediates anti-apoptotic action byphosphorylating BCL2. During macrophage differentiation induced bymacrophage colony-stimulating factor (CSF1), is translocated tothe nucleus and is associated with macrophage development. Afterwounding, translocates from focal contacts to lamellipodia andparticipates in the modulation of desmosomal adhesion. Plays arole in cell motility by phosphorylating CSPG4, which inducesassociation of CSPG4 with extensive lamellipodia at the cellperiphery and polarization of the cell accompanied by increases incell motility. Is highly expressed in a number of cancer cellswhere it can act as a tumor promoter and is implicated inmalignant phenotypes of several tumors such as gliomas and breastcancers. Negatively regulates myocardial contractility andpositively regulates angiogenesis, platelet aggregation andthrombus formation in arteries. Mediates hypertrophic growth ofneonatal cardiomyocytes, in part through a MAPK1/3 (ERK1/2)-dependent signaling pathway, and upon PMA treatment, is requiredto induce cardiomyocyte hypertrophy up to heart failure and death,by increasing protein synthesis, protein-DNA ratio and cellsurface area. Regulates cardiomyocyte function by phosphorylatingcardiac troponin T (TNNT2/CTNT), which induces significantreduction in actomyosin ATPase activity, myofilament calciumsensitivity and myocardial contractility. In angiogenesis, isrequired for full endothelial cell migration, adhesion tovitronectin (VTN), and vascular endothelial growth factor A(VEGFA)-dependent regulation of kinase activation and vasculartube formation. Involved in the stabilization of VEGFA mRNA atpost-transcriptional level and mediates VEGFA-induced cellproliferation. In the regulation of calcium-induced plateletaggregation, mediates signals from the CD36/GP4 receptor forgranule release, and activates the integrin heterodimer ITGA2B-ITGB3 through the RAP1GAP pathway for adhesion. During response tolipopolysaccharides (LPS), may regulate selective LPS-inducedmacrophage functions involved in host defense and inflammation.But in some inflammatory responses, may negatively regulate NF-kappa-B-induced genes, through IL1A-dependent induction of NF-kappa-B inhibitor alpha (NFKBIA/IKBA). Upon stimulation with 12-O-tetradecanoylphorbol-13-acetate (TPA), phosphorylates EIF4G1,which modulates EIF4G1 binding to MKNK1 and may be involved in theregulation of EIF4E phosphorylation. Phosphorylates KIT, leadingto inhibition of KIT activity. Phosphorylates ATF2 which promotescooperation between ATF2 and JUN, activating transcription.", isseed: false, uniprot: "P17252", isvalid: true, importance: 3, ox: 812.0152327436849, oy: 413.32065076032404, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK1", altered: 0, rank: 27, cited: 2149, uniprotdesc: "Plays a key role in the control of the eukaryotic cellcycle by modulating the centrosome cycle as well as mitotic onset;promotes G2-M transition, and regulates G1 progress and G1-Stransition via association with multiple interphase cyclins.Required in higher cells for entry into S-phase and mitosis.Phosphorylates PARVA/actopaxin, APC, AMPH, APC, BARD1, Bcl-xL/BCL2L1, BRCA2, CALD1, CASP8, CDC7, CDC20, CDC25A, CDC25C,CC2D1A, CSNK2 proteins/CKII, FZR1/CDH1, CDK7, CEBPB, CHAMP1,DMD/dystrophin, EEF1 proteins/EF-1, EZH2, KIF11/EG5, EGFR, FANCG,FOS, GFAP, GOLGA2/GM130, GRASP1, UBE2A/hHR6A, HIST1H1proteins/histone H1, HMGA1, HIVEP3/KRC, LMNA, LMNB, LMNC, LBR,LATS1, MAP1B, MAP4, MARCKS, MCM2, MCM4, MKLP1, MYB, NEFH, NFIC,NPC/nuclear pore complex, PITPNM1/NIR2, NPM1, NCL, NUCKS1,NPM1/numatrin, ORC1, PRKAR2A, EEF1E1/p18, EIF3F/p47, p53/TP53,NONO/p54NRB, PAPOLA, PLEC/plectin, RB1, UL40/R2, RAB4A, RAP1GAP,RCC1, RPS6KB1/S6K1, KHDRBS1/SAM68, ESPL1, SKI, BIRC5/survivin,STIP1, TEX14, beta-tubulins, MAPT/TAU, NEDD1, VIM/vimentin, TK1,FOXO1, RUNX1/AML1, SIRT2 and RUNX2. CDK1/CDC2-cyclin-B controlspronuclear union in interphase fertilized eggs. Essential forearly stages of embryonic development. During G2 and earlymitosis, CDC25A/B/C-mediated dephosphorylation activatesCDK1/cyclin complexes which phosphorylate several substrates thattrigger at least centrosome separation, Golgi dynamics, nuclearenvelope breakdown and chromosome condensation. Once chromosomesare condensed and aligned at the metaphase plate, CDK1 activity isswitched off by WEE1- and PKMYT1-mediated phosphorylation to allowsister chromatid separation, chromosome decondensation,reformation of the nuclear envelope and cytokinesis. Inactivatedby PKR/EIF2AK2- and WEE1-mediated phosphorylation upon DNA damageto stop cell cycle and genome replication at the G2 checkpointthus facilitating DNA repair. Reactivated after successful DNArepair through WIP1-dependent signaling leading to CDC25A/B/C-mediated dephosphorylation and restoring cell cycle progression.In proliferating cells, CDK1-mediated FOXO1 phosphorylation at theG2-M phase represses FOXO1 interaction with 14-3-3 proteins andthereby promotes FOXO1 nuclear accumulation and transcriptionfactor activity, leading to cell death of postmitotic neurons. Thephosphorylation of beta-tubulins regulates microtubule dynamicsduring mitosis. NEDD1 phosphorylation promotes PLK1-mediated NEDD1phosphorylation and subsequent targeting of the gamma-tubulin ringcomplex (gTuRC) to the centrosome, an important step for spindleformation. In addition, CC2D1A phosphorylation regulates CC2D1Aspindle pole localization and association with SCC1/RAD21 andcentriole cohesion during mitosis. The phosphorylation of Bcl-xL/BCL2L1 after prolongated G2 arrest upon DNA damage triggersapoptosis. In contrast, CASP8 phosphorylation during mitosisprevents its activation by proteolysis and subsequent apoptosis.This phosphorylation occurs in cancer cell lines, as well as inprimary breast tissues and lymphocytes. EZH2 phosphorylationpromotes H3K27me3 maintenance and epigenetic gene silencing. CALD1phosphorylation promotes Schwann cell migration during peripheralnerve regeneration. ", isseed: false, uniprot: "P06493", isvalid: true, importance: 3, ox: 816.2846778918833, oy: 443.01529401675197, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK9", altered: 0, rank: 66, cited: 448, uniprotdesc: "Protein kinase involved in the regulation oftranscription. Member of the cyclin-dependent kinase pair(CDK9/cyclin-T) complex, also called positive transcriptionelongation factor b (P-TEFb), which facilitates the transitionfrom abortive to productive elongation by phosphorylating the CTD(C-terminal domain) of the large subunit of RNA polymerase II(RNAP II) POLR2A, SUPT5H and RDBP. This complex is inactive whenin the 7SK snRNP complex form. Phosphorylates EP300, MYOD1,RPB1/POLR2A and AR, and the negative elongation factors DSIF andNELF. Regulates cytokine inducible transcription networks byfacilitating promoter recognition of target transcription factors(e.g. TNF-inducible RELA/p65 activation and IL-6-inducible STAT3signaling). Promotes RNA synthesis in genetic programs for cellgrowth, differentiation and viral pathogenesis. P-TEFb is alsoinvolved in cotranscriptional histone modification, mRNAprocessing and mRNA export. Modulates a complex network ofchromatin modifications including histone H2B monoubiquitination(H2Bub1), H3 lysine 4 trimethylation (H3K4me3) and H3K36me3;integrates phosphorylation during transcription with chromatinmodifications to control co-transcriptional histone mRNAprocessing. The CDK9/cyclin-K complex has also a kinase activitytowards CTD of RNAP II and can substitute for CDK9/cyclin-T P-TEFbin vitro. Replication stress response protein; the CDK9/cyclin-Kcomplex is required for genome integrity maintenance, by promotingcell cycle recovery from replication arrest and limiting single-stranded DNA amount in response to replication stress, thusreducing the breakdown of stalled replication forks and avoidingDNA damage. In addition, probable function in DNA repair ofisoform 2 via interaction with KU70/XRCC6. Promotes cardiacmyocyte enlargement. RPB1/POLR2A phosphorylation on 'Ser-2' in CTDactivates transcription. AR phosphorylation modulates ARtranscription factor promoter selectivity and cell growth. DSIFand NELF phosphorylation promotes transcription by inhibitingtheir negative effect. The phosphorylation of MYOD1 enhances itstranscriptional activity and thus promotes muscle differentiation.", isseed: false, uniprot: "P50750", isvalid: true, importance: 3, ox: 817.1413594156943, oy: 473.0030598015976, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RB1", altered: 0, rank: 15, cited: 3201, uniprotdesc: "Key regulator of entry into cell division that acts as atumor suppressor. Promotes G0-G1 transition when phosphorylated byCDK3/cyclin-C. Acts as a transcription repressor of E2F1 targetgenes. The underphosphorylated, active form of RB1 interacts withE2F1 and represses its transcription activity, leading to cellcycle arrest. Directly involved in heterochromatin formation bymaintaining overall chromatin structure and, in particular, thatof constitutive heterochromatin by stabilizing histonemethylation. Recruits and targets histone methyltransferasesSUV39H1, SUV420H1 and SUV420H2, leading to epigenetictranscriptional repression. Controls histone H4 'Lys-20'trimethylation. Inhibits the intrinsic kinase activity of TAF1.Mediates transcriptional repression by SMARCA4/BRG1 by recruitinga histone deacetylase (HDAC) complex to the c-FOS promoter. Inresting neurons, transcription of the c-FOS promoter is inhibitedby BRG1-dependent recruitment of a phospho-RB1-HDAC1 repressorcomplex. Upon calcium influx, RB1 is dephosphorylated bycalcineurin, which leads to release of the repressor complex (Bysimilarity). In case of viral infections, interactions with SV40large T antigen, HPV E7 protein or adenovirus E1A protein inducethe disassembly of RB1-E2F1 complex thereby disrupting RB1'sactivity. ", isseed: false, uniprot: "P06400", isvalid: true, importance: 3, ox: 814.574109161329, oy: 502.89301172747827, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK7", altered: 0, rank: 72, cited: 372, uniprotdesc: "Serine/threonine kinase involved in cell cycle controland in RNA polymerase II-mediated RNA transcription. Cyclin-dependent kinases (CDKs) are activated by the binding to a cyclinand mediate the progression through the cell cycle. Each differentcomplex controls a specific transition between 2 subsequent phasesin the cell cycle. Required for both activation and complexformation of CDK1/cyclin-B during G2-M transition, and foractivation of CDK2/cyclins during G1-S transition (but not complexformation). CDK7 is the catalytic subunit of the CDK-activatingkinase (CAK) complex. Phosphorylates SPT5/SUPT5H, SF1/NR5A1,POLR2A, p53/TP53, CDK1, CDK2, CDK4, CDK6 and CDK11B/CDK11. CAKactivates the cyclin-associated kinases CDK1, CDK2, CDK4 and CDK6by threonine phosphorylation, thus regulating cell cycleprogression. CAK complexed to the core-TFIIH basal transcriptionfactor activates RNA polymerase II by serine phosphorylation ofthe repetitive C-terminal domain (CTD) of its large subunit(POLR2A), allowing its escape from the promoter and elongation ofthe transcripts. Phosphorylation of POLR2A in complex with DNApromotes transcription initiation by triggering dissociation fromDNA. Its expression and activity are constant throughout the cellcycle. Upon DNA damage, triggers p53/TP53 activation byphosphorylation, but is inactivated in turn by p53/TP53; thisfeedback loop may lead to an arrest of the cell cycle and of thetranscription, helping in cell recovery, or to apoptosis. Requiredfor DNA-bound peptides-mediated transcription and cellular growthinhibition. ", isseed: false, uniprot: "P50613", isvalid: true, importance: 3, ox: 808.6163951619568, oy: 532.2954885602501, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGA2", altered: 0, rank: 82, cited: 280, uniprotdesc: "Functions as a transcriptional regulator. Functions incell cycle regulation through CCNA2. Plays an important role inchromosome condensation during the meiotic G2/M transition ofspermatocytes. ", isseed: false, uniprot: "P52926", isvalid: true, importance: 3, ox: 390.3801522944653, oy: 399.55122105213593, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK3", altered: 0, rank: 112, cited: 146, uniprotdesc: "Serine/threonine kinase which is involved in theregulation of apoptosis, autophagy, transcription, translation andactin cytoskeleton reorganization. Involved in the regulation ofsmooth muscle contraction. Regulates both type I (caspase-dependent) apoptotic and type II (caspase-independent) autophagiccell deaths signal, depending on the cellular setting. Involved inregulation of starvation-induced autophagy. Regulates myosinphosphorylation in both smooth muscle and non-muscle cells. Insmooth muscle, regulates myosin either directly by phosphorylatingMYL12B and MYL9 or through inhibition of smooth muscle myosinphosphatase (SMPP1M) via phosphorylation of PPP1R12A; theinhibition of SMPP1M functions to enhance muscle responsiveness toCa(2+) and promote a contractile state. Phosphorylates MYL12B innon-muscle cells leading to reorganization of actin cytoskeleton.Isoform 2 can phosphorylate myosin, PPP1R12A and MYL12B.Overexpression leads to condensation of actin stress fibers intothick bundles. Involved in actin filament focal adhesion dynamics.The function in both reorganization of actin cytoskeleton andfocal adhesion dissolution is modulated by RhoD. Positivelyregulates canonical Wnt/beta-catenin signaling through interactionwith NLK and TCF7L2. Phosphorylates RPL13A on 'Ser-77' uponinterferon-gamma activation which is causing RPL13A release fromthe ribosome, RPL13A association with the GAIT complex and itssubsequent involvement in transcript-selective translationinhibition. Enhances transcription from AR-responsive promoters ina hormone- and kinase-dependent manner. Involved in regulation ofcell cycle progression and cell proliferation. May be a tumorsuppressor. ", isseed: false, uniprot: "O43293", isvalid: true, importance: 3, ox: 786.8834349406518, oy: 588.1161439097402, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGA1", altered: 0, rank: 111, cited: 147, uniprotdesc: "HMG-I/Y bind preferentially to the minor groove of A+Trich regions in double-stranded DNA. It is suggested that theseproteins could function in nucleosome phasing and in the 3'-endprocessing of mRNA transcripts. They are also involved in thetranscription regulation of genes containing, or in closeproximity to A+T-rich regions.", isseed: false, uniprot: "P17096", isvalid: true, importance: 3, ox: 403.8862646389955, oy: 372.7634453076488, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCD", altered: 0, rank: 122, cited: 90, uniprotdesc: "Calcium-independent, phospholipid- and diacylglycerol(DAG)-dependent serine/threonine-protein kinase that playscontrasting roles in cell death and cell survival by functioningas a pro-apoptotic protein during DNA damage-induced apoptosis,but acting as an anti-apoptotic protein during cytokine receptor-initiated cell death, is involved in tumor suppression as well assurvival of several cancers, is required for oxygen radicalproduction by NADPH oxidase and acts as positive or negativeregulator in platelet functional responses. Negatively regulates Bcell proliferation and also has an important function in self-antigen induced B cell tolerance induction. Upon DNA damage,activates the promoter of the death-promoting transcription factorBCLAF1/Btf to trigger BCLAF1-mediated p53/TP53 gene transcriptionand apoptosis. In response to oxidative stress, interact with andactivate CHUK/IKKA in the nucleus, causing the phosphorylation ofp53/TP53. In the case of ER stress or DNA damage-inducedapoptosis, can form a complex with the tyrosine-protein kinaseABL1 which trigger apoptosis independently of p53/TP53. In cytosolcan trigger apoptosis by activating MAPK11 or MAPK14, inhibitingAKT1 and decreasing the level of X-linked inhibitor of apoptosisprotein (XIAP), whereas in nucleus induces apoptosis via theactivation of MAPK8 or MAPK9. Upon ionizing radiation treatment,is required for the activation of the apoptosis regulators BAX andBAK, which trigger the mitochondrial cell death pathway. Canphosphorylate MCL1 and target it for degradation which issufficient to trigger for BAX activation and apoptosis. Isrequired for the control of cell cycle progression both at G1/Sand G2/M phases. Mediates phorbol 12-myristate 13-acetate (PMA)-induced inhibition of cell cycle progression at G1/S phase by up-regulating the CDK inhibitor CDKN1A/p21 and inhibiting the cyclinCCNA2 promoter activity. In response to UV irradiation canphosphorylate CDK1, which is important for the G2/M DNA damagecheckpoint activation. Can protect glioma cells from the apoptosisinduced by TNFSF10/TRAIL, probably by inducing increasedphosphorylation and subsequent activation of AKT1. Is highlyexpressed in a number of cancer cells and promotes cell survivaland resistance against chemotherapeutic drugs by inducing cyclinD1 (CCND1) and hyperphosphorylation of RB1, and via several pro-survival pathways, including NF-kappa-B, AKT1 and MAPK1/3(ERK1/2). Can also act as tumor suppressor upon mitogenicstimulation with PMA or TPA. In N-formyl-methionyl-leucyl-phenylalanine (fMLP)-treated cells, is required for NCF1 (p47-phox) phosphorylation and activation of NADPH oxidase activity,and regulates TNF-elicited superoxide anion production inneutrophils, by direct phosphorylation and activation of NCF1 orindirectly through MAPK1/3 (ERK1/2) signaling pathways. May alsoplay a role in the regulation of NADPH oxidase activity ineosinophil after stimulation with IL5, leukotriene B4 or PMA. Incollagen-induced platelet aggregation, acts a negative regulatorof filopodia formation and actin polymerization by interactingwith and negatively regulating VASP phosphorylation. Downstream ofPAR1, PAR4 and CD36/GP4 receptors, regulates differentiallyplatelet dense granule secretion; acts as a positive regulator inPAR-mediated granule secretion, whereas it negatively regulatesCD36/GP4-mediated granule release. Phosphorylates MUC1 in the C-terminal and regulates the interaction between MUC1 and beta-catenin. The catalytic subunit phosphorylates 14-3-3 proteins(YWHAB, YWHAZ and YWHAH) in a sphingosine-dependent fashion (Bysimilarity). ", isseed: false, uniprot: "Q05655", isvalid: true, importance: 3, ox: 753.0720747024197, oy: 637.5636821949563, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "UBN1", altered: 0, rank: 180, cited: 8, uniprotdesc: "Acts as a novel regulator of senescence. Involved in theformation of senescence-associated heterochromatin foci (SAHF),which represses expression of proliferation-promoting genes. Bindsto proliferation-promoting genes. May be required for replication-independent chromatin assembly. ", isseed: false, uniprot: "Q9NPG3", isvalid: true, importance: 3, ox: 421.7252599281241, oy: 348.6435313966405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK5", altered: 0, rank: 44, cited: 837, uniprotdesc: "Proline-directed serine/threonine-protein kinaseessential for neuronal cell cycle arrest and differentiation andmay be involved in apoptotic cell death in neuronal diseases bytriggering abortive cell cycle re-entry. Interacts with D1 and D3-type G1 cyclins. Phosphorylates SRC, NOS3, VIM/vimentin,p35/CDK5R1, MEF2A, SIPA1L1, SH3GLB1, PXN, PAK1, MCAM/MUC18, SEPT5,SYN1, DNM1, AMPH, SYNJ1, CDK16, RAC1, RHOA, CDC42, TONEBP/NFAT5,MAPT/TAU, MAP1B, histone H1, p53/TP53, HDAC1, APEX1, PTK2/FAK1,huntingtin/HTT, ATM, MAP2, NEFH and NEFM. Regulates severalneuronal development and physiological processes includingneuronal survival, migration and differentiation, axonal andneurite growth, synaptogenesis, oligodendrocyte differentiation,synaptic plasticity and neurotransmission, by phosphorylating keyproteins. Activated by interaction with CDK5R1 (p35) and CDK5R2(p39), especially in post-mitotic neurons, and promotes CDK5R1(p35) expression in an autostimulation loop. Phosphorylates manydownstream substrates such as Rho and Ras family small GTPases(e.g. PAK1, RAC1, RHOA, CDC42) or microtubule-binding proteins(e.g. MAPT/TAU, MAP2, MAP1B), and modulates actin dynamics toregulate neurite growth and/or spine morphogenesis. Phosphorylatesalso exocytosis associated proteins such as MCAM/MUC18, SEPT5,SYN1, and CDK16/PCTAIRE1 as well as endocytosis associatedproteins such as DNM1, AMPH and SYNJ1 at synaptic terminals. Inthe mature central nervous system (CNS), regulatesneurotransmitter movements by phosphorylating substratesassociated with neurotransmitter release and synapse plasticity;synaptic vesicle exocytosis, vesicles fusion with the presynapticmembrane, and endocytosis. Promotes cell survival by activatinganti-apoptotic proteins BCL2 and STAT3, and negatively regulatingof JNK3/MAPK10 activity. Phosphorylation of p53/TP53 in responseto genotoxic and oxidative stresses enhances its stabilization bypreventing ubiquitin ligase-mediated proteasomal degradation, andinduces transactivation of p53/TP53 target genes, thus regulatingapoptosis. Phosphorylation of p35/CDK5R1 enhances itsstabilization by preventing calpain-mediated proteolysis producingp25/CDK5R1 and avoiding ubiquitin ligase-mediated proteasomaldegradation. During aberrant cell-cycle activity and DNA damage,p25/CDK5 activity elicits cell-cycle activity and double-strandDNA breaks that precedes neuronal death by deregulating HDAC1. DNAdamage triggered phosphorylation of huntingtin/HTT in nuclei ofneurons protects neurons against polyglutamine expansion as wellas DNA damage mediated toxicity. Phosphorylation of PXN reducesits interaction with PTK2/FAK1 in matrix-cell focal adhesions(MCFA) during oligodendrocytes (OLs) differentiation. Negativeregulator of Wnt/beta-catenin signaling pathway. Activator of theGAIT (IFN-gamma-activated inhibitor of translation) pathway, whichsuppresses expression of a post-transcriptional regulon ofproinflammatory genes in myeloid cells; phosphorylates the linkerdomain of glutamyl-prolyl tRNA synthetase (EPRS) in a IFN-gamma-dependent manner, the initial event in assembly of the GAITcomplex. Phosphorylation of SH3GLB1 is required for autophagyinduction in starved neurons. Phosphorylation of TONEBP/NFAT5 inresponse to osmotic stress mediates its rapid nuclearlocalization. MEF2 is inactivated by phosphorylation in nucleus inresponse to neurotoxin, thus leading to neuronal apoptosis. APEX1AP-endodeoxyribonuclease is repressed by phosphorylation,resulting in accumulation of DNA damage and contributing toneuronal death. NOS3 phosphorylation down regulates NOS3-derivednitrite (NO) levels. SRC phosphorylation mediates its ubiquitin-dependent degradation and thus leads to cytoskeletalreorganization. May regulate endothelial cell migration andangiogenesis via the modulation of lamellipodia formation.Involved in dendritic spine morphogenesis by mediating the EFNA1-EPHA4 signaling. The complex p35/CDK5 participates in theregulation of the circadian clock by modulating the function ofCLOCK protein: phosphorylates CLOCK at 'Thr-451' and 'Thr-461' andregulates the transcriptional activity of the CLOCK-ARNTL/BMAL1heterodimer in association with altered stability and subcellulardistribution. ", isseed: false, uniprot: "Q00535", isvalid: true, importance: 3, ox: 708.9396993235885, oy: 678.0680099519911, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK2", altered: 0, rank: 34, cited: 1469, uniprotdesc: "Serine/threonine-protein kinase involved in the controlof the cell cycle; essential for meiosis, but dispensable formitosis. Phosphorylates CTNNB1, USP37, p53/TP53, NPM1, CDK7, RB1,BRCA2, MYC, NPAT, EZH2. Interacts with cyclins A, B1, B3, D, or E.Triggers duplication of centrosomes and DNA. Acts at the G1-Stransition to promote the E2F transcriptional program and theinitiation of DNA synthesis, and modulates G2 progression;controls the timing of entry into mitosis/meiosis by controllingthe subsequent activation of cyclin B/CDK1 by phosphorylation, andcoordinates the activation of cyclin B/CDK1 at the centrosome andin the nucleus. Crucial role in orchestrating a fine balancebetween cellular proliferation, cell death, and DNA repair inhuman embryonic stem cells (hESCs). Activity of CDK2 is maximalduring S phase and G2; activated by interaction with cyclin Eduring the early stages of DNA synthesis to permit G1-Stransition, and subsequently activated by cyclin A2 (cyclin A1 ingerm cells) during the late stages of DNA replication to drive thetransition from S phase to mitosis, the G2 phase. EZH2phosphorylation promotes H3K27me3 maintenance and epigenetic genesilencing. Phosphorylates CABLES1 (By similarity). Cyclin E/CDK2prevents oxidative stress-mediated Ras-induced senescence byphosphorylating MYC. Involved in G1-S phase DNA damage checkpointthat prevents cells with damaged DNA from initiating mitosis;regulates homologous recombination-dependent repair byphosphorylating BRCA2, this phosphorylation is low in S phase whenrecombination is active, but increases as cells progress towardsmitosis. In response to DNA damage, double-strand break repair byhomologous recombination a reduction of CDK2-mediated BRCA2phosphorylation. Phosphorylation of RB1 disturbs its interactionwith E2F1. NPM1 phosphorylation by cyclin E/CDK2 promotes itsdissociates from unduplicated centrosomes, thus initiatingcentrosome duplication. Cyclin E/CDK2-mediated phosphorylation ofNPAT at G1-S transition and until prophase stimulates the NPAT-mediated activation of histone gene transcription during S phase.Required for vitamin D-mediated growth inhibition by being itselfinactivated. Involved in the nitric oxide- (NO) mediated signalingin a nitrosylation/activation-dependent manner. USP37 is activatedby phosphorylation and thus triggers G1-S transition. CTNNB1phosphorylation regulates insulin internalization. ", isseed: false, uniprot: "P24941", isvalid: true, importance: 3, ox: 683.702093338653, oy: 694.2872344756593, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK1", altered: 0, rank: 49, cited: 691, uniprotdesc: "Calcium/calmodulin-dependent serine/threonine kinaseinvolved in multiple cellular signaling pathways that trigger cellsurvival, apoptosis, and autophagy. Regulates both type Iapoptotic and type II autophagic cell deaths signal, depending onthe cellular setting. The former is caspase-dependent, while thelatter is caspase-independent and is characterized by theaccumulation of autophagic vesicles. Phosphorylates PIN1 resultingin inhibition of its catalytic activity, nuclear localization, andcellular function. Phosphorylates TPM1, enhancing stress fiberformation in endothelial cells. Phosphorylates STX1A andsignificantly decreases its binding to STXBP1. PhosphorylatesPRKD1 and regulates JNK signaling by binding and activating PRKD1under oxidative stress. Phosphorylates BECN1, reducing itsinteraction with BCL2 and BCL2L1 and promoting the induction ofautophagy. Phosphorylates TSC2, disrupting the TSC1-TSC2 complexand stimulating mTORC1 activity in a growth factor-dependentpathway. Phosphorylates RPS6, MYL9 and DAPK3. Acts as a signalingamplifier of NMDA receptors at extrasynaptic sites for mediatingbrain damage in stroke. Cerebral ischemia recruits DAPK1 into theNMDA receptor complex and it phosphorylates GRINB at Ser-1303inducing injurious Ca(2+) influx through NMDA receptor channels,resulting in an irreversible neuronal death. Required togetherwith DAPK3 for phosphorylation of RPL13A upon interferon-gammaactivation which is causing RPL13A involvement in transcript-selective translation inhibition.Isoform 2 cannot induce apoptosis but can inducemembrane blebbing.", isseed: false, uniprot: "P53355", isvalid: true, importance: 3, ox: 656.7801404779123, oy: 707.5238675129558, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RFWD2", altered: 0, rank: 143, cited: 60, uniprotdesc: "E3 ubiquitin-protein ligase that mediates ubiquitinationand subsequent proteasomal degradation of target proteins. E3ubiquitin ligases accept ubiquitin from an E2 ubiquitin-conjugating enzyme in the form of a thioester and then directlytransfers the ubiquitin to targeted substrates. Involved in JUNubiquitination and degradation. Directly involved in p53 (TP53)ubiquitination and degradation, thereby abolishing p53-dependenttranscription and apoptosis. Ubiquitinates p53 independently ofMDM2 or RCHY1. Probably mediates E3 ubiquitin ligase activity byfunctioning as the essential RING domain subunit of larger E3complexes. In contrast, it does not constitute the catalytic RINGsubunit in the DCX DET1-COP1 complex that negatively regulatesJUN, the ubiquitin ligase activity being mediated by RBX1.Involved in 14-3-3 protein sigma/SFN ubiquitination andproteasomal degradation, leading to AKT activation and promotionof cell survival. Ubiquitinates MTA1 leading to its proteasomaldegradation. ", isseed: false, uniprot: "Q8NHY2", isvalid: true, importance: 3, ox: 628.5248095687266, oy: 717.6053493094187, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPM1J", altered: 0, rank: 191, cited: 3, uniprotdesc: "", isseed: false, uniprot: "Q5JR12", isvalid: true, importance: 3, ox: 599.3044520604564, oy: 724.4002523321917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "BTG2", altered: 0, rank: 97, cited: 205, uniprotdesc: "Anti-proliferative protein; the function is mediated byassociation with deadenylase subunits of the CCR4-NOT complex.Activates mRNA deadenylation in a CNOT6 and CNOT7-dependentmanner. In vitro can inhibit deadenylase activity of CNOT7 andCNOT8. Involved in cell cycle regulation. Could be involved in thegrowth arrest and differentiation of the neuronal precursors (Bysimilarity). Modulates transcription regulation mediated by ESR1.Involved in mitochondrial depolarization and neurite outgrowth.", isseed: false, uniprot: "P78543", isvalid: true, importance: 3, ox: 569.5000000000001, oy: 727.8199946289078, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CD82", altered: 0, rank: 69, cited: 417, uniprotdesc: "Associates with CD4 or CD8 and delivers costimulatorysignals for the TCR/CD3 pathway.", isseed: false, uniprot: "P27701", isvalid: true, importance: 3, ox: 539.5, oy: 727.8199946289078, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIPK2", altered: 0, rank: 70, cited: 405, uniprotdesc: "Serine/threonine-protein kinase involved intranscription regulation, p53/TP53-mediated cellular apoptosis andregulation of the cell cycle. Acts as a corepressor of severaltranscription factors, including SMAD1 and POU4F1/Brn3a andprobably NK homeodomain transcription factors. PhosphorylatesPDX1, ATF1, PML, p53/TP53, CREB1, CTBP1, CBX4, RUNX1, EP300,CTNNB1, HMGA1 and ZBTB4. Inhibits cell growth and promotesapoptosis through the activation of p53/TP53 both at thetranscription level and at the protein level (by phosphorylationand indirect acetylation). The phosphorylation of p53/TP53 may bemediated by a p53/TP53-HIPK2-AXIN1 complex. Involved in theresponse to hypoxia by acting as a transcriptional co-suppressorof HIF1A. Mediates transcriptional activation of TP73. In responseto TGFB, cooperates with DAXX to activate JNK. Negative regulatorthrough phosphorylation and subsequent proteasomal degradation ofCTNNB1 and the antiapoptotic factor CTBP1. In the Wnt/beta-cateninsignaling pathway acts as an intermediate kinase betweenMAP3K7/TAK1 and NLK to promote the proteasomal degradation of MYB.Phosphorylates CBX4 upon DNA damage and promotes its E3 SUMO-protein ligase activity. Activates CREB1 and ATF1 transcriptionfactors by phosphorylation in response to genotoxic stress. Inresponse to DNA damage, stabilizes PML by phosphorylation. PML,HIPK2 and FBXO3 may act synergically to activate p53/TP53-dependent transactivation. Promotes angiogenesis, and is involvedin erythroid differentiation, especially during fetal livererythropoiesis. Phosphorylation of RUNX1 and EP300 stimulatesEP300 transcription regulation activity. Triggers ZBTB4 proteindegradation in response to DNA damage. Modulates HMGA1 DNA-bindingaffinity. In response to high glucose, triggers phosphorylation-mediated subnuclear localization shifting of PDX1. Involved in theregulation of eye size, lens formation and retinal laminationduring late embryogenesis. ", isseed: false, uniprot: "Q9H2X6", isvalid: true, importance: 3, ox: 509.69554793954376, oy: 724.4002523321917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DDB2", altered: 0, rank: 102, cited: 168, uniprotdesc: "Required for DNA repair. Binds to DDB1 to form the UV-damaged DNA-binding protein complex (the UV-DDB complex). The UV-DDB complex may recognize UV-induced DNA damage and recruitproteins of the nucleotide excision repair pathway (the NERpathway) to initiate DNA repair. The UV-DDB complex preferentiallybinds to cyclobutane pyrimidine dimers (CPD), 6-4 photoproducts(6-4 PP), apurinic sites and short mismatches. Also appears tofunction as the substrate recognition module for the DCX (DDB1-CUL4-X-box) E3 ubiquitin-protein ligase complex DDB1-CUL4-ROC1(also known as CUL4-DDB-ROC1 and CUL4-DDB-RBX1). The DDB1-CUL4-ROC1 complex may ubiquitinate histone H2A, histone H3 and histoneH4 at sites of UV-induced DNA damage. The ubiquitination ofhistones may facilitate their removal from the nucleosome andpromote subsequent DNA repair. The DDB1-CUL4-ROC1 complex alsoubiquitinates XPC, which may enhance DNA-binding by XPC andpromote NER. Isoform D1 and isoform D2 inhibit UV-damaged DNArepair. ", isseed: false, uniprot: "Q92466", isvalid: true, importance: 3, ox: 480.47519043127363, oy: 717.6053493094188, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2", altered: 0, rank: 7, cited: 5024, uniprotdesc: "E3 ubiquitin-protein ligase that mediates ubiquitinationof p53/TP53, leading to its degradation by the proteasome.Inhibits p53/TP53- and p73/TP73-mediated cell cycle arrest andapoptosis by binding its transcriptional activation domain. Alsoacts as a ubiquitin ligase E3 toward itself and ARRB1. Permits thenuclear export of p53/TP53. Promotes proteasome-dependentubiquitin-independent degradation of retinoblastoma RB1 protein.Inhibits DAXX-mediated apoptosis by inducing its ubiquitinationand degradation. Component of the TRIM28/KAP1-MDM2-p53/TP53complex involved in stabilizing p53/TP53. Also component of theTRIM28/KAP1-ERBB4-MDM2 complex which links growth factor and DNAdamage response pathways. Mediates ubiquitination and subsequentproteasome degradation of DYRK2 in nucleus. Ubiquitinates IGF1Rand SNAI1 and promotes them to proteasomal degradation.", isseed: false, uniprot: "Q00987", isvalid: true, importance: 3, ox: 599.0684773104314, oy: 636.667218490667, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CTSD", altered: 0, rank: 85, cited: 273, uniprotdesc: "Acid protease active in intracellular protein breakdown.Involved in the pathogenesis of several diseases such as breastcancer and possibly Alzheimer disease.", isseed: false, uniprot: "P07339", isvalid: true, importance: 3, ox: 425.2979066613468, oy: 694.287234475659, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NGFR", altered: 0, rank: 80, cited: 313, uniprotdesc: "Plays a role in the regulation of the translocation ofGLUT4 to the cell surface in adipocytes and skeletal muscle cellsin response to insulin, probably by regulating RAB31 activity, andthereby contributes to the regulation of insulin-dependent glucoseuptake (By similarity). Low affinity receptor which can bind toNGF, BDNF, NT-3, and NT-4. Can mediate cell survival as well ascell death of neural cells. Necessary for the circadianoscillation of the clock genes ARNTL/BMAL1, PER1, PER2 and NR1D1in the suprachiasmatic nucleus (SCN) of the brain and in liver andof the genes involved in glucose and lipid metabolism in theliver. ", isseed: false, uniprot: "P08138", isvalid: true, importance: 3, ox: 400.06030067641166, oy: 678.0680099519913, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CARM1", altered: 0, rank: 207, cited: 152, uniprotdesc: "Methylates (mono- and asymmetric dimethylation) theguanidino nitrogens of arginyl residues in several proteinsinvolved in DNA packaging, transcription regulation, pre-mRNAsplicing, and mRNA stability. Recruited to promoters upon geneactivation together with histone acetyltransferases fromEP300/P300 and p160 families, methylates histone H3 at 'Arg-17'(H3R17me), forming mainly asymmetric dimethylarginine (H3R17me2a),leading to activate transcription via chromatin remodeling. Duringnuclear hormone receptor activation and TCF7L2/TCF4 activation,acts synergically with EP300/P300 and either one of the p160histone acetyltransferases NCOA1/SRC1, NCOA2/GRIP1 and NCOA3/ACTRor CTNNB1/beta-catenin to activate transcription. During myogenictranscriptional activation, acts together with NCOA3/ACTR as acoactivator for MEF2C. During monocyte inflammatory stimulation,acts together with EP300/P300 as a coactivator for NF-kappa-B.Acts as coactivator for PPARG, promotes adipocyte differentiationand the accumulation of brown fat tissue. Plays a role in theregulation of pre-mRNA alternative splicing by methylation ofsplicing factors. Also seems to be involved in p53/TP53transcriptional activation. Methylates EP300/P300, both at 'Arg-2142', which may loosen its interaction with NCOA2/GRIP1, and at'Arg-580' and 'Arg-604' in the KIX domain, which impairs itsinteraction with CREB and inhibits CREB-dependent transcriptionalactivation. Also methylates arginine residues in RNA-bindingproteins PABPC1, ELAVL1 and ELAV4, which may affect their mRNA-stabilizing properties and the half-life of their target mRNAs.", isseed: false, uniprot: "Q86X55", isvalid: true, importance: 2, ox: 376.83605235723905, oy: 659.0776363377252, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TYRP1", altered: 0, rank: 87, cited: 265, uniprotdesc: "Oxidation of 5,6-dihydroxyindole-2-carboxylic acid(DHICA) into indole-5,6-quinone-2-carboxylic acid. May regulate orinfluence the type of melanin synthesized.", isseed: false, uniprot: "P17643", isvalid: true, importance: 3, ox: 355.92792529758043, oy: 637.5636821949564, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKDC", altered: 0, rank: 74, cited: 363, uniprotdesc: "Serine/threonine-protein kinase that acts as a molecularsensor for DNA damage. Involved in DNA non-homologous end joining(NHEJ) required for double-strand break (DSB) repair and V(D)Jrecombination. Must be bound to DNA to express its catalyticproperties. Promotes processing of hairpin DNA structures in V(D)Jrecombination by activation of the hairpin endonuclease artemis(DCLRE1C). The assembly of the DNA-PK complex at DNA ends is alsorequired for the NHEJ ligation step. Required to protect and alignbroken ends of DNA. May also act as a scaffold protein to aid thelocalization of DNA repair proteins to the site of damage. Foundat the ends of chromosomes, suggesting a further role in themaintenance of telomeric stability and the prevention ofchromosomal end fusion. Also involved in modulation oftranscription. Recognizes the substrate consensus sequence [ST]-Q.Phosphorylates 'Ser-139' of histone variant H2AX/H2AFX, therebyregulating DNA damage response mechanism. Phosphorylates DCLRE1C,c-Abl/ABL1, histone H1, HSPCA, c-jun/JUN, p53/TP53, PARP1, POU2F1,DHX9, SRF, XRCC1, XRCC1, XRCC4, XRCC5, XRCC6, WRN, MYC and RFA2.Can phosphorylate C1D not only in the presence of linear DNA butalso in the presence of supercoiled DNA. Ability to phosphorylatep53/TP53 in the presence of supercoiled DNA is dependent on C1D.Contributes to the determination of the circadian period length byantagonizing phosphorylation of CRY1 'Ser-588' and increasing CRY1protein stability, most likely through an indirect machanism.Interacts with CRY1 and CRY2; negatively regulates CRY1phosphorylation. ", isseed: false, uniprot: "P78527", isvalid: true, importance: 3, ox: 337.6084889085172, oy: 613.806614817288, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIC1", altered: 0, rank: 99, cited: 185, uniprotdesc: "Transcriptional repressor. Recognizes and binds to theconsensus sequence '5-[CG]NG[CG]GGGCA[CA]CC-3'. May act as a tumorsuppressor. May be involved in development of head, face, limbsand ventral body wall. Involved in down-regulation of SIRT1 andthereby is involved in regulation of p53/TP53-dependent apoptoticDNA-damage responses. The specific target gene promoterassociation seems to be depend on corepressors, such as CTBP1 orCTBP2 and MTA1. The regulation of SIRT1 transcription in responseto nutrient deprivation seems to involve CTBP1. In cooperationwith MTA1 (indicative for an association with the NuRD complex)represses transcription from CCND1/cyclin-D1 and CDKN1C/p57Kip2specifically in quiescent cells. Involved in regulation of the Wntsignaling pathway probably by association with TCF7L2 andpreventing TCF7L2 and CTNNB1 association with promoters of TCF-responsive genes. Seems to repress transcription from E2F1 andATOH1 which involves ARID1A, indicative for the participation of adistinct SWI/SNF-type chromatin-remodeling complex. Probablyrepresses transcription from ACKR3, FGFBP1 and EFNA1.", isseed: false, uniprot: "Q14526", isvalid: true, importance: 3, ox: 322.1165650593482, oy: 588.1161439097402, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TAP1", altered: 0, rank: 63, cited: 474, uniprotdesc: "Involved in the transport of antigens from the cytoplasmto the endoplasmic reticulum for association with MHC class Imolecules. Also acts as a molecular scaffold for the final stageof MHC class I folding, namely the binding of peptide. Nascent MHCclass I molecules associate with TAP via tapasin. Inhibited by thecovalent attachment of herpes simplex virus ICP47 protein, whichblocks the peptide-binding site of TAP. Inhibited by humancytomegalovirus US6 glycoprotein, which binds to the lumenal sideof the TAP complex and inhibits peptide translocation byspecifically blocking ATP-binding to TAP1 and prevents theconformational rearrangement of TAP induced by peptide binding.Inhibited by human adenovirus E3-19K glycoprotein, which binds theTAP complex and acts as a tapasin inhibitor, preventing MHC classI/TAP association. Expression of TAP1 is down-regulated by humanEpstein-Barr virus vIL-10 protein, thereby affecting the transportof peptides into the endoplasmic reticulum and subsequent peptideloading by MHC class I molecules.", isseed: false, uniprot: "Q03518", isvalid: true, importance: 3, ox: 309.6541146692916, oy: 560.8271840491045, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PYCARD", altered: 0, rank: 89, cited: 244, uniprotdesc: "Functions as key mediator in apoptosis and inflammation.Promotes caspase-mediated apoptosis involving predominantlycaspase-8 and also caspase-9 in a probable cell type-specificmanner. Involved in activation of the mitochondrial apoptoticpathway, promotes caspase-8-dependent proteolytic maturation ofBID independently of FADD in certain cell types and also mediatesmitochondrial translocation of BAX and activates BAX-dependentapoptosis coupled to activation of caspase-9, -2 and -3. Involvedin macrophage pyroptosis, a caspase-1-dependent inflammatory formof cell death and is the major constituent of the ASC pyroptosomewhich forms upon potassium depletion and rapidly recruits andactivates caspase-1. In innate immune response believed to act asan integral adapter in the assembly of the inflammasome whichactivates caspase-1 leading to processing and secretion ofproinflammatory cytokines. The function as activating adapter indifferent types of inflammasomes is mediated by the DAPIN and CARDdomains and their homotypic interactions. Required for recruitmentof caspase-1 to inflammasomes containing certain patternrecognition receptors, such as NLRP2, NLRP3, AIM2 and probablyIFI16. In the NLRP1 and NLRC4 inflammasomes seems not be requiredbut facilitates the processing of procaspase-1. In cooperationwith NOD2 involved in an inflammasome activated by bacterialmuramyl dipeptide leading to caspase-1 activation. May be involvedin DDX58-triggered proinflammatory responses and inflammasomeactivation. Isoform 2 may have a regulating effect on the functionas inflammasome adapter. Isoform 3 seems to inhibit inflammasome-mediated maturation of interleukin-1 beta. In collaboration withAIM2 which detects cytosolic double-stranded DNA may also beinvolved in a caspase-1-independent cell death that involvescaspase-8. In adaptive immunity may be involved in maturation ofdendritic cells to stimulate T-cell immunity and in cytoskeletalrearrangements coupled to chemotaxis and antigen uptake may beinvolved in post-transcriptional regulation of the guaninenucleotide exchange factor DOCK2; the latter function is proposedto involve the nuclear form. Also involved in transcriptionalactivation of cytokines and chemokines independent of theinflammasome; this function may involve AP-1, NF-kappa-B, MAPK andcaspase-8 signaling pathways. For regulation of NF-kappa-Bactivating and inhibiting functions have been reported. ModulatesNF-kappa-B induction at the level of the IKK complex by inhibitingkinase activity of CHUK and IKBK. Proposed to compete with RIPK2for association with CASP1 thereby down-regulating CASP1-mediatedRIPK2-dependent NF-kappa-B activation and activating interleukin-1beta processing. ", isseed: false, uniprot: "Q9ULZ3", isvalid: true, importance: 3, ox: 300.38360483804325, oy: 532.2954885602502, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "APC", altered: 0, rank: 22, cited: 2683, uniprotdesc: "Tumor suppressor. Promotes rapid degradation of CTNNB1and participates in Wnt signaling as a negative regulator. APCactivity is correlated with its phosphorylation state. Activatesthe GEF activity of SPATA13 and ARHGEF4. Plays a role inhepatocyte growth factor (HGF)-induced cell migration. Requiredfor MMP9 up-regulation via the JNK signaling pathway in colorectaltumor cells. Acts as a mediator of ERBB2-dependent stabilizationof microtubules at the cell cortex. It is required for thelocalization of MACF1 to the cell membrane and this localizationof MACF1 is critical for its function in microtubulestabilization. ", isseed: false, uniprot: "P25054", isvalid: true, importance: 3, ox: 294.42589083867097, oy: 502.89301172747867, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RNF144B", altered: 0, rank: 190, cited: 4, uniprotdesc: "E3 ubiquitin-protein ligase which accepts ubiquitin fromE2 ubiquitin-conjugating enzymes UBE2L3 and UBE2L6 in the form ofa thioester and then directly transfers the ubiquitin to targetedsubstrates such as LCMT2, thereby promoting their degradation.Induces apoptosis via a p53/TP53-dependent but caspase-independentmechanism. However, its overexpression also produces a decrease ofthe ubiquitin-dependent stability of BAX, a pro-apoptotic protein,ultimately leading to protection of cell death; But, it is not ananti-apoptotic protein per se. ", isseed: false, uniprot: "Q7Z419", isvalid: true, importance: 3, ox: 291.8586405843057, oy: 473.0030598015978, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT2B", altered: 0, rank: 55, cited: 609, uniprotdesc: null, isseed: false, uniprot: null, isvalid: true, importance: 3, ox: 292.7153221081166, oy: 443.0152940167519, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MSH2", altered: 0, rank: 21, cited: 2696, uniprotdesc: "Component of the post-replicative DNA mismatch repairsystem (MMR). Forms two different heterodimers: MutS alpha (MSH2-MSH6 heterodimer) and MutS beta (MSH2-MSH3 heterodimer) whichbinds to DNA mismatches thereby initiating DNA repair. When bound,heterodimers bend the DNA helix and shields approximately 20 basepairs. MutS alpha recognizes single base mismatches anddinucleotide insertion-deletion loops (IDL) in the DNA. MutS betarecognizes larger insertion-deletion loops up to 13 nucleotideslong. After mismatch binding, MutS alpha or beta forms a ternarycomplex with the MutL alpha heterodimer, which is thought to beresponsible for directing the downstream MMR events, includingstrand discrimination, excision, and resynthesis. ATP binding andhydrolysis play a pivotal role in mismatch repair functions. TheATPase activity associated with MutS alpha regulates bindingsimilar to a molecular switch: mismatched DNA provokes ADP-->ATPexchange, resulting in a discernible conformational transitionthat converts MutS alpha into a sliding clamp capable ofhydrolysis-independent diffusion along the DNA backbone. Thistransition is crucial for mismatch repair. MutS alpha may alsoplay a role in DNA homologous recombination repair. In melanocytesmay modulate both UV-B-induced cell cycle regulation andapoptosis. ", isseed: false, uniprot: "P43246", isvalid: true, importance: 3, ox: 296.9847672563152, oy: 413.32065076032376, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP1R13L", altered: 0, rank: 140, cited: 63, uniprotdesc: "Regulator that plays a central role in regulation ofapoptosis and transcription via its interaction with NF-kappa-Band p53/TP53 proteins. Blocks transcription of HIV-1 virus byinhibiting the action of both NF-kappa-B and SP1. Also inhibitsp53/TP53 function, possibly by preventing the association betweenp53/TP53 and ASPP1 or ASPP2, and therefore suppressing thesubsequent activation of apoptosis. ", isseed: false, uniprot: "Q8WUF5", isvalid: true, importance: 3, ox: 304.6113172821198, oy: 384.3062451192653, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1", altered: 0, rank: 46, cited: 799, uniprotdesc: "NAD-dependent protein deacetylase that linkstranscriptional regulation directly to intracellular energeticsand participates in the coordination of several separated cellularfunctions such as cell cycle, response to DNA damage, metobolism,apoptosis and autophagy. Can modulate chromatin function throughdeacetylation of histones and can promote alterations in themethylation of histones and DNA, leading to transcriptionalrepression. Deacetylates a broad range of transcription factorsand coregulators, thereby regulating target gene expressionpositively and negatively. Serves as a sensor of the cytosolicratio of NAD(+)/NADH which is altered by glucose deprivation andmetabolic changes associated with caloric restriction. Isessential in skeletal muscle cell differentiation and in responseto low nutrients mediates the inhibitory effect on skeletalmyoblast differentiation which also involves 5'-AMP-activatedprotein kinase (AMPK) and nicotinamide phosphoribosyltransferase(NAMPT). Component of the eNoSC (energy-dependent nucleolarsilencing) complex, a complex that mediates silencing of rDNA inresponse to intracellular energy status and acts by recruitinghistone-modifying enzymes. The eNoSC complex is able to sense theenergy status of cell: upon glucose starvation, elevation ofNAD(+)/NADP(+) ratio activates SIRT1, leading to histone H3deacetylation followed by dimethylation of H3 at 'Lys-9' (H3K9me2)by SUV39H1 and the formation of silent chromatin in the rDNAlocus. Deacetylates 'Lys-266' of SUV39H1, leading to itsactivation. Inhibits skeletal muscle differentiation bydeacetylating PCAF and MYOD1. Deacetylates H2A and 'Lys-26' ofHIST1H1E. Deacetylates 'Lys-16' of histone H4 (in vitro). Involvedin NR0B2/SHP corepression function through chromatin remodeling:Recruited to LRH1 target gene promoters by NR0B2/SHP therebystimulating histone H3 and H4 deacetylation leading totranscriptional repression. Proposed to contribute to genomicintegrity via positive regulation of telomere length; however,reports on localization to pericentromeric heterochromatin areconflicting. Proposed to play a role in constitutiveheterochromatin (CH) formation and/or maintenance throughregulation of the available pool of nuclear SUV39H1. Uponoxidative/metabolic stress decreases SUV39H1 degradation byinhibiting SUV39H1 polyubiquitination by MDM2. This increase inSUV39H1 levels enhances SUV39H1 turnover in CH, which in turnseems to accelerate renewal of the heterochromatin whichcorrelates with greater genomic integrity during stress response.Deacetylates 'Lys-382' of p53/TP53 and impairs its ability toinduce transcription-dependent proapoptotic program and modulatecell senescence. Deacetylates TAF1B and thereby represses rDNAtranscription by the RNA polymerase I. Deacetylates MYC, promotesthe association of MYC with MAX and decreases MYC stabilityleading to compromised transformational capability. DeacetylatesFOXO3 in response to oxidative stress thereby increasing itsability to induce cell cycle arrest and resistance to oxidativestress but inhibiting FOXO3-mediated induction of apoptosistranscriptional activity; also leading to FOXO3 ubiquitination andprotesomal degradation. Appears to have a similar effect onMLLT7/FOXO4 in regulation of transcriptional activity andapoptosis. Deacetylates DNMT1; thereby impairs DNMT1methyltransferase-independent transcription repressor activity,modulates DNMT1 cell cycle regulatory function and DNMT1-mediatedgene silencing. Deacetylates RELA/NF-kappa-B p65 therebyinhibiting its transactivating potential and augments apoptosis inresponse to TNF-alpha. Deacetylates HIF1A, KAT5/TIP60, RB1 andHIC1. Deacetylates FOXO1 resulting in its nuclear retention andenhancement of its transcriptional activity leading to increasedgluconeogenesis in liver. Inhibits E2F1 transcriptional activityand apoptotic function, possibly by deacetylation. Involved inHES1- and HEY2-mediated transcriptional repression. In cooperationwith MYCN seems to be involved in transcriptional repression ofDUSP6/MAPK3 leading to MYCN stabilization by phosphorylation at'Ser-62'. Deacetylates MEF2D. Required for antagonist-mediatedtranscription suppression of AR-dependent genes which may belinked to local deacetylation of histone H3. Represses HNF1A-mediated transcription. Required for the repression of ESRRG byCREBZF. Modulates AP-1 transcription factor activity. DeacetylatesNR1H3 AND NR1H2 and deacetylation of NR1H3 at 'Lys-434' positivelyregulates transcription of NR1H3:RXR target genes, promotes NR1H3proteosomal degradation and results in cholesterol efflux; apromoter clearing mechanism after reach round of transcription isproposed. Involved in lipid metabolism. Implicated in regulationof adipogenesis and fat mobilization in white adipocytes byrepression of PPARG which probably involves association with NCOR1and SMRT/NCOR2. Deacetylates ACSS2 leading to its activation, andHMGCS1. Involved in liver and muscle metabolism. Throughdeacteylation and activation of PPARGC1A is required to activatefatty acid oxidation in skeletel muscle under low-glucoseconditions and is involved in glucose homeostasis. Involved inregulation of PPARA and fatty acid beta-oxidation in liver.Involved in positive regulation of insulin secretion in pancreaticbeta cells in response to glucose; the function seems to implytranscriptional repression of UCP2. Proposed to deacetylate IRS2thereby facilitating its insulin-induced tyrosine phosphorylation.Deacetylates SREBF1 isoform SREBP-1C thereby decreasing itsstability and transactivation in lipogenic gene expression.Involved in DNA damage response by repressing genes which areinvolved in DNA repair, such as XPC and TP73, deacetylatingXRCC6/Ku70, and faciliting recruitment of additional factors tosites of damaged DNA, such as SIRT1-deacetylated NBN can recruitATM to initiate DNA repair and SIRT1-deacetylated XPA interactswith RPA2. Also involved in DNA repair of DNA double-strand breaksby homologous recombination and specifically single-strandannealing independently of XRCC6/Ku70 and NBN. Transcriptionalsuppression of XPC probably involves an E2F4:RBL2 suppressorcomplex and protein kinase B (AKT) signaling. Transcriptionalsuppression of TP73 probably involves E2F4 and PCAF. DeacetylatesWRN thereby regulating its helicase and exonuclease activities andregulates WRN nuclear translocation in response to DNA damage.Deacetylates APEX1 at 'Lys-6' and 'Lys-7' and stimulates cellularAP endonuclease activity by promoting the association of APEX1 toXRCC1. Increases p53/TP53-mediated transcription-independentapoptosis by blocking nuclear translocation of cytoplasmicp53/TP53 and probably redirecting it to mitochondria. DeacetylatesXRCC6/Ku70 at 'Lys-539' and 'Lys-542' causing it to sequester BAXaway from mitochondria thereby inhibiting stress-inducedapoptosis. Is involved in autophagy, presumably by deacetylatingATG5, ATG7 and MAP1LC3B/ATG8. Deacetylates AKT1 which leads toenhanced binding of AKT1 and PDK1 to PIP3 and promotes theiractivation. Proposed to play role in regulation of STK11/LBK1-dependent AMPK signaling pathways implicated in cellularsenescence which seems to involve the regulation of theacetylation status of STK11/LBK1. Can deacetylate STK11/LBK1 andthereby increase its activity, cytoplasmic localization andassociation with STRAD; however, the relevance of such activity innormal cells is unclear. In endothelial cells is shown to inhibitSTK11/LBK1 activity and to promote its degradation. DeacetylatesSMAD7 at 'Lys-64' and 'Lys-70' thereby promoting its degradation.Deacetylates CIITA and augments its MHC class II transactivationand contributes to its stability. Deacteylates MECOM/EVI1. Isoform2 is shown to deacetylate 'Lys-382' of p53/TP53, however withlower activity than isoform 1. In combination, the two isoformsexert an additive effect. Isoform 2 regulates p53/TP53 expressionand cellular stress response and is in turn repressed by p53/TP53presenting a SIRT1 isoform-dependent auto-regulatory loop. In caseof HIV-1 infection, interacts with and deacetylates the viral Tatprotein. The viral Tat protein inhibits SIRT1 deacetylationactivity toward RELA/NF-kappa-B p65, thereby potentiates itstranscriptional activity and SIRT1 is proposed to contribute to T-cell hyperactivation during infection. Deacetylates PML at 'Lys-487' and this deacetylation promotes PML control of PER2 nuclearlocalization. During the neurogenic transition, repress selectiveNOTCH1-target genes through histone deacetylation in a BCL6-dependent manner and leading to neuronal differentiation.Regulates the circadian expression of several core clock genes,including ARNTL/BMAL1, RORC, PER2 and CRY1 and plays a criticalrole in maintaining a controlled rhythmicity in histoneacetylation, thereby contributing to circadian chromatinremodeling. Deacetylates ARNTL/BMAL1 and histones at the circadiangene promoters in order to facilitate repression by inhibitorycomponents of the circadian oscillator. Deacetylates PER2,facilitating its ubiquitination and degradation by the proteosome.Protects cardiomyocytes against palmitate-induced apoptosis(PubMed:11672523, PubMed:12006491, PubMed:14976264,PubMed:14980222, PubMed:15126506, PubMed:15152190,PubMed:15205477, PubMed:15469825, PubMed:15692560,PubMed:16079181, PubMed:16166628, PubMed:16892051,PubMed:16998810, PubMed:17283066, PubMed:17334224,PubMed:17505061, PubMed:17612497, PubMed:17620057,PubMed:17936707, PubMed:18203716, PubMed:18296641,PubMed:18662546, PubMed:18687677, PubMed:19188449,PubMed:19220062, PubMed:19364925, PubMed:19690166,PubMed:19934257, PubMed:20097625, PubMed:20100829,PubMed:20203304, PubMed:20375098, PubMed:20620956,PubMed:20670893, PubMed:20817729, PubMed:20975832,PubMed:21149730, PubMed:21245319, PubMed:21471201,PubMed:21504832, PubMed:21555002, PubMed:21698133,PubMed:21701047, PubMed:21775285, PubMed:21807113,PubMed:21841822, PubMed:21890893, PubMed:21909281,PubMed:21947282, PubMed:22274616). Deacetylates XBP1 isoform 2;deacetylation decreases protein stability of XBP1 isoform 2 andinhibits its transcriptional activity (By similarity).", isseed: false, uniprot: "Q96EB6", isvalid: true, importance: 3, ox: 632.4422863405995, oy: 420.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP10", altered: 0, rank: 100, cited: 181, uniprotdesc: "Involved in the activation cascade of caspasesresponsible for apoptosis execution. Recruited to both Fas- andTNFR-1 receptors in a FADD dependent manner. May participate inthe granzyme B apoptotic pathways. Cleaves and activates caspase-3, -4, -6, -7, -8, and -9. Hydrolyzes the small- moleculesubstrates, Tyr-Val-Ala-Asp-|-AMC and Asp-Glu-Val-Asp-|-AMC.", isseed: false, uniprot: "Q92851", isvalid: true, importance: 3, ox: 329.4955681394091, oy: 329.81733631298744, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SP1", altered: 0, rank: 204, cited: 351, uniprotdesc: "Transcription factor that can activate or represstranscription in response to physiological and pathologicalstimuli. Binds with high affinity to GC-rich motifs and regulatesthe expression of a large number of genes involved in a variety ofprocesses such as cell growth, apoptosis, differentiation andimmune responses. Highly regulated by post-translationalmodifications (phosphorylations, sumoylation, proteolyticcleavage, glycosylation and acetylation). Binds also the PDGFR-alpha G-box promoter. May have a role in modulating the cellularresponse to DNA damage. Implicated in chromatin remodeling. Playsa role in the recruitment of SMARCA4/BRG1 on the c-FOS promoter.Plays an essential role in the regulation of FE65 gene expression.In complex with ATF7IP, maintains telomerase activity in cancercells by inducing TERT and TERC gene expression. Isoform 3 is astronger activator of transcription than isoform 1. Positivelyregulates the transcription of the core clock componentARNTL/BMAL1. ", isseed: false, uniprot: "P08047", isvalid: true, importance: 2, ox: 346.42886470541225, oy: 305.05317940410407, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IRF5", altered: 0, rank: 101, cited: 180, uniprotdesc: "Transcription factor involved in the induction ofinterferons IFNA and INFB and inflammatory cytokines upon virusinfection. Activated by TLR7 or TLR8 signaling.", isseed: false, uniprot: "Q13568", isvalid: true, importance: 3, ox: 366.0746867237709, oy: 282.3806921734762, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "BAX", altered: 0, rank: 51, cited: 635, uniprotdesc: "Accelerates programmed cell death by binding to, andantagonizing the apoptosis repressor BCL2 or its adenovirushomolog E1B 19k protein. Under stress conditions, undergoes aconformation change that causes translocation to the mitochondrionmembrane, leading to the release of cytochrome c that thentriggers apoptosis. Promotes activation of CASP3, and therebyapoptosis. ", isseed: false, uniprot: "Q07812", isvalid: true, importance: 3, ox: 495.57608693571933, oy: 298.7290842958664, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CABIN1", altered: 0, rank: 132, cited: 77, uniprotdesc: "May be required for replication-independent chromatinassembly. May serve as a negative regulator of T-cell receptor(TCR) signaling via inhibition of calcineurin. Inhibition ofactivated calcineurin is dependent on both PKC and calciumsignals. Acts as a negative regulator of p53/TP53 by keeping p53in an inactive state on chromatin at promoters of a subset of it'starget genes. ", isseed: false, uniprot: "Q9Y6J0", isvalid: true, importance: 3, ox: 524.6080753437241, oy: 291.16974245431265, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD7", altered: 0, rank: 156, cited: 32, uniprotdesc: "Histone methyltransferase that specificallymonomethylates 'Lys-4' of histone H3. H3 'Lys-4' methylationrepresents a specific tag for epigenetic transcriptionalactivation. Plays a central role in the transcriptional activationof genes such as collagenase or insulin. Recruited by IPF1/PDX-1to the insulin promoter, leading to activate transcription. Hasalso methyltransferase activity toward non-histone proteins suchas p53/TP53, TAF10, and possibly TAF7 by recognizing and bindingthe [KR]-[STA]-K in substrate proteins. Monomethylates 'Lys-189'of TAF10, leading to increase the affinity of TAF10 for RNApolymerase II. Monomethylates 'Lys-372' of p53/TP53, stabilizingp53/TP53 and increasing p53/TP53-mediated transcriptionalactivation. ", isseed: false, uniprot: "Q8WTS6", isvalid: true, importance: 3, ox: 438.5698130049044, oy: 229.70989985711353, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD8", altered: 0, rank: 164, cited: 22, uniprotdesc: "Protein-lysine N-methyltransferase that monomethylatesboth histones and non-histone proteins. Specificallymonomethylates 'Lys-20' of histone H4 (H4K20me1). H4K20me1 isenriched during mitosis and represents a specific tag forepigenetic transcriptional repression. Mainly functions ineuchromatin regions, thereby playing a central role in thesilencing of euchromatic genes. Required for cell proliferation,probably by contributing to the maintenance of proper higher-orderstructure of DNA during mitosis. Involved in chromosomecondensation and proper cytokinesis. Nucleosomes are preferred assubstrate compared to free histones. Mediates monomethylation ofp53/TP53 at 'Lys-382', leading to repress p53/TP53-target genes.Plays a negative role in TGF-beta response regulation and apositive role in cell migration. ", isseed: false, uniprot: "Q9NQR1", isvalid: true, importance: 3, ox: 466.2035225983501, oy: 218.0317966675917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "APAF1", altered: 0, rank: 83, cited: 278, uniprotdesc: "Oligomeric Apaf-1 mediates the cytochrome c-dependentautocatalytic activation of pro-caspase-9 (Apaf-3), leading to theactivation of caspase-3 and apoptosis. This activation requiresATP. Isoform 6 is less effective in inducing apoptosis.", isseed: false, uniprot: "O14727", isvalid: true, importance: 3, ox: 494.98831180678513, oy: 209.57981996234875, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GDF15", altered: 0, rank: 91, cited: 232, uniprotdesc: "", isseed: false, uniprot: "Q99988", isvalid: true, importance: 3, ox: 388.1769208600632, oy: 262.09544516525557, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, ], edges: [ { id: "TP53-controls-state-change-of-H1F0", source: "TP53", cited: 0, target: "H1F0", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-IRF5", source: "TP53", cited: 0, target: "IRF5", pubmed: ["11973653"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT8-controls-state-change-of-TP53", source: "KAT8", cited: 0, target: "TP53", pubmed: ["17189187", "17534149"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11-controls-state-change-of-TP53", source: "FBXO11", cited: 4, target: "TP53", pubmed: ["17098746"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP53", source: "ATR", cited: 24, target: "TP53", pubmed: [ "10202145", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11042698", "11096068", "11121242", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15665826", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19934315", "19962312", "20005840", "20024960", "20026654", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20696760", "20711232", "20931131", "20935676", "20962272", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9363941", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11-controls-state-change-of-NEDD8", source: "FBXO11", cited: 1, target: "NEDD8", pubmed: ["17098746"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP53", source: "ATM", cited: 237, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9733514", "9733515", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SMYD2-controls-state-change-of-TP53", source: "SMYD2", cited: 6, target: "TP53", pubmed: ["17108971"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NGFR-controls-state-change-of-TP53", source: "NGFR", cited: 0, target: "TP53", pubmed: ["15668238"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAX-controls-expression-of-TP53", source: "MAX", cited: 0, target: "TP53", pubmed: ["8494784"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PRKAB1", source: "TP53", cited: 5, target: "PRKAB1", pubmed: ["16140933", "17409411"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2-controls-state-change-of-TP53", source: "MDM2", cited: 2748, target: "TP53", pubmed: [ "10734067", "11127820", "11340074", "11713287", "14654783", "14671306", "14702041", "15210108", "15242646", "16107876", "9153395", "9153396", "9450543", ], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD8-controls-state-change-of-TP53", source: "SETD8", cited: 8, target: "TP53", pubmed: ["17707234"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD7-controls-state-change-of-TP53", source: "SETD7", cited: 8, target: "TP53", pubmed: ["15525938", "17646389"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TYRP1", source: "TP53", cited: 0, target: "TYRP1", pubmed: ["10640990"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP63", source: "ATR", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCA-controls-state-change-of-TP53", source: "PRKCA", cited: 12, target: "TP53", pubmed: [ "10706102", "10733583", "11007451", "11423984", "11585729", "12080066", "14640983", "14744935", "15659650", "16227590", "17898864", "18812399", "19819244", "19933256", "9254608", "9315650", "9571186", "9620776", "9739174", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP63", source: "ATM", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP73", source: "CHEK2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-DDB2", source: "TP53", cited: 23, target: "DDB2", pubmed: ["11971958"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCD-controls-state-change-of-TP53", source: "PRKCD", cited: 0, target: "TP53", pubmed: [ "10581258", "11030628", "11101524", "11300786", "11495913", "11740489", "11780126", "11875057", "12021785", "12093737", "12397361", "12427754", "12676607", "12860987", "12902982", "12907596", "14749479", "15322239", "15381073", "15471885", "15489221", "15526030", "15619621", "15657359", "15706352", "15750624", "15843377", "15870257", "15897882", "16219768", "16247456", "16377624", "16601678", "16717128", "16738336", "16793543", "17105820", "17107963", "17210684", "17332358", "17349958", "17349959", "17380123", "17567906", "17591690", "17891183", "17906639", "18056705", "18160537", "18216278", "18536714", "18560558", "18769132", "19465479", "19819244", "19828042", "19857493", "19861417", "19882354", "19965871", "20018442", "20024960", "20123963", "20171273", "20363803", "20514025", "20610713", "20673369", "20696760", "20811699", "20935676", "20962272", "21057547", "21383696", "21394211", "21642861", "21660965", "21765463", "21765464", "22011578", "22797063", "22878263", "23149944", "24145406", "24196445", "24379358", "24899407", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP63", source: "TP53", cited: 257, target: "TP63", pubmed: ["14576823"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PML", source: "TP53", cited: 102, target: "PML", pubmed: ["14992722"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP73", source: "ATM", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP63", source: "WRN", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP73", source: "ATR", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PCBP4", source: "TP53", cited: 0, target: "PCBP4", pubmed: ["10891498"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GADD45A", source: "TP53", cited: 45, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKDC-controls-state-change-of-TP53", source: "PRKDC", cited: 10, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10930428", "10958792", "11030628", "11042698", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11883897", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19345189", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21386980", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22496350", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GDF15", source: "TP53", cited: 18, target: "GDF15", pubmed: ["10618379"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP73", source: "WRN", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-SERPINE1", source: "TP53", cited: 35, target: "SERPINE1", pubmed: ["7479001"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PPM1J", source: "TP53", cited: 0, target: "PPM1J", pubmed: ["16260627"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP63", source: "HTT", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP1", source: "TP53", cited: 6, target: "CASP1", pubmed: ["11278253"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP63", source: "MAPK14", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP73", source: "HMGB1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP6", source: "TP53", cited: 13, target: "CASP6", pubmed: ["12089322"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP63", source: "MAPK13", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP53", source: "HTT", cited: 9, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP63", source: "MAPK12", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP63", source: "MAPK11", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-expression-of-CDKN1A", source: "SIRT1", cited: 0, target: "CDKN1A", pubmed: [], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP53", source: "PML", cited: 101, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP-controls-state-change-of-TP53", source: "CREBBP", cited: 72, target: "TP53", pubmed: ["18485870"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TAP1", source: "TP53", cited: 6, target: "TAP1", pubmed: ["10618714", "12857899"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP53", source: "MAPK13", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP53", source: "MAPK12", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP53", source: "MAPK14", cited: 65, target: "TP53", pubmed: [ "10202145", "10212189", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10747897", "10958792", "11030628", "11078726", "11096068", "11101524", "11121242", "11244509", "11258706", "11283254", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15657359", "15665826", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16552184", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17210684", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17942552", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20018442", "20024960", "20026654", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9372954", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP53", source: "MAPK11", cited: 0, target: "TP53", pubmed: ["10212189", "10747897", "17254968"], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-BAX", source: "TP53", cited: 95, target: "BAX", pubmed: ["14963330"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP63", source: "HMGB1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP73", source: "TP53", cited: 42, target: "TP73", pubmed: ["11314010"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP63", source: "PML", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP73", source: "PPP2CA", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP73", source: "PPP2CB", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FOS-controls-expression-of-TP53", source: "FOS", cited: 12, target: "TP53", pubmed: ["10072388", "11136975"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP-controls-expression-of-GADD45A", source: "CREBBP", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CDKN1A", source: "TP53", cited: 1480, target: "CDKN1A", pubmed: [ "11080152", "15655109", "17110336", "17409421", "17707234", "17719541", "17938176", "18250150", "18485870", "19011621", "7796420", "8242752", ], isdirected: true, type: "controls-expression-of", datasource: ["Reactome", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP73", source: "PML", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP53", source: "HMGB1", cited: 21, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP73", source: "IGBP1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIPK2-controls-state-change-of-TP53", source: "HIPK2", cited: 98, target: "TP53", pubmed: [ "10581258", "11030628", "11101524", "11300786", "11495913", "11740489", "11780126", "11875057", "12021785", "12093737", "12397361", "12427754", "12676607", "12860987", "12902982", "12907596", "14749479", "15322239", "15381073", "15471885", "15489221", "15526030", "15619621", "15657359", "15706352", "15750624", "15843377", "15870257", "15897882", "16219768", "16247456", "16377624", "16601678", "16717128", "16738336", "16793543", "17105820", "17107963", "17210684", "17332358", "17349958", "17349959", "17380123", "17567906", "17591690", "17891183", "17906639", "18056705", "18160537", "18216278", "18536714", "18560558", "18769132", "19465479", "19819244", "19828042", "19857493", "19861417", "19882354", "19965871", "20018442", "20024960", "20123963", "20171273", "20363803", "20514025", "20610713", "20673369", "20696760", "20811699", "20935676", "20962272", "21057547", "21383696", "21394211", "21642861", "21660965", "21765463", "21765464", "22011578", "22797063", "22878263", "23149944", "24145406", "24196445", "24379358", "24899407", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RNF144B", source: "TP53", cited: 0, target: "RNF144B", pubmed: ["12853982"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HIC1", source: "TP53", cited: 22, target: "HIC1", pubmed: ["16301995"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIRA", source: "TP53", cited: 1, target: "HIRA", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP73", source: "MAPK14", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-UBN1", source: "TP53", cited: 0, target: "UBN1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RB1", source: "TP53", cited: 262, target: "RB1", pubmed: ["8119988"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP73", source: "MAPK11", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HMGA2", source: "TP53", cited: 5, target: "HMGA2", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HMGA1", source: "TP53", cited: 5, target: "HMGA1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP73", source: "MAPK13", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP73", source: "MAPK12", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP63", source: "IGBP1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP53I3", source: "TP53", cited: 28, target: "TP53I3", pubmed: ["11684014", "11919562", "17719542", "18485870"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DYRK1A-controls-state-change-of-TP53", source: "DYRK1A", cited: 1, target: "TP53", pubmed: [ "10202145", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11121242", "11244509", "11258706", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15665826", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19934315", "19962312", "20005840", "20024960", "20026654", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20696760", "20711232", "20931131", "20935676", "20962272", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9363941", "9733515", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP73", source: "SUMO1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP63", source: "PRKAG1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP73", source: "SIRT1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP63", source: "PPP2CB", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP53", source: "CHEK2", cited: 73, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11042698", "11096068", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11585729", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11883897", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14640983", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15629715", "15659650", "15665826", "15671037", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17121812", "17135248", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17898864", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18812399", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19933256", "19934315", "19962312", "20005840", "20009884", "20024960", "20026654", "20041275", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20931131", "20935676", "20962272", "21148320", "21317932", "21383696", "21386980", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9254608", "9315650", "9363941", "9571186", "9620776", "9733515", "9739174", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP63", source: "PPP2CA", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK7-controls-state-change-of-TP53", source: "CDK7", cited: 7, target: "TP53", pubmed: [ "10202145", "10348343", "10581258", "10656682", "10656795", "10706102", "10733583", "10747897", "11007451", "11101524", "11239457", "11300786", "11423984", "11495913", "11526498", "11583595", "11585729", "11707453", "11709713", "11850826", "11875057", "12021785", "12080066", "12091386", "12393879", "12397361", "12397362", "12427754", "12519780", "12676607", "12776195", "12860987", "12959929", "1406679", "14640983", "14665630", "14744935", "14968111", "15064747", "15155458", "15322239", "15471885", "15489221", "15619621", "15659650", "15792956", "15843377", "16083285", "16227590", "16319070", "16436515", "16552184", "16632641", "16651424", "16717128", "16818520", "17105820", "17108107", "17237827", "17591690", "17891183", "17898864", "17906639", "17942552", "17975552", "18490454", "18523266", "18718914", "18765533", "18769132", "18778462", "18812399", "19251701", "19369195", "19413330", "19819244", "19861417", "19882354", "19933256", "20009884", "20024960", "20123963", "20562916", "20663147", "20686112", "20962272", "21317932", "21383696", "21423215", "21455220", "21460857", "21832239", "22011578", "22112863", "22975381", "23312004", "23603988", "23871434", "24194938", "24657168", "8327466", "9254608", "9315650", "9372954", "9467949", "9571186", "9620776", "9739174", "9744860", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK9-controls-state-change-of-TP53", source: "CDK9", cited: 19, target: "TP53", pubmed: [ "10202145", "10348343", "10581258", "10644693", "10656682", "10656795", "10706102", "10733583", "10747897", "11078726", "11101524", "11239457", "11300786", "11423984", "11495913", "11526498", "11583595", "11687964", "11707453", "11709713", "11850826", "11875057", "12021785", "12091386", "12393879", "12397361", "12397362", "12427754", "12519780", "12676607", "12776195", "12860987", "12959929", "1406679", "14640983", "14665630", "14702041", "14744935", "14968111", "15064747", "15155458", "15302935", "15322239", "15471885", "15489221", "15619621", "15792956", "15843377", "16037820", "16083285", "16227590", "16319070", "16436515", "16552184", "16632641", "16651424", "16674116", "16717128", "16784539", "16818520", "17105820", "17108107", "17237827", "17287340", "17591690", "17891183", "17906639", "17942552", "17975552", "18490454", "18521083", "18523266", "18718914", "18765533", "18769132", "18778462", "18847512", "19251701", "19369195", "19413330", "19574224", "19664995", "19819244", "19861417", "19882354", "20009884", "20024960", "20123963", "20363803", "20562916", "20661218", "20663147", "20686112", "20808790", "20815410", "20962272", "21317932", "21383696", "21423215", "21455220", "21460857", "21659604", "21832239", "21983960", "22011578", "22112863", "22496350", "22547687", "22975381", "23201157", "23312004", "23603988", "23871434", "24194938", "24657168", "25159151", "7596441", "8327466", "9254608", "9315650", "9372954", "9467949", "9739174", "9744860", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK2-controls-state-change-of-TP53", source: "CDK2", cited: 26, target: "TP53", pubmed: [ "10581258", "10644693", "10656795", "11078726", "11283254", "11300786", "11687964", "11875057", "12021785", "12397361", "12397362", "12860987", "1406679", "14640983", "14702041", "14744935", "15302935", "15619621", "16037820", "16227590", "16552184", "16674116", "16784539", "17287340", "17906639", "17942552", "18521083", "18769132", "18847512", "19413330", "19574224", "19664995", "20363803", "20562916", "20661218", "20686112", "20808790", "20815410", "21659604", "21983960", "22011578", "22496350", "22547687", "23201157", "23312004", "25159151", "7596441", "8327466", "9254608", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK5-controls-state-change-of-TP53", source: "CDK5", cited: 23, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16552184", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17942552", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9372954", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP53", source: "IGBP1", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-BAX", source: "TP53", cited: 95, target: "BAX", pubmed: [ "10518217", "11080152", "11278953", "11684014", "11850816", "15598651", "17145718", "17189187", ], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CCNB1", source: "TP53", cited: 23, target: "CCNB1", pubmed: ["15710382"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP63", source: "SIRT1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP73", source: "PRKAG1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-MDM2", source: "TP53", cited: 2784, target: "MDM2", pubmed: ["12138177", "17409421", "7651818", "8319905"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP53", source: "PPP2CB", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP53", source: "PPP2CA", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP63", source: "CHEK2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CD82", source: "TP53", cited: 44, target: "CD82", pubmed: ["9736732"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-FDXR", source: "TP53", cited: 0, target: "FDXR", pubmed: ["12370809", "17409421"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HTT", source: "TP53", cited: 9, target: "HTT", pubmed: ["16278683"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CTSD", source: "TP53", cited: 0, target: "CTSD", pubmed: ["9619826"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP53", source: "SIRT1", cited: 50, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP10", source: "TP53", cited: 0, target: "CASP10", pubmed: ["14688482"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-APAF1", source: "TP53", cited: 26, target: "APAF1", pubmed: ["11559530"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HGF", source: "TP53", cited: 1, target: "HGF", pubmed: ["9023107"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT5-controls-state-change-of-TP53", source: "PRMT5", cited: 0, target: "TP53", pubmed: ["19011621"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-APC", source: "TP53", cited: 166, target: "APC", pubmed: ["11279192"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-BTG2", source: "TP53", cited: 14, target: "BTG2", pubmed: ["11814693"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT1-controls-expression-of-GADD45A", source: "PRMT1", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-ASF1A", source: "TP53", cited: 1, target: "ASF1A", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-FAS", source: "TP53", cited: 114, target: "FAS", pubmed: ["9841917"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP73", source: "HTT", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP53", source: "PRKAG1", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TRIAP1", source: "TP53", cited: 2, target: "TRIAP1", pubmed: ["15735003"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RFWD2", source: "TP53", cited: 11, target: "RFWD2", pubmed: ["15103385"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP63", source: "EP300", cited: 2, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-COL18A1", source: "TP53", cited: 1, target: "COL18A1", pubmed: ["15958553"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-expression-of-GADD45A", source: "EP300", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP73", source: "PRKAB2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP53", source: "EP300", cited: 117, target: "TP53", pubmed: ["18485870"], isdirected: true, type: "controls-state-change-of", datasource: ["pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP73", source: "PRKAB1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1B", source: "TP53", cited: 2, target: "HIST1H1B", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP73", source: "EP300", cited: 1, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1C", source: "TP53", cited: 4, target: "HIST1H1C", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1A", source: "TP53", cited: 0, target: "HIST1H1A", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CARM1-controls-expression-of-GADD45A", source: "CARM1", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1D", source: "TP53", cited: 0, target: "HIST1H1D", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1E", source: "TP53", cited: 0, target: "HIST1H1E", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP53", source: "WRN", cited: 46, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-MSH2", source: "TP53", cited: 109, target: "MSH2", pubmed: ["10984493", "11350971"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT2B-controls-state-change-of-TP53", source: "KAT2B", cited: 34, target: "TP53", pubmed: ["17110336", "9744860", "9891054"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PYCARD", source: "TP53", cited: 13, target: "PYCARD", pubmed: ["14730312"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP53", source: "PRKAA2", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SP1-controls-expression-of-CCNB1", source: "SP1", cited: 1, target: "CCNB1", pubmed: ["15710382"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP53", source: "PRKAA1", cited: 1, target: "TP53", pubmed: [ "10202145", "10570149", "10606744", "10656795", "10673500", "10673501", "10706102", "10710310", "10733583", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11883897", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15355354", "15471885", "15489221", "15542844", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18246126", "18593910", "18669630", "18718914", "18778462", "18794113", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21386980", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GPX1", source: "TP53", cited: 10, target: "GPX1", pubmed: ["16140933"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-CABIN1", source: "TP53", cited: 6, target: "CABIN1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2-controls-state-change-of-NEDD8", source: "MDM2", cited: 10, target: "NEDD8", pubmed: ["15242646"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PLK3-controls-state-change-of-TP53", source: "PLK3", cited: 16, target: "TP53", pubmed: [ "10202145", "10570149", "10656795", "10673500", "10673501", "10706102", "10710310", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15471885", "15489221", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18593910", "18669630", "18718914", "18778462", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP53", source: "PRKAB1", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP53", source: "SUMO1", cited: 39, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP63", source: "PRKAA1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP1R13L-controls-state-change-of-TP53", source: "PPP1R13L", cited: 13, target: "TP53", pubmed: [ "10581258", "11740489", "11780126", "16377624", "17349958", "17906639", ], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PLK3", source: "TP53", cited: 16, target: "PLK3", pubmed: ["16140933"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP63", source: "PRKAA2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP53", source: "PRKAB2", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK1-controls-state-change-of-TP53", source: "DAPK1", cited: 6, target: "TP53", pubmed: [ "10202145", "10570149", "10606744", "10656795", "10673500", "10673501", "10706102", "10710310", "10733583", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11883897", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15355354", "15471885", "15489221", "15542844", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18246126", "18593910", "18669630", "18718914", "18778462", "18794113", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20847049", "20851891", "20959462", "20962272", "21148320", "21383696", "21386980", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK1-controls-state-change-of-TP53", source: "CDK1", cited: 47, target: "TP53", pubmed: [ "10644693", "10656795", "11078726", "11300786", "11687964", "11875057", "12021785", "12397361", "12397362", "12860987", "1406679", "14640983", "14702041", "14744935", "15302935", "15619621", "16037820", "16227590", "16552184", "16674116", "16784539", "17287340", "17906639", "17942552", "18521083", "18769132", "18847512", "19413330", "19574224", "19664995", "20363803", "20562916", "20661218", "20686112", "20808790", "20815410", "21659604", "21983960", "22011578", "22496350", "22547687", "23201157", "23312004", "25159151", "7596441", "8327466", "9254608", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK3-controls-state-change-of-TP53", source: "DAPK3", cited: 0, target: "TP53", pubmed: [ "10202145", "10570149", "10656795", "10673500", "10673501", "10706102", "10710310", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15471885", "15489221", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18593910", "18669630", "18718914", "18778462", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP63", source: "PRKAB1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP63", source: "SUMO1", cited: 1, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP73", source: "PRKAA1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "E4F1-controls-state-change-of-TP53", source: "E4F1", cited: 12, target: "TP53", pubmed: ["17110336", "9288740"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP73", source: "PRKAA2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP63", source: "PRKAB2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-concentric/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-concentric/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-concentric/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import concentric from "@antv/f6/dist/extends/layout/concentricLayout"; /** * basicConcentric */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("concentric", concentric); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "concentric", maxLevelDiff: 0.5, sortBy: "degree", }, animate: true, defaultNode: { size: 5, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-concentric/index.json ================================================ { "defaultTitle": "基本同心圆布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-dagre/data.js ================================================ export default { nodes: [ { id: "1", dataType: "alps", name: "alps_file1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "2", dataType: "alps", name: "alps_file2", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "3", dataType: "alps", name: "alps_file3", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "4", dataType: "sql", name: "sql_file1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "5", dataType: "sql", name: "sql_file2", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "6", dataType: "feature_etl", name: "feature_etl_1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "7", dataType: "feature_etl", name: "feature_etl_1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "8", dataType: "feature_extractor", name: "feature_extractor", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, ], edges: [ { source: "1", target: "2", }, { source: "1", target: "3", }, { source: "2", target: "4", }, { source: "3", target: "4", }, { source: "4", target: "5", }, { source: "5", target: "6", }, { source: "6", target: "7", }, { source: "6", target: "8", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-dagre/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-dagre/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-dagre/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * Dagre流程图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); F6.registerNode( "sql", { drawShape(cfg, group) { const rect = group.addShape("rect", { attrs: { x: -75, y: -25, width: 150, height: 50, radius: 10, stroke: "#5B8FF9", fill: "#C6E5FF", lineWidth: 3, }, name: "rect-shape", }); if (cfg.name) { group.addShape("text", { attrs: { text: cfg.name, x: 0, y: 0, fill: "#00287E", fontSize: 14, textAlign: "center", textBaseline: "middle", fontWeight: "bold", }, name: "text-shape", }); } return rect; }, }, "single-node", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, layout: { type: "dagre", nodesepFunc: (d) => { if (d.id === "3") { return 500; } return 50; }, ranksep: 70, controlPoints: true, }, defaultNode: { type: "sql", }, defaultEdge: { type: "polyline", style: { radius: 20, offset: 45, endArrow: true, lineWidth: 2, stroke: "#C2C8D5", }, }, nodeStateStyles: { selected: { stroke: "#d9d9d9", fill: "#5394ef", }, }, modes: { default: [ "drag-canvas", "zoom-canvas", "click-select", { type: "tooltip", formatText(model) { const cfg = model.conf; const text = []; cfg.forEach((row) => { text.push(`${row.label}:${row.value}
`); }); return text.join("\n"); }, offset: 30, }, ], }, fitView: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-dagre/index.json ================================================ { "defaultTitle": "流程图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 基本力导向布局及节点拖拽 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", }, defaultNode: { size: 15, }, }); const data = getData(); // 注册数据 this.graph.data({ nodes: data.nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); // 更新位置用的函数 function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 监听事件 this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { const forceLayout = this.graph.get("layoutController").layoutMethods[0]; forceLayout.execute(); refreshDragedNodePosition(e); }); this.graph.on("node:dragend", function (e) { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed/index.json ================================================ { "defaultTitle": "基本力导向布局及节点拖拽", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed-drag-fix/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed-drag-fix/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed-drag-fix/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed-drag-fix/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 固定被拖拽节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const data = getData(); const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, nodeSize: 20, }, modes: { default: ["drag-node"], }, defaultNode: { size: 20, }, }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } this.graph.on("node:dragstart", (e) => { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", (e) => { refreshDragedNodePosition(e); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-force-directed-drag-fix/index.json ================================================ { "defaultTitle": "固定被拖拽节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-grid/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-grid/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-grid/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-grid/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import grid from "@antv/f6/dist/extends/layout/gridLayout"; /** * basicGrid布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("grid", grid); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "grid", begin: [20, 20], width: width - 20, height: height - 20, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-grid/index.json ================================================ { "defaultTitle": "基本网格布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-radial/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-radial/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-radial/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-radial/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * basicRadial */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/basic-radial/index.json ================================================ { "defaultTitle": "基本辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-arc-diagram/data.js ================================================ export default { nodes: [ { id: "0", name: "analytics.cluster", cluster: "analytics", value: 21, }, { id: "1", name: "analytics.graph", cluster: "analytics", value: 34, }, { id: "2", name: "analytics.optimization", cluster: "analytics", value: 8, }, { id: "3", name: "animate", cluster: "animate", value: 40, }, { id: "4", name: "animate.interpolate", cluster: "animate", value: 18, }, { id: "5", name: "data.converters", cluster: "data", value: 25, }, { id: "6", name: "data", cluster: "data", value: 10, }, { id: "7", name: "display", cluster: "display", value: 4, }, { id: "8", name: "flex", cluster: "flex", value: 6, }, { id: "9", name: "physics", cluster: "physics", value: 22, }, { id: "10", name: "query", cluster: "query", value: 67, }, { id: "11", name: "query.methods", cluster: "query", value: 71, }, { id: "12", name: "scale", cluster: "scale", value: 33, }, { id: "13", name: "util", cluster: "util", value: 23, }, { id: "14", name: "util.heap", cluster: "util", value: 2, }, { id: "15", cluster: "util", name: "util.math", value: 2, }, { id: "16", name: "util.palette", cluster: "util", value: 5, }, { id: "17", name: "vis.axis", cluster: "vis", value: 24, }, { id: "18", name: "vis.controls", cluster: "vis", value: 28, }, { id: "19", name: "vis.data", cluster: "vis", value: 70, }, { id: "20", name: "vis.data.render", cluster: "vis", value: 11, }, { id: "21", name: "vis.events", cluster: "vis", value: 8, }, { id: "22", name: "vis.legend", cluster: "vis", value: 27, }, { id: "23", name: "vis.operator.distortion", cluster: "vis", value: 9, }, { id: "24", name: "vis.operator.encoder", cluster: "vis", value: 30, }, { id: "25", name: "vis.operator.filter", cluster: "vis", value: 17, }, { id: "26", name: "vis.operator", cluster: "vis", value: 27, }, { id: "27", name: "vis.operator.label", cluster: "vis", value: 18, }, { id: "28", name: "vis.operator.layout", cluster: "vis", value: 91, }, { id: "29", name: "vis", cluster: "vis", value: 13, }, ], edges: [ { source: "10", target: "10", sourceWeight: 61, targetWeight: 61, }, { source: "11", target: "11", sourceWeight: 39, targetWeight: 39, }, { source: "3", target: "3", sourceWeight: 30, targetWeight: 30, }, { source: "19", target: "19", sourceWeight: 26, targetWeight: 26, }, { source: "13", target: "13", sourceWeight: 23, targetWeight: 23, }, { source: "9", target: "9", sourceWeight: 22, targetWeight: 22, }, { source: "12", target: "12", sourceWeight: 19, targetWeight: 19, }, { source: "28", target: "19", sourceWeight: 34, targetWeight: 0, }, { source: "4", target: "4", sourceWeight: 16, targetWeight: 16, }, { source: "11", target: "10", sourceWeight: 32, targetWeight: 0, }, { source: "28", target: "28", sourceWeight: 14, targetWeight: 14, }, { source: "18", target: "18", sourceWeight: 12, targetWeight: 12, }, { source: "26", target: "26", sourceWeight: 11, targetWeight: 11, }, { source: "28", target: "13", sourceWeight: 20, targetWeight: 0, }, { source: "5", target: "6", sourceWeight: 17, targetWeight: 2, }, { source: "19", target: "13", sourceWeight: 17, targetWeight: 0, }, { source: "17", target: "17", sourceWeight: 7, targetWeight: 7, }, { source: "6", target: "6", sourceWeight: 7, targetWeight: 7, }, { source: "12", target: "13", sourceWeight: 14, targetWeight: 0, }, { source: "1", target: "19", sourceWeight: 14, targetWeight: 0, }, { source: "5", target: "5", sourceWeight: 7, targetWeight: 7, }, { source: "21", target: "19", sourceWeight: 6, targetWeight: 4, }, { source: "25", target: "19", sourceWeight: 10, targetWeight: 0, }, { source: "0", target: "0", sourceWeight: 5, targetWeight: 5, }, { source: "3", target: "13", sourceWeight: 9, targetWeight: 0, }, { source: "20", target: "19", sourceWeight: 5, targetWeight: 4, }, { source: "19", target: "12", sourceWeight: 9, targetWeight: 0, }, { source: "0", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "24", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "22", target: "22", sourceWeight: 4, targetWeight: 4, }, { source: "24", target: "24", sourceWeight: 4, targetWeight: 4, }, { source: "26", target: "3", sourceWeight: 7, targetWeight: 0, }, { source: "24", target: "16", sourceWeight: 7, targetWeight: 0, }, { source: "16", target: "16", sourceWeight: 3, targetWeight: 3, }, { source: "10", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "7", target: "7", sourceWeight: 3, targetWeight: 3, }, { source: "22", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "20", target: "20", sourceWeight: 3, targetWeight: 3, }, { source: "1", target: "26", sourceWeight: 6, targetWeight: 0, }, { source: "27", target: "19", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "12", sourceWeight: 6, targetWeight: 0, }, { source: "22", target: "7", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "3", sourceWeight: 6, targetWeight: 0, }, { source: "17", target: "7", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "27", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "3", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "29", sourceWeight: 3, targetWeight: 2, }, { source: "22", target: "16", sourceWeight: 5, targetWeight: 0, }, { source: "18", target: "21", sourceWeight: 4, targetWeight: 0, }, { source: "22", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "23", target: "23", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "29", sourceWeight: 2, targetWeight: 2, }, { source: "28", target: "17", sourceWeight: 4, targetWeight: 0, }, { source: "15", target: "15", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "27", target: "27", sourceWeight: 2, targetWeight: 2, }, { source: "14", target: "14", sourceWeight: 2, targetWeight: 2, }, { source: "18", target: "29", sourceWeight: 3, targetWeight: 1, }, { source: "25", target: "26", sourceWeight: 3, targetWeight: 0, }, { source: "28", target: "9", sourceWeight: 3, targetWeight: 0, }, { source: "27", target: "7", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "12", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "18", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "20", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "19", target: "6", sourceWeight: 3, targetWeight: 0, }, { source: "29", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "25", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "28", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "24", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "16", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "21", sourceWeight: 2, targetWeight: 0, }, { source: "21", target: "21", sourceWeight: 1, targetWeight: 1, }, { source: "29", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "4", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "8", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "2", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "1", sourceWeight: 1, targetWeight: 1, }, { source: "23", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "23", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "0", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "21", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "3", target: "4", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "26", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "17", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "5", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "12", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "20", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "21", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "6", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "1", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "6", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "25", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "7", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "0", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "19", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "29", sourceWeight: 1, targetWeight: 0, }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-arc-diagram/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-arc-diagram/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-arc-diagram/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import mds from "@antv/f6/dist/extends/layout/mdsLayout"; /** * 环形弧线图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const colors = [ "rgb(91, 143, 249)", "rgb(90, 216, 166)", "rgb(93, 112, 146)", "rgb(246, 189, 22)", "rgb(232, 104, 74)", "rgb(109, 200, 236)", "rgb(146, 112, 202)", "rgb(255, 157, 77)", "rgb(38, 154, 153)", "rgb(227, 137, 163)", ]; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = `source: ${model.sourceName}
target: ${model.targetName}`; return text; }, }, ], }, defaultNode: { style: { opacity: 0.8, lineWidth: 1, stroke: "#999", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { opacity: 0.6, lineAppendWidth: 3, }, }, }); // 处理数据 function scaleNodeProp(nodes, propName, refPropName, dataRange, outRange) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; nodes.forEach(function (n) { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; }); } const origin = [width / 2, height / 2]; const radius = width < height ? width / 3 : height / 3; const { edges } = data; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; const n = nodes.length; const angleSep = (Math.PI * 2) / n; nodes.forEach(function (node, i) { const angle = i * angleSep; node.x = radius * Math.cos(angle) + origin[0]; node.y = radius * Math.sin(angle) + origin[1]; node.angle = angle; nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const id = clusterMap.get(node.cluster); if (node.style) { node.style.fill = colors[id % colors.length]; } else { node.style = { fill: colors[id % colors.length], }; } // label node.label = node.name; node.labelCfg = { position: "center", style: { rotate: angle, rotateCenter: "lefttop", textAlign: "start", }, }; }); edges.forEach((edge) => { edge.type = "quadratic"; const source = nodeMap.get(edge.source); const target = nodeMap.get(edge.target); edge.controlPoints = [ { x: origin[0], y: origin[1], }, ]; edge.color = source.style.fill; edge.sourceName = source.name; edge.targetName = target.name; }); // map the value to node size let maxValue = -9999; let minValue = 9999; nodes.forEach(function (k) { if (maxValue < k.value) maxValue = k.value; if (minValue > k.value) minValue = k.value; }); const sizeRange = [3, 30]; const sizeDataRange = [minValue, maxValue]; scaleNodeProp(nodes, "size", "value", sizeDataRange, sizeRange); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-arc-diagram/index.json ================================================ { "defaultTitle": "环形弧线图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-configuration-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-configuration-translate/index.axml ================================================ {{discription}} ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-configuration-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; /** * Circular布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, discription: "Circular layout with radius: take full use of the canvas, ordering: topology", }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); setInterval(function () { layoutConfigTranslation(); }, 11500); function layoutConfigTranslation() { setTimeout(function () { me.setData({ discription: "Circular layout, radius = 200, divisions = 5, ordering: degree", }); me.graph.updateLayout({ radius: 200, startAngle: Math.PI / 4, endAngle: Math.PI, divisions: 5, ordering: "degree", }); }, 1000); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 200, divisions = 3, ordering: degree", }); me.graph.updateLayout({ startAngle: Math.PI / 4, endAngle: Math.PI, divisions: 3, }); }, 2500); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 200, divisions = 8, ordering: degree", }); me.graph.updateLayout({ radius: 200, startAngle: 0, endAngle: Math.PI / 2, divisions: 8, }); }, 4000); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 10~300(spiral), endAngle: PI, divisions = 1, ordering: degree", }); me.graph.updateLayout({ radius: null, startRadius: 10, endRadius: 300, divisions: 1, startAngle: 0, endAngle: Math.PI, }); }, 5500); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 10~300(spiral),endAngle: 2 * PI, divisions= 1, ordering: degree", }); me.graph.updateLayout({ endAngle: 2 * Math.PI, }); }, 7000); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 200, ordering: degree", }); me.graph.updateLayout({ radius: 200, }); }, 8500); setTimeout(function () { me.setData({ discription: "Circular layout, radius = 200, ordering: topology", }); me.graph.updateLayout({ radius: 200, ordering: "topology", }); }, 10000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/circular-configuration-translate/index.json ================================================ { "defaultTitle": "参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/cluster-grid/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", cluster: "0", }, { id: "1", label: "1", cluster: "0", }, { id: "2", label: "2", cluster: "0", }, { id: "3", label: "3", cluster: "0", }, { id: "4", label: "4", cluster: "0", }, { id: "5", label: "5", cluster: "3", }, { id: "6", label: "6", cluster: "0", }, { id: "7", label: "7", cluster: "0", }, { id: "8", label: "8", cluster: "0", }, { id: "9", label: "9", cluster: "3", }, { id: "10", label: "10", cluster: "3", }, { id: "11", label: "11", cluster: "2", }, { id: "12", label: "12", cluster: "2", }, { id: "13", label: "13", cluster: "4", }, { id: "14", label: "14", cluster: "2", }, { id: "15", label: "15", cluster: "2", }, { id: "16", label: "16", cluster: "2", }, { id: "17", label: "17", cluster: "1", }, { id: "18", label: "18", cluster: "4", }, { id: "19", label: "19", cluster: "4", }, { id: "20", label: "20", cluster: "4", }, { id: "21", label: "21", cluster: "0", }, { id: "22", label: "22", cluster: "2", }, { id: "23", label: "23", cluster: "2", }, { id: "24", label: "24", cluster: "2", }, { id: "25", label: "25", cluster: "3", }, { id: "26", label: "26", cluster: "4", }, { id: "27", label: "27", cluster: "4", }, { id: "28", label: "28", cluster: "1", }, { id: "29", label: "29", cluster: "1", }, { id: "30", label: "30", cluster: "4", }, { id: "31", label: "31", cluster: "4", }, { id: "32", label: "32", cluster: "1", }, { id: "33", label: "33", cluster: "2", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach(function (node) { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) node.style = {}; node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); export default data; ================================================ FILE: packages/examples-alipay/pages/general-graph/cluster-grid/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/cluster-grid/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/cluster-grid/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import grid from "@antv/f6/dist/extends/layout/gridLayout"; /** * 指定排序方式的网格布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("grid", grid); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "grid", begin: [20, 20], width: width - 20, height: height - 20, sortBy: "cluster", }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/cluster-grid/index.json ================================================ { "defaultTitle": "指定排序方式的网格布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/custom-bi-graph/data.js ================================================ export default { nodes: [ { id: "0", label: "A", cluster: "part1", }, { id: "1", label: "B", cluster: "part1", }, { id: "2", label: "C", cluster: "part1", }, { id: "3", label: "D", cluster: "part1", }, { id: "4", label: "E", cluster: "part1", }, { id: "5", label: "F", cluster: "part1", }, { id: "6", label: "a", cluster: "part2", }, { id: "7", label: "b", cluster: "part2", }, { id: "8", label: "c", cluster: "part2", }, { id: "9", label: "d", cluster: "part2", }, ], edges: [ { source: "0", target: "6", }, { source: "0", target: "7", }, { source: "0", target: "9", }, { source: "1", target: "6", }, { source: "1", target: "9", }, { source: "1", target: "7", }, { source: "2", target: "8", }, { source: "2", target: "9", }, { source: "2", target: "6", }, { source: "3", target: "8", }, { source: "4", target: "6", }, { source: "4", target: "7", }, { source: "5", target: "9", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/custom-bi-graph/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/custom-bi-graph/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/custom-bi-graph/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * customBiGraph */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("bigraphLayout", { execute() { const self = this; const center = self.center || [0, 0]; const biSep = self.biSep || 100; const nodeSep = self.nodeSep || 20; const nodeSize = self.nodeSize || 20; const direction = self.direction || "horizontal"; let part1Pos = 0; let part2Pos = 0; if (direction === "horizontal") { part1Pos = center[0] - biSep / 2; part2Pos = center[0] + biSep / 2; } const { nodes, edges } = self; const part1Nodes = []; const part2Nodes = []; const part1NodeMap = new Map(); const part2NodeMap = new Map(); // separate the nodes and init the positions nodes.forEach(function (node, i) { if (node.cluster === "part1") { part1Nodes.push(node); part1NodeMap.set(node.id, i); } else { part2Nodes.push(node); part2NodeMap.set(node.id, i); } }); // order the part1 node part1Nodes.forEach(function (p1n) { let index = 0; let adjCount = 0; edges.forEach(function (edge) { const sourceId = edge.source; const targetId = edge.target; if (sourceId === p1n.id) { index += part2NodeMap.get(targetId); adjCount += 1; } else if (targetId === p1n.id) { index += part2NodeMap.get(sourceId); adjCount += 1; } }); index /= adjCount; p1n.index = index; }); part1Nodes.sort(function (a, b) { return a.index - b.index; }); part2Nodes.forEach(function (p2n) { let index = 0; let adjCount = 0; edges.forEach(function (edge) { const sourceId = edge.source; const targetId = edge.target; if (sourceId === p2n.id) { index += part1NodeMap.get(targetId); adjCount += 1; } else if (targetId === p2n.id) { index += part1NodeMap.get(sourceId); adjCount += 1; } }); index /= adjCount; p2n.index = index; }); part2Nodes.sort(function (a, b) { return a.index - b.index; }); // place the nodes const hLength = part1Nodes.length > part2Nodes.length ? part1Nodes.length : part2Nodes.length; const height = hLength * (nodeSep + nodeSize); let begin = center[1] - height / 2; if (direction === "vertical") { begin = center[0] - height / 2; } part1Nodes.forEach(function (p1n, i) { if (direction === "horizontal") { p1n.x = part1Pos; p1n.y = begin + i * (nodeSep + nodeSize); } else { p1n.x = begin + i * (nodeSep + nodeSize); p1n.y = part1Pos; } }); part2Nodes.forEach(function (p2n, i) { if (direction === "horizontal") { p2n.x = part2Pos; p2n.y = begin + i * (nodeSep + nodeSize); } else { p2n.x = begin + i * (nodeSep + nodeSize); p2n.y = part2Pos; } }); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "bigraphLayout", biSep: 300, nodeSep: 20, nodeSize: 20, }, animate: true, defaultNode: { size: 20, style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, color: "#e2e2e2", }, modes: { default: ["drag-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/custom-bi-graph/index.json ================================================ { "defaultTitle": "自定义二分图布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * 自左向右的Dagre */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", rankdir: "LR", align: "DL", nodesepFunc: () => 1, ranksepFunc: () => 1, }, defaultNode: { size: [30, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre/index.json ================================================ { "defaultTitle": "自左向右的流程图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-UL/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "1", target: "4", }, { source: "0", target: "3", }, { source: "3", target: "4", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "7", }, { source: "5", target: "8", }, { source: "8", target: "9", }, { source: "2", target: "9", }, { source: "3", target: "9", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-UL/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-UL/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-UL/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * 自左向右的Dagre上对齐 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", rankdir: "LR", align: "UL", controlPoints: true, nodesepFunc: () => 1, ranksepFunc: () => 1, }, defaultNode: { size: [30, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { type: "polyline", size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, radius: 20, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-UL/index.json ================================================ { "defaultTitle": "自左向右的流程图对齐", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-combo/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", comboId: "A", }, { id: "5", label: "5", comboId: "B", }, { id: "6", label: "6", comboId: "A", }, { id: "7", label: "7", comboId: "C", }, { id: "8", label: "8", comboId: "C", }, { id: "9", label: "9", comboId: "A", }, { id: "10", label: "10", comboId: "B", }, { id: "11", label: "11", comboId: "B", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "1", target: "4", }, { source: "0", target: "3", }, { source: "3", target: "4", }, { source: "2", target: "5", }, { source: "1", target: "6", }, { source: "1", target: "7", }, { source: "3", target: "8", }, { source: "3", target: "9", }, { source: "5", target: "10", }, { source: "5", target: "11", }, ], combos: [ { id: "A", label: "combo A", style: { fill: "#C4E3B2", stroke: "#C4E3B2", }, }, { id: "B", label: "combo B", style: { stroke: "#99C0ED", fill: "#99C0ED", }, }, { id: "C", label: "combo C", style: { stroke: "#eee", fill: "#eee", }, }, ], }; data.nodes.forEach((node) => { switch (node.ComboId) { case "A": node.style = { fill: "#C4E3B2", stroke: "#aaa", }; break; case "B": node.style = { fill: "#99C0ED", stroke: "#aaa", }; break; case "C": node.style = { fill: "#eee", stroke: "#aaa", }; break; default: node.style = { fill: "#FDE1CE", stroke: "#aaa", }; break; } }); export default data; ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-combo/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-combo/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-combo/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * dagreCombo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, sortByCombo: false, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, description: "Enable sortByCombo", }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, handleClickButton() { console.log("click", this.sortByCombo); this.sortByCombo = !this.sortByCombo; this.setData({ description: this.sortByCombo ? "Disable sortByCombo" : "Enable sortByCombo", }); const { sortByCombo } = this; this.graph.updateLayout({ sortByCombo, }); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, animate: true, groupByTypes: false, modes: { default: [ "drag-combo", "drag-node", "drag-canvas", { type: "collapse-expand-combo", relayout: false, }, ], }, layout: { type: "dagre", sortByCombo: false, ranksep: 10, nodesep: 10, }, defaultNode: { size: [60, 30], type: "rect", anchorPoints: [ [0.5, 0], [0.5, 1], ], }, defaultEdge: { type: "line", }, defaultCombo: { type: "rect", style: { fillOpacity: 0.1, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-combo/index.json ================================================ { "defaultTitle": "带有Combo的流程图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-configuration-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-configuration-translate/index.axml ================================================ {{description}} ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-configuration-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * Dagre布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, description: "", }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", nodeSize: [40, 20], nodesep: 1, ranksep: 1, }, animate: true, defaultNode: { size: [40, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); function layoutConfigTranslation() { setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 1, layout direction: Top->Bottom, alignment of nodes: DL", }); me.graph.updateLayout({ ranksep: 10, }); }, 1000); setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: DL", }); me.graph.updateLayout({ nodesep: 5, }); }, 2500); setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UL", }); me.graph.updateLayout({ align: "UL", }); }, 4000); setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UR", }); me.graph.updateLayout({ align: "UR", }); }, 5500); setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", }); me.graph.updateLayout({ rankdir: "LR", align: "DL", }); }, 7000); setTimeout(function () { me.setData({ description: "Dagre layout, rank seperation: 30, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", }); me.graph.updateLayout({ ranksep: 30, }); }, 8500); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/dagre-configuration-translate/index.json ================================================ { "defaultTitle": "布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/data-change/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const data2 = { nodes: [ { id: "b0", label: "0", }, { id: "b1", label: "1", }, { id: "b2", label: "2", }, { id: "b3", label: "3", }, { id: "b4", label: "4", }, { id: "b5", label: "5", }, ], edges: [ { id: "be1", source: "b0", target: "b1", }, { id: "be2", source: "b0", target: "b2", }, { id: "be3", source: "b0", target: "b3", }, { id: "be4", source: "b0", target: "b4", }, { id: "be5", source: "b0", target: "b5", }, ], }; export { data, data2 }; ================================================ FILE: packages/examples-alipay/pages/general-graph/data-change/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/data-change/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/data-change/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { data, data2 } from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * layoutTranslate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "force", }, // animate: true, defaultNode: { size: 20, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 切换数据 setTimeout(() => { this.graph.changeData(data2); }, 2500); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/data-change/index.json ================================================ { "defaultTitle": "数据动态切换", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/degree-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/degree-circular/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/degree-circular/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/degree-circular/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; /** * 按照节点度数排序的Circular */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", ordering: "degree", }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/degree-circular/index.json ================================================ { "defaultTitle": "按节点度数排序", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/division-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/division-circular/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/division-circular/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/division-circular/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; /** * 分割环形布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", divisions: 5, radius: 200, startAngle: Math.PI / 4, endAngle: Math.PI, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/division-circular/index.json ================================================ { "defaultTitle": "分割环形布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-bubbles/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", value: 10, cluster: "a", description: "this is node 0, \nand the value of it is 10", }, { id: "1", label: "1", value: 20, cluster: "b", description: "this is node 1, \nand the value of it is 20", }, { id: "2", label: "2", value: 5, cluster: "a", description: "this is node 2, \nand the value of it is 5", }, { id: "3", label: "3", value: 10, cluster: "a", description: "this is node 3, \nand the value of it is 10", }, { id: "4", label: "4", value: 12, cluster: "c", subCluster: "sb", description: "this is node 4, \nand the value of it is 12", }, { id: "5", label: "5", value: 18, cluster: "c", subCluster: "sa", description: "this is node 5, \nand the value of it is 18", }, { id: "6", label: "6", value: 3, cluster: "c", subCluster: "sa", description: "this is node 6, \nand the value of it is 3", }, { id: "7", label: "7", value: 7, cluster: "b", subCluster: "sa", description: "this is node 7, \nand the value of it is 7", }, { id: "8", label: "8", value: 21, cluster: "d", subCluster: "sb", description: "this is node 8, \nand the value of it is 21", }, { id: "9", label: "9", value: 9, cluster: "d", subCluster: "sb", description: "this is node 9, \nand the value of it is 9", }, ], edges: [], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-bubbles/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-bubbles/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/force-bubbles/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 力导向气泡图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", nodeStrength: 30, collideStrength: 0.7, alphaDecay: 0.01, preventOverlap: true, }, modes: { default: ["drag-node"], }, defaultNode: { size: [10, 10], }, }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true, }); } else { obj[key] = value; } return obj; } const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; nodes.forEach((node) => { nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) node.style = {}; node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; node.x = width / 2 + 200 * (Math.random() - 0.5); node.y = height / 2 + 200 * (Math.random() - 0.5); }); // map the value to node size let maxNodeValue = -9999; let minNodeValue = 9999; nodes.forEach(function (n) { if (maxNodeValue < n.value) maxNodeValue = n.value; if (minNodeValue > n.value) minNodeValue = n.value; }); const nodeSizeRange = [10, 30]; const nodeSizeDataRange = [minNodeValue, maxNodeValue]; scaleNodeProp(nodes, "size", "value", nodeSizeDataRange, nodeSizeRange); nodes.forEach(function (node) { node.oriSize = node.size; node.oriLabel = node.label; }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 监听 this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { refreshDragedNodePosition(e); }); this.graph.on("node:dragend", function (e) { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.on("node:click", function (e) { const node = e.item; const states = node.getStates(); let clicked = false; const model = node.getModel(); let size = 200; let labelText = `NODE: ${model.id}\n${model.description}`; states.forEach(function (state) { if (state === "click") { clicked = true; size = model.oriSize; labelText = model.oriLabel; } }); this.graph.setItemState(node, "click", !clicked); this.graph.updateItem(node, { size, label: labelText, }); this.graph.layout(); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); function scaleNodeProp( elements, propName, refPropName, dataRange, outRange, ) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; elements.forEach(function (n) { if (propName.split(".")[0] === "style") { if (n.style) { n.style[propName.split(".")[1]] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; } else { n.style = _defineProperty( {}, propName.split(".")[1], ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0], ); } } else { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; } }); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-bubbles/index.json ================================================ { "defaultTitle": "力导向气泡图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-constrained-in-rect/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-constrained-in-rect/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-constrained-in-rect/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/force-constrained-in-rect/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 约束在范围内布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); const { nodes } = data; // 包裹范围的参数 const constrainBox = { x: 60, y: 50, width: 500, height: 150 }; const onTick = () => { let minx = 99999999; let maxx = -99999999; let miny = 99999999; let maxy = -99999999; let maxsize = -9999999; nodes.forEach((node) => { if (minx > node.x) { minx = node.x; } if (maxx < node.x) { maxx = node.x; } if (miny > node.y) { miny = node.y; } if (maxy < node.y) { maxy = node.y; } if (maxsize < node.size) { maxsize = node.size; } }); const scalex = (constrainBox.width - maxsize) / (maxx - minx); const scaley = (constrainBox.height - maxsize) / (maxy - miny); nodes.forEach((node) => { node.x = (node.x - minx) * scalex + constrainBox.x; node.y = (node.y - miny) * scaley + constrainBox.y; }); }; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", onTick, }, defaultNode: { size: 15, }, }); this.graph.data({ nodes: data.nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-constrained-in-rect/index.json ================================================ { "defaultTitle": "约束在范围内布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-configuration-translate/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-configuration-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-configuration-translate/index.axml ================================================ {{desc}} ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-configuration-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 力导向布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, desc: "", }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "force", linkDistance: 50, center: [width / 2, height / 2], }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); const my = this; setInterval(() => { layoutConfigTranslation(); }, 5000); function layoutConfigTranslation() { setTimeout(() => { my.setData({ desc: "Force layout, linkDistance = 100, preventOverlap: true", }); my.graph.updateLayout({ linkDistance: 100, preventOverlap: true, nodeSize: 20, }); }, 2500); setTimeout(() => { my.setData({ desc: "Force layout, linkDistance = 50, preventOverlap: false", }); my.graph.updateLayout({ linkDistance: 50, preventOverlap: false, }); }, 5000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-configuration-translate/index.json ================================================ { "defaultTitle": "力导向布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-force-clustering/data.js ================================================ export default () => ({ nodes: [ { id: "4", sim_name: "AFG", name: "Afghanistan", region: "South Asia", resource: "Cereals", year: 2012, value: 57.847, weight: 73.355, }, { id: "8", sim_name: "ALB", name: "Albania", region: "Europe", resource: "Cereals", year: 2012, value: 556.3332546, weight: 1214.363, }, { id: "10", sim_name: "ATA", name: "Antarctica", region: "Other", resource: "Cereals", year: 2012, value: 2829.367, weight: 11113.564, }, { id: "12", sim_name: "DZA", name: "Algeria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 105217.8151, weight: 146857.7593, }, { id: "16", sim_name: "ASM", name: "American Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 97.623, weight: 982.085, }, { id: "20", sim_name: "AND", name: "Andorra", region: "Europe", resource: "Cereals", year: 2012, value: 787.166, weight: 1240.056, }, { id: "24", sim_name: "AGO", name: "Angola", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0.366, weight: 0.211, }, { id: "28", sim_name: "ATG", name: "Antigua and Barbuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 30831.87949, weight: 72065.168, }, { id: "31", sim_name: "AZE", name: "Azerbaijan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 46917.41553, weight: 45114.87169, }, { id: "32", sim_name: "ARG", name: "Argentina", region: "South America", resource: "Cereals", year: 2012, value: 11347322.78, weight: 38200326.47, }, { id: "36", sim_name: "AUS", name: "Australia", region: "Oceania", resource: "Cereals", year: 2012, value: 10983308.38, weight: 32933532.17, }, { id: "40", sim_name: "AUT", name: "Austria", region: "Europe", resource: "Cereals", year: 2012, value: 714932.2545, weight: 1683224.24, }, { id: "44", sim_name: "BHS", name: "Bahamas", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 427.395, weight: 969.33, }, { id: "48", sim_name: "BHR", name: "Bahrain", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 22229.96717, weight: 53856.78001, }, { id: "50", sim_name: "BGD", name: "Bangladesh", region: "South Asia", resource: "Cereals", year: 2012, value: 22330.75971, weight: 86944.1853, }, { id: "51", sim_name: "ARM", name: "Armenia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 206.6709842, weight: 223.5014745, }, { id: "52", sim_name: "BRB", name: "Barbados", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4790.290139, weight: 7428.399008, }, { id: "56", sim_name: "BEL", name: "Belgium", region: "Europe", resource: "Cereals", year: 2012, value: 1896499.584, weight: 3625004.302, }, { id: "60", sim_name: "BMU", name: "Bermuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 100.264, weight: 250, }, { id: "64", sim_name: "BTN", name: "Bhutan", region: "South Asia", resource: "Cereals", year: 2012, value: 1100.663269, weight: 3990.493739, }, { id: "68", sim_name: "BOL", name: "Bolivia", region: "South America", resource: "Cereals", year: 2012, value: 107152.4673, weight: 117438.7654, }, { id: "70", sim_name: "BIH", name: "Bosnia Herzegovina", region: "Europe", resource: "Cereals", year: 2012, value: 10652.90002, weight: 25582.17925, }, { id: "72", sim_name: "BWA", name: "Botswana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 7635.744989, weight: 24790.60442, }, { id: "76", sim_name: "BRA", name: "Brazil", region: "South America", resource: "Cereals", year: 2012, value: 7114534.381, weight: 22441162.41, }, { id: "84", sim_name: "BLZ", name: "Belize", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 28037.35873, weight: 77441.91463, }, { id: "90", sim_name: "SLB", name: "Solomon Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "92", sim_name: "VGB", name: "British Virgin Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 15328.77, weight: 51127.16, }, { id: "96", sim_name: "BRN", name: "Brunei Darussalam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 46.438, weight: 35.416, }, { id: "100", sim_name: "BGR", name: "Bulgaria", region: "Europe", resource: "Cereals", year: 2012, value: 1258892.481, weight: 4147538.49, }, { id: "104", sim_name: "MMR", name: "Myanmar", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 599204.3703, weight: 1218435.323, }, { id: "108", sim_name: "BDI", name: "Burundi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 523.644, weight: 2841.873, }, { id: "112", sim_name: "BLR", name: "Belarus", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 52538.61827, weight: 137692.36, }, { id: "116", sim_name: "KHM", name: "Cambodia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 167651.1526, weight: 265914.0128, }, { id: "120", sim_name: "CMR", name: "Cameroon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1263.861619, weight: 2235.140891, }, { id: "124", sim_name: "CAN", name: "Canada", region: "North America", resource: "Cereals", year: 2012, value: 8982050.268, weight: 24667183.74, }, { id: "132", sim_name: "CPV", name: "Cabo Verde", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2344.96, weight: 4095.993, }, { id: "140", sim_name: "CAF", name: "Central African Rep.", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "144", sim_name: "LKA", name: "Sri Lanka", region: "South Asia", resource: "Cereals", year: 2012, value: 181369.2559, weight: 489552.3718, }, { id: "152", sim_name: "CHL", name: "Chile", region: "South America", resource: "Cereals", year: 2012, value: 412283.3672, weight: 270900.3596, }, { id: "156", sim_name: "CHN", name: "China", region: "East Asia", resource: "Cereals", year: 2012, value: 1490564.833, weight: 2304819.508, }, { id: "170", sim_name: "COL", name: "Colombia", region: "South America", resource: "Cereals", year: 2012, value: 46615.80539, weight: 52684.28073, }, { id: "188", sim_name: "CRI", name: "Costa Rica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 17710.68444, weight: 28937.25094, }, { id: "191", sim_name: "HRV", name: "Croatia", region: "Europe", resource: "Cereals", year: 2012, value: 192245.2115, weight: 580710.257, }, { id: "192", sim_name: "CUB", name: "Cuba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 793.321, weight: 1620.825, }, { id: "196", sim_name: "CYP", name: "Cyprus", region: "Europe", resource: "Cereals", year: 2012, value: 47981.18874, weight: 126474.07, }, { id: "203", sim_name: "CZE", name: "Czech Rep.", region: "Europe", resource: "Cereals", year: 2012, value: 922618.0722, weight: 3054247.331, }, { id: "204", sim_name: "BEN", name: "Benin", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12987.78421, weight: 55672.72433, }, { id: "208", sim_name: "DNK", name: "Denmark", region: "Europe", resource: "Cereals", year: 2012, value: 701199.8922, weight: 1992757.212, }, { id: "212", sim_name: "DMA", name: "Dominica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1.351, weight: 0.692, }, { id: "214", sim_name: "DOM", name: "Dominican Rep.", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 105510.1813, weight: 210275.29, }, { id: "218", sim_name: "ECU", name: "Ecuador", region: "South America", resource: "Cereals", year: 2012, value: 30957.4275, weight: 49399.64362, }, { id: "222", sim_name: "SLV", name: "El Salvador", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 77105.01061, weight: 129245.0661, }, { id: "231", sim_name: "ETH", name: "Ethiopia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44330.31405, weight: 29794.00055, }, { id: "233", sim_name: "EST", name: "Estonia", region: "Europe", resource: "Cereals", year: 2012, value: 150772.6292, weight: 458854.905, }, { id: "234", sim_name: "FRO", name: "Faeroe Isds", region: "Europe", resource: "Cereals", year: 2012, value: 18.298, weight: 44.726, }, { id: "242", sim_name: "FJI", name: "Fiji", region: "Oceania", resource: "Cereals", year: 2012, value: 15966.92145, weight: 24119.72685, }, { id: "246", sim_name: "FIN", name: "Finland", region: "Europe", resource: "Cereals", year: 2012, value: 266364.4975, weight: 753973.3063, }, { id: "251", sim_name: "FRA", name: "France", region: "Europe", resource: "Cereals", year: 2012, value: 11027310.62, weight: 31368277.85, }, { id: "262", sim_name: "DJI", name: "Djibouti", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1936.537, weight: 2932.238, }, { id: "266", sim_name: "GAB", name: "Gabon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2624.516, weight: 10407.907, }, { id: "268", sim_name: "GEO", name: "Georgia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 48754.57507, weight: 158741.3575, }, { id: "270", sim_name: "GMB", name: "Gambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 38.193, weight: 24.45, }, { id: "275", sim_name: "PSE", name: "State of Palestine", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16057.14949, weight: 13745.84557, }, { id: "276", sim_name: "DEU", name: "Germany", region: "Europe", resource: "Cereals", year: 2012, value: 4635549.458, weight: 12647922.94, }, { id: "288", sim_name: "GHA", name: "Ghana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 8210.66114, weight: 28560.44817, }, { id: "292", sim_name: "GIB", name: "Gibraltar", region: "Europe", resource: "Cereals", year: 2012, value: 728.465, weight: 809.623, }, { id: "296", sim_name: "KIR", name: "Kiribati", region: "Oceania", resource: "Cereals", year: 2012, value: 23.052, weight: 18.562, }, { id: "300", sim_name: "GRC", name: "Greece", region: "Europe", resource: "Cereals", year: 2012, value: 263693.016, weight: 644312.8604, }, { id: "304", sim_name: "GRL", name: "Greenland", region: "North America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "308", sim_name: "GRD", name: "Grenada", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4657.914, weight: 9335.526, }, { id: "316", sim_name: "GUM", name: "Guam", region: "Oceania", resource: "Cereals", year: 2012, value: 527.033, weight: 982.642, }, { id: "320", sim_name: "GTM", name: "Guatemala", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 20968.96314, weight: 22893.23335, }, { id: "324", sim_name: "GIN", name: "Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2636.849, weight: 7422.12, }, { id: "328", sim_name: "GUY", name: "Guyana", region: "South America", resource: "Cereals", year: 2012, value: 334196.3131, weight: 520437.64, }, { id: "332", sim_name: "HTI", name: "Haiti", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5.134, weight: 16.128, }, { id: "340", sim_name: "HND", name: "Honduras", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 22936.79385, weight: 43129.60369, }, { id: "348", sim_name: "HUN", name: "Hungary", region: "Europe", resource: "Cereals", year: 2012, value: 2015665.793, weight: 6379394.988, }, { id: "352", sim_name: "ISL", name: "Iceland", region: "Europe", resource: "Cereals", year: 2012, value: 891.513, weight: 2118.828, }, { id: "360", sim_name: "IDN", name: "Indonesia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 175738.8156, weight: 544860.3789, }, { id: "364", sim_name: "IRN", name: "Iran", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 7978.124, weight: 20473.686, }, { id: "368", sim_name: "IRQ", name: "Iraq", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 253.845, weight: 246.151, }, { id: "372", sim_name: "IRL", name: "Ireland", region: "Europe", resource: "Cereals", year: 2012, value: 166058.1767, weight: 476236.2048, }, { id: "376", sim_name: "ISR", name: "Israel", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 197912.4336, weight: 431193.8203, }, { id: "381", sim_name: "ITA", name: "Italy", region: "Europe", resource: "Cereals", year: 2012, value: 1288077.184, weight: 1887032.489, }, { id: "384", sim_name: "CIV", name: "Cote d'Ivoire", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 77750.0467, weight: 254222.8878, }, { id: "388", sim_name: "JAM", name: "Jamaica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 6751.46461, weight: 12484.22296, }, { id: "392", sim_name: "JPN", name: "Japan", region: "East Asia", resource: "Cereals", year: 2012, value: 189561.3237, weight: 359553.4615, }, { id: "398", sim_name: "KAZ", name: "Kazakhstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2535465.094, weight: 10562777.14, }, { id: "400", sim_name: "JOR", name: "Jordan", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 2022.699859, weight: 1810.995193, }, { id: "404", sim_name: "KEN", name: "Kenya", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31813.863, weight: 84144.582, }, { id: "414", sim_name: "KWT", name: "Kuwait", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 28509.72, weight: 41425.612, }, { id: "417", sim_name: "KGZ", name: "Kyrgyzstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 344.2343218, weight: 452.0188439, }, { id: "418", sim_name: "LAO", name: "Lao PDR", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 58500.6357, weight: 212304.4463, }, { id: "422", sim_name: "LBN", name: "Lebanon", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16263.18003, weight: 38974.77174, }, { id: "426", sim_name: "LSO", name: "Lesotho", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 19865.12276, weight: 54350.43934, }, { id: "428", sim_name: "LVA", name: "Latvia", region: "Europe", resource: "Cereals", year: 2012, value: 516410.4254, weight: 1643243.015, }, { id: "430", sim_name: "LBR", name: "Liberia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12.35, weight: 53.471, }, { id: "434", sim_name: "LBY", name: "Libya", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 634.239, weight: 2102.142, }, { id: "440", sim_name: "LTU", name: "Lithuania", region: "Europe", resource: "Cereals", year: 2012, value: 871039.5602, weight: 2446114.811, }, { id: "442", sim_name: "LUX", name: "Luxembourg", region: "Europe", resource: "Cereals", year: 2012, value: 68969.99793, weight: 178380.981, }, { id: "450", sim_name: "MDG", name: "Madagascar", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 950.8530206, weight: 3780.89311, }, { id: "454", sim_name: "MWI", name: "Malawi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 11553.98159, weight: 41269.33681, }, { id: "458", sim_name: "MYS", name: "Malaysia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 99255.71471, weight: 142965.3262, }, { id: "462", sim_name: "MDV", name: "Maldives", region: "South Asia", resource: "Cereals", year: 2012, value: 12.448, weight: 14.6, }, { id: "466", sim_name: "MLI", name: "Mali", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3143.270747, weight: 11121.96188, }, { id: "470", sim_name: "MLT", name: "Malta", region: "Europe", resource: "Cereals", year: 2012, value: 35991.55686, weight: 94799.54871, }, { id: "478", sim_name: "MRT", name: "Mauritania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 292.538, weight: 627.637, }, { id: "480", sim_name: "MUS", name: "Mauritius", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 17602.67917, weight: 36755.35938, }, { id: "484", sim_name: "MEX", name: "Mexico", region: "North America", resource: "Cereals", year: 2012, value: 571803.2432, weight: 1234860.795, }, { id: "496", sim_name: "MNG", name: "Mongolia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1328.368, weight: 10672.694, }, { id: "498", sim_name: "MDA", name: "Moldova", region: "Europe", resource: "Cereals", year: 2012, value: 59072.0085, weight: 188178.1824, }, { id: "499", sim_name: "MNE", name: "Montenegro", region: "Europe", resource: "Cereals", year: 2012, value: 2444.455322, weight: 6125.451, }, { id: "504", sim_name: "MAR", name: "Morocco", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 86884.06321, weight: 161631.8094, }, { id: "508", sim_name: "MOZ", name: "Mozambique", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 68388.81722, weight: 146520.864, }, { id: "512", sim_name: "OMN", name: "Oman", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 55530.66234, weight: 88434.23327, }, { id: "516", sim_name: "NAM", name: "Namibia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 5168.27047, weight: 7877.053106, }, { id: "524", sim_name: "NPL", name: "Nepal", region: "South Asia", resource: "Cereals", year: 2012, value: 4032.41279, weight: 17770.75769, }, { id: "528", sim_name: "NLD", name: "Netherlands", region: "Europe", resource: "Cereals", year: 2012, value: 1424347.018, weight: 3125730.04, }, { id: "531", sim_name: "CUW", name: "Curacao", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 535.691, weight: 2358.613, }, { id: "533", sim_name: "ABW", name: "Aruba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 178879.593, weight: 560431.967, }, { id: "540", sim_name: "NCL", name: "New Caledonia", region: "Oceania", resource: "Cereals", year: 2012, value: 205.777282, weight: 363.439991, }, { id: "548", sim_name: "VUT", name: "Vanuatu", region: "Oceania", resource: "Cereals", year: 2012, value: 160.463, weight: 440.332, }, { id: "554", sim_name: "NZL", name: "New Zealand", region: "Oceania", resource: "Cereals", year: 2012, value: 33994.85867, weight: 35177.57975, }, { id: "558", sim_name: "NIC", name: "Nicaragua", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 41294.65615, weight: 85186.87824, }, { id: "562", sim_name: "NER", name: "Niger", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31152.35763, weight: 44518.07202, }, { id: "566", sim_name: "NGA", name: "Nigeria", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 323839.5301, weight: 192057.843, }, { id: "579", sim_name: "NOR", name: "Norway", region: "Europe", resource: "Cereals", year: 2012, value: 2382.344541, weight: 2488.51136, }, { id: "580", sim_name: "MNP", name: "N. Mariana Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 1.144, weight: 1.864, }, { id: "581", sim_name: "UMI", name: "United States Minor Outlying Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 23.008, weight: 21, }, { id: "585", sim_name: "PLW", name: "Palau", region: "Oceania", resource: "Cereals", year: 2012, value: 2.151, weight: 0.22, }, { id: "586", sim_name: "PAK", name: "Pakistan", region: "South Asia", resource: "Cereals", year: 2012, value: 2412673.261, weight: 4864111.072, }, { id: "591", sim_name: "PAN", name: "Panama", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 10056.54107, weight: 26993.1125, }, { id: "598", sim_name: "PNG", name: "Papua New Guinea", region: "Oceania", resource: "Cereals", year: 2012, value: 319.374, weight: 2210.48, }, { id: "600", sim_name: "PRY", name: "Paraguay", region: "South America", resource: "Cereals", year: 2012, value: 1009228.641, weight: 3862696.891, }, { id: "604", sim_name: "PER", name: "Peru", region: "South America", resource: "Cereals", year: 2012, value: 91326.10676, weight: 128637.0767, }, { id: "608", sim_name: "PHL", name: "Philippines", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 12041.64316, weight: 16205.94695, }, { id: "616", sim_name: "POL", name: "Poland", region: "Europe", resource: "Cereals", year: 2012, value: 1028089.751, weight: 3186360.963, }, { id: "620", sim_name: "PRT", name: "Portugal", region: "Europe", resource: "Cereals", year: 2012, value: 92543.15766, weight: 192795.3179, }, { id: "624", sim_name: "GNB", name: "Guinea-Bissau", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37.268, weight: 135, }, { id: "626", sim_name: "TLS", name: "Timor-Leste", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 18.551, weight: 10.883, }, { id: "634", sim_name: "QAT", name: "Qatar", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 6936.324, weight: 11122.252, }, { id: "642", sim_name: "ROU", name: "Romania", region: "Europe", resource: "Cereals", year: 2012, value: 1778677.092, weight: 5301402.18, }, { id: "643", sim_name: "RUS", name: "Russian Federation", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 7440900.086, weight: 23852343.49, }, { id: "646", sim_name: "RWA", name: "Rwanda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37520.31393, weight: 73367.60768, }, { id: "659", sim_name: "KNA", name: "Saint Kitts and Nevis", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0.062, weight: 0.009, }, { id: "662", sim_name: "LCA", name: "Saint Lucia", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "670", sim_name: "VCT", name: "Saint Vincent and the Grenadines", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 16002.19104, weight: 17977.52343, }, { id: "674", sim_name: "SMR", name: "San Marino", region: "Europe", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "682", sim_name: "SAU", name: "Saudi Arabia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 92568.76043, weight: 56036.2484, }, { id: "686", sim_name: "SEN", name: "Senegal", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44740.28095, weight: 98109.85876, }, { id: "688", sim_name: "SRB", name: "Serbia", region: "Europe", resource: "Cereals", year: 2012, value: 907006.831, weight: 3003936.426, }, { id: "690", sim_name: "SYC", name: "Seychelles", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 387.548, weight: 246.84, }, { id: "694", sim_name: "SLE", name: "Sierra Leone", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 147.544, weight: 705.466, }, { id: "699", sim_name: "IND", name: "India", region: "South Asia", resource: "Cereals", year: 2012, value: 9062980.928, weight: 19031680.14, }, { id: "702", sim_name: "SGP", name: "Singapore", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 193120.3466, weight: 470488.3668, }, { id: "703", sim_name: "SVK", name: "Slovakia", region: "Europe", resource: "Cereals", year: 2012, value: 580789.4685, weight: 1589777.797, }, { id: "704", sim_name: "VNM", name: "Vietnam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 3558044.517, weight: 7381230.275, }, { id: "705", sim_name: "SVN", name: "Slovenia", region: "Europe", resource: "Cereals", year: 2012, value: 75282.28683, weight: 227283.1873, }, { id: "706", sim_name: "SOM", name: "Somalia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 240.399, weight: 1055, }, { id: "710", sim_name: "ZAF", name: "South Africa", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 938907.5758, weight: 2190384.881, }, { id: "716", sim_name: "ZWE", name: "Zimbabwe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6067.581387, weight: 21394.92603, }, { id: "724", sim_name: "ESP", name: "Spain", region: "Europe", resource: "Cereals", year: 2012, value: 906018.1944, weight: 1602797.031, }, { id: "729", sim_name: "SDN", name: "Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 18327.14063, weight: 66310.50556, }, { id: "740", sim_name: "SUR", name: "Suriname", region: "South America", resource: "Cereals", year: 2012, value: 73211.6794, weight: 83933.84802, }, { id: "748", sim_name: "SWZ", name: "Swaziland", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6674.46, weight: 16386.136, }, { id: "752", sim_name: "SWE", name: "Sweden", region: "Europe", resource: "Cereals", year: 2012, value: 439154.313, weight: 1207272.863, }, { id: "757", sim_name: "CHE", name: "Switzerland", region: "Europe", resource: "Cereals", year: 2012, value: 492516.8323, weight: 1581172.074, }, { id: "760", sim_name: "SYR", name: "Syria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 4169.742, weight: 7890.447, }, { id: "762", sim_name: "TJK", name: "Tajikistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 300.162, weight: 712.396, }, { id: "764", sim_name: "THA", name: "Thailand", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 5003324.321, weight: 6926962.31, }, { id: "768", sim_name: "TGO", name: "Togo", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 16809.12488, weight: 43975.34784, }, { id: "772", sim_name: "TKL", name: "Tokelau", region: "Oceania", resource: "Cereals", year: 2012, value: 1012.213, weight: 1926.401, }, { id: "776", sim_name: "TON", name: "Tonga", region: "Oceania", resource: "Cereals", year: 2012, value: 0.18, weight: 0.011, }, { id: "780", sim_name: "TTO", name: "Trinidad and Tobago", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5731.199288, weight: 9463.821332, }, { id: "784", sim_name: "ARE", name: "United Arab Emirates", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 442646.1236, weight: 684603.6345, }, { id: "788", sim_name: "TUN", name: "Tunisia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 202627.2087, weight: 121296.0689, }, { id: "792", sim_name: "TUR", name: "Turkey", region: "Europe", resource: "Cereals", year: 2012, value: 1205009.52, weight: 2692733.392, }, { id: "795", sim_name: "TKM", name: "Turkmenistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1020.566, weight: 3442.938, }, { id: "796", sim_name: "TCA", name: "Turks and Caicos Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1029.474, weight: 2224.885, }, { id: "800", sim_name: "UGA", name: "Uganda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 153220.9856, weight: 467968.0664, }, { id: "804", sim_name: "UKR", name: "Ukraine", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 8444175.988, weight: 29508635.03, }, { id: "818", sim_name: "EGY", name: "Egypt", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 178849.3005, weight: 310332.3386, }, { id: "826", sim_name: "GBR", name: "United Kingdom", region: "Europe", resource: "Cereals", year: 2012, value: 1224264.681, weight: 3079070.328, }, { id: "834", sim_name: "TZA", name: "Tanzania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 152688.2977, weight: 493774.3125, }, { id: "838", sim_name: "", name: "Free Zones", region: "Other", resource: "Cereals", year: 2012, value: 1488.719, weight: 4904.648, }, { id: "842", sim_name: "USA", name: "United States", region: "North America", resource: "Cereals", year: 2012, value: 23694720.38, weight: 66623810.06, }, { id: "854", sim_name: "BFA", name: "Burkina Faso", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3861.072093, weight: 17132.42303, }, { id: "858", sim_name: "URY", name: "Uruguay", region: "South America", resource: "Cereals", year: 2012, value: 1550881.026, weight: 4155101.445, }, { id: "860", sim_name: "UZB", name: "Uzbekistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2094.579, weight: 7229.088, }, { id: "862", sim_name: "VEN", name: "Venezuela", region: "South America", resource: "Cereals", year: 2012, value: 73.53, weight: 91.675, }, { id: "882", sim_name: "WSM", name: "Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 1.603, weight: 6.415, }, { id: "887", sim_name: "YEM", name: "Yemen", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 48184.79726, weight: 245917.1867, }, { id: "894", sim_name: "ZMB", name: "Zambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 470664.7641, weight: 863829.2506, }, { id: "86", sim_name: "IOT", name: "British Indian Ocean Territory", region: "Oceania", resource: "Cereals", year: 2013, value: 36.802, weight: 21.33, }, { id: "136", sim_name: "CYM", name: "Cayman Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "148", sim_name: "TCD", name: "Chad", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 24.335, weight: 103.232, }, { id: "166", sim_name: "CCK", name: "Cocos Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 2.417, weight: 2, }, { id: "174", sim_name: "COM", name: "Comoros", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 19, weight: 21, }, { id: "226", sim_name: "GNQ", name: "Equatorial Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "232", sim_name: "ERI", name: "Eritrea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "238", sim_name: "FLK", name: "Falkland Isds (Malvinas)", region: "South America", resource: "Cereals", year: 2013, value: 177.295, weight: 47.1, }, { id: "258", sim_name: "PYF", name: "French Polynesia", region: "Oceania", resource: "Cereals", year: 2013, value: 1.65, weight: 0.6, }, { id: "534", sim_name: "SXM", name: "Sint Maarten (Dutch part)", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "584", sim_name: "MHL", name: "Marshall Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 47.581, weight: 26.942, }, { id: "612", sim_name: "PCN", name: "Pitcairn", region: "Oceania", resource: "Cereals", year: 2013, value: 95.892, weight: 265, }, { id: "728", sim_name: "SSD", name: "South Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "798", sim_name: "TUV", name: "Tuvalu", region: "Oceania", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "184", sim_name: "COK", name: "Cook Isds", region: "Oceania", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "654", sim_name: "SHN", name: "Saint Helena", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "660", sim_name: "AIA", name: "Anguilla", region: "Caribbean and Central America", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "678", sim_name: "STP", name: "Sao Tome and Principe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 198.633, weight: 350, }, { id: "837", sim_name: "", name: "Bunkers", region: "Other", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "732", sim_name: "ESH", name: "Western Sahara", region: "Middle East and North Africa", resource: "Cereals", year: 2015, value: 0, weight: 0, }, { id: "666", sim_name: "SPM", name: "Saint Pierre and Miquelon", region: "North America", resource: "Cereals", year: 2016, value: 0, weight: 0, }, { id: "162", sim_name: "CXR", name: "Christmas Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 131.818, weight: 99.95, }, { id: "336", sim_name: "VAT", name: "Holy See", region: "Europe", resource: "Cereals", year: 2012, value: 24.492, weight: 42.805, }, { id: "520", sim_name: "NRU", name: "Nauru", region: "Oceania", resource: "Cereals", year: 2012, value: 496.386, weight: 457.721, }, { id: "535", sim_name: "BES", name: "Bonaire", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 326.45, weight: 551.554, }, ], edges: [ { eid: "e16", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Maize", year: "2015", value: "9.049", weight: "11.52", embodiedLand: "4.765", embodiedWater: "348.756", }, { eid: "e17", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "23.306", weight: "64.74", embodiedLand: "37.716", embodiedWater: "726.512", }, { eid: "e18", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "94.052", weight: "230.588", embodiedLand: "141.564", embodiedWater: "1851.16", }, { eid: "e19", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "13.068", weight: "65.34", embodiedLand: "", embodiedWater: "", }, { eid: "e20", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Sorghum", year: "2016", value: "34.399", weight: "171.996", embodiedLand: "", embodiedWater: "", }, { eid: "e21", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.027", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e22", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.812", weight: "4.061", embodiedLand: "", embodiedWater: "", }, { eid: "e43", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "0.01", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e44", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e45", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "1.875", weight: "1.352", embodiedLand: "", embodiedWater: "", }, { eid: "e48", source: "10", sourceSimName: "ATA", sourceRegion: "Antarctica", sourceName: "Other", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.837", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e85", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "0.886", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e86", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "23.9136184", weight: "40.2929249", embodiedLand: "", embodiedWater: "", }, { eid: "e88", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e89", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.9393726", weight: "1.75517982", embodiedLand: "0.38365313", embodiedWater: "17.7067202", }, { eid: "e90", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e91", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.005", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e92", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.249", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e93", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.19", weight: "0.175", embodiedLand: "", embodiedWater: "", }, { eid: "e103", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e104", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e105", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e115", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e116", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "128.652", weight: "96", embodiedLand: "", embodiedWater: "", }, { eid: "e117", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "5.117", weight: "26.7", embodiedLand: "", embodiedWater: "", }, { eid: "e118", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e119", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "798.871", weight: "4322.88", embodiedLand: "", embodiedWater: "", }, { eid: "e128", source: "24", sourceSimName: "AGO", sourceRegion: "Angola", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.401", weight: "0.44", embodiedLand: "", embodiedWater: "", }, { eid: "e155", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "20.91", weight: "1.04", embodiedLand: "", embodiedWater: "", }, { eid: "e156", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "177.885", weight: "967.513", embodiedLand: "", embodiedWater: "", }, { eid: "e157", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e158", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "51.175", weight: "76.8", embodiedLand: "", embodiedWater: "", }, { eid: "e159", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.005", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e160", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "2456.668", weight: "2481.6", embodiedLand: "", embodiedWater: "", }, { eid: "e182", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.356", weight: "27.2", embodiedLand: "13.377", embodiedWater: "156.237", }, { eid: "e183", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1.344", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e185", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "108.397", weight: "40", embodiedLand: "", embodiedWater: "", }, { eid: "e186", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Buckwheat", year: "2016", value: "1.814", weight: "2.99", embodiedLand: "", embodiedWater: "", }, { eid: "e187", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Buckwheat", year: "2016", value: "0.044", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e188", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "5.8", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e351", source: "32", sourceSimName: "ARG", sourceRegion: "Argentina", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.29", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e494", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "25.78", weight: "206.12", embodiedLand: "", embodiedWater: "", }, { eid: "e495", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "15.036", weight: "18.18", embodiedLand: "", embodiedWater: "", }, { eid: "e496", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "43.503", weight: "101.04", embodiedLand: "41.936", embodiedWater: "35.869", }, { eid: "e497", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "270", targetSimName: "GMB", targetName: "Gambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.141", weight: "0.42", embodiedLand: "", embodiedWater: "", }, { eid: "e498", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.161", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e499", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.004", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e615", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "3.335", weight: "1.058", embodiedLand: "", embodiedWater: "", }, { eid: "e616", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.017", weight: "0.006", embodiedLand: "0.001", embodiedWater: "0.109", }, { eid: "e617", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.018", weight: "0.099", embodiedLand: "", embodiedWater: "0.043", }, { eid: "e618", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.37", weight: "0.2", embodiedLand: "0.006", embodiedWater: "", }, { eid: "e619", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "147.228", weight: "490.76", embodiedLand: "", embodiedWater: "", }, { eid: "e620", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.761", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e621", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "2.19", weight: "1.625", embodiedLand: "", embodiedWater: "", }, { eid: "e622", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "0.1", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e635", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e636", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "55.7439049", weight: "55.492", embodiedLand: "", embodiedWater: "", }, { eid: "e637", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e638", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e694", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e696", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e697", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.929", weight: "7.4", embodiedLand: "2.029", embodiedWater: "95.282", }, { eid: "e698", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "4.248", weight: "1.862", embodiedLand: "0.037", embodiedWater: "18.661", }, { eid: "e699", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e700", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "136", targetSimName: "CYM", targetName: "Cayman Isds", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e701", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.067", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e702", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "124.768", weight: "92.25", embodiedLand: "", embodiedWater: "", }, { eid: "e754", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.004", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e755", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "2.969", weight: "1.85", embodiedLand: "", embodiedWater: "", }, { eid: "e756", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.12", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e757", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.138", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e758", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.494", weight: "0.915", embodiedLand: "", embodiedWater: "", }, { eid: "e776", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e777", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "18.47", weight: "30.8", embodiedLand: "", embodiedWater: "", }, { eid: "e778", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "795", targetSimName: "TKM", targetName: "Turkmenistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "8.71", weight: "1.675", embodiedLand: "", embodiedWater: "", }, { eid: "e798", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e799", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e800", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e801", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e802", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e803", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.199", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e804", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.002", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e805", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.01", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e990", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "1.472", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e992", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.178", weight: "0.21", embodiedLand: "", embodiedWater: "", }, { eid: "e993", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "626", targetSimName: "TLS", targetName: "Timor-Leste", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "146.32", weight: "357", embodiedLand: "", embodiedWater: "", }, { eid: "e998", source: "60", sourceSimName: "BMU", sourceRegion: "Bermuda", sourceName: "Caribbean and Central America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "14.135", weight: "42", embodiedLand: "", embodiedWater: "43.89", }, { eid: "e999", source: "60", sourceSimName: "BMU", sourceRegion: "Bermuda", sourceName: "Caribbean and Central America", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "78.825", weight: "212", embodiedLand: "", embodiedWater: "", }, { eid: "e1008", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.302", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e1009", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "16.708", weight: "25.193", embodiedLand: "8.687", embodiedWater: "31.29", }, { eid: "e1010", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.024", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1095", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "0.5", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e1097", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.14", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e1098", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.007", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e1099", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.249", weight: "0.532", embodiedLand: "", embodiedWater: "", }, { eid: "e1100", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "40.776", weight: "17.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1101", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "37.83", weight: "12", embodiedLand: "", embodiedWater: "", }, { eid: "e1102", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Maize", year: "2016", value: "376.317", weight: "60.619", embodiedLand: "", embodiedWater: "", }, { eid: "e1103", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "20.19096077", weight: "5", embodiedLand: "", embodiedWater: "", }, { eid: "e1104", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.406", weight: "0.043", embodiedLand: "", embodiedWater: "", }, { eid: "e1105", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "12.287", weight: "2.911", embodiedLand: "", embodiedWater: "", }, { eid: "e1106", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "642", targetSimName: "ROU", targetName: "Romania", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "30.2", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e1107", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "20.4", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e1108", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Oats", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1109", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.683", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e1141", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.132", weight: "0.13", embodiedLand: "0.028", embodiedWater: "0.087", }, { eid: "e1142", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.356", weight: "0.38", embodiedLand: "0.09", embodiedWater: "0.274", }, { eid: "e1143", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "111.882952", weight: "50.4723321", embodiedLand: "14.3646986", embodiedWater: "12.7187331", }, { eid: "e1144", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.027", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1145", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.008", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e1146", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1147", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.072", weight: "0.501", embodiedLand: "", embodiedWater: "", }, { eid: "e1164", source: "72", sourceSimName: "BWA", sourceRegion: "Botswana", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.004", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e1165", source: "72", sourceSimName: "BWA", sourceRegion: "Botswana", sourceName: "Sub-Saharan Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.021", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e1319", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "700.563", weight: "3567.012", embodiedLand: "", embodiedWater: "", }, { eid: "e1320", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Rice", year: "2015", value: "21.279294", weight: "36.0515982", embodiedLand: "12.9758444", embodiedWater: "467.733115", }, { eid: "e1321", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.02", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e1322", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "80.401", weight: "267", embodiedLand: "", embodiedWater: "", }, { eid: "e1323", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "2.084", weight: "0.743", embodiedLand: "", embodiedWater: "", }, { eid: "e1324", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "308", targetSimName: "GRD", targetName: "Grenada", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "41.263", weight: "73.557", embodiedLand: "", embodiedWater: "", }, { eid: "e1325", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.673", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e1326", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1350", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e1351", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e1352", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.033", weight: "0.176", embodiedLand: "", embodiedWater: "", }, { eid: "e1353", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "2.767", weight: "2.014", embodiedLand: "", embodiedWater: "", }, { eid: "e1354", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Maize", year: "2016", value: "34.953", weight: "152", embodiedLand: "", embodiedWater: "", }, { eid: "e1356", source: "86", sourceSimName: "IOT", sourceRegion: "British Indian Ocean Territory", sourceName: "Oceania", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1361", source: "90", sourceSimName: "SLB", sourceRegion: "Solomon Isds", sourceName: "Oceania", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "13.167", weight: "42.315", embodiedLand: "3.486", embodiedWater: "5.332", }, { eid: "e1362", source: "90", sourceSimName: "SLB", sourceRegion: "Solomon Isds", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1377", source: "92", sourceSimName: "VGB", sourceRegion: "British Virgin Isds", sourceName: "Caribbean and Central America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "101.43", weight: "490", embodiedLand: "", embodiedWater: "", }, { eid: "e1387", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.011", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e1388", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1389", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "38.441", weight: "44.492", embodiedLand: "", embodiedWater: "", }, { eid: "e1390", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "0.04", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e1483", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "24858.849", weight: "99000", embodiedLand: "", embodiedWater: "", }, { eid: "e1484", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "4.755", weight: "1.934", embodiedLand: "", embodiedWater: "", }, { eid: "e1485", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "93.704", weight: "126.275", embodiedLand: "", embodiedWater: "", }, { eid: "e1486", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Millet", year: "2015", value: "10.413", weight: "27.25", embodiedLand: "24.418", embodiedWater: "8.965", }, { eid: "e1487", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "17703.297", weight: "77309.781", embodiedLand: "18435.802", embodiedWater: "20873.641", }, { eid: "e1489", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Barley", year: "2015", value: "18.8800973", weight: "86.0444724", embodiedLand: "30.7293419", embodiedWater: "1.7204033", }, { eid: "e1490", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "160.110577", weight: "483.392365", embodiedLand: "", embodiedWater: "", }, { eid: "e1491", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "7432.909", weight: "38483.49", embodiedLand: "9381.188", embodiedWater: "11121.729", }, { eid: "e1493", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Barley", year: "2016", value: "189.513", weight: "314", embodiedLand: "", embodiedWater: "", }, { eid: "e1494", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.029", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e1495", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "12.528", weight: "0.77", embodiedLand: "", embodiedWater: "", }, { eid: "e1496", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1497", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "5189.99451", weight: "28567.1783", embodiedLand: "", embodiedWater: "", }, { eid: "e1498", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "14084.1964", weight: "76915.5622", embodiedLand: "", embodiedWater: "", }, { eid: "e1499", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "692.331", weight: "4066.65", embodiedLand: "", embodiedWater: "", }, { eid: "e1500", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "60.703", weight: "339.92", embodiedLand: "", embodiedWater: "", }, { eid: "e1609", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "10.25", weight: "12.219", embodiedLand: "", embodiedWater: "", }, { eid: "e1610", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "112", targetSimName: "BLR", targetName: "Belarus", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "25.7", weight: "75", embodiedLand: "25.54", embodiedWater: "174.3", }, { eid: "e1611", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "108.75", weight: "129.635", embodiedLand: "", embodiedWater: "", }, { eid: "e1612", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1613", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "43.5", weight: "52.27", embodiedLand: "", embodiedWater: "", }, { eid: "e1614", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "104.4", weight: "125.448", embodiedLand: "", embodiedWater: "", }, { eid: "e1615", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "598", targetSimName: "PNG", targetName: "Papua New Guinea", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "21.75", weight: "54.372", embodiedLand: "", embodiedWater: "", }, { eid: "e1616", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1617", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Rice", year: "2016", value: "1775", weight: "1500", embodiedLand: "", embodiedWater: "", }, { eid: "e1619", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "103.45", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e1620", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "137.5", weight: "500", embodiedLand: "", embodiedWater: "", }, { eid: "e1621", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.008", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1622", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "44.4", weight: "120", embodiedLand: "", embodiedWater: "", }, { eid: "e1633", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.606", weight: "0.94", embodiedLand: "", embodiedWater: "", }, { eid: "e1634", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.844", weight: "0.74", embodiedLand: "0.015", embodiedWater: "", }, { eid: "e1635", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "53.041", weight: "90", embodiedLand: "", embodiedWater: "", }, { eid: "e1636", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.492", weight: "1.142", embodiedLand: "", embodiedWater: "", }, { eid: "e1637", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1.021", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e1679", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.015", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e1680", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "3.1", weight: "21.96", embodiedLand: "22.086", embodiedWater: "", }, { eid: "e1681", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "120.2641915", weight: "207.744065", embodiedLand: "", embodiedWater: "", }, { eid: "e1682", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "0.2", weight: "0.09", embodiedLand: "", embodiedWater: "", }, { eid: "e1683", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "44.5214625", weight: "83.785883", embodiedLand: "26.1168536", embodiedWater: "7.20580295", }, { eid: "e1684", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.083", weight: "0.13", embodiedLand: "", embodiedWater: "", }, { eid: "e1685", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "991.896", weight: "5092.85", embodiedLand: "1019.042", embodiedWater: "6610.519", }, { eid: "e1686", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "642", targetSimName: "ROU", targetName: "Romania", targetRegion: "Europe", resource: "Maize", year: "2015", value: "165.472676", weight: "53.1172551", embodiedLand: "17.4316463", embodiedWater: "2398.72164", }, { eid: "e1687", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "1.31077251", weight: "2.06", embodiedLand: "", embodiedWater: "", }, { eid: "e1688", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "27.5722272", weight: "53.4685049", embodiedLand: "19.9639795", embodiedWater: "4.70535121", }, { eid: "e1689", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.773", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e1690", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Barley", year: "2016", value: "10.6", weight: "26.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1691", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "482.1", weight: "2008.8", embodiedLand: "", embodiedWater: "", }, { eid: "e1693", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "6.9", weight: "24.4", embodiedLand: "", embodiedWater: "", }, { eid: "e1694", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "27", weight: "72.94", embodiedLand: "", embodiedWater: "", }, { eid: "e1695", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "10.9", weight: "43.76", embodiedLand: "", embodiedWater: "", }, { eid: "e1696", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Barley", year: "2016", value: "1.4152175", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e1697", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Barley", year: "2016", value: "15.216", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e1792", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "2.058", weight: "1.939", embodiedLand: "", embodiedWater: "", }, { eid: "e1793", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "19.9307517", weight: "54.9268674", embodiedLand: "", embodiedWater: "", }, { eid: "e1795", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "722.843", weight: "2000", embodiedLand: "", embodiedWater: "", }, { eid: "e1796", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.181", weight: "0.05", embodiedLand: "0.0215", embodiedWater: "0.279", }, { eid: "e1797", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "36.5893875", weight: "46", embodiedLand: "22.382", embodiedWater: "419.888", }, { eid: "e1798", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1799", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "20.49", weight: "24.993", embodiedLand: "", embodiedWater: "", }, { eid: "e1800", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "35.6075332", weight: "62.4991805", embodiedLand: "", embodiedWater: "", }, { eid: "e1801", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "87.223", weight: "190", embodiedLand: "", embodiedWater: "", }, { eid: "e1802", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "123.708", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e1803", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "49.454", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e1804", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.332", weight: "1.44", embodiedLand: "", embodiedWater: "", }, { eid: "e1830", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1831", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1832", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.398", weight: "0.041", embodiedLand: "", embodiedWater: "", }, { eid: "e1833", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.379", weight: "0.09", embodiedLand: "0.015", embodiedWater: "", }, { eid: "e1834", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.031", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e1835", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "6.069", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e1836", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2006", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2007", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "10.816", weight: "27.5", embodiedLand: "11.52", embodiedWater: "91.465", }, { eid: "e2008", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.942", weight: "5.224", embodiedLand: "", embodiedWater: "", }, { eid: "e2009", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1549.864", weight: "6461", embodiedLand: "2292.263", embodiedWater: "24648.715", }, { eid: "e2010", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "7.366", weight: "29.392", embodiedLand: "4.087", embodiedWater: "203.275", }, { eid: "e2011", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.105", weight: "0.346", embodiedLand: "", embodiedWater: "", }, { eid: "e2012", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Oats", year: "2016", value: "0.087", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e2013", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "162", targetSimName: "CXR", targetName: "Christmas Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "10.485", weight: "23", embodiedLand: "", embodiedWater: "", }, { eid: "e2014", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "71.847", weight: "90.718", embodiedLand: "", embodiedWater: "", }, { eid: "e2015", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "0.063", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2026", source: "136", sourceSimName: "CYM", sourceRegion: "Cayman Isds", sourceName: "Caribbean and Central America", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2028", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2015", value: "256.296", weight: "584", embodiedLand: "388.652", embodiedWater: "3227.184", }, { eid: "e2029", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2030", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2122", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.617", weight: "0.4", embodiedLand: "0.171", embodiedWater: "9.947", }, { eid: "e2123", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.022", weight: "0.01", embodiedLand: "", embodiedWater: "0.074", }, { eid: "e2124", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "4.465", weight: "4", embodiedLand: "1.462", embodiedWater: "24.56", }, { eid: "e2125", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "674.364", weight: "998.75", embodiedLand: "394.423", embodiedWater: "8358.539", }, { eid: "e2126", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "10.169684", weight: "10", embodiedLand: "4.832", embodiedWater: "129.36", }, { eid: "e2127", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.6929921", weight: "0.39911438", embodiedLand: "0.02313548", embodiedWater: "", }, { eid: "e2128", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Barley", year: "2015", value: "0.021", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2129", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "956.722", weight: "1340", embodiedLand: "468.637", embodiedWater: "10142.46", }, { eid: "e2130", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.129", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2131", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "2581.403", weight: "1630", embodiedLand: "593.987", embodiedWater: "13326.88", }, { eid: "e2132", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.01799708", weight: "0.01963527", embodiedLand: "0.00589058", embodiedWater: "0.15119156", }, { eid: "e2133", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.055", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e2135", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.797", weight: "0.084", embodiedLand: "", embodiedWater: "", }, { eid: "e2139", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2140", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.114", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e2141", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2142", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2143", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.421", weight: "2", embodiedLand: "", embodiedWater: "", }, { eid: "e2227", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "7.466", weight: "0.804", embodiedLand: "", embodiedWater: "", }, { eid: "e2228", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "1.644", weight: "1", embodiedLand: "0.016", embodiedWater: "14.459", }, { eid: "e2229", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.104", weight: "0.058", embodiedLand: "", embodiedWater: "", }, { eid: "e2230", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "32.659", weight: "18.144", embodiedLand: "2.013", embodiedWater: "25.347", }, { eid: "e2231", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "50.962", weight: "29.8", embodiedLand: "", embodiedWater: "", }, { eid: "e2232", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.158", weight: "0.366", embodiedLand: "", embodiedWater: "", }, { eid: "e2233", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Rice", year: "2016", value: "0.57", weight: "0.216", embodiedLand: "", embodiedWater: "", }, { eid: "e2234", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "6.176", weight: "3.84", embodiedLand: "", embodiedWater: "", }, { eid: "e2235", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "13.32", weight: "40", embodiedLand: "", embodiedWater: "", }, { eid: "e2236", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2237", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "6.426", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e2238", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.14", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e2239", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.899", weight: "0.564", embodiedLand: "", embodiedWater: "", }, { eid: "e2240", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2241", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2433", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "63.059", weight: "215.408", embodiedLand: "", embodiedWater: "", }, { eid: "e2434", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.045", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e2435", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "9502.75", weight: "30250", embodiedLand: "", embodiedWater: "", }, { eid: "e2436", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "798", targetSimName: "TUV", targetName: "Tuvalu", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "20.317", weight: "40.634", embodiedLand: "", embodiedWater: "", }, { eid: "e2439", source: "166", sourceSimName: "CCK", sourceRegion: "Cocos Isds", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2440", source: "166", sourceSimName: "CCK", sourceRegion: "Cocos Isds", sourceName: "Oceania", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2507", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.012", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e2508", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "4.945", weight: "5.004", embodiedLand: "", embodiedWater: "", }, { eid: "e2509", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2510", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "3.051", weight: "1.68", embodiedLand: "0.624", embodiedWater: "11.764", }, { eid: "e2511", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "5.99707857", weight: "0.49", embodiedLand: "", embodiedWater: "", }, { eid: "e2513", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.005", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e2514", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.02360264", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e2515", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.014", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e2516", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.661", weight: "0.55", embodiedLand: "", embodiedWater: "", }, { eid: "e2517", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "24.4083904", weight: "21.9972541", embodiedLand: "", embodiedWater: "", }, { eid: "e2518", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e2519", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "29.328", weight: "9.319", embodiedLand: "", embodiedWater: "", }, { eid: "e2520", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.09", weight: "0.114", embodiedLand: "", embodiedWater: "", }, { eid: "e2521", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "28.266", weight: "4", embodiedLand: "", embodiedWater: "", }, { eid: "e2522", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.253", weight: "0.239", embodiedLand: "", embodiedWater: "", }, { eid: "e2526", source: "174", sourceSimName: "COM", sourceRegion: "Comoros", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Rice", year: "2015", value: "64.83", weight: "89.969", embodiedLand: "", embodiedWater: "", }, { eid: "e2562", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.001", weight: "0.002", embodiedLand: "", embodiedWater: "0.003", }, { eid: "e2563", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.068", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2564", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "770.502", weight: "4498.68", embodiedLand: "242.589", embodiedWater: "7341.846", }, { eid: "e2565", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2566", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "17.311", weight: "18.402", embodiedLand: "", embodiedWater: "", }, { eid: "e2630", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Barley", year: "2015", value: "4009.71895", weight: "10426.471", embodiedLand: "4547.15483", embodiedWater: "417.058952", }, { eid: "e2631", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.159", weight: "0.162", embodiedLand: "0.019", embodiedWater: "0.163", }, { eid: "e2632", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.011", weight: "0.009", embodiedLand: "0.001", embodiedWater: "0.01", }, { eid: "e2634", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "0.4225", weight: "1.3", embodiedLand: "0.385", embodiedWater: "0.016", }, { eid: "e2635", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "0.02", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e2636", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "36.137", weight: "68", embodiedLand: "", embodiedWater: "", }, { eid: "e2637", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.947", weight: "0.19", embodiedLand: "", embodiedWater: "", }, { eid: "e2639", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "356.137", weight: "742.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2640", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "11.272", weight: "25.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2641", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "195.135725", weight: "405.023926", embodiedLand: "", embodiedWater: "", }, { eid: "e2642", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Barley", year: "2016", value: "1927.978", weight: "5003.87", embodiedLand: "", embodiedWater: "", }, { eid: "e2653", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "12.015", weight: "22", embodiedLand: "1.121", embodiedWater: "30.294", }, { eid: "e2654", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2655", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2710", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "0.002", weight: "0.025", embodiedLand: "0.006", embodiedWater: "", }, { eid: "e2711", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "0.01", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e2712", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "275.094068", weight: "518.04557", embodiedLand: "852.454555", embodiedWater: "", }, { eid: "e2713", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.123", weight: "0.515", embodiedLand: "", embodiedWater: "", }, { eid: "e2714", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.749", weight: "0.352", embodiedLand: "", embodiedWater: "", }, { eid: "e2815", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "218", targetSimName: "ECU", targetName: "Ecuador", targetRegion: "South America", resource: "Barley", year: "2015", value: "8.19775118", weight: "19.4429394", embodiedLand: "1.01453375", embodiedWater: "6.43614933", }, { eid: "e2816", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "47.058", weight: "31.738", embodiedLand: "", embodiedWater: "", }, { eid: "e2817", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "465.089207", weight: "1056.18955", embodiedLand: "59.5149034", embodiedWater: "349.59874", }, { eid: "e2818", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "1.53", weight: "0.296", embodiedLand: "", embodiedWater: "", }, { eid: "e2819", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Buckwheat", year: "2015", value: "0.077", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2820", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Barley", year: "2015", value: "1233.57708", weight: "2500", embodiedLand: "273.915", embodiedWater: "302.5", }, { eid: "e2821", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "0.512", weight: "0.287", embodiedLand: "1.023", embodiedWater: "", }, { eid: "e2822", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Barley", year: "2015", value: "21.392", weight: "50.1", embodiedLand: "8.127", embodiedWater: "0.601", }, { eid: "e2823", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.59", weight: "1.093", embodiedLand: "", embodiedWater: "", }, { eid: "e2824", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "53.08", weight: "26.912", embodiedLand: "", embodiedWater: "", }, { eid: "e2825", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "4.409", weight: "7.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2826", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.14", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e2827", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "12283.216", weight: "51375.101", embodiedLand: "", embodiedWater: "", }, { eid: "e2828", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6823.806", weight: "28549.006", embodiedLand: "", embodiedWater: "", }, { eid: "e2852", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.041", weight: "0.125", embodiedLand: "0.007", embodiedWater: "1.054", }, { eid: "e2853", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.541", weight: "1", embodiedLand: "0.017", embodiedWater: "0.369", }, { eid: "e2854", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.01", weight: "0.017", embodiedLand: "0.009", embodiedWater: "0.129", }, { eid: "e2855", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "4.19", weight: "17.35", embodiedLand: "", embodiedWater: "", }, { eid: "e2856", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "1.874", weight: "0.506", embodiedLand: "", embodiedWater: "", }, { eid: "e2857", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "17.743", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e2858", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "15.773", weight: "220", embodiedLand: "", embodiedWater: "", }, { eid: "e2992", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "17845.867", weight: "88000", embodiedLand: "", embodiedWater: "", }, { eid: "e2994", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "21.161", weight: "46", embodiedLand: "", embodiedWater: "", }, { eid: "e2995", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2996", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Buckwheat", year: "2015", value: "0.02", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2997", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.023", weight: "0.015", embodiedLand: "", embodiedWater: "0.191", }, { eid: "e2999", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.679", weight: "14", embodiedLand: "3.32", embodiedWater: "25.83", }, { eid: "e3000", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.035", weight: "0.031", embodiedLand: "0.002", embodiedWater: "0.435", }, { eid: "e3001", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "9.53", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e3002", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "146.629", weight: "272.52", embodiedLand: "", embodiedWater: "", }, { eid: "e3003", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3005", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.074", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e3006", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2016", value: "0.234", weight: "0.058", embodiedLand: "", embodiedWater: "", }, { eid: "e3007", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.206", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e3008", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rye", year: "2016", value: "22.102", weight: "41.204", embodiedLand: "", embodiedWater: "", }, { eid: "e3009", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Buckwheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3020", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.813", weight: "1.09", embodiedLand: "", embodiedWater: "", }, { eid: "e3021", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Millet", year: "2016", value: "6.079", weight: "9.869", embodiedLand: "", embodiedWater: "", }, { eid: "e3022", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3073", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "62.9969656", weight: "133.149681", embodiedLand: "", embodiedWater: "", }, { eid: "e3074", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3075", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.011", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e3076", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "41.744", weight: "63.999", embodiedLand: "", embodiedWater: "", }, { eid: "e3077", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Sorghum", year: "2016", value: "0.3", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e3078", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.752", weight: "0.558", embodiedLand: "", embodiedWater: "", }, { eid: "e3080", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.466", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e3081", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.1", weight: "0.057", embodiedLand: "", embodiedWater: "", }, { eid: "e3082", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.258", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e3129", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "0.25", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e3130", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "655.12", weight: "117.45", embodiedLand: "", embodiedWater: "", }, { eid: "e3131", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.508", weight: "0.065", embodiedLand: "", embodiedWater: "", }, { eid: "e3132", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.061", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e3133", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.012", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3134", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.20254593", weight: "0.0630884", embodiedLand: "", embodiedWater: "", }, { eid: "e3136", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.001", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e3137", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.017", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3151", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.016", weight: "0.02", embodiedLand: "", embodiedWater: "0.015", }, { eid: "e3152", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2015", value: "21.36", weight: "26.04", embodiedLand: "4.462", embodiedWater: "131.762", }, { eid: "e3153", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.231", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e3154", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.36", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e3155", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "218", targetSimName: "ECU", targetName: "Ecuador", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.076", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e3156", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.25", weight: "0.076", embodiedLand: "", embodiedWater: "", }, { eid: "e3157", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.651", weight: "0.464", embodiedLand: "", embodiedWater: "", }, { eid: "e3158", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "3.55", weight: "1.075", embodiedLand: "", embodiedWater: "", }, { eid: "e3160", source: "226", sourceSimName: "GNQ", sourceRegion: "Equatorial Guinea", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3161", source: "226", sourceSimName: "GNQ", sourceRegion: "Equatorial Guinea", sourceName: "Sub-Saharan Africa", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3214", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "3.757", weight: "0.78", embodiedLand: "", embodiedWater: "", }, { eid: "e3215", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.159", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e3216", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.24744121", weight: "0.12643068", embodiedLand: "", embodiedWater: "", }, { eid: "e3217", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.084", weight: "0.1", embodiedLand: "0.012", embodiedWater: "0.881", }, { eid: "e3218", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.056", weight: "0.045", embodiedLand: "0.019", embodiedWater: "", }, { eid: "e3219", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3220", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.059", weight: "0.025", embodiedLand: "0.073", embodiedWater: "", }, { eid: "e3221", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.051", weight: "0.015", embodiedLand: "0.008", embodiedWater: "", }, { eid: "e3223", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.388", weight: "0.705", embodiedLand: "0.027", embodiedWater: "0.492", }, { eid: "e3224", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "17.374", weight: "40", embodiedLand: "16.921", embodiedWater: "2.24", }, { eid: "e3225", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.641", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e3226", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.072", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e3231", source: "232", sourceSimName: "ERI", sourceRegion: "Eritrea", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3232", source: "232", sourceSimName: "ERI", sourceRegion: "Eritrea", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3283", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "60.169", weight: "40.581", embodiedLand: "", embodiedWater: "", }, { eid: "e3284", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "12273.129", weight: "69000", embodiedLand: "19376.402", embodiedWater: "3036", }, { eid: "e3285", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "8159.47956", weight: "44000", embodiedLand: "12365.057", embodiedWater: "308", }, { eid: "e3286", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "5697.635", weight: "31498.19", embodiedLand: "8131.804", embodiedWater: "10992.868", }, { eid: "e3287", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "19.337", weight: "53.21", embodiedLand: "", embodiedWater: "", }, { eid: "e3288", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "6239.34", weight: "22384.14", embodiedLand: "", embodiedWater: "", }, { eid: "e3289", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "3166.555", weight: "15864", embodiedLand: "4286.655", embodiedWater: "5393.76", }, { eid: "e3290", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Barley", year: "2015", value: "0.015", weight: "0.019", embodiedLand: "0.006", embodiedWater: "0.001", }, { eid: "e3291", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Barley", year: "2016", value: "3.176", weight: "2.4", embodiedLand: "", embodiedWater: "", }, { eid: "e3292", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "12.414", weight: "49.122", embodiedLand: "", embodiedWater: "", }, { eid: "e3293", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "0.003", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3294", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "629.386", weight: "2596.853", embodiedLand: "", embodiedWater: "", }, { eid: "e3295", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.039", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e3296", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rye", year: "2016", value: "31.581", weight: "76.353", embodiedLand: "", embodiedWater: "", }, { eid: "e3297", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "4160.65711", weight: "25476.5045", embodiedLand: "", embodiedWater: "", }, { eid: "e3338", source: "242", sourceSimName: "FJI", sourceRegion: "Fiji", sourceName: "Oceania", target: "162", targetSimName: "CXR", targetName: "Christmas Isds", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "39.068", weight: "88.5", embodiedLand: "", embodiedWater: "", }, { eid: "e3339", source: "242", sourceSimName: "FJI", sourceRegion: "Fiji", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.007", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e3435", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "481.381304", weight: "1599.203", embodiedLand: "471.659", embodiedWater: "", }, { eid: "e3436", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.092", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e3437", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "0.004", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3438", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.086", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e3439", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "1.48", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e3440", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2015", value: "0.01", weight: "0.018", embodiedLand: "0.006", embodiedWater: "0.007", }, { eid: "e3441", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.067", weight: "0.029", embodiedLand: "0.008", embodiedWater: "", }, { eid: "e3442", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "21.849", weight: "36.603", embodiedLand: "", embodiedWater: "", }, { eid: "e3443", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.071", weight: "0.32", embodiedLand: "", embodiedWater: "", }, { eid: "e3444", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2015", value: "0.572", weight: "0.065", embodiedLand: "", embodiedWater: "", }, { eid: "e3445", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "2.1", weight: "0.929", embodiedLand: "", embodiedWater: "", }, { eid: "e3446", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.762", weight: "0.575", embodiedLand: "", embodiedWater: "", }, { eid: "e3447", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3448", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Oats", year: "2016", value: "1.191", weight: "0.475", embodiedLand: "", embodiedWater: "", }, { eid: "e3449", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.702", weight: "0.182", embodiedLand: "", embodiedWater: "", }, { eid: "e3640", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "16", targetSimName: "ASM", targetName: "American Samoa", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3641", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "292", targetSimName: "GIB", targetName: "Gibraltar", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.099", weight: "0.075", embodiedLand: "", embodiedWater: "", }, { eid: "e3643", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "674", targetSimName: "SMR", targetName: "San Marino", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3644", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "796", targetSimName: "TCA", targetName: "Turks and Caicos Isds", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.039", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3646", source: "258", sourceSimName: "PYF", sourceRegion: "French Polynesia", sourceName: "Oceania", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.303", weight: "0.161", embodiedLand: "", embodiedWater: "0.66", }, { eid: "e3647", source: "258", sourceSimName: "PYF", sourceRegion: "French Polynesia", sourceName: "Oceania", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "11.76", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e3661", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1697.791", weight: "4715.65", embodiedLand: "", embodiedWater: "", }, { eid: "e3662", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.117", weight: "0.241", embodiedLand: "", embodiedWater: "", }, { eid: "e3663", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "10.466", weight: "5.65", embodiedLand: "", embodiedWater: "", }, { eid: "e3674", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3675", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e3676", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3677", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3707", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.048", weight: "0.038", embodiedLand: "", embodiedWater: "", }, { eid: "e3708", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "4.8", weight: "24", embodiedLand: "18.872", embodiedWater: "2.136", }, { eid: "e3709", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.005", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3710", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "22.678", weight: "38.023", embodiedLand: "", embodiedWater: "", }, { eid: "e3711", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.252", weight: "0.455", embodiedLand: "0.074", embodiedWater: "1.176", }, { eid: "e3712", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "27", weight: "4.86", embodiedLand: "2.151", embodiedWater: "5.56", }, { eid: "e3713", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Maize", year: "2016", value: "2.61599203", weight: "1.05", embodiedLand: "", embodiedWater: "", }, { eid: "e3714", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "23.6", weight: "47.6", embodiedLand: "", embodiedWater: "", }, { eid: "e3715", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "12.179", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e3716", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "9.5", weight: "50", embodiedLand: "", embodiedWater: "", }, { eid: "e3718", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.00114478", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e3719", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "18.278", weight: "19.24", embodiedLand: "", embodiedWater: "", }, { eid: "e3720", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3734", source: "270", sourceSimName: "GMB", sourceRegion: "Gambia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "8.156", weight: "9", embodiedLand: "0.265", embodiedWater: "11.43", }, { eid: "e3735", source: "270", sourceSimName: "GMB", sourceRegion: "Gambia", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3766", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.984", weight: "1.468", embodiedLand: "", embodiedWater: "", }, { eid: "e3767", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2015", value: "6.887", weight: "10.275", embodiedLand: "", embodiedWater: "", }, { eid: "e3769", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.621", weight: "0.057", embodiedLand: "", embodiedWater: "", }, { eid: "e3770", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "37.922", weight: "50", embodiedLand: "", embodiedWater: "", }, { eid: "e3771", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "0.035", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e3963", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.908", weight: "23", embodiedLand: "6.114", embodiedWater: "87.285", }, { eid: "e3964", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.077", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e3965", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Barley", year: "2015", value: "14.0348425", weight: "26", embodiedLand: "4.29", embodiedWater: "0.234", }, { eid: "e3966", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3967", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "612", targetSimName: "PCN", targetName: "Pitcairn", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3968", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.096", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4026", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.234", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e4028", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "427.155", weight: "1504", embodiedLand: "", embodiedWater: "", }, { eid: "e4029", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e4034", source: "292", sourceSimName: "GIB", sourceRegion: "Gibraltar", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4035", source: "292", sourceSimName: "GIB", sourceRegion: "Gibraltar", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "3.999", weight: "3.334", embodiedLand: "", embodiedWater: "", }, { eid: "e4038", source: "296", sourceSimName: "KIR", sourceRegion: "Kiribati", sourceName: "Oceania", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "1.46", weight: "0.327", embodiedLand: "", embodiedWater: "", }, { eid: "e4130", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.592", weight: "0.381", embodiedLand: "", embodiedWater: "", }, { eid: "e4131", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Wheat", year: "2015", value: "0.535", weight: "0.685", embodiedLand: "0.344", embodiedWater: "2.925", }, { eid: "e4132", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.225", weight: "0.51", embodiedLand: "0.297", embodiedWater: "0.907", }, { eid: "e4133", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.222", weight: "0.099", embodiedLand: "", embodiedWater: "", }, { eid: "e4134", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.619", weight: "0.9", embodiedLand: "0.215", embodiedWater: "12.695", }, { eid: "e4135", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "1.643", weight: "0.811", embodiedLand: "0.35", embodiedWater: "22.782", }, { eid: "e4136", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "148", targetSimName: "TCD", targetName: "Chad", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9.296", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4139", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.194", weight: "0.105", embodiedLand: "", embodiedWater: "", }, { eid: "e4140", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4141", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "1.549", weight: "0.33", embodiedLand: "", embodiedWater: "", }, { eid: "e4144", source: "304", sourceSimName: "GRL", sourceRegion: "Greenland", sourceName: "North America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4145", source: "304", sourceSimName: "GRL", sourceRegion: "Greenland", sourceName: "North America", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.094", weight: "0.052", embodiedLand: "", embodiedWater: "", }, { eid: "e4160", source: "308", sourceSimName: "GRD", sourceRegion: "Grenada", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4161", source: "308", sourceSimName: "GRD", sourceRegion: "Grenada", sourceName: "Caribbean and Central America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.117", weight: "0.258", embodiedLand: "", embodiedWater: "", }, { eid: "e4166", source: "316", sourceSimName: "GUM", sourceRegion: "Guam", sourceName: "Oceania", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.645", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e4197", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.45", weight: "0.023", embodiedLand: "", embodiedWater: "", }, { eid: "e4198", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.011", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e4199", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4200", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.225", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e4201", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "2.383", weight: "0.959", embodiedLand: "", embodiedWater: "", }, { eid: "e4222", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4223", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1121.1076", weight: "9902.574", embodiedLand: "74.073", embodiedWater: "16091.683", }, { eid: "e4224", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "151.325", weight: "781.716", embodiedLand: "851.781", embodiedWater: "8133.755", }, { eid: "e4225", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "14.702", weight: "22.538", embodiedLand: "26.147", embodiedWater: "54.384", }, { eid: "e4226", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4227", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "514.56", weight: "516", embodiedLand: "", embodiedWater: "", }, { eid: "e4229", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4274", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "2.93", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e4275", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "12.9452924", weight: "80.64", embodiedLand: "", embodiedWater: "", }, { eid: "e4276", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "79.617", weight: "404.777", embodiedLand: "", embodiedWater: "", }, { eid: "e4277", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Rice", year: "2015", value: "146.081", weight: "186.97", embodiedLand: "46.045", embodiedWater: "1298.32", }, { eid: "e4278", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "2751.76304", weight: "3460.64811", embodiedLand: "", embodiedWater: "", }, { eid: "e4279", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "12.957", weight: "2.49", embodiedLand: "", embodiedWater: "", }, { eid: "e4280", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4281", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "336", targetSimName: "VAT", targetName: "Holy See", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4282", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "20.016", weight: "50.04", embodiedLand: "", embodiedWater: "", }, { eid: "e4283", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "6.893", weight: "24.705", embodiedLand: "", embodiedWater: "", }, { eid: "e4284", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4285", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "2.422", weight: "26.912", embodiedLand: "", embodiedWater: "", }, { eid: "e4298", source: "332", sourceSimName: "HTI", sourceRegion: "Haiti", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4323", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Barley", year: "2015", value: "201.042", weight: "323.82", embodiedLand: "", embodiedWater: "", }, { eid: "e4324", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "20.24", weight: "39.916", embodiedLand: "24.266", embodiedWater: "18.162", }, { eid: "e4326", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "47.6473533", weight: "48.6243931", embodiedLand: "", embodiedWater: "", }, { eid: "e4327", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Rice", year: "2016", value: "0.19", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e4328", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2016", value: "8.858", weight: "8.732", embodiedLand: "", embodiedWater: "", }, { eid: "e4329", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "44.64", weight: "96.16", embodiedLand: "", embodiedWater: "", }, { eid: "e4428", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.008", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e4429", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e4430", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "0.109", weight: "0.125", embodiedLand: "0.011", embodiedWater: "0.001", }, { eid: "e4431", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "119.521", weight: "420", embodiedLand: "51.421", embodiedWater: "660.66", }, { eid: "e4432", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "658.77", weight: "2218.1", embodiedLand: "206.877", embodiedWater: "2437.692", }, { eid: "e4434", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "83.377", weight: "273", embodiedLand: "31.384", embodiedWater: "559.377", }, { eid: "e4435", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "0.026", weight: "0.016", embodiedLand: "0.002", embodiedWater: "0.007", }, { eid: "e4436", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "10.865", weight: "21", embodiedLand: "2.303", embodiedWater: "31.017", }, { eid: "e4437", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "13.347", weight: "102.23", embodiedLand: "", embodiedWater: "", }, { eid: "e4439", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "677.568524", weight: "630.017434", embodiedLand: "", embodiedWater: "", }, { eid: "e4461", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "2.403", weight: "4.029", embodiedLand: "", embodiedWater: "", }, { eid: "e4462", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Barley", year: "2015", value: "62.13", weight: "18", embodiedLand: "", embodiedWater: "", }, { eid: "e4463", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4464", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4465", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4568", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "38.048", weight: "120.8", embodiedLand: "11.771", embodiedWater: "164.409", }, { eid: "e4569", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "61.273", weight: "67.74", embodiedLand: "35.111", embodiedWater: "", }, { eid: "e4570", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "1.304", weight: "0.144", embodiedLand: "", embodiedWater: "", }, { eid: "e4571", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "316", targetSimName: "GUM", targetName: "Guam", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4572", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.065", weight: "0.081", embodiedLand: "0.062", embodiedWater: "0.774", }, { eid: "e4573", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "64.711", weight: "26.777", embodiedLand: "", embodiedWater: "", }, { eid: "e4574", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "219", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e4575", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.119", weight: "0.083", embodiedLand: "", embodiedWater: "", }, { eid: "e4576", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "3.501", weight: "0.725", embodiedLand: "", embodiedWater: "", }, { eid: "e4577", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2016", value: "2424", weight: "12000", embodiedLand: "", embodiedWater: "", }, { eid: "e4578", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2016", value: "0.756", weight: "0.947", embodiedLand: "", embodiedWater: "", }, { eid: "e4579", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "270", targetSimName: "GMB", targetName: "Gambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "74.884", weight: "270", embodiedLand: "", embodiedWater: "", }, { eid: "e4581", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "0.437", weight: "0.069", embodiedLand: "", embodiedWater: "", }, { eid: "e4582", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2016", value: "1.06", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4583", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1.59", weight: "0.745", embodiedLand: "", embodiedWater: "", }, { eid: "e4584", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.473", weight: "1.76", embodiedLand: "", embodiedWater: "", }, { eid: "e4635", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "4159.919", weight: "14678.618", embodiedLand: "", embodiedWater: "", }, { eid: "e4636", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.04", weight: "0.15", embodiedLand: "0.011", embodiedWater: "2.752", }, { eid: "e4637", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "17.595", weight: "6.84", embodiedLand: "2.127", embodiedWater: "193.278", }, { eid: "e4638", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "8.79", weight: "43.87", embodiedLand: "15.986", embodiedWater: "396.322", }, { eid: "e4639", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.24", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e4640", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "0.044", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e4641", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.021", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e4642", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2.244", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e4643", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "398.292", weight: "821.65", embodiedLand: "", embodiedWater: "", }, { eid: "e4644", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.079", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e4645", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.62", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4646", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.157", weight: "0.279", embodiedLand: "", embodiedWater: "", }, { eid: "e4647", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.129", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e4649", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.027", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e4650", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.078", weight: "1.118", embodiedLand: "", embodiedWater: "", }, { eid: "e4661", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4662", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "2.843", weight: "1.59", embodiedLand: "", embodiedWater: "", }, { eid: "e4663", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Maize", year: "2016", value: "160.874", weight: "36.36", embodiedLand: "", embodiedWater: "", }, { eid: "e4664", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.002", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e4731", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "159.042", weight: "32.792", embodiedLand: "", embodiedWater: "", }, { eid: "e4732", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "14.867", weight: "44.1", embodiedLand: "6.096", embodiedWater: "34.089", }, { eid: "e4733", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.516", weight: "0.152", embodiedLand: "", embodiedWater: "", }, { eid: "e4734", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "21.023", weight: "42.5", embodiedLand: "0.457", embodiedWater: "48.195", }, { eid: "e4735", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "11.011", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4736", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Rice", year: "2015", value: "3.051", weight: "0.378", embodiedLand: "", embodiedWater: "", }, { eid: "e4737", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "2.542", weight: "0.94", embodiedLand: "0.161", embodiedWater: "0.968", }, { eid: "e4738", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "2.238", weight: "2.262", embodiedLand: "", embodiedWater: "", }, { eid: "e4739", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4740", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e4742", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Barley", year: "2016", value: "0.468", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e4743", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "11.066", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4744", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "1.695", weight: "0.9", embodiedLand: "", embodiedWater: "", }, { eid: "e4745", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2016", value: "0.132", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e4824", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.024", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e4825", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Maize", year: "2015", value: "12", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4826", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Wheat", year: "2015", value: "134.901099", weight: "54.1360357", embodiedLand: "", embodiedWater: "", }, { eid: "e4827", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "1", weight: "0.5", embodiedLand: "0.012", embodiedWater: "4.356", }, { eid: "e4828", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "38", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e4829", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "14.005348", weight: "27.7814111", embodiedLand: "", embodiedWater: "", }, { eid: "e4830", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "11.071", weight: "48", embodiedLand: "2.36", embodiedWater: "517.776", }, { eid: "e4831", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "10", weight: "7.385", embodiedLand: "", embodiedWater: "", }, { eid: "e4832", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Wheat", year: "2016", value: "1", weight: "2.895", embodiedLand: "", embodiedWater: "", }, { eid: "e4833", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "121", weight: "381.095", embodiedLand: "", embodiedWater: "", }, { eid: "e4834", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.828", weight: "0.575", embodiedLand: "", embodiedWater: "", }, { eid: "e4835", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "2", weight: "4.806", embodiedLand: "", embodiedWater: "", }, { eid: "e5015", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.273", weight: "1.5", embodiedLand: "0.94", embodiedWater: "5.117", }, { eid: "e5016", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "762", targetSimName: "TJK", targetName: "Tajikistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "2.747", weight: "3.75", embodiedLand: "1.24", embodiedWater: "1.117", }, { eid: "e5017", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.099", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e5018", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5019", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5065", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "4.837", weight: "0.288", embodiedLand: "", embodiedWater: "", }, { eid: "e5066", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.222", weight: "0.057", embodiedLand: "0.004", embodiedWater: "", }, { eid: "e5067", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.102", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e5068", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Oats", year: "2016", value: "26.888", weight: "155.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5104", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "819.786", weight: "4674.18", embodiedLand: "7.562", embodiedWater: "5814.68", }, { eid: "e5105", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "5.202", weight: "20.58", embodiedLand: "", embodiedWater: "", }, { eid: "e5106", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.134", weight: "0.159", embodiedLand: "", embodiedWater: "", }, { eid: "e5107", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "3.186", weight: "1.973", embodiedLand: "", embodiedWater: "", }, { eid: "e5108", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.004", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e5246", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.646", weight: "0.435", embodiedLand: "", embodiedWater: "", }, { eid: "e5247", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.115", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e5248", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "1285.878", weight: "3253", embodiedLand: "695.174", embodiedWater: "27878.21", }, { eid: "e5249", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "5.677", weight: "2", embodiedLand: "0.486", embodiedWater: "17.53", }, { eid: "e5250", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.05", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e5251", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.128", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e5252", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.792", weight: "1.676", embodiedLand: "", embodiedWater: "", }, { eid: "e5253", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.33", weight: "0.339", embodiedLand: "", embodiedWater: "", }, { eid: "e5254", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1536.952", weight: "2498.778", embodiedLand: "", embodiedWater: "", }, { eid: "e5319", source: "398", sourceSimName: "KAZ", sourceRegion: "Kazakhstan", sourceName: "Central and Northern Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.05", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e5321", source: "398", sourceSimName: "KAZ", sourceRegion: "Kazakhstan", sourceName: "Central and Northern Asia", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.184", weight: "0.086", embodiedLand: "", embodiedWater: "", }, { eid: "e5368", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "7.112", weight: "6.518", embodiedLand: "", embodiedWater: "", }, { eid: "e5369", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.631", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e5370", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.879", weight: "0.168", embodiedLand: "", embodiedWater: "", }, { eid: "e5371", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1.34", weight: "1.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5372", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.026", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e5373", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5374", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.066", weight: "0.649", embodiedLand: "0.046", embodiedWater: "1.955", }, { eid: "e5375", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.143", weight: "0.09", embodiedLand: "", embodiedWater: "", }, { eid: "e5376", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "15280.683", weight: "52494.791", embodiedLand: "49024.216", embodiedWater: "2673717.19", }, { eid: "e5377", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.138", weight: "0.053", embodiedLand: "", embodiedWater: "", }, { eid: "e5378", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "36.011", weight: "115", embodiedLand: "4.942", embodiedWater: "825.24", }, { eid: "e5379", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.825", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5380", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Buckwheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5381", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.946", weight: "0.6", embodiedLand: "", embodiedWater: "", }, { eid: "e5382", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.075", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e5383", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "14.272", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e5384", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.015", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e5447", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.104", weight: "0.05", embodiedLand: "0.015", embodiedWater: "0.286", }, { eid: "e5448", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5449", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5450", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "75.807", weight: "147.131", embodiedLand: "88.514", embodiedWater: "387.69", }, { eid: "e5451", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e5452", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "21.654", weight: "2.897", embodiedLand: "", embodiedWater: "", }, { eid: "e5453", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5494", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "2.118", weight: "3.342", embodiedLand: "0.863", embodiedWater: "4.802", }, { eid: "e5495", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.119", weight: "0.1", embodiedLand: "", embodiedWater: "0.729", }, { eid: "e5496", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5497", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.364", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e5498", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "1.66", weight: "0.715", embodiedLand: "0.028", embodiedWater: "7.631", }, { eid: "e5499", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "0.079", weight: "0.06", embodiedLand: "0.004", embodiedWater: "0.152", }, { eid: "e5500", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.181", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e5501", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.047", weight: "0.08", embodiedLand: "", embodiedWater: "0.392", }, { eid: "e5502", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.255", weight: "0.5", embodiedLand: "", embodiedWater: "", }, { eid: "e5503", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.325", weight: "0.708", embodiedLand: "", embodiedWater: "", }, { eid: "e5504", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.3", weight: "0.22", embodiedLand: "", embodiedWater: "", }, { eid: "e5505", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "0.332", weight: "0.309", embodiedLand: "", embodiedWater: "", }, { eid: "e5506", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "18.636", weight: "8.967", embodiedLand: "", embodiedWater: "", }, { eid: "e5507", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.419", weight: "1.356", embodiedLand: "", embodiedWater: "", }, { eid: "e5508", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.096", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e5524", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2015", value: "0.494", weight: "0.62", embodiedLand: "0.027", embodiedWater: "3.678", }, { eid: "e5525", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.056", weight: "0.05", embodiedLand: "", embodiedWater: "0.088", }, { eid: "e5526", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "3", weight: "12", embodiedLand: "", embodiedWater: "", }, { eid: "e5527", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "20.543", weight: "47.935", embodiedLand: "", embodiedWater: "", }, { eid: "e5528", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.012", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e5529", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1391.017", weight: "5169.24", embodiedLand: "", embodiedWater: "", }, { eid: "e5568", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "23.4938257", weight: "28.2050024", embodiedLand: "", embodiedWater: "", }, { eid: "e5569", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.444", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e5570", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.073", weight: "0.04", embodiedLand: "0.013", embodiedWater: "0.105", }, { eid: "e5571", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "38.47", weight: "46.226", embodiedLand: "", embodiedWater: "", }, { eid: "e5573", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "25.024", weight: "144.873", embodiedLand: "", embodiedWater: "", }, { eid: "e5574", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "4.454", weight: "5.88", embodiedLand: "", embodiedWater: "", }, { eid: "e5680", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "2.433", weight: "1.32", embodiedLand: "", embodiedWater: "", }, { eid: "e5681", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5682", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.07", weight: "0.14", embodiedLand: "", embodiedWater: "", }, { eid: "e5683", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.736", weight: "0.54", embodiedLand: "", embodiedWater: "", }, { eid: "e5684", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.061", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e5685", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Other cereals", year: "2016", value: "0.448", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e5686", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.038", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e5687", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "11.6", weight: "2.25", embodiedLand: "", embodiedWater: "", }, { eid: "e5688", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1.756", weight: "2.3", embodiedLand: "", embodiedWater: "", }, { eid: "e5689", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "6.46160548", weight: "12.1968756", embodiedLand: "", embodiedWater: "", }, { eid: "e5696", source: "426", sourceSimName: "LSO", sourceRegion: "Lesotho", sourceName: "Sub-Saharan Africa", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Millet", year: "2015", value: "11.926", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e5697", source: "426", sourceSimName: "LSO", sourceRegion: "Lesotho", sourceName: "Sub-Saharan Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "21.18", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e5790", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "76.094", weight: "231.535", embodiedLand: "70.276", embodiedWater: "42.371", }, { eid: "e5791", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "21.3954741", weight: "17.634", embodiedLand: "7.808", embodiedWater: "", }, { eid: "e5792", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "9.879", weight: "16.669", embodiedLand: "", embodiedWater: "", }, { eid: "e5793", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "108.18118", weight: "282.748174", embodiedLand: "120.980124", embodiedWater: "113.947519", }, { eid: "e5794", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Oats", year: "2015", value: "55.429", weight: "102", embodiedLand: "50.006", embodiedWater: "", }, { eid: "e5795", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2015", value: "14.519", weight: "16.8", embodiedLand: "5.346", embodiedWater: "0.79", }, { eid: "e5796", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "3040.717", weight: "12000", embodiedLand: "3410.976", embodiedWater: "1416", }, { eid: "e5797", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "10.2", weight: "22.5", embodiedLand: "9.765", embodiedWater: "4.14", }, { eid: "e5798", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5928.904", weight: "27800", embodiedLand: "8141.021", embodiedWater: "5087.4", }, { eid: "e5799", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Oats", year: "2015", value: "12.5758647", weight: "18.1209308", embodiedLand: "9.21064206", embodiedWater: "", }, { eid: "e5800", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.085", weight: "0.05", embodiedLand: "0.004", embodiedWater: "", }, { eid: "e5801", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "126.649", weight: "523.72", embodiedLand: "", embodiedWater: "", }, { eid: "e5802", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.005", weight: "0.02", embodiedLand: "0.006", embodiedWater: "0.002", }, { eid: "e5803", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9979.327", weight: "49080.54", embodiedLand: "", embodiedWater: "", }, { eid: "e5804", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9773.51", weight: "50317.92", embodiedLand: "", embodiedWater: "", }, { eid: "e5805", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1120.625", weight: "6464.72", embodiedLand: "", embodiedWater: "", }, { eid: "e5806", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Wheat", year: "2016", value: "6.55", weight: "13.716", embodiedLand: "", embodiedWater: "", }, { eid: "e5807", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "66.234", weight: "130.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5808", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "59.9755096", weight: "147.628533", embodiedLand: "", embodiedWater: "", }, { eid: "e5809", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Oats", year: "2016", value: "7.622", weight: "13.025", embodiedLand: "", embodiedWater: "", }, { eid: "e5810", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Oats", year: "2016", value: "32.2000609", weight: "184.508668", embodiedLand: "", embodiedWater: "", }, { eid: "e5811", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "3824.84552", weight: "18150", embodiedLand: "", embodiedWater: "", }, { eid: "e5812", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Buckwheat", year: "2016", value: "1.014", weight: "1.003", embodiedLand: "", embodiedWater: "", }, { eid: "e5813", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "47.074", weight: "169", embodiedLand: "", embodiedWater: "", }, { eid: "e5814", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "0.9", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5823", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "72.763", weight: "511.55", embodiedLand: "1.752", embodiedWater: "713.612", }, { eid: "e5824", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "5860.639", weight: "25633.05", embodiedLand: "", embodiedWater: "", }, { eid: "e5825", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "43.94", weight: "396.75", embodiedLand: "", embodiedWater: "", }, { eid: "e5832", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.003", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e5833", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.008", weight: "0.013", embodiedLand: "", embodiedWater: "0.124", }, { eid: "e5834", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "278.215", weight: "344.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5941", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "8", targetSimName: "ALB", targetName: "Albania", targetRegion: "Europe", resource: "Oats", year: "2015", value: "11.037", weight: "21.99", embodiedLand: "11.308", embodiedWater: "", }, { eid: "e5942", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "952.419598", weight: "1777.69802", embodiedLand: "536.005575", embodiedWater: "154.659357", }, { eid: "e5943", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "0.142", weight: "0.029", embodiedLand: "", embodiedWater: "", }, { eid: "e5944", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "17.5941818", weight: "11.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5945", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1740.776", weight: "4444.87", embodiedLand: "1391.87", embodiedWater: "902.309", }, { eid: "e5946", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "34.047", weight: "75", embodiedLand: "25.521", embodiedWater: "8.325", }, { eid: "e5947", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "15.553", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e5948", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Maize", year: "2015", value: "10.706", weight: "21.725", embodiedLand: "", embodiedWater: "", }, { eid: "e5949", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "2682.98701", weight: "9850", embodiedLand: "", embodiedWater: "", }, { eid: "e5950", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "0.692", weight: "0.112", embodiedLand: "", embodiedWater: "", }, { eid: "e5951", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "52.1904308", weight: "28.8378857", embodiedLand: "", embodiedWater: "", }, { eid: "e5952", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Rye", year: "2016", value: "150.48433", weight: "617.293342", embodiedLand: "", embodiedWater: "", }, { eid: "e5954", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.229", weight: "0.108", embodiedLand: "", embodiedWater: "", }, { eid: "e5955", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.185", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e5956", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Wheat", year: "2016", value: "25.8723332", weight: "14.75", embodiedLand: "", embodiedWater: "", }, { eid: "e5957", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "2596.166", weight: "14299.874", embodiedLand: "", embodiedWater: "", }, { eid: "e5958", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "624", targetSimName: "GNB", targetName: "Guinea-Bissau", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6.352", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e5959", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7705.296", weight: "32986.13", embodiedLand: "", embodiedWater: "", }, { eid: "e5960", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "18663.554", weight: "101536.876", embodiedLand: "", embodiedWater: "", }, { eid: "e5961", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Wheat", year: "2016", value: "31.423", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e5962", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.777", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e5963", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "40.583", weight: "41", embodiedLand: "", embodiedWater: "", }, { eid: "e5964", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "9794.196", weight: "53649.806", embodiedLand: "", embodiedWater: "", }, { eid: "e5997", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5998", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.021", weight: "0.014", embodiedLand: "", embodiedWater: "", }, { eid: "e5999", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6000", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.32369588", weight: "10", embodiedLand: "2.391", embodiedWater: "1.34", }, { eid: "e6002", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "0.524", weight: "0.9", embodiedLand: "0.216", embodiedWater: "", }, { eid: "e6003", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1472.921", weight: "4490.059", embodiedLand: "819.513", embodiedWater: "1333.547", }, { eid: "e6005", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6006", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.039", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6008", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6009", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.556", weight: "0.108", embodiedLand: "", embodiedWater: "", }, { eid: "e6010", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "0.553", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6029", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.524", weight: "0.24", embodiedLand: "", embodiedWater: "", }, { eid: "e6030", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e6031", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "86.4864968", weight: "333.932001", embodiedLand: "", embodiedWater: "", }, { eid: "e6032", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "4.432", weight: "0.75", embodiedLand: "", embodiedWater: "", }, { eid: "e6033", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.005", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e6054", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.078", weight: "0.03", embodiedLand: "", embodiedWater: "0.068", }, { eid: "e6055", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.012", weight: "0.01", embodiedLand: "", embodiedWater: "0.044", }, { eid: "e6056", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.087", weight: "0.174", embodiedLand: "0.002", embodiedWater: "0.054", }, { eid: "e6057", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.031", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e6058", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rye", year: "2015", value: "0.051", weight: "0.035", embodiedLand: "", embodiedWater: "", }, { eid: "e6059", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2016", value: "2.192", weight: "0.072", embodiedLand: "", embodiedWater: "", }, { eid: "e6060", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6167", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.033", weight: "0.026", embodiedLand: "0.009", embodiedWater: "0.394", }, { eid: "e6168", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "12.24", weight: "22.5", embodiedLand: "1.165", embodiedWater: "57.42", }, { eid: "e6169", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.547", weight: "0.074", embodiedLand: "", embodiedWater: "", }, { eid: "e6170", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "60.178", weight: "39.34", embodiedLand: "0.219", embodiedWater: "24.902", }, { eid: "e6171", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "250.088", weight: "313.5", embodiedLand: "205.235", embodiedWater: "1026.712", }, { eid: "e6172", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "27.338", weight: "16.94", embodiedLand: "0.121", embodiedWater: "0.813", }, { eid: "e6174", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "226", targetSimName: "GNQ", targetName: "Equatorial Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "38.385", weight: "44.028", embodiedLand: "", embodiedWater: "", }, { eid: "e6175", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.444", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e6176", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "39.86", weight: "18.976", embodiedLand: "", embodiedWater: "", }, { eid: "e6177", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "69.327", weight: "39.34", embodiedLand: "", embodiedWater: "", }, { eid: "e6178", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2016", value: "9.794", weight: "4.694", embodiedLand: "", embodiedWater: "", }, { eid: "e6179", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.55", weight: "1.246", embodiedLand: "", embodiedWater: "", }, { eid: "e6180", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "143.017", weight: "99.252", embodiedLand: "", embodiedWater: "", }, { eid: "e6181", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6182", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6185", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6186", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6187", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Rice", year: "2016", value: "134.792", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e6188", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "55.466", weight: "248", embodiedLand: "", embodiedWater: "", }, { eid: "e6189", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "500.517", weight: "1376.74", embodiedLand: "", embodiedWater: "", }, { eid: "e6210", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "20.222", weight: "24", embodiedLand: "11.101", embodiedWater: "285.816", }, { eid: "e6211", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.201", weight: "0.021", embodiedLand: "", embodiedWater: "", }, { eid: "e6212", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6213", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "0.127", weight: "0.024", embodiedLand: "", embodiedWater: "", }, { eid: "e6214", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6215", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "4.948", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e6216", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "0.006", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6270", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "6113.626", weight: "14771.565", embodiedLand: "", embodiedWater: "", }, { eid: "e6271", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6272", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "14.65", weight: "9.6", embodiedLand: "0.224", embodiedWater: "", }, { eid: "e6273", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "97.941", weight: "48", embodiedLand: "5.948", embodiedWater: "", }, { eid: "e6274", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "5.261", weight: "3.36", embodiedLand: "", embodiedWater: "", }, { eid: "e6275", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "7.207", weight: "23.502", embodiedLand: "0.48152987", embodiedWater: "30.8105997", }, { eid: "e6276", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2.151", weight: "5.43", embodiedLand: "", embodiedWater: "", }, { eid: "e6277", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "18.135", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e6278", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "24.9972232", weight: "43.4084916", embodiedLand: "", embodiedWater: "", }, { eid: "e6280", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6.101", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e6281", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.00156596", weight: "0.00208085", embodiedLand: "", embodiedWater: "", }, { eid: "e6282", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.973", weight: "1.347", embodiedLand: "", embodiedWater: "", }, { eid: "e6293", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.236", weight: "0.2", embodiedLand: "0.017", embodiedWater: "0.139", }, { eid: "e6294", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "16.391", weight: "25", embodiedLand: "7.002", embodiedWater: "204.525", }, { eid: "e6295", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.018", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e6330", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.043", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6331", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "41.478", weight: "30.58", embodiedLand: "", embodiedWater: "", }, { eid: "e6332", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.007", weight: "0.029", embodiedLand: "", embodiedWater: "", }, { eid: "e6333", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6334", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "353.845136", weight: "1878.10933", embodiedLand: "15.5904614", embodiedWater: "3562.77322", }, { eid: "e6335", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "17.786", weight: "42", embodiedLand: "0.943", embodiedWater: "91.056", }, { eid: "e6336", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6337", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "2562.825", weight: "4828.532", embodiedLand: "", embodiedWater: "", }, { eid: "e6437", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Maize", year: "2015", value: "4.35799817", weight: "5.965", embodiedLand: "", embodiedWater: "", }, { eid: "e6438", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.96291721", weight: "1.082", embodiedLand: "0.251", embodiedWater: "2.028", }, { eid: "e6439", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.711", weight: "0.063", embodiedLand: "", embodiedWater: "", }, { eid: "e6440", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Oats", year: "2015", value: "1.881", weight: "0.334", embodiedLand: "", embodiedWater: "", }, { eid: "e6441", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "1.067", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e6442", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "161.633092", weight: "131.698943", embodiedLand: "103.093103", embodiedWater: "356.509274", }, { eid: "e6443", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.013", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e6444", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "337.977", weight: "582.999", embodiedLand: "", embodiedWater: "", }, { eid: "e6445", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.711", weight: "1.526", embodiedLand: "0.37", embodiedWater: "84.283", }, { eid: "e6446", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "4579.296", weight: "12984.96", embodiedLand: "3316.527", embodiedWater: "366708.255", }, { eid: "e6447", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "0.017", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e6448", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.24", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e6449", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1.862", weight: "1.02", embodiedLand: "", embodiedWater: "", }, { eid: "e6451", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6452", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "6917.997", weight: "32990.35", embodiedLand: "", embodiedWater: "", }, { eid: "e6453", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "3719.013", weight: "13050", embodiedLand: "", embodiedWater: "", }, { eid: "e6454", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.221", weight: "0.544", embodiedLand: "", embodiedWater: "", }, { eid: "e6455", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "42.933", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e6469", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "14.193", weight: "24.894", embodiedLand: "1.244", embodiedWater: "132.162", }, { eid: "e6470", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.077", weight: "0.186", embodiedLand: "", embodiedWater: "", }, { eid: "e6471", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2016", value: "88.215", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e6472", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6473", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Buckwheat", year: "2016", value: "0.254", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e6532", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "8", targetSimName: "ALB", targetName: "Albania", targetRegion: "Europe", resource: "Oats", year: "2015", value: "8.045", weight: "44", embodiedLand: "3.73", embodiedWater: "", }, { eid: "e6533", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.13", weight: "0.21", embodiedLand: "0.005", embodiedWater: "0.438", }, { eid: "e6534", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "15.064", weight: "43.85", embodiedLand: "", embodiedWater: "", }, { eid: "e6535", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "326.546", weight: "1813.443", embodiedLand: "499.351", embodiedWater: "223.053", }, { eid: "e6536", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "3.85", weight: "25", embodiedLand: "4.393", embodiedWater: "5.775", }, { eid: "e6537", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "3.266", weight: "21", embodiedLand: "0.97", embodiedWater: "69.3", }, { eid: "e6538", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.59555736", weight: "0.96", embodiedLand: "0.038", embodiedWater: "5.211", }, { eid: "e6539", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.06377214", weight: "0.08899229", embodiedLand: "", embodiedWater: "0.05394042", }, { eid: "e6540", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "222.69", weight: "1394.035", embodiedLand: "436.708", embodiedWater: "224.44", }, { eid: "e6541", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Barley", year: "2015", value: "988.605", weight: "5010.909", embodiedLand: "1241.576", embodiedWater: "410.895", }, { eid: "e6542", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.986", weight: "9.5", embodiedLand: "0.479", embodiedWater: "45.277", }, { eid: "e6543", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "1092.675", weight: "6495", embodiedLand: "", embodiedWater: "", }, { eid: "e6544", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "452.602", weight: "2038.64", embodiedLand: "", embodiedWater: "", }, { eid: "e6545", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Oats", year: "2016", value: "6.63923657", weight: "5.90356819", embodiedLand: "", embodiedWater: "", }, { eid: "e6546", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "288.901", weight: "2028.38", embodiedLand: "", embodiedWater: "", }, { eid: "e6547", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3353.129", weight: "19610.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6548", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "948.934454", weight: "4372.09334", embodiedLand: "", embodiedWater: "", }, { eid: "e6549", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.002", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6550", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "79.648", weight: "504.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6551", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1726.318", weight: "9113.49", embodiedLand: "", embodiedWater: "", }, { eid: "e6567", source: "499", sourceSimName: "MNE", sourceRegion: "Montenegro", sourceName: "Europe", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.01797173", weight: "0.839", embodiedLand: "0.003", embodiedWater: "0.103", }, { eid: "e6568", source: "499", sourceSimName: "MNE", sourceRegion: "Montenegro", sourceName: "Europe", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.084", weight: "0.085", embodiedLand: "", embodiedWater: "", }, { eid: "e6655", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "1.865", weight: "0.451", embodiedLand: "", embodiedWater: "", }, { eid: "e6656", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "13.841", weight: "13.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6657", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.084", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e6658", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "14.0198093", weight: "10.0095949", embodiedLand: "", embodiedWater: "", }, { eid: "e6659", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "0.984", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e6660", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.221", weight: "0.175", embodiedLand: "", embodiedWater: "", }, { eid: "e6661", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.444", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e6662", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "40.732751", weight: "37.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6663", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Wheat", year: "2016", value: "0.1", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e6664", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "6.389", weight: "6.25", embodiedLand: "", embodiedWater: "", }, { eid: "e6666", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.611", weight: "0.722", embodiedLand: "", embodiedWater: "", }, { eid: "e6667", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2.014", weight: "3.382", embodiedLand: "", embodiedWater: "", }, { eid: "e6690", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "227.071", weight: "1000.665", embodiedLand: "616.851", embodiedWater: "729.485", }, { eid: "e6691", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "3.486", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e6692", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.194", weight: "0.633", embodiedLand: "0.042", embodiedWater: "4.535", }, { eid: "e6693", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.126", weight: "0.014", embodiedLand: "", embodiedWater: "", }, { eid: "e6694", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.043", weight: "0.295", embodiedLand: "", embodiedWater: "", }, { eid: "e6695", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "4.596", weight: "6", embodiedLand: "", embodiedWater: "", }, { eid: "e6696", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "0.02", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6697", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.115", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e6698", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "1.767", weight: "0.573", embodiedLand: "", embodiedWater: "", }, { eid: "e6739", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "30.039", weight: "20", embodiedLand: "0.17", embodiedWater: "2.22", }, { eid: "e6740", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6741", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "187.414", weight: "81.513", embodiedLand: "", embodiedWater: "", }, { eid: "e6742", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "443.222", weight: "441.628", embodiedLand: "167.33", embodiedWater: "7857.887", }, { eid: "e6743", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.067", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6744", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2016", value: "49.186", weight: "24.728", embodiedLand: "", embodiedWater: "", }, { eid: "e6745", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.135", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e6746", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1413.126", weight: "572.235", embodiedLand: "", embodiedWater: "", }, { eid: "e6747", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "2.074", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e6802", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.001", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6803", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6804", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5.327", weight: "19.153", embodiedLand: "", embodiedWater: "", }, { eid: "e6805", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.004", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e6806", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.702", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6807", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6808", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.212", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e6809", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.228", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e6810", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.019", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e6811", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6812", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.013", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6833", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.219", weight: "0.503", embodiedLand: "0.001", embodiedWater: "0.015", }, { eid: "e6834", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "193.924", weight: "375", embodiedLand: "194.083", embodiedWater: "3776.25", }, { eid: "e6835", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "11.017", weight: "19.5", embodiedLand: "8.554", embodiedWater: "382.551", }, { eid: "e6836", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.091", weight: "0.02", embodiedLand: "0.001", embodiedWater: "", }, { eid: "e6837", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "64", targetSimName: "BTN", targetName: "Bhutan", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "77.909", weight: "306", embodiedLand: "", embodiedWater: "", }, { eid: "e6838", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.098", weight: "0.095", embodiedLand: "", embodiedWater: "", }, { eid: "e6839", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.403", weight: "0.365", embodiedLand: "", embodiedWater: "", }, { eid: "e6840", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "0.1", weight: "0.023", embodiedLand: "", embodiedWater: "", }, { eid: "e7020", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "20", targetSimName: "AND", targetName: "Andorra", targetRegion: "Europe", resource: "Barley", year: "2015", value: "0.011", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e7021", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.039", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e7022", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "238", targetSimName: "FLK", targetName: "Falkland Isds (Malvinas)", targetRegion: "South America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7023", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "0.003", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e7024", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "308", targetSimName: "GRD", targetName: "Grenada", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "0.001", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e7025", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Barley", year: "2015", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7026", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "15.929", weight: "3.746", embodiedLand: "", embodiedWater: "", }, { eid: "e7027", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "674", targetSimName: "SMR", targetName: "San Marino", targetRegion: "Europe", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7028", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "7.672", weight: "15", embodiedLand: "", embodiedWater: "", }, { eid: "e7030", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "7.506", weight: "15", embodiedLand: "", embodiedWater: "", }, { eid: "e7031", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7032", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "30.968", weight: "60", embodiedLand: "", embodiedWater: "", }, { eid: "e7047", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7048", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7049", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7059", source: "533", sourceSimName: "ABW", sourceRegion: "Aruba", sourceName: "Caribbean and Central America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e7062", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7063", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7064", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7072", source: "540", sourceSimName: "NCL", sourceRegion: "New Caledonia", sourceName: "Oceania", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.055", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e7073", source: "540", sourceSimName: "NCL", sourceRegion: "New Caledonia", sourceName: "Oceania", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7163", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "7.521", weight: "0.435", embodiedLand: "", embodiedWater: "", }, { eid: "e7164", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.288", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e7165", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.328", weight: "0.094", embodiedLand: "", embodiedWater: "", }, { eid: "e7166", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "26.252", weight: "1.208", embodiedLand: "", embodiedWater: "", }, { eid: "e7167", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7168", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7169", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "20.355", weight: "23.559", embodiedLand: "", embodiedWater: "", }, { eid: "e7188", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "0.004", }, { eid: "e7189", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "21.386", weight: "136.7", embodiedLand: "", embodiedWater: "", }, { eid: "e7190", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "0.379", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e7191", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "1.356", weight: "0.982", embodiedLand: "", embodiedWater: "", }, { eid: "e7192", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "48.951", weight: "141", embodiedLand: "", embodiedWater: "", }, { eid: "e7193", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.256", weight: "2.13", embodiedLand: "", embodiedWater: "", }, { eid: "e7221", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7222", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Oats", year: "2015", value: "2.966", weight: "2.817", embodiedLand: "0.349", embodiedWater: "", }, { eid: "e7223", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "20.293", weight: "15.962", embodiedLand: "", embodiedWater: "", }, { eid: "e7224", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "20.609", weight: "35", embodiedLand: "21.084", embodiedWater: "566.545", }, { eid: "e7225", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "14.981", weight: "28.684", embodiedLand: "", embodiedWater: "", }, { eid: "e7226", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rice", year: "2015", value: "249.489", weight: "370", embodiedLand: "118.35", embodiedWater: "54063.29", }, { eid: "e7227", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "48.184", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e7228", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "177.342", weight: "265.715", embodiedLand: "", embodiedWater: "", }, { eid: "e7229", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7230", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "48.184", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e7231", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2016", value: "29.038", weight: "39.727", embodiedLand: "", embodiedWater: "", }, { eid: "e7305", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.338", weight: "0.073", embodiedLand: "", embodiedWater: "", }, { eid: "e7306", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.014", weight: "0.01", embodiedLand: "0.009", embodiedWater: "", }, { eid: "e7307", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "672", weight: "3264.727", embodiedLand: "", embodiedWater: "", }, { eid: "e7308", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.087", weight: "0.07", embodiedLand: "0.002", embodiedWater: "0.106", }, { eid: "e7309", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.039", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e7310", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "1.882", weight: "0.84", embodiedLand: "0.003", embodiedWater: "", }, { eid: "e7311", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "12.401", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e7312", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7313", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "11.331", weight: "23.94", embodiedLand: "", embodiedWater: "", }, { eid: "e7358", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "108.657", weight: "200.963", embodiedLand: "", embodiedWater: "", }, { eid: "e7359", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "98.433", weight: "151.2", embodiedLand: "", embodiedWater: "", }, { eid: "e7360", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "1.211", weight: "4.3", embodiedLand: "0.062", embodiedWater: "10.109", }, { eid: "e7361", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "6.125", weight: "6.503", embodiedLand: "", embodiedWater: "", }, { eid: "e7362", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "22.616", weight: "41.331", embodiedLand: "", embodiedWater: "", }, { eid: "e7363", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Buckwheat", year: "2015", value: "0.125", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e7364", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.165", weight: "0.055", embodiedLand: "", embodiedWater: "", }, { eid: "e7365", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7366", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "0.183", weight: "0.152", embodiedLand: "0.002", embodiedWater: "0.036", }, { eid: "e7367", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.024", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e7368", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.222", weight: "0.65", embodiedLand: "", embodiedWater: "", }, { eid: "e7369", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Wheat", year: "2016", value: "143.971", weight: "104.75", embodiedLand: "", embodiedWater: "", }, { eid: "e7370", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.444", weight: "0.939", embodiedLand: "", embodiedWater: "", }, { eid: "e7371", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "2.662", weight: "4.95", embodiedLand: "", embodiedWater: "", }, { eid: "e7372", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "241.798", weight: "172.775", embodiedLand: "", embodiedWater: "", }, { eid: "e7373", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "7.72031118", weight: "13.3129919", embodiedLand: "", embodiedWater: "", }, { eid: "e7374", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.143", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e7375", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "4.572", weight: "0.64", embodiedLand: "", embodiedWater: "", }, { eid: "e7379", source: "581", sourceSimName: "UMI", sourceRegion: "United States Minor Outlying Isds", sourceName: "Oceania", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7380", source: "581", sourceSimName: "UMI", sourceRegion: "United States Minor Outlying Isds", sourceName: "Oceania", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7384", source: "584", sourceSimName: "MHL", sourceRegion: "Marshall Isds", sourceName: "Oceania", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "173.38", weight: "514.539", embodiedLand: "", embodiedWater: "", }, { eid: "e7551", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "7.467", weight: "8.962", embodiedLand: "", embodiedWater: "", }, { eid: "e7552", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "1.749", weight: "0.657", embodiedLand: "", embodiedWater: "", }, { eid: "e7553", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "533", targetSimName: "ABW", targetName: "Aruba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "14.707", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e7554", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.019", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e7555", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.665", weight: "0.191", embodiedLand: "0.00237267", embodiedWater: "2.86855901", }, { eid: "e7556", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "45.897", weight: "108", embodiedLand: "94.494", embodiedWater: "993.276", }, { eid: "e7557", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "798", targetSimName: "TUV", targetName: "Tuvalu", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "33.126", weight: "85", embodiedLand: "49.298", embodiedWater: "519.945", }, { eid: "e7558", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "11.969", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e7600", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "0.135", weight: "0.021", embodiedLand: "", embodiedWater: "", }, { eid: "e7601", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Rice", year: "2015", value: "17.396", weight: "5.44", embodiedLand: "", embodiedWater: "", }, { eid: "e7602", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.484", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e7603", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "89.077", weight: "262", embodiedLand: "14.9602", embodiedWater: "24.628", }, { eid: "e7604", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "140.541", weight: "1387.5", embodiedLand: "722.268", embodiedWater: "10034.4", }, { eid: "e7605", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "2.5", weight: "5.26", embodiedLand: "", embodiedWater: "", }, { eid: "e7606", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "58.626", weight: "142.99", embodiedLand: "", embodiedWater: "", }, { eid: "e7607", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2016", value: "0.478", weight: "0.354", embodiedLand: "", embodiedWater: "", }, { eid: "e7608", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.908", weight: "1.673", embodiedLand: "", embodiedWater: "", }, { eid: "e7609", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.489", weight: "0.251", embodiedLand: "", embodiedWater: "", }, { eid: "e7610", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2.519", weight: "4.65", embodiedLand: "", embodiedWater: "", }, { eid: "e7611", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "22", weight: "110", embodiedLand: "", embodiedWater: "", }, { eid: "e7612", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "17.307", weight: "25.04", embodiedLand: "", embodiedWater: "", }, { eid: "e7613", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7614", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Barley", year: "2016", value: "2.04", weight: "3.056", embodiedLand: "", embodiedWater: "", }, { eid: "e7627", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7628", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7629", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7701", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.09", weight: "0.056", embodiedLand: "0.022", embodiedWater: "0.002", }, { eid: "e7702", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "21.12", weight: "23.76", embodiedLand: "4.716", embodiedWater: "141.396", }, { eid: "e7703", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "253.201", weight: "2164.51", embodiedLand: "", embodiedWater: "", }, { eid: "e7704", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "176", weight: "2000", embodiedLand: "512.183", embodiedWater: "244", }, { eid: "e7705", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.002", weight: "0.008", embodiedLand: "0.002", embodiedWater: "0.002", }, { eid: "e7706", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Maize", year: "2015", value: "43.718", weight: "321.454", embodiedLand: "99.0839337", embodiedWater: "39.2173983", }, { eid: "e7707", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "3.926", weight: "1.034", embodiedLand: "", embodiedWater: "", }, { eid: "e7708", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "110", weight: "1100", embodiedLand: "264.036", embodiedWater: "247.5", }, { eid: "e7709", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "4903.23583", weight: "30611.0521", embodiedLand: "7784.12365", embodiedWater: "4254.93621", }, { eid: "e7710", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "133.791", weight: "200.04", embodiedLand: "37.571", embodiedWater: "3567.513", }, { eid: "e7711", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "2.368", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e7712", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "6301.54229", weight: "39230.597", embodiedLand: "9966.60233", embodiedWater: "4825.3641", }, { eid: "e7713", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "10163.8981", weight: "51351.1604", embodiedLand: "", embodiedWater: "", }, { eid: "e7714", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "145.554268", weight: "317.548282", embodiedLand: "", embodiedWater: "", }, { eid: "e7715", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "14598.991", weight: "82200.1", embodiedLand: "", embodiedWater: "", }, { eid: "e7716", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.114", weight: "0.114", embodiedLand: "", embodiedWater: "", }, { eid: "e7717", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2016", value: "313.761", weight: "653.634", embodiedLand: "", embodiedWater: "", }, { eid: "e7718", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2016", value: "38", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e7820", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7821", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "1.728", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7822", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "1.665", weight: "0.358", embodiedLand: "", embodiedWater: "", }, { eid: "e7823", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "3.026", weight: "5.379", embodiedLand: "", embodiedWater: "", }, { eid: "e7824", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "28.047", weight: "7.81", embodiedLand: "", embodiedWater: "", }, { eid: "e7825", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Millet", year: "2015", value: "0.81", weight: "0.252", embodiedLand: "", embodiedWater: "0.023", }, { eid: "e7826", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.355", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e7827", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "5.1145", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7828", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "215.438505", weight: "23.9549268", embodiedLand: "", embodiedWater: "", }, { eid: "e7829", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "73.9066099", weight: "25.626565", embodiedLand: "", embodiedWater: "", }, { eid: "e7830", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "3.99", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7831", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.44", weight: "0.6", embodiedLand: "", embodiedWater: "2.623", }, { eid: "e7832", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.51186012", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e7833", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.093", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e7834", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "42.54", weight: "15.6", embodiedLand: "", embodiedWater: "", }, { eid: "e7835", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "64.745", weight: "19.635", embodiedLand: "", embodiedWater: "", }, { eid: "e7836", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "1.872", weight: "0.8", embodiedLand: "", embodiedWater: "", }, { eid: "e7912", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.46", weight: "0.249", embodiedLand: "", embodiedWater: "", }, { eid: "e7913", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.823", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e7914", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.379", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e7915", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.149", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e7916", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "1.659", weight: "0.955", embodiedLand: "", embodiedWater: "", }, { eid: "e7917", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.502", weight: "0.139", embodiedLand: "0.045", embodiedWater: "1.387", }, { eid: "e7918", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.1", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e7919", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Oats", year: "2016", value: "48.872", weight: "81", embodiedLand: "", embodiedWater: "", }, { eid: "e7920", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "296", targetSimName: "KIR", targetName: "Kiribati", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7921", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.177", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7922", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7923", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.076", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7924", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "1.403", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7927", source: "612", sourceSimName: "PCN", sourceRegion: "Pitcairn", sourceName: "Oceania", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8061", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.139", weight: "0.145", embodiedLand: "", embodiedWater: "", }, { eid: "e8064", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.047", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e8065", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "244.824", weight: "507.82", embodiedLand: "154.861", embodiedWater: "22.852", }, { eid: "e8066", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "70.822", weight: "231", embodiedLand: "31.512", embodiedWater: "476.553", }, { eid: "e8067", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "12161.233", weight: "57149.4", embodiedLand: "12254.953", embodiedWater: "180420.656", }, { eid: "e8068", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.272", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e8070", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Maize", year: "2015", value: "220.92779", weight: "400.073031", embodiedLand: "", embodiedWater: "", }, { eid: "e8071", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "0.007", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8072", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1248.54", weight: "5500", embodiedLand: "", embodiedWater: "", }, { eid: "e8073", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "302.5090046", weight: "656.733934", embodiedLand: "", embodiedWater: "", }, { eid: "e8074", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1502.111", weight: "7201.4", embodiedLand: "", embodiedWater: "", }, { eid: "e8075", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "691.763", weight: "1537.68", embodiedLand: "", embodiedWater: "", }, { eid: "e8076", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Barley", year: "2016", value: "0.046", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e8077", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "1568.202", weight: "4027.12", embodiedLand: "", embodiedWater: "", }, { eid: "e8078", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "80.973", weight: "434.92", embodiedLand: "", embodiedWater: "", }, { eid: "e8162", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Rice", year: "2015", value: "56.829", weight: "75", embodiedLand: "21.703", embodiedWater: "1097.55", }, { eid: "e8163", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Rice", year: "2015", value: "50.3339085", weight: "45.9143482", embodiedLand: "", embodiedWater: "", }, { eid: "e8164", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "58.8618795", weight: "87.6717437", embodiedLand: "29.8536241", embodiedWater: "1680.66691", }, { eid: "e8165", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.028", weight: "0.02", embodiedLand: "", embodiedWater: "0.032", }, { eid: "e8166", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.68987608", weight: "0.56109969", embodiedLand: "0.0422374", embodiedWater: "", }, { eid: "e8167", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "18.006", weight: "28", embodiedLand: "22.605", embodiedWater: "", }, { eid: "e8168", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Rice", year: "2015", value: "36.111", weight: "50", embodiedLand: "13.661", embodiedWater: "723.6", }, { eid: "e8169", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "535", targetSimName: "BES", targetName: "Bonaire", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.166", weight: "0.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8170", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8172", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8173", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "267.644962", weight: "510", embodiedLand: "", embodiedWater: "", }, { eid: "e8174", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "456.64271", weight: "587.244797", embodiedLand: "", embodiedWater: "", }, { eid: "e8175", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "292", targetSimName: "GIB", targetName: "Gibraltar", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8176", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "1.756", weight: "1.765", embodiedLand: "", embodiedWater: "", }, { eid: "e8177", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.143", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e8178", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.004", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e8179", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.046", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e8180", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "8.027", weight: "34.041", embodiedLand: "", embodiedWater: "", }, { eid: "e8182", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.009", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e8183", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8184", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Rice", year: "2016", value: "0.272", weight: "0.204", embodiedLand: "", embodiedWater: "", }, { eid: "e8216", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "1.97", weight: "32", embodiedLand: "", embodiedWater: "", }, { eid: "e8217", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.082", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e8219", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "60.79", weight: "74.981", embodiedLand: "2.912", embodiedWater: "1094.423", }, { eid: "e8220", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Oats", year: "2015", value: "83.636", weight: "34.8", embodiedLand: "", embodiedWater: "", }, { eid: "e8221", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.007", weight: "0.001", embodiedLand: "0.00009091", embodiedWater: "0.00372727", }, { eid: "e8222", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "18.134", weight: "45.408", embodiedLand: "0.035", embodiedWater: "79.873", }, { eid: "e8223", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.824", weight: "10", embodiedLand: "3.735", embodiedWater: "104.17", }, { eid: "e8224", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.059", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e8225", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8226", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.458", weight: "0.054", embodiedLand: "", embodiedWater: "", }, { eid: "e8227", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Rye", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8324", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2595", weight: "15000", embodiedLand: "3360.071", embodiedWater: "28275", }, { eid: "e8325", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.03", weight: "0.024", embodiedLand: "0.004", embodiedWater: "0.017", }, { eid: "e8326", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "11237.2354", weight: "56273.1014", embodiedLand: "17817.2079", embodiedWater: "134548.986", }, { eid: "e8327", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1985", weight: "10000", embodiedLand: "", embodiedWater: "", }, { eid: "e8329", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "4093.718", weight: "15865.57", embodiedLand: "", embodiedWater: "", }, { eid: "e8330", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "214.3", weight: "960", embodiedLand: "", embodiedWater: "", }, { eid: "e8331", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1094.973", weight: "7050.24", embodiedLand: "", embodiedWater: "", }, { eid: "e8332", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "228.149", weight: "1193.19", embodiedLand: "", embodiedWater: "", }, { eid: "e8333", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "3847.356", weight: "21928.554", embodiedLand: "", embodiedWater: "", }, { eid: "e8334", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1553.1", weight: "10000", embodiedLand: "", embodiedWater: "", }, { eid: "e8335", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "142.45", weight: "230", embodiedLand: "", embodiedWater: "", }, { eid: "e8468", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "7.432", weight: "10.771", embodiedLand: "", embodiedWater: "", }, { eid: "e8469", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1384.377", weight: "3256", embodiedLand: "1499.247", embodiedWater: "5655.672", }, { eid: "e8470", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "301.524", weight: "261.39", embodiedLand: "", embodiedWater: "", }, { eid: "e8471", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8472", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "13.5", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8473", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.156", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e8474", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.204", weight: "0.47", embodiedLand: "", embodiedWater: "", }, { eid: "e8475", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "1585.217", weight: "11000", embodiedLand: "", embodiedWater: "", }, { eid: "e8476", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "202.572054", weight: "1050", embodiedLand: "269.74", embodiedWater: "5738.25", }, { eid: "e8478", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1198.008", weight: "7131", embodiedLand: "2927.035", embodiedWater: "11794.674", }, { eid: "e8480", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1798.27193", weight: "8589.5235", embodiedLand: "", embodiedWater: "", }, { eid: "e8481", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1929.019", weight: "9904", embodiedLand: "", embodiedWater: "", }, { eid: "e8482", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "11.153", weight: "45.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8483", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "25.0980149", weight: "103.92", embodiedLand: "", embodiedWater: "", }, { eid: "e8484", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1427.83359", weight: "6406.65847", embodiedLand: "", embodiedWater: "", }, { eid: "e8485", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Oats", year: "2016", value: "0.039", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e8486", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "257.303", weight: "957", embodiedLand: "", embodiedWater: "", }, { eid: "e8506", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.172", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e8507", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8508", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.177", weight: "0.178", embodiedLand: "", embodiedWater: "", }, { eid: "e8524", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8526", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8527", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "12.999", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8531", source: "660", sourceSimName: "AIA", sourceRegion: "Anguilla", sourceName: "Caribbean and Central America", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8545", source: "662", sourceSimName: "LCA", sourceRegion: "Saint Lucia", sourceName: "Caribbean and Central America", target: "92", targetSimName: "VGB", targetName: "British Virgin Isds", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.005", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e8546", source: "662", sourceSimName: "LCA", sourceRegion: "Saint Lucia", sourceName: "Caribbean and Central America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.02", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e8547", source: "666", sourceSimName: "SPM", sourceRegion: "Saint Pierre and Miquelon", sourceName: "North America", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8565", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8566", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Barley", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8567", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.002", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e8568", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8573", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.172", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e8574", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.09", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e8575", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "838", targetSimName: "", targetName: "Free Zones", targetRegion: "Other", resource: "Other cereals", year: "2016", value: "0.26", weight: "1.155", embodiedLand: "", embodiedWater: "", }, { eid: "e8652", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.001", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e8653", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8654", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "5.48", weight: "21.772", embodiedLand: "7.63664924", embodiedWater: "109.904952", }, { eid: "e8655", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "1.067", weight: "0.859", embodiedLand: "0.014", embodiedWater: "0.338", }, { eid: "e8656", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.97", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e8657", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "3.115", weight: "2.5", embodiedLand: "0.292", embodiedWater: "34.81", }, { eid: "e8658", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.057", weight: "0.026", embodiedLand: "", embodiedWater: "0.301", }, { eid: "e8659", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "12.838", weight: "16", embodiedLand: "", embodiedWater: "", }, { eid: "e8660", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8661", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "0.252", weight: "0.275", embodiedLand: "", embodiedWater: "", }, { eid: "e8662", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.509", weight: "1.51", embodiedLand: "", embodiedWater: "", }, { eid: "e8663", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.013", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e8664", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "7.747", weight: "5.335", embodiedLand: "", embodiedWater: "", }, { eid: "e8718", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.062", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e8720", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.711", weight: "0.212", embodiedLand: "", embodiedWater: "", }, { eid: "e8721", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "20", targetSimName: "AND", targetName: "Andorra", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.085", weight: "0.026", embodiedLand: "", embodiedWater: "", }, { eid: "e8722", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.302", weight: "1.31", embodiedLand: "", embodiedWater: "", }, { eid: "e8723", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.53", weight: "1.14", embodiedLand: "", embodiedWater: "", }, { eid: "e8724", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.214", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e8725", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "666", targetSimName: "SPM", targetName: "Saint Pierre and Miquelon", targetRegion: "North America", resource: "Rice", year: "2016", value: "84", weight: "261.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8726", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.011", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e8794", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5.967", weight: "21.5", embodiedLand: "6.634", embodiedWater: "5.268", }, { eid: "e8796", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.02", weight: "0.028", embodiedLand: "0.009", embodiedWater: "0.012", }, { eid: "e8797", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8798", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "86.2366732", weight: "177.68999", embodiedLand: "", embodiedWater: "", }, { eid: "e8800", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "129.178771", weight: "288.216749", embodiedLand: "", embodiedWater: "", }, { eid: "e8801", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "13.403", weight: "45.042", embodiedLand: "13.431", embodiedWater: "10.225", }, { eid: "e8802", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "26.6315535", weight: "63", embodiedLand: "", embodiedWater: "", }, { eid: "e8803", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "0.11", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e8804", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "277.534", weight: "46.233", embodiedLand: "", embodiedWater: "", }, { eid: "e8805", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.001", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e8806", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.013", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e8807", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "61.871", weight: "225.4", embodiedLand: "", embodiedWater: "", }, { eid: "e8808", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2016", value: "0.51515098", weight: "0.9", embodiedLand: "", embodiedWater: "", }, { eid: "e8809", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2016", value: "0.25833351", weight: "0.76309616", embodiedLand: "", embodiedWater: "", }, { eid: "e8810", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1.96", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8817", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8818", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "18.484", weight: "75", embodiedLand: "0.094", embodiedWater: "95.025", }, { eid: "e8819", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "12.553", weight: "25.427", embodiedLand: "", embodiedWater: "", }, { eid: "e8820", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8821", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "15.778", weight: "69", embodiedLand: "", embodiedWater: "", }, { eid: "e8835", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "7.786", weight: "2.5", embodiedLand: "1.293", embodiedWater: "0.832", }, { eid: "e8836", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "1.502", weight: "2.93", embodiedLand: "2.545", embodiedWater: "27.483", }, { eid: "e8837", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8838", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8839", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "0.401", weight: "0.519", embodiedLand: "", embodiedWater: "", }, { eid: "e8840", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "12.13", weight: "10.403", embodiedLand: "", embodiedWater: "", }, { eid: "e8841", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.072", weight: "0.36", embodiedLand: "", embodiedWater: "", }, { eid: "e8842", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9039", source: "699", sourceSimName: "IND", sourceRegion: "India", sourceName: "South Asia", target: "581", targetSimName: "UMI", targetName: "United States Minor Outlying Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "10.376", weight: "18", embodiedLand: "", embodiedWater: "", }, { eid: "e9154", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.016", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9155", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "520", targetSimName: "NRU", targetName: "Nauru", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.204", weight: "0.12", embodiedLand: "0.037", embodiedWater: "", }, { eid: "e9156", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "39.237", weight: "63.34", embodiedLand: "", embodiedWater: "", }, { eid: "e9157", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "40.244", weight: "48", embodiedLand: "", embodiedWater: "", }, { eid: "e9159", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "316", targetSimName: "GUM", targetName: "Guam", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9160", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.15", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e9161", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "63.252", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9162", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.757", weight: "0.209", embodiedLand: "", embodiedWater: "", }, { eid: "e9224", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "1.768", weight: "1.585", embodiedLand: "", embodiedWater: "", }, { eid: "e9225", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.004", weight: "0.002", embodiedLand: "0.011", embodiedWater: "0.01", }, { eid: "e9226", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "90.739", weight: "210.86", embodiedLand: "23.926", embodiedWater: "208.33", }, { eid: "e9227", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.27", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e9228", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "7", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e9230", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "1729.926", weight: "4000", embodiedLand: "976.835", embodiedWater: "240", }, { eid: "e9231", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "146.145", weight: "460", embodiedLand: "229.046", embodiedWater: "1751.22", }, { eid: "e9232", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "31.674", weight: "42", embodiedLand: "27.568", embodiedWater: "21.294", }, { eid: "e9233", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "344.235", weight: "1266.178", embodiedLand: "306.755", embodiedWater: "4740.57", }, { eid: "e9234", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "20.173", weight: "1.791", embodiedLand: "", embodiedWater: "", }, { eid: "e9235", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "2.155", weight: "1.878", embodiedLand: "", embodiedWater: "", }, { eid: "e9236", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "20.454", weight: "3.653", embodiedLand: "", embodiedWater: "", }, { eid: "e9237", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.332", weight: "0.229", embodiedLand: "", embodiedWater: "", }, { eid: "e9397", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "38.297", weight: "117.657", embodiedLand: "12.759", embodiedWater: "163.896", }, { eid: "e9398", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2015", value: "2.78", weight: "3.285", embodiedLand: "", embodiedWater: "", }, { eid: "e9399", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "100", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e9400", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "580", targetSimName: "MNP", targetName: "N. Mariana Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "28212.429", weight: "50643.596", embodiedLand: "", embodiedWater: "", }, { eid: "e9401", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "19.732", weight: "25.035", embodiedLand: "", embodiedWater: "", }, { eid: "e9402", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "21.917", weight: "30.866", embodiedLand: "", embodiedWater: "", }, { eid: "e9403", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "767.08", weight: "1370", embodiedLand: "", embodiedWater: "", }, { eid: "e9404", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.161", weight: "0.073", embodiedLand: "", embodiedWater: "", }, { eid: "e9405", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.189", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e9460", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "2.115", weight: "1.485", embodiedLand: "0.001", embodiedWater: "", }, { eid: "e9461", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "76.922", weight: "78", embodiedLand: "", embodiedWater: "", }, { eid: "e9462", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.087", weight: "0.043", embodiedLand: "0.003", embodiedWater: "", }, { eid: "e9463", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Maize", year: "2015", value: "285.64339", weight: "1519.634", embodiedLand: "231.021", embodiedWater: "", }, { eid: "e9464", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "91.632", weight: "210.82", embodiedLand: "23.231", embodiedWater: "116.162", }, { eid: "e9465", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.156", weight: "0.041", embodiedLand: "0.01", embodiedWater: "0.436", }, { eid: "e9467", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "6", weight: "3.75", embodiedLand: "0.251", embodiedWater: "36.904", }, { eid: "e9468", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "52.7905262", weight: "139", embodiedLand: "46.698", embodiedWater: "55.739", }, { eid: "e9469", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.906", weight: "22", embodiedLand: "6.456", embodiedWater: "8.844", }, { eid: "e9470", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "2.687", weight: "0.721", embodiedLand: "", embodiedWater: "", }, { eid: "e9471", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.021", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9472", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "14.93823874", weight: "7.86021619", embodiedLand: "0.01751575", embodiedWater: "27.1184749", }, { eid: "e9473", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "4.876", weight: "30.093", embodiedLand: "", embodiedWater: "", }, { eid: "e9474", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.091", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e9483", source: "706", sourceSimName: "SOM", sourceRegion: "Somalia", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9484", source: "706", sourceSimName: "SOM", sourceRegion: "Somalia", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "19.298", weight: "11.899", embodiedLand: "", embodiedWater: "", }, { eid: "e9630", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9631", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.012", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9632", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "226", targetSimName: "GNQ", targetName: "Equatorial Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.057", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e9633", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.053", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e9634", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.267", weight: "0.24", embodiedLand: "", embodiedWater: "", }, { eid: "e9635", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.184", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e9636", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9637", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "776", targetSimName: "TON", targetName: "Tonga", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "21.01", weight: "35", embodiedLand: "", embodiedWater: "", }, { eid: "e9638", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "10.271", weight: "32", embodiedLand: "", embodiedWater: "", }, { eid: "e9639", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "7.992", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e9640", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "291.645", weight: "223.789", embodiedLand: "", embodiedWater: "", }, { eid: "e9641", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "406.568", weight: "326.18", embodiedLand: "", embodiedWater: "", }, { eid: "e9642", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9670", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "249.898", weight: "235.45", embodiedLand: "59.656", embodiedWater: "250.99", }, { eid: "e9671", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.003", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e9672", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "49.652", weight: "10", embodiedLand: "15.749", embodiedWater: "1.39", }, { eid: "e9673", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.082", weight: "0.1", embodiedLand: "", embodiedWater: "0.054", }, { eid: "e9674", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "262.679", weight: "424.094", embodiedLand: "", embodiedWater: "", }, { eid: "e9675", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.017", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9676", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.006", weight: "0.015", embodiedLand: "", embodiedWater: "0.002", }, { eid: "e9677", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.583", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e9678", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.8", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e9679", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "0.05", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9680", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "108.245803", weight: "74.0433696", embodiedLand: "", embodiedWater: "", }, { eid: "e9681", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.073", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e9682", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.04989606", weight: "0.08321444", embodiedLand: "", embodiedWater: "", }, { eid: "e9683", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.01", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9847", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "19.162", weight: "49.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9848", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.104", weight: "0.84", embodiedLand: "", embodiedWater: "", }, { eid: "e9849", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "71.418", weight: "180", embodiedLand: "", embodiedWater: "", }, { eid: "e9850", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "31.3543178", weight: "71.6911179", embodiedLand: "", embodiedWater: "", }, { eid: "e9851", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "0.221", weight: "0.275", embodiedLand: "", embodiedWater: "", }, { eid: "e9852", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "296", targetSimName: "KIR", targetName: "Kiribati", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.098", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9853", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.199", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e9856", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9857", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9889", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.333", weight: "0.31", embodiedLand: "0.02", embodiedWater: "11.447", }, { eid: "e9890", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Sorghum", year: "2015", value: "43.181", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9891", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "20.076", weight: "40", embodiedLand: "69.334", embodiedWater: "202.56", }, { eid: "e9892", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.5", weight: "5", embodiedLand: "5.013", embodiedWater: "44.535", }, { eid: "e9893", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.13", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e9894", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9895", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.091", weight: "0.333", embodiedLand: "", embodiedWater: "", }, { eid: "e9896", source: "732", sourceSimName: "ESH", sourceRegion: "Western Sahara", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9934", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "48.174", weight: "340.23", embodiedLand: "96.561", embodiedWater: "", }, { eid: "e9935", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.073", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9936", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.141", weight: "0.09", embodiedLand: "0.034", embodiedWater: "0.65", }, { eid: "e9937", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.181", weight: "0.15", embodiedLand: "0.054", embodiedWater: "1.152", }, { eid: "e9938", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "10.08", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9939", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "59.563", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9940", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "486", weight: "1800", embodiedLand: "", embodiedWater: "", }, { eid: "e9941", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.02", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e9942", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2459.276", weight: "7800", embodiedLand: "", embodiedWater: "", }, { eid: "e9943", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.296", weight: "45.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9944", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "86.553", weight: "168", embodiedLand: "", embodiedWater: "", }, { eid: "e9945", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "126", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9946", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.625", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9947", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "10.8", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9960", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.105", weight: "26", embodiedLand: "14.55", embodiedWater: "11.804", }, { eid: "e9961", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "5.963", weight: "1.128", embodiedLand: "", embodiedWater: "", }, { eid: "e9962", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.042", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e9963", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.022", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e9964", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "136.368", weight: "352.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10072", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "321.247599", weight: "594.892627", embodiedLand: "157.689777", embodiedWater: "218.325999", }, { eid: "e10073", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "2.166", weight: "0.461", embodiedLand: "", embodiedWater: "", }, { eid: "e10074", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "7.097", weight: "6.153", embodiedLand: "", embodiedWater: "", }, { eid: "e10075", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.949", weight: "1", embodiedLand: "1.187", embodiedWater: "5.89", }, { eid: "e10076", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "293.17", weight: "713", embodiedLand: "176.112", embodiedWater: "7.843", }, { eid: "e10077", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "0.593", weight: "0.373", embodiedLand: "", embodiedWater: "", }, { eid: "e10078", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.542", weight: "7.661", embodiedLand: "2.193", embodiedWater: "28.537", }, { eid: "e10079", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Barley", year: "2015", value: "7903.00956", weight: "26948.6797", embodiedLand: "6860.2467", embodiedWater: "1077.94733", }, { eid: "e10080", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2016", value: "0.537", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e10081", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10082", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "2650.321", weight: "12000", embodiedLand: "", embodiedWater: "", }, { eid: "e10083", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10084", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "4.659", weight: "2.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10085", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "525.239248", weight: "1150.87085", embodiedLand: "", embodiedWater: "", }, { eid: "e10086", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "776.713", weight: "2078", embodiedLand: "", embodiedWater: "", }, { eid: "e10198", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10199", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.236", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10200", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10201", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.103", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10202", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "897.592", weight: "1303.4", embodiedLand: "445.321", embodiedWater: "21745.926", }, { eid: "e10203", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "0.006", weight: "0.004", embodiedLand: "0.005", embodiedWater: "", }, { eid: "e10204", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.011", weight: "0.011", embodiedLand: "", embodiedWater: "0.152", }, { eid: "e10205", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4511.886", weight: "18900", embodiedLand: "3534.409", embodiedWater: "62181", }, { eid: "e10206", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10207", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "70.534", weight: "150.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10208", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Other cereals", year: "2016", value: "6.519", weight: "6.42", embodiedLand: "", embodiedWater: "", }, { eid: "e10209", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.173", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10210", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10211", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.005", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10212", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.429", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10213", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "389.737", weight: "477.087", embodiedLand: "", embodiedWater: "", }, { eid: "e10214", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.041", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10215", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.1431594", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10245", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.064", weight: "0.107", embodiedLand: "", embodiedWater: "", }, { eid: "e10246", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.032", weight: "0.21", embodiedLand: "0.001", embodiedWater: "0.014", }, { eid: "e10247", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.084", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e10248", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "8862.493", weight: "24861.286", embodiedLand: "1247.997", embodiedWater: "1864.596", }, { eid: "e10250", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.791", weight: "1.44", embodiedLand: "", embodiedWater: "", }, { eid: "e10251", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10252", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.045", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e10253", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.034", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e10254", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10255", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2016", value: "2.895", weight: "1.225", embodiedLand: "", embodiedWater: "", }, { eid: "e10264", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "89.465", weight: "296.215", embodiedLand: "159.202", embodiedWater: "74.646", }, { eid: "e10265", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.061", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e10461", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "212", targetSimName: "DMA", targetName: "Dominica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "9.736", weight: "25.006", embodiedLand: "10.644", embodiedWater: "105.225", }, { eid: "e10462", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "234", targetSimName: "FRO", targetName: "Faeroe Isds", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.136", weight: "0.315", embodiedLand: "0.178", embodiedWater: "2.462", }, { eid: "e10464", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.015", weight: "0.01", embodiedLand: "0.004", embodiedWater: "0.091", }, { eid: "e10465", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "17.484", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e10495", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Other cereals", year: "2015", value: "3.112", weight: "7", embodiedLand: "", embodiedWater: "", }, { eid: "e10496", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.283", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10497", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "5", weight: "18.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10498", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "2.60547527", weight: "2.45939658", embodiedLand: "", embodiedWater: "", }, { eid: "e10499", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "17.2519049", weight: "115.598246", embodiedLand: "99.7718139", embodiedWater: "58.6084014", }, { eid: "e10500", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.119", weight: "0.026", embodiedLand: "", embodiedWater: "0.00827273", }, { eid: "e10501", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.19", weight: "0.068", embodiedLand: "", embodiedWater: "", }, { eid: "e10502", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.981", weight: "1.027", embodiedLand: "", embodiedWater: "", }, { eid: "e10509", source: "772", sourceSimName: "TKL", sourceRegion: "Tokelau", sourceName: "Oceania", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10517", source: "776", sourceSimName: "TON", sourceRegion: "Tonga", sourceName: "Oceania", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.113", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10554", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10555", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10556", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10557", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10558", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10559", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10560", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.184", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10561", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10562", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10563", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10564", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10565", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10566", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "0.075", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10703", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "148", targetSimName: "TCD", targetName: "Chad", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10704", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10705", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10706", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10707", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "6.831", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e10708", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.074", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e10709", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.154", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e10778", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "7.737", weight: "1.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10779", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.415", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e10780", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10781", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "8.223", weight: "9.6", embodiedLand: "", embodiedWater: "", }, { eid: "e10782", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "4.469", weight: "2.876", embodiedLand: "", embodiedWater: "", }, { eid: "e10783", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "10.389", weight: "16.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10784", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "30.163", weight: "19.327", embodiedLand: "4.211", embodiedWater: "62.813", }, { eid: "e10785", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "17.492", weight: "4", embodiedLand: "", embodiedWater: "", }, { eid: "e10786", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "6.28513636", weight: "4.23263329", embodiedLand: "", embodiedWater: "", }, { eid: "e10787", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.026", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10788", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "1.276", weight: "0.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10789", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "46.053", weight: "107.5", embodiedLand: "2.563", embodiedWater: "48.805", }, { eid: "e10790", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "13.516", weight: "20.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10791", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.274", weight: "0.13", embodiedLand: "", embodiedWater: "", }, { eid: "e10792", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "401.922618", weight: "985.504812", embodiedLand: "", embodiedWater: "", }, { eid: "e10793", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.042", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10794", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "33.233", weight: "41.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10795", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "388.489", weight: "300", embodiedLand: "", embodiedWater: "", }, { eid: "e10976", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "16", targetSimName: "ASM", targetName: "American Samoa", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10977", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "14.0119386", weight: "26.25", embodiedLand: "", embodiedWater: "", }, { eid: "e10978", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "55.708", weight: "233.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10979", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "1.198", weight: "0.714", embodiedLand: "", embodiedWater: "", }, { eid: "e10990", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "372.658", weight: "1562.052", embodiedLand: "", embodiedWater: "", }, { eid: "e10991", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "2.407", weight: "2.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11003", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Barley", year: "2015", value: "8.403", weight: "24.42", embodiedLand: "", embodiedWater: "", }, { eid: "e11004", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "8.714", weight: "21.576", embodiedLand: "", embodiedWater: "", }, { eid: "e11049", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11050", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1.754", weight: "16", embodiedLand: "4.518", embodiedWater: "69.808", }, { eid: "e11051", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "8.335", weight: "22.5", embodiedLand: "10.227", embodiedWater: "9.923", }, { eid: "e11052", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "61.018", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e11053", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.263", weight: "0.139", embodiedLand: "", embodiedWater: "", }, { eid: "e11054", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.216", weight: "0.086", embodiedLand: "", embodiedWater: "", }, { eid: "e11209", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "24.476", weight: "20.587", embodiedLand: "11.055", embodiedWater: "57.644", }, { eid: "e11210", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "184", targetSimName: "COK", targetName: "Cook Isds", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.043", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e11211", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2451.982731", weight: "16689", embodiedLand: "2800.015", embodiedWater: "84513.096", }, { eid: "e11212", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "0.03", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e11213", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4890.88387", weight: "20013.8008", embodiedLand: "5001.53453", embodiedWater: "32702.5506", }, { eid: "e11214", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7378.521", weight: "27210.945", embodiedLand: "", embodiedWater: "", }, { eid: "e11215", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.185", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e11216", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1486.932", weight: "4224", embodiedLand: "", embodiedWater: "", }, { eid: "e11217", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "6.555", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e11218", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.25906197", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e11219", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "1683.6727", weight: "6988.48925", embodiedLand: "", embodiedWater: "", }, { eid: "e11220", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11221", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Buckwheat", year: "2016", value: "0.01", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11222", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "40.801", weight: "190.825", embodiedLand: "", embodiedWater: "", }, { eid: "e11223", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "1725.40859", weight: "3353.20792", embodiedLand: "", embodiedWater: "", }, { eid: "e11224", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "29.675", weight: "111.862", embodiedLand: "", embodiedWater: "", }, { eid: "e11225", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11336", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11337", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.099", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e11338", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Rice", year: "2015", value: "20.243", weight: "46.01", embodiedLand: "10.002", embodiedWater: "579.542", }, { eid: "e11339", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "97.433", weight: "247.995", embodiedLand: "119.179", embodiedWater: "1537.817", }, { eid: "e11340", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "41.094", weight: "88.32", embodiedLand: "", embodiedWater: "", }, { eid: "e11341", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.466", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e11342", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "2.135", weight: "4.095", embodiedLand: "", embodiedWater: "", }, { eid: "e11343", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.369", weight: "0.63", embodiedLand: "", embodiedWater: "", }, { eid: "e11344", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "140.284", weight: "337.113", embodiedLand: "", embodiedWater: "", }, { eid: "e11345", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "3.159", weight: "0.854", embodiedLand: "", embodiedWater: "", }, { eid: "e11346", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "114.727", weight: "85.648", embodiedLand: "", embodiedWater: "", }, { eid: "e11347", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "23.162", weight: "30.81", embodiedLand: "", embodiedWater: "", }, { eid: "e11348", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "2.07", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e11522", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "125.184", weight: "45.6", embodiedLand: "9.628", embodiedWater: "", }, { eid: "e11523", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11524", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11525", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "2.981", weight: "0.98", embodiedLand: "", embodiedWater: "", }, { eid: "e11526", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "3.556", weight: "3.554", embodiedLand: "0.914", embodiedWater: "", }, { eid: "e11527", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "3.147", weight: "0.138", embodiedLand: "", embodiedWater: "", }, { eid: "e11528", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.13", weight: "0.241", embodiedLand: "", embodiedWater: "", }, { eid: "e11529", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "0.015", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e11580", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "2.405", weight: "23.6", embodiedLand: "54.414", embodiedWater: "", }, { eid: "e11581", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Maize", year: "2015", value: "113.617", weight: "655.96", embodiedLand: "650.261", embodiedWater: "1034.449", }, { eid: "e11582", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "4.097", weight: "40", embodiedLand: "27.575", embodiedWater: "", }, { eid: "e11583", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.054", weight: "0.05", embodiedLand: "0.004", embodiedWater: "0.463", }, { eid: "e11584", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "19.152", weight: "40.012", embodiedLand: "", embodiedWater: "", }, { eid: "e11585", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11586", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "2.563", weight: "14.38", embodiedLand: "9.575", embodiedWater: "9.707", }, { eid: "e11587", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.496", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e11588", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "44.863", weight: "500", embodiedLand: "", embodiedWater: "", }, { eid: "e11589", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Barley", year: "2016", value: "4.13198458", weight: "5.40716181", embodiedLand: "", embodiedWater: "", }, { eid: "e11591", source: "837", sourceSimName: "", sourceRegion: "Bunkers", sourceName: "Other", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11597", source: "838", sourceSimName: "", sourceRegion: "Free Zones", sourceName: "Other", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2016", value: "6.009", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e11798", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "6.137", weight: "1.878", embodiedLand: "0.36", embodiedWater: "", }, { eid: "e11799", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "9.639", weight: "19.875", embodiedLand: "11.311", embodiedWater: "1.848", }, { eid: "e11800", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "14.64", weight: "20.752", embodiedLand: "2.723", embodiedWater: "10.999", }, { eid: "e11801", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "72.797", weight: "82.805", embodiedLand: "8.475", embodiedWater: "106.818", }, { eid: "e11802", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "752.606", weight: "2216.03", embodiedLand: "", embodiedWater: "", }, { eid: "e11824", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "19.785", weight: "69", embodiedLand: "0.615", embodiedWater: "8.901", }, { eid: "e11825", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "43.6395248", weight: "25.096", embodiedLand: "", embodiedWater: "", }, { eid: "e11826", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "429.663", weight: "250", embodiedLand: "111.522", embodiedWater: "2267.75", }, { eid: "e11827", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.004", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e11828", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "109.987", weight: "30", embodiedLand: "16.331", embodiedWater: "27.69", }, { eid: "e11829", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "3.487", weight: "2.5", embodiedLand: "1.554", embodiedWater: "30.817", }, { eid: "e11830", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.02", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e11951", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "18298.88", weight: "67086.608", embodiedLand: "", embodiedWater: "", }, { eid: "e11952", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "12.537", weight: "27.011", embodiedLand: "11.171", embodiedWater: "16.396", }, { eid: "e11953", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "24935.4179", weight: "104332.188", embodiedLand: "47360.4095", embodiedWater: "68441.9161", }, { eid: "e11954", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "96.16", weight: "524.11", embodiedLand: "", embodiedWater: "", }, { eid: "e11955", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "533", targetSimName: "ABW", targetName: "Aruba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "13.297", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11967", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "24401.666", weight: "75279.56", embodiedLand: "28122.882", embodiedWater: "36209.468", }, { eid: "e11968", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11996", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "174.23", weight: "454.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11997", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.11", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11998", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2015", value: "6.294", weight: "4.58", embodiedLand: "1.249", embodiedWater: "1.53", }, { eid: "e11999", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.025", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e12000", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rice", year: "2015", value: "11.889", weight: "21.609", embodiedLand: "5.737", embodiedWater: "157.097", }, { eid: "e12001", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Rice", year: "2016", value: "1.367", weight: "1.583", embodiedLand: "", embodiedWater: "", }, { eid: "e12002", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.467", weight: "0.75", embodiedLand: "", embodiedWater: "", }, { eid: "e12003", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.117", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e12004", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "22.327", weight: "24.749", embodiedLand: "", embodiedWater: "", }, { eid: "e12012", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.455", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e12013", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.001", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e12043", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Maize", year: "2015", value: "30.578", weight: "66", embodiedLand: "38.092", embodiedWater: "4450.248", }, { eid: "e12044", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e12093", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.102", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e12094", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "82.825", weight: "18.152", embodiedLand: "", embodiedWater: "", }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-force-clustering/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-force-clustering/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-force-clustering/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 力导向布局聚类 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", clustering: true, clusterNodeStrength: -5, clusterEdgeDistance: 200, clusterNodeSize: 20, clusterFociStrength: 1.2, nodeSpacing: 5, preventOverlap: true, }, defaultNode: { size: 15, }, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, }); const colorMap = { 2012: "#BDD2FD", 2013: "#BDEFDB", 2014: "#F6C3B7", 2015: "#FFD8B8", 2016: "#D3C6EA", }; this.graph.data(data); data.nodes.forEach((i) => { i.cluster = i.year; i.style = Object.assign(i.style || {}, { fill: colorMap[i.year], }); }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-force-clustering/index.json ================================================ { "defaultTitle": "力导向布局聚类", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-functional-params/data.js ================================================ export default () => ({ nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, { id: "node4", size: 30, isLeaf: true }, { id: "node5", size: 30, isLeaf: true }, { id: "node6", size: 15, isLeaf: true }, { id: "node7", size: 15, isLeaf: true }, { id: "node8", size: 15, isLeaf: true }, { id: "node9", size: 15, isLeaf: true }, { id: "node10", size: 15, isLeaf: true }, { id: "node11", size: 15, isLeaf: true }, { id: "node12", size: 15, isLeaf: true }, { id: "node13", size: 15, isLeaf: true }, { id: "node14", size: 15, isLeaf: true }, { id: "node15", size: 15, isLeaf: true }, { id: "node16", size: 15, isLeaf: true }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node0", target: "node4" }, { source: "node0", target: "node5" }, { source: "node1", target: "node6" }, { source: "node1", target: "node7" }, { source: "node2", target: "node8" }, { source: "node2", target: "node9" }, { source: "node2", target: "node10" }, { source: "node2", target: "node11" }, { source: "node2", target: "node12" }, { source: "node2", target: "node13" }, { source: "node3", target: "node14" }, { source: "node3", target: "node15" }, { source: "node3", target: "node16" }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-functional-params/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-functional-params/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-functional-params/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 定制不同节点的参数 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, linkDistance: (d) => { if (d.source.id === "node0") { return 100; } return 30; }, nodeStrength: (d) => { if (d.isLeaf) { return -50; } return -10; }, edgeStrength: (d) => { if ( d.source.id === "node1" || d.source.id === "node2" || d.source.id === "node3" ) { return 0.7; } return 0.1; }, }, defaultNode: { color: "#5B8FF9", }, modes: { default: ["drag-canvas"], }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { refreshDragedNodePosition(e); }); this.graph.on("node:dragend", function (e) { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-functional-params/index.json ================================================ { "defaultTitle": "定制不同节点的参数", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-prevent-overlap/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-prevent-overlap/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-prevent-overlap/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-prevent-overlap/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * 力导向布局防止节点重叠 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, }, modes: { default: ["drag-canvas"], }, }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } const { nodes } = data; // randomize the node size nodes.forEach((node) => { node.size = Math.random() * 30 + 5; }); this.graph.data({ nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { const forceLayout = this.graph.get("layoutController").layoutMethods[0]; forceLayout.execute(); refreshDragedNodePosition(e); }); this.graph.on("node:dragend", function (e) { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/force-directed-prevent-overlap/index.json ================================================ { "defaultTitle": "力导向布局防止节点重叠", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import fruchtermanLayout from "@antv/f6/dist/extends/layout/fruchtermanLayout"; /** * fruchterman */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 5, speed: 5, // for rendering after each iteration tick: () => { this.graph.refreshPositions(); }, }, animate: true, defaultNode: { size: 30, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman/index.json ================================================ { "defaultTitle": "基本Fruchterman", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-clustering/data.js ================================================ function getData() { const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach(function (node) { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) { node.style = {}; } node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); return data; } export default getData; ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-clustering/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-clustering/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-clustering/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import fruchtermanLayout from "@antv/f6/dist/extends/layout/fruchtermanLayout"; /** * fruchterman 聚类布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 10, speed: 5, clustering: true, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-clustering/index.json ================================================ { "defaultTitle": "Fruchterman聚类", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-configuration-translate/data.js ================================================ function getData() { const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach(function (node) { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) { node.style = {}; } node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); return data; } export default getData; ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-configuration-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-configuration-translate/index.axml ================================================ {{description}} ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-configuration-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import fruchtermanLayout from "@antv/f6/dist/extends/layout/fruchtermanLayout"; /** * fruchterman 布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, description: "Fructherman layout, gravity = 1", }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 1, speed: 5, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { size: 1, style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); function layoutConfigTranslation() { setTimeout(function () { me.setData({ description: "Fructherman layout, gravity = 5", }); me.graph.updateLayout({ gravity: 5, }); }, 1000); setTimeout(function () { me.setData({ description: "Fructherman layout, gravity = 10, layout by cluster", }); me.graph.updateLayout({ gravity: 10, clustering: true, }); }, 2500); setTimeout(function () { me.setData({ description: "Fructherman layout, gravity = 20, layout by cluster", }); me.graph.updateLayout({ gravity: 20, }); }, 4000); setTimeout(function () { me.setData({ description: "Fructherman layout, gravity = 50, layout by cluster", }); me.graph.updateLayout({ gravity: 50, }); }, 5500); setTimeout(function () { me.setData({ description: "Fructherman layout, gravity = 80, layout by cluster", }); me.graph.updateLayout({ gravity: 80, }); }, 7000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-configuration-translate/index.json ================================================ { "defaultTitle": "参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-worker/data.js ================================================ export default () => ({ nodes: [ { id: "4", sim_name: "AFG", name: "Afghanistan", region: "South Asia", resource: "Cereals", year: 2012, value: 57.847, weight: 73.355, }, { id: "8", sim_name: "ALB", name: "Albania", region: "Europe", resource: "Cereals", year: 2012, value: 556.3332546, weight: 1214.363, }, { id: "10", sim_name: "ATA", name: "Antarctica", region: "Other", resource: "Cereals", year: 2012, value: 2829.367, weight: 11113.564, }, { id: "12", sim_name: "DZA", name: "Algeria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 105217.8151, weight: 146857.7593, }, { id: "16", sim_name: "ASM", name: "American Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 97.623, weight: 982.085, }, { id: "20", sim_name: "AND", name: "Andorra", region: "Europe", resource: "Cereals", year: 2012, value: 787.166, weight: 1240.056, }, { id: "24", sim_name: "AGO", name: "Angola", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0.366, weight: 0.211, }, { id: "28", sim_name: "ATG", name: "Antigua and Barbuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 30831.87949, weight: 72065.168, }, { id: "31", sim_name: "AZE", name: "Azerbaijan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 46917.41553, weight: 45114.87169, }, { id: "32", sim_name: "ARG", name: "Argentina", region: "South America", resource: "Cereals", year: 2012, value: 11347322.78, weight: 38200326.47, }, { id: "36", sim_name: "AUS", name: "Australia", region: "Oceania", resource: "Cereals", year: 2012, value: 10983308.38, weight: 32933532.17, }, { id: "40", sim_name: "AUT", name: "Austria", region: "Europe", resource: "Cereals", year: 2012, value: 714932.2545, weight: 1683224.24, }, { id: "44", sim_name: "BHS", name: "Bahamas", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 427.395, weight: 969.33, }, { id: "48", sim_name: "BHR", name: "Bahrain", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 22229.96717, weight: 53856.78001, }, { id: "50", sim_name: "BGD", name: "Bangladesh", region: "South Asia", resource: "Cereals", year: 2012, value: 22330.75971, weight: 86944.1853, }, { id: "51", sim_name: "ARM", name: "Armenia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 206.6709842, weight: 223.5014745, }, { id: "52", sim_name: "BRB", name: "Barbados", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4790.290139, weight: 7428.399008, }, { id: "56", sim_name: "BEL", name: "Belgium", region: "Europe", resource: "Cereals", year: 2012, value: 1896499.584, weight: 3625004.302, }, { id: "60", sim_name: "BMU", name: "Bermuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 100.264, weight: 250, }, { id: "64", sim_name: "BTN", name: "Bhutan", region: "South Asia", resource: "Cereals", year: 2012, value: 1100.663269, weight: 3990.493739, }, { id: "68", sim_name: "BOL", name: "Bolivia", region: "South America", resource: "Cereals", year: 2012, value: 107152.4673, weight: 117438.7654, }, { id: "70", sim_name: "BIH", name: "Bosnia Herzegovina", region: "Europe", resource: "Cereals", year: 2012, value: 10652.90002, weight: 25582.17925, }, { id: "72", sim_name: "BWA", name: "Botswana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 7635.744989, weight: 24790.60442, }, { id: "76", sim_name: "BRA", name: "Brazil", region: "South America", resource: "Cereals", year: 2012, value: 7114534.381, weight: 22441162.41, }, { id: "84", sim_name: "BLZ", name: "Belize", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 28037.35873, weight: 77441.91463, }, { id: "90", sim_name: "SLB", name: "Solomon Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "92", sim_name: "VGB", name: "British Virgin Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 15328.77, weight: 51127.16, }, { id: "96", sim_name: "BRN", name: "Brunei Darussalam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 46.438, weight: 35.416, }, { id: "100", sim_name: "BGR", name: "Bulgaria", region: "Europe", resource: "Cereals", year: 2012, value: 1258892.481, weight: 4147538.49, }, { id: "104", sim_name: "MMR", name: "Myanmar", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 599204.3703, weight: 1218435.323, }, { id: "108", sim_name: "BDI", name: "Burundi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 523.644, weight: 2841.873, }, { id: "112", sim_name: "BLR", name: "Belarus", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 52538.61827, weight: 137692.36, }, { id: "116", sim_name: "KHM", name: "Cambodia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 167651.1526, weight: 265914.0128, }, { id: "120", sim_name: "CMR", name: "Cameroon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1263.861619, weight: 2235.140891, }, { id: "124", sim_name: "CAN", name: "Canada", region: "North America", resource: "Cereals", year: 2012, value: 8982050.268, weight: 24667183.74, }, { id: "132", sim_name: "CPV", name: "Cabo Verde", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2344.96, weight: 4095.993, }, { id: "140", sim_name: "CAF", name: "Central African Rep.", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "144", sim_name: "LKA", name: "Sri Lanka", region: "South Asia", resource: "Cereals", year: 2012, value: 181369.2559, weight: 489552.3718, }, { id: "152", sim_name: "CHL", name: "Chile", region: "South America", resource: "Cereals", year: 2012, value: 412283.3672, weight: 270900.3596, }, { id: "156", sim_name: "CHN", name: "China", region: "East Asia", resource: "Cereals", year: 2012, value: 1490564.833, weight: 2304819.508, }, { id: "170", sim_name: "COL", name: "Colombia", region: "South America", resource: "Cereals", year: 2012, value: 46615.80539, weight: 52684.28073, }, { id: "188", sim_name: "CRI", name: "Costa Rica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 17710.68444, weight: 28937.25094, }, { id: "191", sim_name: "HRV", name: "Croatia", region: "Europe", resource: "Cereals", year: 2012, value: 192245.2115, weight: 580710.257, }, { id: "192", sim_name: "CUB", name: "Cuba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 793.321, weight: 1620.825, }, { id: "196", sim_name: "CYP", name: "Cyprus", region: "Europe", resource: "Cereals", year: 2012, value: 47981.18874, weight: 126474.07, }, { id: "203", sim_name: "CZE", name: "Czech Rep.", region: "Europe", resource: "Cereals", year: 2012, value: 922618.0722, weight: 3054247.331, }, { id: "204", sim_name: "BEN", name: "Benin", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12987.78421, weight: 55672.72433, }, { id: "208", sim_name: "DNK", name: "Denmark", region: "Europe", resource: "Cereals", year: 2012, value: 701199.8922, weight: 1992757.212, }, { id: "212", sim_name: "DMA", name: "Dominica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1.351, weight: 0.692, }, { id: "214", sim_name: "DOM", name: "Dominican Rep.", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 105510.1813, weight: 210275.29, }, { id: "218", sim_name: "ECU", name: "Ecuador", region: "South America", resource: "Cereals", year: 2012, value: 30957.4275, weight: 49399.64362, }, { id: "222", sim_name: "SLV", name: "El Salvador", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 77105.01061, weight: 129245.0661, }, { id: "231", sim_name: "ETH", name: "Ethiopia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44330.31405, weight: 29794.00055, }, { id: "233", sim_name: "EST", name: "Estonia", region: "Europe", resource: "Cereals", year: 2012, value: 150772.6292, weight: 458854.905, }, { id: "234", sim_name: "FRO", name: "Faeroe Isds", region: "Europe", resource: "Cereals", year: 2012, value: 18.298, weight: 44.726, }, { id: "242", sim_name: "FJI", name: "Fiji", region: "Oceania", resource: "Cereals", year: 2012, value: 15966.92145, weight: 24119.72685, }, { id: "246", sim_name: "FIN", name: "Finland", region: "Europe", resource: "Cereals", year: 2012, value: 266364.4975, weight: 753973.3063, }, { id: "251", sim_name: "FRA", name: "France", region: "Europe", resource: "Cereals", year: 2012, value: 11027310.62, weight: 31368277.85, }, { id: "262", sim_name: "DJI", name: "Djibouti", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1936.537, weight: 2932.238, }, { id: "266", sim_name: "GAB", name: "Gabon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2624.516, weight: 10407.907, }, { id: "268", sim_name: "GEO", name: "Georgia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 48754.57507, weight: 158741.3575, }, { id: "270", sim_name: "GMB", name: "Gambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 38.193, weight: 24.45, }, { id: "275", sim_name: "PSE", name: "State of Palestine", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16057.14949, weight: 13745.84557, }, { id: "276", sim_name: "DEU", name: "Germany", region: "Europe", resource: "Cereals", year: 2012, value: 4635549.458, weight: 12647922.94, }, { id: "288", sim_name: "GHA", name: "Ghana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 8210.66114, weight: 28560.44817, }, { id: "292", sim_name: "GIB", name: "Gibraltar", region: "Europe", resource: "Cereals", year: 2012, value: 728.465, weight: 809.623, }, { id: "296", sim_name: "KIR", name: "Kiribati", region: "Oceania", resource: "Cereals", year: 2012, value: 23.052, weight: 18.562, }, { id: "300", sim_name: "GRC", name: "Greece", region: "Europe", resource: "Cereals", year: 2012, value: 263693.016, weight: 644312.8604, }, { id: "304", sim_name: "GRL", name: "Greenland", region: "North America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "308", sim_name: "GRD", name: "Grenada", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4657.914, weight: 9335.526, }, { id: "316", sim_name: "GUM", name: "Guam", region: "Oceania", resource: "Cereals", year: 2012, value: 527.033, weight: 982.642, }, { id: "320", sim_name: "GTM", name: "Guatemala", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 20968.96314, weight: 22893.23335, }, { id: "324", sim_name: "GIN", name: "Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2636.849, weight: 7422.12, }, { id: "328", sim_name: "GUY", name: "Guyana", region: "South America", resource: "Cereals", year: 2012, value: 334196.3131, weight: 520437.64, }, { id: "332", sim_name: "HTI", name: "Haiti", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5.134, weight: 16.128, }, { id: "340", sim_name: "HND", name: "Honduras", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 22936.79385, weight: 43129.60369, }, { id: "348", sim_name: "HUN", name: "Hungary", region: "Europe", resource: "Cereals", year: 2012, value: 2015665.793, weight: 6379394.988, }, { id: "352", sim_name: "ISL", name: "Iceland", region: "Europe", resource: "Cereals", year: 2012, value: 891.513, weight: 2118.828, }, { id: "360", sim_name: "IDN", name: "Indonesia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 175738.8156, weight: 544860.3789, }, { id: "364", sim_name: "IRN", name: "Iran", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 7978.124, weight: 20473.686, }, { id: "368", sim_name: "IRQ", name: "Iraq", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 253.845, weight: 246.151, }, { id: "372", sim_name: "IRL", name: "Ireland", region: "Europe", resource: "Cereals", year: 2012, value: 166058.1767, weight: 476236.2048, }, { id: "376", sim_name: "ISR", name: "Israel", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 197912.4336, weight: 431193.8203, }, { id: "381", sim_name: "ITA", name: "Italy", region: "Europe", resource: "Cereals", year: 2012, value: 1288077.184, weight: 1887032.489, }, { id: "384", sim_name: "CIV", name: "Cote d'Ivoire", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 77750.0467, weight: 254222.8878, }, { id: "388", sim_name: "JAM", name: "Jamaica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 6751.46461, weight: 12484.22296, }, { id: "392", sim_name: "JPN", name: "Japan", region: "East Asia", resource: "Cereals", year: 2012, value: 189561.3237, weight: 359553.4615, }, { id: "398", sim_name: "KAZ", name: "Kazakhstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2535465.094, weight: 10562777.14, }, { id: "400", sim_name: "JOR", name: "Jordan", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 2022.699859, weight: 1810.995193, }, { id: "404", sim_name: "KEN", name: "Kenya", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31813.863, weight: 84144.582, }, { id: "414", sim_name: "KWT", name: "Kuwait", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 28509.72, weight: 41425.612, }, { id: "417", sim_name: "KGZ", name: "Kyrgyzstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 344.2343218, weight: 452.0188439, }, { id: "418", sim_name: "LAO", name: "Lao PDR", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 58500.6357, weight: 212304.4463, }, { id: "422", sim_name: "LBN", name: "Lebanon", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16263.18003, weight: 38974.77174, }, { id: "426", sim_name: "LSO", name: "Lesotho", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 19865.12276, weight: 54350.43934, }, { id: "428", sim_name: "LVA", name: "Latvia", region: "Europe", resource: "Cereals", year: 2012, value: 516410.4254, weight: 1643243.015, }, { id: "430", sim_name: "LBR", name: "Liberia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12.35, weight: 53.471, }, { id: "434", sim_name: "LBY", name: "Libya", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 634.239, weight: 2102.142, }, { id: "440", sim_name: "LTU", name: "Lithuania", region: "Europe", resource: "Cereals", year: 2012, value: 871039.5602, weight: 2446114.811, }, { id: "442", sim_name: "LUX", name: "Luxembourg", region: "Europe", resource: "Cereals", year: 2012, value: 68969.99793, weight: 178380.981, }, { id: "450", sim_name: "MDG", name: "Madagascar", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 950.8530206, weight: 3780.89311, }, { id: "454", sim_name: "MWI", name: "Malawi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 11553.98159, weight: 41269.33681, }, { id: "458", sim_name: "MYS", name: "Malaysia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 99255.71471, weight: 142965.3262, }, { id: "462", sim_name: "MDV", name: "Maldives", region: "South Asia", resource: "Cereals", year: 2012, value: 12.448, weight: 14.6, }, { id: "466", sim_name: "MLI", name: "Mali", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3143.270747, weight: 11121.96188, }, { id: "470", sim_name: "MLT", name: "Malta", region: "Europe", resource: "Cereals", year: 2012, value: 35991.55686, weight: 94799.54871, }, { id: "478", sim_name: "MRT", name: "Mauritania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 292.538, weight: 627.637, }, { id: "480", sim_name: "MUS", name: "Mauritius", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 17602.67917, weight: 36755.35938, }, { id: "484", sim_name: "MEX", name: "Mexico", region: "North America", resource: "Cereals", year: 2012, value: 571803.2432, weight: 1234860.795, }, { id: "496", sim_name: "MNG", name: "Mongolia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1328.368, weight: 10672.694, }, { id: "498", sim_name: "MDA", name: "Moldova", region: "Europe", resource: "Cereals", year: 2012, value: 59072.0085, weight: 188178.1824, }, { id: "499", sim_name: "MNE", name: "Montenegro", region: "Europe", resource: "Cereals", year: 2012, value: 2444.455322, weight: 6125.451, }, { id: "504", sim_name: "MAR", name: "Morocco", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 86884.06321, weight: 161631.8094, }, { id: "508", sim_name: "MOZ", name: "Mozambique", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 68388.81722, weight: 146520.864, }, { id: "512", sim_name: "OMN", name: "Oman", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 55530.66234, weight: 88434.23327, }, { id: "516", sim_name: "NAM", name: "Namibia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 5168.27047, weight: 7877.053106, }, { id: "524", sim_name: "NPL", name: "Nepal", region: "South Asia", resource: "Cereals", year: 2012, value: 4032.41279, weight: 17770.75769, }, { id: "528", sim_name: "NLD", name: "Netherlands", region: "Europe", resource: "Cereals", year: 2012, value: 1424347.018, weight: 3125730.04, }, { id: "531", sim_name: "CUW", name: "Curacao", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 535.691, weight: 2358.613, }, { id: "533", sim_name: "ABW", name: "Aruba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 178879.593, weight: 560431.967, }, { id: "540", sim_name: "NCL", name: "New Caledonia", region: "Oceania", resource: "Cereals", year: 2012, value: 205.777282, weight: 363.439991, }, { id: "548", sim_name: "VUT", name: "Vanuatu", region: "Oceania", resource: "Cereals", year: 2012, value: 160.463, weight: 440.332, }, { id: "554", sim_name: "NZL", name: "New Zealand", region: "Oceania", resource: "Cereals", year: 2012, value: 33994.85867, weight: 35177.57975, }, { id: "558", sim_name: "NIC", name: "Nicaragua", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 41294.65615, weight: 85186.87824, }, { id: "562", sim_name: "NER", name: "Niger", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31152.35763, weight: 44518.07202, }, { id: "566", sim_name: "NGA", name: "Nigeria", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 323839.5301, weight: 192057.843, }, { id: "579", sim_name: "NOR", name: "Norway", region: "Europe", resource: "Cereals", year: 2012, value: 2382.344541, weight: 2488.51136, }, { id: "580", sim_name: "MNP", name: "N. Mariana Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 1.144, weight: 1.864, }, { id: "581", sim_name: "UMI", name: "United States Minor Outlying Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 23.008, weight: 21, }, { id: "585", sim_name: "PLW", name: "Palau", region: "Oceania", resource: "Cereals", year: 2012, value: 2.151, weight: 0.22, }, { id: "586", sim_name: "PAK", name: "Pakistan", region: "South Asia", resource: "Cereals", year: 2012, value: 2412673.261, weight: 4864111.072, }, { id: "591", sim_name: "PAN", name: "Panama", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 10056.54107, weight: 26993.1125, }, { id: "598", sim_name: "PNG", name: "Papua New Guinea", region: "Oceania", resource: "Cereals", year: 2012, value: 319.374, weight: 2210.48, }, { id: "600", sim_name: "PRY", name: "Paraguay", region: "South America", resource: "Cereals", year: 2012, value: 1009228.641, weight: 3862696.891, }, { id: "604", sim_name: "PER", name: "Peru", region: "South America", resource: "Cereals", year: 2012, value: 91326.10676, weight: 128637.0767, }, { id: "608", sim_name: "PHL", name: "Philippines", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 12041.64316, weight: 16205.94695, }, { id: "616", sim_name: "POL", name: "Poland", region: "Europe", resource: "Cereals", year: 2012, value: 1028089.751, weight: 3186360.963, }, { id: "620", sim_name: "PRT", name: "Portugal", region: "Europe", resource: "Cereals", year: 2012, value: 92543.15766, weight: 192795.3179, }, { id: "624", sim_name: "GNB", name: "Guinea-Bissau", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37.268, weight: 135, }, { id: "626", sim_name: "TLS", name: "Timor-Leste", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 18.551, weight: 10.883, }, { id: "634", sim_name: "QAT", name: "Qatar", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 6936.324, weight: 11122.252, }, { id: "642", sim_name: "ROU", name: "Romania", region: "Europe", resource: "Cereals", year: 2012, value: 1778677.092, weight: 5301402.18, }, { id: "643", sim_name: "RUS", name: "Russian Federation", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 7440900.086, weight: 23852343.49, }, { id: "646", sim_name: "RWA", name: "Rwanda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37520.31393, weight: 73367.60768, }, { id: "659", sim_name: "KNA", name: "Saint Kitts and Nevis", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0.062, weight: 0.009, }, { id: "662", sim_name: "LCA", name: "Saint Lucia", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "670", sim_name: "VCT", name: "Saint Vincent and the Grenadines", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 16002.19104, weight: 17977.52343, }, { id: "674", sim_name: "SMR", name: "San Marino", region: "Europe", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "682", sim_name: "SAU", name: "Saudi Arabia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 92568.76043, weight: 56036.2484, }, { id: "686", sim_name: "SEN", name: "Senegal", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44740.28095, weight: 98109.85876, }, { id: "688", sim_name: "SRB", name: "Serbia", region: "Europe", resource: "Cereals", year: 2012, value: 907006.831, weight: 3003936.426, }, { id: "690", sim_name: "SYC", name: "Seychelles", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 387.548, weight: 246.84, }, { id: "694", sim_name: "SLE", name: "Sierra Leone", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 147.544, weight: 705.466, }, { id: "699", sim_name: "IND", name: "India", region: "South Asia", resource: "Cereals", year: 2012, value: 9062980.928, weight: 19031680.14, }, { id: "702", sim_name: "SGP", name: "Singapore", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 193120.3466, weight: 470488.3668, }, { id: "703", sim_name: "SVK", name: "Slovakia", region: "Europe", resource: "Cereals", year: 2012, value: 580789.4685, weight: 1589777.797, }, { id: "704", sim_name: "VNM", name: "Vietnam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 3558044.517, weight: 7381230.275, }, { id: "705", sim_name: "SVN", name: "Slovenia", region: "Europe", resource: "Cereals", year: 2012, value: 75282.28683, weight: 227283.1873, }, { id: "706", sim_name: "SOM", name: "Somalia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 240.399, weight: 1055, }, { id: "710", sim_name: "ZAF", name: "South Africa", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 938907.5758, weight: 2190384.881, }, { id: "716", sim_name: "ZWE", name: "Zimbabwe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6067.581387, weight: 21394.92603, }, { id: "724", sim_name: "ESP", name: "Spain", region: "Europe", resource: "Cereals", year: 2012, value: 906018.1944, weight: 1602797.031, }, { id: "729", sim_name: "SDN", name: "Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 18327.14063, weight: 66310.50556, }, { id: "740", sim_name: "SUR", name: "Suriname", region: "South America", resource: "Cereals", year: 2012, value: 73211.6794, weight: 83933.84802, }, { id: "748", sim_name: "SWZ", name: "Swaziland", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6674.46, weight: 16386.136, }, { id: "752", sim_name: "SWE", name: "Sweden", region: "Europe", resource: "Cereals", year: 2012, value: 439154.313, weight: 1207272.863, }, { id: "757", sim_name: "CHE", name: "Switzerland", region: "Europe", resource: "Cereals", year: 2012, value: 492516.8323, weight: 1581172.074, }, { id: "760", sim_name: "SYR", name: "Syria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 4169.742, weight: 7890.447, }, { id: "762", sim_name: "TJK", name: "Tajikistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 300.162, weight: 712.396, }, { id: "764", sim_name: "THA", name: "Thailand", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 5003324.321, weight: 6926962.31, }, { id: "768", sim_name: "TGO", name: "Togo", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 16809.12488, weight: 43975.34784, }, { id: "772", sim_name: "TKL", name: "Tokelau", region: "Oceania", resource: "Cereals", year: 2012, value: 1012.213, weight: 1926.401, }, { id: "776", sim_name: "TON", name: "Tonga", region: "Oceania", resource: "Cereals", year: 2012, value: 0.18, weight: 0.011, }, { id: "780", sim_name: "TTO", name: "Trinidad and Tobago", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5731.199288, weight: 9463.821332, }, { id: "784", sim_name: "ARE", name: "United Arab Emirates", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 442646.1236, weight: 684603.6345, }, { id: "788", sim_name: "TUN", name: "Tunisia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 202627.2087, weight: 121296.0689, }, { id: "792", sim_name: "TUR", name: "Turkey", region: "Europe", resource: "Cereals", year: 2012, value: 1205009.52, weight: 2692733.392, }, { id: "795", sim_name: "TKM", name: "Turkmenistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1020.566, weight: 3442.938, }, { id: "796", sim_name: "TCA", name: "Turks and Caicos Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1029.474, weight: 2224.885, }, { id: "800", sim_name: "UGA", name: "Uganda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 153220.9856, weight: 467968.0664, }, { id: "804", sim_name: "UKR", name: "Ukraine", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 8444175.988, weight: 29508635.03, }, { id: "818", sim_name: "EGY", name: "Egypt", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 178849.3005, weight: 310332.3386, }, { id: "826", sim_name: "GBR", name: "United Kingdom", region: "Europe", resource: "Cereals", year: 2012, value: 1224264.681, weight: 3079070.328, }, { id: "834", sim_name: "TZA", name: "Tanzania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 152688.2977, weight: 493774.3125, }, { id: "838", sim_name: "", name: "Free Zones", region: "Other", resource: "Cereals", year: 2012, value: 1488.719, weight: 4904.648, }, { id: "842", sim_name: "USA", name: "United States", region: "North America", resource: "Cereals", year: 2012, value: 23694720.38, weight: 66623810.06, }, { id: "854", sim_name: "BFA", name: "Burkina Faso", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3861.072093, weight: 17132.42303, }, { id: "858", sim_name: "URY", name: "Uruguay", region: "South America", resource: "Cereals", year: 2012, value: 1550881.026, weight: 4155101.445, }, { id: "860", sim_name: "UZB", name: "Uzbekistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2094.579, weight: 7229.088, }, { id: "862", sim_name: "VEN", name: "Venezuela", region: "South America", resource: "Cereals", year: 2012, value: 73.53, weight: 91.675, }, { id: "882", sim_name: "WSM", name: "Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 1.603, weight: 6.415, }, { id: "887", sim_name: "YEM", name: "Yemen", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 48184.79726, weight: 245917.1867, }, { id: "894", sim_name: "ZMB", name: "Zambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 470664.7641, weight: 863829.2506, }, { id: "86", sim_name: "IOT", name: "British Indian Ocean Territory", region: "Oceania", resource: "Cereals", year: 2013, value: 36.802, weight: 21.33, }, { id: "136", sim_name: "CYM", name: "Cayman Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "148", sim_name: "TCD", name: "Chad", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 24.335, weight: 103.232, }, { id: "166", sim_name: "CCK", name: "Cocos Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 2.417, weight: 2, }, { id: "174", sim_name: "COM", name: "Comoros", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 19, weight: 21, }, { id: "226", sim_name: "GNQ", name: "Equatorial Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "232", sim_name: "ERI", name: "Eritrea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "238", sim_name: "FLK", name: "Falkland Isds (Malvinas)", region: "South America", resource: "Cereals", year: 2013, value: 177.295, weight: 47.1, }, { id: "258", sim_name: "PYF", name: "French Polynesia", region: "Oceania", resource: "Cereals", year: 2013, value: 1.65, weight: 0.6, }, { id: "534", sim_name: "SXM", name: "Sint Maarten (Dutch part)", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "584", sim_name: "MHL", name: "Marshall Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 47.581, weight: 26.942, }, { id: "612", sim_name: "PCN", name: "Pitcairn", region: "Oceania", resource: "Cereals", year: 2013, value: 95.892, weight: 265, }, { id: "728", sim_name: "SSD", name: "South Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "798", sim_name: "TUV", name: "Tuvalu", region: "Oceania", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "184", sim_name: "COK", name: "Cook Isds", region: "Oceania", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "654", sim_name: "SHN", name: "Saint Helena", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "660", sim_name: "AIA", name: "Anguilla", region: "Caribbean and Central America", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "678", sim_name: "STP", name: "Sao Tome and Principe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 198.633, weight: 350, }, { id: "837", sim_name: "", name: "Bunkers", region: "Other", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "732", sim_name: "ESH", name: "Western Sahara", region: "Middle East and North Africa", resource: "Cereals", year: 2015, value: 0, weight: 0, }, { id: "666", sim_name: "SPM", name: "Saint Pierre and Miquelon", region: "North America", resource: "Cereals", year: 2016, value: 0, weight: 0, }, { id: "162", sim_name: "CXR", name: "Christmas Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 131.818, weight: 99.95, }, { id: "336", sim_name: "VAT", name: "Holy See", region: "Europe", resource: "Cereals", year: 2012, value: 24.492, weight: 42.805, }, { id: "520", sim_name: "NRU", name: "Nauru", region: "Oceania", resource: "Cereals", year: 2012, value: 496.386, weight: 457.721, }, { id: "535", sim_name: "BES", name: "Bonaire", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 326.45, weight: 551.554, }, ], edges: [ { eid: "e16", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Maize", year: "2015", value: "9.049", weight: "11.52", embodiedLand: "4.765", embodiedWater: "348.756", }, { eid: "e17", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "23.306", weight: "64.74", embodiedLand: "37.716", embodiedWater: "726.512", }, { eid: "e18", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "94.052", weight: "230.588", embodiedLand: "141.564", embodiedWater: "1851.16", }, { eid: "e19", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "13.068", weight: "65.34", embodiedLand: "", embodiedWater: "", }, { eid: "e20", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Sorghum", year: "2016", value: "34.399", weight: "171.996", embodiedLand: "", embodiedWater: "", }, { eid: "e21", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.027", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e22", source: "4", sourceSimName: "AFG", sourceRegion: "Afghanistan", sourceName: "South Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.812", weight: "4.061", embodiedLand: "", embodiedWater: "", }, { eid: "e43", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "0.01", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e44", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e45", source: "8", sourceSimName: "ALB", sourceRegion: "Albania", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "1.875", weight: "1.352", embodiedLand: "", embodiedWater: "", }, { eid: "e48", source: "10", sourceSimName: "ATA", sourceRegion: "Antarctica", sourceName: "Other", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.837", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e85", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "0.886", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e86", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "23.9136184", weight: "40.2929249", embodiedLand: "", embodiedWater: "", }, { eid: "e88", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e89", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.9393726", weight: "1.75517982", embodiedLand: "0.38365313", embodiedWater: "17.7067202", }, { eid: "e90", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e91", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.005", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e92", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.249", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e93", source: "12", sourceSimName: "DZA", sourceRegion: "Algeria", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.19", weight: "0.175", embodiedLand: "", embodiedWater: "", }, { eid: "e103", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e104", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e105", source: "16", sourceSimName: "ASM", sourceRegion: "American Samoa", sourceName: "Oceania", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e115", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e116", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "128.652", weight: "96", embodiedLand: "", embodiedWater: "", }, { eid: "e117", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "5.117", weight: "26.7", embodiedLand: "", embodiedWater: "", }, { eid: "e118", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e119", source: "20", sourceSimName: "AND", sourceRegion: "Andorra", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "798.871", weight: "4322.88", embodiedLand: "", embodiedWater: "", }, { eid: "e128", source: "24", sourceSimName: "AGO", sourceRegion: "Angola", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.401", weight: "0.44", embodiedLand: "", embodiedWater: "", }, { eid: "e155", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "20.91", weight: "1.04", embodiedLand: "", embodiedWater: "", }, { eid: "e156", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "177.885", weight: "967.513", embodiedLand: "", embodiedWater: "", }, { eid: "e157", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e158", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "51.175", weight: "76.8", embodiedLand: "", embodiedWater: "", }, { eid: "e159", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.005", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e160", source: "28", sourceSimName: "ATG", sourceRegion: "Antigua and Barbuda", sourceName: "Caribbean and Central America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "2456.668", weight: "2481.6", embodiedLand: "", embodiedWater: "", }, { eid: "e182", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.356", weight: "27.2", embodiedLand: "13.377", embodiedWater: "156.237", }, { eid: "e183", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1.344", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e185", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "108.397", weight: "40", embodiedLand: "", embodiedWater: "", }, { eid: "e186", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Buckwheat", year: "2016", value: "1.814", weight: "2.99", embodiedLand: "", embodiedWater: "", }, { eid: "e187", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Buckwheat", year: "2016", value: "0.044", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e188", source: "31", sourceSimName: "AZE", sourceRegion: "Azerbaijan", sourceName: "Central and Northern Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "5.8", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e351", source: "32", sourceSimName: "ARG", sourceRegion: "Argentina", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.29", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e494", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "25.78", weight: "206.12", embodiedLand: "", embodiedWater: "", }, { eid: "e495", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "15.036", weight: "18.18", embodiedLand: "", embodiedWater: "", }, { eid: "e496", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "43.503", weight: "101.04", embodiedLand: "41.936", embodiedWater: "35.869", }, { eid: "e497", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "270", targetSimName: "GMB", targetName: "Gambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.141", weight: "0.42", embodiedLand: "", embodiedWater: "", }, { eid: "e498", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.161", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e499", source: "36", sourceSimName: "AUS", sourceRegion: "Australia", sourceName: "Oceania", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.004", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e615", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "3.335", weight: "1.058", embodiedLand: "", embodiedWater: "", }, { eid: "e616", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.017", weight: "0.006", embodiedLand: "0.001", embodiedWater: "0.109", }, { eid: "e617", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.018", weight: "0.099", embodiedLand: "", embodiedWater: "0.043", }, { eid: "e618", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.37", weight: "0.2", embodiedLand: "0.006", embodiedWater: "", }, { eid: "e619", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "147.228", weight: "490.76", embodiedLand: "", embodiedWater: "", }, { eid: "e620", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.761", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e621", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "2.19", weight: "1.625", embodiedLand: "", embodiedWater: "", }, { eid: "e622", source: "40", sourceSimName: "AUT", sourceRegion: "Austria", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "0.1", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e635", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e636", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "55.7439049", weight: "55.492", embodiedLand: "", embodiedWater: "", }, { eid: "e637", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e638", source: "44", sourceSimName: "BHS", sourceRegion: "Bahamas", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e694", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e696", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e697", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.929", weight: "7.4", embodiedLand: "2.029", embodiedWater: "95.282", }, { eid: "e698", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "4.248", weight: "1.862", embodiedLand: "0.037", embodiedWater: "18.661", }, { eid: "e699", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e700", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "136", targetSimName: "CYM", targetName: "Cayman Isds", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e701", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.067", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e702", source: "48", sourceSimName: "BHR", sourceRegion: "Bahrain", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "124.768", weight: "92.25", embodiedLand: "", embodiedWater: "", }, { eid: "e754", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.004", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e755", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "2.969", weight: "1.85", embodiedLand: "", embodiedWater: "", }, { eid: "e756", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.12", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e757", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.138", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e758", source: "50", sourceSimName: "BGD", sourceRegion: "Bangladesh", sourceName: "South Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.494", weight: "0.915", embodiedLand: "", embodiedWater: "", }, { eid: "e776", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e777", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "18.47", weight: "30.8", embodiedLand: "", embodiedWater: "", }, { eid: "e778", source: "51", sourceSimName: "ARM", sourceRegion: "Armenia", sourceName: "Central and Northern Asia", target: "795", targetSimName: "TKM", targetName: "Turkmenistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "8.71", weight: "1.675", embodiedLand: "", embodiedWater: "", }, { eid: "e798", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e799", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e800", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e801", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e802", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e803", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.199", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e804", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.002", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e805", source: "52", sourceSimName: "BRB", sourceRegion: "Barbados", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.01", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e990", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "1.472", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e992", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.178", weight: "0.21", embodiedLand: "", embodiedWater: "", }, { eid: "e993", source: "56", sourceSimName: "BEL", sourceRegion: "Belgium", sourceName: "Europe", target: "626", targetSimName: "TLS", targetName: "Timor-Leste", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "146.32", weight: "357", embodiedLand: "", embodiedWater: "", }, { eid: "e998", source: "60", sourceSimName: "BMU", sourceRegion: "Bermuda", sourceName: "Caribbean and Central America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "14.135", weight: "42", embodiedLand: "", embodiedWater: "43.89", }, { eid: "e999", source: "60", sourceSimName: "BMU", sourceRegion: "Bermuda", sourceName: "Caribbean and Central America", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "78.825", weight: "212", embodiedLand: "", embodiedWater: "", }, { eid: "e1008", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.302", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e1009", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "16.708", weight: "25.193", embodiedLand: "8.687", embodiedWater: "31.29", }, { eid: "e1010", source: "64", sourceSimName: "BTN", sourceRegion: "Bhutan", sourceName: "South Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.024", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1095", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "0.5", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e1097", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.14", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e1098", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.007", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e1099", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.249", weight: "0.532", embodiedLand: "", embodiedWater: "", }, { eid: "e1100", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "40.776", weight: "17.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1101", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "37.83", weight: "12", embodiedLand: "", embodiedWater: "", }, { eid: "e1102", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Maize", year: "2016", value: "376.317", weight: "60.619", embodiedLand: "", embodiedWater: "", }, { eid: "e1103", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "20.19096077", weight: "5", embodiedLand: "", embodiedWater: "", }, { eid: "e1104", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.406", weight: "0.043", embodiedLand: "", embodiedWater: "", }, { eid: "e1105", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "12.287", weight: "2.911", embodiedLand: "", embodiedWater: "", }, { eid: "e1106", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "642", targetSimName: "ROU", targetName: "Romania", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "30.2", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e1107", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "20.4", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e1108", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Oats", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1109", source: "68", sourceSimName: "BOL", sourceRegion: "Bolivia", sourceName: "South America", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.683", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e1141", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.132", weight: "0.13", embodiedLand: "0.028", embodiedWater: "0.087", }, { eid: "e1142", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.356", weight: "0.38", embodiedLand: "0.09", embodiedWater: "0.274", }, { eid: "e1143", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "111.882952", weight: "50.4723321", embodiedLand: "14.3646986", embodiedWater: "12.7187331", }, { eid: "e1144", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.027", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1145", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.008", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e1146", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1147", source: "70", sourceSimName: "BIH", sourceRegion: "Bosnia Herzegovina", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.072", weight: "0.501", embodiedLand: "", embodiedWater: "", }, { eid: "e1164", source: "72", sourceSimName: "BWA", sourceRegion: "Botswana", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.004", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e1165", source: "72", sourceSimName: "BWA", sourceRegion: "Botswana", sourceName: "Sub-Saharan Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.021", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e1319", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "700.563", weight: "3567.012", embodiedLand: "", embodiedWater: "", }, { eid: "e1320", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Rice", year: "2015", value: "21.279294", weight: "36.0515982", embodiedLand: "12.9758444", embodiedWater: "467.733115", }, { eid: "e1321", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.02", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e1322", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "80.401", weight: "267", embodiedLand: "", embodiedWater: "", }, { eid: "e1323", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "2.084", weight: "0.743", embodiedLand: "", embodiedWater: "", }, { eid: "e1324", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "308", targetSimName: "GRD", targetName: "Grenada", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "41.263", weight: "73.557", embodiedLand: "", embodiedWater: "", }, { eid: "e1325", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.673", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e1326", source: "76", sourceSimName: "BRA", sourceRegion: "Brazil", sourceName: "South America", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1350", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e1351", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e1352", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.033", weight: "0.176", embodiedLand: "", embodiedWater: "", }, { eid: "e1353", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "2.767", weight: "2.014", embodiedLand: "", embodiedWater: "", }, { eid: "e1354", source: "84", sourceSimName: "BLZ", sourceRegion: "Belize", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Maize", year: "2016", value: "34.953", weight: "152", embodiedLand: "", embodiedWater: "", }, { eid: "e1356", source: "86", sourceSimName: "IOT", sourceRegion: "British Indian Ocean Territory", sourceName: "Oceania", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1361", source: "90", sourceSimName: "SLB", sourceRegion: "Solomon Isds", sourceName: "Oceania", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "13.167", weight: "42.315", embodiedLand: "3.486", embodiedWater: "5.332", }, { eid: "e1362", source: "90", sourceSimName: "SLB", sourceRegion: "Solomon Isds", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1377", source: "92", sourceSimName: "VGB", sourceRegion: "British Virgin Isds", sourceName: "Caribbean and Central America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "101.43", weight: "490", embodiedLand: "", embodiedWater: "", }, { eid: "e1387", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.011", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e1388", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1389", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "38.441", weight: "44.492", embodiedLand: "", embodiedWater: "", }, { eid: "e1390", source: "96", sourceSimName: "BRN", sourceRegion: "Brunei Darussalam", sourceName: "Southeast Asia", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "0.04", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e1483", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "24858.849", weight: "99000", embodiedLand: "", embodiedWater: "", }, { eid: "e1484", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "4.755", weight: "1.934", embodiedLand: "", embodiedWater: "", }, { eid: "e1485", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "93.704", weight: "126.275", embodiedLand: "", embodiedWater: "", }, { eid: "e1486", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Millet", year: "2015", value: "10.413", weight: "27.25", embodiedLand: "24.418", embodiedWater: "8.965", }, { eid: "e1487", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "17703.297", weight: "77309.781", embodiedLand: "18435.802", embodiedWater: "20873.641", }, { eid: "e1489", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Barley", year: "2015", value: "18.8800973", weight: "86.0444724", embodiedLand: "30.7293419", embodiedWater: "1.7204033", }, { eid: "e1490", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "160.110577", weight: "483.392365", embodiedLand: "", embodiedWater: "", }, { eid: "e1491", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "7432.909", weight: "38483.49", embodiedLand: "9381.188", embodiedWater: "11121.729", }, { eid: "e1493", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Barley", year: "2016", value: "189.513", weight: "314", embodiedLand: "", embodiedWater: "", }, { eid: "e1494", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.029", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e1495", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "12.528", weight: "0.77", embodiedLand: "", embodiedWater: "", }, { eid: "e1496", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1497", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "5189.99451", weight: "28567.1783", embodiedLand: "", embodiedWater: "", }, { eid: "e1498", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "14084.1964", weight: "76915.5622", embodiedLand: "", embodiedWater: "", }, { eid: "e1499", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "692.331", weight: "4066.65", embodiedLand: "", embodiedWater: "", }, { eid: "e1500", source: "100", sourceSimName: "BGR", sourceRegion: "Bulgaria", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "60.703", weight: "339.92", embodiedLand: "", embodiedWater: "", }, { eid: "e1609", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "10.25", weight: "12.219", embodiedLand: "", embodiedWater: "", }, { eid: "e1610", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "112", targetSimName: "BLR", targetName: "Belarus", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "25.7", weight: "75", embodiedLand: "25.54", embodiedWater: "174.3", }, { eid: "e1611", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "108.75", weight: "129.635", embodiedLand: "", embodiedWater: "", }, { eid: "e1612", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1613", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "43.5", weight: "52.27", embodiedLand: "", embodiedWater: "", }, { eid: "e1614", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "104.4", weight: "125.448", embodiedLand: "", embodiedWater: "", }, { eid: "e1615", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "598", targetSimName: "PNG", targetName: "Papua New Guinea", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "21.75", weight: "54.372", embodiedLand: "", embodiedWater: "", }, { eid: "e1616", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1617", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Rice", year: "2016", value: "1775", weight: "1500", embodiedLand: "", embodiedWater: "", }, { eid: "e1619", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "103.45", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e1620", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "137.5", weight: "500", embodiedLand: "", embodiedWater: "", }, { eid: "e1621", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.008", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1622", source: "104", sourceSimName: "MMR", sourceRegion: "Myanmar", sourceName: "Southeast Asia", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "44.4", weight: "120", embodiedLand: "", embodiedWater: "", }, { eid: "e1633", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.606", weight: "0.94", embodiedLand: "", embodiedWater: "", }, { eid: "e1634", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.844", weight: "0.74", embodiedLand: "0.015", embodiedWater: "", }, { eid: "e1635", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "53.041", weight: "90", embodiedLand: "", embodiedWater: "", }, { eid: "e1636", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.492", weight: "1.142", embodiedLand: "", embodiedWater: "", }, { eid: "e1637", source: "108", sourceSimName: "BDI", sourceRegion: "Burundi", sourceName: "Sub-Saharan Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1.021", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e1679", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.015", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e1680", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "3.1", weight: "21.96", embodiedLand: "22.086", embodiedWater: "", }, { eid: "e1681", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "120.2641915", weight: "207.744065", embodiedLand: "", embodiedWater: "", }, { eid: "e1682", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "0.2", weight: "0.09", embodiedLand: "", embodiedWater: "", }, { eid: "e1683", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "44.5214625", weight: "83.785883", embodiedLand: "26.1168536", embodiedWater: "7.20580295", }, { eid: "e1684", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.083", weight: "0.13", embodiedLand: "", embodiedWater: "", }, { eid: "e1685", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "991.896", weight: "5092.85", embodiedLand: "1019.042", embodiedWater: "6610.519", }, { eid: "e1686", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "642", targetSimName: "ROU", targetName: "Romania", targetRegion: "Europe", resource: "Maize", year: "2015", value: "165.472676", weight: "53.1172551", embodiedLand: "17.4316463", embodiedWater: "2398.72164", }, { eid: "e1687", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "1.31077251", weight: "2.06", embodiedLand: "", embodiedWater: "", }, { eid: "e1688", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "27.5722272", weight: "53.4685049", embodiedLand: "19.9639795", embodiedWater: "4.70535121", }, { eid: "e1689", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.773", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e1690", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Barley", year: "2016", value: "10.6", weight: "26.01", embodiedLand: "", embodiedWater: "", }, { eid: "e1691", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "482.1", weight: "2008.8", embodiedLand: "", embodiedWater: "", }, { eid: "e1693", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "6.9", weight: "24.4", embodiedLand: "", embodiedWater: "", }, { eid: "e1694", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "27", weight: "72.94", embodiedLand: "", embodiedWater: "", }, { eid: "e1695", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "10.9", weight: "43.76", embodiedLand: "", embodiedWater: "", }, { eid: "e1696", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Barley", year: "2016", value: "1.4152175", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e1697", source: "112", sourceSimName: "BLR", sourceRegion: "Belarus", sourceName: "Central and Northern Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Barley", year: "2016", value: "15.216", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e1792", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "2.058", weight: "1.939", embodiedLand: "", embodiedWater: "", }, { eid: "e1793", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "19.9307517", weight: "54.9268674", embodiedLand: "", embodiedWater: "", }, { eid: "e1795", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "722.843", weight: "2000", embodiedLand: "", embodiedWater: "", }, { eid: "e1796", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.181", weight: "0.05", embodiedLand: "0.0215", embodiedWater: "0.279", }, { eid: "e1797", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "36.5893875", weight: "46", embodiedLand: "22.382", embodiedWater: "419.888", }, { eid: "e1798", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1799", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "20.49", weight: "24.993", embodiedLand: "", embodiedWater: "", }, { eid: "e1800", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "35.6075332", weight: "62.4991805", embodiedLand: "", embodiedWater: "", }, { eid: "e1801", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "87.223", weight: "190", embodiedLand: "", embodiedWater: "", }, { eid: "e1802", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "123.708", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e1803", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "49.454", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e1804", source: "116", sourceSimName: "KHM", sourceRegion: "Cambodia", sourceName: "Southeast Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.332", weight: "1.44", embodiedLand: "", embodiedWater: "", }, { eid: "e1830", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e1831", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e1832", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.398", weight: "0.041", embodiedLand: "", embodiedWater: "", }, { eid: "e1833", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.379", weight: "0.09", embodiedLand: "0.015", embodiedWater: "", }, { eid: "e1834", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.031", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e1835", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "6.069", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e1836", source: "120", sourceSimName: "CMR", sourceRegion: "Cameroon", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2006", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2007", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "10.816", weight: "27.5", embodiedLand: "11.52", embodiedWater: "91.465", }, { eid: "e2008", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.942", weight: "5.224", embodiedLand: "", embodiedWater: "", }, { eid: "e2009", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1549.864", weight: "6461", embodiedLand: "2292.263", embodiedWater: "24648.715", }, { eid: "e2010", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "7.366", weight: "29.392", embodiedLand: "4.087", embodiedWater: "203.275", }, { eid: "e2011", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.105", weight: "0.346", embodiedLand: "", embodiedWater: "", }, { eid: "e2012", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Oats", year: "2016", value: "0.087", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e2013", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "162", targetSimName: "CXR", targetName: "Christmas Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "10.485", weight: "23", embodiedLand: "", embodiedWater: "", }, { eid: "e2014", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "71.847", weight: "90.718", embodiedLand: "", embodiedWater: "", }, { eid: "e2015", source: "124", sourceSimName: "CAN", sourceRegion: "Canada", sourceName: "North America", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "0.063", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2026", source: "136", sourceSimName: "CYM", sourceRegion: "Cayman Isds", sourceName: "Caribbean and Central America", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2028", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2015", value: "256.296", weight: "584", embodiedLand: "388.652", embodiedWater: "3227.184", }, { eid: "e2029", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2030", source: "140", sourceSimName: "CAF", sourceRegion: "Central African Rep.", sourceName: "Sub-Saharan Africa", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2122", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.617", weight: "0.4", embodiedLand: "0.171", embodiedWater: "9.947", }, { eid: "e2123", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.022", weight: "0.01", embodiedLand: "", embodiedWater: "0.074", }, { eid: "e2124", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "4.465", weight: "4", embodiedLand: "1.462", embodiedWater: "24.56", }, { eid: "e2125", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "674.364", weight: "998.75", embodiedLand: "394.423", embodiedWater: "8358.539", }, { eid: "e2126", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "10.169684", weight: "10", embodiedLand: "4.832", embodiedWater: "129.36", }, { eid: "e2127", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.6929921", weight: "0.39911438", embodiedLand: "0.02313548", embodiedWater: "", }, { eid: "e2128", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Barley", year: "2015", value: "0.021", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2129", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "956.722", weight: "1340", embodiedLand: "468.637", embodiedWater: "10142.46", }, { eid: "e2130", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.129", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2131", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "2581.403", weight: "1630", embodiedLand: "593.987", embodiedWater: "13326.88", }, { eid: "e2132", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.01799708", weight: "0.01963527", embodiedLand: "0.00589058", embodiedWater: "0.15119156", }, { eid: "e2133", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.055", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e2135", source: "144", sourceSimName: "LKA", sourceRegion: "Sri Lanka", sourceName: "South Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.797", weight: "0.084", embodiedLand: "", embodiedWater: "", }, { eid: "e2139", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2140", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.114", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e2141", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2142", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2143", source: "148", sourceSimName: "TCD", sourceRegion: "Chad", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.421", weight: "2", embodiedLand: "", embodiedWater: "", }, { eid: "e2227", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "7.466", weight: "0.804", embodiedLand: "", embodiedWater: "", }, { eid: "e2228", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "1.644", weight: "1", embodiedLand: "0.016", embodiedWater: "14.459", }, { eid: "e2229", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.104", weight: "0.058", embodiedLand: "", embodiedWater: "", }, { eid: "e2230", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "32.659", weight: "18.144", embodiedLand: "2.013", embodiedWater: "25.347", }, { eid: "e2231", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "50.962", weight: "29.8", embodiedLand: "", embodiedWater: "", }, { eid: "e2232", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.158", weight: "0.366", embodiedLand: "", embodiedWater: "", }, { eid: "e2233", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Rice", year: "2016", value: "0.57", weight: "0.216", embodiedLand: "", embodiedWater: "", }, { eid: "e2234", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "6.176", weight: "3.84", embodiedLand: "", embodiedWater: "", }, { eid: "e2235", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "13.32", weight: "40", embodiedLand: "", embodiedWater: "", }, { eid: "e2236", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2237", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "6.426", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e2238", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.14", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e2239", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.899", weight: "0.564", embodiedLand: "", embodiedWater: "", }, { eid: "e2240", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2241", source: "152", sourceSimName: "CHL", sourceRegion: "Chile", sourceName: "South America", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2433", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "63.059", weight: "215.408", embodiedLand: "", embodiedWater: "", }, { eid: "e2434", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.045", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e2435", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "9502.75", weight: "30250", embodiedLand: "", embodiedWater: "", }, { eid: "e2436", source: "156", sourceSimName: "CHN", sourceRegion: "East Asia", sourceName: "China", target: "798", targetSimName: "TUV", targetName: "Tuvalu", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "20.317", weight: "40.634", embodiedLand: "", embodiedWater: "", }, { eid: "e2439", source: "166", sourceSimName: "CCK", sourceRegion: "Cocos Isds", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2440", source: "166", sourceSimName: "CCK", sourceRegion: "Cocos Isds", sourceName: "Oceania", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2507", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.012", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e2508", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "4.945", weight: "5.004", embodiedLand: "", embodiedWater: "", }, { eid: "e2509", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2510", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "3.051", weight: "1.68", embodiedLand: "0.624", embodiedWater: "11.764", }, { eid: "e2511", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "5.99707857", weight: "0.49", embodiedLand: "", embodiedWater: "", }, { eid: "e2513", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.005", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e2514", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.02360264", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e2515", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.014", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e2516", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.661", weight: "0.55", embodiedLand: "", embodiedWater: "", }, { eid: "e2517", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "24.4083904", weight: "21.9972541", embodiedLand: "", embodiedWater: "", }, { eid: "e2518", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e2519", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "29.328", weight: "9.319", embodiedLand: "", embodiedWater: "", }, { eid: "e2520", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.09", weight: "0.114", embodiedLand: "", embodiedWater: "", }, { eid: "e2521", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "28.266", weight: "4", embodiedLand: "", embodiedWater: "", }, { eid: "e2522", source: "170", sourceSimName: "COL", sourceRegion: "Colombia", sourceName: "South America", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.253", weight: "0.239", embodiedLand: "", embodiedWater: "", }, { eid: "e2526", source: "174", sourceSimName: "COM", sourceRegion: "Comoros", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Rice", year: "2015", value: "64.83", weight: "89.969", embodiedLand: "", embodiedWater: "", }, { eid: "e2562", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.001", weight: "0.002", embodiedLand: "", embodiedWater: "0.003", }, { eid: "e2563", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.068", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2564", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "770.502", weight: "4498.68", embodiedLand: "242.589", embodiedWater: "7341.846", }, { eid: "e2565", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2566", source: "188", sourceSimName: "CRI", sourceRegion: "Costa Rica", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "17.311", weight: "18.402", embodiedLand: "", embodiedWater: "", }, { eid: "e2630", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Barley", year: "2015", value: "4009.71895", weight: "10426.471", embodiedLand: "4547.15483", embodiedWater: "417.058952", }, { eid: "e2631", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.159", weight: "0.162", embodiedLand: "0.019", embodiedWater: "0.163", }, { eid: "e2632", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.011", weight: "0.009", embodiedLand: "0.001", embodiedWater: "0.01", }, { eid: "e2634", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "0.4225", weight: "1.3", embodiedLand: "0.385", embodiedWater: "0.016", }, { eid: "e2635", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "0.02", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e2636", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "36.137", weight: "68", embodiedLand: "", embodiedWater: "", }, { eid: "e2637", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.947", weight: "0.19", embodiedLand: "", embodiedWater: "", }, { eid: "e2639", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "356.137", weight: "742.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2640", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "11.272", weight: "25.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2641", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "195.135725", weight: "405.023926", embodiedLand: "", embodiedWater: "", }, { eid: "e2642", source: "191", sourceSimName: "HRV", sourceRegion: "Croatia", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Barley", year: "2016", value: "1927.978", weight: "5003.87", embodiedLand: "", embodiedWater: "", }, { eid: "e2653", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "12.015", weight: "22", embodiedLand: "1.121", embodiedWater: "30.294", }, { eid: "e2654", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2655", source: "192", sourceSimName: "CUB", sourceRegion: "Cuba", sourceName: "Caribbean and Central America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2710", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "0.002", weight: "0.025", embodiedLand: "0.006", embodiedWater: "", }, { eid: "e2711", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "0.01", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e2712", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "275.094068", weight: "518.04557", embodiedLand: "852.454555", embodiedWater: "", }, { eid: "e2713", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.123", weight: "0.515", embodiedLand: "", embodiedWater: "", }, { eid: "e2714", source: "196", sourceSimName: "CYP", sourceRegion: "Cyprus", sourceName: "Europe", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.749", weight: "0.352", embodiedLand: "", embodiedWater: "", }, { eid: "e2815", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "218", targetSimName: "ECU", targetName: "Ecuador", targetRegion: "South America", resource: "Barley", year: "2015", value: "8.19775118", weight: "19.4429394", embodiedLand: "1.01453375", embodiedWater: "6.43614933", }, { eid: "e2816", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "47.058", weight: "31.738", embodiedLand: "", embodiedWater: "", }, { eid: "e2817", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "465.089207", weight: "1056.18955", embodiedLand: "59.5149034", embodiedWater: "349.59874", }, { eid: "e2818", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "1.53", weight: "0.296", embodiedLand: "", embodiedWater: "", }, { eid: "e2819", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Buckwheat", year: "2015", value: "0.077", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e2820", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Barley", year: "2015", value: "1233.57708", weight: "2500", embodiedLand: "273.915", embodiedWater: "302.5", }, { eid: "e2821", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "0.512", weight: "0.287", embodiedLand: "1.023", embodiedWater: "", }, { eid: "e2822", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Barley", year: "2015", value: "21.392", weight: "50.1", embodiedLand: "8.127", embodiedWater: "0.601", }, { eid: "e2823", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.59", weight: "1.093", embodiedLand: "", embodiedWater: "", }, { eid: "e2824", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "53.08", weight: "26.912", embodiedLand: "", embodiedWater: "", }, { eid: "e2825", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "4.409", weight: "7.5", embodiedLand: "", embodiedWater: "", }, { eid: "e2826", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.14", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e2827", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "12283.216", weight: "51375.101", embodiedLand: "", embodiedWater: "", }, { eid: "e2828", source: "203", sourceSimName: "CZE", sourceRegion: "Czech Rep.", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6823.806", weight: "28549.006", embodiedLand: "", embodiedWater: "", }, { eid: "e2852", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.041", weight: "0.125", embodiedLand: "0.007", embodiedWater: "1.054", }, { eid: "e2853", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.541", weight: "1", embodiedLand: "0.017", embodiedWater: "0.369", }, { eid: "e2854", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.01", weight: "0.017", embodiedLand: "0.009", embodiedWater: "0.129", }, { eid: "e2855", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "4.19", weight: "17.35", embodiedLand: "", embodiedWater: "", }, { eid: "e2856", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "1.874", weight: "0.506", embodiedLand: "", embodiedWater: "", }, { eid: "e2857", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "17.743", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e2858", source: "204", sourceSimName: "BEN", sourceRegion: "Benin", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "15.773", weight: "220", embodiedLand: "", embodiedWater: "", }, { eid: "e2992", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "17845.867", weight: "88000", embodiedLand: "", embodiedWater: "", }, { eid: "e2994", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "21.161", weight: "46", embodiedLand: "", embodiedWater: "", }, { eid: "e2995", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e2996", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Buckwheat", year: "2015", value: "0.02", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e2997", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.023", weight: "0.015", embodiedLand: "", embodiedWater: "0.191", }, { eid: "e2999", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.679", weight: "14", embodiedLand: "3.32", embodiedWater: "25.83", }, { eid: "e3000", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.035", weight: "0.031", embodiedLand: "0.002", embodiedWater: "0.435", }, { eid: "e3001", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "9.53", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e3002", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "146.629", weight: "272.52", embodiedLand: "", embodiedWater: "", }, { eid: "e3003", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3005", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.074", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e3006", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2016", value: "0.234", weight: "0.058", embodiedLand: "", embodiedWater: "", }, { eid: "e3007", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.206", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e3008", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rye", year: "2016", value: "22.102", weight: "41.204", embodiedLand: "", embodiedWater: "", }, { eid: "e3009", source: "208", sourceSimName: "DNK", sourceRegion: "Denmark", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Buckwheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3020", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.813", weight: "1.09", embodiedLand: "", embodiedWater: "", }, { eid: "e3021", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Millet", year: "2016", value: "6.079", weight: "9.869", embodiedLand: "", embodiedWater: "", }, { eid: "e3022", source: "212", sourceSimName: "DMA", sourceRegion: "Dominica", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3073", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "62.9969656", weight: "133.149681", embodiedLand: "", embodiedWater: "", }, { eid: "e3074", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3075", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.011", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e3076", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "41.744", weight: "63.999", embodiedLand: "", embodiedWater: "", }, { eid: "e3077", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Sorghum", year: "2016", value: "0.3", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e3078", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.752", weight: "0.558", embodiedLand: "", embodiedWater: "", }, { eid: "e3080", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.466", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e3081", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.1", weight: "0.057", embodiedLand: "", embodiedWater: "", }, { eid: "e3082", source: "214", sourceSimName: "DOM", sourceRegion: "Dominican Rep.", sourceName: "Caribbean and Central America", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.258", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e3129", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "0.25", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e3130", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "655.12", weight: "117.45", embodiedLand: "", embodiedWater: "", }, { eid: "e3131", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.508", weight: "0.065", embodiedLand: "", embodiedWater: "", }, { eid: "e3132", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.061", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e3133", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.012", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3134", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.20254593", weight: "0.0630884", embodiedLand: "", embodiedWater: "", }, { eid: "e3136", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.001", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e3137", source: "218", sourceSimName: "ECU", sourceRegion: "Ecuador", sourceName: "South America", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.017", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3151", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.016", weight: "0.02", embodiedLand: "", embodiedWater: "0.015", }, { eid: "e3152", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2015", value: "21.36", weight: "26.04", embodiedLand: "4.462", embodiedWater: "131.762", }, { eid: "e3153", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.231", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e3154", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.36", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e3155", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "218", targetSimName: "ECU", targetName: "Ecuador", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.076", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e3156", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.25", weight: "0.076", embodiedLand: "", embodiedWater: "", }, { eid: "e3157", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.651", weight: "0.464", embodiedLand: "", embodiedWater: "", }, { eid: "e3158", source: "222", sourceSimName: "SLV", sourceRegion: "El Salvador", sourceName: "Caribbean and Central America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "3.55", weight: "1.075", embodiedLand: "", embodiedWater: "", }, { eid: "e3160", source: "226", sourceSimName: "GNQ", sourceRegion: "Equatorial Guinea", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3161", source: "226", sourceSimName: "GNQ", sourceRegion: "Equatorial Guinea", sourceName: "Sub-Saharan Africa", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3214", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "3.757", weight: "0.78", embodiedLand: "", embodiedWater: "", }, { eid: "e3215", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.159", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e3216", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.24744121", weight: "0.12643068", embodiedLand: "", embodiedWater: "", }, { eid: "e3217", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.084", weight: "0.1", embodiedLand: "0.012", embodiedWater: "0.881", }, { eid: "e3218", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.056", weight: "0.045", embodiedLand: "0.019", embodiedWater: "", }, { eid: "e3219", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3220", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.059", weight: "0.025", embodiedLand: "0.073", embodiedWater: "", }, { eid: "e3221", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.051", weight: "0.015", embodiedLand: "0.008", embodiedWater: "", }, { eid: "e3223", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.388", weight: "0.705", embodiedLand: "0.027", embodiedWater: "0.492", }, { eid: "e3224", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "17.374", weight: "40", embodiedLand: "16.921", embodiedWater: "2.24", }, { eid: "e3225", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.641", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e3226", source: "231", sourceSimName: "ETH", sourceRegion: "Ethiopia", sourceName: "Sub-Saharan Africa", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.072", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e3231", source: "232", sourceSimName: "ERI", sourceRegion: "Eritrea", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3232", source: "232", sourceSimName: "ERI", sourceRegion: "Eritrea", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3283", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "60.169", weight: "40.581", embodiedLand: "", embodiedWater: "", }, { eid: "e3284", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "12273.129", weight: "69000", embodiedLand: "19376.402", embodiedWater: "3036", }, { eid: "e3285", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "8159.47956", weight: "44000", embodiedLand: "12365.057", embodiedWater: "308", }, { eid: "e3286", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "5697.635", weight: "31498.19", embodiedLand: "8131.804", embodiedWater: "10992.868", }, { eid: "e3287", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "19.337", weight: "53.21", embodiedLand: "", embodiedWater: "", }, { eid: "e3288", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "6239.34", weight: "22384.14", embodiedLand: "", embodiedWater: "", }, { eid: "e3289", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "3166.555", weight: "15864", embodiedLand: "4286.655", embodiedWater: "5393.76", }, { eid: "e3290", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Barley", year: "2015", value: "0.015", weight: "0.019", embodiedLand: "0.006", embodiedWater: "0.001", }, { eid: "e3291", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Barley", year: "2016", value: "3.176", weight: "2.4", embodiedLand: "", embodiedWater: "", }, { eid: "e3292", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "12.414", weight: "49.122", embodiedLand: "", embodiedWater: "", }, { eid: "e3293", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "0.003", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3294", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "629.386", weight: "2596.853", embodiedLand: "", embodiedWater: "", }, { eid: "e3295", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.039", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e3296", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rye", year: "2016", value: "31.581", weight: "76.353", embodiedLand: "", embodiedWater: "", }, { eid: "e3297", source: "233", sourceSimName: "EST", sourceRegion: "Estonia", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "4160.65711", weight: "25476.5045", embodiedLand: "", embodiedWater: "", }, { eid: "e3338", source: "242", sourceSimName: "FJI", sourceRegion: "Fiji", sourceName: "Oceania", target: "162", targetSimName: "CXR", targetName: "Christmas Isds", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "39.068", weight: "88.5", embodiedLand: "", embodiedWater: "", }, { eid: "e3339", source: "242", sourceSimName: "FJI", sourceRegion: "Fiji", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.007", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e3435", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "481.381304", weight: "1599.203", embodiedLand: "471.659", embodiedWater: "", }, { eid: "e3436", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.092", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e3437", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "0.004", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3438", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.086", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e3439", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "1.48", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e3440", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2015", value: "0.01", weight: "0.018", embodiedLand: "0.006", embodiedWater: "0.007", }, { eid: "e3441", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.067", weight: "0.029", embodiedLand: "0.008", embodiedWater: "", }, { eid: "e3442", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "21.849", weight: "36.603", embodiedLand: "", embodiedWater: "", }, { eid: "e3443", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.071", weight: "0.32", embodiedLand: "", embodiedWater: "", }, { eid: "e3444", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2015", value: "0.572", weight: "0.065", embodiedLand: "", embodiedWater: "", }, { eid: "e3445", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "2.1", weight: "0.929", embodiedLand: "", embodiedWater: "", }, { eid: "e3446", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.762", weight: "0.575", embodiedLand: "", embodiedWater: "", }, { eid: "e3447", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3448", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Oats", year: "2016", value: "1.191", weight: "0.475", embodiedLand: "", embodiedWater: "", }, { eid: "e3449", source: "246", sourceSimName: "FIN", sourceRegion: "Finland", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.702", weight: "0.182", embodiedLand: "", embodiedWater: "", }, { eid: "e3640", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "16", targetSimName: "ASM", targetName: "American Samoa", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3641", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "292", targetSimName: "GIB", targetName: "Gibraltar", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.099", weight: "0.075", embodiedLand: "", embodiedWater: "", }, { eid: "e3643", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "674", targetSimName: "SMR", targetName: "San Marino", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3644", source: "251", sourceSimName: "FRA", sourceRegion: "France", sourceName: "Europe", target: "796", targetSimName: "TCA", targetName: "Turks and Caicos Isds", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.039", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e3646", source: "258", sourceSimName: "PYF", sourceRegion: "French Polynesia", sourceName: "Oceania", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.303", weight: "0.161", embodiedLand: "", embodiedWater: "0.66", }, { eid: "e3647", source: "258", sourceSimName: "PYF", sourceRegion: "French Polynesia", sourceName: "Oceania", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "11.76", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e3661", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1697.791", weight: "4715.65", embodiedLand: "", embodiedWater: "", }, { eid: "e3662", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.117", weight: "0.241", embodiedLand: "", embodiedWater: "", }, { eid: "e3663", source: "262", sourceSimName: "DJI", sourceRegion: "Djibouti", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "10.466", weight: "5.65", embodiedLand: "", embodiedWater: "", }, { eid: "e3674", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3675", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e3676", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3677", source: "266", sourceSimName: "GAB", sourceRegion: "Gabon", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3707", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.048", weight: "0.038", embodiedLand: "", embodiedWater: "", }, { eid: "e3708", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "4.8", weight: "24", embodiedLand: "18.872", embodiedWater: "2.136", }, { eid: "e3709", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.005", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e3710", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "22.678", weight: "38.023", embodiedLand: "", embodiedWater: "", }, { eid: "e3711", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.252", weight: "0.455", embodiedLand: "0.074", embodiedWater: "1.176", }, { eid: "e3712", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "27", weight: "4.86", embodiedLand: "2.151", embodiedWater: "5.56", }, { eid: "e3713", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Maize", year: "2016", value: "2.61599203", weight: "1.05", embodiedLand: "", embodiedWater: "", }, { eid: "e3714", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "23.6", weight: "47.6", embodiedLand: "", embodiedWater: "", }, { eid: "e3715", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "12.179", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e3716", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "9.5", weight: "50", embodiedLand: "", embodiedWater: "", }, { eid: "e3718", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.00114478", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e3719", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "18.278", weight: "19.24", embodiedLand: "", embodiedWater: "", }, { eid: "e3720", source: "268", sourceSimName: "GEO", sourceRegion: "Georgia", sourceName: "Central and Northern Asia", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3734", source: "270", sourceSimName: "GMB", sourceRegion: "Gambia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "8.156", weight: "9", embodiedLand: "0.265", embodiedWater: "11.43", }, { eid: "e3735", source: "270", sourceSimName: "GMB", sourceRegion: "Gambia", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3766", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.984", weight: "1.468", embodiedLand: "", embodiedWater: "", }, { eid: "e3767", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2015", value: "6.887", weight: "10.275", embodiedLand: "", embodiedWater: "", }, { eid: "e3769", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.621", weight: "0.057", embodiedLand: "", embodiedWater: "", }, { eid: "e3770", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "37.922", weight: "50", embodiedLand: "", embodiedWater: "", }, { eid: "e3771", source: "275", sourceSimName: "PSE", sourceRegion: "State of Palestine", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "0.035", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e3963", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.908", weight: "23", embodiedLand: "6.114", embodiedWater: "87.285", }, { eid: "e3964", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.077", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e3965", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Barley", year: "2015", value: "14.0348425", weight: "26", embodiedLand: "4.29", embodiedWater: "0.234", }, { eid: "e3966", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3967", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "612", targetSimName: "PCN", targetName: "Pitcairn", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e3968", source: "276", sourceSimName: "DEU", sourceRegion: "Germany", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1.096", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4026", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.234", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e4028", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "427.155", weight: "1504", embodiedLand: "", embodiedWater: "", }, { eid: "e4029", source: "288", sourceSimName: "GHA", sourceRegion: "Ghana", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e4034", source: "292", sourceSimName: "GIB", sourceRegion: "Gibraltar", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4035", source: "292", sourceSimName: "GIB", sourceRegion: "Gibraltar", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "3.999", weight: "3.334", embodiedLand: "", embodiedWater: "", }, { eid: "e4038", source: "296", sourceSimName: "KIR", sourceRegion: "Kiribati", sourceName: "Oceania", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "1.46", weight: "0.327", embodiedLand: "", embodiedWater: "", }, { eid: "e4130", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.592", weight: "0.381", embodiedLand: "", embodiedWater: "", }, { eid: "e4131", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Wheat", year: "2015", value: "0.535", weight: "0.685", embodiedLand: "0.344", embodiedWater: "2.925", }, { eid: "e4132", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.225", weight: "0.51", embodiedLand: "0.297", embodiedWater: "0.907", }, { eid: "e4133", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.222", weight: "0.099", embodiedLand: "", embodiedWater: "", }, { eid: "e4134", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.619", weight: "0.9", embodiedLand: "0.215", embodiedWater: "12.695", }, { eid: "e4135", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "1.643", weight: "0.811", embodiedLand: "0.35", embodiedWater: "22.782", }, { eid: "e4136", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "148", targetSimName: "TCD", targetName: "Chad", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9.296", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4139", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.194", weight: "0.105", embodiedLand: "", embodiedWater: "", }, { eid: "e4140", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4141", source: "300", sourceSimName: "GRC", sourceRegion: "Greece", sourceName: "Europe", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "1.549", weight: "0.33", embodiedLand: "", embodiedWater: "", }, { eid: "e4144", source: "304", sourceSimName: "GRL", sourceRegion: "Greenland", sourceName: "North America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4145", source: "304", sourceSimName: "GRL", sourceRegion: "Greenland", sourceName: "North America", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.094", weight: "0.052", embodiedLand: "", embodiedWater: "", }, { eid: "e4160", source: "308", sourceSimName: "GRD", sourceRegion: "Grenada", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4161", source: "308", sourceSimName: "GRD", sourceRegion: "Grenada", sourceName: "Caribbean and Central America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.117", weight: "0.258", embodiedLand: "", embodiedWater: "", }, { eid: "e4166", source: "316", sourceSimName: "GUM", sourceRegion: "Guam", sourceName: "Oceania", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.645", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e4197", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.45", weight: "0.023", embodiedLand: "", embodiedWater: "", }, { eid: "e4198", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.011", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e4199", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4200", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.225", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e4201", source: "320", sourceSimName: "GTM", sourceRegion: "Guatemala", sourceName: "Caribbean and Central America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "2.383", weight: "0.959", embodiedLand: "", embodiedWater: "", }, { eid: "e4222", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4223", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1121.1076", weight: "9902.574", embodiedLand: "74.073", embodiedWater: "16091.683", }, { eid: "e4224", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "151.325", weight: "781.716", embodiedLand: "851.781", embodiedWater: "8133.755", }, { eid: "e4225", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "14.702", weight: "22.538", embodiedLand: "26.147", embodiedWater: "54.384", }, { eid: "e4226", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4227", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "514.56", weight: "516", embodiedLand: "", embodiedWater: "", }, { eid: "e4229", source: "324", sourceSimName: "GIN", sourceRegion: "Guinea", sourceName: "Sub-Saharan Africa", target: "418", targetSimName: "LAO", targetName: "Lao PDR", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4274", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "2.93", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e4275", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "12.9452924", weight: "80.64", embodiedLand: "", embodiedWater: "", }, { eid: "e4276", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "79.617", weight: "404.777", embodiedLand: "", embodiedWater: "", }, { eid: "e4277", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Rice", year: "2015", value: "146.081", weight: "186.97", embodiedLand: "46.045", embodiedWater: "1298.32", }, { eid: "e4278", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "2751.76304", weight: "3460.64811", embodiedLand: "", embodiedWater: "", }, { eid: "e4279", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "12.957", weight: "2.49", embodiedLand: "", embodiedWater: "", }, { eid: "e4280", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4281", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "336", targetSimName: "VAT", targetName: "Holy See", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4282", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "20.016", weight: "50.04", embodiedLand: "", embodiedWater: "", }, { eid: "e4283", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "6.893", weight: "24.705", embodiedLand: "", embodiedWater: "", }, { eid: "e4284", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4285", source: "328", sourceSimName: "GUY", sourceRegion: "Guyana", sourceName: "South America", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "2.422", weight: "26.912", embodiedLand: "", embodiedWater: "", }, { eid: "e4298", source: "332", sourceSimName: "HTI", sourceRegion: "Haiti", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4323", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Barley", year: "2015", value: "201.042", weight: "323.82", embodiedLand: "", embodiedWater: "", }, { eid: "e4324", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "20.24", weight: "39.916", embodiedLand: "24.266", embodiedWater: "18.162", }, { eid: "e4326", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "47.6473533", weight: "48.6243931", embodiedLand: "", embodiedWater: "", }, { eid: "e4327", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Rice", year: "2016", value: "0.19", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e4328", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2016", value: "8.858", weight: "8.732", embodiedLand: "", embodiedWater: "", }, { eid: "e4329", source: "340", sourceSimName: "HND", sourceRegion: "Honduras", sourceName: "Caribbean and Central America", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "44.64", weight: "96.16", embodiedLand: "", embodiedWater: "", }, { eid: "e4428", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.008", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e4429", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "0.001", }, { eid: "e4430", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Barley", year: "2015", value: "0.109", weight: "0.125", embodiedLand: "0.011", embodiedWater: "0.001", }, { eid: "e4431", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "119.521", weight: "420", embodiedLand: "51.421", embodiedWater: "660.66", }, { eid: "e4432", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "658.77", weight: "2218.1", embodiedLand: "206.877", embodiedWater: "2437.692", }, { eid: "e4434", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "83.377", weight: "273", embodiedLand: "31.384", embodiedWater: "559.377", }, { eid: "e4435", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "0.026", weight: "0.016", embodiedLand: "0.002", embodiedWater: "0.007", }, { eid: "e4436", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "10.865", weight: "21", embodiedLand: "2.303", embodiedWater: "31.017", }, { eid: "e4437", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "13.347", weight: "102.23", embodiedLand: "", embodiedWater: "", }, { eid: "e4439", source: "348", sourceSimName: "HUN", sourceRegion: "Hungary", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "677.568524", weight: "630.017434", embodiedLand: "", embodiedWater: "", }, { eid: "e4461", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "2.403", weight: "4.029", embodiedLand: "", embodiedWater: "", }, { eid: "e4462", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Barley", year: "2015", value: "62.13", weight: "18", embodiedLand: "", embodiedWater: "", }, { eid: "e4463", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4464", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4465", source: "352", sourceSimName: "ISL", sourceRegion: "Iceland", sourceName: "Europe", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4568", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "38.048", weight: "120.8", embodiedLand: "11.771", embodiedWater: "164.409", }, { eid: "e4569", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "61.273", weight: "67.74", embodiedLand: "35.111", embodiedWater: "", }, { eid: "e4570", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "1.304", weight: "0.144", embodiedLand: "", embodiedWater: "", }, { eid: "e4571", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "316", targetSimName: "GUM", targetName: "Guam", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4572", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.065", weight: "0.081", embodiedLand: "0.062", embodiedWater: "0.774", }, { eid: "e4573", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "64.711", weight: "26.777", embodiedLand: "", embodiedWater: "", }, { eid: "e4574", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "219", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e4575", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.119", weight: "0.083", embodiedLand: "", embodiedWater: "", }, { eid: "e4576", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "3.501", weight: "0.725", embodiedLand: "", embodiedWater: "", }, { eid: "e4577", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2016", value: "2424", weight: "12000", embodiedLand: "", embodiedWater: "", }, { eid: "e4578", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2016", value: "0.756", weight: "0.947", embodiedLand: "", embodiedWater: "", }, { eid: "e4579", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "270", targetSimName: "GMB", targetName: "Gambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "74.884", weight: "270", embodiedLand: "", embodiedWater: "", }, { eid: "e4581", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "0.437", weight: "0.069", embodiedLand: "", embodiedWater: "", }, { eid: "e4582", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2016", value: "1.06", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4583", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1.59", weight: "0.745", embodiedLand: "", embodiedWater: "", }, { eid: "e4584", source: "360", sourceSimName: "IDN", sourceRegion: "Indonesia", sourceName: "Southeast Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.473", weight: "1.76", embodiedLand: "", embodiedWater: "", }, { eid: "e4635", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "4159.919", weight: "14678.618", embodiedLand: "", embodiedWater: "", }, { eid: "e4636", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.04", weight: "0.15", embodiedLand: "0.011", embodiedWater: "2.752", }, { eid: "e4637", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "17.595", weight: "6.84", embodiedLand: "2.127", embodiedWater: "193.278", }, { eid: "e4638", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "8.79", weight: "43.87", embodiedLand: "15.986", embodiedWater: "396.322", }, { eid: "e4639", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.24", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e4640", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "0.044", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e4641", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.021", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e4642", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2.244", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e4643", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "398.292", weight: "821.65", embodiedLand: "", embodiedWater: "", }, { eid: "e4644", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.079", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e4645", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.62", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e4646", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.157", weight: "0.279", embodiedLand: "", embodiedWater: "", }, { eid: "e4647", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.129", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e4649", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.027", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e4650", source: "364", sourceSimName: "IRN", sourceRegion: "Iran", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.078", weight: "1.118", embodiedLand: "", embodiedWater: "", }, { eid: "e4661", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4662", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "2.843", weight: "1.59", embodiedLand: "", embodiedWater: "", }, { eid: "e4663", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Maize", year: "2016", value: "160.874", weight: "36.36", embodiedLand: "", embodiedWater: "", }, { eid: "e4664", source: "368", sourceSimName: "IRQ", sourceRegion: "Iraq", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.002", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e4731", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "159.042", weight: "32.792", embodiedLand: "", embodiedWater: "", }, { eid: "e4732", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2015", value: "14.867", weight: "44.1", embodiedLand: "6.096", embodiedWater: "34.089", }, { eid: "e4733", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.516", weight: "0.152", embodiedLand: "", embodiedWater: "", }, { eid: "e4734", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "21.023", weight: "42.5", embodiedLand: "0.457", embodiedWater: "48.195", }, { eid: "e4735", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "11.011", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4736", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Rice", year: "2015", value: "3.051", weight: "0.378", embodiedLand: "", embodiedWater: "", }, { eid: "e4737", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "2.542", weight: "0.94", embodiedLand: "0.161", embodiedWater: "0.968", }, { eid: "e4738", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "2.238", weight: "2.262", embodiedLand: "", embodiedWater: "", }, { eid: "e4739", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e4740", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e4742", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Barley", year: "2016", value: "0.468", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e4743", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "11.066", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4744", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "1.695", weight: "0.9", embodiedLand: "", embodiedWater: "", }, { eid: "e4745", source: "372", sourceSimName: "IRL", sourceRegion: "Ireland", sourceName: "Europe", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2016", value: "0.132", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e4824", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.024", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e4825", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Maize", year: "2015", value: "12", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e4826", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Wheat", year: "2015", value: "134.901099", weight: "54.1360357", embodiedLand: "", embodiedWater: "", }, { eid: "e4827", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "1", weight: "0.5", embodiedLand: "0.012", embodiedWater: "4.356", }, { eid: "e4828", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "38", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e4829", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "14.005348", weight: "27.7814111", embodiedLand: "", embodiedWater: "", }, { eid: "e4830", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "11.071", weight: "48", embodiedLand: "2.36", embodiedWater: "517.776", }, { eid: "e4831", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "10", weight: "7.385", embodiedLand: "", embodiedWater: "", }, { eid: "e4832", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Wheat", year: "2016", value: "1", weight: "2.895", embodiedLand: "", embodiedWater: "", }, { eid: "e4833", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "121", weight: "381.095", embodiedLand: "", embodiedWater: "", }, { eid: "e4834", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.828", weight: "0.575", embodiedLand: "", embodiedWater: "", }, { eid: "e4835", source: "376", sourceSimName: "ISR", sourceRegion: "Israel", sourceName: "Middle East and North Africa", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "2", weight: "4.806", embodiedLand: "", embodiedWater: "", }, { eid: "e5015", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.273", weight: "1.5", embodiedLand: "0.94", embodiedWater: "5.117", }, { eid: "e5016", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "762", targetSimName: "TJK", targetName: "Tajikistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "2.747", weight: "3.75", embodiedLand: "1.24", embodiedWater: "1.117", }, { eid: "e5017", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.099", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e5018", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5019", source: "381", sourceSimName: "ITA", sourceRegion: "Italy", sourceName: "Europe", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5065", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "4.837", weight: "0.288", embodiedLand: "", embodiedWater: "", }, { eid: "e5066", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.222", weight: "0.057", embodiedLand: "0.004", embodiedWater: "", }, { eid: "e5067", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.102", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e5068", source: "384", sourceSimName: "CIV", sourceRegion: "Cote d'Ivoire", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Oats", year: "2016", value: "26.888", weight: "155.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5104", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "819.786", weight: "4674.18", embodiedLand: "7.562", embodiedWater: "5814.68", }, { eid: "e5105", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "5.202", weight: "20.58", embodiedLand: "", embodiedWater: "", }, { eid: "e5106", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.134", weight: "0.159", embodiedLand: "", embodiedWater: "", }, { eid: "e5107", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "3.186", weight: "1.973", embodiedLand: "", embodiedWater: "", }, { eid: "e5108", source: "388", sourceSimName: "JAM", sourceRegion: "Jamaica", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.004", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e5246", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.646", weight: "0.435", embodiedLand: "", embodiedWater: "", }, { eid: "e5247", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.115", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e5248", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "1285.878", weight: "3253", embodiedLand: "695.174", embodiedWater: "27878.21", }, { eid: "e5249", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "5.677", weight: "2", embodiedLand: "0.486", embodiedWater: "17.53", }, { eid: "e5250", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.05", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e5251", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.128", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e5252", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.792", weight: "1.676", embodiedLand: "", embodiedWater: "", }, { eid: "e5253", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.33", weight: "0.339", embodiedLand: "", embodiedWater: "", }, { eid: "e5254", source: "392", sourceSimName: "JPN", sourceRegion: "Japan", sourceName: "East Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "1536.952", weight: "2498.778", embodiedLand: "", embodiedWater: "", }, { eid: "e5319", source: "398", sourceSimName: "KAZ", sourceRegion: "Kazakhstan", sourceName: "Central and Northern Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.05", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e5321", source: "398", sourceSimName: "KAZ", sourceRegion: "Kazakhstan", sourceName: "Central and Northern Asia", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.184", weight: "0.086", embodiedLand: "", embodiedWater: "", }, { eid: "e5368", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "7.112", weight: "6.518", embodiedLand: "", embodiedWater: "", }, { eid: "e5369", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.631", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e5370", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.879", weight: "0.168", embodiedLand: "", embodiedWater: "", }, { eid: "e5371", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1.34", weight: "1.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5372", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.026", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e5373", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5374", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.066", weight: "0.649", embodiedLand: "0.046", embodiedWater: "1.955", }, { eid: "e5375", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.143", weight: "0.09", embodiedLand: "", embodiedWater: "", }, { eid: "e5376", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "15280.683", weight: "52494.791", embodiedLand: "49024.216", embodiedWater: "2673717.19", }, { eid: "e5377", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.138", weight: "0.053", embodiedLand: "", embodiedWater: "", }, { eid: "e5378", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "36.011", weight: "115", embodiedLand: "4.942", embodiedWater: "825.24", }, { eid: "e5379", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.825", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5380", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Buckwheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5381", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.946", weight: "0.6", embodiedLand: "", embodiedWater: "", }, { eid: "e5382", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.075", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e5383", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "14.272", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e5384", source: "400", sourceSimName: "JOR", sourceRegion: "Jordan", sourceName: "Middle East and North Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.015", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e5447", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.104", weight: "0.05", embodiedLand: "0.015", embodiedWater: "0.286", }, { eid: "e5448", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5449", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5450", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "75.807", weight: "147.131", embodiedLand: "88.514", embodiedWater: "387.69", }, { eid: "e5451", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e5452", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "21.654", weight: "2.897", embodiedLand: "", embodiedWater: "", }, { eid: "e5453", source: "404", sourceSimName: "KEN", sourceRegion: "Kenya", sourceName: "Sub-Saharan Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5494", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "2.118", weight: "3.342", embodiedLand: "0.863", embodiedWater: "4.802", }, { eid: "e5495", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.119", weight: "0.1", embodiedLand: "", embodiedWater: "0.729", }, { eid: "e5496", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5497", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.364", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e5498", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "1.66", weight: "0.715", embodiedLand: "0.028", embodiedWater: "7.631", }, { eid: "e5499", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "0.079", weight: "0.06", embodiedLand: "0.004", embodiedWater: "0.152", }, { eid: "e5500", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.181", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e5501", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.047", weight: "0.08", embodiedLand: "", embodiedWater: "0.392", }, { eid: "e5502", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.255", weight: "0.5", embodiedLand: "", embodiedWater: "", }, { eid: "e5503", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.325", weight: "0.708", embodiedLand: "", embodiedWater: "", }, { eid: "e5504", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.3", weight: "0.22", embodiedLand: "", embodiedWater: "", }, { eid: "e5505", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "0.332", weight: "0.309", embodiedLand: "", embodiedWater: "", }, { eid: "e5506", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "18.636", weight: "8.967", embodiedLand: "", embodiedWater: "", }, { eid: "e5507", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.419", weight: "1.356", embodiedLand: "", embodiedWater: "", }, { eid: "e5508", source: "414", sourceSimName: "KWT", sourceRegion: "Kuwait", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.096", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e5524", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2015", value: "0.494", weight: "0.62", embodiedLand: "0.027", embodiedWater: "3.678", }, { eid: "e5525", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.056", weight: "0.05", embodiedLand: "", embodiedWater: "0.088", }, { eid: "e5526", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "3", weight: "12", embodiedLand: "", embodiedWater: "", }, { eid: "e5527", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "20.543", weight: "47.935", embodiedLand: "", embodiedWater: "", }, { eid: "e5528", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.012", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e5529", source: "417", sourceSimName: "KGZ", sourceRegion: "Kyrgyzstan", sourceName: "Central and Northern Asia", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1391.017", weight: "5169.24", embodiedLand: "", embodiedWater: "", }, { eid: "e5568", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "23.4938257", weight: "28.2050024", embodiedLand: "", embodiedWater: "", }, { eid: "e5569", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.444", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e5570", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.073", weight: "0.04", embodiedLand: "0.013", embodiedWater: "0.105", }, { eid: "e5571", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "38.47", weight: "46.226", embodiedLand: "", embodiedWater: "", }, { eid: "e5573", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "25.024", weight: "144.873", embodiedLand: "", embodiedWater: "", }, { eid: "e5574", source: "418", sourceSimName: "LAO", sourceRegion: "Lao PDR", sourceName: "Southeast Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "4.454", weight: "5.88", embodiedLand: "", embodiedWater: "", }, { eid: "e5680", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "2.433", weight: "1.32", embodiedLand: "", embodiedWater: "", }, { eid: "e5681", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5682", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.07", weight: "0.14", embodiedLand: "", embodiedWater: "", }, { eid: "e5683", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.736", weight: "0.54", embodiedLand: "", embodiedWater: "", }, { eid: "e5684", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.061", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e5685", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Other cereals", year: "2016", value: "0.448", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e5686", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.038", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e5687", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "11.6", weight: "2.25", embodiedLand: "", embodiedWater: "", }, { eid: "e5688", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1.756", weight: "2.3", embodiedLand: "", embodiedWater: "", }, { eid: "e5689", source: "422", sourceSimName: "LBN", sourceRegion: "Lebanon", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "6.46160548", weight: "12.1968756", embodiedLand: "", embodiedWater: "", }, { eid: "e5696", source: "426", sourceSimName: "LSO", sourceRegion: "Lesotho", sourceName: "Sub-Saharan Africa", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Millet", year: "2015", value: "11.926", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e5697", source: "426", sourceSimName: "LSO", sourceRegion: "Lesotho", sourceName: "Sub-Saharan Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "21.18", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e5790", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "76.094", weight: "231.535", embodiedLand: "70.276", embodiedWater: "42.371", }, { eid: "e5791", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "268", targetSimName: "GEO", targetName: "Georgia", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "21.3954741", weight: "17.634", embodiedLand: "7.808", embodiedWater: "", }, { eid: "e5792", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "9.879", weight: "16.669", embodiedLand: "", embodiedWater: "", }, { eid: "e5793", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "108.18118", weight: "282.748174", embodiedLand: "120.980124", embodiedWater: "113.947519", }, { eid: "e5794", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Oats", year: "2015", value: "55.429", weight: "102", embodiedLand: "50.006", embodiedWater: "", }, { eid: "e5795", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Barley", year: "2015", value: "14.519", weight: "16.8", embodiedLand: "5.346", embodiedWater: "0.79", }, { eid: "e5796", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "3040.717", weight: "12000", embodiedLand: "3410.976", embodiedWater: "1416", }, { eid: "e5797", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "10.2", weight: "22.5", embodiedLand: "9.765", embodiedWater: "4.14", }, { eid: "e5798", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5928.904", weight: "27800", embodiedLand: "8141.021", embodiedWater: "5087.4", }, { eid: "e5799", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Oats", year: "2015", value: "12.5758647", weight: "18.1209308", embodiedLand: "9.21064206", embodiedWater: "", }, { eid: "e5800", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.085", weight: "0.05", embodiedLand: "0.004", embodiedWater: "", }, { eid: "e5801", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "126.649", weight: "523.72", embodiedLand: "", embodiedWater: "", }, { eid: "e5802", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.005", weight: "0.02", embodiedLand: "0.006", embodiedWater: "0.002", }, { eid: "e5803", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9979.327", weight: "49080.54", embodiedLand: "", embodiedWater: "", }, { eid: "e5804", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "9773.51", weight: "50317.92", embodiedLand: "", embodiedWater: "", }, { eid: "e5805", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1120.625", weight: "6464.72", embodiedLand: "", embodiedWater: "", }, { eid: "e5806", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Wheat", year: "2016", value: "6.55", weight: "13.716", embodiedLand: "", embodiedWater: "", }, { eid: "e5807", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "66.234", weight: "130.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5808", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "59.9755096", weight: "147.628533", embodiedLand: "", embodiedWater: "", }, { eid: "e5809", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Oats", year: "2016", value: "7.622", weight: "13.025", embodiedLand: "", embodiedWater: "", }, { eid: "e5810", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Oats", year: "2016", value: "32.2000609", weight: "184.508668", embodiedLand: "", embodiedWater: "", }, { eid: "e5811", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "3824.84552", weight: "18150", embodiedLand: "", embodiedWater: "", }, { eid: "e5812", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Buckwheat", year: "2016", value: "1.014", weight: "1.003", embodiedLand: "", embodiedWater: "", }, { eid: "e5813", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "47.074", weight: "169", embodiedLand: "", embodiedWater: "", }, { eid: "e5814", source: "428", sourceSimName: "LVA", sourceRegion: "Latvia", sourceName: "Europe", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "0.9", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5823", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "72.763", weight: "511.55", embodiedLand: "1.752", embodiedWater: "713.612", }, { eid: "e5824", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "5860.639", weight: "25633.05", embodiedLand: "", embodiedWater: "", }, { eid: "e5825", source: "430", sourceSimName: "LBR", sourceRegion: "Liberia", sourceName: "Sub-Saharan Africa", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "43.94", weight: "396.75", embodiedLand: "", embodiedWater: "", }, { eid: "e5832", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.003", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e5833", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.008", weight: "0.013", embodiedLand: "", embodiedWater: "0.124", }, { eid: "e5834", source: "434", sourceSimName: "LBY", sourceRegion: "Libya", sourceName: "Middle East and North Africa", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "278.215", weight: "344.4", embodiedLand: "", embodiedWater: "", }, { eid: "e5941", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "8", targetSimName: "ALB", targetName: "Albania", targetRegion: "Europe", resource: "Oats", year: "2015", value: "11.037", weight: "21.99", embodiedLand: "11.308", embodiedWater: "", }, { eid: "e5942", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "952.419598", weight: "1777.69802", embodiedLand: "536.005575", embodiedWater: "154.659357", }, { eid: "e5943", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Wheat", year: "2015", value: "0.142", weight: "0.029", embodiedLand: "", embodiedWater: "", }, { eid: "e5944", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "17.5941818", weight: "11.2", embodiedLand: "", embodiedWater: "", }, { eid: "e5945", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1740.776", weight: "4444.87", embodiedLand: "1391.87", embodiedWater: "902.309", }, { eid: "e5946", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "34.047", weight: "75", embodiedLand: "25.521", embodiedWater: "8.325", }, { eid: "e5947", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "15.553", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e5948", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Maize", year: "2015", value: "10.706", weight: "21.725", embodiedLand: "", embodiedWater: "", }, { eid: "e5949", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "2682.98701", weight: "9850", embodiedLand: "", embodiedWater: "", }, { eid: "e5950", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2016", value: "0.692", weight: "0.112", embodiedLand: "", embodiedWater: "", }, { eid: "e5951", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "52.1904308", weight: "28.8378857", embodiedLand: "", embodiedWater: "", }, { eid: "e5952", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Rye", year: "2016", value: "150.48433", weight: "617.293342", embodiedLand: "", embodiedWater: "", }, { eid: "e5954", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "496", targetSimName: "MNG", targetName: "Mongolia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.229", weight: "0.108", embodiedLand: "", embodiedWater: "", }, { eid: "e5955", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.185", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e5956", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Wheat", year: "2016", value: "25.8723332", weight: "14.75", embodiedLand: "", embodiedWater: "", }, { eid: "e5957", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "2596.166", weight: "14299.874", embodiedLand: "", embodiedWater: "", }, { eid: "e5958", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "624", targetSimName: "GNB", targetName: "Guinea-Bissau", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6.352", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e5959", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7705.296", weight: "32986.13", embodiedLand: "", embodiedWater: "", }, { eid: "e5960", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "18663.554", weight: "101536.876", embodiedLand: "", embodiedWater: "", }, { eid: "e5961", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "740", targetSimName: "SUR", targetName: "Suriname", targetRegion: "South America", resource: "Wheat", year: "2016", value: "31.423", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e5962", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.777", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e5963", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "40.583", weight: "41", embodiedLand: "", embodiedWater: "", }, { eid: "e5964", source: "440", sourceSimName: "LTU", sourceRegion: "Lithuania", sourceName: "Europe", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "9794.196", weight: "53649.806", embodiedLand: "", embodiedWater: "", }, { eid: "e5997", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e5998", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.021", weight: "0.014", embodiedLand: "", embodiedWater: "", }, { eid: "e5999", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6000", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.32369588", weight: "10", embodiedLand: "2.391", embodiedWater: "1.34", }, { eid: "e6002", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "0.524", weight: "0.9", embodiedLand: "0.216", embodiedWater: "", }, { eid: "e6003", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "1472.921", weight: "4490.059", embodiedLand: "819.513", embodiedWater: "1333.547", }, { eid: "e6005", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6006", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.039", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6008", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "414", targetSimName: "KWT", targetName: "Kuwait", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6009", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.556", weight: "0.108", embodiedLand: "", embodiedWater: "", }, { eid: "e6010", source: "442", sourceSimName: "LUX", sourceRegion: "Luxembourg", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "0.553", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6029", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.524", weight: "0.24", embodiedLand: "", embodiedWater: "", }, { eid: "e6030", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e6031", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "86.4864968", weight: "333.932001", embodiedLand: "", embodiedWater: "", }, { eid: "e6032", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "4.432", weight: "0.75", embodiedLand: "", embodiedWater: "", }, { eid: "e6033", source: "450", sourceSimName: "MDG", sourceRegion: "Madagascar", sourceName: "Sub-Saharan Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Oats", year: "2016", value: "0.005", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e6054", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.078", weight: "0.03", embodiedLand: "", embodiedWater: "0.068", }, { eid: "e6055", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.012", weight: "0.01", embodiedLand: "", embodiedWater: "0.044", }, { eid: "e6056", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.087", weight: "0.174", embodiedLand: "0.002", embodiedWater: "0.054", }, { eid: "e6057", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.031", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e6058", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rye", year: "2015", value: "0.051", weight: "0.035", embodiedLand: "", embodiedWater: "", }, { eid: "e6059", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2016", value: "2.192", weight: "0.072", embodiedLand: "", embodiedWater: "", }, { eid: "e6060", source: "454", sourceSimName: "MWI", sourceRegion: "Malawi", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6167", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.033", weight: "0.026", embodiedLand: "0.009", embodiedWater: "0.394", }, { eid: "e6168", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "12.24", weight: "22.5", embodiedLand: "1.165", embodiedWater: "57.42", }, { eid: "e6169", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.547", weight: "0.074", embodiedLand: "", embodiedWater: "", }, { eid: "e6170", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "60.178", weight: "39.34", embodiedLand: "0.219", embodiedWater: "24.902", }, { eid: "e6171", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "250.088", weight: "313.5", embodiedLand: "205.235", embodiedWater: "1026.712", }, { eid: "e6172", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "27.338", weight: "16.94", embodiedLand: "0.121", embodiedWater: "0.813", }, { eid: "e6174", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "226", targetSimName: "GNQ", targetName: "Equatorial Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "38.385", weight: "44.028", embodiedLand: "", embodiedWater: "", }, { eid: "e6175", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.444", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e6176", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "39.86", weight: "18.976", embodiedLand: "", embodiedWater: "", }, { eid: "e6177", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "69.327", weight: "39.34", embodiedLand: "", embodiedWater: "", }, { eid: "e6178", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Oats", year: "2016", value: "9.794", weight: "4.694", embodiedLand: "", embodiedWater: "", }, { eid: "e6179", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.55", weight: "1.246", embodiedLand: "", embodiedWater: "", }, { eid: "e6180", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "143.017", weight: "99.252", embodiedLand: "", embodiedWater: "", }, { eid: "e6181", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6182", source: "458", sourceSimName: "MYS", sourceRegion: "Malaysia", sourceName: "Southeast Asia", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6185", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6186", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6187", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Rice", year: "2016", value: "134.792", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e6188", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "55.466", weight: "248", embodiedLand: "", embodiedWater: "", }, { eid: "e6189", source: "462", sourceSimName: "MDV", sourceRegion: "Maldives", sourceName: "South Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "500.517", weight: "1376.74", embodiedLand: "", embodiedWater: "", }, { eid: "e6210", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Rice", year: "2015", value: "20.222", weight: "24", embodiedLand: "11.101", embodiedWater: "285.816", }, { eid: "e6211", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.201", weight: "0.021", embodiedLand: "", embodiedWater: "", }, { eid: "e6212", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6213", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "0.127", weight: "0.024", embodiedLand: "", embodiedWater: "", }, { eid: "e6214", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6215", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "4.948", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e6216", source: "466", sourceSimName: "MLI", sourceRegion: "Mali", sourceName: "Sub-Saharan Africa", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "0.006", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6270", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "6113.626", weight: "14771.565", embodiedLand: "", embodiedWater: "", }, { eid: "e6271", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6272", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "14.65", weight: "9.6", embodiedLand: "0.224", embodiedWater: "", }, { eid: "e6273", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "97.941", weight: "48", embodiedLand: "5.948", embodiedWater: "", }, { eid: "e6274", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "5.261", weight: "3.36", embodiedLand: "", embodiedWater: "", }, { eid: "e6275", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "7.207", weight: "23.502", embodiedLand: "0.48152987", embodiedWater: "30.8105997", }, { eid: "e6276", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2.151", weight: "5.43", embodiedLand: "", embodiedWater: "", }, { eid: "e6277", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "96", targetSimName: "BRN", targetName: "Brunei Darussalam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "18.135", weight: "25", embodiedLand: "", embodiedWater: "", }, { eid: "e6278", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "24.9972232", weight: "43.4084916", embodiedLand: "", embodiedWater: "", }, { eid: "e6280", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "6.101", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e6281", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "0.00156596", weight: "0.00208085", embodiedLand: "", embodiedWater: "", }, { eid: "e6282", source: "470", sourceSimName: "MLT", sourceRegion: "Malta", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.973", weight: "1.347", embodiedLand: "", embodiedWater: "", }, { eid: "e6293", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.236", weight: "0.2", embodiedLand: "0.017", embodiedWater: "0.139", }, { eid: "e6294", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "16.391", weight: "25", embodiedLand: "7.002", embodiedWater: "204.525", }, { eid: "e6295", source: "478", sourceSimName: "MRT", sourceRegion: "Mauritania", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.018", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e6330", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.043", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6331", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "41.478", weight: "30.58", embodiedLand: "", embodiedWater: "", }, { eid: "e6332", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.007", weight: "0.029", embodiedLand: "", embodiedWater: "", }, { eid: "e6333", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6334", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "353.845136", weight: "1878.10933", embodiedLand: "15.5904614", embodiedWater: "3562.77322", }, { eid: "e6335", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "17.786", weight: "42", embodiedLand: "0.943", embodiedWater: "91.056", }, { eid: "e6336", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6337", source: "480", sourceSimName: "MUS", sourceRegion: "Mauritius", sourceName: "Sub-Saharan Africa", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "2562.825", weight: "4828.532", embodiedLand: "", embodiedWater: "", }, { eid: "e6437", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Maize", year: "2015", value: "4.35799817", weight: "5.965", embodiedLand: "", embodiedWater: "", }, { eid: "e6438", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.96291721", weight: "1.082", embodiedLand: "0.251", embodiedWater: "2.028", }, { eid: "e6439", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.711", weight: "0.063", embodiedLand: "", embodiedWater: "", }, { eid: "e6440", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Oats", year: "2015", value: "1.881", weight: "0.334", embodiedLand: "", embodiedWater: "", }, { eid: "e6441", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "1.067", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e6442", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "161.633092", weight: "131.698943", embodiedLand: "103.093103", embodiedWater: "356.509274", }, { eid: "e6443", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.013", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e6444", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "337.977", weight: "582.999", embodiedLand: "", embodiedWater: "", }, { eid: "e6445", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.711", weight: "1.526", embodiedLand: "0.37", embodiedWater: "84.283", }, { eid: "e6446", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "4579.296", weight: "12984.96", embodiedLand: "3316.527", embodiedWater: "366708.255", }, { eid: "e6447", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "0.017", weight: "0.007", embodiedLand: "", embodiedWater: "", }, { eid: "e6448", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.24", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e6449", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1.862", weight: "1.02", embodiedLand: "", embodiedWater: "", }, { eid: "e6451", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6452", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "6917.997", weight: "32990.35", embodiedLand: "", embodiedWater: "", }, { eid: "e6453", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "3719.013", weight: "13050", embodiedLand: "", embodiedWater: "", }, { eid: "e6454", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.221", weight: "0.544", embodiedLand: "", embodiedWater: "", }, { eid: "e6455", source: "484", sourceSimName: "MEX", sourceRegion: "Mexico", sourceName: "North America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "42.933", weight: "14", embodiedLand: "", embodiedWater: "", }, { eid: "e6469", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "14.193", weight: "24.894", embodiedLand: "1.244", embodiedWater: "132.162", }, { eid: "e6470", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.077", weight: "0.186", embodiedLand: "", embodiedWater: "", }, { eid: "e6471", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2016", value: "88.215", weight: "250", embodiedLand: "", embodiedWater: "", }, { eid: "e6472", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6473", source: "496", sourceSimName: "MNG", sourceRegion: "Mongolia", sourceName: "Central and Northern Asia", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Buckwheat", year: "2016", value: "0.254", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e6532", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "8", targetSimName: "ALB", targetName: "Albania", targetRegion: "Europe", resource: "Oats", year: "2015", value: "8.045", weight: "44", embodiedLand: "3.73", embodiedWater: "", }, { eid: "e6533", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.13", weight: "0.21", embodiedLand: "0.005", embodiedWater: "0.438", }, { eid: "e6534", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "15.064", weight: "43.85", embodiedLand: "", embodiedWater: "", }, { eid: "e6535", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "326.546", weight: "1813.443", embodiedLand: "499.351", embodiedWater: "223.053", }, { eid: "e6536", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "3.85", weight: "25", embodiedLand: "4.393", embodiedWater: "5.775", }, { eid: "e6537", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "3.266", weight: "21", embodiedLand: "0.97", embodiedWater: "69.3", }, { eid: "e6538", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.59555736", weight: "0.96", embodiedLand: "0.038", embodiedWater: "5.211", }, { eid: "e6539", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.06377214", weight: "0.08899229", embodiedLand: "", embodiedWater: "0.05394042", }, { eid: "e6540", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "222.69", weight: "1394.035", embodiedLand: "436.708", embodiedWater: "224.44", }, { eid: "e6541", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Barley", year: "2015", value: "988.605", weight: "5010.909", embodiedLand: "1241.576", embodiedWater: "410.895", }, { eid: "e6542", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.986", weight: "9.5", embodiedLand: "0.479", embodiedWater: "45.277", }, { eid: "e6543", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "1092.675", weight: "6495", embodiedLand: "", embodiedWater: "", }, { eid: "e6544", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "452.602", weight: "2038.64", embodiedLand: "", embodiedWater: "", }, { eid: "e6545", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Oats", year: "2016", value: "6.63923657", weight: "5.90356819", embodiedLand: "", embodiedWater: "", }, { eid: "e6546", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "288.901", weight: "2028.38", embodiedLand: "", embodiedWater: "", }, { eid: "e6547", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3353.129", weight: "19610.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6548", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "948.934454", weight: "4372.09334", embodiedLand: "", embodiedWater: "", }, { eid: "e6549", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.002", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6550", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "79.648", weight: "504.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6551", source: "498", sourceSimName: "MDA", sourceRegion: "Moldova", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1726.318", weight: "9113.49", embodiedLand: "", embodiedWater: "", }, { eid: "e6567", source: "499", sourceSimName: "MNE", sourceRegion: "Montenegro", sourceName: "Europe", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.01797173", weight: "0.839", embodiedLand: "0.003", embodiedWater: "0.103", }, { eid: "e6568", source: "499", sourceSimName: "MNE", sourceRegion: "Montenegro", sourceName: "Europe", target: "804", targetSimName: "UKR", targetName: "Ukraine", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "0.084", weight: "0.085", embodiedLand: "", embodiedWater: "", }, { eid: "e6655", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "1.865", weight: "0.451", embodiedLand: "", embodiedWater: "", }, { eid: "e6656", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "13.841", weight: "13.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6657", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.084", weight: "0.017", embodiedLand: "", embodiedWater: "", }, { eid: "e6658", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "14.0198093", weight: "10.0095949", embodiedLand: "", embodiedWater: "", }, { eid: "e6659", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "0.984", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e6660", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.221", weight: "0.175", embodiedLand: "", embodiedWater: "", }, { eid: "e6661", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "7.444", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e6662", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "40.732751", weight: "37.5", embodiedLand: "", embodiedWater: "", }, { eid: "e6663", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Wheat", year: "2016", value: "0.1", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e6664", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "6.389", weight: "6.25", embodiedLand: "", embodiedWater: "", }, { eid: "e6666", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "1.611", weight: "0.722", embodiedLand: "", embodiedWater: "", }, { eid: "e6667", source: "504", sourceSimName: "MAR", sourceRegion: "Morocco", sourceName: "Middle East and North Africa", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2.014", weight: "3.382", embodiedLand: "", embodiedWater: "", }, { eid: "e6690", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "227.071", weight: "1000.665", embodiedLand: "616.851", embodiedWater: "729.485", }, { eid: "e6691", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "3.486", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e6692", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.194", weight: "0.633", embodiedLand: "0.042", embodiedWater: "4.535", }, { eid: "e6693", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.126", weight: "0.014", embodiedLand: "", embodiedWater: "", }, { eid: "e6694", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.043", weight: "0.295", embodiedLand: "", embodiedWater: "", }, { eid: "e6695", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "4.596", weight: "6", embodiedLand: "", embodiedWater: "", }, { eid: "e6696", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "0.02", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6697", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.115", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e6698", source: "508", sourceSimName: "MOZ", sourceRegion: "Mozambique", sourceName: "Sub-Saharan Africa", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "1.767", weight: "0.573", embodiedLand: "", embodiedWater: "", }, { eid: "e6739", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "30.039", weight: "20", embodiedLand: "0.17", embodiedWater: "2.22", }, { eid: "e6740", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6741", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "187.414", weight: "81.513", embodiedLand: "", embodiedWater: "", }, { eid: "e6742", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "443.222", weight: "441.628", embodiedLand: "167.33", embodiedWater: "7857.887", }, { eid: "e6743", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "0.067", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e6744", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2016", value: "49.186", weight: "24.728", embodiedLand: "", embodiedWater: "", }, { eid: "e6745", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.135", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e6746", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "1413.126", weight: "572.235", embodiedLand: "", embodiedWater: "", }, { eid: "e6747", source: "512", sourceSimName: "OMN", sourceRegion: "Oman", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "2.074", weight: "3", embodiedLand: "", embodiedWater: "", }, { eid: "e6802", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "12", targetSimName: "DZA", targetName: "Algeria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.001", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e6803", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6804", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5.327", weight: "19.153", embodiedLand: "", embodiedWater: "", }, { eid: "e6805", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.004", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e6806", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.702", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e6807", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6808", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.212", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e6809", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.228", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e6810", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "3.019", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e6811", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e6812", source: "516", sourceSimName: "NAM", sourceRegion: "Namibia", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.013", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e6833", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.219", weight: "0.503", embodiedLand: "0.001", embodiedWater: "0.015", }, { eid: "e6834", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "193.924", weight: "375", embodiedLand: "194.083", embodiedWater: "3776.25", }, { eid: "e6835", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "11.017", weight: "19.5", embodiedLand: "8.554", embodiedWater: "382.551", }, { eid: "e6836", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.091", weight: "0.02", embodiedLand: "0.001", embodiedWater: "", }, { eid: "e6837", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "64", targetSimName: "BTN", targetName: "Bhutan", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "77.909", weight: "306", embodiedLand: "", embodiedWater: "", }, { eid: "e6838", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.098", weight: "0.095", embodiedLand: "", embodiedWater: "", }, { eid: "e6839", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.403", weight: "0.365", embodiedLand: "", embodiedWater: "", }, { eid: "e6840", source: "524", sourceSimName: "NPL", sourceRegion: "Nepal", sourceName: "South Asia", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Barley", year: "2016", value: "0.1", weight: "0.023", embodiedLand: "", embodiedWater: "", }, { eid: "e7020", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "20", targetSimName: "AND", targetName: "Andorra", targetRegion: "Europe", resource: "Barley", year: "2015", value: "0.011", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e7021", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.039", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e7022", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "238", targetSimName: "FLK", targetName: "Falkland Isds (Malvinas)", targetRegion: "South America", resource: "Oats", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7023", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "0.003", weight: "0.009", embodiedLand: "", embodiedWater: "", }, { eid: "e7024", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "308", targetSimName: "GRD", targetName: "Grenada", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2015", value: "0.001", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e7025", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Barley", year: "2015", value: "0.002", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7026", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "15.929", weight: "3.746", embodiedLand: "", embodiedWater: "", }, { eid: "e7027", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "674", targetSimName: "SMR", targetName: "San Marino", targetRegion: "Europe", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7028", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "7.672", weight: "15", embodiedLand: "", embodiedWater: "", }, { eid: "e7030", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "7.506", weight: "15", embodiedLand: "", embodiedWater: "", }, { eid: "e7031", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7032", source: "528", sourceSimName: "NLD", sourceRegion: "Netherlands", sourceName: "Europe", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "30.968", weight: "60", embodiedLand: "", embodiedWater: "", }, { eid: "e7047", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7048", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7049", source: "531", sourceSimName: "CUW", sourceRegion: "Curacao", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7059", source: "533", sourceSimName: "ABW", sourceRegion: "Aruba", sourceName: "Caribbean and Central America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e7062", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7063", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7064", source: "534", sourceSimName: "SXM", sourceRegion: "Sint Maarten (Dutch part)", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7072", source: "540", sourceSimName: "NCL", sourceRegion: "New Caledonia", sourceName: "Oceania", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.055", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e7073", source: "540", sourceSimName: "NCL", sourceRegion: "New Caledonia", sourceName: "Oceania", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7163", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "7.521", weight: "0.435", embodiedLand: "", embodiedWater: "", }, { eid: "e7164", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.288", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e7165", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.328", weight: "0.094", embodiedLand: "", embodiedWater: "", }, { eid: "e7166", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "26.252", weight: "1.208", embodiedLand: "", embodiedWater: "", }, { eid: "e7167", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7168", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7169", source: "554", sourceSimName: "NZL", sourceRegion: "New Zealand", sourceName: "Oceania", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "20.355", weight: "23.559", embodiedLand: "", embodiedWater: "", }, { eid: "e7188", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.001", weight: "0.006", embodiedLand: "", embodiedWater: "0.004", }, { eid: "e7189", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "21.386", weight: "136.7", embodiedLand: "", embodiedWater: "", }, { eid: "e7190", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "0.379", weight: "0.08", embodiedLand: "", embodiedWater: "", }, { eid: "e7191", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "1.356", weight: "0.982", embodiedLand: "", embodiedWater: "", }, { eid: "e7192", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "562", targetSimName: "NER", targetName: "Niger", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "48.951", weight: "141", embodiedLand: "", embodiedWater: "", }, { eid: "e7193", source: "558", sourceSimName: "NIC", sourceRegion: "Nicaragua", sourceName: "Caribbean and Central America", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.256", weight: "2.13", embodiedLand: "", embodiedWater: "", }, { eid: "e7221", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7222", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Oats", year: "2015", value: "2.966", weight: "2.817", embodiedLand: "0.349", embodiedWater: "", }, { eid: "e7223", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "20.293", weight: "15.962", embodiedLand: "", embodiedWater: "", }, { eid: "e7224", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "20.609", weight: "35", embodiedLand: "21.084", embodiedWater: "566.545", }, { eid: "e7225", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "14.981", weight: "28.684", embodiedLand: "", embodiedWater: "", }, { eid: "e7226", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rice", year: "2015", value: "249.489", weight: "370", embodiedLand: "118.35", embodiedWater: "54063.29", }, { eid: "e7227", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "48.184", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e7228", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "177.342", weight: "265.715", embodiedLand: "", embodiedWater: "", }, { eid: "e7229", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7230", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "48.184", weight: "72", embodiedLand: "", embodiedWater: "", }, { eid: "e7231", source: "562", sourceSimName: "NER", sourceRegion: "Niger", sourceName: "Sub-Saharan Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2016", value: "29.038", weight: "39.727", embodiedLand: "", embodiedWater: "", }, { eid: "e7305", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.338", weight: "0.073", embodiedLand: "", embodiedWater: "", }, { eid: "e7306", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.014", weight: "0.01", embodiedLand: "0.009", embodiedWater: "", }, { eid: "e7307", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "672", weight: "3264.727", embodiedLand: "", embodiedWater: "", }, { eid: "e7308", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "0.087", weight: "0.07", embodiedLand: "0.002", embodiedWater: "0.106", }, { eid: "e7309", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "0.039", weight: "0.013", embodiedLand: "", embodiedWater: "", }, { eid: "e7310", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "1.882", weight: "0.84", embodiedLand: "0.003", embodiedWater: "", }, { eid: "e7311", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "12.401", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e7312", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7313", source: "566", sourceSimName: "NGA", sourceRegion: "Nigeria", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "11.331", weight: "23.94", embodiedLand: "", embodiedWater: "", }, { eid: "e7358", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "108.657", weight: "200.963", embodiedLand: "", embodiedWater: "", }, { eid: "e7359", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "98.433", weight: "151.2", embodiedLand: "", embodiedWater: "", }, { eid: "e7360", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "1.211", weight: "4.3", embodiedLand: "0.062", embodiedWater: "10.109", }, { eid: "e7361", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2015", value: "6.125", weight: "6.503", embodiedLand: "", embodiedWater: "", }, { eid: "e7362", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "22.616", weight: "41.331", embodiedLand: "", embodiedWater: "", }, { eid: "e7363", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "304", targetSimName: "GRL", targetName: "Greenland", targetRegion: "North America", resource: "Buckwheat", year: "2015", value: "0.125", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e7364", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.165", weight: "0.055", embodiedLand: "", embodiedWater: "", }, { eid: "e7365", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7366", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "643", targetSimName: "RUS", targetName: "Russian Federation", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2015", value: "0.183", weight: "0.152", embodiedLand: "0.002", embodiedWater: "0.036", }, { eid: "e7367", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.024", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e7368", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.222", weight: "0.65", embodiedLand: "", embodiedWater: "", }, { eid: "e7369", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Wheat", year: "2016", value: "143.971", weight: "104.75", embodiedLand: "", embodiedWater: "", }, { eid: "e7370", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.444", weight: "0.939", embodiedLand: "", embodiedWater: "", }, { eid: "e7371", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "2.662", weight: "4.95", embodiedLand: "", embodiedWater: "", }, { eid: "e7372", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "241.798", weight: "172.775", embodiedLand: "", embodiedWater: "", }, { eid: "e7373", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "7.72031118", weight: "13.3129919", embodiedLand: "", embodiedWater: "", }, { eid: "e7374", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.143", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e7375", source: "579", sourceSimName: "NOR", sourceRegion: "Norway", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "4.572", weight: "0.64", embodiedLand: "", embodiedWater: "", }, { eid: "e7379", source: "581", sourceSimName: "UMI", sourceRegion: "United States Minor Outlying Isds", sourceName: "Oceania", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7380", source: "581", sourceSimName: "UMI", sourceRegion: "United States Minor Outlying Isds", sourceName: "Oceania", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7384", source: "584", sourceSimName: "MHL", sourceRegion: "Marshall Isds", sourceName: "Oceania", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "173.38", weight: "514.539", embodiedLand: "", embodiedWater: "", }, { eid: "e7551", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "7.467", weight: "8.962", embodiedLand: "", embodiedWater: "", }, { eid: "e7552", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "1.749", weight: "0.657", embodiedLand: "", embodiedWater: "", }, { eid: "e7553", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "533", targetSimName: "ABW", targetName: "Aruba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "14.707", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e7554", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.019", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e7555", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.665", weight: "0.191", embodiedLand: "0.00237267", embodiedWater: "2.86855901", }, { eid: "e7556", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "45.897", weight: "108", embodiedLand: "94.494", embodiedWater: "993.276", }, { eid: "e7557", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "798", targetSimName: "TUV", targetName: "Tuvalu", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "33.126", weight: "85", embodiedLand: "49.298", embodiedWater: "519.945", }, { eid: "e7558", source: "586", sourceSimName: "PAK", sourceRegion: "Pakistan", sourceName: "South Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "11.969", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e7600", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "0.135", weight: "0.021", embodiedLand: "", embodiedWater: "", }, { eid: "e7601", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Rice", year: "2015", value: "17.396", weight: "5.44", embodiedLand: "", embodiedWater: "", }, { eid: "e7602", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.484", weight: "0.4", embodiedLand: "", embodiedWater: "", }, { eid: "e7603", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "89.077", weight: "262", embodiedLand: "14.9602", embodiedWater: "24.628", }, { eid: "e7604", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "140.541", weight: "1387.5", embodiedLand: "722.268", embodiedWater: "10034.4", }, { eid: "e7605", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "2.5", weight: "5.26", embodiedLand: "", embodiedWater: "", }, { eid: "e7606", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "58.626", weight: "142.99", embodiedLand: "", embodiedWater: "", }, { eid: "e7607", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Maize", year: "2016", value: "0.478", weight: "0.354", embodiedLand: "", embodiedWater: "", }, { eid: "e7608", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.908", weight: "1.673", embodiedLand: "", embodiedWater: "", }, { eid: "e7609", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.489", weight: "0.251", embodiedLand: "", embodiedWater: "", }, { eid: "e7610", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2.519", weight: "4.65", embodiedLand: "", embodiedWater: "", }, { eid: "e7611", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "22", weight: "110", embodiedLand: "", embodiedWater: "", }, { eid: "e7612", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "17.307", weight: "25.04", embodiedLand: "", embodiedWater: "", }, { eid: "e7613", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7614", source: "591", sourceSimName: "PAN", sourceRegion: "Panama", sourceName: "Caribbean and Central America", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Barley", year: "2016", value: "2.04", weight: "3.056", embodiedLand: "", embodiedWater: "", }, { eid: "e7627", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7628", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7629", source: "598", sourceSimName: "PNG", sourceRegion: "Papua New Guinea", sourceName: "Oceania", target: "702", targetSimName: "SGP", targetName: "Singapore", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7701", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.09", weight: "0.056", embodiedLand: "0.022", embodiedWater: "0.002", }, { eid: "e7702", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "21.12", weight: "23.76", embodiedLand: "4.716", embodiedWater: "141.396", }, { eid: "e7703", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "253.201", weight: "2164.51", embodiedLand: "", embodiedWater: "", }, { eid: "e7704", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "176", weight: "2000", embodiedLand: "512.183", embodiedWater: "244", }, { eid: "e7705", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.002", weight: "0.008", embodiedLand: "0.002", embodiedWater: "0.002", }, { eid: "e7706", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Maize", year: "2015", value: "43.718", weight: "321.454", embodiedLand: "99.0839337", embodiedWater: "39.2173983", }, { eid: "e7707", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "3.926", weight: "1.034", embodiedLand: "", embodiedWater: "", }, { eid: "e7708", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "110", weight: "1100", embodiedLand: "264.036", embodiedWater: "247.5", }, { eid: "e7709", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "4903.23583", weight: "30611.0521", embodiedLand: "7784.12365", embodiedWater: "4254.93621", }, { eid: "e7710", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "133.791", weight: "200.04", embodiedLand: "37.571", embodiedWater: "3567.513", }, { eid: "e7711", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "2.368", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e7712", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "6301.54229", weight: "39230.597", embodiedLand: "9966.60233", embodiedWater: "4825.3641", }, { eid: "e7713", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "10163.8981", weight: "51351.1604", embodiedLand: "", embodiedWater: "", }, { eid: "e7714", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "145.554268", weight: "317.548282", embodiedLand: "", embodiedWater: "", }, { eid: "e7715", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "14598.991", weight: "82200.1", embodiedLand: "", embodiedWater: "", }, { eid: "e7716", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.114", weight: "0.114", embodiedLand: "", embodiedWater: "", }, { eid: "e7717", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2016", value: "313.761", weight: "653.634", embodiedLand: "", embodiedWater: "", }, { eid: "e7718", source: "600", sourceSimName: "PRY", sourceRegion: "Paraguay", sourceName: "South America", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2016", value: "38", weight: "100", embodiedLand: "", embodiedWater: "", }, { eid: "e7820", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7821", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2015", value: "1.728", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7822", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "1.665", weight: "0.358", embodiedLand: "", embodiedWater: "", }, { eid: "e7823", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "3.026", weight: "5.379", embodiedLand: "", embodiedWater: "", }, { eid: "e7824", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "440", targetSimName: "LTU", targetName: "Lithuania", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "28.047", weight: "7.81", embodiedLand: "", embodiedWater: "", }, { eid: "e7825", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Millet", year: "2015", value: "0.81", weight: "0.252", embodiedLand: "", embodiedWater: "0.023", }, { eid: "e7826", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.355", weight: "0.03", embodiedLand: "", embodiedWater: "", }, { eid: "e7827", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "5.1145", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7828", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "600", targetSimName: "PRY", targetName: "Paraguay", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "215.438505", weight: "23.9549268", embodiedLand: "", embodiedWater: "", }, { eid: "e7829", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "73.9066099", weight: "25.626565", embodiedLand: "", embodiedWater: "", }, { eid: "e7830", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "3.99", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7831", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.44", weight: "0.6", embodiedLand: "", embodiedWater: "2.623", }, { eid: "e7832", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.51186012", weight: "0.25", embodiedLand: "", embodiedWater: "", }, { eid: "e7833", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "0.093", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e7834", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "42.54", weight: "15.6", embodiedLand: "", embodiedWater: "", }, { eid: "e7835", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "64.745", weight: "19.635", embodiedLand: "", embodiedWater: "", }, { eid: "e7836", source: "604", sourceSimName: "PER", sourceRegion: "Peru", sourceName: "South America", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "1.872", weight: "0.8", embodiedLand: "", embodiedWater: "", }, { eid: "e7912", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.46", weight: "0.249", embodiedLand: "", embodiedWater: "", }, { eid: "e7913", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.823", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e7914", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.379", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e7915", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.149", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e7916", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "1.659", weight: "0.955", embodiedLand: "", embodiedWater: "", }, { eid: "e7917", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.502", weight: "0.139", embodiedLand: "0.045", embodiedWater: "1.387", }, { eid: "e7918", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.1", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e7919", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Oats", year: "2016", value: "48.872", weight: "81", embodiedLand: "", embodiedWater: "", }, { eid: "e7920", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "296", targetSimName: "KIR", targetName: "Kiribati", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7921", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.177", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7922", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e7923", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.076", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e7924", source: "608", sourceSimName: "PHL", sourceRegion: "Philippines", sourceName: "Southeast Asia", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "1.403", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e7927", source: "612", sourceSimName: "PCN", sourceRegion: "Pitcairn", sourceName: "Oceania", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8061", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "0.139", weight: "0.145", embodiedLand: "", embodiedWater: "", }, { eid: "e8064", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.047", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e8065", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "244.824", weight: "507.82", embodiedLand: "154.861", embodiedWater: "22.852", }, { eid: "e8066", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "70.822", weight: "231", embodiedLand: "31.512", embodiedWater: "476.553", }, { eid: "e8067", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "12161.233", weight: "57149.4", embodiedLand: "12254.953", embodiedWater: "180420.656", }, { eid: "e8068", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "540", targetSimName: "NCL", targetName: "New Caledonia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.272", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e8070", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "604", targetSimName: "PER", targetName: "Peru", targetRegion: "South America", resource: "Maize", year: "2015", value: "220.92779", weight: "400.073031", embodiedLand: "", embodiedWater: "", }, { eid: "e8071", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "0.007", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8072", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1248.54", weight: "5500", embodiedLand: "", embodiedWater: "", }, { eid: "e8073", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Barley", year: "2016", value: "302.5090046", weight: "656.733934", embodiedLand: "", embodiedWater: "", }, { eid: "e8074", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1502.111", weight: "7201.4", embodiedLand: "", embodiedWater: "", }, { eid: "e8075", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "691.763", weight: "1537.68", embodiedLand: "", embodiedWater: "", }, { eid: "e8076", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Barley", year: "2016", value: "0.046", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e8077", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "1568.202", weight: "4027.12", embodiedLand: "", embodiedWater: "", }, { eid: "e8078", source: "616", sourceSimName: "POL", sourceRegion: "Poland", sourceName: "Europe", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "80.973", weight: "434.92", embodiedLand: "", embodiedWater: "", }, { eid: "e8162", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Rice", year: "2015", value: "56.829", weight: "75", embodiedLand: "21.703", embodiedWater: "1097.55", }, { eid: "e8163", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Rice", year: "2015", value: "50.3339085", weight: "45.9143482", embodiedLand: "", embodiedWater: "", }, { eid: "e8164", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "191", targetSimName: "HRV", targetName: "Croatia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "58.8618795", weight: "87.6717437", embodiedLand: "29.8536241", embodiedWater: "1680.66691", }, { eid: "e8165", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.028", weight: "0.02", embodiedLand: "", embodiedWater: "0.032", }, { eid: "e8166", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "0.68987608", weight: "0.56109969", embodiedLand: "0.0422374", embodiedWater: "", }, { eid: "e8167", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "18.006", weight: "28", embodiedLand: "22.605", embodiedWater: "", }, { eid: "e8168", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Rice", year: "2015", value: "36.111", weight: "50", embodiedLand: "13.661", embodiedWater: "723.6", }, { eid: "e8169", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "535", targetSimName: "BES", targetName: "Bonaire", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.166", weight: "0.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8170", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8172", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8173", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "267.644962", weight: "510", embodiedLand: "", embodiedWater: "", }, { eid: "e8174", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "456.64271", weight: "587.244797", embodiedLand: "", embodiedWater: "", }, { eid: "e8175", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "292", targetSimName: "GIB", targetName: "Gibraltar", targetRegion: "Europe", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8176", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2016", value: "1.756", weight: "1.765", embodiedLand: "", embodiedWater: "", }, { eid: "e8177", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "428", targetSimName: "LVA", targetName: "Latvia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "1.143", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e8178", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "478", targetSimName: "MRT", targetName: "Mauritania", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.004", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e8179", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.046", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e8180", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "531", targetSimName: "CUW", targetName: "Curacao", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "8.027", weight: "34.041", embodiedLand: "", embodiedWater: "", }, { eid: "e8182", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "0.009", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e8183", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.011", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8184", source: "620", sourceSimName: "PRT", sourceRegion: "Portugal", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Rice", year: "2016", value: "0.272", weight: "0.204", embodiedLand: "", embodiedWater: "", }, { eid: "e8216", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "1.97", weight: "32", embodiedLand: "", embodiedWater: "", }, { eid: "e8217", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "276", targetSimName: "DEU", targetName: "Germany", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.082", weight: "0.016", embodiedLand: "", embodiedWater: "", }, { eid: "e8219", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "60.79", weight: "74.981", embodiedLand: "2.912", embodiedWater: "1094.423", }, { eid: "e8220", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Oats", year: "2015", value: "83.636", weight: "34.8", embodiedLand: "", embodiedWater: "", }, { eid: "e8221", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.007", weight: "0.001", embodiedLand: "0.00009091", embodiedWater: "0.00372727", }, { eid: "e8222", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "18.134", weight: "45.408", embodiedLand: "0.035", embodiedWater: "79.873", }, { eid: "e8223", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.824", weight: "10", embodiedLand: "3.735", embodiedWater: "104.17", }, { eid: "e8224", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.059", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e8225", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8226", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.458", weight: "0.054", embodiedLand: "", embodiedWater: "", }, { eid: "e8227", source: "634", sourceSimName: "QAT", sourceRegion: "Qatar", sourceName: "Middle East and North Africa", target: "710", targetSimName: "ZAF", targetName: "South Africa", targetRegion: "Sub-Saharan Africa", resource: "Rye", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8324", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2595", weight: "15000", embodiedLand: "3360.071", embodiedWater: "28275", }, { eid: "e8325", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "0.03", weight: "0.024", embodiedLand: "0.004", embodiedWater: "0.017", }, { eid: "e8326", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "11237.2354", weight: "56273.1014", embodiedLand: "17817.2079", embodiedWater: "134548.986", }, { eid: "e8327", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "232", targetSimName: "ERI", targetName: "Eritrea", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1985", weight: "10000", embodiedLand: "", embodiedWater: "", }, { eid: "e8329", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "4093.718", weight: "15865.57", embodiedLand: "", embodiedWater: "", }, { eid: "e8330", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "214.3", weight: "960", embodiedLand: "", embodiedWater: "", }, { eid: "e8331", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1094.973", weight: "7050.24", embodiedLand: "", embodiedWater: "", }, { eid: "e8332", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "228.149", weight: "1193.19", embodiedLand: "", embodiedWater: "", }, { eid: "e8333", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "3847.356", weight: "21928.554", embodiedLand: "", embodiedWater: "", }, { eid: "e8334", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "716", targetSimName: "ZWE", targetName: "Zimbabwe", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "1553.1", weight: "10000", embodiedLand: "", embodiedWater: "", }, { eid: "e8335", source: "642", sourceSimName: "ROU", sourceRegion: "Romania", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "142.45", weight: "230", embodiedLand: "", embodiedWater: "", }, { eid: "e8468", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "7.432", weight: "10.771", embodiedLand: "", embodiedWater: "", }, { eid: "e8469", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1384.377", weight: "3256", embodiedLand: "1499.247", embodiedWater: "5655.672", }, { eid: "e8470", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "301.524", weight: "261.39", embodiedLand: "", embodiedWater: "", }, { eid: "e8471", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8472", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "13.5", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8473", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.156", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e8474", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.204", weight: "0.47", embodiedLand: "", embodiedWater: "", }, { eid: "e8475", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "1585.217", weight: "11000", embodiedLand: "", embodiedWater: "", }, { eid: "e8476", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2015", value: "202.572054", weight: "1050", embodiedLand: "269.74", embodiedWater: "5738.25", }, { eid: "e8478", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1198.008", weight: "7131", embodiedLand: "2927.035", embodiedWater: "11794.674", }, { eid: "e8480", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1798.27193", weight: "8589.5235", embodiedLand: "", embodiedWater: "", }, { eid: "e8481", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1929.019", weight: "9904", embodiedLand: "", embodiedWater: "", }, { eid: "e8482", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "11.153", weight: "45.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8483", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "25.0980149", weight: "103.92", embodiedLand: "", embodiedWater: "", }, { eid: "e8484", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1427.83359", weight: "6406.65847", embodiedLand: "", embodiedWater: "", }, { eid: "e8485", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Oats", year: "2016", value: "0.039", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e8486", source: "643", sourceSimName: "RUS", sourceRegion: "Russian Federation", sourceName: "Central and Northern Asia", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "257.303", weight: "957", embodiedLand: "", embodiedWater: "", }, { eid: "e8506", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.172", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e8507", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "818", targetSimName: "EGY", targetName: "Egypt", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8508", source: "646", sourceSimName: "RWA", sourceRegion: "Rwanda", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.177", weight: "0.178", embodiedLand: "", embodiedWater: "", }, { eid: "e8524", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "670", targetSimName: "VCT", targetName: "Saint Vincent and the Grenadines", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8526", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "332", targetSimName: "HTI", targetName: "Haiti", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8527", source: "659", sourceSimName: "KNA", sourceRegion: "Saint Kitts and Nevis", sourceName: "Caribbean and Central America", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "12.999", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8531", source: "660", sourceSimName: "AIA", sourceRegion: "Anguilla", sourceName: "Caribbean and Central America", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8545", source: "662", sourceSimName: "LCA", sourceRegion: "Saint Lucia", sourceName: "Caribbean and Central America", target: "92", targetSimName: "VGB", targetName: "British Virgin Isds", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.005", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e8546", source: "662", sourceSimName: "LCA", sourceRegion: "Saint Lucia", sourceName: "Caribbean and Central America", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.02", weight: "0.011", embodiedLand: "", embodiedWater: "", }, { eid: "e8547", source: "666", sourceSimName: "SPM", sourceRegion: "Saint Pierre and Miquelon", sourceName: "North America", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8565", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8566", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Barley", year: "2016", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e8567", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Barley", year: "2016", value: "0.002", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e8568", source: "670", sourceSimName: "VCT", sourceRegion: "Saint Vincent and the Grenadines", sourceName: "Caribbean and Central America", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8573", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "24", targetSimName: "AGO", targetName: "Angola", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.172", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e8574", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.09", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e8575", source: "678", sourceSimName: "STP", sourceRegion: "Sao Tome and Principe", sourceName: "Sub-Saharan Africa", target: "838", targetSimName: "", targetName: "Free Zones", targetRegion: "Other", resource: "Other cereals", year: "2016", value: "0.26", weight: "1.155", embodiedLand: "", embodiedWater: "", }, { eid: "e8652", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.001", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e8653", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8654", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "5.48", weight: "21.772", embodiedLand: "7.63664924", embodiedWater: "109.904952", }, { eid: "e8655", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "417", targetSimName: "KGZ", targetName: "Kyrgyzstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "1.067", weight: "0.859", embodiedLand: "0.014", embodiedWater: "0.338", }, { eid: "e8656", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "659", targetSimName: "KNA", targetName: "Saint Kitts and Nevis", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "1.97", weight: "0.225", embodiedLand: "", embodiedWater: "", }, { eid: "e8657", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "3.115", weight: "2.5", embodiedLand: "0.292", embodiedWater: "34.81", }, { eid: "e8658", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "703", targetSimName: "SVK", targetName: "Slovakia", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.057", weight: "0.026", embodiedLand: "", embodiedWater: "0.301", }, { eid: "e8659", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "12.838", weight: "16", embodiedLand: "", embodiedWater: "", }, { eid: "e8660", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8661", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "0.252", weight: "0.275", embodiedLand: "", embodiedWater: "", }, { eid: "e8662", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.509", weight: "1.51", embodiedLand: "", embodiedWater: "", }, { eid: "e8663", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.013", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e8664", source: "682", sourceSimName: "SAU", sourceRegion: "Saudi Arabia", sourceName: "Middle East and North Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "7.747", weight: "5.335", embodiedLand: "", embodiedWater: "", }, { eid: "e8718", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "48", targetSimName: "BHR", targetName: "Bahrain", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.062", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e8720", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.711", weight: "0.212", embodiedLand: "", embodiedWater: "", }, { eid: "e8721", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "20", targetSimName: "AND", targetName: "Andorra", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.085", weight: "0.026", embodiedLand: "", embodiedWater: "", }, { eid: "e8722", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "0.302", weight: "1.31", embodiedLand: "", embodiedWater: "", }, { eid: "e8723", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.53", weight: "1.14", embodiedLand: "", embodiedWater: "", }, { eid: "e8724", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.214", weight: "0.07", embodiedLand: "", embodiedWater: "", }, { eid: "e8725", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "666", targetSimName: "SPM", targetName: "Saint Pierre and Miquelon", targetRegion: "North America", resource: "Rice", year: "2016", value: "84", weight: "261.5", embodiedLand: "", embodiedWater: "", }, { eid: "e8726", source: "686", sourceSimName: "SEN", sourceRegion: "Senegal", sourceName: "Sub-Saharan Africa", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.011", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e8794", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "5.967", weight: "21.5", embodiedLand: "6.634", embodiedWater: "5.268", }, { eid: "e8796", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.02", weight: "0.028", embodiedLand: "0.009", embodiedWater: "0.012", }, { eid: "e8797", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8798", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "86.2366732", weight: "177.68999", embodiedLand: "", embodiedWater: "", }, { eid: "e8800", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "129.178771", weight: "288.216749", embodiedLand: "", embodiedWater: "", }, { eid: "e8801", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "13.403", weight: "45.042", embodiedLand: "13.431", embodiedWater: "10.225", }, { eid: "e8802", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "26.6315535", weight: "63", embodiedLand: "", embodiedWater: "", }, { eid: "e8803", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "0.11", weight: "0.3", embodiedLand: "", embodiedWater: "", }, { eid: "e8804", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "277.534", weight: "46.233", embodiedLand: "", embodiedWater: "", }, { eid: "e8805", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.001", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e8806", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.013", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e8807", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "61.871", weight: "225.4", embodiedLand: "", embodiedWater: "", }, { eid: "e8808", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2016", value: "0.51515098", weight: "0.9", embodiedLand: "", embodiedWater: "", }, { eid: "e8809", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2016", value: "0.25833351", weight: "0.76309616", embodiedLand: "", embodiedWater: "", }, { eid: "e8810", source: "688", sourceSimName: "SRB", sourceRegion: "Serbia", sourceName: "Europe", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "1.96", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e8817", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8818", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "18.484", weight: "75", embodiedLand: "0.094", embodiedWater: "95.025", }, { eid: "e8819", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Rice", year: "2015", value: "12.553", weight: "25.427", embodiedLand: "", embodiedWater: "", }, { eid: "e8820", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8821", source: "690", sourceSimName: "SYC", sourceRegion: "Seychelles", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "15.778", weight: "69", embodiedLand: "", embodiedWater: "", }, { eid: "e8835", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "7.786", weight: "2.5", embodiedLand: "1.293", embodiedWater: "0.832", }, { eid: "e8836", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "324", targetSimName: "GIN", targetName: "Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "1.502", weight: "2.93", embodiedLand: "2.545", embodiedWater: "27.483", }, { eid: "e8837", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8838", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e8839", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "0.401", weight: "0.519", embodiedLand: "", embodiedWater: "", }, { eid: "e8840", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "12.13", weight: "10.403", embodiedLand: "", embodiedWater: "", }, { eid: "e8841", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "422", targetSimName: "LBN", targetName: "Lebanon", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "0.072", weight: "0.36", embodiedLand: "", embodiedWater: "", }, { eid: "e8842", source: "694", sourceSimName: "SLE", sourceRegion: "Sierra Leone", sourceName: "Sub-Saharan Africa", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9039", source: "699", sourceSimName: "IND", sourceRegion: "India", sourceName: "South Asia", target: "581", targetSimName: "UMI", targetName: "United States Minor Outlying Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "10.376", weight: "18", embodiedLand: "", embodiedWater: "", }, { eid: "e9154", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "68", targetSimName: "BOL", targetName: "Bolivia", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.016", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9155", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "520", targetSimName: "NRU", targetName: "Nauru", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.204", weight: "0.12", embodiedLand: "0.037", embodiedWater: "", }, { eid: "e9156", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "39.237", weight: "63.34", embodiedLand: "", embodiedWater: "", }, { eid: "e9157", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "40.244", weight: "48", embodiedLand: "", embodiedWater: "", }, { eid: "e9159", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "316", targetSimName: "GUM", targetName: "Guam", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9160", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "0.15", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e9161", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "63.252", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9162", source: "702", sourceSimName: "SGP", sourceRegion: "Singapore", sourceName: "Southeast Asia", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.757", weight: "0.209", embodiedLand: "", embodiedWater: "", }, { eid: "e9224", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "1.768", weight: "1.585", embodiedLand: "", embodiedWater: "", }, { eid: "e9225", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2015", value: "0.004", weight: "0.002", embodiedLand: "0.011", embodiedWater: "0.01", }, { eid: "e9226", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "90.739", weight: "210.86", embodiedLand: "23.926", embodiedWater: "208.33", }, { eid: "e9227", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.27", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e9228", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "7", weight: "10", embodiedLand: "", embodiedWater: "", }, { eid: "e9230", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "1729.926", weight: "4000", embodiedLand: "976.835", embodiedWater: "240", }, { eid: "e9231", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "146.145", weight: "460", embodiedLand: "229.046", embodiedWater: "1751.22", }, { eid: "e9232", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "31.674", weight: "42", embodiedLand: "27.568", embodiedWater: "21.294", }, { eid: "e9233", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "344.235", weight: "1266.178", embodiedLand: "306.755", embodiedWater: "4740.57", }, { eid: "e9234", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "20.173", weight: "1.791", embodiedLand: "", embodiedWater: "", }, { eid: "e9235", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "2.155", weight: "1.878", embodiedLand: "", embodiedWater: "", }, { eid: "e9236", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "504", targetSimName: "MAR", targetName: "Morocco", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "20.454", weight: "3.653", embodiedLand: "", embodiedWater: "", }, { eid: "e9237", source: "703", sourceSimName: "SVK", sourceRegion: "Slovakia", sourceName: "Europe", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.332", weight: "0.229", embodiedLand: "", embodiedWater: "", }, { eid: "e9397", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "38.297", weight: "117.657", embodiedLand: "12.759", embodiedWater: "163.896", }, { eid: "e9398", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2015", value: "2.78", weight: "3.285", embodiedLand: "", embodiedWater: "", }, { eid: "e9399", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "100", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e9400", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "580", targetSimName: "MNP", targetName: "N. Mariana Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "28212.429", weight: "50643.596", embodiedLand: "", embodiedWater: "", }, { eid: "e9401", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "19.732", weight: "25.035", embodiedLand: "", embodiedWater: "", }, { eid: "e9402", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "21.917", weight: "30.866", embodiedLand: "", embodiedWater: "", }, { eid: "e9403", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "767.08", weight: "1370", embodiedLand: "", embodiedWater: "", }, { eid: "e9404", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.161", weight: "0.073", embodiedLand: "", embodiedWater: "", }, { eid: "e9405", source: "704", sourceSimName: "VNM", sourceRegion: "Vietnam", sourceName: "Southeast Asia", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.189", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e9460", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "31", targetSimName: "AZE", targetName: "Azerbaijan", targetRegion: "Central and Northern Asia", resource: "Oats", year: "2015", value: "2.115", weight: "1.485", embodiedLand: "0.001", embodiedWater: "", }, { eid: "e9461", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "76.922", weight: "78", embodiedLand: "", embodiedWater: "", }, { eid: "e9462", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Maize", year: "2015", value: "0.087", weight: "0.043", embodiedLand: "0.003", embodiedWater: "", }, { eid: "e9463", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Maize", year: "2015", value: "285.64339", weight: "1519.634", embodiedLand: "231.021", embodiedWater: "", }, { eid: "e9464", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "204", targetSimName: "BEN", targetName: "Benin", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "91.632", weight: "210.82", embodiedLand: "23.231", embodiedWater: "116.162", }, { eid: "e9465", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "233", targetSimName: "EST", targetName: "Estonia", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.156", weight: "0.041", embodiedLand: "0.01", embodiedWater: "0.436", }, { eid: "e9467", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "6", weight: "3.75", embodiedLand: "0.251", embodiedWater: "36.904", }, { eid: "e9468", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "52.7905262", weight: "139", embodiedLand: "46.698", embodiedWater: "55.739", }, { eid: "e9469", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7.906", weight: "22", embodiedLand: "6.456", embodiedWater: "8.844", }, { eid: "e9470", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "2.687", weight: "0.721", embodiedLand: "", embodiedWater: "", }, { eid: "e9471", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Oats", year: "2015", value: "0.021", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9472", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "14.93823874", weight: "7.86021619", embodiedLand: "0.01751575", embodiedWater: "27.1184749", }, { eid: "e9473", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "4.876", weight: "30.093", embodiedLand: "", embodiedWater: "", }, { eid: "e9474", source: "705", sourceSimName: "SVN", sourceRegion: "Slovenia", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "0.091", weight: "0.019", embodiedLand: "", embodiedWater: "", }, { eid: "e9483", source: "706", sourceSimName: "SOM", sourceRegion: "Somalia", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9484", source: "706", sourceSimName: "SOM", sourceRegion: "Somalia", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "19.298", weight: "11.899", embodiedLand: "", embodiedWater: "", }, { eid: "e9630", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9631", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.012", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9632", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "226", targetSimName: "GNQ", targetName: "Equatorial Guinea", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.057", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e9633", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.053", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e9634", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Rice", year: "2015", value: "0.267", weight: "0.24", embodiedLand: "", embodiedWater: "", }, { eid: "e9635", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.184", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e9636", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9637", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "776", targetSimName: "TON", targetName: "Tonga", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "21.01", weight: "35", embodiedLand: "", embodiedWater: "", }, { eid: "e9638", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "28", targetSimName: "ATG", targetName: "Antigua and Barbuda", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "10.271", weight: "32", embodiedLand: "", embodiedWater: "", }, { eid: "e9639", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "7.992", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e9640", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "291.645", weight: "223.789", embodiedLand: "", embodiedWater: "", }, { eid: "e9641", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "406.568", weight: "326.18", embodiedLand: "", embodiedWater: "", }, { eid: "e9642", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9670", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "249.898", weight: "235.45", embodiedLand: "59.656", embodiedWater: "250.99", }, { eid: "e9671", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.003", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e9672", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "49.652", weight: "10", embodiedLand: "15.749", embodiedWater: "1.39", }, { eid: "e9673", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.082", weight: "0.1", embodiedLand: "", embodiedWater: "0.054", }, { eid: "e9674", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "262.679", weight: "424.094", embodiedLand: "", embodiedWater: "", }, { eid: "e9675", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.017", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9676", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.006", weight: "0.015", embodiedLand: "", embodiedWater: "0.002", }, { eid: "e9677", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.583", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e9678", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.8", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e9679", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "0.05", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9680", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "108.245803", weight: "74.0433696", embodiedLand: "", embodiedWater: "", }, { eid: "e9681", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.073", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e9682", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.04989606", weight: "0.08321444", embodiedLand: "", embodiedWater: "", }, { eid: "e9683", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.01", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9847", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "19.162", weight: "49.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9848", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.104", weight: "0.84", embodiedLand: "", embodiedWater: "", }, { eid: "e9849", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "71.418", weight: "180", embodiedLand: "", embodiedWater: "", }, { eid: "e9850", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "31.3543178", weight: "71.6911179", embodiedLand: "", embodiedWater: "", }, { eid: "e9851", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "0.221", weight: "0.275", embodiedLand: "", embodiedWater: "", }, { eid: "e9852", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "296", targetSimName: "KIR", targetName: "Kiribati", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.098", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9853", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.199", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e9856", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9857", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9889", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.333", weight: "0.31", embodiedLand: "0.02", embodiedWater: "11.447", }, { eid: "e9890", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Sorghum", year: "2015", value: "43.181", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9891", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "20.076", weight: "40", embodiedLand: "69.334", embodiedWater: "202.56", }, { eid: "e9892", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.5", weight: "5", embodiedLand: "5.013", embodiedWater: "44.535", }, { eid: "e9893", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.13", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e9894", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9895", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.091", weight: "0.333", embodiedLand: "", embodiedWater: "", }, { eid: "e9896", source: "732", sourceSimName: "ESH", sourceRegion: "Western Sahara", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9934", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "48.174", weight: "340.23", embodiedLand: "96.561", embodiedWater: "", }, { eid: "e9935", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.073", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9936", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.141", weight: "0.09", embodiedLand: "0.034", embodiedWater: "0.65", }, { eid: "e9937", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.181", weight: "0.15", embodiedLand: "0.054", embodiedWater: "1.152", }, { eid: "e9938", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "10.08", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9939", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "59.563", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9940", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "486", weight: "1800", embodiedLand: "", embodiedWater: "", }, { eid: "e9941", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.02", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e9942", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2459.276", weight: "7800", embodiedLand: "", embodiedWater: "", }, { eid: "e9943", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.296", weight: "45.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9944", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "86.553", weight: "168", embodiedLand: "", embodiedWater: "", }, { eid: "e9945", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "126", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9946", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.625", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9947", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "10.8", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9960", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.105", weight: "26", embodiedLand: "14.55", embodiedWater: "11.804", }, { eid: "e9961", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "5.963", weight: "1.128", embodiedLand: "", embodiedWater: "", }, { eid: "e9962", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.042", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e9963", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.022", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e9964", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "136.368", weight: "352.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10072", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "321.247599", weight: "594.892627", embodiedLand: "157.689777", embodiedWater: "218.325999", }, { eid: "e10073", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "2.166", weight: "0.461", embodiedLand: "", embodiedWater: "", }, { eid: "e10074", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "7.097", weight: "6.153", embodiedLand: "", embodiedWater: "", }, { eid: "e10075", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.949", weight: "1", embodiedLand: "1.187", embodiedWater: "5.89", }, { eid: "e10076", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "293.17", weight: "713", embodiedLand: "176.112", embodiedWater: "7.843", }, { eid: "e10077", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "0.593", weight: "0.373", embodiedLand: "", embodiedWater: "", }, { eid: "e10078", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.542", weight: "7.661", embodiedLand: "2.193", embodiedWater: "28.537", }, { eid: "e10079", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Barley", year: "2015", value: "7903.00956", weight: "26948.6797", embodiedLand: "6860.2467", embodiedWater: "1077.94733", }, { eid: "e10080", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2016", value: "0.537", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e10081", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10082", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "2650.321", weight: "12000", embodiedLand: "", embodiedWater: "", }, { eid: "e10083", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10084", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "4.659", weight: "2.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10085", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "525.239248", weight: "1150.87085", embodiedLand: "", embodiedWater: "", }, { eid: "e10086", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "776.713", weight: "2078", embodiedLand: "", embodiedWater: "", }, { eid: "e10198", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10199", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.236", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10200", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10201", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.103", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10202", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "897.592", weight: "1303.4", embodiedLand: "445.321", embodiedWater: "21745.926", }, { eid: "e10203", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "0.006", weight: "0.004", embodiedLand: "0.005", embodiedWater: "", }, { eid: "e10204", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.011", weight: "0.011", embodiedLand: "", embodiedWater: "0.152", }, { eid: "e10205", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4511.886", weight: "18900", embodiedLand: "3534.409", embodiedWater: "62181", }, { eid: "e10206", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10207", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "70.534", weight: "150.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10208", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Other cereals", year: "2016", value: "6.519", weight: "6.42", embodiedLand: "", embodiedWater: "", }, { eid: "e10209", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.173", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10210", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10211", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.005", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10212", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.429", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10213", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "389.737", weight: "477.087", embodiedLand: "", embodiedWater: "", }, { eid: "e10214", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.041", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10215", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.1431594", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10245", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.064", weight: "0.107", embodiedLand: "", embodiedWater: "", }, { eid: "e10246", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.032", weight: "0.21", embodiedLand: "0.001", embodiedWater: "0.014", }, { eid: "e10247", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.084", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e10248", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "8862.493", weight: "24861.286", embodiedLand: "1247.997", embodiedWater: "1864.596", }, { eid: "e10250", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.791", weight: "1.44", embodiedLand: "", embodiedWater: "", }, { eid: "e10251", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10252", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.045", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e10253", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.034", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e10254", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10255", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2016", value: "2.895", weight: "1.225", embodiedLand: "", embodiedWater: "", }, { eid: "e10264", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "89.465", weight: "296.215", embodiedLand: "159.202", embodiedWater: "74.646", }, { eid: "e10265", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.061", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e10461", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "212", targetSimName: "DMA", targetName: "Dominica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "9.736", weight: "25.006", embodiedLand: "10.644", embodiedWater: "105.225", }, { eid: "e10462", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "234", targetSimName: "FRO", targetName: "Faeroe Isds", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.136", weight: "0.315", embodiedLand: "0.178", embodiedWater: "2.462", }, { eid: "e10464", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.015", weight: "0.01", embodiedLand: "0.004", embodiedWater: "0.091", }, { eid: "e10465", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "17.484", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e10495", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Other cereals", year: "2015", value: "3.112", weight: "7", embodiedLand: "", embodiedWater: "", }, { eid: "e10496", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.283", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10497", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "5", weight: "18.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10498", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "2.60547527", weight: "2.45939658", embodiedLand: "", embodiedWater: "", }, { eid: "e10499", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "17.2519049", weight: "115.598246", embodiedLand: "99.7718139", embodiedWater: "58.6084014", }, { eid: "e10500", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.119", weight: "0.026", embodiedLand: "", embodiedWater: "0.00827273", }, { eid: "e10501", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.19", weight: "0.068", embodiedLand: "", embodiedWater: "", }, { eid: "e10502", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.981", weight: "1.027", embodiedLand: "", embodiedWater: "", }, { eid: "e10509", source: "772", sourceSimName: "TKL", sourceRegion: "Tokelau", sourceName: "Oceania", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10517", source: "776", sourceSimName: "TON", sourceRegion: "Tonga", sourceName: "Oceania", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.113", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10554", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10555", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10556", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10557", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10558", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10559", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10560", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.184", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10561", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10562", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10563", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10564", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10565", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10566", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "0.075", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10703", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "148", targetSimName: "TCD", targetName: "Chad", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10704", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10705", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10706", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10707", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "6.831", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e10708", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.074", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e10709", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.154", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e10778", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "7.737", weight: "1.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10779", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.415", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e10780", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10781", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "8.223", weight: "9.6", embodiedLand: "", embodiedWater: "", }, { eid: "e10782", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "4.469", weight: "2.876", embodiedLand: "", embodiedWater: "", }, { eid: "e10783", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "10.389", weight: "16.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10784", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "30.163", weight: "19.327", embodiedLand: "4.211", embodiedWater: "62.813", }, { eid: "e10785", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "17.492", weight: "4", embodiedLand: "", embodiedWater: "", }, { eid: "e10786", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "6.28513636", weight: "4.23263329", embodiedLand: "", embodiedWater: "", }, { eid: "e10787", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.026", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10788", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "1.276", weight: "0.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10789", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "46.053", weight: "107.5", embodiedLand: "2.563", embodiedWater: "48.805", }, { eid: "e10790", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "13.516", weight: "20.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10791", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.274", weight: "0.13", embodiedLand: "", embodiedWater: "", }, { eid: "e10792", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "401.922618", weight: "985.504812", embodiedLand: "", embodiedWater: "", }, { eid: "e10793", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.042", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10794", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "33.233", weight: "41.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10795", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "388.489", weight: "300", embodiedLand: "", embodiedWater: "", }, { eid: "e10976", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "16", targetSimName: "ASM", targetName: "American Samoa", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10977", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "14.0119386", weight: "26.25", embodiedLand: "", embodiedWater: "", }, { eid: "e10978", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "55.708", weight: "233.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10979", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "1.198", weight: "0.714", embodiedLand: "", embodiedWater: "", }, { eid: "e10990", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "372.658", weight: "1562.052", embodiedLand: "", embodiedWater: "", }, { eid: "e10991", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "2.407", weight: "2.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11003", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Barley", year: "2015", value: "8.403", weight: "24.42", embodiedLand: "", embodiedWater: "", }, { eid: "e11004", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "8.714", weight: "21.576", embodiedLand: "", embodiedWater: "", }, { eid: "e11049", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11050", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1.754", weight: "16", embodiedLand: "4.518", embodiedWater: "69.808", }, { eid: "e11051", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "8.335", weight: "22.5", embodiedLand: "10.227", embodiedWater: "9.923", }, { eid: "e11052", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "61.018", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e11053", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.263", weight: "0.139", embodiedLand: "", embodiedWater: "", }, { eid: "e11054", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.216", weight: "0.086", embodiedLand: "", embodiedWater: "", }, { eid: "e11209", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "24.476", weight: "20.587", embodiedLand: "11.055", embodiedWater: "57.644", }, { eid: "e11210", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "184", targetSimName: "COK", targetName: "Cook Isds", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.043", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e11211", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2451.982731", weight: "16689", embodiedLand: "2800.015", embodiedWater: "84513.096", }, { eid: "e11212", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "0.03", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e11213", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4890.88387", weight: "20013.8008", embodiedLand: "5001.53453", embodiedWater: "32702.5506", }, { eid: "e11214", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7378.521", weight: "27210.945", embodiedLand: "", embodiedWater: "", }, { eid: "e11215", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.185", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e11216", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1486.932", weight: "4224", embodiedLand: "", embodiedWater: "", }, { eid: "e11217", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "6.555", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e11218", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.25906197", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e11219", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "1683.6727", weight: "6988.48925", embodiedLand: "", embodiedWater: "", }, { eid: "e11220", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11221", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Buckwheat", year: "2016", value: "0.01", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11222", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "40.801", weight: "190.825", embodiedLand: "", embodiedWater: "", }, { eid: "e11223", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "1725.40859", weight: "3353.20792", embodiedLand: "", embodiedWater: "", }, { eid: "e11224", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "29.675", weight: "111.862", embodiedLand: "", embodiedWater: "", }, { eid: "e11225", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11336", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11337", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.099", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e11338", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Rice", year: "2015", value: "20.243", weight: "46.01", embodiedLand: "10.002", embodiedWater: "579.542", }, { eid: "e11339", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "97.433", weight: "247.995", embodiedLand: "119.179", embodiedWater: "1537.817", }, { eid: "e11340", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "41.094", weight: "88.32", embodiedLand: "", embodiedWater: "", }, { eid: "e11341", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.466", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e11342", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "2.135", weight: "4.095", embodiedLand: "", embodiedWater: "", }, { eid: "e11343", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.369", weight: "0.63", embodiedLand: "", embodiedWater: "", }, { eid: "e11344", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "140.284", weight: "337.113", embodiedLand: "", embodiedWater: "", }, { eid: "e11345", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "3.159", weight: "0.854", embodiedLand: "", embodiedWater: "", }, { eid: "e11346", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "114.727", weight: "85.648", embodiedLand: "", embodiedWater: "", }, { eid: "e11347", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "23.162", weight: "30.81", embodiedLand: "", embodiedWater: "", }, { eid: "e11348", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "2.07", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e11522", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "125.184", weight: "45.6", embodiedLand: "9.628", embodiedWater: "", }, { eid: "e11523", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11524", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11525", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "2.981", weight: "0.98", embodiedLand: "", embodiedWater: "", }, { eid: "e11526", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "3.556", weight: "3.554", embodiedLand: "0.914", embodiedWater: "", }, { eid: "e11527", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "3.147", weight: "0.138", embodiedLand: "", embodiedWater: "", }, { eid: "e11528", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.13", weight: "0.241", embodiedLand: "", embodiedWater: "", }, { eid: "e11529", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "0.015", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e11580", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "2.405", weight: "23.6", embodiedLand: "54.414", embodiedWater: "", }, { eid: "e11581", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Maize", year: "2015", value: "113.617", weight: "655.96", embodiedLand: "650.261", embodiedWater: "1034.449", }, { eid: "e11582", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "4.097", weight: "40", embodiedLand: "27.575", embodiedWater: "", }, { eid: "e11583", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.054", weight: "0.05", embodiedLand: "0.004", embodiedWater: "0.463", }, { eid: "e11584", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "19.152", weight: "40.012", embodiedLand: "", embodiedWater: "", }, { eid: "e11585", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11586", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "2.563", weight: "14.38", embodiedLand: "9.575", embodiedWater: "9.707", }, { eid: "e11587", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.496", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e11588", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "44.863", weight: "500", embodiedLand: "", embodiedWater: "", }, { eid: "e11589", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Barley", year: "2016", value: "4.13198458", weight: "5.40716181", embodiedLand: "", embodiedWater: "", }, { eid: "e11591", source: "837", sourceSimName: "", sourceRegion: "Bunkers", sourceName: "Other", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11597", source: "838", sourceSimName: "", sourceRegion: "Free Zones", sourceName: "Other", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2016", value: "6.009", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e11798", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "6.137", weight: "1.878", embodiedLand: "0.36", embodiedWater: "", }, { eid: "e11799", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "9.639", weight: "19.875", embodiedLand: "11.311", embodiedWater: "1.848", }, { eid: "e11800", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "14.64", weight: "20.752", embodiedLand: "2.723", embodiedWater: "10.999", }, { eid: "e11801", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "72.797", weight: "82.805", embodiedLand: "8.475", embodiedWater: "106.818", }, { eid: "e11802", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "752.606", weight: "2216.03", embodiedLand: "", embodiedWater: "", }, { eid: "e11824", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "19.785", weight: "69", embodiedLand: "0.615", embodiedWater: "8.901", }, { eid: "e11825", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "43.6395248", weight: "25.096", embodiedLand: "", embodiedWater: "", }, { eid: "e11826", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "429.663", weight: "250", embodiedLand: "111.522", embodiedWater: "2267.75", }, { eid: "e11827", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.004", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e11828", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "109.987", weight: "30", embodiedLand: "16.331", embodiedWater: "27.69", }, { eid: "e11829", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "3.487", weight: "2.5", embodiedLand: "1.554", embodiedWater: "30.817", }, { eid: "e11830", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.02", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e11951", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "18298.88", weight: "67086.608", embodiedLand: "", embodiedWater: "", }, { eid: "e11952", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "12.537", weight: "27.011", embodiedLand: "11.171", embodiedWater: "16.396", }, { eid: "e11953", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "24935.4179", weight: "104332.188", embodiedLand: "47360.4095", embodiedWater: "68441.9161", }, { eid: "e11954", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "96.16", weight: "524.11", embodiedLand: "", embodiedWater: "", }, { eid: "e11955", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "533", targetSimName: "ABW", targetName: "Aruba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "13.297", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11967", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "24401.666", weight: "75279.56", embodiedLand: "28122.882", embodiedWater: "36209.468", }, { eid: "e11968", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11996", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "174.23", weight: "454.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11997", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.11", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11998", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2015", value: "6.294", weight: "4.58", embodiedLand: "1.249", embodiedWater: "1.53", }, { eid: "e11999", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.025", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e12000", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rice", year: "2015", value: "11.889", weight: "21.609", embodiedLand: "5.737", embodiedWater: "157.097", }, { eid: "e12001", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Rice", year: "2016", value: "1.367", weight: "1.583", embodiedLand: "", embodiedWater: "", }, { eid: "e12002", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.467", weight: "0.75", embodiedLand: "", embodiedWater: "", }, { eid: "e12003", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.117", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e12004", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "22.327", weight: "24.749", embodiedLand: "", embodiedWater: "", }, { eid: "e12012", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.455", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e12013", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.001", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e12043", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Maize", year: "2015", value: "30.578", weight: "66", embodiedLand: "38.092", embodiedWater: "4450.248", }, { eid: "e12044", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e12093", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.102", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e12094", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "82.825", weight: "18.152", embodiedLand: "", embodiedWater: "", }, ], }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-worker/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-worker/index.axml ================================================ {{description}} ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-worker/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import getData from "./data"; import fruchtermanLayout from "@antv/f6/dist/extends/layout/fruchtermanLayout"; /** * fruchterman 使用WebWorker */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, description: "Doing layout... web-worker is enabled in this demo, so the layout will not block the page.", }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", maxIteration: 8000, gravity: 1, workerEnabled: true, }, animate: true, defaultNode: { size: 10, }, defaultEdge: { size: 1, }, }); this.graph.on("afterlayout", () => { this.setData({ description: "Done!", }); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/fruchterman-worker/index.json ================================================ { "defaultTitle": "使用Web-worker", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/interact-radial/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const data2_m = { nodes: [ { id: "2", label: "2", }, { id: "1001", label: "1001", }, { id: "1002", label: "1002", }, { id: "1003", label: "1003", }, { id: "1004", label: "1004", }, { id: "1005", label: "1005", }, { id: "1006", label: "1006", }, { id: "1007", label: "1007", }, { id: "1008", label: "1008", }, { id: "1009", label: "1009", }, { id: "1010", label: "1010", }, { id: "1011", label: "1011", }, { id: "1012", label: "1012", }, { id: "1013", label: "1013", }, { id: "1014", label: "1014", }, { id: "1015", label: "1015", }, { id: "1016", label: "1016", }, { id: "1017", label: "1017", }, { id: "1018", label: "1018", }, { id: "1019", label: "1019", }, { id: "1020", label: "1020", }, { id: "5", label: "5", }, { id: "41", label: "41", }, ], edges: [ { source: "2", target: "1001", }, { source: "2", target: "1002", }, { source: "2", target: "1003", }, { source: "2", target: "1004", }, { source: "2", target: "1005", }, { source: "1001", target: "1006", }, { source: "1001", target: "1007", }, { source: "1001", target: "1008", }, { source: "1001", target: "1009", }, { source: "1001", target: "1010", }, { source: "1002", target: "1006", }, { source: "1002", target: "1007", }, { source: "1002", target: "1008", }, { source: "1002", target: "1009", }, { source: "1002", target: "1010", }, { source: "1003", target: "1006", }, { source: "1003", target: "1007", }, { source: "1003", target: "1008", }, { source: "1003", target: "1009", }, { source: "1003", target: "1010", }, { source: "1010", target: "1011", }, { source: "1010", target: "1012", }, { source: "1010", target: "1013", }, { source: "1010", target: "1014", }, { source: "1010", target: "1015", }, { source: "1010", target: "1016", }, { source: "1010", target: "1017", }, { source: "1008", target: "1014", }, { source: "1008", target: "1015", }, { source: "1008", target: "1016", }, { source: "1008", target: "1017", }, { source: "1017", target: "1018", }, { source: "1017", target: "1019", }, { source: "1016", target: "1020", }, { source: "1016", target: "1020", }, { source: "5", target: "1020", }, { source: "41", target: "1020", }, { source: "5", target: "1009", }, { source: "41", target: "1009", }, ], }; export { data, data2_m }; ================================================ FILE: packages/examples-alipay/pages/general-graph/interact-radial/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/interact-radial/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/interact-radial/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { data, data2_m } from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * 交互扩展节点的辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, mainUnitRadius: 80, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const focusNode = data.nodes[22]; focusNode.style = { stroke: "#00419F", fill: "#729FFC", lineWidth: 2, }; data.nodes[2].style = { stroke: "#00419F", fill: "#729FFC", lineWidth: 2, }; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "radial", maxIteration: 200, focusNode, unitRadius: this.mainUnitRadius, linkDistance: 100, preventOverlap: true, nodeSize: 20, }, animate: true, modes: { default: ["drag-node", "click-select", "click-add-node", "drag-canvas"], }, defaultNode: { size: 20, }, }); this.graph.on("node:tap", (ev) => { const itemModel = ev.item.getModel(); const nodes = this.graph.getNodes(); const edges = this.graph.getEdges(); let newData; if (itemModel.id === "2") newData = data2_m; else return; const newNodeModels = newData.nodes; const newEdgeModels = []; // deduplication the items in newEdgeModels newData.edges.forEach(function (e) { let exist = false; newEdgeModels.forEach(function (ne) { if (ne.source === e.source && ne.target === e.target) exist = true; }); if (!exist) { newEdgeModels.push(e); } }); // for graph.changeData() const allNodeModels = []; const allEdgeModels = []; // add new nodes to graph const nodeMap = new Map(); nodes.forEach((n) => { const nModel = n.getModel(); nodeMap.set(nModel.id, n); }); newNodeModels.forEach((nodeModel) => { if (nodeMap.get(nodeModel.id) === undefined) { // set the initial positions of the new nodes to the focus(clicked) node nodeModel.x = itemModel.x; nodeModel.y = itemModel.y; this.graph.addItem("node", nodeModel); } }); // add new edges to graph const edgeMap = new Map(); edges.forEach(function (e, i) { const eModel = e.getModel(); edgeMap.set(`${eModel.source},${eModel.target}`, i); }); const oldEdgeNum = edges.length; newEdgeModels.forEach(function (em, i) { const exist = edgeMap.get(`${em.source},${em.target}`); if (exist === undefined) { this.graph.addItem("edge", em); edgeMap.set(`${em.source},${em.target}`, oldEdgeNum + i); } }); edges.forEach((e) => { allEdgeModels.push(e.getModel()); }); nodes.forEach((n) => { allNodeModels.push(n.getModel()); }); // the max degree about foces(clicked) node in the newly added data const maxDegree = 4; // the max degree about foces(clicked) node in the original data const oMaxDegree = 3; const unitRadius = 40; // re-place the clicked node far away the exisiting items // along the radius from center node to it const vx = itemModel.x - focusNode.x; const vy = itemModel.y - focusNode.y; const vlength = Math.sqrt(vx * vx + vy * vy); const ideallength = unitRadius * maxDegree + this.mainUnitRadius * oMaxDegree; itemModel.x = (ideallength * vx) / vlength + focusNode.x; itemModel.y = (ideallength * vy) / vlength + focusNode.y; const Radial = F6.layout.radial; const subRadialLayout = new Radial({ center: [itemModel.x, itemModel.y], maxIteration: 200, focusNode: "2", unitRadius, linkDistance: 180, preventOverlap: true, }); subRadialLayout.init({ nodes: newNodeModels, edges: newEdgeModels, }); subRadialLayout.execute(); this.graph.positionsAnimate(); this.graph.data({ nodes: allNodeModels, edges: allEdgeModels, }); }); this.graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/interact-radial/index.json ================================================ { "defaultTitle": "交互扩展节点的辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-timing/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-timing/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-timing/index.axml ================================================ {{message}} ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-timing/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * layoutTiming */ let currentPage = null; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, message: "", }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); // 获取文本框 this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); currentPage = this; }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, layout: { type: "force", preventOverlap: true, nodeSize: 20, }, modes: { default: ["drag-node"], }, }); // 监听 this.graph.on("beforelayout", function () { currentPage.setData({ message: "Doing force-directed layout... the text will be changed after the layout being done.", }); }); this.graph.on("afterlayout", function () { currentPage.setData({ message: "Done!", }); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-timing/index.json ================================================ { "defaultTitle": "布局时机监听", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-translate/data.js ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-translate/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; import grid from "@antv/f6/dist/extends/layout/gridLayout"; import force from "@antv/f6/dist/extends/layout/forceLayout"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; import concentric from "@antv/f6/dist/extends/layout/concentricLayout"; import mds from "@antv/f6/dist/extends/layout/mdsLayout"; /** * layoutTranslate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); F6.registerLayout("grid", grid); F6.registerLayout("force", force); F6.registerLayout("radial", radial); F6.registerLayout("concentric", concentric); F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "circular", // TODO:random }, modes: { default: ["drag-node"], }, animate: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setTimeout(() => { this.graph.updateLayout({ type: "circular", radius: 200, }); }, 3000); setTimeout(() => { this.graph.updateLayout({ type: "grid", }); }, 6000); setTimeout(() => { this.graph.updateLayout({ type: "force", preventOverlap: true, nodeSize: 20, }); }, 9000); setTimeout(() => { this.graph.updateLayout({ type: "radial", preventOverlap: true, nodeSize: 15, }); }, 12000); setTimeout(() => { this.graph.updateLayout({ type: "concentric", minNodeSpacing: 30, }); }, 15000); setTimeout(() => { this.graph.updateLayout({ type: "mds", linkDistance: 100, }); }, 18000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/layout-translate/index.json ================================================ { "defaultTitle": "布局切换", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-radial/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const { nodes } = data; nodes.forEach((node) => { node.size = Math.random() * 20 + 10; }); export default data; ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-radial/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-radial/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-radial/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * 防止节点重叠的严格辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, preventOverlap: true, maxPreventOverlapIteration: 100, }, animate: true, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-radial/index.json ================================================ { "defaultTitle": "防止节点重叠的严格辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-unstrict-radial/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-unstrict-radial/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-unstrict-radial/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-unstrict-radial/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * 防止节点重叠的非严格辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 70, preventOverlap: true, strictRadial: false, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/prevent-overlap-unstrict-radial/index.json ================================================ { "defaultTitle": "防止节点重叠的非严格辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/radial-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/radial-configuration-translate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/radial-configuration-translate/index.axml ================================================ {{description}} ================================================ FILE: packages/examples-alipay/pages/general-graph/radial-configuration-translate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * Radial布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: false", }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); setInterval(function () { layoutConfigTranslation(); }, 7000); function layoutConfigTranslation() { setTimeout(function () { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: true", }); me.graph.updateLayout({ preventOverlap: true, nodeSize: 20, }); }, 1000); setTimeout(function () { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ unitRadius: 80, }); }, 2500); setTimeout(function () { me.setData({ description: "Radial layout, focusNode = = 10, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ focusNode: "10", }); }, 4000); setTimeout(function () { me.setData({ description: "Radial layout, focusNode = = 20, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ focusNode: "20", }); }, 5500); setTimeout(function () { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: false", }); me.graph.updateLayout({ focusNode: "0", preventOverlap: false, unitRadius: 50, }); }, 5500); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/radial-configuration-translate/index.json ================================================ { "defaultTitle": "布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/sort-radial/data.js ================================================ const data = { nodes: [ { id: "0", sortAttr: 0, sortAttr2: "a", }, { id: "1", sortAttr: 0, sortAttr2: "a", }, { id: "2", sortAttr: 0, sortAttr2: "a", }, { id: "3", sortAttr: 0, sortAttr2: "a", }, { id: "4", sortAttr: 2, sortAttr2: "c", }, { id: "5", sortAttr: 0, sortAttr2: "a", }, { id: "6", sortAttr: 1, sortAttr2: "b", }, { id: "7", sortAttr: 1, sortAttr2: "b", }, { id: "8", sortAttr: 2, sortAttr2: "c", }, { id: "9", sortAttr: 3, sortAttr2: "d", }, { id: "10", sortAttr: 3, sortAttr2: "d", }, { id: "11", sortAttr: 1, sortAttr2: "b", }, { id: "12", sortAttr: 2, sortAttr2: "c", }, { id: "13", sortAttr: 1, sortAttr2: "b", }, { id: "14", sortAttr: 3, sortAttr2: "d", }, { id: "15", sortAttr: 3, sortAttr2: "d", }, { id: "16", sortAttr: 1, sortAttr2: "b", }, { id: "17", sortAttr: 2, sortAttr2: "c", }, { id: "18", sortAttr: 2, sortAttr2: "c", }, { id: "19", sortAttr: 1, sortAttr2: "b", }, { id: "20", sortAttr: 1, sortAttr2: "b", }, { id: "21", sortAttr: 3, sortAttr2: "d", }, { id: "22", sortAttr: 3, sortAttr2: "d", }, { id: "23", sortAttr: 3, sortAttr2: "d", }, { id: "24", sortAttr: 0, sortAttr2: "a", }, { id: "25", sortAttr: 0, sortAttr2: "a", }, { id: "26", sortAttr: 1, sortAttr2: "b", }, { id: "27", sortAttr: 1, sortAttr2: "b", }, { id: "28", sortAttr: 3, sortAttr2: "d", }, { id: "29", sortAttr: 2, sortAttr2: "c", }, { id: "30", sortAttr: 2, sortAttr2: "c", }, { id: "31", sortAttr: 1, sortAttr2: "b", }, { id: "32", sortAttr: 1, sortAttr2: "b", }, { id: "33", sortAttr: 0, sortAttr2: "a", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = ["steelblue", "green", "pink", "grey"]; const colorsObj = { a: "steelblue", b: "green", c: "pink", d: "grey" }; data.nodes.forEach((node) => { node.size = 20; node.style = { lineWidth: 4, fill: "#fff", stroke: colors[node.sortAttr2] || colorsObj[node.sortAttr2], }; }); export default data; ================================================ FILE: packages/examples-alipay/pages/general-graph/sort-radial/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/sort-radial/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/sort-radial/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import radial from "@antv/f6/dist/extends/layout/radialLayout"; /** * 同层节点按照指定字段聚类 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 70, maxIteration: 1000, linkDistance: 10, preventOverlap: true, nodeSize: 30, sortBy: "sortAttr2", sortStrength: 50, }, animate: true, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/sort-radial/index.json ================================================ { "defaultTitle": "同层节点按照指定字段聚类", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/spiral-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/spiral-circular/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/spiral-circular/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/spiral-circular/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import circular from "@antv/f6/dist/extends/layout/circularLayout"; /** * 螺旋线布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", startRadius: 10, endRadius: 300, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/spiral-circular/index.json ================================================ { "defaultTitle": "螺旋线布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/subgraph-layout/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-alipay/pages/general-graph/subgraph-layout/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/subgraph-layout/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/subgraph-layout/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import Force from "@antv/f6/dist/extends/layout/forceLayout"; /** * subgraphLayout */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const { nodes } = data; nodes.forEach(function (node, i) { if (i <= 16 && i !== 12) { if (!node.style) { node.style = { fill: "#F6C3B7", stroke: "#E8684A", }; } else { node.style.fill = "lightsteelblue"; } } }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, modes: { default: ["drag-node"], }, defaultNode: { size: 20, style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, color: "#e2e2e2", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setTimeout(() => { // const { nodes } = data; const { edges } = data; const newNodes = []; const newEdges = []; const newNodeMap = new Map(); // fix the nodes[0] nodes[0].fx = nodes[0].x; nodes[0].fy = nodes[0].y; // add the nodes which should be re-layout nodes.forEach(function (node, i) { if (i <= 16 && i !== 12) { newNodes.push(node); newNodeMap.set(node.id, i); } }); // add related edges edges.forEach(function (edge) { const sourceId = edge.source; const targetId = edge.target; if ( newNodeMap.get(sourceId) !== undefined && newNodeMap.get(targetId) !== undefined ) { newEdges.push(edge); } }); const subForceLayout = new Force({ center: [nodes[0].x, nodes[0].y], linkDistance: 70, preventOverlap: true, nodeSize: 20, tick: () => { // the tick function to show the animation of layout process this.graph.refreshPositions(); }, }); subForceLayout.init({ nodes: newNodes, edges: newEdges, }); subForceLayout.execute(); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/subgraph-layout/index.json ================================================ { "defaultTitle": "子图布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/general-graph/sublayout-pipes/data.js ================================================ const data = { nodes: [], edges: [] }; for (let i = 0; i < 32; i++) { data.nodes.push({ id: `${i}`, label: i < 17 ? `employee-${i}` : `company-${i - 17}`, dataType: i < 17 ? "employee" : "company", style: i < 17 ? { stroke: "#5D7092", fill: "#5D7092", fillOpacity: 0.5 } : { stroke: "#5B8FF9", fill: "#5B8FF9", fillOpacity: 0.5 }, }); } data.edges = [ { source: "0", target: "1" }, { source: "0", target: "2" }, { source: "0", target: "3" }, { source: "0", target: "4" }, { source: "0", target: "5" }, { source: "0", target: "6" }, { source: "1", target: "2" }, { source: "1", target: "3" }, { source: "1", target: "4" }, { source: "1", target: "5" }, { source: "1", target: "6" }, { source: "2", target: "3" }, { source: "2", target: "4" }, { source: "2", target: "5" }, { source: "2", target: "6" }, { source: "7", target: "8" }, { source: "8", target: "9" }, { source: "9", target: "10" }, { source: "11", target: "12" }, { source: "12", target: "13" }, { source: "13", target: "14" }, { source: "14", target: "15" }, { source: "15", target: "16" }, { source: "11", target: "14" }, { source: "31", target: "11" }, { source: "24", target: "4" }, { source: "23", target: "7" }, ]; const legendData = { nodes: [ { id: "employee", label: "employee", style: { stroke: "#5D7092", fill: "#5D7092" }, }, { id: "company", label: "company", style: { stroke: "#5B8FF9", fill: "#5B8FF9" }, }, ], edges: [], }; export { data, legendData }; ================================================ FILE: packages/examples-alipay/pages/general-graph/sublayout-pipes/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/general-graph/sublayout-pipes/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/general-graph/sublayout-pipes/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { data, legendData } from "./data"; // import fruchtermanLayout from '@antv/f6/dist/extends/layout/fruchtermanLayout'; /** * sublayoutPipes */ // 注册布局 // F6.registerLayout('fruchterman', fruchtermanLayout); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 新建F6.legend实例 // TODO:Ledgend is not a constructor const legend = new F6.Legend({ data: legendData, align: "center", layout: "horizontal", // vertical position: "bottom-left", vertiSep: 12, horiSep: 24, offsetY: -24, padding: [4, 16, 8, 16], containerStyle: { fill: "#ccc", lineWidth: 1, }, title: "Legend", titleConfig: { position: "left", offsetX: 0, offsetY: 12, }, filter: { enable: true, multiple: true, trigger: "click", graphActiveState: "activeByLegend", graphInactiveState: "inactiveByLegend", filterFunctions: { a: (d) => { if (d.cluster === "a") return true; return false; }, b: (d) => { if (d.cluster === "b") return true; return false; }, c: (d) => { if (d.cluster === "c") return true; return false; }, d: (d) => { if (d.cluster === "d") return true; return false; }, }, }, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, modes: { default: ["drag-canvas", "drag-node"], }, plugins: [legend], animate: true, nodeStateStyles: { activeByLegend: { lineWidth: 5, strokeOpacity: 0.5, stroke: "#f00", }, inactiveByLegend: { opacity: 0.5, }, }, layout: { pipes: [ { type: "circular", nodesFilter: (node) => +node.id <= 6, center: [(width / 5) * 4 - 30, height / 2], radius: width / 10, }, { type: "circular", nodesFilter: (node) => +node.id >= 7 && +node.id <= 10, center: [width / 20 + 30, (height / 3) * 2], radius: width / 20, }, { type: "circular", nodesFilter: (node) => +node.id >= 11 && +node.id <= 16, center: [width / 20 + 30, height / 3], radius: width / 20, }, { type: "grid", nodesFilter: (node) => +node.id > 16, begin: [width / 10 + 50, 20], width: (width / 5) * 3 - 100, height: height - 40, }, ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/general-graph/sublayout-pipes/index.json ================================================ { "defaultTitle": "流水线子图布局", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/index/index.acss ================================================ .banner { height: 455rpx; width: 100%; background-image: url('../../common/images/component_bg.png'); background-size: contain; background-repeat: no-repeat; position: relative; z-index: 2; } .logo { width: 105rpx; height: 117rpx; position: absolute; top: 122rpx; left: 50%; transform: translate(-50%); } .logo image { width: 100%; height: 100%; } .title { font-size: 46rpx; color: #fff; position: absolute; top: 260rpx; left: 50%; font-weight: bold; transform: translate(-50%); } .sub-title { color: rgba(255, 255, 255, 0.48); font-size: 24rpx; position: absolute; top: 330rpx; left: 50%; transform: translate(-50%); } .fake-searchbar { position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%); height: 92rpx; width: 91.4%; display: flex; justify-content: center; align-items: center; background-color: #fff; border-radius: 4rpx; box-shadow: rgba(153, 153, 153, 0.24) 0 2px 7px; } .fake-placeholder { margin-left: 12rpx; color: rgba(153, 153, 153, 0.89); font-size: 28rpx; } .hot { padding-top: 60px; padding-bottom: 30rpx; padding-left: 4.26%; padding-right: 4.26%; box-sizing: border-box; } .tabs { height: 92rpx; position: sticky; background-color: #fff; z-index: 1; } .tabs.shadow { box-shadow: rgba(153, 153, 153, 0.24) 0 2px 7px; } .tabs-bar { padding: 0 64rpx; display: flex; height: 100%; } .tabs-bar-tab { bottom: 0; flex: 1; display: flex; justify-content: center; font-size: 32rpx; } .tabs-bar-tab-title { color: #999; padding: 16rpx 0; display: flex; align-items: center; border-bottom: 3px solid transparent; box-sizing: border-box; } .tabs-bar-tab-title.active { font-weight: bold; color: #1371f7; border-bottom: 3px solid #1371f7; } .component-name { color: rgb(51, 51, 51); margin-right: 10rpx; text-indent: 3em; } .component-brief { color: #ccc; font-size: 34rpx; } .list { padding: 32rpx; flex-shrink: 0; box-sizing: border-box; width: 100%; } .list-header { width: 100%; box-sizing: border-box; padding-top: 40rpx; padding-bottom: 20rpx; display: flex; align-items: center; background-color: #fff; color: #333; font-weight: bold; font-size: 34rpx; padding-left: 32rpx; } .thumb-wrapper { position: relative; } .thumb { height: 40rpx; width: 40rpx; position: absolute; top: 22rpx; margin-left: 30rpx; } .am-collapse-item-title-text-wrapper { text-indent: 2em; } .am-icon-right { color: black; } .am-list-header { box-sizing: border-box; padding: 0; } .am-list-body::before { display: none; } .list-item { margin-bottom: 35rpx; } .list-wrap { overflow: hidden; } .list-container { display: flex; width: 100%; transition-duration: 500ms; } .logo_devCenter { position: fixed; right: 32rpx; bottom: 44rpx; width: 109rpx; height: 121rpx; } .border-false { border: 1rpx solid #ddd; } ================================================ FILE: packages/examples-alipay/pages/index/index.axml ================================================ {{item}} {{list.type}} {{item.name}} {{list.type}} {{item.name}} ================================================ FILE: packages/examples-alipay/pages/index/index.js ================================================ import { treeGraphContainer, generalGraphContainer, basicElementContainer, basicInteractiveContainer, aminationContainer, customizeTree, classicCace, newsMapVisualize, plugins, hot, tabs, } from "../../common/utils/data"; // 这个是基础组件tab的标题 const basicComponentList = [ { type: "树图", list: treeGraphContainer, }, { type: "一般图", list: generalGraphContainer, }, { type: "元素", list: basicElementContainer, }, { type: "交互", list: basicInteractiveContainer, }, { type: "动画", list: aminationContainer, }, ]; // 这里控制拓展组件的盒子个数 const extComponentList = [ { type: "自定义树", list: customizeTree, }, { type: "经典案例", list: classicCace, }, { type: "新闻图可视化", list: newsMapVisualize, }, { type: "分析组件", list: plugins, }, ]; Page({ data: { showInfoObj: {}, // 控制各个框框的气泡显示 nut: "/images/icon/nut.png", // 下拉框的项目符号 top: 0, hot, // 控制搜索框下面的热词 tabs, // 控制tab栏的文字显示 activeTab: 0, // 默认的tab激活 basicComponentList, // 基础组件tab extComponentList, // 拓展组件tab titleOpacity: 1, shadow: false, }, onPageScroll(e) { const { scrollTop } = e; let titleOpacity = 1 - scrollTop * 0.02; let shadow = false; if (titleOpacity < 0) { titleOpacity = 0; } if (titleOpacity > 1) { titleOpacity = 1; } if (scrollTop > 80) { my.setNavigationBar({ title: "F6官方示例", }); } else { my.setNavigationBar({ title: " ", }); } if (scrollTop > 320) { shadow = true; } else { shadow = false; } this.setData({ shadow, titleOpacity, }); }, onSearchBarTap() { // 点击搜索框的回调 console.log("点击了搜索框"); my.navigateTo({ url: "../search/search", }); }, onTabBarTap(e) { const { index } = e.target.dataset; this.setData({ activeTab: index, }); console.log("activeTab", this.data.activeTab); }, onLoad() { my.getSystemInfo({ // 获取系统信息 success: (res) => { if (res.statusBarHeight && res.titleBarHeight) { this.setData({ top: res.statusBarHeight + res.titleBarHeight, }); } }, }); }, goDevCenter() { // 开发者中心的按钮,后续可以去掉 my.navigateToMiniProgram({ appId: "2018082061148052", path: "pages/discover/discover", extraData: { from: "miniDemo", }, }); }, openPage(e) { // 点开页面的回调 my.navigateTo({ url: e.target.dataset.url, }); }, // 检查点击是否成功 onChange(e) { console.log("collapse change", e); }, }); ================================================ FILE: packages/examples-alipay/pages/index/index.json ================================================ { "defaultTitle": "", "allowsBounceVertical": "NO", "transparentTitle": "auto", "titleBarColor": "#262833", "usingComponents": { "block-list": "../../common/components/block-list/block-list", "list": "mini-ali-ui/es/list/index", "list-item": "mini-ali-ui/es/list/list-item/index", "collapse": "mini-ali-ui/es/collapse/index", "collapse-item": "mini-ali-ui/es/collapse/collapse-item/index" } } ================================================ FILE: packages/examples-alipay/pages/interactive/activate-relations/data.js ================================================ export default { nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/activate-relations/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/activate-relations/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/activate-relations/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * activateRelations:内置的高亮节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const tooltip = new F6.Tooltip({ offsetX: 10, offsetY: 10, fixToNode: [1, 0.5], // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node", "edge"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { const outDiv = document.createElement("div"); outDiv.style.width = "fit-content"; outDiv.style.height = "fit-content"; const model = e.item.getModel(); if (e.item.getType() === "node") { outDiv.innerHTML = `${model.name}`; } else { const source = e.item.getSource(); const target = e.item.getTarget(); outDiv.innerHTML = `来源:${source.getModel().name}
去向:${ target.getModel().name }`; } return outDiv; }, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, layout: { type: "force", edgeStrength: 0.7, }, plugins: [tooltip], modes: { default: ["drag-canvas", "activate-relations"], }, defaultNode: { size: [10, 10], /* style for the keyShape */ // style: { // lineWidth: 2, // fill: '#DEE9FF', // stroke: '#5B8FF9', // }, }, defaultEdge: { /* style for the keyShape */ style: { stroke: "#aaa", lineAppendWidth: 2, opacity: 0.3, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/activate-relations/index.json ================================================ { "defaultTitle": "内置的高亮节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/add-child/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/add-child/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/add-child/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/add-child/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * addChild */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, modes: { default: ["collapse-expand", "drag-canvas"], }, fitView: true, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 50; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node(function (node) { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.edge(function () { return { type: "cubic-horizontal", color: "#A3B1BF", }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); let count = 0; this.graph.on("node:tap", (evt) => { const { item } = evt; const nodeId = item.get("id"); const model = item.getModel(); const { children } = model; if (!children || children.length === 0) { const childData = { id: `child-data-${count}`, type: "rect", children: [ { id: `x-${count}`, }, { id: `y-${count}`, }, ], }; this.graph.addChild(childData, nodeId); count++; } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/add-child/index.json ================================================ { "defaultTitle": "使用addChild", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/canvas-two-fingers/data.js ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/canvas-two-fingers/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/canvas-two-fingers/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/canvas-two-fingers/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * canvasTwoFingers */ // 注册行为 F6.registerBehavior("double-finger-drag-canvas", { getEvents: function getEvents() { return { "canvas:drag": "onWheel", }; }, onWheel: function onWheel(ev) { if (ev.ctrlKey) { const canvas = this.graph.get("canvas"); // 这里显示graph找不到 const point = canvas.getPointByClient(ev.clientX, ev.clientY); let ratio = this.graph.getZoom(); if (ev.wheelDelta > 0) { ratio += ratio * 0.05; } else { ratio -= ratio * 0.05; } this.graph.zoomTo(ratio, { x: point.x, y: point.y, }); } else { const x = ev.deltaX || ev.movementX; const y = ev.deltaY || ev.movementY; this.graph.translate(-x, -y); } ev.preventDefault(); }, }); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, currentMode: "请选择模式", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: ["double-finger-drag-canvas"], }, layout: { type: "force", }, }); this.graph.get("canvas").set("localRefresh", false); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/canvas-two-fingers/index.json ================================================ { "defaultTitle": "两指平移画布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/change-data/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/change-data/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/change-data/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/change-data/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * changeData */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, modes: { default: ["collapse-expand", "drag-canvas"], }, fitView: true, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 50; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node(function (node) { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); let i = 0; this.graph.edge(function () { i++; return { type: "cubic-horizontal", color: "#A3B1BF", label: i, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); let count = 0; this.graph.on("node:tap", function (evt) { const { item } = evt; const nodeId = item.get("id"); const model = item.getModel(); const { children } = model; if (!children || children.length === 0) { const childData = [ { id: `child-data-${count}`, type: "rect", children: [ { id: `x-${count}`, }, { id: `y-${count}`, }, ], }, { id: `child-data1-${count}`, children: [ { id: `x1-${count}`, }, { id: `y1-${count}`, }, ], }, ]; const parentData = this.graph.findDataById(nodeId); if (!parentData.children) { parentData.children = []; } // 如果childData是一个数组,则直接赋值给parentData.children // 如果是一个对象,则使用parentData.children.push(obj) parentData.children = childData; this.graph.changeData(); count++; } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/change-data/index.json ================================================ { "defaultTitle": "使用changeData", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/change-members/data.js ================================================ export default { nodes: [ { id: "1", label: "公司1", group: 1, }, { id: "2", label: "公司2", group: 1, }, { id: "3", label: "公司3", group: 1, }, { id: "4", label: "公司4", group: 1, }, { id: "5", label: "公司5", group: 2, }, { id: "6", label: "公司6", group: 2, }, { id: "7", label: "公司7", group: 2, }, { id: "8", label: "公司8", group: 2, }, { id: "9", label: "公司9", group: 2, }, ], edges: [ { source: "1", target: "1", type: "loop", }, { source: "2", target: "2", type: "loop", }, { source: "1", target: "2", data: { type: "A", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "3", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "2", target: "5", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, { source: "5", target: "6", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "3", target: "4", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, { source: "4", target: "7", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "8", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "9", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/change-members/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/change-members/index.axml ================================================ {{discription}} ================================================ FILE: packages/examples-alipay/pages/interactive/change-members/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import grid from "@antv/f6/dist/extends/layout/gridLayout"; /** * changeMembers:修改包裹内部成员 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, discription: "Wait for the layout to complete...", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerLayout("grid", grid); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, layout: { type: "grid", }, }); const hull1 = this.graph.createHull({ id: "hull1", type: "smooth-convex", padding: 15, members: this.graph .getNodes() .filter((node) => node.getModel().group === 1), }); const hull2 = this.graph.createHull({ id: "hull2", members: this.graph .getNodes() .filter((node) => node.getModel().group === 2), padding: 15, type: "bubble", style: { fill: "pink", stroke: "red", }, update: "drag", }); this.graph.on("canvas:contextmenu", (ev) => { ev.preventDefault(); ev.stopPropagation(); const item = this.graph.addItem("node", { x: ev.x, y: ev.y, id: Math.random(), group: 2, }); hull2.addMember(item); }); this.graph.on("afterupdateitem", (e) => { if ( hull1.members.indexOf(e.item) > -1 || hull1.nonMembers.indexOf(e.item) > -1 ) { hull1.updateData(hull1.members); } }); this.graph.on("node:dragend", (e) => { const { item } = e; const memberIdx = hull2.members.indexOf(item); if (memberIdx > -1) { // 如果移出原hull范围,则去掉 if (!hull2.contain(item)) { hull2.removeMember(item); } else { hull2.updateData(hull2.members); } } else if (hull2.contain(item)) hull2.addMember(item); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/change-members/index.json ================================================ { "defaultTitle": "修改包裹内部成员", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/collapse-slibing/data.js ================================================ export default { isRoot: true, id: "Root", cluster: "c0", children: [ { id: "SubTreeNode1", cluster: "c0", raw: {}, children: [ { id: "SubTreeNode1.1", cluster: "c1", }, { id: "SubTreeNode1.2", cluster: "c1", children: [ { id: "SubTreeNode1.2.1", cluster: "c0", }, { id: "SubTreeNode1.2.2", cluster: "c0", }, { id: "SubTreeNode1.2.3", cluster: "c1", }, ], }, ], }, { id: "SubTreeNode2", cluster: "c0", children: [ { id: "SubTreeNode2.1", cluster: "c2", }, ], }, { id: "SubTreeNode3", cluster: "c0", children: [ { id: "SubTreeNode3.1", cluster: "c2", }, { id: "SubTreeNode3.2", cluster: "c2", }, { id: "SubTreeNode3.3", cluster: "c2", }, ], }, { id: "SubTreeNode4", cluster: "c1", }, { id: "SubTreeNode5", cluster: "c1", }, { id: "SubTreeNode6", cluster: "c1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/collapse-slibing/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/collapse-slibing/index.axml ================================================ {{discription}} ================================================ FILE: packages/examples-alipay/pages/interactive/collapse-slibing/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data.js"; /** * dragSubtree:拖拽子树改变结构 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, discription: "Click a node to collapse the siblings with same cluster, and click again to expand", }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // custom the collapse-sibling behavior F6.registerBehavior("collapse-slibing", { getEvents() { return { "node:click": "onClick", }; }, onClick(evt) { const { item } = evt; const model = item.getModel(); const { cluster } = model; const parentData = item.get("parent").getModel(); const me = this; if (model.collapsedSiblings) { this.graph.removeChild(model.id); setTimeout(() => { const { children } = parentData; for (let i = model.collapsedSiblings.length - 1; i >= 0; i--) { const add = model.collapsedSiblings[i]; children.splice(add.idx, 0, add); } delete model.collapsedSiblings; me.graph.updateChildren(children, parentData.id); }, 550); return; } const siblingData = parentData.children; if (siblingData.length <= 1) return; let count = 0; const aggregateNode = { id: `aggregate-node-${model.id}`, children: [], cluster, collapsedSiblings: [], }; let modelIdx = siblingData.length - 1; for (let i = siblingData.length - 1; i >= 0; i--) { const sibling = siblingData[i]; if (sibling.id === model.id) { const remove = siblingData[i]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); } else if (sibling.cluster === cluster && sibling.id !== model.id) { count++; aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); const remove = siblingData.splice(i, 1)[0]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); } } if (!count) return; aggregateNode.label = count + 1; aggregateNode.size = 16 + (count + 1) * 4; this.graph.removeChild(model.id); siblingData.splice(modelIdx, 0, aggregateNode); setTimeout(() => { me.graph.updateChildren(siblingData, parentData.id); }, 550); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const colors = ["#5F95FF", "#61DDAA", "#65789B"]; const colorSets = F6.Util.getColorSetsBySubjectColors( colors, "#fff", "default", "#777", ); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["collapse-slibing", "drag-canvas"], }, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 50; }, }, defaultEdge: { type: "cubic-horizontal", color: "#A3B1BF", }, }); this.graph.node(function (node) { const colorSet = colorSets[+node.cluster.replace("c", "")]; return { size: node.size || 16, style: { fill: colorSet.mainFill || "#DEE9FF", stroke: colorSet.mainStroke || "#5B8FF9", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/collapse-slibing/index.json ================================================ { "defaultTitle": "合并同类兄弟节点", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/combo-circle/data.js ================================================ export default { nodes: [ { id: "node1", x: 350, y: 200, comboId: "combo1" }, { id: "node2", x: 350, y: 250, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], edges: [ { source: "node1", target: "node2" }, { source: "node1", target: "node3" }, { source: "combo1", target: "node3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/combo-circle/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/combo-circle/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/combo-circle/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * combo_circle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, defaultCombo: { type: "circle", style: { lineWidth: 1, }, labelCfg: { refY: 15, position: "bottom", }, }, comboStateStyles: { dragenter: { lineWidth: 4, stroke: "#FE9797", }, }, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", "click-select", ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("combo:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("node:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("combo:dragenter", (e) => { this.graph.setItemState(e.item, "dragenter", true); }); this.graph.on("combo:dragleave", (e) => { this.graph.setItemState(e.item, "dragenter", false); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/combo-circle/index.json ================================================ { "defaultTitle": "圆形组合", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/combo-rect/data.js ================================================ export default { nodes: [ { id: "node1", x: 350, y: 200, comboId: "combo1" }, { id: "node2", x: 350, y: 250, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], edges: [ { source: "node1", target: "node2" }, { source: "node1", target: "node3" }, { source: "combo1", target: "node3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3" }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/combo-rect/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/combo-rect/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/combo-rect/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * combo_rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, defaultCombo: { type: "rect", size: [40, 10], // The minimum size of the Combo padding: [30, 20, 10, 20], style: { lineWidth: 1, }, labelCfg: { refY: 10, refX: 20, position: "bottom", }, }, comboStateStyles: { dragenter: { lineWidth: 4, stroke: "#FE9797", }, }, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", "click-select", ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("combo:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("node:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("combo:dragenter", (e) => { this.graph.setItemState(e.item, "dragenter", true); }); this.graph.on("combo:dragleave", (e) => { this.graph.setItemState(e.item, "dragenter", false); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/combo-rect/index.json ================================================ { "defaultTitle": "矩形组合", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/drag-subtree/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/drag-subtree/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/drag-subtree/index.axml ================================================ {{discription}} ================================================ FILE: packages/examples-alipay/pages/interactive/drag-subtree/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data.js"; /** * dragSubtree:拖拽子树改变结构 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, discription: "Move a subtree to a new parent by dragging the root node of the subtree.", }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ "drag-canvas", "zoom-canvas", { type: "drag-node", enableDelegate: true, }, ], }, defaultNode: { size: [26, 26], anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, nodeStateStyles: { closest: { fill: "#f00", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node(function (node) { return { label: node.id, labelCfg: { offset: 10, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); let minDisNode; this.graph.on("node:dragstart", () => { minDisNode = undefined; }); this.graph.on("node:drag", (e) => { minDisNode = undefined; const { item } = e; const model = item.getModel(); const nodes = this.graph.getNodes(); let minDis = Infinity; nodes.forEach((inode) => { this.graph.setItemState(inode, "closest", false); const node = inode.getModel(); if (node.id === model.id) return; const dis = (node.x - e.x) * (node.x - e.x) + (node.y - e.y) * (node.y - e.y); if (dis < minDis) { minDis = dis; minDisNode = inode; } }); console.log("minDis", minDis, minDisNode); if (minDis < 2000) this.graph.setItemState(minDisNode, "closest", true); else minDisNode = undefined; }); this.graph.on("node:dragend", (e) => { if (!minDisNode) { this.setData({ discription: "Failed. No node close to the dragged node.", }); return; } const { item } = e; const id = item.getID(); const data = this.graph.findDataById(id); // if the minDisNode is a descent of the dragged node, return let isDescent = false; const minDisNodeId = minDisNode.getID(); console.log("dragend", minDisNodeId, isDescent, data, id); F6.Util.traverseTree(data, (d) => { if (d.id === minDisNodeId) isDescent = true; }); if (isDescent) { this.setData({ discription: "Failed. The target node is a descendant of the dragged node.", }); return; } this.graph.removeChild(id); const me = this; setTimeout(() => { const newParentData = this.graph.findDataById(minDisNodeId); let newChildren = newParentData.children; if (newChildren) newChildren.push(data); else newChildren = [data]; me.graph.updateChildren(newChildren, minDisNodeId); me.setData({ discription: "Success.", }); }, 600); }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/drag-subtree/index.json ================================================ { "defaultTitle": "拖拽子树改变结构", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/fix-item/data.js ================================================ export default { nodes: [ { id: "node0", size: 50, label: "0", x: 326, y: 268 }, { id: "node1", size: 30, label: "1", x: 280, y: 384 }, { id: "node2", size: 30, label: "2", x: 234, y: 167 }, { id: "node3", size: 30, label: "3", x: 391, y: 368 }, { id: "node4", size: 30, label: "4", x: 444, y: 209 }, { id: "node5", size: 30, label: "5", x: 378, y: 157 }, { id: "node6", size: 15, label: "6", x: 229, y: 400 }, { id: "node7", size: 15, label: "7", x: 281, y: 440 }, { id: "node8", size: 15, label: "8", x: 188, y: 119 }, { id: "node9", size: 15, label: "9", x: 287, y: 157 }, { id: "node10", size: 15, label: "10", x: 185, y: 200 }, { id: "node11", size: 15, label: "11", x: 238, y: 110 }, { id: "node12", size: 15, label: "12", x: 239, y: 221 }, { id: "node13", size: 15, label: "13", x: 176, y: 160 }, { id: "node14", size: 15, label: "14", x: 389, y: 423 }, { id: "node15", size: 15, label: "15", x: 441, y: 341 }, { id: "node16", size: 15, label: "16", x: 442, y: 398 }, ], edges: [ { source: "node0", target: "node1", label: "0-1" }, { source: "node0", target: "node2", label: "0-2" }, { source: "node0", target: "node3", label: "0-3" }, { source: "node0", target: "node4", label: "0-4" }, { source: "node0", target: "node5", label: "0-5" }, { source: "node1", target: "node6", label: "1-6" }, { source: "node1", target: "node7", label: "1-7" }, { source: "node2", target: "node8", label: "2-8" }, { source: "node2", target: "node9", label: "2-9" }, { source: "node2", target: "node10", label: "2-10" }, { source: "node2", target: "node11", label: "2-11" }, { source: "node2", target: "node12", label: "2-12" }, { source: "node2", target: "node13", label: "2-13" }, { source: "node3", target: "node14", label: "3-14" }, { source: "node3", target: "node15", label: "3-15" }, { source: "node3", target: "node16", label: "3-16" }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/fix-item/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/fix-item/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/fix-item/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * fixItem:缩放画布时固定元素 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, currentMode: "Fix all", // 按钮的显示 fixSelectedItems: { fixAll: true, fixLabel: false, fixLineWidth: false, fixState: "yourStateName", // 'selected' by default }, }, // 选项框 openOne() { const modeList = [ "Fix all", "Fix fontSize of label", "Fix lineWidth of label", ]; my.optionsSelect({ title: "模式选择", optionsOne: [ "Fix all", "Fix fontSize of label", "Fix lineWidth of label", ], // 按钮的选项 selectedOneIndex: 0, // 默认选项的索引下标 success: (res) => { // my.alert({ // content: res // }); // 获取到选择项的下标 const modeNum = res.selectedOneIndex; // console.log(modeNum, 'modeNum'); // console.log(modeList[Number(modeNum)], 'thisis'); this.setData({ currentMode: modeList[Number(modeNum)], }); // 添加模式 switch (Number(modeNum)) { case 0: this.setData({ fixSelectedItems: { fixAll: true, fixLabel: false, fixLineWidth: false, fixState: "yourStateName", }, }); // this.fixSelectedItems.fixAll = true; break; case 1: this.setData({ fixSelectedItems: { fixAll: false, fixLabel: true, fixLineWidth: false, fixState: "yourStateName", }, }); // this.fixSelectedItems.fixLabel = true; break; case 2: this.setData({ fixSelectedItems: { fixAll: false, fixLabel: false, fixLineWidth: true, fixState: "yourStateName", }, }); // this.fixSelectedItems.fixLineWidth = true; break; } console.log(this.data.fixSelectedItems); this.updateChart(); }, }); }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio, fixSelectedItems } = this.data; console.log("update", fixSelectedItems); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ "drag-canvas", "drag-node", { type: "zoom-canvas", fixSelectedItems, }, ], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, edgeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, }); // 监听 this.graph.on("node:tap", (e) => { this.graph.setItemState(e.item, "yourStateName", true); }); this.graph.on("edge:tap", (e) => { this.graph.setItemState(e.item, "yourStateName", true); }); this.graph.on("canvas:tap", () => { this.graph.findAllByState("node", "yourStateName").forEach((node) => { this.graph.setItemState(node, "yourStateName", false); }); this.graph.findAllByState("edge", "yourStateName").forEach((edge) => { this.graph.setItemState(edge, "yourStateName", false); }); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/fix-item/index.json ================================================ { "defaultTitle": "缩放画布时固定元素", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/hide-item/data.js ================================================ export default { nodes: [ { id: "node0", size: 50, label: "0", x: 326, y: 268 }, { id: "node1", size: 30, label: "1", x: 280, y: 384 }, { id: "node2", size: 30, label: "2", x: 234, y: 167 }, { id: "node3", size: 30, label: "3", x: 391, y: 368 }, { id: "node4", size: 30, label: "4", x: 444, y: 209 }, { id: "node5", size: 30, label: "5", x: 378, y: 157 }, { id: "node6", size: 15, label: "6", x: 229, y: 400 }, { id: "node7", size: 15, label: "7", x: 281, y: 440 }, { id: "node8", size: 15, label: "8", x: 188, y: 119 }, { id: "node9", size: 15, label: "9", x: 287, y: 157 }, { id: "node10", size: 15, label: "10", x: 185, y: 200 }, { id: "node11", size: 15, label: "11", x: 238, y: 110 }, { id: "node12", size: 15, label: "12", x: 239, y: 221 }, { id: "node13", size: 15, label: "13", x: 176, y: 160 }, { id: "node14", size: 15, label: "14", x: 389, y: 423 }, { id: "node15", size: 15, label: "15", x: 441, y: 341 }, { id: "node16", size: 15, label: "16", x: 442, y: 398 }, ], edges: [ { source: "node0", target: "node1", label: "0-1" }, { source: "node0", target: "node2", label: "0-2" }, { source: "node0", target: "node3", label: "0-3" }, { source: "node0", target: "node4", label: "0-4" }, { source: "node0", target: "node5", label: "0-5" }, { source: "node1", target: "node6", label: "1-6" }, { source: "node1", target: "node7", label: "1-7" }, { source: "node2", target: "node8", label: "2-8" }, { source: "node2", target: "node9", label: "2-9" }, { source: "node2", target: "node10", label: "2-10" }, { source: "node2", target: "node11", label: "2-11" }, { source: "node2", target: "node12", label: "2-12" }, { source: "node2", target: "node13", label: "2-13" }, { source: "node3", target: "node14", label: "3-14" }, { source: "node3", target: "node15", label: "3-15" }, { source: "node3", target: "node16", label: "3-16" }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/hide-item/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/hide-item/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/hide-item/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * hideItem */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ "drag-node", { type: "drag-canvas", enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape }, { type: "zoom-canvas", enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape }, ], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, edgeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/hide-item/index.json ================================================ { "defaultTitle": "拖拽画布时候隐藏", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/highlight-dark/data.js ================================================ export default { nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/highlight-dark/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/highlight-dark/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/highlight-dark/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * highlightDark:自定义高亮 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const tooltip = new F6.Tooltip({ offsetX: 10, offsetY: 10, fixToNode: [1, 0.5], // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node", "edge"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { const outDiv = document.createElement("div"); outDiv.style.width = "fit-content"; outDiv.style.height = "fit-content"; const model = e.item.getModel(); if (e.item.getType() === "node") { outDiv.innerHTML = `${model.name}`; } else { const source = e.item.getSource(); const target = e.item.getTarget(); outDiv.innerHTML = `来源:${source.getModel().name}
去向:${ target.getModel().name }`; } return outDiv; }, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, plugins: [tooltip], layout: { type: "force", edgeStrength: 0.7, }, modes: { default: ["drag-canvas"], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { highlight: { opacity: 1, }, dark: { opacity: 0.2, }, }, edgeStateStyles: { highlight: { stroke: "#999", }, }, }); // 监听 function clearAllStats() { this.graph.setAutoPaint(false); this.graph.getNodes().forEach(function (node) { this.graph.clearItemStates(node); }); this.graph.getEdges().forEach(function (edge) { this.graph.clearItemStates(edge); }); this.graph.paint(); this.graph.setAutoPaint(true); } this.graph.on("node:mouseenter", function (e) { const { item } = e; this.graph.setAutoPaint(false); this.graph.getNodes().forEach(function (node) { this.graph.clearItemStates(node); this.graph.setItemState(node, "dark", true); }); this.graph.setItemState(item, "dark", false); this.graph.setItemState(item, "highlight", true); this.graph.getEdges().forEach(function (edge) { if (edge.getSource() === item) { this.graph.setItemState(edge.getTarget(), "dark", false); this.graph.setItemState(edge.getTarget(), "highlight", true); this.graph.setItemState(edge, "highlight", true); edge.toFront(); } else if (edge.getTarget() === item) { this.graph.setItemState(edge.getSource(), "dark", false); this.graph.setItemState(edge.getSource(), "highlight", true); this.graph.setItemState(edge, "highlight", true); edge.toFront(); } else { this.graph.setItemState(edge, "highlight", false); } }); this.graph.paint(); this.graph.setAutoPaint(true); }); this.graph.on("node:mouseleave", clearAllStats); this.graph.on("canvas:tap", clearAllStats); this.graph.data({ nodes: data.nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/highlight-dark/index.json ================================================ { "defaultTitle": "自定义高亮", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/hull/data.js ================================================ export default { nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, { id: "node4", size: 30, isLeaf: true }, { id: "node5", size: 30, isLeaf: true }, { id: "node6", size: 15, isLeaf: true }, { id: "node7", size: 15, isLeaf: true }, { id: "node8", size: 15, isLeaf: true }, { id: "node9", size: 15, isLeaf: true }, { id: "node10", size: 15, isLeaf: true }, { id: "node11", size: 15, isLeaf: true }, { id: "node12", size: 15, isLeaf: true }, { id: "node13", size: 15, isLeaf: true }, { id: "node14", size: 15, isLeaf: true }, { id: "node15", size: 15, isLeaf: true }, { id: "node16", size: 15, isLeaf: true }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node0", target: "node4" }, { source: "node0", target: "node5" }, { source: "node1", target: "node6" }, { source: "node1", target: "node7" }, { source: "node2", target: "node8" }, { source: "node2", target: "node9" }, { source: "node2", target: "node10" }, { source: "node2", target: "node11" }, { source: "node2", target: "node12" }, { source: "node2", target: "node13" }, { source: "node3", target: "node14" }, { source: "node3", target: "node15" }, { source: "node3", target: "node16" }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/hull/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/hull/index.axml ================================================ {{discription}} ================================================ FILE: packages/examples-alipay/pages/interactive/hull/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import force from "@antv/f6/dist/extends/layout/forceLayout"; /** * hull:用轮廓包裹节点集合 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, discription: "Wait for the layout to complete...", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const { nodes } = data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node", "lasso-select"], }, layout: { type: "force", preventOverlap: true, linkDistance: (d) => { if (d.source.id === "node0") { return 300; } return 60; }, nodeStrength: (d) => { if (d.isLeaf) { return -50; } return -10; }, edgeStrength: (d) => { if ( d.source.id === "node1" || d.source.id === "node2" || d.source.id === "node3" ) { return 0.7; } return 0.1; }, }, }); this.graph.data({ nodes, edges: data.edges.map(function (edge, i) { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); const centerNodes = this.graph .getNodes() .filter((node) => !node.getModel().isLeaf); this.graph.on("afterlayout", () => { this.setData({ discription: "", }); const hull1 = this.graph.createHull({ id: "centerNode-hull", type: "bubble", members: centerNodes, padding: 10, }); const hull2 = this.graph.createHull({ id: "leafNode-hull1", members: ["node6", "node7"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); const hull3 = this.graph.createHull({ id: "leafNode-hull2", members: ["node8", "node9", "node10", "node11", "node12", "node13"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); this.graph.on("afterupdateitem", () => { hull1.updateData(hull1.members); hull2.updateData(hull2.members); hull3.updateData(hull3.members); }); }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/hull/index.json ================================================ { "defaultTitle": "用轮廓包裹节点集合", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/move/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 200, y: 150, label: "node2", }, { id: "node3", x: 100, y: 150, label: "node3", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node3", }, { source: "node3", target: "node1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/move/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/move/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/move/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * move */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // function handleNodeClick(event) { // const { item } = event; // console.log('item后', item) // // animately move the graph to focus on the item. // // the second parameter controlls whether move with animation, the third parameter is the animate configuration // this.graph.focusItem(item); // } // listen to the node click event this.graph.on("node:tap", (event) => { const { item } = event; // animately move the graph to focus on the item. // the second parameter controlls whether move with animation, the third parameter is the animate configuration this.graph.focusItem(item); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/move/index.json ================================================ { "defaultTitle": "点击节点移动", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/move-animate/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 200, y: 150, label: "node2", }, { id: "node3", x: 100, y: 150, label: "node3", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node3", }, { source: "node3", target: "node1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/move-animate/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/move-animate/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/move-animate/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * moveAnimate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, // The global configuration for graph animation also takes effect on the focusItem // animate: true, // animateCfg: { // easing: 'easeCubic', // duration: 500 // } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // listen to the node click event this.graph.on("node:tap", (event) => { const { item } = event; // animately move the graph to focus on the item. // the second parameter controlls whether move with animation, the third parameter is the animate configuration this.graph.focusItem(item, true, { easing: "easeCubic", duration: 500, }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/move-animate/index.json ================================================ { "defaultTitle": "点击节点动画", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/partial-node/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 150, label: "node1", size: 100, type: "customNode", }, { id: "node2", x: 300, y: 150, label: "node2", size: 100, type: "customNode", }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/partial-node/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/partial-node/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/partial-node/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * partialNode */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义节点 F6.registerNode( "customNode", { // 绘制节点 drawShape: function drawShape(cfg, group) { const { shapeType } = this; const style = Object.assign({}, this.getShapeStyle(cfg), { x: 0, y: 0, r: 50, }); const shape = group.addShape(shapeType, { attrs: style, name: "key-shape", }); // 绘制节点里面的小圆。点击这个小圆会显示tooltip group.addShape("circle", { attrs: { x: 0, y: -30, r: 10, fill: "#096dd9", cursor: "pointer", }, name: "circle-shape", }); return shape; }, }, "circle", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ { type: "drag-node", delegate: false, }, ], }, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, labelCfg: { style: { fontSize: 12, }, }, }, defaultEdge: { style: { stroke: "#e2e2e2", }, }, nodeStateStyles: { selected: { stroke: "red", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 节点上的点击事件 this.graph.on("node:tap", (event) => { const { item } = event; this.graph.setItemState(item, "selected", true); }); this.graph.on("circle-shape:tap", (evt) => { const { item } = evt; this.graph.updateItem(item, { label: "点击了局部", labelCfg: { style: { fill: "#003a8c", fontSize: 16, }, }, }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/partial-node/index.json ================================================ { "defaultTitle": "响应节点中部分区域", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/interactive/set-mode/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 200, }, { id: "node2", x: 300, y: 200, }, { id: "node3", x: 300, y: 300, }, ], edges: [ { id: "edge1", target: "node2", source: "node1", }, ], }; ================================================ FILE: packages/examples-alipay/pages/interactive/set-mode/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/interactive/set-mode/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/interactive/set-mode/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * setMode */ let modeNum = 0; // 用来标记选择的模式 const modeList = ["默认模式", "添加节点模式", "添加边模式"]; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, currentMode: "请选择模式", }, // 选项框 openOne() { my.optionsSelect({ title: "模式选择", optionsOne: ["默认模式", "添加节点模式", "添加边模式"], selectedOneIndex: 0, // 默认选项的索引下标 success: (res) => { // my.alert({ // content: res // }); modeNum = res.selectedOneIndex; this.setData({ currentMode: modeList[modeNum], }); switch (modeNum) { case 0: this.graph.setMode("default"); console.log("default"); break; case 1: this.graph.setMode("addNode"); console.log("addNode"); break; case 2: this.graph.setMode("addEdge"); console.log("addEdge"); break; } }, }); }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); // 注册自定义节点 let addedCount = 0; // Register a custom behavior: add a node when user click the blank part of canvas F6.registerBehavior("click-add-node", { // Set the events and the corresponding responsing function for this behavior getEvents() { // The event is canvas:click, the responsing function is onClick return { "canvas:tap": "onClick", }; }, // Click event onClick(ev) { const self = this; const { graph } = self; // Add a new node graph.addItem("node", { x: ev.canvasX, y: ev.canvasY, id: `node-${addedCount}`, // Generate the unique id }); addedCount++; }, }); // Register a custom behavior: click two end nodes to add an edge F6.registerBehavior("click-add-edge", { // Set the events and the corresponding responsing function for this behavior getEvents() { return { "node:tap": "onClick", // The event is canvas:click, the responsing function is onClick "canvas:panmove": "onMousemove", // The event is mousemove, the responsing function is onMousemove "edge:tap": "onEdgeClick", // The event is edge:click, the responsing function is onEdgeClick }; }, // The responsing function for node:click defined in getEvents onClick(ev) { const self = this; const node = ev.item; const { graph } = self; // The position where the mouse clicks // const point = { x: ev.x, y: ev.y }; const model = node.getModel(); if (self.addingEdge && self.edge) { graph.updateItem(self.edge, { target: model.id, }); self.edge = null; self.addingEdge = false; } else { // Add anew edge, the end node is the current node user clicks self.edge = graph.addItem("edge", { source: model.id, target: model.id, }); self.addingEdge = true; } }, // The responsing function for mousemove defined in getEvents onMousemove(ev) { const self = this; // The current position the mouse clicks const point = { x: ev.x, y: ev.y }; if (self.addingEdge && self.edge) { // Update the end node to the current node the mouse clicks self.graph.updateItem(self.edge, { target: point, }); } }, // The responsing function for edge:click defined in getEvents onEdgeClick(ev) { const self = this; const currentEdge = ev.item; if (self.addingEdge && self.edge === currentEdge) { self.graph.removeItem(self.edge); self.edge = null; self.addingEdge = false; } }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // The sets of behavior modes modes: { // Defualt mode default: ["drag-node", "click-select"], // Adding node mode addNode: ["click-add-node", "click-select"], // Adding edge mode addEdge: ["click-add-edge", "click-select"], }, // The node styles in different states nodeStateStyles: { // The node styles in selected state selected: { stroke: "#666", lineWidth: 2, fill: "steelblue", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/interactive/set-mode/index.json ================================================ { "defaultTitle": "设置交互模式", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/bundling/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/bundling/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/bundling/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/bundling/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import CircularLayout from "@antv/f6/dist/extends/layout/circularLayout"; import { Bundling } from "@antv/f6-plugin"; F6.registerLayout("circular", CircularLayout); /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const edgeBundling = new Bundling({ bundleThreshold: 0.1, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas"], }, layout: { type: "circular", center: [width / 2, height / 2], radius: height / 2.5, ordering: null, }, plugins: [edgeBundling], defaultNode: { size: [20, 20], color: "steelblue", }, defaultEdge: { size: 1, color: "#999", }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); setTimeout(() => { edgeBundling.bundling(data); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/bundling/index.json ================================================ { "defaultTitle": "边绑定", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/donut-transfer/data.js ================================================ const data = { nodes: [ { id: "person A", label: "person A", // the attributes for drawing donut donutAttrs: { income: 10, outcome: 20, unknown: 25, }, }, { id: "person B", label: "person B", donutAttrs: { income: 20, outcome: 10, unknown: 5, }, }, { id: "person C", label: "person C", donutAttrs: { income: 200, outcome: 20, unknown: 25, }, }, { id: "person D", label: "person D", donutAttrs: { income: 50, outcome: 10, unknown: 15, }, }, { id: "person E", label: "person E", donutAttrs: { income: 80, outcome: 40, unknown: 45, }, }, { id: "person F", label: "person F", donutAttrs: { income: 90, outcome: 110, unknown: 15, }, }, ], edges: [ { source: "person C", target: "person F", size: 10 }, { source: "person B", target: "person A", size: 5 }, { source: "person D", target: "person E", size: 20 }, { source: "person D", target: "person C", size: 5 }, { source: "person B", target: "person C", size: 10 }, { source: "person A", target: "person C", size: 5 }, ], }; data.edges.forEach((edge) => { edge.label = `Transfer $${edge.size}`; }); const colors = { income: "#61DDAA", outcome: "#F08BB4", unknown: "#65789B", }; data.nodes.forEach((node) => { node.donutColorMap = colors; node.size = 0; Object.keys(node.donutAttrs).forEach((key) => { node.size += node.donutAttrs[key]; }); node.size = Math.sqrt(node.size) * 5; }); const legendData = { nodes: [ { id: "income", label: "Income", order: 0, style: { fill: "#61DDAA", }, }, { id: "outcome", label: "Outcome", order: 2, style: { fill: "#F08BB4", }, }, { id: "unknown", label: "Unknown", order: 2, style: { fill: "#65789B", }, }, ], }; export { data, legendData }; ================================================ FILE: packages/examples-alipay/pages/plugins/donut-transfer/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-alipay/pages/plugins/donut-transfer/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/donut-transfer/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { data, legendData } from "./data"; import { Legend } from "@antv/f6-plugin"; import radialLayout from "@antv/f6/dist/extends/layout/radialLayout"; F6.registerLayout("radial", radialLayout); /** * donutTransfer */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const legend = new Legend({ width: 300, height: 80, offsetY: 0, offsetX: 0, data: legendData, align: "center", layout: "horizontal", // vertical position: "top-left", padding: 10, margin: 0, containerStyle: { fill: "#ccc", lineWidth: 1, }, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: false, plugins: [legend], // 这里的plugin不知道能不能用 modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", focusNode: "li", linkDistance: 200, unitRadius: 200, }, defaultEdge: { style: { endArrow: true, }, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, }, }, }, defaultNode: { type: "donut", style: { lineWidth: 0, }, labelCfg: { position: "bottom", }, }, }); this.graph.data(data); this.graph.render(); this.graph.get("canvas").set("localRefresh", false); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/donut-transfer/index.json ================================================ { "defaultTitle": "图例", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/edge-filter/data.js ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, { id: "Gribier", x: 437.51920169330805, y: 160.14388411785757, }, { id: "Jondrette", x: 510.1406569699257, y: 327.7456828911454, }, { id: "Mme.Burgon", x: 466.0856874797108, y: 368.0210264990602, }, { id: "Gavroche", x: 393.6973181801981, y: 380.40382743216634, }, { id: "Gillenormand", x: 338.1148595335302, y: 286.4434006942807, }, { id: "Magnon", x: 277.12320020410266, y: 317.4384382481713, }, { id: "Mlle.Gillenormand", x: 257.52167498720337, y: 306.4604520400414, }, { id: "Mme.Pontmercy", x: 307.71325168392366, y: 318.0074114921048, }, { id: "Mlle.Vaubois", x: 197.63137784390082, y: 325.2999365859076, }, { id: "Lt.Gillenormand", x: 294.4105849543593, y: 296.53686533697186, }, { id: "Marius", x: 336.3436812430268, y: 350.8376519695578, }, { id: "BaronessT", x: 390.6807729530675, y: 322.9175698803163, }, { id: "Mabeuf", x: 366.77554563642803, y: 445.26666512175433, }, { id: "Enjolras", x: 376.9421415192702, y: 371.1750781444891, }, { id: "Combeferre", x: 397.0516872015465, y: 416.38478793328625, }, { id: "Prouvaire", x: 309.0241345496318, y: 426.44215271462605, }, { id: "Feuilly", x: 314.71137563489117, y: 456.80172690673896, }, { id: "Courfeyrac", x: 332.8405296045364, y: 435.8881866127797, }, { id: "Bahorel", x: 343.1268360879219, y: 466.9404473411801, }, { id: "Bossuet", x: 305.84814130923144, y: 382.89355947309724, }, { id: "Joly", x: 371.447442010866, y: 415.99688422022257, }, { id: "Grantaire", x: 370.72651876919826, y: 466.96671298340794, }, { id: "MotherPlutarch", x: 424.04457501182867, y: 461.9373924104361, }, { id: "Gueulemer", x: 344.1315821958891, y: 323.7890765583486, }, { id: "Babet", x: 367.3969014122835, y: 319.2359576043117, }, { id: "Claquesous", x: 303.23885194199465, y: 347.8041412708572, }, { id: "Montparnasse", x: 322.6528688110919, y: 330.01757397802925, }, { id: "Toussaint", x: 306.6921797724685, y: 277.05255454452566, }, { id: "Child1", x: 361.1652068827243, y: 387.9769951347244, }, { id: "Child2", x: 415.98942162128606, y: 432.37341762016945, }, { id: "Brujon", x: 330.44198511493056, y: 394.6025799878689, }, { id: "Mme.Hucheloup", x: 394.43875881505835, y: 450.4056149101193, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/edge-filter/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/edge-filter/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/edge-filter/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import { EdgeFilterLens } from "@antv/f6-plugin"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; data.edges.forEach((edge) => { edge.color = "#aaa"; edge.size = 2; edge.style = { opacity: 0.7, }; edge.label = "a"; }); const filterConfigs = { trigger: "drag", showLabel: "edge", r: 60, }; const filterLens = new EdgeFilterLens(filterConfigs); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, fitView: true, width, height, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [filterLens], defaultEdge: { labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 2, }, }, }, defaultNode: { size: 15, color: "#5B8FF9", style: { lineWidth: 2, fill: "#C6E5FF", }, }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); this.graph.getEdges().forEach((edge) => { edge .getContainer() .getChildren() .forEach((shape) => { if (shape.get("type") === "text") shape.set("visible", false); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/edge-filter/index.json ================================================ { "defaultTitle": "边过滤", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/fisheye/data.js ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, { id: "Gribier", x: 437.51920169330805, y: 160.14388411785757, }, { id: "Jondrette", x: 510.1406569699257, y: 327.7456828911454, }, { id: "Mme.Burgon", x: 466.0856874797108, y: 368.0210264990602, }, { id: "Gavroche", x: 393.6973181801981, y: 380.40382743216634, }, { id: "Gillenormand", x: 338.1148595335302, y: 286.4434006942807, }, { id: "Magnon", x: 277.12320020410266, y: 317.4384382481713, }, { id: "Mlle.Gillenormand", x: 257.52167498720337, y: 306.4604520400414, }, { id: "Mme.Pontmercy", x: 307.71325168392366, y: 318.0074114921048, }, { id: "Mlle.Vaubois", x: 197.63137784390082, y: 325.2999365859076, }, { id: "Lt.Gillenormand", x: 294.4105849543593, y: 296.53686533697186, }, { id: "Marius", x: 336.3436812430268, y: 350.8376519695578, }, { id: "BaronessT", x: 390.6807729530675, y: 322.9175698803163, }, { id: "Mabeuf", x: 366.77554563642803, y: 445.26666512175433, }, { id: "Enjolras", x: 376.9421415192702, y: 371.1750781444891, }, { id: "Combeferre", x: 397.0516872015465, y: 416.38478793328625, }, { id: "Prouvaire", x: 309.0241345496318, y: 426.44215271462605, }, { id: "Feuilly", x: 314.71137563489117, y: 456.80172690673896, }, { id: "Courfeyrac", x: 332.8405296045364, y: 435.8881866127797, }, { id: "Bahorel", x: 343.1268360879219, y: 466.9404473411801, }, { id: "Bossuet", x: 305.84814130923144, y: 382.89355947309724, }, { id: "Joly", x: 371.447442010866, y: 415.99688422022257, }, { id: "Grantaire", x: 370.72651876919826, y: 466.96671298340794, }, { id: "MotherPlutarch", x: 424.04457501182867, y: 461.9373924104361, }, { id: "Gueulemer", x: 344.1315821958891, y: 323.7890765583486, }, { id: "Babet", x: 367.3969014122835, y: 319.2359576043117, }, { id: "Claquesous", x: 303.23885194199465, y: 347.8041412708572, }, { id: "Montparnasse", x: 322.6528688110919, y: 330.01757397802925, }, { id: "Toussaint", x: 306.6921797724685, y: 277.05255454452566, }, { id: "Child1", x: 361.1652068827243, y: 387.9769951347244, }, { id: "Child2", x: 415.98942162128606, y: 432.37341762016945, }, { id: "Brujon", x: 330.44198511493056, y: 394.6025799878689, }, { id: "Mme.Hucheloup", x: 394.43875881505835, y: 450.4056149101193, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/fisheye/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/fisheye/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/fisheye/index.js ================================================ import F6 from "@antv/f6"; import data from "./data"; import { wrapContext } from "../../../common/utils/context"; import { Fisheye } from "@antv/f6-plugin"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const fisheye = new Fisheye({ r: 200, trigger: "drag", }); const colors = [ "#8FE9FF", "#87EAEF", "#FFC9E3", "#A7C2FF", "#FFA1E3", "#FFE269", "#BFCFEE", "#FFA0C5", "#D5FF86", ]; data.nodes.forEach((node) => { node.label = node.id; node.size = Math.random() * 30 + 10; node.style = { fill: colors[Math.floor(Math.random() * 9)], lineWidth: 0, }; }); this.graph = new F6.Graph({ renderer: this.renderer, container: this.canvas, context: this.ctx, pixelRatio, width, height, fitView: true, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [fisheye], }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/fisheye/index.json ================================================ { "defaultTitle": "鱼眼", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/menu/data.js ================================================ const data = { nodes: [ { id: "node1", label: "node1", x: 200, y: 100, type: "rect", }, { id: "node2", label: "node2", x: 250, y: 250, type: "rect", }, { id: "node3", label: "node3", x: 350, y: 100, type: "rect", }, ], edges: [ { source: "node1", target: "node2", label: "Test Label", }, { source: "node1", target: "node3", label: "Test Label 2", }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/menu/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/menu/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/menu/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import { Menu } from "@antv/f6-plugin"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const contextMenu = new Menu({ getContent(evt) { let header; if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) { header = "Canvas ContextMenu"; } else if (evt.item) { const itemType = evt.item.getType(); header = `${itemType.toUpperCase()} ContextMenu`; } return `
${header}
div 1
div 2
`; }, getCss: () => { return ` .container { opacity: 0.9; width: 150; padding: 10 8; border: 1 solid #e2e2e2; } .header { padding-bottom: 10; font-weight: bold; } .li { padding-bottom: 10; } `; }, handleMenuClick: (target) => { my.alert({ title: `点击了: ${target.title}`, }); }, // offsetX and offsetY include the padding of the parent container // 需要加上父级容器的 padding-left 16 与自身偏移量 10 offsetX: 0, // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10 offsetY: 0, // the types of items that allow the menu show up // 在哪些类型的元素上响应 itemTypes: ["node", "edge", "canvas"], }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, fitView: true, plugins: [contextMenu], defaultNode: { size: [80, 40], type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", lineAppendWidth: 3, // Enlarge the range the edge to be hitted }, labelCfg: { autoRotate: true, style: { // A white stroke with width 5 helps show the label more clearly avoiding the interference of the overlapped edge stroke: "white", lineWidth: 5, }, }, }, modes: { default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/menu/index.json ================================================ { "defaultTitle": "上下文菜单", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/mini-map/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/mini-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/mini-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/mini-map/index.js ================================================ import { MiniMap } from "@antv/f6-plugin"; import data from "./data"; import F6 from "@antv/f6"; Page({ data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const sys = my.getSystemInfoSync(); const { windowWidth, screenHeight, titleBarHeight, statusBarHeight, pixelRatio, } = sys; this.setData({ width: windowWidth, height: screenHeight - titleBarHeight - statusBarHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { const miniMap = new MiniMap({ className: "custom-container", viewportClassName: "custom-viewport", getCss: () => { return ` .custom-container { top: 0; background: #eee; border: 1 solid #333; } .custom-viewport { border:1 solid blue; } `; }, }); const { width, height, pixelRatio } = this.data; console.log("------->", ctx, rect, canvas, renderer); this.graph = new F6.Graph({ context: ctx, width, height, pixelRatio, linkCenter: true, renderer, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [miniMap], }); this.graph.data(data); this.graph.render(); // 目前在使用plugin时,需要关闭局部刷新 this.graph.get("canvas").set("localRefresh", false); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/mini-map/index.json ================================================ { "defaultTitle": "miniMap", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/snap-line/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/snap-line/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/snap-line/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/snap-line/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import { SnapLine } from "@antv/f6-plugin"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const snapLine = new SnapLine(); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [snapLine], }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/snap-line/index.json ================================================ { "defaultTitle": "边绑定", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/timebar/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/timebar/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/timebar/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { TimeBar } from "@antv/f6-plugin"; /** * basicArcDiagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = { nodes: [], edges: [], }; for (let i = 0; i < 50; i++) { const id = `node-${i}`; data.nodes.push({ id, date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); data.edges.push({ source: `node-${Math.round(Math.random() * 90)}`, target: `node-${Math.round(Math.random() * 90)}`, }); } const timeBarData = []; for (let i = 0; i < 50; i++) { timeBarData.push({ date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); } const timebar = new TimeBar({ x: 0, y: 0, width, padding: 0, type: "simple", data: timeBarData, }); this.graph = new F6.Graph({ renderer: this.renderer, container: this.canvas, context: this.ctx, width, height, pixelRatio, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, animate: false, defaultNode: { size: 30, }, plugins: [timebar], }); this.graph.get("canvas").set("localRefresh", false); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/timebar/index.json ================================================ { "defaultTitle": "时间轴", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/timebar/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import { TimeBar } from "@antv/f6-plugin"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; const data = { nodes: [], edges: [], }; for (let i = 0; i < 50; i++) { const id = `node-${i}`; data.nodes.push({ id, date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); data.edges.push({ source: `node-${Math.round(Math.random() * 90)}`, target: `node-${Math.round(Math.random() * 90)}`, }); } const timeBarData = []; for (let i = 0; i < 50; i++) { timeBarData.push({ date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); } const timebar = new TimeBar({ x: 0, y: 0, width, padding: 0, type: "simple", data: timeBarData, }); let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, animate: false, defaultNode: { size: 30, }, plugins: [timebar], } as any); graph.get("canvas").set("localRefresh", false); graph.data(data); graph.render(); graph.fitView(); } }, []); return
; }; ================================================ FILE: packages/examples-alipay/pages/plugins/tool-tip/data.js ================================================ export default { id: "g1", name: "Name1", count: 123456, label: "538.90", currency: "Yuan", rate: 1.0, status: "B", variableName: "V1", variableValue: 0.341, variableUp: false, children: [ { id: "g12", name: "Deal with LONG label LONG label LONG label LONG label", count: 123456, label: "338.00", rate: 0.627, status: "R", currency: "Yuan", variableName: "V2", variableValue: 0.179, variableUp: true, children: [ { id: "g121", name: "Name3", collapsed: true, count: 123456, label: "138.00", rate: 0.123, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.27, variableUp: true, children: [ { id: "g1211", name: "Name4", count: 123456, label: "138.00", rate: 1.0, status: "B", currency: "Yuan", variableName: "V1", variableValue: 0.164, variableUp: false, children: [], }, ], }, { id: "g122", name: "Name5", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.259, variableUp: true, children: [ { id: "g1221", name: "Name6", count: 123456, label: "40.00", rate: 0.4, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.135, variableUp: true, children: [ { id: "g12211", name: "Name6-1", count: 123456, label: "40.00", rate: 1.0, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.181, variableUp: true, children: [], }, ], }, { id: "g1222", name: "Name7", count: 123456, label: "60.00", rate: 0.6, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.239, variableUp: false, children: [], }, ], }, { id: "g123", name: "Name8", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [ { id: "g1231", name: "Name8-1", count: 123456, label: "100.00", rate: 1.0, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [], }, ], }, ], }, { id: "g13", name: "Name9", count: 123456, label: "100.90", rate: 0.187, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.221, variableUp: true, children: [ { id: "g131", name: "Name10", count: 123456, label: "33.90", rate: 0.336, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.12, variableUp: true, children: [], }, { id: "g132", name: "Name11", count: 123456, label: "67.00", rate: 0.664, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.241, variableUp: false, children: [], }, ], }, { id: "g14", name: "Name12", count: 123456, label: "100.00", rate: 0.186, status: "G", currency: "Yuan", variableName: "V2", variableValue: 0.531, variableUp: true, children: [], }, ], }; ================================================ FILE: packages/examples-alipay/pages/plugins/tool-tip/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/plugins/tool-tip/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/tool-tip/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import mockData from "./data"; import { Tooltip } from "@antv/f6-plugin"; /** * decisionTree */ const colors = { B: "#5B8FF9", R: "#F46649", Y: "#EEBC20", G: "#5BD8A6", DI: "#A7A7A7", }; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 默认配置 const defaultConfig = { width, height, modes: { default: ["zoom-canvas", "drag-canvas"], }, fitView: true, animate: true, defaultNode: { type: "flow-rect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#CED4D9", }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 300, getHeight: () => { return 60; }, }, }; // 组件props const props = { data: mockData, config: { padding: [20, 50], defaultLevel: 3, defaultZoom: 0.8, modes: { default: ["zoom-canvas", "drag-canvas"] }, }, }; // 自定义节点、边 const registerFn = () => { /** * 自定义节点 */ F6.registerNode( "flow-rect", { shapeType: "flow-rect", draw(cfg, group) { const { name = "", variableName, variableValue, variableUp, label, collapsed, currency, status, // rate, } = cfg; const grey = "#CED4D9"; // 逻辑不应该在这里判断 const rectConfig = { width: 202, height: 60, lineWidth: 1, fontSize: 12, fill: "#fff", radius: 4, stroke: grey, opacity: 1, }; const nodeOrigin = { x: -rectConfig.width / 2, y: -rectConfig.height / 2, }; const textConfig = { textAlign: "left", textBaseline: "bottom", }; const rect = group.addShape("rect", { attrs: { x: nodeOrigin.x, y: nodeOrigin.y, ...rectConfig, }, }); const rectBBox = rect.getBBox(); // label title group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: 20 + nodeOrigin.y, text: name.length > 28 ? `${name.substr(0, 28)}...` : name, fontSize: 12, opacity: 0.85, fill: "#000", cursor: "pointer", }, name: "name-shape", }); // price const price = group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: rectBBox.maxY - 12, text: label, fontSize: 16, fill: "#000", opacity: 0.85, }, }); // label currency group.addShape("text", { attrs: { ...textConfig, x: price.getBBox().maxX + 5, y: rectBBox.maxY - 12, text: currency, fontSize: 12, fill: "#000", opacity: 0.75, }, }); // percentage const percentText = group.addShape("text", { attrs: { ...textConfig, x: rectBBox.maxX - 8, y: rectBBox.maxY - 12, text: `${((variableValue || 0) * 100).toFixed(2)}%`, fontSize: 12, textAlign: "right", fill: colors[status], }, }); // percentage triangle const symbol = variableUp ? "triangle" : "triangle-down"; const triangle = group.addShape("marker", { attrs: { ...textConfig, x: percentText.getBBox().minX - 10, y: rectBBox.maxY - 12 - 6, symbol, r: 6, fill: colors[status], }, }); // variable name group.addShape("text", { attrs: { ...textConfig, x: triangle.getBBox().minX - 4, y: rectBBox.maxY - 12, text: variableName, fontSize: 12, textAlign: "right", fill: "#000", opacity: 0.45, }, }); // bottom line background // const bottomBackRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rectConfig.width, // height: 4, // radius: [0, 0, rectConfig.radius, rectConfig.radius], // fill: '#E0DFE3', // }, // }); // bottom percent // const bottomRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rate * rectBBox.width, // height: 4, // radius: [0, 0, 0, rectConfig.radius], // fill: colors[status], // }, // }); // collapse rect if (cfg.children && cfg.children.length) { group.addShape("rect", { attrs: { x: rectConfig.width / 2 - 8, y: -8, width: 16, height: 16, stroke: "rgba(0, 0, 0, 0.25)", cursor: "pointer", fill: "#fff", }, name: "collapse-back", modelId: cfg.id, }); // collpase text group.addShape("text", { attrs: { x: rectConfig.width / 2, y: -1, textAlign: "center", textBaseline: "middle", text: collapsed ? "+" : "-", fontSize: 16, cursor: "pointer", fill: "rgba(0, 0, 0, 0.25)", }, name: "collapse-text", modelId: cfg.id, }); } this.drawLinkPoints(cfg, group); return rect; }, update(cfg, item) { const group = item.getContainer(); this.updateLinkPoints(cfg, group); }, setState(name, value, item) { if (name === "collapse") { const group = item.getContainer(); const collapseText = group.find( (e) => e.get("name") === "collapse-text", ); if (collapseText) { if (!value) { collapseText.attr({ text: "-", }); } else { collapseText.attr({ text: "+", }); } } } }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "rect", ); F6.registerEdge( "flow-cubic", { getControlPoints(cfg) { let { controlPoints } = cfg; // 指定controlPoints if (!controlPoints || !controlPoints.length) { const { startPoint, endPoint, sourceNode, targetNode } = cfg; const { x: startX, y: startY, coefficientX, coefficientY, } = sourceNode ? sourceNode.getModel() : startPoint; const { x: endX, y: endY } = targetNode ? targetNode.getModel() : endPoint; let curveStart = (endX - startX) * coefficientX; let curveEnd = (endY - startY) * coefficientY; curveStart = curveStart > 40 ? 40 : curveStart; curveEnd = curveEnd < -30 ? curveEnd : -30; controlPoints = [ { x: startPoint.x + curveStart, y: startPoint.y }, { x: endPoint.x + curveEnd, y: endPoint.y }, ]; } return controlPoints; }, getPath(points) { const path = []; path.push(["M", points[0].x, points[0].y]); path.push([ "C", points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y, ]); return path; }, }, "single-line", ); }; registerFn(); const { config } = props; const tooltip = new Tooltip({ trigger: "press", // TODO: _f2.default.Tooltip is not a constructor // offsetX and offsetY include the padding of the parent container // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { // outDiv.style.padding = '0px 0px 20px 0px'; return `
Custom Content
Type: ${e.item.getType()}
Label: ${ e.item.getModel().label || e.item.getModel().id }
`; }, getCss: () => ` .f6-tooltip-container { position: absolute; width: 150; border: 1 solid #e2e2e2; border-radius: 4; font-size: 12; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10 8; } .f6-tooltip-container div{ height: 20; } .tooltip-type { padding: 0; margin: 0; } .tooltip-id { color: #531dab; } `, shouldBegin: (e) => { if (e.target.get("name") === "name-shape") return true; return true; }, }); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, ...defaultConfig, ...config, plugins: [tooltip], extra: { createImage: this.canvas && this.canvas.createImage, requestAnimationFrame: this.canvas.requestAnimationFrame, cancelAnimationFrame: this.canvas.cancelAnimationFrame, }, }); console.log( this.canvas.requestAnimationFrame, this.canvas.cancelAnimationFrame, ); this.graph.data(mockData); this.graph.render(); this.graph.fitView(); this.graph.zoom(config.defaultZoom || 1); const handleCollapse = (e) => { const { target } = e; const id = target.get("modelId"); const item = this.graph.findById(id); const nodeModel = item.getModel(); nodeModel.collapsed = !nodeModel.collapsed; this.graph.layout(); this.graph.setItemState(item, "collapse", nodeModel.collapsed); }; this.graph.on("collapse-text:tap", (e) => { handleCollapse(e); }); this.graph.on("collapse-back:tap", (e) => { handleCollapse(e); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/tool-tip/index.json ================================================ { "defaultTitle": "提示框", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/plugins/zoom-slider/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-alipay/pages/plugins/zoom-slider/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/plugins/zoom-slider/index.js ================================================ import { ZoomSlider } from "@antv/f6-plugin"; import data from "./data"; import F6 from "@antv/f6"; Page({ data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { const zoomSlider = new ZoomSlider(); const { width, height, pixelRatio } = this.data; console.log("------->", ctx, rect, canvas, renderer); this.graph = new F6.Graph({ context: ctx, width, height, pixelRatio, linkCenter: true, renderer, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [zoomSlider], }); this.graph.data(data); this.graph.render(); // 目前在使用plugin时,需要关闭局部刷新 this.graph.get("canvas").set("localRefresh", false); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/plugins/zoom-slider/index.json ================================================ { "defaultTitle": "ZoomSlider", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/custom-flow/data.js ================================================ export default { nodes: [ { id: "1", label: "Company1", }, { id: "2", label: "Company2", }, { id: "3", label: "Company3", }, { id: "4", label: "Company4", }, { id: "5", label: "Company5", }, { id: "6", label: "Company6", }, { id: "7", label: "Company7", }, { id: "8", label: "Company8", }, { id: "9", label: "Company9", }, ], edges: [ { source: "1", target: "2", data: { type: "A", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "3", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "2", target: "5", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "5", target: "6", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "3", target: "4", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "4", target: "7", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "8", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "9", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, ], }; ================================================ FILE: packages/examples-alipay/pages/scene-case/custom-flow/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-alipay/pages/scene-case/custom-flow/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/custom-flow/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * customFlow */ import { isObject } from "@antv/util"; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); const colorMap = { A: "#72CC4A", B: "#1A91FF", C: "#FFAA15", }; F6.registerNode( "round-rect", { drawShape: function drawShape(cfg, group) { const { width } = cfg.style; const { stroke } = cfg.style; const rect = group.addShape("rect", { attrs: { x: -width / 2, y: -15, width, height: 30, radius: 15, stroke, lineWidth: 1.2, fillOpacity: 1, }, name: "rect-shape", }); group.addShape("circle", { attrs: { x: -width / 2, y: 0, r: 3, fill: stroke, }, name: "circle-shape", }); group.addShape("circle", { attrs: { x: width / 2, y: 0, r: 3, fill: stroke, }, name: "circle-shape2", }); return rect; }, getAnchorPoints: function getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, update: function update(cfg, item) { const group = item.getContainer(); const children = group.get("children"); const node = children[0]; const circleLeft = children[1]; const circleRight = children[2]; const { stroke } = cfg.style; if (stroke) { node.attr("stroke", stroke); circleLeft.attr("fill", stroke); circleRight.attr("fill", stroke); } }, }, "single-node", ); F6.registerEdge("fund-polyline", { itemType: "edge", draw: function draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const { stroke } = cfg.style; const Ydiff = endPoint.y - startPoint.y; const slope = Ydiff !== 0 ? Math.min(500 / Math.abs(Ydiff), 20) : 0; const cpOffset = slope > 15 ? 0 : 16; const offset = Ydiff < 0 ? cpOffset : -cpOffset; const line1EndPoint = { x: startPoint.x + slope, y: endPoint.y + offset, }; const line2StartPoint = { x: line1EndPoint.x + cpOffset, y: endPoint.y, }; // 控制点坐标 const controlPoint = { x: ((line1EndPoint.x - startPoint.x) * (endPoint.y - startPoint.y)) / (line1EndPoint.y - startPoint.y) + startPoint.x, y: endPoint.y, }; let path = [ ["M", startPoint.x, startPoint.y], ["L", line1EndPoint.x, line1EndPoint.y], [ "Q", controlPoint.x, controlPoint.y, line2StartPoint.x, line2StartPoint.y, ], ["L", endPoint.x, endPoint.y], ]; if (Math.abs(Ydiff) <= 5) { path = [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x, endPoint.y], ]; } const endArrow = cfg.style && cfg.style.endArrow ? cfg.style.endArrow : false; // 不支持?. if (isObject(endArrow)) endArrow.fill = stroke; const line = group.addShape("path", { attrs: { path, stroke: colorMap[cfg.data && cfg.data.type], lineWidth: 1.2, endArrow, }, name: "path-shape", }); const labelLeftOffset = 0; const labelTopOffset = 8; // amount const amount = group.addShape("text", { attrs: { text: cfg.data && cfg.data.amount, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y - labelTopOffset - 2, fontSize: 14, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-amount", }); // type group.addShape("text", { attrs: { text: cfg.data && cfg.data.type, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y - labelTopOffset - amount.getBBox().height - 2, fontSize: 10, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-type", }); // date group.addShape("text", { attrs: { text: cfg.data && cfg.data.date, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y + labelTopOffset + 4, fontSize: 12, fontWeight: 300, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-date", }); return line; }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "dagre", rankdir: "LR", nodesep: 30, ranksep: 100, }, modes: { default: ["drag-canvas"], }, defaultNode: { type: "round-rect", labelCfg: { style: { fill: "#000000A6", fontSize: 10, }, }, style: { stroke: "#72CC4A", width: 150, }, }, defaultEdge: { type: "fund-polyline", }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); const edges = this.graph.getEdges(); edges.forEach(function (edge) { const line = edge.getKeyShape(); const stroke = line.attr("stroke"); const targetNode = edge.getTarget(); targetNode.update({ style: { stroke, }, }); }); this.graph.paint(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/custom-flow/index.json ================================================ { "defaultTitle": "自定义流向图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/decision-tree/data.js ================================================ export default { id: "g1", name: "Name1", count: 123456, label: "538.90", currency: "Yuan", rate: 1.0, status: "B", variableName: "V1", variableValue: 0.341, variableUp: false, children: [ { id: "g12", name: "Deal with LONG label LONG label LONG label LONG label", count: 123456, label: "338.00", rate: 0.627, status: "R", currency: "Yuan", variableName: "V2", variableValue: 0.179, variableUp: true, children: [ { id: "g121", name: "Name3", collapsed: true, count: 123456, label: "138.00", rate: 0.123, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.27, variableUp: true, children: [ { id: "g1211", name: "Name4", count: 123456, label: "138.00", rate: 1.0, status: "B", currency: "Yuan", variableName: "V1", variableValue: 0.164, variableUp: false, children: [], }, ], }, { id: "g122", name: "Name5", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.259, variableUp: true, children: [ { id: "g1221", name: "Name6", count: 123456, label: "40.00", rate: 0.4, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.135, variableUp: true, children: [ { id: "g12211", name: "Name6-1", count: 123456, label: "40.00", rate: 1.0, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.181, variableUp: true, children: [], }, ], }, { id: "g1222", name: "Name7", count: 123456, label: "60.00", rate: 0.6, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.239, variableUp: false, children: [], }, ], }, { id: "g123", name: "Name8", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [ { id: "g1231", name: "Name8-1", count: 123456, label: "100.00", rate: 1.0, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [], }, ], }, ], }, { id: "g13", name: "Name9", count: 123456, label: "100.90", rate: 0.187, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.221, variableUp: true, children: [ { id: "g131", name: "Name10", count: 123456, label: "33.90", rate: 0.336, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.12, variableUp: true, children: [], }, { id: "g132", name: "Name11", count: 123456, label: "67.00", rate: 0.664, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.241, variableUp: false, children: [], }, ], }, { id: "g14", name: "Name12", count: 123456, label: "100.00", rate: 0.186, status: "G", currency: "Yuan", variableName: "V2", variableValue: 0.531, variableUp: true, children: [], }, ], }; ================================================ FILE: packages/examples-alipay/pages/scene-case/decision-tree/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/scene-case/decision-tree/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/decision-tree/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import mockData from "./data"; /** * decisionTree */ const colors = { B: "#5B8FF9", R: "#F46649", Y: "#EEBC20", G: "#5BD8A6", DI: "#A7A7A7", }; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 默认配置 const defaultConfig = { width, height, modes: { default: ["zoom-canvas", "drag-canvas"], }, fitView: true, animate: true, defaultNode: { type: "flow-rect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#CED4D9", }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 300, getHeight: () => { return 60; }, }, }; // 组件props const props = { data: mockData, config: { padding: [20, 50], defaultLevel: 3, defaultZoom: 0.8, modes: { default: ["zoom-canvas", "drag-canvas"] }, }, }; // 自定义节点、边 const registerFn = () => { /** * 自定义节点 */ F6.registerNode( "flow-rect", { shapeType: "flow-rect", draw(cfg, group) { const { name = "", variableName, variableValue, variableUp, label, collapsed, currency, status, // rate, } = cfg; const grey = "#CED4D9"; // 逻辑不应该在这里判断 const rectConfig = { width: 202, height: 60, lineWidth: 1, fontSize: 12, fill: "#fff", radius: 4, stroke: grey, opacity: 1, }; const nodeOrigin = { x: -rectConfig.width / 2, y: -rectConfig.height / 2, }; const textConfig = { textAlign: "left", textBaseline: "bottom", }; const rect = group.addShape("rect", { attrs: { x: nodeOrigin.x, y: nodeOrigin.y, ...rectConfig, }, }); const rectBBox = rect.getBBox(); // label title group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: 20 + nodeOrigin.y, text: name.length > 28 ? `${name.substr(0, 28)}...` : name, fontSize: 12, opacity: 0.85, fill: "#000", cursor: "pointer", }, name: "name-shape", }); // price const price = group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: rectBBox.maxY - 12, text: label, fontSize: 16, fill: "#000", opacity: 0.85, }, }); // label currency group.addShape("text", { attrs: { ...textConfig, x: price.getBBox().maxX + 5, y: rectBBox.maxY - 12, text: currency, fontSize: 12, fill: "#000", opacity: 0.75, }, }); // percentage const percentText = group.addShape("text", { attrs: { ...textConfig, x: rectBBox.maxX - 8, y: rectBBox.maxY - 12, text: `${((variableValue || 0) * 100).toFixed(2)}%`, fontSize: 12, textAlign: "right", fill: colors[status], }, }); // percentage triangle const symbol = variableUp ? "triangle" : "triangle-down"; const triangle = group.addShape("marker", { attrs: { ...textConfig, x: percentText.getBBox().minX - 10, y: rectBBox.maxY - 12 - 6, symbol, r: 6, fill: colors[status], }, }); // variable name group.addShape("text", { attrs: { ...textConfig, x: triangle.getBBox().minX - 4, y: rectBBox.maxY - 12, text: variableName, fontSize: 12, textAlign: "right", fill: "#000", opacity: 0.45, }, }); // bottom line background // const bottomBackRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rectConfig.width, // height: 4, // radius: [0, 0, rectConfig.radius, rectConfig.radius], // fill: '#E0DFE3', // }, // }); // bottom percent // const bottomRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rate * rectBBox.width, // height: 4, // radius: [0, 0, 0, rectConfig.radius], // fill: colors[status], // }, // }); // collapse rect if (cfg.children && cfg.children.length) { group.addShape("rect", { attrs: { x: rectConfig.width / 2 - 8, y: -8, width: 16, height: 16, stroke: "rgba(0, 0, 0, 0.25)", cursor: "pointer", fill: "#fff", }, name: "collapse-back", modelId: cfg.id, }); // collpase text group.addShape("text", { attrs: { x: rectConfig.width / 2, y: -1, textAlign: "center", textBaseline: "middle", text: collapsed ? "+" : "-", fontSize: 16, cursor: "pointer", fill: "rgba(0, 0, 0, 0.25)", }, name: "collapse-text", modelId: cfg.id, }); } this.drawLinkPoints(cfg, group); return rect; }, update(cfg, item) { const group = item.getContainer(); this.updateLinkPoints(cfg, group); }, setState(name, value, item) { if (name === "collapse") { const group = item.getContainer(); const collapseText = group.find( (e) => e.get("name") === "collapse-text", ); if (collapseText) { if (!value) { collapseText.attr({ text: "-", }); } else { collapseText.attr({ text: "+", }); } } } }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "rect", ); F6.registerEdge( "flow-cubic", { getControlPoints(cfg) { let { controlPoints } = cfg; // 指定controlPoints if (!controlPoints || !controlPoints.length) { const { startPoint, endPoint, sourceNode, targetNode } = cfg; const { x: startX, y: startY, coefficientX, coefficientY, } = sourceNode ? sourceNode.getModel() : startPoint; const { x: endX, y: endY } = targetNode ? targetNode.getModel() : endPoint; let curveStart = (endX - startX) * coefficientX; let curveEnd = (endY - startY) * coefficientY; curveStart = curveStart > 40 ? 40 : curveStart; curveEnd = curveEnd < -30 ? curveEnd : -30; controlPoints = [ { x: startPoint.x + curveStart, y: startPoint.y }, { x: endPoint.x + curveEnd, y: endPoint.y }, ]; } return controlPoints; }, getPath(points) { const path = []; path.push(["M", points[0].x, points[0].y]); path.push([ "C", points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y, ]); return path; }, }, "single-line", ); }; registerFn(); const { onInit, config } = props; console.log(onInit); const tooltip = new F6.Tooltip({ // TODO: _f2.default.Tooltip is not a constructor // offsetX and offsetY include the padding of the parent container offsetX: 20, offsetY: 30, // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { const outDiv = document.createElement("div"); // outDiv.style.padding = '0px 0px 20px 0px'; const nodeName = e.item.getModel().name; let formatedNodeName = ""; for (let i = 0; i < nodeName.length; i++) { formatedNodeName = `${formatedNodeName}${nodeName[i]}`; if (i !== 0 && i % 20 === 0) formatedNodeName = `${formatedNodeName}
`; } outDiv.innerHTML = `${formatedNodeName}`; return outDiv; }, shouldBegin: (e) => { if (e.target.get("name") === "name-shape") return true; return false; }, }); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, ...defaultConfig, ...config, plugins: [tooltip], }); this.graph.data(mockData); this.graph.render(); this.graph.fitView(); this.graph.zoom(config.defaultZoom || 1); const handleCollapse = (e) => { const { target } = e; const id = target.get("modelId"); const item = this.graph.findById(id); const nodeModel = item.getModel(); nodeModel.collapsed = !nodeModel.collapsed; this.graph.layout(); this.graph.setItemState(item, "collapse", nodeModel.collapsed); }; this.graph.on("collapse-text:tap", (e) => { handleCollapse(e); }); this.graph.on("collapse-back:tap", (e) => { handleCollapse(e); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/decision-tree/index.json ================================================ { "defaultTitle": "决策树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/donut-transfer/data.js ================================================ const data = { nodes: [ { id: "person A", label: "person A", // the attributes for drawing donut donutAttrs: { income: 10, outcome: 20, unknown: 25, }, }, { id: "person B", label: "person B", donutAttrs: { income: 20, outcome: 10, unknown: 5, }, }, { id: "person C", label: "person C", donutAttrs: { income: 200, outcome: 20, unknown: 25, }, }, { id: "person D", label: "person D", donutAttrs: { income: 50, outcome: 10, unknown: 15, }, }, { id: "person E", label: "person E", donutAttrs: { income: 80, outcome: 40, unknown: 45, }, }, { id: "person F", label: "person F", donutAttrs: { income: 90, outcome: 110, unknown: 15, }, }, ], edges: [ { source: "person C", target: "person F", size: 10 }, { source: "person B", target: "person A", size: 5 }, { source: "person D", target: "person E", size: 20 }, { source: "person D", target: "person C", size: 5 }, { source: "person B", target: "person C", size: 10 }, { source: "person A", target: "person C", size: 5 }, ], }; data.edges.forEach((edge) => { edge.label = `Transfer $${edge.size}`; }); const colors = { income: "#61DDAA", outcome: "#F08BB4", unknown: "#65789B", }; data.nodes.forEach((node) => { node.donutColorMap = colors; node.size = 0; Object.keys(node.donutAttrs).forEach((key) => { node.size += node.donutAttrs[key]; }); node.size = Math.sqrt(node.size) * 5; }); const legendData = { nodes: [ { id: "income", label: "Income", order: 0, style: { fill: "#61DDAA", }, }, { id: "outcome", label: "Outcome", order: 2, style: { fill: "#F08BB4", }, }, { id: "unknown", label: "Unknown", order: 2, style: { fill: "#65789B", }, }, ], }; export { data, legendData }; ================================================ FILE: packages/examples-alipay/pages/scene-case/donut-transfer/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-alipay/pages/scene-case/donut-transfer/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/donut-transfer/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { data, legendData } from "./data"; /** * donutTransfer */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const legend = new F6.Legend({ data: legendData, align: "center", layout: "horizontal", // vertical position: "bottom-left", vertiSep: 12, horiSep: 24, offsetY: -24, padding: [4, 16, 8, 16], containerStyle: { fill: "#ccc", lineWidth: 1, }, title: " ", titleConfig: { offsetY: -8, }, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, plugins: [legend], // 这里的plugin不知道能不能用 modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", focusNode: "li", linkDistance: 200, unitRadius: 200, }, defaultEdge: { style: { endArrow: true, }, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, }, }, }, defaultNode: { type: "donut", style: { lineWidth: 0, }, labelCfg: { position: "bottom", }, }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/donut-transfer/index.json ================================================ { "defaultTitle": "甜甜圈转账图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/knowledge-tree-graph/data.js ================================================ export default { id: "200000004", tooltip: "Thing", label: "事物", description: null, descriptionZh: null, depth: 3, subTypeCount: 9, status: 0, children: [ { id: "500000061", tooltip: "Person", label: "自然人", description: null, descriptionZh: null, depth: 1, subTypeCount: 1, status: 0, children: [ { id: "707000085", tooltip: "FilmPerson", label: "电影人", description: null, descriptionZh: null, depth: 5, subTypeCount: 3, status: 1, children: [ { id: "707000090", tooltip: "FilmDirector", label: "电影导演", description: null, descriptionZh: null, depth: 0, subTypeCount: 0, status: 1, children: [], }, { id: "707000091", tooltip: "FilmWriter", label: "电影编剧", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "707000092", tooltip: "FilmStar", label: "电影主演", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, ], }, { id: "707000086", tooltip: "MusicPerson", label: "音乐人", description: null, descriptionZh: null, depth: 17, subTypeCount: 2, status: 1, children: [], }, ], }, { id: "200000005", tooltip: "Music", label: "音乐", description: null, descriptionZh: null, depth: 3, subTypeCount: 2, status: 1, children: [], }, { id: "707000128", tooltip: "Film", label: "电影", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [ { id: "7070032328", tooltip: "Comedy", label: "喜剧", description: null, descriptionZh: null, depth: 4, operation: "C", subTypeCount: 0, status: 1, children: [], }, ], }, { id: "707000095", tooltip: "FilmGenre", label: "电影类别", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "702000021", tooltip: "Organization", label: "机构", description: null, descriptionZh: null, depth: 47, subTypeCount: 1, status: 0, children: [ { id: "500000063", tooltip: "Company", label: "公司", description: null, descriptionZh: null, depth: 4, subTypeCount: 2, status: 1, children: [ { id: "707000093", tooltip: "FilmCompany", label: "电影公司", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "707000094", tooltip: "MusicCompany", label: "音乐公司", description: null, descriptionZh: null, depth: 2, subTypeCount: 0, status: 1, children: [], }, ], }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/scene-case/knowledge-tree-graph/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/scene-case/knowledge-tree-graph/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/knowledge-tree-graph/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import data from "./data"; /** * 知识图谱树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); const minWidth = 60; // TODO:这里需要定义两次,因为onLoad()里面传不到,updateChart()里面,如果定义在Page外面是不是就是全局的 const BaseConfig = { nameFontSize: 12, childCountWidth: 22, countMarginLeft: 0, itemPadding: 16, nameMarginLeft: 4, rootPadding: 18, }; F6.registerNode("treeNode", { draw: (cfg, group) => { const { label, collapsed, selected, children, depth } = cfg; const rootNode = depth === 0; const hasChildren = children && children.length !== 0; const { childCountWidth, countMarginLeft, itemPadding, nameMarginLeft, rootPadding, } = BaseConfig; let width = 0; const height = 28; const x = 0; const y = -height / 2; // 名称文本 const text = group.addShape("text", { attrs: { text: label, x: x * 2, y, textAlign: "left", textBaseline: "top", fontFamily: "PingFangSC-Regular", }, cursor: "pointer", name: "name-text-shape", }); const textWidth = text.getBBox().width; width = textWidth + itemPadding + nameMarginLeft; width = width < minWidth ? minWidth : width; if (!rootNode && hasChildren) { width += countMarginLeft; width += childCountWidth; } const keyShapeAttrs = { x, y, width, height, radius: 4, }; // keyShape根节点选中样式 if (rootNode && selected) { keyShapeAttrs.fill = "#e8f7ff"; keyShapeAttrs.stroke = "#e8f7ff"; } const keyShape = group.addShape("rect", { attrs: keyShapeAttrs, name: "root-key-shape-rect-shape", }); if (!rootNode) { // 底部横线 group.addShape("path", { attrs: { path: [ ["M", x - 1, 0], ["L", width, 0], ], stroke: "#AAB7C4", lineWidth: 1, }, name: "node-path-shape", }); } const mainX = x - 10; const mainY = -height + 15; if (rootNode) { group.addShape("rect", { attrs: { x: mainX, y: mainY, width: width + 12, height, radius: 14, fill: "#e8f7ff", cursor: "pointer", }, name: "main-shape", }); } let nameColor = "rgba(0, 0, 0, .65)"; if (selected) { nameColor = "#40A8FF"; } // 名称 if (rootNode) { group.addShape("text", { attrs: { text: label, x: mainX + rootPadding, y: 1, textAlign: "left", textBaseline: "middle", fill: nameColor, fontSize: 12, fontFamily: "PingFangSC-Regular", cursor: "pointer", }, name: "root-text-shape", }); } else { group.addShape("text", { attrs: { text: label, x: selected ? mainX + 6 + nameMarginLeft : mainX + 6, y: y - 5, textAlign: "start", textBaseline: "top", fill: nameColor, fontSize: 12, fontFamily: "PingFangSC-Regular", cursor: "pointer", }, name: "not-root-text-shape", }); } // 子类数量 if (hasChildren && !rootNode) { const childCountHeight = 12; const childCountX = width - childCountWidth; const childCountY = -childCountHeight / 2; group.addShape("rect", { attrs: { width: childCountWidth, height: 12, stroke: collapsed ? "#1890ff" : "#5CDBD3", fill: collapsed ? "#fff" : "#E6FFFB", x: childCountX, y: childCountY, radius: 6, cursor: "pointer", }, name: "child-count-rect-shape", }); group.addShape("text", { attrs: { text: `${children.length}`, fill: "rgba(0, 0, 0, .65)", x: childCountX + childCountWidth / 2, y: childCountY + 12, fontSize: 10, width: childCountWidth, textAlign: "center", cursor: "pointer", }, name: "child-count-text-shape", }); } return keyShape; }, }); F6.registerEdge("smooth", { draw(cfg, group) { const { startPoint, endPoint } = cfg; const hgap = Math.abs(endPoint.x - startPoint.x); const path = [ ["M", startPoint.x, startPoint.y], [ "C", startPoint.x + hgap / 4, startPoint.y, endPoint.x - hgap / 2, endPoint.y, endPoint.x, endPoint.y, ], ]; const shape = group.addShape("path", { attrs: { stroke: "#AAB7C4", path, }, name: "smooth-path-shape", }); return shape; }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const BaseConfig = { nameFontSize: 12, childCountWidth: 22, countMarginLeft: 0, itemPadding: 16, nameMarginLeft: 4, rootPadding: 18, }; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ { type: "collapse-expand", }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { type: "treeNode", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "smooth", }, layout: { type: "compactBox", // TODO:为什么这里找不到 direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth(d) { const labelWidth = F6.Util.getTextSize( d.label, BaseConfig.nameFontSize, )[0]; const width_ = BaseConfig.itemPadding + BaseConfig.nameMarginLeft + labelWidth + BaseConfig.rootPadding + BaseConfig.childCountWidth; return width_; }, getVGap: function getVGap() { return 15; }, getHGap: function getHGap() { return 30; }, }, }); // 注册数据 this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/knowledge-tree-graph/index.json ================================================ { "defaultTitle": "知识图谱树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/metro-lines/data.js ================================================ const data = { nodes: [ { id: "0", x: 12955418.07889617, y: 4858516.455509626, class: "地铁二号线", name: "地铁二号线 0", }, { id: "1", x: 12955418.07889617, y: 4858516.455509626, class: "地铁二号线", name: "地铁二号线 1", }, { id: "2", x: 12960805.702543395, y: 4843623.153783939, class: "地铁五号线", name: "地铁五号线 0", }, { id: "3", x: 12957909.41496727, y: 4878612.7284845, class: "地铁五号线", name: "地铁五号线 1", }, { id: "4", x: 12924431.591067636, y: 4826881.565994551, class: "地铁房山线", name: "地铁房山线 0", }, { id: "5", x: 12946675.914777644, y: 4839000.571326079, class: "地铁房山线", name: "地铁房山线 1", }, { id: "6", x: 12960805.702543395, y: 4843623.153783939, class: "地铁亦庄线", name: "地铁亦庄线 0", }, { id: "7", x: 12980513.522539986, y: 4840611.685434834, class: "地铁亦庄线", name: "地铁亦庄线 1", }, { id: "8", x: 12970460.425604625, y: 4852660.505494347, class: "地铁一号线", name: "地铁一号线 0", }, { id: "9", x: 12932857.683691781, y: 4855262.558461167, class: "地铁一号线", name: "地铁一号线 1", }, { id: "10", x: 12954336.341521818, y: 4841957.844498525, class: "地铁大兴线", name: "地铁大兴线 0", }, { id: "11", x: 12948661.393356105, y: 4818156.255552412, class: "地铁大兴线", name: "地铁大兴线 1", }, { id: "12", x: 12954336.341521818, y: 4841957.844498525, class: "地铁四号线", name: "地铁四号线 0", }, { id: "13", x: 12943094.565471629, y: 4868005.960957178, class: "地铁四号线", name: "地铁四号线 1", }, { id: "14", x: 12943697.439571828, y: 4856096.365355702, class: "地铁六号线", name: "地铁六号线 0", }, { id: "15", x: 12982538.96049167, y: 4855210.774849254, class: "地铁六号线", name: "地铁六号线 1", }, { id: "16", x: 12946675.914777644, y: 4839000.571326079, class: "地铁九号线", name: "地铁九号线 0", }, { id: "17", x: 12949261.040454354, y: 4857656.700765552, class: "地铁九号线", name: "地铁九号线 1", }, { id: "18", x: 12956918.23852815, y: 4858529.6221339535, class: "地铁八号线", name: "地铁八号线 0", }, { id: "19", x: 12957923.222643975, y: 4856285.931514598, class: "地铁八号线", name: "地铁八号线 1", }, { id: "20", x: 12947165.66572366, y: 4873622.718414709, class: "地铁昌平线", name: "地铁昌平线 0", }, { id: "21", x: 12945101.617382836, y: 4896059.0154147735, class: "地铁昌平线", name: "地铁昌平线 1", }, { id: "22", x: 12970460.425604625, y: 4852660.505494347, class: "地铁八通线", name: "地铁八通线 0", }, { id: "23", x: 12989768.23411335, y: 4847232.117513346, class: "地铁八通线", name: "地铁八通线 1", }, { id: "24", x: 12961385.775293019, y: 4857425.3359782435, class: "城铁十三号线", name: "城铁十三号线 0", }, { id: "25", x: 12952415.003097966, y: 4857385.42314959, class: "城铁十三号线", name: "城铁十三号线 1", }, { id: "26", x: 12964405.448829094, y: 4849043.663728292, class: "地铁十号线", name: "地铁十号线 0", }, { id: "27", x: 12945523.914777555, y: 4862157.070927259, class: "地铁十号线", name: "地铁十号线 1", }, { id: "28", x: 12937182.6004098, y: 4846484.783681809, class: "地铁十四号线", name: "地铁十四号线 0", }, { id: "29", x: 12946851.421569752, y: 4846551.5626413245, class: "地铁十四号线", name: "地铁十四号线 1", }, { id: "30", x: 12975248.324027628, y: 4879080.29109743, class: "地铁十五号线", name: "地铁十五号线 0", }, { id: "31", x: 12962862.26847603, y: 4865214.088371204, class: "地铁十五号线", name: "地铁十五号线 1", }, { id: "32", x: 12981143.037271895, y: 4871509.161726701, class: "机场轻轨线", name: "机场轻轨线 0", }, { id: "33", x: 12961347.967621036, y: 4857396.841326526, class: "机场轻轨线", name: "机场轻轨线 1", }, ], edges: [ { id: "0", source: "0", target: "1", class: "地铁二号线", name: "地铁二号线 0", controlPoints: [ { x: 12956158.028659772, y: 4858523.099945488, }, { x: 12956181.882943347, y: 4858523.313643505, }, { x: 12956333.569265882, y: 4858524.675979247, }, { x: 12956722.101097316, y: 4858528.426228019, }, { x: 12956892.09019568, y: 4858529.577087689, }, { x: 12957092.031747662, y: 4858532.537231651, }, { x: 12957285.500773665, y: 4858534.624581567, }, { x: 12958025.324180173, y: 4858542.359953267, }, { x: 12958025.324180173, y: 4858542.359953267, }, { x: 12958040.386887064, y: 4858542.398858417, }, { x: 12958051.381729262, y: 4858542.39594296, }, { x: 12958077.436647858, y: 4858542.626090849, }, { x: 12958156.437099922, y: 4858543.794072316, }, { x: 12958189.185511772, y: 4858543.944439034, }, { x: 12958309.191310784, y: 4858545.279485739, }, { x: 12958458.470410347, y: 4858547.406977885, }, { x: 12958499.690753505, y: 4858547.988957175, }, { x: 12958505.143835366, y: 4858548.099568159, }, { x: 12958552.455966821, y: 4858548.335831382, }, { x: 12958768.467696369, y: 4858549.399143227, }, { x: 12958859.902949648, y: 4858552.977807331, }, { x: 12958924.391812265, y: 4858556.413893195, }, { x: 12958993.172822965, y: 4858558.959445135, }, { x: 12959013.547905065, y: 4858559.7809649445, }, { x: 12959327.7774419, y: 4858574.063556792, }, { x: 12959423.21800485, y: 4858577.691630111, }, { x: 12959426.045447897, y: 4858577.797144458, }, { x: 12959659.119375631, y: 4858587.989742429, }, { x: 12959737.865294052, y: 4858591.668097373, }, { x: 12959846.282077461, y: 4858596.613007342, }, { x: 12959955.561247244, y: 4858601.256188295, }, { x: 12960095.413179535, y: 4858607.094133126, }, { x: 12960179.06451476, y: 4858611.470739427, }, { x: 12960222.914558794, y: 4858613.727307291, }, { x: 12960421.743963502, y: 4858622.407685848, }, { x: 12960445.476249201, y: 4858623.093869879, }, { x: 12960629.592854993, y: 4858630.086065551, }, { x: 12960751.203872466, y: 4858635.467581922, }, { x: 12960848.858819682, y: 4858639.927849644, }, { x: 12960917.431335308, y: 4858642.696504292, }, { x: 12960954.897539183, y: 4858643.0533597935, }, { x: 12960982.959798397, y: 4858642.704017011, }, { x: 12961014.781746428, y: 4858640.30966017, }, { x: 12961051.662476636, y: 4858634.414079347, }, { x: 12961083.478422668, y: 4858626.929183689, }, { x: 12961111.532563318, y: 4858617.271161616, }, { x: 12961140.594020512, y: 4858604.699543408, }, { x: 12961160.7368578, y: 4858593.842589348, }, { x: 12961181.649884878, y: 4858581.485318099, }, { x: 12961198.850660494, y: 4858569.376089524, }, { x: 12961224.140661275, y: 4858547.942074989, }, { x: 12961236.424254648, y: 4858536.280756947, }, { x: 12961250.296104662, y: 4858521.997990917, }, { x: 12961263.585987432, y: 4858506.114455221, }, { x: 12961276.44120637, y: 4858488.344153348, }, { x: 12961286.408321457, y: 4858473.632750297, }, { x: 12961294.63870108, y: 4858460.527513578, }, { x: 12961303.735586522, y: 4858443.4908795785, }, { x: 12961311.961795231, y: 4858426.312269373, }, { x: 12961324.544825437, y: 4858394.384768109, }, { x: 12961332.599563174, y: 4858367.639883998, }, { x: 12961338.437462995, y: 4858349.099767153, }, { x: 12961341.2480161, y: 4858329.523211644, }, { x: 12961344.471828079, y: 4858307.641213481, }, { x: 12961347.327668607, y: 4858271.276643974, }, { x: 12961347.988308016, y: 4858252.824580443, }, { x: 12961348.859027859, y: 4858200.010594391, }, { x: 12961348.859027859, y: 4858200.0103943935, }, { x: 12961347.38216376, y: 4858144.4708304275, }, { x: 12961343.338631237, y: 4857930.979484696, }, { x: 12961343.002661625, y: 4857896.233210593, }, { x: 12961340.747563919, y: 4857737.363889014, }, { x: 12961338.592553958, y: 4857671.84297017, }, { x: 12961341.18922736, y: 4857596.35911637, }, { x: 12961344.975191534, y: 4857477.302133615, }, { x: 12961347.967621036, y: 4857396.841326526, }, { x: 12961350.020733643, y: 4857318.561403474, }, { x: 12961355.68061802, y: 4857153.852373557, }, { x: 12961355.680618014, y: 4857153.852273558, }, { x: 12961359.731217345, y: 4857006.275839691, }, { x: 12961359.731017353, y: 4857006.131939777, }, { x: 12961360.845305737, y: 4856963.669545529, }, { x: 12961366.890092889, y: 4856784.230691269, }, { x: 12961368.58851819, y: 4856746.131025358, }, { x: 12961372.266035046, y: 4856660.336259479, }, { x: 12961372.829975668, y: 4856646.230202675, }, { x: 12961378.034419877, y: 4856495.295969707, }, { x: 12961382.403443811, y: 4856377.660000789, }, { x: 12961384.942063117, y: 4856311.497820034, }, { x: 12961386.465992313, y: 4856243.30465021, }, { x: 12961390.674716666, y: 4856107.682763318, }, { x: 12961394.329897156, y: 4855999.369524935, }, { x: 12961394.516375585, y: 4855993.8847022, }, { x: 12961417.584882293, y: 4855310.507392769, }, { x: 12961417.694868386, y: 4855307.2384764915, }, { x: 12961425.988003194, y: 4855061.622208351, }, { x: 12961440.215299333, y: 4854643.566032893, }, { x: 12961461.215758536, y: 4854015.5516425, }, { x: 12961471.471998505, y: 4853691.795660701, }, { x: 12961471.611776885, y: 4853686.561937957, }, { x: 12961474.998051625, y: 4853601.811384682, }, { x: 12961478.809553925, y: 4853507.031446198, }, { x: 12961480.521483717, y: 4853483.915660419, }, { x: 12961481.521725276, y: 4853474.174593727, }, { x: 12961482.954997385, y: 4853459.926853736, }, { x: 12961485.39370743, y: 4853441.314944552, }, { x: 12961494.966948297, y: 4853364.78470371, }, { x: 12961499.936921315, y: 4853336.948636642, }, { x: 12961547.758241706, y: 4853069.064103569, }, { x: 12961553.642808063, y: 4853027.336298535, }, { x: 12961555.648717735, y: 4853011.198681677, }, { x: 12961558.402478581, y: 4852968.599887655, }, { x: 12961561.595948681, y: 4852886.1285595605, }, { x: 12961562.434182541, y: 4852851.8992535565, }, { x: 12961567.092653673, y: 4852663.388779601, }, { x: 12961567.151841797, y: 4852661.004664356, }, { x: 12961571.615182877, y: 4852499.601380691, }, { x: 12961570.762650162, y: 4852327.846076672, }, { x: 12961554.898502, y: 4852258.290511526, }, { x: 12961533.80510204, y: 4852226.950476327, }, { x: 12961502.181787156, y: 4852194.501877436, }, { x: 12961463.801001186, y: 4852175.682708853, }, { x: 12961419.411661869, y: 4852168.225375068, }, { x: 12961360.726703899, y: 4852159.287636606, }, { x: 12961305.806766747, y: 4852155.632147181, }, { x: 12961091.327734, y: 4852150.8841911405, }, { x: 12961044.05355995, y: 4852148.93802986, }, { x: 12960991.078574985, y: 4852148.12380065, }, { x: 12960926.683247, y: 4852147.134333183, }, { x: 12960858.046176687, y: 4852148.206427826, }, { x: 12960832.258540388, y: 4852148.44774515, }, { x: 12960823.161300883, y: 4852148.574651271, }, { x: 12960804.266769528, y: 4852149.284002013, }, { x: 12960648.459496386, y: 4852144.033337599, }, { x: 12960623.783721833, y: 4852142.918236917, }, { x: 12960610.08653878, y: 4852142.2999238875, }, { x: 12960436.33035975, y: 4852141.569412107, }, { x: 12960425.323876735, y: 4852141.588789343, }, { x: 12960418.062649192, y: 4852140.894469294, }, { x: 12960397.685451128, y: 4852136.929909052, }, { x: 12960381.523315413, y: 4852132.778561514, }, { x: 12960359.877821121, y: 4852123.64158053, }, { x: 12960334.346658466, y: 4852109.556173046, }, { x: 12960318.030734146, y: 4852101.525721443, }, { x: 12960299.754816394, y: 4852089.551346909, }, { x: 12960273.273841146, y: 4852069.355692289, }, { x: 12960250.771053055, y: 4852047.738776747, }, { x: 12960236.237871027, y: 4852032.227379977, }, { x: 12960225.220958065, y: 4852021.18490097, }, { x: 12960202.953132067, y: 4851998.62513292, }, { x: 12960134.803431373, y: 4851930.302729313, }, { x: 12960131.415559309, y: 4851926.836000303, }, { x: 12960033.302394766, y: 4851823.178699325, }, { x: 12959943.550656857, y: 4851717.754021466, }, { x: 12959908.855465326, y: 4851685.719289181, }, { x: 12959858.337924149, y: 4851648.509466072, }, { x: 12959827.947234219, y: 4851635.216304059, }, { x: 12959793.596422547, y: 4851620.193270011, }, { x: 12959764.33089034, y: 4851609.816513307, }, { x: 12959751.845001617, y: 4851605.540422947, }, { x: 12959710.096488312, y: 4851595.58055257, }, { x: 12959644.793413645, y: 4851583.581423427, }, { x: 12959487.546643838, y: 4851579.1003289465, }, { x: 12959322.352977112, y: 4851573.1751883635, }, { x: 12959215.355539855, y: 4851567.487059426, }, { x: 12958906.741867626, y: 4851555.576738978, }, { x: 12958503.588496968, y: 4851536.078897831, }, { x: 12958347.549098158, y: 4851535.177370091, }, { x: 12958020.7967457, y: 4851519.547451833, }, { x: 12958020.774536882, y: 4851519.546442713, }, { x: 12957918.246551817, y: 4851517.112404003, }, { x: 12957847.278726801, y: 4851508.301972056, }, { x: 12957786.075293908, y: 4851497.8561179675, }, { x: 12957620.930185705, y: 4851464.46553163, }, { x: 12957553.206441535, y: 4851451.069831951, }, { x: 12957184.967742233, y: 4851438.277567215, }, { x: 12957151.372959128, y: 4851442.83206844, }, { x: 12956984.39334164, y: 4851457.2499878295, }, { x: 12956887.683125133, y: 4851467.99801078, }, { x: 12956842.417678, y: 4851471.246557499, }, { x: 12956795.847498052, y: 4851471.877345327, }, { x: 12956726.805401612, y: 4851470.21078116, }, { x: 12956719.005096909, y: 4851470.206809098, }, { x: 12956690.032717621, y: 4851466.331142748, }, { x: 12956671.745146377, y: 4851465.288835637, }, { x: 12956647.92701909, y: 4851464.086883708, }, { x: 12956432.678734198, y: 4851457.009062028, }, { x: 12956305.238743283, y: 4851452.754473514, }, { x: 12956260.077742493, y: 4851451.052139781, }, { x: 12956108.520973446, y: 4851442.943084553, }, { x: 12955979.955562841, y: 4851437.82970239, }, { x: 12955830.878658453, y: 4851433.243655892, }, { x: 12955632.99933834, y: 4851425.357106182, }, { x: 12955594.773108216, y: 4851423.831054184, }, { x: 12955514.958767148, y: 4851420.40654864, }, { x: 12955415.916358192, y: 4851415.173754157, }, { x: 12955412.341824232, y: 4851415.068560076, }, { x: 12955220.500590362, y: 4851409.551334249, }, { x: 12955177.214926412, y: 4851406.5893032905, }, { x: 12955161.53826209, y: 4851406.056397046, }, { x: 12955016.683409026, y: 4851400.736845952, }, { x: 12954738.676569056, y: 4851389.629311211, }, { x: 12954418.456831554, y: 4851372.282889688, }, { x: 12954112.367106372, y: 4851361.821497771, }, { x: 12954112.366906373, y: 4851361.821497775, }, { x: 12954095.960447045, y: 4851361.608137167, }, { x: 12954011.183086088, y: 4851358.621103881, }, { x: 12953877.563076375, y: 4851352.740857408, }, { x: 12953853.85732765, y: 4851351.967020577, }, { x: 12953803.748811886, y: 4851349.749490414, }, { x: 12953512.054691948, y: 4851336.624567439, }, { x: 12953304.439376486, y: 4851326.941645583, }, { x: 12953215.990118599, y: 4851343.405356978, }, { x: 12953186.516178105, y: 4851352.304914633, }, { x: 12953160.820809599, y: 4851360.075985219, }, { x: 12953135.6284275, y: 4851368.607839927, }, { x: 12953110.773697035, y: 4851379.448142389, }, { x: 12953078.728780996, y: 4851396.784940073, }, { x: 12953055.671146156, y: 4851410.242045931, }, { x: 12953025.125081131, y: 4851430.283492892, }, { x: 12953002.867918571, y: 4851441.908865417, }, { x: 12952970.9803234, y: 4851464.194335162, }, { x: 12952948.54425685, y: 4851486.7574834535, }, { x: 12952924.669249073, y: 4851516.663157407, }, { x: 12952893.865250975, y: 4851558.425931095, }, { x: 12952868.114842031, y: 4851601.291024181, }, { x: 12952849.72221334, y: 4851633.9557742765, }, { x: 12952840.178024879, y: 4851649.33032892, }, { x: 12952831.61507648, y: 4851664.098507009, }, { x: 12952820.749844346, y: 4851683.626532975, }, { x: 12952808.35960638, y: 4851712.713968235, }, { x: 12952805.20735029, y: 4851721.38335488, }, { x: 12952799.79260895, y: 4851738.36548495, }, { x: 12952789.190178515, y: 4851772.8758911565, }, { x: 12952788.761437649, y: 4851774.851755323, }, { x: 12952777.120529784, y: 4851828.491181396, }, { x: 12952769.442166151, y: 4851865.129402015, }, { x: 12952767.325349899, y: 4851875.233108534, }, { x: 12952767.225566436, y: 4851887.288016115, }, { x: 12952766.931015346, y: 4851923.099737246, }, { x: 12952761.952007528, y: 4852049.700375895, }, { x: 12952753.300309705, y: 4852305.149185844, }, { x: 12952748.81253644, y: 4852466.605133841, }, { x: 12952741.572670683, y: 4852644.392438163, }, { x: 12952738.74974852, y: 4852719.016327442, }, { x: 12952741.79628366, y: 4852826.032311127, }, { x: 12952754.022033157, y: 4852951.122076449, }, { x: 12952755.67102211, y: 4852968.493352729, }, { x: 12952758.734429048, y: 4853002.058635834, }, { x: 12952761.031034866, y: 4853033.715526356, }, { x: 12952761.5816642, y: 4853041.308351835, }, { x: 12952765.105510674, y: 4853089.883771956, }, { x: 12952768.26850136, y: 4853131.897335772, }, { x: 12952769.995078206, y: 4853158.94429872, }, { x: 12952770.288851582, y: 4853209.010686412, }, { x: 12952769.71843731, y: 4853247.566692912, }, { x: 12952767.145004591, y: 4853346.541922129, }, { x: 12952765.253378324, y: 4853436.619436339, }, { x: 12952765.214083849, y: 4853437.930242571, }, { x: 12952764.052342676, y: 4853458.187819974, }, { x: 12952760.168979194, y: 4853554.878914973, }, { x: 12952757.95248891, y: 4853628.164651818, }, { x: 12952754.901710529, y: 4853716.499504081, }, { x: 12952752.129394304, y: 4853804.555406498, }, { x: 12952749.6335356, y: 4853872.268162026, }, { x: 12952743.72513416, y: 4854014.227085098, }, { x: 12952741.487142773, y: 4854096.795681505, }, { x: 12952740.271323254, y: 4854189.877021544, }, { x: 12952735.244090632, y: 4854295.470985418, }, { x: 12952732.246698955, y: 4854403.93734809, }, { x: 12952731.594985832, y: 4854421.351329048, }, { x: 12952728.21683085, y: 4854497.1336529, }, { x: 12952727.968463881, y: 4854504.109582829, }, { x: 12952726.933201442, y: 4854533.194906944, }, { x: 12952726.57184963, y: 4854544.113349503, }, { x: 12952721.050076714, y: 4854688.295102883, }, { x: 12952720.966294285, y: 4854713.652392979, }, { x: 12952718.064468559, y: 4854769.647643217, }, { x: 12952715.044363484, y: 4854852.440379618, }, { x: 12952709.221122695, y: 4855060.2259299345, }, { x: 12952706.836731823, y: 4855138.965809699, }, { x: 12952705.041061016, y: 4855185.826583675, }, { x: 12952701.912666142, y: 4855297.303072879, }, { x: 12952701.774883661, y: 4855301.000993471, }, { x: 12952698.542893687, y: 4855388.379772971, }, { x: 12952694.722481314, y: 4855513.192139022, }, { x: 12952694.351429062, y: 4855527.489094137, }, { x: 12952693.024699595, y: 4855578.268289678, }, { x: 12952691.583080197, y: 4855615.825893778, }, { x: 12952690.241251186, y: 4855663.662486527, }, { x: 12952689.665623294, y: 4855679.603567254, }, { x: 12952688.776130756, y: 4855688.786687114, }, { x: 12952687.754061554, y: 4855729.323832838, }, { x: 12952686.019483153, y: 4855798.026277147, }, { x: 12952677.323277667, y: 4856106.12994655, }, { x: 12952676.787444718, y: 4856125.15381618, }, { x: 12952664.53774193, y: 4856474.271753169, }, { x: 12952649.541640174, y: 4856902.04310439, }, { x: 12952649.394057715, y: 4856906.40602088, }, { x: 12952635.915840019, y: 4857296.152572144, }, { x: 12952629.098613512, y: 4857468.8577486845, }, { x: 12952638.14364149, y: 4857509.197665979, }, { x: 12952650.97963757, y: 4857566.931901507, }, { x: 12952656.040774604, y: 4857583.179374015, }, { x: 12952668.497268757, y: 4857619.1841071565, }, { x: 12952685.776569141, y: 4857653.8455795515, }, { x: 12952706.290524684, y: 4857693.299857913, }, { x: 12952720.33970559, y: 4857717.258845025, }, { x: 12952728.768056454, y: 4857729.804878156, }, { x: 12952742.39713164, y: 4857747.850560737, }, { x: 12952755.039200235, y: 4857761.81094819, }, { x: 12952769.509095559, y: 4857774.792433353, }, { x: 12952782.996884435, y: 4857785.801023545, }, { x: 12952788.77239826, y: 4857789.984151489, }, { x: 12952798.589047497, y: 4857797.094653569, }, { x: 12952808.39067999, y: 4857802.308737876, }, { x: 12952837.452516967, y: 4857817.2604270065, }, { x: 12952881.01716795, y: 4857832.991883696, }, { x: 12952938.897575248, y: 4857852.0831211675, }, { x: 12952998.780647367, y: 4857874.054135021, }, { x: 12953258.491335763, y: 4857983.238622202, }, { x: 12953413.859664995, y: 4858039.332894681, }, { x: 12953461.589598283, y: 4858056.89652088, }, { x: 12953597.722309152, y: 4858106.241247336, }, { x: 12953667.79405445, y: 4858131.433108243, }, { x: 12953748.275540665, y: 4858167.149194927, }, { x: 12953812.476893716, y: 4858200.790776387, }, { x: 12954043.962199515, y: 4858326.647837333, }, { x: 12954069.141445398, y: 4858340.297104379, }, { x: 12954072.957342735, y: 4858342.340504059, }, { x: 12954114.16432913, y: 4858364.427001315, }, { x: 12954137.618859049, y: 4858375.535725627, }, { x: 12954295.058541333, y: 4858440.811649338, }, { x: 12954302.457537467, y: 4858443.441923854, }, { x: 12954310.15020407, y: 4858445.926167106, }, { x: 12954332.638227137, y: 4858452.508316665, }, { x: 12954353.823772585, y: 4858458.21648571, }, { x: 12954389.227238271, y: 4858467.144308251, }, { x: 12954466.181852238, y: 4858479.982544497, }, { x: 12954466.70470393, y: 4858480.069293314, }, { x: 12954681.711705219, y: 4858497.4227523925, }, { x: 12954881.814571371, y: 4858508.773537354, }, { x: 12954977.646000914, y: 4858510.359249282, }, { x: 12955052.400974875, y: 4858511.444873559, }, { x: 12955252.256507836, y: 4858514.336868981, }, { x: 12955253.967495963, y: 4858514.361726689, }, { x: 12955289.19954713, y: 4858514.5128645515, }, { x: 12955354.90360536, y: 4858516.033826125, }, { x: 12955355.483066956, y: 4858516.047198033, }, ], }, { id: "1", source: "2", target: "3", class: "地铁五号线", name: "地铁五号线 0", controlPoints: [ { x: 12960720.74502968, y: 4843624.831892422, }, { x: 12960633.531054523, y: 4843628.020999428, }, { x: 12960615.721414793, y: 4843628.698697272, }, { x: 12960529.018550536, y: 4843631.993865521, }, { x: 12960395.923003213, y: 4843634.498433887, }, { x: 12960303.4487313, y: 4843658.086022387, }, { x: 12960247.83253429, y: 4843698.236051296, }, { x: 12960198.244516307, y: 4843756.513927734, }, { x: 12960152.936239943, y: 4843826.831983379, }, { x: 12960093.80567492, y: 4844050.470482044, }, { x: 12960074.685721893, y: 4844241.260554531, }, { x: 12960067.43941915, y: 4844443.961097181, }, { x: 12960064.463686703, y: 4844812.802009133, }, { x: 12960051.958804457, y: 4845167.465485617, }, { x: 12960045.686471423, y: 4845319.993679029, }, { x: 12960040.290314263, y: 4845427.501735388, }, { x: 12960000.078505961, y: 4846409.670004274, }, { x: 12959967.360368509, y: 4847353.92871215, }, { x: 12959903.599435318, y: 4849086.018465949, }, { x: 12959897.308980407, y: 4849189.719214646, }, { x: 12959894.110421222, y: 4849203.583410498, }, { x: 12959890.4317169, y: 4849219.531068828, }, { x: 12959886.89822709, y: 4849232.656139195, }, { x: 12959877.73105254, y: 4849260.436420323, }, { x: 12959865.561524102, y: 4849290.043697017, }, { x: 12959837.38401807, y: 4849362.616048384, }, { x: 12959808.903257467, y: 4849435.004427626, }, { x: 12959779.115515891, y: 4849512.45632027, }, { x: 12959744.160038425, y: 4849599.294323696, }, { x: 12959725.117032269, y: 4849657.80245415, }, { x: 12959719.313276159, y: 4849682.1804609, }, { x: 12959715.446228703, y: 4849703.304149181, }, { x: 12959711.903727653, y: 4849724.430177948, }, { x: 12959709.011729391, y: 4849753.676989364, }, { x: 12959707.415947258, y: 4849783.8967948, }, { x: 12959706.932266207, y: 4849809.126489505, }, { x: 12959706.941864654, y: 4849836.458652587, }, { x: 12959706.941864647, y: 4849836.458852586, }, { x: 12959706.73825638, y: 4849843.058438657, }, { x: 12959701.188848983, y: 4850022.751749156, }, { x: 12959698.75643586, y: 4850092.048955763, }, { x: 12959696.677162938, y: 4850153.857703244, }, { x: 12959695.78056296, y: 4850188.632551699, }, { x: 12959694.918345, y: 4850201.721921542, }, { x: 12959692.002134146, y: 4850243.844071576, }, { x: 12959688.713196509, y: 4850307.368296433, }, { x: 12959688.399038235, y: 4850412.527108991, }, { x: 12959688.405735636, y: 4850420.937318844, }, { x: 12959688.343863737, y: 4850445.110083258, }, { x: 12959686.127736844, y: 4850539.017117742, }, { x: 12959683.968880652, y: 4850587.739754507, }, { x: 12959680.875828847, y: 4850658.134830053, }, { x: 12959679.529814905, y: 4850705.839287117, }, { x: 12959676.829087818, y: 4850793.495084584, }, { x: 12959675.815426968, y: 4850823.398964908, }, { x: 12959675.182101322, y: 4850846.066167584, }, { x: 12959674.637837825, y: 4850881.825140678, }, { x: 12959674.600854788, y: 4850900.231972202, }, { x: 12959672.17730142, y: 4850971.880703524, }, { x: 12959670.889156122, y: 4851002.727395804, }, { x: 12959670.698638307, y: 4851010.549985337, }, { x: 12959668.117749112, y: 4851106.755282467, }, { x: 12959665.56854209, y: 4851184.430341829, }, { x: 12959663.290916206, y: 4851257.106068522, }, { x: 12959662.369610716, y: 4851304.277585146, }, { x: 12959661.413917739, y: 4851326.766808909, }, { x: 12959657.931598857, y: 4851433.829044472, }, { x: 12959658.028261015, y: 4851474.80850299, }, { x: 12959657.267483199, y: 4851488.965234568, }, { x: 12959651.951822918, y: 4851544.541841047, }, { x: 12959644.793413645, y: 4851583.581423427, }, { x: 12959595.684288755, y: 4852619.8846618915, }, { x: 12959574.465131808, y: 4853929.7776421, }, { x: 12959536.880014552, y: 4854963.031257658, }, { x: 12959497.404227743, y: 4856298.871464132, }, { x: 12959482.020338908, y: 4856720.60653976, }, { x: 12959481.210910158, y: 4856745.719910398, }, { x: 12959480.218744718, y: 4856801.67083334, }, { x: 12959480.657100372, y: 4856811.732979886, }, { x: 12959473.537570594, y: 4857026.976625398, }, { x: 12959472.67316361, y: 4857117.529377648, }, { x: 12959471.826244202, y: 4857148.4116494795, }, { x: 12959471.914116398, y: 4857157.0041156085, }, { x: 12959471.914116394, y: 4857157.004315607, }, { x: 12959468.421265613, y: 4857243.442849801, }, { x: 12959465.42503048, y: 4857320.248131243, }, { x: 12959457.359831337, y: 4857487.904976163, }, { x: 12959441.732397161, y: 4858203.22983063, }, { x: 12959436.13624882, y: 4858459.380345282, }, { x: 12959415.193417262, y: 4858615.8007214, }, { x: 12959400.093169626, y: 4858713.511716538, }, { x: 12959399.09985982, y: 4858740.126114421, }, { x: 12959398.923112214, y: 4858756.581567208, }, { x: 12959400.425177053, y: 4858770.664816282, }, { x: 12959403.329731172, y: 4858781.277141151, }, { x: 12959406.81271103, y: 4858791.891385901, }, { x: 12959411.454041706, y: 4858801.77406984, }, { x: 12959416.960302725, y: 4858809.912175236, }, { x: 12959421.887523, y: 4858817.179145314, }, { x: 12959428.263989503, y: 4858824.297946437, }, { x: 12959438.405571558, y: 4858834.467323184, }, { x: 12959446.951603249, y: 4858840.418765018, }, { x: 12959453.47044277, y: 4858844.047635263, }, { x: 12959461.338227013, y: 4858847.889734993, }, { x: 12959468.530699532, y: 4858850.719229388, }, { x: 12959476.367733365, y: 4858853.206677165, }, { x: 12959486.177776907, y: 4858855.242211642, }, { x: 12959498.356965585, y: 4858856.501662772, }, { x: 12959543.238861157, y: 4858861.103129856, }, { x: 12959564.955544673, y: 4858862.823145494, }, { x: 12959585.658078235, y: 4858864.541516278, }, { x: 12959595.839429364, y: 4858866.740035375, }, { x: 12959604.626178885, y: 4858869.753969439, }, { x: 12959619.393890884, y: 4858875.118084437, }, { x: 12959634.602011, y: 4858883.533997516, }, { x: 12959647.926199682, y: 4858893.114601357, }, { x: 12959659.08101609, y: 4858903.862660445, }, { x: 12959672.122859873, y: 4858920.571917142, }, { x: 12959683.284136135, y: 4858939.464230514, }, { x: 12959691.987331163, y: 4858961.4122961955, }, { x: 12959695.907905033, y: 4858977.986510597, }, { x: 12959696.897168944, y: 4858990.458458495, }, { x: 12959696.95704519, y: 4859022.197030113, }, { x: 12959693.756261105, y: 4859059.590188502, }, { x: 12959690.179340184, y: 4859134.214310129, }, { x: 12959685.340567466, y: 4859249.237691335, }, { x: 12959685.339668898, y: 4859260.445091072, }, { x: 12959679.606577044, y: 4859423.720155937, }, { x: 12959665.286089724, y: 4859737.709063406, }, { x: 12959643.000270054, y: 4860035.900026235, }, { x: 12959632.910441214, y: 4860295.517810925, }, { x: 12959592.233549183, y: 4861342.088331037, }, { x: 12959588.730015729, y: 4861432.225749819, }, { x: 12959556.060278306, y: 4862388.960503767, }, { x: 12959545.695101015, y: 4862688.364754779, }, { x: 12959518.592346862, y: 4863435.743969738, }, { x: 12959485.60762339, y: 4864345.2318098685, }, { x: 12959486.001310887, y: 4864482.759632916, }, { x: 12959486.585650299, y: 4865230.9384146165, }, { x: 12959489.44520427, y: 4865436.730097548, }, { x: 12959497.988421464, y: 4865529.704413291, }, { x: 12959497.988421455, y: 4865529.704613299, }, { x: 12959519.200702442, y: 4865741.969269226, }, { x: 12959522.357194034, y: 4865776.148131042, }, { x: 12959522.573317947, y: 4865778.504652967, }, { x: 12959522.916097239, y: 4865782.246629099, }, { x: 12959551.022895565, y: 4866071.32380023, }, { x: 12959556.838158142, y: 4866160.7037429465, }, { x: 12959551.949571997, y: 4866262.940886653, }, { x: 12959540.38150212, y: 4866354.7103297105, }, { x: 12959539.340979226, y: 4866362.459925865, }, { x: 12959513.475078186, y: 4866576.75533692, }, { x: 12959513.47507818, y: 4866576.755436918, }, { x: 12959497.755400725, y: 4866692.268572319, }, { x: 12959497.610949984, y: 4866693.40672459, }, { x: 12959483.493606979, y: 4866796.261737931, }, { x: 12959466.691132883, y: 4866917.22829191, }, { x: 12959461.210504338, y: 4866960.1057711635, }, { x: 12959426.407796139, y: 4867225.807957604, }, { x: 12959418.801394718, y: 4867288.213382227, }, { x: 12959416.692326868, y: 4867306.0886218455, }, { x: 12959410.47637647, y: 4867351.37610048, }, { x: 12959400.148907803, y: 4867462.455263302, }, { x: 12959399.112409318, y: 4867478.93856583, }, { x: 12959396.256439034, y: 4867556.841285077, }, { x: 12959394.84524912, y: 4867623.882782224, }, { x: 12959402.914618, y: 4867739.272140503, }, { x: 12959407.505976537, y: 4867797.003244392, }, { x: 12959415.808022052, y: 4867872.177101691, }, { x: 12959437.831136882, y: 4868003.5787004335, }, { x: 12959443.098101616, y: 4868036.394816039, }, { x: 12959464.101440175, y: 4868167.242968876, }, { x: 12959478.37498549, y: 4868261.98680037, }, { x: 12959508.23051181, y: 4868432.816097544, }, { x: 12959539.922123043, y: 4868629.3165109595, }, { x: 12959551.24160535, y: 4868728.22086592, }, { x: 12959555.049512597, y: 4868834.379861189, }, { x: 12959557.09776522, y: 4869178.128956159, }, { x: 12959557.46233141, y: 4869212.439258056, }, { x: 12959560.523011155, y: 4869592.048363338, }, { x: 12959577.865984676, y: 4869718.394291774, }, { x: 12959590.012423703, y: 4869827.204686913, }, { x: 12959595.795077762, y: 4869869.18333726, }, { x: 12959598.248023918, y: 4869952.360503471, }, { x: 12959599.56821579, y: 4870095.040123146, }, { x: 12959609.728836436, y: 4870531.437161518, }, { x: 12959603.972221585, y: 4870603.500963714, }, { x: 12959588.040449219, y: 4870699.62726807, }, { x: 12959577.341958042, y: 4870759.729165575, }, { x: 12959552.550153958, y: 4870890.017106278, }, { x: 12959549.504474476, y: 4870907.895185102, }, { x: 12959536.238199469, y: 4870980.633462292, }, { x: 12959519.906514881, y: 4871059.136581221, }, { x: 12959498.606091205, y: 4871123.470002014, }, { x: 12959483.02793797, y: 4871158.4458806105, }, { x: 12959398.579719294, y: 4871307.904408066, }, { x: 12959372.473708287, y: 4871364.923557604, }, { x: 12959355.676189639, y: 4871417.85108307, }, { x: 12959345.382419249, y: 4871467.110988155, }, { x: 12959337.246138988, y: 4871518.719362454, }, { x: 12959331.993689496, y: 4871552.047085774, }, { x: 12959329.720869558, y: 4871566.954753559, }, { x: 12959309.401737848, y: 4871682.640660545, }, { x: 12959284.09575571, y: 4871813.104051212, }, { x: 12959272.141485408, y: 4871880.577467433, }, { x: 12959212.679174809, y: 4872024.938082188, }, { x: 12959122.218527583, y: 4872236.515550644, }, { x: 12959101.497205438, y: 4872286.842893077, }, { x: 12959082.233978389, y: 4872332.857224708, }, { x: 12959064.438388105, y: 4872374.568487362, }, { x: 12959002.833097033, y: 4872476.910775585, }, { x: 12958978.720982237, y: 4872510.998020613, }, { x: 12958934.40716439, y: 4872572.781793622, }, { x: 12958888.474905616, y: 4872641.302003023, }, { x: 12958847.253143456, y: 4872732.877987774, }, { x: 12958840.613299651, y: 4872775.301160091, }, { x: 12958826.01344493, y: 4872861.8293480575, }, { x: 12958817.526527362, y: 4873017.26494393, }, { x: 12958814.054718142, y: 4873226.284171534, }, { x: 12958816.11193364, y: 4873266.055943593, }, { x: 12958816.129135203, y: 4873290.15488096, }, { x: 12958821.354560152, y: 4873309.887136759, }, { x: 12958841.32562995, y: 4873397.115248937, }, { x: 12958844.285408415, y: 4873409.713148855, }, { x: 12958847.915875804, y: 4873422.442037873, }, { x: 12958889.630321097, y: 4873507.434415227, }, { x: 12958925.449787276, y: 4873574.258471447, }, { x: 12959052.396737209, y: 4873809.916450764, }, { x: 12959072.334776778, y: 4873851.7039971035, }, { x: 12959091.382334014, y: 4873912.579314463, }, { x: 12959103.205925986, y: 4873994.365655067, }, { x: 12959105.049669469, y: 4874040.715385412, }, { x: 12959098.781538986, y: 4874130.696496499, }, { x: 12959091.653604891, y: 4874277.942229356, }, { x: 12959073.762015432, y: 4874560.621555201, }, { x: 12959055.88026487, y: 4874851.491609374, }, { x: 12959035.313639542, y: 4875190.5466335295, }, { x: 12959020.984397592, y: 4875394.165125814, }, { x: 12958976.23099209, y: 4876077.778969328, }, { x: 12958959.745692749, y: 4876337.611516656, }, { x: 12958959.782791425, y: 4876388.517880667, }, { x: 12958963.47494545, y: 4876487.604684548, }, { x: 12958978.051701134, y: 4876614.863733437, }, { x: 12959002.615098093, y: 4876782.118274665, }, { x: 12959044.457185756, y: 4877060.270620597, }, { x: 12959067.219679391, y: 4877241.168949157, }, { x: 12959071.783226173, y: 4877290.243072816, }, { x: 12959070.11534219, y: 4877482.0814475445, }, { x: 12959050.419169253, y: 4877777.579645479, }, { x: 12959032.750496056, y: 4878102.221159315, }, { x: 12959032.750496058, y: 4878102.221259315, }, { x: 12959003.26866052, y: 4878470.802548815, }, { x: 12959000.418311324, y: 4878535.557270987, }, { x: 12958996.46075172, y: 4878573.393290567, }, { x: 12958986.710555336, y: 4878612.325690378, }, { x: 12958984.36114175, y: 4878620.285756933, }, { x: 12958979.482719835, y: 4878633.567604723, }, { x: 12958971.70519758, y: 4878648.669953857, }, { x: 12958960.310788708, y: 4878668.732809022, }, { x: 12958954.159688484, y: 4878678.6962916935, }, { x: 12958940.408512954, y: 4878697.079788669, }, { x: 12958920.863620294, y: 4878718.556967109, }, { x: 12958911.0902516, y: 4878726.568490176, }, { x: 12958895.161451222, y: 4878738.950175331, }, { x: 12958883.032721909, y: 4878747.3254355155, }, { x: 12958866.73870309, y: 4878756.433205192, }, { x: 12958839.217742998, y: 4878769.914421513, }, { x: 12958816.400635526, y: 4878777.388295637, }, { x: 12958783.623366289, y: 4878784.917193882, }, { x: 12958771.309150409, y: 4878786.744063957, }, { x: 12958739.429878792, y: 4878788.584452175, }, { x: 12958705.738986243, y: 4878786.424910058, }, { x: 12958578.932445105, y: 4878772.682927707, }, { x: 12958490.16318142, y: 4878762.546866739, }, { x: 12958476.030639933, y: 4878759.645153562, }, { x: 12958398.482079366, y: 4878738.585155731, }, { x: 12958337.60009126, y: 4878723.697450009, }, { x: 12958319.258018306, y: 4878717.823743411, }, { x: 12958285.414545368, y: 4878706.985809459, }, { x: 12958281.24441303, y: 4878706.124142206, }, { x: 12958265.300704759, y: 4878704.674592208, }, { x: 12958248.322873216, y: 4878700.7330124155, }, { x: 12958235.48402549, y: 4878697.874149074, }, { x: 12958209.66504376, y: 4878694.661718712, }, { x: 12958185.394430613, y: 4878692.518259022, }, { x: 12958163.832025072, y: 4878687.433936088, }, { x: 12958149.29817478, y: 4878683.5722363135, }, { x: 12958127.588537483, y: 4878677.8039692715, }, { x: 12958103.488411777, y: 4878671.445979302, }, { x: 12958088.084013943, y: 4878666.72080967, }, { x: 12958073.22210372, y: 4878661.450932288, }, { x: 12958053.105073934, y: 4878653.090874466, }, { x: 12958019.939165607, y: 4878639.8218743205, }, { x: 12957987.498125235, y: 4878626.005036278, }, { x: 12957976.804148829, y: 4878622.369122046, }, { x: 12957959.95128188, y: 4878618.734327142, }, { x: 12957933.674733272, y: 4878614.921507571, }, ], }, { id: "2", source: "4", target: "5", class: "地铁房山线", name: "地铁房山线 0", controlPoints: [ { x: 12924448.17238817, y: 4826880.333482542, }, { x: 12924525.979211709, y: 4826872.878344628, }, { x: 12924651.003975658, y: 4826850.186382258, }, { x: 12924772.909010362, y: 4826831.637862584, }, { x: 12924892.815210382, y: 4826808.910764785, }, { x: 12924979.825081667, y: 4826797.17955122, }, { x: 12925084.39744784, y: 4826783.365645579, }, { x: 12925155.81120956, y: 4826773.302022665, }, { x: 12925191.531802883, y: 4826763.145386636, }, { x: 12925246.401130036, y: 4826741.508641205, }, { x: 12925289.809143692, y: 4826716.000219138, }, { x: 12925328.122217724, y: 4826687.913828323, }, { x: 12925435.446934095, y: 4826589.547291209, }, { x: 12925667.935929714, y: 4826383.866700324, }, { x: 12925703.114335984, y: 4826349.828286723, }, { x: 12925770.622207448, y: 4826279.8993723765, }, { x: 12925812.089063462, y: 4826236.363691168, }, { x: 12925860.064926796, y: 4826185.624213163, }, { x: 12925972.45908047, y: 4826067.695006573, }, { x: 12926072.836947165, y: 4825968.627523454, }, { x: 12926117.70970191, y: 4825926.122953221, }, { x: 12926163.925422803, y: 4825891.864408059, }, { x: 12926224.487089904, y: 4825859.005237854, }, { x: 12926272.713245494, y: 4825838.833351052, }, { x: 12926306.225330409, y: 4825828.247220456, }, { x: 12926323.66112753, y: 4825823.471552652, }, { x: 12926342.999038229, y: 4825815.638790402, }, { x: 12926395.038321048, y: 4825807.019948717, }, { x: 12926456.619666297, y: 4825801.386693386, }, { x: 12926771.931888463, y: 4825802.616129439, }, { x: 12926851.048048986, y: 4825801.631130125, }, { x: 12926918.475671358, y: 4825800.789146462, }, { x: 12927029.359667536, y: 4825801.827672996, }, { x: 12927182.830807276, y: 4825803.048420769, }, { x: 12927499.41885292, y: 4825801.064920832, }, { x: 12927985.316114604, y: 4825802.302803997, }, { x: 12928151.253302878, y: 4825800.059199896, }, { x: 12928748.07329185, y: 4825800.240476295, }, { x: 12929111.030443402, y: 4825800.274953787, }, { x: 12929262.734959431, y: 4825802.042122076, }, { x: 12929411.395781256, y: 4825802.035455338, }, { x: 12929506.992909838, y: 4825802.706934221, }, { x: 12929650.07556503, y: 4825802.544157764, }, { x: 12929720.668591391, y: 4825802.142241587, }, { x: 12929772.983434387, y: 4825800.887369454, }, { x: 12929857.446321096, y: 4825798.160825567, }, { x: 12929912.070413183, y: 4825797.961849597, }, { x: 12930020.049115648, y: 4825798.40702736, }, { x: 12930163.955832295, y: 4825797.372447041, }, { x: 12930397.554672962, y: 4825796.54976334, }, { x: 12930475.738706259, y: 4825796.886377486, }, { x: 12930546.696718559, y: 4825797.190814849, }, { x: 12930678.19064345, y: 4825796.767765474, }, { x: 12930758.84637836, y: 4825797.611875748, }, { x: 12930844.12941692, y: 4825797.184218957, }, { x: 12931658.797219362, y: 4825797.407901417, }, { x: 12932033.235206187, y: 4825795.320207194, }, { x: 12932233.393439343, y: 4825794.180152587, }, { x: 12932721.308799969, y: 4825803.219910631, }, { x: 12932928.523249036, y: 4825803.557711617, }, { x: 12933053.790329, y: 4825812.987185039, }, { x: 12933138.900921563, y: 4825833.806609662, }, { x: 12933190.809829095, y: 4825856.349271142, }, { x: 12933226.429307265, y: 4825874.795930243, }, { x: 12933272.213535246, y: 4825905.5475769965, }, { x: 12933330.19116232, y: 4825952.706628941, }, { x: 12933394.224417783, y: 4826031.661583878, }, { x: 12933434.848204572, y: 4826099.343443693, }, { x: 12933457.160278024, y: 4826153.699179631, }, { x: 12933477.393874265, y: 4826231.651463547, }, { x: 12933483.411973838, y: 4826283.965274176, }, { x: 12933484.24966211, y: 4826383.467920047, }, { x: 12933484.612918697, y: 4826744.564537366, }, { x: 12933484.578816487, y: 4826763.36453251, }, { x: 12933483.779386565, y: 4826924.895615106, }, { x: 12933482.610669505, y: 4827007.992815708, }, { x: 12933492.646572754, y: 4827092.110644749, }, { x: 12933513.41196703, y: 4827439.884337276, }, { x: 12933543.228519833, y: 4827854.75280781, }, { x: 12933566.570100563, y: 4828176.552121379, }, { x: 12933594.643939137, y: 4828596.572517603, }, { x: 12933629.925192222, y: 4829103.087824667, }, { x: 12933645.64381434, y: 4829320.597027384, }, { x: 12933649.89045366, y: 4829382.144115338, }, { x: 12933667.168927083, y: 4829632.556420974, }, { x: 12933676.117122944, y: 4829774.023766041, }, { x: 12933682.081289982, y: 4829869.157117123, }, { x: 12933689.928693485, y: 4829940.817807672, }, { x: 12933703.310192509, y: 4830006.297419812, }, { x: 12933719.154849395, y: 4830066.214843579, }, { x: 12933755.774424188, y: 4830174.310550475, }, { x: 12933810.744445253, y: 4830313.90749861, }, { x: 12933922.503728205, y: 4830609.788269573, }, { x: 12934038.543576436, y: 4830918.028547641, }, { x: 12934058.694520555, y: 4830974.859139696, }, { x: 12934069.58014834, y: 4831005.072471465, }, { x: 12934119.846976575, y: 4831143.433958218, }, { x: 12934149.991077174, y: 4831222.949836257, }, { x: 12934198.033104936, y: 4831349.678156342, }, { x: 12934223.473509623, y: 4831400.412253144, }, { x: 12934259.369952803, y: 4831461.028016709, }, { x: 12934309.114426302, y: 4831520.072779361, }, { x: 12934377.085065225, y: 4831581.991332408, }, { x: 12934396.69835483, y: 4831595.164926664, }, { x: 12934437.243386144, y: 4831618.212550709, }, { x: 12934478.449542966, y: 4831638.623777254, }, { x: 12934524.898399867, y: 4831655.075704626, }, { x: 12934580.515549589, y: 4831668.889447878, }, { x: 12934636.143351322, y: 4831676.770691342, }, { x: 12934666.908025475, y: 4831679.39163554, }, { x: 12934765.756048232, y: 4831678.685510442, }, { x: 12934930.73367185, y: 4831674.651678714, }, { x: 12935250.876591342, y: 4831667.251747576, }, { x: 12935499.671785736, y: 4831663.187574107, }, { x: 12935746.513249094, y: 4831659.130713738, }, { x: 12935815.915508969, y: 4831660.42132409, }, { x: 12935908.050789848, y: 4831663.982781072, }, { x: 12935967.815653212, y: 4831666.293463208, }, { x: 12936241.494185515, y: 4831674.4963234225, }, { x: 12936369.370711273, y: 4831678.336400013, }, { x: 12936425.785732588, y: 4831676.31555289, }, { x: 12936581.316240864, y: 4831673.037189442, }, { x: 12936633.370649267, y: 4831674.963771561, }, { x: 12936737.713978717, y: 4831679.370178035, }, { x: 12936831.315349536, y: 4831683.322450787, }, { x: 12936877.589160608, y: 4831685.252679165, }, { x: 12936910.361308584, y: 4831690.419854687, }, { x: 12936949.558532905, y: 4831696.881239256, }, { x: 12936987.467610013, y: 4831706.574167675, }, { x: 12937022.15788816, y: 4831719.5039792955, }, { x: 12937065.199754963, y: 4831736.958924886, }, { x: 12937110.158974504, y: 4831760.881236912, }, { x: 12937157.036534246, y: 4831793.8590075895, }, { x: 12937199.404558316, y: 4831833.307823846, }, { x: 12937237.91287837, y: 4831875.343509309, }, { x: 12937258.446807722, y: 4831901.211682247, }, { x: 12937284.10526521, y: 4831938.723324833, }, { x: 12937312.95239147, y: 4831994.991182708, }, { x: 12937327.68762551, y: 4832030.564244142, }, { x: 12937343.684707167, y: 4832083.600788961, }, { x: 12937351.972602425, y: 4832131.461705969, }, { x: 12937358.31940185, y: 4832186.438225887, }, { x: 12937355.622857124, y: 4832274.4059191365, }, { x: 12937339.975481886, y: 4832427.060379704, }, { x: 12937324.788945852, y: 4832705.848365801, }, { x: 12937293.01305762, y: 4832897.32304263, }, { x: 12937270.892804373, y: 4833079.740939002, }, { x: 12937248.767915612, y: 4833263.455352972, }, { x: 12937209.689481642, y: 4833612.138889359, }, { x: 12937165.784590699, y: 4834031.900756954, }, { x: 12937138.418116648, y: 4834222.711592586, }, { x: 12937083.08660543, y: 4834535.844936789, }, { x: 12937052.334413424, y: 4834663.757169239, }, { x: 12936994.342385216, y: 4834895.126983638, }, { x: 12936953.854431149, y: 4835030.737985154, }, { x: 12936869.843218748, y: 4835313.3219827665, }, { x: 12936862.532161772, y: 4835339.778036121, }, { x: 12936836.320704404, y: 4835434.637730703, }, { x: 12936827.217503313, y: 4835519.169988192, }, { x: 12936827.124637516, y: 4835581.758973662, }, { x: 12936837.906126408, y: 4835663.063325517, }, { x: 12936864.056538468, y: 4835757.266142062, }, { x: 12936880.668495258, y: 4835797.917881852, }, { x: 12936907.667939143, y: 4835847.318738415, }, { x: 12936952.878761742, y: 4835914.1082075, }, { x: 12937000.216170117, y: 4835969.234486032, }, { x: 12937063.361933991, y: 4836023.2971759755, }, { x: 12937143.36704171, y: 4836079.4810301885, }, { x: 12937217.081887215, y: 4836115.519519725, }, { x: 12937329.790312514, y: 4836151.556748291, }, { x: 12937431.328256749, y: 4836175.655924688, }, { x: 12937851.122850813, y: 4836275.4876682935, }, { x: 12938154.622310877, y: 4836341.2390868, }, { x: 12938362.244614977, y: 4836390.037264124, }, { x: 12938503.041870078, y: 4836411.664485504, }, { x: 12938564.047320768, y: 4836418.793423229, }, { x: 12938988.303480383, y: 4836457.009886602, }, { x: 12939480.568825236, y: 4836493.208155112, }, { x: 12939792.38983277, y: 4836515.385447704, }, { x: 12940262.993302846, y: 4836548.909357694, }, { x: 12940393.59269819, y: 4836559.504709913, }, { x: 12940478.91780255, y: 4836571.822251312, }, { x: 12940790.622461848, y: 4836636.837138435, }, { x: 12941203.633091165, y: 4836730.122990206, }, { x: 12941712.749939607, y: 4836839.200160033, }, { x: 12942167.786199445, y: 4836936.5137574095, }, { x: 12942294.984682916, y: 4836959.65357408, }, { x: 12942610.524821742, y: 4837005.682620561, }, { x: 12942843.547300853, y: 4837039.413158133, }, { x: 12943166.318173433, y: 4837086.947605261, }, { x: 12943510.46784253, y: 4837134.81698191, }, { x: 12943617.3707184, y: 4837150.799628537, }, { x: 12943658.487001108, y: 4837158.769269097, }, { x: 12943691.736804834, y: 4837167.08383111, }, { x: 12943717.587123148, y: 4837172.921819401, }, { x: 12943814.810048617, y: 4837200.232098826, }, { x: 12943917.263605423, y: 4837238.058053253, }, { x: 12943974.78713743, y: 4837264.277939439, }, { x: 12944030.153658753, y: 4837291.952562648, }, { x: 12944135.650915911, y: 4837354.294186727, }, { x: 12944445.141549075, y: 4837528.417611227, }, { x: 12944644.509050895, y: 4837635.945078776, }, { x: 12944685.94060137, y: 4837654.409708789, }, { x: 12944719.086739298, y: 4837669.359215808, }, { x: 12944794.975247588, y: 4837699.716510274, }, { x: 12944947.1976908, y: 4837760.873124597, }, { x: 12945035.745333357, y: 4837798.266491122, }, { x: 12945124.72566364, y: 4837845.286033468, }, { x: 12945270.414963193, y: 4837921.319729365, }, { x: 12945450.582071586, y: 4838013.632744957, }, { x: 12945577.533408465, y: 4838080.445217846, }, { x: 12945834.434212714, y: 4838202.613398697, }, { x: 12946075.31690205, y: 4838296.146027662, }, { x: 12946292.279576164, y: 4838360.532187274, }, { x: 12946521.019224824, y: 4838491.165573925, }, { x: 12946638.949600644, y: 4838621.542593471, }, { x: 12946650.686066799, y: 4838737.438298838, }, ], }, { id: "3", source: "6", target: "7", class: "地铁亦庄线", name: "地铁亦庄线 0", controlPoints: [ { x: 12960801.92985531, y: 4843268.231642703, }, { x: 12960819.048596159, y: 4842751.648234617, }, { x: 12960883.71369413, y: 4842268.659267911, }, { x: 12960932.9503868, y: 4842163.931739517, }, { x: 12961006.927248925, y: 4842097.692273121, }, { x: 12961168.66192465, y: 4842014.7338780835, }, { x: 12962601.717469966, y: 4841896.79575762, }, { x: 12962754.46753597, y: 4841885.241291034, }, { x: 12962943.500290178, y: 4841880.673982279, }, { x: 12963012.112349365, y: 4841876.615867013, }, { x: 12963059.010006737, y: 4841861.67650217, }, { x: 12963116.452138275, y: 4841834.8158408785, }, { x: 12963210.447880082, y: 4841771.47221078, }, { x: 12963235.833946913, y: 4841754.363392143, }, { x: 12963662.654879957, y: 4841466.647965242, }, { x: 12964038.994342858, y: 4841212.831358209, }, { x: 12964154.545155134, y: 4841070.441342094, }, { x: 12964171.735590378, y: 4841010.993206987, }, { x: 12964339.916463993, y: 4840434.314594529, }, { x: 12964343.389385078, y: 4840399.329742603, }, { x: 12964334.817316562, y: 4840225.397102979, }, { x: 12964331.221136974, y: 4840162.554061632, }, { x: 12964328.50535713, y: 4840100.593094604, }, { x: 12964332.779831221, y: 4840004.0775054535, }, { x: 12964346.582668858, y: 4839794.207556842, }, { x: 12964363.097590594, y: 4839601.773416806, }, { x: 12964380.328964364, y: 4839365.602941362, }, { x: 12964385.8482237, y: 4839211.548689884, }, { x: 12964387.499547305, y: 4839127.002529577, }, { x: 12964391.276917182, y: 4838985.794324284, }, { x: 12964392.443018869, y: 4838864.958482721, }, { x: 12964394.955731656, y: 4838766.690857032, }, { x: 12964393.975998627, y: 4838687.027470687, }, { x: 12964387.294707682, y: 4838617.567328025, }, { x: 12964367.416052649, y: 4838539.309062238, }, { x: 12964347.51619, y: 4838431.650587995, }, { x: 12964322.767169563, y: 4838324.645467618, }, { x: 12964313.562428541, y: 4838262.541243617, }, { x: 12964310.411869453, y: 4838225.729635625, }, { x: 12964309.355618041, y: 4838208.017849213, }, { x: 12964309.656222237, y: 4838174.319843992, }, { x: 12964311.684558112, y: 4838140.960443022, }, { x: 12964317.833830703, y: 4838091.9543595165, }, { x: 12964329.018005343, y: 4838019.745353896, }, { x: 12964357.57037216, y: 4837928.397117701, }, { x: 12964379.95742845, y: 4837836.721116149, }, { x: 12964395.761376698, y: 4837785.937210788, }, { x: 12964408.481659109, y: 4837751.494051737, }, { x: 12964423.958059136, y: 4837713.2194660455, }, { x: 12964454.929082762, y: 4837651.608776794, }, { x: 12964485.908545986, y: 4837599.028090593, }, { x: 12964502.078122087, y: 4837575.000819509, }, { x: 12964507.944067815, y: 4837566.284373945, }, { x: 12964538.941616124, y: 4837526.901722564, }, { x: 12964580.623847708, y: 4837481.571345544, }, { x: 12964632.30168787, y: 4837432.37855521, }, { x: 12964707.289879689, y: 4837377.0810903795, }, { x: 12964746.5828552, y: 4837352.947415166, }, { x: 12964787.599945143, y: 4837330.888655926, }, { x: 12964847.234552702, y: 4837303.540100147, }, { x: 12964952.379239444, y: 4837263.837261641, }, { x: 12965041.659042722, y: 4837228.367036585, }, { x: 12965086.817706559, y: 4837212.190291242, }, { x: 12965125.425630035, y: 4837197.083091712, }, { x: 12965198.852510314, y: 4837173.487209741, }, { x: 12965285.035077993, y: 4837148.788444636, }, { x: 12965345.022458684, y: 4837136.015256971, }, { x: 12965376.741696445, y: 4837131.008352433, }, { x: 12965413.288189877, y: 4837126.675422853, }, { x: 12965466.732716972, y: 4837121.571415942, }, { x: 12965495.35177725, y: 4837119.3559531085, }, { x: 12965530.521028334, y: 4837117.112703386, }, { x: 12965593.968191253, y: 4837116.473776446, }, { x: 12965649.486601945, y: 4837118.648806222, }, { x: 12965697.768784914, y: 4837122.941340376, }, { x: 12965780.881747998, y: 4837133.843576874, }, { x: 12965906.431954557, y: 4837162.43093923, }, { x: 12966118.21979879, y: 4837224.64350029, }, { x: 12966330.35727124, y: 4837296.215654915, }, { x: 12966430.728530029, y: 4837328.721880014, }, { x: 12966526.230111593, y: 4837358.910915481, }, { x: 12966643.884234305, y: 4837396.097468287, }, { x: 12966715.9714909, y: 4837420.053074277, }, { x: 12966775.298984269, y: 4837442.68182159, }, { x: 12966834.282130612, y: 4837464.615069852, }, { x: 12966877.402287401, y: 4837483.848933528, }, { x: 12966941.220910013, y: 4837513.053573998, }, { x: 12967048.56698116, y: 4837567.953487057, }, { x: 12967160.356455721, y: 4837633.033932691, }, { x: 12967341.830451151, y: 4837734.223029286, }, { x: 12967598.515018187, y: 4837876.520746398, }, { x: 12967695.550281677, y: 4837931.8672629995, }, { x: 12967769.295083275, y: 4837973.927233142, }, { x: 12967806.210225426, y: 4837994.921276422, }, { x: 12967880.373314308, y: 4838029.263222194, }, { x: 12967942.458581364, y: 4838054.463929446, }, { x: 12968006.949619304, y: 4838074.960467259, }, { x: 12968064.880156811, y: 4838089.239839763, }, { x: 12968160.7317529, y: 4838106.785960654, }, { x: 12968223.818423554, y: 4838111.656953844, }, { x: 12968280.003925696, y: 4838113.086931953, }, { x: 12968326.878944056, y: 4838112.138498563, }, { x: 12968367.54589312, y: 4838109.4857799625, }, { x: 12968389.51656575, y: 4838106.448409635, }, { x: 12968438.187831255, y: 4838099.719152986, }, { x: 12968498.833145326, y: 4838088.619169914, }, { x: 12968538.110375632, y: 4838079.370846887, }, { x: 12968616.314083783, y: 4838057.750684839, }, { x: 12968698.633058043, y: 4838023.949189746, }, { x: 12968811.931290373, y: 4837966.003419178, }, { x: 12968881.824553497, y: 4837922.53959489, }, { x: 12968943.430079784, y: 4837870.786756742, }, { x: 12969022.924111847, y: 4837800.520362136, }, { x: 12969055.9530577, y: 4837765.945136667, }, { x: 12969084.843050089, y: 4837731.392991392, }, { x: 12969120.958078042, y: 4837688.466172142, }, { x: 12969155.332209961, y: 4837635.4723625, }, { x: 12969242.285513127, y: 4837496.730319538, }, { x: 12969333.712761667, y: 4837355.187852096, }, { x: 12969408.647255532, y: 4837235.936020544, }, { x: 12969513.801304353, y: 4837064.791048047, }, { x: 12969590.779687598, y: 4836941.394981127, }, { x: 12969705.899936745, y: 4836755.955416486, }, { x: 12969806.238916375, y: 4836594.567940544, }, { x: 12969938.533153186, y: 4836382.639398942, }, { x: 12970039.8160462, y: 4836217.531831086, }, { x: 12970129.245947173, y: 4836071.878209337, }, { x: 12970220.246216761, y: 4835926.897614078, }, { x: 12970286.073547151, y: 4835822.025633852, }, { x: 12970415.07546836, y: 4835612.642595116, }, { x: 12970568.870650535, y: 4835365.18734994, }, { x: 12970669.724938907, y: 4835202.376148994, }, { x: 12970752.484735584, y: 4835070.152439515, }, { x: 12970832.895625059, y: 4834939.975857269, }, { x: 12970899.569476828, y: 4834832.910757041, }, { x: 12971033.918129083, y: 4834616.066050077, }, { x: 12971144.158073269, y: 4834433.937266104, }, { x: 12971198.069970135, y: 4834344.871445297, }, { x: 12971305.26943295, y: 4834167.479451596, }, { x: 12971364.235194443, y: 4834074.351988931, }, { x: 12971525.71156008, y: 4833814.364471716, }, { x: 12971682.679083303, y: 4833562.284042895, }, { x: 12971812.288419375, y: 4833350.753875024, }, { x: 12972017.979800759, y: 4833021.125112385, }, { x: 12972103.744545488, y: 4832885.194999167, }, { x: 12972135.257382995, y: 4832846.417732776, }, { x: 12972160.077781122, y: 4832821.220722371, }, { x: 12972199.662509607, y: 4832785.10628778, }, { x: 12972264.123885086, y: 4832742.901302573, }, { x: 12972264.12408505, y: 4832742.901202536, }, { x: 12972324.21434308, y: 4832713.4141902095, }, { x: 12972386.305619905, y: 4832692.675651716, }, { x: 12972428.804140508, y: 4832685.222868618, }, { x: 12972485.012097614, y: 4832680.520476171, }, { x: 12972542.168608952, y: 4832680.834396475, }, { x: 12972604.011630796, y: 4832688.654398485, }, { x: 12972644.212348452, y: 4832699.10386752, }, { x: 12972696.734916897, y: 4832717.642597281, }, { x: 12972757.695351638, y: 4832749.00336457, }, { x: 12972859.999908108, y: 4832813.088811927, }, { x: 12972941.093523078, y: 4832860.97338974, }, { x: 12973004.727402989, y: 4832901.107069043, }, { x: 12973063.375094922, y: 4832939.388312671, }, { x: 12973118.709117647, y: 4832976.2564467145, }, { x: 12973157.278549964, y: 4833001.955820043, }, { x: 12973287.045299167, y: 4833078.76948663, }, { x: 12973336.018910544, y: 4833107.376876498, }, { x: 12973532.737387815, y: 4833234.050880133, }, { x: 12973711.056147737, y: 4833345.140835251, }, { x: 12973939.785549805, y: 4833486.730983602, }, { x: 12974177.84357694, y: 4833635.477147498, }, { x: 12974448.095380764, y: 4833804.380259698, }, { x: 12974616.656587714, y: 4833906.469350846, }, { x: 12974744.179042902, y: 4833983.66343434, }, { x: 12974848.457567113, y: 4834048.738895861, }, { x: 12975023.307596708, y: 4834158.038177878, }, { x: 12975344.80631824, y: 4834362.369596276, }, { x: 12975542.195598783, y: 4834485.718127945, }, { x: 12975589.153098417, y: 4834515.976788436, }, { x: 12975743.362999665, y: 4834615.341611351, }, { x: 12976018.28541726, y: 4834788.58647766, }, { x: 12976156.837017762, y: 4834874.4406398935, }, { x: 12976203.26410973, y: 4834903.209489788, }, { x: 12976425.749449603, y: 4835044.1395141035, }, { x: 12976682.803252261, y: 4835209.05760146, }, { x: 12977612.288689816, y: 4836078.591476348, }, { x: 12977703.538800083, y: 4836157.900805114, }, { x: 12977801.888863295, y: 4836235.662686368, }, { x: 12978758.33292605, y: 4837259.312987513, }, { x: 12978842.971959101, y: 4837349.736883194, }, { x: 12979531.54154612, y: 4838049.719256911, }, { x: 12979689.378903074, y: 4838256.735438744, }, { x: 12980051.853140548, y: 4838731.323685468, }, { x: 12980384.15998818, y: 4839120.990048823, }, { x: 12980467.93565266, y: 4839255.613023306, }, { x: 12980521.623321274, y: 4839397.296177998, }, { x: 12980529.827086125, y: 4839430.697709363, }, { x: 12980535.501366084, y: 4839564.805608976, }, { x: 12980538.135068312, y: 4840222.645451332, }, { x: 12980538.379641674, y: 4840283.5996034695, }, { x: 12980538.543424217, y: 4840324.221498785, }, { x: 12980535.067586645, y: 4840405.430398631, }, { x: 12980525.345959615, y: 4840470.937074263, }, { x: 12980513.995958695, y: 4840544.736949112, }, ], }, { id: "4", source: "8", target: "9", class: "地铁一号线", name: "地铁一号线 0", controlPoints: [ { x: 12969787.144385956, y: 4852662.477041108, }, { x: 12969236.284285808, y: 4852670.237943584, }, { x: 12968944.36629118, y: 4852676.464039239, }, { x: 12968472.728321342, y: 4852684.58530441, }, { x: 12968414.420578972, y: 4852687.842999674, }, { x: 12968235.54912727, y: 4852697.8323459625, }, { x: 12968069.523958666, y: 4852708.845800531, }, { x: 12967520.284252618, y: 4852709.247613191, }, { x: 12967117.366149856, y: 4852665.62205985, }, { x: 12966772.612022452, y: 4852628.17396013, }, { x: 12966517.096762186, y: 4852623.936320605, }, { x: 12966223.985369124, y: 4852617.830735498, }, { x: 12964521.542056274, y: 4852636.984637193, }, { x: 12964462.063732337, y: 4852637.63680008, }, { x: 12964380.646967553, y: 4852638.41249018, }, { x: 12964310.636384122, y: 4852638.548196548, }, { x: 12964259.391907305, y: 4852638.609292217, }, { x: 12964063.789477564, y: 4852640.250627404, }, { x: 12964002.433399238, y: 4852641.068996505, }, { x: 12963990.595935801, y: 4852641.261031478, }, { x: 12963890.25903454, y: 4852642.515969342, }, { x: 12963809.987625448, y: 4852643.546429879, }, { x: 12963781.834338633, y: 4852643.942282169, }, { x: 12963774.327120606, y: 4852643.970398907, }, { x: 12963455.081045607, y: 4852646.588025983, }, { x: 12963322.230220675, y: 4852647.784045951, }, { x: 12963223.166991241, y: 4852649.725733759, }, { x: 12963190.819152791, y: 4852650.417434513, }, { x: 12963127.561328052, y: 4852650.0517423265, }, { x: 12963039.607865393, y: 4852649.766256757, }, { x: 12962819.058636826, y: 4852651.358893755, }, { x: 12962593.866965737, y: 4852653.665194887, }, { x: 12962462.408622202, y: 4852654.791986625, }, { x: 12962183.756523842, y: 4852657.365475698, }, { x: 12962157.173752429, y: 4852659.766562548, }, { x: 12961924.104038442, y: 4852660.11712501, }, { x: 12961924.059855, y: 4852660.116942157, }, { x: 12961900.696391538, y: 4852660.033076115, }, { x: 12961567.092653673, y: 4852663.388779601, }, { x: 12961454.569802668, y: 4852664.505495348, }, { x: 12961217.079500727, y: 4852658.515584384, }, { x: 12961149.13715287, y: 4852657.212458487, }, { x: 12961133.237071244, y: 4852657.247371087, }, { x: 12961027.846655574, y: 4852654.2780048065, }, { x: 12960863.900760658, y: 4852649.966801163, }, { x: 12960818.644700909, y: 4852648.896293183, }, { x: 12960637.184863163, y: 4852644.743311257, }, { x: 12960624.025816733, y: 4852644.477645673, }, { x: 12960602.480219977, y: 4852643.937047354, }, { x: 12960506.031680021, y: 4852641.9318091385, }, { x: 12960391.353551494, y: 4852639.083787939, }, { x: 12960320.201913092, y: 4852637.313773441, }, { x: 12960062.18095632, y: 4852628.1362550985, }, { x: 12959904.438548937, y: 4852627.023597047, }, { x: 12959595.684288755, y: 4852619.8846618915, }, { x: 12959323.178066703, y: 4852609.481755874, }, { x: 12958840.802221617, y: 4852590.942915122, }, { x: 12957502.352622895, y: 4852528.684166141, }, { x: 12956620.835296787, y: 4852504.508925668, }, { x: 12955674.942021938, y: 4852471.61015628, }, { x: 12955416.308852747, y: 4852469.018503432, }, { x: 12954706.035138829, y: 4852461.803325078, }, { x: 12953928.716739, y: 4852464.489858927, }, { x: 12952788.83672684, y: 4852466.54282573, }, { x: 12952748.81253644, y: 4852466.605133841, }, { x: 12951563.203060223, y: 4852477.671537925, }, { x: 12951199.751181506, y: 4852495.122833292, }, { x: 12950198.141508736, y: 4852495.025451202, }, { x: 12949965.299984097, y: 4852495.077305805, }, { x: 12949129.26242653, y: 4852504.598358415, }, { x: 12947838.444126923, y: 4852505.90698292, }, { x: 12947589.306786017, y: 4852505.320736883, }, { x: 12945901.390879856, y: 4852501.577557874, }, { x: 12944980.974916212, y: 4852499.625168126, }, { x: 12943548.12132782, y: 4852497.380847655, }, { x: 12942376.001682293, y: 4852500.03430738, }, { x: 12941203.789519304, y: 4852502.985840143, }, { x: 12939774.001753055, y: 4852500.299665425, }, { x: 12938324.854233196, y: 4852497.834034189, }, { x: 12938281.788912078, y: 4852497.828983922, }, { x: 12938058.817138307, y: 4852497.810737135, }, { x: 12937898.86276059, y: 4852497.3685845565, }, { x: 12937671.875809424, y: 4852496.791572168, }, { x: 12937460.220387606, y: 4852497.967734828, }, { x: 12937174.041187, y: 4852498.731022245, }, { x: 12937173.96999806, y: 4852498.730233027, }, { x: 12937136.194604035, y: 4852498.300376261, }, { x: 12936946.821682766, y: 4852498.918736944, }, { x: 12936849.614381388, y: 4852498.356186343, }, { x: 12936692.322356569, y: 4852497.959326306, }, { x: 12936587.17645106, y: 4852498.5677669365, }, { x: 12934252.339824114, y: 4852499.457888381, }, { x: 12934092.666854141, y: 4852498.783005591, }, { x: 12933957.2920676, y: 4852554.157396755, }, { x: 12933867.245068891, y: 4852636.768727248, }, { x: 12933790.29537299, y: 4852771.049393255, }, { x: 12933709.54499776, y: 4852986.243814959, }, { x: 12933275.354659256, y: 4854146.7353322515, }, ], }, { id: "5", source: "10", target: "11", class: "地铁大兴线", name: "地铁大兴线 0", controlPoints: [ { x: 12954320.097829182, y: 4841755.370768595, }, { x: 12954269.565863218, y: 4841475.231416884, }, { x: 12954109.467427691, y: 4840587.804965775, }, { x: 12953795.666789988, y: 4838847.936111765, }, { x: 12953779.74076359, y: 4838781.406112334, }, { x: 12953764.911988458, y: 4838735.372116771, }, { x: 12953728.040718146, y: 4838684.612972186, }, { x: 12953200.942060454, y: 4837849.787883376, }, { x: 12953071.02731984, y: 4837651.869209399, }, { x: 12952979.616992796, y: 4837589.00545091, }, { x: 12952903.159508042, y: 4837579.42379109, }, { x: 12952782.211602798, y: 4837577.388802782, }, { x: 12952678.006507806, y: 4837568.850794091, }, { x: 12952630.246652557, y: 4837568.346663251, }, { x: 12952563.144880537, y: 4837569.3784104185, }, { x: 12952459.727695232, y: 4837576.654353493, }, { x: 12952047.259057738, y: 4837602.473680529, }, { x: 12951992.11263072, y: 4837607.014363404, }, { x: 12951930.600837775, y: 4837607.287158209, }, { x: 12951859.333033504, y: 4837604.988006545, }, { x: 12951659.950799704, y: 4837590.463923004, }, { x: 12951511.86811374, y: 4837581.708907432, }, { x: 12951503.592170091, y: 4837581.306936129, }, { x: 12951471.758692794, y: 4837579.760443551, }, { x: 12951416.434195919, y: 4837581.464508876, }, { x: 12951320.836636368, y: 4837591.26673181, }, { x: 12951208.471245904, y: 4837608.1171654025, }, { x: 12951130.332944639, y: 4837620.206020496, }, { x: 12951053.162266875, y: 4837624.532130631, }, { x: 12950994.073467728, y: 4837620.818036712, }, { x: 12950952.099045333, y: 4837614.236065724, }, { x: 12950903.02068405, y: 4837603.431351229, }, { x: 12950854.265358152, y: 4837586.804646552, }, { x: 12950803.897617934, y: 4837565.966975064, }, { x: 12950750.622557428, y: 4837538.00750994, }, { x: 12950713.171179097, y: 4837512.0295137195, }, { x: 12950613.406373397, y: 4837431.864322759, }, { x: 12950473.803516785, y: 4837318.037136518, }, { x: 12950224.739204535, y: 4837111.815739738, }, { x: 12949781.71624435, y: 4836761.283068602, }, { x: 12949728.565575039, y: 4836716.7570553925, }, { x: 12949703.653419532, y: 4836690.060944494, }, { x: 12949670.437469736, y: 4836646.1427171705, }, { x: 12949640.546313735, y: 4836599.462744173, }, { x: 12949602.355321119, y: 4836518.919640969, }, { x: 12949581.32899617, y: 4836447.855053628, }, { x: 12949571.933781365, y: 4836366.283691224, }, { x: 12949570.99564922, y: 4836297.018513739, }, { x: 12949583.773060184, y: 4836131.096596216, }, { x: 12949630.95790481, y: 4835587.242148269, }, { x: 12949644.605106963, y: 4835427.978435933, }, { x: 12949674.069930378, y: 4835084.076939791, }, { x: 12949741.123785608, y: 4834412.860058607, }, { x: 12949881.255387962, y: 4833114.597124276, }, { x: 12949988.167188657, y: 4831634.321648644, }, { x: 12950011.8904392, y: 4831024.642033773, }, { x: 12950045.949834898, y: 4830169.250105037, }, { x: 12950067.86965607, y: 4829187.531131907, }, { x: 12950068.411119526, y: 4828643.488667632, }, { x: 12950089.439076275, y: 4827012.598861079, }, { x: 12950075.332266735, y: 4825735.265538567, }, { x: 12950077.6177772, y: 4825610.926281617, }, { x: 12950063.743562018, y: 4825551.423688702, }, { x: 12949886.484341538, y: 4825355.5838901615, }, { x: 12949714.24435096, y: 4825240.542840744, }, { x: 12948810.72447873, y: 4824919.1962220995, }, { x: 12948630.372620959, y: 4824779.957329413, }, { x: 12948551.763527192, y: 4824562.001534207, }, { x: 12948571.333401924, y: 4824233.799839876, }, { x: 12948851.677430334, y: 4820591.681083957, }, { x: 12948856.025176648, y: 4820535.340838382, }, { x: 12948857.519128771, y: 4820485.531178259, }, ], }, { id: "6", source: "12", target: "13", class: "地铁四号线", name: "地铁四号线 0", controlPoints: [ { x: 12954373.657756021, y: 4843560.934009259, }, { x: 12954403.308395952, y: 4844637.092136642, }, { x: 12954443.631939387, y: 4845049.84687948, }, { x: 12954465.385927541, y: 4845230.316998346, }, { x: 12954477.104733607, y: 4845295.713890768, }, { x: 12954510.159202749, y: 4845363.4843960125, }, { x: 12954722.716019211, y: 4845628.35857464, }, { x: 12954922.594454948, y: 4845874.895440882, }, { x: 12955211.028271338, y: 4846209.062552702, }, { x: 12955269.78815066, y: 4846334.5600019405, }, { x: 12955267.306704495, y: 4846529.094981971, }, { x: 12955200.99362026, y: 4846713.313157282, }, { x: 12955050.45468214, y: 4846989.573067081, }, { x: 12954853.97442472, y: 4847378.402945743, }, { x: 12954774.906886864, y: 4847675.2444390515, }, { x: 12954731.85449024, y: 4848212.883938044, }, { x: 12954744.79924884, y: 4848786.391306657, }, { x: 12954747.612023802, y: 4849835.643590178, }, { x: 12954747.682216099, y: 4849861.774043528, }, { x: 12954741.08816034, y: 4850881.230635524, }, { x: 12954737.645653786, y: 4851386.201206222, }, { x: 12954721.760149185, y: 4851926.74810973, }, { x: 12954706.035138829, y: 4852461.803325078, }, { x: 12954661.27452527, y: 4853769.120768002, }, { x: 12954633.49377667, y: 4854880.847809376, }, { x: 12954587.535533391, y: 4856278.18149549, }, { x: 12954557.952698175, y: 4857155.485744631, }, { x: 12954557.437163154, y: 4857170.770202318, }, { x: 12954537.64640468, y: 4857234.798733779, }, { x: 12954507.61800925, y: 4857265.498611502, }, { x: 12954448.18840873, y: 4857290.387739614, }, { x: 12954389.022163786, y: 4857304.787614773, }, { x: 12954302.10618948, y: 4857314.253741188, }, { x: 12954046.446788153, y: 4857314.448443049, }, { x: 12952788.718781503, y: 4857298.136733208, }, { x: 12952635.915840019, y: 4857296.152572144, }, { x: 12952564.595755607, y: 4857295.107641618, }, { x: 12952364.409316596, y: 4857273.12227582, }, { x: 12952154.040871462, y: 4857235.468350076, }, { x: 12951969.43909615, y: 4857201.456667664, }, { x: 12951808.104168849, y: 4857155.825128381, }, { x: 12951795.707910977, y: 4857150.112186163, }, { x: 12951672.542241815, y: 4857093.348351254, }, { x: 12951530.459501661, y: 4857032.392475653, }, { x: 12951457.165035697, y: 4857016.611367204, }, { x: 12951413.82925054, y: 4857010.241801462, }, { x: 12951362.398381047, y: 4857007.948880891, }, { x: 12951289.260741765, y: 4857006.283719927, }, { x: 12951243.494159421, y: 4857003.966436169, }, { x: 12951198.613096055, y: 4857003.604147996, }, { x: 12951191.52223199, y: 4857003.216630181, }, { x: 12951176.410532618, y: 4857002.724713779, }, { x: 12950664.103792224, y: 4856969.636138788, }, { x: 12950490.915616779, y: 4856960.604637075, }, { x: 12950376.449417142, y: 4856957.730451393, }, { x: 12950275.412423559, y: 4856958.095432962, }, { x: 12950197.754097624, y: 4856965.795888429, }, { x: 12950087.769172028, y: 4856976.7011729805, }, { x: 12949969.030407438, y: 4856988.731925641, }, { x: 12949611.385620916, y: 4857033.614270364, }, { x: 12949433.088418497, y: 4857064.900798794, }, { x: 12949359.045249254, y: 4857097.992433988, }, { x: 12949324.284422386, y: 4857141.787668212, }, { x: 12949323.829516204, y: 4857143.221560914, }, { x: 12949294.040752294, y: 4857237.088716105, }, { x: 12949290.965819698, y: 4857281.5241520675, }, { x: 12949290.844836328, y: 4857284.326685918, }, { x: 12949286.84859171, y: 4857363.3786635455, }, { x: 12949255.74271649, y: 4857669.774620552, }, { x: 12949251.021282567, y: 4857716.034187529, }, { x: 12949240.534414742, y: 4857818.781418282, }, { x: 12949229.599655101, y: 4857925.935052169, }, { x: 12949223.285025857, y: 4857987.8014169345, }, { x: 12949218.68930698, y: 4858032.839792737, }, { x: 12949202.705857255, y: 4858189.081518219, }, { x: 12949201.91675542, y: 4858197.081514944, }, { x: 12949188.720634252, y: 4858325.005565848, }, { x: 12949171.484932527, y: 4858492.101118972, }, { x: 12949140.242605533, y: 4858794.965387163, }, { x: 12949128.462758997, y: 4858908.105794337, }, { x: 12949119.684607878, y: 4858997.242106079, }, { x: 12949117.630120248, y: 4859021.712509141, }, { x: 12949113.161648553, y: 4859077.167116614, }, { x: 12949110.991163222, y: 4859101.470621213, }, { x: 12949110.099969309, y: 4859112.821822983, }, { x: 12949108.911677599, y: 4859127.083425599, }, { x: 12949101.505333235, y: 4859206.231246072, }, { x: 12949098.141760852, y: 4859235.087958121, }, { x: 12949086.945661454, y: 4859330.204405712, }, { x: 12949080.506525062, y: 4859390.090037273, }, { x: 12949072.760807924, y: 4859454.574381684, }, { x: 12949053.421043288, y: 4859613.1813176535, }, { x: 12949006.291508188, y: 4860099.103019413, }, { x: 12948987.273876615, y: 4860281.083185734, }, { x: 12948981.095505225, y: 4860340.214580902, }, { x: 12948971.386815451, y: 4860438.818238612, }, { x: 12948968.790673513, y: 4860465.186182631, }, { x: 12948957.099444743, y: 4860583.923590711, }, { x: 12948954.944696926, y: 4860602.30153119, }, { x: 12948953.629329322, y: 4860611.371156355, }, { x: 12948945.376137566, y: 4860665.772419023, }, { x: 12948943.371389516, y: 4860677.809759844, }, { x: 12948941.428640455, y: 4860688.287999877, }, { x: 12948940.027077485, y: 4860695.8687290335, }, { x: 12948933.979640268, y: 4860726.099657515, }, { x: 12948928.21129958, y: 4860754.943783897, }, { x: 12948925.53477491, y: 4860767.8741438445, }, { x: 12948914.390798561, y: 4860816.020402436, }, { x: 12948908.818966143, y: 4860838.981437038, }, { x: 12948891.21272109, y: 4860906.962985634, }, { x: 12948891.084425297, y: 4860907.371989038, }, { x: 12948849.368497113, y: 4861042.125295077, }, { x: 12948835.90431828, y: 4861088.737227414, }, { x: 12948830.296142103, y: 4861108.420813816, }, { x: 12948822.04407856, y: 4861138.651794888, }, { x: 12948813.499036651, y: 4861166.617294492, }, { x: 12948805.08019881, y: 4861193.008798196, }, { x: 12948779.113573417, y: 4861277.779889043, }, { x: 12948764.04589559, y: 4861326.974101848, }, { x: 12948764.026496535, y: 4861327.037202654, }, { x: 12948753.359326178, y: 4861360.815953497, }, { x: 12948743.747416658, y: 4861389.941771785, }, { x: 12948718.178381432, y: 4861470.921841358, }, { x: 12948696.13872888, y: 4861543.199816692, }, { x: 12948691.345809, y: 4861558.918058851, }, { x: 12948670.805545585, y: 4861626.292230624, }, { x: 12948635.660998613, y: 4861741.800393923, }, { x: 12948620.137949644, y: 4861792.813013884, }, { x: 12948586.362157172, y: 4861900.900528574, }, { x: 12948570.146171637, y: 4861955.959000696, }, { x: 12948553.55913321, y: 4862007.46980901, }, { x: 12948506.607909067, y: 4862151.020102147, }, { x: 12948474.477154713, y: 4862249.710439044, }, { x: 12948433.854782313, y: 4862372.508539395, }, { x: 12948405.896567902, y: 4862457.026555028, }, { x: 12948387.467864858, y: 4862540.95750102, }, { x: 12948369.72084694, y: 4862608.589042327, }, { x: 12948351.287448928, y: 4862705.352991365, }, { x: 12948349.399856329, y: 4862717.969572795, }, { x: 12948342.9554688, y: 4862761.161096935, }, { x: 12948334.103059907, y: 4862815.789967469, }, { x: 12948330.745336216, y: 4862847.533998459, }, { x: 12948330.324781813, y: 4862857.667238568, }, { x: 12948330.719618713, y: 4862923.321583864, }, { x: 12948329.271456743, y: 4863030.035711758, }, { x: 12948318.983617261, y: 4863152.700650098, }, { x: 12948308.624791207, y: 4863323.528821448, }, { x: 12948305.573238118, y: 4863383.023344128, }, { x: 12948304.882713268, y: 4863410.205718649, }, { x: 12948304.34907461, y: 4863418.883075538, }, { x: 12948304.349074604, y: 4863418.883175537, }, { x: 12948293.57852302, y: 4863594.090943488, }, { x: 12948292.26537664, y: 4863615.222388438, }, { x: 12948285.911429897, y: 4863694.78289179, }, { x: 12948279.888862576, y: 4863721.625153882, }, { x: 12948276.328498306, y: 4863738.652548549, }, { x: 12948273.0212985, y: 4863779.761424982, }, { x: 12948271.391195413, y: 4863804.060012918, }, { x: 12948269.44583099, y: 4863833.063038297, }, { x: 12948268.544436276, y: 4863862.57964908, }, { x: 12948264.951457486, y: 4863980.229798113, }, { x: 12948262.743327497, y: 4864012.842760259, }, { x: 12948253.95970473, y: 4864163.393230665, }, { x: 12948251.540303396, y: 4864206.470731608, }, { x: 12948212.079753308, y: 4864794.335183325, }, { x: 12948192.775449837, y: 4865057.815886522, }, { x: 12948172.296877252, y: 4865301.5112607, }, { x: 12948164.786289226, y: 4865392.804538419, }, { x: 12948154.255917, y: 4865512.14757284, }, { x: 12948154.255917, y: 4865512.1477728365, }, { x: 12948149.74303433, y: 4865560.011840421, }, { x: 12948144.366829144, y: 4865612.142398512, }, { x: 12948143.959623424, y: 4865618.525997311, }, { x: 12948137.439734928, y: 4865720.508486359, }, { x: 12948107.519605923, y: 4865814.2291544955, }, { x: 12948078.069647746, y: 4865856.462480031, }, { x: 12948024.306038419, y: 4865884.525941556, }, { x: 12947948.793208137, y: 4865895.857790665, }, { x: 12947726.110412342, y: 4865901.65407643, }, { x: 12947662.03325602, y: 4865903.549335554, }, { x: 12947582.728775566, y: 4865884.474219018, }, { x: 12947578.428732935, y: 4865883.43990478, }, { x: 12947516.084078891, y: 4865861.968135664, }, { x: 12947457.991019811, y: 4865841.929292836, }, { x: 12947430.320338927, y: 4865825.17744688, }, { x: 12947403.34891173, y: 4865801.908641243, }, { x: 12947385.583410634, y: 4865783.125515066, }, { x: 12947366.462947419, y: 4865758.28002787, }, { x: 12947349.636991477, y: 4865736.761035594, }, { x: 12947325.434427919, y: 4865705.9521581745, }, { x: 12947293.294439247, y: 4865662.223273893, }, { x: 12947280.026460873, y: 4865645.503535422, }, { x: 12947272.790190758, y: 4865637.152186299, }, { x: 12947264.45234974, y: 4865630.50206878, }, { x: 12947253.895662466, y: 4865622.890310138, }, { x: 12947242.3961359, y: 4865615.799413275, }, { x: 12947228.023148427, y: 4865608.898160762, }, { x: 12947219.081559768, y: 4865605.561492597, }, { x: 12947209.673061684, y: 4865603.139115063, }, { x: 12947199.896463385, y: 4865601.658737004, }, { x: 12947170.376100887, y: 4865598.241728645, }, { x: 12947114.262342412, y: 4865594.002744353, }, { x: 12947069.303568143, y: 4865590.097302363, }, { x: 12946996.955287198, y: 4865580.432522639, }, { x: 12946941.228131976, y: 4865573.255125918, }, { x: 12946900.084918642, y: 4865569.517658332, }, { x: 12946822.761463061, y: 4865560.673446433, }, { x: 12946727.614742137, y: 4865552.84563637, }, { x: 12946678.905013254, y: 4865548.119018174, }, { x: 12946642.17997207, y: 4865544.956115833, }, { x: 12946584.893309405, y: 4865543.859270443, }, { x: 12946544.506879704, y: 4865545.213818521, }, { x: 12946501.165103968, y: 4865545.26638306, }, { x: 12946422.048745677, y: 4865542.2614939865, }, { x: 12946366.591065088, y: 4865538.478497777, }, { x: 12946343.54274385, y: 4865536.796393288, }, { x: 12946313.331102742, y: 4865534.072102609, }, { x: 12946276.992936801, y: 4865530.295722415, }, { x: 12946044.983768271, y: 4865506.53848812, }, { x: 12946044.982468616, y: 4865506.538388461, }, { x: 12945999.054564236, y: 4865501.51634233, }, { x: 12945939.11875475, y: 4865501.919490546, }, { x: 12945842.188083762, y: 4865505.838142619, }, { x: 12945841.360324211, y: 4865506.238193714, }, { x: 12945718.088826543, y: 4865565.803399573, }, { x: 12945361.171856038, y: 4865725.241244186, }, { x: 12945288.888034362, y: 4865771.876347319, }, { x: 12944971.787632536, y: 4865960.501491743, }, { x: 12944694.050529143, y: 4866125.748562615, }, { x: 12944571.275779925, y: 4866175.496896087, }, { x: 12944486.984637886, y: 4866196.026940467, }, { x: 12944376.91914833, y: 4866212.279980763, }, { x: 12943875.491423381, y: 4866303.184805465, }, { x: 12943715.625648474, y: 4866329.140561554, }, { x: 12943691.286623739, y: 4866336.782693048, }, { x: 12943666.684753045, y: 4866355.700580207, }, { x: 12943647.036226608, y: 4866386.77867161, }, { x: 12943618.683377, y: 4866431.5171539625, }, { x: 12943575.591938026, y: 4866503.065200196, }, { x: 12943549.272841655, y: 4866548.372445914, }, { x: 12943513.655516205, y: 4866606.664160266, }, { x: 12943464.443157, y: 4866692.552688016, }, { x: 12943362.33352031, y: 4866844.144888357, }, { x: 12943298.332087196, y: 4866965.865469642, }, { x: 12943194.660765983, y: 4867152.9265388595, }, { x: 12943140.884084987, y: 4867273.386822292, }, { x: 12943114.423065275, y: 4867594.932334096, }, { x: 12943113.763426922, y: 4867602.948598135, }, { x: 12943108.181515867, y: 4867757.799791251, }, ], }, { id: "7", source: "14", target: "15", class: "地铁六号线", name: "地铁六号线 0", controlPoints: [ { x: 12944329.792132245, y: 4856125.732393313, }, { x: 12944374.963417206, y: 4856132.075934602, }, { x: 12944438.830775484, y: 4856136.896376604, }, { x: 12944515.16641718, y: 4856137.056480541, }, { x: 12944577.483953971, y: 4856135.625803216, }, { x: 12944642.924413817, y: 4856126.389908644, }, { x: 12944711.48482392, y: 4856114.036716937, }, { x: 12944790.955263415, y: 4856098.58349056, }, { x: 12944854.842780758, y: 4856089.348004857, }, { x: 12944925.484679118, y: 4856086.034136885, }, { x: 12944964.41973033, y: 4856083.331773158, }, { x: 12944978.393002376, y: 4856082.950699846, }, { x: 12945058.975743152, y: 4856080.754937213, }, { x: 12945281.461997462, y: 4856092.418480259, }, { x: 12945643.041754864, y: 4856110.003093847, }, { x: 12945784.907202916, y: 4856113.134308052, }, { x: 12946578.056629626, y: 4856112.4447421245, }, { x: 12947587.39674028, y: 4856115.133251456, }, { x: 12947613.274919279, y: 4856115.203954564, }, { x: 12948409.558918482, y: 4856120.2980670845, }, { x: 12950197.88091994, y: 4856127.655709365, }, { x: 12950522.56167453, y: 4856128.972474555, }, { x: 12952789.177160164, y: 4856124.15803456, }, { x: 12953464.615126304, y: 4856122.0006891955, }, { x: 12954530.376567366, y: 4856151.814350079, }, { x: 12955417.241989752, y: 4856201.3555319505, }, { x: 12956068.761834681, y: 4856237.46303956, }, { x: 12956833.347700687, y: 4856274.21357933, }, { x: 12958297.780383743, y: 4856277.010194032, }, { x: 12958569.623250166, y: 4856268.920119228, }, { x: 12958601.133725567, y: 4855382.984479329, }, { x: 12958611.676282825, y: 4855232.673994465, }, { x: 12958632.866942339, y: 4855139.665765479, }, { x: 12958688.973578054, y: 4855045.110782978, }, { x: 12958728.4139951, y: 4855000.874038989, }, { x: 12958770.892719645, y: 4854961.207780969, }, { x: 12958799.677543039, y: 4854945.921102297, }, { x: 12959324.962061018, y: 4854945.451113535, }, { x: 12959585.872160498, y: 4854945.153439757, }, { x: 12961042.442201044, y: 4854962.677000188, }, { x: 12961432.109595038, y: 4854972.467899889, }, { x: 12961926.386577822, y: 4854934.294285994, }, { x: 12962148.74759053, y: 4854917.131482158, }, { x: 12962283.599321207, y: 4854895.403863202, }, { x: 12962563.81989391, y: 4854825.953182589, }, { x: 12962930.401073314, y: 4854769.91200932, }, { x: 12963190.916752387, y: 4854738.551506216, }, { x: 12964441.84613731, y: 4854799.404628956, }, { x: 12964524.312877567, y: 4854798.896359394, }, { x: 12965180.991672397, y: 4854794.927301339, }, { x: 12965609.29152333, y: 4854782.320431698, }, { x: 12965890.746902762, y: 4854765.761862335, }, { x: 12966166.126872526, y: 4854749.201512711, }, { x: 12966285.65860789, y: 4854745.572490727, }, { x: 12966514.13404955, y: 4854747.498023047, }, { x: 12967120.576418092, y: 4854750.252015507, }, { x: 12968417.872233221, y: 4854755.563269503, }, { x: 12968618.637517042, y: 4854756.352373138, }, { x: 12969113.28223611, y: 4854778.000756352, }, { x: 12969684.88717921, y: 4854779.300801552, }, { x: 12970067.575502042, y: 4854781.712135722, }, { x: 12970534.989097549, y: 4854786.685865359, }, { x: 12970699.884643015, y: 4854793.3733178545, }, { x: 12970823.931856325, y: 4854795.719200881, }, { x: 12970982.830224, y: 4854826.832892539, }, { x: 12971113.005257478, y: 4854865.732206641, }, { x: 12971202.287273336, y: 4854878.94766238, }, { x: 12971370.206297623, y: 4854874.950868926, }, { x: 12972309.189289698, y: 4854855.496835954, }, { x: 12973018.812017871, y: 4854841.117131226, }, { x: 12973547.047963066, y: 4854830.666734374, }, { x: 12974064.854700932, y: 4854852.350465733, }, { x: 12974472.82455872, y: 4854876.455052272, }, { x: 12975051.371356072, y: 4854904.052996347, }, { x: 12975605.826026462, y: 4854907.507188204, }, { x: 12975778.549655946, y: 4854906.705688043, }, { x: 12976205.686714906, y: 4854908.883752931, }, { x: 12977221.096053148, y: 4854914.252570144, }, { x: 12977364.010499585, y: 4854929.9394761175, }, { x: 12977849.475332348, y: 4854987.676906845, }, { x: 12978108.4311247, y: 4855013.81299573, }, { x: 12978521.22706543, y: 4855058.406105899, }, { x: 12980109.377856214, y: 4855165.781190299, }, { x: 12980283.977902222, y: 4855177.638637634, }, { x: 12980489.227525037, y: 4855187.924099469, }, { x: 12980583.71991004, y: 4855179.543517038, }, { x: 12980688.925014246, y: 4855138.6160322325, }, { x: 12980767.103468414, y: 4855089.631526497, }, { x: 12980869.512862012, y: 4855013.486901767, }, { x: 12981090.661572816, y: 4854899.114190809, }, { x: 12981198.816266755, y: 4854879.956045967, }, { x: 12981320.40982718, y: 4854890.50993648, }, { x: 12982163.741886314, y: 4855124.274679628, }, ], }, { id: "8", source: "16", target: "17", class: "地铁九号线", name: "地铁九号线 0", controlPoints: [ { x: 12946648.06073432, y: 4839260.025729084, }, { x: 12946544.074465087, y: 4839619.202216059, }, { x: 12946445.496254807, y: 4839771.777087536, }, { x: 12946363.495286731, y: 4839808.518510458, }, { x: 12946292.702186562, y: 4839843.812617867, }, { x: 12946221.884510016, y: 4839925.221959326, }, { x: 12946200.062497655, y: 4839988.63678963, }, { x: 12946126.464738874, y: 4840577.558530562, }, { x: 12946154.121327115, y: 4841454.65715364, }, { x: 12946159.216413628, y: 4841615.166540137, }, { x: 12946163.133984758, y: 4841750.3172009885, }, { x: 12946166.16397019, y: 4841854.414496068, }, { x: 12946134.718988903, y: 4842145.305047408, }, { x: 12946011.482648093, y: 4842839.443615038, }, { x: 12945967.3702783, y: 4843175.101744513, }, { x: 12945875.098454604, y: 4843833.607067226, }, { x: 12945815.866086949, y: 4844216.664802826, }, { x: 12945773.952396747, y: 4844701.295741741, }, { x: 12945762.960414361, y: 4844884.183169307, }, { x: 12945811.645641796, y: 4846485.73907944, }, { x: 12945821.760873735, y: 4846713.698002954, }, { x: 12945850.240499485, y: 4847377.283903233, }, { x: 12945860.277378498, y: 4847457.126713241, }, { x: 12945889.251105716, y: 4847545.70699325, }, { x: 12946012.904132249, y: 4847683.799611397, }, { x: 12946527.681154523, y: 4848401.627416125, }, { x: 12946550.388778795, y: 4848450.652934715, }, { x: 12946578.885636054, y: 4848483.879589509, }, { x: 12946614.230164707, y: 4848509.121830013, }, { x: 12946687.204717232, y: 4848555.03996301, }, { x: 12946714.570161361, y: 4848573.402833471, }, { x: 12946927.965178315, y: 4848771.050237301, }, { x: 12947039.251749933, y: 4848874.121019451, }, { x: 12947590.671676153, y: 4849210.0301651545, }, { x: 12947894.176283287, y: 4849394.908355361, }, { x: 12948001.161563184, y: 4849454.528594686, }, { x: 12948726.115618171, y: 4849833.574366419, }, { x: 12948780.697656307, y: 4849859.709410215, }, { x: 12948804.10908822, y: 4849909.061453937, }, { x: 12948808.591585146, y: 4849968.572800762, }, { x: 12948813.15515829, y: 4850598.421530288, }, { x: 12949122.850263117, y: 4852505.623073113, }, { x: 12949328.200350346, y: 4854831.558034923, }, { x: 12949353.269647257, y: 4856109.000245334, }, { x: 12949291.632125383, y: 4857143.131243851, }, ], }, { id: "9", source: "18", target: "19", class: "地铁八号线", name: "地铁八号线 0", controlPoints: [ { x: 12957190.97175418, y: 4856829.187045242, }, { x: 12957268.3578042, y: 4856387.328711017, }, { x: 12957289.353013203, y: 4856359.317449307, }, { x: 12957331.343025276, y: 4856327.797491008, }, { x: 12957376.831138888, y: 4856317.277947678, }, { x: 12957891.704380175, y: 4856296.418069313, }, ], }, { id: "10", source: "20", target: "21", class: "地铁昌平线", name: "地铁昌平线 0", controlPoints: [ { x: 12947094.115985483, y: 4873731.336740117, }, { x: 12947072.54413634, y: 4873784.735931892, }, { x: 12947042.017514793, y: 4873859.579611177, }, { x: 12946995.4508778, y: 4873970.753583026, }, { x: 12946943.109137688, y: 4874095.283923113, }, { x: 12946899.787751423, y: 4874206.107863865, }, { x: 12946881.01472949, y: 4874253.759727108, }, { x: 12946789.68802783, y: 4874467.089710582, }, { x: 12946751.78362451, y: 4874555.5292996485, }, { x: 12946700.523958035, y: 4874674.650758464, }, { x: 12946655.766671386, y: 4874767.410641011, }, { x: 12946571.364045683, y: 4874925.748577232, }, { x: 12946510.5646055, y: 4875031.897509199, }, { x: 12946472.444944305, y: 4875099.449536901, }, { x: 12946378.125857558, y: 4875270.873813889, }, { x: 12946315.432537835, y: 4875442.5781064425, }, { x: 12945987.019381497, y: 4876429.405849195, }, { x: 12945494.324537683, y: 4877247.425781118, }, { x: 12945212.872442825, y: 4877783.708641315, }, { x: 12944881.49739096, y: 4878774.737871047, }, { x: 12944906.896743502, y: 4879158.180641696, }, { x: 12945532.959607262, y: 4879647.417083359, }, { x: 12946150.468651066, y: 4879791.647184245, }, { x: 12946905.53928399, y: 4879921.626008038, }, { x: 12947757.621608311, y: 4880143.70392179, }, { x: 12948030.412870025, y: 4880398.632118471, }, { x: 12948052.616659699, y: 4880692.773681223, }, { x: 12947846.20854383, y: 4881514.465746558, }, { x: 12947597.065183768, y: 4882366.221916524, }, { x: 12947351.139175126, y: 4883370.132124624, }, { x: 12947176.67206149, y: 4883933.272704212, }, { x: 12946774.041093351, y: 4884211.771737467, }, { x: 12946459.054291379, y: 4884228.537864571, }, { x: 12945934.213743346, y: 4884401.946771053, }, { x: 12945765.765805947, y: 4884775.110386402, }, { x: 12945765.322226081, y: 4884788.004333703, }, { x: 12945769.507831955, y: 4885435.210764532, }, { x: 12945706.715861775, y: 4886123.159872877, }, { x: 12945619.689717943, y: 4886769.72363822, }, { x: 12945442.673617564, y: 4887206.479468694, }, { x: 12945265.150235325, y: 4887443.841590078, }, { x: 12944956.967706354, y: 4887910.572665611, }, { x: 12944764.2703165, y: 4888414.954761419, }, { x: 12944490.393851373, y: 4889211.049688148, }, { x: 12944158.000725761, y: 4890227.3009047955, }, { x: 12943939.50054619, y: 4890938.589379339, }, { x: 12943741.193033013, y: 4891765.333179633, }, { x: 12943523.89343197, y: 4892817.059629789, }, { x: 12943477.185800951, y: 4893223.648609116, }, { x: 12943632.832055906, y: 4893581.194364219, }, { x: 12944230.352351204, y: 4893813.015893581, }, { x: 12944907.808217492, y: 4894017.717405242, }, { x: 12945120.621122792, y: 4894152.507246883, }, { x: 12945341.919177428, y: 4894481.916219006, }, ], }, { id: "11", source: "22", target: "23", class: "地铁八通线", name: "地铁八通线 0", controlPoints: [ { x: 12970985.252146643, y: 4852637.932500459, }, { x: 12971008.063154463, y: 4852637.603850775, }, { x: 12971057.7816163, y: 4852638.1331448015, }, { x: 12971134.73710355, y: 4852640.9154947065, }, { x: 12971179.237531189, y: 4852645.416718783, }, { x: 12971201.570727265, y: 4852648.649302951, }, { x: 12971249.17801756, y: 4852658.196621391, }, { x: 12971255.746157914, y: 4852659.512994105, }, { x: 12971346.991565293, y: 4852680.378101265, }, { x: 12971465.503559206, y: 4852715.45222975, }, { x: 12971556.44305453, y: 4852739.194460047, }, { x: 12971603.653185746, y: 4852750.417086441, }, { x: 12971652.445129333, y: 4852760.353265841, }, { x: 12971690.783407204, y: 4852768.115819445, }, { x: 12971748.39988629, y: 4852774.830285477, }, { x: 12971832.350691043, y: 4852785.209187933, }, { x: 12971909.010570884, y: 4852791.801163421, }, { x: 12971924.359283764, y: 4852792.523685262, }, { x: 12971999.921089781, y: 4852796.079471216, }, { x: 12972107.290890923, y: 4852793.567220141, }, { x: 12972304.93984065, y: 4852791.354142118, }, { x: 12972304.939940628, y: 4852791.354142104, }, { x: 12972558.358169641, y: 4852786.198665246, }, { x: 12972686.068063304, y: 4852781.700119552, }, { x: 12972843.240578711, y: 4852778.233391634, }, { x: 12972922.890764125, y: 4852776.13617569, }, { x: 12973043.782765854, y: 4852773.582308092, }, { x: 12973160.438646115, y: 4852771.291533754, }, { x: 12973301.369215274, y: 4852766.977022844, }, { x: 12973376.555572206, y: 4852766.575507644, }, { x: 12973483.79407899, y: 4852764.105804903, }, { x: 12973602.57893526, y: 4852764.972085765, }, { x: 12973986.241797326, y: 4852757.068452248, }, { x: 12974216.115580516, y: 4852753.700414064, }, { x: 12974536.719347281, y: 4852751.372519053, }, { x: 12974901.466203645, y: 4852758.063962363, }, { x: 12974983.483695555, y: 4852759.700171818, }, { x: 12975075.477382166, y: 4852761.366109267, }, { x: 12975146.21345055, y: 4852762.740995125, }, { x: 12975252.652350875, y: 4852765.001749013, }, { x: 12975418.029274665, y: 4852769.231663441, }, { x: 12975512.274773095, y: 4852771.693583396, }, { x: 12975667.430020995, y: 4852774.665220624, }, { x: 12975945.482280165, y: 4852780.652428524, }, { x: 12976048.941242512, y: 4852783.088273825, }, { x: 12976157.13466884, y: 4852786.1686903015, }, { x: 12976200.541262798, y: 4852787.159456441, }, { x: 12976234.258291336, y: 4852787.5677579185, }, { x: 12976365.991912834, y: 4852790.688773559, }, { x: 12976483.576280847, y: 4852793.632750944, }, { x: 12976521.657226892, y: 4852795.637126801, }, { x: 12976580.431624653, y: 4852800.4899075935, }, { x: 12976630.833259074, y: 4852806.145179798, }, { x: 12976695.08046594, y: 4852815.315654606, }, { x: 12976729.999958823, y: 4852820.657543227, }, { x: 12976776.474955026, y: 4852827.352541805, }, { x: 12976812.252139, y: 4852833.2147945, }, { x: 12976815.968375333, y: 4852833.822868197, }, { x: 12976885.429953378, y: 4852844.764512234, }, { x: 12976975.596115217, y: 4852858.43044723, }, { x: 12977055.606962522, y: 4852871.247395306, }, { x: 12977150.103301922, y: 4852886.690040669, }, { x: 12977164.484104557, y: 4852889.144325767, }, { x: 12977349.452764807, y: 4852911.35750741, }, { x: 12977396.826802246, y: 4852914.6312842835, }, { x: 12977445.21322845, y: 4852917.3740233835, }, { x: 12977499.905881032, y: 4852919.653667679, }, { x: 12977561.24229945, y: 4852918.623041482, }, { x: 12977618.078808535, y: 4852916.964759332, }, { x: 12977670.621610347, y: 4852911.879830347, }, { x: 12977751.148635335, y: 4852902.670739922, }, { x: 12977786.88548381, y: 4852897.948010646, }, { x: 12977824.596628416, y: 4852892.215955226, }, { x: 12977838.222668163, y: 4852889.785354156, }, { x: 12977897.63684129, y: 4852879.987122803, }, { x: 12978112.587513769, y: 4852847.147889897, }, { x: 12978212.010580407, y: 4852831.849550509, }, { x: 12978289.722346092, y: 4852819.825778696, }, { x: 12978376.198797919, y: 4852806.369032904, }, { x: 12978443.1247446, y: 4852796.941799674, }, { x: 12978511.962721677, y: 4852789.040221515, }, { x: 12978556.675266935, y: 4852784.800445814, }, { x: 12978603.675698506, y: 4852781.445204418, }, { x: 12978657.285893984, y: 4852778.451914039, }, { x: 12978800.565625936, y: 4852773.68229988, }, { x: 12978914.98070244, y: 4852769.67853182, }, { x: 12979058.626918213, y: 4852765.050844271, }, { x: 12979117.93108979, y: 4852764.395843838, }, { x: 12979200.907964638, y: 4852760.896022486, }, { x: 12979376.070149522, y: 4852755.492429703, }, { x: 12979821.264409432, y: 4852740.865419091, }, { x: 12979869.005644636, y: 4852738.659817284, }, { x: 12980006.684293807, y: 4852733.642694393, }, { x: 12980010.412107708, y: 4852733.505705852, }, { x: 12980102.14796544, y: 4852731.09585125, }, { x: 12980102.150365561, y: 4852731.095751376, }, { x: 12980241.426094191, y: 4852724.458911123, }, { x: 12980383.972661799, y: 4852720.275860491, }, { x: 12980452.567191115, y: 4852718.295604612, }, { x: 12980501.279651301, y: 4852717.168056968, }, { x: 12980511.817043953, y: 4852716.940679275, }, { x: 12980527.720170368, y: 4852714.900895137, }, { x: 12980546.205864942, y: 4852712.0589568885, }, { x: 12980556.739903979, y: 4852710.6345186, }, { x: 12980575.024717016, y: 4852707.192393184, }, { x: 12980600.064811092, y: 4852702.138990685, }, { x: 12980620.733107321, y: 4852697.095017998, }, { x: 12980641.992123496, y: 4852691.0518540675, }, { x: 12980667.422524082, y: 4852682.803530873, }, { x: 12980697.81666234, y: 4852671.350689514, }, { x: 12980750.44375973, y: 4852646.269770028, }, { x: 12980789.758654011, y: 4852625.613153645, }, { x: 12980817.158831125, y: 4852610.176831961, }, { x: 12980871.562055342, y: 4852579.505635189, }, { x: 12980917.628692484, y: 4852553.447517574, }, { x: 12981043.583099704, y: 4852484.690581212, }, { x: 12981099.336563937, y: 4852456.01893319, }, { x: 12981140.890511304, y: 4852432.9686271055, }, { x: 12981182.135998141, y: 4852411.356320457, }, { x: 12981255.809566528, y: 4852369.673110186, }, { x: 12981306.254684363, y: 4852342.213287527, }, { x: 12981355.360464152, y: 4852316.156478455, }, { x: 12981380.125408497, y: 4852304.328818308, }, { x: 12981404.370375846, y: 4852293.9445663355, }, { x: 12981411.357722916, y: 4852291.019192892, }, { x: 12981429.138416857, y: 4852284.705685185, }, { x: 12981449.445248626, y: 4852278.144038033, }, { x: 12981466.988468504, y: 4852273.038244298, }, { x: 12981483.934169278, y: 4852269.01732057, }, { x: 12981501.72129354, y: 4852264.633525485, }, { x: 12981521.195052542, y: 4852260.970876668, }, { x: 12981540.429482171, y: 4852257.912291013, }, { x: 12981556.300366443, y: 4852255.823523872, }, { x: 12981570.366991611, y: 4852253.983978159, }, { x: 12981590.808079034, y: 4852252.37024785, }, { x: 12981606.562289793, y: 4852251.488995252, }, { x: 12981636.507357743, y: 4852250.579113849, }, { x: 12981656.356278451, y: 4852250.896393729, }, { x: 12981692.086214192, y: 4852252.868202504, }, { x: 12981714.223939104, y: 4852254.872887953, }, { x: 12981755.862461897, y: 4852261.416093576, }, { x: 12981787.756915031, y: 4852268.344546958, }, { x: 12981824.48947952, y: 4852277.740325138, }, { x: 12982006.994348593, y: 4852327.843007399, }, { x: 12982014.941592565, y: 4852330.480576966, }, { x: 12982026.402121745, y: 4852333.381042817, }, { x: 12982040.946943458, y: 4852337.063108767, }, { x: 12982067.796619976, y: 4852344.124059822, }, { x: 12982082.244231999, y: 4852347.351909036, }, { x: 12982111.255736986, y: 4852353.085681991, }, { x: 12982129.791819442, y: 4852355.941803544, }, { x: 12982150.73459613, y: 4852358.6745200455, }, { x: 12982173.599064307, y: 4852360.678826859, }, { x: 12982199.590729142, y: 4852362.073329141, }, { x: 12982224.25684918, y: 4852362.508778318, }, { x: 12982242.781496631, y: 4852362.108043774, }, { x: 12982265.278136691, y: 4852361.098500819, }, { x: 12982291.742691308, y: 4852358.874468977, }, { x: 12982315.67474395, y: 4852355.811827975, }, { x: 12982335.035976896, y: 4852352.394862233, }, { x: 12982357.042847889, y: 4852348.851728803, }, { x: 12982382.295058098, y: 4852343.857827946, }, { x: 12982417.531268932, y: 4852337.395309842, }, { x: 12982448.197524806, y: 4852331.785528333, }, { x: 12982478.86330164, y: 4852326.658255823, }, { x: 12982531.423479121, y: 4852319.199320662, }, { x: 12982583.51522219, y: 4852315.239714849, }, { x: 12982619.249260034, y: 4852313.483230399, }, { x: 12982707.726446714, y: 4852311.01354565, }, { x: 12982818.643484026, y: 4852310.195081021, }, { x: 12982926.718911368, y: 4852308.423580399, }, { x: 12982969.351654056, y: 4852307.719497175, }, { x: 12983023.546593202, y: 4852306.599390685, }, { x: 12983109.423810175, y: 4852304.789328974, }, { x: 12983167.539974144, y: 4852304.283514513, }, { x: 12983217.219463198, y: 4852303.191877694, }, { x: 12983281.254377576, y: 4852302.216069689, }, { x: 12983366.75675525, y: 4852300.701005913, }, { x: 12983452.20281669, y: 4852299.1755383825, }, { x: 12983534.11611313, y: 4852296.359641885, }, { x: 12983559.667424409, y: 4852295.629501179, }, { x: 12983601.161266102, y: 4852294.627091015, }, { x: 12983611.984969016, y: 4852293.890433964, }, { x: 12983622.368472738, y: 4852292.692271228, }, { x: 12983631.964793393, y: 4852291.967613732, }, { x: 12983642.347676827, y: 4852290.532228432, }, { x: 12983664.288969724, y: 4852286.790795176, }, { x: 12983681.665854465, y: 4852283.294093203, }, { x: 12983691.650165133, y: 4852280.518425564, }, { x: 12983704.937446222, y: 4852276.871566698, }, { x: 12983719.485094307, y: 4852271.960088485, }, { x: 12983734.576153021, y: 4852266.573224977, }, { x: 12983749.349894535, y: 4852260.636238543, }, { x: 12983764.356448224, y: 4852253.439065454, }, { x: 12983783.229950167, y: 4852243.675282068, }, { x: 12983809.54016834, y: 4852227.647694631, }, { x: 12983819.177255707, y: 4852221.021988448, }, { x: 12983830.24508297, y: 4852212.4117375035, }, { x: 12983845.626987867, y: 4852200.007109512, }, { x: 12983856.53356637, y: 4852190.291205582, }, { x: 12983870.184671514, y: 4852177.732756121, }, { x: 12983883.752366735, y: 4852163.04569551, }, { x: 12983893.242055438, y: 4852153.491082963, }, { x: 12983901.156669818, y: 4852143.226680874, }, { x: 12983911.419729222, y: 4852128.860448257, }, { x: 12983920.032326968, y: 4852115.678436422, }, { x: 12983928.333826244, y: 4852103.047421788, }, { x: 12983936.314326718, y: 4852088.763105886, }, { x: 12983946.18360984, y: 4852068.498493203, }, { x: 12984045.08972995, y: 4851885.404455599, }, { x: 12984080.804905687, y: 4851817.337034466, }, { x: 12984134.748354, y: 4851706.836804487, }, { x: 12984195.8623765, y: 4851591.525543062, }, { x: 12984254.587788567, y: 4851478.621198026, }, { x: 12984307.768564539, y: 4851379.326535712, }, { x: 12984344.27421628, y: 4851308.864740265, }, { x: 12984375.225174434, y: 4851249.609910724, }, { x: 12984415.701271733, y: 4851172.74323114, }, { x: 12984461.729403371, y: 4851084.666569579, }, { x: 12984517.277267791, y: 4850976.575614915, }, { x: 12984628.35638987, y: 4850756.39703862, }, { x: 12984643.441411281, y: 4850729.173746353, }, { x: 12984659.718515014, y: 4850700.1083314745, }, { x: 12984681.711487297, y: 4850670.601281623, }, { x: 12984717.725659953, y: 4850629.896011068, }, { x: 12984754.999484044, y: 4850595.784380661, }, { x: 12984794.35474119, y: 4850566.24036794, }, { x: 12984822.179769346, y: 4850548.063337961, }, { x: 12984863.461169159, y: 4850526.723240278, }, { x: 12984915.289983816, y: 4850505.12020892, }, { x: 12984951.72965507, y: 4850491.149559257, }, { x: 12985164.594748862, y: 4850408.269419757, }, { x: 12985223.73663421, y: 4850386.334720776, }, { x: 12985231.332473703, y: 4850382.288306166, }, { x: 12985243.255608164, y: 4850375.964354305, }, { x: 12985309.485768877, y: 4850350.550316565, }, { x: 12985309.485868897, y: 4850350.550316587, }, { x: 12986172.233193466, y: 4850032.791403444, }, { x: 12986172.8663129, y: 4850032.558329904, }, { x: 12986339.175501348, y: 4849968.327595861, }, { x: 12986505.507225916, y: 4849904.089056084, }, { x: 12986656.604391119, y: 4849847.60963517, }, { x: 12986702.483696718, y: 4849828.918664281, }, { x: 12986760.975453354, y: 4849792.3676841725, }, { x: 12986797.326063676, y: 4849765.012441939, }, { x: 12986830.880906345, y: 4849735.181111031, }, { x: 12986886.127819829, y: 4849677.217710046, }, { x: 12987120.13083682, y: 4849429.888750661, }, { x: 12987545.455182405, y: 4848990.56075093, }, { x: 12987572.780970717, y: 4848962.972667584, }, { x: 12987750.347789623, y: 4848775.995218805, }, { x: 12987812.698881118, y: 4848712.132626582, }, { x: 12987888.840439832, y: 4848629.514697122, }, { x: 12987922.383888729, y: 4848595.374774107, }, { x: 12988054.963756831, y: 4848456.434616343, }, { x: 12988203.560175221, y: 4848293.895912913, }, { x: 12988250.566429619, y: 4848245.193567729, }, { x: 12988306.722374829, y: 4848191.552325912, }, { x: 12988429.814042207, y: 4848060.358476343, }, { x: 12988509.892477134, y: 4847972.732590752, }, { x: 12988516.052521963, y: 4847966.473292817, }, { x: 12988531.25232795, y: 4847951.020837734, }, { x: 12988547.774189414, y: 4847934.22664656, }, { x: 12988684.205479793, y: 4847792.520992836, }, { x: 12988709.83813206, y: 4847765.978322433, }, { x: 12988751.064218508, y: 4847721.917838166, }, { x: 12988806.893480845, y: 4847664.753238427, }, { x: 12988838.47984446, y: 4847638.4005759265, }, { x: 12988863.550537288, y: 4847617.484576525, }, { x: 12988871.447747946, y: 4847610.900250857, }, { x: 12988928.71596574, y: 4847568.305396379, }, { x: 12989015.639990052, y: 4847513.087871169, }, { x: 12989070.178705394, y: 4847482.192075563, }, { x: 12989148.863691295, y: 4847447.998694799, }, { x: 12989221.630766438, y: 4847420.154502207, }, { x: 12989339.331564289, y: 4847380.68202523, }, { x: 12989542.519483887, y: 4847312.531220079, }, { x: 12989591.848173946, y: 4847295.984625068, }, ], }, { id: "12", source: "24", target: "25", class: "城铁十三号线", name: "城铁十三号线 0", controlPoints: [ { x: 12961384.821093876, y: 4857604.895638846, }, { x: 12961379.888425605, y: 4857950.407662031, }, { x: 12961378.603161972, y: 4858178.984029268, }, { x: 12961378.251699504, y: 4858199.941669665, }, { x: 12961362.948288757, y: 4859113.050576728, }, { x: 12961351.774871988, y: 4859246.305776181, }, { x: 12961344.673628464, y: 4859330.995740561, }, { x: 12961338.185205506, y: 4859379.136027955, }, { x: 12961326.701474292, y: 4859430.3762181355, }, { x: 12961296.23872469, y: 4859534.623118192, }, { x: 12961279.573160157, y: 4859595.157872784, }, { x: 12961271.432916135, y: 4859636.755033974, }, { x: 12961227.692613533, y: 4859930.467545727, }, { x: 12961219.290961184, y: 4859990.017196776, }, { x: 12961215.868152, y: 4860031.195887179, }, { x: 12961213.956200192, y: 4860042.603136049, }, { x: 12961206.891662417, y: 4860091.520899557, }, { x: 12961188.165871859, y: 4860211.789308975, }, { x: 12961182.052734978, y: 4860252.9748706035, }, { x: 12961177.381970651, y: 4860285.458304639, }, { x: 12961133.584798172, y: 4861282.165295659, }, { x: 12961131.197062261, y: 4861339.773361728, }, { x: 12961125.764970018, y: 4861465.195775947, }, { x: 12961124.551248107, y: 4861505.652557301, }, { x: 12961122.644612342, y: 4861570.024727552, }, { x: 12961122.505511757, y: 4861612.817632623, }, { x: 12961126.125387294, y: 4861656.679218022, }, { x: 12961134.236030966, y: 4861724.086379644, }, { x: 12961147.346890498, y: 4861783.573658952, }, { x: 12961169.949061126, y: 4861856.88455326, }, { x: 12961190.92239628, y: 4861908.443200537, }, { x: 12961244.80679, y: 4862017.212104109, }, { x: 12961785.271410704, y: 4863090.557436891, }, { x: 12962406.945922375, y: 4864318.974454228, }, { x: 12963018.284754738, y: 4865521.493683898, }, { x: 12963018.284854762, y: 4865521.493783919, }, { x: 12963224.051473433, y: 4866039.3565800125, }, { x: 12963500.971012274, y: 4867139.241053313, }, { x: 12963650.819367116, y: 4867725.703316142, }, { x: 12963888.949552327, y: 4868660.037686641, }, { x: 12964153.29996666, y: 4869706.424707541, }, { x: 12964161.049777685, y: 4869739.748010959, }, { x: 12964169.022003202, y: 4869783.887620618, }, { x: 12964169.79918989, y: 4869788.187596136, }, { x: 12964170.396725647, y: 4869792.28592288, }, { x: 12964178.09229784, y: 4869845.141780633, }, { x: 12964182.866363246, y: 4869906.602764703, }, { x: 12964186.742670394, y: 4869983.180502373, }, { x: 12964187.80107099, y: 4870004.059485736, }, { x: 12964194.767189663, y: 4870141.601109272, }, { x: 12964195.586355446, y: 4870157.791065987, }, { x: 12964195.629143188, y: 4870158.625753281, }, { x: 12964197.365642045, y: 4870232.162939279, }, { x: 12964199.986983918, y: 4870338.989878203, }, { x: 12964198.233979, y: 4870399.4780171625, }, { x: 12964195.521848764, y: 4870426.330630218, }, { x: 12964189.688597165, y: 4870457.628060375, }, { x: 12964178.76505046, y: 4870495.275356304, }, { x: 12964167.839258399, y: 4870529.241804792, }, { x: 12964156.90262342, y: 4870556.635705516, }, { x: 12964139.446759911, y: 4870591.940950339, }, { x: 12964119.380342938, y: 4870629.3612662265, }, { x: 12964087.063558495, y: 4870686.289743977, }, { x: 12964065.951472988, y: 4870723.716488513, }, { x: 12964052.918280806, y: 4870746.119234959, }, { x: 12964041.187130783, y: 4870764.046505531, }, { x: 12964018.239456784, y: 4870796.744059516, }, { x: 12963997.373145364, y: 4870821.018842714, }, { x: 12963975.979364637, y: 4870842.403550631, }, { x: 12963943.620649595, y: 4870869.876901368, }, { x: 12963912.565489624, y: 4870894.189978186, }, { x: 12963888.553606404, y: 4870910.587164291, }, { x: 12963855.921490764, y: 4870928.856058391, }, { x: 12963818.847341483, y: 4870946.088721298, }, { x: 12963778.372132206, y: 4870961.231012497, }, { x: 12963730.060326898, y: 4870976.4015065245, }, { x: 12963657.978381645, y: 4870995.602780929, }, { x: 12963622.05854108, y: 4871004.430416085, }, { x: 12963558.724530451, y: 4871019.810885714, }, { x: 12963512.503679566, y: 4871035.906957649, }, { x: 12963453.681321735, y: 4871059.763481818, }, { x: 12963248.80497939, y: 4871172.328870646, }, { x: 12963244.572822267, y: 4871174.658396504, }, { x: 12963038.471529033, y: 4871288.035313995, }, { x: 12962853.820973437, y: 4871391.186996228, }, { x: 12962725.303994041, y: 4871462.571934574, }, { x: 12962724.957375426, y: 4871462.752610938, }, { x: 12962723.887909118, y: 4871463.345629024, }, { x: 12962716.736546198, y: 4871467.315161244, }, { x: 12962716.284189595, y: 4871467.567097997, }, { x: 12962579.957906647, y: 4871543.225352538, }, { x: 12962098.530270364, y: 4871808.314025743, }, { x: 12961985.615570927, y: 4871875.438409937, }, { x: 12961943.360948866, y: 4871903.003423259, }, { x: 12961806.371053975, y: 4871987.009769704, }, { x: 12961737.483883223, y: 4872026.3265607115, }, { x: 12961633.115452316, y: 4872086.751682198, }, { x: 12961545.844782017, y: 4872134.320089415, }, { x: 12961361.563495556, y: 4872236.98400638, }, { x: 12961327.331658702, y: 4872255.833857056, }, { x: 12961251.875342408, y: 4872297.087065438, }, { x: 12961204.826219695, y: 4872325.325771341, }, { x: 12961132.023615833, y: 4872361.658743605, }, { x: 12961052.11865231, y: 4872405.144750871, }, { x: 12960972.646711243, y: 4872441.930478759, }, { x: 12960858.106042854, y: 4872506.91698905, }, { x: 12960760.426450621, y: 4872559.359681711, }, { x: 12960724.908352494, y: 4872580.416320622, }, { x: 12960641.560702814, y: 4872626.948672511, }, { x: 12960409.848923735, y: 4872755.68364987, }, { x: 12960214.328045709, y: 4872860.212735837, }, { x: 12960127.928549424, y: 4872909.2953869505, }, { x: 12960102.655544914, y: 4872922.969133999, }, { x: 12960020.162988434, y: 4872967.3561403835, }, { x: 12959950.134860648, y: 4873006.403798974, }, { x: 12959863.03802686, y: 4873054.88910155, }, { x: 12959777.644680386, y: 4873104.258241601, }, { x: 12959699.508191582, y: 4873147.282306783, }, { x: 12959620.328795532, y: 4873191.4477808075, }, { x: 12959477.877193257, y: 4873269.404125038, }, { x: 12959357.123719096, y: 4873335.684058211, }, { x: 12959338.647690238, y: 4873345.82380848, }, { x: 12958925.449787276, y: 4873574.258471447, }, { x: 12958914.496696375, y: 4873580.313011027, }, { x: 12958908.925432095, y: 4873583.384761498, }, { x: 12958469.664608255, y: 4873826.333185746, }, { x: 12958317.119431961, y: 4873910.348894859, }, { x: 12958173.63725258, y: 4873989.354939118, }, { x: 12958109.864433711, y: 4874026.411209632, }, { x: 12958056.459419694, y: 4874055.42987156, }, { x: 12958035.572431948, y: 4874066.780988242, }, { x: 12957541.464879088, y: 4874339.316503633, }, { x: 12957541.314450411, y: 4874339.40007746, }, { x: 12957515.50602984, y: 4874353.589680841, }, { x: 12957515.424667433, y: 4874353.63521974, }, { x: 12957178.774763126, y: 4874538.369890689, }, { x: 12957143.891148778, y: 4874557.897348821, }, { x: 12956953.433700653, y: 4874662.620502712, }, { x: 12956865.14112665, y: 4874711.491226545, }, { x: 12956730.395010892, y: 4874784.283691582, }, { x: 12956584.60989753, y: 4874864.17479837, }, { x: 12956514.690003015, y: 4874902.207189248, }, { x: 12956415.921079142, y: 4874957.945257982, }, { x: 12956350.318605551, y: 4874993.942196934, }, { x: 12955970.523661379, y: 4875204.572856644, }, { x: 12955961.168925371, y: 4875209.826648806, }, { x: 12955608.616340334, y: 4875403.58048848, }, { x: 12955424.989326235, y: 4875505.19312055, }, { x: 12955208.191654494, y: 4875621.246472876, }, { x: 12955106.685266893, y: 4875676.949542184, }, { x: 12954909.088653814, y: 4875785.6214146055, }, { x: 12954898.699293226, y: 4875791.33469513, }, { x: 12954809.86015897, y: 4875840.183103034, }, { x: 12954515.78755851, y: 4876003.857567704, }, { x: 12954425.351083811, y: 4876047.515434021, }, { x: 12954361.536701877, y: 4876075.173523097, }, { x: 12954318.522177251, y: 4876092.11950955, }, { x: 12954285.295954525, y: 4876103.586379883, }, { x: 12954230.248733655, y: 4876121.545707381, }, { x: 12954175.140615348, y: 4876137.686398102, }, { x: 12954117.372576779, y: 4876152.031328337, }, { x: 12954117.372476779, y: 4876152.031328334, }, { x: 12954063.303781305, y: 4876163.662863832, }, { x: 12954007.331071056, y: 4876172.399246002, }, { x: 12953967.211788474, y: 4876178.65975709, }, { x: 12953802.621925015, y: 4876196.237827291, }, { x: 12953668.73601341, y: 4876199.186105529, }, { x: 12953503.298073018, y: 4876194.053015986, }, { x: 12953435.898150826, y: 4876195.031116625, }, { x: 12952907.1719517, y: 4876202.110021278, }, { x: 12952854.57708836, y: 4876202.818902422, }, { x: 12952810.046254802, y: 4876203.418551955, }, { x: 12952736.613090457, y: 4876203.294253911, }, { x: 12952624.4348891, y: 4876204.555723625, }, { x: 12952552.43031391, y: 4876204.964896776, }, { x: 12952497.943888191, y: 4876207.608055034, }, { x: 12952468.042451413, y: 4876210.829014632, }, { x: 12952437.79969268, y: 4876214.509841102, }, { x: 12952375.588643614, y: 4876223.886731359, }, { x: 12952301.856311196, y: 4876236.1209624605, }, { x: 12952251.31522576, y: 4876242.8451233655, }, { x: 12952214.021838313, y: 4876246.965370512, }, { x: 12952162.807325037, y: 4876250.527753233, }, { x: 12952103.452750135, y: 4876251.697783142, }, { x: 12952023.611417918, y: 4876253.082581543, }, { x: 12951892.55511939, y: 4876253.812631988, }, { x: 12951846.328905031, y: 4876253.171084735, }, { x: 12951802.992080217, y: 4876249.116505366, }, { x: 12951766.843265098, y: 4876244.26441203, }, { x: 12951714.743373726, y: 4876233.633230178, }, { x: 12951654.073062496, y: 4876222.691277131, }, { x: 12951616.46554052, y: 4876216.252301995, }, { x: 12951584.63468386, y: 4876213.574076274, }, { x: 12951561.015438031, y: 4876212.359467597, }, { x: 12951502.289814433, y: 4876212.143345088, }, { x: 12951293.085304, y: 4876214.875420837, }, { x: 12951031.075470097, y: 4876215.897535212, }, { x: 12950959.097605025, y: 4876216.275884133, }, { x: 12950894.730929183, y: 4876215.974946514, }, { x: 12950773.64057589, y: 4876216.703301484, }, { x: 12950673.746751422, y: 4876225.670588799, }, { x: 12950616.565179903, y: 4876229.034309006, }, { x: 12950568.486162541, y: 4876230.042798452, }, { x: 12950375.145719487, y: 4876231.976121928, }, { x: 12950194.78158641, y: 4876234.464466195, }, { x: 12950048.658437809, y: 4876236.2574803205, }, { x: 12950001.4772779, y: 4876235.293804152, }, { x: 12949948.747199, y: 4876229.307334167, }, { x: 12949849.140274497, y: 4876224.443260822, }, { x: 12948886.90103617, y: 4876237.644317312, }, { x: 12948886.90093617, y: 4876237.644317315, }, { x: 12948715.380098497, y: 4876239.997015189, }, { x: 12948425.68643085, y: 4876243.705096172, }, { x: 12948424.112088347, y: 4876243.72353365, }, { x: 12948407.06491928, y: 4876243.944145824, }, { x: 12948405.98243078, y: 4876243.95624331, }, { x: 12948361.171213618, y: 4876244.531933125, }, { x: 12948356.092076505, y: 4876244.596227219, }, { x: 12948294.145588111, y: 4876245.390073654, }, { x: 12948293.421376245, y: 4876245.398151391, }, { x: 12948245.081662236, y: 4876246.017528498, }, { x: 12948244.258669348, y: 4876246.030423269, }, { x: 12948227.313400865, y: 4876246.246399225, }, { x: 12948226.443416782, y: 4876246.256701933, }, { x: 12948223.250043418, y: 4876246.298279974, }, { x: 12947945.409350824, y: 4876250.961636466, }, { x: 12947934.332267188, y: 4876250.890472651, }, { x: 12947877.07401595, y: 4876250.914315445, }, { x: 12947815.021065967, y: 4876253.851354821, }, { x: 12947763.487477783, y: 4876261.1465055365, }, { x: 12947725.059790507, y: 4876269.052617193, }, { x: 12947653.430817837, y: 4876293.225426714, }, { x: 12947609.2695425, y: 4876314.985599062, }, { x: 12947579.101654992, y: 4876329.096570221, }, { x: 12947532.916624067, y: 4876357.08904473, }, { x: 12947462.2262063, y: 4876393.072714213, }, { x: 12947421.555621969, y: 4876408.477083252, }, { x: 12947369.78948997, y: 4876424.051528886, }, { x: 12947316.08051995, y: 4876430.96623273, }, { x: 12947288.108453162, y: 4876433.523245403, }, { x: 12947233.34126908, y: 4876432.790803788, }, { x: 12947188.401168212, y: 4876429.088000529, }, { x: 12947141.165666422, y: 4876420.772086076, }, { x: 12947111.803456603, y: 4876412.760024161, }, { x: 12947064.825877437, y: 4876399.584901326, }, { x: 12947029.14763327, y: 4876383.288698463, }, { x: 12947000.45767468, y: 4876366.611471653, }, { x: 12946972.12493202, y: 4876348.110056718, }, { x: 12946952.979055353, y: 4876335.007395409, }, { x: 12946936.827550543, y: 4876323.077202845, }, { x: 12946921.333707113, y: 4876310.548771458, }, { x: 12946816.8297496, y: 4876219.287650481, }, { x: 12946732.699527778, y: 4876127.270037018, }, { x: 12946657.488720905, y: 4876045.210086455, }, { x: 12946622.587940522, y: 4875983.965371542, }, { x: 12946496.471341081, y: 4875762.643722024, }, { x: 12946423.522392513, y: 4875557.850478406, }, { x: 12946399.995473424, y: 4875459.537530149, }, { x: 12946396.978958678, y: 4875437.0025600875, }, { x: 12946396.993859813, y: 4875409.162322274, }, { x: 12946399.79561764, y: 4875362.09033934, }, { x: 12946402.86393251, y: 4875338.563648224, }, { x: 12946405.625597931, y: 4875320.088412483, }, { x: 12946410.942566253, y: 4875295.299492259, }, { x: 12946416.254743187, y: 4875274.811186232, }, { x: 12946428.647654204, y: 4875238.394850413, }, { x: 12946449.128231185, y: 4875187.827926565, }, { x: 12946468.842936842, y: 4875151.68413807, }, { x: 12946489.817988945, y: 4875118.8342050975, }, { x: 12946522.546502326, y: 4875072.470895908, }, { x: 12946570.68181112, y: 4875007.932055009, }, { x: 12946590.31852286, y: 4874978.982263895, }, { x: 12946617.815584973, y: 4874935.88435813, }, { x: 12946646.325475948, y: 4874873.520782715, }, { x: 12946820.499390153, y: 4874459.418667514, }, { x: 12946888.30456704, y: 4874294.857213484, }, { x: 12946930.646429846, y: 4874192.6851136675, }, { x: 12946949.005201655, y: 4874148.378390104, }, { x: 12947044.284756513, y: 4873918.4637040915, }, { x: 12947056.289818808, y: 4873889.083139696, }, { x: 12947165.66572366, y: 4873622.718414709, }, { x: 12947202.737800827, y: 4873531.999517411, }, { x: 12947209.63262473, y: 4873515.652391753, }, { x: 12947273.282788856, y: 4873364.7546024555, }, { x: 12947273.708122, y: 4873363.743532597, }, { x: 12947287.460317507, y: 4873331.140831067, }, { x: 12947304.830566434, y: 4873289.959057868, }, { x: 12947411.8537799, y: 4873054.533746381, }, { x: 12947541.50808741, y: 4872842.7485984, }, { x: 12947580.982706897, y: 4872777.370338213, }, { x: 12947615.711724276, y: 4872723.318503141, }, { x: 12947649.183798542, y: 4872667.856626571, }, { x: 12947675.12323022, y: 4872624.93555951, }, { x: 12947696.263067583, y: 4872593.158431816, }, { x: 12947734.29565014, y: 4872530.60731087, }, { x: 12947764.795609327, y: 4872480.528620551, }, { x: 12947824.300805386, y: 4872380.158015446, }, { x: 12947865.335921923, y: 4872300.691582129, }, { x: 12947868.4019642, y: 4872293.260799115, }, { x: 12947877.607004203, y: 4872273.69886109, }, { x: 12947897.445241943, y: 4872226.595834379, }, { x: 12947927.647142874, y: 4872153.107787066, }, { x: 12947994.798658265, y: 4871994.343646774, }, { x: 12948026.296440713, y: 4871921.612665893, }, { x: 12948040.948586507, y: 4871894.217878682, }, { x: 12948057.308193548, y: 4871865.8032324435, }, { x: 12948067.326472418, y: 4871850.338413439, }, { x: 12948081.773480348, y: 4871830.043075507, }, { x: 12948106.005618699, y: 4871796.572364472, }, { x: 12948147.255517324, y: 4871752.044003956, }, { x: 12948212.569000661, y: 4871679.780786607, }, { x: 12948214.328663053, y: 4871677.809478982, }, { x: 12948273.504086189, y: 4871611.484093596, }, { x: 12948317.798932584, y: 4871561.862160343, }, { x: 12948344.377879875, y: 4871527.5162396645, }, { x: 12948380.890677512, y: 4871477.605026336, }, { x: 12948413.38959998, y: 4871425.5829799725, }, { x: 12948414.44249342, y: 4871423.82499065, }, { x: 12948447.049964357, y: 4871369.071132418, }, { x: 12948447.986775042, y: 4871367.444350426, }, { x: 12948505.566148069, y: 4871267.333064074, }, { x: 12948544.503004055, y: 4871190.001687928, }, { x: 12948579.413090972, y: 4871111.04819233, }, { x: 12948621.84723699, y: 4871002.001678927, }, { x: 12948649.245005308, y: 4870919.800386681, }, { x: 12948729.034075115, y: 4870659.041565615, }, { x: 12948806.660201645, y: 4870408.542141671, }, { x: 12948816.10369674, y: 4870377.056894108, }, { x: 12948817.112454178, y: 4870373.69505771, }, { x: 12948822.827115472, y: 4870354.633454126, }, { x: 12948823.264697373, y: 4870353.177438731, }, { x: 12948871.583647873, y: 4870192.062297062, }, { x: 12948888.256377492, y: 4870137.412837239, }, { x: 12948888.256477488, y: 4870137.412437243, }, { x: 12948981.13241698, y: 4869833.0181290535, }, { x: 12949020.38513926, y: 4869703.696545276, }, { x: 12949062.757994082, y: 4869570.843921744, }, { x: 12949090.169382466, y: 4869479.2850293545, }, { x: 12949123.989708498, y: 4869371.588525548, }, { x: 12949143.001308247, y: 4869300.813594804, }, { x: 12949146.761492698, y: 4869288.429210793, }, { x: 12949163.7803404, y: 4869233.145301005, }, { x: 12949175.026622072, y: 4869195.787679086, }, { x: 12949196.938022848, y: 4869123.013569744, }, { x: 12949208.873643316, y: 4869083.2070951825, }, { x: 12949223.461787153, y: 4869036.1056654295, }, { x: 12949242.728116639, y: 4868973.956351733, }, { x: 12949271.681629652, y: 4868877.983261017, }, { x: 12949297.10128093, y: 4868796.606128646, }, { x: 12949301.07802554, y: 4868786.43636378, }, { x: 12949316.770515563, y: 4868745.313714858, }, { x: 12949322.956596527, y: 4868730.50358208, }, { x: 12949339.748933367, y: 4868696.689288448, }, { x: 12949362.183788385, y: 4868657.470406632, }, { x: 12949389.99988878, y: 4868612.036959275, }, { x: 12949405.211090067, y: 4868588.465232985, }, { x: 12949424.342096223, y: 4868564.828507317, }, { x: 12949513.190764954, y: 4868460.242782986, }, { x: 12949542.465744024, y: 4868426.322580645, }, { x: 12949544.338502375, y: 4868424.150033486, }, { x: 12949600.872280473, y: 4868356.658526145, }, { x: 12949646.996273136, y: 4868303.803243655, }, { x: 12949696.144125719, y: 4868246.537783951, }, { x: 12949755.723785738, y: 4868181.855453389, }, { x: 12949832.37526342, y: 4868093.127098315, }, { x: 12949851.813717443, y: 4868068.399532126, }, { x: 12949894.667583121, y: 4868017.630119035, }, { x: 12949932.221547332, y: 4867975.033422636, }, { x: 12949984.350867936, y: 4867915.6628556745, }, { x: 12950051.280432409, y: 4867836.640979047, }, { x: 12950119.532814305, y: 4867759.173557603, }, { x: 12950170.049738903, y: 4867700.545102677, }, { x: 12950196.18372548, y: 4867669.647630281, }, { x: 12950245.012623828, y: 4867612.641024118, }, { x: 12950366.341310102, y: 4867472.554440256, }, { x: 12950396.016682621, y: 4867437.159853344, }, { x: 12950433.41414459, y: 4867388.174952161, }, { x: 12950467.047766922, y: 4867337.197051575, }, { x: 12950472.727024797, y: 4867327.624837841, }, { x: 12950504.43931956, y: 4867270.541731104, }, { x: 12950506.66515916, y: 4867265.686943075, }, { x: 12950513.328076823, y: 4867251.147877864, }, { x: 12950522.125427773, y: 4867231.948518946, }, { x: 12950543.25084689, y: 4867180.747377998, }, { x: 12950554.610753339, y: 4867148.755648968, }, { x: 12950565.938845547, y: 4867113.7289358685, }, { x: 12950577.077540115, y: 4867070.725547691, }, { x: 12950584.992247868, y: 4867034.253515085, }, { x: 12950597.570781464, y: 4866945.446932178, }, { x: 12950602.621253733, y: 4866858.218872007, }, { x: 12950604.351725787, y: 4866798.591035709, }, { x: 12950604.673463916, y: 4866769.830411211, }, { x: 12950608.500044588, y: 4866652.0108254915, }, { x: 12950610.319620667, y: 4866589.554543856, }, { x: 12950610.359324489, y: 4866588.2321465295, }, { x: 12950610.80126891, y: 4866566.6265690895, }, { x: 12950612.409021743, y: 4866522.173389596, }, { x: 12950616.621330654, y: 4866372.98018754, }, { x: 12950618.97605836, y: 4866293.007567341, }, { x: 12950619.842244353, y: 4866255.184129226, }, { x: 12950625.910927346, y: 4866063.848140013, }, { x: 12950628.387367597, y: 4865977.081155829, }, { x: 12950629.753005603, y: 4865908.9763710955, }, { x: 12950632.086528255, y: 4865841.0262908945, }, { x: 12950632.35165354, y: 4865833.33471617, }, { x: 12950633.79978892, y: 4865801.28505746, }, { x: 12950635.690965662, y: 4865759.427843475, }, { x: 12950637.922484085, y: 4865674.26866093, }, { x: 12950641.139187874, y: 4865591.213986744, }, { x: 12950643.134781921, y: 4865519.6466930285, }, { x: 12950643.368005117, y: 4865509.419217591, }, { x: 12950643.529421674, y: 4865500.599934787, }, { x: 12950643.977363357, y: 4865491.176881495, }, { x: 12950644.362001631, y: 4865474.307022515, }, { x: 12950644.872350669, y: 4865458.107876617, }, { x: 12950645.130576981, y: 4865444.560304754, }, { x: 12950645.57682058, y: 4865427.882852814, }, { x: 12950645.993461674, y: 4865410.917198133, }, { x: 12950646.667225737, y: 4865391.909170426, }, { x: 12950647.177975576, y: 4865372.994126345, }, { x: 12950647.75493018, y: 4865357.594288625, }, { x: 12950648.042257652, y: 4865348.937219927, }, { x: 12950648.42689613, y: 4865331.427963337, }, { x: 12950649.226270262, y: 4865315.3585491525, }, { x: 12950650.507293697, y: 4865273.423391737, }, { x: 12950650.697711246, y: 4865269.97251224, }, { x: 12950651.401779896, y: 4865244.094692232, }, { x: 12950652.233156506, y: 4865229.016682226, }, { x: 12950652.74640693, y: 4865208.822741665, }, { x: 12950653.64269155, y: 4865185.438841808, }, { x: 12950654.09033895, y: 4865156.015598994, }, { x: 12950655.11473383, y: 4865135.615712103, }, { x: 12950655.81880249, y: 4865109.7205952415, }, { x: 12950656.266944723, y: 4865098.219646195, }, { x: 12950656.776491228, y: 4865090.42570183, }, { x: 12950657.610074416, y: 4865053.173004747, }, { x: 12950657.80429587, y: 4865037.45393246, }, { x: 12950665.057790544, y: 4864813.469608394, }, { x: 12950666.31470639, y: 4864789.756353396, }, { x: 12950666.825456835, y: 4864768.799620799, }, { x: 12950667.593330417, y: 4864744.839817025, }, { x: 12950667.977868663, y: 4864728.163469017, }, { x: 12950669.195489043, y: 4864677.813533126, }, { x: 12950669.835947098, y: 4864668.869905654, }, { x: 12950670.091873968, y: 4864653.088344843, }, { x: 12950670.988058263, y: 4864630.3428553175, }, { x: 12950670.92435391, y: 4864626.509652139, }, { x: 12950671.691826217, y: 4864606.63864744, }, { x: 12950672.203278288, y: 4864580.504222692, }, { x: 12950673.228074549, y: 4864554.884550185, }, { x: 12950673.73952671, y: 4864528.497326723, }, { x: 12950674.890434487, y: 4864500.769470086, }, { x: 12950675.2757754, y: 4864475.593033784, }, { x: 12950675.409487799, y: 4864472.776850138, }, { x: 12950676.010148842, y: 4864442.529341358, }, { x: 12950677.468085546, y: 4864406.737226046, }, { x: 12950678.344374934, y: 4864361.629262644, }, { x: 12950681.645047376, y: 4864252.127616024, }, { x: 12950682.9547692, y: 4864216.335625385, }, { x: 12950683.100682352, y: 4864214.154238779, }, { x: 12950684.236285895, y: 4864191.999439908, }, { x: 12950685.866634507, y: 4864160.1778856525, }, { x: 12950689.79278639, y: 4864108.3870529765, }, { x: 12950689.938599342, y: 4864106.931066905, }, { x: 12950697.064031562, y: 4864036.379448896, }, { x: 12950699.534748787, y: 4864019.216889406, }, { x: 12950699.680561578, y: 4864018.345103669, }, { x: 12950716.396330617, y: 4863888.161824789, }, { x: 12950718.57772101, y: 4863874.636737837, }, { x: 12950718.577821152, y: 4863874.05533762, }, { x: 12950732.387228379, y: 4863767.873478454, }, { x: 12950748.375318805, y: 4863648.896232093, }, { x: 12950765.67291641, y: 4863514.502311158, }, { x: 12950777.731654065, y: 4863426.117281793, }, { x: 12950782.448058736, y: 4863391.472539309, }, { x: 12950787.587200012, y: 4863348.835337318, }, { x: 12950801.256266356, y: 4863250.146561549, }, { x: 12950805.275908938, y: 4863217.932650578, }, { x: 12950818.28101368, y: 4863113.762708521, }, { x: 12950822.999512516, y: 4863078.5401642835, }, { x: 12950827.797217675, y: 4863040.997227563, }, { x: 12950833.851926966, y: 4862997.421011249, }, { x: 12950838.379305013, y: 4862973.344145836, }, { x: 12950848.476446522, y: 4862915.367113537, }, { x: 12950856.118280582, y: 4862873.256843487, }, { x: 12950862.060671719, y: 4862842.477409358, }, { x: 12950882.653269414, y: 4862709.589368273, }, { x: 12950907.883131918, y: 4862524.421459502, }, { x: 12950907.90533372, y: 4862524.26986159, }, { x: 12950920.067918759, y: 4862435.001208198, }, { x: 12950928.527198693, y: 4862379.783399951, }, { x: 12950939.681083987, y: 4862336.514125757, }, { x: 12950954.29343263, y: 4862293.863553435, }, { x: 12950967.571566563, y: 4862263.107846068, }, { x: 12950978.195387682, y: 4862240.704492119, }, { x: 12950999.06198339, y: 4862206.546426427, }, { x: 12951021.446772633, y: 4862168.969866098, }, { x: 12951097.70213785, y: 4862042.200138503, }, { x: 12951174.075577334, y: 4861915.693221821, }, { x: 12951267.776776478, y: 4861760.078948706, }, { x: 12951395.236453552, y: 4861519.784399533, }, { x: 12951412.303520849, y: 4861476.874540171, }, { x: 12951451.654131988, y: 4861334.408202046, }, { x: 12951451.745536273, y: 4861334.052106667, }, { x: 12951466.623726709, y: 4861241.564646258, }, { x: 12951489.13393889, y: 4861018.001826673, }, { x: 12951490.383194035, y: 4860999.999285448, }, { x: 12951491.439840542, y: 4860985.560035131, }, { x: 12951503.010040093, y: 4860889.175072468, }, { x: 12951531.140403, y: 4860680.970427163, }, { x: 12951557.758936353, y: 4860485.587344637, }, { x: 12951565.10420882, y: 4860453.124738692, }, { x: 12951575.364280945, y: 4860406.458640103, }, { x: 12951581.065583235, y: 4860384.268158007, }, { x: 12951610.884689623, y: 4860288.296338669, }, { x: 12951620.19888619, y: 4860261.224956072, }, { x: 12951627.274605729, y: 4860242.081190622, }, { x: 12951637.413111666, y: 4860215.23171692, }, { x: 12951657.721893568, y: 4860163.979635463, }, { x: 12951666.949544173, y: 4860142.223200858, }, { x: 12951668.869595224, y: 4860137.696654858, }, { x: 12951693.982928237, y: 4860078.331821876, }, { x: 12951736.262245214, y: 4859972.802878212, }, { x: 12951779.310281485, y: 4859859.063131411, }, { x: 12951799.296553789, y: 4859804.14710355, }, { x: 12951825.224839896, y: 4859739.862680752, }, { x: 12951906.509982908, y: 4859546.26065336, }, { x: 12951960.443026407, y: 4859429.470375646, }, { x: 12951999.771882042, y: 4859335.105420177, }, { x: 12952032.435444733, y: 4859254.969474848, }, { x: 12952037.41706581, y: 4859242.9403781, }, { x: 12952060.923649335, y: 4859187.91377235, }, { x: 12952072.317820875, y: 4859160.3641980635, }, { x: 12952084.970246904, y: 4859131.4834706, }, { x: 12952113.084959969, y: 4859065.12985738, }, { x: 12952130.693674402, y: 4859023.732486952, }, { x: 12952141.643150551, y: 4858996.55370852, }, { x: 12952162.804377414, y: 4858947.308924186, }, { x: 12952171.755373834, y: 4858927.981571281, }, { x: 12952175.604139445, y: 4858917.094515989, }, { x: 12952180.82205369, y: 4858900.9651018735, }, { x: 12952184.554718394, y: 4858889.243946094, }, { x: 12952190.769288482, y: 4858868.280381973, }, { x: 12952193.507485226, y: 4858857.610563799, }, { x: 12952195.947291974, y: 4858845.681757747, }, { x: 12952197.797320686, y: 4858836.642376694, }, { x: 12952199.129268397, y: 4858825.304718492, }, { x: 12952203.716285268, y: 4858778.431416472, }, { x: 12952205.964993557, y: 4858749.46331663, }, { x: 12952207.408630643, y: 4858703.901754291, }, { x: 12952205.633196818, y: 4858677.13773786, }, { x: 12952200.97007183, y: 4858631.018552714, }, { x: 12952196.971420817, y: 4858601.209733323, }, { x: 12952192.67917836, y: 4858569.843524169, }, { x: 12952188.386933465, y: 4858539.217911885, }, { x: 12952168.84610709, y: 4858394.254627763, }, { x: 12952159.519210786, y: 4858329.002694597, }, { x: 12952158.632838566, y: 4858318.547228751, }, { x: 12952157.151183436, y: 4858288.818485506, }, { x: 12952156.706496444, y: 4858276.218902411, }, { x: 12952157.149780104, y: 4858257.685985396, }, { x: 12952159.218710119, y: 4858232.933605842, }, { x: 12952159.810389748, y: 4858223.449482893, }, { x: 12952162.532997137, y: 4858196.9427767545, }, { x: 12952172.755045319, y: 4858146.897168553, }, { x: 12952179.958089378, y: 4858120.216771117, }, { x: 12952191.658258049, y: 4858079.657970377, }, { x: 12952208.58059935, y: 4858022.51880722, }, { x: 12952216.501576891, y: 4857997.283134168, }, { x: 12952225.680391517, y: 4857966.100288983, }, { x: 12952269.24519301, y: 4857823.342887307, }, { x: 12952302.724863112, y: 4857711.949002681, }, ], }, { id: "13", source: "26", target: "27", class: "地铁十号线", name: "地铁十号线 0", controlPoints: [ { x: 12964391.173261674, y: 4847959.964747035, }, { x: 12964381.421162914, y: 4847238.950861313, }, { x: 12964379.013229802, y: 4847130.369249381, }, { x: 12964369.707333228, y: 4846953.233573841, }, { x: 12964365.098653296, y: 4846899.529372901, }, { x: 12964350.271597194, y: 4846844.7236321755, }, { x: 12964328.613459915, y: 4846773.943192761, }, { x: 12964303.571447244, y: 4846720.321707801, }, { x: 12964261.49123042, y: 4846658.767114734, }, { x: 12964219.422329223, y: 4846606.356004327, }, { x: 12964163.72308854, y: 4846548.283066274, }, { x: 12964117.115347376, y: 4846498.174184149, }, { x: 12963719.24125982, y: 4846081.363070078, }, { x: 12963666.940189386, y: 4846020.980269377, }, { x: 12963651.029381108, y: 4846008.466281171, }, { x: 12963640.792827746, y: 4845993.645627467, }, { x: 12963630.555030722, y: 4845977.682026026, }, { x: 12963622.579870086, y: 4845954.85254285, }, { x: 12963622.547271827, y: 4845927.422297171, }, { x: 12963624.705055857, y: 4845832.5516995825, }, { x: 12963605.106422728, y: 4844950.156548626, }, { x: 12963600.552929461, y: 4844939.887775902, }, { x: 12963641.28504856, y: 4844029.840890613, }, { x: 12963635.07102118, y: 4843895.785437119, }, { x: 12963592.56494142, y: 4843790.304489117, }, { x: 12963515.79594813, y: 4843723.544249312, }, { x: 12963437.02641232, y: 4843673.039785006, }, { x: 12963372.392513098, y: 4843630.608396946, }, { x: 12963273.452605404, y: 4843594.387913362, }, { x: 12963212.653908446, y: 4843577.914113967, }, { x: 12963206.82489125, y: 4843576.334664474, }, { x: 12963057.427614385, y: 4843550.431693091, }, { x: 12962954.477380954, y: 4843548.741287049, }, { x: 12962788.932332132, y: 4843539.119846538, }, { x: 12960734.413928954, y: 4843579.436506579, }, { x: 12960615.677401308, y: 4843579.296389959, }, { x: 12959224.804679275, y: 4843577.132908265, }, { x: 12958165.962075146, y: 4843552.786071934, }, { x: 12958015.842937116, y: 4843539.299682281, }, { x: 12957633.083574392, y: 4843505.052930688, }, { x: 12956758.552751072, y: 4843474.381786778, }, { x: 12956086.236845858, y: 4843457.686331021, }, { x: 12955417.836020822, y: 4843562.642953932, }, { x: 12955413.075883733, y: 4843564.0987397935, }, { x: 12955318.578314304, y: 4843592.994666116, }, { x: 12955279.765356282, y: 4843598.897849127, }, { x: 12955190.622782081, y: 4843602.847728858, }, { x: 12953646.394080758, y: 4843575.957979132, }, { x: 12953060.552869217, y: 4843574.760301962, }, { x: 12952787.031931885, y: 4843571.511276698, }, { x: 12951953.230827896, y: 4843561.903501986, }, { x: 12951924.357645055, y: 4843559.360785293, }, { x: 12951835.590379665, y: 4843551.541948503, }, { x: 12951527.588141518, y: 4843484.482094485, }, { x: 12951075.84273588, y: 4843410.169546208, }, { x: 12950795.208394462, y: 4843386.56777375, }, { x: 12950199.79003986, y: 4843370.818621907, }, { x: 12950187.299179578, y: 4843370.485690744, }, { x: 12948755.739655264, y: 4843370.555741397, }, { x: 12948301.7684026, y: 4843375.188304583, }, { x: 12948278.325845689, y: 4843375.123114149, }, { x: 12947913.423896424, y: 4843373.865129756, }, { x: 12947592.303468505, y: 4843394.1161822025, }, { x: 12947581.215097992, y: 4843394.815685296, }, { x: 12947415.424213238, y: 4843437.701399312, }, { x: 12947274.850617228, y: 4843509.5493655335, }, { x: 12947145.066987505, y: 4843631.989033849, }, { x: 12947083.745603528, y: 4843765.448522134, }, { x: 12947029.622192265, y: 4843916.987015813, }, { x: 12946979.091048203, y: 4844090.2070025485, }, { x: 12946955.102622215, y: 4844184.990607465, }, { x: 12946945.915349547, y: 4844319.830258014, }, { x: 12946923.770701075, y: 4845315.372927731, }, { x: 12946851.421569752, y: 4846551.5626413245, }, { x: 12946848.88594415, y: 4846594.6202231655, }, { x: 12946848.609652413, y: 4846598.19993173, }, { x: 12946696.54362537, y: 4848569.1295227185, }, { x: 12946757.730386814, y: 4848764.400754196, }, { x: 12946757.762984468, y: 4848770.602855413, }, { x: 12946761.025258096, y: 4849389.514336067, }, { x: 12946767.82605037, y: 4850217.041711847, }, { x: 12946789.423173606, y: 4850282.143556595, }, { x: 12946825.465052422, y: 4850311.148186556, }, { x: 12947052.561481878, y: 4850452.686121019, }, { x: 12947214.803034527, y: 4850514.554585377, }, { x: 12947308.555685857, y: 4850529.261912783, }, { x: 12947449.196901781, y: 4850533.256072254, }, { x: 12947590.121115766, y: 4850533.639384969, }, { x: 12947604.269979956, y: 4850533.6780554075, }, { x: 12947595.595432382, y: 4853171.930337626, }, { x: 12947588.6332791, y: 4853230.507756927, }, { x: 12947570.25534986, y: 4853385.134998881, }, { x: 12947534.132989677, y: 4853500.7123848, }, { x: 12947451.113532243, y: 4853616.16379296, }, { x: 12947332.03107398, y: 4853706.215145492, }, { x: 12947133.576039799, y: 4853828.591678857, }, { x: 12946866.97284939, y: 4854028.085858982, }, { x: 12946608.167520212, y: 4854187.260197411, }, { x: 12946364.738988684, y: 4854328.7254704805, }, { x: 12946303.257037977, y: 4854430.402571901, }, { x: 12946252.383757986, y: 4854573.552461346, }, { x: 12946214.461752877, y: 4854793.706838007, }, { x: 12946220.215499429, y: 4854990.273434222, }, { x: 12946219.011349382, y: 4855034.084710322, }, { x: 12946156.333146382, y: 4855155.899273862, }, { x: 12946061.71710423, y: 4855352.240931815, }, { x: 12946050.635431375, y: 4855405.652363556, }, { x: 12946036.841429455, y: 4855472.970938698, }, { x: 12945937.184814524, y: 4856212.898218268, }, { x: 12945963.10362221, y: 4857094.046675076, }, { x: 12945958.921351675, y: 4857134.026535522, }, { x: 12945884.03047807, y: 4857857.218830575, }, { x: 12945847.638054904, y: 4858399.611054495, }, { x: 12945847.280553274, y: 4859007.224022067, }, { x: 12945860.526034107, y: 4859226.599693325, }, { x: 12945864.842806887, y: 4859298.0925262105, }, { x: 12945879.5175261, y: 4859405.1651427485, }, { x: 12945886.625513952, y: 4859589.651325276, }, { x: 12945864.662784807, y: 4859694.379973758, }, { x: 12945784.912348324, y: 4859882.159043464, }, { x: 12945727.11821354, y: 4859994.151868572, }, { x: 12945701.784202412, y: 4860124.311216468, }, { x: 12945698.14559977, y: 4860174.944243185, }, { x: 12945452.47590781, y: 4860713.3477798365, }, { x: 12945196.058016783, y: 4861128.770078741, }, { x: 12945092.686995683, y: 4861317.482488749, }, { x: 12945051.578445194, y: 4861392.531520205, }, { x: 12945015.437229244, y: 4861490.129152049, }, { x: 12945008.163701242, y: 4861576.939256895, }, { x: 12945015.284018965, y: 4861718.049761452, }, { x: 12945022.23002506, y: 4861756.836245517, }, { x: 12945035.651318152, y: 4861797.3254907355, }, { x: 12945054.888690906, y: 4861837.528089324, }, { x: 12945105.325637072, y: 4861946.179124048, }, { x: 12945125.370065786, y: 4861974.055941134, }, { x: 12945163.446826743, y: 4862019.098382124, }, { x: 12945194.809906306, y: 4862048.391273372, }, { x: 12945228.090067945, y: 4862073.16642714, }, { x: 12945255.305523323, y: 4862092.36230406, }, { x: 12945285.556679495, y: 4862110.414454173, }, { x: 12945315.808265274, y: 4862128.467023728, }, { x: 12945361.54760602, y: 4862142.217026062, }, { x: 12945487.830327151, y: 4862156.985505024, }, ], }, { id: "14", source: "28", target: "29", class: "地铁十四号线", name: "地铁十四号线 0", controlPoints: [ { x: 12937234.877597623, y: 4846515.674866713, }, { x: 12937368.988537306, y: 4846593.191490097, }, { x: 12937461.335291399, y: 4846647.398606839, }, { x: 12937532.375518117, y: 4846688.019702177, }, { x: 12937591.769328088, y: 4846720.059432032, }, { x: 12937621.188342465, y: 4846732.002843995, }, { x: 12937671.789557256, y: 4846748.737535954, }, { x: 12937709.602904188, y: 4846758.320650579, }, { x: 12937735.762316125, y: 4846763.326932602, }, { x: 12937752.397758542, y: 4846765.615152837, }, { x: 12937773.44091199, y: 4846768.332774585, }, { x: 12937804.297495496, y: 4846770.764304414, }, { x: 12937827.33427437, y: 4846772.051537565, }, { x: 12937868.008451082, y: 4846771.479321919, }, { x: 12937892.32897584, y: 4846770.33498424, }, { x: 12937918.075058706, y: 4846766.901995257, }, { x: 12937940.834554123, y: 4846763.6122220345, }, { x: 12937968.574529182, y: 4846758.463006948, }, { x: 12937995.180239107, y: 4846751.025023762, }, { x: 12938017.517118562, y: 4846745.160619812, }, { x: 12938042.132414829, y: 4846737.43681869, }, { x: 12938076.570282334, y: 4846723.276240112, }, { x: 12938122.822349729, y: 4846702.393192925, }, { x: 12938155.702757211, y: 4846683.512634498, }, { x: 12938188.444042044, y: 4846662.62954278, }, { x: 12938219.76602793, y: 4846639.600848661, }, { x: 12938250.095861865, y: 4846614.140497331, }, { x: 12938278.438376905, y: 4846585.962328421, }, { x: 12938304.220769178, y: 4846557.783944012, }, { x: 12938329.579807637, y: 4846527.173999285, }, { x: 12938353.520818293, y: 4846493.274026497, }, { x: 12938372.907309297, y: 4846461.6623603245, }, { x: 12938391.017690128, y: 4846427.046785262, }, { x: 12938412.561981687, y: 4846377.125676343, }, { x: 12938434.974010698, y: 4846316.476277426, }, { x: 12938448.248669473, y: 4846281.574595996, }, { x: 12938475.656359944, y: 4846207.766580478, }, { x: 12938490.211433839, y: 4846172.579389068, }, { x: 12938507.041724533, y: 4846137.6790905995, }, { x: 12938526.29072453, y: 4846102.493274418, }, { x: 12938542.26056133, y: 4846073.028826507, }, { x: 12938584.740041988, y: 4846003.660309321, }, { x: 12938633.06400581, y: 4845924.638571542, }, { x: 12938715.454181843, y: 4845792.771941782, }, { x: 12938776.553557053, y: 4845700.585488995, }, { x: 12938781.398345944, y: 4845694.149817628, }, { x: 12938800.081236716, y: 4845673.873968367, }, { x: 12938830.820290571, y: 4845645.815687927, }, { x: 12938844.393556165, y: 4845633.390067325, }, { x: 12938873.132778017, y: 4845610.143030206, }, { x: 12938936.183000699, y: 4845573.274183875, }, { x: 12938969.9751077, y: 4845523.292870295, }, { x: 12939008.30658488, y: 4845483.611718048, }, { x: 12939046.62636937, y: 4845453.553428374, }, { x: 12939107.67397802, y: 4845425.508528395, }, { x: 12939139.988430338, y: 4845415.095566754, }, { x: 12939215.636890687, y: 4845415.718690437, }, { x: 12939308.039270518, y: 4845421.266472513, }, { x: 12939491.25690715, y: 4845458.350894194, }, { x: 12939790.511140315, y: 4845556.207267058, }, { x: 12939988.628771447, y: 4845616.1622475535, }, { x: 12940117.839141306, y: 4845661.911291016, }, { x: 12940686.897376765, y: 4845952.2196258595, }, { x: 12941074.89764744, y: 4846157.503429323, }, { x: 12941335.171058182, y: 4846317.370755986, }, { x: 12941559.500148436, y: 4846435.253157876, }, { x: 12941942.0737714, y: 4846649.584496282, }, { x: 12942044.003008543, y: 4846663.89086179, }, { x: 12942128.18335582, y: 4846652.232800751, }, { x: 12942566.46418881, y: 4846526.042660932, }, { x: 12942889.715147126, y: 4846450.953434545, }, { x: 12943968.393642, y: 4846408.250017698, }, { x: 12944809.837601995, y: 4846425.649451, }, { x: 12944985.099897848, y: 4846441.60822536, }, { x: 12945546.215890277, y: 4846492.747584046, }, { x: 12946211.229001617, y: 4846547.780306945, }, ], }, { id: "15", source: "30", target: "31", class: "地铁十五号线", name: "地铁十五号线 0", controlPoints: [ { x: 12975220.360613192, y: 4878868.526210992, }, { x: 12975170.101829547, y: 4878482.810853661, }, { x: 12975127.393577926, y: 4878166.084186471, }, { x: 12975102.3383307, y: 4877971.094415046, }, { x: 12975067.230635904, y: 4877703.212676576, }, { x: 12975028.196639525, y: 4877408.433615002, }, { x: 12974992.782733576, y: 4877135.782488413, }, { x: 12974961.616855532, y: 4876898.418269849, }, { x: 12974957.635438241, y: 4876867.667671654, }, { x: 12974924.692424836, y: 4876613.225913413, }, { x: 12974904.122140514, y: 4876457.185169152, }, { x: 12974891.114395186, y: 4876358.838107704, }, { x: 12974881.80755435, y: 4876318.801830084, }, { x: 12974850.30174708, y: 4876128.145737729, }, { x: 12974841.600142721, y: 4876060.242186066, }, { x: 12974833.693115635, y: 4875993.44712488, }, { x: 12974824.851303473, y: 4875896.879010218, }, { x: 12974823.581860177, y: 4875861.890374971, }, { x: 12974804.231609207, y: 4875717.818793602, }, { x: 12974793.363254767, y: 4875644.593833729, }, { x: 12974780.733046675, y: 4875579.452634726, }, { x: 12974765.457217943, y: 4875526.588724708, }, { x: 12974748.090285787, y: 4875469.247595661, }, { x: 12974731.657055452, y: 4875430.44830189, }, { x: 12974707.759133428, y: 4875374.935044397, }, { x: 12974682.982388051, y: 4875324.213162166, }, { x: 12974660.60794111, y: 4875285.743106426, }, { x: 12974635.85688353, y: 4875245.7891169265, }, { x: 12974592.33221722, y: 4875182.6007377645, }, { x: 12974565.515120054, y: 4875148.641781552, }, { x: 12974477.340428105, y: 4875046.200795493, }, { x: 12974324.23997027, y: 4874868.727412534, }, { x: 12974285.225031873, y: 4874824.06709895, }, { x: 12974250.676817749, y: 4874784.765451768, }, { x: 12974226.548435159, y: 4874754.982961457, }, { x: 12974179.793554721, y: 4874702.287665765, }, { x: 12974152.700378012, y: 4874674.611620291, }, { x: 12974102.993937358, y: 4874629.4094777135, }, { x: 12974057.281876976, y: 4874592.149864237, }, { x: 12974010.571259402, y: 4874557.10058754, }, { x: 12973965.349593911, y: 4874523.243715123, }, { x: 12973927.86306645, y: 4874495.325444062, }, { x: 12973778.829987278, y: 4874388.442810681, }, { x: 12973631.292726409, y: 4874281.260318043, }, { x: 12973511.128084678, y: 4874193.07702723, }, { x: 12973457.885669941, y: 4874152.090015151, }, { x: 12973424.569167605, y: 4874125.653511811, }, { x: 12973401.064728435, y: 4874103.948181291, }, { x: 12973364.466450525, y: 4874069.155318013, }, { x: 12973343.040548371, y: 4874047.737895291, }, { x: 12973301.971003683, y: 4874004.595285215, }, { x: 12973268.333740914, y: 4873965.001992706, }, { x: 12973223.968151508, y: 4873907.523655236, }, { x: 12973200.145078428, y: 4873874.757068463, }, { x: 12973184.359140303, y: 4873851.817254196, }, { x: 12973151.288220981, y: 4873799.065100245, }, { x: 12973133.104508085, y: 4873765.071843533, }, { x: 12973115.220516248, y: 4873731.975402937, }, { x: 12973083.514099035, y: 4873666.6145877475, }, { x: 12972958.272448545, y: 4873409.226124313, }, { x: 12972918.910218379, y: 4873326.610352403, }, { x: 12972826.476255693, y: 4873134.840144364, }, { x: 12972795.763337882, y: 4873070.719005933, }, { x: 12972744.76742065, y: 4872959.163678453, }, { x: 12972720.60264992, y: 4872901.886303345, }, { x: 12972659.997036628, y: 4872735.667320859, }, { x: 12972643.299525585, y: 4872699.580940345, }, { x: 12972559.100747146, y: 4872455.805418115, }, { x: 12972532.783339068, y: 4872369.677216135, }, { x: 12972491.590280673, y: 4872256.099208747, }, { x: 12972431.316032, y: 4872100.655541013, }, { x: 12972411.705557901, y: 4872052.949093282, }, { x: 12972344.317184499, y: 4871873.754390362, }, { x: 12972344.317084517, y: 4871873.754090381, }, { x: 12972283.901539784, y: 4871713.096747656, }, { x: 12972231.51025757, y: 4871590.704161345, }, { x: 12972220.786418218, y: 4871568.055674147, }, { x: 12972187.677583814, y: 4871506.46596912, }, { x: 12972159.917606726, y: 4871462.740223999, }, { x: 12972122.405523332, y: 4871409.778587388, }, { x: 12972070.897276413, y: 4871345.708445298, }, { x: 12972018.521820415, y: 4871290.250138916, }, { x: 12971949.740475345, y: 4871227.65827687, }, { x: 12971856.352377752, y: 4871157.9745282065, }, { x: 12971744.543129945, y: 4871096.1426233165, }, { x: 12971666.305498093, y: 4871059.28347291, }, { x: 12971573.517186211, y: 4871028.317100962, }, { x: 12971543.275268642, y: 4871019.710796947, }, { x: 12970313.75580163, y: 4871029.4038401535, }, { x: 12969743.624482477, y: 4871013.157693107, }, { x: 12969526.746136123, y: 4871006.97216711, }, { x: 12969268.713759044, y: 4870954.619065353, }, { x: 12969027.21710455, y: 4870806.293398591, }, { x: 12968695.732934553, y: 4870386.919417365, }, { x: 12968267.842089783, y: 4869845.614706303, }, { x: 12968041.977084596, y: 4869507.853755934, }, { x: 12967897.801472468, y: 4868972.889715916, }, { x: 12967878.337220326, y: 4867594.394019558, }, { x: 12967868.77862341, y: 4866238.919959571, }, { x: 12967801.717744218, y: 4865970.777359848, }, { x: 12967494.283058798, y: 4865925.768674796, }, { x: 12965837.973847104, y: 4865743.023798019, }, { x: 12965348.196035301, y: 4865688.751628207, }, { x: 12964443.21307059, y: 4865516.203149938, }, ], }, { id: "16", source: "32", target: "33", class: "机场轻轨线", name: "机场轻轨线 0", controlPoints: [ { x: 12981108.370146083, y: 4871488.68313175, }, { x: 12981018.508214273, y: 4871439.9092021575, }, { x: 12980902.535834748, y: 4871405.203097882, }, { x: 12980821.525095403, y: 4871396.07635756, }, { x: 12980751.756629316, y: 4871395.085485736, }, { x: 12980685.769679295, y: 4871406.921907764, }, { x: 12980609.835639, y: 4871428.117243195, }, { x: 12980553.791983627, y: 4871454.35924438, }, { x: 12980504.260708505, y: 4871483.782440005, }, { x: 12980435.350114407, y: 4871539.621344493, }, { x: 12980398.504969673, y: 4871582.03131289, }, { x: 12980362.007896207, y: 4871632.577822356, }, { x: 12980332.654508604, y: 4871686.360369531, }, { x: 12980319.13294245, y: 4871720.246401924, }, { x: 12980306.26908758, y: 4871757.385237568, }, { x: 12980293.763164897, y: 4871806.2405863255, }, { x: 12980277.698010115, y: 4871929.260816189, }, { x: 12980261.290169481, y: 4871965.0230897125, }, { x: 12980254.749320468, y: 4871910.852033942, }, { x: 12980243.756181171, y: 4871816.594568528, }, { x: 12980227.70573535, y: 4871752.941176994, }, { x: 12980203.072226636, y: 4871672.165283503, }, { x: 12980150.33990551, y: 4871582.889266779, }, { x: 12980101.34029352, y: 4871516.884384831, }, { x: 12980048.722460367, y: 4871461.910039693, }, { x: 12979996.111785132, y: 4871413.06501025, }, { x: 12979909.333892826, y: 4871359.422428334, }, { x: 12979799.058829894, y: 4871312.3731178045, }, { x: 12979720.936799372, y: 4871295.456660487, }, { x: 12979624.500482768, y: 4871274.924462654, }, { x: 12979479.39873571, y: 4871277.213494264, }, { x: 12979085.453077132, y: 4871280.917372964, }, { x: 12978992.156225236, y: 4871279.384364794, }, { x: 12978956.177897697, y: 4871277.666599098, }, { x: 12978900.674255166, y: 4871271.113841657, }, { x: 12978860.293281717, y: 4871262.702607095, }, { x: 12978764.752916442, y: 4871245.472966051, }, { x: 12978664.480746558, y: 4871226.718917767, }, { x: 12978629.714270562, y: 4871220.650472208, }, { x: 12978620.414652059, y: 4871219.068466421, }, { x: 12978564.580504624, y: 4871213.590081386, }, { x: 12978460.737579372, y: 4871195.649671084, }, { x: 12978328.733081415, y: 4871172.822299577, }, { x: 12978213.58406164, y: 4871153.546776074, }, { x: 12978126.884770632, y: 4871139.996553964, }, { x: 12978030.808147773, y: 4871127.039056859, }, { x: 12977949.096244726, y: 4871117.637013953, }, { x: 12977857.7281794, y: 4871107.719554274, }, { x: 12977818.256715368, y: 4871103.431990254, }, { x: 12977782.926936783, y: 4871099.961185381, }, { x: 12977738.76375114, y: 4871094.860768784, }, { x: 12977699.015983863, y: 4871089.466841593, }, { x: 12977670.034107389, y: 4871085.695982234, }, { x: 12977617.58207723, y: 4871075.083050405, }, { x: 12977586.096101644, y: 4871069.051658005, }, { x: 12977553.816080883, y: 4871065.107010753, }, { x: 12977547.258727068, y: 4871063.901849335, }, { x: 12977530.618654177, y: 4871060.843754747, }, { x: 12977510.63402144, y: 4871057.271591576, }, { x: 12977488.410456756, y: 4871052.304085646, }, { x: 12977476.108263735, y: 4871049.825167599, }, { x: 12977449.974956136, y: 4871043.750099359, }, { x: 12977426.211063186, y: 4871036.9651420405, }, { x: 12977355.623273922, y: 4871014.777517495, }, { x: 12977296.479809767, y: 4870992.125603299, }, { x: 12977282.77631216, y: 4870986.002440447, }, { x: 12977251.719621776, y: 4870972.154493815, }, { x: 12977247.24550043, y: 4870969.812148521, }, { x: 12977238.854476603, y: 4870965.421079147, }, { x: 12977209.761773894, y: 4870950.136411922, }, { x: 12977096.757856315, y: 4870889.44525773, }, { x: 12976968.08990173, y: 4870816.956775016, }, { x: 12976780.16768485, y: 4870720.01310895, }, { x: 12976677.82368606, y: 4870666.528023298, }, { x: 12976655.8764118, y: 4870655.5205783425, }, { x: 12976529.223142704, y: 4870592.317432991, }, { x: 12976428.586317737, y: 4870542.427981049, }, { x: 12976366.5421185, y: 4870518.407870099, }, { x: 12976329.380473636, y: 4870506.354736436, }, { x: 12976271.82754423, y: 4870490.321866817, }, { x: 12976228.111302977, y: 4870481.388277324, }, { x: 12976188.09288433, y: 4870478.038546045, }, { x: 12976149.436712662, y: 4870471.373423314, }, { x: 12976071.072179394, y: 4870465.607346994, }, { x: 12975965.86990555, y: 4870455.646798379, }, { x: 12975917.917454332, y: 4870449.027466127, }, { x: 12975868.894021038, y: 4870442.773831003, }, { x: 12975820.580020344, y: 4870433.638390911, }, { x: 12975790.158459982, y: 4870426.94054179, }, { x: 12975775.838848663, y: 4870422.328125062, }, { x: 12975751.13866662, y: 4870414.524700168, }, { x: 12975725.00528259, y: 4870405.648373743, }, { x: 12975714.620193584, y: 4870400.657944233, }, { x: 12975694.938773984, y: 4870397.150636553, }, { x: 12975674.888572035, y: 4870388.966441453, }, { x: 12975636.937384691, y: 4870373.667942694, }, { x: 12975612.227725828, y: 4870361.187195985, }, { x: 12975582.510264473, y: 4870348.370360326, }, { x: 12975500.513648823, y: 4870309.887833572, }, { x: 12975383.793644667, y: 4870256.097796813, }, { x: 12975133.184359929, y: 4870136.739612404, }, { x: 12974949.40711058, y: 4870050.794763821, }, { x: 12974941.365436705, y: 4870047.009858454, }, { x: 12974724.15676446, y: 4869944.777526178, }, { x: 12974559.111049827, y: 4869868.410730108, }, { x: 12974550.453614099, y: 4869864.520617537, }, { x: 12974441.55043712, y: 4869814.212693192, }, { x: 12974270.106768792, y: 4869734.071269941, }, { x: 12974091.838388277, y: 4869651.027056911, }, { x: 12973885.444597295, y: 4869555.245051317, }, { x: 12973766.248404168, y: 4869500.831533556, }, { x: 12973540.981958374, y: 4869392.930468844, }, { x: 12973391.381564768, y: 4869323.244557277, }, { x: 12973283.232700225, y: 4869272.859937838, }, { x: 12972573.852092165, y: 4868943.251794805, }, { x: 12970368.479611576, y: 4867801.281579257, }, { x: 12970186.368543653, y: 4867581.247939134, }, { x: 12970138.160652429, y: 4867522.999803067, }, { x: 12970014.83652081, y: 4867376.428914912, }, { x: 12969982.687756885, y: 4867339.028822399, }, { x: 12969938.176704682, y: 4867288.1582316635, }, { x: 12969884.318320546, y: 4867223.8002079725, }, { x: 12969842.279029265, y: 4867174.850547206, }, { x: 12969736.51761531, y: 4867052.928304552, }, { x: 12969715.618553909, y: 4867028.835423228, }, { x: 12969620.004793288, y: 4866917.186788599, }, { x: 12969438.04374979, y: 4866711.844669058, }, { x: 12969408.156057132, y: 4866677.285747163, }, { x: 12969324.820910655, y: 4866578.791680055, }, { x: 12969226.67533753, y: 4866469.379122947, }, { x: 12968956.364812195, y: 4866149.976631404, }, { x: 12968801.20089387, y: 4865953.939934027, }, { x: 12968661.628187554, y: 4865774.016041136, }, { x: 12968440.203180425, y: 4865520.086029257, }, { x: 12968418.752663735, y: 4865496.720383862, }, { x: 12968265.16366474, y: 4865329.4158122465, }, { x: 12968082.376416814, y: 4865118.794538391, }, { x: 12967977.74367467, y: 4865003.326373822, }, { x: 12967875.580874648, y: 4864890.602510729, }, { x: 12967828.859212246, y: 4864840.529032915, }, { x: 12967771.529788392, y: 4864773.642307851, }, { x: 12967754.0789727, y: 4864752.1729925005, }, { x: 12967615.98897636, y: 4864590.439552254, }, { x: 12967559.654778784, y: 4864523.543494982, }, { x: 12967512.793535465, y: 4864468.1316355625, }, { x: 12967489.97373297, y: 4864440.960919648, }, { x: 12967391.600998314, y: 4864324.055311191, }, { x: 12967258.997379664, y: 4864167.803726059, }, { x: 12967157.800077152, y: 4864048.489056851, }, { x: 12967072.064892631, y: 4863952.160647396, }, { x: 12966932.938263306, y: 4863786.109663975, }, { x: 12966772.422852328, y: 4863597.399173657, }, { x: 12966615.568496268, y: 4863412.808523439, }, { x: 12966305.336633127, y: 4863047.703772259, }, { x: 12966269.190687215, y: 4863001.279273752, }, { x: 12965833.711641828, y: 4862475.155696717, }, { x: 12965806.851898653, y: 4862442.704151941, }, { x: 12964858.528949967, y: 4861327.4237803, }, { x: 12964224.475284964, y: 4860561.038983111, }, { x: 12963811.623681322, y: 4860051.71716615, }, { x: 12963154.244359475, y: 4859240.959120094, }, { x: 12962659.851017611, y: 4858630.950164011, }, { x: 12962035.08051321, y: 4857953.39954861, }, { x: 12961929.533509394, y: 4857864.163282811, }, { x: 12961663.821656032, y: 4857639.499910775, }, { x: 12961465.562880669, y: 4857485.1627320545, }, { x: 12961385.775293019, y: 4857425.3359782435, }, ], }, ], }; const colors = [ "rgb(64, 174, 247)", "rgb(108, 207, 169)", "rgb(157, 223, 125)", "rgb(240, 198, 74)", "rgb(221, 158, 97)", "rgb(141, 163, 112)", "rgb(115, 136, 220)", "rgb(133, 88, 219)", "rgb(203, 135, 226)", "rgb(227, 137, 163)", ]; const { nodes } = data; const { edges } = data; const classMap = new Map(); let classId = 0; nodes.forEach(function (node) { node.y = -node.y; }); edges.forEach(function (edge) { edge.id = `edge-${edge.id}`; // edge cluster if (edge.class && classMap.get(edge.class) === undefined) { classMap.set(edge.class, classId); classId++; } const cid = classMap.get(edge.class); edge.color = colors[cid % colors.length]; const { controlPoints } = edge; controlPoints.forEach(function (cp) { cp.y = -cp.y; }); }); export { nodes, edges, data }; ================================================ FILE: packages/examples-alipay/pages/scene-case/metro-lines/index.acss ================================================ page { background-color: #101424; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .canvas { margin-top: 200rpx; background: url("https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*G23iRqkiibIAAAAAAAAAAABkARQnAQ"); background-size: 100% 100%; } ================================================ FILE: packages/examples-alipay/pages/scene-case/metro-lines/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/metro-lines/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import { nodes, edges, data } from "./data"; /** * metroLines */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 412, height: 412, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { pixelRatio } = my.getSystemInfoSync(); my.setBackgroundColor({ backgroundColorTop: "#000000", backgroundColorBottom: "#000000", }); // custom the node F6.registerNode( "breath-node", { afterDraw(cfg, group) { const r = cfg.size / 2; const back1 = group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r, fill: cfg.color || (cfg.style && cfg.style.fill), opacity: 0.6, }, name: "back1-shape", }); const back2 = group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r, fill: cfg.color, // 为了显示清晰,随意设置了颜色 opacity: 0.6, }, name: "back2-shape", }); const back3 = group.addShape("circle", { zIndex: -1, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back3-shape", }); group.sort(); // 排序,根据zIndex 排序 const delayBase = Math.random() * 2000; back1.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase, // 无延迟 }, ); back2.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase + 1000, // 1 秒延迟 }, ); back3.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase + 2000, // 2 秒延迟 }, ); }, }, "circle", ); // custom the edge F6.registerEdge( "running-polyline", { afterDraw(cfg, group) { const shape = group.get("children")[0]; const length = shape.getTotalLength(); let circleCount = Math.ceil(length / 20); circleCount = circleCount === 0 ? 1 : circleCount; const _loop = function _loop(i) { const delay = Math.random() * 1000; const start = shape.getPoint(i / circleCount); const circle = group.addShape("circle", { attrs: { x: start.x, y: start.y, r: 0.8, fill: "#A0F3AF", shadowColor: "#fff", shadowBlur: 30, }, name: "circle-shape", }); circle.animate( (ratio) => { ratio += i / circleCount; if (ratio > 1) { ratio %= 1; } const tmpPoint = shape.getPoint(ratio); return { x: tmpPoint.x, y: tmpPoint.y, }; }, { repeat: true, duration: 10 * length, easing: "easeCubic", delay, }, ); }; for (let i = 0; i < circleCount; i++) { _loop(i); } }, }, "polyline", ); this.setData({ pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; function scaleNodesPoints(nodes_, edges_, graphSize) { const size = graphSize[0] < graphSize[1] ? graphSize[0] : graphSize[1]; let minX = 99999999999999999; let maxX = -99999999999999999; let minY = 99999999999999999; let maxY = -99999999999999999; nodes_.forEach(function (node) { if (node.x > maxX) maxX = node.x; if (node.x < minX) minX = node.x; if (node.y > maxY) maxY = node.y; if (node.y < minY) minY = node.y; }); edges_.forEach(function (edge) { const { controlPoints } = edge; controlPoints.forEach(function (cp) { if (cp.x > maxX) maxX = cp.x; if (cp.x < minX) minX = cp.x; if (cp.y > maxY) maxY = cp.y; if (cp.y < minY) minY = cp.y; }); }); const xScale = maxX - minX; const yScale = maxY - minY; nodes_.forEach(function (node) { node.orix = node.x; node.oriy = node.y; node.x = ((node.x - minX) / xScale) * size; node.y = ((node.y - minY) / yScale) * size; }); edges_.forEach(function (edge) { const { controlPoints } = edge; controlPoints.forEach(function (cp) { cp.x = ((cp.x - minX) / xScale) * size; cp.y = ((cp.y - minY) / yScale) * size; }); }); } // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = model.class; return text; }, }, ], }, defaultNode: { type: "breath-node", size: 3, style: { lineWidth: 0, fill: "rgb(240, 223, 83)", }, }, defaultEdge: { type: "running-polyline", size: 1, color: "rgb(14,142,63)", style: { opacity: 0.8, lineAppendWidth: 3, }, }, }); const graphSize = [500, 500]; scaleNodesPoints(nodes, edges, graphSize); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/metro-lines/index.json ================================================ { "defaultTitle": "地铁路线图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/mind-map/data.js ================================================ const rawData = { label: "Modeling Methods", id: "0", children: [ { label: "Classification", id: "0-1", color: "#5AD8A6", children: [ { label: "Logistic regression", id: "0-1-1", }, { label: "Linear discriminant analysis", id: "0-1-2", }, { label: "Rules", id: "0-1-3", }, { label: "Decision trees", id: "0-1-4", }, { label: "Naive Bayes", id: "0-1-5", }, { label: "K nearest neighbor", id: "0-1-6", }, { label: "Probabilistic neural network", id: "0-1-7", }, { label: "Support vector machine", id: "0-1-8", }, ], }, { label: "Consensus", id: "0-2", color: "#F6BD16", children: [ { label: "Models diversity", id: "0-2-1", children: [ { label: "Different initializations", id: "0-2-1-1", }, { label: "Different parameter choices", id: "0-2-1-2", }, { label: "Different architectures", id: "0-2-1-3", }, { label: "Different modeling methods", id: "0-2-1-4", }, { label: "Different training sets", id: "0-2-1-5", }, { label: "Different feature sets", id: "0-2-1-6", }, ], }, { label: "Methods", id: "0-2-2", children: [ { label: "Classifier selection", id: "0-2-2-1", }, { label: "Classifier fusion", id: "0-2-2-2", }, ], }, { label: "Common", id: "0-2-3", children: [ { label: "Bagging", id: "0-2-3-1", }, { label: "Boosting", id: "0-2-3-2", }, { label: "AdaBoost", id: "0-2-3-3", }, ], }, ], }, { label: "Regression", id: "0-3", color: "#269A99", children: [ { label: "Multiple linear regression", id: "0-3-1", }, { label: "Partial least squares", id: "0-3-2", }, { label: "Multi-layer feedforward neural network", id: "0-3-3", }, { label: "General regression neural network", id: "0-3-4", }, { label: "Support vector regression", id: "0-3-5", }, ], }, ], }; const dataTransform = (data_) => { const changeData = (d, level = 0, color) => { const data = { ...d, }; switch (level) { case 0: data.type = "dice-mind-map-root"; break; case 1: data.type = "dice-mind-map-sub"; break; default: data.type = "dice-mind-map-leaf"; break; } data.hover = false; if (color) { data.color = color; } if (level === 1 && !d.direction) { if (!d.direction) { data.direction = d.id.charCodeAt(d.id.length - 1) % 2 === 0 ? "right" : "left"; } } if (d.children) { data.children = d.children.map((child) => changeData(child, level + 1, data.color), ); } return data; }; return changeData(data_); }; const result = dataTransform(rawData); export default result; ================================================ FILE: packages/examples-alipay/pages/scene-case/mind-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-alipay/pages/scene-case/mind-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/mind-map/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import result from "./data"; /** * mindMap */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { const { Util } = F6; // const colorArr = [ // '#5B8FF9', // '#5AD8A6', // '#5D7092', // '#F6BD16', // '#6F5EF9', // '#6DC8EC', // '#D3EEF9', // '#DECFEA', // '#FFE0C7', // '#1E9493', // '#BBDEDE', // '#FF99C3', // '#FFE0ED', // '#CDDDFD', // '#CDF3E4', // '#CED4DE', // '#FCEBB9', // '#D3CEFD', // '#945FB9', // '#FF9845', // ]; F6.registerNode( "dice-mind-map-root", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 16)[0] + 24; const stroke = cfg.style.stroke || "#096dd9"; return ` ${ cfg.label } + `; }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-sub", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 14)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-leaf", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 12)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerBehavior("dice-mindmap", { getEvents() { return { "node:click": "clickNode", "node:dblclick": "editNode", "node:mouseenter": "hoverNode", "node:mouseleave": "hoverNodeOut", }; }, clickNode(evt) { // const model = evt.item.get('model'); const name = evt.target.get("action"); switch (name) { // TODO:这里没办法过语法检查 // case 'add': // const newId = `${model.id}-${ // ((model.children || []).reduce((a, b) => { // const num = Number(b.id.split('-').pop()); // return a < num ? num : a; // }, 0) || 0) + 1 // }`; // evt.currentTarget.updateItem(evt.item, { // children: (model.children || []).concat([ // { // id: newId, // direction: newId.charCodeAt(newId.length - 1) % 2 === 0 ? 'right' : 'left', // label: 'New', // type: 'dice-mind-map-leaf', // color: model.color || colorArr[Math.floor(Math.random() * colorArr.length)], // }, // ]), // }); // evt.currentTarget.layout(false); // break; // case 'delete': // const parent = evt.item.get('parent'); // evt.currentTarget.updateItem(parent, { // children: (parent.get('model').children || []).filter((e) => e.id !== model.id), // }); // evt.currentTarget.layout(false); // break; case "edit": break; default: } }, editNode(evt) { const { item } = evt; const model = item.get("model"); const { x, y } = item.calculateBBox(); const graph = evt.currentTarget; const realPosition = evt.currentTarget.getClientByPoint(x, y); const el = document.createElement("div"); const fontSizeMap = { "dice-mind-map-root": 24, "dice-mind-map-sub": 18, "dice-mind-map-leaf": 16, }; el.style.fontSize = `${fontSizeMap[model.type]}px`; el.style.position = "fixed"; el.style.top = `${realPosition.y}px`; el.style.left = `${realPosition.x}px`; el.style.paddingLeft = "12px"; el.style.transformOrigin = "top left"; el.style.transform = `scale(${evt.currentTarget.getZoom()})`; const input = document.createElement("input"); input.style.border = "none"; input.value = model.label; input.style.width = `${ Util.getTextSize(model.label, fontSizeMap[model.type])[0] }px`; input.className = "dice-input"; el.className = "dice-input"; el.appendChild(input); document.body.appendChild(el); const destroyEl = () => { document.body.removeChild(el); }; const clickEvt = (event) => { if ( !( event.target && event.target.className && event.target.className.includes("dice-input") ) ) { window.removeEventListener("mousedown", clickEvt); window.removeEventListener("scroll", clickEvt); graph.updateItem(item, { label: input.value, }); graph.layout(false); graph.off("wheelZoom", clickEvt); destroyEl(); } }; graph.on("wheelZoom", clickEvt); window.addEventListener("mousedown", clickEvt); window.addEventListener("scroll", clickEvt); input.addEventListener("keyup", (event) => { if (event.key === "Enter") { clickEvt({ target: {}, }); } }); }, hoverNode(evt) { evt.currentTarget.updateItem(evt.item, { hover: true, }); }, hoverNodeOut(evt) { evt.currentTarget.updateItem(evt.item, { hover: false, }); }, }); F6.registerBehavior("scroll-canvas", { getEvents: function getEvents() { return { wheel: "onWheel", }; }, onWheel: function onWheel(ev) { const { graph } = this; if (!graph) { return; } if (ev.ctrlKey) { const canvas = graph.get("canvas"); const point = canvas.getPointByClient(ev.clientX, ev.clientY); let ratio = graph.getZoom(); if (ev.wheelDelta > 0) { ratio += ratio * 0.05; } else { ratio *= ratio * 0.05; } graph.zoomTo(ratio, { x: point.x, y: point.y, }); } else { const x = ev.deltaX || ev.movementX; const y = ev.deltaY || ev.movementY || (-ev.wheelDelta * 125) / 3; graph.translate(-x, -y); } ev.preventDefault(); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: [10, 20], layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: (node) => { return node.level === 0 ? F6.Util.getTextSize(node.label, 16)[0] + 12 : F6.Util.getTextSize(node.label, 12)[0]; }, getVGap: () => { return 10; }, getHGap: () => { return 60; }, getSide: (node) => { return node.data.direction; }, }, defaultEdge: { type: "cubic-horizontal", style: { lineWidth: 2, }, }, minZoom: 0.5, modes: { default: ["drag-canvas", "zoom-canvas", "dice-mindmap"], }, }); this.graph.data(result); this.graph.render(); // this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/mind-map/index.json ================================================ { "defaultTitle": "思维导图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/scene-case/sankey/data.js ================================================ const colorArr = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#6F5EF9", "#6DC8EC", "#D3EEF9", "#DECFEA", "#FFE0C7", "#1E9493", "#BBDEDE", "#FF99C3", "#FFE0ED", "#CDDDFD", "#CDF3E4", "#CED4DE", "#FCEBB9", "#D3CEFD", "#945FB9", "#FF9845", ]; const rawData = [ { label: "A", id: "A", to: [ { target: "C", value: 200, }, ], }, { label: "B", id: "B", to: [ { target: "C", value: 400, }, ], }, { label: "C", id: "C", to: [ { target: "D", value: 300, }, { target: "E", value: 300, }, ], }, { label: "D", id: "D", to: [ { target: "F", value: 100, }, { target: "G", value: 200, }, ], }, { label: "E", id: "E", to: [ { target: "F", value: 200, }, { target: "G", value: 100, }, ], }, { label: "F", id: "F", }, { label: "G", id: "G", }, ]; const dataTransform = (data) => { const nodes = []; const edges = []; const nodeRecvMap = {}; data.forEach((node, i) => { const { id, label, color = colorArr[i % colorArr.length], to = [] } = node; let index = 0; to.forEach((rel) => { edges.push({ source: id, target: rel.target, value: rel.value, color, sourceIndex: index, targetIndex: nodeRecvMap[rel.target] || 0, }); index += rel.value || 0; if (rel.value) { nodeRecvMap[rel.target] = (nodeRecvMap[rel.target] || 0) + rel.value; } }); nodes.push({ id, label, color, outSize: index, }); }); nodes.forEach((node) => { node.inSize = nodeRecvMap[node.id] || 0; node.size = [4, Math.max(4, node.inSize, node.outSize)]; }); return { nodes, edges, }; }; const result = dataTransform(rawData); export default result; ================================================ FILE: packages/examples-alipay/pages/scene-case/sankey/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-alipay/pages/scene-case/sankey/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/scene-case/sankey/index.js ================================================ import F6 from "@antv/f6"; import { wrapContext } from "../../../common/utils/context"; import result from "./data"; import dagreLayout from "@antv/f6/dist/extends/layout/dagreLayout"; /** * sankey */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); F6.registerNode( "dice-sankey-node", { jsx: (cfg) => ` ${cfg.label} ${cfg.size[1]} `, getAnchorPoints() { return [[0, 0]]; }, }, "single-node", ); F6.registerEdge("dice-sankey-edge", { draw(cfg, group) { const { startPoint, endPoint, color } = cfg; const deltaY1 = Number(cfg.sourceIndex); const deltaY2 = Number(cfg.sourceIndex) + Number(cfg.value); const deltaY3 = Number(cfg.targetIndex); const deltaY4 = Number(cfg.targetIndex) + Number(cfg.value); const quaterX = (Math.abs(endPoint.x - startPoint.x) / 5) * 3; return group.addShape("path", { attrs: { fill: color, opacity: 0.6, path: [ ["M", startPoint.x, startPoint.y + deltaY1], [ "C", endPoint.x - quaterX, startPoint.y + deltaY1, startPoint.x + quaterX, endPoint.y + deltaY3, endPoint.x, endPoint.y + deltaY3, ], ["L", endPoint.x, endPoint.y + deltaY4], [ "C", startPoint.x + quaterX, endPoint.y + deltaY4, endPoint.x - quaterX, startPoint.y + deltaY2, startPoint.x, startPoint.y + deltaY2, ], ["L", startPoint.x, startPoint.y + deltaY1], ["Z"], ], }, }); }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, defaultNode: { type: "dice-sankey-node", }, defaultEdge: { type: "dice-sankey-edge", }, fitView: true, fitViewPadding: 60, layout: { type: "dagre", rankdir: "LR", nodesep: 10, ranksep: 130, align: "ul", }, }); this.graph.data(result); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/scene-case/sankey/index.json ================================================ { "defaultTitle": "桑基图", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/search/search.acss ================================================ page { background-color: #fff; } .page { padding: 0; } .search-bar { position: sticky; top: 0; background-color: #fff; z-index: 2; padding-top: 14rpx; overflow: hidden; } .am-search-input { height: 35px; line-height: 35px; } .am-search-synthetic { height: 35px; line-height: 35px; } .am-search-value { height: 35px; } .am-search-clear { height: 35px; width: 35px; } .am-search-cancel { color: #333; } .search-bar .am-search-input { background-color: rgba(0, 0, 0, 0.05); } .search-container { box-sizing: border-box; padding: 20px 12px; } .history { position: relative; padding-left: 2px; padding-bottom: 1px; color: #333; font-size: 36rpx; font-weight: bold; } .history .clear { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 40rpx; width: 40rpx; background-image: url('/image/clear.png'); background-size: 50%; background-position: center; background-repeat: no-repeat; } .history-list { margin-top: 10px; } .hot { padding-left: 2px; padding-bottom: 2px; color: #333; font-size: 36rpx; font-weight: bold; } .hot-list { margin-top: 10px; } .search-results { padding: 16px 12 0 0; } .component-name { color: #333; margin-right: 10rpx; } .thumb { height: 60rpx; width: 60rpx; margin-right: 30rpx; } .component .am-list-line-bottom::after { left: auto; right: 0; width: calc(100% - 80rpx); } .am-list-body::before { display: none; } .am-list-body::after { display: none; } .list-header { height: 100rpx; display: flex; align-items: center; background-color: #fff; color: #333; font-weight: bold; font-size: 34rpx; } .am-list-header { padding: 8px 16px 0; } .no-search-result { height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center; } .no-search-result image { width: 87rpx; height: 87rpx; } .no-search-result text { margin-top: 37rpx; color: #999; font-size: 28rpx; } .am-list-text-wrapper { width: 100%; } ================================================ FILE: packages/examples-alipay/pages/search/search.axml ================================================ 历史 热门 未找到搜索结果 组件 {{item.name}} API {{item.name}} ================================================ FILE: packages/examples-alipay/pages/search/search.js ================================================ import { debounce } from "../../common/utils/common"; import { componentList } from "../../common/utils/process"; // 搜索推荐 const apiList = []; Page({ data: { value: "", history: my.getStorageSync({ key: "searchHistory" }).data || [], hot: [ { name: "知识图谱树", url: "../../SceneCase/knowledgeTreeGraph/index" }, { name: "基本弧线图", url: "../../GeneralGraph/basicArcDiagram/index" }, { name: "FA气泡图", url: "../../GeneralGraph/forceBubbles/index" }, { name: "无到有的边", url: "../../Animation/edge_lineGrowth/index" }, { name: "自定义流向图", url: "../../SceneCase/customFlow/index" }, { name: "生态树", url: "../../TreeGraph/BasicDendrogram/index" }, { name: "自定义树中的边", url: "../../TreeGraph/customEdgeTree/index" }, { name: "基本同心圆布局", url: "../../GeneralGraph/basicConcentric/index", }, { name: "布局切换", url: "../../GeneralGraph/layoutTranslate/index" }, ], componentSuggestions: [], apiSuggestions: [], }, onLoad() { this.setData({ history: my.getStorageSync({ key: "searchHistory" }).data, }); console.log(my.getStorageSync({ key: "searchHistory" }).data); this.onInput = debounce(this.onInput.bind(this), 400); my.setNavigationBar({ borderBottomColor: "#fff", }); }, clear() { my.confirm({ content: "确定删除相关历史?", success: (res) => { if (res.confirm) { my.clearStorage(); this.setData({ history: [], }); } }, }); }, onInput(keyword) { this.setData({ value: keyword, }); const regExp = /[A-Za-z]/; if (keyword === "" || (regExp.test(keyword) && keyword.length === 1)) { this.setData({ componentSuggestions: [], apiSuggestions: [], }); return; } const componentSuggestions = []; const apiSuggestions = []; for (let i = 0; i < componentList.length; i++) { if ( componentList[i].suggestion .toLocaleLowerCase() .indexOf(keyword.toLocaleLowerCase()) != -1 ) { componentSuggestions.push(componentList[i]); } } for (let i = 0; i < apiList.length; i++) { if ( apiList[i].suggestion .toLocaleLowerCase() .indexOf(keyword.toLocaleLowerCase()) != -1 ) { apiSuggestions.push(apiList[i]); } } this.setData({ componentSuggestions, apiSuggestions }); }, onClear() { this.setData({ value: "", }); }, onCancel() { this.setData({ componentSuggestions: [], apiSuggestions: [], value: "", }); my.navigateBack(); }, onItemTap({ name }) { this.setData({ value: name, }); this.onInput(name); }, onListItemTap(e) { const { name, url } = e.target.dataset; this.addToHistory(name); console.log(url); my.navigateTo({ url }); }, addToHistory(keyword) { const searchHistory = my.getStorageSync({ key: "searchHistory" }).data || []; let index = -1; for (let i = 0; i < searchHistory.length; i++) { if (searchHistory[i].name === keyword) { index = i; break; } } let history = []; if (searchHistory.length >= 8) { if (index === -1) { history = [{ name: keyword }, ...searchHistory.slice(0, 7)]; } else { searchHistory.splice(index, 1).slice(0, 7); history = [{ name: keyword }, ...searchHistory]; } } else if (index === -1) { history = [{ name: keyword }, ...searchHistory]; } else { searchHistory.splice(index, 1); history = [{ name: keyword }, ...searchHistory]; } my.setStorageSync({ key: "searchHistory", data: history, }); this.setData({ history, }); }, }); ================================================ FILE: packages/examples-alipay/pages/search/search.json ================================================ { "defaultTitle": "搜索", "transparentTitle": "none", "allowsBounceVertical": "NO", "usingComponents": { "search-bar": "mini-ali-ui/es/search-bar/index", "block-list": "../../common/components/block-list/block-list", "list": "mini-ali-ui/es/list/index", "list-item": "mini-ali-ui/es/list/list-item/index" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/basic-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/basic-dendrogram/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/basic-dendrogram/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/basic-dendrogram/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 生态树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "dendrogram", direction: "LR", nodeSep: 30, rankSep: 100, getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node(function (node) { return { label: node.id, labelCfg: { offset: 5, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/basic-dendrogram/index.json ================================================ { "defaultTitle": "生态树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data.js"; /** * 紧凑树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node(function (node) { return { label: node.id, labelCfg: { offset: 10, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box/index.json ================================================ { "defaultTitle": "紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box-left-align/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box-left-align/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box-left-align/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box-left-align/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data.js"; /** * 节点左右对齐的紧凑树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const fontSize = 15; F6.registerNode("crect", { draw: (cfg, group) => { const width = cfg.id.length * 10; const rect = group.addShape("rect", { attrs: { x: 0, y: -10, ...cfg.style, width, height: 20, lineWidth: 0, opacity: 0, }, name: "rect-shape", draggable: true, }); const label = group.addShape("text", { attrs: { text: cfg.id, fill: "#ccc", fontSize, x: 0, y: 0, }, name: "label-shape", draggable: true, }); const bboxWidth = label.getBBox().width + 20; rect.attr({ width: bboxWidth }); group.addShape("path", { attrs: { lineWidth: 1, fill: "#ccc", stroke: "#ccc", path: [ ["M", 0, 0], ["L", bboxWidth, 0], ], }, name: "path-shape", draggable: true, }); return rect; }, getAnchorPoints: () => { return [ [0, 0.5], [1, 0.5], ]; }, }); const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["collapse-expand", "drag-canvas", "zoom-canvas"], }, defaultNode: { type: "crect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, getWidth: function getWidth(d) { return F6.Util.getTextSize(d.id, fontSize)[0] + 20; }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/compact-box-left-align/index.json ================================================ { "defaultTitle": "节点左右对齐的紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-edge-tree/data.js ================================================ export default { id: "root", label: "root", children: [ { id: "c1", label: "c1", children: [ { id: "c1-1", label: "c1-1", }, { id: "c1-2", label: "c1-2", children: [ { id: "c1-2-1", label: "c1-2-1", }, { id: "c1-2-2", label: "c1-2-2", }, ], }, ], }, { id: "c2", label: "c2", }, { id: "c3", label: "c3", children: [ { id: "c3-1", label: "c3-1", }, { id: "c3-2", label: "c3-2", children: [ { id: "c3-2-1", label: "c3-2-1", }, { id: "c3-2-2", label: "c3-2-2", }, { id: "c3-2-3", label: "c3-2-3", }, ], }, { id: "c3-3", label: "c3-3", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-edge-tree/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-edge-tree/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-edge-tree/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 自定义图中的边 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; const COLLAPSE_ICON = function COLLAPSE_ICON(x, y, r) { return [ ["M", x - r, y - r], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x + 2 - r, y - r], ["L", x + r - 2, y - r], ]; }; const EXPAND_ICON = function EXPAND_ICON(x, y, r) { return [ ["M", x - r, y - r], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x + 2 - r, y - r], ["L", x + r - 2, y - r], ["M", x, y - 2 * r + 2], ["L", x, y - 2], ]; }; F6.Util.traverseTree(data, (d) => { d.leftIcon = { style: { fill: "#e6fffb", stroke: "#e6fffb", }, img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Q_FQT6nwEC8AAAAAAAAAAABkARQnAQ", }; return true; }); F6.registerNode( "icon-node", { options: { size: [60, 20], stroke: "#91d5ff", fill: "#91d5ff", }, draw(cfg, group) { const styles = this.getShapeStyle(cfg); const { labelCfg = {} } = cfg; const w = styles.width; const h = styles.height; const keyShape = group.addShape("rect", { attrs: { ...styles, x: -w / 2, y: -h / 2, }, }); /** * leftIcon 格式如下: * { * style: ShapeStyle; * img: '' * } */ console.log("cfg.leftIcon", cfg.leftIcon); if (cfg.leftIcon) { const { style, img } = cfg.leftIcon; group.addShape("rect", { attrs: { x: 1 - w / 2, y: 1 - h / 2, width: 38, height: styles.height - 2, fill: "#8c8c8c", ...style, }, }); group.addShape("image", { attrs: { x: 8 - w / 2, y: 8 - h / 2, width: 24, height: 24, img: img || "https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png", }, name: "image-shape", }); } // 如果不需要动态增加或删除元素,则不需要 add 这两个 marker group.addShape("marker", { attrs: { x: 40 - w / 2, y: 52 - h / 2, r: 6, stroke: "#73d13d", cursor: "pointer", symbol: EXPAND_ICON, }, name: "add-item", }); group.addShape("marker", { attrs: { x: 80 - w / 2, y: 52 - h / 2, r: 6, stroke: "#ff4d4f", cursor: "pointer", symbol: COLLAPSE_ICON, }, name: "remove-item", }); if (cfg.label) { group.addShape("text", { attrs: { ...labelCfg.style, text: cfg.label, x: 50 - w / 2, y: 25 - h / 2, }, }); } return keyShape; }, update: undefined, }, "rect", ); F6.registerEdge("flow-line", { draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const { style } = cfg; const shape = group.addShape("path", { attrs: { stroke: style.stroke, endArrow: style.endArrow, path: [ ["M", startPoint.x, startPoint.y], ["L", startPoint.x, (startPoint.y + endPoint.y) / 2], ["L", endPoint.x, (startPoint.y + endPoint.y) / 2], ["L", endPoint.x, endPoint.y], ], }, }); return shape; }, }); const defaultStateStyles = { hover: { stroke: "#1890ff", lineWidth: 2, }, }; const defaultNodeStyle = { fill: "#91d5ff", stroke: "#40a9ff", radius: 5, }; const defaultEdgeStyle = { stroke: "#91d5ff", endArrow: { path: "M 0,0 L 12, 6 L 9,0 L 12, -6 Z", fill: "#91d5ff", d: -20, }, }; const defaultLayout = { type: "compactBox", direction: "TB", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 40; }, getHGap: function getHGap() { return 70; }, }; const defaultLabelCfg = { style: { fill: "#000", fontSize: 12, }, }; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, // plugins: [minimap], modes: { default: ["drag-canvas", "zoom-canvas"], }, defaultNode: { type: "icon-node", size: [120, 40], style: defaultNodeStyle, labelCfg: defaultLabelCfg, }, defaultEdge: { type: "flow-line", style: defaultEdgeStyle, }, nodeStateStyles: defaultStateStyles, edgeStateStyles: defaultStateStyles, layout: defaultLayout, }); // 监听 this.graph.on("node:tap", (evt) => { const { item, target } = evt; const targetType = target.get("type"); const name = target.get("name"); // 增加元素 if (targetType === "marker") { const model = item.getModel(); if (name === "add-item") { if (!model.children) { model.children = []; } const id = `n-${Math.random()}`; model.children.push({ id, label: id.substr(0, 8), leftIcon: { style: { fill: "#e6fffb", stroke: "#e6fffb", }, img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Q_FQT6nwEC8AAAAAAAAAAABkARQnAQ", }, }); this.graph.updateChild(model, model.id); } else if (name === "remove-item") { this.graph.removeChild(model.id); } } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-edge-tree/index.json ================================================ { "defaultTitle": "自定义树中的边", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-side-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-side-mind-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-side-mind-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-side-mind-map/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 脑图-自定义子节点分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 50; }, getSide: (d) => { if (d.id === "Classification") { return "left"; } return "right"; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-side-mind-map/index.json ================================================ { "defaultTitle": "自定义子节点分布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-tree/data.js ================================================ export default { name: "Modeling Methods", children: [ { name: "Classification", children: [ { name: "Logistic regression", }, { name: "Linear discriminant analysis", }, { name: "Rules", }, { name: "Decision trees", }, { name: "Naive Bayes", }, { name: "K nearest neighbor", }, { name: "Probabilistic neural network", }, { name: "Support vector machine", }, ], }, { name: "Consensus", children: [ { name: "Models diversity", children: [ { name: "Different initializations", }, { name: "Different parameter choices", }, { name: "Different architectures", }, { name: "Different modeling methods", }, { name: "Different training sets", }, { name: "Different feature sets", }, ], }, { name: "Methods", children: [ { name: "Classifier selection", }, { name: "Classifier fusion", }, ], }, { name: "Common", children: [ { name: "Bagging", }, { name: "Boosting", }, { name: "AdaBoost", }, ], }, ], }, { name: "Regression", children: [ { name: "Multiple linear regression", }, { name: "Partial least squares", }, { name: "Multi-layer feedforward neural network", }, { name: "General regression neural network", }, { name: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-tree/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-tree/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-tree/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 自定义复杂树图样式 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); F6.registerNode( "tree-node", { drawShape: function drawShape(cfg, group) { const rect = group.addShape("rect", { attrs: { fill: "#fff", stroke: "#666", x: 0, y: 0, width: 1, height: 1, }, name: "rect-shape", }); const content = cfg.name.replace(/(.{19})/g, "$1\n"); const text = group.addShape("text", { attrs: { text: content, x: 0, y: 0, textAlign: "left", textBaseline: "middle", fill: "#666", }, name: "text-shape", }); const bbox = text.getBBox(); const hasChildren = cfg.children && cfg.children.length > 0; rect.attr({ x: -bbox.width / 2 - 4, y: -bbox.height / 2 - 6, width: bbox.width + (hasChildren ? 26 : 12), height: bbox.height + 12, }); text.attr({ x: -bbox.width / 2, y: 0, }); if (hasChildren) { group.addShape("marker", { attrs: { x: bbox.width / 2 + 12, y: 0, r: 6, symbol: cfg.collapsed ? F6.Marker.expand : F6.Marker.collapse, stroke: "#666", lineWidth: 2, }, name: "collapse-icon", }); } return rect; }, update: (cfg, item) => { const group = item.getContainer(); const icon = group.find((e) => e.get("name") === "collapse-icon"); icon.attr( "symbol", cfg.collapsed ? F6.Marker.expand : F6.Marker.collapse, ); }, }, "single-node", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); this.graph.updateItem(item, { collapsed, }); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { type: "tree-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 20; }, getHGap: function getHGap() { return 80; }, }, }); F6.Util.traverseTree(data_, function (item) { item.id = item.name; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/custom-tree/index.json ================================================ { "defaultTitle": "复杂树样式", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/file-system/data.js ================================================ export default { id: "1", name: "src", children: [ { id: "1-1", name: "behavior", children: [], }, { id: "1-3", name: "graph", children: [ { id: "1-3-1", name: "controller", children: [], }, ], }, { id: "1-5", name: "item", children: [], }, { id: "1-6", name: "shape", children: [ { id: "1-6-2", name: "extend", children: [], }, ], }, { id: "1-7", name: "util", children: [], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/file-system/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/file-system/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/file-system/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 缩进树-文件系统 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // registerNode F6.registerNode("file-node", { draw: function draw(cfg, group) { const keyShape = group.addShape("rect", { attrs: { x: 10, y: -12, fill: "#fff", stroke: null, }, }); let isLeaf = false; if (cfg.collapsed) { group.addShape("marker", { attrs: { symbol: "triangle", x: 4, y: -2, r: 4, fill: "#666", }, name: "marker-shape", }); } else if (cfg.children && cfg.children.length > 0) { group.addShape("marker", { attrs: { symbol: "triangle-down", x: 4, y: -2, r: 4, fill: "#666", }, name: "marker-shape", }); } else { isLeaf = true; } const shape = group.addShape("text", { attrs: { x: 15, y: 4, text: cfg.name, fill: "#666", fontSize: 16, textAlign: "left", fontFamily: typeof window !== "undefined" ? window .getComputedStyle(document.body, null) .getPropertyValue("font-family") || "Arial, sans-serif" : "Arial, sans-serif", }, name: "text-shape", }); const bbox = shape.getBBox(); let backRectW = bbox.width; let backRectX = keyShape.attr("x"); if (!isLeaf) { backRectW += 8; backRectX -= 15; } keyShape.attr({ width: backRectW, height: bbox.height + 4, x: backRectX, }); return keyShape; }, }); // registerEdge F6.registerEdge( "step-line", { getControlPoints: function getControlPoints(cfg) { const { startPoint } = cfg; const { endPoint } = cfg; return [ startPoint, { x: startPoint.x, y: endPoint.y, }, endPoint, ]; }, }, "polyline", ); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", animate: false, onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultEdge: { style: { stroke: "#A3B1BF", }, }, layout: { type: "indented", isHorizontal: true, direction: "LR", indent: 30, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } // position的取值(由于ESlint禁止嵌套的三元表达,所以单独提取出来写) let position_value = null; if (node.children && node.children.length > 0) { position_value = "left"; } else if (node.x > centerX) position_value = "right"; else position_value = "left"; return { label: node.id, labelCfg: { offset: 5, position: position_value, }, }; }); this.graph.node((node) => { return { type: "file-node", label: node.name, }; }); this.graph.edge(() => { return { type: "step-line", }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/file-system/index.json ================================================ { "defaultTitle": "文件系统", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/intend-align-top/data.js ================================================ export default { id: "A", children: [ { id: "A1", children: [{ id: "A11" }, { id: "A12" }, { id: "A13" }, { id: "A14" }], }, { id: "A2", children: [ { id: "A21", children: [{ id: "A211" }, { id: "A212" }], }, { id: "A22", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/intend-align-top/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/intend-align-top/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/intend-align-top/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 缩进树-顶部对齐 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); F6.registerNode("card-node", { draw: function drawShape(cfg, group) { const r = 2; const color = "#5B8FF9"; const w = cfg.size[0]; const h = cfg.size[1]; const shape = group.addShape("rect", { attrs: { x: -w / 2, y: -h / 2, width: w, // 200, height: h, // 60 stroke: color, radius: r, fill: "#fff", }, name: "main-box", draggable: true, }); group.addShape("rect", { attrs: { x: -w / 2, y: -h / 2, width: w, // 200, height: h / 2, // 60 fill: color, radius: [r, r, 0, 0], }, name: "title-box", draggable: true, }); // title text group.addShape("text", { attrs: { textBaseline: "top", x: -w / 2 + 8, y: -h / 2 + 2, lineHeight: 20, text: cfg.id, fill: "#fff", }, name: "title", }); cfg.children && group.addShape("marker", { attrs: { x: w / 2, y: 0, r: 6, cursor: "pointer", symbol: F6.Marker.collapse, stroke: "#666", lineWidth: 1, fill: "#fff", }, name: "collapse-icon", }); group.addShape("text", { attrs: { textBaseline: "top", x: -w / 2 + 8, y: -h / 2 + 24, lineHeight: 20, text: "description", fill: "rgba(0,0,0, 1)", }, name: `description`, }); return shape; }, setState(name, value, item) { if (name === "collapsed") { const marker = item .get("group") .find((ele) => ele.get("name") === "collapse-icon"); const icon = value ? F6.Marker.expand : F6.Marker.collapse; marker.attr("symbol", icon); } }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: ["drag-canvas"], }, defaultNode: { type: "card-node", size: [100, 40], }, defaultEdge: { type: "cubic-horizontal", style: { endArrow: true, }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 200, getHeight: () => { return 60; }, }, }); this.graph.on("node:tap", (e) => { if (e.target.get("name") === "collapse-icon") { e.item.getModel().collapsed = !e.item.getModel().collapsed; this.graph.setItemState( e.item, "collapsed", e.item.getModel().collapsed, ); this.graph.layout(); } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/intend-align-top/index.json ================================================ { "defaultTitle": "顶部对齐", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/intended/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/intended/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/intended/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/intended/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 缩进树-子节点两侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: ["drag-canvas"], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "indented", direction: "H", indent: 80, getHeight: () => { return 10; }, getWidth: () => { return 10; }, getSide: (d) => { if (d.id === "Regression" || d.id === "Classification") return "left"; return "right"; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "left"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/intended/index.json ================================================ { "defaultTitle": "子节点两侧分布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/left-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/left-mind-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/left-mind-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/left-mind-map/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 脑图-子节点右侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 100; }, getSide: () => { return "left"; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/left-mind-map/index.json ================================================ { "defaultTitle": "子节点左侧分布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/mind-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/mind-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/mind-map/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 脑图-自节点自动两侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 50; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } // position的取值(由于ESlint禁止嵌套的三元表达,所以单独提取出来写) let position_value = null; if (node.children && node.children.length > 0) { position_value = "left"; } else if (node.x > centerX) position_value = "right"; else position_value = "left"; return { label: node.id, labelCfg: { offset: 5, position: position_value, }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/mind-map/index.json ================================================ { "defaultTitle": "子节点自动两侧分布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-compact-box/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-compact-box/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-compact-box/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 紧凑辐射树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, }, layout: { type: "compactBox", direction: "RL", getId: function getId(d) { return d.id; }, getHeight: () => { return 26; }, getWidth: () => { return 26; }, getVGap: () => { return 20; }, getHGap: () => { return 30; }, radial: true, }, }); this.graph.node(function (node) { return { label: node.id, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-compact-box/index.json ================================================ { "defaultTitle": "紧凑辐射树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-dendrogram/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-dendrogram/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-dendrogram/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data from "./data"; /** * 生态辐射树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, }, layout: { type: "dendrogram", direction: "LR", nodeSep: 20, rankSep: 100, radial: true, }, }); this.graph.node(function (node) { return { label: node.id, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/radial-dendrogram/index.json ================================================ { "defaultTitle": "生态辐射树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/right-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/right-mind-map/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/right-mind-map/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/right-mind-map/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 脑图-子节点右侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 100; }, getSide: () => { return "right"; }, }, }); let centerX = 0; this.graph.node(function (node) { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/right-mind-map/index.json ================================================ { "defaultTitle": "子节点右侧分布", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-compact-box/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-compact-box/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-compact-box/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data.js"; /** * 至上而下的紧凑树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, linkCenter: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.getModel(); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-vertical", }, layout: { type: "compactBox", direction: "TB", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 80; }, getHGap: function getHGap() { return 20; }, }, }); this.graph.node(function (node) { let position = "right"; let rotate = 0; if (!node.children) { position = "bottom"; rotate = Math.PI / 2; } return { label: node.id, labelCfg: { position, offset: 5, style: { rotate, textAlign: "start", }, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-compact-box/index.json ================================================ { "defaultTitle": "至上而下的紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-dendrogram/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-dendrogram/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-dendrogram/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 至上而下的生态树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, linkCenter: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-vertical", }, layout: { type: "dendrogram", direction: "TB", // H / V / LR / RL / TB / BT nodeSep: 40, rankSep: 100, }, }); this.graph.node(function (node) { let position = "right"; let rotate = 0; if (!node.children) { position = "bottom"; rotate = Math.PI / 2; } return { label: node.id, labelCfg: { position, offset: 5, style: { rotate, textAlign: "start", }, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/tb-dendrogram/index.json ================================================ { "defaultTitle": "至上而下的生态树", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tree-edge-label/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, { id: "SubTreeNode7", }, { id: "SubTreeNode8", }, { id: "SubTreeNode9", }, { id: "SubTreeNode10", }, { id: "SubTreeNode11", }, ], }; ================================================ FILE: packages/examples-alipay/pages/tree-graph/tree-edge-label/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-alipay/pages/tree-graph/tree-edge-label/index.axml ================================================ ================================================ FILE: packages/examples-alipay/pages/tree-graph/tree-edge-label/index.js ================================================ import F6 from "@antv/f6"; import TreeGraph from "@antv/f6/dist/extends/graph/treeGraph"; import { wrapContext } from "../../../common/utils/context"; import data_ from "./data"; /** * 树图边上的标签 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(ctx, rect, canvas, renderer) { this.isCanvasInit = true; this.ctx = wrapContext(ctx); this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 30, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); // 点 this.graph.node(function (node) { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", offset: 5, }, }; }); // 边 let i = 0; this.graph.edge(function () { i++; return { type: "cubic-horizontal", color: "#A3B1BF", label: i, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-alipay/pages/tree-graph/tree-edge-label/index.json ================================================ { "defaultTitle": "树边上的标签", "usingComponents": { "f6-canvas": "@antv/f6-alipay/es/container/container" } } ================================================ FILE: packages/examples-uniapp/.hbuilderx/launch.json ================================================ { // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 "version": "0.0", "configurations": [ { "default": { "launchtype": "local" }, "h5": { "launchtype": "local" }, "mp-weixin": { "launchtype": "local" }, "type": "uniCloud" } ] } ================================================ FILE: packages/examples-uniapp/App.vue ================================================ ================================================ FILE: packages/examples-uniapp/components/canvas/canvas.vue ================================================ ================================================ FILE: packages/examples-uniapp/f6/extends/graph/treeGraph.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.TreeGraph = n()) : (t.TreeGraph = n()); })(this, function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports; } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: e }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, n) { if ((1 & n && (t = r(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var e = Object.create(null); if ( (r.r(e), Object.defineProperty(e, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var i in t) r.d( e, i, function (n) { return t[n]; }.bind(null, i), ); return e; }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 196)) ); })({ 0: function (t, n, r) { "use strict"; r.r(n), r.d(n, "contains", function () { return i; }), r.d(n, "includes", function () { return i; }), r.d(n, "difference", function () { return o; }), r.d(n, "find", function () { return O; }), r.d(n, "findIndex", function () { return j; }), r.d(n, "firstValue", function () { return x; }), r.d(n, "flatten", function () { return w; }), r.d(n, "flattenDeep", function () { return A; }), r.d(n, "getRange", function () { return E; }), r.d(n, "pull", function () { return T; }), r.d(n, "pullAt", function () { return N; }), r.d(n, "reduce", function () { return k; }), r.d(n, "remove", function () { return I; }), r.d(n, "sortBy", function () { return F; }), r.d(n, "union", function () { return H; }), r.d(n, "uniq", function () { return D; }), r.d(n, "valuesOfKey", function () { return R; }), r.d(n, "head", function () { return z; }), r.d(n, "last", function () { return V; }), r.d(n, "startsWith", function () { return q; }), r.d(n, "endsWith", function () { return U; }), r.d(n, "filter", function () { return u; }), r.d(n, "every", function () { return W; }), r.d(n, "some", function () { return G; }), r.d(n, "group", function () { return $; }), r.d(n, "groupBy", function () { return K; }), r.d(n, "groupToMap", function () { return X; }), r.d(n, "getWrapBehavior", function () { return J; }), r.d(n, "wrapBehavior", function () { return Q; }), r.d(n, "number2color", function () { return tt; }), r.d(n, "parseRadius", function () { return nt; }), r.d(n, "clamp", function () { return rt; }), r.d(n, "fixedBase", function () { return et; }), r.d(n, "isDecimal", function () { return ut; }), r.d(n, "isEven", function () { return ot; }), r.d(n, "isInteger", function () { return at; }), r.d(n, "isNegative", function () { return ct; }), r.d(n, "isNumberEqual", function () { return ft; }), r.d(n, "isOdd", function () { return st; }), r.d(n, "isPositive", function () { return lt; }), r.d(n, "max", function () { return S; }), r.d(n, "maxBy", function () { return dt; }), r.d(n, "min", function () { return P; }), r.d(n, "minBy", function () { return ht; }), r.d(n, "mod", function () { return pt; }), r.d(n, "toDegree", function () { return yt; }), r.d(n, "toInteger", function () { return gt; }), r.d(n, "toRadian", function () { return mt; }), r.d(n, "forIn", function () { return Ot; }), r.d(n, "has", function () { return jt; }), r.d(n, "hasKey", function () { return xt; }), r.d(n, "hasValue", function () { return At; }), r.d(n, "keys", function () { return v; }), r.d(n, "isMatch", function () { return y; }), r.d(n, "values", function () { return wt; }), r.d(n, "lowerCase", function () { return Pt; }), r.d(n, "lowerFirst", function () { return Et; }), r.d(n, "substitute", function () { return _t; }), r.d(n, "upperCase", function () { return Ct; }), r.d(n, "upperFirst", function () { return Mt; }), r.d(n, "getType", function () { return Bt; }), r.d(n, "isArguments", function () { return Nt; }), r.d(n, "isArray", function () { return l; }), r.d(n, "isArrayLike", function () { return e; }), r.d(n, "isBoolean", function () { return kt; }), r.d(n, "isDate", function () { return It; }), r.d(n, "isError", function () { return Lt; }), r.d(n, "isFunction", function () { return f; }), r.d(n, "isFinite", function () { return Ft; }), r.d(n, "isNil", function () { return s; }), r.d(n, "isNull", function () { return Dt; }), r.d(n, "isNumber", function () { return it; }), r.d(n, "isObject", function () { return h; }), r.d(n, "isObjectLike", function () { return b; }), r.d(n, "isPlainObject", function () { return m; }), r.d(n, "isPrototype", function () { return Rt; }), r.d(n, "isRegExp", function () { return zt; }), r.d(n, "isString", function () { return L; }), r.d(n, "isType", function () { return c; }), r.d(n, "isUndefined", function () { return Vt; }), r.d(n, "isElement", function () { return qt; }), r.d(n, "requestAnimationFrame", function () { return Ut; }), r.d(n, "clearAnimationFrame", function () { return Wt; }), r.d(n, "augment", function () { return Kt; }), r.d(n, "clone", function () { return $t; }), r.d(n, "debounce", function () { return Jt; }), r.d(n, "memoize", function () { return Qt; }), r.d(n, "deepMix", function () { return tn; }), r.d(n, "each", function () { return p; }), r.d(n, "extend", function () { return nn; }), r.d(n, "indexOf", function () { return rn; }), r.d(n, "isEmpty", function () { return un; }), r.d(n, "isEqual", function () { return on; }), r.d(n, "isEqualWith", function () { return an; }), r.d(n, "map", function () { return cn; }), r.d(n, "mapValues", function () { return sn; }), r.d(n, "mix", function () { return Yt; }), r.d(n, "assign", function () { return Yt; }), r.d(n, "get", function () { return ln; }), r.d(n, "set", function () { return dn; }), r.d(n, "pick", function () { return pn; }), r.d(n, "omit", function () { return vn; }), r.d(n, "throttle", function () { return yn; }), r.d(n, "toArray", function () { return gn; }), r.d(n, "toString", function () { return St; }), r.d(n, "uniqueId", function () { return mn; }), r.d(n, "noop", function () { return On; }), r.d(n, "identity", function () { return jn; }), r.d(n, "size", function () { return xn; }), r.d(n, "measureTextWidth", function () { return Sn; }), r.d(n, "getEllipsisText", function () { return Pn; }), r.d(n, "Cache", function () { return En; }); var e = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = function (t, n) { return !!e(t) && t.indexOf(n) > -1; }, u = function (t, n) { if (!e(t)) return t; for (var r = [], i = 0; i < t.length; i++) { var u = t[i]; n(u, i) && r.push(u); } return r; }, o = function (t, n) { return ( void 0 === n && (n = []), u(t, function (t) { return !i(n, t); }) ); }, a = {}.toString, c = function (t, n) { return a.call(t) === "[object " + n + "]"; }, f = function (t) { return c(t, "Function"); }, s = function (t) { return null == t; }, l = function (t) { return Array.isArray ? Array.isArray(t) : c(t, "Array"); }; function d(t) { return (d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var h = function (t) { var n = d(t); return (null !== t && "object" === n) || "function" === n; }; var p = function (t, n) { if (t) if (l(t)) for (var r = 0, e = t.length; r < e && !1 !== n(t[r], r); r++); else if (h(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === n(t[i], i)) break; }, v = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var n = []; return ( p(t, function (r, e) { (f(t) && "prototype" === e) || n.push(e); }), n ); }; var y = function (t, n) { var r = v(n), e = r.length; if (s(t)) return !e; for (var i = 0; i < e; i += 1) { var u = r[i]; if (n[u] !== t[u] || !(u in t)) return !1; } return !0; }; function g(t) { return (g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var b = function (t) { return "object" === g(t) && null !== t; }, m = function (t) { if (!b(t) || !c(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; var O = function (t, n) { if (!l(t)) return null; var r; if ( (f(n) && (r = n), m(n) && (r = function (t) { return y(t, n); }), r) ) for (var e = 0; e < t.length; e += 1) if (r(t[e])) return t[e]; return null; }; var j = function (t, n, r) { void 0 === r && (r = 0); for (var e = r; e < t.length; e++) if (n(t[e], e)) return e; return -1; }, x = function (t, n) { for (var r = null, e = 0; e < t.length; e++) { var i = t[e][n]; if (!s(i)) { r = l(i) ? i[0] : i; break; } } return r; }, w = function (t) { if (!l(t)) return []; for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); return n; }, A = function t(n, r) { if ((void 0 === r && (r = []), l(n))) for (var e = 0; e < n.length; e += 1) t(n[e], r); else r.push(n); return r; }, S = function (t) { if (l(t)) return t.reduce(function (t, n) { return Math.max(t, n); }, t[0]); }, P = function (t) { if (l(t)) return t.reduce(function (t, n) { return Math.min(t, n); }, t[0]); }, E = function (t) { var n = t.filter(function (t) { return !isNaN(t); }); if (!n.length) return { min: 0, max: 0 }; if (l(t[0])) { for (var r = [], e = 0; e < t.length; e++) r = r.concat(t[e]); n = r; } var i = S(n); return { min: P(n), max: i }; }, _ = Array.prototype, C = _.splice, M = _.indexOf, T = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e++) for (var i = n[e], u = -1; (u = M.call(t, i)) > -1; ) C.call(t, u, 1); return t; }, B = Array.prototype.splice, N = function (t, n) { if (!e(t)) return []; for (var r = t ? n.length : 0, i = r - 1; r--; ) { var u = void 0, o = n[r]; (r !== i && o === u) || ((u = o), B.call(t, o, 1)); } return t; }, k = function (t, n, r) { if (!l(t) && !m(t)) return t; var e = r; return ( p(t, function (t, r) { e = n(e, t, r); }), e ); }, I = function (t, n) { var r = []; if (!e(t)) return r; for (var i = -1, u = [], o = t.length; ++i < o; ) { var a = t[i]; n(a, i, t) && (r.push(a), u.push(i)); } return N(t, u), r; }, L = function (t) { return c(t, "String"); }; var F = function (t, n) { var r; if (f(n)) r = function (t, r) { return n(t) - n(r); }; else { var e = []; L(n) ? e.push(n) : l(n) && (e = n), (r = function (t, n) { for (var r = 0; r < e.length; r += 1) { var i = e[r]; if (t[i] > n[i]) return 1; if (t[i] < n[i]) return -1; } return 0; }); } return t.sort(r), t; }; function D(t, n) { void 0 === n && (n = new Map()); var r = []; if (Array.isArray(t)) for (var e = 0, i = t.length; e < i; e++) { var u = t[e]; n.has(u) || (r.push(u), n.set(u, !0)); } return r; } var H = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; return D([].concat.apply([], t)); }, R = function (t, n) { for (var r = [], e = {}, i = 0; i < t.length; i++) { var u = t[i][n]; if (!s(u)) { l(u) || (u = [u]); for (var o = 0; o < u.length; o++) { var a = u[o]; e[a] || (r.push(a), (e[a] = !0)); } } } return r; }; function z(t) { if (e(t)) return t[0]; } function V(t) { if (e(t)) { return t[t.length - 1]; } } var q = function (t, n) { return !(!l(t) && !L(t)) && t[0] === n; }; var U = function (t, n) { return !(!l(t) && !L(t)) && t[t.length - 1] === n; }, W = function (t, n) { for (var r = 0; r < t.length; r++) if (!n(t[r], r)) return !1; return !0; }, G = function (t, n) { for (var r = 0; r < t.length; r++) if (n(t[r], r)) return !0; return !1; }, Y = Object.prototype.hasOwnProperty; var K = function (t, n) { if (!n || !l(t)) return {}; for ( var r, e = {}, i = f(n) ? n : function (t) { return t[n]; }, u = 0; u < t.length; u++ ) { var o = t[u]; (r = i(o)), Y.call(e, r) ? e[r].push(o) : (e[r] = [o]); } return e; }; function X(t, n) { if (!n) return { 0: t }; if (!f(n)) { var r = l(n) ? n : n.replace(/\s+/g, "").split("*"); n = function (t) { for (var n = "_", e = 0, i = r.length; e < i; e++) n += t[r[e]] && t[r[e]].toString(); return n; }; } return K(t, n); } var $ = function (t, n) { if (!n) return [t]; var r = X(t, n), e = []; for (var i in r) e.push(r[i]); return e; }; var J = function (t, n) { return t["_wrap_" + n]; }; var Q = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }, Z = {}; var tt = function (t) { var n = Z[t]; if (!n) { for (var r = t.toString(16), e = r.length; e < 6; e++) r = "0" + r; (n = "#" + r), (Z[t] = n); } return n; }; var nt = function (t) { var n = 0, r = 0, e = 0, i = 0; return ( l(t) ? 1 === t.length ? (n = r = e = i = t[0]) : 2 === t.length ? ((n = e = t[0]), (r = i = t[1])) : 3 === t.length ? ((n = t[0]), (r = i = t[1]), (e = t[2])) : ((n = t[0]), (r = t[1]), (e = t[2]), (i = t[3])) : (n = r = e = i = t), { r1: n, r2: r, r3: e, r4: i } ); }, rt = function (t, n, r) { return t < n ? n : t > r ? r : t; }, et = function (t, n) { var r = n.toString(), e = r.indexOf("."); if (-1 === e) return Math.round(t); var i = r.substr(e + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }, it = function (t) { return c(t, "Number"); }, ut = function (t) { return it(t) && t % 1 != 0; }, ot = function (t) { return it(t) && t % 2 == 0; }, at = Number.isInteger ? Number.isInteger : function (t) { return it(t) && t % 1 == 0; }, ct = function (t) { return it(t) && t < 0; }; function ft(t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; } var st = function (t) { return it(t) && t % 2 != 0; }, lt = function (t) { return it(t) && t > 0; }, dt = function (t, n) { if (l(t)) { for (var r, e = -1 / 0, i = 0; i < t.length; i++) { var u = t[i], o = f(n) ? n(u) : u[n]; o > e && ((r = u), (e = o)); } return r; } }, ht = function (t, n) { if (l(t)) { for (var r, e = 1 / 0, i = 0; i < t.length; i++) { var u = t[i], o = f(n) ? n(u) : u[n]; o < e && ((r = u), (e = o)); } return r; } }, pt = function (t, n) { return ((t % n) + n) % n; }, vt = 180 / Math.PI, yt = function (t) { return vt * t; }, gt = parseInt, bt = Math.PI / 180, mt = function (t) { return bt * t; }, Ot = p, jt = function (t, n) { return t.hasOwnProperty(n); }, xt = jt, wt = Object.values ? function (t) { return Object.values(t); } : function (t) { var n = []; return ( p(t, function (r, e) { (f(t) && "prototype" === e) || n.push(r); }), n ); }, At = function (t, n) { return i(wt(t), n); }, St = function (t) { return s(t) ? "" : t.toString(); }, Pt = function (t) { return St(t).toLowerCase(); }, Et = function (t) { var n = St(t); return n.charAt(0).toLowerCase() + n.substring(1); }; var _t = function (t, n) { return t && n ? t.replace(/\\?\{([^{}]+)\}/g, function (t, r) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === n[r] ? "" : n[r]; }) : t; }, Ct = function (t) { return St(t).toUpperCase(); }, Mt = function (t) { var n = St(t); return n.charAt(0).toUpperCase() + n.substring(1); }, Tt = {}.toString, Bt = function (t) { return Tt.call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }, Nt = function (t) { return c(t, "Arguments"); }, kt = function (t) { return c(t, "Boolean"); }, It = function (t) { return c(t, "Date"); }, Lt = function (t) { return c(t, "Error"); }, Ft = function (t) { return it(t) && isFinite(t); }, Dt = function (t) { return null === t; }, Ht = Object.prototype, Rt = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || Ht); }, zt = function (t) { return c(t, "RegExp"); }, Vt = function (t) { return void 0 === t; }, qt = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; function Ut(t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); } function Wt(t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); } function Gt(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } function Yt(t, n, r, e) { return n && Gt(t, n), r && Gt(t, r), e && Gt(t, e), t; } var Kt = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; for (var r = t[0], e = 1; e < t.length; e++) { var i = t[e]; f(i) && (i = i.prototype), Yt(r.prototype, i); } }; function Xt(t) { return (Xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var $t = function t(n) { if ("object" !== Xt(n) || null === n) return n; var r; if (l(n)) { r = []; for (var e = 0, i = n.length; e < i; e++) "object" === Xt(n[e]) && null != n[e] ? (r[e] = t(n[e])) : (r[e] = n[e]); } else for (var u in ((r = {}), n)) "object" === Xt(n[u]) && null != n[u] ? (r[u] = t(n[u])) : (r[u] = n[u]); return r; }; var Jt = function (t, n, r) { var e; return function () { var i = this, u = arguments, o = function () { (e = null), r || t.apply(i, u); }, a = r && !e; clearTimeout(e), (e = setTimeout(o, n)), a && t.apply(i, u); }; }, Qt = function (t, n) { if (!f(t)) throw new TypeError("Expected a function"); var r = function r() { for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i]; var u = n ? n.apply(this, e) : e[0], o = r.cache; if (o.has(u)) return o.get(u); var a = t.apply(this, e); return o.set(u, a), a; }; return (r.cache = new Map()), r; }; function Zt(t, n, r, e) { for (var i in ((r = r || 0), (e = e || 5), n)) if (n.hasOwnProperty(i)) { var u = n[i]; null !== u && m(u) ? (m(t[i]) || (t[i] = {}), r < e ? Zt(t[i], u, r + 1, e) : (t[i] = n[i])) : l(u) ? ((t[i] = []), (t[i] = t[i].concat(u))) : void 0 !== u && (t[i] = u); } } var tn = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) Zt(t, n[e]); return t; }, nn = function (t, n, r, e) { f(n) || ((r = n), (n = t), (t = function () {})); var i = Object.create ? function (t, n) { return Object.create(t, { constructor: { value: n } }); } : function (t, n) { function r() {} r.prototype = t; var e = new r(); return (e.constructor = n), e; }, u = i(n.prototype, t); return ( (t.prototype = Yt(u, t.prototype)), (t.superclass = i(n.prototype, n)), Yt(u, r), Yt(t, e), t ); }, rn = function (t, n) { if (!e(t)) return -1; var r = Array.prototype.indexOf; if (r) return r.call(t, n); for (var i = -1, u = 0; u < t.length; u++) if (t[u] === n) { i = u; break; } return i; }, en = Object.prototype.hasOwnProperty; var un = function (t) { if (s(t)) return !0; if (e(t)) return !t.length; var n = Bt(t); if ("Map" === n || "Set" === n) return !t.size; if (Rt(t)) return !Object.keys(t).length; for (var r in t) if (en.call(t, r)) return !1; return !0; }, on = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (L(n) || L(r)) return !1; if (e(n) || e(r)) { if (n.length !== r.length) return !1; for (var i = !0, u = 0; u < n.length && (i = t(n[u], r[u])); u++); return i; } if (b(n) || b(r)) { var o = Object.keys(n), a = Object.keys(r); if (o.length !== a.length) return !1; for (i = !0, u = 0; u < o.length && (i = t(n[o[u]], r[o[u]])); u++); return i; } return !1; }, an = function (t, n, r) { return f(r) ? !!r(t, n) : on(t, n); }, cn = function (t, n) { if (!e(t)) return t; for (var r = [], i = 0; i < t.length; i++) { var u = t[i]; r.push(n(u, i)); } return r; }, fn = function (t) { return t; }, sn = function (t, n) { void 0 === n && (n = fn); var r = {}; return ( h(t) && !s(t) && Object.keys(t).forEach(function (e) { r[e] = n(t[e], e); }), r ); }, ln = function (t, n, r) { for (var e = 0, i = L(n) ? n.split(".") : n; t && e < i.length; ) t = t[i[e++]]; return void 0 === t || e < i.length ? r : t; }, dn = function (t, n, r) { var e = t, i = L(n) ? n.split(".") : n; return ( i.forEach(function (t, n) { n < i.length - 1 ? (h(e[t]) || (e[t] = it(i[n + 1]) ? [] : {}), (e = e[t])) : (e[t] = r); }), t ); }, hn = Object.prototype.hasOwnProperty, pn = function (t, n) { if (null === t || !m(t)) return {}; var r = {}; return ( p(n, function (n) { hn.call(t, n) && (r[n] = t[n]); }), r ); }, vn = function (t, n) { return k( t, function (t, r, e) { return n.includes(e) || (t[e] = r), t; }, {}, ); }, yn = function (t, n, r) { var e, i, u, o, a = 0; r || (r = {}); var c = function () { (a = !1 === r.leading ? 0 : Date.now()), (e = null), (o = t.apply(i, u)), e || (i = u = null); }, f = function () { var f = Date.now(); a || !1 !== r.leading || (a = f); var s = n - (f - a); return ( (i = this), (u = arguments), s <= 0 || s > n ? (e && (clearTimeout(e), (e = null)), (a = f), (o = t.apply(i, u)), e || (i = u = null)) : e || !1 === r.trailing || (e = setTimeout(c, s)), o ); }; return ( (f.cancel = function () { clearTimeout(e), (a = 0), (e = i = u = null); }), f ); }, gn = function (t) { return e(t) ? Array.prototype.slice.call(t) : []; }, bn = {}, mn = function (t) { return bn[(t = t || "g")] ? (bn[t] += 1) : (bn[t] = 1), t + bn[t]; }, On = function () {}, jn = function (t) { return t; }; function xn(t) { return s(t) ? 0 : e(t) ? t.length : Object.keys(t).length; } var wn, An = r(1), Sn = Qt( function (t, n) { void 0 === n && (n = {}); var r = n.fontSize, e = n.fontFamily, i = n.fontWeight, u = n.fontStyle, o = n.fontVariant; return ( wn || (wn = document.createElement("canvas").getContext("2d")), (wn.font = [u, o, i, r + "px", e].join(" ")), wn.measureText(L(t) ? t : "").width ); }, function (t, n) { return void 0 === n && (n = {}), Object(An.g)([t], wt(n)).join(""); }, ), Pn = function (t, n, r, e) { void 0 === e && (e = "..."); var i, u, o = Sn(e, r), a = L(t) ? t : St(t), c = n, f = []; if (Sn(t, r) <= n) return t; for (; (i = a.substr(0, 16)), !((u = Sn(i, r)) + o > c && u > c); ) if ((f.push(i), (c -= u), !(a = a.substr(16)))) return f.join(""); for (; (i = a.substr(0, 1)), !((u = Sn(i, r)) + o > c); ) if ((f.push(i), (c -= u), !(a = a.substr(1)))) return f.join(""); return "" + f.join("") + e; }, En = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); }, 1: function (t, n, r) { "use strict"; r.d(n, "c", function () { return i; }), r.d(n, "a", function () { return u; }), r.d(n, "e", function () { return o; }), r.d(n, "b", function () { return a; }), r.d(n, "d", function () { return c; }), r.d(n, "g", function () { return f; }), r.d(n, "f", function () { return s; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var e = function (t, n) { return (e = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); })(t, n); }; function i(t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function r() { this.constructor = t; } e(t, n), (t.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); } var u = function () { return (u = Object.assign || function (t) { for (var n, r = 1, e = arguments.length; r < e; r++) for (var i in (n = arguments[r])) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]); return t; }).apply(this, arguments); }; function o(t, n) { var r = {}; for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (e = Object.getOwnPropertySymbols(t); i < e.length; i++) n.indexOf(e[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[i]) && (r[e[i]] = t[e[i]]); } return r; } function a(t, n, r, e) { return new (r || (r = Promise))(function (i, u) { function o(t) { try { c(e.next(t)); } catch (t) { u(t); } } function a(t) { try { c(e.throw(t)); } catch (t) { u(t); } } function c(t) { var n; t.done ? i(t.value) : ((n = t.value), n instanceof r ? n : new r(function (t) { t(n); })).then(o, a); } c((e = e.apply(t, n || [])).next()); }); } function c(t, n) { var r, e, i, u, o = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (u = { next: a(0), throw: a(1), return: a(2) }), "function" == typeof Symbol && (u[Symbol.iterator] = function () { return this; }), u ); function a(u) { return function (a) { return (function (u) { if (r) throw new TypeError("Generator is already executing."); for (; o; ) try { if ( ((r = 1), e && (i = 2 & u[0] ? e.return : u[0] ? e.throw || ((i = e.return) && i.call(e), 0) : e.next) && !(i = i.call(e, u[1])).done) ) return i; switch (((e = 0), i && (u = [2 & u[0], i.value]), u[0])) { case 0: case 1: i = u; break; case 4: return o.label++, { value: u[1], done: !1 }; case 5: o.label++, (e = u[1]), (u = [0]); continue; case 7: (u = o.ops.pop()), o.trys.pop(); continue; default: if ( !((i = o.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== u[0] && 2 !== u[0])) ) { o = 0; continue; } if (3 === u[0] && (!i || (u[1] > i[0] && u[1] < i[3]))) { o.label = u[1]; break; } if (6 === u[0] && o.label < i[1]) { (o.label = i[1]), (i = u); break; } if (i && o.label < i[2]) { (o.label = i[2]), o.ops.push(u); break; } i[2] && o.ops.pop(), o.trys.pop(); continue; } u = n.call(t, o); } catch (t) { (u = [6, t]), (e = 0); } finally { r = i = 0; } if (5 & u[0]) throw u[1]; return { value: u[0] ? u[1] : void 0, done: !0 }; })([u, a]); }; } } Object.create; function f() { for (var t = 0, n = 0, r = arguments.length; n < r; n++) t += arguments[n].length; var e = Array(t), i = 0; for (n = 0; n < r; n++) for (var u = arguments[n], o = 0, a = u.length; o < a; o++, i++) e[i] = u[o]; return e; } function s(t, n, r) { if (r || 2 === arguments.length) for (var e, i = 0, u = n.length; i < u; i++) (!e && i in n) || (e || (e = Array.prototype.slice.call(n, 0, i)), (e[i] = n[i])); return t.concat(e || Array.prototype.slice.call(n)); } Object.create; }, 196: function (t, n, r) { "use strict"; r.r(n); var e = r(1), i = r(99), u = r.n(i), o = r(0); n.default = function (t) { var n = t.Graph, r = t.Util, i = r.radialLayout, a = r.traverseTree; return (function (t) { function n(n) { var r = t.call(this, n) || this; return ( (r.layoutAnimating = !1), r.set("removeList", []), r.set("layoutMethod", r.getLayout()), r ); } return ( Object(e.c)(n, t), (n.prototype.getLayout = function () { var t = this.get("layout"); return t ? "function" == typeof t ? t : (t.type || (t.type = "dendrogram"), t.direction || (t.direction = "TB"), t.radial ? function (n) { var r = u.a[t.type](n, t); return i(r), r; } : function (n) { return u.a[t.type](n, t); }) : null; }), (n.indexOfChild = function (t, n) { var r = -1; return ( Object(o.each)(t, function (t, e) { if (n === t.id) return (r = e), !1; }), r ); }), (n.prototype.getDefaultCfg = function () { var n = t.prototype.getDefaultCfg.call(this); return (n.animate = !0), n; }), (n.prototype.innerAddChild = function (t, n, r) { var e = this, i = t.data; i && ((i.x = t.x), (i.y = t.y), (i.depth = t.depth)); var u = e.addItem("node", i, !1); if (n) { if ((u.set("parent", n), r)) { var a = n.get("originAttrs"); if (a) u.set("originAttrs", a); else { var c = n.getModel(); u.set("originAttrs", { x: c.x, y: c.y }); } } var f = n.get("children"); f ? f.push(u) : n.set("children", [u]), e.addItem( "edge", { source: n, target: u, id: n.get("id") + ":" + u.get("id"), }, !1, ); } return ( Object(o.each)(t.children || [], function (t) { e.innerAddChild(t, u, r); }), e.emit("afteraddchild", { item: u, parent: n }), u ); }), (n.prototype.innerUpdateChild = function (t, r, e) { var i = this, u = i.findById(t.id); if (u) { Object(o.each)(t.children || [], function (t) { i.innerUpdateChild(t, u, e); }); var a, c, f = u.get("children"); if (f) if (f.length > 0) for (var s = f.length - 1; s >= 0; s--) { var l = f[s].getModel(); -1 === n.indexOfChild(t.children || [], l.id) && (i.innerRemoveChild(l.id, { x: t.x, y: t.y }, e), f.splice(s, 1)); } u.get("originAttrs") && ((a = u.get("originAttrs").x), (c = u.get("originAttrs").y)); var d = u.getModel(); e && u.set("originAttrs", { x: d.x, y: d.y }), u.set("model", t.data), (a === t.x && c === t.y) || u.updatePosition({ x: t.x, y: t.y }); } else i.innerAddChild(t, r, e); }), (n.prototype.innerRemoveChild = function (t, n, r) { var e = this, i = e.findById(t); if (i) if ( (Object(o.each)(i.get("children"), function (t) { e.innerRemoveChild(t.getModel().id, n, r); }), r) ) { var u = i.getModel(); i.set("to", n), i.set("originAttrs", { x: u.x, y: u.y }), e.get("removeList").push(i); } else e.removeItem(i); }), (n.prototype.changeData = function (t) { var n = this; this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }), t ? (n.data(t), n.render()) : n.layout(this.get("fitView")); }), (n.prototype.changeLayout = function (t) { console.warn( "Please call updateLayout instead of changeLayout. changeLayout will be discarded soon", ); this.updateLayout(t); }), (n.prototype.updateLayout = function (t) { t ? (this.set("layout", t), this.set("layoutMethod", this.getLayout()), this.layout()) : console.warn("layout cannot be null"); }), (n.prototype.refreshLayout = function (t) { console.warn( "Please call layout instead of refreshLayout. refreshLayout will be discarded soon", ); this.layout(t); }), (n.prototype.layout = function (t) { var n = this.get("data"), r = this.get("layoutMethod")(n, this.get("layout")), e = this.get("animate"); (this.emit("beforerefreshlayout", { data: n, layoutData: r }), this.emit("beforelayout"), this.innerUpdateChild(r, void 0, e), t) && this.get("viewController").fitView(); e ? this.layoutAnimate(r) : (this.refresh(), this.paint()), this.emit("afterrefreshlayout", { data: n, layoutData: r }), this.emit("afterlayout"); }), (n.prototype.addChild = function (t, n) { this.emit("beforeaddchild", { model: t, parent: n }), Object(o.isString)(n) || (n = n.get("id")); var r = this.findDataById(n); r && (r.children || (r.children = []), r.children.push(t), this.changeData()); }), (n.prototype.updateChildren = function (t, n) { n && this.findById(n) ? ((this.findDataById(n).children = t), this.changeData()) : console.warn( "Update children failed! There is no node with id '" + n + "'", ); }), (n.prototype.updateChild = function (t, r) { if (r && this.findById(r)) { var e = this.findDataById(r), i = this.findById(t.id); if ((e.children || (e.children = []), i)) { var u = n.indexOfChild(e.children, t.id); e.children[u] = t; } else e.children.push(t); this.changeData(); } else this.changeData(t); }), (n.prototype.removeChild = function (t) { var r = this.findById(t); if (r) { var e = r.get("parent"); if (e && !e.destroyed) { var i = this.findDataById(e.get("id")), u = (i && i.children) || [], o = r.getModel(), a = n.indexOfChild(u, o.id); u.splice(a, 1); } this.changeData(); } }), (n.prototype.findDataById = function (t, n) { var r = this; if ((n || (n = r.get("data")), t === n.id)) return n; var e = null; return ( Object(o.each)(n.children || [], function (n) { return n.id === t ? ((e = n), !1) : !(e = r.findDataById(t, n)) && void 0; }), e ); }), (n.prototype.layoutAnimate = function (t, n) { var r = this, e = this.get("animateCfg"); r.emit("beforeanimate", { data: t }), r.getEdges().forEach(function (t) { var n = t.get("model"); n.sourceAnchor || (n.sourceAnchor = t.get("sourceAnchorIndex")); }), this.get("canvas").animate( function (e) { a(t, function (i) { var u = r.findById(i.id); if (u) { var o = u.get("originAttrs"), a = u.get("model"); if ( (o || ((o = { x: a.x, y: a.y }), u.set("originAttrs", o)), n) ) { var c = n(u, e, o, t); u.set("model", Object.assign(a, c)); } else (a.x = o.x + (i.x - o.x) * e), (a.y = o.y + (i.y - o.y) * e); } return !0; }), Object(o.each)(r.get("removeList"), function (t) { var n = t.getModel(), r = t.get("originAttrs"), i = t.get("to"); (n.x = r.x + (i.x - r.x) * e), (n.y = r.y + (i.y - r.y) * e); }), r.refreshPositions(); }, { duration: e.duration, easing: e.ease, callback: function () { Object(o.each)(r.getNodes(), function (t) { t.set("originAttrs", null); }), Object(o.each)(r.get("removeList"), function (t) { r.removeItem(t); }), r.set("removeList", []), e.callback && e.callback(), r.emit("afteranimate", { data: t }); }, delay: e.delay, }, ); }), (n.prototype.stopLayoutAnimate = function () { this.get("canvas").stopAnimate(), this.emit("layoutanimateend", { data: this.get("data") }), (this.layoutAnimating = !1); }), (n.prototype.isLayoutAnimating = function () { return this.layoutAnimating; }), (n.prototype.render = function () { if (!this.get("data")) throw new Error("data must be defined first"); this.clear(), this.emit("beforerender"), this.layout(this.get("fitView")), this.emit("afterrender"); }), (n.prototype.save = function () { return this.get("data"); }), n ); })(n); }; }, 45: function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, 99: function (t, n, r) { (function (t) { var r, e, i, u; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } "undefined" != typeof self && self, (u = function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return ( t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports ); } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { configurable: !1, enumerable: !0, get: e, }); }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 31)) ); })([ function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Array.isArray ? Array.isArray(t) : Object(e.a)(t, "Array"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( null !== t && "function" != typeof t && isFinite(t.length) ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(13); n.a = function (t, n) { if (t) if (Object(e.a)(t)) for ( var r = 0, u = t.length; r < u && !1 !== n(t[r], r); r++ ); else if (Object(i.a)(t)) for (var o in t) if (t.hasOwnProperty(o) && !1 === n(t[o], o)) break; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Function"); }; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t, n) { return e.call(t) === "[object " + n + "]"; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Number"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null == t; }; }, function (t, n, r) { var e = r(33).mix; t.exports = { assign: e }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "String"); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(4); n.a = function (t) { if (!Object(e.a)(t) || !Object(i.a)(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; }, function (t, n, r) { "use strict"; var e = r(6); n.a = function (t) { return Object(e.a)(t) ? "" : t.toString(); }; }, function (t, n, r) { var e = r(18), i = (function () { function t(t, n) { void 0 === n && (n = {}), (this.options = n), (this.rootNode = e(t, n)); } return ( (t.prototype.execute = function () { throw new Error("please override this method"); }), t ); })(); t.exports = i; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { return !!Object(e.a)(t) && t.indexOf(n) > -1; }; }, function (t, n, r) { "use strict"; n.a = function (t) { var n = o(t); return (null !== t && "object" === n) || "function" === n; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { n(t, e) && r.push(t); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return "object" === o(t) && null !== t; }; }, function (t, n, r) { "use strict"; function e(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } n.a = function (t, n, r, i) { return n && e(t, n), r && e(t, r), i && e(t, i), t; }; }, function (t, n, r) { var e = r(30), i = ["LR", "RL", "TB", "BT", "H", "V"], u = ["LR", "RL", "H"], o = i[0]; t.exports = function (t, n, r) { var a = n.direction || o; if ( ((n.isHorizontal = (function (t) { return u.indexOf(t) > -1; })(a)), a && -1 === i.indexOf(a)) ) throw new TypeError("Invalid direction: " + a); if (a === i[0]) r(t, n); else if (a === i[1]) r(t, n), t.right2left(); else if (a === i[2]) r(t, n); else if (a === i[3]) r(t, n), t.bottom2top(); else if (a === i[4] || a === i[5]) { var c = e(t, n), f = c.left, s = c.right; r(f, n), r(s, n), n.isHorizontal ? f.right2left() : f.bottom2top(), s.translate(f.x - s.x, f.y - s.y), (t.x = f.x), (t.y = s.y); var l = t.getBoundingBox(); n.isHorizontal ? l.top < 0 && t.translate(0, -l.top) : l.left < 0 && t.translate(-l.left, 0); } var d = n.fixedRoot; return ( void 0 === d && (d = !0), d && t.translate( -(t.x + t.width / 2 + t.hgap), -(t.y + t.height / 2 + t.vgap), ), t ); }; }, function (t, n, r) { var e = r(7), i = { getId: function (t) { return t.id || t.name; }, getPreH: function (t) { return t.preH || 0; }, getPreV: function (t) { return t.preV || 0; }, getHGap: function (t) { return t.hgap || 18; }, getVGap: function (t) { return t.vgap || 18; }, getChildren: function (t) { return t.children; }, getHeight: function (t) { return t.height || 36; }, getWidth: function (t) { var n = t.label || " "; return t.width || 18 * n.split("").length; }, }; function u(t, n) { var r = this; if (((r.vgap = r.hgap = 0), t instanceof u)) return t; r.data = t; var e = n.getHGap(t), i = n.getVGap(t); return ( (r.preH = n.getPreH(t)), (r.preV = n.getPreV(t)), (r.width = n.getWidth(t)), (r.height = n.getHeight(t)), (r.width += r.preH), (r.height += r.preV), (r.id = n.getId(t)), (r.x = r.y = 0), (r.depth = 0), r.children || (r.children = []), r.addGap(e, i), r ); } e.assign(u.prototype, { isRoot: function () { return 0 === this.depth; }, isLeaf: function () { return 0 === this.children.length; }, addGap: function (t, n) { (this.hgap += t), (this.vgap += n), (this.width += 2 * t), (this.height += 2 * n); }, eachNode: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = n.children.concat(r)); }, DFTraverse: function (t) { this.eachNode(t); }, BFTraverse: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = r.concat(n.children)); }, getBoundingBox: function () { var t = { left: Number.MAX_VALUE, top: Number.MAX_VALUE, width: 0, height: 0, }; return ( this.eachNode(function (n) { (t.left = Math.min(t.left, n.x)), (t.top = Math.min(t.top, n.y)), (t.width = Math.max(t.width, n.x + n.width)), (t.height = Math.max(t.height, n.y + n.height)); }), t ); }, translate: function (t, n) { void 0 === t && (t = 0), void 0 === n && (n = 0), this.eachNode(function (r) { (r.x += t), (r.y += n), (r.x += r.preH), (r.y += r.preV); }); }, right2left: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.x = n.x - 2 * (n.x - t.left) - n.width; }), this.translate(t.width, 0); }, bottom2top: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.y = n.y - 2 * (n.y - t.top) - n.height; }), this.translate(0, t.height); }, }), (t.exports = function (t, n, r) { void 0 === n && (n = {}); var o, a = new u(t, (n = e.assign({}, i, n))), c = [a]; if (!r && !t.collapsed) for (; (o = c.shift()); ) if (!o.data.collapsed) { var f = n.getChildren(o.data), s = f ? f.length : 0; if (((o.children = new Array(s)), f && s)) for (var l = 0; l < s; l++) { var d = new u(f[l], n); (o.children[l] = d), c.push(d), (d.parent = o), (d.depth = o.depth + 1); } } return a; }); }, function (t, n, r) { "use strict"; var e = r(6), i = r(20); n.a = function (t, n) { var r = Object(i.a)(n), u = r.length; if (Object(e.a)(t)) return !u; for (var o = 0; o < u; o += 1) { var a = r[o]; if (n[a] !== t[a] || !(a in t)) return !1; } return !0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), u = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(e); }), n ); }; n.a = u; }, function (t, n, r) { "use strict"; var e = r(1), i = Array.prototype.splice; n.a = function (t, n) { if (!Object(e.a)(t)) return []; for (var r = t ? n.length : 0, u = r - 1; r--; ) { var o = void 0, a = n[r]; (r !== u && a === o) || ((o = a), i.call(t, a, 1)); } return t; }; }, function (t, n, r) { "use strict"; var e = r(12), i = r(2); n.a = function (t) { var n = []; return ( Object(i.a)(t, function (t) { Object(e.a)(n, t) || n.push(t); }), n ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(3), u = r(24); n.a = function (t, n) { if (!n) return { 0: t }; if (!Object(i.a)(n)) { var r = Object(e.a)(n) ? n : n.replace(/\s+/g, "").split("*"); n = function (t) { for (var n = "_", e = 0, i = r.length; e < i; e++) n += t[r[e]] && t[r[e]].toString(); return n; }; } return Object(u.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), u = r(3), o = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (!n || !Object(i.a)(t)) return {}; var r, a = {}, c = Object(u.a)(n) ? n : function (t) { return t[n]; }; return ( Object(e.a)(t, function (t) { (r = c(t)), o.call(a, r) ? a[r].push(t) : (a[r] = [t]); }), a ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t.hasOwnProperty(n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), u = Object.values ? function (t) { return Object.values(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(r); }), n ); }; n.a = u; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t) { return e .call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }; }, function (t, n, r) { "use strict"; var e = Object.prototype; n.a = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(1), u = r(8); n.a = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (Object(u.a)(n) || Object(u.a)(r)) return !1; if (Object(i.a)(n) || Object(i.a)(r)) { if (n.length !== r.length) return !1; for ( var o = !0, a = 0; a < n.length && (o = t(n[a], r[a])); a++ ); return o; } if (Object(e.a)(n) || Object(e.a)(r)) { var c = Object.keys(n), f = Object.keys(r); if (c.length !== f.length) return !1; for ( o = !0, a = 0; a < c.length && (o = t(n[c[a]], r[c[a]])); a++ ); return o; } return !1; }; }, function (t, n, r) { var e = r(18); t.exports = function (t, n) { for ( var r = e(t.data, n, !0), i = e(t.data, n, !0), u = t.children.length, o = Math.round(u / 2), a = n.getSide || function (t, n) { return n < o ? "right" : "left"; }, c = 0; c < u; c++ ) { var f = t.children[c]; "right" === a(f, c) ? i.children.push(f) : r.children.push(f); } return ( r.eachNode(function (t) { t.isRoot() || (t.side = "left"); }), i.eachNode(function (t) { t.isRoot() || (t.side = "right"); }), { left: r, right: i } ); }; }, function (t, n, r) { var e = { compactBox: r(32), dendrogram: r(114), indented: r(116), mindmap: r(118), }; t.exports = e; }, function (t, n, r) { var e = r(11), i = r(113), u = r(17), o = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return u(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = o.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }); var e = r(12); r.d(n, "contains", function () { return e.a; }), r.d(n, "includes", function () { return e.a; }); var i = r(34); r.d(n, "difference", function () { return i.a; }); var u = r(35); r.d(n, "find", function () { return u.a; }); var o = r(36); r.d(n, "findIndex", function () { return o.a; }); var a = r(37); r.d(n, "firstValue", function () { return a.a; }); var c = r(38); r.d(n, "flatten", function () { return c.a; }); var f = r(39); r.d(n, "flattenDeep", function () { return f.a; }); var s = r(40); r.d(n, "getRange", function () { return s.a; }); var l = r(41); r.d(n, "pull", function () { return l.a; }); var d = r(21); r.d(n, "pullAt", function () { return d.a; }); var h = r(42); r.d(n, "reduce", function () { return h.a; }); var p = r(43); r.d(n, "remove", function () { return p.a; }); var v = r(44); r.d(n, "sortBy", function () { return v.a; }); var y = r(45); r.d(n, "union", function () { return y.a; }); var g = r(22); r.d(n, "uniq", function () { return g.a; }); var b = r(46); r.d(n, "valuesOfKey", function () { return b.a; }); var m = r(47); r.d(n, "head", function () { return m.a; }); var O = r(48); r.d(n, "last", function () { return O.a; }); var j = r(49); r.d(n, "startsWith", function () { return j.a; }); var x = r(50); r.d(n, "endsWith", function () { return x.a; }); var w = r(14); r.d(n, "filter", function () { return w.a; }); var A = r(51); r.d(n, "every", function () { return A.a; }); var S = r(52); r.d(n, "some", function () { return S.a; }); var P = r(53); r.d(n, "group", function () { return P.a; }); var E = r(24); r.d(n, "groupBy", function () { return E.a; }); var _ = r(23); r.d(n, "groupToMap", function () { return _.a; }); var C = r(54); r.d(n, "getWrapBehavior", function () { return C.a; }); var M = r(55); r.d(n, "wrapBehavior", function () { return M.a; }); var T = r(56); r.d(n, "number2color", function () { return T.a; }); var B = r(57); r.d(n, "parseRadius", function () { return B.a; }); var N = r(58); r.d(n, "clamp", function () { return N.a; }); var k = r(59); r.d(n, "fixedBase", function () { return k.a; }); var I = r(60); r.d(n, "isDecimal", function () { return I.a; }); var L = r(61); r.d(n, "isEven", function () { return L.a; }); var F = r(62); r.d(n, "isInteger", function () { return F.a; }); var D = r(63); r.d(n, "isNegative", function () { return D.a; }); var H = r(64); r.d(n, "isNumberEqual", function () { return H.a; }); var R = r(65); r.d(n, "isOdd", function () { return R.a; }); var z = r(66); r.d(n, "isPositive", function () { return z.a; }); var V = r(67); r.d(n, "maxBy", function () { return V.a; }); var q = r(68); r.d(n, "minBy", function () { return q.a; }); var U = r(69); r.d(n, "mod", function () { return U.a; }); var W = r(70); r.d(n, "toDegree", function () { return W.a; }); var G = r(71); r.d(n, "toInteger", function () { return G.a; }); var Y = r(72); r.d(n, "toRadian", function () { return Y.a; }); var K = r(73); r.d(n, "forIn", function () { return K.a; }); var X = r(25); r.d(n, "has", function () { return X.a; }); var $ = r(74); r.d(n, "hasKey", function () { return $.a; }); var J = r(75); r.d(n, "hasValue", function () { return J.a; }); var Q = r(20); r.d(n, "keys", function () { return Q.a; }); var Z = r(19); r.d(n, "isMatch", function () { return Z.a; }); var tt = r(26); r.d(n, "values", function () { return tt.a; }); var nt = r(76); r.d(n, "lowerCase", function () { return nt.a; }); var rt = r(77); r.d(n, "lowerFirst", function () { return rt.a; }); var et = r(78); r.d(n, "substitute", function () { return et.a; }); var it = r(79); r.d(n, "upperCase", function () { return it.a; }); var ut = r(80); r.d(n, "upperFirst", function () { return ut.a; }); var ot = r(27); r.d(n, "getType", function () { return ot.a; }); var at = r(81); r.d(n, "isArguments", function () { return at.a; }); var ct = r(0); r.d(n, "isArray", function () { return ct.a; }); var ft = r(1); r.d(n, "isArrayLike", function () { return ft.a; }); var st = r(82); r.d(n, "isBoolean", function () { return st.a; }); var lt = r(83); r.d(n, "isDate", function () { return lt.a; }); var dt = r(84); r.d(n, "isError", function () { return dt.a; }); var ht = r(3); r.d(n, "isFunction", function () { return ht.a; }); var pt = r(85); r.d(n, "isFinite", function () { return pt.a; }); var vt = r(6); r.d(n, "isNil", function () { return vt.a; }); var yt = r(86); r.d(n, "isNull", function () { return yt.a; }); var gt = r(5); r.d(n, "isNumber", function () { return gt.a; }); var bt = r(13); r.d(n, "isObject", function () { return bt.a; }); var mt = r(15); r.d(n, "isObjectLike", function () { return mt.a; }); var Ot = r(9); r.d(n, "isPlainObject", function () { return Ot.a; }); var jt = r(28); r.d(n, "isPrototype", function () { return jt.a; }); var xt = r(87); r.d(n, "isRegExp", function () { return xt.a; }); var wt = r(8); r.d(n, "isString", function () { return wt.a; }); var At = r(4); r.d(n, "isType", function () { return At.a; }); var St = r(88); r.d(n, "isUndefined", function () { return St.a; }); var Pt = r(89); r.d(n, "isElement", function () { return Pt.a; }); var Et = r(90); r.d(n, "requestAnimationFrame", function () { return Et.a; }); var _t = r(91); r.d(n, "clearAnimationFrame", function () { return _t.a; }); var Ct = r(92); r.d(n, "augment", function () { return Ct.a; }); var Mt = r(93); r.d(n, "clone", function () { return Mt.a; }); var Tt = r(94); r.d(n, "debounce", function () { return Tt.a; }); var Bt = r(95); r.d(n, "memoize", function () { return Bt.a; }); var Nt = r(96); r.d(n, "deepMix", function () { return Nt.a; }); var kt = r(2); r.d(n, "each", function () { return kt.a; }); var It = r(97); r.d(n, "extend", function () { return It.a; }); var Lt = r(98); r.d(n, "indexOf", function () { return Lt.a; }); var Ft = r(99); r.d(n, "isEmpty", function () { return Ft.a; }); var Dt = r(29); r.d(n, "isEqual", function () { return Dt.a; }); var Ht = r(100); r.d(n, "isEqualWith", function () { return Ht.a; }); var Rt = r(101); r.d(n, "map", function () { return Rt.a; }); var zt = r(102); r.d(n, "mapValues", function () { return zt.a; }); var Vt = r(16); r.d(n, "mix", function () { return Vt.a; }), r.d(n, "assign", function () { return Vt.a; }); var qt = r(103); r.d(n, "get", function () { return qt.a; }); var Ut = r(104); r.d(n, "set", function () { return Ut.a; }); var Wt = r(105); r.d(n, "pick", function () { return Wt.a; }); var Gt = r(106); r.d(n, "throttle", function () { return Gt.a; }); var Yt = r(107); r.d(n, "toArray", function () { return Yt.a; }); var Kt = r(10); r.d(n, "toString", function () { return Kt.a; }); var Xt = r(108); r.d(n, "uniqueId", function () { return Xt.a; }); var $t = r(109); r.d(n, "noop", function () { return $t.a; }); var Jt = r(110); r.d(n, "identity", function () { return Jt.a; }); var Qt = r(111); r.d(n, "size", function () { return Qt.a; }); var Zt = r(112); r.d(n, "Cache", function () { return Zt.a; }); }, function (t, n, r) { "use strict"; var e = r(14), i = r(12); n.a = function (t, n) { return ( void 0 === n && (n = []), Object(e.a)(t, function (t) { return !Object(i.a)(n, t); }) ); }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(19), u = r(0), o = r(9); n.a = function (t, n) { if (!Object(u.a)(t)) return null; var r; if ( (Object(e.a)(n) && (r = n), Object(o.a)(n) && (r = function (t) { return Object(i.a)(t, n); }), r) ) for (var a = 0; a < t.length; a += 1) if (r(t[a])) return t[a]; return null; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { void 0 === r && (r = 0); for (var e = r; e < t.length; e++) if (n(t[e], e)) return e; return -1; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(0); n.a = function (t, n) { for (var r = null, u = 0; u < t.length; u++) { var o = t[u][n]; if (!Object(e.a)(o)) { r = Object(i.a)(o) ? o[0] : o; break; } } return r; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { if (!Object(e.a)(t)) return []; for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n, r) { if ((void 0 === r && (r = []), Object(e.a)(n))) for (var i = 0; i < n.length; i += 1) t(n[i], r); else r.push(n); return r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(14); n.a = function (t) { if ( !(t = Object(i.a)(t, function (t) { return !isNaN(t); })).length ) return { min: 0, max: 0 }; if (Object(e.a)(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); t = n; } var u = Math.max.apply(null, t); return { min: Math.min.apply(null, t), max: u }; }; }, function (t, n, r) { "use strict"; var e = Array.prototype, i = e.splice, u = e.indexOf; n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e++) for (var o = n[e], a = -1; (a = u.call(t, o)) > -1; ) i.call(t, a, 1); return t; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), u = r(9); n.a = function (t, n, r) { if (!Object(i.a)(t) && !Object(u.a)(t)) return t; var o = r; return ( Object(e.a)(t, function (t, r) { o = n(o, t, r); }), o ); }; }, function (t, n, r) { "use strict"; var e = r(1), i = r(21); n.a = function (t, n) { var r = []; if (!Object(e.a)(t)) return r; for (var u = -1, o = [], a = t.length; ++u < a; ) { var c = t[u]; n(c, u, t) && (r.push(c), o.push(u)); } return Object(i.a)(t, o), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8), u = r(3); n.a = function (t, n) { var r; if (Object(u.a)(n)) r = function (t, r) { return n(t) - n(r); }; else { var o = []; Object(i.a)(n) ? o.push(n) : Object(e.a)(n) && (o = n), (r = function (t, n) { for (var r = 0; r < o.length; r += 1) { var e = o[r]; if (t[e] > n[e]) return 1; if (t[e] < n[e]) return -1; } return 0; }); } return t.sort(r), t; }; }, function (t, n, r) { "use strict"; var e = r(22); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; return Object(e.a)([].concat.apply([], t)); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), u = r(6); n.a = function (t, n) { var r = [], o = {}; return ( t.forEach(function (t) { var a = t[n]; Object(u.a)(a) || (Object(i.a)(a) || (a = [a]), Object(e.a)(a, function (t) { o[t] || (r.push(t), (o[t] = !0)); })); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[0]; }; var e = r(1); }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[t.length - 1]; }; var e = r(1); }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return !(!Object(e.a)(t) && !Object(i.a)(t)) && t[0] === n; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return ( !(!Object(e.a)(t) && !Object(i.a)(t)) && t[t.length - 1] === n ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (!n(t[r], r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (n(t[r], r)) return !0; return !1; }; }, function (t, n, r) { "use strict"; var e = r(23); n.a = function (t, n) { if (!n) return [t]; var r = Object(e.a)(t, n), i = []; for (var u in r) i.push(r[u]); return i; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t["_wrap_" + n]; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { var n = e[t]; if (!n) { for (var r = t.toString(16), i = r.length; i < 6; i++) r = "0" + r; (n = "#" + r), (e[t] = n); } return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { var n = 0, r = 0, i = 0, u = 0; return ( Object(e.a)(t) ? 1 === t.length ? (n = r = i = u = t[0]) : 2 === t.length ? ((n = i = t[0]), (r = u = t[1])) : 3 === t.length ? ((n = t[0]), (r = u = t[1]), (i = t[2])) : ((n = t[0]), (r = t[1]), (i = t[2]), (u = t[3])) : (n = r = i = u = t), { r1: n, r2: r, r3: i, r4: u } ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return t < n ? n : t > r ? r : t; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { var r = n.toString(), e = r.indexOf("."); if (-1 === e) return Math.round(t); var i = r.substr(e + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 1 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 == 0; }; }, function (t, n, r) { "use strict"; var e = r(5), i = Number.isInteger ? Number.isInteger : function (t) { return Object(e.a)(t) && t % 1 == 0; }; n.a = i; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t < 0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t > 0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), u = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, o, a = t[0]; return ( (r = Object(u.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (o = Object(u.a)(n) ? n(t) : t[n]) > r && ((a = t), (r = o)); }), a ); } }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), u = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, o, a = t[0]; return ( (r = Object(u.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (o = Object(u.a)(n) ? n(t) : t[n]) < r && ((a = t), (r = o)); }), a ); } }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return ((t % n) + n) % n; }; }, function (t, n, r) { "use strict"; var e = 180 / Math.PI; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; n.a = parseInt; }, function (t, n, r) { "use strict"; var e = Math.PI / 180; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; var e = r(2); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(25); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(12), i = r(26); n.a = function (t, n) { return Object(e.a)(Object(i.a)(t), n); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toLowerCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toLowerCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t && n ? t.replace(/\\?\{([^{}]+)\}/g, function (t, r) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === n[r] ? "" : n[r]; }) : t; }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toUpperCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toUpperCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Arguments"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Boolean"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Date"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Error"); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && isFinite(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null === t; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "RegExp"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return void 0 === t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; for (var r = t[0], u = 1; u < t.length; u++) { var o = t[u]; Object(i.a)(o) && (o = o.prototype), Object(e.a)(r.prototype, o); } }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n) { if ("object" !== o(n) || null === n) return n; var r; if (Object(e.a)(n)) { r = []; for (var i = 0, u = n.length; i < u; i++) "object" === o(n[i]) && null != n[i] ? (r[i] = t(n[i])) : (r[i] = n[i]); } else for (var a in ((r = {}), n)) "object" === o(n[a]) && null != n[a] ? (r[a] = t(n[a])) : (r[a] = n[a]); return r; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e; return function () { var i = this, u = arguments, o = function () { (e = null), r || t.apply(i, u); }, a = r && !e; clearTimeout(e), (e = setTimeout(o, n)), a && t.apply(i, u); }; }; }, function (t, n, r) { "use strict"; var e = r(3); n.a = function (t, n) { if (!Object(e.a)(t)) throw new TypeError("Expected a function"); var r = function r() { for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i]; var u = n ? n.apply(this, e) : e[0], o = r.cache; if (o.has(u)) return o.get(u); var a = t.apply(this, e); return o.set(u, a), a; }; return (r.cache = new Map()), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(9); function u(t, n, r, o) { for (var a in ((r = r || 0), (o = o || 5), n)) if (n.hasOwnProperty(a)) { var c = n[a]; null !== c && Object(i.a)(c) ? (Object(i.a)(t[a]) || (t[a] = {}), r < o ? u(t[a], c, r + 1, o) : (t[a] = n[a])) : Object(e.a)(c) ? ((t[a] = []), (t[a] = t[a].concat(c))) : void 0 !== c && (t[a] = c); } } n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) u(t, n[e]); return t; }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function (t, n, r, u) { Object(i.a)(n) || ((r = n), (n = t), (t = function () {})); var o = Object.create ? function (t, n) { return Object.create(t, { constructor: { value: n }, }); } : function (t, n) { function r() {} r.prototype = t; var e = new r(); return (e.constructor = n), e; }, a = o(n.prototype, t); return ( (t.prototype = Object(e.a)(a, t.prototype)), (t.superclass = o(n.prototype, n)), Object(e.a)(a, r), Object(e.a)(t, u), t ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { if (!Object(e.a)(t)) return -1; var r = Array.prototype.indexOf; if (r) return r.call(t, n); for (var i = -1, u = 0; u < t.length; u++) if (t[u] === n) { i = u; break; } return i; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(1), u = r(27), o = r(28), a = Object.prototype.hasOwnProperty; n.a = function (t) { if (Object(e.a)(t)) return !0; if (Object(i.a)(t)) return !t.length; var n = Object(u.a)(t); if ("Map" === n || "Set" === n) return !t.size; if (Object(o.a)(t)) return !Object.keys(t).length; for (var r in t) if (a.call(t, r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(29); n.a = function (t, n, r) { return Object(e.a)(r) ? !!r(t, n) : Object(i.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { r.push(n(t, e)); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(13), u = function (t) { return t; }; n.a = function (t, n) { void 0 === n && (n = u); var r = {}; return ( Object(i.a)(t) && !Object(e.a)(t) && Object.keys(t).forEach(function (e) { r[e] = n(t[e], e); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(8); n.a = function (t, n, r) { for ( var i = 0, u = Object(e.a)(n) ? n.split(".") : n; t && i < u.length; ) t = t[u[i++]]; return void 0 === t || i < u.length ? r : t; }; }, function (t, n, r) { "use strict"; var e = r(13), i = r(8), u = r(5); n.a = function (t, n, r) { var o = t, a = Object(i.a)(n) ? n.split(".") : n; return ( a.forEach(function (t, n) { n < a.length - 1 ? (Object(e.a)(o[t]) || (o[t] = Object(u.a)(a[n + 1]) ? [] : {}), (o = o[t])) : (o[t] = r); }), t ); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(9), u = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (null === t || !Object(i.a)(t)) return {}; var r = {}; return ( Object(e.a)(n, function (n) { u.call(t, n) && (r[n] = t[n]); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e, i, u, o, a = 0; r || (r = {}); var c = function () { (a = !1 === r.leading ? 0 : Date.now()), (e = null), (o = t.apply(i, u)), e || (i = u = null); }, f = function () { var f = Date.now(); a || !1 !== r.leading || (a = f); var s = n - (f - a); return ( (i = this), (u = arguments), s <= 0 || s > n ? (e && (clearTimeout(e), (e = null)), (a = f), (o = t.apply(i, u)), e || (i = u = null)) : e || !1 === r.trailing || (e = setTimeout(c, s)), o ); }; return ( (f.cancel = function () { clearTimeout(e), (a = 0), (e = i = u = null); }), f ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t) { return Object(e.a)(t) ? Array.prototype.slice.call(t) : []; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { return e[(t = t || "g")] ? (e[t] += 1) : (e[t] = 1), t + e[t]; }; }, function (t, n, r) { "use strict"; n.a = function () {}; }, function (t, n, r) { "use strict"; n.a = function (t) { return t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return Object(e.a)(t) ? 0 : Object(i.a)(t) ? t.length : Object.keys(t).length; }; var e = r(6), i = r(1); }, function (t, n, r) { "use strict"; var e = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); n.a = e; }, function (t, n) { function r(t, n, r, e) { void 0 === e && (e = []); var i = this; (i.w = t || 0), (i.h = n || 0), (i.y = r || 0), (i.x = 0), (i.c = e || []), (i.cs = e.length), (i.prelim = 0), (i.mod = 0), (i.shift = 0), (i.change = 0), (i.tl = null), (i.tr = null), (i.el = null), (i.er = null), (i.msel = 0), (i.mser = 0); } function e(t, n) { var r = (function t(n, r) { var e = r ? n.y : n.x; return ( n.children.forEach(function (n) { e = Math.min(t(n, r), e); }), e ); })(t, n); !(function t(n, r, e) { e ? (n.y += r) : (n.x += r), n.children.forEach(function (n) { t(n, r, e); }); })(t, -r, n); } (r.fromNode = function (t, n) { if (!t) return null; var e = []; return ( t.children.forEach(function (t) { e.push(r.fromNode(t, n)); }), n ? new r(t.height, t.width, t.x, e) : new r(t.width, t.height, t.y, e) ); }), (t.exports = function (t, n) { void 0 === n && (n = {}); var i = n.isHorizontal; function u(t) { 0 === t.cs ? ((t.el = t), (t.er = t), (t.msel = t.mser = 0)) : ((t.el = t.c[0].el), (t.msel = t.c[0].msel), (t.er = t.c[t.cs - 1].er), (t.mser = t.c[t.cs - 1].mser)); } function o(t, n, r) { for ( var e = t.c[n - 1], i = e.mod, u = t.c[n], o = u.mod; null !== e && null !== u; ) { s(e) > r.low && (r = r.nxt); var l = i + e.prelim + e.w - (o + u.prelim); l > 0 && ((o += l), a(t, n, r.index, l)); var d = s(e), h = s(u); d <= h && null !== (e = f(e)) && (i += e.mod), d >= h && null !== (u = c(u)) && (o += u.mod); } !e && u ? (function (t, n, r, e) { var i = t.c[0].el; i.tl = r; var u = e - r.mod - t.c[0].msel; (i.mod += u), (i.prelim -= u), (t.c[0].el = t.c[n].el), (t.c[0].msel = t.c[n].msel); })(t, n, u, o) : e && !u && (function (t, n, r, e) { var i = t.c[n].er; i.tr = r; var u = e - r.mod - t.c[n].mser; (i.mod += u), (i.prelim -= u), (t.c[n].er = t.c[n - 1].er), (t.c[n].mser = t.c[n - 1].mser); })(t, n, e, i); } function a(t, n, r, e) { (t.c[n].mod += e), (t.c[n].msel += e), (t.c[n].mser += e), (function (t, n, r, e) { if (r !== n - 1) { var i = n - r; (t.c[r + 1].shift += e / i), (t.c[n].shift -= e / i), (t.c[n].change -= e - e / i); } })(t, n, r, e); } function c(t) { return 0 === t.cs ? t.tl : t.c[0]; } function f(t) { return 0 === t.cs ? t.tr : t.c[t.cs - 1]; } function s(t) { return t.y + t.h; } function l(t, n, r) { for (; null !== r && t >= r.low; ) r = r.nxt; return { low: t, index: n, nxt: r }; } !(function t(n, r, e) { void 0 === e && (e = 0), r ? ((n.x = e), (e += n.width)) : ((n.y = e), (e += n.height)), n.children.forEach(function (n) { t(n, r, e); }); })(t, i); var d = r.fromNode(t, i); return ( (function t(n) { if (0 !== n.cs) { t(n.c[0]); for ( var r = l(s(n.c[0].el), 0, null), e = 1; e < n.cs; ++e ) { t(n.c[e]); var i = s(n.c[e].er); o(n, e, r), (r = l(i, e, r)); } !(function (t) { t.prelim = (t.c[0].prelim + t.c[0].mod + t.c[t.cs - 1].mod + t.c[t.cs - 1].prelim + t.c[t.cs - 1].w) / 2 - t.w / 2; })(n), u(n); } else u(n); })(d), (function t(n, r) { (r += n.mod), (n.x = n.prelim + r), (function (t) { for (var n = 0, r = 0, e = 0; e < t.cs; e++) (n += t.c[e].shift), (r += n + t.c[e].change), (t.c[e].mod += r); })(n); for (var e = 0; e < n.cs; e++) t(n.c[e], r); })(d, 0), (function t(n, r, e) { e ? (r.y = n.x) : (r.x = n.x), n.c.forEach(function (n, i) { t(n, r.children[i], e); }); })(d, t, i), e(t, i), t ); }); }, function (t, n, r) { var e = r(11), i = r(115), u = r(17), o = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return ( (this.rootNode.width = 0), u(this.rootNode, this.options, i) ); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = o.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7); function i(t, n) { void 0 === t && (t = 0), void 0 === n && (n = []); var r = this; (r.x = r.y = 0), (r.leftChild = r.rightChild = null), (r.height = 0), (r.children = n); } var u = { isHorizontal: !0, nodeSep: 20, nodeSize: 20, rankSep: 200, subTreeSep: 10, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, u, n)); var r, o = 0, a = (function t(n) { if (!n) return null; (n.width = 0), n.depth && n.depth > o && (o = n.depth); var r = n.children, e = r.length, u = new i(n.height, []); return ( r.forEach(function (n, r) { var i = t(n); u.children.push(i), 0 === r && (u.leftChild = i), r === e - 1 && (u.rightChild = i); }), (u.originNode = n), (u.isLeaf = n.isLeaf()), u ); })(t); return ( (function t(n) { if (n.isLeaf || 0 === n.children.length) n.drawingDepth = o; else { var r = n.children.map(function (n) { return t(n); }), e = Math.min.apply(null, r); n.drawingDepth = e - 1; } return n.drawingDepth; })(a), (function t(e) { (e.x = e.drawingDepth * n.rankSep), e.isLeaf ? ((e.y = 0), r && ((e.y = r.y + r.height + n.nodeSep), e.originNode.parent !== r.originNode.parent && (e.y += n.subTreeSep)), (r = e)) : (e.children.forEach(function (n) { t(n); }), (e.y = (e.leftChild.y + e.rightChild.y) / 2)); })(a), (function t(n, r, e) { e ? ((r.x = n.x), (r.y = n.y)) : ((r.x = n.y), (r.y = n.x)), n.children.forEach(function (n, i) { t(n, r.children[i], e); }); })(a, t, n.isHorizontal), t ); }; }, function (t, n, r) { var e = r(11), i = r(117), u = r(30), o = r(7), a = ["LR", "RL", "H"], c = a[0], f = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { var t = this.options, n = this.rootNode; t.isHorizontal = !0; var r = t.indent, e = void 0 === r ? 20 : r, o = t.dropCap, f = void 0 === o || o, s = t.direction || c; if (s && -1 === a.indexOf(s)) throw new TypeError("Invalid direction: " + s); if (s === a[0]) i(n, e, f); else if (s === a[1]) i(n, e, f), n.right2left(); else if (s === a[2]) { var l = u(n, t), d = l.left, h = l.right; i(d, e, f), d.right2left(), i(h, e, f); var p = d.getBoundingBox(); h.translate(p.width, 0), (n.x = h.x - n.width / 2); } return n; }), e ); })(e), s = {}; t.exports = function (t, n) { return (n = o.assign({}, s, n)), new f(t, n).execute(); }; }, function (t, n) { t.exports = function (t, n, r) { var e = null; t.eachNode(function (t) { !(function (t, n, r, e) { var i = "function" == typeof r ? r(t) : r * t.depth; if (!e) try { if (t.id === t.parent.children[0].id) return (t.x += i), void (t.y = n ? n.y : 0); } catch (t) {} (t.x += i), (t.y = n ? n.y + n.height : 0); })(t, e, n, r), (e = t); }); }; }, function (t, n, r) { var e = r(11), i = r(119), u = r(17), o = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return u(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = o.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7), i = { getSubTreeSep: function () { return 0; }, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, i, n)), (t.parent = { x: 0, width: 0, height: 0, y: 0 }), t.BFTraverse(function (t) { t.x = t.parent.x + t.parent.width; }), (t.parent = null), (function t(n, r) { var e = 0; return ( n.children.length ? n.children.forEach(function (n) { e += t(n, r); }) : (e = n.height), (n._subTreeSep = r.getSubTreeSep(n.data)), (n.totalHeight = Math.max(n.height, e) + 2 * n._subTreeSep), n.totalHeight ); })(t, n), (t.startY = 0), (t.y = t.totalHeight / 2 - t.height / 2), t.eachNode(function (t) { var n = t.children, r = n.length; if (r) { var e = n[0]; if (((e.startY = t.startY + t._subTreeSep), 1 === r)) e.y = t.y + t.height / 2 - e.height / 2; else { e.y = e.startY + e.totalHeight / 2 - e.height / 2; for (var i = 1; i < r; i++) { var u = n[i]; (u.startY = n[i - 1].startY + n[i - 1].totalHeight), (u.y = u.startY + u.totalHeight / 2 - u.height / 2); } } } }), (function t(n) { var r = n.children, e = r.length; if (e) { r.forEach(function (n) { t(n); }); var i = r[0], u = r[e - 1], o = u.y - i.y + u.height, a = 0; if ( (r.forEach(function (t) { a += t.totalHeight; }), o > n.height) ) n.y = i.y + o / 2 - n.height / 2; else if (1 !== r.length || n.height > a) { var c = n.y + (n.height - o) / 2 - i.y; r.forEach(function (t) { t.translate(0, c); }); } else n.y = (i.y + i.height / 2 + u.y + u.height / 2) / 2 - n.height / 2; } })(t); }; }, ]); }), "object" === o(n) && "object" === o(t) ? (t.exports = u()) : ((e = []), void 0 === (i = "function" == typeof (r = u) ? r.apply(n, e) : r) || (t.exports = i)); }).call(this, r(45)(t)); }, }).default; }); //# sourceMappingURL=treeGraph.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/circularLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.CircularLayout = e()) : (t.CircularLayout = e()); })(this, function () { return (function (t) { var e = {}; function r(n) { if (e[n]) return e[n].exports; var o = (e[n] = { i: n, l: !1, exports: {} }); return t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; } return ( (r.m = t), (r.c = e), (r.d = function (t, e, n) { r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, e) { if ((1 & e && (t = r(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if ( (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) r.d( n, o, function (e) { return t[e]; }.bind(null, o), ); return n; }), (r.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(e, "a", e), e; }), (r.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (r.p = ""), r((r.s = 197)) ); })({ 10: function (t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? function (t, e, r, n) { void 0 === n && (n = r), Object.defineProperty(t, n, { enumerable: !0, get: function () { return e[r]; }, }); } : function (t, e, r, n) { void 0 === n && (n = r), (t[n] = e[r]); }), o = (this && this.__exportStar) || function (t, e) { for (var r in t) "default" === r || Object.prototype.hasOwnProperty.call(e, r) || n(e, t, r); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(r(11), e), o(r(12), e), o(r(13), e), o(r(14), e), o(r(15), e), o(r(16), e); }, 11: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var n, o, i = /-(\w)/g; e.camelize = ((n = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = n(t)); }); }, 12: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var r = parseFloat(t); return e.isNaN(r) ? t : r; }; }, 14: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, r) { for (var n = [], o = 0; o < t; o++) n[o] = 0; return r ? (r.forEach(function (t) { t.source && (n[e[t.source]] += 1), t.target && (n[e[t.target]] += 1); }), n) : n; }; e.floydWarshall = function (t) { for (var e = [], r = t.length, n = 0; n < r; n += 1) { e[n] = []; for (var o = 0; o < r; o += 1) n === o ? (e[n][o] = 0) : 0 !== t[n][o] && t[n][o] ? (e[n][o] = t[n][o]) : (e[n][o] = 1 / 0); } for (var i = 0; i < r; i += 1) for (n = 0; n < r; n += 1) for (o = 0; o < r; o += 1) e[n][o] > e[n][i] + e[i][o] && (e[n][o] = e[n][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var r = t.nodes, n = t.edges, o = [], i = {}; if (!r) throw new Error("invalid nodes data!"); return ( r && r.forEach(function (t, e) { i[t.id] = e; o.push([]); }), n && n.forEach(function (t) { var r = t.source, n = t.target, u = i[r], s = i[n]; (o[u][s] = 1), e || (o[s][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var r = []; return ( t.forEach(function (t) { var n = []; t.forEach(function (t) { n.push(t * e); }), r.push(n); }), r ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, r) { if (e && e.children) for (var n = e.children.length - 1; n >= 0; n--) if (!t(e.children[n], r)) return; return !!r(e); })(t, e); }; }, 15: function (t, e, r) { "use strict"; function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in (e = arguments[r])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === n(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var r = []; return ( t.forEach(function (t) { r.push(t); }), r.map(function (t) { return e.clone(t); }) ); } if ("object" === n(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 158: function (t, e, r) { "use strict"; var n, o = (this && this.__extends) || ((n = function (t, e) { return (n = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function r() { this.constructor = t; } n(t, e), (t.prototype = null === e ? Object.create(e) : ((r.prototype = e.prototype), new r())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.CircularLayout = void 0); var i = r(9), u = r(10); function s(t, e) { var r = t.degree, n = e.degree; return r < n ? -1 : r > n ? 1 : 0; } var c = (function (t) { function e(e) { var r = t.call(this) || this; return ( (r.radius = null), (r.startRadius = null), (r.endRadius = null), (r.startAngle = 0), (r.endAngle = 2 * Math.PI), (r.clockwise = !0), (r.divisions = 1), (r.ordering = null), (r.angleRatio = 1), (r.nodes = []), (r.edges = []), (r.nodeMap = {}), (r.degrees = []), (r.width = 300), (r.height = 300), r.updateCfg(e), r ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { radius: null, startRadius: null, endRadius: null, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0, divisions: 1, ordering: null, angleRatio: 1, }; }), (e.prototype.execute = function () { var t = this.nodes, e = this.edges, r = t.length; if (0 !== r) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === r) return ( (t[0].x = n[0]), (t[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var o = this.radius, i = this.startRadius, s = this.endRadius, c = this.divisions, a = this.startAngle, f = this.endAngle, d = (f - a) / r, l = {}; t.forEach(function (t, e) { l[t.id] = e; }), (this.nodeMap = l); var h = u.getDegree(t.length, l, e); (this.degrees = h), o || i || s ? !i && s ? (i = s) : i && !s && (s = i) : (o = this.height > this.width ? this.width / 2 : this.height / 2); var p = d * this.angleRatio, y = this.ordering, g = []; g = "topology" === y ? this.topologyOrdering() : "topology-directed" === y ? this.topologyOrdering(!0) : "degree" === y ? this.degreeOrdering() : t; for ( var v = this.clockwise, b = Math.ceil(r / c), _ = 0; _ < r; ++_ ) { var O = o; O || null === i || null === s || (O = i + (_ * (s - i)) / (r - 1)), O || (O = 10 + (100 * _) / (r - 1)); var j = a + (_ % b) * p + ((2 * Math.PI) / c) * Math.floor(_ / b); v || (j = f - (_ % b) * p - ((2 * Math.PI) / c) * Math.floor(_ / b)), (g[_].x = n[0] + Math.cos(j) * O), (g[_].y = n[1] + Math.sin(j) * O), (g[_].weight = h[_]); } return ( this.onLayoutEnd && this.onLayoutEnd(), { nodes: g, edges: this.edges } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.topologyOrdering = function (t) { void 0 === t && (t = !1); var e = this.degrees, r = this.edges, n = this.nodes, o = u.clone(n), i = this.nodeMap, s = [o[0]], c = [n[0]], a = [], f = n.length; (a[0] = !0), (function (t, e, r, n) { t.forEach(function (e, r) { (t[r].children = []), (t[r].parent = []); }), n ? e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].parent; i.push(t[o].id), u.push(t[n].id); }) : e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].children; i.push(t[o].id), u.push(t[n].id); }); })(o, r, i, t); var d = 0; return ( o.forEach(function (t, u) { if (0 !== u) if ( (u !== f - 1 && e[u] === e[u + 1] && !(function (t, e, r) { for (var n = r.length, o = 0; o < n; o++) if ( (t.id === r[o].source && e.id === r[o].target) || (e.id === r[o].source && t.id === r[o].target) ) return !0; return !1; })(s[d], t, r)) || a[u] ) { for ( var l = s[d].children, h = !1, p = 0; p < l.length; p++ ) { var y = i[l[p]]; if (e[y] === e[u] && !a[y]) { s.push(o[y]), c.push(n[i[o[y].id]]), (a[y] = !0), (h = !0); break; } } for ( var g = 0; !h && (a[g] || (s.push(o[g]), c.push(n[i[o[g].id]]), (a[g] = !0), (h = !0)), ++g !== f); ); } else s.push(t), c.push(n[i[t.id]]), (a[u] = !0), d++; }), c ); }), (e.prototype.degreeOrdering = function () { var t = this.nodes, e = [], r = this.degrees; return ( t.forEach(function (t, n) { (t.degree = r[n]), e.push(t); }), e.sort(s), e ); }), (e.prototype.getType = function () { return "circular"; }), e ); })(i.Base); e.CircularLayout = c; }, 16: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 197: function (t, e, r) { "use strict"; r.r(e); var n = r(158); e.default = n.CircularLayout; }, 9: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var n = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = n; }, }).default; }); //# sourceMappingURL=circularLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/comboForceLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.ComboForceLayout = t()) : (e.ComboForceLayout = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 198)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, c = i[o], a = i[r]; (n[c][a] = 1), t || (n[a][c] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 159: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ComboForceLayout = void 0); var i = o(9), c = o(10), a = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.center = [0, 0]), (o.maxIteration = 100), (o.gravity = 10), (o.comboGravity = 10), (o.linkDistance = 10), (o.alpha = 1), (o.alphaMin = 0.001), (o.alphaDecay = 1 - Math.pow(o.alphaMin, 1 / 300)), (o.alphaTarget = 0), (o.velocityDecay = 0.6), (o.edgeStrength = 0.6), (o.nodeStrength = 30), (o.preventOverlap = !1), (o.preventNodeOverlap = !1), (o.preventComboOverlap = !1), (o.collideStrength = void 0), (o.nodeCollideStrength = 0.5), (o.comboCollideStrength = 0.5), (o.comboSpacing = 20), (o.comboPadding = 10), (o.optimizeRangeFactor = 1), (o.onTick = function () {}), (o.onLayoutEnd = function () {}), (o.depthAttractiveForceScale = 1), (o.depthRepulsiveForceScale = 2), (o.nodes = []), (o.edges = []), (o.combos = []), (o.comboTrees = []), (o.width = 300), (o.height = 300), (o.bias = []), (o.nodeMap = {}), (o.oriComboMap = {}), (o.indexMap = {}), (o.comboMap = {}), (o.previousLayouted = !1), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { maxIteration: 100, center: [0, 0], gravity: 10, speed: 1, comboGravity: 30, preventOverlap: !1, preventComboOverlap: !0, preventNodeOverlap: !0, nodeSpacing: void 0, collideStrength: void 0, nodeCollideStrength: 0.5, comboCollideStrength: 0.5, comboSpacing: 20, comboPadding: 10, edgeStrength: 0.6, nodeStrength: 30, linkDistance: 10, }; }), (t.prototype.execute = function () { var e = this.nodes, t = this.center; if ( ((this.comboTree = { id: "comboTreeRoot", depth: -1, children: this.comboTrees, }), e && 0 !== e.length) ) { if (1 === e.length) return ( (e[0].x = t[0]), (e[0].y = t[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); this.initVals(), this.run(), this.onLayoutEnd && this.onLayoutEnd(); } else this.onLayoutEnd && this.onLayoutEnd(); }), (t.prototype.run = function () { var e = this, t = e.nodes, o = e.previousLayouted ? e.maxIteration / 5 : e.maxIteration; e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var r = e.center, n = e.velocityDecay, i = e.comboMap; e.previousLayouted || e.initPos(i); for ( var a = function (o) { var r = []; t.forEach(function (e, t) { r[t] = { x: 0, y: 0 }; }), e.applyCalculate(r), e.applyComboCenterForce(r), t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += r[t].x * n), (e.y += r[t].y * n)); }), (e.alpha += (e.alphaTarget - e.alpha) * e.alphaDecay), e.onTick(); }, u = 0; u < o; u++ ) a(); var s = [0, 0]; t.forEach(function (e) { c.isNumber(e.x) && c.isNumber(e.y) && ((s[0] += e.x), (s[1] += e.y)); }), (s[0] /= t.length), (s[1] /= t.length); var d = [r[0] - s[0], r[1] - s[1]]; t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += d[0]), (e.y += d[1])); }), e.combos.forEach(function (e) { var t = i[e.id]; t && t.empty && ((e.x = t.cx || e.x), (e.y = t.cy || e.y)); }), (e.previousLayouted = !0); }), (t.prototype.initVals = function () { var e = this.edges, t = this.nodes, o = this.combos, r = {}, n = {}, i = {}; t.forEach(function (e, t) { (n[e.id] = e), (i[e.id] = t); }), (this.nodeMap = n), (this.indexMap = i); var a = {}; o.forEach(function (e) { a[e.id] = e; }), (this.oriComboMap = a), (this.comboMap = this.getComboMap()); var u = this.preventOverlap; (this.preventComboOverlap = this.preventComboOverlap || u), (this.preventNodeOverlap = this.preventNodeOverlap || u); var s = this.collideStrength; s && ((this.comboCollideStrength = s), (this.nodeCollideStrength = s)), (this.comboCollideStrength = this.comboCollideStrength ? this.comboCollideStrength : 0), (this.nodeCollideStrength = this.nodeCollideStrength ? this.nodeCollideStrength : 0); for (var d = 0; d < e.length; ++d) r[e[d].source] ? r[e[d].source]++ : (r[e[d].source] = 1), r[e[d].target] ? r[e[d].target]++ : (r[e[d].target] = 1); var f = []; for (d = 0; d < e.length; ++d) f[d] = r[e[d].source] / (r[e[d].source] + r[e[d].target]); this.bias = f; var p, h, l = this.nodeSize, y = this.nodeSpacing; if ( ((h = c.isNumber(y) ? function () { return y; } : c.isFunction(y) ? y : function () { return 0; }), (this.nodeSpacing = h), l) ) if (c.isFunction(l)) p = function (e) { return l(e); }; else if (c.isArray(l)) { var v = (l[0] > l[1] ? l[0] : l[1]) / 2; p = function (e) { return v; }; } else { var m = l / 2; p = function (e) { return m; }; } else p = function (e) { return e.size ? c.isArray(e.size) ? (e.size[0] > e.size[1] ? e.size[0] : e.size[1]) / 2 : e.size / 2 : 10; }; this.nodeSize = p; var b, g = this.comboSpacing; (b = c.isNumber(g) ? function () { return g; } : c.isFunction(g) ? g : function () { return 0; }), (this.comboSpacing = b); var x, S = this.comboPadding; (x = c.isNumber(S) ? function () { return S; } : c.isArray(S) ? function () { return Math.max.apply(null, S); } : c.isFunction(S) ? S : function () { return 0; }), (this.comboPadding = x); var M, O = this.linkDistance; O || (O = 10), (M = c.isNumber(O) ? function (e) { return O; } : O), (this.linkDistance = M); var C, N = this.edgeStrength; N || (N = 1), (C = c.isNumber(N) ? function (e) { return N; } : N), (this.edgeStrength = C); var E, _ = this.nodeStrength; _ || (_ = 30), (E = c.isNumber(_) ? function (e) { return _; } : _), (this.nodeStrength = E); }), (t.prototype.initPos = function (e) { this.nodes.forEach(function (t, o) { var r = t.comboId, n = e[r]; r && n ? ((t.x = n.cx + 100 / (o + 1)), (t.y = n.cy + 100 / (o + 1))) : ((t.x = 100 / (o + 1)), (t.y = 100 / (o + 1))); }); }), (t.prototype.getComboMap = function () { var e = this, t = e.nodeMap, o = e.indexMap, r = e.comboTrees, n = e.oriComboMap, i = {}; return ( (r || []).forEach(function (r) { var a = []; c.traverseTreeUp(r, function (r) { if ("node" === r.itemType) return !0; if (!n[r.id]) return !0; if (void 0 === i[r.id]) { var u = { id: r.id, name: r.id, cx: 0, cy: 0, count: 0, depth: e.oriComboMap[r.id].depth, children: [], }; i[r.id] = u; } var s = r.children; s && s.forEach(function (e) { if (!i[e.id] && !t[e.id]) return !0; a.push(e); }); var d = i[r.id]; if (((d.cx = 0), (d.cy = 0), 0 === a.length)) { d.empty = !0; var f = n[r.id], p = Object.keys(t).length, h = r.id + "-visual-child-" + p, l = { id: h, x: f.x, y: f.y, depth: d.depth + 1, itemType: "node", }; e.nodes.push(l), (t[h] = l), (o[h] = p), (d.cx = f.x), (d.cy = f.y), a.push(l); } return ( a.forEach(function (e) { if ((d.count++, "node" !== e.itemType)) { var o = i[e.id]; return ( c.isNumber(o.cx) && (d.cx += o.cx), void (c.isNumber(o.cy) && (d.cy += o.cy)) ); } var r = t[e.id]; r && (c.isNumber(r.x) && (d.cx += r.x), c.isNumber(r.y) && (d.cy += r.y)); }), (d.cx /= d.count), (d.cy /= d.count), (d.children = a), !0 ); }); }), i ); }), (t.prototype.applyComboCenterForce = function (e) { var t = this.gravity, o = this.comboGravity || t, r = this.alpha, n = this.comboTrees, i = this.indexMap, a = this.nodeMap, u = this.comboMap; (n || []).forEach(function (t) { c.traverseTreeUp(t, function (t) { if ("node" === t.itemType) return !0; if (!u[t.id]) return !0; var n = u[t.id], s = ((n.depth + 1) / 10) * 0.5, d = n.cx, f = n.cy; return ( (n.cx = 0), (n.cy = 0), n.children.forEach(function (t) { if ("node" !== t.itemType) { var p = u[t.id]; return ( p && c.isNumber(p.cx) && (n.cx += p.cx), void (p && c.isNumber(p.cy) && (n.cy += p.cy)) ); } var h = a[t.id], l = h.x - d || 0.005, y = h.y - f || 0.005, v = Math.sqrt(l * l + y * y), m = i[h.id], b = ((o * r) / v) * s; (e[m].x -= l * b), (e[m].y -= y * b), c.isNumber(h.x) && (n.cx += h.x), c.isNumber(h.y) && (n.cy += h.y); }), (n.cx /= n.count), (n.cy /= n.count), !0 ); }); }); }), (t.prototype.applyCalculate = function (e) { var t = this.comboMap, o = this.nodes, r = {}; o.forEach(function (e, t) { o.forEach(function (o, n) { if (!(t < n)) { var i = e.x - o.x || 0.005, c = e.y - o.y || 0.005, a = i * i + c * c, u = Math.sqrt(a); a < 1 && (a = u), (r[e.id + "-" + o.id] = { vx: i, vy: c, vl2: a, vl: u }), (r[o.id + "-" + e.id] = { vl2: a, vl: u, vx: -i, vy: -c, }); } }); }), this.updateComboSizes(t), this.calRepulsive(e, r), this.calAttractive(e, r), this.preventComboOverlap && this.comboNonOverlapping(e, t); }), (t.prototype.updateComboSizes = function (e) { var t = this, o = t.comboTrees, r = t.nodeMap, n = t.nodeSize, i = t.comboSpacing, a = t.comboPadding; (o || []).forEach(function (o) { var u = []; c.traverseTreeUp(o, function (o) { if ("node" === o.itemType) return !0; var s = e[o.id]; if (!s) return !1; var d = o.children; d && d.forEach(function (t) { (e[t.id] || r[t.id]) && u.push(t); }), (s.minX = 1 / 0), (s.minY = 1 / 0), (s.maxX = -1 / 0), (s.maxY = -1 / 0), u.forEach(function (e) { if ("node" !== e.itemType) return !0; var t = r[e.id]; if (!t) return !0; var o = n(t), i = t.x - o, c = t.y - o, a = t.x + o, u = t.y + o; s.minX > i && (s.minX = i), s.minY > c && (s.minY = c), s.maxX < a && (s.maxX = a), s.maxY < u && (s.maxY = u); }); var f = t.oriComboMap[o.id].size || 10; c.isArray(f) && (f = f[0]); var p = Math.max(s.maxX - s.minX, s.maxY - s.minY, f); return (s.r = p / 2 + i(s) / 2 + a(s)), !0; }); }); }), (t.prototype.comboNonOverlapping = function (e, t) { var o = this.comboTree, r = this.comboCollideStrength, n = this.indexMap, i = this.nodeMap; c.traverseTreeUp(o, function (o) { if (!t[o.id] && !i[o.id] && "comboTreeRoot" !== o.id) return !1; var c = o.children; return ( c && c.length > 1 && c.forEach(function (o, a) { if ("node" === o.itemType) return !1; var u = t[o.id]; u && c.forEach(function (c, s) { if (a <= s) return !1; if ("node" === c.itemType) return !1; var d = t[c.id]; if (!d) return !1; var f = u.cx - d.cx || 0.005, p = u.cy - d.cy || 0.005, h = f * f + p * p, l = u.r, y = d.r, v = l + y, m = y * y, b = l * l; if (h < v * v) { var g = o.children; if (!g || 0 === g.length) return !1; var x = c.children; if (!x || 0 === x.length) return !1; var S = Math.sqrt(h), M = ((v - S) / S) * r, O = f * M, C = p * M, N = m / (b + m), E = 1 - N; g.forEach(function (t) { if ("node" !== t.itemType) return !1; if (i[t.id]) { var o = n[t.id]; x.forEach(function (t) { if ("node" !== t.itemType) return !1; if (!i[t.id]) return !1; var r = n[t.id]; (e[o].x += O * N), (e[o].y += C * N), (e[r].x -= O * E), (e[r].y -= C * E); }); } }); } }); }), !0 ); }); }), (t.prototype.calRepulsive = function (e, t) { var o = this, r = o.nodes, n = o.width * o.optimizeRangeFactor, i = o.nodeStrength, c = o.alpha, a = o.nodeCollideStrength, u = o.preventNodeOverlap, s = o.nodeSize, d = o.nodeSpacing, f = o.depthRepulsiveForceScale, p = o.center; r.forEach(function (h, l) { if (h.x && h.y) { if (p) { var y = o.gravity, v = h.x - p[0] || 0.005, m = h.y - p[1] || 0.005, b = Math.sqrt(v * v + m * m); (e[l].x -= (v * y * c) / b), (e[l].y -= (m * y * c) / b); } r.forEach(function (o, r) { if (l !== r && o.x && o.y) { var p = t[h.id + "-" + o.id], y = p.vl2, v = p.vl; if (!(v > n)) { var m = t[h.id + "-" + o.id], b = m.vx, g = m.vy, x = Math.log(Math.abs(o.depth - h.depth) / 10) + 1 || 1; (x = x < 1 ? 1 : x), o.comboId !== h.comboId && (x += 1); var S = x ? Math.pow(f, x) : 1, M = ((i(o) * c) / y) * S; if ( ((e[l].x += b * M), (e[l].y += g * M), l < r && u) ) { var O = s(h) + d(h), C = s(o) + d(o), N = O + C; if (y < N * N) { var E = ((N - v) / v) * a, _ = C * C, j = _ / (O * O + _), T = b * E, w = g * E; (e[l].x += T * j), (e[l].y += w * j), (j = 1 - j), (e[r].x -= T * j), (e[r].y -= w * j); } } } } }); } }); }), (t.prototype.calAttractive = function (e, t) { var o = this, r = o.edges, n = o.linkDistance, i = o.alpha, a = o.edgeStrength, u = o.bias, s = o.depthAttractiveForceScale; r.forEach(function (r, d) { if (r.source && r.target && r.source !== r.target) { var f = o.indexMap[r.source], p = o.indexMap[r.target], h = o.nodeMap[r.source], l = o.nodeMap[r.target]; if (h && l) { var y = Math.log(Math.abs(h.depth - l.depth) / 10); h.comboId === l.comboId && (y /= 2); var v = y ? Math.pow(s, y) : 1; if ( (h.comboId !== l.comboId && 1 === v ? (v = s / 2) : h.comboId === l.comboId && (v = 2), c.isNumber(l.x) && c.isNumber(h.x) && c.isNumber(l.y) && c.isNumber(h.y)) ) { var m = t[r.target + "-" + r.source], b = m.vl, g = m.vx, x = m.vy, S = ((b - n(r)) / b) * i * a(r) * v, M = g * S, O = x * S, C = u[d]; (e[p].x -= M * C), (e[p].y -= O * C), (e[f].x += M * (1 - C)), (e[f].y += O * (1 - C)); } } } }); }), (t.prototype.getType = function () { return "comboForce"; }), t ); })(i.Base); t.ComboForceLayout = a; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 198: function (e, t, o) { "use strict"; o.r(t); var r = o(159); t.default = r.ComboForceLayout; }, 9: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=comboForceLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/concentricLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.ConcentricLayout = t()) : (e.ConcentricLayout = t()); })(this, function () { return (function (e) { var t = {}; function n(r) { if (t[r]) return t[r].exports; var o = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = e), (n.c = t), (n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (n.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (n.t = function (e, t) { if ((1 & t && (e = n(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var o in e) n.d( r, o, function (t) { return e[t]; }.bind(null, o), ); return r; }), (n.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return n.d(t, "a", t), t; }), (n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (n.p = ""), n((n.s = 199)) ); })({ 10: function (e, t, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, n, r) { void 0 === r && (r = n), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[n]; }, }); } : function (e, t, n, r) { void 0 === r && (r = n), (e[r] = t[n]); }), o = (this && this.__exportStar) || function (e, t) { for (var n in e) "default" === n || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n); }; Object.defineProperty(t, "__esModule", { value: !0 }), o(n(11), t), o(n(12), t), o(n(13), t), o(n(14), t), o(n(15), t), o(n(16), t); }, 11: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, o, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (o = Object.create(null)), function (e) { return o[e] || (o[e] = r(e)); }); }, 12: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var n = parseFloat(e); return t.isNaN(n) ? e : n; }; }, 14: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, n) { for (var r = [], o = 0; o < e; o++) r[o] = 0; return n ? (n.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], n = e.length, r = 0; r < n; r += 1) { t[r] = []; for (var o = 0; o < n; o += 1) r === o ? (t[r][o] = 0) : 0 !== e[r][o] && e[r][o] ? (t[r][o] = e[r][o]) : (t[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) t[r][o] > t[r][i] + t[i][o] && (t[r][o] = t[r][i] + t[i][o]); return t; }; t.getAdjMatrix = function (e, t) { var n = e.nodes, r = e.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (e, t) { i[e.id] = t; o.push([]); }), r && r.forEach(function (e) { var n = e.source, r = e.target, u = i[n], c = i[r]; (o[u][c] = 1), t || (o[c][u] = 1); }), o ); }; t.scaleMatrix = function (e, t) { var n = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), n.push(r); }), n ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, n) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], n)) return; return !!n(t); })(e, t); }; }, 15: function (e, t, n) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var n = []; return ( e.forEach(function (e) { n.push(e); }), n.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = o({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 160: function (e, t, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function n() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ConcentricLayout = void 0); var i = n(10), u = (function (e) { function t(t) { var n = e.call(this) || this; return ( (n.nodeSize = 30), (n.minNodeSpacing = 10), (n.preventOverlap = !1), (n.equidistant = !1), (n.startAngle = 1.5 * Math.PI), (n.clockwise = !0), (n.sortBy = "degree"), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.onLayoutEnd = function () {}), n.updateCfg(t), n ); } return ( o(t, e), (t.prototype.getDefaultCfg = function () { return { nodeSize: 30, minNodeSpacing: 10, preventOverlap: !1, sweep: void 0, equidistant: !1, startAngle: 1.5 * Math.PI, clockwise: !0, maxLevelDiff: void 0, sortBy: "degree", }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, n = e.edges, r = t.length; if (0 !== r) { e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight), e.center || (e.center = [e.width / 2, e.height / 2]); var o = e.center; if (1 === r) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var u, c = []; (u = i.isArray(e.nodeSize) ? Math.max(e.nodeSize[0], e.nodeSize[1]) : e.nodeSize), t.forEach(function (e) { c.push(e); var t = u; i.isArray(e.size) ? (t = Math.max(e.size[0], e.size[1])) : i.isNumber(e.size) && (t = e.size), (u = Math.max(u, t)); }), (e.clockwise = void 0 !== e.counterclockwise ? !e.counterclockwise : e.clockwise); var a = {}, s = {}; if ( (c.forEach(function (e, t) { (a[e.id] = e), (s[e.id] = t); }), !( ("degree" !== e.sortBy && i.isString(e.sortBy) && void 0 !== c[0][e.sortBy]) || ((e.sortBy = "degree"), i.isNumber(t[0].degree)) )) ) { var f = i.getDegree(t.length, s, n); c.forEach(function (e, t) { e.degree = f[t]; }); } c.sort(function (t, n) { return n[e.sortBy] - t[e.sortBy]; }), (e.maxValueNode = c[0]), (e.maxLevelDiff = e.maxLevelDiff || e.maxValueNode[e.sortBy] / 4); var d = [[]], l = d[0]; c.forEach(function (t) { if (l.length > 0) { var n = Math.abs(l[0][e.sortBy] - t[e.sortBy]); e.maxLevelDiff && n >= e.maxLevelDiff && ((l = []), d.push(l)); } l.push(t); }); var p = u + e.minNodeSpacing; if (!e.preventOverlap) { var h = d.length > 0 && d[0].length > 1, y = (Math.min(e.width, e.height) / 2 - p) / (d.length + (h ? 1 : 0)); p = Math.min(p, y); } var v = 0; if ( (d.forEach(function (t) { var n = e.sweep; void 0 === n && (n = 2 * Math.PI - (2 * Math.PI) / t.length); var r = (t.dTheta = n / Math.max(1, t.length - 1)); if (t.length > 1 && e.preventOverlap) { var o = Math.cos(r) - Math.cos(0), i = Math.sin(r) - Math.sin(0), u = Math.sqrt((p * p) / (o * o + i * i)); v = Math.max(u, v); } (t.r = v), (v += p); }), e.equidistant) ) { for (var g = 0, b = 0, m = 0; m < d.length; m++) { var _ = d[m].r - b; g = Math.max(g, _); } (b = 0), d.forEach(function (e, t) { 0 === t && (b = e.r), (e.r = b), (b += g); }); } return ( d.forEach(function (t) { var n = t.dTheta, r = t.r; t.forEach(function (t, i) { var u = e.startAngle + (e.clockwise ? 1 : -1) * n * i; (t.x = o[0] + r * Math.cos(u)), (t.y = o[1] + r * Math.sin(u)); }); }), e.onLayoutEnd && e.onLayoutEnd(), { nodes: t, edges: n } ); } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.getType = function () { return "concentric"; }), t ); })(n(9).Base); t.ConcentricLayout = u; }, 199: function (e, t, n) { "use strict"; n.r(t); var r = n(160); t.default = r.ConcentricLayout; }, 9: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=concentricLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/dagreLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.DagreLayout = n()) : (t.DagreLayout = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 200)) ); })([ , , , , , , , , function (t, n, e) { var r; try { r = { cloneDeep: e(316), constant: e(89), defaults: e(317), each: e(121), filter: e(124), find: e(318), flatten: e(151), forEach: e(122), forIn: e(325), has: e(135), isUndefined: e(136), last: e(326), map: e(137), mapValues: e(327), max: e(328), merge: e(330), min: e(336), minBy: e(337), now: e(338), pick: e(339), range: e(344), reduce: e(139), sortBy: e(347), uniqueId: e(352), values: e(144), zipObject: e(353), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, function (t, n) { var e = Array.isArray; t.exports = e; }, , function (t, n, e) { "use strict"; var r = e(8), o = e(23).Graph; function i(t, n, e, o) { var i; do { i = r.uniqueId(o); } while (t.hasNode(i)); return (e.dummy = n), t.setNode(i, e), i; } function u(t) { return r.max( r.map(t.nodes(), function (n) { var e = t.node(n).rank; if (!r.isUndefined(e)) return e; }), ); } t.exports = { addDummyNode: i, simplify: function (t) { var n = new o().setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { var r = n.edge(e.v, e.w) || { weight: 0, minlen: 1 }, o = t.edge(e); n.setEdge(e.v, e.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen), }); }), n ); }, asNonCompoundGraph: function (t) { var n = new o({ multigraph: t.isMultigraph() }).setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { t.children(e).length || n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { n.setEdge(e, t.edge(e)); }), n ); }, successorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.outEdges(n), function (n) { e[n.w] = (e[n.w] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, predecessorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.inEdges(n), function (n) { e[n.v] = (e[n.v] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, intersectRect: function (t, n) { var e, r, o = t.x, i = t.y, u = n.x - o, c = n.y - i, a = t.width / 2, f = t.height / 2; if (!u && !c) throw new Error( "Not possible to find intersection inside of the rectangle", ); Math.abs(c) * a > Math.abs(u) * f ? (c < 0 && (f = -f), (e = (f * u) / c), (r = f)) : (u < 0 && (a = -a), (e = a), (r = (a * c) / u)); return { x: o + e, y: i + r }; }, buildLayerMatrix: function (t) { var n = r.map(r.range(u(t) + 1), function () { return []; }); return ( r.forEach(t.nodes(), function (e) { var o = t.node(e), i = o.rank; r.isUndefined(i) || (n[i][o.order] = e); }), n ); }, normalizeRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ); r.forEach(t.nodes(), function (e) { var o = t.node(e); r.has(o, "rank") && (o.rank -= n); }); }, removeEmptyRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ), e = []; r.forEach(t.nodes(), function (r) { var o = t.node(r).rank - n; e[o] || (e[o] = []), e[o].push(r); }); var o = 0, i = t.graph().nodeRankFactor; r.forEach(e, function (n, e) { r.isUndefined(n) && e % i != 0 ? --o : o && r.forEach(n, function (n) { t.node(n).rank += o; }); }); }, addBorderNode: function (t, n, e, r) { var o = { width: 0, height: 0 }; arguments.length >= 4 && ((o.rank = e), (o.order = r)); return i(t, "border", o, n); }, maxRank: u, partition: function (t, n) { var e = { lhs: [], rhs: [] }; return ( r.forEach(t, function (t) { n(t) ? e.lhs.push(t) : e.rhs.push(t); }), e ); }, time: function (t, n) { var e = r.now(); try { return n(); } finally { console.log(t + " time: " + (r.now() - e) + "ms"); } }, notime: function (t, n) { return n(); }, }; }, function (t, n, e) { var r; try { r = { clone: e(204), constant: e(89), each: e(121), filter: e(124), has: e(135), isArray: e(17), isEmpty: e(280), isFunction: e(46), isUndefined: e(136), keys: e(31), map: e(137), reduce: e(139), size: e(283), transform: e(289), union: e(290), values: e(144), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return null != t && ("object" == n || "function" == n); }; }, , function (t, n, e) { var r; try { r = e(202); } catch (t) {} r || (r = window.graphlib), (t.exports = r); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(104), i = "object" == ("undefined" == typeof self ? "undefined" : r(self)) && self && self.Object === Object && self, u = o || i || Function("return this")(); t.exports = u; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { return null != t && "object" == e(t); }; }, , , function (t, n, e) { var r = e(46), o = e(83); t.exports = function (t) { return null != t && o(t.length) && !r(t); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(260), i = e(270), u = e(36), c = e(17), a = e(277); t.exports = function (t) { return "function" == typeof t ? t : null == t ? u : "object" == r(t) ? c(t) ? i(t[0], t[1]) : o(t) : a(t); }; }, , function (t, n, e) { var r = e(107), o = e(85), i = e(28); t.exports = function (t) { return i(t) ? r(t) : o(t); }; }, , function (t, n, e) { var r = e(215), o = e(220); t.exports = function (t, n) { var e = o(t, n); return r(e) ? e : void 0; }; }, function (t, n, e) { var r = e(38), o = e(216), i = e(217), u = r ? r.toStringTag : void 0; t.exports = function (t) { return null == t ? void 0 === t ? "[object Undefined]" : "[object Null]" : u && u in Object(t) ? o(t) : i(t); }; }, function (t, n, e) { var r = e(107), o = e(240), i = e(28); t.exports = function (t) { return i(t) ? r(t, !0) : o(t); }; }, function (t, n) { t.exports = function (t) { return t; }; }, function (t, n) { t.exports = function (t, n) { return t === n || (t != t && n != n); }; }, function (t, n, e) { var r = e(24).Symbol; t.exports = r; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = e(236), u = "object" == r(n) && n && !n.nodeType && n, c = u && "object" == r(t) && t && !t.nodeType && t, a = c && c.exports === u ? o.Buffer : void 0, f = (a ? a.isBuffer : void 0) || i; t.exports = f; }).call(this, e(45)(t)); }, function (t, n, e) { var r = e(245), o = e(80), i = e(246), u = e(116), c = e(247), a = e(34), f = e(105), s = f(r), p = f(o), d = f(i), h = f(u), l = f(c), v = a; ((r && "[object DataView]" != v(new r(new ArrayBuffer(1)))) || (o && "[object Map]" != v(new o())) || (i && "[object Promise]" != v(i.resolve())) || (u && "[object Set]" != v(new u())) || (c && "[object WeakMap]" != v(new c()))) && (v = function (t) { var n = a(t), e = "[object Object]" == n ? t.constructor : void 0, r = e ? f(e) : ""; if (r) switch (r) { case s: return "[object DataView]"; case p: return "[object Map]"; case d: return "[object Promise]"; case h: return "[object Set]"; case l: return "[object WeakMap]"; } return n; }), (t.exports = v); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(34), i = e(25); t.exports = function (t) { return "symbol" == r(t) || (i(t) && "[object Symbol]" == o(t)); }; }, , , , function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, function (t, n, e) { var r = e(34), o = e(21); t.exports = function (t) { if (!o(t)) return !1; var n = r(t); return ( "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n ); }; }, function (t, n, e) { var r = e(59), o = e(60); t.exports = function (t, n, e, i) { var u = !e; e || (e = {}); for (var c = -1, a = n.length; ++c < a; ) { var f = n[c], s = i ? i(e[f], t[f], f, e, t) : void 0; void 0 === s && (s = t[f]), u ? o(e, f, s) : r(e, f, s); } return e; }; }, function (t, n, e) { var r = e(235), o = e(25), i = Object.prototype, u = i.hasOwnProperty, c = i.propertyIsEnumerable, a = r( (function () { return arguments; })(), ) ? r : function (t) { return o(t) && u.call(t, "callee") && !c.call(t, "callee"); }; t.exports = a; }, function (t, n, e) { var r = e(237), o = e(62), i = e(84), u = i && i.isTypedArray, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(41); t.exports = function (t) { if ("string" == typeof t || r(t)) return t; var n = t + ""; return "0" == n && 1 / t == -1 / 0 ? "-0" : n; }; }, , , , function (t, n, e) { var r = e(55), o = e(210), i = e(211), u = e(212), c = e(213), a = e(214); function f(t) { var n = (this.__data__ = new r(t)); this.size = n.size; } (f.prototype.clear = o), (f.prototype.delete = i), (f.prototype.get = u), (f.prototype.has = c), (f.prototype.set = a), (t.exports = f); }, function (t, n, e) { var r = e(205), o = e(206), i = e(207), u = e(208), c = e(209); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(37); t.exports = function (t, n) { for (var e = t.length; e--; ) if (r(t[e][0], n)) return e; return -1; }; }, function (t, n, e) { var r = e(33)(Object, "create"); t.exports = r; }, function (t, n, e) { var r = e(229); t.exports = function (t, n) { var e = t.__data__; return r(n) ? e["string" == typeof n ? "string" : "hash"] : e.map; }; }, function (t, n, e) { var r = e(60), o = e(37), i = Object.prototype.hasOwnProperty; t.exports = function (t, n, e) { var u = t[n]; (i.call(t, n) && o(u, e) && (void 0 !== e || n in t)) || r(t, n, e); }; }, function (t, n, e) { var r = e(106); t.exports = function (t, n, e) { "__proto__" == n && r ? r(t, n, { configurable: !0, enumerable: !0, value: e, writable: !0, }) : (t[n] = e); }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = /^(?:0|[1-9]\d*)$/; t.exports = function (t, n) { var o = e(t); return ( !!(n = null == n ? 9007199254740991 : n) && ("number" == o || ("symbol" != o && r.test(t))) && t > -1 && t % 1 == 0 && t < n ); }; }, function (t, n) { t.exports = function (t) { return function (n) { return t(n); }; }; }, function (t, n) { var e = Object.prototype; t.exports = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, e) { var r = e(108)(Object.getPrototypeOf, Object); t.exports = r; }, function (t, n, e) { var r = e(90), o = e(258)(r); t.exports = o; }, function (t, n, e) { var r = e(67), o = e(50); t.exports = function (t, n) { for (var e = 0, i = (n = r(n, t)).length; null != t && e < i; ) t = t[o(n[e++])]; return e && e == i ? t : void 0; }; }, function (t, n, e) { var r = e(17), o = e(93), i = e(272), u = e(131); t.exports = function (t, n) { return r(t) ? t : o(t, n) ? [t] : i(u(t)); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length, o = Array(r); ++e < r; ) o[e] = n(t[e], e, t); return o; }; }, function (t, n, e) { var r = e(36), o = e(140), i = e(141); t.exports = function (t, n) { return i(o(t, n, r), t + ""); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(37), i = e(28), u = e(61), c = e(21); t.exports = function (t, n, e) { if (!c(e)) return !1; var a = r(n); return ( !!("number" == a ? i(e) && u(n, e.length) : "string" == a && n in e) && o(e[n], t) ); }; }, function (t, n, e) { "use strict"; var r = e(8); t.exports = { longestPath: function (t) { var n = {}; r.forEach(t.sources(), function e(o) { var i = t.node(o); if (r.has(n, o)) return i.rank; n[o] = !0; var u = r.min( r.map(t.outEdges(o), function (n) { return e(n.w) - t.edge(n).minlen; }), ); return ( (u !== Number.POSITIVE_INFINITY && null != u) || (u = 0), (i.rank = u) ); }); }, slack: function (t, n) { return t.node(n.w).rank - t.node(n.v).rank - t.edge(n).minlen; }, }; }, , , , , , function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : e(window)) && (r = window); } t.exports = r; }, , function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(20); t.exports = i; function i(t) { (this._isDirected = !o.has(t, "directed") || t.directed), (this._isMultigraph = !!o.has(t, "multigraph") && t.multigraph), (this._isCompound = !!o.has(t, "compound") && t.compound), (this._label = void 0), (this._defaultNodeLabelFn = o.constant(void 0)), (this._defaultEdgeLabelFn = o.constant(void 0)), (this._nodes = {}), this._isCompound && ((this._parent = {}), (this._children = {}), (this._children["\0"] = {})), (this._in = {}), (this._preds = {}), (this._out = {}), (this._sucs = {}), (this._edgeObjs = {}), (this._edgeLabels = {}); } function u(t, n) { t[n] ? t[n]++ : (t[n] = 1); } function c(t, n) { --t[n] || delete t[n]; } function a(t, n, e, r) { var i = "" + n, u = "" + e; if (!t && i > u) { var c = i; (i = u), (u = c); } return i + "" + u + "" + (o.isUndefined(r) ? "\0" : r); } function f(t, n, e, r) { var o = "" + n, i = "" + e; if (!t && o > i) { var u = o; (o = i), (i = u); } var c = { v: o, w: i }; return r && (c.name = r), c; } function s(t, n) { return a(t, n.v, n.w, n.name); } (i.prototype._nodeCount = 0), (i.prototype._edgeCount = 0), (i.prototype.isDirected = function () { return this._isDirected; }), (i.prototype.isMultigraph = function () { return this._isMultigraph; }), (i.prototype.isCompound = function () { return this._isCompound; }), (i.prototype.setGraph = function (t) { return (this._label = t), this; }), (i.prototype.graph = function () { return this._label; }), (i.prototype.setDefaultNodeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultNodeLabelFn = t), this ); }), (i.prototype.nodeCount = function () { return this._nodeCount; }), (i.prototype.nodes = function () { return o.keys(this._nodes); }), (i.prototype.sources = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._in[n]); }); }), (i.prototype.sinks = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._out[n]); }); }), (i.prototype.setNodes = function (t, n) { var e = arguments, r = this; return ( o.each(t, function (t) { e.length > 1 ? r.setNode(t, n) : r.setNode(t); }), this ); }), (i.prototype.setNode = function (t, n) { return o.has(this._nodes, t) ? (arguments.length > 1 && (this._nodes[t] = n), this) : ((this._nodes[t] = arguments.length > 1 ? n : this._defaultNodeLabelFn(t)), this._isCompound && ((this._parent[t] = "\0"), (this._children[t] = {}), (this._children["\0"][t] = !0)), (this._in[t] = {}), (this._preds[t] = {}), (this._out[t] = {}), (this._sucs[t] = {}), ++this._nodeCount, this); }), (i.prototype.node = function (t) { return this._nodes[t]; }), (i.prototype.hasNode = function (t) { return o.has(this._nodes, t); }), (i.prototype.removeNode = function (t) { var n = this; if (o.has(this._nodes, t)) { var e = function (t) { n.removeEdge(n._edgeObjs[t]); }; delete this._nodes[t], this._isCompound && (this._removeFromParentsChildList(t), delete this._parent[t], o.each(this.children(t), function (t) { n.setParent(t); }), delete this._children[t]), o.each(o.keys(this._in[t]), e), delete this._in[t], delete this._preds[t], o.each(o.keys(this._out[t]), e), delete this._out[t], delete this._sucs[t], --this._nodeCount; } return this; }), (i.prototype.setParent = function (t, n) { if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); if (o.isUndefined(n)) n = "\0"; else { for (var e = (n += ""); !o.isUndefined(e); e = this.parent(e)) if (e === t) throw new Error( "Setting " + n + " as parent of " + t + " would create a cycle", ); this.setNode(n); } return ( this.setNode(t), this._removeFromParentsChildList(t), (this._parent[t] = n), (this._children[n][t] = !0), this ); }), (i.prototype._removeFromParentsChildList = function (t) { delete this._children[this._parent[t]][t]; }), (i.prototype.parent = function (t) { if (this._isCompound) { var n = this._parent[t]; if ("\0" !== n) return n; } }), (i.prototype.children = function (t) { if ((o.isUndefined(t) && (t = "\0"), this._isCompound)) { var n = this._children[t]; if (n) return o.keys(n); } else { if ("\0" === t) return this.nodes(); if (this.hasNode(t)) return []; } }), (i.prototype.predecessors = function (t) { var n = this._preds[t]; if (n) return o.keys(n); }), (i.prototype.successors = function (t) { var n = this._sucs[t]; if (n) return o.keys(n); }), (i.prototype.neighbors = function (t) { var n = this.predecessors(t); if (n) return o.union(n, this.successors(t)); }), (i.prototype.isLeaf = function (t) { return ( 0 === (this.isDirected() ? this.successors(t) : this.neighbors(t)).length ); }), (i.prototype.filterNodes = function (t) { var n = new this.constructor({ directed: this._isDirected, multigraph: this._isMultigraph, compound: this._isCompound, }); n.setGraph(this.graph()); var e = this; o.each(this._nodes, function (e, r) { t(r) && n.setNode(r, e); }), o.each(this._edgeObjs, function (t) { n.hasNode(t.v) && n.hasNode(t.w) && n.setEdge(t, e.edge(t)); }); var r = {}; return ( this._isCompound && o.each(n.nodes(), function (t) { n.setParent( t, (function t(o) { var i = e.parent(o); return void 0 === i || n.hasNode(i) ? ((r[o] = i), i) : i in r ? r[i] : t(i); })(t), ); }), n ); }), (i.prototype.setDefaultEdgeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultEdgeLabelFn = t), this ); }), (i.prototype.edgeCount = function () { return this._edgeCount; }), (i.prototype.edges = function () { return o.values(this._edgeObjs); }), (i.prototype.setPath = function (t, n) { var e = this, r = arguments; return ( o.reduce(t, function (t, o) { return r.length > 1 ? e.setEdge(t, o, n) : e.setEdge(t, o), o; }), this ); }), (i.prototype.setEdge = function () { var t, n, e, i, c = !1, s = arguments[0]; "object" === r(s) && null !== s && "v" in s ? ((t = s.v), (n = s.w), (e = s.name), 2 === arguments.length && ((i = arguments[1]), (c = !0))) : ((t = s), (n = arguments[1]), (e = arguments[3]), arguments.length > 2 && ((i = arguments[2]), (c = !0))), (t = "" + t), (n = "" + n), o.isUndefined(e) || (e = "" + e); var p = a(this._isDirected, t, n, e); if (o.has(this._edgeLabels, p)) return c && (this._edgeLabels[p] = i), this; if (!o.isUndefined(e) && !this._isMultigraph) throw new Error( "Cannot set a named edge when isMultigraph = false", ); this.setNode(t), this.setNode(n), (this._edgeLabels[p] = c ? i : this._defaultEdgeLabelFn(t, n, e)); var d = f(this._isDirected, t, n, e); return ( (t = d.v), (n = d.w), Object.freeze(d), (this._edgeObjs[p] = d), u(this._preds[n], t), u(this._sucs[t], n), (this._in[n][p] = d), (this._out[t][p] = d), this._edgeCount++, this ); }), (i.prototype.edge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return this._edgeLabels[r]; }), (i.prototype.hasEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return o.has(this._edgeLabels, r); }), (i.prototype.removeEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e), o = this._edgeObjs[r]; return ( o && ((t = o.v), (n = o.w), delete this._edgeLabels[r], delete this._edgeObjs[r], c(this._preds[n], t), c(this._sucs[t], n), delete this._in[n][r], delete this._out[t][r], this._edgeCount--), this ); }), (i.prototype.inEdges = function (t, n) { var e = this._in[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.v === n; }) : r; } }), (i.prototype.outEdges = function (t, n) { var e = this._out[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.w === n; }) : r; } }), (i.prototype.nodeEdges = function (t, n) { var e = this.inEdges(t, n); if (e) return e.concat(this.outEdges(t, n)); }); }, function (t, n, e) { var r = e(33)(e(24), "Map"); t.exports = r; }, function (t, n, e) { var r = e(221), o = e(228), i = e(230), u = e(231), c = e(232); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length; ++e < r && !1 !== n(t[e], e, t); ); return t; }; }, function (t, n) { t.exports = function (t) { return ( "number" == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991 ); }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(104), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i && o.process, a = (function () { try { var t = u && u.require && u.require("util").types; return t || (c && c.binding && c.binding("util")); } catch (t) {} })(); t.exports = a; }).call(this, e(45)(t)); }, function (t, n, e) { var r = e(63), o = e(238), i = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return o(t); var n = []; for (var e in Object(t)) i.call(t, e) && "constructor" != e && n.push(e); return n; }; }, function (t, n, e) { var r = e(111), o = e(112), i = Object.prototype.propertyIsEnumerable, u = Object.getOwnPropertySymbols, c = u ? function (t) { return null == t ? [] : ((t = Object(t)), r(u(t), function (n) { return i.call(t, n); })); } : o; t.exports = c; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = n.length, o = t.length; ++e < r; ) t[o + e] = n[e]; return t; }; }, function (t, n, e) { var r = e(117); t.exports = function (t) { var n = new t.constructor(t.byteLength); return new r(n).set(new r(t)), n; }; }, function (t, n) { t.exports = function (t) { return function () { return t; }; }; }, function (t, n, e) { var r = e(91), o = e(31); t.exports = function (t, n) { return t && r(t, n, o); }; }, function (t, n, e) { var r = e(257)(); t.exports = r; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t) { e[++n] = t; }), e ); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(17), i = e(41), u = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, c = /^\w*$/; t.exports = function (t, n) { if (o(t)) return !1; var e = r(t); return ( !( "number" != e && "symbol" != e && "boolean" != e && null != t && !i(t) ) || c.test(t) || !u.test(t) || (null != n && t in Object(n)) ); }; }, function (t, n, e) { var r = e(87), o = e(291); t.exports = function t(n, e, i, u, c) { var a = -1, f = n.length; for (i || (i = o), c || (c = []); ++a < f; ) { var s = n[a]; e > 0 && i(s) ? e > 1 ? t(s, e - 1, i, u, c) : r(c, s) : u || (c[c.length] = s); } return c; }; }, function (t, n, e) { var r = e(41); t.exports = function (t, n, e) { for (var o = -1, i = t.length; ++o < i; ) { var u = t[o], c = n(u); if (null != c && (void 0 === a ? c == c && !r(c) : e(c, a))) var a = c, f = u; } return f; }; }, , , , , , , , function (t, n, e) { var r = e(54), o = e(82), i = e(59), u = e(233), c = e(239), a = e(109), f = e(110), s = e(242), p = e(243), d = e(114), h = e(244), l = e(40), v = e(248), y = e(249), g = e(119), b = e(17), m = e(39), x = e(253), _ = e(21), w = e(255), E = e(31), j = e(35), k = {}; (k["[object Arguments]"] = k["[object Array]"] = k["[object ArrayBuffer]"] = k["[object DataView]"] = k["[object Boolean]"] = k["[object Date]"] = k["[object Float32Array]"] = k["[object Float64Array]"] = k["[object Int8Array]"] = k["[object Int16Array]"] = k["[object Int32Array]"] = k["[object Map]"] = k["[object Number]"] = k["[object Object]"] = k["[object RegExp]"] = k["[object Set]"] = k["[object String]"] = k["[object Symbol]"] = k["[object Uint8Array]"] = k["[object Uint8ClampedArray]"] = k["[object Uint16Array]"] = k["[object Uint32Array]"] = !0), (k["[object Error]"] = k["[object Function]"] = k["[object WeakMap]"] = !1), (t.exports = function t(n, e, S, O, N, I) { var P, M = 1 & e, C = 2 & e, A = 4 & e; if ((S && (P = N ? S(n, O, N, I) : S(n)), void 0 !== P)) return P; if (!_(n)) return n; var L = b(n); if (L) { if (((P = v(n)), !M)) return f(n, P); } else { var T = l(n), z = "[object Function]" == T || "[object GeneratorFunction]" == T; if (m(n)) return a(n, M); if ( "[object Object]" == T || "[object Arguments]" == T || (z && !N) ) { if (((P = C || z ? {} : g(n)), !M)) return C ? p(n, c(P, n)) : s(n, u(P, n)); } else { if (!k[T]) return N ? n : {}; P = y(n, T, M); } } I || (I = new r()); var F = I.get(n); if (F) return F; I.set(n, P), w(n) ? n.forEach(function (r) { P.add(t(r, e, S, r, n, I)); }) : x(n) && n.forEach(function (r, o) { P.set(o, t(r, e, S, o, n, I)); }); var D = L ? void 0 : (A ? (C ? h : d) : C ? j : E)(n); return ( o(D || n, function (r, o) { D && (r = n[(o = r)]), i(P, o, t(r, e, S, o, n, I)); }), P ); }); }, function (t, n, e) { (function (n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = "object" == (void 0 === n ? "undefined" : e(n)) && n && n.Object === Object && n; t.exports = r; }).call(this, e(77)); }, function (t, n) { var e = Function.prototype.toString; t.exports = function (t) { if (null != t) { try { return e.call(t); } catch (t) {} try { return t + ""; } catch (t) {} } return ""; }; }, function (t, n, e) { var r = e(33), o = (function () { try { var t = r(Object, "defineProperty"); return t({}, "", {}), t; } catch (t) {} })(); t.exports = o; }, function (t, n, e) { var r = e(234), o = e(48), i = e(17), u = e(39), c = e(61), a = e(49), f = Object.prototype.hasOwnProperty; t.exports = function (t, n) { var e = i(t), s = !e && o(t), p = !e && !s && u(t), d = !e && !s && !p && a(t), h = e || s || p || d, l = h ? r(t.length, String) : [], v = l.length; for (var y in t) (!n && !f.call(t, y)) || (h && ("length" == y || (p && ("offset" == y || "parent" == y)) || (d && ("buffer" == y || "byteLength" == y || "byteOffset" == y)) || c(y, v))) || l.push(y); return l; }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return t(n(e)); }; }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i ? o.Buffer : void 0, a = c ? c.allocUnsafe : void 0; t.exports = function (t, n) { if (n) return t.slice(); var e = t.length, r = a ? a(e) : new t.constructor(e); return t.copy(r), r; }; }).call(this, e(45)(t)); }, function (t, n) { t.exports = function (t, n) { var e = -1, r = t.length; for (n || (n = Array(r)); ++e < r; ) n[e] = t[e]; return n; }; }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length, o = 0, i = []; ++e < r; ) { var u = t[e]; n(u, e, t) && (i[o++] = u); } return i; }; }, function (t, n) { t.exports = function () { return []; }; }, function (t, n, e) { var r = e(87), o = e(64), i = e(86), u = e(112), c = Object.getOwnPropertySymbols ? function (t) { for (var n = []; t; ) r(n, i(t)), (t = o(t)); return n; } : u; t.exports = c; }, function (t, n, e) { var r = e(115), o = e(86), i = e(31); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(87), o = e(17); t.exports = function (t, n, e) { var i = n(t); return o(t) ? i : r(i, e(t)); }; }, function (t, n, e) { var r = e(33)(e(24), "Set"); t.exports = r; }, function (t, n, e) { var r = e(24).Uint8Array; t.exports = r; }, function (t, n, e) { var r = e(88); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.length); }; }, function (t, n, e) { var r = e(120), o = e(64), i = e(63); t.exports = function (t) { return "function" != typeof t.constructor || i(t) ? {} : r(o(t)); }; }, function (t, n, e) { var r = e(21), o = Object.create, i = (function () { function t() {} return function (n) { if (!r(n)) return {}; if (o) return o(n); t.prototype = n; var e = new t(); return (t.prototype = void 0), e; }; })(); t.exports = i; }, function (t, n, e) { t.exports = e(122); }, function (t, n, e) { var r = e(82), o = e(65), i = e(123), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n)); }; }, function (t, n, e) { var r = e(36); t.exports = function (t) { return "function" == typeof t ? t : r; }; }, function (t, n, e) { var r = e(111), o = e(259), i = e(29), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n, 3)); }; }, function (t, n, e) { var r = e(262), o = e(25); t.exports = function t(n, e, i, u, c) { return ( n === e || (null == n || null == e || (!o(n) && !o(e)) ? n != n && e != e : r(n, e, i, u, t, c)) ); }; }, function (t, n, e) { var r = e(127), o = e(265), i = e(128); t.exports = function (t, n, e, u, c, a) { var f = 1 & e, s = t.length, p = n.length; if (s != p && !(f && p > s)) return !1; var d = a.get(t), h = a.get(n); if (d && h) return d == n && h == t; var l = -1, v = !0, y = 2 & e ? new r() : void 0; for (a.set(t, n), a.set(n, t); ++l < s; ) { var g = t[l], b = n[l]; if (u) var m = f ? u(b, g, l, n, t, a) : u(g, b, l, t, n, a); if (void 0 !== m) { if (m) continue; v = !1; break; } if (y) { if ( !o(n, function (t, n) { if (!i(y, n) && (g === t || c(g, t, e, u, a))) return y.push(n); }) ) { v = !1; break; } } else if (g !== b && !c(g, b, e, u, a)) { v = !1; break; } } return a.delete(t), a.delete(n), v; }; }, function (t, n, e) { var r = e(81), o = e(263), i = e(264); function u(t) { var n = -1, e = null == t ? 0 : t.length; for (this.__data__ = new r(); ++n < e; ) this.add(t[n]); } (u.prototype.add = u.prototype.push = o), (u.prototype.has = i), (t.exports = u); }, function (t, n) { t.exports = function (t, n) { return t.has(n); }; }, function (t, n, e) { var r = e(21); t.exports = function (t) { return t == t && !r(t); }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return null != e && e[t] === n && (void 0 !== n || t in Object(e)); }; }; }, function (t, n, e) { var r = e(275); t.exports = function (t) { return null == t ? "" : r(t); }; }, function (t, n, e) { var r = e(276), o = e(133); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n, e) { var r = e(67), o = e(48), i = e(17), u = e(61), c = e(83), a = e(50); t.exports = function (t, n, e) { for (var f = -1, s = (n = r(n, t)).length, p = !1; ++f < s; ) { var d = a(n[f]); if (!(p = null != t && e(t, d))) break; t = t[d]; } return p || ++f != s ? p : !!(s = null == t ? 0 : t.length) && c(s) && u(d, s) && (i(t) || o(t)); }; }, function (t, n) { t.exports = function (t) { return function (n) { return null == n ? void 0 : n[t]; }; }; }, function (t, n, e) { var r = e(279), o = e(133); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n) { t.exports = function (t) { return void 0 === t; }; }, function (t, n, e) { var r = e(68), o = e(29), i = e(138), u = e(17); t.exports = function (t, n) { return (u(t) ? r : i)(t, o(n, 3)); }; }, function (t, n, e) { var r = e(65), o = e(28); t.exports = function (t, n) { var e = -1, i = o(t) ? Array(t.length) : []; return ( r(t, function (t, r, o) { i[++e] = n(t, r, o); }), i ); }; }, function (t, n, e) { var r = e(281), o = e(65), i = e(29), u = e(282), c = e(17); t.exports = function (t, n, e) { var a = c(t) ? r : u, f = arguments.length < 3; return a(t, i(n, 4), e, f, o); }; }, function (t, n, e) { var r = e(292), o = Math.max; t.exports = function (t, n, e) { return ( (n = o(void 0 === n ? t.length - 1 : n, 0)), function () { for ( var i = arguments, u = -1, c = o(i.length - n, 0), a = Array(c); ++u < c; ) a[u] = i[n + u]; u = -1; for (var f = Array(n + 1); ++u < n; ) f[u] = i[u]; return (f[n] = e(a)), r(t, this, f); } ); }; }, function (t, n, e) { var r = e(293), o = e(294)(r); t.exports = o; }, function (t, n) { t.exports = function (t, n, e, r) { for (var o = t.length, i = e + (r ? 1 : -1); r ? i-- : ++i < o; ) if (n(t[i], i, t)) return i; return -1; }; }, function (t, n, e) { var r = e(28), o = e(25); t.exports = function (t) { return o(t) && r(t); }; }, function (t, n, e) { var r = e(303), o = e(31); t.exports = function (t) { return null == t ? [] : r(t, o(t)); }; }, function (t, n, e) { var r = e(20), o = e(146); t.exports = function (t, n, e, r) { return (function (t, n, e, r) { var i, u, c = {}, a = new o(), f = function (t) { var n = t.v !== i ? t.v : t.w, r = c[n], o = e(t), f = u.distance + o; if (o < 0) throw new Error( "dijkstra does not allow negative edge weights. Bad edge: " + t + " Weight: " + o, ); f < r.distance && ((r.distance = f), (r.predecessor = i), a.decrease(n, f)); }; t.nodes().forEach(function (t) { var e = t === n ? 0 : Number.POSITIVE_INFINITY; (c[t] = { distance: e }), a.add(t, e); }); for ( ; a.size() > 0 && ((i = a.removeMin()), (u = c[i]).distance !== Number.POSITIVE_INFINITY); ) r(i).forEach(f); return c; })( t, String(n), e || i, r || function (n) { return t.outEdges(n); }, ); }; var i = r.constant(1); }, function (t, n, e) { var r = e(20); function o() { (this._arr = []), (this._keyIndices = {}); } (t.exports = o), (o.prototype.size = function () { return this._arr.length; }), (o.prototype.keys = function () { return this._arr.map(function (t) { return t.key; }); }), (o.prototype.has = function (t) { return r.has(this._keyIndices, t); }), (o.prototype.priority = function (t) { var n = this._keyIndices[t]; if (void 0 !== n) return this._arr[n].priority; }), (o.prototype.min = function () { if (0 === this.size()) throw new Error("Queue underflow"); return this._arr[0].key; }), (o.prototype.add = function (t, n) { var e = this._keyIndices; if (((t = String(t)), !r.has(e, t))) { var o = this._arr, i = o.length; return ( (e[t] = i), o.push({ key: t, priority: n }), this._decrease(i), !0 ); } return !1; }), (o.prototype.removeMin = function () { this._swap(0, this._arr.length - 1); var t = this._arr.pop(); return delete this._keyIndices[t.key], this._heapify(0), t.key; }), (o.prototype.decrease = function (t, n) { var e = this._keyIndices[t]; if (n > this._arr[e].priority) throw new Error( "New priority is greater than current priority. Key: " + t + " Old: " + this._arr[e].priority + " New: " + n, ); (this._arr[e].priority = n), this._decrease(e); }), (o.prototype._heapify = function (t) { var n = this._arr, e = 2 * t, r = e + 1, o = t; e < n.length && ((o = n[e].priority < n[o].priority ? e : o), r < n.length && (o = n[r].priority < n[o].priority ? r : o), o !== t && (this._swap(t, o), this._heapify(o))); }), (o.prototype._decrease = function (t) { for ( var n, e = this._arr, r = e[t].priority; 0 !== t && !(e[(n = t >> 1)].priority < r); ) this._swap(t, n), (t = n); }), (o.prototype._swap = function (t, n) { var e = this._arr, r = this._keyIndices, o = e[t], i = e[n]; (e[t] = i), (e[n] = o), (r[i.key] = t), (r[o.key] = n); }); }, function (t, n, e) { var r = e(20); t.exports = function (t) { var n = 0, e = [], o = {}, i = []; return ( t.nodes().forEach(function (u) { r.has(o, u) || (function u(c) { var a = (o[c] = { onStack: !0, lowlink: n, index: n++ }); if ( (e.push(c), t.successors(c).forEach(function (t) { r.has(o, t) ? o[t].onStack && (a.lowlink = Math.min(a.lowlink, o[t].index)) : (u(t), (a.lowlink = Math.min(a.lowlink, o[t].lowlink))); }), a.lowlink === a.index) ) { var f, s = []; do { (f = e.pop()), (o[f].onStack = !1), s.push(f); } while (c !== f); i.push(s); } })(u); }), i ); }; }, function (t, n, e) { var r = e(20); function o(t) { var n = {}, e = {}, o = []; if ( (r.each(t.sinks(), function u(c) { if (r.has(e, c)) throw new i(); r.has(n, c) || ((e[c] = !0), (n[c] = !0), r.each(t.predecessors(c), u), delete e[c], o.push(c)); }), r.size(n) !== t.nodeCount()) ) throw new i(); return o; } function i() {} (t.exports = o), (o.CycleException = i), (i.prototype = new Error()); }, function (t, n, e) { var r = e(20); t.exports = function (t, n, e) { r.isArray(n) || (n = [n]); var o = (t.isDirected() ? t.successors : t.neighbors).bind(t), i = [], u = {}; return ( r.each(n, function (n) { if (!t.hasNode(n)) throw new Error("Graph does not have node: " + n); !(function t(n, e, o, i, u, c) { r.has(i, e) || ((i[e] = !0), o || c.push(e), r.each(u(e), function (e) { t(n, e, o, i, u, c); }), o && c.push(e)); })(t, n, "post" === e, u, o, i); }), i ); }; }, function (t, n, e) { var r = e(322); t.exports = function (t) { return t ? (t = r(t)) === 1 / 0 || t === -1 / 0 ? 17976931348623157e292 * (t < 0 ? -1 : 1) : t == t ? t : 0 : 0 === t ? t : 0; }; }, function (t, n, e) { var r = e(94); t.exports = function (t) { return (null == t ? 0 : t.length) ? r(t, 1) : []; }; }, function (t, n, e) { var r = e(60), o = e(37); t.exports = function (t, n, e) { ((void 0 !== e && !o(t[n], e)) || (void 0 === e && !(n in t))) && r(t, n, e); }; }, function (t, n) { t.exports = function (t, n) { if ( ("constructor" !== n || "function" != typeof t[n]) && "__proto__" != n ) return t[n]; }; }, function (t, n) { t.exports = function (t, n) { return t < n; }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(23).Graph, i = e(71).slack; function u(t, n) { return ( r.forEach(t.nodes(), function e(o) { r.forEach(n.nodeEdges(o), function (r) { var u = r.v, c = o === u ? r.w : u; t.hasNode(c) || i(n, r) || (t.setNode(c, {}), t.setEdge(o, c, {}), e(c)); }); }), t.nodeCount() ); } function c(t, n) { return r.minBy(n.edges(), function (e) { if (t.hasNode(e.v) !== t.hasNode(e.w)) return i(n, e); }); } function a(t, n, e) { r.forEach(t.nodes(), function (t) { n.node(t).rank += e; }); } t.exports = function (t) { var n, e, r = new o({ directed: !1 }), f = t.nodes()[0], s = t.nodeCount(); r.setNode(f, {}); for (; u(r, t) < s; ) (n = c(r, t)), (e = r.hasNode(n.v) ? i(t, n) : -i(t, n)), a(r, t, e); return r; }; }, , , , , , function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.DagreLayout = void 0); var u = i(e(201)), c = e(10), a = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.rankdir = "TB"), (e.nodesep = 50), (e.ranksep = 50), (e.controlPoints = !1), (e.sortByCombo = !1), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { rankdir: "TB", align: void 0, nodeSize: void 0, nodesepFunc: void 0, ranksepFunc: void 0, nodesep: 50, ranksep: 50, controlPoints: !1, }; }), (n.prototype.execute = function () { var t = this, n = this, e = n.nodes, r = n.nodeSize, o = n.rankdir, i = n.combos; if (e) { var a, s = n.edges || [], p = new u.default.graphlib.Graph({ multigraph: !0, compound: !0, }); a = r ? c.isArray(r) ? function () { return r; } : function () { return [r, r]; } : function (t) { return t.size ? c.isArray(t.size) ? t.size : [t.size, t.size] : [40, 40]; }; var d = f(n.nodesepFunc, n.nodesep, 50), h = f(n.ranksepFunc, n.ranksep, 50); ("LR" !== o && "RL" !== o) || ((d = f(n.ranksepFunc, n.ranksep, 50)), (h = f(n.nodesepFunc, n.nodesep, 50))), p.setDefaultEdgeLabel(function () { return {}; }), p.setGraph(n); var l, v = {}; return ( e.forEach(function (n) { var e = a(n), r = h(n), o = d(n), i = e[0] + 2 * o, u = e[1] + 2 * r; p.setNode(n.id, { width: i, height: u }), t.sortByCombo && n.comboId && (v[n.comboId] || ((v[n.comboId] = !0), p.setNode(n.comboId, {})), p.setParent(n.id, n.comboId)); }), this.sortByCombo && i && i.forEach(function (t) { t.parentId && (v[t.parentId] || ((v[t.parentId] = !0), p.setNode(t.parentId, {})), p.setParent(t.id, t.parentId)); }), s.forEach(function (t) { p.setEdge(t.source, t.target, { weight: t.weight || 1 }); }), u.default.layout(p), p.nodes().forEach(function (t) { l = p.node(t); var n = e.findIndex(function (n) { return n.id === t; }); e[n] && ((e[n].x = l.x), (e[n].y = l.y)); }), p.edges().forEach(function (t) { l = p.edge(t); var e = s.findIndex(function (n) { return n.source === t.v && n.target === t.w; }); n.controlPoints && "loop" !== s[e].type && (s[e].controlPoints = l.points.slice( 1, l.points.length - 1, )); }), n.onLayoutEnd && n.onLayoutEnd(), { nodes: e, edges: s } ); } }), (n.prototype.getType = function () { return "dagre"; }), n ); })(e(9).Base); function f(t, n, e) { return ( t || (c.isNumber(n) ? function () { return n; } : function () { return e; }) ); } n.DagreLayout = a; }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (t, n, e) { "use strict"; e.r(n); var r = e(161); n.default = r.DagreLayout; }, function (t, n, e) { t.exports = { graphlib: e(23), layout: e(315), debug: e(376), util: { time: e(19).time, notime: e(19).notime }, version: e(377), }; }, function (t, n, e) { var r = e(203); t.exports = { Graph: r.Graph, json: e(305), alg: e(306), version: r.version, }; }, function (t, n, e) { t.exports = { Graph: e(79), version: e(304) }; }, function (t, n, e) { var r = e(103); t.exports = function (t) { return r(t, 4); }; }, function (t, n) { t.exports = function () { (this.__data__ = []), (this.size = 0); }; }, function (t, n, e) { var r = e(56), o = Array.prototype.splice; t.exports = function (t) { var n = this.__data__, e = r(n, t); return ( !(e < 0) && (e == n.length - 1 ? n.pop() : o.call(n, e, 1), --this.size, !0) ); }; }, function (t, n, e) { var r = e(56); t.exports = function (t) { var n = this.__data__, e = r(n, t); return e < 0 ? void 0 : n[e][1]; }; }, function (t, n, e) { var r = e(56); t.exports = function (t) { return r(this.__data__, t) > -1; }; }, function (t, n, e) { var r = e(56); t.exports = function (t, n) { var e = this.__data__, o = r(e, t); return o < 0 ? (++this.size, e.push([t, n])) : (e[o][1] = n), this; }; }, function (t, n, e) { var r = e(55); t.exports = function () { (this.__data__ = new r()), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.__data__, e = n.delete(t); return (this.size = n.size), e; }; }, function (t, n) { t.exports = function (t) { return this.__data__.get(t); }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n, e) { var r = e(55), o = e(80), i = e(81); t.exports = function (t, n) { var e = this.__data__; if (e instanceof r) { var u = e.__data__; if (!o || u.length < 199) return u.push([t, n]), (this.size = ++e.size), this; e = this.__data__ = new i(u); } return e.set(t, n), (this.size = e.size), this; }; }, function (t, n, e) { var r = e(46), o = e(218), i = e(21), u = e(105), c = /^\[object .+?Constructor\]$/, a = Function.prototype, f = Object.prototype, s = a.toString, p = f.hasOwnProperty, d = RegExp( "^" + s .call(p) .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") .replace( /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?", ) + "$", ); t.exports = function (t) { return !(!i(t) || o(t)) && (r(t) ? d : c).test(u(t)); }; }, function (t, n, e) { var r = e(38), o = Object.prototype, i = o.hasOwnProperty, u = o.toString, c = r ? r.toStringTag : void 0; t.exports = function (t) { var n = i.call(t, c), e = t[c]; try { t[c] = void 0; var r = !0; } catch (t) {} var o = u.call(t); return r && (n ? (t[c] = e) : delete t[c]), o; }; }, function (t, n) { var e = Object.prototype.toString; t.exports = function (t) { return e.call(t); }; }, function (t, n, e) { var r, o = e(219), i = (r = /[^.]+$/.exec((o && o.keys && o.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + r : ""; t.exports = function (t) { return !!i && i in t; }; }, function (t, n, e) { var r = e(24)["__core-js_shared__"]; t.exports = r; }, function (t, n) { t.exports = function (t, n) { return null == t ? void 0 : t[n]; }; }, function (t, n, e) { var r = e(222), o = e(55), i = e(80); t.exports = function () { (this.size = 0), (this.__data__ = { hash: new r(), map: new (i || o)(), string: new r(), }); }; }, function (t, n, e) { var r = e(223), o = e(224), i = e(225), u = e(226), c = e(227); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(57); t.exports = function () { (this.__data__ = r ? r(null) : {}), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.has(t) && delete this.__data__[t]; return (this.size -= n ? 1 : 0), n; }; }, function (t, n, e) { var r = e(57), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; if (r) { var e = n[t]; return "__lodash_hash_undefined__" === e ? void 0 : e; } return o.call(n, t) ? n[t] : void 0; }; }, function (t, n, e) { var r = e(57), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; return r ? void 0 !== n[t] : o.call(n, t); }; }, function (t, n, e) { var r = e(57); t.exports = function (t, n) { var e = this.__data__; return ( (this.size += this.has(t) ? 0 : 1), (e[t] = r && void 0 === n ? "__lodash_hash_undefined__" : n), this ); }; }, function (t, n, e) { var r = e(58); t.exports = function (t) { var n = r(this, t).delete(t); return (this.size -= n ? 1 : 0), n; }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return "string" == n || "number" == n || "symbol" == n || "boolean" == n ? "__proto__" !== t : null === t; }; }, function (t, n, e) { var r = e(58); t.exports = function (t) { return r(this, t).get(t); }; }, function (t, n, e) { var r = e(58); t.exports = function (t) { return r(this, t).has(t); }; }, function (t, n, e) { var r = e(58); t.exports = function (t, n) { var e = r(this, t), o = e.size; return e.set(t, n), (this.size += e.size == o ? 0 : 1), this; }; }, function (t, n, e) { var r = e(47), o = e(31); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = Array(t); ++e < t; ) r[e] = n(e); return r; }; }, function (t, n, e) { var r = e(34), o = e(25); t.exports = function (t) { return o(t) && "[object Arguments]" == r(t); }; }, function (t, n) { t.exports = function () { return !1; }; }, function (t, n, e) { var r = e(34), o = e(83), i = e(25), u = {}; (u["[object Float32Array]"] = u["[object Float64Array]"] = u["[object Int8Array]"] = u["[object Int16Array]"] = u["[object Int32Array]"] = u["[object Uint8Array]"] = u["[object Uint8ClampedArray]"] = u["[object Uint16Array]"] = u["[object Uint32Array]"] = !0), (u["[object Arguments]"] = u["[object Array]"] = u["[object ArrayBuffer]"] = u["[object Boolean]"] = u["[object DataView]"] = u["[object Date]"] = u["[object Error]"] = u["[object Function]"] = u["[object Map]"] = u["[object Number]"] = u["[object Object]"] = u["[object RegExp]"] = u["[object Set]"] = u["[object String]"] = u["[object WeakMap]"] = !1), (t.exports = function (t) { return i(t) && o(t.length) && !!u[r(t)]; }); }, function (t, n, e) { var r = e(108)(Object.keys, Object); t.exports = r; }, function (t, n, e) { var r = e(47), o = e(35); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n, e) { var r = e(21), o = e(63), i = e(241), u = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return i(t); var n = o(t), e = []; for (var c in t) ("constructor" != c || (!n && u.call(t, c))) && e.push(c); return e; }; }, function (t, n) { t.exports = function (t) { var n = []; if (null != t) for (var e in Object(t)) n.push(e); return n; }; }, function (t, n, e) { var r = e(47), o = e(86); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(47), o = e(113); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(115), o = e(113), i = e(35); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(33)(e(24), "DataView"); t.exports = r; }, function (t, n, e) { var r = e(33)(e(24), "Promise"); t.exports = r; }, function (t, n, e) { var r = e(33)(e(24), "WeakMap"); t.exports = r; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = t.length, r = new t.constructor(n); return ( n && "string" == typeof t[0] && e.call(t, "index") && ((r.index = t.index), (r.input = t.input)), r ); }; }, function (t, n, e) { var r = e(88), o = e(250), i = e(251), u = e(252), c = e(118); t.exports = function (t, n, e) { var a = t.constructor; switch (n) { case "[object ArrayBuffer]": return r(t); case "[object Boolean]": case "[object Date]": return new a(+t); case "[object DataView]": return o(t, e); case "[object Float32Array]": case "[object Float64Array]": case "[object Int8Array]": case "[object Int16Array]": case "[object Int32Array]": case "[object Uint8Array]": case "[object Uint8ClampedArray]": case "[object Uint16Array]": case "[object Uint32Array]": return c(t, e); case "[object Map]": return new a(); case "[object Number]": case "[object String]": return new a(t); case "[object RegExp]": return i(t); case "[object Set]": return new a(); case "[object Symbol]": return u(t); } }; }, function (t, n, e) { var r = e(88); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.byteLength); }; }, function (t, n) { var e = /\w*$/; t.exports = function (t) { var n = new t.constructor(t.source, e.exec(t)); return (n.lastIndex = t.lastIndex), n; }; }, function (t, n, e) { var r = e(38), o = r ? r.prototype : void 0, i = o ? o.valueOf : void 0; t.exports = function (t) { return i ? Object(i.call(t)) : {}; }; }, function (t, n, e) { var r = e(254), o = e(62), i = e(84), u = i && i.isMap, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(40), o = e(25); t.exports = function (t) { return o(t) && "[object Map]" == r(t); }; }, function (t, n, e) { var r = e(256), o = e(62), i = e(84), u = i && i.isSet, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(40), o = e(25); t.exports = function (t) { return o(t) && "[object Set]" == r(t); }; }, function (t, n) { t.exports = function (t) { return function (n, e, r) { for (var o = -1, i = Object(n), u = r(n), c = u.length; c--; ) { var a = u[t ? c : ++o]; if (!1 === e(i[a], a, i)) break; } return n; }; }; }, function (t, n, e) { var r = e(28); t.exports = function (t, n) { return function (e, o) { if (null == e) return e; if (!r(e)) return t(e, o); for ( var i = e.length, u = n ? i : -1, c = Object(e); (n ? u-- : ++u < i) && !1 !== o(c[u], u, c); ); return e; }; }; }, function (t, n, e) { var r = e(65); t.exports = function (t, n) { var e = []; return ( r(t, function (t, r, o) { n(t, r, o) && e.push(t); }), e ); }; }, function (t, n, e) { var r = e(261), o = e(269), i = e(130); t.exports = function (t) { var n = o(t); return 1 == n.length && n[0][2] ? i(n[0][0], n[0][1]) : function (e) { return e === t || r(e, t, n); }; }; }, function (t, n, e) { var r = e(54), o = e(125); t.exports = function (t, n, e, i) { var u = e.length, c = u, a = !i; if (null == t) return !c; for (t = Object(t); u--; ) { var f = e[u]; if (a && f[2] ? f[1] !== t[f[0]] : !(f[0] in t)) return !1; } for (; ++u < c; ) { var s = (f = e[u])[0], p = t[s], d = f[1]; if (a && f[2]) { if (void 0 === p && !(s in t)) return !1; } else { var h = new r(); if (i) var l = i(p, d, s, t, n, h); if (!(void 0 === l ? o(d, p, 3, i, h) : l)) return !1; } } return !0; }; }, function (t, n, e) { var r = e(54), o = e(126), i = e(266), u = e(268), c = e(40), a = e(17), f = e(39), s = e(49), p = "[object Object]", d = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, h, l, v) { var y = a(t), g = a(n), b = y ? "[object Array]" : c(t), m = g ? "[object Array]" : c(n), x = (b = "[object Arguments]" == b ? p : b) == p, _ = (m = "[object Arguments]" == m ? p : m) == p, w = b == m; if (w && f(t)) { if (!f(n)) return !1; (y = !0), (x = !1); } if (w && !x) return ( v || (v = new r()), y || s(t) ? o(t, n, e, h, l, v) : i(t, n, b, e, h, l, v) ); if (!(1 & e)) { var E = x && d.call(t, "__wrapped__"), j = _ && d.call(n, "__wrapped__"); if (E || j) { var k = E ? t.value() : t, S = j ? n.value() : n; return v || (v = new r()), l(k, S, e, h, v); } } return !!w && (v || (v = new r()), u(t, n, e, h, l, v)); }; }, function (t, n) { t.exports = function (t) { return this.__data__.set(t, "__lodash_hash_undefined__"), this; }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length; ++e < r; ) if (n(t[e], e, t)) return !0; return !1; }; }, function (t, n, e) { var r = e(38), o = e(117), i = e(37), u = e(126), c = e(267), a = e(92), f = r ? r.prototype : void 0, s = f ? f.valueOf : void 0; t.exports = function (t, n, e, r, f, p, d) { switch (e) { case "[object DataView]": if (t.byteLength != n.byteLength || t.byteOffset != n.byteOffset) return !1; (t = t.buffer), (n = n.buffer); case "[object ArrayBuffer]": return !(t.byteLength != n.byteLength || !p(new o(t), new o(n))); case "[object Boolean]": case "[object Date]": case "[object Number]": return i(+t, +n); case "[object Error]": return t.name == n.name && t.message == n.message; case "[object RegExp]": case "[object String]": return t == n + ""; case "[object Map]": var h = c; case "[object Set]": var l = 1 & r; if ((h || (h = a), t.size != n.size && !l)) return !1; var v = d.get(t); if (v) return v == n; (r |= 2), d.set(t, n); var y = u(h(t), h(n), r, f, p, d); return d.delete(t), y; case "[object Symbol]": if (s) return s.call(t) == s.call(n); } return !1; }; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t, r) { e[++n] = [r, t]; }), e ); }; }, function (t, n, e) { var r = e(114), o = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, i, u, c) { var a = 1 & e, f = r(t), s = f.length; if (s != r(n).length && !a) return !1; for (var p = s; p--; ) { var d = f[p]; if (!(a ? d in n : o.call(n, d))) return !1; } var h = c.get(t), l = c.get(n); if (h && l) return h == n && l == t; var v = !0; c.set(t, n), c.set(n, t); for (var y = a; ++p < s; ) { var g = t[(d = f[p])], b = n[d]; if (i) var m = a ? i(b, g, d, n, t, c) : i(g, b, d, t, n, c); if (!(void 0 === m ? g === b || u(g, b, e, i, c) : m)) { v = !1; break; } y || (y = "constructor" == d); } if (v && !y) { var x = t.constructor, _ = n.constructor; x == _ || !("constructor" in t) || !("constructor" in n) || ("function" == typeof x && x instanceof x && "function" == typeof _ && _ instanceof _) || (v = !1); } return c.delete(t), c.delete(n), v; }; }, function (t, n, e) { var r = e(129), o = e(31); t.exports = function (t) { for (var n = o(t), e = n.length; e--; ) { var i = n[e], u = t[i]; n[e] = [i, u, r(u)]; } return n; }; }, function (t, n, e) { var r = e(125), o = e(271), i = e(132), u = e(93), c = e(129), a = e(130), f = e(50); t.exports = function (t, n) { return u(t) && c(n) ? a(f(t), n) : function (e) { var u = o(e, t); return void 0 === u && u === n ? i(e, t) : r(n, u, 3); }; }; }, function (t, n, e) { var r = e(66); t.exports = function (t, n, e) { var o = null == t ? void 0 : r(t, n); return void 0 === o ? e : o; }; }, function (t, n, e) { var r = e(273), o = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g, u = r(function (t) { var n = []; return ( 46 === t.charCodeAt(0) && n.push(""), t.replace(o, function (t, e, r, o) { n.push(r ? o.replace(i, "$1") : e || t); }), n ); }); t.exports = u; }, function (t, n, e) { var r = e(274); t.exports = function (t) { var n = r(t, function (t) { return 500 === e.size && e.clear(), t; }), e = n.cache; return n; }; }, function (t, n, e) { var r = e(81); function o(t, n) { if ("function" != typeof t || (null != n && "function" != typeof n)) throw new TypeError("Expected a function"); var e = function e() { var r = arguments, o = n ? n.apply(this, r) : r[0], i = e.cache; if (i.has(o)) return i.get(o); var u = t.apply(this, r); return (e.cache = i.set(o, u) || i), u; }; return (e.cache = new (o.Cache || r)()), e; } (o.Cache = r), (t.exports = o); }, function (t, n, e) { var r = e(38), o = e(68), i = e(17), u = e(41), c = r ? r.prototype : void 0, a = c ? c.toString : void 0; t.exports = function t(n) { if ("string" == typeof n) return n; if (i(n)) return o(n, t) + ""; if (u(n)) return a ? a.call(n) : ""; var e = n + ""; return "0" == e && 1 / n == -1 / 0 ? "-0" : e; }; }, function (t, n) { t.exports = function (t, n) { return null != t && n in Object(t); }; }, function (t, n, e) { var r = e(134), o = e(278), i = e(93), u = e(50); t.exports = function (t) { return i(t) ? r(u(t)) : o(t); }; }, function (t, n, e) { var r = e(66); t.exports = function (t) { return function (n) { return r(n, t); }; }; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t, n) { return null != t && e.call(t, n); }; }, function (t, n, e) { var r = e(85), o = e(40), i = e(48), u = e(17), c = e(28), a = e(39), f = e(63), s = e(49), p = Object.prototype.hasOwnProperty; t.exports = function (t) { if (null == t) return !0; if ( c(t) && (u(t) || "string" == typeof t || "function" == typeof t.splice || a(t) || s(t) || i(t)) ) return !t.length; var n = o(t); if ("[object Map]" == n || "[object Set]" == n) return !t.size; if (f(t)) return !r(t).length; for (var e in t) if (p.call(t, e)) return !1; return !0; }; }, function (t, n) { t.exports = function (t, n, e, r) { var o = -1, i = null == t ? 0 : t.length; for (r && i && (e = t[++o]); ++o < i; ) e = n(e, t[o], o, t); return e; }; }, function (t, n) { t.exports = function (t, n, e, r, o) { return ( o(t, function (t, o, i) { e = r ? ((r = !1), t) : n(e, t, o, i); }), e ); }; }, function (t, n, e) { var r = e(85), o = e(40), i = e(28), u = e(284), c = e(285); t.exports = function (t) { if (null == t) return 0; if (i(t)) return u(t) ? c(t) : t.length; var n = o(t); return "[object Map]" == n || "[object Set]" == n ? t.size : r(t).length; }; }, function (t, n, e) { var r = e(34), o = e(17), i = e(25); t.exports = function (t) { return ( "string" == typeof t || (!o(t) && i(t) && "[object String]" == r(t)) ); }; }, function (t, n, e) { var r = e(286), o = e(287), i = e(288); t.exports = function (t) { return o(t) ? i(t) : r(t); }; }, function (t, n, e) { var r = e(134)("length"); t.exports = r; }, function (t, n) { var e = RegExp( "[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]", ); t.exports = function (t) { return e.test(t); }; }, function (t, n) { var e = "[\\ud800-\\udfff]", r = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", o = "\\ud83c[\\udffb-\\udfff]", i = "[^\\ud800-\\udfff]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", c = "[\\ud800-\\udbff][\\udc00-\\udfff]", a = "(?:" + r + "|" + o + ")" + "?", f = "[\\ufe0e\\ufe0f]?" + a + ("(?:\\u200d(?:" + [i, u, c].join("|") + ")[\\ufe0e\\ufe0f]?" + a + ")*"), s = "(?:" + [i + r + "?", r, u, c, e].join("|") + ")", p = RegExp(o + "(?=" + o + ")|" + s + f, "g"); t.exports = function (t) { for (var n = (p.lastIndex = 0); p.test(t); ) ++n; return n; }; }, function (t, n, e) { var r = e(82), o = e(120), i = e(90), u = e(29), c = e(64), a = e(17), f = e(39), s = e(46), p = e(21), d = e(49); t.exports = function (t, n, e) { var h = a(t), l = h || f(t) || d(t); if (((n = u(n, 4)), null == e)) { var v = t && t.constructor; e = l ? (h ? new v() : []) : p(t) && s(v) ? o(c(t)) : {}; } return ( (l ? r : i)(t, function (t, r, o) { return n(e, t, r, o); }), e ); }; }, function (t, n, e) { var r = e(94), o = e(69), i = e(295), u = e(143), c = o(function (t) { return i(r(t, 1, u, !0)); }); t.exports = c; }, function (t, n, e) { var r = e(38), o = e(48), i = e(17), u = r ? r.isConcatSpreadable : void 0; t.exports = function (t) { return i(t) || o(t) || !!(u && t && t[u]); }; }, function (t, n) { t.exports = function (t, n, e) { switch (e.length) { case 0: return t.call(n); case 1: return t.call(n, e[0]); case 2: return t.call(n, e[0], e[1]); case 3: return t.call(n, e[0], e[1], e[2]); } return t.apply(n, e); }; }, function (t, n, e) { var r = e(89), o = e(106), i = e(36), u = o ? function (t, n) { return o(t, "toString", { configurable: !0, enumerable: !1, value: r(n), writable: !0, }); } : i; t.exports = u; }, function (t, n) { var e = Date.now; t.exports = function (t) { var n = 0, r = 0; return function () { var o = e(), i = 16 - (o - r); if (((r = o), i > 0)) { if (++n >= 800) return arguments[0]; } else n = 0; return t.apply(void 0, arguments); }; }; }, function (t, n, e) { var r = e(127), o = e(296), i = e(300), u = e(128), c = e(301), a = e(92); t.exports = function (t, n, e) { var f = -1, s = o, p = t.length, d = !0, h = [], l = h; if (e) (d = !1), (s = i); else if (p >= 200) { var v = n ? null : c(t); if (v) return a(v); (d = !1), (s = u), (l = new r()); } else l = n ? [] : h; t: for (; ++f < p; ) { var y = t[f], g = n ? n(y) : y; if (((y = e || 0 !== y ? y : 0), d && g == g)) { for (var b = l.length; b--; ) if (l[b] === g) continue t; n && l.push(g), h.push(y); } else s(l, g, e) || (l !== h && l.push(g), h.push(y)); } return h; }; }, function (t, n, e) { var r = e(297); t.exports = function (t, n) { return !!(null == t ? 0 : t.length) && r(t, n, 0) > -1; }; }, function (t, n, e) { var r = e(142), o = e(298), i = e(299); t.exports = function (t, n, e) { return n == n ? i(t, n, e) : r(t, o, e); }; }, function (t, n) { t.exports = function (t) { return t != t; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = e - 1, o = t.length; ++r < o; ) if (t[r] === n) return r; return -1; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = null == t ? 0 : t.length; ++r < o; ) if (e(n, t[r])) return !0; return !1; }; }, function (t, n, e) { var r = e(116), o = e(302), i = e(92), u = r && 1 / i(new r([, -0]))[1] == 1 / 0 ? function (t) { return new r(t); } : o; t.exports = u; }, function (t, n) { t.exports = function () {}; }, function (t, n, e) { var r = e(68); t.exports = function (t, n) { return r(n, function (n) { return t[n]; }); }; }, function (t, n) { t.exports = "2.1.8"; }, function (t, n, e) { var r = e(20), o = e(79); function i(t) { return r.map(t.nodes(), function (n) { var e = t.node(n), o = t.parent(n), i = { v: n }; return ( r.isUndefined(e) || (i.value = e), r.isUndefined(o) || (i.parent = o), i ); }); } function u(t) { return r.map(t.edges(), function (n) { var e = t.edge(n), o = { v: n.v, w: n.w }; return ( r.isUndefined(n.name) || (o.name = n.name), r.isUndefined(e) || (o.value = e), o ); }); } t.exports = { write: function (t) { var n = { options: { directed: t.isDirected(), multigraph: t.isMultigraph(), compound: t.isCompound(), }, nodes: i(t), edges: u(t), }; r.isUndefined(t.graph()) || (n.value = r.clone(t.graph())); return n; }, read: function (t) { var n = new o(t.options).setGraph(t.value); return ( r.each(t.nodes, function (t) { n.setNode(t.v, t.value), t.parent && n.setParent(t.v, t.parent); }), r.each(t.edges, function (t) { n.setEdge({ v: t.v, w: t.w, name: t.name }, t.value); }), n ); }, }; }, function (t, n, e) { t.exports = { components: e(307), dijkstra: e(145), dijkstraAll: e(308), findCycles: e(309), floydWarshall: e(310), isAcyclic: e(311), postorder: e(312), preorder: e(313), prim: e(314), tarjan: e(147), topsort: e(148), }; }, function (t, n, e) { var r = e(20); t.exports = function (t) { var n, e = {}, o = []; function i(o) { r.has(e, o) || ((e[o] = !0), n.push(o), r.each(t.successors(o), i), r.each(t.predecessors(o), i)); } return ( r.each(t.nodes(), function (t) { (n = []), i(t), n.length && o.push(n); }), o ); }; }, function (t, n, e) { var r = e(145), o = e(20); t.exports = function (t, n, e) { return o.transform( t.nodes(), function (o, i) { o[i] = r(t, i, n, e); }, {}, ); }; }, function (t, n, e) { var r = e(20), o = e(147); t.exports = function (t) { return r.filter(o(t), function (n) { return n.length > 1 || (1 === n.length && t.hasEdge(n[0], n[0])); }); }; }, function (t, n, e) { var r = e(20); t.exports = function (t, n, e) { return (function (t, n, e) { var r = {}, o = t.nodes(); return ( o.forEach(function (t) { (r[t] = {}), (r[t][t] = { distance: 0 }), o.forEach(function (n) { t !== n && (r[t][n] = { distance: Number.POSITIVE_INFINITY }); }), e(t).forEach(function (e) { var o = e.v === t ? e.w : e.v, i = n(e); r[t][o] = { distance: i, predecessor: t }; }); }), o.forEach(function (t) { var n = r[t]; o.forEach(function (e) { var i = r[e]; o.forEach(function (e) { var r = i[t], o = n[e], u = i[e], c = r.distance + o.distance; c < u.distance && ((u.distance = c), (u.predecessor = o.predecessor)); }); }); }), r ); })( t, n || o, e || function (n) { return t.outEdges(n); }, ); }; var o = r.constant(1); }, function (t, n, e) { var r = e(148); t.exports = function (t) { try { r(t); } catch (t) { if (t instanceof r.CycleException) return !1; throw t; } return !0; }; }, function (t, n, e) { var r = e(149); t.exports = function (t, n) { return r(t, n, "post"); }; }, function (t, n, e) { var r = e(149); t.exports = function (t, n) { return r(t, n, "pre"); }; }, function (t, n, e) { var r = e(20), o = e(79), i = e(146); t.exports = function (t, n) { var e, u = new o(), c = {}, a = new i(); function f(t) { var r = t.v === e ? t.w : t.v, o = a.priority(r); if (void 0 !== o) { var i = n(t); i < o && ((c[r] = e), a.decrease(r, i)); } } if (0 === t.nodeCount()) return u; r.each(t.nodes(), function (t) { a.add(t, Number.POSITIVE_INFINITY), u.setNode(t); }), a.decrease(t.nodes()[0], 0); var s = !1; for (; a.size() > 0; ) { if (((e = a.removeMin()), r.has(c, e))) u.setEdge(e, c[e]); else { if (s) throw new Error("Input graph is not connected: " + t); s = !0; } t.nodeEdges(e).forEach(f); } return u; }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(355), i = e(358), u = e(359), c = e(19).normalizeRanks, a = e(361), f = e(19).removeEmptyRanks, s = e(362), p = e(363), d = e(364), h = e(365), l = e(374), v = e(19), y = e(23).Graph; t.exports = function (t, n) { var e = n && n.debugTiming ? v.time : v.notime; e("layout", function () { var n = e(" buildLayoutGraph", function () { return (function (t) { var n = new y({ multigraph: !0, compound: !0 }), e = S(t.graph()); return ( n.setGraph(r.merge({}, b, k(e, g), r.pick(e, m))), r.forEach(t.nodes(), function (e) { var o = S(t.node(e)); n.setNode(e, r.defaults(k(o, x), _)), n.setParent(e, t.parent(e)); }), r.forEach(t.edges(), function (e) { var o = S(t.edge(e)); n.setEdge(e, r.merge({}, E, k(o, w), r.pick(o, j))); }), n ); })(t); }); e(" runLayout", function () { !(function (t, n) { n(" makeSpaceForEdgeLabels", function () { !(function (t) { var n = t.graph(); (n.ranksep /= 2), r.forEach(t.edges(), function (e) { var r = t.edge(e); (r.minlen *= 2), "c" !== r.labelpos.toLowerCase() && ("TB" === n.rankdir || "BT" === n.rankdir ? (r.width += r.labeloffset) : (r.height += r.labeloffset)); }); })(t); }), n(" removeSelfEdges", function () { !(function (t) { r.forEach(t.edges(), function (n) { if (n.v === n.w) { var e = t.node(n.v); e.selfEdges || (e.selfEdges = []), e.selfEdges.push({ e: n, label: t.edge(n) }), t.removeEdge(n); } }); })(t); }), n(" acyclic", function () { o.run(t); }), n(" nestingGraph.run", function () { s.run(t); }), n(" rank", function () { u(v.asNonCompoundGraph(t)); }), n(" injectEdgeLabelProxies", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.width && e.height) { var r = t.node(n.v), o = { rank: (t.node(n.w).rank - r.rank) / 2 + r.rank, e: n, }; v.addDummyNode(t, "edge-proxy", o, "_ep"); } }); })(t); }), n(" removeEmptyRanks", function () { f(t); }), n(" nestingGraph.cleanup", function () { s.cleanup(t); }), n(" normalizeRanks", function () { c(t); }), n(" assignRankMinMax", function () { !(function (t) { var n = 0; r.forEach(t.nodes(), function (e) { var o = t.node(e); o.borderTop && ((o.minRank = t.node(o.borderTop).rank), (o.maxRank = t.node(o.borderBottom).rank), (n = r.max(n, o.maxRank))); }), (t.graph().maxRank = n); })(t); }), n(" removeEdgeLabelProxies", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); "edge-proxy" === e.dummy && ((t.edge(e.e).labelRank = e.rank), t.removeNode(n)); }); })(t); }), n(" normalize.run", function () { i.run(t); }), n(" parentDummyChains", function () { a(t); }), n(" addBorderSegments", function () { p(t); }), n(" order", function () { h(t); }), n(" insertSelfEdges", function () { !(function (t) { var n = v.buildLayerMatrix(t); r.forEach(n, function (n) { var e = 0; r.forEach(n, function (n, o) { var i = t.node(n); (i.order = o + e), r.forEach(i.selfEdges, function (n) { v.addDummyNode( t, "selfedge", { width: n.label.width, height: n.label.height, rank: i.rank, order: o + ++e, e: n.e, label: n.label, }, "_se", ); }), delete i.selfEdges; }); }); })(t); }), n(" adjustCoordinateSystem", function () { d.adjust(t); }), n(" position", function () { l(t); }), n(" positionSelfEdges", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); if ("selfedge" === e.dummy) { var r = t.node(e.e.v), o = r.x + r.width / 2, i = r.y, u = e.x - o, c = r.height / 2; t.setEdge(e.e, e.label), t.removeNode(n), (e.label.points = [ { x: o + (2 * u) / 3, y: i - c }, { x: o + (5 * u) / 6, y: i - c }, { x: o + u, y: i }, { x: o + (5 * u) / 6, y: i + c }, { x: o + (2 * u) / 3, y: i + c }, ]), (e.label.x = e.x), (e.label.y = e.y); } }); })(t); }), n(" removeBorderNodes", function () { !(function (t) { r.forEach(t.nodes(), function (n) { if (t.children(n).length) { var e = t.node(n), o = t.node(e.borderTop), i = t.node(e.borderBottom), u = t.node(r.last(e.borderLeft)), c = t.node(r.last(e.borderRight)); (e.width = Math.abs(c.x - u.x)), (e.height = Math.abs(i.y - o.y)), (e.x = u.x + e.width / 2), (e.y = o.y + e.height / 2); } }), r.forEach(t.nodes(), function (n) { "border" === t.node(n).dummy && t.removeNode(n); }); })(t); }), n(" normalize.undo", function () { i.undo(t); }), n(" fixupEdgeLabelCoords", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (r.has(e, "x")) switch ( (("l" !== e.labelpos && "r" !== e.labelpos) || (e.width -= e.labeloffset), e.labelpos) ) { case "l": e.x -= e.width / 2 + e.labeloffset; break; case "r": e.x += e.width / 2 + e.labeloffset; } }); })(t); }), n(" undoCoordinateSystem", function () { d.undo(t); }), n(" translateGraph", function () { !(function (t) { var n = Number.POSITIVE_INFINITY, e = 0, o = Number.POSITIVE_INFINITY, i = 0, u = t.graph(), c = u.marginx || 0, a = u.marginy || 0; function f(t) { var r = t.x, u = t.y, c = t.width, a = t.height; (n = Math.min(n, r - c / 2)), (e = Math.max(e, r + c / 2)), (o = Math.min(o, u - a / 2)), (i = Math.max(i, u + a / 2)); } r.forEach(t.nodes(), function (n) { f(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.has(e, "x") && f(e); }), (n -= c), (o -= a), r.forEach(t.nodes(), function (e) { var r = t.node(e); (r.x -= n), (r.y -= o); }), r.forEach(t.edges(), function (e) { var i = t.edge(e); r.forEach(i.points, function (t) { (t.x -= n), (t.y -= o); }), r.has(i, "x") && (i.x -= n), r.has(i, "y") && (i.y -= o); }), (u.width = e - n + c), (u.height = i - o + a); })(t); }), n(" assignNodeIntersects", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e, r, o = t.edge(n), i = t.node(n.v), u = t.node(n.w); o.points ? ((e = o.points[0]), (r = o.points[o.points.length - 1])) : ((o.points = []), (e = u), (r = i)), o.points.unshift(v.intersectRect(i, e)), o.points.push(v.intersectRect(u, r)); }); })(t); }), n(" reversePoints", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); e.reversed && e.points.reverse(); }); })(t); }), n(" acyclic.undo", function () { o.undo(t); }); })(n, e); }), e(" updateInputGraph", function () { !(function (t, n) { r.forEach(t.nodes(), function (e) { var r = t.node(e), o = n.node(e); r && ((r.x = o.x), (r.y = o.y), n.children(e).length && ((r.width = o.width), (r.height = o.height))); }), r.forEach(t.edges(), function (e) { var o = t.edge(e), i = n.edge(e); (o.points = i.points), r.has(i, "x") && ((o.x = i.x), (o.y = i.y)); }), (t.graph().width = n.graph().width), (t.graph().height = n.graph().height); })(t, n); }); }); }; var g = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], b = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, m = ["acyclicer", "ranker", "rankdir", "align"], x = ["width", "height"], _ = { width: 0, height: 0 }, w = ["minlen", "weight", "width", "height", "labeloffset"], E = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r", }, j = ["labelpos"]; function k(t, n) { return r.mapValues(r.pick(t, n), Number); } function S(t) { var n = {}; return ( r.forEach(t, function (t, e) { n[e.toLowerCase()] = t; }), n ); } }, function (t, n, e) { var r = e(103); t.exports = function (t) { return r(t, 5); }; }, function (t, n, e) { var r = e(69), o = e(37), i = e(70), u = e(35), c = Object.prototype, a = c.hasOwnProperty, f = r(function (t, n) { t = Object(t); var e = -1, r = n.length, f = r > 2 ? n[2] : void 0; for (f && i(n[0], n[1], f) && (r = 1); ++e < r; ) for (var s = n[e], p = u(s), d = -1, h = p.length; ++d < h; ) { var l = p[d], v = t[l]; (void 0 === v || (o(v, c[l]) && !a.call(t, l))) && (t[l] = s[l]); } return t; }); t.exports = f; }, function (t, n, e) { var r = e(319)(e(320)); t.exports = r; }, function (t, n, e) { var r = e(29), o = e(28), i = e(31); t.exports = function (t) { return function (n, e, u) { var c = Object(n); if (!o(n)) { var a = r(e, 3); (n = i(n)), (e = function (t) { return a(c[t], t, c); }); } var f = t(n, e, u); return f > -1 ? c[a ? n[f] : f] : void 0; }; }; }, function (t, n, e) { var r = e(142), o = e(29), i = e(321), u = Math.max; t.exports = function (t, n, e) { var c = null == t ? 0 : t.length; if (!c) return -1; var a = null == e ? 0 : i(e); return a < 0 && (a = u(c + a, 0)), r(t, o(n, 3), a); }; }, function (t, n, e) { var r = e(150); t.exports = function (t) { var n = r(t), e = n % 1; return n == n ? (e ? n - e : n) : 0; }; }, function (t, n, e) { var r = e(323), o = e(21), i = e(41), u = /^[-+]0x[0-9a-f]+$/i, c = /^0b[01]+$/i, a = /^0o[0-7]+$/i, f = parseInt; t.exports = function (t) { if ("number" == typeof t) return t; if (i(t)) return NaN; if (o(t)) { var n = "function" == typeof t.valueOf ? t.valueOf() : t; t = o(n) ? n + "" : n; } if ("string" != typeof t) return 0 === t ? t : +t; t = r(t); var e = c.test(t); return e || a.test(t) ? f(t.slice(2), e ? 2 : 8) : u.test(t) ? NaN : +t; }; }, function (t, n, e) { var r = e(324), o = /^\s+/; t.exports = function (t) { return t ? t.slice(0, r(t) + 1).replace(o, "") : t; }; }, function (t, n) { var e = /\s/; t.exports = function (t) { for (var n = t.length; n-- && e.test(t.charAt(n)); ); return n; }; }, function (t, n, e) { var r = e(91), o = e(123), i = e(35); t.exports = function (t, n) { return null == t ? t : r(t, o(n), i); }; }, function (t, n) { t.exports = function (t) { var n = null == t ? 0 : t.length; return n ? t[n - 1] : void 0; }; }, function (t, n, e) { var r = e(60), o = e(90), i = e(29); t.exports = function (t, n) { var e = {}; return ( (n = i(n, 3)), o(t, function (t, o, i) { r(e, o, n(t, o, i)); }), e ); }; }, function (t, n, e) { var r = e(95), o = e(329), i = e(36); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n) { t.exports = function (t, n) { return t > n; }; }, function (t, n, e) { var r = e(331), o = e(335)(function (t, n, e) { r(t, n, e); }); t.exports = o; }, function (t, n, e) { var r = e(54), o = e(152), i = e(91), u = e(332), c = e(21), a = e(35), f = e(153); t.exports = function t(n, e, s, p, d) { n !== e && i( e, function (i, a) { if ((d || (d = new r()), c(i))) u(n, e, a, s, t, p, d); else { var h = p ? p(f(n, a), i, a + "", n, e, d) : void 0; void 0 === h && (h = i), o(n, a, h); } }, a, ); }; }, function (t, n, e) { var r = e(152), o = e(109), i = e(118), u = e(110), c = e(119), a = e(48), f = e(17), s = e(143), p = e(39), d = e(46), h = e(21), l = e(333), v = e(49), y = e(153), g = e(334); t.exports = function (t, n, e, b, m, x, _) { var w = y(t, e), E = y(n, e), j = _.get(E); if (j) r(t, e, j); else { var k = x ? x(w, E, e + "", t, n, _) : void 0, S = void 0 === k; if (S) { var O = f(E), N = !O && p(E), I = !O && !N && v(E); (k = E), O || N || I ? f(w) ? (k = w) : s(w) ? (k = u(w)) : N ? ((S = !1), (k = o(E, !0))) : I ? ((S = !1), (k = i(E, !0))) : (k = []) : l(E) || a(E) ? ((k = w), a(w) ? (k = g(w)) : (h(w) && !d(w)) || (k = c(E))) : (S = !1); } S && (_.set(E, k), m(k, E, b, x, _), _.delete(E)), r(t, e, k); } }; }, function (t, n, e) { var r = e(34), o = e(64), i = e(25), u = Function.prototype, c = Object.prototype, a = u.toString, f = c.hasOwnProperty, s = a.call(Object); t.exports = function (t) { if (!i(t) || "[object Object]" != r(t)) return !1; var n = o(t); if (null === n) return !0; var e = f.call(n, "constructor") && n.constructor; return "function" == typeof e && e instanceof e && a.call(e) == s; }; }, function (t, n, e) { var r = e(47), o = e(35); t.exports = function (t) { return r(t, o(t)); }; }, function (t, n, e) { var r = e(69), o = e(70); t.exports = function (t) { return r(function (n, e) { var r = -1, i = e.length, u = i > 1 ? e[i - 1] : void 0, c = i > 2 ? e[2] : void 0; for ( u = t.length > 3 && "function" == typeof u ? (i--, u) : void 0, c && o(e[0], e[1], c) && ((u = i < 3 ? void 0 : u), (i = 1)), n = Object(n); ++r < i; ) { var a = e[r]; a && t(n, a, r, u); } return n; }); }; }, function (t, n, e) { var r = e(95), o = e(154), i = e(36); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n, e) { var r = e(95), o = e(29), i = e(154); t.exports = function (t, n) { return t && t.length ? r(t, o(n, 2), i) : void 0; }; }, function (t, n, e) { var r = e(24); t.exports = function () { return r.Date.now(); }; }, function (t, n, e) { var r = e(340), o = e(343)(function (t, n) { return null == t ? {} : r(t, n); }); t.exports = o; }, function (t, n, e) { var r = e(341), o = e(132); t.exports = function (t, n) { return r(t, n, function (n, e) { return o(t, e); }); }; }, function (t, n, e) { var r = e(66), o = e(342), i = e(67); t.exports = function (t, n, e) { for (var u = -1, c = n.length, a = {}; ++u < c; ) { var f = n[u], s = r(t, f); e(s, f) && o(a, i(f, t), s); } return a; }; }, function (t, n, e) { var r = e(59), o = e(67), i = e(61), u = e(21), c = e(50); t.exports = function (t, n, e, a) { if (!u(t)) return t; for ( var f = -1, s = (n = o(n, t)).length, p = s - 1, d = t; null != d && ++f < s; ) { var h = c(n[f]), l = e; if ("__proto__" === h || "constructor" === h || "prototype" === h) return t; if (f != p) { var v = d[h]; void 0 === (l = a ? a(v, h, d) : void 0) && (l = u(v) ? v : i(n[f + 1]) ? [] : {}); } r(d, h, l), (d = d[h]); } return t; }; }, function (t, n, e) { var r = e(151), o = e(140), i = e(141); t.exports = function (t) { return i(o(t, void 0, r), t + ""); }; }, function (t, n, e) { var r = e(345)(); t.exports = r; }, function (t, n, e) { var r = e(346), o = e(70), i = e(150); t.exports = function (t) { return function (n, e, u) { return ( u && "number" != typeof u && o(n, e, u) && (e = u = void 0), (n = i(n)), void 0 === e ? ((e = n), (n = 0)) : (e = i(e)), (u = void 0 === u ? (n < e ? 1 : -1) : i(u)), r(n, e, u, t) ); }; }; }, function (t, n) { var e = Math.ceil, r = Math.max; t.exports = function (t, n, o, i) { for (var u = -1, c = r(e((n - t) / (o || 1)), 0), a = Array(c); c--; ) (a[i ? c : ++u] = t), (t += o); return a; }; }, function (t, n, e) { var r = e(94), o = e(348), i = e(69), u = e(70), c = i(function (t, n) { if (null == t) return []; var e = n.length; return ( e > 1 && u(t, n[0], n[1]) ? (n = []) : e > 2 && u(n[0], n[1], n[2]) && (n = [n[0]]), o(t, r(n, 1), []) ); }); t.exports = c; }, function (t, n, e) { var r = e(68), o = e(66), i = e(29), u = e(138), c = e(349), a = e(62), f = e(350), s = e(36), p = e(17); t.exports = function (t, n, e) { n = n.length ? r(n, function (t) { return p(t) ? function (n) { return o(n, 1 === t.length ? t[0] : t); } : t; }) : [s]; var d = -1; n = r(n, a(i)); var h = u(t, function (t, e, o) { return { criteria: r(n, function (n) { return n(t); }), index: ++d, value: t, }; }); return c(h, function (t, n) { return f(t, n, e); }); }; }, function (t, n) { t.exports = function (t, n) { var e = t.length; for (t.sort(n); e--; ) t[e] = t[e].value; return t; }; }, function (t, n, e) { var r = e(351); t.exports = function (t, n, e) { for ( var o = -1, i = t.criteria, u = n.criteria, c = i.length, a = e.length; ++o < c; ) { var f = r(i[o], u[o]); if (f) return o >= a ? f : f * ("desc" == e[o] ? -1 : 1); } return t.index - n.index; }; }, function (t, n, e) { var r = e(41); t.exports = function (t, n) { if (t !== n) { var e = void 0 !== t, o = null === t, i = t == t, u = r(t), c = void 0 !== n, a = null === n, f = n == n, s = r(n); if ( (!a && !s && !u && t > n) || (u && c && f && !a && !s) || (o && c && f) || (!e && f) || !i ) return 1; if ( (!o && !u && !s && t < n) || (s && e && i && !o && !u) || (a && e && i) || (!c && i) || !f ) return -1; } return 0; }; }, function (t, n, e) { var r = e(131), o = 0; t.exports = function (t) { var n = ++o; return r(t) + n; }; }, function (t, n, e) { var r = e(59), o = e(354); t.exports = function (t, n) { return o(t || [], n || [], r); }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = t.length, i = n.length, u = {}; ++r < o; ) { var c = r < i ? n[r] : void 0; e(u, t[r], c); } return u; }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(356); t.exports = { run: function (t) { var n = "greedy" === t.graph().acyclicer ? o( t, (function (t) { return function (n) { return t.edge(n).weight; }; })(t), ) : (function (t) { var n = [], e = {}, o = {}; function i(u) { r.has(o, u) || ((o[u] = !0), (e[u] = !0), r.forEach(t.outEdges(u), function (t) { r.has(e, t.w) ? n.push(t) : i(t.w); }), delete e[u]); } return r.forEach(t.nodes(), i), n; })(t); r.forEach(n, function (n) { var e = t.edge(n); t.removeEdge(n), (e.forwardName = n.name), (e.reversed = !0), t.setEdge(n.w, n.v, e, r.uniqueId("rev")); }); }, undo: function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.reversed) { t.removeEdge(n); var r = e.forwardName; delete e.reversed, delete e.forwardName, t.setEdge(n.w, n.v, e, r); } }); }, }; }, function (t, n, e) { var r = e(8), o = e(23).Graph, i = e(357); t.exports = function (t, n) { if (t.nodeCount() <= 1) return []; var e = (function (t, n) { var e = new o(), u = 0, c = 0; r.forEach(t.nodes(), function (t) { e.setNode(t, { v: t, in: 0, out: 0 }); }), r.forEach(t.edges(), function (t) { var r = e.edge(t.v, t.w) || 0, o = n(t), i = r + o; e.setEdge(t.v, t.w, i), (c = Math.max(c, (e.node(t.v).out += o))), (u = Math.max(u, (e.node(t.w).in += o))); }); var f = r.range(c + u + 3).map(function () { return new i(); }), s = u + 1; return ( r.forEach(e.nodes(), function (t) { a(f, s, e.node(t)); }), { graph: e, buckets: f, zeroIdx: s } ); })(t, n || u), f = (function (t, n, e) { var r, o = [], i = n[n.length - 1], u = n[0]; for (; t.nodeCount(); ) { for (; (r = u.dequeue()); ) c(t, n, e, r); for (; (r = i.dequeue()); ) c(t, n, e, r); if (t.nodeCount()) for (var a = n.length - 2; a > 0; --a) if ((r = n[a].dequeue())) { o = o.concat(c(t, n, e, r, !0)); break; } } return o; })(e.graph, e.buckets, e.zeroIdx); return r.flatten( r.map(f, function (n) { return t.outEdges(n.v, n.w); }), !0, ); }; var u = r.constant(1); function c(t, n, e, o, i) { var u = i ? [] : void 0; return ( r.forEach(t.inEdges(o.v), function (r) { var o = t.edge(r), c = t.node(r.v); i && u.push({ v: r.v, w: r.w }), (c.out -= o), a(n, e, c); }), r.forEach(t.outEdges(o.v), function (r) { var o = t.edge(r), i = r.w, u = t.node(i); (u.in -= o), a(n, e, u); }), t.removeNode(o.v), u ); } function a(t, n, e) { e.out ? e.in ? t[e.out - e.in + n].enqueue(e) : t[t.length - 1].enqueue(e) : t[0].enqueue(e); } }, function (t, n) { function e() { var t = {}; (t._next = t._prev = t), (this._sentinel = t); } function r(t) { (t._prev._next = t._next), (t._next._prev = t._prev), delete t._next, delete t._prev; } function o(t, n) { if ("_next" !== t && "_prev" !== t) return n; } (t.exports = e), (e.prototype.dequeue = function () { var t = this._sentinel, n = t._prev; if (n !== t) return r(n), n; }), (e.prototype.enqueue = function (t) { var n = this._sentinel; t._prev && t._next && r(t), (t._next = n._next), (n._next._prev = t), (n._next = t), (t._prev = n); }), (e.prototype.toString = function () { for (var t = [], n = this._sentinel, e = n._prev; e !== n; ) t.push(JSON.stringify(e, o)), (e = e._prev); return "[" + t.join(", ") + "]"; }); }, function (t, n, e) { "use strict"; var r = e(8), o = e(19); t.exports = { run: function (t) { (t.graph().dummyChains = []), r.forEach(t.edges(), function (n) { !(function (t, n) { var e, r, i, u = n.v, c = t.node(u).rank, a = n.w, f = t.node(a).rank, s = n.name, p = t.edge(n), d = p.labelRank; if (f === c + 1) return; for (t.removeEdge(n), i = 0, ++c; c < f; ++i, ++c) (p.points = []), (r = { width: 0, height: 0, edgeLabel: p, edgeObj: n, rank: c, }), (e = o.addDummyNode(t, "edge", r, "_d")), c === d && ((r.width = p.width), (r.height = p.height), (r.dummy = "edge-label"), (r.labelpos = p.labelpos)), t.setEdge(u, e, { weight: p.weight }, s), 0 === i && t.graph().dummyChains.push(e), (u = e); t.setEdge(u, a, { weight: p.weight }, s); })(t, n); }); }, undo: function (t) { r.forEach(t.graph().dummyChains, function (n) { var e, r = t.node(n), o = r.edgeLabel; for (t.setEdge(r.edgeObj, o); r.dummy; ) (e = t.successors(n)[0]), t.removeNode(n), o.points.push({ x: r.x, y: r.y }), "edge-label" === r.dummy && ((o.x = r.x), (o.y = r.y), (o.width = r.width), (o.height = r.height)), (n = e), (r = t.node(n)); }); }, }; }, function (t, n, e) { "use strict"; var r = e(71).longestPath, o = e(155), i = e(360); t.exports = function (t) { switch (t.graph().ranker) { case "network-simplex": c(t); break; case "tight-tree": !(function (t) { r(t), o(t); })(t); break; case "longest-path": u(t); break; default: c(t); } }; var u = r; function c(t) { i(t); } }, function (t, n, e) { "use strict"; var r = e(8), o = e(155), i = e(71).slack, u = e(71).longestPath, c = e(23).alg.preorder, a = e(23).alg.postorder, f = e(19).simplify; function s(t) { (t = f(t)), u(t); var n, e = o(t); for (h(e), p(e, t); (n = v(e)); ) g(e, t, n, y(e, t, n)); } function p(t, n) { var e = a(t, t.nodes()); (e = e.slice(0, e.length - 1)), r.forEach(e, function (e) { !(function (t, n, e) { var r = t.node(e).parent; t.edge(e, r).cutvalue = d(t, n, e); })(t, n, e); }); } function d(t, n, e) { var o = t.node(e).parent, i = !0, u = n.edge(e, o), c = 0; return ( u || ((i = !1), (u = n.edge(o, e))), (c = u.weight), r.forEach(n.nodeEdges(e), function (r) { var u, a, f = r.v === e, s = f ? r.w : r.v; if (s !== o) { var p = f === i, d = n.edge(r).weight; if (((c += p ? d : -d), (u = e), (a = s), t.hasEdge(u, a))) { var h = t.edge(e, s).cutvalue; c += p ? -h : h; } } }), c ); } function h(t, n) { arguments.length < 2 && (n = t.nodes()[0]), l(t, {}, 1, n); } function l(t, n, e, o, i) { var u = e, c = t.node(o); return ( (n[o] = !0), r.forEach(t.neighbors(o), function (i) { r.has(n, i) || (e = l(t, n, e, i, o)); }), (c.low = u), (c.lim = e++), i ? (c.parent = i) : delete c.parent, e ); } function v(t) { return r.find(t.edges(), function (n) { return t.edge(n).cutvalue < 0; }); } function y(t, n, e) { var o = e.v, u = e.w; n.hasEdge(o, u) || ((o = e.w), (u = e.v)); var c = t.node(o), a = t.node(u), f = c, s = !1; c.lim > a.lim && ((f = a), (s = !0)); var p = r.filter(n.edges(), function (n) { return s === b(t, t.node(n.v), f) && s !== b(t, t.node(n.w), f); }); return r.minBy(p, function (t) { return i(n, t); }); } function g(t, n, e, o) { var i = e.v, u = e.w; t.removeEdge(i, u), t.setEdge(o.v, o.w, {}), h(t), p(t, n), (function (t, n) { var e = r.find(t.nodes(), function (t) { return !n.node(t).parent; }), o = c(t, e); (o = o.slice(1)), r.forEach(o, function (e) { var r = t.node(e).parent, o = n.edge(e, r), i = !1; o || ((o = n.edge(r, e)), (i = !0)), (n.node(e).rank = n.node(r).rank + (i ? o.minlen : -o.minlen)); }); })(t, n); } function b(t, n, e) { return e.low <= n.lim && n.lim <= e.lim; } (t.exports = s), (s.initLowLimValues = h), (s.initCutValues = p), (s.calcCutValue = d), (s.leaveEdge = v), (s.enterEdge = y), (s.exchangeEdges = g); }, function (t, n, e) { var r = e(8); t.exports = function (t) { var n = (function (t) { var n = {}, e = 0; function o(i) { var u = e; r.forEach(t.children(i), o), (n[i] = { low: u, lim: e++ }); } return r.forEach(t.children(), o), n; })(t); r.forEach(t.graph().dummyChains, function (e) { for ( var r = t.node(e), o = r.edgeObj, i = (function (t, n, e, r) { var o, i, u = [], c = [], a = Math.min(n[e].low, n[r].low), f = Math.max(n[e].lim, n[r].lim); o = e; do { (o = t.parent(o)), u.push(o); } while (o && (n[o].low > a || f > n[o].lim)); (i = o), (o = r); for (; (o = t.parent(o)) !== i; ) c.push(o); return { path: u.concat(c.reverse()), lca: i }; })(t, n, o.v, o.w), u = i.path, c = i.lca, a = 0, f = u[a], s = !0; e !== o.w; ) { if (((r = t.node(e)), s)) { for (; (f = u[a]) !== c && t.node(f).maxRank < r.rank; ) a++; f === c && (s = !1); } if (!s) { for ( ; a < u.length - 1 && t.node((f = u[a + 1])).minRank <= r.rank; ) a++; f = u[a]; } t.setParent(e, f), (e = t.successors(e)[0]); } }); }; }, function (t, n, e) { var r = e(8), o = e(19); t.exports = { run: function (t) { var n = o.addDummyNode(t, "root", {}, "_root"), e = (function (t) { var n = {}; return ( r.forEach(t.children(), function (e) { !(function e(o, i) { var u = t.children(o); u && u.length && r.forEach(u, function (t) { e(t, i + 1); }); n[o] = i; })(e, 1); }), n ); })(t), i = r.max(r.values(e)) - 1, u = 2 * i + 1; (t.graph().nestingRoot = n), r.forEach(t.edges(), function (n) { t.edge(n).minlen *= u; }); var c = (function (t) { return r.reduce( t.edges(), function (n, e) { return n + t.edge(e).weight; }, 0, ); })(t) + 1; r.forEach(t.children(), function (a) { !(function t(n, e, i, u, c, a, f) { var s = n.children(f); if (!s.length) return void ( f !== e && n.setEdge(e, f, { weight: 0, minlen: i }) ); var p = o.addBorderNode(n, "_bt"), d = o.addBorderNode(n, "_bb"), h = n.node(f); n.setParent(p, f), (h.borderTop = p), n.setParent(d, f), (h.borderBottom = d), r.forEach(s, function (r) { t(n, e, i, u, c, a, r); var o = n.node(r), s = o.borderTop ? o.borderTop : r, h = o.borderBottom ? o.borderBottom : r, l = o.borderTop ? u : 2 * u, v = s !== h ? 1 : c - a[f] + 1; n.setEdge(p, s, { weight: l, minlen: v, nestingEdge: !0 }), n.setEdge(h, d, { weight: l, minlen: v, nestingEdge: !0 }); }), n.parent(f) || n.setEdge(e, p, { weight: 0, minlen: c + a[f] }); })(t, n, u, c, i, e, a); }), (t.graph().nodeRankFactor = u); }, cleanup: function (t) { var n = t.graph(); t.removeNode(n.nestingRoot), delete n.nestingRoot, r.forEach(t.edges(), function (n) { t.edge(n).nestingEdge && t.removeEdge(n); }); }, }; }, function (t, n, e) { var r = e(8), o = e(19); function i(t, n, e, r, i, u) { var c = { width: 0, height: 0, rank: u, borderType: n }, a = i[n][u - 1], f = o.addDummyNode(t, "border", c, e); (i[n][u] = f), t.setParent(f, r), a && t.setEdge(a, f, { weight: 1 }); } t.exports = function (t) { r.forEach(t.children(), function n(e) { var o = t.children(e), u = t.node(e); if ((o.length && r.forEach(o, n), r.has(u, "minRank"))) { (u.borderLeft = []), (u.borderRight = []); for (var c = u.minRank, a = u.maxRank + 1; c < a; ++c) i(t, "borderLeft", "_bl", e, u, c), i(t, "borderRight", "_br", e, u, c); } }); }; }, function (t, n, e) { "use strict"; var r = e(8); function o(t) { r.forEach(t.nodes(), function (n) { i(t.node(n)); }), r.forEach(t.edges(), function (n) { i(t.edge(n)); }); } function i(t) { var n = t.width; (t.width = t.height), (t.height = n); } function u(t) { t.y = -t.y; } function c(t) { var n = t.x; (t.x = t.y), (t.y = n); } t.exports = { adjust: function (t) { var n = t.graph().rankdir.toLowerCase(); ("lr" !== n && "rl" !== n) || o(t); }, undo: function (t) { var n = t.graph().rankdir.toLowerCase(); ("bt" !== n && "rl" !== n) || (function (t) { r.forEach(t.nodes(), function (n) { u(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, u), r.has(e, "y") && u(e); }); })(t); ("lr" !== n && "rl" !== n) || (!(function (t) { r.forEach(t.nodes(), function (n) { c(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, c), r.has(e, "x") && c(e); }); })(t), o(t)); }, }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(366), i = e(367), u = e(368), c = e(372), a = e(373), f = e(23).Graph, s = e(19); function p(t, n, e) { return r.map(n, function (n) { return c(t, n, e); }); } function d(t, n) { var e = new f(); r.forEach(t, function (t) { var o = t.graph().root, i = u(t, o, e, n); r.forEach(i.vs, function (n, e) { t.node(n).order = e; }), a(t, e, i.vs); }); } function h(t, n) { r.forEach(n, function (n) { r.forEach(n, function (n, e) { t.node(n).order = e; }); }); } t.exports = function (t) { var n = s.maxRank(t), e = p(t, r.range(1, n + 1), "inEdges"), u = p(t, r.range(n - 1, -1, -1), "outEdges"), c = o(t); h(t, c); for ( var a, f = Number.POSITIVE_INFINITY, l = 0, v = 0; v < 4; ++l, ++v ) { d(l % 2 ? e : u, l % 4 >= 2), (c = s.buildLayerMatrix(t)); var y = i(t, c); y < f && ((v = 0), (a = r.cloneDeep(c)), (f = y)); } h(t, a); }; }, function (t, n, e) { "use strict"; var r = e(8); t.exports = function (t) { var n = {}, e = r.filter(t.nodes(), function (n) { return !t.children(n).length; }), o = r.max( r.map(e, function (n) { return t.node(n).rank; }), ), i = r.map(r.range(o + 1), function () { return []; }); var u = r.sortBy(e, function (n) { return t.node(n).rank; }); return ( r.forEach(u, function e(o) { if (r.has(n, o)) return; n[o] = !0; var u = t.node(o); i[u.rank].push(o), r.forEach(t.successors(o), e); }), i ); }; }, function (t, n, e) { "use strict"; var r = e(8); function o(t, n, e) { for ( var o = r.zipObject( e, r.map(e, function (t, n) { return n; }), ), i = r.flatten( r.map(n, function (n) { return r.sortBy( r.map(t.outEdges(n), function (n) { return { pos: o[n.w], weight: t.edge(n).weight }; }), "pos", ); }), !0, ), u = 1; u < e.length; ) u <<= 1; var c = 2 * u - 1; u -= 1; var a = r.map(new Array(c), function () { return 0; }), f = 0; return ( r.forEach( i.forEach(function (t) { var n = t.pos + u; a[n] += t.weight; for (var e = 0; n > 0; ) n % 2 && (e += a[n + 1]), (a[(n = (n - 1) >> 1)] += t.weight); f += t.weight * e; }), ), f ); } t.exports = function (t, n) { for (var e = 0, r = 1; r < n.length; ++r) e += o(t, n[r - 1], n[r]); return e; }; }, function (t, n, e) { var r = e(8), o = e(369), i = e(370), u = e(371); t.exports = function t(n, e, c, a) { var f = n.children(e), s = n.node(e), p = s ? s.borderLeft : void 0, d = s ? s.borderRight : void 0, h = {}; p && (f = r.filter(f, function (t) { return t !== p && t !== d; })); var l = o(n, f); r.forEach(l, function (e) { if (n.children(e.v).length) { var o = t(n, e.v, c, a); (h[e.v] = o), r.has(o, "barycenter") && ((i = e), (u = o), r.isUndefined(i.barycenter) ? ((i.barycenter = u.barycenter), (i.weight = u.weight)) : ((i.barycenter = (i.barycenter * i.weight + u.barycenter * u.weight) / (i.weight + u.weight)), (i.weight += u.weight))); } var i, u; }); var v = i(l, c); !(function (t, n) { r.forEach(t, function (t) { t.vs = r.flatten( t.vs.map(function (t) { return n[t] ? n[t].vs : t; }), !0, ); }); })(v, h); var y = u(v, a); if ( p && ((y.vs = r.flatten([p, y.vs, d], !0)), n.predecessors(p).length) ) { var g = n.node(n.predecessors(p)[0]), b = n.node(n.predecessors(d)[0]); r.has(y, "barycenter") || ((y.barycenter = 0), (y.weight = 0)), (y.barycenter = (y.barycenter * y.weight + g.order + b.order) / (y.weight + 2)), (y.weight += 2); } return y; }; }, function (t, n, e) { var r = e(8); t.exports = function (t, n) { return r.map(n, function (n) { var e = t.inEdges(n); if (e.length) { var o = r.reduce( e, function (n, e) { var r = t.edge(e), o = t.node(e.v); return { sum: n.sum + r.weight * o.order, weight: n.weight + r.weight, }; }, { sum: 0, weight: 0 }, ); return { v: n, barycenter: o.sum / o.weight, weight: o.weight }; } return { v: n }; }); }; }, function (t, n, e) { "use strict"; var r = e(8); t.exports = function (t, n) { var e = {}; return ( r.forEach(t, function (t, n) { var o = (e[t.v] = { indegree: 0, in: [], out: [], vs: [t.v], i: n, }); r.isUndefined(t.barycenter) || ((o.barycenter = t.barycenter), (o.weight = t.weight)); }), r.forEach(n.edges(), function (t) { var n = e[t.v], o = e[t.w]; r.isUndefined(n) || r.isUndefined(o) || (o.indegree++, n.out.push(e[t.w])); }), (function (t) { var n = []; function e(t) { return function (n) { n.merged || ((r.isUndefined(n.barycenter) || r.isUndefined(t.barycenter) || n.barycenter >= t.barycenter) && (function (t, n) { var e = 0, r = 0; t.weight && ((e += t.barycenter * t.weight), (r += t.weight)); n.weight && ((e += n.barycenter * n.weight), (r += n.weight)); (t.vs = n.vs.concat(t.vs)), (t.barycenter = e / r), (t.weight = r), (t.i = Math.min(n.i, t.i)), (n.merged = !0); })(t, n)); }; } function o(n) { return function (e) { e.in.push(n), 0 == --e.indegree && t.push(e); }; } for (; t.length; ) { var i = t.pop(); n.push(i), r.forEach(i.in.reverse(), e(i)), r.forEach(i.out, o(i)); } return r.map( r.filter(n, function (t) { return !t.merged; }), function (t) { return r.pick(t, ["vs", "i", "barycenter", "weight"]); }, ); })( r.filter(e, function (t) { return !t.indegree; }), ) ); }; }, function (t, n, e) { var r = e(8), o = e(19); function i(t, n, e) { for (var o; n.length && (o = r.last(n)).i <= e; ) n.pop(), t.push(o.vs), e++; return e; } t.exports = function (t, n) { var e = o.partition(t, function (t) { return r.has(t, "barycenter"); }), u = e.lhs, c = r.sortBy(e.rhs, function (t) { return -t.i; }), a = [], f = 0, s = 0, p = 0; u.sort( ((d = !!n), function (t, n) { return t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : d ? n.i - t.i : t.i - n.i; }), ), (p = i(a, c, p)), r.forEach(u, function (t) { (p += t.vs.length), a.push(t.vs), (f += t.barycenter * t.weight), (s += t.weight), (p = i(a, c, p)); }); var d; var h = { vs: r.flatten(a, !0) }; s && ((h.barycenter = f / s), (h.weight = s)); return h; }; }, function (t, n, e) { var r = e(8), o = e(23).Graph; t.exports = function (t, n, e) { var i = (function (t) { var n; for (; t.hasNode((n = r.uniqueId("_root"))); ); return n; })(t), u = new o({ compound: !0 }) .setGraph({ root: i }) .setDefaultNodeLabel(function (n) { return t.node(n); }); return ( r.forEach(t.nodes(), function (o) { var c = t.node(o), a = t.parent(o); (c.rank === n || (c.minRank <= n && n <= c.maxRank)) && (u.setNode(o), u.setParent(o, a || i), r.forEach(t[e](o), function (n) { var e = n.v === o ? n.w : n.v, i = u.edge(e, o), c = r.isUndefined(i) ? 0 : i.weight; u.setEdge(e, o, { weight: t.edge(n).weight + c }); }), r.has(c, "minRank") && u.setNode(o, { borderLeft: c.borderLeft[n], borderRight: c.borderRight[n], })); }), u ); }; }, function (t, n, e) { var r = e(8); t.exports = function (t, n, e) { var o, i = {}; r.forEach(e, function (e) { for (var r, u, c = t.parent(e); c; ) { if ( ((r = t.parent(c)) ? ((u = i[r]), (i[r] = c)) : ((u = o), (o = c)), u && u !== c) ) return void n.setEdge(u, c); c = r; } }); }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(19), i = e(375).positionX; t.exports = function (t) { (function (t) { var n = o.buildLayerMatrix(t), e = t.graph().ranksep, i = 0; r.forEach(n, function (n) { var o = r.max( r.map(n, function (n) { return t.node(n).height; }), ); r.forEach(n, function (n) { t.node(n).y = i + o / 2; }), (i += o + e); }); })((t = o.asNonCompoundGraph(t))), r.forEach(i(t), function (n, e) { t.node(e).x = n; }); }; }, function (t, n, e) { "use strict"; var r = e(8), o = e(23).Graph, i = e(19); function u(t, n) { var e = {}; return ( r.reduce(n, function (n, o) { var i = 0, u = 0, c = n.length, f = r.last(o); return ( r.forEach(o, function (n, s) { var p = (function (t, n) { if (t.node(n).dummy) return r.find(t.predecessors(n), function (n) { return t.node(n).dummy; }); })(t, n), d = p ? t.node(p).order : c; (p || n === f) && (r.forEach(o.slice(u, s + 1), function (n) { r.forEach(t.predecessors(n), function (r) { var o = t.node(r), u = o.order; !(u < i || d < u) || (o.dummy && t.node(n).dummy) || a(e, r, n); }); }), (u = s + 1), (i = d)); }), o ); }), e ); } function c(t, n) { var e = {}; function o(n, o, i, u, c) { var f; r.forEach(r.range(o, i), function (o) { (f = n[o]), t.node(f).dummy && r.forEach(t.predecessors(f), function (n) { var r = t.node(n); r.dummy && (r.order < u || r.order > c) && a(e, n, f); }); }); } return ( r.reduce(n, function (n, e) { var i, u = -1, c = 0; return ( r.forEach(e, function (r, a) { if ("border" === t.node(r).dummy) { var f = t.predecessors(r); f.length && ((i = t.node(f[0]).order), o(e, c, a, u, i), (c = a), (u = i)); } o(e, c, e.length, i, n.length); }), e ); }), e ); } function a(t, n, e) { if (n > e) { var r = n; (n = e), (e = r); } var o = t[n]; o || (t[n] = o = {}), (o[e] = !0); } function f(t, n, e) { if (n > e) { var o = n; (n = e), (e = o); } return r.has(t[n], e); } function s(t, n, e, o) { var i = {}, u = {}, c = {}; return ( r.forEach(n, function (t) { r.forEach(t, function (t, n) { (i[t] = t), (u[t] = t), (c[t] = n); }); }), r.forEach(n, function (t) { var n = -1; r.forEach(t, function (t) { var a = o(t); if (a.length) for ( var s = ((a = r.sortBy(a, function (t) { return c[t]; })).length - 1) / 2, p = Math.floor(s), d = Math.ceil(s); p <= d; ++p ) { var h = a[p]; u[t] === t && n < c[h] && !f(e, t, h) && ((u[h] = t), (u[t] = i[t] = i[h]), (n = c[h])); } }); }), { root: i, align: u } ); } function p(t, n, e, i, u) { var c = {}, a = (function (t, n, e, i) { var u = new o(), c = t.graph(), a = (function (t, n, e) { return function (o, i, u) { var c, a = o.node(i), f = o.node(u), s = 0; if (((s += a.width / 2), r.has(a, "labelpos"))) switch (a.labelpos.toLowerCase()) { case "l": c = -a.width / 2; break; case "r": c = a.width / 2; } if ( (c && (s += e ? c : -c), (c = 0), (s += (a.dummy ? n : t) / 2), (s += (f.dummy ? n : t) / 2), (s += f.width / 2), r.has(f, "labelpos")) ) switch (f.labelpos.toLowerCase()) { case "l": c = f.width / 2; break; case "r": c = -f.width / 2; } return c && (s += e ? c : -c), (c = 0), s; }; })(c.nodesep, c.edgesep, i); return ( r.forEach(n, function (n) { var o; r.forEach(n, function (n) { var r = e[n]; if ((u.setNode(r), o)) { var i = e[o], c = u.edge(i, r); u.setEdge(i, r, Math.max(a(t, n, o), c || 0)); } o = n; }); }), u ); })(t, n, e, u), f = u ? "borderLeft" : "borderRight"; function s(t, n) { for (var e = a.nodes(), r = e.pop(), o = {}; r; ) o[r] ? t(r) : ((o[r] = !0), e.push(r), (e = e.concat(n(r)))), (r = e.pop()); } return ( s(function (t) { c[t] = a.inEdges(t).reduce(function (t, n) { return Math.max(t, c[n.v] + a.edge(n)); }, 0); }, a.predecessors.bind(a)), s(function (n) { var e = a.outEdges(n).reduce(function (t, n) { return Math.min(t, c[n.w] - a.edge(n)); }, Number.POSITIVE_INFINITY), r = t.node(n); e !== Number.POSITIVE_INFINITY && r.borderType !== f && (c[n] = Math.max(c[n], e)); }, a.successors.bind(a)), r.forEach(i, function (t) { c[t] = c[e[t]]; }), c ); } function d(t, n) { return r.minBy(r.values(n), function (n) { var e = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY; return ( r.forIn(n, function (n, r) { var i = (function (t, n) { return t.node(n).width; })(t, r) / 2; (e = Math.max(n + i, e)), (o = Math.min(n - i, o)); }), e - o ); }); } function h(t, n) { var e = r.values(n), o = r.min(e), i = r.max(e); r.forEach(["u", "d"], function (e) { r.forEach(["l", "r"], function (u) { var c, a = e + u, f = t[a]; if (f !== n) { var s = r.values(f); (c = "l" === u ? o - r.min(s) : i - r.max(s)) && (t[a] = r.mapValues(f, function (t) { return t + c; })); } }); }); } function l(t, n) { return r.mapValues(t.ul, function (e, o) { if (n) return t[n.toLowerCase()][o]; var i = r.sortBy(r.map(t, o)); return (i[1] + i[2]) / 2; }); } t.exports = { positionX: function (t) { var n, e = i.buildLayerMatrix(t), o = r.merge(u(t, e), c(t, e)), a = {}; r.forEach(["u", "d"], function (i) { (n = "u" === i ? e : r.values(e).reverse()), r.forEach(["l", "r"], function (e) { "r" === e && (n = r.map(n, function (t) { return r.values(t).reverse(); })); var u = ("u" === i ? t.predecessors : t.successors).bind(t), c = s(t, n, o, u), f = p(t, n, c.root, c.align, "r" === e); "r" === e && (f = r.mapValues(f, function (t) { return -t; })), (a[i + e] = f); }); }); var f = d(t, a); return h(a, f), l(a, t.graph().align); }, findType1Conflicts: u, findType2Conflicts: c, addConflict: a, hasConflict: f, verticalAlignment: s, horizontalCompaction: p, alignCoordinates: h, findSmallestWidthAlignment: d, balance: l, }; }, function (t, n, e) { var r = e(8), o = e(19), i = e(23).Graph; t.exports = { debugOrdering: function (t) { var n = o.buildLayerMatrix(t), e = new i({ compound: !0, multigraph: !0 }).setGraph({}); return ( r.forEach(t.nodes(), function (n) { e.setNode(n, { label: n }), e.setParent(n, "layer" + t.node(n).rank); }), r.forEach(t.edges(), function (t) { e.setEdge(t.v, t.w, {}, t.name); }), r.forEach(n, function (t, n) { var o = "layer" + n; e.setNode(o, { rank: "same" }), r.reduce(t, function (t, n) { return e.setEdge(t, n, { style: "invis" }), n; }); }), e ); }, }; }, function (t, n) { t.exports = "0.8.5"; }, ]).default; }); //# sourceMappingURL=dagreLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/forceAtlas2Layout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.ForceAtlas2Layout = e()) : (t.ForceAtlas2Layout = e()); })(this, function () { return (function (t) { var e = {}; function r(i) { if (e[i]) return e[i].exports; var n = (e[i] = { i: i, l: !1, exports: {} }); return t[i].call(n.exports, n, n.exports, r), (n.l = !0), n.exports; } return ( (r.m = t), (r.c = e), (r.d = function (t, e, i) { r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, e) { if ((1 & e && (t = r(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var i = Object.create(null); if ( (r.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var n in t) r.d( i, n, function (e) { return t[e]; }.bind(null, n), ); return i; }), (r.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(e, "a", e), e; }), (r.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (r.p = ""), r((r.s = 378)) ); })({ 10: function (t, e, r) { "use strict"; var i = (this && this.__createBinding) || (Object.create ? function (t, e, r, i) { void 0 === i && (i = r), Object.defineProperty(t, i, { enumerable: !0, get: function () { return e[r]; }, }); } : function (t, e, r, i) { void 0 === i && (i = r), (t[i] = e[r]); }), n = (this && this.__exportStar) || function (t, e) { for (var r in t) "default" === r || Object.prototype.hasOwnProperty.call(e, r) || i(e, t, r); }; Object.defineProperty(e, "__esModule", { value: !0 }), n(r(11), e), n(r(12), e), n(r(13), e), n(r(14), e), n(r(15), e), n(r(16), e); }, 11: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var i, n, o = /-(\w)/g; e.camelize = ((i = function (t) { return t.replace(o, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = i(t)); }); }, 12: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var r = parseFloat(t); return e.isNaN(r) ? t : r; }; }, 14: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, r) { for (var i = [], n = 0; n < t; n++) i[n] = 0; return r ? (r.forEach(function (t) { t.source && (i[e[t.source]] += 1), t.target && (i[e[t.target]] += 1); }), i) : i; }; e.floydWarshall = function (t) { for (var e = [], r = t.length, i = 0; i < r; i += 1) { e[i] = []; for (var n = 0; n < r; n += 1) i === n ? (e[i][n] = 0) : 0 !== t[i][n] && t[i][n] ? (e[i][n] = t[i][n]) : (e[i][n] = 1 / 0); } for (var o = 0; o < r; o += 1) for (i = 0; i < r; i += 1) for (n = 0; n < r; n += 1) e[i][n] > e[i][o] + e[o][n] && (e[i][n] = e[i][o] + e[o][n]); return e; }; e.getAdjMatrix = function (t, e) { var r = t.nodes, i = t.edges, n = [], o = {}; if (!r) throw new Error("invalid nodes data!"); return ( r && r.forEach(function (t, e) { o[t.id] = e; n.push([]); }), i && i.forEach(function (t) { var r = t.source, i = t.target, s = o[r], u = o[i]; (n[s][u] = 1), e || (n[u][s] = 1); }), n ); }; e.scaleMatrix = function (t, e) { var r = []; return ( t.forEach(function (t) { var i = []; t.forEach(function (t) { i.push(t * e); }), r.push(i); }), r ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, r) { if (e && e.children) for (var i = e.children.length - 1; i >= 0; i--) if (!t(e.children[i], r)) return; return !!r(e); })(t, e); }; }, 15: function (t, e, r) { "use strict"; function i(t) { return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var e, r = 1, i = arguments.length; r < i; r++) for (var n in (e = arguments[r])) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === i(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var r = []; return ( t.forEach(function (t) { r.push(t); }), r.map(function (t) { return e.clone(t); }) ); } if ("object" === i(t) && t !== {}) { var o = n({}, t); return ( Object.keys(o).forEach(function (t) { o[t] = e.clone(o[t]); }), o ); } return t; }; }, 16: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 162: function (t, e, r) { "use strict"; var i, n = (this && this.__extends) || ((i = function (t, e) { return (i = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function r() { this.constructor = t; } i(t, e), (t.prototype = null === e ? Object.create(e) : ((r.prototype = e.prototype), new r())); }), o = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.ForceAtlas2Layout = void 0); var s = r(9), u = r(10), h = o(r(379)), a = o(r(380)), c = o(r(381)), d = (function (t) { function e(e) { var r = t.call(this) || this; return ( (r.center = [0, 0]), (r.width = 300), (r.height = 300), (r.nodes = []), (r.edges = []), (r.kr = 5), (r.kg = 1), (r.mode = "normal"), (r.preventOverlap = !1), (r.dissuadeHubs = !1), (r.barnesHut = !1), (r.maxIteration = 0), (r.ks = 0.1), (r.ksmax = 10), (r.tao = 0.1), (r.onLayoutEnd = function () {}), (r.prune = !1), r.updateCfg(e), r ); } return ( n(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.execute = function () { var t = this.nodes, e = this.maxIteration, r = this.onLayoutEnd, i = this.prune; this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight); for (var n = [], o = t.length, s = 0; s < o; s += 1) { var h = t[s], a = 10, c = 10; u.isNumber(h.size) && ((a = h.size), (c = h.size)), u.isArray(h.size) && (isNaN(h.size[0]) || (a = h.size[0]), isNaN(h.size[1]) || (c = h.size[1])), this.getWidth && !isNaN(this.getWidth(h)) && (c = this.getWidth(h)), this.getHeight && !isNaN(this.getHeight(h)) && (a = this.getHeight(h)); var d = Math.max(a, c); n.push(d); } !this.barnesHut && o > 250 && (this.barnesHut = !0), !this.prune && o > 100 && (this.prune = !0), 0 !== this.maxIteration || this.prune ? 0 === this.maxIteration && i && ((e = 100), o <= 200 && o > 100 ? (e = 500) : o > 200 && (e = 950), (this.maxIteration = e)) : ((e = 250), o <= 200 && o > 100 ? (e = 1e3) : o > 200 && (e = 1200), (this.maxIteration = e)), this.kr || ((this.kr = 50), o > 100 && o <= 500 ? (this.kr = 20) : o > 500 && (this.kr = 1)), this.kg || ((this.kg = 20), o > 100 && o <= 500 ? (this.kg = 10) : o > 500 && (this.kg = 1)), (this.nodes = this.updateNodesByForces(n)), r(); }), (e.prototype.updateNodesByForces = function (t) { for ( var e = this.nodes, r = this.edges, i = this.maxIteration, n = r.filter(function (t) { return t.source !== t.target; }), o = e.length, s = n.length, u = [], h = {}, a = {}, c = [], d = 0; d < o; d += 1 ) (h[e[d].id] = d), (u[d] = 0), (void 0 === e[d].x || isNaN(e[d].x)) && (e[d].x = 1e3 * Math.random()), (void 0 === e[d].y || isNaN(e[d].y)) && (e[d].y = 1e3 * Math.random()), c.push({ x: e[d].x, y: e[d].y }); for (d = 0; d < s; d += 1) { for ( var f = void 0, p = void 0, l = 0, y = 0, g = 0; g < o; g += 1 ) e[g].id === n[d].source ? ((f = e[g]), (l = g)) : e[g].id === n[d].target && ((p = e[g]), (y = g)), (a[d] = { sourceIdx: l, targetIdx: y }); f && (u[h[f.id]] += 1), p && (u[h[p.id]] += 1); } var v = i; if (((e = this.iterate(v, h, a, s, u, t)), this.prune)) { for (g = 0; g < s; g += 1) u[a[g].sourceIdx] <= 1 ? ((e[a[g].sourceIdx].x = e[a[g].targetIdx].x), (e[a[g].sourceIdx].y = e[a[g].targetIdx].y)) : u[a[g].targetIdx] <= 1 && ((e[a[g].targetIdx].x = e[a[g].sourceIdx].x), (e[a[g].targetIdx].y = e[a[g].sourceIdx].y)); (this.prune = !1), (this.barnesHut = !1), (v = 100), (e = this.iterate(v, h, a, s, u, t)); } return e; }), (e.prototype.iterate = function (t, e, r, i, n, o) { for ( var s = this.nodes, u = this.kr, a = this.preventOverlap, c = this.barnesHut, d = s.length, f = 0, p = t, l = [], y = [], g = [], v = 0; v < d; v += 1 ) if (((l[2 * v] = 0), (l[2 * v + 1] = 0), c)) { var x = { id: v, rx: s[v].x, ry: s[v].y, mass: 1, g: u, degree: n[v], }; g[v] = new h.default(x); } for (; p > 0; ) { for (v = 0; v < d; v += 1) (y[2 * v] = l[2 * v]), (y[2 * v + 1] = l[2 * v + 1]), (l[2 * v] = 0), (l[2 * v + 1] = 0); (l = this.getAttrForces(p, 50, i, e, r, n, o, l)), (l = c && ((a && p > 50) || !a) ? this.getOptRepGraForces(l, g, n) : this.getRepGraForces(p, 50, l, 100, o, n)); var m = this.updatePos(l, y, f, n); (s = m.nodes), (f = m.sg), p--, this.tick && this.tick(); } return s; }), (e.prototype.getAttrForces = function (t, e, r, i, n, o, s, u) { for ( var h = this.nodes, a = this.preventOverlap, c = this.dissuadeHubs, d = this.mode, f = this.prune, p = 0; p < r; p += 1 ) { var l = h[n[p].sourceIdx], y = n[p].sourceIdx, g = h[n[p].targetIdx], v = n[p].targetIdx; if (!f || !(o[y] <= 1 || o[v] <= 1)) { var x = [g.x - l.x, g.y - l.y], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m), a && t < e && (m = m - s[y] - s[v]); var b = m, _ = b; "linlog" === d && (_ = b = Math.log(1 + m)), c && ((b = m / o[y]), (_ = m / o[v])), a && t < e && m <= 0 ? ((b = 0), (_ = 0)) : a && t < e && m > 0 && ((b = m), (_ = m)), (u[2 * i[l.id]] += b * x[0]), (u[2 * i[g.id]] -= _ * x[0]), (u[2 * i[l.id] + 1] += b * x[1]), (u[2 * i[g.id] + 1] -= _ * x[1]); } } return u; }), (e.prototype.getRepGraForces = function (t, e, r, i, n, o) { for ( var s = this.nodes, u = this.preventOverlap, h = this.kr, a = this.kg, c = this.center, d = this.prune, f = s.length, p = 0; p < f; p += 1 ) { for (var l = p + 1; l < f; l += 1) if (!d || !(o[p] <= 1 || o[l] <= 1)) { var y = [s[l].x - s[p].x, s[l].y - s[p].y], g = Math.hypot(y[0], y[1]); (g = g < 1e-4 ? 1e-4 : g), (y[0] = y[0] / g), (y[1] = y[1] / g), u && t < e && (g = g - n[p] - n[l]); var v = (h * (o[p] + 1) * (o[l] + 1)) / g; u && t < e && g < 0 ? (v = i * (o[p] + 1) * (o[l] + 1)) : u && t < e && 0 === g ? (v = 0) : u && t < e && g > 0 && (v = (h * (o[p] + 1) * (o[l] + 1)) / g), (r[2 * p] -= v * y[0]), (r[2 * l] += v * y[0]), (r[2 * p + 1] -= v * y[1]), (r[2 * l + 1] += v * y[1]); } var x = [s[p].x - c[0], s[p].y - c[1]], m = Math.hypot(x[0], x[1]); (x[0] = x[0] / m), (x[1] = x[1] / m); var b = a * (o[p] + 1); (r[2 * p] -= b * x[0]), (r[2 * p + 1] -= b * x[1]); } return r; }), (e.prototype.getOptRepGraForces = function (t, e, r) { for ( var i = this.nodes, n = this.kg, o = this.center, s = this.prune, u = i.length, h = 9e10, d = -9e10, f = 9e10, p = -9e10, l = 0; l < u; l += 1 ) (s && r[l] <= 1) || (e[l].setPos(i[l].x, i[l].y), i[l].x >= d && (d = i[l].x), i[l].x <= h && (h = i[l].x), i[l].y >= p && (p = i[l].y), i[l].y <= f && (f = i[l].y)); var y = { xmid: (d + h) / 2, ymid: (p + f) / 2, length: Math.max(d - h, p - f), massCenter: o, mass: u, }, g = new a.default(y), v = new c.default(g); for (l = 0; l < u; l += 1) (s && r[l] <= 1) || (e[l].in(g) && v.insert(e[l])); for (l = 0; l < u; l += 1) if (!(s && r[l] <= 1)) { e[l].resetForce(), v.updateForce(e[l]), (t[2 * l] -= e[l].fx), (t[2 * l + 1] -= e[l].fy); var x = [i[l].x - o[0], i[l].y - o[1]], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m); var b = n * (r[l] + 1); (t[2 * l] -= b * x[0]), (t[2 * l + 1] -= b * x[1]); } return t; }), (e.prototype.updatePos = function (t, e, r, i) { for ( var n = this.nodes, o = this.ks, s = this.tao, u = this.prune, h = this.ksmax, a = n.length, c = [], d = [], f = 0, p = 0, l = 0; l < a; l += 1 ) if (!(u && i[l] <= 1)) { var y = [t[2 * l] - e[2 * l], t[2 * l + 1] - e[2 * l + 1]], g = Math.hypot(y[0], y[1]), v = [t[2 * l] + e[2 * l], t[2 * l + 1] + e[2 * l + 1]], x = Math.hypot(v[0], v[1]); (c[l] = g), (d[l] = x / 2), (f += (i[l] + 1) * c[l]), (p += (i[l] + 1) * d[l]); } var m = r; (r = (s * p) / f), 0 !== m && (r = r > 1.5 * m ? 1.5 * m : r); for (l = 0; l < a; l += 1) if (!(u && i[l] <= 1)) { var b = (o * r) / (1 + r * Math.sqrt(c[l])), _ = Math.hypot(t[2 * l], t[2 * l + 1]), N = h / (_ = _ < 1e-4 ? 1e-4 : _), O = (b = b > N ? N : b) * t[2 * l], j = b * t[2 * l + 1]; (n[l].x += O), (n[l].y += j); } return { nodes: n, sg: r }; }), e ); })(s.Base); e.ForceAtlas2Layout = d; }, 378: function (t, e, r) { "use strict"; r.r(e); var i = r(162); e.default = i.ForceAtlas2Layout; }, 379: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var i = (function () { function t(t) { (this.id = t.id || 0), (this.rx = t.rx), (this.ry = t.ry), (this.fx = 0), (this.fy = 0), (this.mass = t.mass), (this.degree = t.degree), (this.g = t.g || 0); } return ( (t.prototype.distanceTo = function (t) { var e = this.rx - t.rx, r = this.ry - t.ry; return Math.hypot(e, r); }), (t.prototype.setPos = function (t, e) { (this.rx = t), (this.ry = e); }), (t.prototype.resetForce = function () { (this.fx = 0), (this.fy = 0); }), (t.prototype.addForce = function (t) { var e = t.rx - this.rx, r = t.ry - this.ry, i = Math.hypot(e, r); i = i < 1e-4 ? 1e-4 : i; var n = (this.g * (this.degree + 1) * (t.degree + 1)) / i; (this.fx += (n * e) / i), (this.fy += (n * r) / i); }), (t.prototype.in = function (t) { return t.contains(this.rx, this.ry); }), (t.prototype.add = function (e) { var r = this.mass + e.mass; return new t({ rx: (this.rx * this.mass + e.rx * e.mass) / r, ry: (this.ry * this.mass + e.ry * e.mass) / r, mass: r, degree: this.degree + e.degree, }); }), t ); })(); e.default = i; }, 380: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var i = (function () { function t(t) { (this.xmid = t.xmid), (this.ymid = t.ymid), (this.length = t.length), (this.massCenter = t.massCenter || [0, 0]), (this.mass = t.mass || 1); } return ( (t.prototype.getLength = function () { return this.length; }), (t.prototype.contains = function (t, e) { var r = this.length / 2; return ( t <= this.xmid + r && t >= this.xmid - r && e <= this.ymid + r && e >= this.ymid - r ); }), (t.prototype.NW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.NE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.SW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), (t.prototype.SE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), t ); })(); e.default = i; }, 381: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var i = (function () { function t(t) { (this.body = null), (this.quad = null), (this.NW = null), (this.NE = null), (this.SW = null), (this.SE = null), (this.theta = 0.5), null != t && (this.quad = t); } return ( (t.prototype.insert = function (e) { null != this.body ? this._isExternal() ? (this.quad && ((this.NW = new t(this.quad.NW())), (this.NE = new t(this.quad.NE())), (this.SW = new t(this.quad.SW())), (this.SE = new t(this.quad.SE()))), this._putBody(this.body), this._putBody(e), (this.body = this.body.add(e))) : ((this.body = this.body.add(e)), this._putBody(e)) : (this.body = e); }), (t.prototype._putBody = function (t) { this.quad && (t.in(this.quad.NW()) && this.NW ? this.NW.insert(t) : t.in(this.quad.NE()) && this.NE ? this.NE.insert(t) : t.in(this.quad.SW()) && this.SW ? this.SW.insert(t) : t.in(this.quad.SE()) && this.SE && this.SE.insert(t)); }), (t.prototype._isExternal = function () { return ( null == this.NW && null == this.NE && null == this.SW && null == this.SE ); }), (t.prototype.updateForce = function (t) { null != this.body && t !== this.body && (this._isExternal() || (this.quad ? this.quad.getLength() : 0) / this.body.distanceTo(t) < this.theta ? t.addForce(this.body) : (this.NW && this.NW.updateForce(t), this.NE && this.NE.updateForce(t), this.SW && this.SW.updateForce(t), this.SE && this.SE.updateForce(t))); }), t ); })(); e.default = i; }, 9: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var i = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = i; }, }).default; }); //# sourceMappingURL=forceAtlas2Layout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/forceLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.ForceLayout = n()) : (t.ForceLayout = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 382)) ); })({ 10: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, 11: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, 13: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, 14: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, 15: function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, 156: function (t, n, e) { "use strict"; e.r(n), e.d(n, "forceCenter", function () { return r; }), e.d(n, "forceCollide", function () { return v; }), e.d(n, "forceLink", function () { return b; }), e.d(n, "forceManyBody", function () { return V; }), e.d(n, "forceRadial", function () { return Z; }), e.d(n, "forceSimulation", function () { return Q; }), e.d(n, "forceX", function () { return $; }), e.d(n, "forceY", function () { return tt; }); var r = function (t, n) { var e, r = 1; function o() { var o, i, u = e.length, c = 0, f = 0; for (o = 0; o < u; ++o) (c += (i = e[o]).x), (f += i.y); for (c = (c / u - t) * r, f = (f / u - n) * r, o = 0; o < u; ++o) ((i = e[o]).x -= c), (i.y -= f); } return ( null == t && (t = 0), null == n && (n = 0), (o.initialize = function (t) { e = t; }), (o.x = function (n) { return arguments.length ? ((t = +n), o) : t; }), (o.y = function (t) { return arguments.length ? ((n = +t), o) : n; }), (o.strength = function (t) { return arguments.length ? ((r = +t), o) : r; }), o ); }; function o(t, n, e, r) { if (isNaN(n) || isNaN(e)) return t; var o, i, u, c, f, a, l, s, h, d = t._root, y = { data: r }, p = t._x0, v = t._y0, g = t._x1, _ = t._y1; if (!d) return (t._root = y), t; for (; d.length; ) if ( ((a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u), (o = d), !(d = d[(s = (l << 1) | a)])) ) return (o[s] = y), t; if ( ((c = +t._x.call(null, d.data)), (f = +t._y.call(null, d.data)), n === c && e === f) ) return (y.next = d), o ? (o[s] = y) : (t._root = y), t; do { (o = o ? (o[s] = new Array(4)) : (t._root = new Array(4))), (a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u); } while ((s = (l << 1) | a) == (h = ((f >= u) << 1) | (c >= i))); return (o[h] = d), (o[s] = y), t; } var i = function (t, n, e, r, o) { (this.node = t), (this.x0 = n), (this.y0 = e), (this.x1 = r), (this.y1 = o); }; function u(t) { return t[0]; } function c(t) { return t[1]; } function f(t, n, e) { var r = new a(null == n ? u : n, null == e ? c : e, NaN, NaN, NaN, NaN); return null == t ? r : r.addAll(t); } function a(t, n, e, r, o, i) { (this._x = t), (this._y = n), (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), (this._root = void 0); } function l(t) { for (var n = { data: t.data }, e = n; (t = t.next); ) e = e.next = { data: t.data }; return n; } var s = (f.prototype = a.prototype); (s.copy = function () { var t, n, e = new a(this._x, this._y, this._x0, this._y0, this._x1, this._y1), r = this._root; if (!r) return e; if (!r.length) return (e._root = l(r)), e; for ( t = [{ source: r, target: (e._root = new Array(4)) }]; (r = t.pop()); ) for (var o = 0; o < 4; ++o) (n = r.source[o]) && (n.length ? t.push({ source: n, target: (r.target[o] = new Array(4)) }) : (r.target[o] = l(n))); return e; }), (s.add = function (t) { var n = +this._x.call(null, t), e = +this._y.call(null, t); return o(this.cover(n, e), n, e, t); }), (s.addAll = function (t) { var n, e, r, i, u = t.length, c = new Array(u), f = new Array(u), a = 1 / 0, l = 1 / 0, s = -1 / 0, h = -1 / 0; for (e = 0; e < u; ++e) isNaN((r = +this._x.call(null, (n = t[e])))) || isNaN((i = +this._y.call(null, n))) || ((c[e] = r), (f[e] = i), r < a && (a = r), r > s && (s = r), i < l && (l = i), i > h && (h = i)); if (a > s || l > h) return this; for (this.cover(a, l).cover(s, h), e = 0; e < u; ++e) o(this, c[e], f[e], t[e]); return this; }), (s.cover = function (t, n) { if (isNaN((t = +t)) || isNaN((n = +n))) return this; var e = this._x0, r = this._y0, o = this._x1, i = this._y1; if (isNaN(e)) (o = (e = Math.floor(t)) + 1), (i = (r = Math.floor(n)) + 1); else { for ( var u, c, f = o - e || 1, a = this._root; e > t || t >= o || r > n || n >= i; ) switch ( ((c = ((n < r) << 1) | (t < e)), ((u = new Array(4))[c] = a), (a = u), (f *= 2), c) ) { case 0: (o = e + f), (i = r + f); break; case 1: (e = o - f), (i = r + f); break; case 2: (o = e + f), (r = i - f); break; case 3: (e = o - f), (r = i - f); } this._root && this._root.length && (this._root = a); } return ( (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), this ); }), (s.data = function () { var t = []; return ( this.visit(function (n) { if (!n.length) do { t.push(n.data); } while ((n = n.next)); }), t ); }), (s.extent = function (t) { return arguments.length ? this.cover(+t[0][0], +t[0][1]).cover(+t[1][0], +t[1][1]) : isNaN(this._x0) ? void 0 : [ [this._x0, this._y0], [this._x1, this._y1], ]; }), (s.find = function (t, n, e) { var r, o, u, c, f, a, l, s = this._x0, h = this._y0, d = this._x1, y = this._y1, p = [], v = this._root; for ( v && p.push(new i(v, s, h, d, y)), null == e ? (e = 1 / 0) : ((s = t - e), (h = n - e), (d = t + e), (y = n + e), (e *= e)); (a = p.pop()); ) if ( !( !(v = a.node) || (o = a.x0) > d || (u = a.y0) > y || (c = a.x1) < s || (f = a.y1) < h ) ) if (v.length) { var g = (o + c) / 2, _ = (u + f) / 2; p.push( new i(v[3], g, _, c, f), new i(v[2], o, _, g, f), new i(v[1], g, u, c, _), new i(v[0], o, u, g, _), ), (l = ((n >= _) << 1) | (t >= g)) && ((a = p[p.length - 1]), (p[p.length - 1] = p[p.length - 1 - l]), (p[p.length - 1 - l] = a)); } else { var x = t - +this._x.call(null, v.data), b = n - +this._y.call(null, v.data), w = x * x + b * b; if (w < e) { var m = Math.sqrt((e = w)); (s = t - m), (h = n - m), (d = t + m), (y = n + m), (r = v.data); } } return r; }), (s.remove = function (t) { if ( isNaN((i = +this._x.call(null, t))) || isNaN((u = +this._y.call(null, t))) ) return this; var n, e, r, o, i, u, c, f, a, l, s, h, d = this._root, y = this._x0, p = this._y0, v = this._x1, g = this._y1; if (!d) return this; if (d.length) for (;;) { if ( ((a = i >= (c = (y + v) / 2)) ? (y = c) : (v = c), (l = u >= (f = (p + g) / 2)) ? (p = f) : (g = f), (n = d), !(d = d[(s = (l << 1) | a)])) ) return this; if (!d.length) break; (n[(s + 1) & 3] || n[(s + 2) & 3] || n[(s + 3) & 3]) && ((e = n), (h = s)); } for (; d.data !== t; ) if (((r = d), !(d = d.next))) return this; return ( (o = d.next) && delete d.next, r ? (o ? (r.next = o) : delete r.next, this) : n ? (o ? (n[s] = o) : delete n[s], (d = n[0] || n[1] || n[2] || n[3]) && d === (n[3] || n[2] || n[1] || n[0]) && !d.length && (e ? (e[h] = d) : (this._root = d)), this) : ((this._root = o), this) ); }), (s.removeAll = function (t) { for (var n = 0, e = t.length; n < e; ++n) this.remove(t[n]); return this; }), (s.root = function () { return this._root; }), (s.size = function () { var t = 0; return ( this.visit(function (n) { if (!n.length) do { ++t; } while ((n = n.next)); }), t ); }), (s.visit = function (t) { var n, e, r, o, u, c, f = [], a = this._root; for ( a && f.push(new i(a, this._x0, this._y0, this._x1, this._y1)); (n = f.pop()); ) if ( !t( (a = n.node), (r = n.x0), (o = n.y0), (u = n.x1), (c = n.y1), ) && a.length ) { var l = (r + u) / 2, s = (o + c) / 2; (e = a[3]) && f.push(new i(e, l, s, u, c)), (e = a[2]) && f.push(new i(e, r, s, l, c)), (e = a[1]) && f.push(new i(e, l, o, u, s)), (e = a[0]) && f.push(new i(e, r, o, l, s)); } return this; }), (s.visitAfter = function (t) { var n, e = [], r = []; for ( this._root && e.push(new i(this._root, this._x0, this._y0, this._x1, this._y1)); (n = e.pop()); ) { var o = n.node; if (o.length) { var u, c = n.x0, f = n.y0, a = n.x1, l = n.y1, s = (c + a) / 2, h = (f + l) / 2; (u = o[0]) && e.push(new i(u, c, f, s, h)), (u = o[1]) && e.push(new i(u, s, f, a, h)), (u = o[2]) && e.push(new i(u, c, h, s, l)), (u = o[3]) && e.push(new i(u, s, h, a, l)); } r.push(n); } for (; (n = r.pop()); ) t(n.node, n.x0, n.y0, n.x1, n.y1); return this; }), (s.x = function (t) { return arguments.length ? ((this._x = t), this) : this._x; }), (s.y = function (t) { return arguments.length ? ((this._y = t), this) : this._y; }); var h = function (t) { return function () { return t; }; }, d = function (t) { return 1e-6 * (t() - 0.5); }; function y(t) { return t.x + t.vx; } function p(t) { return t.y + t.vy; } var v = function (t) { var n, e, r, o = 1, i = 1; function u() { for (var t, u, a, l, s, h, v, g = n.length, _ = 0; _ < i; ++_) for (u = f(n, y, p).visitAfter(c), t = 0; t < g; ++t) (a = n[t]), (h = e[a.index]), (v = h * h), (l = a.x + a.vx), (s = a.y + a.vy), u.visit(x); function x(t, n, e, i, u) { var c = t.data, f = t.r, y = h + f; if (!c) return n > l + y || i < l - y || e > s + y || u < s - y; if (c.index > a.index) { var p = l - c.x - c.vx, g = s - c.y - c.vy, _ = p * p + g * g; _ < y * y && (0 === p && (_ += (p = d(r)) * p), 0 === g && (_ += (g = d(r)) * g), (_ = ((y - (_ = Math.sqrt(_))) / _) * o), (a.vx += (p *= _) * (y = (f *= f) / (v + f))), (a.vy += (g *= _) * y), (c.vx -= p * (y = 1 - y)), (c.vy -= g * y)); } } } function c(t) { if (t.data) return (t.r = e[t.data.index]); for (var n = (t.r = 0); n < 4; ++n) t[n] && t[n].r > t.r && (t.r = t[n].r); } function a() { if (n) { var r, o, i = n.length; for (e = new Array(i), r = 0; r < i; ++r) (o = n[r]), (e[o.index] = +t(o, r, n)); } } return ( "function" != typeof t && (t = h(null == t ? 1 : +t)), (u.initialize = function (t, e) { (n = t), (r = e), a(); }), (u.iterations = function (t) { return arguments.length ? ((i = +t), u) : i; }), (u.strength = function (t) { return arguments.length ? ((o = +t), u) : o; }), (u.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), a(), u) : t; }), u ); }; function g(t) { return (g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function _(t) { return t.index; } function x(t, n) { var e = t.get(n); if (!e) throw new Error("node not found: " + n); return e; } var b = function (t) { var n, e, r, o, i, u, c = _, f = function (t) { return 1 / Math.min(o[t.source.index], o[t.target.index]); }, a = h(30), l = 1; function s(r) { for (var o = 0, c = t.length; o < l; ++o) for (var f, a, s, h, y, p, v, g = 0; g < c; ++g) (a = (f = t[g]).source), (h = (s = f.target).x + s.vx - a.x - a.vx || d(u)), (y = s.y + s.vy - a.y - a.vy || d(u)), (h *= p = (((p = Math.sqrt(h * h + y * y)) - e[g]) / p) * r * n[g]), (y *= p), (s.vx -= h * (v = i[g])), (s.vy -= y * v), (a.vx += h * (v = 1 - v)), (a.vy += y * v); } function y() { if (r) { var u, f, a = r.length, l = t.length, s = new Map( r.map(function (t, n) { return [c(t, n, r), t]; }), ); for (u = 0, o = new Array(a); u < l; ++u) ((f = t[u]).index = u), "object" !== g(f.source) && (f.source = x(s, f.source)), "object" !== g(f.target) && (f.target = x(s, f.target)), (o[f.source.index] = (o[f.source.index] || 0) + 1), (o[f.target.index] = (o[f.target.index] || 0) + 1); for (u = 0, i = new Array(l); u < l; ++u) (f = t[u]), (i[u] = o[f.source.index] / (o[f.source.index] + o[f.target.index])); (n = new Array(l)), p(), (e = new Array(l)), v(); } } function p() { if (r) for (var e = 0, o = t.length; e < o; ++e) n[e] = +f(t[e], e, t); } function v() { if (r) for (var n = 0, o = t.length; n < o; ++n) e[n] = +a(t[n], n, t); } return ( null == t && (t = []), (s.initialize = function (t, n) { (r = t), (u = n), y(); }), (s.links = function (n) { return arguments.length ? ((t = n), y(), s) : t; }), (s.id = function (t) { return arguments.length ? ((c = t), s) : c; }), (s.iterations = function (t) { return arguments.length ? ((l = +t), s) : l; }), (s.strength = function (t) { return arguments.length ? ((f = "function" == typeof t ? t : h(+t)), p(), s) : f; }), (s.distance = function (t) { return arguments.length ? ((a = "function" == typeof t ? t : h(+t)), v(), s) : a; }), s ); }, w = { value: function () {} }; function m() { for (var t, n = 0, e = arguments.length, r = {}; n < e; ++n) { if (!(t = arguments[n] + "") || t in r || /[\s.]/.test(t)) throw new Error("illegal type: " + t); r[t] = []; } return new S(r); } function S(t) { this._ = t; } function N(t, n) { return t .trim() .split(/^|\s+/) .map(function (t) { var e = "", r = t.indexOf("."); if ( (r >= 0 && ((e = t.slice(r + 1)), (t = t.slice(0, r))), t && !n.hasOwnProperty(t)) ) throw new Error("unknown type: " + t); return { type: t, name: e }; }); } function O(t, n) { for (var e, r = 0, o = t.length; r < o; ++r) if ((e = t[r]).name === n) return e.value; } function k(t, n, e) { for (var r = 0, o = t.length; r < o; ++r) if (t[r].name === n) { (t[r] = w), (t = t.slice(0, r).concat(t.slice(r + 1))); break; } return null != e && t.push({ name: n, value: e }), t; } S.prototype = m.prototype = { constructor: S, on: function (t, n) { var e, r = this._, o = N(t + "", r), i = -1, u = o.length; if (!(arguments.length < 2)) { if (null != n && "function" != typeof n) throw new Error("invalid callback: " + n); for (; ++i < u; ) if ((e = (t = o[i]).type)) r[e] = k(r[e], t.name, n); else if (null == n) for (e in r) r[e] = k(r[e], t.name, null); return this; } for (; ++i < u; ) if ((e = (t = o[i]).type) && (e = O(r[e], t.name))) return e; }, copy: function () { var t = {}, n = this._; for (var e in n) t[e] = n[e].slice(); return new S(t); }, call: function (t, n) { if ((e = arguments.length - 2) > 0) for (var e, r, o = new Array(e), i = 0; i < e; ++i) o[i] = arguments[i + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (i = 0, e = (r = this._[t]).length; i < e; ++i) r[i].value.apply(n, o); }, apply: function (t, n, e) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], o = 0, i = r.length; o < i; ++o) r[o].value.apply(n, e); }, }; var M = m; function j(t) { return (j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var E, A, P = 0, z = 0, D = 0, L = 0, T = 0, F = 0, U = "object" === ("undefined" == typeof performance ? "undefined" : j(performance)) && performance.now ? performance : Date, C = "object" === ("undefined" == typeof window ? "undefined" : j(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function q() { return T || (C(B), (T = U.now() + F)); } function B() { T = 0; } function Y() { this._call = this._time = this._next = null; } function R(t, n, e) { var r = new Y(); return r.restart(t, n, e), r; } function G() { (T = (L = U.now()) + F), (P = z = 0); try { !(function () { q(), ++P; for (var t, n = E; n; ) (t = T - n._time) >= 0 && n._call.call(null, t), (n = n._next); --P; })(); } finally { (P = 0), (function () { var t, n, e = E, r = 1 / 0; for (; e; ) e._call ? (r > e._time && (r = e._time), (t = e), (e = e._next)) : ((n = e._next), (e._next = null), (e = t ? (t._next = n) : (E = n))); (A = t), W(r); })(), (T = 0); } } function I() { var t = U.now(), n = t - L; n > 1e3 && ((F -= n), (L = t)); } function W(t) { P || (z && (z = clearTimeout(z)), t - T > 24 ? (t < 1 / 0 && (z = setTimeout(G, t - U.now() - F)), D && (D = clearInterval(D))) : (D || ((L = U.now()), (D = setInterval(I, 1e3))), (P = 1), C(G))); } Y.prototype = R.prototype = { constructor: Y, restart: function (t, n, e) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (e = (null == e ? q() : +e) + (null == n ? 0 : +n)), this._next || A === this || (A ? (A._next = this) : (E = this), (A = this)), (this._call = t), (this._time = e), W(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), W()); }, }; var X = 4294967296; function K(t) { return t.x; } function H(t) { return t.y; } var J = Math.PI * (3 - Math.sqrt(5)), Q = function (t) { var n, e, r = 1, o = 0.001, i = 1 - Math.pow(o, 1 / 300), u = 0, c = 0.6, f = new Map(), a = R(h), l = M("tick", "end"), s = ((e = 1), function () { return (e = (1664525 * e + 1013904223) % X) / X; }); function h() { d(), l.call("tick", n), r < o && (a.stop(), l.call("end", n)); } function d(e) { var o, a, l = t.length; void 0 === e && (e = 1); for (var s = 0; s < e; ++s) for ( r += (u - r) * i, f.forEach(function (t) { t(r); }), o = 0; o < l; ++o ) null == (a = t[o]).fx ? (a.x += a.vx *= c) : ((a.x = a.fx), (a.vx = 0)), null == a.fy ? (a.y += a.vy *= c) : ((a.y = a.fy), (a.vy = 0)); return n; } function y() { for (var n, e = 0, r = t.length; e < r; ++e) { if ( (((n = t[e]).index = e), null != n.fx && (n.x = n.fx), null != n.fy && (n.y = n.fy), isNaN(n.x) || isNaN(n.y)) ) { var o = 10 * Math.sqrt(0.5 + e), i = e * J; (n.x = o * Math.cos(i)), (n.y = o * Math.sin(i)); } (isNaN(n.vx) || isNaN(n.vy)) && (n.vx = n.vy = 0); } } function p(n) { return n.initialize && n.initialize(t, s), n; } return ( null == t && (t = []), y(), (n = { tick: d, restart: function () { return a.restart(h), n; }, stop: function () { return a.stop(), n; }, nodes: function (e) { return arguments.length ? ((t = e), y(), f.forEach(p), n) : t; }, alpha: function (t) { return arguments.length ? ((r = +t), n) : r; }, alphaMin: function (t) { return arguments.length ? ((o = +t), n) : o; }, alphaDecay: function (t) { return arguments.length ? ((i = +t), n) : +i; }, alphaTarget: function (t) { return arguments.length ? ((u = +t), n) : u; }, velocityDecay: function (t) { return arguments.length ? ((c = 1 - t), n) : 1 - c; }, randomSource: function (t) { return arguments.length ? ((s = t), f.forEach(p), n) : s; }, force: function (t, e) { return arguments.length > 1 ? (null == e ? f.delete(t) : f.set(t, p(e)), n) : f.get(t); }, find: function (n, e, r) { var o, i, u, c, f, a = 0, l = t.length; for (null == r ? (r = 1 / 0) : (r *= r), a = 0; a < l; ++a) (u = (o = n - (c = t[a]).x) * o + (i = e - c.y) * i) < r && ((f = c), (r = u)); return f; }, on: function (t, e) { return arguments.length > 1 ? (l.on(t, e), n) : l.on(t); }, }) ); }, V = function () { var t, n, e, r, o, i = h(-30), u = 1, c = 1 / 0, a = 0.81; function l(e) { var o, i = t.length, u = f(t, K, H).visitAfter(y); for (r = e, o = 0; o < i; ++o) (n = t[o]), u.visit(p); } function s() { if (t) { var n, e, r = t.length; for (o = new Array(r), n = 0; n < r; ++n) (e = t[n]), (o[e.index] = +i(e, n, t)); } } function y(t) { var n, e, r, i, u, c = 0, f = 0; if (t.length) { for (r = i = u = 0; u < 4; ++u) (n = t[u]) && (e = Math.abs(n.value)) && ((c += n.value), (f += e), (r += e * n.x), (i += e * n.y)); (t.x = r / f), (t.y = i / f); } else { ((n = t).x = n.data.x), (n.y = n.data.y); do { c += o[n.data.index]; } while ((n = n.next)); } t.value = c; } function p(t, i, f, l) { if (!t.value) return !0; var s = t.x - n.x, h = t.y - n.y, y = l - i, p = s * s + h * h; if ((y * y) / a < p) return ( p < c && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p)), (n.vx += (s * t.value * r) / p), (n.vy += (h * t.value * r) / p)), !0 ); if (!(t.length || p >= c)) { (t.data !== n || t.next) && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p))); do { t.data !== n && ((y = (o[t.data.index] * r) / p), (n.vx += s * y), (n.vy += h * y)); } while ((t = t.next)); } } return ( (l.initialize = function (n, r) { (t = n), (e = r), s(); }), (l.strength = function (t) { return arguments.length ? ((i = "function" == typeof t ? t : h(+t)), s(), l) : i; }), (l.distanceMin = function (t) { return arguments.length ? ((u = t * t), l) : Math.sqrt(u); }), (l.distanceMax = function (t) { return arguments.length ? ((c = t * t), l) : Math.sqrt(c); }), (l.theta = function (t) { return arguments.length ? ((a = t * t), l) : Math.sqrt(a); }), l ); }, Z = function (t, n, e) { var r, o, i, u = h(0.1); function c(t) { for (var u = 0, c = r.length; u < c; ++u) { var f = r[u], a = f.x - n || 1e-6, l = f.y - e || 1e-6, s = Math.sqrt(a * a + l * l), h = ((i[u] - s) * o[u] * t) / s; (f.vx += a * h), (f.vy += l * h); } } function f() { if (r) { var n, e = r.length; for (o = new Array(e), i = new Array(e), n = 0; n < e; ++n) (i[n] = +t(r[n], n, r)), (o[n] = isNaN(i[n]) ? 0 : +u(r[n], n, r)); } } return ( "function" != typeof t && (t = h(+t)), null == n && (n = 0), null == e && (e = 0), (c.initialize = function (t) { (r = t), f(); }), (c.strength = function (t) { return arguments.length ? ((u = "function" == typeof t ? t : h(+t)), f(), c) : u; }), (c.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), f(), c) : t; }), (c.x = function (t) { return arguments.length ? ((n = +t), c) : n; }), (c.y = function (t) { return arguments.length ? ((e = +t), c) : e; }), c ); }, $ = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vx += (r[i] - o.x) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.x = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }, tt = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vy += (r[i] - o.y) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.y = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }; }, 16: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, 163: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(383), n); }, 382: function (t, n, e) { "use strict"; e.r(n); var r = e(163); n.default = r.ForceLayout; }, 383: function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), u = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), c = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && i(n, t, e); return u(n, t), n; }, f = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.ForceLayout = void 0); var a = c(e(156)), l = f(e(384)), s = e(10), h = e(9), d = e(385), y = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.nodeStrength = null), (e.edgeStrength = null), (e.preventOverlap = !1), (e.clusterNodeStrength = null), (e.clusterEdgeStrength = null), (e.clusterEdgeDistance = null), (e.clusterNodeSize = null), (e.clusterFociStrength = null), (e.linkDistance = 50), (e.alphaDecay = 0.028), (e.alphaMin = 0.001), (e.alpha = 0.3), (e.collideStrength = 1), (e.workerEnabled = !1), (e.tick = function () {}), (e.onLayoutEnd = function () {}), (e.ticking = void 0), n && e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { center: [0, 0], nodeStrength: null, edgeStrength: null, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, linkDistance: 50, forceSimulation: null, alphaDecay: 0.028, alphaMin: 0.001, alpha: 0.3, collideStrength: 1, clustering: !1, clusterNodeStrength: -1, clusterEdgeStrength: 0.1, clusterEdgeDistance: 100, clusterFociStrength: 0.8, clusterNodeSize: 10, tick: function () {}, onLayoutEnd: function () {}, workerEnabled: !1, }; }), (n.prototype.init = function (t) { this.nodes = t.nodes || []; var n = t.edges || []; (this.edges = n.map(function (t) { var n = {}, e = ["targetNode", "sourceNode", "startPoint", "endPoint"]; return ( Object.keys(t).forEach(function (r) { e.indexOf(r) > -1 || (n[r] = t[r]); }), n ); })), (this.ticking = !1); }), (n.prototype.execute = function (t) { var n = this, e = n.nodes, r = n.edges; if (!n.ticking) { var o = n.forceSimulation, i = n.alphaMin, u = n.alphaDecay, c = n.alpha; if (o) { if (t) if ( (n.clustering && n.clusterForce && (n.clusterForce.nodes(e), n.clusterForce.links(r)), o.nodes(e), r && n.edgeForce) ) n.edgeForce.links(r); else if (r && !n.edgeForce) { h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } n.preventOverlap && n.overlapProcess(o), o.alpha(c).restart(), (this.ticking = !0); } else try { var f = a.forceManyBody(); if ( (n.nodeStrength && f.strength(n.nodeStrength), (o = a.forceSimulation().nodes(e)), n.clustering) ) { var s = l.default(); s .centerX(n.center[0]) .centerY(n.center[1]) .template("force") .strength(n.clusterFociStrength), r && s.links(r), e && s.nodes(e), s .forceLinkDistance(n.clusterEdgeDistance) .forceLinkStrength(n.clusterEdgeStrength) .forceCharge(n.clusterNodeStrength) .forceNodeSize(n.clusterNodeSize), (n.clusterForce = s), o.force("group", s); } if ( (o .force( "center", a.forceCenter(n.center[0], n.center[1]), ) .force("charge", f) .alpha(c) .alphaDecay(u) .alphaMin(i), n.preventOverlap && n.overlapProcess(o), r) ) { var h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } if ( (n.workerEnabled && !p() && ((n.workerEnabled = !1), console.warn( "workerEnabled option is only supported when running in web worker.", )), n.workerEnabled) ) { o.stop(); for ( var y = (function (t) { var n = t.alphaMin(), e = t.alphaTarget(), r = t.alpha(), o = Math.log((n - e) / (r - e)) / Math.log(1 - t.alphaDecay()); return Math.ceil(o); })(o), v = 1; v <= y; v++ ) o.tick(), postMessage( { nodes: e, currentTick: v, totalTicks: y, type: d.LAYOUT_MESSAGE.TICK, }, void 0, ); n.ticking = !1; } else o .on("tick", function () { n.tick(); }) .on("end", function () { (n.ticking = !1), n.onLayoutEnd && n.onLayoutEnd(); }), (n.ticking = !0); (n.forceSimulation = o), (n.ticking = !0); } catch (t) { (n.ticking = !1), console.warn(t); } } }), (n.prototype.overlapProcess = function (t) { var n, e, r = this.nodeSize, o = this.nodeSpacing, i = this.collideStrength; if ( ((e = s.isNumber(o) ? function () { return o; } : s.isFunction(o) ? o : function () { return 0; }), r) ) if (s.isFunction(r)) n = function (t) { return r(t) + e(t); }; else if (s.isArray(r)) { var u = (r[0] > r[1] ? r[0] : r[1]) / 2; n = function (t) { return u + e(t); }; } else if (s.isNumber(r)) { var c = r / 2; n = function (t) { return c + e(t); }; } else n = function () { return 10; }; else n = function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) / 2 + e(t) : t.size / 2 + e(t) : 10 + e(t); }; t.force("collisionForce", a.forceCollide(n).strength(i)); }), (n.prototype.updateCfg = function (t) { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.forceSimulation = null), Object.assign(this, t); }), (n.prototype.destroy = function () { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), n ); })(h.Base); function p() { return ( "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope ); } n.ForceLayout = y; }, 384: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), i = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && r(n, t, e); return o(n, t), n; }; Object.defineProperty(n, "__esModule", { value: !0 }); var u = i(e(156)); n.default = function () { function t(t) { return function () { return t; }; } var n, e = function (t) { return t.cluster; }, r = t(1), o = t(-1), i = t(100), c = t(0.1), f = [0, 0], a = [], l = {}, s = [], h = 100, d = 100, y = { none: { x: 0, y: 0 } }, p = [], v = "force", g = !0, _ = 0.1; function x(t) { if (!g) return x; n.tick(), w(); for (var r = 0, o = a.length, i = void 0, u = t * _; r < o; ++r) ((i = a[r]).vx += (y[e(i)].x - i.x) * u), (i.vy += (y[e(i)].y - i.y) * u); } function b() { a && (function () { if (!a || !a.length) return; if (void 0 === e(a[0])) throw Error( "Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()", ); var t = ((y = []), (v = []), (g = {}), (_ = []), (f = (function (t) { var n = {}; return ( t.forEach(function (t) { var r = e(t); n[r] || (n[r] = { count: 0, sumforceNodeSize: 0 }); }), t.forEach(function (t) { var o = e(t), i = r(t), u = n[o]; (u.count = u.count + 1), (u.sumforceNodeSize = u.sumforceNodeSize + Math.PI * (i * i) * 1.3), (n[o] = u); }), n ); })(a)), (_ = (function (t) { var n = {}, r = []; return ( t.forEach(function (t) { var r = (function (t) { var n = e(l[t.source]), r = e(l[t.target]); return n <= r ? n + "~" + r : r + "~" + n; })(t), o = 0; void 0 !== n[r] && (o = n[r]), (o += 1), (n[r] = o); }), Object.entries(n).forEach(function (t) { var n = t[0], e = t[1], o = n.split("~")[0], i = n.split("~")[1]; void 0 !== o && void 0 !== i && r.push({ source: o, target: i, count: e }); }), r ); })(s)), Object.keys(f).forEach(function (t, n) { var e = f[t]; y.push({ id: t, size: e.count, r: Math.sqrt(e.sumforceNodeSize / Math.PI), }), (g[t] = n); }), _.forEach(function (t) { var n = g[t.source], e = g[t.target]; void 0 !== n && void 0 !== e && v.push({ source: n, target: e, count: t.count }); }), { nodes: y, links: v }); var f, y, v, g, _; (n = u .forceSimulation(t.nodes) .force("x", u.forceX(h).strength(0.1)) .force("y", u.forceY(d).strength(0.1)) .force( "collide", u .forceCollide(function (t) { return t.r; }) .iterations(4), ) .force("charge", u.forceManyBody().strength(o)) .force( "links", u .forceLink(t.nodes.length ? t.links : []) .distance(i) .strength(c), )), (p = n.nodes()), w(); })(); } function w() { return ( (y = { none: { x: 0, y: 0 } }), p.forEach(function (t) { y[t.id] = { x: t.x - f[0], y: t.y - f[1] }; }), y ); } function m(t) { (l = {}), t.forEach(function (t) { l[t.id] = t; }); } return ( (x.initialize = function (t) { (a = t), b(); }), (x.template = function (t) { return arguments.length ? ((v = t), b(), x) : v; }), (x.groupBy = function (t) { return arguments.length ? "string" == typeof t ? ((e = function (n) { return n[t]; }), x) : ((e = t), x) : e; }), (x.enableGrouping = function (t) { return arguments.length ? ((g = t), x) : g; }), (x.strength = function (t) { return arguments.length ? ((_ = t), x) : _; }), (x.centerX = function (t) { return arguments.length ? ((h = t), x) : h; }), (x.centerY = function (t) { return arguments.length ? ((d = t), x) : d; }), (x.nodes = function (t) { return arguments.length ? (m(t || []), (a = t || []), x) : a; }), (x.links = function (t) { return arguments.length ? ((s = t || []), b(), x) : s; }), (x.forceNodeSize = function (n) { return arguments.length ? ((r = "function" == typeof n ? n : t(+n)), b(), x) : r; }), (x.nodeSize = x.forceNodeSize), (x.forceCharge = function (n) { return arguments.length ? ((o = "function" == typeof n ? n : t(+n)), b(), x) : o; }), (x.forceLinkDistance = function (n) { return arguments.length ? ((i = "function" == typeof n ? n : t(+n)), b(), x) : i; }), (x.forceLinkStrength = function (n) { return arguments.length ? ((c = "function" == typeof n ? n : t(+n)), b(), x) : c; }), (x.offset = function (t) { return arguments.length ? ((f = t), x) : f; }), (x.getFocis = w), x ); }; }, 385: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.LAYOUT_MESSAGE = void 0), (n.LAYOUT_MESSAGE = { RUN: "LAYOUT_RUN", END: "LAYOUT_END", ERROR: "LAYOUT_ERROR", TICK: "LAYOUT_TICK", GPURUN: "GPU_LAYOUT_RUN", GPUEND: "GPU_LAYOUT_END", }); }, 9: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, }).default; }); //# sourceMappingURL=forceLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/fruchtermanLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.FruchtermanLayout = e()) : (t.FruchtermanLayout = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 386)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], c = i[r]; (o[u][c] = 1), e || (o[c][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 164: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.FruchtermanLayout = void 0); var i = n(9), u = n(10), c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.gravity = 10), (n.speed = 5), (n.clustering = !1), (n.clusterGravity = 10), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), (n.onLayoutEnd = function () {}), (n.tick = function () {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, gravity: 10, speed: 1, clustering: !1, clusterGravity: 10, }; }), (e.prototype.execute = function () { var t = this, e = this.nodes; if ( (void 0 !== this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval), e && 0 !== e.length) ) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var r = {}, o = {}; return ( e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (this.nodeMap = r), (this.nodeIdxMap = o), this.run() ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes; if (e) { var n = t.edges, r = t.maxIteration, o = t.center, i = t.height * t.width, c = Math.sqrt(i) / 10, s = i / (e.length + 1), a = Math.sqrt(s), f = t.gravity, y = t.speed, l = t.clustering, d = {}; if (l) for (var p in (e.forEach(function (t) { if (void 0 === d[t.cluster]) { var e = { name: t.cluster, cx: 0, cy: 0, count: 0 }; d[t.cluster] = e; } var n = d[t.cluster]; u.isNumber(t.x) && (n.cx += t.x), u.isNumber(t.y) && (n.cy += t.y), n.count++; }), d)) (d[p].cx /= d[p].count), (d[p].cy /= d[p].count); if ("undefined" != typeof window) { var h = 0; return ( (this.timeInterval = window.setInterval(function () { if (e) { var i = []; if ( (e.forEach(function (t, e) { i[e] = { x: 0, y: 0 }; }), t.applyCalculate(e, n, i, a, s), l) ) { var p = t.clusterGravity || f; for (var v in (e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = d[t.cluster], r = Math.sqrt( (t.x - n.cx) * (t.x - n.cx) + (t.y - n.cy) * (t.y - n.cy), ), o = a * p; (i[e].x -= (o * (t.x - n.cx)) / r), (i[e].y -= (o * (t.y - n.cy)) / r); } }), d)) (d[v].cx = 0), (d[v].cy = 0), (d[v].count = 0); for (var v in (e.forEach(function (t) { var e = d[t.cluster]; u.isNumber(t.x) && (e.cx += t.x), u.isNumber(t.y) && (e.cy += t.y), e.count++; }), d)) (d[v].cx /= d[v].count), (d[v].cy /= d[v].count); } e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = 0.01 * a * f; (i[e].x -= n * (t.x - o[0])), (i[e].y -= n * (t.y - o[1])); } }), e.forEach(function (t, e) { if (u.isNumber(t.fx) && u.isNumber(t.fy)) return (t.x = t.fx), void (t.y = t.fy); if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = Math.sqrt( i[e].x * i[e].x + i[e].y * i[e].y, ); if (n > 0) { var r = Math.min(c * (y / 800), n); (t.x += (i[e].x / n) * r), (t.y += (i[e].y / n) * r); } } }), t.tick && t.tick(), ++h >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0)), { nodes: e, edges: n } ); } } }), (e.prototype.applyCalculate = function (t, e, n, r, o) { this.calRepulsive(t, n, o), e && this.calAttractive(e, n, r); }), (e.prototype.calRepulsive = function (t, e, n) { t.forEach(function (r, o) { (e[o] = { x: 0, y: 0 }), t.forEach(function (t, i) { if ( o !== i && u.isNumber(r.x) && u.isNumber(t.x) && u.isNumber(r.y) && u.isNumber(t.y) ) { var c = r.x - t.x, s = r.y - t.y, a = c * c + s * s; if (0 === a) { a = 1; var f = o > i ? 1 : -1; (c = 0.01 * f), (s = 0.01 * f); } var y = n / a; (e[o].x += c * y), (e[o].y += s * y); } }); }); }), (e.prototype.calAttractive = function (t, e, n) { var r = this; t.forEach(function (t) { if (t.source && t.target) { var o = r.nodeIdxMap[t.source], i = r.nodeIdxMap[t.target]; if (o !== i) { var c = r.nodeMap[t.source], s = r.nodeMap[t.target]; if ( u.isNumber(s.x) && u.isNumber(c.x) && u.isNumber(s.y) && u.isNumber(c.y) ) { var a = s.x - c.x, f = s.y - c.y, y = Math.sqrt(a * a + f * f), l = (y * y) / n; (e[i].x -= (a / y) * l), (e[i].y -= (f / y) * l), (e[o].x += (a / y) * l), (e[o].y += (f / y) * l); } } } }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "fruchterman"; }), e ); })(i.Base); e.FruchtermanLayout = c; }, 386: function (t, e, n) { "use strict"; n.r(e); var r = n(164); e.default = r.FruchtermanLayout; }, 9: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=fruchtermanLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/gForceLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.GForceLayout = e()) : (t.GForceLayout = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 387)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], a = i[r]; (o[u][a] = 1), e || (o[a][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 165: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.GForceLayout = void 0); var i = n(9), u = n(10), a = function (t, e) { return t ? u.isNumber(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.edgeStrength = 200), (n.nodeStrength = 1e3), (n.coulombDisScale = 0.005), (n.damping = 0.9), (n.maxSpeed = 1e3), (n.minMovement = 0.5), (n.interval = 0.02), (n.factor = 1), (n.linkDistance = 1), (n.gravity = 10), (n.preventOverlap = !0), (n.tick = function () {}), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 500, gravity: 10, enableTick: !0 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes; if ( (void 0 !== t.timeInterval && "undefined" != typeof window && window.clearInterval(t.timeInterval), e && 0 !== e.length) ) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var n = t.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var r = {}, o = {}; e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (t.nodeMap = r), (t.nodeIdxMap = o), (t.linkDistance = a(t.linkDistance, 1)), (t.nodeStrength = a(t.nodeStrength, 1)), (t.edgeStrength = a(t.edgeStrength, 1)); var i, c = t.nodeSize; if (t.preventOverlap) { var s, f = t.nodeSpacing; (s = u.isNumber(f) ? function () { return f; } : u.isFunction(f) ? f : function () { return 0; }), (i = c ? u.isArray(c) ? function (t) { return (c[0] > c[1] ? c[0] : c[1]) + s(t); } : function (t) { return c + s(t); } : function (t) { return t.size ? u.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + s(t) : t.size + s(t) : 10 + s(t); }); } t.nodeSize = i; var d = t.edges; (t.degrees = u.getDegree(e.length, t.nodeIdxMap, d)), t.getMass || (t.getMass = function (e) { return t.degrees[t.nodeIdxMap[e.id]] || 1; }), t.run(); } else t.onLayoutEnd && t.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes, n = t.edges, r = t.maxIteration; if ("undefined" != typeof window) { var o = 0; this.timeInterval = window.setInterval(function () { var i = [], u = []; if (e) { e.forEach(function (t, e) { (i[2 * e] = 0), (i[2 * e + 1] = 0), (u[2 * e] = 0), (u[2 * e + 1] = 0); }), t.calRepulsive(i, e), n && t.calAttractive(i, n), t.calGravity(i, e); var a = Math.max(0.02, t.interval - 0.002 * o); t.updateVelocity(i, u, a, e); var c = []; e.forEach(function (t) { c.push({ x: t.x, y: t.y }); }), t.updatePosition(u, a, e), t.tick && t.tick(); var s = 0; e.forEach(function (t, e) { var n = t.x - c[e].x, r = t.y - c[e].y; s += Math.sqrt(n * n + r * r); }), (s /= e.length) < t.minMovement && (window.clearInterval(t.timeInterval), t.onLayoutEnd && t.onLayoutEnd()), ++o >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0); } }), (e.prototype.calRepulsive = function (t, e) { var n = this.getMass, r = this.nodeStrength, o = this.factor, i = this.coulombDisScale, u = this.preventOverlap, a = this.nodeSize; e.forEach(function (c, s) { var f = n ? n(c) : 1; e.forEach(function (e, d) { if (!(s >= d)) { var l = c.x - e.x, p = c.y - e.y, y = Math.sqrt(l * l + p * p) + 0.01, h = (y + 0.1) * i, v = l / y, g = p / y, b = (((r(c) + r(e)) / 2) * o) / (h * h), m = n ? n(e) : 1; if ( ((t[2 * s] += v * b), (t[2 * s + 1] += g * b), (t[2 * d] -= v * b), (t[2 * d + 1] -= g * b), u && y < (a(c) + a(e)) / 2) ) { var x = (r(c) + r(e)) / 2 / (y * y); (t[2 * s] += (v * x) / f), (t[2 * s + 1] += (g * x) / f), (t[2 * d] -= (v * x) / m), (t[2 * d + 1] -= (g * x) / m); } } }); }); }), (e.prototype.calAttractive = function (t, e) { var n = this.nodeMap, r = this.nodeIdxMap, o = this.linkDistance, i = this.edgeStrength, u = this.getMass; e.forEach(function (e, a) { var c = n[e.source], s = n[e.target], f = s.x - c.x, d = s.y - c.y, l = Math.sqrt(f * f + d * d) + 0.01, p = f / l, y = d / l, h = ((o(e) || 1) - l) * i(e), v = r[e.source], g = r[e.target], b = u ? u(c) : 1, m = u ? u(s) : 1; (t[2 * v] -= (p * h) / b), (t[2 * v + 1] -= (y * h) / b), (t[2 * g] += (p * h) / m), (t[2 * g + 1] += (y * h) / m); }); }), (e.prototype.calGravity = function (t, e) { for ( var n = this.center, r = this.gravity, o = this.degrees, i = e.length, a = 0; a < i; a++ ) { var c = e[a], s = c.x - n[0], f = c.y - n[1], d = r; if (this.getCenter) { var l = this.getCenter(c, o[a]); l && u.isNumber(l[0]) && u.isNumber(l[1]) && u.isNumber(l[2]) && ((s = c.x - l[0]), (f = c.y - l[1]), (d = l[2])); } d && ((t[2 * a] -= d * s), (t[2 * a + 1] -= d * f)); } }), (e.prototype.updateVelocity = function (t, e, n, r) { var o = this, i = n * o.damping; r.forEach(function (n, r) { var u = t[2 * r] * i || 0.01, a = t[2 * r + 1] * i || 0.01, c = Math.sqrt(u * u + a * a); if (c > o.maxSpeed) { var s = o.maxSpeed / c; (u *= s), (a *= s); } (e[2 * r] = u), (e[2 * r + 1] = a); }); }), (e.prototype.updatePosition = function (t, e, n) { n.forEach(function (n, r) { if (u.isNumber(n.fx) && u.isNumber(n.fy)) return (n.x = n.fx), void (n.y = n.fy); var o = t[2 * r] * e, i = t[2 * r + 1] * e; (n.x += o), (n.y += i); }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "gForce"; }), e ); })(i.Base); e.GForceLayout = c; }, 387: function (t, e, n) { "use strict"; n.r(e); var r = n(165); e.default = r.GForceLayout; }, 9: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=gForceLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/gridLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.GridLayout = t()) : (e.GridLayout = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 388)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, s = i[o], u = i[r]; (n[s][u] = 1), t || (n[u][s] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 166: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.GridLayout = void 0); var i = o(10), s = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.begin = [0, 0]), (o.preventOverlap = !0), (o.preventOverlapPadding = 10), (o.condense = !1), (o.sortBy = "degree"), (o.nodeSize = 30), (o.nodes = []), (o.edges = []), (o.width = 300), (o.height = 300), (o.row = 0), (o.col = 0), (o.cellWidth = 0), (o.cellHeight = 0), (o.cellUsed = {}), (o.id2manPos = {}), (o.onLayoutEnd = function () {}), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { begin: [0, 0], preventOverlap: !0, preventOverlapPadding: 10, condense: !1, rows: void 0, cols: void 0, position: void 0, sortBy: "degree", nodeSize: 30, }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, o = t.length, r = e.begin; if (0 !== o) { if (1 === o) return ( (t[0].x = r[0]), (t[0].y = r[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var n = e.edges, s = []; t.forEach(function (e) { s.push(e); }); var u = {}; if ( (s.forEach(function (e, t) { u[e.id] = t; }), ("degree" === e.sortBy || !i.isString(e.sortBy) || void 0 === s[0][e.sortBy]) && ((e.sortBy = "degree"), i.isNaN(t[0].degree))) ) { var c = i.getDegree(s.length, u, n); s.forEach(function (e, t) { e.degree = c[t]; }); } s.sort(function (t, o) { return o[e.sortBy] - t[e.sortBy]; }), e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var l = e.rows, a = null != e.cols ? e.cols : e.columns; if ( ((e.cells = o), null != l && null != a ? ((e.rows = l), (e.cols = a)) : null != l && null == a ? ((e.rows = l), (e.cols = Math.ceil(e.cells / e.rows))) : null == l && null != a ? ((e.cols = a), (e.rows = Math.ceil(e.cells / e.cols))) : ((e.splits = Math.sqrt((e.cells * e.height) / e.width)), (e.rows = Math.round(e.splits)), (e.cols = Math.round((e.width / e.height) * e.splits))), e.cols * e.rows > e.cells) ) ((d = e.small()) - 1) * (f = e.large()) >= e.cells ? e.small(d - 1) : (f - 1) * d >= e.cells && e.large(f - 1); else for (; e.cols * e.rows < e.cells; ) { var f, d = e.small(); ((f = e.large()) + 1) * d >= e.cells ? e.large(f + 1) : e.small(d + 1); } (e.cellWidth = e.width / e.cols), (e.cellHeight = e.height / e.rows), e.condense && ((e.cellWidth = 0), (e.cellHeight = 0)), e.preventOverlap && s.forEach(function (t) { var o, r; (t.x && t.y) || ((t.x = 0), (t.y = 0)), i.isArray(t.size) ? ((o = t.size[0]), (r = t.size[1])) : i.isNumber(t.size) && ((o = t.size), (r = t.size)), (void 0 !== o && void 0 !== r) || (i.isArray(e.nodeSize) ? ((o = e.nodeSize[0]), (r = e.nodeSize[1])) : i.isNumber(e.nodeSize) ? ((o = e.nodeSize), (r = e.nodeSize)) : ((o = 30), (r = 30))); var n = e.preventOverlapPadding, s = o + n, u = r + n; (e.cellWidth = Math.max(e.cellWidth, s)), (e.cellHeight = Math.max(e.cellHeight, u)); }), (e.cellUsed = {}), (e.row = 0), (e.col = 0), (e.id2manPos = {}); for (var p = 0; p < s.length; p++) { var h = s[p], y = void 0; if ( (e.position && (y = e.position(h)), y && (void 0 !== y.row || void 0 !== y.col)) ) { var v = { row: y.row, col: y.col }; if (void 0 === v.col) for (v.col = 0; e.used(v.row, v.col); ) v.col++; else if (void 0 === v.row) for (v.row = 0; e.used(v.row, v.col); ) v.row++; (e.id2manPos[h.id] = v), e.use(v.row, v.col); } e.getPos(h); } return e.onLayoutEnd && e.onLayoutEnd(), { edges: n, nodes: s }; } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.small = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.min(o, r)) : Math.min(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.large = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.max(o, r)) : Math.max(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.used = function (e, t) { return this.cellUsed["c-" + e + "-" + t] || !1; }), (t.prototype.use = function (e, t) { this.cellUsed["c-" + e + "-" + t] = !0; }), (t.prototype.moveToNextCell = function () { var e = this.cols || 5; this.col++, this.col >= e && ((this.col = 0), this.row++); }), (t.prototype.getPos = function (e) { var t, o, r = this.begin, n = this.cellWidth, i = this.cellHeight, s = this.id2manPos[e.id]; if (s) (t = s.col * n + n / 2 + r[0]), (o = s.row * i + i / 2 + r[1]); else { for (; this.used(this.row, this.col); ) this.moveToNextCell(); (t = this.col * n + n / 2 + r[0]), (o = this.row * i + i / 2 + r[1]), this.use(this.row, this.col), this.moveToNextCell(); } (e.x = t), (e.y = o); }), (t.prototype.getType = function () { return "grid"; }), t ); })(o(9).Base); t.GridLayout = s; }, 388: function (e, t, o) { "use strict"; o.r(t); var r = o(166); t.default = r.GridLayout; }, 9: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=gridLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/mdsLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.MdsLayout = r()) : (t.MdsLayout = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 389)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 167: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }); Object.defineProperty(r, "__esModule", { value: !0 }), (r.MDSLayout = void 0); var i = e(96), s = e(10), u = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.linkDistance = 50), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { center: [0, 0], linkDistance: 50 }; }), (r.prototype.execute = function () { var t = this.nodes, r = this.edges, e = void 0 === r ? [] : r, o = this.center; if (t && 0 !== t.length) { if (1 === t.length) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var n = this.linkDistance, i = s.getAdjMatrix({ nodes: t, edges: e }, !1), u = s.floydWarshall(i); this.handleInfinity(u); var a = s.scaleMatrix(u, n); this.scaledDistances = a; var f = this.runMDS(); return ( (this.positions = f), f.forEach(function (r, e) { (t[e].x = r[0] + o[0]), (t[e].y = r[1] + o[1]); }), this.onLayoutEnd && this.onLayoutEnd(), { nodes: t, edges: e } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (r.prototype.runMDS = function () { var t = this.scaledDistances, r = i.Matrix.mul(i.Matrix.pow(t, 2), -0.5), e = r.mean("row"), o = r.mean("column"), n = r.mean(); r.add(n).subRowVector(e).subColumnVector(o); var s = new i.SingularValueDecomposition(r), u = i.Matrix.sqrt(s.diagonalMatrix).diagonal(); return s.leftSingularVectors.toJSON().map(function (t) { return i.Matrix.mul([t], [u]).toJSON()[0].splice(0, 2); }); }), (r.prototype.handleInfinity = function (t) { var r = -999999; t.forEach(function (t) { t.forEach(function (t) { t !== 1 / 0 && r < t && (r = t); }); }), t.forEach(function (e, o) { e.forEach(function (e, n) { e === 1 / 0 && (t[o][n] = r); }); }); }), (r.prototype.getType = function () { return "mds"; }), r ); })(e(9).Base); r.MDSLayout = u; }, 389: function (t, r, e) { "use strict"; e.r(r); var o = e(167); r.default = o.MDSLayout; }, 9: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, 96: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return U; }), e.d(r, "default", function () { return Y; }), e.d(r, "Matrix", function () { return Y; }), e.d(r, "MatrixColumnView", function () { return ut; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return Mt; }), e.d(r, "MatrixFlipRowView", function () { return Rt; }), e.d(r, "MatrixRowView", function () { return It; }), e.d(r, "MatrixRowSelectionView", function () { return zt; }), e.d(r, "MatrixSelectionView", function () { return Kt; }), e.d(r, "MatrixSubView", function () { return er; }), e.d(r, "MatrixTransposeView", function () { return fr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return gr; }), e.d(r, "WrapperMatrix2D", function () { return Sr; }), e.d(r, "solve", function () { return Ir; }), e.d(r, "inverse", function () { return Dr; }), e.d(r, "determinant", function () { return Vr; }), e.d(r, "linearDependencies", function () { return Fr; }), e.d(r, "pseudoInverse", function () { return Lr; }), e.d(r, "covariance", function () { return zr; }), e.d(r, "correlation", function () { return Wr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Yr; }), e.d(r, "EVD", function () { return Yr; }), e.d(r, "CholeskyDecomposition", function () { return te; }), e.d(r, "CHO", function () { return te; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return _r; }), e.d(r, "QR", function () { return _r; }), e.d(r, "Nipals", function () { return ne; }), e.d(r, "NIPALS", function () { return ne; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } function i(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; } function s(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; } function u(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError("output option must be an array if specified"); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; } var a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function v(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function g(t, r) { if (!n(r)) throw new TypeError("row indices must be an array"); for (var e = 0; e < r.length; e++) if (r[e] < 0 || r[e] >= t.rows) throw new RangeError("row indices are out of range"); } function w(t, r) { if (!n(r)) throw new TypeError("column indices must be an array"); for (var e = 0; e < r.length; e++) if (r[e] < 0 || r[e] >= t.columns) throw new RangeError("column indices are out of range"); } function b(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (M("startRow", r), M("endRow", e), M("startColumn", o), M("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function d(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function M(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function x(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function k(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function S(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function O(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function E(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function R(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function P(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function T(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function C(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function N(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function D(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function I(t, r) { return (I = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function V(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = A(t); if (r) { var n = A(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return q(this, e); }; } function q(t, r) { if (r && ("object" === F(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function A(t) { return (A = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function F(t) { return (F = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function L(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function B(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function z(t, r, e) { return ( r && B(t.prototype, r), e && B(t, e), Object.defineProperty(t, "prototype", { writable: !1 }), t ); } var U = (function () { function t() { L(this, t); } return ( z( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new Y(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { p(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return Y.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { p(this, t), (r = v(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { p(this, t), p(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return Y.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = m(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { p(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { x(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { x(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((p(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { p(this, t), x(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((p(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { p(this, t), x(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), x(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), x(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = Y.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new Y(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = Y.checkMatrix(t); var r = new Y(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), y = (e + n) * f, v = c + p - y + (n - a) * (u + f), m = l + y, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, v), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = Y.checkMatrix(t); var r = new Y(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), y = t.get(1, 0), v = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), b = t.get(2, 2), d = (e - i) * (-l + v), M = (-e + i + s) * (h - l + v), x = (i + s) * (-h + l), k = e * h, S = (-e + a + f) * (h - p + m), O = (-e + a) * (p - m), E = (a + f) * (-h + p), j = (-n + f + c) * (v + g - w), R = (n - c) * (v - w), P = n * g, _ = (f + c) * (-g + w), T = (-n + s + u) * (m + g - b), C = (n - u) * (m - b), N = (s + u) * (-g + b), D = k + P + o * y, I = (e + o + n - i - s - f - c) * v + M + x + k + j + P + _, V = k + S + E + (e + o + n - s - u - a - f) * m + P + T + N, q = d + s * (-h + l + y - v - m - g + b) + M + k + P + T + C, A = d + M + x + k + u * w, F = P + T + C + N + i * p, L = k + S + O + f * (-h + p + y - v - m - g + w) + j + R + P, B = j + R + P + _ + a * l, z = k + S + O + E + c * b; return ( r.set(0, 0, D), r.set(0, 1, I), r.set(0, 2, V), r.set(1, 0, q), r.set(1, 1, A), r.set(1, 2, F), r.set(2, 0, L), r.set(2, 1, B), r.set(2, 2, z), r ); }, }, { key: "mmulStrassen", value: function (r) { r = Y.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), y = o.subMatrix(s, o.rows - 1, 0, a - 1), v = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, v), t.add(c, m), s, a), w = r(t.add(p, v), c, s, a), b = r(f, t.sub(l, m), s, a), d = r(v, t.sub(y, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), k = r(t.sub(h, v), t.add(y, m), s, a), S = t.add(g, d); S.sub(M), S.add(k); var O = t.add(b, M), E = t.add(w, d), j = t.sub(g, w); j.add(b), j.add(x); var R = t.zeros(2 * S.rows, 2 * S.columns); return (R = (R = (R = (R = R.setSubMatrix( S, 0, 0, )).setSubMatrix(O, S.rows, 0)).setSubMatrix( E, 0, S.columns, )).setSubMatrix(j, S.rows, S.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new Y(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new Y(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = Y.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new Y(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = Y.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(Y.eye(e, e)), n = Y.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new Y(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : W, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : W, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { b(this, t, r, e, o); for (var n = new Y(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new Y(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new Y(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = Y.checkMatrix(t)).isEmpty()) return this; b(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { g(this, t), w(this, r); for ( var e = new Y(t.length, r.length), o = 0; o < t.length; o++ ) for (var n = t[o], i = 0; i < r.length; i++) { var s = r[i]; e.set(o, i, this.get(n, s)); } return e; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new Y(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = d(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = d(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = d(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = d(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, i = void 0 === o || o, s = e.mean, u = void 0 === s ? this.mean(t) : s; if ("boolean" != typeof i) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!n(u)) throw new TypeError("mean must be an array"); return k(this, i, u); case "column": if (!n(u)) throw new TypeError("mean must be an array"); return S(this, i, u); case void 0: if ("number" != typeof u) throw new TypeError("mean must be a number"); return O(this, i, u); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === F(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, i = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!n(i)) throw new TypeError("center must be an array"); return E(this, i), this; case "column": if (!n(i)) throw new TypeError("center must be an array"); return j(this, i), this; case void 0: if ("number" != typeof i) throw new TypeError("center must be a number"); return R(this, i), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = P(this); else if (!n(e)) throw new TypeError("scale must be an array"); return _(this, e), this; case "column": if (void 0 === e) e = T(this); else if (!n(e)) throw new TypeError("scale must be an array"); return C(this, e), this; case void 0: if (void 0 === e) e = N(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return D(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new Y(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new Y(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new Y(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new Y(t, r); }, }, { key: "ones", value: function (t, r) { return new Y(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== F(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new Y(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== F(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new Y(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new Y(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new Y(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function W(t, r) { return t - r; } (U.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (U.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (U.random = U.rand), (U.randomInt = U.randInt), (U.diagonal = U.diag), (U.prototype.diagonal = U.prototype.diag), (U.identity = U.eye), (U.prototype.negate = U.prototype.neg), (U.prototype.tensorProduct = U.prototype.kroneckerProduct); var Q, J, Y = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && I(t, r); })(e, t); var r = V(e); function e(t, o) { var i; if ((L(this, e), (i = r.call(this)), e.isMatrix(t))) return q(i, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((i.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var s = 0; s < t; s++) i.data.push(new Float64Array(o)); } else { if (!n(t)) throw new TypeError( "First argument must be a positive number or an array", ); var u = t; if ("number" != typeof (o = (t = u.length) ? u[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); i.data = []; for (var a = 0; a < t; a++) { if (u[a].length !== o) throw new RangeError("Inconsistent array dimensions"); i.data.push(Float64Array.from(u[a])); } } return (i.rows = t), (i.columns = o), i; } return ( z(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( p(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), p(this, t, !0), (r = Float64Array.from(v(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = m(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(U); function H(t) { return (H = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function K(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function X(t, r) { return (X = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function G(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = $(t); if (r) { var n = $(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Z(this, e); }; } function Z(t, r) { if (r && ("object" === H(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function $(t) { return ($ = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (J = Y), ((Q = U).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (Q.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (Q.prototype.addM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (Q.add = function (t, r) { return new J(t).add(r); }), (Q.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (Q.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (Q.prototype.subM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (Q.sub = function (t, r) { return new J(t).sub(r); }), (Q.prototype.subtract = Q.prototype.sub), (Q.prototype.subtractS = Q.prototype.subS), (Q.prototype.subtractM = Q.prototype.subM), (Q.subtract = Q.sub), (Q.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (Q.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (Q.prototype.mulM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (Q.mul = function (t, r) { return new J(t).mul(r); }), (Q.prototype.multiply = Q.prototype.mul), (Q.prototype.multiplyS = Q.prototype.mulS), (Q.prototype.multiplyM = Q.prototype.mulM), (Q.multiply = Q.mul), (Q.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (Q.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (Q.prototype.divM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (Q.div = function (t, r) { return new J(t).div(r); }), (Q.prototype.divide = Q.prototype.div), (Q.prototype.divideS = Q.prototype.divS), (Q.prototype.divideM = Q.prototype.divM), (Q.divide = Q.div), (Q.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (Q.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (Q.prototype.modM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (Q.mod = function (t, r) { return new J(t).mod(r); }), (Q.prototype.modulus = Q.prototype.mod), (Q.prototype.modulusS = Q.prototype.modS), (Q.prototype.modulusM = Q.prototype.modM), (Q.modulus = Q.mod), (Q.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (Q.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (Q.prototype.andM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (Q.and = function (t, r) { return new J(t).and(r); }), (Q.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (Q.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (Q.prototype.orM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (Q.or = function (t, r) { return new J(t).or(r); }), (Q.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (Q.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (Q.prototype.xorM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (Q.xor = function (t, r) { return new J(t).xor(r); }), (Q.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (Q.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (Q.prototype.leftShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (Q.leftShift = function (t, r) { return new J(t).leftShift(r); }), (Q.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (Q.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (Q.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (Q.signPropagatingRightShift = function (t, r) { return new J(t).signPropagatingRightShift(r); }), (Q.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (Q.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (Q.prototype.rightShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (Q.rightShift = function (t, r) { return new J(t).rightShift(r); }), (Q.prototype.zeroFillRightShift = Q.prototype.rightShift), (Q.prototype.zeroFillRightShiftS = Q.prototype.rightShiftS), (Q.prototype.zeroFillRightShiftM = Q.prototype.rightShiftM), (Q.zeroFillRightShift = Q.rightShift), (Q.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (Q.not = function (t) { return new J(t).not(); }), (Q.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (Q.abs = function (t) { return new J(t).abs(); }), (Q.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (Q.acos = function (t) { return new J(t).acos(); }), (Q.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (Q.acosh = function (t) { return new J(t).acosh(); }), (Q.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (Q.asin = function (t) { return new J(t).asin(); }), (Q.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (Q.asinh = function (t) { return new J(t).asinh(); }), (Q.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (Q.atan = function (t) { return new J(t).atan(); }), (Q.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (Q.atanh = function (t) { return new J(t).atanh(); }), (Q.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (Q.cbrt = function (t) { return new J(t).cbrt(); }), (Q.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (Q.ceil = function (t) { return new J(t).ceil(); }), (Q.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (Q.clz32 = function (t) { return new J(t).clz32(); }), (Q.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (Q.cos = function (t) { return new J(t).cos(); }), (Q.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (Q.cosh = function (t) { return new J(t).cosh(); }), (Q.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (Q.exp = function (t) { return new J(t).exp(); }), (Q.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (Q.expm1 = function (t) { return new J(t).expm1(); }), (Q.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (Q.floor = function (t) { return new J(t).floor(); }), (Q.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (Q.fround = function (t) { return new J(t).fround(); }), (Q.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (Q.log = function (t) { return new J(t).log(); }), (Q.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (Q.log1p = function (t) { return new J(t).log1p(); }), (Q.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (Q.log10 = function (t) { return new J(t).log10(); }), (Q.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (Q.log2 = function (t) { return new J(t).log2(); }), (Q.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (Q.round = function (t) { return new J(t).round(); }), (Q.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (Q.sign = function (t) { return new J(t).sign(); }), (Q.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (Q.sin = function (t) { return new J(t).sin(); }), (Q.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (Q.sinh = function (t) { return new J(t).sinh(); }), (Q.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (Q.sqrt = function (t) { return new J(t).sqrt(); }), (Q.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (Q.tan = function (t) { return new J(t).tan(); }), (Q.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (Q.tanh = function (t) { return new J(t).tanh(); }), (Q.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (Q.trunc = function (t) { return new J(t).trunc(); }), (Q.pow = function (t, r) { return new J(t).pow(r); }), (Q.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (Q.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (Q.prototype.powM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var tt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && X(t, r); })(i, t); var r, e, o, n = G(i); function i(t, r, e) { var o; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((o = n.call(this)).matrix = t), (o.rows = r), (o.columns = e), o ); } return ( (r = i), e && K(r.prototype, e), o && K(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), r ); })(U); function rt(t) { return (rt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function et(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ot(t, r) { return (ot = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function nt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = st(t); if (r) { var n = st(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return it(this, e); }; } function it(t, r) { if (r && ("object" === rt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function st(t) { return (st = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ot(t, r); })(i, t); var r, e, o, n = nt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && et(r.prototype, e), o && et(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function at(t) { return (at = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ft(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ct(t, r) { return (ct = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ht(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = pt(t); if (r) { var n = pt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return lt(this, e); }; } function lt(t, r) { if (r && ("object" === at(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function pt(t) { return (pt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ct(t, r); })(i, t); var r, e, o, n = ht(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), w(t, r), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ft(r.prototype, e), o && ft(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function vt(t) { return (vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function mt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function gt(t, r) { return (gt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function wt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = dt(t); if (r) { var n = dt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return bt(this, e); }; } function bt(t, r) { if (r && ("object" === vt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function dt(t) { return (dt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Mt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && gt(t, r); })(i, t); var r, e, o, n = wt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && mt(r.prototype, e), o && mt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function xt(t) { return (xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function kt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function St(t, r) { return (St = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Et(this, e); }; } function Et(t, r) { if (r && ("object" === xt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && St(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && kt(r.prototype, e), o && kt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function _t(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Tt(t, r) { return (Tt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ct(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Dt(t); if (r) { var n = Dt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { if (r && ("object" === Pt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Dt(t) { return (Dt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var It = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Tt(t, r); })(i, t); var r, e, o, n = Ct(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), p(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && _t(r.prototype, e), o && _t(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Vt(t) { return (Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ft(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Bt(t); if (r) { var n = Bt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Lt(this, e); }; } function Lt(t, r) { if (r && ("object" === Vt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Bt(t) { return (Bt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var zt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && At(t, r); })(i, t); var r, e, o, n = Ft(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), g(t, r), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && qt(r.prototype, e), o && qt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Ut(t) { return (Ut = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Wt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Qt(t, r) { return (Qt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Jt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Ht(t); if (r) { var n = Ht(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Yt(this, e); }; } function Yt(t, r) { if (r && ("object" === Ut(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ht(t) { return (Ht = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Kt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Qt(t, r); })(i, t); var r, e, o, n = Jt(i); function i(t, r, e) { var o; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), g(t, r), w(t, e), ((o = n.call(this, t, r.length, e.length)).rowIndices = r), (o.columnIndices = e), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Wt(r.prototype, e), o && Wt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Xt(t) { return (Xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Zt(t, r) { return (Zt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function $t(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = rr(t); if (r) { var n = rr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return tr(this, e); }; } function tr(t, r) { if (r && ("object" === Xt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function rr(t) { return (rr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Zt(t, r); })(i, t); var r, e, o, n = $t(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), b(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Gt(r.prototype, e), o && Gt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function or(t) { return (or = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function nr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ir(t, r) { return (ir = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function sr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ar(t); if (r) { var n = ar(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ur(this, e); }; } function ur(t, r) { if (r && ("object" === or(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ar(t) { return (ar = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var fr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ir(t, r); })(i, t); var r, e, o, n = sr(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && nr(r.prototype, e), o && nr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function cr(t) { return (cr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function hr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function lr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function pr(t, r) { return (pr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = mr(t); if (r) { var n = mr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return vr(this, e); }; } function vr(t, r) { if (r && ("object" === cr(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function mr(t) { return (mr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var gr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && pr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; hr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && lr(r.prototype, e), o && lr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(U); function wr(t) { return (wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function br(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function dr(t, r) { return (dr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Mr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = kr(t); if (r) { var n = kr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return xr(this, e); }; } function xr(t, r) { if (r && ("object" === wr(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function kr(t) { return (kr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Sr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && dr(t, r); })(i, t); var r, e, o, n = Mr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && br(r.prototype, e), o && br(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(U); function Or(t, r) { if (n(t)) return t[0] && n(t[0]) ? new Sr(t) : new gr(t, r); throw new Error("the argument is not an array"); } function Er(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Sr.checkMatrix(r)).clone(), l = h.rows, p = h.columns, y = new Float64Array(l), v = 1; for (e = 0; e < l; e++) y[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = y[i]), (y[i] = y[o]), (y[o] = a), (v = -v); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = y), (this.pivotSign = v); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = Y.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new Y(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new Y(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Er(r.prototype, e), o && Er(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Rr(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var _r = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Sr.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = Rr(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = Y.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new Y(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new Y(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Tr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Cr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Tr(this, t), (r = Sr.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), y = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (y = !0); var v = l; (l = p), (p = v); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), b = new Y(n, m), d = new Y(i, i), M = new Float64Array(i), x = new Float64Array(n), k = new Float64Array(g), S = 0; S < g; S++ ) k[S] = S; for ( var O = Math.min(n - 1, i), E = Math.max(0, Math.min(i - 2, n)), j = Math.max(O, E), R = 0; R < j; R++ ) { if (R < O) { w[R] = 0; for (var P = R; P < n; P++) w[R] = Rr(w[R], o.get(P, R)); if (0 !== w[R]) { o.get(R, R) < 0 && (w[R] = -w[R]); for (var _ = R; _ < n; _++) o.set(_, R, o.get(_, R) / w[R]); o.set(R, R, o.get(R, R) + 1); } w[R] = -w[R]; } for (var T = R + 1; T < i; T++) { if (R < O && 0 !== w[R]) { for (var C = 0, N = R; N < n; N++) C += o.get(N, R) * o.get(N, T); C = -C / o.get(R, R); for (var D = R; D < n; D++) o.set(D, T, o.get(D, T) + C * o.get(D, R)); } M[T] = o.get(R, T); } if (l && R < O) for (var I = R; I < n; I++) b.set(I, R, o.get(I, R)); if (R < E) { M[R] = 0; for (var V = R + 1; V < i; V++) M[R] = Rr(M[R], M[V]); if (0 !== M[R]) { M[R + 1] < 0 && (M[R] = 0 - M[R]); for (var q = R + 1; q < i; q++) M[q] /= M[R]; M[R + 1] += 1; } if (((M[R] = -M[R]), R + 1 < n && 0 !== M[R])) { for (var A = R + 1; A < n; A++) x[A] = 0; for (var F = R + 1; F < n; F++) for (var L = R + 1; L < i; L++) x[F] += M[L] * o.get(F, L); for (var B = R + 1; B < i; B++) for (var z = -M[B] / M[R + 1], U = R + 1; U < n; U++) o.set(U, B, o.get(U, B) + z * x[U]); } if (p) for (var W = R + 1; W < i; W++) d.set(W, R, M[W]); } } var Q = Math.min(i, n + 1); if ( (O < i && (w[O] = o.get(O, O)), n < Q && (w[Q - 1] = 0), E + 1 < Q && (M[E] = o.get(E, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = O; J < m; J++) { for (var H = 0; H < n; H++) b.set(H, J, 0); b.set(J, J, 1); } for (var K = O - 1; K >= 0; K--) if (0 !== w[K]) { for (var X = K + 1; X < m; X++) { for (var G = 0, Z = K; Z < n; Z++) G += b.get(Z, K) * b.get(Z, X); G = -G / b.get(K, K); for (var $ = K; $ < n; $++) b.set($, X, b.get($, X) + G * b.get($, K)); } for (var tt = K; tt < n; tt++) b.set(tt, K, -b.get(tt, K)); b.set(K, K, 1 + b.get(K, K)); for (var rt = 0; rt < K - 1; rt++) b.set(rt, K, 0); } else { for (var et = 0; et < n; et++) b.set(et, K, 0); b.set(K, K, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < E && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += d.get(st, ot) * d.get(st, nt); it = -it / d.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) d.set(ut, nt, d.get(ut, nt) + it * d.get(ut, ot)); } for (var at = 0; at < i; at++) d.set(at, ot, 0); d.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var yt = void 0; for (yt = Q - 1; yt >= ht && yt !== ht; yt--) { var vt = (yt !== Q ? Math.abs(M[yt]) : 0) + (yt !== ht + 1 ? Math.abs(M[yt - 1]) : 0); if (Math.abs(w[yt]) <= ct * vt) { w[yt] = 0; break; } } yt === ht ? (lt = 3) : yt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = yt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = Rr(w[gt], mt), bt = w[gt] / wt, dt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -dt * M[gt - 1]), (M[gt - 1] = bt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = bt * d.get(Mt, gt) + dt * d.get(Mt, Q - 1)), d.set( Mt, Q - 1, -dt * d.get(Mt, gt) + bt * d.get(Mt, Q - 1), ), d.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var kt = ht; kt < Q; kt++) { var St = Rr(w[kt], xt), Ot = w[kt] / St, Et = xt / St; if ( ((w[kt] = St), (xt = -Et * M[kt]), (M[kt] = Ot * M[kt]), l) ) for (var jt = 0; jt < n; jt++) (St = Ot * b.get(jt, kt) + Et * b.get(jt, ht - 1)), b.set( jt, ht - 1, -Et * b.get(jt, kt) + Ot * b.get(jt, ht - 1), ), b.set(jt, kt, St); } break; case 3: var Rt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), Pt = w[Q - 1] / Rt, _t = w[Q - 2] / Rt, Tt = M[Q - 2] / Rt, Ct = w[ht] / Rt, Nt = M[ht] / Rt, Dt = ((_t + Pt) * (_t - Pt) + Tt * Tt) / 2, It = Pt * Tt * (Pt * Tt), Vt = 0; (0 === Dt && 0 === It) || (Vt = It / (Dt + (Vt = Dt < 0 ? 0 - Math.sqrt(Dt * Dt + It) : Math.sqrt(Dt * Dt + It)))); for ( var qt = (Ct + Pt) * (Ct - Pt) + Vt, At = Ct * Nt, Ft = ht; Ft < Q - 1; Ft++ ) { var Lt = Rr(qt, At); 0 === Lt && (Lt = Number.MIN_VALUE); var Bt = qt / Lt, zt = At / Lt; if ( (Ft !== ht && (M[Ft - 1] = Lt), (qt = Bt * w[Ft] + zt * M[Ft]), (M[Ft] = Bt * M[Ft] - zt * w[Ft]), (At = zt * w[Ft + 1]), (w[Ft + 1] = Bt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Lt = Bt * d.get(Ut, Ft) + zt * d.get(Ut, Ft + 1)), d.set( Ut, Ft + 1, -zt * d.get(Ut, Ft) + Bt * d.get(Ut, Ft + 1), ), d.set(Ut, Ft, Lt); if ( (0 === (Lt = Rr(qt, At)) && (Lt = Number.MIN_VALUE), (Bt = qt / Lt), (zt = At / Lt), (w[Ft] = Lt), (qt = Bt * M[Ft] + zt * w[Ft + 1]), (w[Ft + 1] = -zt * M[Ft] + Bt * w[Ft + 1]), (At = zt * M[Ft + 1]), (M[Ft + 1] = Bt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Lt = Bt * b.get(Wt, Ft) + zt * b.get(Wt, Ft + 1)), b.set( Wt, Ft + 1, -zt * b.get(Wt, Ft) + Bt * b.get(Wt, Ft + 1), ), b.set(Wt, Ft, Lt); } (M[Q - 2] = qt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) d.set(Qt, ht, -d.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Yt = 0; Yt < i; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); if (l && ht < n - 1) for (var Ht = 0; Ht < n; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); ht++; } 0, Q--; } } if (y) { var Kt = d; (d = b), (b = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = b), (this.V = d); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = Y.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = Y.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var y = 0, v = 0; v < o; v++) y += a.get(l, v) * s.get(p, v); h.set(l, p, y); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(Y.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new Y(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new Y(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, y = 0; y < f; y++) p += n.get(h, y) * u.get(l, y); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return Y.diag(this.s); }, }, ]) && Cr(r.prototype, e), o && Cr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Dr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Sr.checkMatrix(t)), r ? new Nr(t).inverse() : Ir(t, Y.eye(t.rows)) ); } function Ir(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Sr.checkMatrix(t)), (r = Sr.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new _r(t).solve(r) ); } function Vr(t) { var r, e, o, n, i, s; if ((t = Y.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Kt(t, [1, 2], [1, 2])), (i = new Kt(t, [1, 2], [0, 2])), (s = new Kt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * Vr(n) - e * Vr(i) + o * Vr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function qr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Ar(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Fr(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = Y.checkMatrix(t)).rows, u = new Y(s, s), a = 0; a < s; a++ ) { var f = Y.columnVector(t.getRow(a)), c = t.subMatrixRow(qr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = Y.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Ar(p, l, a, o, i)); } return u; } function Lr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = Y.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(Y.diag(i).mmul(o.transpose())); } function Br(t) { return (Br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function zr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new Y(t); var o = !1; if ( ("object" !== Br(r) || Y.isMatrix(r) || n(r) ? (r = new Y(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var i = e, s = i.center, u = void 0 === s || s; u && ((t = t.center("column")), o || (r = r.center("column"))); for (var a = t.transpose().mmul(r), f = 0; f < a.rows; f++) for (var c = 0; c < a.columns; c++) a.set(f, c, a.get(f, c) * (1 / (t.rows - 1))); return a; } function Ur(t) { return (Ur = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Wr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new Y(t); var o = !1; if ( ("object" !== Ur(r) || Y.isMatrix(r) || n(r) ? (r = new Y(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var i = e, s = i.center, u = void 0 === s || s, a = i.scale, f = void 0 === a || a; u && (t.center("column"), o || r.center("column")), f && (t.scale("column"), o || r.scale("column")); for ( var c = t.standardDeviation("column", { unbiased: !0 }), h = o ? c : r.standardDeviation("column", { unbiased: !0 }), l = t.transpose().mmul(r), p = 0; p < l.rows; p++ ) for (var y = 0; y < l.columns; y++) l.set(p, y, l.get(p, y) * (1 / (c[p] * h[y])) * (1 / (t.rows - 1))); return l; } function Qr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Jr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Yr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Qr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Sr.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new Y(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Hr(u, c, f, a), Kr(u, c, f, a); } else { var l = new Y(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Xr(u, l, p, a), Gr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new Y(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Jr(r.prototype, e), o && Jr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Hr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, y, v, m, g, w, b; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var d = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = Rr((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( d += i, h = e[c], v = y = 1, m = y, g = r[f + 1], w = 0, b = 0, s = c - 1; s >= f; s-- ) for ( m = v, v = y, b = w, n = y * r[s], i = y * h, l = Rr(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (y = h / l) * e[s] - w * n, e[s + 1] = i + w * (y * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + y * i), o.set(a, s, y * o.get(a, s) - w * i); (h = (-w * b * m * g * r[f]) / p), (r[f] = w * h), (e[f] = y * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + d), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Gr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, y, v, m, g, w, b, d = t - 1, M = t - 1, x = Number.EPSILON, k = 0, S = 0, O = 0, E = 0, j = 0, R = 0, P = 0, _ = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) S += Math.abs(n.get(i, s)); for (; d >= 0; ) { for ( a = d; a > 0 && (0 === (R = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (R = S), !(Math.abs(n.get(a, a - 1)) < x * R)); ) a--; if (a === d) n.set(d, d, n.get(d, d) + k), (e[d] = n.get(d, d)), (r[d] = 0), d--, (_ = 0); else if (a === d - 1) { if ( ((h = n.get(d, d - 1) * n.get(d - 1, d)), (E = (O = (n.get(d - 1, d - 1) - n.get(d, d)) / 2) * O + h), (P = Math.sqrt(Math.abs(E))), n.set(d, d, n.get(d, d) + k), n.set(d - 1, d - 1, n.get(d - 1, d - 1) + k), (l = n.get(d, d)), E >= 0) ) { for ( P = O >= 0 ? O + P : O - P, e[d - 1] = l + P, e[d] = e[d - 1], 0 !== P && (e[d] = l - h / P), r[d - 1] = 0, r[d] = 0, O = (l = n.get(d, d - 1)) / (R = Math.abs(l) + Math.abs(P)), E = P / R, O /= j = Math.sqrt(O * O + E * E), E /= j, s = d - 1; s < t; s++ ) (P = n.get(d - 1, s)), n.set(d - 1, s, E * P + O * n.get(d, s)), n.set(d, s, E * n.get(d, s) - O * P); for (i = 0; i <= d; i++) (P = n.get(i, d - 1)), n.set(i, d - 1, E * P + O * n.get(i, d)), n.set(i, d, E * n.get(i, d) - O * P); for (i = 0; i <= M; i++) (P = o.get(i, d - 1)), o.set(i, d - 1, E * P + O * o.get(i, d)), o.set(i, d, E * o.get(i, d) - O * P); } else (e[d - 1] = l + O), (e[d] = l + O), (r[d - 1] = P), (r[d] = -P); (d -= 2), (_ = 0); } else { if ( ((l = n.get(d, d)), (p = 0), (h = 0), a < d && ((p = n.get(d - 1, d - 1)), (h = n.get(d, d - 1) * n.get(d - 1, d))), 10 === _) ) { for (k += l, i = 0; i <= d; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (R = Math.abs(n.get(d, d - 1)) + Math.abs(n.get(d - 1, d - 2)))), (h = -0.4375 * R * R); } if (30 === _ && (R = (R = (p - l) / 2) * R + h) > 0) { for ( R = Math.sqrt(R), p < l && (R = -R), R = l - h / ((p - l) / 2 + R), i = 0; i <= d; i++ ) n.set(i, i, n.get(i, i) - R); (k += R), (l = p = h = 0.964); } for ( _ += 1, f = d - 2; f >= a && ((O = ((j = l - (P = n.get(f, f))) * (R = p - P) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (E = n.get(f + 1, f + 1) - P - j - R), (j = n.get(f + 2, f + 1)), (O /= R = Math.abs(O) + Math.abs(E) + Math.abs(j)), (E /= R), (j /= R), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(E) + Math.abs(j)) < x * (Math.abs(O) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(P) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= d; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= d - 1 && ((w = u !== d - 1), u !== f && ((O = n.get(u, u - 1)), (E = n.get(u + 1, u - 1)), (j = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(O) + Math.abs(E) + Math.abs(j)) && ((O /= l), (E /= l), (j /= l))), 0 !== l); u++ ) if ( ((R = Math.sqrt(O * O + E * E + j * j)), O < 0 && (R = -R), 0 !== R) ) { for ( u !== f ? n.set(u, u - 1, -R * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (O += R) / R, p = E / R, P = j / R, E /= O, j /= O, s = u; s < t; s++ ) (O = n.get(u, s) + E * n.get(u + 1, s)), w && ((O += j * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - O * P)), n.set(u, s, n.get(u, s) - O * l), n.set(u + 1, s, n.get(u + 1, s) - O * p); for (i = 0; i <= Math.min(d, u + 3); i++) (O = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((O += P * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - O * j)), n.set(i, u, n.get(i, u) - O), n.set(i, u + 1, n.get(i, u + 1) - O * E); for (i = 0; i <= M; i++) (O = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((O += P * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - O * j)), o.set(i, u, o.get(i, u) - O), o.set(i, u + 1, o.get(i, u + 1) - O * E); } } } if (0 !== S) { for (d = t - 1; d >= 0; d--) if (((O = e[d]), 0 === (E = r[d]))) for (a = d, n.set(d, d, 1), i = d - 1; i >= 0; i--) { for (h = n.get(i, i) - O, j = 0, s = a; s <= d; s++) j += n.get(i, s) * n.get(s, d); if (r[i] < 0) (P = h), (R = j); else if ( ((a = i), 0 === r[i] ? n.set(i, d, 0 !== h ? -j / h : -j / (x * S)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * R - P * j) / (E = (e[i] - O) * (e[i] - O) + r[i] * r[i])), n.set(i, d, c), n.set( i + 1, d, Math.abs(l) > Math.abs(P) ? (-j - h * c) / l : (-R - p * c) / P, )), x * (c = Math.abs(n.get(i, d))) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d, n.get(s, d) / c); } else if (E < 0) for ( a = d - 1, Math.abs(n.get(d, d - 1)) > Math.abs(n.get(d - 1, d)) ? (n.set(d - 1, d - 1, E / n.get(d, d - 1)), n.set(d - 1, d, -(n.get(d, d) - O) / n.get(d, d - 1))) : ((b = Zr( 0, -n.get(d - 1, d), n.get(d - 1, d - 1) - O, E, )), n.set(d - 1, d - 1, b[0]), n.set(d - 1, d, b[1])), n.set(d, d - 1, 0), n.set(d, d, 1), i = d - 2; i >= 0; i-- ) { for (y = 0, v = 0, s = a; s <= d; s++) (y += n.get(i, s) * n.get(s, d - 1)), (v += n.get(i, s) * n.get(s, d)); if (((h = n.get(i, i) - O), r[i] < 0)) (P = h), (j = y), (R = v); else if ( ((a = i), 0 === r[i] ? ((b = Zr(-y, -v, h, E)), n.set(i, d - 1, b[0]), n.set(i, d, b[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - O) * (e[i] - O) + r[i] * r[i] - E * E), (g = 2 * (e[i] - O) * E), 0 === m && 0 === g && (m = x * S * (Math.abs(h) + Math.abs(E) + Math.abs(l) + Math.abs(p) + Math.abs(P))), (b = Zr( l * j - P * y + E * v, l * R - P * v - E * y, m, g, )), n.set(i, d - 1, b[0]), n.set(i, d, b[1]), Math.abs(l) > Math.abs(P) + Math.abs(E) ? (n.set( i + 1, d - 1, (-y - h * n.get(i, d - 1) + E * n.get(i, d)) / l, ), n.set( i + 1, d, (-v - h * n.get(i, d) - E * n.get(i, d - 1)) / l, )) : ((b = Zr( -j - p * n.get(i, d - 1), -R - p * n.get(i, d), P, E, )), n.set(i + 1, d - 1, b[0]), n.set(i + 1, d, b[1]))), x * (c = Math.max( Math.abs(n.get(i, d - 1)), Math.abs(n.get(i, d)), )) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d - 1, n.get(s, d - 1) / c), n.set(s, d, n.get(s, d) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (P = 0, u = 0; u <= Math.min(s, M); u++) P += o.get(i, u) * n.get(u, s); o.set(i, s, P); } } } function Zr(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function $r(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var te = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Sr.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new Y(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Sr.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && $r(r.prototype, e), o && $r(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function re(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ee(t, r, e) { return ( r && re(t.prototype, r), e && re(t, e), Object.defineProperty(t, "prototype", { writable: !1 }), t ); } function oe(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var ne = ee(function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; oe(this, t), (r = Sr.checkMatrix(r)); var o, i = e.Y, s = e.scaleScores, u = void 0 !== s && s, a = e.maxIterations, f = void 0 === a ? 1e3 : a, c = e.terminationCriteria, h = void 0 === c ? 1e-10 : c; if (i) { if ( (i = n(i) && "number" == typeof i[0] ? Y.columnVector(i) : Sr.checkMatrix(i)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = i.getColumnVector(0); } else o = r.getColumnVector(0); for (var l, p, y, v, m = 1, g = 0; g < f && m > h; g++) (y = (y = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(y.norm())), (l = r.mmul(y).div(y.transpose().mmul(y).get(0, 0))), g > 0 && (m = l.clone().sub(v).pow(2).sum()), (v = l.clone()), i ? ((p = (p = i .transpose() .mmul(l) .div(l.transpose().mmul(l).get(0, 0))).div(p.norm())), (o = i.mmul(p).div(p.transpose().mmul(p).get(0, 0)))) : (o = l); if (i) { var w = r.transpose().mmul(l).div(l.transpose().mmul(l).get(0, 0)); w = w.div(w.norm()); var b = r.clone().sub(l.clone().mmul(w.transpose())), d = o.transpose().mmul(l).div(l.transpose().mmul(l).get(0, 0)), M = i.clone().sub(l.clone().mulS(d.get(0, 0)).mmul(p.transpose())); (this.t = l), (this.p = w.transpose()), (this.w = y.transpose()), (this.q = p), (this.u = o), (this.s = l.transpose().mmul(l)), (this.xResidual = b), (this.yResidual = M), (this.betas = d); } else (this.w = y.transpose()), (this.s = l.transpose().mmul(l).sqrt()), (this.t = u ? l.clone().div(this.s.get(0, 0)) : l), (this.xResidual = r.sub(l.mmul(y.transpose()))); }); }, }).default; }); //# sourceMappingURL=mdsLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/radialLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.RadialLayout = r()) : (t.RadialLayout = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 390)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 168: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(391), r); }, 390: function (t, r, e) { "use strict"; e.r(r); var o = e(168); r.default = o.RadialLayout; }, 391: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.RadialLayout = void 0); var s = e(10), u = e(9), a = i(e(392)), f = i(e(393)); function c(t, r) { return Math.sqrt( (t[0] - r[0]) * (t[0] - r[0]) + (t[1] - r[1]) * (t[1] - r[1]), ); } var h = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.maxIteration = 1e3), (e.focusNode = null), (e.unitRadius = null), (e.linkDistance = 50), (e.preventOverlap = !1), (e.strictRadial = !0), (e.maxPreventOverlapIteration = 200), (e.sortStrength = 10), (e.nodes = []), (e.edges = []), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, focusNode: null, unitRadius: null, linkDistance: 50, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, strictRadial: !0, maxPreventOverlapIteration: 200, sortBy: void 0, sortStrength: 10, }; }), (r.prototype.execute = function () { var t = this, r = t.nodes, e = t.edges || []; if (r && 0 !== r.length) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var o = t.center; if (1 === r.length) return ( (r[0].x = o[0]), (r[0].y = o[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var n = t.linkDistance, i = null; if (s.isString(t.focusNode)) { for (var u = !1, c = 0; c < r.length; c++) r[c].id === t.focusNode && ((i = r[c]), (t.focusNode = i), (u = !0), (c = r.length)); u || (i = null); } else i = t.focusNode; i || ((i = r[0]), (t.focusNode = i)); var h, l, p, y = ((h = r), (l = i.id), (p = -1), h.forEach(function (t, r) { t.id === l && (p = r); }), p); t.focusIndex = y; var v = s.getAdjMatrix({ nodes: r, edges: e }, !1), m = s.floydWarshall(v), g = t.maxToFocus(m, y); t.handleInfinity(m, y, g + 1), (t.distances = m); var w = m[y], d = t.width || 500, b = t.height || 500, M = d - o[0] > o[0] ? o[0] : d - o[0], x = b - o[1] > o[1] ? o[1] : b - o[1]; 0 === M && (M = d / 2), 0 === x && (x = b / 2); var k = x > M ? M : x, S = Math.max.apply(Math, w), O = []; w.forEach(function (r, e) { t.unitRadius || (t.unitRadius = k / S), (O[e] = r * t.unitRadius); }), (t.radii = O); var E = t.eIdealDisMatrix(); t.eIdealDistances = E; var j = (function (t) { for ( var r = t.length, e = t[0].length, o = [], n = 0; n < r; n++ ) { for (var i = [], s = 0; s < e; s++) 0 !== t[n][s] ? i.push(1 / (t[n][s] * t[n][s])) : i.push(0); o.push(i); } return o; })(E); t.weights = j; var R = new a.default({ linkDistance: n, distances: E }).layout(); R.forEach(function (t) { s.isNaN(t[0]) && (t[0] = Math.random() * n), s.isNaN(t[1]) && (t[1] = Math.random() * n); }), (t.positions = R), R.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), R.forEach(function (t) { (t[0] -= R[y][0]), (t[1] -= R[y][1]); }), t.run(); var P, _ = t.preventOverlap, T = t.nodeSize, I = t.strictRadial; if (_) { var N, C = t.nodeSpacing; (N = s.isNumber(C) ? function () { return C; } : s.isFunction(C) ? C : function () { return 0; }), (P = T ? s.isArray(T) ? function (t) { return (T[0] > T[1] ? T[0] : T[1]) + N(t); } : function (t) { return T + N(t); } : function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + N(t) : t.size + N(t) : 10 + N(t); }); var D = { nodes: r, nodeSizeFunc: P, adjMatrix: v, positions: R, radii: O, height: b, width: d, strictRadial: I, focusID: y, iterations: t.maxPreventOverlapIteration || 200, k: R.length / 4.5, }, V = new f.default(D); R = V.layout(); } return ( R.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: r, edges: e } ); } t.onLayoutEnd && t.onLayoutEnd(); }), (r.prototype.run = function () { for ( var t = this.maxIteration, r = this.positions || [], e = this.weights || [], o = this.eIdealDistances || [], n = this.radii || [], i = 0; i <= t; i++ ) { var s = i / t; this.oneIteration(s, r, n, o, e); } }), (r.prototype.oneIteration = function (t, r, e, o, n) { var i = 1 - t, s = this.focusIndex; r.forEach(function (u, a) { var f = c(u, [0, 0]), h = 0 === f ? 0 : 1 / f; if (a !== s) { var l = 0, p = 0, y = 0; r.forEach(function (t, r) { if (a !== r) { var e = c(u, t), i = 0 === e ? 0 : 1 / e, s = o[r][a]; (y += n[a][r]), (l += n[a][r] * (t[0] + s * (u[0] - t[0]) * i)), (p += n[a][r] * (t[1] + s * (u[1] - t[1]) * i)); } }); var v = 0 === e[a] ? 0 : 1 / e[a]; (y *= i), (y += t * v * v), (l *= i), (l += t * v * u[0] * h), (u[0] = l / y), (p *= i), (p += t * v * u[1] * h), (u[1] = p / y); } }); }), (r.prototype.eIdealDisMatrix = function () { var t = this, r = t.nodes; if (!r) return []; var e = t.distances, o = t.linkDistance, n = t.radii || [], i = t.unitRadius || 50, u = []; return ( e && e.forEach(function (e, a) { var f = []; e.forEach(function (e, u) { if (a === u) f.push(0); else if (n[a] === n[u]) if ("data" === t.sortBy) f.push( (e * (Math.abs(a - u) * t.sortStrength)) / (n[a] / i), ); else if (t.sortBy) { var c = r[a][t.sortBy] || 0, h = r[u][t.sortBy] || 0; s.isString(c) && (c = c.charCodeAt(0)), s.isString(h) && (h = h.charCodeAt(0)), f.push( (e * (Math.abs(c - h) * t.sortStrength)) / (n[a] / i), ); } else f.push((e * o) / (n[a] / i)); else { var l = (o + i) / 2; f.push(e * l); } }), u.push(f); }), u ); }), (r.prototype.handleInfinity = function (t, r, e) { for (var o = t.length, n = 0; n < o; n++) if (t[r][n] === 1 / 0) { (t[r][n] = e), (t[n][r] = e); for (var i = 0; i < o; i++) t[n][i] !== 1 / 0 && t[r][i] === 1 / 0 && ((t[r][i] = e + t[n][i]), (t[i][r] = e + t[n][i])); } for (n = 0; n < o; n++) if (n !== r) for (i = 0; i < o; i++) if (t[n][i] === 1 / 0) { var s = Math.abs(t[r][n] - t[r][i]); (s = 0 === s ? 1 : s), (t[n][i] = s); } }), (r.prototype.maxToFocus = function (t, r) { for (var e = 0, o = 0; o < t[r].length; o++) t[r][o] !== 1 / 0 && (e = t[r][o] > e ? t[r][o] : e); return e; }), (r.prototype.getType = function () { return "radial"; }), r ); })(u.Base); r.RadialLayout = h; }, 392: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = e(96), n = (function () { function t(t) { (this.distances = t.distances), (this.dimension = t.dimension || 2), (this.linkDistance = t.linkDistance); } return ( (t.prototype.layout = function () { var t = this.dimension, r = this.distances, e = this.linkDistance; try { var n = o.Matrix.mul(o.Matrix.pow(r, 2), -0.5), i = n.mean("row"), s = n.mean("column"), u = n.mean(); n.add(u).subRowVector(i).subColumnVector(s); var a = new o.SingularValueDecomposition(n), f = o.Matrix.sqrt(a.diagonalMatrix).diagonal(); return a.leftSingularVectors.toJSON().map(function (r) { return o.Matrix.mul([r], [f]).toJSON()[0].splice(0, t); }); } catch (t) { for (var c = [], h = 0; h < r.length; h++) { var l = Math.random() * e, p = Math.random() * e; c.push([l, p]); } return c; } }), t ); })(); r.default = n; }, 393: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = (function () { function t(t) { (this.disp = []), (this.positions = t.positions), (this.adjMatrix = t.adjMatrix), (this.focusID = t.focusID), (this.radii = t.radii), (this.iterations = t.iterations || 10), (this.height = t.height || 10), (this.width = t.width || 10), (this.speed = t.speed || 100), (this.gravity = t.gravity || 10), (this.nodeSizeFunc = t.nodeSizeFunc), (this.k = t.k || 5), (this.strictRadial = t.strictRadial), (this.nodes = t.nodes); } return ( (t.prototype.layout = function () { var t = this.positions, r = [], e = this.iterations, o = this.width / 10; (this.maxDisplace = o), (this.disp = r); for (var n = 0; n < e; n++) t.forEach(function (t, e) { r[e] = { x: 0, y: 0 }; }), this.getRepulsion(), this.updatePositions(); return t; }), (t.prototype.getRepulsion = function () { var t = this, r = t.positions, e = t.nodes, o = t.disp, n = t.k, i = t.radii || []; r.forEach(function (s, u) { (o[u] = { x: 0, y: 0 }), r.forEach(function (r, a) { if (u !== a && i[u] === i[a]) { var f = s[0] - r[0], c = s[1] - r[1], h = Math.sqrt(f * f + c * c); if (0 === h) { h = 1; var l = u > a ? 1 : -1; (f = 0.01 * l), (c = 0.01 * l); } if ( h < t.nodeSizeFunc(e[u]) / 2 + t.nodeSizeFunc(e[a]) / 2 ) { var p = (n * n) / h; (o[u].x += (f / h) * p), (o[u].y += (c / h) * p); } } }); }); }), (t.prototype.updatePositions = function () { var t = this.positions, r = this.disp, e = this.speed, o = this.strictRadial, n = this.focusID, i = this.maxDisplace || this.width / 10; o && r.forEach(function (r, e) { var o = t[e][0] - t[n][0], i = t[e][1] - t[n][1], s = Math.sqrt(o * o + i * i), u = i / s, a = -o / s, f = Math.sqrt(r.x * r.x + r.y * r.y), c = Math.acos((u * r.x + a * r.y) / f); c > Math.PI / 2 && ((c -= Math.PI / 2), (u *= -1), (a *= -1)); var h = Math.cos(c) * f; (r.x = u * h), (r.y = a * h); }); var s = this.radii; t.forEach(function (u, a) { if (a !== n) { var f = Math.sqrt(r[a].x * r[a].x + r[a].y * r[a].y); if (f > 0 && a !== n) { var c = Math.min(i * (e / 800), f); if ( ((u[0] += (r[a].x / f) * c), (u[1] += (r[a].y / f) * c), o) ) { var h = u[0] - t[n][0], l = u[1] - t[n][1], p = Math.sqrt(h * h + l * l); (h = (h / p) * s[a]), (l = (l / p) * s[a]), (u[0] = t[n][0] + h), (u[1] = t[n][1] + l); } } } }); }), t ); })(); r.default = o; }, 9: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, 96: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return U; }), e.d(r, "default", function () { return H; }), e.d(r, "Matrix", function () { return H; }), e.d(r, "MatrixColumnView", function () { return ut; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return Mt; }), e.d(r, "MatrixFlipRowView", function () { return Rt; }), e.d(r, "MatrixRowView", function () { return Dt; }), e.d(r, "MatrixRowSelectionView", function () { return Lt; }), e.d(r, "MatrixSelectionView", function () { return Kt; }), e.d(r, "MatrixSubView", function () { return er; }), e.d(r, "MatrixTransposeView", function () { return fr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return gr; }), e.d(r, "WrapperMatrix2D", function () { return Sr; }), e.d(r, "solve", function () { return Dr; }), e.d(r, "inverse", function () { return Cr; }), e.d(r, "determinant", function () { return Vr; }), e.d(r, "linearDependencies", function () { return Fr; }), e.d(r, "pseudoInverse", function () { return Br; }), e.d(r, "covariance", function () { return Lr; }), e.d(r, "correlation", function () { return Wr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Hr; }), e.d(r, "EVD", function () { return Hr; }), e.d(r, "CholeskyDecomposition", function () { return te; }), e.d(r, "CHO", function () { return te; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return _r; }), e.d(r, "QR", function () { return _r; }), e.d(r, "Nipals", function () { return ne; }), e.d(r, "NIPALS", function () { return ne; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } function i(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; } function s(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; } function u(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError("output option must be an array if specified"); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; } var a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function v(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function g(t, r) { if (!n(r)) throw new TypeError("row indices must be an array"); for (var e = 0; e < r.length; e++) if (r[e] < 0 || r[e] >= t.rows) throw new RangeError("row indices are out of range"); } function w(t, r) { if (!n(r)) throw new TypeError("column indices must be an array"); for (var e = 0; e < r.length; e++) if (r[e] < 0 || r[e] >= t.columns) throw new RangeError("column indices are out of range"); } function d(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (M("startRow", r), M("endRow", e), M("startColumn", o), M("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function b(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function M(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function x(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function k(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function S(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function O(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function E(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function R(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function P(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function T(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function I(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function N(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function C(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function D(t, r) { return (D = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function V(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = A(t); if (r) { var n = A(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return q(this, e); }; } function q(t, r) { if (r && ("object" === F(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function A(t) { return (A = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function F(t) { return (F = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function B(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function z(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function L(t, r, e) { return ( r && z(t.prototype, r), e && z(t, e), Object.defineProperty(t, "prototype", { writable: !1 }), t ); } var U = (function () { function t() { B(this, t); } return ( L( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new H(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { p(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return H.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { p(this, t), (r = v(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { p(this, t), p(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return H.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = m(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = v(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { p(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { x(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { x(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((p(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { p(this, t), x(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((p(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { p(this, t), x(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), x(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), x(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = H.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new H(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = H.checkMatrix(t); var r = new H(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), y = (e + n) * f, v = c + p - y + (n - a) * (u + f), m = l + y, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, v), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = H.checkMatrix(t); var r = new H(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), y = t.get(1, 0), v = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), d = t.get(2, 2), b = (e - i) * (-l + v), M = (-e + i + s) * (h - l + v), x = (i + s) * (-h + l), k = e * h, S = (-e + a + f) * (h - p + m), O = (-e + a) * (p - m), E = (a + f) * (-h + p), j = (-n + f + c) * (v + g - w), R = (n - c) * (v - w), P = n * g, _ = (f + c) * (-g + w), T = (-n + s + u) * (m + g - d), I = (n - u) * (m - d), N = (s + u) * (-g + d), C = k + P + o * y, D = (e + o + n - i - s - f - c) * v + M + x + k + j + P + _, V = k + S + E + (e + o + n - s - u - a - f) * m + P + T + N, q = b + s * (-h + l + y - v - m - g + d) + M + k + P + T + I, A = b + M + x + k + u * w, F = P + T + I + N + i * p, B = k + S + O + f * (-h + p + y - v - m - g + w) + j + R + P, z = j + R + P + _ + a * l, L = k + S + O + E + c * d; return ( r.set(0, 0, C), r.set(0, 1, D), r.set(0, 2, V), r.set(1, 0, q), r.set(1, 1, A), r.set(1, 2, F), r.set(2, 0, B), r.set(2, 1, z), r.set(2, 2, L), r ); }, }, { key: "mmulStrassen", value: function (r) { r = H.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), y = o.subMatrix(s, o.rows - 1, 0, a - 1), v = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, v), t.add(c, m), s, a), w = r(t.add(p, v), c, s, a), d = r(f, t.sub(l, m), s, a), b = r(v, t.sub(y, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), k = r(t.sub(h, v), t.add(y, m), s, a), S = t.add(g, b); S.sub(M), S.add(k); var O = t.add(d, M), E = t.add(w, b), j = t.sub(g, w); j.add(d), j.add(x); var R = t.zeros(2 * S.rows, 2 * S.columns); return (R = (R = (R = (R = R.setSubMatrix( S, 0, 0, )).setSubMatrix(O, S.rows, 0)).setSubMatrix( E, 0, S.columns, )).setSubMatrix(j, S.rows, S.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new H(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== F(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new H(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = H.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new H(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = H.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(H.eye(e, e)), n = H.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new H(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : W, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : W, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { d(this, t, r, e, o); for (var n = new H(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new H(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new H(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = H.checkMatrix(t)).isEmpty()) return this; d(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { g(this, t), w(this, r); for ( var e = new H(t.length, r.length), o = 0; o < t.length; o++ ) for (var n = t[o], i = 0; i < r.length; i++) { var s = r[i]; e.set(o, i, this.get(n, s)); } return e; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new H(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = b(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = b(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = b(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = b(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, i = void 0 === o || o, s = e.mean, u = void 0 === s ? this.mean(t) : s; if ("boolean" != typeof i) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!n(u)) throw new TypeError("mean must be an array"); return k(this, i, u); case "column": if (!n(u)) throw new TypeError("mean must be an array"); return S(this, i, u); case void 0: if ("number" != typeof u) throw new TypeError("mean must be a number"); return O(this, i, u); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === F(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, i = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!n(i)) throw new TypeError("center must be an array"); return E(this, i), this; case "column": if (!n(i)) throw new TypeError("center must be an array"); return j(this, i), this; case void 0: if ("number" != typeof i) throw new TypeError("center must be a number"); return R(this, i), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === F(t) && ((r = t), (t = void 0)), "object" !== F(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = P(this); else if (!n(e)) throw new TypeError("scale must be an array"); return _(this, e), this; case "column": if (void 0 === e) e = T(this); else if (!n(e)) throw new TypeError("scale must be an array"); return I(this, e), this; case void 0: if (void 0 === e) e = N(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return C(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new H(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new H(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new H(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new H(t, r); }, }, { key: "ones", value: function (t, r) { return new H(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== F(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new H(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== F(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new H(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new H(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new H(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function W(t, r) { return t - r; } (U.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (U.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (U.random = U.rand), (U.randomInt = U.randInt), (U.diagonal = U.diag), (U.prototype.diagonal = U.prototype.diag), (U.identity = U.eye), (U.prototype.negate = U.prototype.neg), (U.prototype.tensorProduct = U.prototype.kroneckerProduct); var Q, J, H = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && D(t, r); })(e, t); var r = V(e); function e(t, o) { var i; if ((B(this, e), (i = r.call(this)), e.isMatrix(t))) return q(i, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((i.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var s = 0; s < t; s++) i.data.push(new Float64Array(o)); } else { if (!n(t)) throw new TypeError( "First argument must be a positive number or an array", ); var u = t; if ("number" != typeof (o = (t = u.length) ? u[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); i.data = []; for (var a = 0; a < t; a++) { if (u[a].length !== o) throw new RangeError("Inconsistent array dimensions"); i.data.push(Float64Array.from(u[a])); } } return (i.rows = t), (i.columns = o), i; } return ( L(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( p(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), p(this, t, !0), (r = Float64Array.from(v(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = m(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(U); function Y(t) { return (Y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function K(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function X(t, r) { return (X = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function G(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = $(t); if (r) { var n = $(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Z(this, e); }; } function Z(t, r) { if (r && ("object" === Y(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function $(t) { return ($ = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (J = H), ((Q = U).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (Q.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (Q.prototype.addM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (Q.add = function (t, r) { return new J(t).add(r); }), (Q.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (Q.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (Q.prototype.subM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (Q.sub = function (t, r) { return new J(t).sub(r); }), (Q.prototype.subtract = Q.prototype.sub), (Q.prototype.subtractS = Q.prototype.subS), (Q.prototype.subtractM = Q.prototype.subM), (Q.subtract = Q.sub), (Q.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (Q.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (Q.prototype.mulM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (Q.mul = function (t, r) { return new J(t).mul(r); }), (Q.prototype.multiply = Q.prototype.mul), (Q.prototype.multiplyS = Q.prototype.mulS), (Q.prototype.multiplyM = Q.prototype.mulM), (Q.multiply = Q.mul), (Q.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (Q.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (Q.prototype.divM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (Q.div = function (t, r) { return new J(t).div(r); }), (Q.prototype.divide = Q.prototype.div), (Q.prototype.divideS = Q.prototype.divS), (Q.prototype.divideM = Q.prototype.divM), (Q.divide = Q.div), (Q.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (Q.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (Q.prototype.modM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (Q.mod = function (t, r) { return new J(t).mod(r); }), (Q.prototype.modulus = Q.prototype.mod), (Q.prototype.modulusS = Q.prototype.modS), (Q.prototype.modulusM = Q.prototype.modM), (Q.modulus = Q.mod), (Q.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (Q.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (Q.prototype.andM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (Q.and = function (t, r) { return new J(t).and(r); }), (Q.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (Q.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (Q.prototype.orM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (Q.or = function (t, r) { return new J(t).or(r); }), (Q.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (Q.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (Q.prototype.xorM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (Q.xor = function (t, r) { return new J(t).xor(r); }), (Q.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (Q.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (Q.prototype.leftShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (Q.leftShift = function (t, r) { return new J(t).leftShift(r); }), (Q.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (Q.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (Q.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (Q.signPropagatingRightShift = function (t, r) { return new J(t).signPropagatingRightShift(r); }), (Q.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (Q.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (Q.prototype.rightShiftM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (Q.rightShift = function (t, r) { return new J(t).rightShift(r); }), (Q.prototype.zeroFillRightShift = Q.prototype.rightShift), (Q.prototype.zeroFillRightShiftS = Q.prototype.rightShiftS), (Q.prototype.zeroFillRightShiftM = Q.prototype.rightShiftM), (Q.zeroFillRightShift = Q.rightShift), (Q.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (Q.not = function (t) { return new J(t).not(); }), (Q.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (Q.abs = function (t) { return new J(t).abs(); }), (Q.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (Q.acos = function (t) { return new J(t).acos(); }), (Q.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (Q.acosh = function (t) { return new J(t).acosh(); }), (Q.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (Q.asin = function (t) { return new J(t).asin(); }), (Q.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (Q.asinh = function (t) { return new J(t).asinh(); }), (Q.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (Q.atan = function (t) { return new J(t).atan(); }), (Q.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (Q.atanh = function (t) { return new J(t).atanh(); }), (Q.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (Q.cbrt = function (t) { return new J(t).cbrt(); }), (Q.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (Q.ceil = function (t) { return new J(t).ceil(); }), (Q.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (Q.clz32 = function (t) { return new J(t).clz32(); }), (Q.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (Q.cos = function (t) { return new J(t).cos(); }), (Q.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (Q.cosh = function (t) { return new J(t).cosh(); }), (Q.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (Q.exp = function (t) { return new J(t).exp(); }), (Q.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (Q.expm1 = function (t) { return new J(t).expm1(); }), (Q.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (Q.floor = function (t) { return new J(t).floor(); }), (Q.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (Q.fround = function (t) { return new J(t).fround(); }), (Q.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (Q.log = function (t) { return new J(t).log(); }), (Q.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (Q.log1p = function (t) { return new J(t).log1p(); }), (Q.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (Q.log10 = function (t) { return new J(t).log10(); }), (Q.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (Q.log2 = function (t) { return new J(t).log2(); }), (Q.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (Q.round = function (t) { return new J(t).round(); }), (Q.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (Q.sign = function (t) { return new J(t).sign(); }), (Q.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (Q.sin = function (t) { return new J(t).sin(); }), (Q.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (Q.sinh = function (t) { return new J(t).sinh(); }), (Q.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (Q.sqrt = function (t) { return new J(t).sqrt(); }), (Q.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (Q.tan = function (t) { return new J(t).tan(); }), (Q.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (Q.tanh = function (t) { return new J(t).tanh(); }), (Q.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (Q.trunc = function (t) { return new J(t).trunc(); }), (Q.pow = function (t, r) { return new J(t).pow(r); }), (Q.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (Q.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (Q.prototype.powM = function (t) { if ( ((t = J.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var tt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && X(t, r); })(i, t); var r, e, o, n = G(i); function i(t, r, e) { var o; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((o = n.call(this)).matrix = t), (o.rows = r), (o.columns = e), o ); } return ( (r = i), e && K(r.prototype, e), o && K(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), r ); })(U); function rt(t) { return (rt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function et(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ot(t, r) { return (ot = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function nt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = st(t); if (r) { var n = st(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return it(this, e); }; } function it(t, r) { if (r && ("object" === rt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function st(t) { return (st = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ot(t, r); })(i, t); var r, e, o, n = nt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && et(r.prototype, e), o && et(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function at(t) { return (at = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ft(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ct(t, r) { return (ct = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ht(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = pt(t); if (r) { var n = pt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return lt(this, e); }; } function lt(t, r) { if (r && ("object" === at(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function pt(t) { return (pt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ct(t, r); })(i, t); var r, e, o, n = ht(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), w(t, r), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ft(r.prototype, e), o && ft(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function vt(t) { return (vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function mt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function gt(t, r) { return (gt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function wt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = bt(t); if (r) { var n = bt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return dt(this, e); }; } function dt(t, r) { if (r && ("object" === vt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function bt(t) { return (bt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Mt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && gt(t, r); })(i, t); var r, e, o, n = wt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && mt(r.prototype, e), o && mt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function xt(t) { return (xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function kt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function St(t, r) { return (St = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Et(this, e); }; } function Et(t, r) { if (r && ("object" === xt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && St(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && kt(r.prototype, e), o && kt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function _t(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Tt(t, r) { return (Tt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function It(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Ct(t); if (r) { var n = Ct(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { if (r && ("object" === Pt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Dt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Tt(t, r); })(i, t); var r, e, o, n = It(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), p(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && _t(r.prototype, e), o && _t(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Vt(t) { return (Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ft(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = zt(t); if (r) { var n = zt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Bt(this, e); }; } function Bt(t, r) { if (r && ("object" === Vt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function zt(t) { return (zt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Lt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && At(t, r); })(i, t); var r, e, o, n = Ft(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), g(t, r), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && qt(r.prototype, e), o && qt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Ut(t) { return (Ut = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Wt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Qt(t, r) { return (Qt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Jt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Yt(t); if (r) { var n = Yt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Ht(this, e); }; } function Ht(t, r) { if (r && ("object" === Ut(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Yt(t) { return (Yt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Kt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Qt(t, r); })(i, t); var r, e, o, n = Jt(i); function i(t, r, e) { var o; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), g(t, r), w(t, e), ((o = n.call(this, t, r.length, e.length)).rowIndices = r), (o.columnIndices = e), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Wt(r.prototype, e), o && Wt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function Xt(t) { return (Xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Zt(t, r) { return (Zt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function $t(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = rr(t); if (r) { var n = rr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return tr(this, e); }; } function tr(t, r) { if (r && ("object" === Xt(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function rr(t) { return (rr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && Zt(t, r); })(i, t); var r, e, o, n = $t(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), d(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Gt(r.prototype, e), o && Gt(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function or(t) { return (or = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function nr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ir(t, r) { return (ir = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function sr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ar(t); if (r) { var n = ar(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ur(this, e); }; } function ur(t, r) { if (r && ("object" === or(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ar(t) { return (ar = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var fr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && ir(t, r); })(i, t); var r, e, o, n = sr(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && nr(r.prototype, e), o && nr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(tt); function cr(t) { return (cr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function hr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function lr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function pr(t, r) { return (pr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = mr(t); if (r) { var n = mr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return vr(this, e); }; } function vr(t, r) { if (r && ("object" === cr(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function mr(t) { return (mr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var gr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && pr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; hr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && lr(r.prototype, e), o && lr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(U); function wr(t) { return (wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function dr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function br(t, r) { return (br = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Mr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = kr(t); if (r) { var n = kr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return xr(this, e); }; } function xr(t, r) { if (r && ("object" === wr(r) || "function" == typeof r)) return r; if (void 0 !== r) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function kr(t) { return (kr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Sr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), r && br(t, r); })(i, t); var r, e, o, n = Mr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && dr(r.prototype, e), o && dr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), i ); })(U); function Or(t, r) { if (n(t)) return t[0] && n(t[0]) ? new Sr(t) : new gr(t, r); throw new Error("the argument is not an array"); } function Er(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Sr.checkMatrix(r)).clone(), l = h.rows, p = h.columns, y = new Float64Array(l), v = 1; for (e = 0; e < l; e++) y[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = y[i]), (y[i] = y[o]), (y[o] = a), (v = -v); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = y), (this.pivotSign = v); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = H.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new H(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new H(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Er(r.prototype, e), o && Er(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Rr(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var _r = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Sr.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = Rr(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = H.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new H(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new H(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Tr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Tr(this, t), (r = Sr.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), y = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (y = !0); var v = l; (l = p), (p = v); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), d = new H(n, m), b = new H(i, i), M = new Float64Array(i), x = new Float64Array(n), k = new Float64Array(g), S = 0; S < g; S++ ) k[S] = S; for ( var O = Math.min(n - 1, i), E = Math.max(0, Math.min(i - 2, n)), j = Math.max(O, E), R = 0; R < j; R++ ) { if (R < O) { w[R] = 0; for (var P = R; P < n; P++) w[R] = Rr(w[R], o.get(P, R)); if (0 !== w[R]) { o.get(R, R) < 0 && (w[R] = -w[R]); for (var _ = R; _ < n; _++) o.set(_, R, o.get(_, R) / w[R]); o.set(R, R, o.get(R, R) + 1); } w[R] = -w[R]; } for (var T = R + 1; T < i; T++) { if (R < O && 0 !== w[R]) { for (var I = 0, N = R; N < n; N++) I += o.get(N, R) * o.get(N, T); I = -I / o.get(R, R); for (var C = R; C < n; C++) o.set(C, T, o.get(C, T) + I * o.get(C, R)); } M[T] = o.get(R, T); } if (l && R < O) for (var D = R; D < n; D++) d.set(D, R, o.get(D, R)); if (R < E) { M[R] = 0; for (var V = R + 1; V < i; V++) M[R] = Rr(M[R], M[V]); if (0 !== M[R]) { M[R + 1] < 0 && (M[R] = 0 - M[R]); for (var q = R + 1; q < i; q++) M[q] /= M[R]; M[R + 1] += 1; } if (((M[R] = -M[R]), R + 1 < n && 0 !== M[R])) { for (var A = R + 1; A < n; A++) x[A] = 0; for (var F = R + 1; F < n; F++) for (var B = R + 1; B < i; B++) x[F] += M[B] * o.get(F, B); for (var z = R + 1; z < i; z++) for (var L = -M[z] / M[R + 1], U = R + 1; U < n; U++) o.set(U, z, o.get(U, z) + L * x[U]); } if (p) for (var W = R + 1; W < i; W++) b.set(W, R, M[W]); } } var Q = Math.min(i, n + 1); if ( (O < i && (w[O] = o.get(O, O)), n < Q && (w[Q - 1] = 0), E + 1 < Q && (M[E] = o.get(E, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = O; J < m; J++) { for (var Y = 0; Y < n; Y++) d.set(Y, J, 0); d.set(J, J, 1); } for (var K = O - 1; K >= 0; K--) if (0 !== w[K]) { for (var X = K + 1; X < m; X++) { for (var G = 0, Z = K; Z < n; Z++) G += d.get(Z, K) * d.get(Z, X); G = -G / d.get(K, K); for (var $ = K; $ < n; $++) d.set($, X, d.get($, X) + G * d.get($, K)); } for (var tt = K; tt < n; tt++) d.set(tt, K, -d.get(tt, K)); d.set(K, K, 1 + d.get(K, K)); for (var rt = 0; rt < K - 1; rt++) d.set(rt, K, 0); } else { for (var et = 0; et < n; et++) d.set(et, K, 0); d.set(K, K, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < E && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += b.get(st, ot) * b.get(st, nt); it = -it / b.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) b.set(ut, nt, b.get(ut, nt) + it * b.get(ut, ot)); } for (var at = 0; at < i; at++) b.set(at, ot, 0); b.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var yt = void 0; for (yt = Q - 1; yt >= ht && yt !== ht; yt--) { var vt = (yt !== Q ? Math.abs(M[yt]) : 0) + (yt !== ht + 1 ? Math.abs(M[yt - 1]) : 0); if (Math.abs(w[yt]) <= ct * vt) { w[yt] = 0; break; } } yt === ht ? (lt = 3) : yt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = yt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = Rr(w[gt], mt), dt = w[gt] / wt, bt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -bt * M[gt - 1]), (M[gt - 1] = dt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = dt * b.get(Mt, gt) + bt * b.get(Mt, Q - 1)), b.set( Mt, Q - 1, -bt * b.get(Mt, gt) + dt * b.get(Mt, Q - 1), ), b.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var kt = ht; kt < Q; kt++) { var St = Rr(w[kt], xt), Ot = w[kt] / St, Et = xt / St; if ( ((w[kt] = St), (xt = -Et * M[kt]), (M[kt] = Ot * M[kt]), l) ) for (var jt = 0; jt < n; jt++) (St = Ot * d.get(jt, kt) + Et * d.get(jt, ht - 1)), d.set( jt, ht - 1, -Et * d.get(jt, kt) + Ot * d.get(jt, ht - 1), ), d.set(jt, kt, St); } break; case 3: var Rt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), Pt = w[Q - 1] / Rt, _t = w[Q - 2] / Rt, Tt = M[Q - 2] / Rt, It = w[ht] / Rt, Nt = M[ht] / Rt, Ct = ((_t + Pt) * (_t - Pt) + Tt * Tt) / 2, Dt = Pt * Tt * (Pt * Tt), Vt = 0; (0 === Ct && 0 === Dt) || (Vt = Dt / (Ct + (Vt = Ct < 0 ? 0 - Math.sqrt(Ct * Ct + Dt) : Math.sqrt(Ct * Ct + Dt)))); for ( var qt = (It + Pt) * (It - Pt) + Vt, At = It * Nt, Ft = ht; Ft < Q - 1; Ft++ ) { var Bt = Rr(qt, At); 0 === Bt && (Bt = Number.MIN_VALUE); var zt = qt / Bt, Lt = At / Bt; if ( (Ft !== ht && (M[Ft - 1] = Bt), (qt = zt * w[Ft] + Lt * M[Ft]), (M[Ft] = zt * M[Ft] - Lt * w[Ft]), (At = Lt * w[Ft + 1]), (w[Ft + 1] = zt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Bt = zt * b.get(Ut, Ft) + Lt * b.get(Ut, Ft + 1)), b.set( Ut, Ft + 1, -Lt * b.get(Ut, Ft) + zt * b.get(Ut, Ft + 1), ), b.set(Ut, Ft, Bt); if ( (0 === (Bt = Rr(qt, At)) && (Bt = Number.MIN_VALUE), (zt = qt / Bt), (Lt = At / Bt), (w[Ft] = Bt), (qt = zt * M[Ft] + Lt * w[Ft + 1]), (w[Ft + 1] = -Lt * M[Ft] + zt * w[Ft + 1]), (At = Lt * M[Ft + 1]), (M[Ft + 1] = zt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Bt = zt * d.get(Wt, Ft) + Lt * d.get(Wt, Ft + 1)), d.set( Wt, Ft + 1, -Lt * d.get(Wt, Ft) + zt * d.get(Wt, Ft + 1), ), d.set(Wt, Ft, Bt); } (M[Q - 2] = qt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) b.set(Qt, ht, -b.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Ht = 0; Ht < i; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); if (l && ht < n - 1) for (var Yt = 0; Yt < n; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); ht++; } 0, Q--; } } if (y) { var Kt = b; (b = d), (d = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = d), (this.V = b); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = H.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = H.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var y = 0, v = 0; v < o; v++) y += a.get(l, v) * s.get(p, v); h.set(l, p, y); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(H.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new H(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new H(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, y = 0; y < f; y++) p += n.get(h, y) * u.get(l, y); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return H.diag(this.s); }, }, ]) && Ir(r.prototype, e), o && Ir(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Cr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Sr.checkMatrix(t)), r ? new Nr(t).inverse() : Dr(t, H.eye(t.rows)) ); } function Dr(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Sr.checkMatrix(t)), (r = Sr.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new _r(t).solve(r) ); } function Vr(t) { var r, e, o, n, i, s; if ((t = H.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Kt(t, [1, 2], [1, 2])), (i = new Kt(t, [1, 2], [0, 2])), (s = new Kt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * Vr(n) - e * Vr(i) + o * Vr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function qr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Ar(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Fr(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = H.checkMatrix(t)).rows, u = new H(s, s), a = 0; a < s; a++ ) { var f = H.columnVector(t.getRow(a)), c = t.subMatrixRow(qr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = H.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Ar(p, l, a, o, i)); } return u; } function Br(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = H.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(H.diag(i).mmul(o.transpose())); } function zr(t) { return (zr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Lr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new H(t); var o = !1; if ( ("object" !== zr(r) || H.isMatrix(r) || n(r) ? (r = new H(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var i = e, s = i.center, u = void 0 === s || s; u && ((t = t.center("column")), o || (r = r.center("column"))); for (var a = t.transpose().mmul(r), f = 0; f < a.rows; f++) for (var c = 0; c < a.columns; c++) a.set(f, c, a.get(f, c) * (1 / (t.rows - 1))); return a; } function Ur(t) { return (Ur = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Wr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new H(t); var o = !1; if ( ("object" !== Ur(r) || H.isMatrix(r) || n(r) ? (r = new H(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var i = e, s = i.center, u = void 0 === s || s, a = i.scale, f = void 0 === a || a; u && (t.center("column"), o || r.center("column")), f && (t.scale("column"), o || r.scale("column")); for ( var c = t.standardDeviation("column", { unbiased: !0 }), h = o ? c : r.standardDeviation("column", { unbiased: !0 }), l = t.transpose().mmul(r), p = 0; p < l.rows; p++ ) for (var y = 0; y < l.columns; y++) l.set(p, y, l.get(p, y) * (1 / (c[p] * h[y])) * (1 / (t.rows - 1))); return l; } function Qr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Jr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Hr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Qr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Sr.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new H(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Yr(u, c, f, a), Kr(u, c, f, a); } else { var l = new H(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Xr(u, l, p, a), Gr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new H(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Jr(r.prototype, e), o && Jr(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function Yr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, y, v, m, g, w, d; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var b = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = Rr((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( b += i, h = e[c], v = y = 1, m = y, g = r[f + 1], w = 0, d = 0, s = c - 1; s >= f; s-- ) for ( m = v, v = y, d = w, n = y * r[s], i = y * h, l = Rr(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (y = h / l) * e[s] - w * n, e[s + 1] = i + w * (y * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + y * i), o.set(a, s, y * o.get(a, s) - w * i); (h = (-w * d * m * g * r[f]) / p), (r[f] = w * h), (e[f] = y * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + b), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Gr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, y, v, m, g, w, d, b = t - 1, M = t - 1, x = Number.EPSILON, k = 0, S = 0, O = 0, E = 0, j = 0, R = 0, P = 0, _ = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) S += Math.abs(n.get(i, s)); for (; b >= 0; ) { for ( a = b; a > 0 && (0 === (R = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (R = S), !(Math.abs(n.get(a, a - 1)) < x * R)); ) a--; if (a === b) n.set(b, b, n.get(b, b) + k), (e[b] = n.get(b, b)), (r[b] = 0), b--, (_ = 0); else if (a === b - 1) { if ( ((h = n.get(b, b - 1) * n.get(b - 1, b)), (E = (O = (n.get(b - 1, b - 1) - n.get(b, b)) / 2) * O + h), (P = Math.sqrt(Math.abs(E))), n.set(b, b, n.get(b, b) + k), n.set(b - 1, b - 1, n.get(b - 1, b - 1) + k), (l = n.get(b, b)), E >= 0) ) { for ( P = O >= 0 ? O + P : O - P, e[b - 1] = l + P, e[b] = e[b - 1], 0 !== P && (e[b] = l - h / P), r[b - 1] = 0, r[b] = 0, O = (l = n.get(b, b - 1)) / (R = Math.abs(l) + Math.abs(P)), E = P / R, O /= j = Math.sqrt(O * O + E * E), E /= j, s = b - 1; s < t; s++ ) (P = n.get(b - 1, s)), n.set(b - 1, s, E * P + O * n.get(b, s)), n.set(b, s, E * n.get(b, s) - O * P); for (i = 0; i <= b; i++) (P = n.get(i, b - 1)), n.set(i, b - 1, E * P + O * n.get(i, b)), n.set(i, b, E * n.get(i, b) - O * P); for (i = 0; i <= M; i++) (P = o.get(i, b - 1)), o.set(i, b - 1, E * P + O * o.get(i, b)), o.set(i, b, E * o.get(i, b) - O * P); } else (e[b - 1] = l + O), (e[b] = l + O), (r[b - 1] = P), (r[b] = -P); (b -= 2), (_ = 0); } else { if ( ((l = n.get(b, b)), (p = 0), (h = 0), a < b && ((p = n.get(b - 1, b - 1)), (h = n.get(b, b - 1) * n.get(b - 1, b))), 10 === _) ) { for (k += l, i = 0; i <= b; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (R = Math.abs(n.get(b, b - 1)) + Math.abs(n.get(b - 1, b - 2)))), (h = -0.4375 * R * R); } if (30 === _ && (R = (R = (p - l) / 2) * R + h) > 0) { for ( R = Math.sqrt(R), p < l && (R = -R), R = l - h / ((p - l) / 2 + R), i = 0; i <= b; i++ ) n.set(i, i, n.get(i, i) - R); (k += R), (l = p = h = 0.964); } for ( _ += 1, f = b - 2; f >= a && ((O = ((j = l - (P = n.get(f, f))) * (R = p - P) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (E = n.get(f + 1, f + 1) - P - j - R), (j = n.get(f + 2, f + 1)), (O /= R = Math.abs(O) + Math.abs(E) + Math.abs(j)), (E /= R), (j /= R), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(E) + Math.abs(j)) < x * (Math.abs(O) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(P) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= b; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= b - 1 && ((w = u !== b - 1), u !== f && ((O = n.get(u, u - 1)), (E = n.get(u + 1, u - 1)), (j = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(O) + Math.abs(E) + Math.abs(j)) && ((O /= l), (E /= l), (j /= l))), 0 !== l); u++ ) if ( ((R = Math.sqrt(O * O + E * E + j * j)), O < 0 && (R = -R), 0 !== R) ) { for ( u !== f ? n.set(u, u - 1, -R * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (O += R) / R, p = E / R, P = j / R, E /= O, j /= O, s = u; s < t; s++ ) (O = n.get(u, s) + E * n.get(u + 1, s)), w && ((O += j * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - O * P)), n.set(u, s, n.get(u, s) - O * l), n.set(u + 1, s, n.get(u + 1, s) - O * p); for (i = 0; i <= Math.min(b, u + 3); i++) (O = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((O += P * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - O * j)), n.set(i, u, n.get(i, u) - O), n.set(i, u + 1, n.get(i, u + 1) - O * E); for (i = 0; i <= M; i++) (O = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((O += P * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - O * j)), o.set(i, u, o.get(i, u) - O), o.set(i, u + 1, o.get(i, u + 1) - O * E); } } } if (0 !== S) { for (b = t - 1; b >= 0; b--) if (((O = e[b]), 0 === (E = r[b]))) for (a = b, n.set(b, b, 1), i = b - 1; i >= 0; i--) { for (h = n.get(i, i) - O, j = 0, s = a; s <= b; s++) j += n.get(i, s) * n.get(s, b); if (r[i] < 0) (P = h), (R = j); else if ( ((a = i), 0 === r[i] ? n.set(i, b, 0 !== h ? -j / h : -j / (x * S)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * R - P * j) / (E = (e[i] - O) * (e[i] - O) + r[i] * r[i])), n.set(i, b, c), n.set( i + 1, b, Math.abs(l) > Math.abs(P) ? (-j - h * c) / l : (-R - p * c) / P, )), x * (c = Math.abs(n.get(i, b))) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b, n.get(s, b) / c); } else if (E < 0) for ( a = b - 1, Math.abs(n.get(b, b - 1)) > Math.abs(n.get(b - 1, b)) ? (n.set(b - 1, b - 1, E / n.get(b, b - 1)), n.set(b - 1, b, -(n.get(b, b) - O) / n.get(b, b - 1))) : ((d = Zr( 0, -n.get(b - 1, b), n.get(b - 1, b - 1) - O, E, )), n.set(b - 1, b - 1, d[0]), n.set(b - 1, b, d[1])), n.set(b, b - 1, 0), n.set(b, b, 1), i = b - 2; i >= 0; i-- ) { for (y = 0, v = 0, s = a; s <= b; s++) (y += n.get(i, s) * n.get(s, b - 1)), (v += n.get(i, s) * n.get(s, b)); if (((h = n.get(i, i) - O), r[i] < 0)) (P = h), (j = y), (R = v); else if ( ((a = i), 0 === r[i] ? ((d = Zr(-y, -v, h, E)), n.set(i, b - 1, d[0]), n.set(i, b, d[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - O) * (e[i] - O) + r[i] * r[i] - E * E), (g = 2 * (e[i] - O) * E), 0 === m && 0 === g && (m = x * S * (Math.abs(h) + Math.abs(E) + Math.abs(l) + Math.abs(p) + Math.abs(P))), (d = Zr( l * j - P * y + E * v, l * R - P * v - E * y, m, g, )), n.set(i, b - 1, d[0]), n.set(i, b, d[1]), Math.abs(l) > Math.abs(P) + Math.abs(E) ? (n.set( i + 1, b - 1, (-y - h * n.get(i, b - 1) + E * n.get(i, b)) / l, ), n.set( i + 1, b, (-v - h * n.get(i, b) - E * n.get(i, b - 1)) / l, )) : ((d = Zr( -j - p * n.get(i, b - 1), -R - p * n.get(i, b), P, E, )), n.set(i + 1, b - 1, d[0]), n.set(i + 1, b, d[1]))), x * (c = Math.max( Math.abs(n.get(i, b - 1)), Math.abs(n.get(i, b)), )) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b - 1, n.get(s, b - 1) / c), n.set(s, b, n.get(s, b) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (P = 0, u = 0; u <= Math.min(s, M); u++) P += o.get(i, u) * n.get(u, s); o.set(i, s, P); } } } function Zr(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function $r(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var te = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Sr.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new H(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Sr.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && $r(r.prototype, e), o && $r(r, o), Object.defineProperty(r, "prototype", { writable: !1 }), t ); })(); function re(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ee(t, r, e) { return ( r && re(t.prototype, r), e && re(t, e), Object.defineProperty(t, "prototype", { writable: !1 }), t ); } function oe(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var ne = ee(function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; oe(this, t), (r = Sr.checkMatrix(r)); var o, i = e.Y, s = e.scaleScores, u = void 0 !== s && s, a = e.maxIterations, f = void 0 === a ? 1e3 : a, c = e.terminationCriteria, h = void 0 === c ? 1e-10 : c; if (i) { if ( (i = n(i) && "number" == typeof i[0] ? H.columnVector(i) : Sr.checkMatrix(i)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = i.getColumnVector(0); } else o = r.getColumnVector(0); for (var l, p, y, v, m = 1, g = 0; g < f && m > h; g++) (y = (y = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(y.norm())), (l = r.mmul(y).div(y.transpose().mmul(y).get(0, 0))), g > 0 && (m = l.clone().sub(v).pow(2).sum()), (v = l.clone()), i ? ((p = (p = i .transpose() .mmul(l) .div(l.transpose().mmul(l).get(0, 0))).div(p.norm())), (o = i.mmul(p).div(p.transpose().mmul(p).get(0, 0)))) : (o = l); if (i) { var w = r.transpose().mmul(l).div(l.transpose().mmul(l).get(0, 0)); w = w.div(w.norm()); var d = r.clone().sub(l.clone().mmul(w.transpose())), b = o.transpose().mmul(l).div(l.transpose().mmul(l).get(0, 0)), M = i.clone().sub(l.clone().mulS(b.get(0, 0)).mmul(p.transpose())); (this.t = l), (this.p = w.transpose()), (this.w = y.transpose()), (this.q = p), (this.u = o), (this.s = l.transpose().mmul(l)), (this.xResidual = d), (this.yResidual = M), (this.betas = b); } else (this.w = y.transpose()), (this.s = l.transpose().mmul(l).sqrt()), (this.t = u ? l.clone().div(this.s.get(0, 0)) : l), (this.xResidual = r.sub(l.mmul(y.transpose()))); }); }, }).default; }); //# sourceMappingURL=radialLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/extends/layout/randomLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.RandomLayout = e()) : (t.RandomLayout = e()); })(this, function () { return (function (t) { var e = {}; function o(n) { if (e[n]) return e[n].exports; var r = (e[n] = { i: n, l: !1, exports: {} }); return t[n].call(r.exports, r, r.exports, o), (r.l = !0), r.exports; } return ( (o.m = t), (o.c = e), (o.d = function (t, e, n) { o.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); }), (o.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (o.t = function (t, e) { if ((1 & e && (t = o(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if ( (o.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var r in t) o.d( n, r, function (e) { return t[e]; }.bind(null, r), ); return n; }), (o.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return o.d(e, "a", e), e; }), (o.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (o.p = ""), o((o.s = 394)) ); })({ 394: function (t, e, o) { "use strict"; o.r(e); var n = o(52); e.default = n.RandomLayout; }, 52: function (t, e, o) { "use strict"; var n, r = ((n = function (t, e) { return (n = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function o() { this.constructor = t; } n(t, e), (t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var i = (function (t) { function e(e) { var o = t.call(this) || this; return ( (o.center = [0, 0]), (o.width = 300), (o.height = 300), (o.nodes = []), (o.edges = []), (o.onLayoutEnd = function () {}), o.updateCfg(e), o ); } return ( r(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, o = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + o[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + o[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(o(53).Base); e.RandomLayout = i; }, 53: function (t, e, o) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var n = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function () {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = n; }, }).default; }); //# sourceMappingURL=randomLayout.js.map ================================================ FILE: packages/examples-uniapp/f6/index.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.F6 = e()) : (t.F6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var i in t) n.d( r, i, function (e) { return t[e]; }.bind(null, i), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 177)) ); })({ 0: function (t, e, n) { "use strict"; n.r(e), n.d(e, "contains", function () { return i; }), n.d(e, "includes", function () { return i; }), n.d(e, "difference", function () { return a; }), n.d(e, "find", function () { return x; }), n.d(e, "findIndex", function () { return w; }), n.d(e, "firstValue", function () { return S; }), n.d(e, "flatten", function () { return O; }), n.d(e, "flattenDeep", function () { return M; }), n.d(e, "getRange", function () { return E; }), n.d(e, "pull", function () { return I; }), n.d(e, "pullAt", function () { return N; }), n.d(e, "reduce", function () { return B; }), n.d(e, "remove", function () { return L; }), n.d(e, "sortBy", function () { return _; }), n.d(e, "union", function () { return F; }), n.d(e, "uniq", function () { return R; }), n.d(e, "valuesOfKey", function () { return Y; }), n.d(e, "head", function () { return X; }), n.d(e, "last", function () { return z; }), n.d(e, "startsWith", function () { return W; }), n.d(e, "endsWith", function () { return q; }), n.d(e, "filter", function () { return o; }), n.d(e, "every", function () { return V; }), n.d(e, "some", function () { return G; }), n.d(e, "group", function () { return K; }), n.d(e, "groupBy", function () { return U; }), n.d(e, "groupToMap", function () { return Z; }), n.d(e, "getWrapBehavior", function () { return $; }), n.d(e, "wrapBehavior", function () { return Q; }), n.d(e, "number2color", function () { return tt; }), n.d(e, "parseRadius", function () { return et; }), n.d(e, "clamp", function () { return nt; }), n.d(e, "fixedBase", function () { return rt; }), n.d(e, "isDecimal", function () { return ot; }), n.d(e, "isEven", function () { return at; }), n.d(e, "isInteger", function () { return st; }), n.d(e, "isNegative", function () { return ct; }), n.d(e, "isNumberEqual", function () { return ut; }), n.d(e, "isOdd", function () { return ht; }), n.d(e, "isPositive", function () { return lt; }), n.d(e, "max", function () { return k; }), n.d(e, "maxBy", function () { return ft; }), n.d(e, "min", function () { return C; }), n.d(e, "minBy", function () { return dt; }), n.d(e, "mod", function () { return pt; }), n.d(e, "toDegree", function () { return vt; }), n.d(e, "toInteger", function () { return yt; }), n.d(e, "toRadian", function () { return bt; }), n.d(e, "forIn", function () { return xt; }), n.d(e, "has", function () { return wt; }), n.d(e, "hasKey", function () { return St; }), n.d(e, "hasValue", function () { return Mt; }), n.d(e, "keys", function () { return g; }), n.d(e, "isMatch", function () { return v; }), n.d(e, "values", function () { return Ot; }), n.d(e, "lowerCase", function () { return Ct; }), n.d(e, "lowerFirst", function () { return Et; }), n.d(e, "substitute", function () { return jt; }), n.d(e, "upperCase", function () { return Pt; }), n.d(e, "upperFirst", function () { return At; }), n.d(e, "getType", function () { return Tt; }), n.d(e, "isArguments", function () { return Nt; }), n.d(e, "isArray", function () { return l; }), n.d(e, "isArrayLike", function () { return r; }), n.d(e, "isBoolean", function () { return Bt; }), n.d(e, "isDate", function () { return Lt; }), n.d(e, "isError", function () { return Dt; }), n.d(e, "isFunction", function () { return u; }), n.d(e, "isFinite", function () { return _t; }), n.d(e, "isNil", function () { return h; }), n.d(e, "isNull", function () { return Rt; }), n.d(e, "isNumber", function () { return it; }), n.d(e, "isObject", function () { return d; }), n.d(e, "isObjectLike", function () { return m; }), n.d(e, "isPlainObject", function () { return b; }), n.d(e, "isPrototype", function () { return Yt; }), n.d(e, "isRegExp", function () { return Xt; }), n.d(e, "isString", function () { return D; }), n.d(e, "isType", function () { return c; }), n.d(e, "isUndefined", function () { return zt; }), n.d(e, "isElement", function () { return Wt; }), n.d(e, "requestAnimationFrame", function () { return qt; }), n.d(e, "clearAnimationFrame", function () { return Vt; }), n.d(e, "augment", function () { return Ut; }), n.d(e, "clone", function () { return Kt; }), n.d(e, "debounce", function () { return $t; }), n.d(e, "memoize", function () { return Qt; }), n.d(e, "deepMix", function () { return te; }), n.d(e, "each", function () { return p; }), n.d(e, "extend", function () { return ee; }), n.d(e, "indexOf", function () { return ne; }), n.d(e, "isEmpty", function () { return ie; }), n.d(e, "isEqual", function () { return oe; }), n.d(e, "isEqualWith", function () { return ae; }), n.d(e, "map", function () { return se; }), n.d(e, "mapValues", function () { return ue; }), n.d(e, "mix", function () { return Ht; }), n.d(e, "assign", function () { return Ht; }), n.d(e, "get", function () { return he; }), n.d(e, "set", function () { return le; }), n.d(e, "pick", function () { return de; }), n.d(e, "omit", function () { return pe; }), n.d(e, "throttle", function () { return ge; }), n.d(e, "toArray", function () { return ve; }), n.d(e, "toString", function () { return kt; }), n.d(e, "uniqueId", function () { return me; }), n.d(e, "noop", function () { return be; }), n.d(e, "identity", function () { return xe; }), n.d(e, "size", function () { return we; }), n.d(e, "measureTextWidth", function () { return Me; }), n.d(e, "getEllipsisText", function () { return ke; }), n.d(e, "Cache", function () { return Ce; }); var r = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = function (t, e) { return !!r(t) && t.indexOf(e) > -1; }, o = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; e(o, i) && n.push(o); } return n; }, a = function (t, e) { return ( void 0 === e && (e = []), o(t, function (t) { return !i(e, t); }) ); }, s = {}.toString, c = function (t, e) { return s.call(t) === "[object " + e + "]"; }, u = function (t) { return c(t, "Function"); }, h = function (t) { return null == t; }, l = function (t) { return Array.isArray ? Array.isArray(t) : c(t, "Array"); }; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var d = function (t) { var e = f(t); return (null !== t && "object" === e) || "function" === e; }; var p = function (t, e) { if (t) if (l(t)) for (var n = 0, r = t.length; n < r && !1 !== e(t[n], n); n++); else if (d(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === e(t[i], i)) break; }, g = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(r); }), e ); }; var v = function (t, e) { var n = g(e), r = n.length; if (h(t)) return !r; for (var i = 0; i < r; i += 1) { var o = n[i]; if (e[o] !== t[o] || !(o in t)) return !1; } return !0; }; function y(t) { return (y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var m = function (t) { return "object" === y(t) && null !== t; }, b = function (t) { if (!m(t) || !c(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var e = t; null !== Object.getPrototypeOf(e); ) e = Object.getPrototypeOf(e); return Object.getPrototypeOf(t) === e; }; var x = function (t, e) { if (!l(t)) return null; var n; if ( (u(e) && (n = e), b(e) && (n = function (t) { return v(t, e); }), n) ) for (var r = 0; r < t.length; r += 1) if (n(t[r])) return t[r]; return null; }; var w = function (t, e, n) { void 0 === n && (n = 0); for (var r = n; r < t.length; r++) if (e(t[r], r)) return r; return -1; }, S = function (t, e) { for (var n = null, r = 0; r < t.length; r++) { var i = t[r][e]; if (!h(i)) { n = l(i) ? i[0] : i; break; } } return n; }, O = function (t) { if (!l(t)) return []; for (var e = [], n = 0; n < t.length; n++) e = e.concat(t[n]); return e; }, M = function t(e, n) { if ((void 0 === n && (n = []), l(e))) for (var r = 0; r < e.length; r += 1) t(e[r], n); else n.push(e); return n; }, k = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.max(t, e); }, t[0]); }, C = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.min(t, e); }, t[0]); }, E = function (t) { var e = t.filter(function (t) { return !isNaN(t); }); if (!e.length) return { min: 0, max: 0 }; if (l(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); e = n; } var i = k(e); return { min: C(e), max: i }; }, j = Array.prototype, P = j.splice, A = j.indexOf, I = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r++) for (var i = e[r], o = -1; (o = A.call(t, i)) > -1; ) P.call(t, o, 1); return t; }, T = Array.prototype.splice, N = function (t, e) { if (!r(t)) return []; for (var n = t ? e.length : 0, i = n - 1; n--; ) { var o = void 0, a = e[n]; (n !== i && a === o) || ((o = a), T.call(t, a, 1)); } return t; }, B = function (t, e, n) { if (!l(t) && !b(t)) return t; var r = n; return ( p(t, function (t, n) { r = e(r, t, n); }), r ); }, L = function (t, e) { var n = []; if (!r(t)) return n; for (var i = -1, o = [], a = t.length; ++i < a; ) { var s = t[i]; e(s, i, t) && (n.push(s), o.push(i)); } return N(t, o), n; }, D = function (t) { return c(t, "String"); }; var _ = function (t, e) { var n; if (u(e)) n = function (t, n) { return e(t) - e(n); }; else { var r = []; D(e) ? r.push(e) : l(e) && (r = e), (n = function (t, e) { for (var n = 0; n < r.length; n += 1) { var i = r[n]; if (t[i] > e[i]) return 1; if (t[i] < e[i]) return -1; } return 0; }); } return t.sort(n), t; }; function R(t, e) { void 0 === e && (e = new Map()); var n = []; if (Array.isArray(t)) for (var r = 0, i = t.length; r < i; r++) { var o = t[r]; e.has(o) || (n.push(o), e.set(o, !0)); } return n; } var F = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return R([].concat.apply([], t)); }, Y = function (t, e) { for (var n = [], r = {}, i = 0; i < t.length; i++) { var o = t[i][e]; if (!h(o)) { l(o) || (o = [o]); for (var a = 0; a < o.length; a++) { var s = o[a]; r[s] || (n.push(s), (r[s] = !0)); } } } return n; }; function X(t) { if (r(t)) return t[0]; } function z(t) { if (r(t)) { return t[t.length - 1]; } } var W = function (t, e) { return !(!l(t) && !D(t)) && t[0] === e; }; var q = function (t, e) { return !(!l(t) && !D(t)) && t[t.length - 1] === e; }, V = function (t, e) { for (var n = 0; n < t.length; n++) if (!e(t[n], n)) return !1; return !0; }, G = function (t, e) { for (var n = 0; n < t.length; n++) if (e(t[n], n)) return !0; return !1; }, H = Object.prototype.hasOwnProperty; var U = function (t, e) { if (!e || !l(t)) return {}; for ( var n, r = {}, i = u(e) ? e : function (t) { return t[e]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (n = i(a)), H.call(r, n) ? r[n].push(a) : (r[n] = [a]); } return r; }; function Z(t, e) { if (!e) return { 0: t }; if (!u(e)) { var n = l(e) ? e : e.replace(/\s+/g, "").split("*"); e = function (t) { for (var e = "_", r = 0, i = n.length; r < i; r++) e += t[n[r]] && t[n[r]].toString(); return e; }; } return U(t, e); } var K = function (t, e) { if (!e) return [t]; var n = Z(t, e), r = []; for (var i in n) r.push(n[i]); return r; }; var $ = function (t, e) { return t["_wrap_" + e]; }; var Q = function (t, e) { if (t["_wrap_" + e]) return t["_wrap_" + e]; var n = function (n) { t[e](n); }; return (t["_wrap_" + e] = n), n; }, J = {}; var tt = function (t) { var e = J[t]; if (!e) { for (var n = t.toString(16), r = n.length; r < 6; r++) n = "0" + n; (e = "#" + n), (J[t] = e); } return e; }; var et = function (t) { var e = 0, n = 0, r = 0, i = 0; return ( l(t) ? 1 === t.length ? (e = n = r = i = t[0]) : 2 === t.length ? ((e = r = t[0]), (n = i = t[1])) : 3 === t.length ? ((e = t[0]), (n = i = t[1]), (r = t[2])) : ((e = t[0]), (n = t[1]), (r = t[2]), (i = t[3])) : (e = n = r = i = t), { r1: e, r2: n, r3: r, r4: i } ); }, nt = function (t, e, n) { return t < e ? e : t > n ? n : t; }, rt = function (t, e) { var n = e.toString(), r = n.indexOf("."); if (-1 === r) return Math.round(t); var i = n.substr(r + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }, it = function (t) { return c(t, "Number"); }, ot = function (t) { return it(t) && t % 1 != 0; }, at = function (t) { return it(t) && t % 2 == 0; }, st = Number.isInteger ? Number.isInteger : function (t) { return it(t) && t % 1 == 0; }, ct = function (t) { return it(t) && t < 0; }; function ut(t, e, n) { return void 0 === n && (n = 1e-5), Math.abs(t - e) < n; } var ht = function (t) { return it(t) && t % 2 != 0; }, lt = function (t) { return it(t) && t > 0; }, ft = function (t, e) { if (l(t)) { for (var n, r = -1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a > r && ((n = o), (r = a)); } return n; } }, dt = function (t, e) { if (l(t)) { for (var n, r = 1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a < r && ((n = o), (r = a)); } return n; } }, pt = function (t, e) { return ((t % e) + e) % e; }, gt = 180 / Math.PI, vt = function (t) { return gt * t; }, yt = parseInt, mt = Math.PI / 180, bt = function (t) { return mt * t; }, xt = p, wt = function (t, e) { return t.hasOwnProperty(e); }, St = wt, Ot = Object.values ? function (t) { return Object.values(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(n); }), e ); }, Mt = function (t, e) { return i(Ot(t), e); }, kt = function (t) { return h(t) ? "" : t.toString(); }, Ct = function (t) { return kt(t).toLowerCase(); }, Et = function (t) { var e = kt(t); return e.charAt(0).toLowerCase() + e.substring(1); }; var jt = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === e[n] ? "" : e[n]; }) : t; }, Pt = function (t) { return kt(t).toUpperCase(); }, At = function (t) { var e = kt(t); return e.charAt(0).toUpperCase() + e.substring(1); }, It = {}.toString, Tt = function (t) { return It.call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }, Nt = function (t) { return c(t, "Arguments"); }, Bt = function (t) { return c(t, "Boolean"); }, Lt = function (t) { return c(t, "Date"); }, Dt = function (t) { return c(t, "Error"); }, _t = function (t) { return it(t) && isFinite(t); }, Rt = function (t) { return null === t; }, Ft = Object.prototype, Yt = function (t) { var e = t && t.constructor; return t === (("function" == typeof e && e.prototype) || Ft); }, Xt = function (t) { return c(t, "RegExp"); }, zt = function (t) { return void 0 === t; }, Wt = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; function qt(t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); } function Vt(t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); } function Gt(t, e) { for (var n in e) e.hasOwnProperty(n) && "constructor" !== n && void 0 !== e[n] && (t[n] = e[n]); } function Ht(t, e, n, r) { return e && Gt(t, e), n && Gt(t, n), r && Gt(t, r), t; } var Ut = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var n = t[0], r = 1; r < t.length; r++) { var i = t[r]; u(i) && (i = i.prototype), Ht(n.prototype, i); } }; function Zt(t) { return (Zt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Kt = function t(e) { if ("object" !== Zt(e) || null === e) return e; var n; if (l(e)) { n = []; for (var r = 0, i = e.length; r < i; r++) "object" === Zt(e[r]) && null != e[r] ? (n[r] = t(e[r])) : (n[r] = e[r]); } else for (var o in ((n = {}), e)) "object" === Zt(e[o]) && null != e[o] ? (n[o] = t(e[o])) : (n[o] = e[o]); return n; }; var $t = function (t, e, n) { var r; return function () { var i = this, o = arguments, a = function () { (r = null), n || t.apply(i, o); }, s = n && !r; clearTimeout(r), (r = setTimeout(a, e)), s && t.apply(i, o); }; }, Qt = function (t, e) { if (!u(t)) throw new TypeError("Expected a function"); var n = function n() { for (var r = [], i = 0; i < arguments.length; i++) r[i] = arguments[i]; var o = e ? e.apply(this, r) : r[0], a = n.cache; if (a.has(o)) return a.get(o); var s = t.apply(this, r); return a.set(o, s), s; }; return (n.cache = new Map()), n; }; function Jt(t, e, n, r) { for (var i in ((n = n || 0), (r = r || 5), e)) if (e.hasOwnProperty(i)) { var o = e[i]; null !== o && b(o) ? (b(t[i]) || (t[i] = {}), n < r ? Jt(t[i], o, n + 1, r) : (t[i] = e[i])) : l(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var te = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r += 1) Jt(t, e[r]); return t; }, ee = function (t, e, n, r) { u(e) || ((n = e), (e = t), (t = function () {})); var i = Object.create ? function (t, e) { return Object.create(t, { constructor: { value: e } }); } : function (t, e) { function n() {} n.prototype = t; var r = new n(); return (r.constructor = e), r; }, o = i(e.prototype, t); return ( (t.prototype = Ht(o, t.prototype)), (t.superclass = i(e.prototype, e)), Ht(o, n), Ht(t, r), t ); }, ne = function (t, e) { if (!r(t)) return -1; var n = Array.prototype.indexOf; if (n) return n.call(t, e); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === e) { i = o; break; } return i; }, re = Object.prototype.hasOwnProperty; var ie = function (t) { if (h(t)) return !0; if (r(t)) return !t.length; var e = Tt(t); if ("Map" === e || "Set" === e) return !t.size; if (Yt(t)) return !Object.keys(t).length; for (var n in t) if (re.call(t, n)) return !1; return !0; }, oe = function t(e, n) { if (e === n) return !0; if (!e || !n) return !1; if (D(e) || D(n)) return !1; if (r(e) || r(n)) { if (e.length !== n.length) return !1; for (var i = !0, o = 0; o < e.length && (i = t(e[o], n[o])); o++); return i; } if (m(e) || m(n)) { var a = Object.keys(e), s = Object.keys(n); if (a.length !== s.length) return !1; for (i = !0, o = 0; o < a.length && (i = t(e[a[o]], n[a[o]])); o++); return i; } return !1; }, ae = function (t, e, n) { return u(n) ? !!n(t, e) : oe(t, e); }, se = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; n.push(e(o, i)); } return n; }, ce = function (t) { return t; }, ue = function (t, e) { void 0 === e && (e = ce); var n = {}; return ( d(t) && !h(t) && Object.keys(t).forEach(function (r) { n[r] = e(t[r], r); }), n ); }, he = function (t, e, n) { for (var r = 0, i = D(e) ? e.split(".") : e; t && r < i.length; ) t = t[i[r++]]; return void 0 === t || r < i.length ? n : t; }, le = function (t, e, n) { var r = t, i = D(e) ? e.split(".") : e; return ( i.forEach(function (t, e) { e < i.length - 1 ? (d(r[t]) || (r[t] = it(i[e + 1]) ? [] : {}), (r = r[t])) : (r[t] = n); }), t ); }, fe = Object.prototype.hasOwnProperty, de = function (t, e) { if (null === t || !b(t)) return {}; var n = {}; return ( p(e, function (e) { fe.call(t, e) && (n[e] = t[e]); }), n ); }, pe = function (t, e) { return B( t, function (t, n, r) { return e.includes(r) || (t[r] = n), t; }, {}, ); }, ge = function (t, e, n) { var r, i, o, a, s = 0; n || (n = {}); var c = function () { (s = !1 === n.leading ? 0 : Date.now()), (r = null), (a = t.apply(i, o)), r || (i = o = null); }, u = function () { var u = Date.now(); s || !1 !== n.leading || (s = u); var h = e - (u - s); return ( (i = this), (o = arguments), h <= 0 || h > e ? (r && (clearTimeout(r), (r = null)), (s = u), (a = t.apply(i, o)), r || (i = o = null)) : r || !1 === n.trailing || (r = setTimeout(c, h)), a ); }; return ( (u.cancel = function () { clearTimeout(r), (s = 0), (r = i = o = null); }), u ); }, ve = function (t) { return r(t) ? Array.prototype.slice.call(t) : []; }, ye = {}, me = function (t) { return ye[(t = t || "g")] ? (ye[t] += 1) : (ye[t] = 1), t + ye[t]; }, be = function () {}, xe = function (t) { return t; }; function we(t) { return h(t) ? 0 : r(t) ? t.length : Object.keys(t).length; } var Se, Oe = n(1), Me = Qt( function (t, e) { void 0 === e && (e = {}); var n = e.fontSize, r = e.fontFamily, i = e.fontWeight, o = e.fontStyle, a = e.fontVariant; return ( Se || (Se = document.createElement("canvas").getContext("2d")), (Se.font = [o, a, i, n + "px", r].join(" ")), Se.measureText(D(t) ? t : "").width ); }, function (t, e) { return void 0 === e && (e = {}), Object(Oe.g)([t], Ot(e)).join(""); }, ), ke = function (t, e, n, r) { void 0 === r && (r = "..."); var i, o, a = Me(r, n), s = D(t) ? t : kt(t), c = e, u = []; if (Me(t, n) <= e) return t; for (; (i = s.substr(0, 16)), !((o = Me(i, n)) + a > c && o > c); ) if ((u.push(i), (c -= o), !(s = s.substr(16)))) return u.join(""); for (; (i = s.substr(0, 1)), !((o = Me(i, n)) + a > c); ) if ((u.push(i), (c -= o), !(s = s.substr(1)))) return u.join(""); return "" + u.join("") + r; }, Ce = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, e) { var n = this.map[t]; return void 0 === n ? e : n; }), (t.prototype.set = function (t, e) { this.map[t] = e; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); }, 1: function (t, e, n) { "use strict"; n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }), n.d(e, "e", function () { return a; }), n.d(e, "b", function () { return s; }), n.d(e, "d", function () { return c; }), n.d(e, "g", function () { return u; }), n.d(e, "f", function () { return h; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }; function i(t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); } var o = function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function a(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } function s(t, e, n, r) { return new (n || (n = Promise))(function (i, o) { function a(t) { try { c(r.next(t)); } catch (t) { o(t); } } function s(t) { try { c(r.throw(t)); } catch (t) { o(t); } } function c(t) { var e; t.done ? i(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } c((r = r.apply(t, e || [])).next()); }); } function c(t, e) { var n, r, i, o, a = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: s(0), throw: s(1), return: s(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function s(o) { return function (s) { return (function (o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if ( ((n = 1), r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) ) return i; switch (((r = 0), i && (o = [2 & o[0], i.value]), o[0])) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, (r = o[1]), (o = [0]); continue; case 7: (o = a.ops.pop()), a.trys.pop(); continue; default: if ( !((i = a.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== o[0] && 2 !== o[0])) ) { a = 0; continue; } if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) { a.label = o[1]; break; } if (6 === o[0] && a.label < i[1]) { (a.label = i[1]), (i = o); break; } if (i && a.label < i[2]) { (a.label = i[2]), a.ops.push(o); break; } i[2] && a.ops.pop(), a.trys.pop(); continue; } o = e.call(t, a); } catch (t) { (o = [6, t]), (r = 0); } finally { n = i = 0; } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 }; })([o, s]); }; } } Object.create; function u() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; } function h(t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); } Object.create; }, 100: function (t, e, n) { "use strict"; var r = n(186), i = {}; for (var o in r) r.hasOwnProperty(o) && (i[r[o]] = o); var a = (t.exports = { rgb: { channels: 3, labels: "rgb" }, hsl: { channels: 3, labels: "hsl" }, hsv: { channels: 3, labels: "hsv" }, hwb: { channels: 3, labels: "hwb" }, cmyk: { channels: 4, labels: "cmyk" }, xyz: { channels: 3, labels: "xyz" }, lab: { channels: 3, labels: "lab" }, lch: { channels: 3, labels: "lch" }, hex: { channels: 1, labels: ["hex"] }, keyword: { channels: 1, labels: ["keyword"] }, ansi16: { channels: 1, labels: ["ansi16"] }, ansi256: { channels: 1, labels: ["ansi256"] }, hcg: { channels: 3, labels: ["h", "c", "g"] }, apple: { channels: 3, labels: ["r16", "g16", "b16"] }, gray: { channels: 1, labels: ["gray"] }, }); for (var s in a) if (a.hasOwnProperty(s)) { if (!("channels" in a[s])) throw new Error("missing channels property: " + s); if (!("labels" in a[s])) throw new Error("missing channel labels property: " + s); if (a[s].labels.length !== a[s].channels) throw new Error("channel and label counts mismatch: " + s); var c = a[s].channels, u = a[s].labels; delete a[s].channels, delete a[s].labels, Object.defineProperty(a[s], "channels", { value: c }), Object.defineProperty(a[s], "labels", { value: u }); } function h(t, e) { return ( Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2) + Math.pow(t[2] - e[2], 2) ); } (a.rgb.hsl = function (t) { var e, n, r = t[0] / 255, i = t[1] / 255, o = t[2] / 255, a = Math.min(r, i, o), s = Math.max(r, i, o), c = s - a; return ( s === a ? (e = 0) : r === s ? (e = (i - o) / c) : i === s ? (e = 2 + (o - r) / c) : o === s && (e = 4 + (r - i) / c), (e = Math.min(60 * e, 360)) < 0 && (e += 360), (n = (a + s) / 2), [ e, 100 * (s === a ? 0 : n <= 0.5 ? c / (s + a) : c / (2 - s - a)), 100 * n, ] ); }), (a.rgb.hsv = function (t) { var e, n, r, i, o, a = t[0] / 255, s = t[1] / 255, c = t[2] / 255, u = Math.max(a, s, c), h = u - Math.min(a, s, c), l = function (t) { return (u - t) / 6 / h + 0.5; }; return ( 0 === h ? (i = o = 0) : ((o = h / u), (e = l(a)), (n = l(s)), (r = l(c)), a === u ? (i = r - n) : s === u ? (i = 1 / 3 + e - r) : c === u && (i = 2 / 3 + n - e), i < 0 ? (i += 1) : i > 1 && (i -= 1)), [360 * i, 100 * o, 100 * u] ); }), (a.rgb.hwb = function (t) { var e = t[0], n = t[1], r = t[2]; return [ a.rgb.hsl(t)[0], (1 / 255) * Math.min(e, Math.min(n, r)) * 100, 100 * (r = 1 - (1 / 255) * Math.max(e, Math.max(n, r))), ]; }), (a.rgb.cmyk = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255, i = Math.min(1 - e, 1 - n, 1 - r); return [ 100 * ((1 - e - i) / (1 - i) || 0), 100 * ((1 - n - i) / (1 - i) || 0), 100 * ((1 - r - i) / (1 - i) || 0), 100 * i, ]; }), (a.rgb.keyword = function (t) { var e, n = i[t]; if (n) return n; var o, a = 1 / 0; for (var s in r) r.hasOwnProperty(s) && (e = h(t, r[s])) < a && ((a = e), (o = s)); return o; }), (a.keyword.rgb = function (t) { return r[t]; }), (a.rgb.xyz = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255; return [ 100 * (0.4124 * (e = e > 0.04045 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92) + 0.3576 * (n = n > 0.04045 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92) + 0.1805 * (r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92)), 100 * (0.2126 * e + 0.7152 * n + 0.0722 * r), 100 * (0.0193 * e + 0.1192 * n + 0.9505 * r), ]; }), (a.rgb.lab = function (t) { var e = a.rgb.xyz(t), n = e[0], r = e[1], i = e[2]; return ( (r /= 100), (i /= 108.883), (n = (n /= 95.047) > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116), [ 116 * (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116) - 16, 500 * (n - r), 200 * (r - (i = i > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116)), ] ); }), (a.hsl.rgb = function (t) { var e, n, r, i, o, a, s = t[0] / 360, c = t[1] / 100, u = t[2] / 100; if (0 === c) return [(a = 255 * u), a, a]; for ( n = 2 * u - (r = u < 0.5 ? u * (1 + c) : u + c - u * c), o = [0, 0, 0], e = 0; e < 3; e++ ) (i = s + (1 / 3) * -(e - 1)) < 0 && i++, i > 1 && i--, (a = 6 * i < 1 ? n + 6 * (r - n) * i : 2 * i < 1 ? r : 3 * i < 2 ? n + (r - n) * (2 / 3 - i) * 6 : n), (o[e] = 255 * a); return o; }), (a.hsl.hsv = function (t) { var e = t[0], n = t[1] / 100, r = t[2] / 100, i = n, o = Math.max(r, 0.01); return ( (n *= (r *= 2) <= 1 ? r : 2 - r), (i *= o <= 1 ? o : 2 - o), [ e, 100 * (0 === r ? (2 * i) / (o + i) : (2 * n) / (r + n)), ((r + n) / 2) * 100, ] ); }), (a.hsv.rgb = function (t) { var e = t[0] / 60, n = t[1] / 100, r = t[2] / 100, i = Math.floor(e) % 6, o = e - Math.floor(e), a = 255 * r * (1 - n), s = 255 * r * (1 - n * o), c = 255 * r * (1 - n * (1 - o)); switch (((r *= 255), i)) { case 0: return [r, c, a]; case 1: return [s, r, a]; case 2: return [a, r, c]; case 3: return [a, s, r]; case 4: return [c, a, r]; case 5: return [r, a, s]; } }), (a.hsv.hsl = function (t) { var e, n, r = t[0], i = t[1] / 100, o = t[2] / 100, a = Math.max(o, 0.01), s = (2 - i) * o; return ( (n = i * a), [ r, 100 * (n = (n /= (e = (2 - i) * a) <= 1 ? e : 2 - e) || 0), 100 * (s /= 2), ] ); }), (a.hwb.rgb = function (t) { var e, n, r, i, o, a, s, c = t[0] / 360, u = t[1] / 100, h = t[2] / 100, l = u + h; switch ( (l > 1 && ((u /= l), (h /= l)), (r = 6 * c - (e = Math.floor(6 * c))), 0 != (1 & e) && (r = 1 - r), (i = u + r * ((n = 1 - h) - u)), e) ) { default: case 6: case 0: (o = n), (a = i), (s = u); break; case 1: (o = i), (a = n), (s = u); break; case 2: (o = u), (a = n), (s = i); break; case 3: (o = u), (a = i), (s = n); break; case 4: (o = i), (a = u), (s = n); break; case 5: (o = n), (a = u), (s = i); } return [255 * o, 255 * a, 255 * s]; }), (a.cmyk.rgb = function (t) { var e = t[0] / 100, n = t[1] / 100, r = t[2] / 100, i = t[3] / 100; return [ 255 * (1 - Math.min(1, e * (1 - i) + i)), 255 * (1 - Math.min(1, n * (1 - i) + i)), 255 * (1 - Math.min(1, r * (1 - i) + i)), ]; }), (a.xyz.rgb = function (t) { var e, n, r, i = t[0] / 100, o = t[1] / 100, a = t[2] / 100; return ( (n = -0.9689 * i + 1.8758 * o + 0.0415 * a), (r = 0.0557 * i + -0.204 * o + 1.057 * a), (e = (e = 3.2406 * i + -1.5372 * o + -0.4986 * a) > 0.0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - 0.055 : 12.92 * e), (n = n > 0.0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - 0.055 : 12.92 * n), (r = r > 0.0031308 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : 12.92 * r), [ 255 * (e = Math.min(Math.max(0, e), 1)), 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (r = Math.min(Math.max(0, r), 1)), ] ); }), (a.xyz.lab = function (t) { var e = t[0], n = t[1], r = t[2]; return ( (n /= 100), (r /= 108.883), (e = (e /= 95.047) > 0.008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116), [ 116 * (n = n > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (e - n), 200 * (n - (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116)), ] ); }), (a.lab.xyz = function (t) { var e, n, r, i = t[0]; (e = t[1] / 500 + (n = (i + 16) / 116)), (r = n - t[2] / 200); var o = Math.pow(n, 3), a = Math.pow(e, 3), s = Math.pow(r, 3); return ( (n = o > 0.008856 ? o : (n - 16 / 116) / 7.787), (e = a > 0.008856 ? a : (e - 16 / 116) / 7.787), (r = s > 0.008856 ? s : (r - 16 / 116) / 7.787), [(e *= 95.047), (n *= 100), (r *= 108.883)] ); }), (a.lab.lch = function (t) { var e, n = t[0], r = t[1], i = t[2]; return ( (e = (360 * Math.atan2(i, r)) / 2 / Math.PI) < 0 && (e += 360), [n, Math.sqrt(r * r + i * i), e] ); }), (a.lch.lab = function (t) { var e = t[0], n = t[1], r = (t[2] / 360) * 2 * Math.PI; return [e, n * Math.cos(r), n * Math.sin(r)]; }), (a.rgb.ansi16 = function (t) { var e = t[0], n = t[1], r = t[2], i = 1 in arguments ? arguments[1] : a.rgb.hsv(t)[2]; if (0 === (i = Math.round(i / 50))) return 30; var o = 30 + ((Math.round(r / 255) << 2) | (Math.round(n / 255) << 1) | Math.round(e / 255)); return 2 === i && (o += 60), o; }), (a.hsv.ansi16 = function (t) { return a.rgb.ansi16(a.hsv.rgb(t), t[2]); }), (a.rgb.ansi256 = function (t) { var e = t[0], n = t[1], r = t[2]; return e === n && n === r ? e < 8 ? 16 : e > 248 ? 231 : Math.round(((e - 8) / 247) * 24) + 232 : 16 + 36 * Math.round((e / 255) * 5) + 6 * Math.round((n / 255) * 5) + Math.round((r / 255) * 5); }), (a.ansi16.rgb = function (t) { var e = t % 10; if (0 === e || 7 === e) return t > 50 && (e += 3.5), [(e = (e / 10.5) * 255), e, e]; var n = 0.5 * (1 + ~~(t > 50)); return [ (1 & e) * n * 255, ((e >> 1) & 1) * n * 255, ((e >> 2) & 1) * n * 255, ]; }), (a.ansi256.rgb = function (t) { return t >= 232 ? [(n = 10 * (t - 232) + 8), n, n] : ((t -= 16), [ (Math.floor(t / 36) / 5) * 255, (Math.floor((e = t % 36) / 6) / 5) * 255, ((e % 6) / 5) * 255, ]); var e, n; }), (a.rgb.hex = function (t) { var e = ( ((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2])) ) .toString(16) .toUpperCase(); return "000000".substring(e.length) + e; }), (a.hex.rgb = function (t) { var e = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!e) return [0, 0, 0]; var n = e[0]; 3 === e[0].length && (n = n .split("") .map(function (t) { return t + t; }) .join("")); var r = parseInt(n, 16); return [(r >> 16) & 255, (r >> 8) & 255, 255 & r]; }), (a.rgb.hcg = function (t) { var e, n = t[0] / 255, r = t[1] / 255, i = t[2] / 255, o = Math.max(Math.max(n, r), i), a = Math.min(Math.min(n, r), i), s = o - a; return ( (e = s <= 0 ? 0 : o === n ? ((r - i) / s) % 6 : o === r ? 2 + (i - n) / s : 4 + (n - r) / s + 4), (e /= 6), [360 * (e %= 1), 100 * s, 100 * (s < 1 ? a / (1 - s) : 0)] ); }), (a.hsl.hcg = function (t) { var e, n = t[1] / 100, r = t[2] / 100, i = 0; return ( (e = r < 0.5 ? 2 * n * r : 2 * n * (1 - r)) < 1 && (i = (r - 0.5 * e) / (1 - e)), [t[0], 100 * e, 100 * i] ); }), (a.hsv.hcg = function (t) { var e = t[1] / 100, n = t[2] / 100, r = e * n, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.hcg.rgb = function (t) { var e = t[0] / 360, n = t[1] / 100, r = t[2] / 100; if (0 === n) return [255 * r, 255 * r, 255 * r]; var i, o = [0, 0, 0], a = (e % 1) * 6, s = a % 1, c = 1 - s; switch (Math.floor(a)) { case 0: (o[0] = 1), (o[1] = s), (o[2] = 0); break; case 1: (o[0] = c), (o[1] = 1), (o[2] = 0); break; case 2: (o[0] = 0), (o[1] = 1), (o[2] = s); break; case 3: (o[0] = 0), (o[1] = c), (o[2] = 1); break; case 4: (o[0] = s), (o[1] = 0), (o[2] = 1); break; default: (o[0] = 1), (o[1] = 0), (o[2] = c); } return ( (i = (1 - n) * r), [255 * (n * o[0] + i), 255 * (n * o[1] + i), 255 * (n * o[2] + i)] ); }), (a.hcg.hsv = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e), r = 0; return n > 0 && (r = e / n), [t[0], 100 * r, 100 * n]; }), (a.hcg.hsl = function (t) { var e = t[1] / 100, n = (t[2] / 100) * (1 - e) + 0.5 * e, r = 0; return ( n > 0 && n < 0.5 ? (r = e / (2 * n)) : n >= 0.5 && n < 1 && (r = e / (2 * (1 - n))), [t[0], 100 * r, 100 * n] ); }), (a.hcg.hwb = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e); return [t[0], 100 * (n - e), 100 * (1 - n)]; }), (a.hwb.hcg = function (t) { var e = t[1] / 100, n = 1 - t[2] / 100, r = n - e, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.apple.rgb = function (t) { return [ (t[0] / 65535) * 255, (t[1] / 65535) * 255, (t[2] / 65535) * 255, ]; }), (a.rgb.apple = function (t) { return [ (t[0] / 255) * 65535, (t[1] / 255) * 65535, (t[2] / 255) * 65535, ]; }), (a.gray.rgb = function (t) { return [(t[0] / 100) * 255, (t[0] / 100) * 255, (t[0] / 100) * 255]; }), (a.gray.hsl = a.gray.hsv = function (t) { return [0, 0, t[0]]; }), (a.gray.hwb = function (t) { return [0, 100, t[0]]; }), (a.gray.cmyk = function (t) { return [0, 0, 0, t[0]]; }), (a.gray.lab = function (t) { return [t[0], 0, 0]; }), (a.gray.hex = function (t) { var e = 255 & Math.round((t[0] / 100) * 255), n = ((e << 16) + (e << 8) + e).toString(16).toUpperCase(); return "000000".substring(n.length) + n; }), (a.rgb.gray = function (t) { return [((t[0] + t[1] + t[2]) / 3 / 255) * 100]; }); }, 101: function (t, e) {}, 102: function (t, e) {}, 157: function (t, e, n) { "use strict"; (function (t) { n.d(e, "a", function () { return f; }); var r = function (t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); }, i = function (t, e, n) { (this.name = t), (this.version = e), (this.os = n), (this.type = "browser"); }, o = function (e) { (this.version = e), (this.type = "node"), (this.name = "node"), (this.os = t.platform); }, a = function (t, e, n, r) { (this.name = t), (this.version = e), (this.os = n), (this.bot = r), (this.type = "bot-device"); }, s = function () { (this.type = "bot"), (this.bot = !0), (this.name = "bot"), (this.version = null), (this.os = null); }, c = function () { (this.type = "react-native"), (this.name = "react-native"), (this.version = null), (this.os = null); }, u = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/, h = [ ["aol", /AOLShield\/([0-9\._]+)/], ["edge", /Edge\/([0-9\._]+)/], ["edge-ios", /EdgiOS\/([0-9\._]+)/], ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], ["samsung", /SamsungBrowser\/([0-9\.]+)/], ["silk", /\bSilk\/([0-9._-]+)\b/], ["miui", /MiuiBrowser\/([0-9\.]+)$/], ["beaker", /BeakerBrowser\/([0-9\.]+)/], ["edge-chromium", /EdgA?\/([0-9\.]+)/], [ "chromium-webview", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, ], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["fxios", /FxiOS\/([0-9\.]+)/], ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], [ "pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/, ], ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], ["android", /Android\s([0-9\.]+)/], ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], ["safari", /Version\/([0-9\._]+).*Safari/], ["facebook", /FB[AS]V\/([0-9\.]+)/], ["instagram", /Instagram\s([0-9\.]+)/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ["curl", /^curl\/([0-9\.]+)$/], [ "searchbot", /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/, ], ], l = [ ["iOS", /iP(hone|od|ad)/], ["Android OS", /Android/], ["BlackBerry OS", /BlackBerry|BB10/], ["Windows Mobile", /IEMobile/], ["Amazon OS", /Kindle/], ["Windows 3.11", /Win16/], ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows 98", /(Windows 98)|(Win98)/], ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows Server 2003", /(Windows NT 5.2)/], ["Windows Vista", /(Windows NT 6.0)/], ["Windows 7", /(Windows NT 6.1)/], ["Windows 8", /(Windows NT 6.2)/], ["Windows 8.1", /(Windows NT 6.3)/], ["Windows 10", /(Windows NT 10.0)/], ["Windows ME", /Windows ME/], [ "Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/, ], ["Open BSD", /OpenBSD/], ["Sun OS", /SunOS/], ["Chrome OS", /CrOS/], ["Linux", /(Linux)|(X11)/], ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], ["QNX", /QNX/], ["BeOS", /BeOS/], ["OS/2", /OS\/2/], ]; function f(e) { return e ? p(e) : "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" === navigator.product ? new c() : "undefined" != typeof navigator ? p(navigator.userAgent) : void 0 !== t && t.version ? new o(t.version.slice(1)) : null; } function d(t) { return ( "" !== t && h.reduce(function (e, n) { var r = n[0], i = n[1]; if (e) return e; var o = i.exec(t); return !!o && [r, o]; }, !1) ); } function p(t) { var e = d(t); if (!e) return null; var n = e[0], o = e[1]; if ("searchbot" === n) return new s(); var c = o[1] && o[1].split(".").join("_").split("_").slice(0, 3); c ? c.length < 3 && (c = r( r([], c, !0), (function (t) { for (var e = [], n = 0; n < t; n++) e.push("0"); return e; })(3 - c.length), !0, )) : (c = []); var h = c.join("."), f = (function (t) { for (var e = 0, n = l.length; e < n; e++) { var r = l[e], i = r[0]; if (r[1].exec(t)) return i; } return null; })(t), p = u.exec(t); return p && p[1] ? new a(n, h, f, p[1]) : new i(n, h, f); } }).call(this, n(178)); }, 177: function (t, e, n) { "use strict"; n.r(e), function (r) { var i = n(97), o = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== r ? r : void 0; ("object" == typeof exports && "object" == typeof t) || ("function" == typeof define && n(195)) || "object" == typeof exports || Object.defineProperties(o, { f6: { get: function () { return ( console.warn("废弃的特性: f6, 请使用 F6 代替 f6"), i.default ); }, }, }), (e.default = i.default); }.call(this, n(77)); }, 178: function (t, e) { var n, r, i = (t.exports = {}); function o() { throw new Error("setTimeout has not been defined"); } function a() { throw new Error("clearTimeout has not been defined"); } function s(t) { if (n === setTimeout) return setTimeout(t, 0); if ((n === o || !n) && setTimeout) return (n = setTimeout), setTimeout(t, 0); try { return n(t, 0); } catch (e) { try { return n.call(null, t, 0); } catch (e) { return n.call(this, t, 0); } } } !(function () { try { n = "function" == typeof setTimeout ? setTimeout : o; } catch (t) { n = o; } try { r = "function" == typeof clearTimeout ? clearTimeout : a; } catch (t) { r = a; } })(); var c, u = [], h = !1, l = -1; function f() { h && c && ((h = !1), c.length ? (u = c.concat(u)) : (l = -1), u.length && d()); } function d() { if (!h) { var t = s(f); h = !0; for (var e = u.length; e; ) { for (c = u, u = []; ++l < e; ) c && c[l].run(); (l = -1), (e = u.length); } (c = null), (h = !1), (function (t) { if (r === clearTimeout) return clearTimeout(t); if ((r === a || !r) && clearTimeout) return (r = clearTimeout), clearTimeout(t); try { r(t); } catch (e) { try { return r.call(null, t); } catch (e) { return r.call(this, t); } } })(t); } } function p(t, e) { (this.fun = t), (this.array = e); } function g() {} (i.nextTick = function (t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; u.push(new p(t, e)), 1 !== u.length || h || s(d); }), (p.prototype.run = function () { this.fun.apply(null, this.array); }), (i.title = "browser"), (i.browser = !0), (i.env = {}), (i.argv = []), (i.version = ""), (i.versions = {}), (i.on = g), (i.addListener = g), (i.once = g), (i.off = g), (i.removeListener = g), (i.removeAllListeners = g), (i.emit = g), (i.prependListener = g), (i.prependOnceListener = g), (i.listeners = function (t) { return []; }), (i.binding = function (t) { throw new Error("process.binding is not supported"); }), (i.cwd = function () { return "/"; }), (i.chdir = function (t) { throw new Error("process.chdir is not supported"); }), (i.umask = function () { return 0; }); }, 179: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isAllowCapture = e.isParent = e.upperFirst = e.each = e.mix = e.isArray = e.isObject = e.isString = e.isFunction = e.isNil = e.isBrowser = e.removeFromArray = void 0), (e.removeFromArray = function (t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); }), (e.isBrowser = "undefined" != typeof window && void 0 !== window.document); var r = n(0); Object.defineProperty(e, "isNil", { enumerable: !0, get: function () { return r.isNil; }, }), Object.defineProperty(e, "isFunction", { enumerable: !0, get: function () { return r.isFunction; }, }), Object.defineProperty(e, "isString", { enumerable: !0, get: function () { return r.isString; }, }), Object.defineProperty(e, "isObject", { enumerable: !0, get: function () { return r.isObject; }, }), Object.defineProperty(e, "isArray", { enumerable: !0, get: function () { return r.isArray; }, }), Object.defineProperty(e, "mix", { enumerable: !0, get: function () { return r.mix; }, }), Object.defineProperty(e, "each", { enumerable: !0, get: function () { return r.each; }, }), Object.defineProperty(e, "upperFirst", { enumerable: !0, get: function () { return r.upperFirst; }, }), (e.isParent = function (t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; }), (e.isAllowCapture = function (t) { return t.cfg.visible && t.cfg.capture; }); }, 18: function (t, e, n) { "use strict"; var r = n(75), i = Object(r.getColorsWithSubjectColor)( "rgb(95, 149, 255)", "rgb(255, 255, 255)", ); e.a = { version: "0.0.16", rootContainerClassName: "root-container", uiContainerClassName: "ui-container", waterContainerClassName: "water-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: i.mainStroke, fill: i.mainFill }, size: 20, color: i.mainStroke, linkPoints: { size: 8, lineWidth: 1, fill: i.activeFill, stroke: i.activeStroke, }, }, nodeStateStyles: { active: { fill: i.activeFill, stroke: i.activeStroke, lineWidth: 2, shadowColor: i.mainStroke, shadowBlur: 10, }, selected: { fill: i.selectedFill, stroke: i.selectedStroke, lineWidth: 4, shadowColor: i.selectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: i.highlightFill, stroke: i.highlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: i.inactiveFill, stroke: i.inactiveStroke, lineWidth: 1, }, disable: { fill: i.disableFill, stroke: i.disableStroke, lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: i.edgeMainStroke, lineAppendWidth: 2 }, color: i.edgeMainStroke, }, edgeStateStyles: { active: { stroke: i.edgeActiveStroke, lineWidth: 1 }, selected: { stroke: i.edgeSelectedStroke, lineWidth: 2, shadowColor: i.edgeSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.edgeHighlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.edgeInactiveStroke, lineWidth: 1 }, disable: { stroke: i.edgeDisableStroke, lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12 }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: i.comboMainFill, lineWidth: 1, stroke: i.comboMainStroke, r: 5, width: 20, height: 10, }, size: [20, 5], color: i.comboMainStroke, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: i.comboActiveStroke, lineWidth: 1, fill: i.comboActiveFill, }, selected: { stroke: i.comboSelectedStroke, lineWidth: 2, fill: i.comboSelectedFill, shadowColor: i.comboSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.comboHighlightStroke, lineWidth: 2, fill: i.comboHighlightFill, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.comboInactiveStroke, fill: i.comboInactiveFill, lineWidth: 1, }, disable: { stroke: i.comboDisableStroke, fill: i.comboDisableFill, lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, textWaterMarkerConfig: { width: 150, height: 100, compatible: !1, text: { x: 0, y: 60, lineHeight: 20, rotate: 20, fontSize: 14, fontFamily: "Microsoft YaHei", fill: "rgba(0, 0, 0, 0.1)", baseline: "Middle", }, }, imageWaterMarkerConfig: { image: { x: 0, y: 0, width: 30, height: 20, rotate: 0 }, }, waterMarkerImage: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", }; }, 180: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.getOffScreenContext = void 0); var r = null; e.getOffScreenContext = function () { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; }; }, 181: function (t, e, n) { "use strict"; var r = n(182), i = n(183), o = Object.hasOwnProperty, a = {}; for (var s in r) o.call(r, s) && (a[r[s]] = s); var c = (t.exports = { to: {}, get: {} }); function u(t, e, n) { return Math.min(Math.max(e, t), n); } function h(t) { var e = Math.round(t).toString(16).toUpperCase(); return e.length < 2 ? "0" + e : e; } (c.get = function (t) { var e, n; switch (t.substring(0, 3).toLowerCase()) { case "hsl": (e = c.get.hsl(t)), (n = "hsl"); break; case "hwb": (e = c.get.hwb(t)), (n = "hwb"); break; default: (e = c.get.rgb(t)), (n = "rgb"); } return e ? { model: n, value: e } : null; }), (c.get.rgb = function (t) { if (!t) return null; var e, n, i, a, s = [0, 0, 0, 1]; if ((n = t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i))) { for (a = n[2], n = n[1], i = 0; i < 3; i++) (e = 2 * i), (s[i] = parseInt(n.slice(e, e + 2), 16)); a && (s[3] = parseInt(a, 16) / 255); } else if ((n = t.match(/^#([a-f0-9]{3,4})$/i))) { for (a = (n = n[1])[3], i = 0; i < 3; i++) s[i] = parseInt(n[i] + n[i], 16); a && (s[3] = parseInt(a + a, 16) / 255); } else if ( (n = t.match( /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) { for (i = 0; i < 3; i++) s[i] = parseInt(n[i + 1], 0); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } else { if ( !(n = t.match( /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) return (n = t.match(/^(\w+)$/)) ? "transparent" === n[1] ? [0, 0, 0, 0] : o.call(r, n[1]) ? (((s = r[n[1]])[3] = 1), s) : null : null; for (i = 0; i < 3; i++) s[i] = Math.round(2.55 * parseFloat(n[i + 1])); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } for (i = 0; i < 3; i++) s[i] = u(s[i], 0, 255); return (s[3] = u(s[3], 0, 1)), s; }), (c.get.hsl = function (t) { if (!t) return null; var e, n = t.match( /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.get.hwb = function (t) { if (!t) return null; var e, n = t.match( /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.to.hex = function () { var t = i(arguments); return ( "#" + h(t[0]) + h(t[1]) + h(t[2]) + (t[3] < 1 ? h(Math.round(255 * t[3])) : "") ); }), (c.to.rgb = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "rgb(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ")" : "rgba(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ", " + t[3] + ")"; }), (c.to.rgb.percent = function () { var t = i(arguments), e = Math.round((t[0] / 255) * 100), n = Math.round((t[1] / 255) * 100), r = Math.round((t[2] / 255) * 100); return t.length < 4 || 1 === t[3] ? "rgb(" + e + "%, " + n + "%, " + r + "%)" : "rgba(" + e + "%, " + n + "%, " + r + "%, " + t[3] + ")"; }), (c.to.hsl = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" : "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + t[3] + ")"; }), (c.to.hwb = function () { var t = i(arguments), e = ""; return ( t.length >= 4 && 1 !== t[3] && (e = ", " + t[3]), "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + e + ")" ); }), (c.to.keyword = function (t) { return a[t.slice(0, 3)]; }); }, 182: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 183: function (t, e, n) { "use strict"; var r = n(184), i = Array.prototype.concat, o = Array.prototype.slice, a = (t.exports = function (t) { var e, n, a, s = []; for (e = 0, n = t.length; e < n; e++) (a = t[e]), r(a) ? (s = i.call(s, o.call(a))) : s.push(a); return s; }); a.wrap = function (t) { return function () { return t(a(arguments)); }; }; }, 184: function (t, e, n) { "use strict"; t.exports = function (t) { return ( !(!t || "string" == typeof t) && (t instanceof Array || Array.isArray(t) || (t.length >= 0 && (t.splice instanceof Function || (Object.getOwnPropertyDescriptor(t, t.length - 1) && "String" !== t.constructor.name)))) ); }; }, 185: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(100), a = n(187), s = {}; Object.keys(o).forEach(function (t) { (s[t] = {}), Object.defineProperty(s[t], "channels", { value: o[t].channels }), Object.defineProperty(s[t], "labels", { value: o[t].labels }); var e = a(t); Object.keys(e).forEach(function (n) { var r = e[n]; (s[t][n] = (function (t) { var e = function (e) { if (null == e) return e; arguments.length > 1 && (e = Array.prototype.slice.call(arguments)); var n, r, o = t(e); if ("object" === i(o)) for (n = o.length, r = 0; r < n; r++) o[r] = Math.round(o[r]); return o; }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)), (s[t][n].raw = (function (t) { var e = function (e) { return null == e ? e : (arguments.length > 1 && (e = Array.prototype.slice.call(arguments)), t(e)); }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)); }); }), (t.exports = s); }, 186: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 187: function (t, e, n) { "use strict"; var r = n(100); function i(t) { var e, n, i, o, a, s, c = (function () { var t, e, n = {}, i = Object.keys(r); for (t = i.length, e = 0; e < t; e++) n[i[e]] = { distance: -1, parent: null }; return n; })(), u = [t]; for (c[t].distance = 0; u.length; ) for ( e = u.pop(), i = (n = Object.keys(r[e])).length, o = 0; o < i; o++ ) -1 === (s = c[(a = n[o])]).distance && ((s.distance = c[e].distance + 1), (s.parent = e), u.unshift(a)); return c; } function o(t, e) { return function (n) { return e(t(n)); }; } function a(t, e) { for ( var n = [e[t].parent, t], i = r[e[t].parent][t], a = e[t].parent; e[a].parent; ) n.unshift(e[a].parent), (i = o(r[e[a].parent][a], i)), (a = e[a].parent); return (i.conversion = n), i; } t.exports = function (t) { var e, n, r, o = i(t), s = {}, c = Object.keys(o); for (e = c.length, n = 0; n < e; n++) null !== o[(r = c[n])].parent && (s[r] = a(r, o)); return s; }; }, 188: function (t, e, n) { "use strict"; var r = Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }, i = function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), i(n(189), e), i(n(190), e), i(n(191), e), i(n(192), e), i(n(193), e), i(n(194), e); }, 189: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r = /-(\w)/g; e.camelize = (function (t) { var e = Object.create(null); return function (n) { return e[n] || (e[n] = t(n)); }; })(function (t) { return t.replace(r, function (t, e) { return e ? e.toUpperCase() : ""; }); }); }, 190: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 191: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 192: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { var r, i = []; for (r = 0; r < t; r++) i[r] = 0; return n ? (n.forEach(function (t) { t.source && (i[e[t.source]] += 1), t.target && (i[e[t.target]] += 1); }), i) : i; }; e.floydWarshall = function (t) { var e, n = [], r = t.length; for (i = 0; i < r; i += 1) for (n[i] = [], o = 0; o < r; o += 1) i === o ? (n[i][o] = 0) : 0 !== t[i][o] && t[i][o] ? (n[i][o] = t[i][o]) : (n[i][o] = 1 / 0); for (e = 0; e < r; e += 1) for (var i = 0; i < r; i += 1) for (var o = 0; o < r; o += 1) n[i][o] > n[i][e] + n[e][o] && (n[i][o] = n[i][e] + n[e][o]); return n; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { (o[t.id] = e), i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { var r; if (e && e.children) for (r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 193: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = function () { return (o = Object.assign || function (t) { var e, n, r; for (n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === i(t); }; e.clone = function (t) { var n, r; return null === t ? t : t instanceof Date ? new Date(t.getTime()) : t instanceof Array ? ((n = []), t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); })) : "object" === i(t) && t !== {} ? ((r = o({}, t)), Object.keys(r).forEach(function (t) { r[t] = e.clone(r[t]); }), r) : t; }; }, 194: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 195: function (t, e) { (function (e) { t.exports = e; }).call(this, {}); }, 2: function (t, e, n) { "use strict"; n.d(e, "d", function () { return Le; }), n.d(e, "g", function () { return _e; }), n.d(e, "f", function () { return De; }), n.d(e, "l", function () { return We; }), n.d(e, "j", function () { return Ve; }), n.d(e, "b", function () { return we; }), n.d(e, "h", function () { return Ye; }), n.d(e, "k", function () { return qe; }), n.d(e, "i", function () { return Ge; }), n.d(e, "c", function () { return Xe; }), n.d(e, "a", function () { return ze; }), n.d(e, "e", function () { return He; }); var r = {}; n.r(r), n.d(r, "compare", function () { return m; }), n.d(r, "getLineIntersect", function () { return x; }), n.d(r, "getRectIntersectByPoint", function () { return w; }), n.d(r, "getCircleIntersectByPoint", function () { return S; }), n.d(r, "getEllipseIntersectByPoint", function () { return O; }), n.d(r, "applyMatrix", function () { return M; }), n.d(r, "invertMatrix", function () { return k; }), n.d(r, "getCircleCenterByPoints", function () { return C; }), n.d(r, "distance", function () { return E; }), n.d(r, "scaleMatrix", function () { return j; }), n.d(r, "floydWarshall", function () { return P; }), n.d(r, "getAdjMatrix", function () { return A; }), n.d(r, "translate", function () { return I; }), n.d(r, "move", function () { return T; }), n.d(r, "scale", function () { return N; }), n.d(r, "rotate", function () { return B; }), n.d(r, "getDegree", function () { return L; }), n.d(r, "isPointInPolygon", function () { return _; }), n.d(r, "intersectBBox", function () { return R; }), n.d(r, "isPolygonsIntersect", function () { return F; }), n.d(r, "Line", function () { return Y; }), n.d(r, "getBBoxBoundLine", function () { return X; }), n.d(r, "itemIntersectByLine", function () { return W; }), n.d(r, "fractionToLine", function () { return q; }), n.d(r, "getPointsCenter", function () { return V; }), n.d(r, "squareDist", function () { return G; }), n.d(r, "pointLineSquareDist", function () { return H; }), n.d(r, "isPointsOverlap", function () { return U; }), n.d(r, "pointRectSquareDist", function () { return Z; }), n.d(r, "pointLineDistance", function () { return K; }); var i = {}; n.r(i), n.d(i, "getBBox", function () { return ut; }), n.d(i, "getLoopCfgs", function () { return ht; }), n.d(i, "getLabelPosition", function () { return lt; }), n.d(i, "traverseTree", function () { return dt; }), n.d(i, "traverseTreeUp", function () { return pt; }), n.d(i, "getLetterWidth", function () { return gt; }), n.d(i, "getTextSize", function () { return vt; }), n.d(i, "plainCombosToTrees", function () { return yt; }), n.d(i, "reconstructTree", function () { return mt; }), n.d(i, "getComboBBox", function () { return bt; }), n.d(i, "shouldRefreshEdge", function () { return xt; }), n.d(i, "cloneBesidesImg", function () { return wt; }); var o = {}; n.r(o), n.d(o, "uniqueId", function () { return Ct; }), n.d(o, "formatPadding", function () { return Et; }), n.d(o, "cloneEvent", function () { return jt; }), n.d(o, "isViewportChanged", function () { return Pt; }), n.d(o, "isNaN", function () { return At; }), n.d(o, "calculationItemsBBox", function () { return It; }), n.d(o, "processParallelEdges", function () { return Tt; }); var a = {}; n.r(a), n.d(a, "getSpline", function () { return te; }), n.d(a, "getControlPoint", function () { return ee; }), n.d(a, "pointsToPolygon", function () { return ne; }), n.d(a, "pathToPoints", function () { return re; }), n.d(a, "getClosedSpline", function () { return ie; }), n.d(a, "roundedHull", function () { return ce; }), n.d(a, "paddedHull", function () { return ue; }); var s = {}; n.r(s), n.d(s, "defaultSubjectColors", function () { return Re; }); var c = n(0), u = { getDefaultCfg: function () { return {}; }, getEvents: function () { return {}; }, updateCfg: function (t) { return Object.assign(this, t), !0; }, shouldBegin: function () { return !0; }, shouldUpdate: function () { return !0; }, shouldEnd: function () { return !0; }, bind: function (t) { var e = this.events; (this.graph = t), ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !0), Object(c.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !1), Object(c.each)(e, function (e, n) { t.off(n, e); }); }, get: function (t) { return this[t]; }, set: function (t, e) { return (this[t] = e), this; }, }, h = (function () { function t() {} return ( (t.registerBehavior = function (e, n) { if (!n) throw new Error( "please specify handler for this behavior: ".concat(e), ); var r = Object(c.clone)(u); Object.assign(r, n); var i = function (t) { var e = this; Object.assign(this, this.getDefaultCfg(), t); var n = this.getEvents(); this.events = null; var r = {}; n && (Object(c.each)(n, function (t, n) { r[n] = Object(c.wrapBehavior)(e, t); }), (this.events = r)); }; (i.prototype = r), (t.types[e] = i); }), (t.hasBehavior = function (e) { return !!t.types[e]; }), (t.getBehavior = function (e) { return t.types[e]; }), (t.types = {}), t ); })(), l = h, f = n(1), d = n(73), p = n(76), g = n(3), v = n(27), y = g.a.transform, m = function (t) { return function (e, n) { return e[t] - n[t]; }; }, b = function (t, e, n) { return t >= e && t <= n; }, x = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = e.x - t.x, s = e.y - t.y, c = r.x - n.x, u = r.y - n.y, h = a * u - s * c, l = 1 / h; if (h * h > 1e-4 * (a * a + s * s) * (c * c + u * u)) { var f = (i * u - o * c) * l, d = (i * s - o * a) * l; return b(f, 0, 1) && b(d, 0, 1) ? { x: t.x + f * a, y: t.y + f * s } : null; } return null; }, w = function (t, e) { var n = t.x, r = t.y, i = t.width, o = t.height, a = [], s = { x: n + i / 2, y: r + o / 2 }; a.push({ x: n, y: r }), a.push({ x: n + i, y: r }), a.push({ x: n + i, y: r + o }), a.push({ x: n, y: r + o }), a.push({ x: n, y: r }); for ( var c = null, u = 1; u < a.length && !(c = x(a[u - 1], a[u], s, e)); u++ ); return c; }, S = function (t, e) { var n = t.x, r = t.y, i = t.r, o = e.x - n, a = e.y - r; if (Math.sqrt(o * o + a * a) < i) return null; var s = Math.sign(o), c = Math.sign(a), u = Math.atan(a / o); return { x: n + Math.abs(i * Math.cos(u)) * s, y: r + Math.abs(i * Math.sin(u)) * c, }; }, O = function (t, e) { var n = t.rx, r = t.ry, i = t.x, o = t.y, a = e.x - i, s = e.y - o, c = Math.atan2(s / r, a / n); return ( c < 0 && (c += 2 * Math.PI), { x: i + n * Math.cos(c), y: o + r * Math.sin(c) } ); }, M = function (t, e, n) { void 0 === n && (n = 1); var r = [t.x, t.y, n]; return ( (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]), g.d.transformMat3(r, r, e), { x: r[0], y: r[1] } ); }, k = function (t, e, n) { void 0 === n && (n = 1), (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = g.b.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], e); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var i = [t.x, t.y, n]; return g.d.transformMat3(i, i, r), { x: i[0], y: i[1] }; }, C = function (t, e, n) { var r = t.x - e.x, i = t.y - e.y, o = t.x - n.x, a = t.y - n.y, s = (t.x * t.x - e.x * e.x - e.y * e.y + t.y * t.y) / 2, c = (t.x * t.x - n.x * n.x - n.y * n.y + t.y * t.y) / 2, u = i * o - r * a; return { x: -(a * s - i * c) / u, y: -(r * c - o * s) / u }; }, E = function (t, e) { var n = t.x - e.x, r = t.y - e.y; return Math.sqrt(n * n + r * r); }, j = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }, P = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var i = 0; i < n; i += 1) r === i ? (e[r][i] = 0) : 0 !== t[r][i] && t[r][i] ? (e[r][i] = t[r][i]) : (e[r][i] = 1 / 0); } for (var o = 0; o < n; o += 1) for (r = 0; r < n; r += 1) for (i = 0; i < n; i += 1) e[r][i] > e[r][o] + e[o][i] && (e[r][i] = e[r][o] + e[o][i]); return e; }, A = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }, I = function (t, e) { t.translate(e.x, e.y); }, T = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = t.getCanvasBBox(), i = e.x - r.minX, o = e.y - r.minY, a = y(n, [["t", i, o]]); t.setMatrix(a); }, N = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e; Object(c.isArray)(e) || (r = [e, e]), Object(c.isArray)(e) && 1 === e.length && (r = [e[0], e[0]]), (n = y(n, [["s", r[0], r[1]]])), t.setMatrix(n); }, B = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (n = y(n, [["r", e]])), t.setMatrix(n); }, L = function (t, e, n) { for (var r = [], i = 0; i < t; i++) r[i] = 0; return ( n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r ); }; function D(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } var _ = function (t, e, n) { var r = !1, i = t.length; function o(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } if (i <= 2) return !1; for (var a = 0; a < i; a++) { var s = t[a], c = t[(a + 1) % i]; if (D(s, c, [e, n])) return !0; o(s[1] - n) > 0 != o(c[1] - n) > 0 && o(e - ((n - s[1]) * (s[0] - c[0])) / (s[1] - c[1]) - s[0]) < 0 && (r = !r); } return r; }, R = function (t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); }, F = function (t, e) { var n = function (t) { var e = t.map(function (t) { return t[0]; }), n = t.map(function (t) { return t[1]; }); return { minX: Math.min.apply(null, e), maxX: Math.max.apply(null, e), minY: Math.min.apply(null, n), maxY: Math.max.apply(null, n), }; }, r = function (t) { for (var e = [], n = t.length, r = 0; r < n - 1; r++) { var i = t[r], o = t[r + 1]; e.push({ from: { x: i[0], y: i[1] }, to: { x: o[0], y: o[1] }, }); } if (e.length > 1) { var a = t[0], s = t[n - 1]; e.push({ from: { x: s[0], y: s[1] }, to: { x: a[0], y: a[1] }, }); } return e; }; if (t.length < 2 || e.length < 2) return !1; var i = n(t), o = n(e); if (!R(i, o)) return !1; var a = !1; if ( (Object(c.each)(e, function (e) { if (_(t, e[0], e[1])) return (a = !0), !1; }), a) ) return !0; if ( (Object(c.each)(t, function (t) { if (_(e, t[0], t[1])) return (a = !0), !1; }), a) ) return !0; var s = r(t), u = r(e), h = !1; return ( Object(c.each)(u, function (t) { if ( (function (t, e) { var n = !1; return ( Object(c.each)(t, function (t) { if (x(t.from, t.to, e.from, e.to)) return (n = !0), !1; }), n ); })(s, t) ) return (h = !0), !1; }), h ); }, Y = (function () { function t(t, e, n, r) { (this.x1 = t), (this.y1 = e), (this.x2 = n), (this.y2 = r); } return ( (t.prototype.getBBox = function () { var t = Math.min(this.x1, this.x2), e = Math.min(this.y1, this.y2), n = Math.max(this.x1, this.x2), r = Math.max(this.y1, this.y2); return { x: t, y: e, minX: t, minY: e, maxX: n, maxY: r, width: n - t, height: r - e, }; }), t ); })(), X = function (t, e) { return { top: [t.minX, t.minY, t.maxX, t.minY], left: [t.minX, t.minY, t.minX, t.maxY], bottom: [t.minX, t.maxY, t.maxX, t.maxY], right: [t.maxX, t.minY, t.maxX, t.maxY], }[e]; }, z = function (t, e) { var n = (e.x2 - e.x1) * (t.y1 - e.y1) - (e.y2 - e.y1) * (t.x1 - e.x1), r = (t.x2 - t.x1) * (t.y1 - e.y1) - (t.y2 - t.y1) * (t.x1 - e.x1), i = (e.y2 - e.y1) * (t.x2 - t.x1) - (e.x2 - e.x1) * (t.y2 - t.y1); if (i) { var o = n / i, a = r / i; if (o >= 0 && o <= 1 && a >= 0 && a <= 1) return o; } return Number.POSITIVE_INFINITY; }, W = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = 0, o = [], a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3]; (o[a] = x( { x: e.x1, y: e.y1 }, { x: e.x2, y: e.y2 }, { x: c, y: u }, { x: h, y: l }, )), o[a] && (i += 1); } return [o, i]; }, q = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = Number.POSITIVE_INFINITY, o = 0, a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3], f = z(e, new Y(c, u, h, l)); (f = Math.abs(f - 0.5)) >= 0 && f <= 1 && ((o += 1), (i = f < i ? f : i)); } return 0 === o ? -1 : i; }, V = function (t) { var e = 0, n = 0; if (t.length > 0) { for (var r = 0, i = t; r < i.length; r++) { var o = i[r]; (e += o.x), (n += o.y); } (e /= t.length), (n /= t.length); } return { x: e, y: n }; }, G = function (t, e) { return Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2); }, H = function (t, e) { var n, r = e.x1, i = e.y1, o = e.x2 - r, a = e.y2 - i, s = t.x - r, c = t.y - i, u = s * o + c * a; n = u <= 0 || (u = (s = o - s) * o + (c = a - c) * a) <= 0 ? 0 : (u * u) / (o * o + a * a); var h = s * s + c * c - n; return h < 0 && (h = 0), h; }, U = function (t, e, n) { return ( void 0 === n && (n = 0.001), Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2) < Math.pow(n, 2) ); }, Z = function (t, e) { var n = t.x < e.x, r = t.x > e.x + e.width, i = t.y > e.y + e.height, o = t.y < e.y; if (!(n || r || i || o)) return 0; if (i && !n && !r) return Math.pow(e.y + e.height - t.y, 2); if (o && !n && !r) return Math.pow(t.y - e.y, 2); if (n && !i && !o) return Math.pow(e.x - t.x, 2); if (r && !i && !o) return Math.pow(e.x + e.width - t.x, 2); var a = Math.min(Math.abs(e.x - t.x), Math.abs(e.x + e.width - t.x)), s = Math.min(Math.abs(e.y - t.y), Math.abs(e.y + e.height - t.y)); return a * a + s * s; }, K = function (t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], a = e.x, s = e.y, c = [i - n, o - r]; if (g.c.exactEquals(c, [0, 0])) return NaN; var u = [-c[1], c[0]]; g.c.normalize(u, u); var h = [a - n, s - r]; return Math.abs(g.c.dot(h, u)); }, $ = "rgb(95, 149, 255)", Q = "rgb(253, 253, 253)", J = "rgb(247, 250, 255)", tt = "rgb(224, 224, 224)", et = "rgb(224, 224, 224)", nt = { version: "0.0.2", rootContainerClassName: "root-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: $, fill: "rgb(239, 244, 255)" }, size: 20, color: $, linkPoints: { size: 8, lineWidth: 1, fill: J, stroke: $ }, }, nodeStateStyles: { active: { fill: J, stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, }, selected: { fill: "rgb(255, 255, 255)", stroke: $, lineWidth: 4, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: "rgb(223, 234, 255)", stroke: "#4572d9", lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: "rgb(247, 250, 255)", stroke: "rgb(191, 213, 255)", lineWidth: 1, }, disable: { fill: "rgb(250, 250, 250)", stroke: "rgb(224, 224, 224)", lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: tt, lineAppendWidth: 2 }, color: tt, }, edgeStateStyles: { active: { stroke: $, lineWidth: 1 }, selected: { stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: $, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(234, 234, 234)", lineWidth: 1 }, disable: { stroke: "rgb(245, 245, 245)", lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12, }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: Q, lineWidth: 1, stroke: et, r: 5, width: 20, height: 10, }, size: [20, 5], color: et, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: $, lineWidth: 1, fill: "rgb(247, 250, 255)" }, selected: { stroke: $, lineWidth: 2, fill: Q, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: "#4572d9", lineWidth: 2, fill: Q, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(224, 224, 224)", fill: Q, lineWidth: 1 }, disable: { stroke: "rgb(234, 234, 234)", fill: "rgb(250, 250, 250)", lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, }, rt = { " ": 0.3329986572265625, a: 0.5589996337890625, A: 0.6569992065429687, b: 0.58599853515625, B: 0.6769989013671875, c: 0.5469985961914062, C: 0.7279998779296875, d: 0.58599853515625, D: 0.705999755859375, e: 0.554998779296875, E: 0.63699951171875, f: 0.37299957275390627, F: 0.5769989013671875, g: 0.5909988403320312, G: 0.7479995727539063, h: 0.555999755859375, H: 0.7199996948242188, i: 0.255999755859375, I: 0.23699951171875, j: 0.26699981689453123, J: 0.5169998168945312, k: 0.5289993286132812, K: 0.6899993896484375, l: 0.23499908447265624, L: 0.5879989624023437, m: 0.854998779296875, M: 0.8819992065429687, n: 0.5589996337890625, N: 0.7189987182617188, o: 0.58599853515625, O: 0.7669998168945312, p: 0.58599853515625, P: 0.6419998168945312, q: 0.58599853515625, Q: 0.7669998168945312, r: 0.3649993896484375, R: 0.6759994506835938, s: 0.504998779296875, S: 0.6319992065429687, t: 0.354998779296875, T: 0.6189987182617187, u: 0.5599990844726562, U: 0.7139999389648437, v: 0.48199920654296874, V: 0.6389999389648438, w: 0.754998779296875, W: 0.929998779296875, x: 0.5089996337890625, X: 0.63699951171875, y: 0.4959991455078125, Y: 0.66199951171875, z: 0.48699951171875, Z: 0.6239990234375, 0: 0.6, 1: 0.40099945068359377, 2: 0.6, 3: 0.6, 4: 0.6, 5: 0.6, 6: 0.6, 7: 0.5469985961914062, 8: 0.6, 9: 0.6, "[": 0.3329986572265625, "]": 0.3329986572265625, ",": 0.26399993896484375, ".": 0.26399993896484375, ";": 0.26399993896484375, ":": 0.26399993896484375, "{": 0.3329986572265625, "}": 0.3329986572265625, "\\": 0.5, "|": 0.19499969482421875, "=": 0.604998779296875, "+": 0.604998779296875, "-": 0.604998779296875, _: 0.5, "`": 0.3329986572265625, " ~": 0.8329986572265625, "!": 0.3329986572265625, "@": 0.8579986572265625, "#": 0.6, $: 0.6, "%": 0.9699996948242188, "^": 0.517999267578125, "&": 0.7259994506835937, "*": 0.505999755859375, "(": 0.3329986572265625, ")": 0.3329986572265625, "<": 0.604998779296875, ">": 0.604998779296875, "/": 0.5, "?": 0.53699951171875, }, it = Math.PI, ot = Math.sin, at = Math.cos, st = ot(it / 8), ct = at(it / 8), ut = function (t, e) { var n = t.getBBox(), r = { x: n.minX, y: n.minY }, i = { x: n.maxX, y: n.maxY }; if (e) { var o = e.getMatrix(); o || (o = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = M(r, o)), (i = M(i, o)); } var a = r.x, s = r.y, c = i.x, u = i.y; return { x: a, y: s, minX: a, minY: s, maxX: c, maxY: u, width: c - a, height: u - s, }; }, ht = function (t) { var e = t.sourceNode || t.targetNode, n = e.get("group").getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e.getKeyShape().getBBox(), i = t.loopCfg || {}, o = i.dist || 2 * Math.max(r.width, r.height), a = i.position || nt.defaultLoopPosition, s = [n[6], n[7]], c = [t.startPoint.x, t.startPoint.y], u = [t.endPoint.x, t.endPoint.y], h = r.height / 2, l = r.height / 2, f = h * st, d = h * ct, p = l * st, v = l * ct; if (c[0] === u[0] && c[1] === u[1]) { switch (a) { case "top": (c = [s[0] - f, s[1] - d]), (u = [s[0] + p, s[1] - v]); break; case "top-right": (h = r.height / 2), (l = r.width / 2), (c = [s[0] + (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (v = l * ct), s[1] - (p = l * st)]); break; case "right": (h = r.width / 2), (l = r.width / 2), (c = [s[0] + (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] + (v = l * ct), s[1] + (p = l * st)]); break; case "bottom-right": (h = r.width / 2), (l = r.height / 2), (c = [s[0] + (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] + (p = l * st), s[1] + (v = l * ct)]); break; case "bottom": (h = r.height / 2), (l = r.height / 2), (c = [s[0] + (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (p = l * st), s[1] + (v = l * ct)]); break; case "bottom-left": (h = r.height / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (v = l * ct), s[1] + (p = l * st)]); break; case "left": (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] - (v = l * ct), s[1] - (p = l * st)]); break; case "top-left": (h = r.width / 2), (l = r.height / 2), (c = [s[0] - (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] - (p = l * st), s[1] - (v = l * ct)]); break; default: (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (p = l * st), s[1] - (v = l * ct)]); } if (!1 === i.clockwise) { var y = [c[0], c[1]]; (c = [u[0], u[1]]), (u = [y[0], y[1]]); } } var m = [c[0] - s[0], c[1] - s[1]], b = (h + o) / h, x = (l + o) / l; !1 === i.clockwise && ((b = (l + o) / l), (x = (h + o) / h)); var w = g.c.scale([0, 0], m, b), S = [s[0] + w[0], s[1] + w[1]], O = [u[0] - s[0], u[1] - s[1]], M = g.c.scale([0, 0], O, x), k = [s[0] + M[0], s[1] + M[1]]; return ( (t.startPoint = { x: c[0], y: c[1] }), (t.endPoint = { x: u[0], y: u[1] }), (t.controlPoints = [ { x: S[0], y: S[1] }, { x: k[0], y: k[1] }, ]), t ); }, lt = function (t, e, n, r, i) { var o = [], a = t.getPoint(e); if (null === a) return { x: 0, y: 0, angle: 0 }; if (e < 1e-4) o = t.getStartTangent().reverse(); else if (e > 0.9999) o = t.getEndTangent(); else { var s = t.getPoint(e + 1e-4); o.push([a.x, a.y]), o.push([s.x, s.y]); } var c = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]); if ( (c < 0 && (c += 2 * it), n && ((a.x += at(c) * n), (a.y += ot(c) * n)), r) ) { var u = c - it / 2; c > 0.5 * it && c < 1.5 * it && (u -= it), (a.x += at(u) * r), (a.y += ot(u) * r); } var h = { x: a.x, y: a.y, angle: c }; return i ? (c > 0.5 * it && c < 1.5 * it && (c -= it), Object(f.a)({ rotate: c }, h)) : h; }, ft = function t(e, n) { if (!1 === n(e)) return !1; if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return !1; return !0; }, dt = function (t, e) { "function" == typeof e && ft(t, e); }, pt = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !1 !== n(e); })(t, e); }, gt = function (t, e) { return e * (rt[t] || 1); }, vt = function (t, e) { var n = 0, r = new RegExp("[一-龥]+"); return ( t.split("").forEach(function (t) { r.test(t) ? (n += e) : (n += gt(t, e)); }), [n, e] ); }, yt = function (t, e) { var n = [], r = {}, i = {}; t.forEach(function (t) { i[t.id] = t; }), t.forEach(function (t, e) { var o = Object(c.clone)(t); (o.itemType = "combo"), (o.children = void 0), o.parentId === o.id ? (console.warn( "The parentId for combo ".concat( o.id, " can not be the same as the combo's id", ), ), delete o.parentId) : o.parentId && !i[o.parentId] && (console.warn( "The parent combo for combo ".concat( o.id, " does not exist!", ), ), delete o.parentId); var a = r[o.id]; if (a) { if ( ((o.children = a.children), (r[o.id] = o), !(a = o).parentId) ) return void n.push(a); var s = r[a.parentId]; if (s) s.children ? s.children.push(o) : (s.children = [o]); else { var u = { id: a.parentId, children: [a] }; (r[a.parentId] = u), (r[o.id] = o); } } else if (Object(c.isString)(t.parentId)) { var h = r[t.parentId]; if (h) h.children ? h.children.push(o) : (h.children = [o]), (r[o.id] = o); else { var l = { id: t.parentId, children: [o] }; (r[l.id] = l), (r[o.id] = o); } } else n.push(o), (r[o.id] = o); }); var o = {}; (e || []).forEach(function (t) { o[t.id] = t; var e = r[t.comboId]; if (e) { var n = { id: t.id, comboId: t.comboId }; e.children ? e.children.push(n) : (e.children = [n]), (n.itemType = "node"), (r[t.id] = n); } }); var a = 0; return ( n.forEach(function (t) { (t.depth = a + 10), ft(t, function (t) { var e, n = r[t.id].itemType; (e = "node" === n ? r[t.comboId] : r[t.parentId]), (t.depth = e && "node" === n ? a + 1 : a + 10), a < t.depth && (a = t.depth); var i = o[t.id]; return i && (i.depth = t.depth), !0; }); }), n ); }, mt = function (t, e, n) { var r, i = t, o = { root: { children: t } }, a = !1, s = "root"; (t || []).forEach(function (t) { if (!a) return t.id === e ? ((r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), void (a = !0)) : void dt(t, function (t) { return ( (o[t.id] = { children: t.children }), (i = o[t.parentId || t.comboId || "root"].children), !t || (!t.removed && e !== t.id) || !i || ((s = t.parentId || t.comboId || "root"), (r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), (a = !0), !1) ); }); }); var c = (i = o[s].children) ? i.indexOf(r) : -1; if ( (c > -1 && i.splice(c, 1), a || ((r = { id: e, itemType: "node", comboId: n }), (o[e] = { children: void 0 })), e) ) { var u = !1; if (n) { var h = 0; (t || []).forEach(function (t) { u || dt(t, function (t) { return ( n !== t.id || ((u = !0), t.children ? t.children.push(r) : (t.children = [r]), (h = t.depth), "node" === r.itemType ? (r.depth = h + 2) : (r.depth = h + 1), !1) ); }); }); } else (n && u) || "node" === r.itemType || t.push(r); var l = r.depth; dt(r, function (t) { return ( "node" === t.itemType ? (l += 2) : (l += 1), (t.depth = l), !0 ); }); } return t; }, bt = function (t, e) { var n = { minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0, x: void 0, y: void 0, width: void 0, height: void 0, centerX: void 0, centerY: void 0, }; return t && 0 !== t.length ? (t.forEach(function (t) { var r = e.findById(t.id); if (r && r.isVisible()) { r.set("bboxCanvasCache", void 0); var i = r.getCanvasBBox(); i.x && n.minX > i.minX && (n.minX = i.minX), i.y && n.minY > i.minY && (n.minY = i.minY), i.x && n.maxX < i.maxX && (n.maxX = i.maxX), i.y && n.maxY < i.maxY && (n.maxY = i.maxY); } }), (n.x = (n.minX + n.maxX) / 2), (n.y = (n.minY + n.maxY) / 2), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), Object.keys(n).forEach(function (t) { (n[t] !== 1 / 0 && n[t] !== -1 / 0) || (n[t] = void 0); }), n) : n; }, xt = function (t) { var e = Object(c.isNumber)(t.x) || Object(c.isNumber)(t.y) || t.type || t.anchorPoints || t.size; return ( t.style && (e = e || Object(c.isNumber)(t.style.r) || Object(c.isNumber)(t.style.width) || Object(c.isNumber)(t.style.height) || Object(c.isNumber)(t.style.rx) || Object(c.isNumber)(t.style.ry)), e ); }, wt = function (t) { var e = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n]; if (Object(c.isObject)(r)) { var i = {}; Object.keys(r).forEach(function (t) { var e = r[t]; ("img" !== t || Object(c.isString)(e)) && (i[t] = Object(c.clone)(e)); }), (e[n] = i); } else e[n] = Object(c.clone)(r); }), e ); }, St = function (t) { if (!t) return console.error("G6 Error Tips: the data must be defined"), !1; var e = t.nodes, n = t.edges, r = t.combos, i = void 0 === r ? [] : r; if (!e && !n) { var o = !0; return ( dt(t, function (t) { return !!Object(c.isString)(t.id) || ((o = !1), !1); }), o ); } var a = (e || []).find(function (t) { return !Object(c.isString)(t.id); }); if (a) return ( console.warn( "G6 Warning Tips: missing 'id' property, or %c".concat( a.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); var s = (e || []).map(function (t) { return t.id; }), u = i.map(function (t) { return t.id; }), h = Object(f.f)(Object(f.f)([], s, !0), u, !0), l = (n || []).find(function (t) { return !h.includes(t.source) || !h.includes(t.target); }); return ( !l || (console.warn( "G6 Warning Tips: The source %c" .concat(l.source, "%c or the target %c") .concat( l.target, "%c of the edge do not exist in the nodes or combos.", ), "font-size: 20px; color: red;", "", "font-size: 20px; color: red;", "", ), !1) ); }, Ot = (function () { function t(t) { (this.graph = t), (this.destroyed = !1), (this.modes = t.get("modes") || { default: [] }), this.formatModes(), (this.mode = t.get("defaultMode") || "default"), (this.currentBehaves = []), this.setMode(this.mode); } return ( (t.prototype.formatModes = function () { var t = this.modes; Object(c.each)(t, function (t) { Object(c.each)(t, function (e, n) { Object(c.isString)(e) && (t[n] = { type: e }); }); }); }), (t.prototype.setBehaviors = function (t) { var e, n = this.graph, r = this.modes[t], i = []; Object(c.each)(r || [], function (t) { var r = h.getBehavior(t.type || t); r && (e = new r(t)) && (e.bind(n), i.push(e)); }), (this.currentBehaves = i); }), (t.mergeBehaviors = function (t, e) { return ( Object(c.each)(e, function (e) { t.indexOf(e) < 0 && (Object(c.isString)(e) && (e = { type: e }), t.push(e)); }), t ); }), (t.filterBehaviors = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = ""; (r = Object(c.isString)(t) ? t : t.type), e.indexOf(r) < 0 && n.push(t); }), n ); }), (t.prototype.setMode = function (t) { var e = this.modes, n = this.graph, r = t; e[r] && (n.emit("beforemodechange", { mode: t }), Object(c.each)(this.currentBehaves, function (t) { t.delegate && t.delegate.remove(), t.unbind(n); }), this.setBehaviors(r), n.emit("aftermodechange", { mode: t }), (this.mode = t)); }), (t.prototype.getMode = function () { return this.mode; }), (t.prototype.manipulateBehaviors = function (e, n, r) { var i, o = this; if (((i = Object(c.isArray)(e) ? e : [e]), Object(c.isArray)(n))) return ( Object(c.each)(n, function (e) { o.modes[e] ? (o.modes[e] = r ? t.mergeBehaviors(o.modes[e] || [], i) : t.filterBehaviors(o.modes[e] || [], i)) : r && (o.modes[e] = i); }), this ); var a = n; return ( n || (a = this.mode), this.modes[a] || (r && (this.modes[a] = i)), (this.modes[a] = r ? t.mergeBehaviors(this.modes[a] || [], i) : t.filterBehaviors(this.modes[a] || [], i)), this.setMode(this.mode), this ); }), (t.prototype.updateBehavior = function (t, e, n) { Object(c.isString)(t) && (t = { type: t }); var r = []; if (n && n !== this.mode && "default" !== n) { if (!(r = this.modes[n]) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); var i = r.length; for (a = 0; a < i; a++) { if ((s = r[a]).type === t.type || s === t.type) return ( s === t.type && (s = { type: s }), Object.assign(s, e), (r[a] = s), this ); a === i - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } else { if (!(r = this.currentBehaves) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); for (var o = r.length, a = 0; a < o; a++) { var s; if ((s = r[a]).type === t.type) return s.updateCfg(e), this; a === o - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } return this; }), (t.prototype.destroy = function () { (this.graph = null), (this.modes = null), (this.currentBehaves = null), (this.destroyed = !0); }), t ); })(), Mt = n(43), kt = (function (t) { function e(e, n) { var r = t.call(this, e, n) || this; return ( (r.item = n.item), (r.canvasX = n.canvasX), (r.canvasY = n.canvasY), (r.detail = n.detail), r ); } return Object(f.c)(e, t), e; })(n(6).d), Ct = function (t) { return "".concat(t, "-").concat(Math.random()).concat(Date.now()); }, Et = function (t) { var e = 0, n = 0, r = 0, i = 0; if (Object(c.isNumber)(t)) e = n = r = i = t; else if (Object(c.isString)(t)) { e = n = r = i = parseInt(t, 10); } else Object(c.isArray)(t) && ((e = t[0]), (r = Object(c.isNil)(t[1]) ? t[0] : t[1]), (i = Object(c.isNil)(t[2]) ? t[0] : t[2]), (n = Object(c.isNil)(t[3]) ? r : t[3])); return [e, r, i, n]; }, jt = function (t) { var e = new kt(t.type, t); return ( (e.clientX = t.clientX), (e.clientY = t.clientY), (e.x = t.x), (e.y = t.y), (e.target = t.target), (e.currentTarget = t.currentTarget), (e.bubbles = !0), (e.item = t.item), e ); }, Pt = function (t) { if (!t) return !1; for (var e = [1, 0, 0, 0, 1, 0, 0, 0, 1], n = 0; n < 9; n++) if (t[n] !== e[n]) return !0; return !1; }, At = function (t) { return Number.isNaN(Number(t)); }, It = function (t) { for ( var e = 1 / 0, n = -1 / 0, r = 1 / 0, i = -1 / 0, o = 0; o < t.length; o++ ) { var a = t[o].getBBox(), s = a.minX, c = a.minY, u = a.maxX, h = a.maxY; s < e && (e = s), c < r && (r = c), u > n && (n = u), h > i && (i = h); } return { x: Math.floor(e), y: Math.floor(r), width: Math.ceil(n) - Math.floor(e), height: Math.ceil(i) - Math.floor(r), minX: e, minY: r, maxX: n, maxY: i, }; }, Tt = function (t, e, n, r, i) { void 0 === e && (e = 15), void 0 === n && (n = "quadratic"), void 0 === r && (r = void 0), void 0 === i && (i = void 0); for ( var o = t.length, a = 2 * e, s = [ "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ], c = {}, u = [], h = {}, l = 0; l < o; l++ ) { var f = t[l], d = f.source, p = f.target, g = "".concat(d, "-").concat(p); if (!u[l]) { c[g] || (c[g] = []), (u[l] = !0), c[g].push(f); for (var v = 0; v < o; v++) if (l !== v) { var y = t[v], m = y.source, b = y.target; u[v] || (d === b && p === m ? (c[g].push(y), (u[v] = !0), (h[ "" .concat(m, "|") .concat(b, "|") .concat(c[g].length - 1) ] = !0)) : d === m && p === b && (c[g].push(y), (u[v] = !0))); } } } for (var x in c) for (var w = c[x], S = w.length, O = 0; O < S; O++) { var M = w[O]; if (M.source !== M.target) if (1 === S && r && M.source !== M.target) M.type = r; else { M.type = n; var k = (O % 2 == 0 ? 1 : -1) * (h["".concat(M.source, "|").concat(M.target, "|").concat(O)] ? -1 : 1); M.curveOffset = S % 2 == 1 ? k * Math.ceil(O / 2) * a : k * (Math.floor(O / 2) * a + e); } else i && (M.type = i), (M.loopCfg = { position: s[O % 8], dist: 20 * Math.floor(O / 8) + 50, }); } return t; }, Nt = (function () { function t(t) { (this.destroyed = !1), (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.getViewCenter = function () { var t = this.getFormatPadding(), e = this.graph, n = this.graph.get("width"), r = e.get("height"); return { x: (n - t[1] - t[3]) / 2 + t[3], y: (r - t[0] - t[2]) / 2 + t[0], }; }), (t.prototype.fitCenter = function () { var t = this.graph, e = t.get("group"); e.resetMatrix(); var n = e.getCanvasBBox(); if (0 !== n.width && 0 !== n.height) { var r = this.getViewCenter(), i = n.x + n.width / 2, o = n.y + n.height / 2; t.translate(r.x - i, r.y - o); } }), (t.prototype.fitView = function () { var t = this.graph, e = this.getFormatPadding(), n = t.get("width"), r = t.get("height"), i = t.get("group"); i.resetMatrix(); var o = i.getCanvasBBox(); if (0 !== o.width && 0 !== o.height) { var a = this.getViewCenter(), s = o.x + o.width / 2, c = o.y + o.height / 2; t.translate(a.x - s, a.y - c); var u = (n - e[1] - e[3]) / o.width, h = (r - e[0] - e[2]) / o.height, l = u; u > h && (l = h), t.zoom(l, a); } }), (t.prototype.getFormatPadding = function () { var t = this.graph.get("fitViewPadding"); return Et(t); }), (t.prototype.focusPoint = function (t, e, n) { var r = this, i = this.getViewCenter(), o = this.getPointByCanvas(i.x, i.y), a = this.graph.get("group").getMatrix(); if ((a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), e)) { var s = (o.x - t.x) * a[0], c = (o.y - t.y) * a[4], u = 0, h = 0, l = 0, d = 0; this.graph.get("canvas").animate( function (t) { (l = s * t), (d = c * t), r.graph.translate(l - u, d - h), (u = l), (h = d); }, Object(f.a)({}, n), ); } else this.graph.translate((o.x - t.x) * a[0], (o.y - t.y) * a[4]); }), (t.prototype.getPointByCanvas = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), k({ x: t, y: e }, n) ); }), (t.prototype.getPointByClient = function (t, e) { var n = this.graph.get("canvas").getPointByClient(t, e); return this.getPointByCanvas(n.x, n.y); }), (t.prototype.getClientByPoint = function (t, e) { var n = this.graph.get("canvas"), r = this.getCanvasByPoint(t, e), i = n.getClientByPoint(r.x, r.y); return { x: i.x, y: i.y }; }), (t.prototype.getCanvasByPoint = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), M({ x: t, y: e }, n) ); }), (t.prototype.focus = function (t, e, n) { if ((Object(c.isString)(t) && (t = this.graph.findById(t)), t)) { var r = 0, i = 0; if (t.getType && "edge" === t.getType()) { var o = t.getSource().get("group").getMatrix(), a = t.getTarget().get("group").getMatrix(); o && a ? ((r = (o[6] + a[6]) / 2), (i = (o[7] + a[7]) / 2)) : (o || a) && ((r = o ? o[6] : a[6]), (i = o ? o[7] : a[7])); } else { var s = t.get("group").getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = s[6]), (i = s[7]); } this.focusPoint({ x: r, y: i }, e, n); } }), (t.prototype.changeSize = function (t, e) { var n = this.graph; if (!Object(c.isNumber)(t) || !Object(c.isNumber)(e)) throw Error( "invalid canvas width & height, please make sure width & height type is number", ); n.set({ width: t, height: e }), n.get("canvas").changeSize(t, e), n.get("plugins").forEach(function (r) { if (r.get("gridContainer")) { var i = n.get("minZoom"); Object(Mt.b)(r.get("container"), { width: "".concat(t, "px"), height: "".concat(e, "px"), }), Object(Mt.b)(r.get("gridContainer"), { width: "".concat(t / i, "px"), height: "".concat(e / i, "px"), left: 0, top: 0, }); } }); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !1); }), t ); })(); function Bt(t) { return (Bt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Lt(t) { if ("string" != typeof t) return t; var e = function (t) { if ("string" != typeof t) return t; try { return JSON.parse(t.trim()); } catch (e) { return t.trim(); } }, n = e(t); if ("string" != typeof n) return n; for ( var r = function (t) { return t[t.length - 1]; }, i = t.trim(), o = [], a = [], s = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return t.some(function (t) { return r(a) === t; }); }, c = null, u = 0, h = ""; u < i.length; ) { var l = i[u], f = s('"', "'"); if (f || l.trim()) { var d = "\\" === i[u - 1], p = s("}"), g = s("]"), v = s(","), y = r(o); if (f) if (r(a) !== l || d) h += l; else { a.pop(); var m = e(h); y.push(m), (c = m), (h = ""); } else if (g && "," === l) h && (y.push(e(h)), (h = "")); else if (p && ":" === l) a.push(","), h && (y.push(h), (h = "")); else if (v && "," === l) h && (y.push(e(h)), (h = "")), a.pop(); else if ("}" === l && (p || v)) { h && (y.push(e(h)), (h = "")), v && a.pop(); for (var b = {}, x = 1; x < y.length; x += 2) b[y[x - 1]] = y[x]; o.pop(), o.length && r(o).push(b), a.pop(), (c = b); } else "]" === l && g ? (h && (y.push(e(h)), (h = "")), o.pop(), o.length && r(o).push(y), a.pop(), (c = y)) : "{" === l ? (o.push([]), a.push("}")) : "[" === l ? (o.push([]), a.push("]")) : '"' === l ? a.push('"') : "'" === l ? a.push("'") : (h += l); u += 1; } else u += 1; } return c || h; } function Dt(t, e) { var n; void 0 === e && (e = { x: 0, y: 0 }); var r = Object(f.a)({ x: 0, y: 0, width: 0, height: 0 }, e); if (null === (n = t.children) || void 0 === n ? void 0 : n.length) { var i = t.attrs, o = void 0 === i ? {} : i, a = o.marginTop, s = Object(f.a)({}, e); a && (s.y += a); for (var c = 0; c < t.children.length; c++) { t.children[c].attrs.key = "" .concat(o.key || "root", " -") .concat(c, " "); var u = Dt(t.children[c], s); if (u.bbox) { var h = u.bbox; "inline" === u.attrs.next ? (s.x += u.bbox.width) : (s.y += u.bbox.height), h.width + h.x > r.width && (r.width = h.width + h.x), h.height + h.y > r.height && (r.height = h.height + h.y); } } } return ( (t.bbox = (function (t, e, n) { var r, i, o = t.attrs, a = void 0 === o ? {} : o, s = { x: e.x || 0, y: e.y || 0, width: n.width || 0, height: n.height || 0, }; switch (t.type) { case "maker": case "circle": a.r && ((i = 2 * a.r), (r = 2 * a.r)); break; case "text": a.text && ((i = vt(a.text, a.fontSize || 12)[0]), (r = 16), (s.y += r), (s.height = r), (s.width = i), (t.attrs = Object(f.a)({ fontSize: 12, fill: "#000" }, a))); break; default: a.width && (i = a.width), a.height && (r = a.height); } return ( r >= 0 && (s.height = r), i >= 0 && (s.width = i), a.marginTop && (s.y += a.marginTop), a.marginLeft && (s.x += a.marginLeft), s ); })(t, e, r)), (t.attrs = Object(f.a)(Object(f.a)({}, t.attrs), t.bbox)), t ); } function _t(t) { var e = {}, n = function (e) { var n = (function (t) { return function (e) { for (var n = t.length, r = [], i = 0, o = ""; i < n; ) if ("{" === t[i] && "{" === t[i + 1]) r.push(o), (o = ""), (i += 2); else if ("}" === t[i] && "}" === t[i + 1]) { if (r.length) { var a = r.pop(); (o = Object(c.get)( e, o, a.endsWith("=") ? '"{'.concat(o, '}"') : o, )), r.push(a + o); } (i += 2), (o = ""); } else (o += t[i]), (i += 1); return ( r.push(o), r .map(function (t, e) { return r[e - 1] && r[e - 1].endsWith("=") ? '"{'.concat(t, '}"') : t; }) .join("") ); }; })("function" == typeof t ? t(e) : t)(e), r = document.createElement("div"); r.innerHTML = n; var i = Dt( (function t(e, n) { var r = {}, i = (e.getAttributeNames && e.getAttributeNames()) || [], o = e.children && Array.from(e.children).map(function (e) { return t(e, n); }), a = {}, s = e.tagName ? e.tagName.toLowerCase() : "group"; return ( "text" === s && (r.text = e.innerText), (a.type = s), "img" === s && (a.type = "image"), Array.from(i).forEach(function (t) { var n = t.split("-").reduce(function (t, e) { return t + e.charAt(0).toUpperCase() + e.slice(1); }), i = e.getAttribute(t); try { if ("style" === n || "attrs" === n) { var o = Lt(i); r = Object(f.a)(Object(f.a)({}, r), o); } else a[n] = Lt(i); } catch (t) { if ("style" === n) throw t; a[n] = i; } }), (a.attrs = r), n && n.style && a.name && "object" === Bt(n.style[a.name]) && (a.attrs = Object(f.a)( Object(f.a)({}, a.attrs), n.style[a.name], )), n && n.style && a.keyshape && (a.attrs = Object(f.a)(Object(f.a)({}, a.attrs), n.style)), o.length && (a.children = o), a ); })(r.children[0], e), ); return r.remove(), i; }; return { draw: function (t, r) { var i = n(t), o = r; return ( (function t(e) { var n = e.attrs, i = void 0 === n ? {} : n, a = e.bbox, s = e.type, c = e.children, u = Object(f.e)(e, ["attrs", "bbox", "type", "children"]); if ("group" !== e.type) { var h = r.addShape( e.type, Object(f.a)( { attrs: i, origin: { bbox: a, type: s, children: c } }, u, ), ); e.keyshape && (o = h); } e.children && e.children.forEach(function (e) { return t(e); }); })(i), (e[t.id] = [i]), o ); }, update: function (t, r) { e[t.id] || (e[t.id] = []); var i = r.getContainer(), o = i.get("children"), a = n(t), s = (function t(e, n) { var r, i, o, a, s = (e || {}).type, c = ((null == n ? void 0 : n.attrs) || {}).key; if ((c && e && (e.attrs.key = c), !e && n)) return { action: "delete", val: n, type: s, key: c }; if (e && !n) return { action: "add", val: e, type: s }; if (!e && !n) return { action: "same", type: s }; var u = []; if ( (null === (r = e.children) || void 0 === r ? void 0 : r.length) > 0 || (null === (i = n.children) || void 0 === i ? void 0 : i.length) > 0 ) for ( var h = Math.max( null === (o = e.children) || void 0 === o ? void 0 : o.length, null === (a = n.children) || void 0 === a ? void 0 : a.length, ), l = n.children || [], f = e.children || [], d = 0; d < h; d += 1 ) u.push(t(f[d], l[d])); var p = Object.keys(n.attrs), g = Object.keys(e.attrs); return n.type !== e.type ? { action: "restructure", nowTarget: e, formerTarget: n, key: c, children: u, } : p .filter(function (t) { return "children" !== t; }) .some(function (t) { return e.attrs[t] !== n.attrs[t] || !g.includes(t); }) ? { action: "change", val: e, children: u, type: s, key: c } : { action: "same", children: u, type: s, key: c }; })(a, e[t.id].pop()), c = function t(e) { var n; "group" !== e.type && i.addShape(e.type, { attrs: e.attrs }), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }, u = function t(e) { var n, r = o.find(function (t) { return t.attrs.key === e.attrs.key; }); r && i.removeChild(r), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }; !(function t(e) { var n = e.key; if ("group" !== e.type) { var i = o.find(function (t) { return t.attrs.key === n; }); switch (e.action) { case "change": if (i) { var a = e.val.keyshape ? r.getOriginStyle() : {}; i.attr(Object(f.a)(Object(f.a)({}, a), e.val.attrs)); } break; case "add": c(e.val); break; case "delete": u(e.val); break; case "restructure": u(e.formerTarget), c(e.nowTarget); } } e.children && e.children.forEach(function (e) { return t(e); }); })(s), e[t.id].push(a); }, getAnchorPoints: function () { return [ [0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0], ]; }, }; } var Rt = {}; function Ft(t) { return Rt[t] || (Rt[t] = Object(c.upperFirst)(t)), Rt[t]; } var Yt = { defaultShapeType: "defaultType", className: null, getShape: function (t) { return ( this[t] || this[this.defaultShapeType] || this["simple-circle"] ); }, draw: function (t, e, n) { var r = this.getShape(t), i = r.draw(e, n); return r.afterDraw && r.afterDraw(e, n, i), i; }, baseUpdate: function (t, e, n) { var r = this.getShape(t); r.update && r.update(e, n), r.afterUpdate && r.afterUpdate(e, n); }, setState: function (t, e, n, r) { this.getShape(t).setState(e, n, r); }, shouldUpdate: function (t) { return !!this.getShape(t).update; }, getControlPoints: function (t, e) { return this.getShape(t).getControlPoints(e); }, getAnchorPoints: function (t, e) { return this.getShape(t).getAnchorPoints(e); }, }, Xt = { options: {}, draw: function (t, e) { return this.drawShape(t, e); }, drawShape: function () {}, afterDraw: function () {}, afterUpdate: function () {}, setState: function () {}, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { var e = this.options.anchorPoints; return t.anchorPoints || e; }, }, zt = (function () { function t() {} return ( (t.registerFactory = function (e, n) { var r = Ft(e), i = Yt, o = Object(f.a)(Object(f.a)({}, i), n); return (t[r] = o), (o.className = r), o; }), (t.getFactory = function (e) { return t[Ft(e)]; }), (t.registerNode = function (e, n, r) { var i, o = t.Node; if ("string" == typeof n || "function" == typeof n) { var a = _t(n); i = Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a); } else if (n.jsx) { a = _t(n.jsx); i = Object(f.a)( Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a), n, ); } else { o.getShape(r); var s = r ? o.getShape(r) : Xt; i = Object(f.a)(Object(f.a)({}, s), n); } return (i.type = e), (i.itemType = "node"), (o[e] = i), i; }), (t.registerEdge = function (e, n, r) { var i = t.Edge, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "edge"), (i[e] = a), a; }), (t.registerCombo = function (e, n, r) { var i = t.Combo, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "combo"), (i[e] = a), a; }), t ); })(), Wt = zt; zt.registerFactory("node", { defaultShapeType: "circle" }), zt.registerFactory("edge", { defaultShapeType: "line" }), zt.registerFactory("combo", { defaultShapeType: "circle" }); var qt = (function () { function t(t) { (this._cfg = {}), (this.destroyed = !1); var e = { id: void 0, type: "item", model: {}, group: void 0, animate: !1, visible: !0, locked: !1, event: !0, keyShape: void 0, states: [], }; this._cfg = Object.assign(e, this.getDefaultCfg(), t); var n = this.get("model"), r = n.id, i = this.get("type"); r || ((r = Ct(i)), (this.get("model").id = r)), this.set("id", r); var o = t.group; o && (o.set("item", this), o.set("id", r)), this.init(), this.draw(); var a = n.shape || n.type || ("edge" === i ? "line" : "circle"), s = this.get("shapeFactory"); if (s && s[a]) { var u = s[a].options; if (u && u.stateStyles) { var h = this.get("styles") || n.stateStyles; (h = Object(c.deepMix)({}, u.stateStyles, h)), this.set("styles", h); } } } return ( (t.prototype.calculateBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.calculateCanvasBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.drawInner = function () { var t = this.get("shapeFactory"), e = this.get("group"), n = this.get("model"); e.clear(); var r = n.visible; if ((void 0 === r || r || this.changeVisibility(r), t)) { this.updatePosition(n); var i = this.getShapeCfg(n), o = i.type, a = t.draw(o, i, e); a && (this.set("keyShape", a), a.set("isKeyShape", !0), a.set("draggable", !0)), this.setOriginStyle(), this.set("currentShape", o), this.restoreStates(t, o); } }), (t.prototype.setOriginStyle = function () { var t = this.get("group").get("children"), e = this.getKeyShape(), n = this, r = e.get("name"); if (this.get("originStyle")) { var i = this.getOriginStyle(); r && !i[r] && (i[r] = {}); var o = this.getCurrentStatesStyle(); Object(c.each)(t, function (t) { var e = t.get("name"), a = t.attr(); if (e && e !== r) { var s = o[e]; i[e] || (i[e] = {}), s ? Object.keys(a).forEach(function (t) { var n = a[t]; n !== s[t] && (i[e][t] = n); }) : (i[e] = "image" !== t.get("type") ? Object(c.clone)(a) : n.getShapeStyleByName(e)); } else { var u = t.attr(), h = Object(f.a)(Object(f.a)({}, o), o[r]); Object.keys(u).forEach(function (t) { var e = u[t]; h[t] !== e && (r ? (i[r][t] = e) : (i[t] = e)); }); } }), i.path && delete i.path, i.matrix && delete i.matrix, i.x && delete i.x, i.y && delete i.y, i[r] && i[r].x && delete i[r].x, i[r] && i[r].y && delete i[r].y, n.set("originStyle", i); } else { var a = {}; Object(c.each)(t, function (t) { var e = t.get("type"), i = t.get("name"); if (i && i !== r) a[i] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i); else { var o = n.getShapeStyleByName(); if ( (o.path && delete o.path, o.matrix && delete o.matrix, r) ) if (i) a[r] = o; else { var s = Ct("shape"); t.set("name", s), (a[s] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i)); } else Object.assign(a, o); } }), n.set("originStyle", a); } }), (t.prototype.restoreStates = function (t, e) { var n = this, r = n.get("states"); Object(c.each)(r, function (r) { t.setState(e, r, !0, n); }); }), (t.prototype.init = function () { var t = Wt.getFactory(this.get("type")); this.set("shapeFactory", t); }), (t.prototype.get = function (t) { return this._cfg[t]; }), (t.prototype.set = function (t, e) { Object(c.isPlainObject)(t) ? (this._cfg = Object(f.a)(Object(f.a)({}, this._cfg), t)) : (this._cfg[t] = e); }), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null); }), (t.prototype.beforeDraw = function () {}), (t.prototype.afterDraw = function () {}), (t.prototype.afterUpdate = function () {}), (t.prototype.draw = function () { this.beforeDraw(), this.drawInner(), this.afterDraw(); }), (t.prototype.getShapeStyleByName = function (t) { var e, n = this.get("group"); if ( (e = t ? n.find(function (e) { return e.get("name") === t; }) : this.getKeyShape()) ) { var r = {}; return ( Object(c.each)(e.attr(), function (t, e) { "img" !== e && (r[e] = t); }), r ); } return {}; }), (t.prototype.getShapeCfg = function (t) { var e = this.get("styles"); if (e) { var n = t; return (n.style = Object(f.a)(Object(f.a)({}, e), t.style)), n; } return t; }), (t.prototype.getStateStyle = function (t) { var e = this.get("styles"); return e && e[t]; }), (t.prototype.getOriginStyle = function () { return this.get("originStyle"); }), (t.prototype.getCurrentStatesStyle = function () { var t = this, e = {}, n = t.getStates(); return n && n.length ? (Object(c.each)(t.getStates(), function (n) { e = Object.assign(e, t.getStateStyle(n)); }), e) : this.getOriginStyle(); }), (t.prototype.setState = function (t, e) { var n = this.get("states"), r = this.get("shapeFactory"), i = t, o = t; Object(c.isString)(e) && ((i = "".concat(t, ":").concat(e)), (o = "".concat(t, ":"))); var a = n; if (Object(c.isBoolean)(e)) { var s = n.indexOf(o); if (e) { if (s > -1) return; n.push(i); } else s > -1 && n.splice(s, 1); } else if (Object(c.isString)(e)) { var u = n.filter(function (t) { return t.includes(o); }); u.length > 0 && this.clearStates(u), (a = a.filter(function (t) { return !t.includes(o); })).push(i), this.set("states", a); } if (r) { var h = this.get("model").type; r.setState(h, t, e, this); } }), (t.prototype.clearStates = function (t) { var e = this, n = e.getStates(), r = e.get("shapeFactory"), i = e.get("model").type; t || (t = n), Object(c.isString)(t) && (t = [t]); var o = n.filter(function (e) { return -1 === t.indexOf(e); }); e.set("states", o), t.forEach(function (t) { r.setState(i, t, !1, e); }); }), (t.prototype.getContainer = function () { return this.get("group"); }), (t.prototype.getKeyShape = function () { return this.get("keyShape"); }), (t.prototype.getModel = function () { return this.get("model"); }), (t.prototype.getType = function () { return this.get("type"); }), (t.prototype.getID = function () { return this.get("id"); }), (t.prototype.isItem = function () { return !0; }), (t.prototype.getStates = function () { return this.get("states"); }), (t.prototype.hasState = function (t) { return this.getStates().indexOf(t) >= 0; }), (t.prototype.refresh = function () { var t = this.get("model"); this.updatePosition(t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (t.prototype.isOnlyMove = function (t) { return !1; }), (t.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = n.x, a = n.y; (t.x = isNaN(t.x) ? n.x : t.x), (t.y = isNaN(t.y) ? n.y : t.y); var s = this.get("styles"); if (t.stateStyles) { var u = t.stateStyles; Object(c.mix)(s, u), delete t.stateStyles; } Object.assign(n, t), e ? this.updatePosition(t) : ((o === t.x && a === t.y) || this.updatePosition(t), this.updateShape()), this.afterUpdate(), this.clearCache(); }), (t.prototype.updateShape = function () { var t = this.get("shapeFactory"), e = this.get("model"), n = e.type; if (t.shouldUpdate(n) && n === this.get("currentShape")) { var r = this.getShapeCfg(e); t.baseUpdate(n, r, this), this.setOriginStyle(); } else this.draw(); this.restoreStates(t, n); }), (t.prototype.updatePosition = function (t) { var e = this.get("model"), n = Object(c.isNil)(t.x) ? e.x : t.x, r = Object(c.isNil)(t.y) ? e.y : t.y, i = this.get("group"); if (Object(c.isNil)(n) || Object(c.isNil)(r)) return !1; (e.x = n), (e.y = r); var o = i.getMatrix(); return ( (!o || o[6] !== n || o[7] !== r) && (i.resetMatrix(), I(i, { x: n, y: r }), this.clearCache(), !0) ); }), (t.prototype.getBBox = function () { var t = this.get("bboxCache"); return ( t || ((t = this.calculateBBox()), this.set("bboxCache", t)), t ); }), (t.prototype.getCanvasBBox = function () { var t = this.get("bboxCanvasCache"); return ( t || ((t = this.calculateCanvasBBox()), this.set("bboxCanvasCache", t)), t ); }), (t.prototype.toFront = function () { this.get("group").toFront(); }), (t.prototype.toBack = function () { this.get("group").toBack(); }), (t.prototype.show = function () { this.changeVisibility(!0); }), (t.prototype.hide = function () { this.changeVisibility(!1); }), (t.prototype.changeVisibility = function (t) { var e = this.get("group"); t ? e.show() : e.hide(), this.set("visible", t); }), (t.prototype.isVisible = function () { return this.get("visible"); }), (t.prototype.enableCapture = function (t) { var e = this.get("group"); e && e.set("capture", t); }), (t.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), t ); })(), Vt = { source: "start", target: "end" }, Gt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "edge", sourceNode: null, targetNode: null, startPoint: null, endPoint: null, linkCenter: !1, }; }), (e.prototype.setEnd = function (t, e) { var n = Vt[t] + "Point", r = t + "Node", i = this.get(r); i && !i.destroyed && i.removeEdge(this), Object(c.isPlainObject)(e) ? (this.set(n, e), this.set(r, null)) : (e.addEdge(this), this.set(r, e), this.set(n, null)); }), (e.prototype.getLinkPoint = function (t, e, n) { var r = Vt[t] + "Point", i = t + "Node", o = this.get(r); if (!o) { var a = this.get(i), s = t + "Anchor", u = this.getPrePoint(t, n), h = e[s]; Object(c.isNil)(h) || (o = a.getLinkPointByAnchor(h)), (o = o || a.getLinkPoint(u)), Object(c.isNil)(o.index) || this.set("".concat(t, "AnchorIndex"), o.index); } return o; }), (e.prototype.getPrePoint = function (t, e) { if (e && e.length) return e["source" === t ? 0 : e.length - 1]; var n = "source" === t ? "target" : "source"; return this.getEndPoint(n); }), (e.prototype.getEndPoint = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); return r ? r.get("model") : this.get(n); }), (e.prototype.getControlPointsByCenter = function (t) { var e = this.getEndPoint("source"), n = this.getEndPoint("target"), r = this.get("shapeFactory"), i = t.type; return r.getControlPoints(i, { startPoint: e, endPoint: n }); }), (e.prototype.getEndCenter = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); if (r) { var i = r.getBBox(); return { x: i.centerX, y: i.centerY }; } return this.get(n); }), (e.prototype.init = function () { t.prototype.init.call(this), this.setSource(this.get("source")), this.setTarget(this.get("target")); }), (e.prototype.getShapeCfg = function (e) { var n = this.get("linkCenter"), r = t.prototype.getShapeCfg.call(this, e); if (n) (r.startPoint = this.getEndCenter("source")), (r.endPoint = this.getEndCenter("target")); else { var i = r.controlPoints || this.getControlPointsByCenter(r); (r.startPoint = this.getLinkPoint("source", e, i)), (r.endPoint = this.getLinkPoint("target", e, i)); } return ( (r.sourceNode = this.get("sourceNode")), (r.targetNode = this.get("targetNode")), r ); }), (e.prototype.getModel = function () { var t = this.get("model"), e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); return ( e ? delete t["source".concat("Node")] : (t.source = this.get("start".concat("Point"))), n ? delete t["target".concat("Node")] : (t.target = this.get("end".concat("Point"))), Object(c.isString)(t.source) || Object(c.isPlainObject)(t.source) || (t.source = t.source.getID()), Object(c.isString)(t.target) || Object(c.isPlainObject)(t.target) || (t.target = t.target.getID()), t ); }), (e.prototype.setSource = function (t) { this.setEnd("source", t), this.set("source", t); }), (e.prototype.setTarget = function (t) { this.setEnd("target", t), this.set("target", t); }), (e.prototype.getSource = function () { return this.get("source"); }), (e.prototype.getTarget = function () { return this.get("target"); }), (e.prototype.updatePosition = function () { return !1; }), (e.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = this.get("styles"); if (t.stateStyles) { var a = t.stateStyles; Object(c.mix)(o, a), delete t.stateStyles; } Object.assign(n, t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (e.prototype.destroy = function () { var e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); e && !e.destroyed && e.removeEdge(this), n && !n.destroyed && n.removeEdge(this), t.prototype.destroy.call(this); }), e ); })(qt), Ht = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getNearestPoint = function (t, e) { for ( var n = 0, r = t[0], i = E(t[0], e), o = 0; o < t.length; o++ ) { var a = t[o], s = E(a, e); s < i && ((r = a), (i = s), (n = o)); } return (r.anchorIndex = n), r; }), (e.prototype.getDefaultCfg = function () { return { type: "node", edges: [] }; }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getInEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("target") === t; }); }), (e.prototype.getOutEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("source") === t; }); }), (e.prototype.getNeighbors = function (t) { var e = this, n = this.get("edges"); if ("target" === t) { return n .filter(function (t) { return t.getSource() === e; }) .map(function (t) { return t.getTarget(); }); } if ("source" === t) { return n .filter(function (t) { return t.getTarget() === e; }) .map(function (t) { return t.getSource(); }); } return n.map(function (t) { return t.getSource() === e ? t.getTarget() : t.getSource(); }); }), (e.prototype.getLinkPointByAnchor = function (t) { return this.getAnchorPoints()[t]; }), (e.prototype.getLinkPoint = function (t) { var e, n, r = this.get("keyShape").get("type"), i = this.get("type"), o = this.getBBox(); "combo" === i ? ((e = o.centerX || (o.maxX + o.minX) / 2), (n = o.centerY || (o.maxY + o.minY) / 2)) : ((e = o.centerX), (n = o.centerY)); var a, s = this.getAnchorPoints(); switch (r) { case "circle": a = S({ x: e, y: n, r: o.width / 2 }, t); break; case "ellipse": a = O({ x: e, y: n, rx: o.width / 2, ry: o.height / 2 }, t); break; default: a = w(o, t); } var c = a; return ( s.length && (c || (c = t), (c = this.getNearestPoint(s, c))), c || (c = { x: e, y: n }), c ); }), (e.prototype.getAnchorPoints = function () { var t = this.get("anchorPointsCache"); if (!t) { t = []; var e = this.get("shapeFactory"), n = this.getBBox(), r = this.get("model"), i = this.getShapeCfg(r), o = r.type, a = e.getAnchorPoints(o, i) || []; Object(c.each)(a, function (e, r) { var i = { x: n.minX + e[0] * n.width, y: n.minY + e[1] * n.height, anchorIndex: r, }; t.push(i); }), this.set("anchorPointsCache", t); } return t; }), (e.prototype.addEdge = function (t) { this.get("edges").push(t); }), (e.prototype.lock = function () { this.set("locked", !0); }), (e.prototype.unlock = function () { this.set("locked", !1); }), (e.prototype.hasLocked = function () { return this.get("locked"); }), (e.prototype.removeEdge = function (t) { var e = this.getEdges(), n = e.indexOf(t); n > -1 && e.splice(n, 1); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("anchorPointsCache", null); }), (e.prototype.isOnlyMove = function (t) { if (!t) return !1; var e = !Object(c.isNil)(t.x), n = !Object(c.isNil)(t.y), r = Object.keys(t); return (1 === r.length && (e || n)) || (2 === r.length && e && n); }), e ); })(qt), Ut = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "combo", nodes: [], edges: [], combos: [] }; }), (e.prototype.getShapeCfg = function (t) { var e = this.get("styles"), n = this.get("bbox"); if (e && n) { var r = t, i = { r: Math.hypot(n.height, n.width) / 2 || nt.defaultCombo.size[0] / 2, width: n.width || nt.defaultCombo.size[0], height: n.height || nt.defaultCombo.size[1], }; r.style = Object(f.a)( Object(f.a)(Object(f.a)({}, e), t.style), i, ); var o = t.padding || nt.defaultCombo.padding; return ( Object(c.isNumber)(o) ? ((i.r += o), (i.width += 2 * o), (i.height += 2 * o)) : ((i.r += o[0]), (i.width += o[1] + o[3] || 2 * o[1]), (i.height += o[0] + o[2] || 2 * o[0])), this.set("sizeCache", i), r ); } return t; }), (e.prototype.calculateCanvasBBox = function () { if (!this.destroyed) { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); var r = this.get("sizeCache"), i = this.get("bboxCache") || {}, o = i.x, a = i.x; if (r) (r.width = Math.max(r.width, n.width)), (r.height = Math.max(r.height, n.height)), "circle" === t.get("type") ? ((n.width = 2 * r.r), (n.height = 2 * r.r)) : ((n.width = r.width), (n.height = r.height)), (n.minX = n.centerX - n.width / 2), (n.minY = n.centerY - n.height / 2), (n.maxX = n.centerX + n.width / 2), (n.maxY = n.centerY + n.height / 2); else (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); return ( (n.x = n.minX), (n.y = n.minY), (n.x === o && n.y === a) || this.set("anchorPointsCache", null), n ); } }), (e.prototype.getChildren = function () { return { nodes: this.getNodes(), combos: this.getCombos() }; }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.addChild = function (t) { switch (t.getType()) { case "node": this.addNode(t); break; case "combo": this.addCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.addCombo = function (t) { return this.get("combos").push(t), !0; }), (e.prototype.addNode = function (t) { return this.get("nodes").push(t), !0; }), (e.prototype.removeChild = function (t) { switch (t.getType()) { case "node": this.removeNode(t); break; case "combo": this.removeCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.removeCombo = function (t) { if (t) { var e = this.getCombos(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.removeNode = function (t) { if (t) { var e = this.getNodes(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.isOnlyMove = function (t) { return !1; }), (e.prototype.getBBox = function () { return ( this.set("bboxCanvasCache", null), this.calculateCanvasBBox() ); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null), this.set("anchorPointsCache", null); }), (e.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), this.set("sizeCache", null), this.set("bbox", null), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), e ); })(Ht), Zt = (function () { function t(t) { (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.addItem = function (t, e) { var n = this.graph, r = "vedge" === t ? "edge" : t, i = n.get("".concat(r, "Group")) || n.get("group"), o = Object(c.upperFirst)(r), a = null, s = n.get(r + Object(c.upperFirst)("stateStyles")) || {}, u = n.get("default" + o); e.stateStyles && (s = e.stateStyles), u && Object(c.each)(u, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, t, e[n])) : Object(c.isArray)(t) ? (e[n] = e[n] || Object(c.clone)(u[n])) : (e[n] = e[n] || u[n]); }); var h = n.get(r + "Mapper"); if (h) { var l = h(e); l.stateStyles && ((s = l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, e[n], t)) : (e[n] = l[n] || e[n]); }); } if ( (n.emit("beforeadditem", { type: t, model: e }), "edge" === t || "vedge" === t) ) { var f = void 0, d = void 0; if ( ((f = e.source), (d = e.target), f && Object(c.isString)(f) && (f = n.findById(f)), d && Object(c.isString)(d) && (d = n.findById(d)), !f || !d) ) return void console.warn( "The source or target node of edge ".concat( e.id, " does not exist!", ), ); f.getType && "combo" === f.getType() && (e.isComboEdge = !0), d.getType && "combo" === d.getType() && (e.isComboEdge = !0), (a = new Gt({ model: e, source: f, target: d, styles: s, linkCenter: n.get("linkCenter"), group: i.addGroup(), })); } else if ("node" === t) a = new Ht({ model: e, styles: s, group: i.addGroup() }); else if ("combo" === t) { var p = e.children, g = bt(p, n); isNaN(g.x) ? isNaN(e.x) && (e.x = 100 * Math.random()) : (e.x = g.x), isNaN(g.y) ? isNaN(e.y) && (e.y = 100 * Math.random()) : (e.y = g.y); var v = i.addGroup(); v.setZIndex(e.depth); var y = (a = new Ut({ model: e, styles: s, bbox: e.collapsed ? bt([], n) : g, group: v, })).getModel(); (p || []).forEach(function (t) { var e = n.findById(t.id); a.addChild(e), (t.depth = y.depth + 2); }), e.collapsed && setTimeout(function () { n.collapseCombo(a); }, 16); } if (a) return ( n.get("".concat(t, "s")).push(a), (n.get("itemMap")[a.get("id")] = a), n.emit("afteradditem", { item: a, model: e }), a ); }), (t.prototype.updateItem = function (t, e) { var n, r, i = this.graph; if ( (Object(c.isString)(t) && (t = i.findById(t)), t && !t.destroyed) ) { var o = ""; t.getType && (o = t.getType()); var a = i.get(o + "Mapper"), s = t.getModel(), u = t.isOnlyMove(e); if (a) { var h = a(Object(c.deepMix)({}, s, e)), l = Object(c.deepMix)({}, s, h, e); h.stateStyles && (t.set("styles", l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { e[n] = t; }); } else Object(c.each)(e, function (t, n) { s[n] && Object(c.isObject)(t) && !Object(c.isArray)(t) && (e[n] = Object(f.a)(Object(f.a)({}, s[n]), e[n])); }); if ( (i.emit("beforeupdateitem", { item: t, cfg: e }), "edge" === o) ) { if (e.source) { var d = e.source; Object(c.isString)(d) && (d = i.findById(d)), t.setSource(d); } if (e.target) { var p = e.target; Object(c.isString)(p) && (p = i.findById(p)), t.setTarget(p); } t.update(e); } if ("node" === o || "combo" === o) { t.update(e, u); var g = t.getEdges(), v = xt(e); if (v && "node" === o) Object(c.each)(g, function (t) { t.refresh(); }); else if (v && "combo" === o) { var y = t.get("shapeFactory"), m = s.type || "circle"; ( void 0 === s.animate || void 0 === e.animate ? null === (r = null === (n = y[m]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : s.animate || e.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && Object(c.each)(g, function (t) { t && !t.destroyed && t.refresh(); }); } }, 201) : Object(c.each)(g, function (t) { t.refresh(); }); } } i.emit("afterupdateitem", { item: t, cfg: e }); } }), (t.prototype.updateCombo = function (t, e) { var n, r, i = this, o = this.graph; if ( (Object(c.isString)(t) && (t = o.findById(t)), t && !t.destroyed) ) { var a = t.getModel(), s = bt(a.collapsed ? [] : e, o); t.set("bbox", s), t.update({ x: s.x, y: s.y }); var u = t.get("shapeFactory"), h = a.type || "circle"; ( void 0 === a.animate ? null === (r = null === (n = u[h]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : a.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && (t.getShapeCfg(a), i.updateComboEdges(t)); } }, 201) : this.updateComboEdges(t); } }), (t.prototype.updateComboEdges = function (t) { for (var e = t.getEdges() || [], n = 0; n < e.length; n++) { var r = e[n]; if (r && !r.destroyed) { var i = r.get("shapeFactory"), o = r.getShapeCfg(r.getModel()), a = r.getContainer(); a.clear(); var s = i.draw(o.type, o, a); r.set("keyShape", s), s.set("isKeyShape", !0), s.set("draggable", !0), r.setOriginStyle(); } } }), (t.prototype.collapseCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.hideItem(t); }), n.combos.forEach(function (t) { e.hideItem(t); }); }), (t.prototype.expandCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.showItem(t); }), n.combos.forEach(function (t) { t.getModel().collapsed ? t.show() : e.showItem(t); }); }), (t.prototype.removeItem = function (t) { var e = this, n = this.graph; if ( (Object(c.isString)(t) && (t = n.findById(t)), t && !t.destroyed) ) { var r = Object(c.clone)(t.getModel()); n.emit("beforeremoveitem", { item: r }); var i = ""; t.getType && (i = t.getType()); var o = n.get("".concat(i, "s")), a = o.indexOf(t); if ((a > -1 && o.splice(a, 1), "edge" === i)) { var s = n.get("v".concat(i, "s")), u = s.indexOf(t); u > -1 && s.splice(u, 1); } var h = t.get("id"); delete n.get("itemMap")[h]; var l = n.get("comboTrees"), f = t.get("id"); if ("node" === i) { var d = t.getModel().comboId; if (l && d) { var p = l, g = !1; l.forEach(function (t) { g || dt(t, function (t) { if (t.id === f && p) { var e = p.indexOf(t); return p.splice(e, 1), (g = !0), !1; } return (p = t.children), !0; }); }); } for (var v = (x = t.getEdges()).length - 1; v >= 0; v--) n.removeItem(x[v], !1); d && n.updateCombo(d); } else if ("combo" === i) { var y, m = t.getModel().parentId, b = !1; (l || []).forEach(function (t) { b || dt(t, function (t) { return t.id !== f || ((y = t), (b = !0), !1); }); }), (y.removed = !0), y && y.children && y.children.forEach(function (t) { e.removeItem(t.id); }); var x; for (v = (x = t.getEdges()).length; v >= 0; v--) n.removeItem(x[v], !1); m && n.updateCombo(m); } t.destroy(), n.emit("afterremoveitem", { item: r }); } }), (t.prototype.setItemState = function (t, e, n) { var r = this.graph, i = e; Object(c.isString)(n) && (i = "".concat(e, ":").concat(n)), (t.hasState(i) === n && n) || (Object(c.isString)(n) && t.hasState(i)) || (r.emit("beforeitemstatechange", { item: t, state: i, enabled: n, }), t.setState(e, n), r.autoPaint(), r.emit("afteritemstatechange", { item: t, state: i, enabled: n, })); }), (t.prototype.priorityState = function (t, e) { var n = this.graph, r = t; Object(c.isString)(t) && (r = n.findById(t)), this.setItemState(r, e, !1), this.setItemState(r, e, !0); }), (t.prototype.clearItemStates = function (t, e) { var n = this.graph; Object(c.isString)(t) && (t = n.findById(t)), n.emit("beforeitemstatesclear", { item: t, states: e }), t.clearStates(e), n.emit("afteritemstatesclear", { item: t, states: e }); }), (t.prototype.refreshItem = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)), e.emit("beforeitemrefresh", { item: t }), t.refresh(), e.emit("afteritemrefresh", { item: t }); }), (t.prototype.addCombos = function (t, e) { var n = this, r = this.graph; (t || []).forEach(function (t) { pt(t, function (t) { var r; return ( e.forEach(function (e) { e.id === t.id && ((e.children = t.children), (e.depth = t.depth), (r = e)); }), r && n.addItem("combo", r), !0 ); }); }); var i = r.get("comboGroup"); i && i.sort(); }), (t.prototype.changeItemVisibility = function (t, e) { var n = this, r = this.graph; if ((Object(c.isString)(t) && (t = r.findById(t)), t)) { if ( (r.emit("beforeitemvisibilitychange", { item: t, visible: e, }), t.changeVisibility(e), t.getType && "node" === t.getType()) ) { var i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } else if (t.getType && "combo" === t.getType()) { var o = r.get("comboTrees"), a = t.get("id"), s = [], u = !1; (o || []).forEach(function (t) { u || (t.children && 0 !== t.children.length && dt(t, function (t) { return t.id !== a || ((s = t.children), (u = !0), !1); })); }), s && (!e || (e && !t.getModel().collapsed)) && s.forEach(function (t) { var i = r.findById(t.id); n.changeItemVisibility(i, e); }); i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } return ( r.emit("afteritemvisibilitychange", { item: t, visible: e }), t ); } console.warn("The item to be shown or hidden does not exist!"); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !0); }), t ); })(), Kt = null, $t = (function () { function t(t) { (this.graph = t), (this.cachedStates = { enabled: {}, disabled: {} }), (this.destroyed = !1); } return ( (t.checkCache = function (t, e, n) { if (n[e]) { var r = n[e].indexOf(t); r >= 0 && n[e].splice(r, 1); } }), (t.cacheState = function (t, e, n) { n[e] || (n[e] = []), n[e].push(t); }), (t.prototype.updateState = function (e, n, r) { var i = this, o = t.checkCache, a = t.cacheState; if (!e.destroyed) { var s = this.cachedStates, c = s.enabled, u = s.disabled; r ? (o(e, n, u), a(e, n, c)) : (o(e, n, c), a(e, n, u)), Kt && clearTimeout(Kt), (Kt = setTimeout(function () { (Kt = null), i.updateGraphStates(); }, 16)); } }), (t.prototype.updateStates = function (t, e, n) { var r = this; Object(c.isString)(e) ? this.updateState(t, e, n) : e.forEach(function (e) { r.updateState(t, e, n); }); }), (t.prototype.updateGraphStates = function () { var t = this.graph.get("states"), e = this.cachedStates; Object(c.each)(e.disabled, function (e, n) { t[n] && (t[n] = t[n].filter(function (t) { return e.indexOf(t) < 0 && !e.destroyed; })); }), Object(c.each)(e.enabled, function (e, n) { if (t[n]) { var r = {}; t[n].forEach(function (t) { t.destroyed || (r[t.get("id")] = !0); }), e.forEach(function (e) { if (!e.destroyed) { var i = e.get("id"); r[i] || ((r[i] = !0), t[n].push(e)); } }); } else t[n] = e; }), this.graph.emit("graphstatechange", { states: t }), (this.cachedStates = { enabled: {}, disabled: {} }); }), (t.prototype.destroy = function () { (this.graph = null), (this.cachedStates = null), Kt && clearTimeout(Kt), (Kt = null), (this.destroyed = !0); }), t ); })(), Qt = n(22), Jt = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { if ("\\" === t.charAt(0)) return t.slice(1); var r = e[n]; return 0 === r && (r = "0"), r || ""; }) : t; }, te = function (t) { var e = []; if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); for (var n = 0, r = t; n < r.length; n++) { var i = r[n], o = i.x, a = i.y; e.push(o), e.push(a); } var s = Object(Qt.a)(e); return s.unshift(["M", t[0].x, t[0].y]), s; }, ee = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 0); var i = { x: (1 - n) * t.x + n * e.x, y: (1 - n) * t.y + n * e.y }, o = [0, 0]; g.c.normalize(o, [e.x - t.x, e.y - t.y]), (o && (o[0] || o[1])) || (o = [0, 0]); var a = [-o[1] * r, o[0] * r]; return (i.x += a[0]), (i.y += a[1]), i; }, ne = function (t, e) { var n = t.length; if (!n) return ""; for (var r = "", i = 0; i < n; i++) { var o = t[i]; r += Jt(0 === i ? "M{x} {y}" : "L{x} {y}", o); } return e && (r += "Z"), r; }, re = function (t) { var e = []; return ( t.forEach(function (t) { if ("A" !== t[0]) for (var n = 1; n < t.length; n += 2) e.push([t[n], t[n + 1]]); else { var r = t.length; e.push([t[r - 2], t[r - 1]]); } }), e ); }, ie = function (t) { if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); var e = t[0], n = t[1], r = t[t.length - 1], i = t[t.length - 2]; t.unshift(r), t.unshift(i), t.push(e), t.push(n); for (var o = [], a = 1; a < t.length - 2; a += 1) { var s = t[a - 1].x, c = t[a - 1].y, u = t[a].x, h = t[a].y, l = t[a + 1].x, f = t[a + 1].y, d = u + (l - s) / 6, p = h + (f - c) / 6, g = l - ((a !== t.length - 2 ? t[a + 2].x : l) - u) / 6, v = f - ((a !== t.length - 2 ? t[a + 2].y : f) - h) / 6; o.push(["C", d, p, g, v, l, f]); } return o.unshift(["M", r.x, r.y]), o; }, oe = function (t, e) { return g.c.scale([0, 0], g.c.normalize([0, 0], t), e); }, ae = function (t, e) { var n = [t[1] - e[1], e[0] - t[0]], r = Math.sqrt(n[0] * n[0] + n[1] * n[1]); if (0 === r) throw new Error("p0 should not be equal to p1"); return [n[0] / r, n[1] / r]; }, se = function (t, e) { return [e[0] - t[0], e[1] - t[1]]; }; function ce(t, e) { if (!t || t.length < 1) return ""; if (1 === t.length) return (function (t) { var n = [t[0][0], t[0][1] - e], r = [t[0][0], t[0][1] + e]; return "M " .concat(n, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(r, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(n); })(t); if (2 === t.length) return (function (t) { var n = g.c.scale([0, 0], ae(t[0], t[1]), e), r = g.c.scale([0, 0], n, -1), i = g.c.add([0, 0], t[0], n), o = g.c.add([0, 0], t[1], n), a = g.c.add([0, 0], t[1], r), s = g.c.add([0, 0], t[0], r); return "M " .concat(i, " L ") .concat(o, " A ") .concat([e, e, "0,0,0", a].join(","), " L ") .concat(s, " A ") .concat([e, e, "0,0,0", i].join(",")); })(t); for (var n = new Array(t.length), r = 0; r < n.length; ++r) { var i = 0 === r ? t[t.length - 1] : t[r - 1], o = t[r], a = g.c.scale([0, 0], ae(i, o), e); n[r] = [g.c.add([0, 0], i, a), g.c.add([0, 0], o, a)]; } var s = "A ".concat([e, e, "0,0,0,"].join(",")); return (n = n.map(function (t, e) { var r = ""; return ( 0 === e && (r = "M ".concat(n[n.length - 1][1], " ")), (r += "".concat(s + t[0], " L ").concat(t[1])) ); })).join(" "); } function ue(t, e) { var n, r, i, o = t.length; if (!t || o < 1) return ""; if (1 === o) return ( (r = [(n = t)[0][0], n[0][1] - e]), (i = [n[0][0], n[0][1] + e]), "M " .concat(r, " A ") .concat([e, e, "0,0,0", i].join(","), " A ") .concat([e, e, "0,0,0", r].join(",")) ); if (2 === o) return (function (t) { var n = se(t[0], t[1]), r = oe(n, e), i = g.c.add([0, 0], t[0], g.c.scale([0, 0], r, -1)), o = g.c.add([0, 0], t[1], r), a = 1.2 * e, s = oe(g.c.normalize([0, 0], n), a), c = g.c.scale([0, 0], s, -1), u = g.c.add([0, 0], i, c), h = g.c.add([0, 0], o, c), l = g.c.add([0, 0], i, s); return "M " .concat(i, " C ") .concat([u, h, o].join(","), " S ") .concat([l, i].join(","), " Z"); })(t); for ( var a = t.map(function (e, n) { var r = t[(n + 1) % o]; return { p: e, v: g.c.normalize([0, 0], se(e, r)) }; }), s = 0; s < a.length; ++s ) { var c = s > 0 ? s - 1 : o - 1, u = g.c.normalize( [0, 0], g.c.add([0, 0], a[c].v, g.c.scale([0, 0], a[s].v, -1)), ); a[s].p = g.c.add([0, 0], a[s].p, g.c.scale([0, 0], u, e)); } return a.map(function (t) { var e = t.p; return { x: e[0], y: e[1] }; }); } var he = function (t, e, n) { return (t.y - n.y) * (e.x - n.x) - (t.x - n.x) * (e.y - n.y); }, le = function (t) { var e = t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }); if ( (e.sort(function (t, e) { return t.x === e.x ? t.y - e.y : t.x - e.x; }), 1 === e.length) ) return e; for (var n = [], r = 0; r < e.length; r++) { for ( ; n.length >= 2 && he(n[n.length - 2], n[n.length - 1], e[r]) <= 0; ) n.pop(); n.push(e[r]); } var i = []; for (r = e.length - 1; r >= 0; r--) { for ( ; i.length >= 2 && he(i[i.length - 2], i[i.length - 1], e[r]) <= 0; ) i.pop(); i.push(e[r]); } return i.pop(), n.pop(), n.concat(i); }, fe = { maxRoutingIterations: 100, maxMarchingIterations: 100, pixelGroupSize: 2, edgeR0: 10, edgeR1: 10, nodeR0: 5, nodeR1: 10, morphBuffer: 5, threshold: 0.001, skip: 16, nodeInfluenceFactor: 1, edgeInfluenceFactor: 1, negativeNodeInfluenceFactor: -0.5, }; function de(t, e, n) { var r = !1, i = function (t, n) { return e.cells[t + n * e.width]; }, o = function (t, e) { var r = 0; return ( i(t - 1, e - 1) >= n && (r += 1), i(t, e - 1) > n && (r += 2), i(t - 1, e) > n && (r += 4), i(t, e) > n && (r += 8), r ); }, a = function (n, r) { for (var i, a, s = n, c = r, u = 0; u < e.width * e.height; u++) { if ( ((i = s), (a = c), t.findIndex(function (t) { return t.x === s && t.y === c; }) > -1) ) { if (t[0].x === s && t[0].y === c) return !0; } else t.push({ x: s, y: c }); var h = o(s, c); switch (h) { case -1: return console.warn("Marched out of bounds"), !0; case 0: case 3: case 2: case 7: s++; break; case 12: case 14: case 4: s--; break; case 6: 0 === i && (-1 === a ? (s -= 1) : (s += 1)); break; case 1: case 13: case 5: c--; break; case 9: 1 === i && (0 === a ? (c -= 1) : (c += 1)); break; case 10: case 8: case 11: c++; break; default: return ( console.warn("Marching squares invalid state: ".concat(h)), !0 ); } } }; this.march = function () { for (var t = 0; t < e.width && !r; t += 1) for (var s = 0; s < e.height && !r; s += 1) i(t, s) > n && 15 !== o(t, s) && (r = a(t, s)); return r; }; } var pe = function (t, e) { var n = Number.POSITIVE_INFINITY, r = null; return ( t.forEach(function (t) { var i = q(t, e); i >= 0 && i < n && ((r = t), (n = i)); }), r ); }; function ge(t, e, n, r, i) { var o = (function (t, e, n) { var r = null, i = Number.POSITIVE_INFINITY; return ( e.forEach(function (e) { var o = { x: t.getModel().x, y: t.getModel().y }, a = { x: e.getModel().x, y: e.getModel().y }, s = G(o, a), c = new Y(o.x, o.y, a.x, a.y), u = n.reduce(function (t, e) { return q(e, c) > 0 ? t + 1 : t; }, 0); s * Math.pow(u + 1, 2) < i && ((r = e), (i = s * Math.pow(u + 1, 2))); }), r ); })(t, n, e); if (null === o) return []; return (function (t) { for (var n = []; t.length > 0; ) { var r = t.pop(); if (0 === t.length) { n.push(r); break; } var i = t.pop(), o = new Y(r.x1, r.y1, i.x2, i.y2); pe(e, o) ? (n.push(r), t.push(i)) : t.push(o); } return n; })( (function (t, e, n, r) { var i = [], o = []; o.push(t); for ( var a = !0, s = 0, c = function (t, e) { var n = !1; return ( e.forEach(function (e) { n || ((U(t, { x: e.x1, y: e.y1 }) || U(t, { x: e.x2, y: e.y2 })) && (n = !0)); }), n ); }, u = function (t, e) { for (var n = 0, r = e; n < r.length; n++) { var i = r[n].getBBox(), o = [ [i.x, i.y], [i.x + i.width, i.y], [i.x, i.y + i.height], [i.x + i.width, i.y + i.height], ]; if (_(o, t.x, t.y)) return !0; } return !1; }; a && s < n; ) { a = !1; for ( var h = function () { var t = o.pop(), n = pe(e, t); if (n) { var h = W(n, t), l = h[0]; if (2 === h[1]) { var f = function (s) { for ( var h = r, f = me(n, h, l, s), d = c(f, o) || c(f, i), p = u(f, e); !d && p && h >= 1; ) (f = me(n, (h /= 1.5), l, s)), (d = c(f, o) || c(f, i)), (p = u(f, e)); !f || d || (s && p) || (o.push(new Y(t.x1, t.y1, f.x, f.y)), o.push(new Y(f.x, f.y, t.x2, t.y2)), (a = !0)); }; f(!0), a || f(!1); } } a || i.push(t), (s += 1); }; !a && o.length; ) h(); } for (; o.length; ) i.push(o.pop()); return i; })( new Y( t.getModel().x, t.getModel().y, o.getModel().x, o.getModel().y, ), e, r, i, ), ); } var ve = function (t, e, n) { var r = Object.assign(fe, n), i = V( t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }), ); t = t.sort(function (t, e) { return ( G({ x: t.getModel().x, y: t.getModel().y }, i) - G({ x: e.getModel().x, y: e.getModel().y }, i) ); }); var o = [], a = []; t.forEach(function (t) { ge(t, e, o, r.maxRoutingIterations, r.morphBuffer).forEach( function (t) { a.push(t); }, ), o.push(t); }); for ( var s, c, u, h, l, f = (function (t, e, n) { var r = { minX: Number.POSITIVE_INFINITY, minY: Number.POSITIVE_INFINITY, maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, width: 0, height: 0, x: 0, y: 0, }, i = []; t.forEach(function (t) { i.push(t.getBBox()); }), e.forEach(function (t) { i.push(t.getBBox()); }); for (var o = 0, a = i; o < a.length; o++) { var s = a[o]; (r.minX = (s.minX < r.minX ? s.minX : r.minX) - n), (r.minY = (s.minY < r.minY ? s.minY : r.minY) - n), (r.maxX = (s.maxX > r.maxX ? s.maxX : r.maxX) + n), (r.maxY = (s.maxY > r.maxY ? s.maxY : r.maxY) + n); } return ( (r.width = r.maxX - r.minX), (r.height = r.maxY - r.minY), (r.x = r.minX), (r.y = r.minY), r ); })(t, a, r.nodeR0), d = ((s = f.width), (c = f.height), (u = r.pixelGroupSize), (h = Math.ceil(s / u)), (l = Math.ceil(c / u)), { cells: new Float32Array(Math.max(0, h * l)).fill(0), width: h, height: l, }), p = [], g = [], v = 0; v < r.maxMarchingIterations; v++ ) if ( (ye(t, e, a, f, d, r), (g = []), new de((p = []), d, r.threshold).march()) ) { var y = p.map(function (t) { return { x: Math.round(t.x * r.pixelGroupSize + f.minX), y: Math.round(t.y * r.pixelGroupSize + f.minY), }; }); if (y) { var m = y.length; if (r.skip > 1) for (m = Math.floor(y.length / r.skip); m < 3 && r.skip > 1; ) (r.skip -= 1), (m = Math.floor(y.length / r.skip)); for (var b = 0, x = 0; x < m; x += 1, b += r.skip) g.push({ x: y[b].x, y: y[b].y }); } if ( g && (function () { for (var e = 0, n = t; e < n.length; e++) { var r = n[e], i = g.map(function (t) { return [t.x, t.y]; }); if (!_(i, r.getBBox().centerX, r.getBBox().centerY)) return !1; } return !0; })() ) return g; if (((r.threshold *= 0.9), v <= 0.5 * r.maxMarchingIterations)) (r.memberInfluenceFactor *= 1.2), (r.edgeInfluenceFactor *= 1.2); else { if (!(0 !== r.nonMemberInfluenceFactor && e.length > 0)) break; r.nonMemberInfluenceFactor *= 0.8; } } return g; }; function ye(t, e, n, r, i, o) { function a(t, e) { var n = Math.floor((t - e) / o.pixelGroupSize); return n < 0 ? 0 : n; } function s(t, e) { return t * o.pixelGroupSize + e; } var c = (o.nodeR0 - o.nodeR1) * (o.nodeR0 - o.nodeR1), u = (o.edgeR0 - o.edgeR1) * (o.edgeR0 - o.edgeR1), h = function (t, e) { return [ Math.min(a(t.minX, e + r.minX), i.width), Math.min(a(t.minY, e + r.minY), i.height), Math.min(a(t.maxX, -e + r.minX), i.width), Math.min(a(t.maxY, -e + r.minY), i.height), ]; }, l = function (t, e) { for ( var n = t.getBBox(), a = h(n, o.nodeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = Z( { x: g, y: v }, { x: n.minX, y: n.minY, width: n.width, height: n.height, }, ); if (y < Math.pow(o.nodeR1, 2)) { var m = Math.sqrt(y) - o.nodeR1; i.cells[p + d * i.width] += e * m * m; } } }; o.nodeInfluenceFactor && t.forEach(function (t) { l(t, o.nodeInfluenceFactor / c); }), o.edgeInfluenceFactor && n.forEach(function (t) { !(function (t, e) { for ( var n = t.getBBox(), a = h(n, o.edgeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i.cells[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = H({ x: g, y: v }, t); if (y < Math.pow(o.edgeR1, 2)) { var m = Math.sqrt(y) - o.edgeR1; i.cells[p + d * i.width] += e * m * m; } } })(t, o.edgeInfluenceFactor / u); }), o.negativeNodeInfluenceFactor && e.forEach(function (t) { l(t, o.negativeNodeInfluenceFactor / c); }); } function me(t, e, n, r) { var i = t.getBBox(), o = n[0], a = n[1], s = n[2], c = n[3], u = { topLeft: { x: i.minX - e, y: i.minY - e }, topRight: { x: i.maxX + e, y: i.minY - e }, bottomLeft: { x: i.minX - e, y: i.maxY + e }, bottomRight: { x: i.maxX + e, y: i.maxY + e }, }, h = i.height * i.width; function l(t, e) { return i.width * (0.5 * (t.y - i.minY + (e.y - i.minY))); } if (a) return o ? r ? u.topLeft : u.bottomRight : s ? r ? u.bottomLeft : u.topRight : l(a, c) < 0.5 * h ? a.y > c.y ? r ? u.topLeft : u.bottomRight : r ? u.topRight : u.bottomLeft : a.y < c.y ? r ? u.bottomLeft : u.topRight : r ? u.bottomRight : u.topLeft; if (c) { if (o) return r ? u.topRight : u.bottomLeft; if (s) return r ? u.bottomRight : u.topLeft; } return l(o, s) < 0.5 * h ? o.x > s.x ? r ? u.topLeft : u.bottomRight : r ? u.bottomLeft : u.topRight : o.x < s.x ? r ? u.topRight : u.bottomLeft : r ? u.bottomRight : u.topLeft; } var be = (function () { function t(t, e) { (this.cfg = Object(c.deepMix)(this.getDefaultCfg(), e)), (this.graph = t), (this.id = this.cfg.id), (this.group = this.cfg.group), (this.members = this.cfg.members.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), (this.nonMembers = this.cfg.nonMembers.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); } return ( (t.prototype.getDefaultCfg = function () { return { id: "g6-hull", type: "round-convex", members: [], nonMembers: [], style: { fill: "lightblue", stroke: "blue", opacity: 0.2 }, padding: 10, }; }), (t.prototype.setPadding = function () { var t = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2; (this.padding = this.cfg.padding > 0 ? this.cfg.padding + t : 10 + t), (this.cfg.bubbleCfg = { nodeR0: this.padding - t, nodeR1: this.padding - t, morphBuffer: this.padding - t, }); }), (t.prototype.setType = function () { (this.type = this.cfg.type), this.members.length < 3 && (this.type = "round-convex"), "round-convex" !== this.type && "smooth-convex" !== this.type && "bubble" !== this.type && (console.warn( "The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.", ), (this.type = "round-convex")); }), (t.prototype.calcPath = function (t, e) { var n, r, i; switch (this.type) { case "round-convex": (i = ce( (n = le(t)).map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i)); break; case "smooth-convex": 2 === (n = le(t)).length ? ((i = ce( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i))) : n.length > 2 && ((i = ue( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = ie(i))); break; case "bubble": r = (n = ve(t, e, this.cfg.bubbleCfg)).length >= 2 && ie(n); } return r; }), (t.prototype.render = function () { this.group.addShape("path", { attrs: Object(f.a)({ path: this.path }, this.cfg.style), id: this.id, name: this.cfg.id, }), this.group.toBack(); }), (t.prototype.addMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.members.push(t); var e = this.nonMembers.indexOf(t); return ( e > -1 && this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.addNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.nonMembers.push(t); var e = this.members.indexOf(t); return ( e > -1 && this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.removeMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.members.indexOf(t); return ( e > -1 && (this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.removeNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.nonMembers.indexOf(t); return ( e > -1 && (this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.updateData = function (t, e) { var n = this; this.group.findById(this.id).remove(), t && (this.members = t.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), e && (this.nonMembers = e.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.updateStyle = function (t) { this.group.findById(this.id).attr(Object(f.a)({}, t)); }), (t.prototype.updateCfg = function (t) { var e = this; (this.cfg = Object(c.deepMix)(this.cfg, t)), (this.id = this.cfg.id), (this.group = this.cfg.group), t.members && (this.members = this.cfg.members.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), t.nonMembers && (this.nonMembers = this.cfg.nonMembers.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.contain = function (t) { var e, n, r = this, i = (e = Object(c.isString)(t) ? this.graph.findById(t) : t).getKeyShape(); if ("path" === e.get("type")) n = re(i.attr("path")); else { var o = i.getCanvasBBox(); n = [ [o.minX, o.minY], [o.maxX, o.minY], [o.maxX, o.maxY], [o.minX, o.maxY], ]; } return ( (n = n.map(function (t) { var e = r.graph.getPointByCanvas(t[0], t[1]); return [e.x, e.y]; })), F(n, re(this.path)) ); }), (t.prototype.destroy = function () { this.group.remove(), (this.cfg = null); }), t ); })(), xe = g.a.transform, we = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.cfg = Object(c.deepMix)(n.getDefaultCfg(), e)), n.init(), (n.animating = !1), (n.destroyed = !1), n.cfg.enabledStack && ((n.undoStack = new v.Stack(n.cfg.maxStep)), (n.redoStack = new v.Stack(n.cfg.maxStep))), n ); } return ( Object(f.c)(e, t), (e.prototype.init = function () { this.initCanvas(); var t = new Nt(this), e = new Ot(this), n = new Zt(this), r = new $t(this); this.set({ viewController: t, modeController: e, itemController: n, stateController: r, }), this.initLayoutController(), this.initEventController(), this.initGroups(), this.initPlugins(), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), )); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = this.get("canvas").get("el").id, n = t.addGroup({ id: "".concat(e, "-root"), className: nt.rootContainerClassName, }); if (this.get("groupByTypes")) { var r = n.addGroup({ id: "".concat(e, "-edge"), className: nt.edgeContainerClassName, }), i = n.addGroup({ id: "".concat(e, "-node"), className: nt.nodeContainerClassName, }), o = n.addGroup({ id: "".concat(e, "-combo"), className: nt.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = n.addGroup({ id: "".concat(e, "-delegate"), className: nt.delegateContainerClassName, }); this.set({ delegateGroup: a }), this.set("group", n); }), (e.prototype.getDefaultCfg = function () { return { container: void 0, width: void 0, height: void 0, renderer: "canvas", modes: {}, plugins: [], data: {}, fitViewPadding: 10, minZoom: 0.2, maxZoom: 10, event: !0, groupByTypes: !0, directed: !1, autoPaint: !0, nodes: [], edges: [], combos: [], vedges: [], itemMap: {}, linkCenter: !1, defaultNode: {}, defaultEdge: {}, nodeStateStyles: {}, edgeStateStyles: {}, states: {}, animate: !1, animateCfg: { onFrame: void 0, duration: 500, easing: "easeLinear", }, callback: void 0, enabledStack: !1, maxStep: 10, tooltips: [], }; }), (e.prototype.set = function (t, e) { return ( Object(c.isPlainObject)(t) ? (this.cfg = Object(f.a)(Object(f.a)({}, this.cfg), t)) : (this.cfg[t] = e), this ); }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.getGroup = function () { return this.get("group"); }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.getMinZoom = function () { return this.get("minZoom"); }), (e.prototype.setMinZoom = function (t) { return this.set("minZoom", t); }), (e.prototype.getMaxZoom = function () { return this.get("maxZoom"); }), (e.prototype.setMaxZoom = function (t) { return this.set("maxZoom", t); }), (e.prototype.getWidth = function () { return this.get("width"); }), (e.prototype.getHeight = function () { return this.get("height"); }), (e.prototype.clearItemStates = function (t, e) { Object(c.isString)(t) && (t = this.findById(t)); var n = this.get("itemController"); e || (e = t.get("states")), n.clearItemStates(t, e), this.get("stateController").updateStates(t, e, !1); }), (e.prototype.node = function (t) { "function" == typeof t && this.set("nodeMapper", t); }), (e.prototype.edge = function (t) { "function" == typeof t && this.set("edgeMapper", t); }), (e.prototype.combo = function (t) { "function" == typeof t && this.set("comboMapper", t); }), (e.prototype.findById = function (t) { return this.get("itemMap")[t]; }), (e.prototype.find = function (t, e) { var n, r = this.get("".concat(t, "s")); return ( Object(c.each)(r, function (t, r) { if (e(t, r)) return (n = t); }), n ); }), (e.prototype.findAll = function (t, e) { var n = []; return ( Object(c.each)(this.get("".concat(t, "s")), function (t, r) { e(t, r) && n.push(t); }), n ); }), (e.prototype.findAllByState = function (t, e) { return this.findAll(t, function (t) { return t.hasState(e); }); }), (e.prototype.translate = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe(r, [["t", t, e]])), n.setMatrix(r), this.emit("viewportchange", { action: "translate", matrix: n.getMatrix(), }), this.autoPaint(); }), (e.prototype.moveTo = function (t, e) { var n = this.get("group"); T(n, { x: t, y: e }), this.emit("viewportchange", { action: "move", matrix: n.getMatrix(), }); }), (e.prototype.fitView = function (t) { t && this.set("fitViewPadding", t), this.get("viewController").fitView(), this.autoPaint(); }), (e.prototype.fitCenter = function () { this.get("viewController").fitCenter(), this.autoPaint(); }), (e.prototype.addBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !0), this ); }), (e.prototype.removeBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !1), this ); }), (e.prototype.updateBehavior = function (t, e, n) { return this.get("modeController").updateBehavior(t, e, n), this; }), (e.prototype.zoom = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()), i = this.get("minZoom"), o = this.get("maxZoom"); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe( r, e ? [ ["t", -e.x, -e.y], ["s", t, t], ["t", e.x, e.y], ] : [["s", t, t]], )), (i && r[0] < i) || (o && r[0] > o) || (n.setMatrix(r), this.emit("viewportchange", { action: "zoom", matrix: r }), this.autoPaint()); }), (e.prototype.zoomTo = function (t, e) { var n = t / this.getZoom(); this.zoom(n, e); }), (e.prototype.focusItem = function (t, e, n) { var r = this.get("viewController"), i = !1; e ? (i = !0) : void 0 === e && (i = this.get("animate")); var o = {}; n ? (o = n) : void 0 === n && (o = this.get("animateCfg")), r.focus(t, i, o), this.autoPaint(); }), (e.prototype.autoPaint = function () { this.get("autoPaint") && this.paint(); }), (e.prototype.paint = function () { this.emit("beforepaint"), this.get("canvas").draw(), this.emit("afterpaint"); }), (e.prototype.getPointByClient = function (t, e) { return this.get("viewController").getPointByClient(t, e); }), (e.prototype.getClientByPoint = function (t, e) { return this.get("viewController").getClientByPoint(t, e); }), (e.prototype.getPointByCanvas = function (t, e) { return this.get("viewController").getPointByCanvas(t, e); }), (e.prototype.getCanvasByPoint = function (t, e) { return this.get("viewController").getCanvasByPoint(t, e); }), (e.prototype.getGraphCenterPoint = function () { var t = this.get("group").getCanvasBBox(); return { x: (t.minX + t.maxX) / 2, y: (t.minY + t.maxY) / 2 }; }), (e.prototype.getViewPortCenterPoint = function () { return this.getPointByCanvas( this.get("width") / 2, this.get("height") / 2, ); }), (e.prototype.showItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !0); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !1 }]), (o.nodes = [{ id: r, visible: !0 }]); break; case "edge": (i.nodes = [{ id: r, visible: !1 }]), (o.edges = [{ id: r, visible: !0 }]); break; case "combo": (i.nodes = [{ id: r, visible: !1 }]), (o.combos = [{ id: r, visible: !0 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.hideItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !1); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !0 }]), (o.nodes = [{ id: r, visible: !1 }]); break; case "edge": (i.nodes = [{ id: r, visible: !0 }]), (o.edges = [{ id: r, visible: !1 }]); break; case "combo": (i.nodes = [{ id: r, visible: !0 }]), (o.combos = [{ id: r, visible: !1 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.refreshItem = function (t) { this.get("itemController").refreshItem(t); }), (e.prototype.setAutoPaint = function (t) { this.set("autoPaint", t), this.get("canvas").set("autoDraw", t); }), (e.prototype.remove = function (t, e) { void 0 === e && (e = !0), this.removeItem(t, e); }), (e.prototype.removeItem = function (t, e) { void 0 === e && (e = !0); var n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n && Object(c.isString)(t)) ) console.warn("The item to be removed does not exist!"); else if (n) { var r = ""; if ( (n.getType && (r = n.getType()), e && this.get("enabledStack")) ) { var i = Object(f.a)(Object(f.a)({}, n.getModel()), { itemType: r, }), o = {}; switch (r) { case "node": (o.nodes = [i]), (o.edges = []); for (var a = n.getEdges(), s = a.length - 1; s >= 0; s--) o.edges.push( Object(f.a)(Object(f.a)({}, a[s].getModel()), { itemType: "edge", }), ); break; case "edge": o.edges = [i]; break; case "combo": o.combos = [i]; } this.pushStack("delete", { before: o, after: {} }); } if ("node" === r) n.getModel().comboId && this.updateComboTree(n); if ((this.get("itemController").removeItem(n), "combo" === r)) { var u = mt(this.get("comboTrees")); this.set("comboTrees", u); } } }), (e.prototype.addItem = function (t, e, n, r) { void 0 === n && (n = !0), void 0 === r && (r = !0); var i = this.get("comboSorted"); this.set("comboSorted", i && !r); var o = this.get("itemController"); if ( !(function (t, e) { if ("node" === t || "combo" === t) { if (e.id && !Object(c.isString)(e.id)) return ( console.warn( "G6 Warning Tips: missing 'id' property, or the 'id' %c".concat( e.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); } else if (!("edge" !== t || (e.source && e.target))) return ( console.warn( "G6 Warning Tips: missing 'source' or 'target' for the edge.", ), !1 ); return !0; })(t, e) ) return !1; if (!e.id || !this.findById(e.id)) { var a, s = this.get("comboTrees"); if ((s || (s = []), "combo" === t)) { var u = this.get("itemMap"), h = !1; if ( (s.forEach(function (n) { h || pt(n, function (n) { if (e.parentId === n.id) { h = !0; var r = Object(f.a)( { id: e.id, depth: n.depth + 2 }, e, ); n.children ? n.children.push(r) : (n.children = [r]), (e.depth = r.depth), (a = o.addItem(t, e)); } var i = u[n.id]; return ( h && i && i.getType && "combo" === i.getType() && o.updateCombo(i, n.children), !0 ); }); }), !h) ) { var l = Object(f.a)({ id: e.id, depth: 0 }, e); (e.depth = l.depth), s.push(l), (a = o.addItem(t, e)); } this.set("comboTrees", s); } else if ("node" === t && Object(c.isString)(e.comboId) && s) { var d; (d = this.findById(e.comboId)) && d.getType && "combo" !== d.getType() && console.warn( "'".concat( e.comboId, "' is not a id of a combo in the graph, the node will be added without combo.", ), ), (a = o.addItem(t, e)); var p = this.get("itemMap"), g = !1, v = !1; (s || []).forEach(function (t) { v || g || pt(t, function (t) { if (t.id === e.id) return (v = !0), !1; if (e.comboId === t.id && !v) { g = !0; var n = Object(c.clone)(e); (n.itemType = "node"), t.children ? t.children.push(n) : (t.children = [n]), (n.depth = t.depth + 1); } return ( g && p[t.id].getType && "combo" === p[t.id].getType() && o.updateCombo(p[t.id], t.children), !0 ); }); }); } else a = o.addItem(t, e); if ( ("node" === t && e.comboId) || ("combo" === t && e.parentId) ) (d = this.findById(e.comboId || e.parentId)) && d.getType && "combo" === d.getType() && d.addChild(a); var y = this.get("combos"); if ( (y && y.length > 0 && this.sortCombos(), this.autoPaint(), n && this.get("enabledStack")) ) { var m = Object(f.a)(Object(f.a)({}, a.getModel()), { itemType: t, }), b = {}; switch (t) { case "node": b.nodes = [m]; break; case "edge": b.edges = [m]; break; case "combo": b.combos = [m]; } this.pushStack("add", { before: {}, after: b }); } return a; } console.warn( "This item exists already. Be sure the id %c".concat( e.id, "%c is unique.", ), "font-size: 20px; color: red;", "", ); }), (e.prototype.add = function (t, e, n, r) { return ( void 0 === n && (n = !0), void 0 === r && (r = !0), this.addItem(t, e, n, r) ); }), (e.prototype.updateItem = function (t, e, n) { var r = this; void 0 === n && (n = !0); var i, o = this.get("itemController"); i = Object(c.isString)(t) ? this.findById(t) : t; var a = Object(c.clone)(i.getModel()), s = ""; i.getType && (s = i.getType()); var u = Object(f.f)([], i.getStates(), !0); if ( ("combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !1); }), o.updateItem(i, e), "combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !0); }), n && this.get("enabledStack")) ) { var h = { nodes: [], edges: [], combos: [] }, l = { nodes: [], edges: [], combos: [] }, d = Object(f.a)({ id: a.id }, e); switch (s) { case "node": h.nodes.push(a), l.nodes.push(d); break; case "edge": h.edges.push(a), l.edges.push(d); break; case "combo": h.combos.push(a), l.combos.push(d); } "node" === s && h.nodes.push(a), this.pushStack("update", { before: h, after: l }); } }), (e.prototype.update = function (t, e, n) { void 0 === n && (n = !0), this.updateItem(t, e, n); }), (e.prototype.setItemState = function (t, e, n) { Object(c.isString)(t) && (t = this.findById(t)), this.get("itemController").setItemState(t, e, n); var r = this.get("stateController"); Object(c.isString)(n) ? r.updateState(t, "".concat(e, ":").concat(n), !0) : r.updateState(t, e, n); }), (e.prototype.priorityState = function (t, e) { this.get("itemController").priorityState(t, e); }), (e.prototype.data = function (t) { St(t), this.set("data", t); }), (e.prototype.render = function () { var t = this; this.set("comboSorted", !1); var e = this.get("data"); if ((this.get("enabledStack") && this.clearStack(), !e)) throw new Error("data must be defined first"); var n = e.nodes, r = void 0 === n ? [] : n, i = e.edges, o = void 0 === i ? [] : i, a = e.combos, s = void 0 === a ? [] : a; if ( (this.clear(!0), this.emit("beforerender"), Object(c.each)(r, function (e) { t.add("node", e, !1, !1); }), s && 0 !== s.length) ) { var u = yt(s, r); this.set("comboTrees", u), t.addCombos(s); } Object(c.each)(o, function (e) { t.add("edge", e, !1, !1); }); var h = t.get("animate"); (t.get("fitView") || t.get("fitCenter")) && t.set("animate", !1); var l = t.get("layoutController"); if (l) { if ( (l.layout(function () { t.get("fitView") ? t.fitView() : t.get("fitCenter") && t.fitCenter(); t.autoPaint(), t.emit("afterrender"), (t.get("fitView") || t.get("fitCenter")) && t.set("animate", h); }), this.refreshPositions(), this.destroyed) ) return; } else t.get("fitView") && t.fitView(), t.get("fitCenter") && t.fitCenter(), t.emit("afterrender"), t.set("animate", h); this.get("groupByTypes") || (s && 0 !== s.length ? this.sortCombos() : e.nodes && e.edges && e.nodes.length < e.edges.length ? this.getNodes().forEach(function (t) { t.toFront(); }) : this.getEdges().forEach(function (t) { t.toBack(); })); this.get("enabledStack") && this.pushStack("render"); }), (e.prototype.read = function (t) { this.data(t), this.render(); }), (e.prototype.diffItems = function (t, e, n) { var r, i = this, o = this.get("itemMap"); Object(c.each)(n, function (n) { if ((r = o[n.id])) { if (i.get("animate") && "node" === t) { var a = r.getContainer().getMatrix(); a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.set("originAttrs", { x: a[6], y: a[7] }); } i.updateItem(r, n, !1); } else r = i.addItem(t, n, !1); r && e["".concat(t, "s")].push(r); }); }), (e.prototype.changeData = function (t, e) { void 0 === e && (e = !0); var n = this; if (!St(t)) return this; e && this.get("enabledStack") && this.pushStack("changedata", { before: n.save(), after: t }), this.set("comboSorted", !1), this.removeHulls(), this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }); var r = this.get("canvas"), i = r.get("localRefresh"); r.set("localRefresh", !1), n.get("data") || (n.data(t), n.render()); var o = this.get("itemMap"), a = { nodes: [], edges: [] }, s = t.combos; if (s) { var u = yt(s, t.nodes); this.set("comboTrees", u); } this.diffItems("node", a, t.nodes), Object(c.each)(o, function (t, e) { (o[e].getModel().depth = 0), (t.getType && "edge" === t.getType()) || (t.getType && "combo" === t.getType() ? (delete o[e], t.destroy()) : a.nodes.indexOf(t) < 0 && (delete o[e], n.remove(t, !1))); }); for (var h = this.getCombos(), l = h.length - 1; l >= 0; l--) h[l].destroyed && h.splice(l, 1); s && (n.addCombos(s), this.get("groupByTypes") || this.sortCombos()), this.diffItems("edge", a, t.edges), Object(c.each)(o, function (t, e) { (!t.getType || ("node" !== t.getType() && "combo" !== t.getType())) && a.edges.indexOf(t) < 0 && (delete o[e], n.remove(t, !1)); }), this.set({ nodes: a.nodes, edges: a.edges }); var f = this.get("layoutController"); return ( f && (f.changeData(), n.get("animate") && !f.getLayoutType() ? n.positionsAnimate() : n.autoPaint()), setTimeout(function () { r.set("localRefresh", i); }, 16), this ); }), (e.prototype.addCombos = function (t) { var e = this.get("comboTrees"); this.get("itemController").addCombos(e, t); }), (e.prototype.createCombo = function (t, e) { var n = this; this.set("comboSorted", !1); var r, i = ""; if (t) { if (Object(c.isString)(t)) (i = t), (r = { id: t }); else { if (!(i = t.id)) return void console.warn( "Create combo failed. Please assign a unique string id for the adding combo.", ); r = t; } var o = e.map(function (t) { var e = n.findById(t), r = e.getModel(), o = ""; e.getType && (o = e.getType()); var a = { id: e.getID(), itemType: o }; return ( "combo" === o ? ((a.parentId = i), (r.parentId = i)) : "node" === o && ((a.comboId = i), (r.comboId = i)), a ); }); (r.children = o), this.addItem("combo", r, !1), this.set("comboSorted", !1); var a = this.get("comboTrees"); (a || []).forEach(function (t) { pt(t, function (t) { return ( t.id !== i || ((t.itemType = "combo"), (t.children = o), !1) ); }); }), a && this.sortCombos(); } }), (e.prototype.uncombo = function (t) { var e = this, n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n || (n.getType && "combo" !== n.getType())) ) console.warn("The item is not a combo!"); else { var r = n.getModel().parentId, i = this.get("comboTrees"); i || (i = []); var o, a = this.get("itemMap"), s = n.get("id"), u = [], h = this.get("combos"), l = this.findById(r); if ( (i.forEach(function (i) { o || pt(i, function (i) { if (i.id === s) { (o = i), n.getEdges().forEach(function (t) { e.removeItem(t, !1); }); var c = h.indexOf(t); h.splice(c, 1), delete a[s], n.destroy(); } return ( !r || !o || i.id !== r || (l.removeCombo(n), -1 !== (c = (u = i.children).indexOf(o)) && u.splice(c, 1), o.children.forEach(function (t) { var n = e.findById(t.id), i = n.getModel(); n.getType && "combo" === n.getType() ? ((t.parentId = r), delete t.comboId, (i.parentId = r), delete i.comboId) : n.getType && "node" === n.getType() && ((t.comboId = r), (i.comboId = r)), l.addChild(n), u.push(t); }), !1) ); }); }), !r && o) ) { var f = i.indexOf(o); i.splice(f, 1), o.children.forEach(function (t) { t.parentId = void 0; var n = e.findById(t.id).getModel(); delete n.parentId, delete n.comboId, "node" !== t.itemType && i.push(t); }); } } }), (e.prototype.updateCombos = function () { var t = this, e = this.get("comboTrees"), n = this.get("itemController"), r = this.get("itemMap"); (e || []).forEach(function (e) { pt(e, function (e) { if (!e) return !0; var i = r[e.id]; if (i && i.getType && "combo" === i.getType()) { var o = Object(f.f)([], i.getStates(), !0); Object(c.each)(o, function (e) { return t.setItemState(i, e, !1); }), n.updateCombo(i, e.children), Object(c.each)(o, function (e) { return t.setItemState(i, e, !0); }); } return !0; }); }), this.sortCombos(); }), (e.prototype.updateCombo = function (t) { var e, n = this, r = t; if ( (Object(c.isString)(t) && (r = this.findById(t)), !r || (r.getType && "combo" !== r.getType())) ) console.warn("The item to be updated is not a combo!"); else { e = r.get("id"); var i = this.get("comboTrees"), o = this.get("itemController"), a = this.get("itemMap"); (i || []).forEach(function (t) { pt(t, function (t) { if (!t) return !0; var r = a[t.id]; if ( e === t.id && r && r.getType && "combo" === r.getType() ) { var i = Object(f.f)([], r.getStates(), !0); Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !1); }), o.updateCombo(r, t.children), Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !0); }), e && (e = t.parentId); } return !0; }); }); } }), (e.prototype.updateComboTree = function (t, e, n) { void 0 === n && (n = !0); var r; this.set("comboSorted", !1); var i, o = (r = Object(c.isString)(t) ? this.findById(t) : t).getModel(), a = o.comboId || o.parentId, s = ""; if ((r.getType && (s = r.getType()), e && "combo" === s)) { var u, h = this.get("comboTrees"), l = !0; if ( ((h || []).forEach(function (t) { u || dt(t, function (t) { if (!u) return t.id === r.getID() && (u = t), !0; }); }), dt(u, function (t) { return t.id !== e || ((l = !1), !1); }), !l) ) return void console.warn( "Failed to update the combo tree! The parentId points to a descendant of the combo!", ); } if (n && this.get("enabledStack")) { var f = {}, d = {}; "combo" === s ? ((f.combos = [{ id: o.id, parentId: o.parentId }]), (d.combos = [{ id: o.id, parentId: e }])) : "node" === s && ((f.nodes = [{ id: o.id, parentId: o.comboId }]), (d.nodes = [{ id: o.id, parentId: e }])), this.pushStack("updateComboTree", { before: f, after: d }); } if (o.parentId || o.comboId) { var p = this.findById(o.parentId || o.comboId); p && p.removeChild(r); } ("combo" === s ? (o.parentId = e) : "node" === s && (o.comboId = e), e) && (i = this.findById(e)) && i.addChild(r); a && (i = this.findById(a)) && i.removeChild(r); var g = mt(this.get("comboTrees"), o.id, e); this.set("comboTrees", g), this.updateCombos(); }), (e.prototype.save = function () { var t = [], e = [], n = []; return ( Object(c.each)(this.get("nodes"), function (e) { t.push(e.getModel()); }), Object(c.each)(this.get("edges"), function (t) { e.push(t.getModel()); }), Object(c.each)(this.get("combos"), function (t) { n.push(t.getModel()); }), { nodes: t, edges: e, combos: n } ); }), (e.prototype.changeSize = function (t, e) { return this.get("viewController").changeSize(t, e), this; }), (e.prototype.refresh = function () { if ((this.emit("beforegraphrefresh"), this.get("animate"))) this.positionsAnimate(); else { var t = this.get("nodes"), e = this.get("edges"), n = this.get("edges"); Object(c.each)(t, function (t) { t.refresh(); }), Object(c.each)(e, function (t) { t.refresh(); }), Object(c.each)(n, function (t) { t.refresh(); }); } this.emit("aftergraphrefresh"), this.autoPaint(); }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.getComboChildren = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) return t.getChildren(); console.warn("The combo does not exist!"); }), (e.prototype.positionsAnimate = function () { var t = this; t.emit("beforeanimate"); var e = t.get("animateCfg"), n = e.onFrame, r = t.getNodes(), i = r.map(function (t) { var e = t.getModel(); return { id: e.id, x: e.x, y: e.y }; }); t.isAnimating() && t.stopAnimate(), t.get("canvas").animate( function (e) { Object(c.each)(i, function (r) { var i = t.findById(r.id); if (i && !i.destroyed) { var o = i.get("originAttrs"), a = i.get("model"); if (!o) { var s = i.getContainer().getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (o = { x: s[6], y: s[7] }), i.set("originAttrs", o); } if (n) { var c = n(i, e, r, o); i.set("model", Object.assign(a, c)); } else (a.x = o.x + (r.x - o.x) * e), (a.y = o.y + (r.y - o.y) * e); } }), t.refreshPositions(); }, { duration: e.duration, easing: e.easing, callback: function () { Object(c.each)(r, function (t) { t.set("originAttrs", null); }), e.callback && e.callback(), t.emit("afteranimate"), (t.animating = !1); }, }, ); }), (e.prototype.refreshPositions = function () { this.emit("beforegraphrefreshposition"); var t, e = this.get("nodes"), n = this.get("edges"), r = this.get("vedges"), i = this.get("combos"), o = {}; Object(c.each)(e, function (e) { t = e.getModel(); var n = e.get("originAttrs"); if (!n || t.x !== n.x || t.y !== n.y) { var r = e.updatePosition({ x: t.x, y: t.y }); (o[t.id] = r), t.comboId && (o[t.comboId] = o[t.comboId] || r); } }), i && 0 !== i.length && this.updateCombos(), Object(c.each)(n, function (t) { var e = t.getSource().getModel(), n = t.getTarget(); if (!Object(c.isPlainObject)(n)) { var r = n.getModel(); (o[e.id] || o[r.id] || t.getModel().isComboEdge) && t.refresh(); } }), Object(c.each)(r, function (t) { t.refresh(); }), this.emit("aftergraphrefreshposition"), this.autoPaint(); }), (e.prototype.stopAnimate = function () { this.get("canvas").stopAnimate(); }), (e.prototype.isAnimating = function () { return this.animating; }), (e.prototype.getZoom = function () { var t = this.get("group").getMatrix(); return t ? t[0] : 1; }), (e.prototype.getCurrentMode = function () { return this.get("modeController").getMode(); }), (e.prototype.setMode = function (t) { return this.get("modeController").setMode(t), this; }), (e.prototype.clear = function (t) { return ( void 0 === t && (t = !1), this.get("canvas").clear(), this.initGroups(), this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [], }), t || this.emit("afterrender"), this ); }), (e.prototype.updateLayout = function (t) { var e = this.get("layoutController"); Object(c.isString)(t) && (t = { type: t }); var n = this.get("layout"), r = {}; Object.assign(r, n, t), this.set("layout", r), e.isLayoutTypeSame(r) && r.gpuEnabled === n.gpuEnabled ? e.updateLayoutCfg(r) : e.changeLayout(r); }), (e.prototype.destroyLayout = function () { this.get("layoutController").destroyLayout(); }), (e.prototype.layout = function () { var t = this.get("layoutController"), e = this.get("layout"); e && t && (e.workerEnabled ? t.layout() : t.layoutMethod ? t.relayout(!0) : t.layout()); }), (e.prototype.collapseCombo = function (t) { var e = this; if ((Object(c.isString)(t) && (t = this.findById(t)), t)) { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").collapseCombo(t), (n.collapsed = !0); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = []; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || r.getModel().id === n.id ) { if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var s = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(s.parentId || s.comboId)) || (!s.parentId && !s.comboId) ) return; s = a.getModel(); } var c = s.id; if (u["".concat(n.id, "-").concat(c)]) return void (u["".concat(n.id, "-").concat(c)] += f.size || 1); var l = e.addItem( "vedge", { source: n.id, target: c, isVEdge: !0 }, !1, ); (u["".concat(n.id, "-").concat(c)] = f.size || 1), h.push(l); } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || a.getModel().id === n.id ) { var f; if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var d = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(d.parentId || d.comboId)) || (!d.parentId && !d.comboId) ) return; d = r.getModel(); } var p = d.id; if (u["".concat(p, "-").concat(n.id)]) return void (u["".concat(p, "-").concat(n.id)] += f.size || 1); l = e.addItem( "vedge", { target: n.id, source: p, isVEdge: !0 }, !1, ); (u["".concat(p, "-").concat(n.id)] = f.size || 1), h.push(l); } } }), h.forEach(function (t) { var n = t.getModel(); e.updateItem( t, { size: u["".concat(n.source, "-").concat(n.target)] }, !1, ); }), this.emit("aftercollapseexpandcombo", { action: "collapse", item: t, }); } else console.warn("The combo to be collapsed does not exist!"); }), (e.prototype.expandCombo = function (t) { var e = this; if ( (Object(c.isString)(t) && (t = this.findById(t)), !t || (t.getType && "combo" !== t.getType())) ) console.warn("The combo to be collapsed does not exist!"); else { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").expandCombo(t), (n.collapsed = !1); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = {}; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(), s = r.get("id"), c = a.get("id"); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || s === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (var l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; l = a.getModel(); } c = l.id; for (var f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; if (f.comboId === n.id || f.parentId === n.id) break; f = r.getModel(); } if (((s = f.id), c)) { var d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); var p = e.addItem( "vedge", { source: s, target: c, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || c === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; f = r.getModel(); } s = f.id; for (l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; if (l.comboId === n.id || l.parentId === n.id) break; l = a.getModel(); } if (((c = l.id), s)) { d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); p = e.addItem( "vedge", { target: c, source: s, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else (i.includes(r) || o.includes(r)) && (i.includes(a) || o.includes(a)) && r.isVisible() && a.isVisible() && t.show(); } }), this.emit("aftercollapseexpandcombo", { action: "expand", item: t, }); } }), (e.prototype.collapseExpandCombo = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) { for (var e = t.getModel(), n = this.findById(e.parentId); n; ) { var r = n.getModel(); if (r.collapsed) return ( console.warn( "Fail to expand the combo since it's ancestor combo is collapsed.", ), void (n = void 0) ); n = this.findById(r.parentId); } e.collapsed ? this.expandCombo(t) : this.collapseCombo(t), this.updateCombo(t); } }), (e.prototype.sortCombos = function () { var t = this; if (!this.get("comboSorted")) { this.set("comboSorted", !0); var e = [], n = {}; (this.get("comboTrees") || []).forEach(function (t) { dt(t, function (t) { return ( e[t.depth] ? e[t.depth].push(t.id) : (e[t.depth] = [t.id]), (n[t.id] = t.depth), !0 ); }); }), (this.getEdges().concat(this.get("vedges")) || []).forEach( function (t) { var r = t.getModel(), i = n[r.source] || 0, o = n[r.target] || 0, a = Math.max(i, o); e[a] ? e[a].push(r.id) : (e[a] = [r.id]); }, ), e.forEach(function (e) { if (e && e.length) for (var n = e.length - 1; n >= 0; n--) { var r = t.findById(e[n]); r && r.toFront(); } }); } }), (e.prototype.getNeighbors = function (t, e) { var n = t; return ( Object(c.isString)(t) && (n = this.findById(t)), n.getNeighbors(e) ); }), (e.prototype.getNodeDegree = function (t, e, n) { void 0 === e && (e = void 0), void 0 === n && (n = !1); var r = t; Object(c.isString)(t) && (r = this.findById(t)); var i = this.get("degrees"); (i && !n) || ((i = Object(v.getDegree)(this.save())), this.set("degrees", i)); var o = i[r.getID()], a = 0; if (!o) return 0; switch (e) { case "in": a = o.inDegree; break; case "out": a = o.outDegree; break; case "all": a = o; break; default: a = o.degree; } return a; }), (e.prototype.getUndoStack = function () { return this.undoStack; }), (e.prototype.getRedoStack = function () { return this.redoStack; }), (e.prototype.getStackData = function () { return this.get("enabledStack") ? { undoStack: this.undoStack.toArray(), redoStack: this.redoStack.toArray(), } : null; }), (e.prototype.clearStack = function () { this.get("enabledStack") && (this.undoStack.clear(), this.redoStack.clear()); }), (e.prototype.pushStack = function (t, e, n) { if ( (void 0 === t && (t = "update"), void 0 === n && (n = "undo"), this.get("enabledStack")) ) { var r = e ? Object(c.clone)(e) : { before: {}, after: Object(c.clone)(this.save()) }; "redo" === n ? this.redoStack.push({ action: t, data: r }) : this.undoStack.push({ action: t, data: r }), this.emit("stackchange", { undoStack: this.undoStack, redoStack: this.redoStack, }); } else console.warn( "请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !", ); }), (e.prototype.getAdjMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), n ); }), (e.prototype.getShortestPathMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"), r = this.get("shortestPathMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), (r && t) || ((r = Object(v.floydWarshall)(this.save(), e)), this.set("shortestPathMatrix", r)), r ); }), (e.prototype.on = function (e, n, r) { return t.prototype.on.call(this, e, n, r); }), (e.prototype.destroy = function () { this.clear(), Object(p.clearAnimationFrame)(this.timeIndex), this.clearStack(), this.get("itemController").destroy(), this.get("modeController").destroy(), this.get("viewController").destroy(), this.get("stateController").destroy(), this.get("canvas").destroy(), (this.cfg = null), (this.destroyed = !0), (this.redoStack = null), (this.undoStack = null); }), (e.prototype.createHull = function (t) { if (t.members && !(t.members.length < 1)) { var e = this.get("hullGroup"), n = this.get("hullMap"); if ( (n || ((n = {}), this.set("hullMap", n)), (e && !e.get("destroyed")) || ((e = this.get("group").addGroup({ id: "hullGroup", })).toBack(), this.set("hullGroup", e)), n[t.id]) ) return console.warn("Existed hull id."), n[t.id]; var r = e.addGroup({ id: "".concat(t.id, "-container") }), i = new be( this, Object(f.a)(Object(f.a)({}, t), { group: r }), ); return (n[i.id] = i), i; } console.warn("Create hull failed! The members is empty."); }), (e.prototype.getHulls = function () { return this.get("hullMap"); }), (e.prototype.getHullById = function (t) { return this.get("hullMap")[t]; }), (e.prototype.removeHull = function (t) { var e; (e = Object(c.isString)(t) ? this.getHullById(t) : t), delete this.get("hullMap")[e.id], e.destroy(); }), (e.prototype.removeHulls = function () { var t = this.getHulls(); t && Object.keys(t).length && (Object.keys(t).forEach(function (e) { t[e].destroy(); }), this.set("hullMap", {})); }), (e.prototype.onTick = function (t) { var e = this.get("layoutController"); e && (e.onTick(t), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), ))); }), e ); })(d.a); function Se(t) { return (Se = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Oe = g.a.transform, Me = ["startArrow", "endArrow"], ke = { lineWidth: 1, stroke: void 0, fill: void 0, lineAppendWidth: 1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, x: 0, y: 0, r: 10, width: 20, height: 20, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, Ce = { edge: { lineWidth: 1, stroke: "#000", lineDash: void 0, startArrow: !1, endArrow: !1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, node: ke, combo: ke, }, Ee = { options: {}, itemType: "", type: "", getCustomConfig: function (t) { return {}; }, getOptions: function (t) { return Object(c.deepMix)( { labelCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, descriptionCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, }, this.options, this.getCustomConfig(t) || {}, t, ); }, draw: function (t, e) { var n = this.drawShape(t, e); (n.set("className", this.itemType + "-shape"), t.label) && this.drawLabel(t, e).set("className", this.itemType + "-label"); return n; }, afterDraw: function (t, e, n) {}, drawShape: function (t, e) { return null; }, drawLabel: function (t, e) { var n = this.getOptions(t).labelCfg || {}, r = this.getLabelStyle(t, n, e), i = r.rotate; delete r.rotate; var o = e.addShape("text", { attrs: r, draggable: !0, className: "text-shape", name: "text-shape", }); if (i) { var a = o.getBBox(), s = o.getMatrix(); if ((s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.rotateCenter)) switch (r.rotateCenter) { case "center": s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); break; case "lefttop": s = Oe(s, [ ["t", -r.x, -r.y], ["r", i], ["t", r.x, r.y], ]); break; case "leftcenter": s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); break; default: s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); } else s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); o.setMatrix(s); } if (r.background) { var c = this.drawLabelBg(t, e, o), u = this.itemType + "-label-bg"; c.set("classname", u), o.toFront(); } return o; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.mix)({}, r, t.labelCfg), o = this.getLabelBgStyleByPosition(n, t, i, e); return e.addShape("rect", { name: "text-bg-shape", attrs: o }); }, getLabelStyleByPosition: function (t, e, n) { return { text: t.label }; }, getLabelBgStyleByPosition: function (t, e, n, r) { return {}; }, getLabelStyle: function (t, e, n) { var r = this.getLabelStyleByPosition(t, e, n), i = "".concat(this.itemType, "Label"), o = nt[i] ? nt[i].style : null; return Object(f.a)(Object(f.a)(Object(f.a)({}, o), r), e.style); }, getShapeStyle: function (t) { return t.style; }, update: function (t, e) { this.updateShapeStyle(t, e), this.updateLabel(t, e); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = e.getKeyShape(), i = Object(c.mix)({}, r.attr(), t.style), o = function (t) { var e, o = i[t]; if (Object(c.isPlainObject)(o)) { var a = n.find(function (e) { return e.get("name") === t; }); a && a.attr(o); } else r.attr((((e = {})[t] = o), e)); }; for (var a in i) o(a); }, updateLabel: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).labelCfg, i = this.itemType + "-label", o = n.find(function (t) { return t.get("className") === i; }), a = this.itemType + "-label-bg", s = n.find(function (t) { return t.get("classname") === a; }); if (t.label || "" === t.label) if (o) { var u = {}; e.getModel && (u = e.getModel().labelCfg); var h = Object(c.deepMix)({}, r, u, t.labelCfg), l = this.getLabelStyleByPosition(t, h, n), d = t.labelCfg ? t.labelCfg.style : void 0, p = h.style && h.style.background, g = Object(f.a)(Object(f.a)(Object(f.a)({}, o.attr()), l), d), v = g.rotate; if ((delete g.rotate, v)) { var y = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (y = Oe(y, [ ["t", -g.x, -g.y], ["r", v], ["t", g.x, g.y], ])), o.resetMatrix(), o.attr(Object(f.a)(Object(f.a)({}, g), { matrix: y })); } else o.resetMatrix(), o.attr(g); if (s) if (g.background) { var m = this.getLabelBgStyleByPosition(o, t, h, n), b = Object(f.a)(Object(f.a)({}, m), p); if ((s.resetMatrix(), v)) { var x = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (x = Oe(x, [ ["t", -b.x, -b.y], ["r", v], ["t", b.x, b.y], ])), (b.matrix = x); } s.attr(b); } else n.removeChild(s); else g.background && ((s = this.drawLabelBg(t, n, o)).set("classname", a), o.toFront()); } else { this.drawLabel(t, n).set("className", i); } }, afterUpdate: function (t, e) {}, setState: function (t, e, n) { var r, i, o = n.get("keyShape"); if (o && !o.destroyed) { var a = n.getType(), s = Object(c.isBoolean)(e) ? t : "".concat(t, ":").concat(e), u = this.getStateStyle(s, n), h = n.getStateStyle(s); if (h || u) { var l = Object(c.mix)({}, h || u), f = n.getContainer(), d = { x: 1, y: 1, cx: 1, cy: 1 }; if ( ("combo" === a && ((d.r = 1), (d.width = 1), (d.height = 1)), e) ) { var p = function (t) { var e, n = l[t]; if (Object(c.isPlainObject)(n) && !Me.includes(t)) { var r = f.find(function (e) { return e.get("name") === t; }); r && r.attr(n); } else o.attr((((e = {})[t] = n), e)); }; for (var g in l) p(g); } else { var v = wt(n.getCurrentStatesStyle()), y = n.getModel(), m = Object(c.mix)({}, y.style, wt(n.getOriginStyle())), b = o.get("name"), x = o.attr(), w = {}; Object.keys(x).forEach(function (t) { if ("img" !== t) { var e = x[t]; e && "object" === Se(e) ? (w[t] = Object(c.clone)(e)) : (w[t] = e); } }); var S = {}, O = function (t) { var e = l[t]; if (Object(c.isPlainObject)(e) && !Me.includes(t)) { var n = f.find(function (e) { return e.get("name") === t; }); if (n) { var r = Object(c.clone)(n.attr()); Object(c.each)(e, function (e, i) { if (t === b && w[i] && !d[i]) { delete w[i]; var s = m[t][i] || Ce[a][i]; o.attr(i, s); } else if (r[i] || 0 === r[i]) { delete r[i]; var c = m[t][i] || Ce[a][i]; n.attr(i, c); } }), (S[t] = r); } } else if (w[t] && !d[t]) { delete w[t]; var i = m[t] || (m[b] ? m[b][t] : void 0) || Ce[a][t]; o.attr(t, i); } }; for (var M in l) O(M); for (var g in (b ? (S[b] = w) : Object(c.mix)(S, w), v)) if (!d[g]) { var k = v[g]; (Object(c.isPlainObject)(k) && !Me.includes(g)) || (b ? (Object(c.mix)(m[b], (((i = {})[g] = k), i)), delete m[g]) : Object(c.mix)(m, (((r = {})[g] = k), r)), delete v[g]); } var C = {}; Object(c.deepMix)(C, m, S, v); var E = !1, j = function (t) { var e, n, r = C[t]; if (Object(c.isPlainObject)(r) && !Me.includes(t)) { var i = f.find(function (e) { return e.get("name") === t; }); i && (t === b && ("combo" === a && (delete r.r, delete r.width, delete r.height), (E = !0)), i.attr(r)); } else if (!E) { var s = r || Ce[a][t]; "combo" === a ? b || o.attr((((e = {})[t] = s), e)) : o.attr((((n = {})[t] = s), n)); } }; for (var P in C) j(P); } } } }, getStateStyle: function (t, e) { var n = e.getModel(), r = e.getType(), i = this.getOptions(n), o = i.stateStyles, a = i.style, s = void 0 === a ? {} : a, u = n.stateStyles ? n.stateStyles[t] : o && o[t]; return "combo" === r ? Object(c.clone)(u) : Object(c.mix)({}, s, u); }, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { return this.getOptions(t).anchorPoints; }, }, je = { itemType: "node", shapeType: "single-node", labelPosition: "center", offset: nt.nodeLabel.offset, getSize: function (t) { var e = t.size || this.getOptions({}).size || nt.defaultNode.size; return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition; if ("center" === n) return { x: 0, y: 0, text: t.label }; var r = e.offset; Object(c.isNil)(r) && (r = this.offset); var i, o = this.getSize(t), a = o[0], s = o[1]; switch (n) { case "top": i = { x: 0, y: 0 - s / 2 - r, textBaseline: "bottom" }; break; case "bottom": i = { x: 0, y: s / 2 + r, textBaseline: "top" }; break; case "left": i = { x: 0 - a / 2 - r, y: 0, textAlign: "right" }; break; default: i = { x: a / 2 + r, y: 0, textAlign: "left" }; } return (i.text = t.label), i; }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = Et(o.padding), u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.offset; return ( Object(c.isNil)(l) && (l = this.offset), (a = { x: i.minX - s[3], y: i.minY - s[0] }), (a = Object(f.a)(Object(f.a)(Object(f.a)({}, a), o), { width: u, height: h, })) ); }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "node-shape", }); }, updateLinkPoints: function (t, e) { var n, r = this.getOptions(t).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), a = e.find(function (t) { return "link-point-top" === t.get("className"); }), s = e.find(function (t) { return "link-point-bottom" === t.get("className"); }); i && (n = i.attr()), o && !n && (n = o.attr()), a && !n && (n = a.attr()), s && !n && (n = s.attr()), n || (n = r); var u = Object(c.mix)({}, n, t.linkPoints), h = u.fill, l = u.stroke, d = u.lineWidth, p = u.size / 2; p || (p = u.r); var g = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0 }, v = g.left, y = g.right, m = g.top, b = g.bottom, x = this.getSize(t), w = x[0], S = x[1], O = { r: p, fill: h, stroke: l, lineWidth: d }; i ? v || void 0 === v ? i.attr(Object(f.a)(Object(f.a)({}, O), { x: -w / 2, y: 0 })) : i.remove() : v && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: -w / 2, y: 0 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), o ? (y || void 0 === y || o.remove(), o.attr(Object(f.a)(Object(f.a)({}, O), { x: w / 2, y: 0 }))) : y && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: w / 2, y: 0 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a ? (m || void 0 === m || a.remove(), a.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: -S / 2 }))) : m && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: -S / 2 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), s ? b || void 0 === b ? s.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: S / 2 })) : s.remove() : b && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: S / 2 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, updateShape: function (t, e, n, r) { e.get("keyShape").attr(Object(f.a)({}, n)), this.updateLabel(t, e), r && this.updateIcon(t, e); }, updateIcon: function (t, e) { var n = this, r = e.getContainer(), i = this.getOptions(t).icon, o = (t.icon ? t.icon : { show: void 0 }).show, a = r.find(function (t) { return t.get("className") === "".concat(n.type, "-icon"); }); if (a) if (o || void 0 === o) { var s = Object(c.mix)({}, a.attr(), i), u = s.width, h = s.height; a.attr( Object(f.a)(Object(f.a)({}, s), { x: -u / 2, y: -h / 2 }), ); } else a.remove(); else if (o) { (u = i.width), (h = i.height); r.addShape("image", { attrs: Object(f.a)(Object(f.a)({}, i), { x: -u / 2, y: -h / 2, }), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), }); var l = r.find(function (t) { return "node-label" === t.get("className"); }); l && l.toFront(); } }, }, Pe = Object(f.a)(Object(f.a)({}, Ee), je); Wt.registerNode("single-node", Pe); var Ae = { itemType: "edge", labelPosition: "center", refX: 0, refY: 0, labelAutoRotate: !1, options: { size: nt.defaultEdge.size, style: { x: 0, y: 0, stroke: nt.defaultEdge.style.stroke, lineAppendWidth: nt.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: nt.edgeLabel.style.fill, fontSize: nt.edgeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.edgeStateStyles), }, getPath: function (t) { var e = []; return ( Object(c.each)(t, function (t, n) { 0 === n ? e.push(["M", t.x, t.y]) : e.push(["L", t.x, t.y]); }), e ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n, t.style), i = t.size || nt.defaultEdge.size, o = (t = this.getPathPoints(t)).startPoint, a = t.endPoint, s = this.getControlPoints(t), u = [o]; s && (u = u.concat(s)), u.push(a); var h = this.getPath(u); return Object(c.mix)( {}, nt.defaultEdge.style, { stroke: nt.defaultEdge.color, lineWidth: i, path: h }, r, ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, a = (t = this.getPathPoints(t)).startPoint, s = t.endPoint, u = this.getControlPoints(t), h = [a]; u && (h = h.concat(u)), h.push(s); var l = i.attr(), f = Object(c.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = { radius: f.radius }; u || (g = { source: d, target: p, offset: f.offset, radius: f.radius, }), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var v = this.getPath(h, g), y = Object(c.mix)( r, i.attr(), { lineWidth: o, path: v }, t.style, ); i && i.attr(y); }, getLabelStyleByPosition: function (t, e, n) { var r, i = e.position || this.labelPosition, o = {}, a = n && n.find(function (t) { return "edge-shape" === t.get("className"); }); r = "start" === i ? 0 : "end" === i ? 1 : 0.5; var s, u = e.refX || this.refX, h = e.refY || this.refY; if ( t.startPoint.x === t.endPoint.x && t.startPoint.y === t.endPoint.y ) return ( (o.x = t.startPoint.x + u), (o.y = t.startPoint.y + h), (o.text = t.label), o ); s = Object(c.isNil)(e.autoRotate) ? this.labelAutoRotate : e.autoRotate; var l = lt(a, r, u, h, s); return ( (o.x = l.x), (o.y = l.y), (o.rotate = l.rotate), (o.textAlign = this._getTextAlign(i, l.angle)), (o.text = t.label), o ); }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = o.padding, u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.position || this.labelPosition, d = Object(f.a)(Object(f.a)({}, o), { width: u, height: h, x: i.minX - s[2], y: i.minY - s[0], rotate: 0, }); a = Object(c.isNil)(n.autoRotate) ? this.labelAutoRotate : n.autoRotate; var p, g = r && r.find(function (t) { return "edge-shape" === t.get("className"); }); p = "start" === l ? 0 : "end" === l ? 1 : 0.5; var v = n.refX || this.refX, y = n.refY || this.refY; if ( e.startPoint.x === e.endPoint.x && e.startPoint.y === e.endPoint.y ) return ( (d.x = e.startPoint.x + v - u / 2), (d.y = e.startPoint.y + y - h / 2), d ); var m = lt(g, p, v - u / 2, y + h / 2, a), b = m.angle; return ( b > 0.5 * Math.PI && b < 1.5 * Math.PI && (m = lt(g, p, v + u / 2, y + h / 2, a)), a && ((d.x = m.x), (d.y = m.y)), (d.rotate = m.rotate), d ); }, _getTextAlign: function (t, e) { var n = "center"; return e ? ((e %= 2 * Math.PI), "center" !== t && (n = (e >= 0 && e <= Math.PI / 2) || (e >= 1.5 * Math.PI && e < 2 * Math.PI) ? t : (function (t) { var e = t; return ( "start" === t ? (e = "end") : "end" === t && (e = "start"), e ); })(t)), n) : t; }, getControlPoints: function (t) { return t.controlPoints; }, getPathPoints: function (t) { return t; }, drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }); }, drawLabel: function (t, e) { var n, r = this.options.labelCfg; n = ("undefined" != typeof window && void 0 !== window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif"; var i = Object(c.deepMix)({ fontFamily: n }, r, t.labelCfg), o = this.getLabelStyle(t, i, e), a = o.rotate; delete o.rotate; var s = e.addShape("text", { attrs: o, name: "text-shape" }); if ((a && s.rotateAtStart(a), o.background)) { var u = this.drawLabelBg(t, e, s), h = this.itemType + "-label-bg"; u.set("classname", h), s.toFront(); } return s; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.deepMix)({}, r, t.labelCfg), o = this.getLabelStyle(t, i, e).rotate, a = this.getLabelBgStyleByPosition(n, t, i, e); delete a.rotate; var s = e.addShape("rect", { name: "text-bg-shape", attrs: a }); return o && s.rotateAtStart(o), s; }, }, Ie = Object(f.a)(Object(f.a)({}, Ee), Ae); Wt.registerEdge("single-edge", Ie), Wt.registerEdge( "line", { getControlPoints: function () {} }, "single-edge", ), Wt.registerEdge( "spline", { getPath: function (t) { return te(t); }, }, "single-edge", ), Wt.registerEdge( "arc", { curveOffset: 20, clockwise: 1, getControlPoints: function (t) { var e, n, r = t.startPoint, i = t.endPoint, o = (r.x + i.x) / 2, a = (r.y + i.y) / 2; if (void 0 !== t.controlPoints) { if ( ((n = t.controlPoints[0]), (e = C(r, n, i)), r.x <= i.x && r.y > i.y ? (this.clockwise = e.x > n.x ? 0 : 1) : r.x <= i.x && r.y < i.y ? (this.clockwise = e.x > n.x ? 1 : 0) : r.x > i.x && r.y <= i.y ? (this.clockwise = e.y < n.y ? 0 : 1) : (this.clockwise = e.y < n.y ? 1 : 0), (n.x - r.x) / (n.y - r.y) == (i.x - r.x) / (i.y - r.y)) ) return []; } else { void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), Object(c.isArray)(t.curveOffset) && (t.curveOffset = t.curveOffset[0]), t.curveOffset < 0 ? (this.clockwise = 0) : (this.clockwise = 1); var s = { x: i.x - r.x, y: i.y - r.y }, u = Math.atan2(s.y, s.x); (n = { x: t.curveOffset * Math.cos(-Math.PI / 2 + u) + o, y: t.curveOffset * Math.sin(-Math.PI / 2 + u) + a, }), (e = C(r, n, i)); } var h = E(r, e); return [{ x: h, y: h }]; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), 2 === t.length ? e.push(["L", t[1].x, t[1].y]) : e.push([ "A", t[1].x, t[1].y, 0, 0, this.clockwise, t[2].x, t[2].y, ]), e ); }, }, "single-edge", ), Wt.registerEdge( "quadratic", { curvePosition: 0.5, curveOffset: -20, getControlPoints: function (t) { var e = t.controlPoints; if (!e || !e.length) { var n = t.startPoint, r = t.endPoint; void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isArray)(this.curveOffset) && (t.curveOffset = t.curveOffset[0]), Object(c.isArray)(this.curvePosition) && (t.curvePosition = t.curveOffset[0]), (e = [ee(n, r, t.curvePosition, t.curveOffset)]); } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["Q", t[1].x, t[1].y, t[2].x, t[2].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic", { curvePosition: [0.5, 0.5], curveOffset: [-20, 20], getControlPoints: function (t) { var e = t.controlPoints; if ( (void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]), !e || !e.length || e.length < 2) ) { var n = t.startPoint, r = t.endPoint; e = [ ee(n, r, t.curvePosition[0], t.curveOffset[0]), ee(n, r, t.curvePosition[1], t.curveOffset[1]), ]; } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["C", t[1].x, t[1].y, t[2].x, t[2].y, t[3].x, t[3].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic-vertical", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.y - e.y, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x, y: e.y + r * this.curvePosition[0] + i[0] }, { x: n.x, y: n.y - r * this.curvePosition[1] + i[1] }, ] ); }, }, "cubic", ), Wt.registerEdge( "cubic-horizontal", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.x - e.x, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x + r * this.curvePosition[0] + i[0], y: e.y }, { x: n.x - r * this.curvePosition[1] + i[1], y: n.y }, ] ); }, }, "cubic", ), Wt.registerEdge( "loop", { getPathPoints: function (t) { return ht(t); }, getControlPoints: function (t) { return t.controlPoints; }, afterDraw: function (t) { t.controlPoints = void 0; }, afterUpdate: function (t) { t.controlPoints = void 0; }, }, "cubic", ); var Te = { itemType: "combo", shapeType: "single-combo", labelPosition: "top", refX: nt.comboLabel.refX, refY: nt.comboLabel.refY, options: { style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, getSize: function (t) { var e = Object(c.clone)( t.size || this.options.size || nt.defaultCombo.size, ); return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isArray)(i) && (i = i[0]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = this.getSize(t), h = (Math.max(r.r, u[0] / 2) || u[0] / 2) + i; switch (n) { case "top": s = { x: 0, y: -h - a, textBaseline: "bottom", textAlign: "center", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: -h + o, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: h + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "combo-shape", }); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, Ne = Object(f.a)(Object(f.a)({}, Ee), Te); Wt.registerCombo("single-combo", Ne), Wt.registerCombo( "circle", { options: { size: [nt.defaultCombo.size[0], nt.defaultCombo.size[0]], padding: nt.defaultCombo.padding[0], animate: !0, style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, refX: 0, refY: 0, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "circle", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( delete n.height, delete n.width, e.addShape("circle", { attrs: n, className: "circle-combo", name: "circle-combo", draggable: !0, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isArray)(n) && (n = n[0]); var r, i = { stroke: t.color }, o = Object(c.mix)({}, e, i, t.style); if (t.fixSize) r = Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0]; else { var a = this.getSize(t); r = !Object(c.isNumber)(o.r) || isNaN(o.r) ? a[0] / 2 || nt.defaultCombo.style.r : Math.max(o.r, a[0] / 2) || a[0] / 2; } o.r = r + n; var s = Object(f.a)({ x: 0, y: 0 }, o); return t.style ? (t.style.r = r) : (t.style = { r: r }), s; }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isArray)(r) && (r = r[0]); var i, o = Object(c.clone)(t.style); (i = t.fixSize ? Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0] : Math.max(o.r, n[0] / 2) || n[0] / 2), (o.r = i + r); var a = e.get("sizeCache"); a && (a.r = o.r); var s = { stroke: t.color }, u = e.get("keyShape"), h = Object(c.mix)({}, u.attr(), s, o); t.style ? (t.style.r = i) : (t.style = { r: i }), this.updateShape(t, e, h, !0); }, }, "single-combo", ), Wt.registerCombo( "rect", { options: { size: [40, 5], padding: [25, 20, 15, 20], animate: !0, style: { radius: 0, stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "rect", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "rect-combo", name: "rect-combo", draggable: !0, }); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isNumber)(i) && (i = [i, i, i, i]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = r.width / 2 + i[3], h = r.height / 2 + i[0]; switch (n) { case "top": s = { x: 0 - u + o, y: 0 - h + a, textBaseline: "top", textAlign: "left", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: 0 - u + a, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: u + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isNumber)(n) && (n = [n, n, n, n]); var r, i, o = { stroke: t.color }, a = Object(c.mix)({}, e, o, t.style), s = this.getSize(t), u = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; u ? Object(c.isNumber)(u) ? ((r = u), (i = u)) : ((r = u[0]), (i = u[1])) : ((r = !Object(c.isNumber)(a.width) || isNaN(a.width) ? s[0] || nt.defaultCombo.style.width : Math.max(a.width, s[0]) || s[0]), (i = !Object(c.isNumber)(a.height) || isNaN(a.height) ? s[1] || nt.defaultCombo.style.height : Math.max(a.height, s[1]) || s[1])); var h = -r / 2 - n[3], l = -i / 2 - n[0]; (a.width = r + n[1] + n[3]), (a.height = i + n[0] + n[2]); var d = Object(f.a)({ x: h, y: l }, a); return ( t.style ? ((t.style.width = r), (t.style.height = i)) : (t.style = { width: r, height: i }), d ); }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isNumber)(r) && (r = [r, r, r, r]); var i, o, a = Object(c.clone)(t.style), s = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; s ? Object(c.isNumber)(s) ? ((i = s), (o = s)) : ((i = s[0]), (o = s[1])) : ((i = Math.max(a.width, n[0]) || n[0]), (o = Math.max(a.height, n[1]) || n[1])), (a.width = i + r[1] + r[3]), (a.height = o + r[0] + r[2]); var u = e.get("sizeCache"); u && ((u.width = a.width), (u.height = a.height)), (a.x = -i / 2 - r[3]), (a.y = -o / 2 - r[0]); var h = { stroke: t.color }, l = e.get("keyShape"), f = Object(c.mix)({}, l.attr(), h, a); t.style ? ((t.style.width = i), (t.style.height = o)) : (t.style = { width: i, height: o }), this.updateShape(t, e, f, !1); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, "single-combo", ), Wt.registerNode( "simple-circle", { options: { size: nt.defaultNode.size, style: { x: 0, y: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("circle", { attrs: n, className: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.deepMix)({}, e, n), i = this.getSize(t)[0] / 2; return Object(f.a)({ x: 0, y: 0, r: i }, r); }, update: function (t, e) { var n = this.getSize(t), r = { stroke: t.color, r: n[0] / 2 }, i = e.get("keyShape"), o = Object(c.deepMix)({}, i.attr(), r, t.style); this.updateShape(t, e, o, !0); }, }, "single-node", ), Wt.registerNode( "simple-rect", { options: { size: [100, 30], style: { radius: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n), i = this.getSize(t), o = r.width || i[0], a = r.height || i[1]; return Object(f.a)( { x: -o / 2, y: -a / 2, width: o, height: a }, r, ); }, update: function (t, e) { e.getContainer(); var n = this.getOptions({}).style, r = this.getSize(t), i = e.get("keyShape"); t.size || ((r[0] = i.attr("width") || n.width), (r[1] = i.attr("height") || n.height)); var o = { stroke: t.color, x: -r[0] / 2, y: -r[1] / 2, width: r[0], height: r[1], }, a = Object(c.mix)({}, n, i.attr(), o); (a = Object(c.mix)(a, t.style)), this.updateShape(t, e, a, !1); }, }, "single-node", ), Wt.registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: !1, type: "circle", r: 50, rx: 50, ry: 35, width: 50, height: 35, points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], x: 0, y: 0, }, }, shapeType: "image", labelPosition: "bottom", drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); delete r.fill; var i = e.addShape(n, { attrs: r, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawClip(t, i), i; }, drawClip: function (t, e) { var n = this.getOptions(t).clipCfg; if (n.show) { var r = n.type, i = n.x, o = n.y, a = n.style; if ("circle" === r) { var s = n.r; e.setClip({ type: "circle", attrs: Object(f.a)({ r: s, x: i, y: o }, a), }); } else if ("rect" === r) { var c = n.width, u = n.height, h = i - c / 2, l = o - u / 2; e.setClip({ type: "rect", attrs: Object(f.a)({ x: h, y: l, width: c, height: u }, a), }); } else if ("ellipse" === r) { var d = n.rx, p = n.ry; e.setClip({ type: "ellipse", attrs: Object(f.a)({ x: i, y: o, rx: d, ry: p }, a), }); } else if ("polygon" === r) { var g = n.points; e.setClip({ type: "polygon", attrs: Object(f.a)({ points: g }, a), }); } else if ("path" === r) { var v = n.path; e.setClip({ type: "path", attrs: Object(f.a)({ path: v }, a), }); } } }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = this.getSize(t), r = this.getOptions(t).img, i = n[0], o = n[1]; return ( e && ((i = e.width || n[0]), (o = e.height || n[1])), Object(f.a)( { x: -i / 2, y: -o / 2, width: i, height: o, img: r }, e, ) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = "".concat(this.itemType, "-shape"), i = n.find(function (t) { return t.get("className") === r; }) || e.getKeyShape(), o = this.getShapeStyle(t); i && i.attr(o); }, }, "single-node", ); var Be, Le = { triangle: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, " L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, vee: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 20), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, "\n L ") .concat(r + (2 * e) / 3, ",0 L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, circle: function (t, e) { return ( void 0 === t && (t = 5), void 0 === e && (e = 0), "M " .concat(2 * e, ", 0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * t, ",0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * -t, ",0") ); }, rect: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 10), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(t / 2, " \n L ") .concat(r, ",") .concat(t / 2, " Z"); }, diamond: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 \n L ") .concat(r + e / 2, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",0 \n L ") .concat(r + e / 2, ",") .concat(t / 2, " Z"); }, triangleRect: function (t, e, n, r, i, o) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 15), void 0 === r && (r = 3), void 0 === i && (i = 5), void 0 === o && (o = 0); var a = 2 * o, s = a + e + i; return "M " .concat(a, ",0 L ") .concat(a + e, ",-") .concat(t / 2, " L ") .concat(a + e, ",") .concat(t / 2, " Z\n M ") .concat(s, ", -") .concat(n / 2, "\n L ") .concat(s + r, " -") .concat(n / 2, "\n L ") .concat(s + r, " ") .concat(n / 2, "\n L ") .concat(s, " ") .concat(n / 2, "\n Z"); }, }, De = { collapse: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t + n - 4, e], ]; }, expand: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t - n + 2 * n - 4, e], ["M", t - n + n, e - n + 4], ["L", t, e + n - 4], ]; }, upTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e + i], ["L", t + r, e + i], ["L", t, e - n], ["Z"], ]; }, downTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e - i], ["L", t + r, e - i], ["L", t, e + n], ["Z"], ]; }, }, _e = Wt, Re = [ "#5F95FF", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4", ], Fe = g.a.transform, Ye = Object(f.a)( Object(f.a)( Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({}, o), i), a), r), s, ), { transform: Fe, mat3: g.b }, ), Xe = (function () { function t(t) { (this.graph = t), (this.layoutCfg = t.get("layout") || {}), (this.layoutType = this.getLayoutType()), (this.layoutMethods = []), this.initLayout(); } return ( (t.prototype.initLayout = function () {}), (t.prototype.getLayoutType = function () { return this.getLayoutCfgType(this.layoutCfg); }), (t.prototype.getLayoutCfgType = function (t) { var e = t.type; if (e) return e; var n = t.pipes; return Array.isArray(n) ? n.map(function (t) { return (null == t ? void 0 : t.type) || ""; }) : null; }), (t.prototype.isLayoutTypeSame = function (t) { var e = this.getLayoutCfgType(t); return Array.isArray(this.layoutType) ? this.layoutType.every(function (t, n) { return t === e[n]; }) : (null == t ? void 0 : t.type) === this.layoutType; }), (t.prototype.refreshLayout = function () { var t = this.graph; t && (t.get("animate") ? t.positionsAnimate() : t.refreshPositions()); }), (t.prototype.changeLayout = function (t) { (this.layoutCfg = t), this.destoryLayoutMethods(), this.layout(); }), (t.prototype.changeData = function () { this.destoryLayoutMethods(), this.layout(); }), (t.prototype.destoryLayoutMethods = function () { var t = this.layoutMethods; null == t || t.forEach(function (t) { t.destroy(); }), (this.layoutMethods = []); }), (t.prototype.destroyLayout = function () { var t = this.graph; this.destoryLayoutMethods(), t.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0); }), (t.prototype.setDataFromGraph = function () { for ( var t = [], e = [], n = [], r = [], i = [], o = [], a = this.graph.getNodes(), s = this.graph.getEdges(), c = this.graph.getCombos(), u = a.length, h = 0; h < u; h++ ) { var l = a[h]; if (l && !l.destroyed) { var f = l.getModel(); l.isVisible() ? t.push(f) : e.push(f); } } var d = s.length; for (h = 0; h < d; h++) { var p = s[h]; if (p && !p.destroyed) { f = p.getModel(); p.isVisible() ? f.isComboEdge ? i.push(f) : n.push(f) : r.push(f); } } var g = c.length; for (h = 0; h < g; h++) { var v = c[h]; if (!v.destroyed) { f = v.getModel(); v.isVisible() ? o.push(f) : r.push(f); } } return { nodes: t, hiddenNodes: e, edges: n, hiddenEdges: r, combos: o, hiddenCombos: [], comboEdges: i, }; }), (t.prototype.reLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; (e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), t.init(n.data), "force" === a && ((t.ticking = !1), t.forceSimulation.stop()), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (t.prototype.relayout = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = this.layoutCfg; if (t) { this.data = this.setDataFromGraph(); var o = this.data.nodes; if (!o) return !1; this.initPositions(i.center, o); } n.emit("beforelayout"); var a = Promise.resolve(); null == r || r.forEach(function (t, n) { var r = i[n]; a = a.then(function () { return e.reLayoutMethod(t, r); }); }), a .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("relayout failed", t); }); }), (t.prototype.filterLayoutData = function (t, e) { var n, r, i = t.nodes, o = t.edges, a = Object(f.e)(t, ["nodes", "edges"]); if (!i) return t; if ( ((n = Object(c.isFunction)(null == e ? void 0 : e.nodesFilter) ? e.nodesFilter : function () { return !0; }), Object(c.isFunction)(null == e ? void 0 : e.edgesFilter)) ) r = e.edgesFilter; else { var s = i.reduce(function (t, e) { return (t[e.id] = !0), t; }, {}); r = function (t) { return s[t.source] && s[t.target]; }; } return Object(f.a)({ nodes: i.filter(n), edges: o.filter(r) }, a); }), (t.prototype.getLayoutBBox = function (t) { var e = this.graph, n = Object(c.groupBy)(e.getNodes(), function (t) { return t.getModel().layoutOrder; }), r = Object.values(n).map(function (t) { var e = It(t); return (e.size = [e.width, e.height]), e; }); return { groupNodes: Object.values(Object(c.groupBy)(t, "layoutOrder")), layoutNodes: r, }; }), (t.prototype.layoutAnimate = function () {}), (t.prototype.moveToZero = function () { var t = this.graph.get("data").nodes; if (void 0 !== t[0].x && null !== t[0].x && !At(t[0].x)) { for (var e = [0, 0], n = t.length, r = 0; r < n; r++) { var i = t[r]; (e[0] += i.x), (e[1] += i.y); } (e[0] /= t.length), (e[1] /= t.length); for (r = 0; r < n; r++) { ((i = t[r]).x -= e[0]), (i.y -= e[1]); } } }), (t.prototype.initPositions = function (t, e) { var n = this.graph; if (!e) return !1; var r = e ? e.length : 0; if (r) { var i = 0.85 * n.get("width"), o = 0.85 * n.get("height"), a = Math.ceil(Math.sqrt(r) * (i / o)), s = i / (a - 1), c = o / (Math.ceil(r / a) - 1); (isFinite(s) && s) || (s = 0), (isFinite(c) && s) || (c = 0); for ( var u = t[0] - i / 2, h = t[1] - o / 2, l = !0, f = 0; f < r; f++ ) { var d = e[f]; At(d.x) && ((l = !1), (d.x = (f % a) * s + u)), At(d.y) && ((l = !1), (d.y = Math.floor(f / a) * c + h)); } return l; } }), (t.prototype.destroy = function () { (this.graph = null), this.destoryLayoutMethods(), (this.destroyed = !0); }), (t.prototype.onTick = function (t) { var e; null === (e = this.layoutMethods) || void 0 === e || e.forEach(function (e) { var n; null === (n = null == e ? void 0 : e.onTick) || void 0 === n || n.call(e, t); }); }), t ); })(), ze = function (t) { (this.graph = t), (this.destroyed = !1), this.initEvents(); }; !(function (t) { (t.CLICK = "click"), (t.DBLCLICK = "dblclick"), (t.TAP = "tap"), (t.DBLTAP = "dbltap"), (t.DRAGSTART = "dragstart"), (t.DRAGEND = "dragend"), (t.DRAG = "drag"), (t.DRAGENTER = "dragenter"), (t.DRAGLEAVE = "dragleave"), (t.DRAGOVER = "dragover"), (t.DRAGOUT = "dragout"), (t.DDROP = "drop"), (t.PINCHSTART = "pinchstart"), (t.PINCHMOVE = "pinchmove"), (t.PANSTART = "panstart"), (t.PANMOVE = "panmove"), (t.PANEND = "panend"), (t.PRESS = "press"), (t.ACTION_END = "actionend"), (t.TOUCHSTART = "touchstart"), (t.TOUCHMOVE = "touchmove"), (t.TOUCHEND = "touchend"), (t.CANVAS_TOUCHSTART = "canvas:touchstart"), (t.CANVAS_TOUCHMOVE = "canvas:touchmove"), (t.CANVAS_TOUCHEND = "canvas:touchend"), (t.NODE_TOUCHSTART = "node:touchstart"), (t.NODE_TOUCHMOVE = "node:touchmove"), (t.NODE_TOUCHEND = "node:touchend"), (t.COMBO_TOUCHSTART = "combo:touchstart"), (t.COMBO_TOUCHMOVE = "combo:touchmove"), (t.COMBO_TOUCHEND = "combo:touchend"), (t.EDGE_TOUCHSTART = "edge:touchstart"), (t.EDGE_TOUCHMOVE = "edge:touchmove"), (t.EDGE_TOUCHEND = "edge:touchend"), (t.NODE_CLICK = "node:click"), (t.NODE_DBLCLICK = "node:dblclick"), (t.NODE_DROP = "node:drop"), (t.NODE_DRAGOVER = "node:dragover"), (t.NODE_DRAGENTER = "node:dragenter"), (t.NODE_DRAGLEAVE = "node:dragleave"), (t.NODE_DRAGSTART = "node:dragstart"), (t.NODE_DRAG = "node:drag"), (t.NODE_DRAGEND = "node:dragend"), (t.NODE_TAP = "node:tap"), (t.NODE_DBLTAP = "node:dbltap"), (t.NODE_PANSTART = "node:panstart"), (t.NODE_PANMOVE = "node:panmove"), (t.NODE_PANEND = "node:panend"), (t.NODE_PRESS = "node:press"), (t.COMBO_CLICK = "combo:click"), (t.COMBO_DBLCLICK = "combo:dblclick"), (t.COMBO_DROP = "combo:drop"), (t.COMBO_DRAGOVER = "combo:dragover"), (t.COMBO_DRAGENTER = "combo:dragenter"), (t.COMBO_DRAGLEAVE = "combo:dragleave"), (t.COMBO_DRAGSTART = "combo:dragstart"), (t.COMBO_DRAG = "combo:drag"), (t.COMBO_DRAGEND = "combo:dragend"), (t.COMBO_TAP = "combo:tap"), (t.COMBO_DBLTAP = "combo:dbltap"), (t.COMBO_PANSTART = "combo:panstart"), (t.COMBO_PANMOVE = "combo:panmove"), (t.COMBO_PANEND = "combo:panend"), (t.COMBO_PRESS = "combo:press"), (t.EDGE_CLICK = "edge:click"), (t.EDGE_DBLCLICK = "edge:dblclick"), (t.EDGE_DROP = "edge:drop"), (t.EDGE_DRAGOVER = "edge:dragover"), (t.EDGE_DRAGENTER = "edge:dragenter"), (t.EDGE_DRAGLEAVE = "edge:dragleave"), (t.EDGE_TAP = "edge:tap"), (t.EDGE_DBLTAP = "edge:dbltap"), (t.EDGE_PRESS = "edge:press"), (t.CANVAS_CLICK = "canvas:click"), (t.CANVAS_DBLCLICK = "canvas:dblclick"), (t.CANVAS_DROP = "canvas:drop"), (t.CANVAS_DRAGENTER = "canvas:dragenter"), (t.CANVAS_DRAGLEAVE = "canvas:dragleave"), (t.CANVAS_DRAGSTART = "canvas:dragstart"), (t.CANVAS_DRAG = "canvas:drag"), (t.CANVAS_DRAGEND = "canvas:dragend"), (t.CANVAS_TAP = "canvas:tap"), (t.CANVAS_DBLTAP = "canvas:dbltap"), (t.CANVAS_PANSTART = "canvas:panstart"), (t.CANVAS_PANMOVE = "canvas:panmove"), (t.CANVAS_PANEND = "canvas:panend"), (t.CANVAS_PRESS = "canvas:press"), (t.BEFORERENDER = "beforerender"), (t.AFTERRENDER = "afterrender"), (t.BEFOREADDITEM = "beforeadditem"), (t.AFTERADDITEM = "afteradditem"), (t.BEFOREREMOVEITEM = "beforeremoveitem"), (t.AFTERREMOVEITEM = "afterremoveitem"), (t.BEFOREUPDATEITEM = "beforeupdateitem"), (t.AFTERUPDATEITEM = "afterupdateitem"), (t.BEFOREITEMVISIBILITYCHANGE = "beforeitemvisibilitychange"), (t.AFTERITEMVISIBILITYCHANGE = "afteritemvisibilitychange"), (t.BEFOREITEMSTATECHANGE = "beforeitemstatechange"), (t.AFTERITEMSTATECHANGE = "afteritemstatechange"), (t.BEFOREITEMREFRESH = "beforeitemrefresh"), (t.AFTERITEMREFRESH = "afteritemrefresh"), (t.BEFOREITEMSTATESCLEAR = "beforeitemstatesclear"), (t.AFTERITEMSTATESCLEAR = "afteritemstatesclear"), (t.BEFOREMODECHANGE = "beforemodechange"), (t.AFTERMODECHANGE = "aftermodechange"), (t.BEFORELAYOUT = "beforelayout"), (t.AFTERLAYOUT = "afterlayout"), (t.BEFORECREATEEDGE = "beforecreateedge"), (t.AFTERCREATEEDGE = "aftercreateedge"), (t.BEFOREGRAPHREFRESHPOSITION = "beforegraphrefreshposition"), (t.AFTERGRAPHREFRESHPOSITION = "aftergraphrefreshposition"), (t.BEFOREGRAPHREFRESH = "beforegraphrefresh"), (t.AFTERGRAPHREFRESH = "aftergraphrefresh"), (t.BEFOREANIMATE = "beforeanimate"), (t.AFTERANIMATE = "afteranimate"), (t.BEFOREPAINT = "beforepaint"), (t.AFTERPAINT = "afterpaint"), (t.BEFORECOLLAPSEEXPANDCOMBO = "beforecollapseexpandcombo"), (t.AFTERCOLLAPSEEXPANDCOMBO = "aftercollapseexpandcombo"), (t.GRAPHSTATECHANGE = "graphstatechange"), (t.AFTERACTIVATERELATIONS = "afteractivaterelations"), (t.NODESELECTCHANGE = "nodeselectchange"), (t.TOOLTIPCHANGE = "tooltipchange"), (t.WHEELZOOM = "wheelzoom"), (t.VIEWPORTCHANGE = "viewportchange"), (t.DRAGNODEEND = "dragnodeend"), (t.STACKCHANGE = "stackchange"); })(Be || (Be = {})); var We = _e.registerNode, qe = _e.registerEdge, Ve = _e.registerCombo, Ge = l.registerBehavior, He = nt; _e.registerNode, _e.registerEdge, _e.registerCombo, l.registerBehavior; }, 22: function (t, e, n) { "use strict"; n.d(e, "a", function () { return c; }), n.d(e, "b", function () { return f; }), n.d(e, "c", function () { return g; }), n.d(e, "d", function () { return S; }); var r = n(0), i = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi, o = /[^\s\,]+/gi; var a = function (t) { var e = t || []; return Object(r.isArray)(e) ? e : Object(r.isString)(e) ? ((e = e.match(i)), Object(r.each)(e, function (t, n) { if ((t = t.match(o))[0].length > 1) { var i = t[0].charAt(0); t.splice(1, 0, t[0].substr(1)), (t[0] = i); } Object(r.each)(t, function (e, n) { isNaN(e) || (t[n] = +e); }), (e[n] = t); }), e) : void 0; }, s = n(4); var c = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = [ [0, 0], [1, 1], ]); for (var r = !!e, i = [], o = 0, a = t.length; o < a; o += 2) i.push([t[o], t[o + 1]]); var c, u, h, l = (function (t, e, n, r) { var i, o, a, c, u, h, l, f = [], d = !!r; if (d) { (a = r[0]), (c = r[1]); for (var p = 0, g = t.length; p < g; p += 1) { var v = t[p]; (a = s.b.min([0, 0], a, v)), (c = s.b.max([0, 0], c, v)); } } p = 0; for (var y = t.length; p < y; p += 1) { v = t[p]; if (0 !== p || n) if (p !== y - 1 || n) { (i = t[[p ? p - 1 : y - 1, p - 1][n ? 0 : 1]]), (o = t[n ? (p + 1) % y : p + 1]); var m = [0, 0]; (m = s.b.sub(m, o, i)), (m = s.b.scale(m, m, e)); var b = s.b.distance(v, i), x = s.b.distance(v, o), w = b + x; 0 !== w && ((b /= w), (x /= w)); var S = s.b.scale([0, 0], m, -b), O = s.b.scale([0, 0], m, x); (h = s.b.add([0, 0], v, S)), (u = s.b.add([0, 0], v, O)), (u = s.b.min([0, 0], u, s.b.max([0, 0], o, v))), (u = s.b.max([0, 0], u, s.b.min([0, 0], o, v))), (S = s.b.sub([0, 0], u, v)), (S = s.b.scale([0, 0], S, -b / x)), (h = s.b.add([0, 0], v, S)), (h = s.b.min([0, 0], h, s.b.max([0, 0], i, v))), (h = s.b.max([0, 0], h, s.b.min([0, 0], i, v))), (O = s.b.sub([0, 0], v, h)), (O = s.b.scale([0, 0], O, x / b)), (u = s.b.add([0, 0], v, O)), d && ((h = s.b.max([0, 0], h, a)), (h = s.b.min([0, 0], h, c)), (u = s.b.max([0, 0], u, a)), (u = s.b.min([0, 0], u, c))), f.push(l), f.push(h), (l = u); } else (h = v), f.push(l), f.push(h); else l = v; } return n && f.push(f.shift()), f; })(i, 0.4, r, n), f = i.length, d = []; for (o = 0; o < f - 1; o += 1) (c = l[2 * o]), (u = l[2 * o + 1]), (h = i[o + 1]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]]); return ( r && ((c = l[f]), (u = l[f + 1]), (h = i[0]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]])), d ); }; var u = "\t\n\v\f\r   ᠎              \u2028\u2029", h = new RegExp( "([a-z])[" + u + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + u + "]*,?[" + u + "]*)+)", "ig", ), l = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + u + "]*,?[" + u + "]*", "ig", ); function f(t) { if (!t) return null; if (Object(r.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(h, function (t, r, i) { var o = [], a = r.toLowerCase(); if ( (i.replace(l, function (t, e) { e && o.push(+e); }), "m" === a && o.length > 2 && (n.push([r].concat(o.splice(0, 2))), (a = "l"), (r = "m" === r ? "l" : "L")), "o" === a && 1 === o.length && n.push([r, o[0]]), "r" === a) ) n.push([r].concat(o)); else for ( ; o.length >= e[a] && (n.push([r].concat(o.splice(0, e[a]))), e[a]); ); return ""; }), n ); } var d = /[a-z]/; function p(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function g(t) { var e = f(t); if (!e || !e.length) return [["M", 0, 0]]; for (var n = !1, r = 0; r < e.length; r++) { var i = e[r][0]; if (d.test(i) || ["V", "H", "T", "S"].indexOf(i) >= 0) { n = !0; break; } } if (!n) return e; var o = [], a = 0, s = 0, c = 0, u = 0, h = 0, l = e[0]; ("M" !== l[0] && "m" !== l[0]) || ((c = a = +l[1]), (u = s = +l[2]), h++, (o[0] = ["M", a, s])); r = h; for (var g = e.length; r < g; r++) { var v = e[r], y = o[r - 1], m = [], b = (i = v[0]).toUpperCase(); if (i !== b) switch (((m[0] = b), b)) { case "A": (m[1] = v[1]), (m[2] = v[2]), (m[3] = v[3]), (m[4] = v[4]), (m[5] = v[5]), (m[6] = +v[6] + a), (m[7] = +v[7] + s); break; case "V": m[1] = +v[1] + s; break; case "H": m[1] = +v[1] + a; break; case "M": (c = +v[1] + a), (u = +v[2] + s), (m[1] = c), (m[2] = u); break; default: for (var x = 1, w = v.length; x < w; x++) m[x] = +v[x] + (x % 2 ? a : s); } else m = e[r]; switch (b) { case "Z": (a = +c), (s = +u); break; case "H": m = ["L", (a = m[1]), s]; break; case "V": m = ["L", a, (s = m[1])]; break; case "T": (a = m[1]), (s = m[2]); var S = p([y[1], y[2]], [y[3], y[4]]); m = ["Q", S[0], S[1], a, s]; break; case "S": (a = m[m.length - 2]), (s = m[m.length - 1]); var O = y.length, M = p([y[O - 4], y[O - 3]], [y[O - 2], y[O - 1]]); m = ["C", M[0], M[1], m[1], m[2], a, s]; break; case "M": (c = m[m.length - 2]), (u = m[m.length - 1]); break; default: (a = m[m.length - 2]), (s = m[m.length - 1]); } o.push(m); } return o; } Math.PI; function v(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function y(t, e) { return v(t) * v(e) ? (t[0] * e[0] + t[1] * e[1]) / (v(t) * v(e)) : 1; } function m(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(y(t, e)); } function b(t, e) { return t[0] === e[0] && t[1] === e[1]; } function x(t, e) { var n = e[1], i = e[2], o = Object(r.mod)(Object(r.toRadian)(e[3]), 2 * Math.PI), a = e[4], s = e[5], c = t[0], u = t[1], h = e[6], l = e[7], f = (Math.cos(o) * (c - h)) / 2 + (Math.sin(o) * (u - l)) / 2, d = (-1 * Math.sin(o) * (c - h)) / 2 + (Math.cos(o) * (u - l)) / 2, p = (f * f) / (n * n) + (d * d) / (i * i); p > 1 && ((n *= Math.sqrt(p)), (i *= Math.sqrt(p))); var g = n * n * (d * d) + i * i * (f * f), v = g ? Math.sqrt((n * n * (i * i) - g) / g) : 1; a === s && (v *= -1), isNaN(v) && (v = 0); var x = i ? (v * n * d) / i : 0, w = n ? (v * -i * f) / n : 0, S = (c + h) / 2 + Math.cos(o) * x - Math.sin(o) * w, O = (u + l) / 2 + Math.sin(o) * x + Math.cos(o) * w, M = [(f - x) / n, (d - w) / i], k = [(-1 * f - x) / n, (-1 * d - w) / i], C = m([1, 0], M), E = m(M, k); return ( y(M, k) <= -1 && (E = Math.PI), y(M, k) >= 1 && (E = 0), 0 === s && E > 0 && (E -= 2 * Math.PI), 1 === s && E < 0 && (E += 2 * Math.PI), { cx: S, cy: O, rx: b(t, [h, l]) ? 0 : n, ry: b(t, [h, l]) ? 0 : i, startAngle: C, endAngle: C + E, xRotation: o, arcFlag: a, sweepFlag: s, } ); } function w(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function S(t) { for ( var e = [], n = null, r = null, i = null, o = 0, s = (t = a(t)).length, c = 0; c < s; c++ ) { var u = t[c]; r = t[c + 1]; var h = u[0], l = { command: h, prePoint: n, params: u, startTangent: null, endTangent: null, }; switch (h) { case "M": (i = [u[1], u[2]]), (o = c); break; case "A": var f = x(n, u); l.arcParams = f; } if ("Z" === h) (n = i), (r = t[o + 1]); else { var d = u.length; n = [u[d - 2], u[d - 1]]; } r && "Z" === r[0] && ((r = t[o]), e[o] && (e[o].prePoint = n)), (l.currentPoint = n), e[o] && b(n, e[o].currentPoint) && (e[o].prePoint = l.prePoint); var p = r ? [r[r.length - 2], r[r.length - 1]] : null; l.nextPoint = p; var g = l.prePoint; if (["L", "H", "V"].includes(h)) (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]]); else if ("Q" === h) { var v = [u[1], u[2]]; (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]]); } else if ("T" === h) { v = w((S = e[c - 1]).currentPoint, g); "Q" === S.command ? ((l.command = "Q"), (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]])) : ((l.command = "TL"), (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]])); } else if ("C" === h) { var y = [u[1], u[2]], m = [u[3], u[4]]; (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]]), 0 === l.startTangent[0] && 0 === l.startTangent[1] && (l.startTangent = [y[0] - m[0], y[1] - m[1]]), 0 === l.endTangent[0] && 0 === l.endTangent[1] && (l.endTangent = [m[0] - y[0], m[1] - y[1]]); } else if ("S" === h) { var S; (y = w((S = e[c - 1]).currentPoint, g)), (m = [u[1], u[2]]); "C" === S.command ? ((l.command = "C"), (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])) : ((l.command = "SQ"), (l.startTangent = [g[0] - m[0], g[1] - m[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])); } else if ("A" === h) { var O = 0.001, M = l.arcParams || {}, k = M.cx, C = void 0 === k ? 0 : k, E = M.cy, j = void 0 === E ? 0 : E, P = M.rx, A = void 0 === P ? 0 : P, I = M.ry, T = void 0 === I ? 0 : I, N = M.sweepFlag, B = void 0 === N ? 0 : N, L = M.startAngle, D = void 0 === L ? 0 : L, _ = M.endAngle, R = void 0 === _ ? 0 : _; 0 === B && (O *= -1); var F = A * Math.cos(D - O) + C, Y = T * Math.sin(D - O) + j; l.startTangent = [F - i[0], Y - i[1]]; var X = A * Math.cos(D + R + O) + C, z = T * Math.sin(D + R - O) + j; l.endTangent = [g[0] - X, g[1] - z]; } e.push(l); } return e; } }, 26: function (t, e, n) { "use strict"; var r = n(78); n.d(e, "a", function () { return r.Layout; }), n.d(e, "b", function () { return r.Layouts; }); var i = n(51); n.d(e, "c", function () { return i.registerLayout; }), n.d(e, "d", function () { return i.unRegisterLayout; }); var o = n(52); Object(i.registerLayout)("random", o.RandomLayout); }, 27: function (t, e, n) { "use strict"; n.r(e), n.d(e, "getAdjMatrix", function () { return r; }), n.d(e, "breadthFirstSearch", function () { return l; }), n.d(e, "connectedComponent", function () { return d; }), n.d(e, "getDegree", function () { return g; }), n.d(e, "getInDegree", function () { return v; }), n.d(e, "getOutDegree", function () { return y; }), n.d(e, "detectCycle", function () { return S; }), n.d(e, "detectDirectedCycle", function () { return mt; }), n.d(e, "detectAllCycles", function () { return w; }), n.d(e, "detectAllDirectedCycle", function () { return x; }), n.d(e, "detectAllUndirectedCycle", function () { return b; }), n.d(e, "depthFirstSearch", function () { return m; }), n.d(e, "dijkstra", function () { return k; }), n.d(e, "findAllPath", function () { return P; }), n.d(e, "findShortestPath", function () { return j; }), n.d(e, "floydWarshall", function () { return A; }), n.d(e, "labelPropagation", function () { return I; }), n.d(e, "louvain", function () { return F; }), n.d(e, "iLouvain", function () { return Y; }), n.d(e, "kCore", function () { return X; }), n.d(e, "kMeans", function () { return W; }), n.d(e, "cosineSimilarity", function () { return q; }), n.d(e, "nodesCosineSimilarity", function () { return V; }), n.d(e, "minimumSpanningTree", function () { return $; }), n.d(e, "pageRank", function () { return Q; }), n.d(e, "getNeighbors", function () { return c; }), n.d(e, "Stack", function () { return yt; }), n.d(e, "GADDI", function () { return vt; }); var r = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (!a && 0 !== a) || (!s && 0 !== s) || ((i[a][s] = 1), e || (i[s][a] = 1)); }), i ); }, i = function (t, e) { return t === e; }, o = (function () { function t(t, e) { void 0 === e && (e = null), (this.value = t), (this.next = e); } return ( (t.prototype.toString = function (t) { return t ? t(this.value) : "".concat(this.value); }), t ); })(), a = (function () { function t(t) { void 0 === t && (t = i), (this.head = null), (this.tail = null), (this.compare = t); } return ( (t.prototype.prepend = function (t) { var e = new o(t, this.head); return (this.head = e), this.tail || (this.tail = e), this; }), (t.prototype.append = function (t) { var e = new o(t); return this.head ? ((this.tail.next = e), (this.tail = e), this) : ((this.head = e), (this.tail = e), this); }), (t.prototype.delete = function (t) { if (!this.head) return null; for ( var e = null; this.head && this.compare(this.head.value, t); ) (e = this.head), (this.head = this.head.next); var n = this.head; if (null !== n) for (; n.next; ) this.compare(n.next.value, t) ? ((e = n.next), (n.next = n.next.next)) : (n = n.next); return this.compare(this.tail.value, t) && (this.tail = n), e; }), (t.prototype.find = function (t) { var e = t.value, n = void 0 === e ? void 0 : e, r = t.callback, i = void 0 === r ? void 0 : r; if (!this.head) return null; for (var o = this.head; o; ) { if (i && i(o.value)) return o; if (void 0 !== n && this.compare(o.value, n)) return o; o = o.next; } return null; }), (t.prototype.deleteTail = function () { var t = this.tail; if (this.head === this.tail) return (this.head = null), (this.tail = null), t; for (var e = this.head; e.next; ) e.next.next ? (e = e.next) : (e.next = null); return (this.tail = e), t; }), (t.prototype.deleteHead = function () { if (!this.head) return null; var t = this.head; return ( this.head.next ? (this.head = this.head.next) : ((this.head = null), (this.tail = null)), t ); }), (t.prototype.fromArray = function (t) { var e = this; return ( t.forEach(function (t) { return e.append(t); }), this ); }), (t.prototype.toArray = function () { for (var t = [], e = this.head; e; ) t.push(e), (e = e.next); return t; }), (t.prototype.reverse = function () { for (var t = this.head, e = null, n = null; t; ) (n = t.next), (t.next = e), (e = t), (t = n); (this.tail = this.head), (this.head = e); }), (t.prototype.toString = function (t) { return ( void 0 === t && (t = void 0), this.toArray() .map(function (e) { return e.toString(t); }) .toString() ); }), t ); })(), s = (function () { function t() { this.linkedList = new a(); } return ( (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.peek = function () { return this.linkedList.head ? this.linkedList.head.value : null; }), (t.prototype.enqueue = function (t) { this.linkedList.append(t); }), (t.prototype.dequeue = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toString = function (t) { return this.linkedList.toString(t); }), t ); })(), c = function (t, e, n) { void 0 === e && (e = []); var r = e.filter(function (e) { return e.source === t || e.target === t; }); if ("target" === n) { return r .filter(function (e) { return e.source === t; }) .map(function (t) { return t.target; }); } if ("source" === n) { return r .filter(function (e) { return e.target === t; }) .map(function (t) { return t.source; }); } return r.map(function (e) { return e.source === t ? e.target : e.source; }); }, u = function (t, e) { return e.filter(function (e) { return e.source === t || e.target === t; }); }, h = function (t) { void 0 === t && (t = 0); var e = "".concat(Math.random()).split(".")[1].substr(0, 5), n = "".concat(Math.random()).split(".")[1].substr(0, 5); return "".concat(t, "-").concat(e).concat(n); }; var l = function (t, e, n, r) { void 0 === r && (r = !0); var i = (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), o = new s(), a = t.edges, u = void 0 === a ? [] : a; o.enqueue(e); for ( var h = "", l = function () { var t = o.dequeue(); i.enter({ current: t, previous: h }), c(t, u, r ? "target" : void 0).forEach(function (e) { i.allowTraversal({ previous: h, current: t, next: e }) && o.enqueue(e); }), i.leave({ current: t, previous: h }), (h = t); }; !o.isEmpty(); ) l(); }, f = function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = {}, u = {}, h = [], l = 0, f = function t(e) { (s[e.id] = l), (u[e.id] = l), (l += 1), o.push(e), (a[e.id] = !0); for ( var r = c(e.id, i, "target").filter(function (t) { return ( n .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }), f = function (i) { var o = r[i]; if (s[o] || 0 === s[o]) a[o] && (u[e.id] = Math.min(u[e.id], s[o])); else { var c = n.filter(function (t) { return t.id === o; }); c.length > 0 && t(c[0]), (u[e.id] = Math.min(u[e.id], u[o])); } }, d = 0; d < r.length; d++ ) f(d); if (u[e.id] === s[e.id]) { for (var p = []; o.length > 0; ) { var g = o.pop(); if (((a[g.id] = !1), p.push(g), g === e)) break; } p.length > 0 && h.push(p); } }, d = 0, p = n; d < p.length; d++ ) { var g = p[d]; s[g.id] || 0 === s[g.id] || f(g); } return h; }; function d(t, e) { return e ? f(t) : (function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = [], u = function t(e) { s.push(e), (a[e.id] = !0); for ( var r = c(e.id, i), o = function (e) { var i = r[e]; if (!a[i]) { var o = n.filter(function (t) { return t.id === i; }); o.length > 0 && t(o[0]); } }, u = 0; u < r.length; ++u ) o(u); }, h = 0; h < n.length; h++ ) { var l = n[h]; if (!a[l.id]) { u(l); for (var f = []; s.length > 0; ) f.push(s.pop()); o.push(f); } } return o; })(t); } var p = function (t) { var e = {}, n = t.nodes, r = void 0 === n ? [] : n, i = t.edges, o = void 0 === i ? [] : i; return ( r.forEach(function (t) { e[t.id] = { degree: 0, inDegree: 0, outDegree: 0 }; }), o.forEach(function (t) { e[t.source].degree++, e[t.source].outDegree++, e[t.target].degree++, e[t.target].inDegree++; }), e ); }, g = p, v = function (t, e) { return p(t)[e] ? p(t)[e].inDegree : 0; }, y = function (t, e) { return p(t)[e] ? p(t)[e].outDegree : 0; }; function m(t, e, n) { !(function t(e, n, r, i) { i.enter({ current: n, previous: r }); var o = e.edges; c(n, void 0 === o ? [] : o, "target").forEach(function (o) { i.allowTraversal({ previous: r, current: n, next: o }) && t(e, o, n, i); }), i.leave({ current: n, previous: r }); })( t, e, "", (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), ); } var b = function (t, e, n) { var r, i; void 0 === n && (n = !0); for (var o = [], a = 0, s = d(t, !1); a < s.length; a++) { var u = s[a]; if (u.length) for ( var h = u[0], l = h.id, f = [h], p = (((r = {})[l] = h), r), g = (((i = {})[l] = new Set()), i); f.length > 0; ) for ( var v = f.pop(), y = v.id, m = c(y, t.edges), b = function (r) { var i, a = m[r], s = t.nodes.find(function (t) { return t.id === a; }); if (a === y) o.push((((i = {})[a] = v), i)); else if ((a in g)) { if (!g[y].has(s)) { for ( var c = !0, u = [s, v], h = p[y]; g[a].size && !g[a].has(h) && (u.push(h), h !== p[h.id]); ) h = p[h.id]; if ( (u.push(h), e && n ? ((c = !1), u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !0)) : e && !n && u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !1), c) ) { for (var l = {}, d = 1; d < u.length; d += 1) l[u[d - 1].id] = u[d]; u.length && (l[u[u.length - 1].id] = u[0]), o.push(l); } g[a].add(v); } } else (p[a] = v), f.push(s), (g[a] = new Set([v])); }, x = 0; x < m.length; x += 1 ) b(x); } return o; }, x = function (t, e, n) { void 0 === n && (n = !0); for ( var r = [], i = new Set(), o = [], a = [], s = {}, u = {}, h = function t(c, u, h) { var l = !1; if (e && !1 === n && e.indexOf(c.id) > -1) return l; r.push(c), i.add(c); for (var f = h[c.id], d = 0; d < f.length; d += 1) { if ((v = s[f[d]]) === u) { for (var p = {}, g = 1; g < r.length; g += 1) p[r[g - 1].id] = r[g]; r.length && (p[r[r.length - 1].id] = r[0]), a.push(p), (l = !0); } else i.has(v) || (t(v, u, h) && (l = !0)); } if (l) !(function (t) { for (var e = [t]; e.length > 0; ) { var n = e.pop(); i.has(n) && (i.delete(n), o[n.id].forEach(function (t) { e.push(t); }), o[n.id].clear()); } })(c); else for (d = 0; d < f.length; d += 1) { var v = s[f[d]]; o[v.id].has(c) || o[v.id].add(c); } return r.pop(), l; }, l = t.nodes, d = void 0 === l ? [] : l, p = 0; p < d.length; p += 1 ) { var g = d[p], v = g.id; (u[v] = p), (s[p] = g); } if (e && n) { var y = function (t) { var n = e[t]; (u[d[t].id] = u[n]), (u[n] = 0), (s[0] = d.find(function (t) { return t.id === n; })), (s[u[d[t].id]] = d[t]); }; for (p = 0; p < e.length; p++) y(p); } for ( var m = function (r) { for (var i, o, s = 1 / 0, h = 0; h < r.length; h += 1) for (var l = r[h], f = 0; f < l.length; f++) { var d = u[l[f].id]; d < s && ((s = d), (o = h)); } var p = r[o], g = []; for (h = 0; h < p.length; h += 1) { var v = p[h]; g[v.id] = []; for ( var y = 0, m = c(v.id, t.edges, "target").filter(function (t) { return ( p .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }); y < m.length; y++ ) { var b = m[y]; b !== v.id || (!1 === n && e.indexOf(v.id) > -1) ? g[v.id].push(u[b]) : a.push((((i = {})[v.id] = v), i)); } } return { component: p, adjList: g, minIdx: s }; }, b = 0; b < d.length; ) { var x = d.filter(function (t) { return u[t.id] >= b; }), w = f({ nodes: x, edges: t.edges }).filter(function (t) { return t.length > 1; }); if (0 === w.length) break; var S = m(w), O = S.minIdx, M = S.adjList, k = S.component; if (!(k.length > 1)) break; k.forEach(function (t) { o[t.id] = new Set(); }); var C = s[O]; if (e && n && -1 === e.indexOf(C.id)) return a; h(C, C, M), (b = O + 1); } return a; }, w = function (t, e, n, r) { return void 0 === r && (r = !0), e ? x(t, n, r) : b(t, n, r); }, S = function (t) { var e = null, n = t.nodes, r = {}, i = {}, o = {}, a = {}; (void 0 === n ? [] : n).forEach(function (t) { i[t.id] = t; }); for ( var s = { enter: function (t) { var n = t.current, a = t.previous; if (o[n]) { e = {}; for (var s = n, c = a; c !== n; ) (e[s] = c), (s = c), (c = r[c]); e[s] = c; } else (o[n] = n), delete i[n], (r[n] = a); }, leave: function (t) { var e = t.current; (a[e] = e), delete o[e]; }, allowTraversal: function (t) { var n = t.next; return !e && !a[n]; }, }; Object.keys(i).length; ) { m(t, Object.keys(i)[0], s); } return e; }, O = n(1), M = n(0), k = function (t, e, n, r) { var i = t.nodes, o = void 0 === i ? [] : i, a = t.edges, s = void 0 === a ? [] : a, c = [], h = {}, l = {}, f = {}; o.forEach(function (t, n) { var r = t.id; c.push(r), (l[r] = 1 / 0), r === e && (l[r] = 0); }); for ( var d = o.length, p = function (t) { var e = (function (t, e, n) { for (var r, i = 1 / 0, o = 0; o < e.length; o++) { var a = e[o].id; !n[a] && t[a] <= i && ((i = t[a]), (r = e[o])); } return r; })(l, o, h), i = e.id; if (((h[i] = !0), l[i] === 1 / 0)) return "continue"; (n ? (function (t, e) { return e.filter(function (e) { return e.source === t; }); })(i, s) : u(i, s) ).forEach(function (t) { var n = t.target, o = t.source, a = n === i ? o : n, s = r && t[r] ? t[r] : 1; l[a] > l[e.id] + s ? ((l[a] = l[e.id] + s), (f[a] = [e.id])) : l[a] === l[e.id] + s && f[a].push(e.id); }); }, g = 0; g < d; g++ ) p(); f[e] = [e]; var v = {}; for (var y in l) l[y] !== 1 / 0 && C(e, y, f, v); var m = {}; for (var y in v) m[y] = v[y][0]; return { length: l, path: m, allPath: v }; }; function C(t, e, n, r) { if (t === e) return [t]; if (r[e]) return r[e]; for (var i = [], o = 0, a = n[e]; o < a.length; o++) { var s = C(t, a[o], n, r); if (!s) return; for (var c = 0, u = s; c < u.length; c++) { var h = u[c]; Object(M.isArray)(h) ? i.push(Object(O.f)(Object(O.f)([], h, !0), [e], !1)) : i.push([h, e]); } } return (r[e] = i), r[e]; } var E, j = function (t, e, n, r, i) { var o = k(t, e, r, i), a = o.length, s = o.path, c = o.allPath; return { length: a[n], path: s[n], allPath: c[n] }; }, P = function (t, e, n, r) { var i; if (e === n) return [[e]]; var o = t.edges, a = void 0 === o ? [] : o, s = [e], u = (((i = {})[e] = !0), i), h = [], l = [], f = r ? c(e, a, "target") : c(e, a); for (h.push(f); s.length > 0 && h.length > 0; ) { var d = h[h.length - 1]; if (d.length) { var p = d.shift(); if ( (p && (s.push(p), (u[p] = !0), (f = r ? c(p, a, "target") : c(p, a)), h.push( f.filter(function (t) { return !u[t]; }), )), s[s.length - 1] === n) ) { var g = s.map(function (t) { return t; }); l.push(g); v = s.pop(); (u[v] = !1), h.pop(); } } else { var v = s.pop(); (u[v] = !1), h.pop(); } } return l; }, A = function (t, e) { for (var n = r(t, e), i = [], o = n.length, a = 0; a < o; a += 1) { i[a] = []; for (var s = 0; s < o; s += 1) a === s ? (i[a][s] = 0) : 0 !== n[a][s] && n[a][s] ? (i[a][s] = n[a][s]) : (i[a][s] = 1 / 0); } for (var c = 0; c < o; c += 1) for (a = 0; a < o; a += 1) for (s = 0; s < o; s += 1) i[a][s] > i[a][c] + i[c][s] && (i[a][s] = i[a][c] + i[c][s]); return i; }, I = function (t, e, n, i) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e3); var o = t.nodes, a = void 0 === o ? [] : o, s = t.edges, c = void 0 === s ? [] : s, u = {}, l = {}; a.forEach(function (t, e) { var n = h(); (t.clusterId = n), (u[n] = { id: n, nodes: [t] }), (l[t.id] = { node: t, idx: e }); }); var f = r(t, e), d = [], p = {}; f.forEach(function (t, e) { var n = 0, r = a[e].id; (p[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = a[e].id; p[r][i] = t; } }), d.push(n); }); for ( var g = 0, v = function () { var t = !1; if ( (a.forEach(function (e) { var n = {}; Object.keys(p[e.id]).forEach(function (t) { var r = p[e.id][t], i = l[t].node.clusterId; n[i] || (n[i] = 0), (n[i] += r); }); var r = -1 / 0, i = []; if ( (Object.keys(n).forEach(function (t) { r < n[t] ? ((r = n[t]), (i = [t])) : r === n[t] && i.push(t); }), 1 !== i.length || i[0] !== e.clusterId) ) { var o = i.indexOf(e.clusterId); if ((o >= 0 && i.splice(o, 1), i && i.length)) { t = !0; var a = u[e.clusterId], s = a.nodes.indexOf(e); a.nodes.splice(s, 1); var c = Math.floor(Math.random() * i.length), h = u[i[c]]; h.nodes.push(e), (e.clusterId = h.id); } } }), !t) ) return "break"; g++; }; g < i; ) { if ("break" === v()) break; } Object.keys(u).forEach(function (t) { var e = u[t]; (e.nodes && e.nodes.length) || delete u[t]; }); var y = [], m = {}; c.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = l[e].node.clusterId, a = l[r].node.clusterId, s = "".concat(o, "---").concat(a); if (m[s]) (m[s].weight += i), m[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (m[s] = c), y.push(c); } }); var b = []; return ( Object.keys(u).forEach(function (t) { b.push(u[t]); }), { clusters: b, clusterEdges: y } ); }, T = (function () { function t(t) { this.arr = t; } return ( (t.prototype.getArr = function () { return this.arr || []; }), (t.prototype.add = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] + r[o]; return new t(i); } }), (t.prototype.subtract = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] - r[o]; return new t(i); } }), (t.prototype.avg = function (e) { var n = []; if (0 !== e) for (var r in this.arr) n[r] = this.arr[r] / e; return new t(n); }), (t.prototype.negate = function () { var e = []; for (var n in this.arr) e[n] = -this.arr[n]; return new t(e); }), (t.prototype.squareEuclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return r; } }), (t.prototype.euclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return Math.sqrt(r); } console.error("The two vectors are unequal in length."); }), (t.prototype.normalize = function () { var e = [], n = Object(M.clone)(this.arr); n.sort(function (t, e) { return t - e; }); var r = n[n.length - 1], i = n[0]; for (var o in this.arr) e[o] = (this.arr[o] - i) / (r - i); return new t(e); }), (t.prototype.norm2 = function () { var t; if ( !(null === (t = this.arr) || void 0 === t ? void 0 : t.length) ) return 0; var e = 0; for (var n in this.arr) e += Math.pow(this.arr[n], 2); return Math.sqrt(e); }), (t.prototype.dot = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += this.arr[i] * t.arr[i]; return r; } console.error("The two vectors are unequal in length."); }), (t.prototype.equal = function (t) { var e, n = t.arr; if ( (null === (e = this.arr) || void 0 === e ? void 0 : e.length) !== (null == n ? void 0 : n.length) ) return !1; for (var r in this.arr) if (this.arr[r] !== n[r]) return !1; return !0; }), t ); })(), N = function (t, e) { void 0 === e && (e = void 0); var n = []; return ( t.forEach(function (t) { void 0 === e && n.push(t), void 0 !== t[e] && n.push(t[e]); }), n ); }; !(function (t) { t.EuclideanDistance = "euclideanDistance"; })(E || (E = {})); var B = function (t, e, n) { var r = []; (null == e ? void 0 : e.length) ? (r = e) : (t.forEach(function (t) { r = r.concat(Object.keys(t)); }), (r = Object(M.uniq)(r))); var i = {}; return ( r.forEach(function (e) { var r = []; t.forEach(function (t) { void 0 !== t[e] && "" !== t[e] && r.push(t[e]); }), r.length && !(null == n ? void 0 : n.includes(e)) && (i[e] = Object(M.uniq)(r)); }), i ); }, L = function (t, e, n) { var r = B(t, e, n), i = []; return Object.keys(r).length ? (t.forEach(function (t, e) { var n = []; if (1 === Object.keys(r).length) { var o = Object.keys(r)[0]; r[o].every(function (t) { return !isNaN(Number(t)); }) && (n = [t[o]]); } else Object.keys(r).forEach(function (e) { for ( var i = t[e], o = r[e], a = o.findIndex(function (t) { return i === t; }), s = [], c = 0; c < o.length; c++ ) c === a ? s.push(1) : s.push(0); n = n.concat(s); }); i[e] = n; }), i) : i; }, D = function (t, e, n, r) { void 0 === n && (n = E.EuclideanDistance); var i = 0; switch (n) { case E.EuclideanDistance: i = new T(t).euclideanDistance(new T(e)); } return i; }, _ = function (t, e, n, r) { for (var i = e.length, o = 2 * r, a = 0, s = 0; s < i; s++) for (var c = t[s].clusterId, u = 0; u < i; u++) { if (c === t[u].clusterId) a += (e[s][u] || 0) - ((n[s] || 0) * (n[u] || 0)) / o; } return (a *= 1 / o); }, R = function (t, e) { void 0 === t && (t = []); for (var n = t.length, r = new T([]), i = 0; i < n; i++) r = r.add(new T(e[i])); var o = r.avg(n); o.normalize(); var a = 0; for (i = 0; i < n; i++) { a += (c = new T(e[i])).squareEuclideanDistance(o); } var s = []; t.forEach(function () { s.push([]); }); for (i = 0; i < n; i++) { var c = new T(e[i]); t[i].clusterInertial = 0; for (var u = 0; u < n; u++) if (i !== u) { var h = new T(e[u]); (s[i][u] = c.squareEuclideanDistance(h)), (t[i].clusterInertial += s[i][u]); } else s[i][u] = 0; } var l = 0, f = 2 * n * a; for (i = 0; i < n; i++) { var d = t[i].clusterId; for (u = 0; u < n; u++) { var p = t[u].clusterId; if (i !== u && d === p) l += (t[i].clusterInertial * t[u].clusterInertial) / Math.pow(f, 2) - s[i][u] / f; } } return Number(l.toFixed(4)); }, F = function (t, e, n, i, o, a, s, c, u) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e-4), void 0 === o && (o = !1), void 0 === a && (a = void 0), void 0 === s && (s = []), void 0 === c && (c = ["id"]), void 0 === u && (u = 1); var h = t.nodes, l = void 0 === h ? [] : h, f = t.edges, d = void 0 === f ? [] : f, p = []; if (o) { l.forEach(function (t, e) { (t.properties = t.properties || {}), (t.originIndex = e); }); var g = []; l.every(function (t) { return t.hasOwnProperty("nodeType"); }) && ((g = Array.from( new Set( l.map(function (t) { return t.nodeType; }), ), )), l.forEach(function (t) { t.properties.nodeType = g.findIndex(function (e) { return e === t.nodeType; }); })); var v = N(l, a); p = L(v, s, c); } var y = 1, m = {}, b = {}; l.forEach(function (t, e) { var n = String(y++); (t.clusterId = n), (m[n] = { id: n, nodes: [t] }), (b[t.id] = { node: t, idx: e }); }); var x = r(t, e), w = [], S = {}, O = 0; x.forEach(function (t, e) { var n = 0, r = l[e].id; (S[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = l[e].id; (S[r][i] = t), (O += t); } }), w.push(n); }), (O /= 2); for (var k = 1 / 0, C = 1 / 0, E = 0, j = [], P = {}; ; ) { (k = o && l.every(function (t) { return t.hasOwnProperty("properties"); }) ? _(l, x, w, O) + R(l, p) * u : _(l, x, w, O)), 0 === E && ((C = k), (j = l), (P = m)); var A = k > 0 && k > C && k - C < i; if ( (k > C && ((j = l.map(function (t) { return { node: t, clusterId: t.clusterId }; })), (P = Object(M.clone)(m)), (C = k)), A || E > 100) ) break; E++, Object.keys(m).forEach(function (t) { var e = 0; d.forEach(function (r) { var i = r.source, o = r.target, a = b[i].node.clusterId, s = b[o].node.clusterId; ((a === t && s !== t) || (s === t && a !== t)) && (e += r[n] || 1); }), (m[t].sumTot = e); }), l.forEach(function (t, e) { var r, i = m[t.clusterId], a = 0, s = w[e] / (2 * O), c = 0, h = i.nodes; h.forEach(function (t) { var n = b[t.id].idx; c += x[e][n] || 0; }); var l = c - i.sumTot * s, f = h.filter(function (e) { return e.id !== t.id; }), g = []; f.forEach(function (t, e) { g[e] = p[t.originIndex]; }); var v = R(f, p) * u, y = S[t.id]; if ( (Object.keys(y).forEach(function (n) { var i = b[n].node.clusterId; if (i !== t.clusterId) { var c = m[i], h = c.nodes; if (h && h.length) { var f = 0; h.forEach(function (t) { var n = b[t.id].idx; f += x[e][n] || 0; }); var d = f - c.sumTot * s, g = h.concat([t]), y = []; g.forEach(function (t, e) { y[e] = p[t.originIndex]; }); var w = R(g, p) * u, S = d - l; o && (S = d + w - (l + v)), S > a && ((a = S), (r = c)); } } }), a > 0) ) { r.nodes.push(t); var M = t.clusterId; t.clusterId = r.id; var k = i.nodes.indexOf(t); i.nodes.splice(k, 1); var C = 0, E = 0; d.forEach(function (t) { var e = t.source, i = t.target, o = b[e].node.clusterId, a = b[i].node.clusterId; ((o === r.id && a !== r.id) || (a === r.id && o !== r.id)) && (C += t[n] || 1), ((o === M && a !== M) || (a === M && o !== M)) && (E += t[n] || 1); }), (r.sumTot = C), (i.sumTot = E); } }); } var I = {}, T = 0; Object.keys(P).forEach(function (t) { var e = P[t]; if (e.nodes && e.nodes.length) { var n = String(T + 1); n !== t && ((e.id = n), (e.nodes = e.nodes.map(function (t) { return { id: t.id, clusterId: n }; })), (P[n] = e), (I[t] = n), delete P[t], T++); } else delete P[t]; }), j.forEach(function (t) { var e = t.node, n = t.clusterId; (e.clusterId = n), e.clusterId && I[e.clusterId] && (e.clusterId = I[e.clusterId]); }); var B = [], D = {}; d.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = b[e].node.clusterId, a = b[r].node.clusterId, s = "".concat(o, "---").concat(a); if (D[s]) (D[s].weight += i), D[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (D[s] = c), B.push(c); } }); var F = []; return ( Object.keys(P).forEach(function (t) { F.push(P[t]); }), { clusters: F, clusterEdges: B } ); }, Y = function (t, e, n, r, i, o, a, s) { return ( void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === r && (r = 1e-4), void 0 === i && (i = void 0), void 0 === o && (o = []), void 0 === a && (a = ["id"]), void 0 === s && (s = 1), F(t, e, n, r, !0, i, o, a, s) ); }, X = function (t, e) { var n; void 0 === e && (e = 1); for ( var r = Object(M.clone)(t), i = r.nodes, o = void 0 === i ? [] : i, a = r.edges, s = void 0 === a ? [] : a, c = function () { var t = g({ nodes: o, edges: s }), r = Object.keys(t); r.sort(function (e, n) { var r, i; return ( (null === (r = t[e]) || void 0 === r ? void 0 : r.degree) - (null === (i = t[n]) || void 0 === i ? void 0 : i.degree) ); }); var i = r[0]; if ( !o.length || (null === (n = t[i]) || void 0 === n ? void 0 : n.degree) >= e ) return "break"; var a = o.findIndex(function (t) { return t.id === i; }); o.splice(a, 1), (s = s.filter(function (t) { return !(t.source === i || t.target === i); })); }; ; ) { if ("break" === c()) break; } return { nodes: o, edges: s }; }, z = function (t, e, n) { var r = []; switch (t) { case E.EuclideanDistance: r = e[n]; break; default: r = []; } return r; }, W = function (t, e, n, r, i, o) { void 0 === e && (e = 3), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = ["id"]), void 0 === o && (o = E.EuclideanDistance); var a = t.nodes, s = void 0 === a ? [] : a, c = t.edges, u = void 0 === c ? [] : c, h = { clusters: [{ id: "0", nodes: s }], clusterEdges: [] }; if ( o === E.EuclideanDistance && !s.every(function (t) { return t.hasOwnProperty(n); }) ) return h; var l = [], f = []; if ( (o === E.EuclideanDistance && ((l = N(s, n)), (f = L(l, r, i))), !f.length) ) return h; for ( var d = Object(M.uniq)( f.map(function (t) { return t.join(""); }), ), p = Math.min(e, s.length, d.length), g = 0; g < s.length; g++ ) s[g].originIndex = g; var v = [], y = [], m = []; for (g = 0; g < p; g++) if (0 === g) { var b = Math.floor(Math.random() * s.length); switch (o) { case E.EuclideanDistance: v[g] = f[b]; break; default: v[g] = []; } y.push(b), (m[g] = [s[b]]), (s[b].clusterId = String(g)); } else { for ( var x = -1 / 0, w = 0, S = function (t) { if (!y.includes(t)) { for (var e = 0, n = 0; n < v.length; n++) { var r = 0; switch (o) { case E.EuclideanDistance: r = D(f[s[t].originIndex], v[n], o); } e += r; } var i = e / v.length; i > x && !v.find(function (e) { return Object(M.isEqual)( e, z(o, f, s[t].originIndex), ); }) && ((x = i), (w = t)); } }, O = 0; O < s.length; O++ ) S(O); (v[g] = z(o, f, w)), y.push(w), (m[g] = [s[w]]), (s[w].clusterId = String(g)); } for (var k = 0; ; ) { for (g = 0; g < s.length; g++) { var C = 0, j = 1 / 0; if (0 !== k || !y.includes(g)) { for (var P = 0; P < v.length; P++) { var A = 0; switch (o) { case E.EuclideanDistance: A = D(f[g], v[P], o); } A < j && ((j = A), (C = P)); } if (void 0 !== s[g].clusterId) for ( var I = m[Number(s[g].clusterId)].length - 1; I >= 0; I-- ) m[Number(s[g].clusterId)][I].id === s[g].id && m[Number(s[g].clusterId)].splice(I, 1); (s[g].clusterId = String(C)), m[C].push(s[g]); } } var B = !1; for (g = 0; g < m.length; g++) { var _ = m[g], R = new T([]); for (P = 0; P < _.length; P++) R = R.add(new T(f[_[P].originIndex])); var F = R.avg(_.length); F.equal(new T(v[g])) || ((B = !0), (v[g] = F.getArr())); } if ( (k++, (s.every(function (t) { return void 0 !== t.clusterId; }) && B) || k >= 1e3) ) break; } var Y = [], X = {}; return ( u.forEach(function (t) { var e, n, r = t.source, i = t.target, o = null === (e = s.find(function (t) { return t.id === r; })) || void 0 === e ? void 0 : e.clusterId, a = null === (n = s.find(function (t) { return t.id === i; })) || void 0 === n ? void 0 : n.clusterId, c = "".concat(o, "---").concat(a); if (X[c]) X[c].count++; else { var u = { source: o, target: a, count: 1 }; (X[c] = u), Y.push(u); } }), { clusters: m, clusterEdges: Y } ); }, q = function (t, e) { var n = new T(e), r = n.norm2(), i = new T(t), o = i.norm2(), a = n.dot(i), s = r * o, c = s ? a / s : 0; return c; }, V = function (t, e, n, r, i) { void 0 === t && (t = []), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = []); var o = Object(M.clone)( t.filter(function (t) { return t.id !== e.id; }), ), a = t.findIndex(function (t) { return t.id === e.id; }), s = N(t, n), c = L(s, r, i), u = c[a], h = []; return ( o.forEach(function (t, n) { if (t.id !== e.id) { var r = c[n], i = q(r, u); h.push(i), (t.cosineSimilarity = i); } }), o.sort(function (t, e) { return e.cosineSimilarity - t.cosineSimilarity; }), { allCosineSimilarity: h, similarNodes: o } ); }, G = (function () { function t(t) { (this.count = t.length), (this.parent = {}); for (var e = 0, n = t; e < n.length; e++) { var r = n[e]; this.parent[r] = r; } } return ( (t.prototype.find = function (t) { for (; this.parent[t] !== t; ) t = this.parent[t]; return t; }), (t.prototype.union = function (t, e) { var n = this.find(t), r = this.find(e); n !== r && (n < r ? (this.parent[e] !== e && this.union(this.parent[e], t), (this.parent[e] = this.parent[t])) : (this.parent[t] !== t && this.union(this.parent[t], e), (this.parent[t] = this.parent[e]))); }), (t.prototype.connected = function (t, e) { return this.find(t) === this.find(e); }), t ); })(), H = function (t, e) { return t - e; }, U = (function () { function t(t) { void 0 === t && (t = H), (this.compareFn = t), (this.list = []); } return ( (t.prototype.getLeft = function (t) { return 2 * t + 1; }), (t.prototype.getRight = function (t) { return 2 * t + 2; }), (t.prototype.getParent = function (t) { return 0 === t ? null : Math.floor((t - 1) / 2); }), (t.prototype.isEmpty = function () { return this.list.length <= 0; }), (t.prototype.top = function () { return this.isEmpty() ? void 0 : this.list[0]; }), (t.prototype.delMin = function () { var t = this.top(), e = this.list.pop(); return ( this.list.length > 0 && ((this.list[0] = e), this.moveDown(0)), t ); }), (t.prototype.insert = function (t) { if (null !== t) { this.list.push(t); var e = this.list.length - 1; return this.moveUp(e), !0; } return !1; }), (t.prototype.moveUp = function (t) { for ( var e = this.getParent(t); t && t > 0 && this.compareFn(this.list[e], this.list[t]) > 0; ) { var n = this.list[e]; (this.list[e] = this.list[t]), (this.list[t] = n), (t = e), (e = this.getParent(t)); } }), (t.prototype.moveDown = function (t) { var e, n = t, r = this.getLeft(t), i = this.getRight(t), o = this.list.length; null !== r && r < o && this.compareFn(this.list[n], this.list[r]) > 0 ? (n = r) : null !== i && i < o && this.compareFn(this.list[n], this.list[i]) > 0 && (n = i), t !== n && ((e = [this.list[n], this.list[t]]), (this.list[t] = e[0]), (this.list[n] = e[1]), this.moveDown(n)); }), t ); })(), Z = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = i[0], c = new Set(); c.add(s); var h = new U(function (t, n) { return e ? t.weight - n.weight : 0; }); for ( u(s.id, a).forEach(function (t) { h.insert(t); }); !h.isEmpty(); ) { var l = h.delMin(), f = l.source, d = l.target; (c.has(f) && c.has(d)) || (n.push(l), c.has(f) || (c.add(f), u(f, a).forEach(function (t) { h.insert(t); })), c.has(d) || (c.add(d), u(d, a).forEach(function (t) { h.insert(t); }))); } return n; }, K = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = a.map(function (t) { return t; }); e && s.sort(function (t, e) { return t.weight - e.weight; }); for ( var c = new G( i.map(function (t) { return t.id; }), ); s.length > 0; ) { var u = s.shift(), h = u.source, l = u.target; c.connected(h, l) || (n.push(u), c.union(h, l)); } return n; }, $ = function (t, e, n) { return n ? { prim: Z, kruskal: K }[n](t, e) : K(t, e); }, Q = function (t, e, n) { "number" != typeof e && (e = 1e-6), "number" != typeof n && (n = 0.85); for ( var r, i = 1, o = 0, a = 1e3, s = t.nodes, u = void 0 === s ? [] : s, h = t.edges, l = void 0 === h ? [] : h, f = u.length, d = {}, p = {}, v = 0; v < f; ++v ) { (d[(m = (O = u[v]).id)] = 1 / f), (p[m] = 1 / f); } for (var y = g(t); a > 0 && i > e; ) { o = 0; for (v = 0; v < f; ++v) { var m = (O = u[v]).id; if (((r = 0), 0 === y[O.id].inDegree)) d[m] = 0; else { for (var b = c(m, l, "source"), x = 0; x < b.length; ++x) { var w = b[x], S = y[w].outDegree; S > 0 && (r += p[w] / S); } (d[m] = n * r), (o += d[m]); } } (o = (1 - o) / f), (i = 0); for (v = 0; v < f; ++v) { var O; (r = d[(m = (O = u[v]).id)] + o), (i += Math.abs(r - p[m])), (p[m] = r); } a -= 1; } return p; }, J = function (t, e, n, r) { void 0 === t && (t = -1), void 0 === e && (e = -1), void 0 === n && (n = -1), void 0 === r && (r = "-1"), (this.id = t), (this.from = e), (this.to = n), (this.label = r); }, tt = (function () { function t(t, e) { void 0 === t && (t = -1), void 0 === e && (e = "-1"), (this.id = t), (this.label = e), (this.edges = []), (this.edgeMap = {}); } return ( (t.prototype.addEdge = function (t) { this.edges.push(t), (this.edgeMap[t.id] = t); }), t ); })(), et = (function () { function t(t, e, n) { void 0 === t && (t = -1), void 0 === e && (e = !0), void 0 === n && (n = !1), (this.id = t), (this.edgeIdAutoIncrease = e), (this.edges = []), (this.nodes = []), (this.nodeMap = {}), (this.edgeMap = {}), (this.nodeLabelMap = {}), (this.edgeLabelMap = {}), (this.counter = 0), (this.directed = n); } return ( (t.prototype.getNodeNum = function () { return this.nodes.length; }), (t.prototype.addNode = function (t, e) { if (!this.nodeMap[t]) { var n = new tt(t, e); this.nodes.push(n), (this.nodeMap[t] = n), this.nodeLabelMap[e] || (this.nodeLabelMap[e] = []), this.nodeLabelMap[e].push(t); } }), (t.prototype.addEdge = function (t, e, n, r) { if ( ((this.edgeIdAutoIncrease || void 0 === t) && (t = this.counter++), !( this.nodeMap[e] && this.nodeMap[n] && this.nodeMap[n].edgeMap[t] )) ) { var i = new J(t, e, n, r); if ( (this.edges.push(i), (this.edgeMap[t] = i), this.nodeMap[e].addEdge(i), this.edgeLabelMap[r] || (this.edgeLabelMap[r] = []), this.edgeLabelMap[r].push(i), !this.directed) ) { var o = new J(t, n, e, r); this.nodeMap[n].addEdge(o), this.edgeLabelMap[r].push(o); } } }), t ); })(), nt = (function () { function t(t, e, n, r, i) { (this.fromNode = t), (this.toNode = e), (this.nodeEdgeNodeLabel = { nodeLabel1: n || "-1", edgeLabel: r || "-1", nodeLabel2: i || "-1", }); } return ( (t.prototype.equalTo = function (t) { return ( this.fromNode === t.formNode && this.toNode === t.toNode && this.nodeEdgeNodeLabel === t.nodeEdgeNodeLabel ); }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), t ); })(), rt = (function () { function t() { (this.rmpath = []), (this.dfsEdgeList = []); } return ( (t.prototype.equalTo = function (t) { var e = this.dfsEdgeList.length; if (e !== t.length) return !1; for (var n = 0; n < e; n++) if (this.dfsEdgeList[n] !== t[n]) return !1; return !0; }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), (t.prototype.pushBack = function (t, e, n, r, i) { return ( this.dfsEdgeList.push(new nt(t, e, n, r, i)), this.dfsEdgeList ); }), (t.prototype.toGraph = function (t, e) { void 0 === t && (t = -1), void 0 === e && (e = !1); var n = new et(t, !0, e); return ( this.dfsEdgeList.forEach(function (t) { var e = t.fromNode, r = t.toNode, i = t.nodeEdgeNodeLabel, o = i.nodeLabel1, a = i.edgeLabel, s = i.nodeLabel2; "-1" !== o && n.addNode(e, o), "-1" !== s && n.addNode(r, s), "-1" !== o && s !== o && n.addEdge(void 0, e, r, a); }), n ); }), (t.prototype.buildRmpath = function () { this.rmpath = []; for ( var t = void 0, e = this.dfsEdgeList.length - 1; e >= 0; e-- ) { var n = this.dfsEdgeList[e], r = n.fromNode, i = n.toNode; r < i && (void 0 === t || i === t) && (this.rmpath.push(e), (t = r)); } return this.rmpath; }), (t.prototype.getNodeNum = function () { var t = {}; return ( this.dfsEdgeList.forEach(function (e) { t[e.fromNode] || (t[e.fromNode] = !0), t[e.toNode] || (t[e.toNode] = !0); }), Object.keys(t).length ); }), t ); })(), it = (function () { function t(t) { if ( ((this.his = {}), (this.nodesUsed = {}), (this.edgesUsed = {}), (this.edges = []), t) ) { for (; t; ) { var e = t.edge; this.edges.push(e), (this.nodesUsed[e.from] = 1), (this.nodesUsed[e.to] = 1), (this.edgesUsed[e.id] = 1), (t = t.preNode); } this.edges = this.edges.reverse(); } } return ( (t.prototype.hasNode = function (t) { return 1 === this.nodesUsed[t.id]; }), (t.prototype.hasEdge = function (t) { return 1 === this.edgesUsed[t.id]; }), t ); })(), ot = (function () { function t(t) { var e = t.graphs, n = t.minSupport, r = void 0 === n ? 2 : n, i = t.minNodeNum, o = void 0 === i ? 1 : i, a = t.maxNodeNum, s = void 0 === a ? 4 : a, c = t.top, u = void 0 === c ? 10 : c, h = t.directed, l = void 0 !== h && h, f = t.verbose, d = void 0 !== f && f; (this.graphs = e), (this.dfsCode = new rt()), (this.support = 0), (this.frequentSize1Subgraphs = []), (this.frequentSubgraphs = []), (this.minSupport = r), (this.top = u), (this.directed = l), (this.counter = 0), (this.maxNodeNum = s), (this.minNodeNum = o), (this.verbose = d), this.maxNodeNum < this.minNodeNum && (this.maxNodeNum = this.minNodeNum), (this.reportDF = []); } return ( (t.prototype.findForwardRootEdges = function (t, e) { var n = this, r = [], i = t.nodeMap; return ( e.edges.forEach(function (t) { (n.directed || e.label <= i[t.to].label) && r.push(t); }), r ); }), (t.prototype.findBackwardEdge = function (t, e, n, r) { if (!this.directed && e === n) return null; for ( var i = t.nodeMap, o = i[n.to].edges, a = o.length, s = 0; s < a; s++ ) { var c = o[s]; if (!r.hasEdge(c) && c.to === e.from) if (this.directed) { if ( i[e.from].label < i[n.to].label || (i[e.from].label === i[n.to].label && e.label <= c.label) ) return c; } else if ( e.label < c.label || (e.label === c.label && i[e.to].label <= i[n.to].label) ) return c; } return null; }), (t.prototype.findForwardPureEdges = function (t, e, n, r) { for ( var i = [], o = e.to, a = t.nodeMap[o].edges, s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = t.nodeMap[u.to]; n <= h.label && !r.hasNode(h) && i.push(u); } return i; }), (t.prototype.findForwardRmpathEdges = function (t, e, n, r) { for ( var i = [], o = t.nodeMap, a = o[e.to].label, s = o[e.from].edges, c = s.length, u = 0; u < c; u++ ) { var h = s[u], l = o[h.to].label; e.to === h.to || n > l || r.hasNode(o[h.to]) || ((e.label < h.label || (e.label === h.label && a <= l)) && i.push(h)); } return i; }), (t.prototype.getSupport = function (t) { var e = {}; return ( t.forEach(function (t) { e[t.graphId] || (e[t.graphId] = !0); }), Object.keys(e).length ); }), (t.prototype.findMinLabel = function (t) { var e = void 0; return ( Object.keys(t).forEach(function (n) { var r = t[n], i = r.nodeLabel1, o = r.edgeLabel, a = r.nodeLabel2; e ? (i < e.nodeLabel1 || (i === e.nodeLabel1 && o < e.edgeLabel) || (i === e.nodeLabel1 && o === e.edgeLabel && a < e.nodeLabel2)) && (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }) : (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }); }), e ); }), (t.prototype.isMin = function () { var t = this, e = this.dfsCode; if ( (this.verbose && console.log("isMin checking", e), 1 === e.dfsEdgeList.length) ) return !0; var n = this.directed, r = e.toGraph(-1, n), i = r.nodeMap, o = new rt(), a = {}; r.nodes.forEach(function (e) { t.findForwardRootEdges(r, e).forEach(function (t) { var n = i[t.to], o = "" .concat(e.label, "-") .concat(t.label, "-") .concat(n.label); a[o] || (a[o] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: n.label, }); var s = { graphId: r.id, edge: t, preNode: null }; a[o].projected.push(s); }); }); var s = this.findMinLabel(a); if (s) { o.dfsEdgeList.push( new nt(0, 1, s.nodeLabel1, s.edgeLabel, s.nodeLabel2), ); var c = "" .concat(s.nodeLabel1, "-") .concat(s.edgeLabel, "-") .concat(s.nodeLabel2); return (function a(s) { for ( var c = o.buildRmpath(), u = o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, h = o.dfsEdgeList[c[0]].toNode, l = {}, f = !1, d = 0, p = n ? -1 : 0, g = function (e) { if (f) return "break"; s.forEach(function (n) { var i = new it(n), a = t.findBackwardEdge( r, i.edges[c[e]], i.edges[c[0]], i, ); a && (l[a.label] || (l[a.label] = { projected: [], edgeLabel: a.label, }), l[a.label].projected.push({ graphId: r.id, edge: l, preNode: n, }), (d = o.dfsEdgeList[c[e]].fromNode), (f = !0)); }); }, v = c.length - 1; v > p; v-- ) { if ("break" === g(v)) break; } if (f) { var y = t.findMinLabel(l); o.dfsEdgeList.push(new nt(h, d, "-1", y.edgeLabel, "-1")); var m = o.dfsEdgeList.length - 1; return ( t.dfsCode.dfsEdgeList[m] === o.dfsEdgeList[m] && a(l[y.edgeLabel].projected) ); } var b = {}; f = !1; var x = 0; s.forEach(function (e) { var n = new it(e), o = t.findForwardPureEdges(r, n.edges[c[0]], u, n); o.length > 0 && ((f = !0), (x = h), o.forEach(function (t) { var n = "".concat(t.label, "-").concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); var w = c.length, S = function (e) { if (f) return "break"; var n = c[e]; s.forEach(function (e) { var a = new it(e), s = t.findForwardRmpathEdges(r, a.edges[n], u, a); s.length > 0 && ((f = !0), (x = o.dfsEdgeList[n].fromNode), s.forEach(function (t) { var n = "" .concat(t.label, "-") .concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); }; for (v = 0; v < w; v++) { if ("break" === S(v)) break; } if (!f) return !0; var O = t.findMinLabel(b); o.dfsEdgeList.push( new nt(x, h + 1, "-1", O.edgeLabel, O.nodeLabel2), ); var M = o.dfsEdgeList.length - 1; return ( e.dfsEdgeList[M] === o.dfsEdgeList[M] && a( b["".concat(O.edgeLabel, "-").concat(O.nodeLabel2)] .projected, ) ); })(a[c].projected); } }), (t.prototype.report = function () { if (!(this.dfsCode.getNodeNum() < this.minNodeNum)) { this.counter++; var t = this.dfsCode.toGraph(this.counter, this.directed); this.frequentSubgraphs.push(Object(M.clone)(t)); } }), (t.prototype.subGraphMining = function (t) { var e = this; if (!(this.getSupport(t) < this.minSupport) && this.isMin()) { this.report(); var n = this.dfsCode.getNodeNum(), r = this.dfsCode.buildRmpath(), i = this.dfsCode.dfsEdgeList[r[0]].toNode, o = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, a = {}, s = {}; t.forEach(function (t) { for ( var c = e.graphs[t.graphId], u = c.nodeMap, h = new it(t), l = r.length - 1; l >= 0; l-- ) { var f = e.findBackwardEdge( c, h.edges[r[l]], h.edges[r[0]], h, ); if (f) { var d = "" .concat(e.dfsCode.dfsEdgeList[r[l]].fromNode, "-") .concat(f.label); s[d] || (s[d] = { projected: [], toNodeId: e.dfsCode.dfsEdgeList[r[l]].fromNode, edgeLabel: f.label, }), s[d].projected.push({ graphId: t.graphId, edge: f, preNode: t, }); } } if (!(n >= e.maxNodeNum)) { e.findForwardPureEdges(c, h.edges[r[0]], o, h).forEach( function (e) { var n = "" .concat(i, "-") .concat(e.label, "-") .concat(u[e.to].label); a[n] || (a[n] = { projected: [], fromNodeId: i, edgeLabel: e.label, nodeLabel2: u[e.to].label, }), a[n].projected.push({ graphId: t.graphId, edge: e, preNode: t, }); }, ); var p = function (n) { e.findForwardRmpathEdges(c, h.edges[r[n]], o, h).forEach( function (i) { var o = "" .concat(e.dfsCode.dfsEdgeList[r[n]].fromNode, "-") .concat(i.label, "-") .concat(u[i.to].label); a[o] || (a[o] = { projected: [], fromNodeId: e.dfsCode.dfsEdgeList[r[n]].fromNode, edgeLabel: i.label, nodeLabel2: u[i.to].label, }), a[o].projected.push({ graphId: t.graphId, edge: i, preNode: t, }); }, ); }; for (l = 0; l < r.length; l++) p(l); } }), Object.keys(s).forEach(function (t) { var n = s[t], r = n.toNodeId, o = n.edgeLabel; e.dfsCode.dfsEdgeList.push(new nt(i, r, "-1", o, "-1")), e.subGraphMining(s[t].projected), e.dfsCode.dfsEdgeList.pop(); }), Object.keys(a).forEach(function (t) { var n = a[t], r = n.fromNodeId, o = n.edgeLabel, s = n.nodeLabel2; e.dfsCode.dfsEdgeList.push(new nt(r, i + 1, "-1", o, s)), e.subGraphMining(a[t].projected), e.dfsCode.dfsEdgeList.pop(); }); } }), (t.prototype.generate1EdgeFrequentSubGraphs = function () { var t = this.graphs, e = this.directed, n = this.minSupport, r = this.frequentSize1Subgraphs, i = {}, o = {}, a = {}, s = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n], c = r.nodeMap; r.nodes.forEach(function (t, r) { var u = t.label, h = "".concat(n, "-").concat(u); if (!a[h]) { var l = i[u] || 0; l++, (i[u] = l); } (a[h] = { graphKey: n, label: u }), t.edges.forEach(function (t) { var r = u, i = c[t.to].label; if (!e && r > i) { var a = i; (i = r), (r = a); } var h = t.label, l = "" .concat(n, "-") .concat(r, "-") .concat(h, "-") .concat(i), f = "".concat(r, "-").concat(h, "-").concat(i); if (!o[f]) { var d = o[f] || 0; d++, (o[f] = d); } s[l] = { graphId: n, nodeLabel1: r, edgeLabel: h, nodeLabel2: i, }; }); }); }), Object.keys(i).forEach(function (t) { if (!(i[t] < n)) { var e = { nodes: [], edges: [] }; e.nodes.push({ id: "0", label: t }), r.push(e); } }), r ); }), (t.prototype.run = function () { var t = this; if ( ((this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs()), !(this.maxNodeNum < 2)) ) { var e = this.graphs, n = (this.directed, {}); Object.keys(e).forEach(function (r) { var i = e[r], o = i.nodeMap; i.nodes.forEach(function (e) { t.findForwardRootEdges(i, e).forEach(function (t) { var i = o[t.to], a = "" .concat(e.label, "-") .concat(t.label, "-") .concat(i.label); n[a] || (n[a] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: i.label, }); var s = { graphId: r, edge: t, preNode: null }; n[a].projected.push(s); }); }); }), Object.keys(n).forEach(function (e) { var r = n[e], i = r.projected, o = r.nodeLabel1, a = r.edgeLabel, s = r.nodeLabel2; t.dfsCode.dfsEdgeList.push(new nt(0, 1, o, a, s)), t.subGraphMining(i), t.dfsCode.dfsEdgeList.pop(); }); } }), t ); })(), at = function (t) { var e = t.graphs, n = t.directed, r = void 0 !== n && n, i = t.nodeLabelProp, o = void 0 === i ? "cluster" : i, a = t.edgeLabelProp, s = void 0 === a ? "cluster" : a, c = (function (t, e, n, r) { var i = {}; return ( Object.keys(t).forEach(function (o, a) { var s = t[o], c = new et(a, !0, e), u = {}; s.nodes.forEach(function (t, e) { c.addNode(e, t[n]), (u[t.id] = e); }), s.edges.forEach(function (t, e) { var n = u[t.source], i = u[t.target]; c.addEdge(-1, n, i, t[r]); }), c && c.getNodeNum() && (i[c.id] = c); }), i ); })(e, r, o, s), u = t.minSupport, h = t.maxNodeNum, l = t.minNodeNum, f = t.verbose, d = t.top, p = new ot({ graphs: c, minSupport: u, maxNodeNum: h, minNodeNum: l, top: d, verbose: f, directed: r, }); return ( p.run(), (function (t, e, n) { var r = []; return ( t.forEach(function (t) { var i = { nodes: [], edges: [] }; t.nodes.forEach(function (t) { var n; i.nodes.push( (((n = { id: "".concat(t.id) })[e] = t.label), n), ); }), t.edges.forEach(function (t) { var e; i.edges.push( (((e = { source: "".concat(t.from), target: "".concat(t.to), })[n] = t.label), e), ); }), r.push(i); }), r ); })(p.frequentSubgraphs, o, s) ); }, st = function (t, e, n, r) { void 0 === n && (n = "cluster"), void 0 === r && (r = 2); var i = [], o = t.nodes; return ( e.forEach(function (t, e) { i.push(ct(o, t, e, n, r)); }), i ); }, ct = function (t, e, n, r, i) { var o = [n], a = [], s = {}; return ( e.forEach(function (e, c) { if (e <= i && n !== c) { o.push(c), a.push(t[c]); var u = t[c][r]; s[u] ? (s[u].count++, s[u].dists.push(e)) : (s[u] = { count: 1, dists: [e] }); } }), Object.keys(s).forEach(function (t) { s[t].dists = s[t].dists.sort(function (t, e) { return t - e; }); }), { nodeIdx: n, nodeId: t[n].id, nodeIdxs: o, neighbors: a, neighborNum: o.length - 1, nodeLabelCountMap: s, } ); }, ut = function (t, e, n, r) { var i = n.nodes; return ( r || (r = {}), Object.keys(t).forEach(function (o) { var a, s; if (!r || !r[o]) { r[o] = { nodes: [], edges: [] }; var c = t[o], u = null === (a = e[c.start]) || void 0 === a ? void 0 : a.nodeIdxs, h = null === (s = e[c.end]) || void 0 === s ? void 0 : s.nodeIdxs; if (u && h) { var l = new Set(h), f = u.filter(function (t) { return l.has(t); }); if (f && f.length) { for (var d = {}, p = f.length, g = 0; g < p; g++) { var v = i[f[g]]; r[o].nodes.push(v), (d[v.id] = !0); } n.edges.forEach(function (t) { d[t.source] && d[t.target] && r[o].edges.push(t); }); } } } }), r ); }, ht = function (t, e, n, r) { var i, o, a = {}; t.nodes.forEach(function (t) { a[t.id] = t; }); var s = 0; return !(null === (i = null == e ? void 0 : e.edges) || void 0 === i ? void 0 : i.length) || (null === (o = null == e ? void 0 : e.nodes) || void 0 === o ? void 0 : o.length) < 2 ? 0 : (t.edges.forEach(function (t) { var i = a[t.source][n], o = a[t.target][n], c = null == e ? void 0 : e.nodes[0][n], u = null == e ? void 0 : e.nodes[1][n], h = null == e ? void 0 : e.edges[0][r]; t[r] === h && ((i === c && o === u) || (i === u && o === c)) && s++; }), s); }, lt = function (t, e) { var n = {}, r = {}; return ( t.forEach(function (t, i) { n[t.id] = { idx: i, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var o = t[e]; r[o] || (r[o] = []), r[o].push(t); }), { nodeMap: n, nodeLabelMap: r } ); }, ft = function (t, e, n) { var r = {}, i = {}; return ( t.forEach(function (t, o) { r["".concat(h)] = { idx: o, edge: t }; var a = t[e]; i[a] || (i[a] = []), i[a].push(t); var s = n[t.source]; s && (s.degree++, s.outDegree++); var c = n[t.target]; c && (c.degree++, c.inDegree++); }), { edgeMap: r, edgeLabelMap: i } ); }, dt = function (t, e, n) { var r = e.length, i = {}; return ( e.forEach(function (e, o) { for (var a = n ? 0 : o + 1, s = t[o].id, c = a; c < r; c++) if (o !== c) { var u = t[c].id, h = e[c]; (i["".concat(s, "-").concat(u)] = h), n || (i["".concat(u, "-").concat(s)] = h); } }), i ); }, pt = function (t, e, n, r, i, o, a, s, c, u, h) { var l, f = "".concat(e.id, "-").concat(n.id); if (u && u[f]) return u[f]; var d = h ? h[f] : void 0; if (!d) { var p = (((l = {})[f] = { start: r[e.id].idx, end: r[n.id].idx, distance: i, }), l); d = (h = ut(p, o, t, h))[f]; } return ht(d, a, s, c); }, gt = function (t, e, n, r) { var i, o, a, s = null === (i = t[e]) || void 0 === i ? void 0 : i.degree, c = null === (o = t[e]) || void 0 === o ? void 0 : o.inDegree, u = null === (a = t[e]) || void 0 === a ? void 0 : a.outDegree; return ( void 0 === t[e] && ((s = 1 / 0), (c = 1 / 0), (u = 1 / 0), r[e].forEach(function (t) { var e = n[t.id].degree; s > e && (s = e); var r = n[t.id].inDegree; c > r && (c = r); var i = n[t.id].outDegree; u > i && (u = i); }), (t[e] = { degree: s, inDegree: c, outDegree: u })), { minPatternNodeLabelDegree: s, minPatternNodeLabelInDegree: c, minPatternNodeLabelOutDegree: u, } ); }, vt = function (t, e, n, r, i, o, a) { var s; if ( (void 0 === n && (n = !1), void 0 === o && (o = "cluster"), void 0 === a && (a = "cluster"), t && t.nodes) ) { var c = t.nodes.length; if (c) { var u = A(t, n), h = A(e, n), l = dt(t.nodes, u, n), f = dt(e.nodes, h, n), d = lt(t.nodes, o), p = d.nodeMap, g = d.nodeLabelMap, v = lt(e.nodes, o), y = v.nodeMap, m = v.nodeLabelMap; ft(t.edges, a, p); var b = ft(e.edges, a, y).edgeLabelMap, x = []; null == h || h.forEach(function (t) { x = x.concat(t); }), i || (i = Math.max.apply( Math, Object(O.f)(Object(O.f)([], x, !1), [2], !1), )), r || (r = i); var w = st(t, u, o, r), S = st(e, h, o, r), M = (function (t, e, n, r, i) { var o = Math.ceil(n / e), a = {}, s = 0; return ( r.forEach(function (t, r) { for ( var c = 0, u = 0, h = t.nodeIdxs, l = t.neighborNum - 1; c < o; ) { for ( var f = h[1 + Math.floor(Math.random() * l)], d = 0; (a["".concat(r, "-").concat(f)] || a["".concat(f, "-").concat(r)]) && ((f = Math.floor(Math.random() * e)), !(++d > 2 * e)); ); if ( d < 2 * e && ((a["".concat(r, "-").concat(f)] = { start: r, end: f, distance: i[r][f], }), c++, ++s >= n) ) return a; if (++u > 2 * e) break; } c < o && (o = (o + (o - c)) / (e - r - 1)); }), a ); })(0, c, Math.min(100, (c * (c - 1)) / 2), w, u), C = ut(M, w, t), E = at({ graphs: C, nodeLabelProp: o, edgeLabelProp: a, minSupport: 1, minNodeNum: 1, maxNodeNum: 4, directed: n, }).slice(0, 10), j = E.length, P = []; E.forEach(function (t, e) { (P[e] = {}), Object.keys(C).forEach(function (n) { var r = C[n], i = ht(r, t, o, a); P[e][n] = i; }); }); var I = (function (t, e, n) { for ( var r = 1 / 0, i = 0, o = function (e) { var n = t[e], o = Object.keys(n).sort(function (t, e) { return n[t] - n[e]; }), a = []; o.forEach(function (t, e) { a[e % 10] || (a[e % 10] = { graphs: [], totalCount: 0, aveCount: 0, }), a[e % 10].graphs.push(t), (a[e % 10].totalCount += n[t]); }); var s = 0, c = []; a.forEach(function (t) { var e = t.totalCount / t.graphs.length; (t.aveCount = e), c.push(e); var r = 0, i = t.length; t.graphs.forEach(function (e, i) { var o = n[e]; t.graphs.forEach(function (t, e) { i !== e && (r += Math.abs(o - n[t])); }); }), (s += r /= (i * (i - 1)) / 2); }), (s /= a.length); var u = 0; c.forEach(function (t, e) { c.forEach(function (n, r) { e !== r && (u += Math.abs(t - n)); }), (u /= (c.length * (c.length - 1)) / 2); }); var h = u - s; r < h && ((r = h), (i = e)); }, a = 0; a < e; a++ ) o(a); return { structure: n[i], structureCountMap: t[i] }; })(P, j, E), T = I.structure, N = I.structureCountMap, B = e.nodes[0], L = [], D = null === (s = e.nodes[0]) || void 0 === s ? void 0 : s[o], _ = -1 / 0; e.nodes.forEach(function (t) { var e = t[o], n = g[e]; (null == n ? void 0 : n.length) > _ && ((_ = n.length), (L = n), (D = e), (B = t)); }); var R = {}, F = {}, Y = {}, X = {}, z = {}, W = {}; Object.keys(m).forEach(function (r, i) { (z[r] = []), n && (W[r] = []); var s = -1 / 0, c = m[r], u = {}; c.forEach(function (t) { var e = f["".concat(B.id, "-").concat(t.id)]; if ( (e && z[r].push(e), s < e && (s = e), (u["".concat(B.id, "-").concat(t.id)] = { start: 0, end: y[t.id].idx, distance: e, }), n) ) { var i = f["".concat(t.id, "-").concat(B.id)]; i && W[r].push(i); } }), (z[r] = z[r].sort(function (t, e) { return t - e; })), n && (W[r] = W[r].sort(function (t, e) { return t - e; })), (F = ut(u, S, e, F)); var h = []; if ( (Object.keys(u).forEach(function (t) { if (Y[t]) h.push(Y[t]); else { var e = F[t]; (Y[t] = ht(e, T, o, a)), h.push(Y[t]); } }), (h = h.sort(function (t, e) { return e - t; })), (X["".concat(B.id, "-").concat(r)] = h), r !== D) ) for ( var d = function (e) { var n = L[e], i = w[p[n.id].idx], s = i.nodeLabelCountMap[r], c = m[r].length; if (!s || s.count < c) return L.splice(e, 1), "continue"; for (var u = !1, f = 0; f < c; f++) if (s.dists[f] > z[r][f]) { u = !0; break; } if (u) return L.splice(e, 1), "continue"; var d = {}; i.neighbors.forEach(function (t) { var e = l["".concat(n.id, "-").concat(t.id)]; d["".concat(n.id, "-").concat(t.id)] = { start: p[n.id].idx, end: p[t.id].idx, distance: e, }; }), (C = ut(d, w, t, C)); var g = []; Object.keys(d).forEach(function (t) { if (N[t]) g.push(N[t]); else { var e = C[t]; (N[t] = ht(e, T, o, a)), g.push(N[t]); } }), (g = g.sort(function (t, e) { return e - t; })); var v = !1; for (f = 0; f < c; f++) if (g[f] < h[f]) { v = !0; break; } return v ? (L.splice(e, 1), "continue") : void 0; }, g = ((null == L ? void 0 : L.length) || 0) - 1; g >= 0; g-- ) d(g); }); var q = []; null == L || L.forEach(function (r) { for ( var s = p[r.id].idx, c = ct(t.nodes, u[s], s, o, i).neighbors, h = !1, f = c.length - 1; f >= 0; f-- ) { if (c.length + 1 < e.nodes.length) return void (h = !0); var d = c[f], g = d[o]; if (m[g] && m[g].length) if (z[g] && z[g].length) { var v = "".concat(r.id, "-").concat(d.id), b = l[v], x = z[g].length - 1; if (b > z[g][x]) c.splice(f, 1); else { if (n) { var S = "".concat(d.id, "-").concat(r.id), O = l[S]; if (((x = W[g].length - 1), O > W[g][x])) { c.splice(f, 1); continue; } } var M = N[v] ? N[v] : pt(t, r, d, p, b, w, T, o, a, N, C), k = "".concat(B.id, "-").concat(g); if (M < X[k][X[k].length - 1]) c.splice(f, 1); else { var E = gt(R, g, y, m), j = E.minPatternNodeLabelDegree; E.minPatternNodeLabelInDegree, E.minPatternNodeLabelOutDegree; p[d.id].degree < j && c.splice(f, 1); } } } else c.splice(f, 1); else c.splice(f, 1); } h || q.push({ nodes: [r].concat(c) }); }); var V = k(e, B.id, !1).length, G = {}; n ? (Object.keys(V).forEach(function (t) { var e = y[t].node[o]; G[e] ? G[e].push(V[t]) : (G[e] = [V[t]]); }), Object.keys(G).forEach(function (t) { G[t].sort(function (t, e) { return t - e; }); })) : (G = z); for ( var H = function (r) { var i = q[r], s = i.nodes[0], c = {}, u = {}; i.nodes.forEach(function (t, e) { u[t.id] = { idx: e, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var n = t[o]; c[n] ? c[n]++ : (c[n] = 1); }); var h = [], l = {}; t.edges.forEach(function (t) { u[t.source] && u[t.target] && (h.push(t), l[t[a]] ? l[t[a]]++ : (l[t[a]] = 1), u[t.source].degree++, u[t.target].degree++, u[t.source].outDegree++, u[t.target].inDegree++); }); for ( var f = Object.keys(b).length, d = !1, g = 0; g < f; g++ ) { var v = Object.keys(b)[g]; if (!l[v] || l[v] < b[v].length) { d = !0; break; } } if (d) return q.splice(r, 1), "continue"; var x = h.length; if (x < e.edges.length) return q.splice(r, 1), "break"; var w = !1, S = function (t) { var e = h[t], r = e[a], i = b[r]; if (!i || !i.length) return ( l[r]--, i && l[r] < i.length ? ((w = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue") ); var s = u[e.source].node[o], c = u[e.target].node[o], f = !1; return ( i.forEach(function (t) { var e = y[t.source].node, r = y[t.target].node; e[o] === s && r[o] === c && (f = !0), n || e[o] !== c || r[o] !== s || (f = !0); }), f ? void 0 : (l[r]--, i && l[r] < i.length ? ((w = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue")) ); }; for (g = x - 1; g >= 0; g--) { if ("break" === S(g)) break; } if (w) return q.splice(r, 1), "continue"; i.edges = h; var O = k(i, i.nodes[0].id, !1).length; if ( (Object.keys(O) .reverse() .forEach(function (t) { if (t !== i.nodes[0].id && !w) { if (O[t] === 1 / 0) { var e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (w = !0); var n = i.nodes.indexOf(u[t].node); return i.nodes.splice(n, 1), void (u[t] = void 0); } var r = p[t].node[o]; if ( !G[r] || !G[r].length || O[t] > G[r][G[r].length - 1] ) { e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (w = !0); n = i.nodes.indexOf(u[t].node); i.nodes.splice(n, 1), (u[t] = void 0); } } }), w) ) return q.splice(r, 1), "continue"; for (var M = !0, C = 0; M && !w; ) { if ( ((M = !1), n ? u[s.id].degree < y[B.id].degree || u[s.id].inDegree < y[B.id].inDegree || u[s.id].outDegree < y[B.id].outDegree : u[s.id].degree < y[B.id].degree) ) { w = !0; break; } if (c[s[o]] < m[s[o]].length) { w = !0; break; } for (var E = i.nodes.length - 1; E >= 0; E--) { var j = i.nodes[E], P = u[j.id].degree, A = u[j.id].inDegree, I = u[j.id].outDegree, T = j[o], N = gt(R, T, y, m), L = N.minPatternNodeLabelDegree, D = N.minPatternNodeLabelInDegree, _ = N.minPatternNodeLabelOutDegree; if (n ? P < L || A < D || I < _ : P < L) { if ((c[j[o]]--, c[j[o]] < m[j[o]].length)) { w = !0; break; } i.nodes.splice(E, 1), (u[j.id] = void 0), (M = !0); } } if (w || (!M && 0 !== C)) break; for (var F = (x = h.length) - 1; F >= 0; F--) { var Y = h[F]; if (!u[Y.source] || !u[Y.target]) { h.splice(F, 1); var X = Y[a]; if ( (l[X]--, u[Y.source] && (u[Y.source].degree--, u[Y.source].outDegree--), u[Y.target] && (u[Y.target].degree--, u[Y.target].inDegree--), b[X] && l[X] < b[X].length) ) { w = !0; break; } M = !0; } } C++; } return w || w || i.nodes.length < e.nodes.length || h.length < e.edges.length ? (q.splice(r, 1), "continue") : void 0; }, U = q.length - 1; U >= 0; U-- ) { if ("break" === H(U)) break; } var Z = q.length, K = function (t) { var e = q[t], n = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); n[e] ? n[e]++ : (n[e] = 1); }); for ( var r = function (t) { var e = q[t], r = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); r[e] ? r[e]++ : (r[e] = 1); }); var i = !0; Object.keys(r).length !== Object.keys(n).length ? (i = !1) : Object.keys(n).forEach(function (t) { r[t] !== n[t] && (i = !1); }), i && q.splice(t, 1); }, i = Z - 1; i > t; i-- ) r(i); Z = q.length; }; for (U = 0; U <= Z - 1; U++) K(U); return q; } } }, yt = (function () { function t(t) { void 0 === t && (t = 10), (this.linkedList = new a()), (this.maxStep = t); } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this.linkedList.toArray().length; }, enumerable: !1, configurable: !0, }), (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.isMaxStack = function () { return this.toArray().length >= this.maxStep; }), (t.prototype.peek = function () { return this.isEmpty() ? null : this.linkedList.head.value; }), (t.prototype.push = function (t) { this.linkedList.prepend(t), this.length > this.maxStep && this.linkedList.deleteTail(); }), (t.prototype.pop = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toArray = function () { return this.linkedList.toArray().map(function (t) { return t.value; }); }), (t.prototype.clear = function () { for (; !this.isEmpty(); ) this.pop(); }), t ); })(), mt = S; e.default = { getAdjMatrix: r, breadthFirstSearch: l, connectedComponent: d, getDegree: g, getInDegree: v, getOutDegree: y, detectCycle: S, detectDirectedCycle: mt, detectAllCycles: w, detectAllDirectedCycle: x, detectAllUndirectedCycle: b, depthFirstSearch: m, dijkstra: k, findAllPath: P, findShortestPath: j, floydWarshall: A, labelPropagation: I, louvain: F, iLouvain: Y, kCore: X, kMeans: W, cosineSimilarity: q, nodesCosineSimilarity: V, minimumSpanningTree: $, pageRank: Q, getNeighbors: c, Stack: yt, GADDI: vt, }; }, 3: function (t, e, n) { "use strict"; n.d(e, "b", function () { return i.a; }), n.d(e, "c", function () { return i.b; }), n.d(e, "d", function () { return i.c; }), n.d(e, "a", function () { return r; }); var r = {}; n.r(r), n.d(r, "leftTranslate", function () { return o; }), n.d(r, "leftRotate", function () { return a; }), n.d(r, "leftScale", function () { return s; }), n.d(r, "transform", function () { return c; }), n.d(r, "direction", function () { return u; }), n.d(r, "angleTo", function () { return h; }), n.d(r, "vertical", function () { return l; }); var i = n(4); function o(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromTranslation(r, n), i.a.multiply(t, r, e); } function a(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromRotation(r, n), i.a.multiply(t, r, e); } function s(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromScaling(r, n), i.a.multiply(t, r, e); } function c(t, e) { for ( var n, r, c, u = t ? [].concat(t) : [1, 0, 0, 0, 1, 0, 0, 0, 1], h = 0, l = e.length; h < l; h++ ) { var f = e[h]; switch (f[0]) { case "t": o(u, u, [f[1], f[2]]); break; case "s": s(u, u, [f[1], f[2]]); break; case "r": a(u, u, f[1]); break; case "m": (n = u), (r = u), (c = f[1]), i.a.multiply(n, c, r); } } return u; } function u(t, e) { return t[0] * e[1] - e[0] * t[1]; } function h(t, e, n) { var r = i.b.angle(t, e), o = u(t, e) >= 0; return n ? (o ? 2 * Math.PI - r : r) : o ? r : 2 * Math.PI - r; } function l(t, e, n) { return ( n ? ((t[0] = e[1]), (t[1] = -1 * e[0])) : ((t[0] = -1 * e[1]), (t[1] = e[0])), t ); } }, 30: function (t, e, n) { self, (t.exports = (function () { "use strict"; var t = { d: function (e, n) { for (var r in n) t.o(n, r) && !t.o(e, r) && Object.defineProperty(e, r, { enumerable: !0, get: n[r] }); }, o: function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }, r: function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module", }), Object.defineProperty(t, "__esModule", { value: !0 }); }, }, e = {}; function n(t, e) { return void 0 === t ? e : t; } t.r(e), t.d(e, { default: function () { return de; }, }); var r, i = Math.round, o = Math.abs, a = Date.now, s = "compute", c = "auto", u = "manipulation", h = "none", l = "pan-x", f = "pan-y", d = ((r = {}), [ "auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none", ].forEach(function (t) { return (r[t] = !0); }), r), p = "touch", g = ["x", "y"], v = ["clientX", "clientY"], y = 32, m = "function" != typeof Object.assign ? function (t) { if (null == t) throw new TypeError( "Cannot convert undefined or null to object", ); for (var e = Object(t), n = 1; n < arguments.length; n++) { var r = arguments[n]; if (null != r) for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]); } return e; } : Object.assign, b = 1; function x(t, e, n) { var r; if (t) if (t.forEach) t.forEach(e, n); else if (void 0 !== t.length) for (r = 0; r < t.length; ) e.call(n, t[r], r, t), r++; else for (r in t) t.hasOwnProperty(r) && e.call(n, t[r], r, t); } function w(t, e, n) { return !!Array.isArray(t) && (x(t, n[e], n), !0); } function S(t, e, n) { if (t.indexOf && !n) return t.indexOf(e); for (var r = 0; r < t.length; ) { if ((n && t[r][n] == e) || (!n && t[r] === e)) return r; r++; } return -1; } function O(t) { return (O = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function M(t, e) { return "function" === O(t) ? t.apply((e && e[0]) || void 0, e) : t; } function k(t, e) { var n = e.manager; return n ? n.get(t) : t; } function C(t) { return 16 & t ? "cancel" : 8 & t ? "end" : 4 & t ? "move" : 2 & t ? "start" : ""; } var E = (function () { function t(e) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, this.defaults, e || {})), (this.id = b++), (this.manager = null), (this.options.enable = n(this.options.enable, !0)), (this.state = 1), (this.simultaneous = {}), (this.requireFail = []); } var e, r; return ( (e = t), (r = [ { key: "set", value: function (t) { return ( m(this.options, t), this.manager && this.manager.touchAction.update(), this ); }, }, { key: "recognizeWith", value: function (t) { if (w(t, "recognizeWith", this)) return this; var e = this.simultaneous; return ( e[(t = k(t, this)).id] || ((e[t.id] = t), t.recognizeWith(this)), this ); }, }, { key: "dropRecognizeWith", value: function (t) { return ( w(t, "dropRecognizeWith", this) || ((t = k(t, this)), delete this.simultaneous[t.id]), this ); }, }, { key: "requireFailure", value: function (t) { if (w(t, "requireFailure", this)) return this; var e = this.requireFail; return ( -1 === S(e, (t = k(t, this))) && (e.push(t), t.requireFailure(this)), this ); }, }, { key: "dropRequireFailure", value: function (t) { if (w(t, "dropRequireFailure", this)) return this; t = k(t, this); var e = S(this.requireFail, t); return e > -1 && this.requireFail.splice(e, 1), this; }, }, { key: "hasRequireFailures", value: function () { return this.requireFail.length > 0; }, }, { key: "canRecognizeWith", value: function (t) { return !!this.simultaneous[t.id]; }, }, { key: "emit", value: function (t) { var e = this, n = this.state; function r(n) { e.manager.emit(n, t); } n < 8 && r(e.options.event + C(n)), r(e.options.event), t.additionalEvent && r(t.additionalEvent), n >= 8 && r(e.options.event + C(n)); }, }, { key: "tryEmit", value: function (t) { if (this.canEmit()) return this.emit(t); this.state = y; }, }, { key: "canEmit", value: function () { for (var t = 0; t < this.requireFail.length; ) { if (!(33 & this.requireFail[t].state)) return !1; t++; } return !0; }, }, { key: "recognize", value: function (t) { var e = m({}, t); if (!M(this.options.enable, [this, e])) return this.reset(), void (this.state = y); 56 & this.state && (this.state = 1), (this.state = this.process(e)), 30 & this.state && this.tryEmit(e); }, }, { key: "process", value: function (t) {} }, { key: "getTouchAction", value: function () {} }, { key: "reset", value: function () {} }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, r), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function j(t) { return (j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function P(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function A(t, e) { return (A = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function I(t, e) { if (e && ("object" === j(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function T(t) { return (T = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } E.prototype.defaults = {}; var N = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && A(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = T(r); if (i) { var n = T(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return I(this, t); }); function a() { return P(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "attrTest", value: function (t) { var e = this.options.pointers; return 0 === e || t.pointers.length === e; }, }, { key: "process", value: function (t) { var e = this.state, n = t.eventType, r = 6 & e, i = this.attrTest(t); return r && (8 & n || !i) ? 16 | e : r || i ? 4 & n ? 8 | e : 2 & e ? 4 | e : 2 : y; }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function B(t) { return (B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function L(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function D() { return (D = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (t, e, n) { var r = _(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function _(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = Y(t)); ); return t; } function R(t, e) { return (R = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function F(t, e) { if (e && ("object" === B(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Y(t) { return (Y = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } N.prototype.defaults = { pointers: 1 }; var X = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && R(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Y(r); if (i) { var n = Y(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return F(this, t); }); function a() { return L(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( D(Y(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.rotation) > this.options.threshold || 2 & this.state) ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(N); function z(t) { return (z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function W(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function q() { return (q = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (t, e, n) { var r = V(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function V(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = U(t)); ); return t; } function G(t, e) { return (G = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function H(t, e) { if (e && ("object" === z(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function U(t) { return (U = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } X.prototype.defaults = { event: "rotate", threshold: 0, pointers: 2 }; var Z = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && G(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = U(r); if (i) { var n = U(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return H(this, t); }); function a() { return W(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( q(U(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.scale - 1) > this.options.threshold || 2 & this.state) ); }, }, { key: "emit", value: function (t) { if (1 !== t.scale) { var e = t.scale < 1 ? "in" : "out"; t.additionalEvent = this.options.event + e; } q(U(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(N); function K(t) { return 16 === t ? "down" : 8 === t ? "up" : 2 === t ? "left" : 4 === t ? "right" : ""; } function $(t) { return ($ = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Q(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function J() { return (J = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (t, e, n) { var r = tt(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function tt(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = rt(t)); ); return t; } function et(t, e) { return (et = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function nt(t, e) { if (e && ("object" === $(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function rt(t) { return (rt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } Z.prototype.defaults = { event: "pinch", threshold: 0, pointers: 2 }; var it = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && et(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = rt(r); if (i) { var n = rt(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return nt(this, t); }); function a() { var t; return ( Q(this, a), ((t = o.apply(this, arguments)).pX = null), (t.pY = null), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { var t = this.options.direction, e = []; return 6 & t && e.push(f), 24 & t && e.push(l), e; }, }, { key: "directionTest", value: function (t) { var e = this.options, n = !0, r = t.distance, i = t.direction, o = t.deltaX, a = t.deltaY; return ( i & e.direction || (6 & e.direction ? ((i = 0 === o ? 1 : o < 0 ? 2 : 4), (n = o !== this.pX), (r = Math.abs(t.deltaX))) : ((i = 0 === a ? 1 : a < 0 ? 8 : 16), (n = a !== this.pY), (r = Math.abs(t.deltaY)))), (t.direction = i), n && r > e.threshold && i & e.direction ); }, }, { key: "attrTest", value: function (t) { return ( N.prototype.attrTest.call(this, t) && (2 & this.state || (!(2 & this.state) && this.directionTest(t))) ); }, }, { key: "emit", value: function (t) { (this.pX = t.deltaX), (this.pY = t.deltaY); var e = K(t.direction); e && (t.additionalEvent = this.options.event + e), J(rt(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(N); function ot(t) { return (ot = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function at(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function st() { return (st = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (t, e, n) { var r = ct(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function ct(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = lt(t)); ); return t; } function ut(t, e) { return (ut = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function ht(t, e) { if (e && ("object" === ot(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function lt(t) { return (lt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } it.prototype.defaults = { event: "pan", threshold: 10, pointers: 1, direction: 30, }; var ft = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ut(t, e); })(s, t); var e, n, r, i, a = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = lt(r); if (i) { var n = lt(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return ht(this, t); }); function s() { return at(this, s), a.apply(this, arguments); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return it.prototype.getTouchAction.call(this); }, }, { key: "attrTest", value: function (t) { var e, n = this.options.direction; return ( 30 & n ? (e = t.overallVelocity) : 6 & n ? (e = t.overallVelocityX) : 24 & n && (e = t.overallVelocityY), st(lt(s.prototype), "attrTest", this).call(this, t) && n & t.offsetDirection && t.distance > this.options.threshold && t.maxPointers === this.options.pointers && o(e) > this.options.velocity && 4 & t.eventType ); }, }, { key: "emit", value: function (t) { var e = K(t.offsetDirection); e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(N); function dt(t, e) { return function () { return t.apply(e, arguments); }; } function pt(t, e, n) { return setTimeout(dt(t, n), e); } function gt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return Math.sqrt(r * r + i * i); } function vt(t) { return (vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function yt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function mt(t, e) { return (mt = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function bt(t, e) { if (e && ("object" === vt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function xt(t) { return (xt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } ft.prototype.defaults = { event: "swipe", threshold: 10, velocity: 0.3, direction: 30, pointers: 1, }; var wt = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && mt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = xt(r); if (i) { var n = xt(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return bt(this, t); }); function a() { var t; return ( yt(this, a), ((t = o.apply(this, arguments)).pTime = !1), (t.pCenter = !1), (t._timer = null), (t._input = null), (t.count = 0), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [u]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime < n.time; if ((this.reset(), 1 & t.eventType && 0 === this.count)) return this.failTimeout(); if (i && o && r) { if (4 !== t.eventType) return this.failTimeout(); var a = !this.pTime || t.timeStamp - this.pTime < n.interval, s = !this.pCenter || gt(this.pCenter, t.center) < n.posThreshold; if ( ((this.pTime = t.timeStamp), (this.pCenter = t.center), s && a ? (this.count += 1) : (this.count = 1), (this._input = t), 0 == this.count % n.taps) ) return this.hasRequireFailures() ? ((this._timer = pt( function () { (e.state = 8), e.tryEmit(); }, n.interval, this, )), 2) : 8; } return y; }, }, { key: "failTimeout", value: function () { var t = this; return ( (this._timer = pt( function () { t.state = y; }, this.options.interval, this, )), y ); }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function () { 8 === this.state && ((this._input.tapCount = this.count), this.manager.emit(this.options.event, this._input)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function St(t) { return (St = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Ot(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Mt(t, e) { return (Mt = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function kt(t, e) { if (e && ("object" === St(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } wt.prototype.defaults = { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10, }; var Et = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && Mt(t, e); })(s, t); var e, n, r, i, o = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Ct(r); if (i) { var n = Ct(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return kt(this, t); }); function s() { var t; return ( Ot(this, s), ((t = o.apply(this, arguments))._timer = null), (t._input = null), t ); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return [c]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime > n.time; if ( ((this._input = t), !i || !r || (12 & t.eventType && !o)) ) this.reset(); else if (1 & t.eventType) this.reset(), (this._timer = pt( function () { (e.state = 8), e.tryEmit(); }, n.time, this, )); else if (4 & t.eventType) return 8; return y; }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function (t) { 8 === this.state && (t && 4 & t.eventType ? this.manager.emit( "".concat(this.options.event, "up"), t, ) : ((this._input.timeStamp = a()), this.manager.emit(this.options.event, this._input))); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(E); function jt(t, e) { return t.indexOf(e) > -1; } Et.prototype.defaults = { event: "press", pointers: 1, time: 251, threshold: 9, }; var Pt = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.manager = e), this.set(n); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { t === s && (t = this.compute()), (this.actions = t.toLowerCase().trim()); }, }, { key: "update", value: function () { this.set(this.manager.options.touchAction); }, }, { key: "compute", value: function () { var t = []; return ( x(this.manager.recognizers, function (e) { M(e.options.enable, [e]) && (t = t.concat(e.getTouchAction())); }), (function (t) { if (jt(t, h)) return h; var e = jt(t, l), n = jt(t, f); return e && n ? h : e || n ? e ? l : f : jt(t, u) ? u : c; })(t.join(" ")) ); }, }, { key: "preventDefaults", value: function (t) { var e = t.srcEvent, n = t.offsetDirection; if (this.manager.session.prevented) e.preventDefault(); else { var r = this.actions, i = jt(r, h) && !d.none, o = jt(r, f) && !d["pan-y"], a = jt(r, l) && !d["pan-x"]; if (i) { var s = 1 === t.pointers.length, c = t.distance < 2, u = t.deltaTime < 250; if (s && c && u) return; } if (!a || !o) return i || (o && 6 & n) || (a && 24 & n) ? this.preventSrc(e) : void 0; } }, }, { key: "preventSrc", value: function (t) { (this.manager.session.prevented = !0), t.preventDefault(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function At(t) { var e = t.length; if (1 === e) return { x: i(t[0].clientX), y: i(t[0].clientY) }; for (var n = 0, r = 0, o = 0; o < e; ) (n += t[o].clientX), (r += t[o].clientY), o++; return { x: i(n / e), y: i(r / e) }; } function It(t) { for (var e = [], n = 0; n < t.pointers.length; ) (e[n] = { clientX: i(t.pointers[n].clientX), clientY: i(t.pointers[n].clientY), }), n++; return { timeStamp: a(), pointers: e, center: At(e), deltaX: t.deltaX, deltaY: t.deltaY, }; } function Tt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return (180 * Math.atan2(i, r)) / Math.PI; } function Nt(t, e) { return t === e ? 1 : o(t) >= o(e) ? t < 0 ? 2 : 4 : e < 0 ? 8 : 16; } function Bt(t, e, n) { return { x: e / t || 0, y: n / t || 0 }; } function Lt(t, e, n) { var r = n.pointers.length, i = n.changedPointers.length, s = 1 & e && r - i == 0, c = 12 & e && r - i == 0; (n.isFirst = !!s), (n.isFinal = !!c), s && (t.session = {}), (n.eventType = e), (function (t, e) { var n = t.session, r = e.pointers, i = r.length; n.firstInput || (n.firstInput = It(e)), i > 1 && !n.firstMultiple ? (n.firstMultiple = It(e)) : 1 === i && (n.firstMultiple = !1); var s = n.firstInput, c = n.firstMultiple, u = c ? c.center : s.center, h = (e.center = At(r)); (e.timeStamp = a()), (e.deltaTime = e.timeStamp - s.timeStamp), (e.angle = Tt(u, h)), (e.distance = gt(u, h)), (function (t, e) { var n = e.center, r = t.offsetDelta || {}, i = t.prevDelta || {}, o = t.prevInput || {}; (1 !== e.eventType && 4 !== o.eventType) || ((i = t.prevDelta = { x: o.deltaX || 0, y: o.deltaY || 0 }), (r = t.offsetDelta = { x: n.x, y: n.y })), (e.deltaX = i.x + (n.x - r.x)), (e.deltaY = i.y + (n.y - r.y)); })(n, e), (e.offsetDirection = Nt(e.deltaX, e.deltaY)); var l, f, d = Bt(e.deltaTime, e.deltaX, e.deltaY); (e.overallVelocityX = d.x), (e.overallVelocityY = d.y), (e.overallVelocity = o(d.x) > o(d.y) ? d.x : d.y), (e.scale = c ? ((l = c.pointers), gt((f = r)[0], f[1], v) / gt(l[0], l[1], v)) : 1), (e.rotation = c ? (function (t, e) { return Tt(e[1], e[0], v) + Tt(t[1], t[0], v); })(c.pointers, r) : 0), (e.maxPointers = n.prevInput ? e.pointers.length > n.prevInput.maxPointers ? e.pointers.length : n.prevInput.maxPointers : e.pointers.length), (function (t, e) { var n, r, i, a, s = t.lastInterval || e, c = e.timeStamp - s.timeStamp; if ( 8 !== e.eventType && (c > 25 || void 0 === s.velocity) ) { var u = e.deltaX - s.deltaX, h = e.deltaY - s.deltaY, l = Bt(c, u, h); (r = l.x), (i = l.y), (n = o(l.x) > o(l.y) ? l.x : l.y), (a = Nt(u, h)), (t.lastInterval = e); } else (n = s.velocity), (r = s.velocityX), (i = s.velocityY), (a = s.direction); (e.velocity = n), (e.velocityX = r), (e.velocityY = i), (e.direction = a); })(n, e); })(t, n), t.emit("hammer.input", n), t.recognize(n), (t.session.prevInput = n); } function Dt(t) { return t.trim().split(/\s+/g); } function _t(t, e, n) { x(Dt(e), function (e) { t.addEventListener(e, n, !1); }); } var Rt = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t); var r = this; (this.manager = e), (this.callback = n), (this.eventHandler = function (t) { M(e.options.enable, [e]) && r.handler(t); }), this.init(); } var e, n; return ( (e = t), (n = [ { key: "handler", value: function () {} }, { key: "init", value: function () { var t, e, n; (t = this.manager), (e = this.events || ""), (n = this.eventHandler), x(Dt(e), function (e) { t.on("origin_input:".concat(e), n); }); }, }, { key: "destroy", value: function () { removeManagerListeners( this.manager, this.events || "", this.eventHandler, ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function Ft(t) { return Array.prototype.slice.call(t, 0); } function Yt(t, e, n) { for (var r = [], i = [], o = 0; o < t.length; ) { var a = e ? t[o][e] : t[o]; S(i, a) < 0 && r.push(t[o]), (i[o] = a), o++; } return ( n && (r = e ? r.sort(function (t, n) { return t[e] > n[e]; }) : r.sort()), r ); } function Xt(t) { return (Xt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function zt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Wt(t, e) { return (Wt = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function qt(t, e) { if (e && ("object" === Xt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Vt(t) { return (Vt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Gt = { touchstart: 1, touchmove: 2, touchend: 4, touchcancel: 8 }, Ht = "touchstart touchmove touchend touchcancel", Ut = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && Wt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Vt(r); if (i) { var n = Vt(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return qt(this, t); }); function a() { var t; return ( zt(this, a), (a.prototype.evTarget = Ht), (a.prototype.targetIds = {}), (a.prototype.events = Ht), ((t = o.apply(this, arguments)).evTarget = Ht), (t.targetIds = {}), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = Gt[t.type], n = Zt.call(this, t, e); n && this.callback(this.manager, e, { pointers: n[0], changedPointers: n[1], pointerType: p, srcEvent: t, }); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Rt); function Zt(t, e) { var n, r, i = Ft(t.touches), o = this.targetIds; if (3 & e && 1 === i.length) return (o[i[0].identifier] = !0), [i, i]; var a = Ft(t.changedTouches), s = []; if ((this.target, (r = i), 1 === e)) for (n = 0; n < r.length; ) (o[r[n].identifier] = !0), n++; for (n = 0; n < a.length; ) o[a[n].identifier] && s.push(a[n]), 12 & e && delete o[a[n].identifier], n++; return s.length ? [Yt(r.concat(s), "identifier", !0), s] : void 0; } var Kt = (function () { function t(e) { var n, r = this; !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, Qt.defaults, e || {})), (this.handlers = {}), (this.filters = []), (this.session = {}), (this.recognizers = []), (this.input = ((n = Ut), this.options.inputClass && (n = inputClass), new n(this, Lt))), (this.touchAction = new Pt(this, this.options.touchAction)), x( this.options.recognizers, function (t) { var e = r.add(new t[0](t[1])); t[2] && e.recognizeWith(t[2]), t[3] && e.requireFailure(t[3]); }, this, ); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { return ( m(this.options, t), t.touchAction && this.touchAction.update(), this ); }, }, { key: "stop", value: function (t) { this.session.stopped = t ? 2 : 1; }, }, { key: "addFilter", value: function (t) { if ("function" != typeof t) throw new Error("filter must be a function"); this.filters.push(t); }, }, { key: "recognize", value: function (t) { var e = this.session; if (!e.stopped) { var n; this.touchAction.preventDefaults(t); var r = this.recognizers, i = e.curRecognizer; (!i || (i && 8 & i.state)) && (i = e.curRecognizer = null); for (var o = 0; o < r.length; ) (n = r[o]), 2 === e.stopped || (i && n !== i && !n.canRecognizeWith(i)) ? n.reset() : n.recognize(t), !i && 14 & n.state && (i = e.curRecognizer = n), o++; } }, }, { key: "get", value: function (t) { if (t instanceof E) return t; for (var e = this.recognizers, n = 0; n < e.length; n++) if (e[n].options.event === t) return e[n]; return null; }, }, { key: "add", value: function (t) { if (w(t, "add", this)) return this; var e = this.get(t.options.event); return ( e && this.remove(e), this.recognizers.push(t), (t.manager = this), this.touchAction.update(), t ); }, }, { key: "remove", value: function (t) { if (w(t, "remove", this)) return this; if ((t = this.get(t))) { var e = this.recognizers, n = S(e, t); -1 !== n && (e.splice(n, 1), this.touchAction.update()); } return this; }, }, { key: "on", value: function (t, e) { if (void 0 !== t && void 0 !== e) { var n = this.handlers; return ( x(Dt(t), function (t) { (n[t] = n[t] || []), n[t].push(e); }), this ); } }, }, { key: "off", value: function (t, e) { if (void 0 !== t) { var n = this.handlers; return ( x(Dt(t), function (t) { e ? n[t] && n[t].splice(S(n[t], e), 1) : delete n[t]; }), this ); } }, }, { key: "emit", value: function (t, e) { var n = this.handlers[t] && this.handlers[t].slice(); if ((this.filters, n && n.length)) { t.startsWith("origin_input") || ((e.type = t), (e.preventDefault = function () { e.srcEvent.preventDefault && e.srcEvent.preventDefault(); })); for (var r = 0; r < n.length; ) n[r](e), r++; } }, }, { key: "destroy", value: function () { (this.handlers = {}), (this.filters = []), (this.session = {}), this.input.destroy(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function $t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } } var Qt = (function (t, e, n) { return ( e && $t(t.prototype, e), n && $t(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t ); })(function t(e) { return ( (function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), ((e = e || {}).recognizers = n(e.recognizers, t.defaults.preset)), new Kt(e) ); }); function Jt(t) { return (Jt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function te(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ee(t, e) { return (ee = Object.setPrototypeOf || function (t, e) { return (t.__proto__ = e), t; })(t, e); } function ne(t, e) { if (e && ("object" === Jt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function re(t) { return (re = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } Qt.defaults = { domEvents: !1, touchAction: s, enable: !0, inputClass: null, preset: [ [X, { enable: !1 }], [Z, { enable: !1 }, ["rotate"]], [ft, { direction: 6 }], [it, { direction: 6 }, ["swipe"]], [wt], [wt, { event: "doubletap", taps: 2 }, ["tap"]], [Et], ], }; var ie = { pointerdown: 1, pointermove: 2, pointerup: 4, pointercancel: 8, pointerout: 8, }, oe = { 2: p, 3: "pen", 4: "mouse", 5: "kinect" }, ae = "pointerdown", se = "pointermove pointerup pointercancel", ce = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ee(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = re(r); if (i) { var n = re(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return ne(this, t); }); function a() { var t; return ( te(this, a), (a.prototype.events = "".concat(ae, " ").concat(se)), ((t = o.apply(this, arguments)).evEl = ae), (t.evWin = se), (t.store = t.manager.session.pointerEvents = []), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = this.store, n = !1, r = t.type.toLowerCase().replace("ms", ""), i = ie[r], o = oe[t.pointerType] || t.pointerType, a = o === p, s = S(e, t.pointerId, "pointerId"); 1 & i && (0 === t.button || a) ? s < 0 && (e.push(t), (s = e.length - 1)) : 12 & i && (n = !0), s < 0 || ((e[s] = t), this.callback(this.manager, i, { pointers: e, changedPointers: [t], pointerType: o, srcEvent: t, }), n && e.splice(s, 1)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r); } })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Rt); function ue(t, e, n) { x(Dt(e), function (e) { t.removeEventListener(e, n, !1); }); } function he(t, e, n) { var r = "DEPRECATED METHOD: ".concat(e, "\n").concat(n, " AT \n"); return function () { var e = new Error("get-stack-trace"), n = e && e.stack ? e.stack .replace(/^[^\(]+?[\n$]/gm, "") .replace(/^\s+at\s+/gm, "") .replace(/^Object.\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", i = console.warn; return i && i(r, n), t.apply(this, arguments); }; } var le = he( function (t, e, n) { for (var r = Object.keys(e), i = 0; i < r.length; ) (!n || (n && void 0 === t[r[i]])) && (t[r[i]] = e[r[i]]), i++; return t; }, "extend", "Use `assign`.", ), fe = he( function (t, e) { return le(t, e, !0); }, "merge", "Use `assign`.", ), de = m(Qt, { INPUT_START: 1, INPUT_MOVE: 2, INPUT_END: 4, INPUT_CANCEL: 8, STATE_POSSIBLE: 1, STATE_BEGAN: 2, STATE_CHANGED: 4, STATE_ENDED: 8, STATE_RECOGNIZED: 8, STATE_CANCELLED: 16, STATE_FAILED: y, DIRECTION_NONE: 1, DIRECTION_LEFT: 2, DIRECTION_RIGHT: 4, DIRECTION_UP: 8, DIRECTION_DOWN: 16, DIRECTION_HORIZONTAL: 6, DIRECTION_VERTICAL: 24, DIRECTION_ALL: 30, Manager: Kt, Input: Rt, TouchAction: Pt, TouchInput: Ut, PointerEventInput: ce, Recognizer: E, AttrRecognizer: N, Tap: wt, Pan: it, Swipe: ft, Pinch: Z, Rotate: X, Press: Et, on: _t, off: ue, each: x, merge: fe, extend: le, assign: m, inherit: function (t, e, n) { var r, i = e.prototype; ((r = t.prototype = Object.create(i)).constructor = t), (r._super = i), n && m(r, n); }, bindFn: dt, toArray: Ft, inArray: S, uniqueArray: Yt, splitStr: Dt, boolOrFn: M, hasParent: function (t, e) { for (; t; ) { if (t === e) return !0; t = t.parentNode; } return !1; }, addEventListeners: _t, removeEventListeners: ue, }); return e; })()); }, 32: function (t, e, n) { "use strict"; var r = {}; n.r(r), n.d(r, "proccessToFunc", function () { return u; }), n.d(r, "buildTextureData", function () { return h; }), n.d(r, "buildTextureDataWithOneEdgeAttr", function () { return l; }), n.d(r, "buildTextureDataWithTwoEdgeAttr", function () { return f; }), n.d(r, "attributesToTextureData", function () { return d; }), n.d(r, "arrayToTextureData", function () { return p; }), n.d(r, "radialLayout", function () { return g; }); var i = n(1), o = n(75), a = n(2), s = n(0), c = a.h.traverseTree, u = function (t, e) { return t ? Object(s.isNumber)(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, h = function (t, e) { var n = [], r = [], i = {}, o = 0; for (o = 0; o < t.length; o++) { var a = t[o]; (i[a.id] = o), n.push(a.x), n.push(a.y), n.push(0), n.push(0), r.push([]); } for (o = 0; o < e.length; o++) { var s = e[o]; r[i[s.source]].push(i[s.target]), r[i[s.target]].push(i[s.source]); } var c = 0; for (o = 0; o < t.length; o++) { var u = n.length, h = r[o], l = h.length; (n[4 * o + 2] = u), (n[4 * o + 3] = h.length), (c = Math.max(c, h.length)); for (var f = 0; f < l; ++f) { var d = h[f]; n.push(+d); } } for (; n.length % 4 != 0; ) n.push(0); return { array: new Float32Array(n), maxEdgePerVetex: c }; }, l = function (t, e, n) { var r = [], i = [], o = {}, a = 0; for (a = 0; a < t.length; a++) { var s = t[a]; (o[s.id] = a), r.push(s.x), r.push(s.y), r.push(0), r.push(0), i.push([]); } for (a = 0; a < e.length; a++) { var c = e[a]; i[o[c.source]].push(o[c.target]), i[o[c.source]].push(n(c)), i[o[c.target]].push(o[c.source]), i[o[c.target]].push(n(c)); } var u = 0; for (a = 0; a < t.length; a++) { var h = r.length, l = i[a], f = l.length; (r[4 * a + 2] = h), (r[4 * a + 3] = f / 2), (u = Math.max(u, f / 2)); for (var d = 0; d < f; ++d) { var p = l[d]; r.push(+p); } } for (; r.length % 4 != 0; ) r.push(0); return { array: new Float32Array(r), maxEdgePerVetex: u }; }, f = function (t, e, n, r) { var i = [], o = [], a = {}, s = 0; for (s = 0; s < t.length; s++) { var c = t[s]; (a[c.id] = s), i.push(c.x), i.push(c.y), i.push(0), i.push(0), o.push([]); } for (s = 0; s < e.length; s++) { var u = e[s]; o[a[u.source]].push(a[u.target]), o[a[u.source]].push(n(u)), o[a[u.source]].push(r(u)), o[a[u.source]].push(0), o[a[u.target]].push(a[u.source]), o[a[u.target]].push(n(u)), o[a[u.target]].push(r(u)), o[a[u.target]].push(0); } var h = 0; for (s = 0; s < t.length; s++) { var l = i.length, f = o[s], d = f.length; (i[4 * s + 2] = l + (1048576 * d) / 4), (i[4 * s + 3] = 0), (h = Math.max(h, d / 4)); for (var p = 0; p < d; ++p) { var g = f[p]; i.push(+g); } } for (; i.length % 4 != 0; ) i.push(0); return { array: new Float32Array(i), maxEdgePerVetex: h }; }, d = function (t, e) { var n = [], r = t.length, i = {}; return ( e.forEach(function (e) { t.forEach(function (t, o) { if ( (void 0 === i[e[t]] && (i[e[t]] = Object.keys(i).length), n.push(i[e[t]]), o === r - 1) ) for (; n.length % 4 != 0; ) n.push(0); }); }), { array: new Float32Array(n), count: Object.keys(i).length } ); }, p = function (t) { for ( var e = [], n = t.length, r = t[0].length, i = function (r) { t.forEach(function (t, i) { if ((e.push(t[r]), i === n - 1)) for (; e.length % 4 != 0; ) e.push(0); }); }, o = 0; o < r; o++ ) i(o); return new Float32Array(e); }, g = function (t, e) { var n = { x: 1 / 0, y: 1 / 0 }, r = { x: -1 / 0, y: -1 / 0 }, i = "x", o = "y"; e && ["V", "TB", "BT"].indexOf(e) >= 0 && ((o = "x"), (i = "y")); var a = 0; c(t, function (t) { return ( a++, t.x > r.x && (r.x = t.x), t.x < n.x && (n.x = t.x), t.y > r.y && (r.y = t.y), t.y < n.y && (n.y = t.y), !0 ); }); var s = (2 * Math.PI) / a, u = r[o] - n[o]; return ( 0 === u || c(t, function (e) { var r = ((e[o] - n[o]) / u) * (2 * Math.PI - s) + s, a = Math.abs("x" === i ? e.x - t.x : e.y - t.y); return (e.x = a * Math.cos(r)), (e.y = a * Math.sin(r)), !0; }), t ); }, v = Object(i.a)(Object(i.a)(Object(i.a)({}, a.h), o), r); e.a = v; }, 395: function (t, e, n) { "use strict"; var r = function () { return (r = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function i(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } var o = n(2), a = n(0); Object(o.l)( "circle", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), s = Object(a.deepMix)({}, i, t.icon), c = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, }), u = s.width, h = s.height, l = s.show, f = s.text; return ( l && (f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, s, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -u / 2, y: -h / 2 }, s), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), c ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t)[0] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -d, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: d, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -d, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: d, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.deepMix)({}, e, n), o = this.getSize(t)[0] / 2; return r({ x: 0, y: 0, r: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getSize(t), i = { stroke: t.color, r: r[0] / 2 }, o = e.get("keyShape"), s = Object(a.deepMix)({}, o.attr(), i, t.style); this.updateShape(t, e, s, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "rect", { options: { size: [100, 30], style: { radius: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t), r = e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawLinkPoints(t, e), r; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = e.get("keyShape"); t.size || ((i[0] = o.attr("width") || r.width), (i[1] = o.attr("height") || r.height)); var s = { stroke: t.color, x: -i[0] / 2, y: -i[1] / 2, width: i[0], height: i[1], }, c = Object(a.mix)({}, r, o.attr(), s); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !1), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "ellipse", { options: { size: [80, 40], style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "ellipse", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("ellipse", { attrs: o, className: "ellipse-keyShape", name: "ellipse-keyShape", draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0] / 2, g = d[1] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = o[0] / 2, c = o[1] / 2; return r({ x: 0, y: 0, rx: s, ry: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = { stroke: t.color, rx: i[0] / 2, ry: i[1] / 2 }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "diamond", { options: { size: [80, 80], style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "diamond", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getPath: function (t) { var e = this.getSize(t), n = e[0], r = e[1]; return [ ["M", 0, -r / 2], ["L", n / 2, 0], ["L", 0, r / 2], ["L", -n / 2, 0], ["Z"], ]; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "triangle", { options: { size: 40, direction: "up", style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, offset: 15, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, offset: 6, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "triangle", labelPosition: "bottom", drawShape: function (t, e) { var n = this.getOptions(t), i = n.icon, o = void 0 === i ? {} : i, a = n.direction, s = this.getShapeStyle(t), c = t.direction || a, u = e.addShape("path", { attrs: s, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), h = o.width, l = o.height, f = o.show, d = o.offset, p = o.text; if (f) if (p) e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, o, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); else { var g = -h / 2, v = -l / 2; ("up" !== c && "down" !== c) || (v += d), ("left" !== c && "right" !== c) || (g += d), e.addShape("image", { attrs: r({ x: g, y: v }, o), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); } return this.drawLinkPoints(t, e), u; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t), o = n.linkPoints, a = void 0 === o ? {} : o, s = n.direction, c = t.direction || s, u = a.top, h = a.left, l = a.right, f = a.bottom, d = a.size, p = a.r, g = i(a, ["top", "left", "right", "bottom", "size", "r"]), v = this.getSize(t)[0]; if (h) { var y = null, m = v * Math.sin((1 / 3) * Math.PI), b = v * Math.sin((1 / 3) * Math.PI); "up" === c ? (y = [-b, m]) : "down" === c ? (y = [-b, -m]) : "left" === c && (y = [-b, b - m]), y && e.addShape("circle", { attrs: r(r({}, g), { x: y[0], y: y[1], r: d / 2 || p || 5, }), className: "link-point-left", name: "link-point-left", }); } if (l) { var x = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (x = [b, m]) : "down" === c ? (x = [b, -m]) : "right" === c && (x = [b, b - m]), x && e.addShape("circle", { attrs: r(r({}, g), { x: x[0], y: x[1], r: d / 2 || p || 5, }), className: "link-point-right", name: "link-point-right", }); } if (u) { var w = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (w = [b - m, -m]) : "left" === c ? (w = [b, -m]) : "right" === c && (w = [-b, -m]), w && e.addShape("circle", { attrs: r(r({}, g), { x: w[0], y: w[1], r: d / 2 || p || 5, }), className: "link-point-top", name: "link-point-top", }); } if (f) { var S = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "down" === c ? (S = [-b + m, m]) : "left" === c ? (S = [b, m]) : "right" === c && (S = [-b, m]), S && e.addShape("circle", { attrs: r(r({}, g), { x: S[0], y: S[1], r: d / 2 || p || 5, }), className: "link-point-bottom", name: "link-point-bottom", }); } }, getPath: function (t) { var e = this.getOptions(t).direction, n = t.direction || e, r = this.getSize(t)[0], i = r * Math.sin((1 / 3) * Math.PI), o = r * Math.sin((1 / 3) * Math.PI), a = [["M", -o, i], ["L", 0, -i], ["L", o, i], ["Z"]]; return ( "down" === n ? (a = [["M", -o, -i], ["L", o, -i], ["L", 0, i], ["Z"]]) : "left" === n ? (a = [["M", -o, o - i], ["L", o, -o], ["L", o, o], ["Z"]]) : "right" === n && (a = [["M", o, o - i], ["L", -o, o], ["L", -o, -o], ["Z"]]), a ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}), i = n.linkPoints, o = n.direction, s = t.direction || o, c = e.find(function (t) { return "link-point-left" === t.get("className"); }), u = e.find(function (t) { return "link-point-right" === t.get("className"); }), h = e.find(function (t) { return "link-point-top" === t.get("className"); }), l = e.find(function (t) { return "link-point-bottom" === t.get("className"); }), f = i, d = c || u || h || l; d && (f = d.attr()); var p = Object(a.mix)({}, f, t.linkPoints), g = p.fill, v = p.stroke, y = p.lineWidth, m = p.size / 2; m || (m = p.r); var b = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0, }, x = b.left, w = b.right, S = b.top, O = b.bottom, M = this.getSize(t)[0], k = { r: m, fill: g, stroke: v, lineWidth: y }, C = null, E = M * Math.sin((1 / 3) * Math.PI), j = M * Math.sin((1 / 3) * Math.PI); "up" === s ? (C = [-j, E]) : "down" === s ? (C = [-j, -E]) : "left" === s && (C = [-j, j - E]), C && (c ? x || void 0 === x ? c.attr(r(r({}, k), { x: C[0], y: C[1] })) : c.remove() : x && e.addShape("circle", { attrs: r(r({}, k), { x: C[0], y: C[1] }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, })); var P = null; "up" === s ? (P = [j, E]) : "down" === s ? (P = [j, -E]) : "right" === s && (P = [j, j - E]), P && (u ? w || void 0 === w ? u.attr(r(r({}, k), { x: P[0], y: P[1] })) : u.remove() : w && e.addShape("circle", { attrs: r(r({}, k), { x: P[0], y: P[1] }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, })); var A = null; "up" === s ? (A = [j - E, -E]) : "left" === s ? (A = [j, -E]) : "right" === s && (A = [-j, -E]), A && (h ? S || void 0 === S ? h.attr(r(r({}, k), { x: A[0], y: A[1] })) : h.remove() : S && e.addShape("circle", { attrs: r(r({}, k), { x: A[0], y: A[1] }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, })); var I = null; "down" === s ? (I = [-j + E, E]) : "left" === s ? (I = [j, E]) : "right" === s && (I = [-j, E]), I && (l ? O || void 0 === O ? l.attr(r(r({}, k), { x: I[0], y: I[1] })) : l.remove() : O && e.addShape("circle", { attrs: r(r({}, k), { x: I[0], y: I[1] }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, })); }, }, "single-node", ), Object(o.l)( "modelRect", { options: { size: [185, 70], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: o.e.defaultNode.style.lineWidth, fillOpacity: 1, }, labelCfg: { style: { fill: "#595959", fontSize: 14 }, offset: 30, }, descriptionCfg: { style: { fontSize: 12, fill: "#bfbfbf" }, paddingTop: 0, }, preRect: { show: !0, width: 4, fill: "#40a9ff", radius: 2 }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, logoIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, offset: 0, }, stateIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, offset: -5, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, shapeType: "modelRect", drawShape: function (t, e) { var n = this.getOptions(t).preRect, o = void 0 === n ? {} : n, a = this.getShapeStyle(t), s = this.getSize(t), c = s[0], u = s[1], h = e.addShape("rect", { attrs: a, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), l = o.show, f = i(o, ["show"]); return ( l && e.addShape("rect", { attrs: r({ x: -c / 2, y: -u / 2, height: u }, f), className: "pre-rect", name: "pre-rect", draggable: !0, }), this.drawLogoIcon(t, e), this.drawStateIcon(t, e), this.drawLinkPoints(t, e), h ); }, drawLogoIcon: function (t, e) { var n = this.getOptions(t).logoIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || -a / 2 + s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }); } }, drawStateIcon: function (t, e) { var n = this.getOptions(t).stateIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || a / 2 - s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }); } }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, drawLabel: function (t, e) { var n = this.getOptions(t), i = n.labelCfg, o = void 0 === i ? {} : i, s = n.logoIcon, c = void 0 === s ? {} : s, u = n.descriptionCfg, h = void 0 === u ? {} : u, l = this.getSize(t)[0], f = null, d = c.show, p = c.width, g = -l / 2 + o.offset; d && (g = -l / 2 + p + o.offset); var v = o.style, y = h.style, m = h.paddingTop; return ( Object(a.isString)(t.description) ? ((f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: -5, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), e.addShape("text", { attrs: r(r({}, y), { x: g, y: 17 + (m || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, })) : (f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: 7, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), f ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = this.getOptions(t), o = n.style, s = void 0 === o ? {} : o, c = n.labelCfg, u = void 0 === c ? {} : c, h = n.descriptionCfg, l = void 0 === h ? {} : h, f = this.getSize(t), d = f[0], p = f[1]; e.get("keyShape").attr( r(r({}, s), { x: -d / 2, y: -p / 2, width: d, height: p }), ); var g = e.getContainer(), v = g.find(function (t) { return "rect-logo-icon" === t.get("className"); }), y = v ? v.attr() : {}, m = Object(a.mix)({}, y, t.logoIcon), b = m.width; void 0 === b && (b = this.options.logoIcon.width); var x = t.logoIcon ? t.logoIcon.show : void 0, w = u.offset, S = -d / 2 + b + w; x || void 0 === x || (S = -d / 2 + w); var O = g.find(function (t) { return "node-label" === t.get("className"); }), M = g.find(function (t) { return "rect-description" === t.get("className"); }); if (t.label) if (O) { var k = t.labelCfg ? t.labelCfg.style : {}, C = Object(a.mix)({}, O.attr(), k); t.label && (C.text = t.label), (C.x = S), Object(a.isString)(t.description) && (C.y = -5), M && (M.resetMatrix(), M.attr({ x: S })), O.resetMatrix(), O.attr(C); } else g.addShape("text", { attrs: r(r({}, u.style), { x: S, y: t.description ? -5 : 7, text: t.label, }), className: "node-label", name: "node-label", draggable: !0, }); if (Object(a.isString)(t.description)) { var E = l.paddingTop; if (M) { k = t.descriptionCfg ? t.descriptionCfg.style : {}; var j = Object(a.mix)({}, M.attr(), k); Object(a.isString)(t.description) && (j.text = t.description), (j.x = S), M.resetMatrix(), M.attr(r(r({}, j), { y: 17 + (E || 0) })); } else g.addShape("text", { attrs: r(r({}, l.style), { x: S, y: 17 + (E || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, }); } var P = g.find(function (t) { return "pre-rect" === t.get("className"); }); if (P) { var A = Object(a.mix)({}, P.attr(), t.preRect); P.attr(r(r({}, A), { x: -d / 2, y: -p / 2, height: p })); } if (v) if (x || void 0 === x) { var I = m.width, T = m.height, N = m.x, B = m.y, L = m.offset, D = i(m, ["width", "height", "x", "y", "offset"]); v.attr( r(r({}, D), { x: N || -d / 2 + I + L, y: B || -T / 2, width: I, height: T, }), ); } else v.remove(); else x && this.drawLogoIcon(t, g); var _ = g.find(function (t) { return "rect-state-icon" === t.get("className"); }), R = _ ? _.attr() : {}, F = Object(a.mix)({}, R, t.stateIcon); if (_) { F.show || void 0 === F.show || _.remove(); var Y = F.width, X = ((T = F.height), (N = F.x), (B = F.y), F.offset), z = i(F, ["width", "height", "x", "y", "offset"]); _.attr( r(r({}, z), { x: N || d / 2 - Y + X, y: B || -T / 2, width: Y, height: T, }), ); } else F.show && this.drawStateIcon(t, g); this.updateLinkPoints(t, g); }, }, "single-node", ), Object(o.l)( "star", { options: { size: 60, style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "star", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.leftBottom, h = o.rightBottom, l = o.size, f = o.r, d = i(o, [ "top", "left", "right", "leftBottom", "rightBottom", "size", "r", ]), p = this.getSize(t)[0]; if (c) { var g = Math.cos(0.1 * Math.PI) * p, v = Math.sin(0.1 * Math.PI) * p; e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right", name: "link-point-right", }); } if (a) { (g = Math.cos(0.5 * Math.PI) * p), (v = Math.sin(0.5 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-top", name: "link-point-top", }); } if (s) { (g = Math.cos(0.9 * Math.PI) * p), (v = Math.sin(0.9 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left", name: "link-point-left", }); } if (u) { (g = Math.cos(1.3 * Math.PI) * p), (v = Math.sin(1.3 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left-bottom", name: "link-point-left-bottom", }); } if (h) { (g = Math.cos(1.7 * Math.PI) * p), (v = Math.sin(1.7 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right-bottom", name: "link-point-right-bottom", }); } }, getPath: function (t) { for ( var e = this.getSize(t)[0], n = (3 * e) / 8, r = t.innerR || n, i = [], o = 0; o < 5; o++ ) { var a = Math.cos(((18 + 72 * o) / 180) * Math.PI) * e, s = Math.sin(((18 + 72 * o) / 180) * Math.PI) * e, c = Math.cos(((54 + 72 * o) / 180) * Math.PI) * r, u = Math.sin(((54 + 72 * o) / 180) * Math.PI) * r; 0 === o ? i.push(["M", a, -s]) : i.push(["L", a, -s]), i.push(["L", c, -u]); } return i.push(["Z"]), i; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), s = e.find(function (t) { return "link-point-top" === t.get("className"); }), c = e.find(function (t) { return "link-point-left-bottom" === t.get("className"); }), u = e.find(function (t) { return "link-point-right-bottom" === t.get("className"); }), h = n, l = i || o || s || c || u; l && (h = l.attr()); var f = Object(a.mix)({}, h, t.linkPoints), d = f.fill, p = f.stroke, g = f.lineWidth, v = f.size / 2; v || (v = f.r); var y = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, leftBottom: void 0, rightBottom: void 0, }, m = y.left, b = y.right, x = y.top, w = y.leftBottom, S = y.rightBottom, O = this.getSize(t)[0], M = { r: v, fill: d, stroke: p, lineWidth: g }, k = Math.cos(0.1 * Math.PI) * O, C = Math.sin(0.1 * Math.PI) * O; o ? b || void 0 === b ? o.attr(r(r({}, M), { x: k, y: -C })) : o.remove() : b && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -C }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), (k = Math.cos(0.5 * Math.PI) * O), (C = Math.sin(0.5 * Math.PI) * O), s ? x || void 0 === x ? s.attr(r(r({}, M), { x: k, y: -C })) : s.remove() : x && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -C }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), (k = Math.cos(0.9 * Math.PI) * O), (C = Math.sin(0.9 * Math.PI) * O), i ? m || void 0 === m ? i.attr(r(r({}, M), { x: k, y: -C })) : i.remove() : m && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -C }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), (k = Math.cos(1.3 * Math.PI) * O), (C = Math.sin(1.3 * Math.PI) * O), c ? w || void 0 === w ? c.attr(r(r({}, M), { x: k, y: -C })) : c.remove() : w && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -C }), className: "link-point-left-bottom", name: "link-point-left-bottom", isAnchorPoint: !0, }), (k = Math.cos(1.7 * Math.PI) * O), (C = Math.sin(1.7 * Math.PI) * O), u ? S || void 0 === S ? u.attr(r(r({}, M), { x: k, y: -C })) : c.remove() : S && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -C }), className: "link-point-right-bottom", name: "link-point-right-bottom", isAnchorPoint: !0, }); }, }, "single-node", ); var s = o.h.defaultSubjectColors; Object(o.l)( "donut", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), c = Object(a.deepMix)({}, i, t.icon), u = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, name: "".concat(this.type, "-keyShape"), }), h = c.width, l = c.height, f = c.show, d = c.text; f && (d ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, c, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -h / 2, y: -l / 2 }, c), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })); var p = u.attr("r"), g = 0.6 * p, v = (p + g) / 2, y = t, m = y.donutAttrs, b = void 0 === m ? {} : m, x = y.donutColorMap, w = void 0 === x ? {} : x, S = Object.keys(b).length; if (b && S > 1) { var O = [], M = 0; if ( (Object.keys(b).forEach(function (t) { var e = b[t] || 0; Object(a.isNumber)(e) && (O.push({ key: t, value: e, color: w[t] }), (M += e)); }), M) ) { var k = p - g; if (1 === S) return void e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: O[0].color || s[0], lineWidth: k, }, name: "fan-shape-0", }); var C = [v, 0], E = 0; O.forEach(function (t, n) { var r = t.value / M; if (!(r < 0.001)) if ((r > 0.999 && (r = 1), 1 !== r)) { (t.percent = r), (t.angle = r * Math.PI * 2), (t.beginAgnle = E), (E += t.angle), (t.endAngle = E), (t.arcBegin = C), (t.arcEnd = [ v * Math.cos(t.endAngle), -v * Math.sin(t.endAngle), ]); var i = t.angle > Math.PI ? 1 : 0, o = [ ["M", t.arcBegin[0], t.arcBegin[1]], ["A", v, v, 0, i, 0, t.arcEnd[0], t.arcEnd[1]], ["L", t.arcEnd[0], t.arcEnd[1]], ]; e.addShape("path", { attrs: { path: o, lineWidth: k, stroke: t.color || s[n % s.length], }, name: "fan-shape-".concat(n), }), (C = t.arcEnd); } else e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: t.color || s[n % s.length], lineWidth: k, }, name: "fan-shape-".concat(n), }); }); } } return this.drawLinkPoints(t, e), u; }, update: void 0, }, "circle", ); var c = function (t) { var e = t.x, n = t.y; return { x: e, y: n, centerX: e, centerY: n, minX: e, minY: n, maxX: e, maxY: n, height: 0, width: 0, }; }, u = function (t) { for (var e = [], n = {}, r = t.length - 1; r >= 0; r--) { var i = t[r]; (i.id = "".concat(i.x, "|||").concat(i.y)), (n[i.id] = i), e.push(i); } return e; }, h = function (t) { return u(t); }, l = function (t, e) { return t.width || t.height ? { centerX: t.centerX, centerY: t.centerY, minX: t.minX - e, minY: t.minY - e, maxX: t.maxX + e, maxY: t.maxY + e, height: t.height + 2 * e, width: t.width + 2 * e, } : t; }, f = function (t, e, n) { var r = (function (t, e) { var n = Math.abs(t.x - e.centerX), r = Math.abs(t.y - e.centerY); return 0 === n && 0 === r ? 0 : n / e.width > r / e.height; })(e, t); if (0 === r) { var i = t.centerX, o = t.centerY; return ( n.y < e.y ? (o = t.minY) : n.x > e.x ? (i = t.maxX) : n.x < e.x ? (i = t.minX) : n.x === e.x && (o = t.maxY), { x: i, y: o } ); } return r ? { x: e.x > t.centerX ? t.maxX : t.minX, y: e.y } : { x: e.x, y: e.y > t.centerY ? t.maxY : t.minY }; }, d = function (t, e) { var n = Math.min(t.minX, e.minX), r = Math.min(t.minY, e.minY), i = Math.max(t.maxX, e.maxX), o = Math.max(t.maxY, e.maxY); return { centerX: (n + i) / 2, centerY: (r + o) / 2, minX: n, minY: r, maxX: i, maxY: o, height: o - r, width: i - n, }; }, p = function (t) { return [ { x: t.minX, y: t.minY }, { x: t.maxX, y: t.minY }, { x: t.maxX, y: t.maxY }, { x: t.minX, y: t.maxY }, ]; }, g = function (t, e) { var n = t.x, r = t.y; return n < e.minX || n > e.maxX || r < e.minY || r > e.maxY; }, v = function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, y = function (t, e, n, r, i) { return ( v(t, e) + v(t, n) + (function (t, e) { var n = 0; return ( e.forEach(function (e) { e && (t.x === e.x && (n += -2), t.y === e.y && (n += -2)); }), n ); })(t, [e, n, r, i]) ); }, m = function t(e, n, r, i, o) { void 0 === o && (o = 0), e.unshift(n[i]), r[i] && r[i] !== i && o <= 100 && t(e, n, r, r[i], o + 1); }, b = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = r.x - t.x, s = r.y - t.y, c = n.x - e.x, u = n.y - e.y, h = r.x - e.x, l = r.y - e.y; return ( (i * s - o * a) * (c * l - u * h) <= 0 && (i * u - o * c) * (a * l - s * h) <= 0 ); }, x = function (t, e, n) { if (n.width || n.height) { var r = p(n), i = r[0], o = r[1], a = r[2], s = r[3]; return ( b(t, e, i, o) || b(t, e, i, s) || b(t, e, o, a) || b(t, e, a, s) ); } return !1; }, w = function (t, e, n, r) { var i = []; return ( t.forEach(function (t) { if (t !== e && (t.x === e.x || t.y === e.y)) { if (x(t, e, n) || x(t, e, r)) return; i.push(t); } }), u(i) ); }, S = function (t, e) { var n = [], r = t[0]; return ( n.push("M".concat(r.x, " ").concat(r.y)), t.forEach(function (r, i) { var o = t[i + 1], a = t[i + 2]; if (o && a) if ( (function (t, e, n) { return !( (t.x === e.x && e.x === n.x) || (t.y === e.y && e.y === n.y) ); })(r, o, a) ) { var s = (function (t, e, n, r) { var i = v(t, e), o = v(n, e); return ( i < r && (r = i), o < r && (r = o), [ { x: e.x - (r / i) * (e.x - t.x), y: e.y - (r / i) * (e.y - t.y), }, { x: e.x - (r / o) * (e.x - n.x), y: e.y - (r / o) * (e.y - n.y), }, ] ); })(r, o, a, e), c = s[0], u = s[1]; n.push("L".concat(c.x, " ").concat(c.y)), n.push( "Q" .concat(o.x, " ") .concat(o.y, " ") .concat(u.x, " ") .concat(u.y), ), n.push("L".concat(u.x, " ").concat(u.y)); } else n.push("L".concat(o.x, " ").concat(o.y)); else o && n.push("L".concat(o.x, " ").concat(o.y)); }), n.join("") ); }, O = function (t, e, n, r, i) { var o, a; if (n && n.getType()) if ("combo" === n.getType()) { ((o = n.getKeyShape().getCanvasBBox() || c(t)).centerX = (o.minX + o.maxX) / 2), (o.centerY = (o.minY + o.maxY) / 2); } else o = n.getBBox(); else o = c(t); if (r && r.getType()) if ("combo" === r.getType()) { var s = r.getKeyShape().getBBox(); if (s) { var b = r.getModel(), x = b.x, S = b.y; ((a = { x: x, y: S, width: s.width, height: s.height, minX: s.minX + x, maxX: s.maxX + x, minY: s.minY + S, maxY: s.maxY + S, }).centerX = (a.minX + a.maxX) / 2), (a.centerY = (a.minY + a.maxY) / 2); } else a = c(e); } else a = r && r.getBBox(); else a = c(e); var O = l(o, i), M = l(a, i), k = f(O, t, e), C = f(M, e, t), E = (function (t) { void 0 === t && (t = []); var e = [], n = []; t.forEach(function (t) { e.push(t.x), n.push(t.y); }); var r = Math.min.apply(Math, e), i = Math.max.apply(Math, e), o = Math.min.apply(Math, n), a = Math.max.apply(Math, n); return { centerX: (r + i) / 2, centerY: (o + a) / 2, maxX: i, maxY: a, minX: r, minY: o, height: a - o, width: i - r, }; })([k, C]), j = d(O, E), P = d(M, E), A = []; A = A.concat(p(j)).concat(p(P)); var I = { x: (t.x + e.x) / 2, y: (t.y + e.y) / 2 }; [E, j, P].forEach(function (t) { A = A.concat( (function (t, e) { return (function (t, e) { return e < t.minX || e > t.maxX ? [] : [ { x: e, y: t.minY }, { x: e, y: t.maxY }, ]; })(t, e.x).concat( (function (t, e) { return e < t.minY || e > t.maxY ? [] : [ { x: t.minX, y: e }, { x: t.maxX, y: e }, ]; })(t, e.y), ); })(t, I).filter(function (t) { return g(t, O) && g(t, M); }), ); }), [ { x: k.x, y: C.y }, { x: C.x, y: k.y }, ].forEach(function (t) { g(t, O) && g(t, M) && A.push(t); }), A.unshift(k), A.push(C); var T = (function (t, e, n, r, i, o, a) { var s = [], c = [e], u = {}, h = {}, l = {}; (h[e.id] = 0), (l[e.id] = y(e, n, e)); var f, d, p, g, b, x = {}; for ( t.forEach(function (t) { x[t.id] = t; }); c.length; ) { if ( ((f = void 0), (d = 1 / 0), c.forEach(function (t) { l[t.id] <= d && ((d = l[t.id]), (f = t)); }), f === n) ) { var S = []; return m(S, x, u, n.id), S; } (g = f), (b = void 0), (b = (p = c).indexOf(g)) > -1 && p.splice(b, 1), s.push(f), w(t, f, r, i).forEach(function (t) { if (-1 === s.indexOf(t)) { -1 === c.indexOf(t) && c.push(t); var r = l[f.id] + v(f, t); (h[t.id] && r >= h[t.id]) || ((u[t.id] = f.id), (h[t.id] = r), (l[t.id] = h[t.id] + y(t, n, e, o, a))); } }); } return [e, n]; })((A = u(A)), k, C, o, a, t, e); return T.unshift(t), T.push(e), h(T); }, M = { offset: 20, maxAllowedDirectionChange: Math.PI / 2, maximumLoops: 2e3, gridSize: 10, directions: [ { stepX: 1, stepY: 0 }, { stepX: -1, stepY: 0 }, { stepX: 0, stepY: 1 }, { stepX: 0, stepY: -1 }, ], get penalties() { return { 0: 0, 45: this.gridSize / 2, 90: this.gridSize / 2 }; }, distFunc: function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, fallbackRoute: function (t, e, n, r, i) { return h(O(t, e, n, r, i.offset)); }, }, k = (Math.PI, function (t, e) { var n = Math.round(Math.abs(t / e)); return n < 0 ? 0 : (t < 0 ? -1 : 1) * n; }), C = function (t, e) { var n = e.x - t.x, r = e.y - t.y; return n || r ? Math.atan2(r, n) : 0; }, E = function (t, e) { var n = Math.abs(t - e); return n > Math.PI ? 2 * Math.PI - n : n; }, j = function (t, e, n) { for (var r = 1 / 0, i = 0, o = e.length; i < o; i++) { var a = n(t, e[i]); a < r && (r = a); } return r; }, P = function (t, e, n, r, i) { var a = []; if (!n) return [t]; var s = i.directions, c = i.offset, u = n.getBBox(), h = e.x > u.minX && e.x < u.maxX && e.y > u.minY && e.y < u.maxY, d = l(u, c); for (var p in d) d[p] = k(d[p], i.gridSize); if (h) { for (var g = 0, v = s; g < v.length; g++) { var y = v[g], m = [ [ { x: d.minX, y: d.minY }, { x: d.maxX, y: d.minY }, ], [ { x: d.minX, y: d.minY }, { x: d.minX, y: d.maxY }, ], [ { x: d.maxX, y: d.minY }, { x: d.maxX, y: d.maxY }, ], [ { x: d.minX, y: d.maxY }, { x: d.maxX, y: d.maxY }, ], ]; for (p = 0; p < 4; p++) { var b = m[p], w = o.h.getLineIntersect( t, { x: t.x + y.stepX * d.width, y: t.y + y.stepY * d.height }, b[0], b[1], ); w && !x(t, w, u) && ((w.id = "".concat(w.x, "|||").concat(w.y)), a.push(w)); } } return a; } var S = f(d, t, r); return (S.id = "".concat(S.x, "|||").concat(S.y)), [S]; }, A = function (t, e, n, r) { var i = C(t, e); if (!n[t.id]) { var o = C(r, t); return E(o, i); } var a = C({ x: n[t.id].x, y: n[t.id].y }, t); return E(a, i); }, I = function (t, e, n, r, i, o, a) { var s = [r], c = t.id, u = t.x, h = t.y, l = { x: u, y: h, id: c }; for ( A(l, o, e, n) && s.unshift({ x: o.x === r.x ? r.x : l.x * a, y: o.y === r.y ? r.y : l.y * a, }); e[c] && e[c].id !== c; ) { var f = { x: u, y: h, id: c }, d = e[c].id, p = e[c].x, g = e[c].y, v = { x: p, y: g, id: d }; A(v, f, e, n) && s.unshift({ x: v.x === f.x ? s[0].x : v.x * a, y: v.y === f.y ? s[0].y : v.y * a, }), (c = d), (u = p), (h = g); } var y = u, m = h; return ( (s[0].x = y === n.x ? i.x : s[0].x), (s[0].y = m === n.y ? i.y : s[0].y), s.unshift(i), s ); }, T = function (t, e, n, r, i) { if (isNaN(t.x) || isNaN(e.x)) return []; var o = Object(a.deepMix)(M, i); o.obstacles = o.obstacles || []; var s = o.gridSize, c = (function (t, e, n) { var r = {}; return ( t.forEach(function (t) { if (t) for ( var i = l(t.getBBox(), n), o = k(i.minX, e); o <= k(i.maxX, e); o += 1 ) for (var a = k(i.minY, e); a <= k(i.maxY, e); a += 1) r["".concat(o, "|||").concat(a)] = !0; }), r ); })(o.obstacles.concat([n, r]), s, o.offset), u = { x: k(t.x, s), y: k(t.y, s) }, h = { x: k(e.x, s), y: k(e.y, s) }; (t.id = "".concat(u.x, "|||").concat(u.y)), (e.id = "".concat(h.x, "|||").concat(h.y)); var f = P(u, t, n, h, o), d = P(h, e, r, u, o); f.forEach(function (t) { delete c[t.id]; }), d.forEach(function (t) { delete c[t.id]; }); for ( var p = {}, g = {}, v = {}, y = {}, m = {}, b = 0; b < f.length; b++ ) { var x = f[b]; (p[x.id] = x), (y[x.id] = 0), (m[x.id] = j(x, d, o.distFunc)); } for ( var w, S, O, C, E, T, N, B = o.maximumLoops, L = o.penalties; Object.keys(p).length > 0 && B > 0 && ((w = void 0), (S = 1 / 0), Object.keys(p).forEach(function (t) { var e = p[t].id; m[e] <= S && ((S = m[e]), (w = p[e])); }), w); ) { if ( d.findIndex(function (t) { return t.x === w.x && t.y === w.y; }) > -1 ) return I(w, v, u, e, t, h, s); delete p[w.id], (g[w.id] = !0); for (b = 0; b < o.directions.length; b++) (O = o.directions[b]), g[ (C = { x: w.x + O.stepX, y: w.y + O.stepY, id: "" .concat(Math.round(w.x) + O.stepX, "|||") .concat(Math.round(w.y) + O.stepY), }).id ] || (N = A(w, C, v, u)) > o.maxAllowedDirectionChange || c[C.id] || (p[C.id] || (p[C.id] = C), (E = o.distFunc(w, C) + (isNaN(L[N]) ? s : L[N])), (T = y[w.id] + E), (y[C.id] && T >= y[C.id]) || ((v[C.id] = w), (y[C.id] = T), (m[C.id] = T + j(C, d, o.distFunc)))); B -= 1; } return o.fallbackRoute(t, e, n, r, o); }; Object(o.k)( "polyline", { options: { color: o.e.defaultEdge.color, size: o.e.defaultEdge.size, style: { radius: 0, offset: 15, x: 0, y: 0, stroke: o.e.defaultEdge.style.stroke, lineAppendWidth: o.e.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: o.e.edgeLabel.style.fill, fontSize: o.e.edgeLabel.style.fontSize, }, }, routeCfg: { obstacles: [], maxAllowedDirectionChange: Math.PI, maximumLoops: 500, gridSize: 10, }, stateStyles: r({}, o.e.edgeStateStyles), }, shapeType: "polyline", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( 0 === n.radius && delete n.radius, e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(a.mix)({}, e, n, t.style); (t = this.getPathPoints(t)), (this.radius = r.radius), (this.offset = r.offset); var i = t.startPoint, s = t.endPoint, c = this.getControlPoints(t), u = [i]; c && (u = u.concat(c)), u.push(s); var h = t.sourceNode, l = t.targetNode, f = r.radius, d = this.options.routeCfg, p = Object(a.mix)({}, d, t.routeCfg); p.offset = r.offset; var g = this.getPath(u, h, l, f, p); return ( ((Object(a.isArray)(g) && g.length <= 1) || (Object(a.isString)(g) && -1 === g.indexOf("L"))) && (g = "M0 0, L0 0"), (isNaN(i.x) || isNaN(i.y) || isNaN(s.x) || isNaN(s.y)) && (g = "M0 0, L0 0"), Object(a.mix)({}, o.e.defaultEdge.style, r, { lineWidth: t.size, path: g, }) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(); if (e.isVisible()) { var r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, s = (t = this.getPathPoints(t)).startPoint, c = t.endPoint, u = this.getControlPoints(t), h = [s]; u && (h = h.concat(u)), h.push(c); var l = i.attr(), f = Object(a.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = f.radius, v = this.options.routeCfg, y = Object(a.mix)({}, v, t.routeCfg); y.offset = f.offset; var m = this.getPath(h, d, p, g, y); ((Object(a.isArray)(m) && m.length <= 1) || (Object(a.isString)(m) && -1 === m.indexOf("L"))) && (m = "M0 0, L0 0"), (isNaN(s.x) || isNaN(s.y) || isNaN(c.x) || isNaN(c.y)) && (m = "M0 0, L0 0"), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var b = Object(a.mix)( r, i.attr(), { lineWidth: o, path: m }, t.style, ); i && i.attr(b); } }, getPath: function (t, e, n, r, i) { var s = i.offset, c = i.simple; if (!s || t.length > 2) { if (r) return S(t, r); var u = []; return ( Object(a.each)(t, function (t, e) { 0 === e ? u.push(["M", t.x, t.y]) : u.push(["L", t.x, t.y]); }), u ); } var h = c ? O(t[t.length - 1], t[0], n, e, s) : T(t[0], t[t.length - 1], e, n, i); return h && h.length ? r ? S(h, r) : o.h.pointsToPolygon(h) : "M0 0, L0 0"; }, }, "single-edge", ); }, 396: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(2), a = n(32), s = a.a.cloneEvent, c = a.a.isNaN, u = Math.abs, h = { getDefaultCfg: function () { return { direction: "both", enableOptimize: !1, scalableRange: 0, allowDragOnItem: !1, }; }, getEvents: function () { return { dragstart: "onDragStart", drag: "onDragMove", dragend: "onDragEnd", }; }, updateViewport: function (t) { var e = this.origin, n = +t.clientX, r = +t.clientY; if (!c(n) && !c(r)) { var i = n - e.x, o = r - e.y; "x" === this.get("direction") ? (o = 0) : "y" === this.get("direction") && (i = 0), (this.origin = { x: n, y: r }); var a = this.graph.get("width"), s = this.graph.get("height"), u = this.graph.get("canvas").getCanvasBBox(); ((u.minX <= a + this.scalableRange && u.minX + i > a + this.scalableRange) || (u.maxX + this.scalableRange >= 0 && u.maxX + this.scalableRange + i < 0)) && (i = 0), ((u.minY <= s + this.scalableRange && u.minY + o > s + this.scalableRange) || (u.maxY + this.scalableRange >= 0 && u.maxY + this.scalableRange + o < 0)) && (o = 0), this.graph.translate(i, o); } }, onDragStart: function (t) { t.originalEvent; if (this.shouldBegin.call(this, t)) { var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ( (this.allowDragOnItem || n) && ((this.origin = { x: t.clientX, y: t.clientY }), (this.dragging = !1), this.enableOptimize) ) { for ( var r = this.graph, i = r.getEdges(), o = 0, a = i.length; o < a; o++ ) { var s = i[o].get("group").get("children"); s && s.forEach(function (t) { t.set( "ori-visibility", t.get("ori-visibility") || t.get("visible"), ), t.hide(); }); } for (var c = r.getNodes(), u = 0, h = c.length; u < h; u++) for ( var l = 0, f = c[u].getContainer().get("children"); l < f.length; l++ ) { var d = f[l]; d.get("isKeyShape") || (d.set( "ori-visibility", d.get("ori-visibility") || d.get("visible"), ), d.hide()); } } } }, onDragMove: function (t) { this.graph; var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ((this.allowDragOnItem || n) && ((t = s(t)), this.origin)) { if (!this.dragging) { if ( u(this.origin.x - t.clientX) + u(this.origin.y - t.clientY) < 10 ) return; this.shouldBegin.call(this, t) && ((t.type = "dragstart"), (this.dragging = !0)); } this.shouldUpdate.call(this, t) && this.updateViewport(t); } }, onDragEnd: function (t) { var e = this.graph; if (this.enableOptimize) { for (var n = e.getEdges(), r = 0, i = n.length; r < i; r++) { var o = n[r].get("group").get("children"); o && o.forEach(function (t) { t.get("ori-visibility") && t.show(); }); } for (var a = e.getNodes(), c = 0, u = a.length; c < u; c++) for ( var h = 0, l = a[c].getContainer().get("children"); h < l.length; h++ ) { var f = l[h]; if (!f.get("isKeyShape")) f.get("ori-visibility") && f.show(); } } this.dragging ? ((t = s(t)), this.shouldEnd.call(this, t) && this.updateViewport(t), (t.type = "dragend"), this.endDrag()) : (this.origin = null); }, endDrag: function () { (this.origin = null), (this.dragging = !1), (this.dragbegin = !1); }, }, l = n(18), f = { getDefaultCfg: function () { return { updateEdge: !0, delegateStyle: {}, enableDelegate: !1, onlyChangeComboSize: !1, comboActiveState: "", selectedState: "selected", }; }, getEvents: function () { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", "combo:drop": "onDropCombo", "node:drop": "onDropNode", "canvas:drop": "onDropCanvas", }; }, validationCombo: function (t) { return ( !(!this.origin || !t || t.destroyed) && "combo" === t.getType() ); }, onDragStart: function (t) { var e = this; if (this.shouldBegin.call(this, t)) { var n = t.item; if (n && !n.destroyed && !n.hasLocked()) { var r = t.target; if (r) if (r.get("isAnchorPoint")) return; var o = this.graph; (this.targets = []), (this.targetCombo = null); var a = o.findAllByState("node", this.selectedState), s = n.get("id"); 0 === a.filter(function (t) { var e = t.get("id"); return s === e; }).length ? this.targets.push(n) : a.length > 1 ? a.forEach(function (t) { t.hasLocked() || e.targets.push(t); }) : this.targets.push(n); var c = []; this.targets.forEach(function (t) { c.push(Object(i.clone)(t.getModel())); }), this.set("beforeDragNodes", c), (this.origin = { x: t.x, y: t.y }), (this.point = {}), (this.originPoint = {}); } } }, onDrag: function (t) { var e = this; this.origin && this.shouldUpdate(this, t) && (this.get("enableDelegate") ? this.updateDelegate(t) : this.targets.map(function (n) { e.update(n, t); })); }, onDragEnd: function (t) { if (this.origin && this.shouldEnd.call(this, t)) { var e = t.item; if (e) e.getContainer().set("capture", !0); this.delegateRect && (this.delegateRect.remove(), (this.delegateRect = null)), this.updatePositions(t); var n = this.graph; if (n.get("enabledStack")) { var r = { before: { nodes: this.get("beforeDragNodes"), edges: [], combos: [], }, after: { nodes: [], edges: [], combos: [] }, }; this.targets.forEach(function (t) { r.after.nodes.push(t.getModel()); }), n.pushStack("update", Object(i.clone)(r)); } n.emit("dragnodeend", { items: this.targets, targetItem: null }), (this.point = {}), (this.origin = null), (this.originPoint = {}), (this.targets.length = 0), (this.targetCombo = null); } }, onDropCombo: function (t) { var e = t.item; if (this.validationCombo(e)) { this.updatePositions(t); var n = this.graph; if ( (this.comboActiveState && n.setItemState(e, this.comboActiveState, !1), (this.targetCombo = e), this.onlyChangeComboSize) ) n.updateCombos(); else { var r = e.getModel(); this.targets.map(function (t) { t.getModel().comboId !== r.id && n.updateComboTree(t, r.id); }), n.updateCombo(e); } n.emit("dragnodeend", { items: this.targets, targetItem: this.targetCombo, }); } }, onDropCanvas: function (t) { var e = this.graph; this.targets && 0 !== this.targets.length && (this.updatePositions(t), this.onlyChangeComboSize ? e.updateCombos() : this.targets.map(function (t) { t.getModel().comboId && e.updateComboTree(t); })); }, onDropNode: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.graph, r = e.getModel().comboId; if (r) { var i = n.findById(r); this.comboActiveState && n.setItemState(i, this.comboActiveState, !1), this.targets.map(function (t) { var e = t.getModel(); r !== e.comboId && n.updateComboTree(t, r); }), n.updateCombo(i); } else this.targets.map(function (t) { t.getModel().comboId && n.updateComboTree(t); }); n.emit("dragnodeend", { items: this.targets, targetItem: e }); } }, onDragEnter: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !0); } }, onDragLeave: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !1); } }, updatePositions: function (t) { var e = this; this.targets && 0 !== this.targets.length && this.get("enableDelegate") && this.targets.map(function (n) { return e.update(n, t); }); }, update: function (t, e) { var n = this.origin, r = t.get("model"), i = t.get("id"); this.point[i] || (this.point[i] = { x: r.x || 0, y: r.y || 0 }); var o = { x: e.x - n.x + this.point[i].x, y: e.y - n.y + this.point[i].y, }; this.get("updateEdge") ? this.graph.updateItem(t, o, !1) : t.updatePosition(o); }, updateDelegate: function (t) { this.graph; if (this.delegateRect) { var e = t.x - this.origin.x + this.originPoint.minX, n = t.y - this.origin.y + this.originPoint.minY; this.delegateRect.attr({ x: e, y: n }); } else { var o = this.graph.get("group"), a = Object(i.deepMix)( {}, l.a.delegateStyle, this.delegateStyle, ), s = this.calculationGroupPosition(t), c = s.x, u = s.y, h = s.width, f = s.height, d = s.minX, p = s.minY; (this.originPoint = { x: c, y: u, width: h, height: f, minX: d, minY: p, }), (this.delegateRect = o.addShape("rect", { attrs: Object(r.a)({ width: h, height: f, x: c, y: u }, a), name: "rect-delegate-shape", })); } }, calculationGroupPosition: function (t) { var e = this.graph.findAllByState("node", this.selectedState); 0 === e.length && e.push(t.item); for ( var n = 1 / 0, r = -1 / 0, i = 1 / 0, o = -1 / 0, a = 0; a < e.length; a++ ) { var s = e[a].getBBox(), c = s.minX, u = s.minY, h = s.maxX, l = s.maxY; c < n && (n = c), u < i && (i = u), h > r && (r = h), l > o && (o = l); } return { x: Math.floor(n), y: Math.floor(i), width: Math.ceil(r) - Math.floor(n), height: Math.ceil(o) - Math.floor(i), minX: n, minY: i, }; }, }, d = { getDefaultCfg: function () { return { multiple: !0, selectedState: "selected" }; }, getEvents: function () { return { "node:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onCanvasClick", }; }, onClick: function (t) { var e = this, n = t.item; if (n && !n.destroyed) { var r = n.getType(), o = e.graph, a = e.multiple, s = e.shouldUpdate; if (e.shouldBegin.call(e, t)) { if (!a) { var c = o.findAllByState(r, e.selectedState); Object(i.each)(c, function (t) { t !== n && o.setItemState(t, e.selectedState, !1); }); } if (n.hasState(e.selectedState)) { s.call(e, t) && o.setItemState(n, e.selectedState, !1); var u = o.findAllByState("node", e.selectedState), h = o.findAllByState("combo", e.selectedState); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !1, }); } else { s.call(e, t) && o.setItemState(n, e.selectedState, !0); (u = o.findAllByState("node", e.selectedState)), (h = o.findAllByState("combo", e.selectedState)); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !0, }); } } } }, onCanvasClick: function () { var t = this, e = this.graph, n = e.findAllByState("node", this.selectedState); Object(i.each)(n, function (n) { e.setItemState(n, t.selectedState, !1); }); var r = e.findAllByState("combo", this.selectedState); Object(i.each)(r, function (n) { e.setItemState(n, t.selectedState, !1); }), e.emit("nodeselectchange", { selectedItems: { nodes: [], edges: [], combos: [] }, select: !1, }); }, }, p = { firstScale: null, getDefaultCfg: function () { return { originScale: 1, sensitivity: 2, minZoom: void 0, maxZoom: void 0, enableOptimize: !1, optimizeZoom: 0.1, fixSelectedItems: { fixAll: !1, fixLineWidth: !1, fixLabel: !1, fixState: "selected", }, }; }, getEvents: function () { var t = this.fixSelectedItems; return ( t.fixState || (t.fixState = "selected"), t.fixAll && ((t.fixLineWidth = !0), (t.fixLabel = !0)), { pinchstart: "onPinch", pinchmove: "onPinch" } ); }, onPinch: function (t) { t.preventDefault && t.preventDefault(), t.originalEvent.preventDefault && t.originalEvent.preventDefault(); var e = t.originalEvent.pointers; if (!(e.length < 2)) { "pinchstart" === t.type && (this.firstScale = this.graph.getZoom()); var n = t.originalEvent.scale || t.originalEvent.srcEvent.extra.scale, r = this.firstScale * n; this.currentScale = r; var i = this.get("minZoom") || this.graph.get("minZoom"); if ( !( r > (this.get("maxZoom") || this.graph.get("maxZoom")) || r < i ) ) { var o = this.graph.get("canvas"), a = e[0].clientX, s = e[0].clientY, c = e[1].clientX, u = e[1].clientY, h = o.getPointByClient((a + c) / 2, (s + u) / 2); this.graph.zoomTo(r, { x: h.x, y: h.y }); } } }, }, g = ["tap", "dbltap"], v = { getDefaultCfg: function () { return { trigger: "tap", onChange: function () {} }; }, getEvents: function () { var t, e; return ( g.includes(this.trigger) ? (e = this.trigger) : ((e = "tap"), console.warn( "Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["node:" + e] = "onNodeTap"), (t.touchstart = "onNodeTap"), t ); }, onNodeTap: function (t) { var e = t.item, n = this.graph.findDataById(e.get("id")); if (n) { var r = n.children; if (r && 0 !== r.length) { var i = !n.collapsed; if ( this.shouldBegin(t, i) && ((n.collapsed = i), (e.getModel().collapsed = i), this.graph.emit("itemcollapsed", { item: t.item, collapsed: i, }), this.shouldUpdate(t, i)) ) { try { this.onChange(e, i); } catch (t) { console.warn(t); } this.graph.layout(); } } } }, }, y = a.a.calculationItemsBBox, m = function (t, e) { if (!1 !== e(t) && t) { var n = t.get("combos"); if (0 === n.length) return !1; Object(i.each)(n, function (t) { m(t, e); }); } }, b = ["click", "dblclick"], x = ["tap", "drag"], w = ["shift", "ctrl", "control", "alt", "meta", void 0], S = { bind: function (t) { "drag-canvas" === this.type && t.get("canvas").set("draggable", !0); var e = this.events; (this.graph = t), Object(i.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; "drag-canvas" === this.type && t.get("canvas").set("draggable", !1), (this.graph = null), Object(i.each)(e, function (e, n) { t.off(n, e); }); }, }, O = { "drag-canvas": h, "zoom-canvas": p, "drag-node": f, "activate-relations": { getDefaultCfg: function () { return { activeState: "active", inactiveState: "inactive", resetSelected: !1, shouldUpdate: function () { return !0; }, }; }, getEvents: function () { return { "node:tap": "setAllItemStates", "canvas:tap": "clearAllItemStates", }; }, setAllItemStates: function (t) { var e = t.item, n = this.graph; if ( ((this.item = e), this.shouldUpdate(t.item, { event: t, action: "activate" })) ) { for ( var r = this.activeState, i = this.inactiveState, o = n.getNodes(), a = n.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u], l = h.hasState("selected"); this.resetSelected && l && n.setItemState(h, "selected", !1), n.setItemState(h, r, !1), i && n.setItemState(h, i, !0); } for (u = 0; u < c; u++) { var f = a[u]; n.setItemState(f, r, !1), i && n.setItemState(f, i, !0); } i && n.setItemState(e, i, !1), n.setItemState(e, r, !0); var d = e.getEdges(), p = d.length; for (u = 0; u < p; u++) { var g = void 0; (g = (f = d[u]).getSource() === e ? f.getTarget() : f.getSource()), i && n.setItemState(g, i, !1), n.setItemState(g, r, !0), n.setItemState(f, i, !1), n.setItemState(f, r, !0), f.toFront(); } n.emit("afteractivaterelations", { item: t.item, action: "activate", }); } }, clearActiveState: function (t) { var e = this.get("graph"); if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { var n = this.activeState, r = this.inactiveState, i = e.get("autoPaint"); e.setAutoPaint(!1); for ( var o = e.getNodes(), a = e.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u]; e.clearItemStates(h, [n, r]); } for (u = 0; u < c; u++) { var l = a[u]; e.clearItemStates(l, [n, r, "deactivate"]); } e.paint(), e.setAutoPaint(i), e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, clearAllItemStates: function (t) { var e = this.graph; if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { for ( var n = this.activeState, r = this.inactiveState, i = e.getNodes(), o = e.getEdges(), a = i.length, s = o.length, c = 0; c < a; c++ ) { var u = i[c]; e.clearItemStates(u, [n, r]); } for (c = 0; c < s; c++) { var h = o[c]; e.clearItemStates(h, [n, r, "deactivate"]); } e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, }, "click-select": d, "collapse-expand": v, "drag-combo": { getDefaultCfg: function () { return { enableDelegate: !1, delegateStyle: {}, onlyChangeComboSize: !1, activeState: "", selectedState: "selected", }; }, getEvents: function () { return { "combo:dragstart": "onDragStart", "combo:drag": "onDrag", "combo:dragend": "onDragEnd", "combo:drop": "onDrop", "node:drop": "onNodeDrop", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", }; }, validationCombo: function (t) { var e = t.item; return ( !(!e || e.destroyed) && !!this.shouldUpdate(this, t) && "combo" === e.getType() ); }, onDragStart: function (t) { var e = this, n = this.graph, r = t.item; if (this.validationCombo(t)) { this.targets = []; var i = n.findAllByState("combo", this.selectedState), o = r.get("id"); 0 === i.filter(function (t) { var e = t.get("id"); return o === e; }).length ? this.targets.push(r) : (this.targets = i), this.activeState && this.targets.map(function (t) { var r = t.getModel(); if (r.parentId) { var i = n.findById(r.parentId); i && n.setItemState(i, e.activeState, !0); } }), (this.point = {}), (this.originPoint = {}), (this.origin = { x: t.x, y: t.y }), (this.currentItemChildCombos = []), m(r, function (t) { if (t.destroyed) return !1; var n = t.getModel(); return e.currentItemChildCombos.push(n.id), !0; }); } }, onDrag: function (t) { var e = this; if (this.origin && this.validationCombo(t)) if (this.enableDelegate) this.updateDelegate(t); else { if (this.activeState) { var n = this.graph, r = t.item, o = r.getModel(), a = n.getCombos(), s = r.getBBox(), c = s.centerX, u = s.centerY, h = s.width; a.filter(function (t) { var n = t.getModel(); return ( o.parentId, n.id !== o.id && !e.currentItemChildCombos.includes(n.id) ); }).map(function (t) { var r = t.getBBox(), i = r.centerX, o = r.centerY, a = r.width, s = c - i, l = u - o, f = 2 * Math.sqrt(s * s + l * l); h + a - f > 0.8 * h ? n.setItemState(t, e.activeState, !0) : n.setItemState(t, e.activeState, !1); }); } Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); } }, updatePositions: function (t) { var e = this; this.enableDelegate && Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); }, onDrop: function (t) { var e = this, n = t.item; if (n && this.targets && !n.destroyed) { this.updatePositions(t); var r = this.graph, i = n.getModel(); this.targets.map(function (t) { t.getModel().parentId !== i.id ? (e.activeState && r.setItemState(n, e.activeState, !1), e.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t, i.id)) : r.updateCombo(n); }), this.end(n, t), (this.endComparison = !0); } }, onNodeDrop: function (t) { var e = this; if (this.targets && 0 !== this.targets.length) { this.updatePositions(t); var n, r = this.graph, i = t.item.getModel().comboId; if (i) { if (this.activeState) { var o = r.findById(i); r.setItemState(o, this.activeState, !1); } this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : i !== t.getID() && ((n = r.findById(i)), i !== t.getModel().parentId && r.updateComboTree(t, i)); }); } else this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : t.getModel().comboId && r.updateComboTree(t); }); (this.endComparison = !0), this.end(n, t); } }, onDragEnter: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !0); } }, onDragLeave: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !1); } }, onDragEnd: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.getParentCombo(e.getModel().parentId), r = this.graph; n && this.activeState && r.setItemState(n, this.activeState, !1), this.end(void 0, t); } }, end: function (t, e) { var n = this; if (this.origin) { var r = this.graph; if (this.delegateShape) r.get("delegateGroup").clear(), (this.delegateShape = null); t && this.activeState && r.setItemState(t, this.activeState, !1), t || this.targets.map(function (t) { n.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t); }), (this.point = []), (this.origin = null), (this.originPoint = null), (this.targets.length = 0); } }, traverse: function (t, e) { var n = this; if (!1 !== e(t) && t) { var r = t.get("combos"); Object(i.each)(r, function (t) { n.traverse(t, e); }); var o = t.get("nodes"); Object(i.each)(o, function (t) { n.traverse(t, e); }); } }, updateCombo: function (t, e) { var n = this; this.traverse(t, function (t) { return !t.destroyed && (n.updateSignleItem(t, e), !0); }); }, updateSignleItem: function (t, e) { var n = this.origin, r = this.graph, i = t.getModel(), o = t.get("id"); this.point[o] || (this.point[o] = { x: i.x, y: i.y }); var a = e.x - n.x + this.point[o].x, s = e.y - n.y + this.point[o].y; r.updateItem(t, { x: a, y: s }); }, getParentCombo: function (t) { var e = this.graph; if (t) { var n = e.findById(t); if (n) return n; } }, updateDelegate: function (t) { var e = this.graph; if (this.delegateShape) { var n = t.x - this.origin.x + this.originPoint.minX, i = t.y - this.origin.y + this.originPoint.minY; this.delegateShape.attr({ x: n, y: i }); } else { var o = e.get("delegateGroup"), a = null, s = (a = this.targets.length > 1 ? y(this.targets) : this.targets[0].getBBox()).x, c = a.y, u = a.width, h = a.height, f = a.minX, d = a.minY; this.originPoint = { x: s, y: c, width: u, height: h, minX: f, minY: d, }; var p = Object(r.a)( Object(r.a)({}, l.a.delegateStyle), this.delegateStyle, ); this.delegateShape = o.addShape("rect", { attrs: Object(r.a)( { width: a.width, height: a.height, x: a.x, y: a.y }, p, ), name: "combo-delegate-shape", }); } }, }, "collapse-expand-combo": { getDefaultCfg: function () { return { trigger: "dblclick", relayout: !0 }; }, getEvents: function () { var t, e; return ( b.includes(this.trigger) ? (e = this.trigger) : ((e = "dblclick"), console.warn( "Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["combo:" + e] = "onComboClick"), t ); }, onComboClick: function (t) { var e = t.item, n = this.graph, r = this.relayout; if (e && !e.destroyed && "combo" === e.getType()) { var i = e.getModel().id; i && (n.collapseExpandCombo(i), r && n.get("layout") ? n.layout() : n.refreshPositions()); } }, }, "create-edge": { getDefaultCfg: function () { return { trigger: "tap", key: void 0, edgeConfig: {} }; }, getEvents: function () { var t; return ( x.indexOf(this.trigger.toLowerCase()) > -1 || ((this.trigger = "tap"), console.warn( "Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'", )), this.key && -1 === w.indexOf(this.key.toLowerCase()) && ((this.trigger = void 0), console.warn( "Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined", )), "drag" === this.trigger ? (t = { "node:dragstart": "onClick", "combo:dragstart": "onClick", drag: "updateEndPoint", "node:drop": "onClick", "combo:drop": "onClick", dragend: "onDragEnd", }) : "click" === this.trigger && (t = { "node:tap": "onClick", mousemove: "updateEndPoint", "edge:tap": "cancelCreating", "canvas:tap": "cancelCreating", "combo:tap": "onClick", }), this.key && ((t.keydown = "onKeyDown"), (t.keyup = "onKeyUp")), t ); }, onDragEnd: function (t) { if (!this.key || this.keydown) { var e = t.item; (e && e.getID() !== this.source && "node" === e.getType()) || this.cancelCreating({ item: this.edge, x: t.x, y: t.y }); } }, onClick: function (t) { if (!this.key || this.keydown) { var e = t.item, n = this.graph, i = e.getModel(); if (this.addingEdge && this.edge) { if (!this.shouldEnd.call(this, t)) return; var o = { target: i.id }; this.source === i.id && (o.type = "loop"), n.emit("beforecreateedge", {}), n.updateItem(this.edge, o), n.emit("aftercreateedge", { edge: this.edge }), this.edge.getKeyShape().set("capture", !0), (this.edge = null), (this.addingEdge = !1); } else { if (!this.shouldBegin.call(this, t)) return; (this.edge = n.addItem( "edge", Object(r.a)( { source: i.id, target: i.id }, this.edgeConfig, ), !1, )), (this.source = i.id), (this.addingEdge = !0), this.edge.getKeyShape().set("capture", !1); } } }, updateEndPoint: function (t) { if (!this.key || this.keydown) { var e = { x: t.x, y: t.y }; this.graph.findById(this.source) ? this.addingEdge && this.edge && this.graph.updateItem(this.edge, { target: e }, !1) : (this.addingEdge = !1); } }, cancelCreating: function (t) { if (!this.key || this.keydown) { var e = this.graph, n = t.item; if ( this.addingEdge && t.target && t.target.isCanvas && t.target.isCanvas() ) return ( e.removeItem(this.edge, !1), (this.edge = null), void (this.addingEdge = !1) ); if (this.addingEdge && this.edge === n) { var r = !0; if (!e.get("groupByTypes")) for ( var i = t.x, o = t.y, a = e.getNodes(), s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = u.getModel(), l = u.getBBox(); if ( i <= l.maxX && i >= l.minX && o <= l.maxY && o >= l.minY ) { if ( !this.shouldEnd.call(this, { x: t.x, y: t.y, canvasX: t.canvasX, canvasY: t.canvasY, clientX: t.clientX, clientY: t.clientY, item: u, }) ) return; e.emit("beforecreateedge", {}), e.updateItem(this.edge, { target: h.id }), e.emit("aftercreateedge", { edge: this.edge }), (r = !1); break; } } r && e.removeItem(this.edge, !1), (this.edge = null), (this.addingEdge = !1); } } }, onKeyDown: function (t) { var e = t.key; e && (e.toLowerCase() === this.key.toLowerCase() ? (this.keydown = !0) : (this.keydown = !1)); }, onKeyUp: function () { this.addingEdge && this.edge && (this.graph.removeItem(this.edge, !1), (this.addingEdge = !1), (this.edge = null)), (this.keydown = !1); }, }, }; Object(i.each)(O, function (t, e) { Object(o.i)(e, Object(r.a)(Object(r.a)({}, t), S)); }); }, 4: function (t, e, n) { "use strict"; n.d(e, "a", function () { return r; }), n.d(e, "b", function () { return _; }), n.d(e, "c", function () { return R; }); var r = {}; n.r(r), n.d(r, "create", function () { return o; }), n.d(r, "fromMat4", function () { return a; }), n.d(r, "clone", function () { return s; }), n.d(r, "copy", function () { return c; }), n.d(r, "fromValues", function () { return u; }), n.d(r, "set", function () { return h; }), n.d(r, "identity", function () { return l; }), n.d(r, "transpose", function () { return f; }), n.d(r, "invert", function () { return d; }), n.d(r, "adjoint", function () { return p; }), n.d(r, "determinant", function () { return g; }), n.d(r, "multiply", function () { return v; }), n.d(r, "translate", function () { return y; }), n.d(r, "rotate", function () { return m; }), n.d(r, "scale", function () { return b; }), n.d(r, "fromTranslation", function () { return x; }), n.d(r, "fromRotation", function () { return w; }), n.d(r, "fromScaling", function () { return S; }), n.d(r, "fromMat2d", function () { return O; }), n.d(r, "fromQuat", function () { return M; }), n.d(r, "normalFromMat4", function () { return k; }), n.d(r, "projection", function () { return C; }), n.d(r, "str", function () { return E; }), n.d(r, "frob", function () { return j; }), n.d(r, "add", function () { return P; }), n.d(r, "subtract", function () { return A; }), n.d(r, "multiplyScalar", function () { return I; }), n.d(r, "multiplyScalarAndAdd", function () { return T; }), n.d(r, "exactEquals", function () { return N; }), n.d(r, "equals", function () { return B; }), n.d(r, "mul", function () { return L; }), n.d(r, "sub", function () { return D; }); var i = n(5); function o() { var t = new i.a(9); return ( i.a != Float32Array && ((t[1] = 0), (t[2] = 0), (t[3] = 0), (t[5] = 0), (t[6] = 0), (t[7] = 0)), (t[0] = 1), (t[4] = 1), (t[8] = 1), t ); } function a(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[4]), (t[4] = e[5]), (t[5] = e[6]), (t[6] = e[8]), (t[7] = e[9]), (t[8] = e[10]), t ); } function s(t) { var e = new i.a(9); return ( (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), e ); } function c(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function u(t, e, n, r, o, a, s, c, u) { var h = new i.a(9); return ( (h[0] = t), (h[1] = e), (h[2] = n), (h[3] = r), (h[4] = o), (h[5] = a), (h[6] = s), (h[7] = c), (h[8] = u), h ); } function h(t, e, n, r, i, o, a, s, c, u) { return ( (t[0] = e), (t[1] = n), (t[2] = r), (t[3] = i), (t[4] = o), (t[5] = a), (t[6] = s), (t[7] = c), (t[8] = u), t ); } function l(t) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function f(t, e) { if (t === e) { var n = e[1], r = e[2], i = e[5]; (t[1] = e[3]), (t[2] = e[6]), (t[3] = n), (t[5] = e[7]), (t[6] = r), (t[7] = i); } else (t[0] = e[0]), (t[1] = e[3]), (t[2] = e[6]), (t[3] = e[1]), (t[4] = e[4]), (t[5] = e[7]), (t[6] = e[2]), (t[7] = e[5]), (t[8] = e[8]); return t; } function d(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (t[0] = l * p), (t[1] = (-h * r + i * u) * p), (t[2] = (s * r - i * a) * p), (t[3] = f * p), (t[4] = (h * n - i * c) * p), (t[5] = (-s * n + i * o) * p), (t[6] = d * p), (t[7] = (-u * n + r * c) * p), (t[8] = (a * n - r * o) * p), t) : null; } function p(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8]; return ( (t[0] = a * h - s * u), (t[1] = i * u - r * h), (t[2] = r * s - i * a), (t[3] = s * c - o * h), (t[4] = n * h - i * c), (t[5] = i * o - n * s), (t[6] = o * u - a * c), (t[7] = r * c - n * u), (t[8] = n * a - r * o), t ); } function g(t) { var e = t[0], n = t[1], r = t[2], i = t[3], o = t[4], a = t[5], s = t[6], c = t[7], u = t[8]; return e * (u * o - a * c) + n * (-u * i + a * s) + r * (c * i - o * s); } function v(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1], p = n[2], g = n[3], v = n[4], y = n[5], m = n[6], b = n[7], x = n[8]; return ( (t[0] = f * r + d * a + p * u), (t[1] = f * i + d * s + p * h), (t[2] = f * o + d * c + p * l), (t[3] = g * r + v * a + y * u), (t[4] = g * i + v * s + y * h), (t[5] = g * o + v * c + y * l), (t[6] = m * r + b * a + x * u), (t[7] = m * i + b * s + x * h), (t[8] = m * o + b * c + x * l), t ); } function y(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1]; return ( (t[0] = r), (t[1] = i), (t[2] = o), (t[3] = a), (t[4] = s), (t[5] = c), (t[6] = f * r + d * a + u), (t[7] = f * i + d * s + h), (t[8] = f * o + d * c + l), t ); } function m(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = Math.sin(n), d = Math.cos(n); return ( (t[0] = d * r + f * a), (t[1] = d * i + f * s), (t[2] = d * o + f * c), (t[3] = d * a - f * r), (t[4] = d * s - f * i), (t[5] = d * c - f * o), (t[6] = u), (t[7] = h), (t[8] = l), t ); } function b(t, e, n) { var r = n[0], i = n[1]; return ( (t[0] = r * e[0]), (t[1] = r * e[1]), (t[2] = r * e[2]), (t[3] = i * e[3]), (t[4] = i * e[4]), (t[5] = i * e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function x(t, e) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = e[0]), (t[7] = e[1]), (t[8] = 1), t ); } function w(t, e) { var n = Math.sin(e), r = Math.cos(e); return ( (t[0] = r), (t[1] = n), (t[2] = 0), (t[3] = -n), (t[4] = r), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function S(t, e) { return ( (t[0] = e[0]), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = e[1]), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function O(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = 0), (t[3] = e[2]), (t[4] = e[3]), (t[5] = 0), (t[6] = e[4]), (t[7] = e[5]), (t[8] = 1), t ); } function M(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = n + n, s = r + r, c = i + i, u = n * a, h = r * a, l = r * s, f = i * a, d = i * s, p = i * c, g = o * a, v = o * s, y = o * c; return ( (t[0] = 1 - l - p), (t[3] = h - y), (t[6] = f + v), (t[1] = h + y), (t[4] = 1 - u - p), (t[7] = d - g), (t[2] = f - v), (t[5] = d + g), (t[8] = 1 - u - l), t ); } function k(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = e[9], f = e[10], d = e[11], p = e[12], g = e[13], v = e[14], y = e[15], m = n * s - r * a, b = n * c - i * a, x = n * u - o * a, w = r * c - i * s, S = r * u - o * s, O = i * u - o * c, M = h * g - l * p, k = h * v - f * p, C = h * y - d * p, E = l * v - f * g, j = l * y - d * g, P = f * y - d * v, A = m * P - b * j + x * E + w * C - S * k + O * M; return A ? ((A = 1 / A), (t[0] = (s * P - c * j + u * E) * A), (t[1] = (c * C - a * P - u * k) * A), (t[2] = (a * j - s * C + u * M) * A), (t[3] = (i * j - r * P - o * E) * A), (t[4] = (n * P - i * C + o * k) * A), (t[5] = (r * C - n * j - o * M) * A), (t[6] = (g * O - v * S + y * w) * A), (t[7] = (v * x - p * O - y * b) * A), (t[8] = (p * S - g * x + y * m) * A), t) : null; } function C(t, e, n) { return ( (t[0] = 2 / e), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = -2 / n), (t[5] = 0), (t[6] = -1), (t[7] = 1), (t[8] = 1), t ); } function E(t) { return ( "mat3(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ", " + t[4] + ", " + t[5] + ", " + t[6] + ", " + t[7] + ", " + t[8] + ")" ); } function j(t) { return Math.hypot(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8]); } function P(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), (t[3] = e[3] + n[3]), (t[4] = e[4] + n[4]), (t[5] = e[5] + n[5]), (t[6] = e[6] + n[6]), (t[7] = e[7] + n[7]), (t[8] = e[8] + n[8]), t ); } function A(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), (t[3] = e[3] - n[3]), (t[4] = e[4] - n[4]), (t[5] = e[5] - n[5]), (t[6] = e[6] - n[6]), (t[7] = e[7] - n[7]), (t[8] = e[8] - n[8]), t ); } function I(t, e, n) { return ( (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), (t[3] = e[3] * n), (t[4] = e[4] * n), (t[5] = e[5] * n), (t[6] = e[6] * n), (t[7] = e[7] * n), (t[8] = e[8] * n), t ); } function T(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), (t[3] = e[3] + n[3] * r), (t[4] = e[4] + n[4] * r), (t[5] = e[5] + n[5] * r), (t[6] = e[6] + n[6] * r), (t[7] = e[7] + n[7] * r), (t[8] = e[8] + n[8] * r), t ); } function N(t, e) { return ( t[0] === e[0] && t[1] === e[1] && t[2] === e[2] && t[3] === e[3] && t[4] === e[4] && t[5] === e[5] && t[6] === e[6] && t[7] === e[7] && t[8] === e[8] ); } function B(t, e) { var n = t[0], r = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( Math.abs(n - f) <= i.b * Math.max(1, Math.abs(n), Math.abs(f)) && Math.abs(r - d) <= i.b * Math.max(1, Math.abs(r), Math.abs(d)) && Math.abs(o - p) <= i.b * Math.max(1, Math.abs(o), Math.abs(p)) && Math.abs(a - g) <= i.b * Math.max(1, Math.abs(a), Math.abs(g)) && Math.abs(s - v) <= i.b * Math.max(1, Math.abs(s), Math.abs(v)) && Math.abs(c - y) <= i.b * Math.max(1, Math.abs(c), Math.abs(y)) && Math.abs(u - m) <= i.b * Math.max(1, Math.abs(u), Math.abs(m)) && Math.abs(h - b) <= i.b * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(l - x) <= i.b * Math.max(1, Math.abs(l), Math.abs(x)) ); } var L = v, D = A, _ = n(42), R = n(72); }, 42: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "fromValues", function () { return a; }), n.d(e, "copy", function () { return s; }), n.d(e, "set", function () { return c; }), n.d(e, "add", function () { return u; }), n.d(e, "subtract", function () { return h; }), n.d(e, "multiply", function () { return l; }), n.d(e, "divide", function () { return f; }), n.d(e, "ceil", function () { return d; }), n.d(e, "floor", function () { return p; }), n.d(e, "min", function () { return g; }), n.d(e, "max", function () { return v; }), n.d(e, "round", function () { return y; }), n.d(e, "scale", function () { return m; }), n.d(e, "scaleAndAdd", function () { return b; }), n.d(e, "distance", function () { return x; }), n.d(e, "squaredDistance", function () { return w; }), n.d(e, "length", function () { return S; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return C; }), n.d(e, "dot", function () { return E; }), n.d(e, "cross", function () { return j; }), n.d(e, "lerp", function () { return P; }), n.d(e, "random", function () { return A; }), n.d(e, "transformMat2", function () { return I; }), n.d(e, "transformMat2d", function () { return T; }), n.d(e, "transformMat3", function () { return N; }), n.d(e, "transformMat4", function () { return B; }), n.d(e, "rotate", function () { return L; }), n.d(e, "angle", function () { return D; }), n.d(e, "zero", function () { return _; }), n.d(e, "str", function () { return R; }), n.d(e, "exactEquals", function () { return F; }), n.d(e, "equals", function () { return Y; }), n.d(e, "len", function () { return z; }), n.d(e, "sub", function () { return W; }), n.d(e, "mul", function () { return q; }), n.d(e, "div", function () { return V; }), n.d(e, "dist", function () { return G; }), n.d(e, "sqrDist", function () { return H; }), n.d(e, "sqrLen", function () { return U; }), n.d(e, "forEach", function () { return Z; }); var r = n(5); function i() { var t = new r.a(2); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0)), t; } function o(t) { var e = new r.a(2); return (e[0] = t[0]), (e[1] = t[1]), e; } function a(t, e) { var n = new r.a(2); return (n[0] = t), (n[1] = e), n; } function s(t, e) { return (t[0] = e[0]), (t[1] = e[1]), t; } function c(t, e, n) { return (t[0] = e), (t[1] = n), t; } function u(t, e, n) { return (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), t; } function h(t, e, n) { return (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), t; } function l(t, e, n) { return (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), t; } function f(t, e, n) { return (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), t; } function d(t, e) { return (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), t; } function p(t, e) { return (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), t; } function g(t, e, n) { return (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), t; } function v(t, e, n) { return (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), t; } function y(t, e) { return (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), t; } function m(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), t; } function b(t, e, n, r) { return (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), t; } function x(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return Math.hypot(n, r); } function w(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return n * n + r * r; } function S(t) { var e = t[0], n = t[1]; return Math.hypot(e, n); } function O(t) { var e = t[0], n = t[1]; return e * e + n * n; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), t; } function C(t, e) { var n = e[0], r = e[1], i = n * n + r * r; return ( i > 0 && (i = 1 / Math.sqrt(i)), (t[0] = e[0] * i), (t[1] = e[1] * i), t ); } function E(t, e) { return t[0] * e[0] + t[1] * e[1]; } function j(t, e, n) { var r = e[0] * n[1] - e[1] * n[0]; return (t[0] = t[1] = 0), (t[2] = r), t; } function P(t, e, n, r) { var i = e[0], o = e[1]; return (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), t; } function A(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI; return (t[0] = Math.cos(n) * e), (t[1] = Math.sin(n) * e), t; } function I(t, e, n) { var r = e[0], i = e[1]; return (t[0] = n[0] * r + n[2] * i), (t[1] = n[1] * r + n[3] * i), t; } function T(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[2] * i + n[4]), (t[1] = n[1] * r + n[3] * i + n[5]), t ); } function N(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[3] * i + n[6]), (t[1] = n[1] * r + n[4] * i + n[7]), t ); } function B(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[4] * i + n[12]), (t[1] = n[1] * r + n[5] * i + n[13]), t ); } function L(t, e, n, r) { var i = e[0] - n[0], o = e[1] - n[1], a = Math.sin(r), s = Math.cos(r); return (t[0] = i * s - o * a + n[0]), (t[1] = i * a + o * s + n[1]), t; } function D(t, e) { var n = t[0], r = t[1], i = e[0], o = e[1], a = Math.sqrt(n * n + r * r) * Math.sqrt(i * i + o * o), s = a && (n * i + r * o) / a; return Math.acos(Math.min(Math.max(s, -1), 1)); } function _(t) { return (t[0] = 0), (t[1] = 0), t; } function R(t) { return "vec2(" + t[0] + ", " + t[1] + ")"; } function F(t, e) { return t[0] === e[0] && t[1] === e[1]; } function Y(t, e) { var n = t[0], i = t[1], o = e[0], a = e[1]; return ( Math.abs(n - o) <= r.b * Math.max(1, Math.abs(n), Math.abs(o)) && Math.abs(i - a) <= r.b * Math.max(1, Math.abs(i), Math.abs(a)) ); } var X, z = S, W = h, q = l, V = f, G = x, H = w, U = O, Z = ((X = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 2), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (X[0] = t[a]), (X[1] = t[a + 1]), i(X, X, o), (t[a] = X[0]), (t[a + 1] = X[1]); return t; }); }, 43: function (t, e, n) { "use strict"; var r, i, o, a; function s(t) { r || ((r = document.createElement("table")), (i = document.createElement("tr")), (o = /^\s*<(\w+|!)[^>]*>/), (a = { tr: document.createElement("tbody"), tbody: r, thead: r, tfoot: r, td: i, th: i, "*": document.createElement("div"), })); var e = o.test(t) && RegExp.$1; (e && e in a) || (e = "*"); var n = a[e]; (t = "string" == typeof t ? t.replace(/(^\s*)|(\s*$)/g, "") : t), (n.innerHTML = "" + t); var s = n.childNodes[0]; return s && n.contains(s) && n.removeChild(s), s; } function c(t, e) { if (t) for (var n in e) e.hasOwnProperty(n) && (t.style[n] = e[n]); return t; } n.d(e, "a", function () { return s; }), n.d(e, "b", function () { return c; }); }, 44: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(181), a = n(185), s = [].slice, c = ["keyword", "gray", "hex"], u = {}; Object.keys(a).forEach(function (t) { u[s.call(a[t].labels).sort().join("")] = t; }); var h = {}; function l(t, e) { if (!(this instanceof l)) return new l(t, e); if ((e && e in c && (e = null), e && !(e in a))) throw new Error("Unknown model: " + e); var n, r, i, f, d, p, g, y, m; if (null == t) (this.model = "rgb"), (this.color = [0, 0, 0]), (this.valpha = 1); else if (t instanceof l) (this.model = t.model), (this.color = t.color.slice()), (this.valpha = t.valpha); else if ("string" == typeof t) { if (null === (r = o.get(t))) throw new Error("Unable to parse color from string: " + t); (this.model = r.model), (m = a[this.model].channels), (this.color = r.value.slice(0, m)), (this.valpha = "number" == typeof r.value[m] ? r.value[m] : 1); } else if (t.length) (this.model = e || "rgb"), (m = a[this.model].channels), (i = s.call(t, 0, m)), (this.color = v(i, m)), (this.valpha = "number" == typeof t[m] ? t[m] : 1); else if ("number" == typeof t) (t &= 16777215), (this.model = "rgb"), (this.color = [(t >> 16) & 255, (t >> 8) & 255, 255 & t]), (this.valpha = 1); else { if ( ((this.valpha = 1), (f = Object.keys(t)), "alpha" in t && (f.splice(f.indexOf("alpha"), 1), (this.valpha = "number" == typeof t.alpha ? t.alpha : 0)), !((d = f.sort().join("")) in u)) ) throw new Error( "Unable to parse color from object: " + JSON.stringify(t), ); for ( this.model = u[d], p = a[this.model].labels, g = [], n = 0; n < p.length; n++ ) g.push(t[p[n]]); this.color = v(g); } if (h[this.model]) for (m = a[this.model].channels, n = 0; n < m; n++) (y = h[this.model][n]) && (this.color[n] = y(this.color[n])); (this.valpha = Math.max(0, Math.min(1, this.valpha))), Object.freeze && Object.freeze(this); } function f(t) { return function (e) { return (function (t, e) { return Number(t.toFixed(e)); })(e, t); }; } function d(t, e, n) { return ( (t = Array.isArray(t) ? t : [t]).forEach(function (t) { (h[t] || (h[t] = []))[e] = n; }), (t = t[0]), function (r) { var i; return arguments.length ? (n && (r = n(r)), ((i = this[t]()).color[e] = r), i) : ((i = this[t]().color[e]), n && (i = n(i)), i); } ); } function p(t) { return function (e) { return Math.max(0, Math.min(t, e)); }; } function g(t) { return Array.isArray(t) ? t : [t]; } function v(t, e) { var n; for (n = 0; n < e; n++) "number" != typeof t[n] && (t[n] = 0); return t; } (l.prototype = { toString: function () { return this.string(); }, toJSON: function () { return this[this.model](); }, string: function (t) { var e = this.model in o.to ? this : this.rgb(), n = 1 === (e = e.round("number" == typeof t ? t : 1)).valpha ? e.color : e.color.concat(this.valpha); return o.to[e.model](n); }, percentString: function (t) { var e = this.rgb().round("number" == typeof t ? t : 1), n = 1 === e.valpha ? e.color : e.color.concat(this.valpha); return o.to.rgb.percent(n); }, array: function () { return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha); }, object: function () { var t, e = {}, n = a[this.model].channels, r = a[this.model].labels; for (t = 0; t < n; t++) e[r[t]] = this.color[t]; return 1 !== this.valpha && (e.alpha = this.valpha), e; }, unitArray: function () { var t = this.rgb().color; return ( (t[0] /= 255), (t[1] /= 255), (t[2] /= 255), 1 !== this.valpha && t.push(this.valpha), t ); }, unitObject: function () { var t = this.rgb().object(); return ( (t.r /= 255), (t.g /= 255), (t.b /= 255), 1 !== this.valpha && (t.alpha = this.valpha), t ); }, round: function (t) { return ( (t = Math.max(t || 0, 0)), new l(this.color.map(f(t)).concat(this.valpha), this.model) ); }, alpha: function (t) { return arguments.length ? new l(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha; }, red: d("rgb", 0, p(255)), green: d("rgb", 1, p(255)), blue: d("rgb", 2, p(255)), hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function (t) { return ((t % 360) + 360) % 360; }), saturationl: d("hsl", 1, p(100)), lightness: d("hsl", 2, p(100)), saturationv: d("hsv", 1, p(100)), value: d("hsv", 2, p(100)), chroma: d("hcg", 1, p(100)), gray: d("hcg", 2, p(100)), white: d("hwb", 1, p(100)), wblack: d("hwb", 2, p(100)), cyan: d("cmyk", 0, p(100)), magenta: d("cmyk", 1, p(100)), yellow: d("cmyk", 2, p(100)), black: d("cmyk", 3, p(100)), x: d("xyz", 0, p(100)), y: d("xyz", 1, p(100)), z: d("xyz", 2, p(100)), l: d("lab", 0, p(100)), a: d("lab", 1), b: d("lab", 2), keyword: function (t) { return arguments.length ? new l(t) : a[this.model].keyword(this.color); }, hex: function (t) { return arguments.length ? new l(t) : o.to.hex(this.rgb().round().color); }, rgbNumber: function () { var t = this.rgb().color; return ((255 & t[0]) << 16) | ((255 & t[1]) << 8) | (255 & t[2]); }, luminosity: function () { var t, e, n = this.rgb().color, r = []; for (t = 0; t < n.length; t++) (e = n[t] / 255), (r[t] = e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)); return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2]; }, contrast: function (t) { var e = this.luminosity(), n = t.luminosity(); return e > n ? (e + 0.05) / (n + 0.05) : (n + 0.05) / (e + 0.05); }, level: function (t) { var e = this.contrast(t); return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : ""; }, isDark: function () { var t = this.rgb().color; return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128; }, isLight: function () { return !this.isDark(); }, negate: function () { var t, e = this.rgb(); for (t = 0; t < 3; t++) e.color[t] = 255 - e.color[t]; return e; }, lighten: function (t) { var e = this.hsl(); return (e.color[2] += e.color[2] * t), e; }, darken: function (t) { var e = this.hsl(); return (e.color[2] -= e.color[2] * t), e; }, saturate: function (t) { var e = this.hsl(); return (e.color[1] += e.color[1] * t), e; }, desaturate: function (t) { var e = this.hsl(); return (e.color[1] -= e.color[1] * t), e; }, whiten: function (t) { var e = this.hwb(); return (e.color[1] += e.color[1] * t), e; }, blacken: function (t) { var e = this.hwb(); return (e.color[2] += e.color[2] * t), e; }, grayscale: function () { var t = this.rgb().color, e = 0.3 * t[0] + 0.59 * t[1] + 0.11 * t[2]; return l.rgb(e, e, e); }, fade: function (t) { return this.alpha(this.valpha - this.valpha * t); }, opaquer: function (t) { return this.alpha(this.valpha + this.valpha * t); }, rotate: function (t) { var e = this.hsl(), n = e.color[0]; return ( (n = (n = (n + t) % 360) < 0 ? 360 + n : n), (e.color[0] = n), e ); }, mix: function (t, e) { if (!t || !t.rgb) throw new Error( 'Argument to "mix" was not a Color instance, but rather an instance of ' + i(t), ); var n = t.rgb(), r = this.rgb(), o = void 0 === e ? 0.5 : e, a = 2 * o - 1, s = n.alpha() - r.alpha(), c = ((a * s == -1 ? a : (a + s) / (1 + a * s)) + 1) / 2, u = 1 - c; return l.rgb( c * n.red() + u * r.red(), c * n.green() + u * r.green(), c * n.blue() + u * r.blue(), n.alpha() * o + r.alpha() * (1 - o), ); }, }), Object.keys(a).forEach(function (t) { if (-1 === c.indexOf(t)) { var e = a[t].channels; (l.prototype[t] = function () { if (this.model === t) return new l(this); if (arguments.length) return new l(arguments, t); var n = "number" == typeof arguments[e] ? e : this.valpha; return new l(g(a[this.model][t].raw(this.color)).concat(n), t); }), (l[t] = function (n) { return ( "number" == typeof n && (n = v(s.call(arguments), e)), new l(n, t) ); }); } }), (t.exports = l); }, 5: function (t, e, n) { "use strict"; n.d(e, "b", function () { return r; }), n.d(e, "a", function () { return i; }), n.d(e, "c", function () { return o; }); var r = 1e-6, i = "undefined" != typeof Float32Array ? Float32Array : Array, o = Math.random; Math.PI; Math.hypot || (Math.hypot = function () { for (var t = 0, e = arguments.length; e--; ) t += arguments[e] * arguments[e]; return Math.sqrt(t); }); }, 51: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.getLayoutByName = e.unRegisterLayout = e.registerLayout = void 0); var o = n(53), a = n(188), s = new Map(); e.registerLayout = function (t, e) { var n; s.get(t) && console.warn( "The layout with the name " + t + " exists already, it will be overridden", ), a.isObject(e) ? ((n = (function (t) { function n(n) { var r = t.call(this) || this, i = r, o = {}, a = i.getDefaultCfg(); return ( Object.assign(o, a, e, n), Object.keys(o).forEach(function (t) { var e = o[t]; i[t] = e; }), r ); } return i(n, t), n; })(o.Base)), s.set(t, n)) : s.set(t, e); }; e.unRegisterLayout = function (t) { s.has(t) && s.delete(t); }; e.getLayoutByName = function (t) { return s.has(t) ? s.get(t) : null; }; }, 52: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var o = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.center = [0, 0]), (n.width = 300), (n.height = 300), (n.nodes = []), (n.edges = []), (n.onLayoutEnd = function () {}), n.updateCfg(e), n ); } return ( i(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, n = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + n[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + n[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(n(53).Base); e.RandomLayout = o; }, 53: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function () {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, 6: function (t, e, n) { "use strict"; n.d(e, "d", function () { return F; }), n.d(e, "a", function () { return cn; }), n.d(e, "b", function () { return un; }), n.d(e, "c", function () { return hn; }), n.d(e, "e", function () { return r; }), n.d(e, "g", function () { return dn; }), n.d(e, "l", function () { return fn; }), n.d(e, "h", function () { return xn; }), n.d(e, "f", function () { return Sn; }), n.d(e, "j", function () { return V; }), n.d(e, "k", function () { return Z; }), n.d(e, "i", function () { return K; }); var r = {}; n.r(r), n.d(r, "catmullRomToBezier", function () { return h; }), n.d(r, "fillPath", function () { return T; }), n.d(r, "fillPathByDiff", function () { return L; }), n.d(r, "formatPath", function () { return R; }), n.d(r, "intersection", function () { return P; }), n.d(r, "parsePathArray", function () { return m; }), n.d(r, "parsePathString", function () { return u; }), n.d(r, "pathToAbsolute", function () { return f; }), n.d(r, "pathToCurve", function () { return v; }), n.d(r, "rectPath", function () { return M; }); var i = {}; n.r(i), n.d(i, "easeLinear", function () { return me; }), n.d(i, "easeQuad", function () { return we; }), n.d(i, "easeQuadIn", function () { return be; }), n.d(i, "easeQuadOut", function () { return xe; }), n.d(i, "easeQuadInOut", function () { return we; }), n.d(i, "easeCubic", function () { return Me; }), n.d(i, "easeCubicIn", function () { return Se; }), n.d(i, "easeCubicOut", function () { return Oe; }), n.d(i, "easeCubicInOut", function () { return Me; }), n.d(i, "easePoly", function () { return Ee; }), n.d(i, "easePolyIn", function () { return ke; }), n.d(i, "easePolyOut", function () { return Ce; }), n.d(i, "easePolyInOut", function () { return Ee; }), n.d(i, "easeSin", function () { return Te; }), n.d(i, "easeSinIn", function () { return Ae; }), n.d(i, "easeSinOut", function () { return Ie; }), n.d(i, "easeSinInOut", function () { return Te; }), n.d(i, "easeExp", function () { return De; }), n.d(i, "easeExpIn", function () { return Be; }), n.d(i, "easeExpOut", function () { return Le; }), n.d(i, "easeExpInOut", function () { return De; }), n.d(i, "easeCircle", function () { return Fe; }), n.d(i, "easeCircleIn", function () { return _e; }), n.d(i, "easeCircleOut", function () { return Re; }), n.d(i, "easeCircleInOut", function () { return Fe; }), n.d(i, "easeBounce", function () { return ze; }), n.d(i, "easeBounceIn", function () { return Xe; }), n.d(i, "easeBounceOut", function () { return ze; }), n.d(i, "easeBounceInOut", function () { return We; }), n.d(i, "easeBack", function () { return Ge; }), n.d(i, "easeBackIn", function () { return qe; }), n.d(i, "easeBackOut", function () { return Ve; }), n.d(i, "easeBackInOut", function () { return Ge; }), n.d(i, "easeElastic", function () { return Ze; }), n.d(i, "easeElasticIn", function () { return Ue; }), n.d(i, "easeElasticOut", function () { return Ze; }), n.d(i, "easeElasticInOut", function () { return Ke; }); var o = n(0), a = "\t\n\v\f\r   ᠎              \u2028\u2029", s = new RegExp( "([a-z])[" + a + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + a + "]*,?[" + a + "]*)+)", "ig", ), c = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + a + "]*,?[" + a + "]*", "ig", ), u = function (t) { if (!t) return null; if (Object(o.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(s, function (r, i, o) { var a = [], s = i.toLowerCase(); if ( (o.replace(c, function (t, e) { e && a.push(+e); }), "m" === s && a.length > 2 && (n.push([i].concat(a.splice(0, 2))), (s = "l"), (i = "m" === i ? "l" : "L")), "o" === s && 1 === a.length && n.push([i, a[0]]), "r" === s) ) n.push([i].concat(a)); else for ( ; a.length >= e[s] && (n.push([i].concat(a.splice(0, e[s]))), e[s]); ); return t; }), n ); }, h = function (t, e) { for (var n = [], r = 0, i = t.length; i - 2 * !e > r; r += 2) { var o = [ { x: +t[r - 2], y: +t[r - 1] }, { x: +t[r], y: +t[r + 1] }, { x: +t[r + 2], y: +t[r + 3] }, { x: +t[r + 4], y: +t[r + 5] }, ]; e ? r ? i - 4 === r ? (o[3] = { x: +t[0], y: +t[1] }) : i - 2 === r && ((o[2] = { x: +t[0], y: +t[1] }), (o[3] = { x: +t[2], y: +t[3] })) : (o[0] = { x: +t[i - 2], y: +t[i - 1] }) : i - 4 === r ? (o[3] = o[2]) : r || (o[0] = { x: +t[r], y: +t[r + 1] }), n.push([ "C", (-o[0].x + 6 * o[1].x + o[2].x) / 6, (-o[0].y + 6 * o[1].y + o[2].y) / 6, (o[1].x + 6 * o[2].x - o[3].x) / 6, (o[1].y + 6 * o[2].y - o[3].y) / 6, o[2].x, o[2].y, ]); } return n; }, l = function (t, e, n, r, i) { var o = []; if ( (null === i && null === r && (r = n), (t = +t), (e = +e), (n = +n), (r = +r), null !== i) ) { var a = Math.PI / 180, s = t + n * Math.cos(-r * a), c = t + n * Math.cos(-i * a); o = [ ["M", s, e + n * Math.sin(-r * a)], ["A", n, n, 0, +(i - r > 180), 0, c, e + n * Math.sin(-i * a)], ]; } else o = [ ["M", t, e], ["m", 0, -r], ["a", n, r, 0, 1, 1, 0, 2 * r], ["a", n, r, 0, 1, 1, 0, -2 * r], ["z"], ]; return o; }, f = function (t) { if (!(t = u(t)) || !t.length) return [["M", 0, 0]]; var e, n, r = [], i = 0, o = 0, a = 0, s = 0, c = 0; "M" === t[0][0] && ((a = i = +t[0][1]), (s = o = +t[0][2]), c++, (r[0] = ["M", i, o])); for ( var f = 3 === t.length && "M" === t[0][0] && "R" === t[1][0].toUpperCase() && "Z" === t[2][0].toUpperCase(), d = void 0, p = void 0, g = c, v = t.length; g < v; g++ ) { if ((r.push((d = [])), (e = (p = t[g])[0]) !== e.toUpperCase())) switch (((d[0] = e.toUpperCase()), d[0])) { case "A": (d[1] = p[1]), (d[2] = p[2]), (d[3] = p[3]), (d[4] = p[4]), (d[5] = p[5]), (d[6] = +p[6] + i), (d[7] = +p[7] + o); break; case "V": d[1] = +p[1] + o; break; case "H": d[1] = +p[1] + i; break; case "R": for ( var y = 2, m = (n = [i, o].concat(p.slice(1))).length; y < m; y++ ) (n[y] = +n[y] + i), (n[++y] = +n[y] + o); r.pop(), (r = r.concat(h(n, f))); break; case "O": r.pop(), (n = l(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); break; case "U": r.pop(), (r = r.concat(l(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); break; case "M": (a = +p[1] + i), (s = +p[2] + o); break; default: for (y = 1, m = p.length; y < m; y++) d[y] = +p[y] + (y % 2 ? i : o); } else if ("R" === e) (n = [i, o].concat(p.slice(1))), r.pop(), (r = r.concat(h(n, f))), (d = ["R"].concat(p.slice(-2))); else if ("O" === e) r.pop(), (n = l(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); else if ("U" === e) r.pop(), (r = r.concat(l(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); else for (var b = 0, x = p.length; b < x; b++) d[b] = p[b]; if ("O" !== (e = e.toUpperCase())) switch (d[0]) { case "Z": (i = +a), (o = +s); break; case "H": i = d[1]; break; case "V": o = d[1]; break; case "M": (a = d[d.length - 2]), (s = d[d.length - 1]); break; default: (i = d[d.length - 2]), (o = d[d.length - 1]); } } return r; }, d = function (t, e, n, r) { return [t, e, n, r, n, r]; }, p = function (t, e, n, r, i, o) { return [ (1 / 3) * t + (2 / 3) * n, (1 / 3) * e + (2 / 3) * r, (1 / 3) * i + (2 / 3) * n, (1 / 3) * o + (2 / 3) * r, i, o, ]; }, g = function t(e, n, r, i, o, a, s, c, u, h) { r === i && (r += 1); var l, f, d, p, g, v = (120 * Math.PI) / 180, y = (Math.PI / 180) * (+o || 0), m = [], b = function (t, e, n) { return { x: t * Math.cos(n) - e * Math.sin(n), y: t * Math.sin(n) + e * Math.cos(n), }; }; if (h) (f = h[0]), (d = h[1]), (p = h[2]), (g = h[3]); else { (e = (l = b(e, n, -y)).x), (n = l.y), (c = (l = b(c, u, -y)).x), (u = l.y), e === c && n === u && ((c += 1), (u += 1)); var x = (e - c) / 2, w = (n - u) / 2, S = (x * x) / (r * r) + (w * w) / (i * i); S > 1 && ((r *= S = Math.sqrt(S)), (i *= S)); var O = r * r, M = i * i, k = (a === s ? -1 : 1) * Math.sqrt( Math.abs( (O * M - O * w * w - M * x * x) / (O * w * w + M * x * x), ), ); (p = (k * r * w) / i + (e + c) / 2), (g = (k * -i * x) / r + (n + u) / 2), (f = Math.asin(((n - g) / i).toFixed(9))), (d = Math.asin(((u - g) / i).toFixed(9))), (f = e < p ? Math.PI - f : f), (d = c < p ? Math.PI - d : d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), s && f > d && (f -= 2 * Math.PI), !s && d > f && (d -= 2 * Math.PI); } var C = d - f; if (Math.abs(C) > v) { var E = d, j = c, P = u; (d = f + v * (s && d > f ? 1 : -1)), (m = t( (c = p + r * Math.cos(d)), (u = g + i * Math.sin(d)), r, i, o, 0, s, j, P, [d, E, p, g], )); } C = d - f; var A = Math.cos(f), I = Math.sin(f), T = Math.cos(d), N = Math.sin(d), B = Math.tan(C / 4), L = (4 / 3) * r * B, D = (4 / 3) * i * B, _ = [e, n], R = [e + L * I, n - D * A], F = [c + L * N, u - D * T], Y = [c, u]; if (((R[0] = 2 * _[0] - R[0]), (R[1] = 2 * _[1] - R[1]), h)) return [R, F, Y].concat(m); for ( var X = [], z = 0, W = (m = [R, F, Y].concat(m).join().split(",")).length; z < W; z++ ) X[z] = z % 2 ? b(m[z - 1], m[z], y).y : b(m[z], m[z + 1], y).x; return X; }, v = function (t, e) { var n, r = f(t), i = e && f(e), o = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, a = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, s = [], c = [], u = "", h = "", l = function (t, e, n) { var r, i; if (!t) return ["C", e.x, e.y, e.x, e.y, e.x, e.y]; switch ( (!(t[0] in { T: 1, Q: 1 }) && (e.qx = e.qy = null), t[0]) ) { case "M": (e.X = t[1]), (e.Y = t[2]); break; case "A": t = ["C"].concat(g.apply(0, [e.x, e.y].concat(t.slice(1)))); break; case "S": "C" === n || "S" === n ? ((r = 2 * e.x - e.bx), (i = 2 * e.y - e.by)) : ((r = e.x), (i = e.y)), (t = ["C", r, i].concat(t.slice(1))); break; case "T": "Q" === n || "T" === n ? ((e.qx = 2 * e.x - e.qx), (e.qy = 2 * e.y - e.qy)) : ((e.qx = e.x), (e.qy = e.y)), (t = ["C"].concat(p(e.x, e.y, e.qx, e.qy, t[1], t[2]))); break; case "Q": (e.qx = t[1]), (e.qy = t[2]), (t = ["C"].concat(p(e.x, e.y, t[1], t[2], t[3], t[4]))); break; case "L": t = ["C"].concat(d(e.x, e.y, t[1], t[2])); break; case "H": t = ["C"].concat(d(e.x, e.y, t[1], e.y)); break; case "V": t = ["C"].concat(d(e.x, e.y, e.x, t[1])); break; case "Z": t = ["C"].concat(d(e.x, e.y, e.X, e.Y)); } return t; }, v = function (t, e) { if (t[e].length > 7) { t[e].shift(); for (var o = t[e]; o.length; ) (s[e] = "A"), i && (c[e] = "A"), t.splice(e++, 0, ["C"].concat(o.splice(0, 6))); t.splice(e, 1), (n = Math.max(r.length, (i && i.length) || 0)); } }, y = function (t, e, o, a, s) { t && e && "M" === t[s][0] && "M" !== e[s][0] && (e.splice(s, 0, ["M", a.x, a.y]), (o.bx = 0), (o.by = 0), (o.x = t[s][1]), (o.y = t[s][2]), (n = Math.max(r.length, (i && i.length) || 0))); }; n = Math.max(r.length, (i && i.length) || 0); for (var m = 0; m < n; m++) { r[m] && (u = r[m][0]), "C" !== u && ((s[m] = u), m && (h = s[m - 1])), (r[m] = l(r[m], o, h)), "A" !== s[m] && "C" === u && (s[m] = "C"), v(r, m), i && (i[m] && (u = i[m][0]), "C" !== u && ((c[m] = u), m && (h = c[m - 1])), (i[m] = l(i[m], a, h)), "A" !== c[m] && "C" === u && (c[m] = "C"), v(i, m)), y(r, i, o, a, m), y(i, r, a, o, m); var b = r[m], x = i && i[m], w = b.length, S = i && x.length; (o.x = b[w - 2]), (o.y = b[w - 1]), (o.bx = parseFloat(b[w - 4]) || o.x), (o.by = parseFloat(b[w - 3]) || o.y), (a.bx = i && (parseFloat(x[S - 4]) || a.x)), (a.by = i && (parseFloat(x[S - 3]) || a.y)), (a.x = i && x[S - 2]), (a.y = i && x[S - 1]); } return i ? [r, i] : r; }, y = /,?([a-z]),?/gi, m = function (t) { return t.join(",").replace(y, "$1"); }, b = function (t, e, n, r, i) { return ( t * (t * (-3 * e + 9 * n - 9 * r + 3 * i) + 6 * e - 12 * n + 6 * r) - 3 * e + 3 * n ); }, x = function (t, e, n, r, i, o, a, s, c) { null === c && (c = 1); for ( var u = (c = c > 1 ? 1 : c < 0 ? 0 : c) / 2, h = [ -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, ], l = [ 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472, ], f = 0, d = 0; d < 12; d++ ) { var p = u * h[d] + u, g = b(p, t, n, i, a), v = b(p, e, r, o, s), y = g * g + v * v; f += l[d] * Math.sqrt(y); } return u * f; }, w = function (t, e, n, r, i, o, a, s) { for (var c, u, h, l, f = [], d = [[], []], p = 0; p < 2; ++p) if ( (0 === p ? ((u = 6 * t - 12 * n + 6 * i), (c = -3 * t + 9 * n - 9 * i + 3 * a), (h = 3 * n - 3 * t)) : ((u = 6 * e - 12 * r + 6 * o), (c = -3 * e + 9 * r - 9 * o + 3 * s), (h = 3 * r - 3 * e)), Math.abs(c) < 1e-12) ) { if (Math.abs(u) < 1e-12) continue; (l = -h / u) > 0 && l < 1 && f.push(l); } else { var g = u * u - 4 * h * c, v = Math.sqrt(g); if (!(g < 0)) { var y = (-u + v) / (2 * c); y > 0 && y < 1 && f.push(y); var m = (-u - v) / (2 * c); m > 0 && m < 1 && f.push(m); } } for (var b, x = f.length, w = x; x--; ) (b = 1 - (l = f[x])), (d[0][x] = b * b * b * t + 3 * b * b * l * n + 3 * b * l * l * i + l * l * l * a), (d[1][x] = b * b * b * e + 3 * b * b * l * r + 3 * b * l * l * o + l * l * l * s); return ( (d[0][w] = t), (d[1][w] = e), (d[0][w + 1] = a), (d[1][w + 1] = s), (d[0].length = d[1].length = w + 2), { min: { x: Math.min.apply(0, d[0]), y: Math.min.apply(0, d[1]) }, max: { x: Math.max.apply(0, d[0]), y: Math.max.apply(0, d[1]) }, } ); }, S = function (t, e, n, r, i, o, a, s) { if ( !( Math.max(t, n) < Math.min(i, a) || Math.min(t, n) > Math.max(i, a) || Math.max(e, r) < Math.min(o, s) || Math.min(e, r) > Math.max(o, s) ) ) { var c = (t - n) * (o - s) - (e - r) * (i - a); if (c) { var u = ((t * r - e * n) * (i - a) - (t - n) * (i * s - o * a)) / c, h = ((t * r - e * n) * (o - s) - (e - r) * (i * s - o * a)) / c, l = +u.toFixed(2), f = +h.toFixed(2); if ( !( l < +Math.min(t, n).toFixed(2) || l > +Math.max(t, n).toFixed(2) || l < +Math.min(i, a).toFixed(2) || l > +Math.max(i, a).toFixed(2) || f < +Math.min(e, r).toFixed(2) || f > +Math.max(e, r).toFixed(2) || f < +Math.min(o, s).toFixed(2) || f > +Math.max(o, s).toFixed(2) ) ) return { x: u, y: h }; } } }, O = function (t, e, n) { return ( e >= t.x && e <= t.x + t.width && n >= t.y && n <= t.y + t.height ); }, M = function (t, e, n, r, i) { if (i) return [ ["M", +t + +i, e], ["l", n - 2 * i, 0], ["a", i, i, 0, 0, 1, i, i], ["l", 0, r - 2 * i], ["a", i, i, 0, 0, 1, -i, i], ["l", 2 * i - n, 0], ["a", i, i, 0, 0, 1, -i, -i], ["l", 0, 2 * i - r], ["a", i, i, 0, 0, 1, i, -i], ["z"], ]; var o = [["M", t, e], ["l", n, 0], ["l", 0, r], ["l", -n, 0], ["z"]]; return (o.parsePathArray = m), o; }, k = function (t, e, n, r) { return ( null === t && (t = e = n = r = 0), null === e && ((e = t.y), (n = t.width), (r = t.height), (t = t.x)), { x: t, y: e, width: n, w: n, height: r, h: r, x2: t + n, y2: e + r, cx: t + n / 2, cy: e + r / 2, r1: Math.min(n, r) / 2, r2: Math.max(n, r) / 2, r0: Math.sqrt(n * n + r * r) / 2, path: M(t, e, n, r), vb: [t, e, n, r].join(" "), } ); }, C = function (t, e, n, r, i, a, s, c) { Object(o.isArray)(t) || (t = [t, e, n, r, i, a, s, c]); var u = w.apply(null, t); return k(u.min.x, u.min.y, u.max.x - u.min.x, u.max.y - u.min.y); }, E = function (t, e, n, r, i, o, a, s, c) { var u = 1 - c, h = Math.pow(u, 3), l = Math.pow(u, 2), f = c * c, d = f * c, p = t + 2 * c * (n - t) + f * (i - 2 * n + t), g = e + 2 * c * (r - e) + f * (o - 2 * r + e), v = n + 2 * c * (i - n) + f * (a - 2 * i + n), y = r + 2 * c * (o - r) + f * (s - 2 * o + r); return { x: h * t + 3 * l * c * n + 3 * u * c * c * i + d * a, y: h * e + 3 * l * c * r + 3 * u * c * c * o + d * s, m: { x: p, y: g }, n: { x: v, y: y }, start: { x: u * t + c * n, y: u * e + c * r }, end: { x: u * i + c * a, y: u * o + c * s }, alpha: 90 - (180 * Math.atan2(p - v, g - y)) / Math.PI, }; }, j = function (t, e, n) { if ( !(function (t, e) { return ( (t = k(t)), (e = k(e)), O(e, t.x, t.y) || O(e, t.x2, t.y) || O(e, t.x, t.y2) || O(e, t.x2, t.y2) || O(t, e.x, e.y) || O(t, e.x2, e.y) || O(t, e.x, e.y2) || O(t, e.x2, e.y2) || (((t.x < e.x2 && t.x > e.x) || (e.x < t.x2 && e.x > t.x)) && ((t.y < e.y2 && t.y > e.y) || (e.y < t.y2 && e.y > t.y))) ); })(C(t), C(e)) ) return n ? 0 : []; for ( var r = ~~(x.apply(0, t) / 8), i = ~~(x.apply(0, e) / 8), o = [], a = [], s = {}, c = n ? 0 : [], u = 0; u < r + 1; u++ ) { var h = E.apply(0, t.concat(u / r)); o.push({ x: h.x, y: h.y, t: u / r }); } for (u = 0; u < i + 1; u++) { h = E.apply(0, e.concat(u / i)); a.push({ x: h.x, y: h.y, t: u / i }); } for (u = 0; u < r; u++) for (var l = 0; l < i; l++) { var f = o[u], d = o[u + 1], p = a[l], g = a[l + 1], v = Math.abs(d.x - f.x) < 0.001 ? "y" : "x", y = Math.abs(g.x - p.x) < 0.001 ? "y" : "x", m = S(f.x, f.y, d.x, d.y, p.x, p.y, g.x, g.y); if (m) { if (s[m.x.toFixed(4)] === m.y.toFixed(4)) continue; s[m.x.toFixed(4)] = m.y.toFixed(4); var b = f.t + Math.abs((m[v] - f[v]) / (d[v] - f[v])) * (d.t - f.t), w = p.t + Math.abs((m[y] - p[y]) / (g[y] - p[y])) * (g.t - p.t); b >= 0 && b <= 1 && w >= 0 && w <= 1 && (n ? (c += 1) : c.push({ x: m.x, y: m.y, t1: b, t2: w })); } } return c; }, P = function (t, e) { return (function (t, e, n) { var r, i, o, a, s, c, u, h, l, f; (t = v(t)), (e = v(e)); for (var d = n ? 0 : [], p = 0, g = t.length; p < g; p++) { var y = t[p]; if ("M" === y[0]) (r = s = y[1]), (i = c = y[2]); else { "C" === y[0] ? ((l = [r, i].concat(y.slice(1))), (r = l[6]), (i = l[7])) : ((l = [r, i, r, i, s, c, s, c]), (r = s), (i = c)); for (var m = 0, b = e.length; m < b; m++) { var x = e[m]; if ("M" === x[0]) (o = u = x[1]), (a = h = x[2]); else { "C" === x[0] ? ((f = [o, a].concat(x.slice(1))), (o = f[6]), (a = f[7])) : ((f = [o, a, o, a, u, h, u, h]), (o = u), (a = h)); var w = j(l, f, n); if (n) d += w; else { for (var S = 0, O = w.length; S < O; S++) (w[S].segment1 = p), (w[S].segment2 = m), (w[S].bez1 = l), (w[S].bez2 = f); d = d.concat(w); } } } } } return d; })(t, e); }; function A(t, e) { var n = [], r = []; return ( t.length && (function t(e, i) { if (1 === e.length) n.push(e[0]), r.push(e[0]); else { for (var o = [], a = 0; a < e.length - 1; a++) 0 === a && n.push(e[0]), a === e.length - 2 && r.push(e[a + 1]), (o[a] = [ (1 - i) * e[a][0] + i * e[a + 1][0], (1 - i) * e[a][1] + i * e[a + 1][1], ]); t(o, i); } })(t, e), { left: n, right: r.reverse() } ); } var I = function (t, e, n) { if (1 === n) return [[].concat(t)]; var r = []; if ("L" === e[0] || "C" === e[0] || "Q" === e[0]) r = r.concat( (function (t, e, n) { var r = [[t[1], t[2]]]; n = n || 2; var i = []; "A" === e[0] ? (r.push(e[6]), r.push(e[7])) : "C" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]]), r.push([e[5], e[6]])) : "S" === e[0] || "Q" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]])) : r.push([e[1], e[2]]); for (var o = r, a = 1 / n, s = 0; s < n - 1; s++) { var c = A(o, a / (1 - a * s)); i.push(c.left), (o = c.right); } return ( i.push(o), i.map(function (t) { var e = []; return ( 4 === t.length && (e.push("C"), (e = e.concat(t[2]))), t.length >= 3 && (3 === t.length && e.push("Q"), (e = e.concat(t[1]))), 2 === t.length && e.push("L"), (e = e.concat(t[t.length - 1])) ); }) ); })(t, e, n), ); else { var i = [].concat(t); "M" === i[0] && (i[0] = "L"); for (var o = 0; o <= n - 1; o++) r.push(i); } return r; }, T = function (t, e) { if (1 === t.length) return t; var n = t.length - 1, r = e.length - 1, i = n / r, o = []; if (1 === t.length && "M" === t[0][0]) { for (var a = 0; a < r - n; a++) t.push(t[0]); return t; } for (a = 0; a < r; a++) { var s = Math.floor(i * a); o[s] = (o[s] || 0) + 1; } var c = o.reduce(function (e, r, i) { return i === n ? e.concat(t[n]) : e.concat(I(t[i], t[i + 1], r)); }, []); return ( c.unshift(t[0]), ("Z" !== e[r] && "z" !== e[r]) || c.push("Z"), c ); }, N = function (t, e) { if (t.length !== e.length) return !1; var n = !0; return ( Object(o.each)(t, function (t, r) { if (t !== e[r]) return (n = !1), !1; }), n ); }; function B(t, e, n) { var r = null, i = n; return ( e < i && ((i = e), (r = "add")), t < i && ((i = t), (r = "del")), { type: r, min: i } ); } var L = function (t, e) { var n = (function (t, e) { var n, r, i = t.length, o = e.length, a = 0; if (0 === i || 0 === o) return null; for (var s = [], c = 0; c <= i; c++) (s[c] = []), (s[c][0] = { min: c }); for (var u = 0; u <= o; u++) s[0][u] = { min: u }; for (c = 1; c <= i; c++) { n = t[c - 1]; for (u = 1; u <= o; u++) { (r = e[u - 1]), (a = N(n, r) ? 0 : 1); var h = s[c - 1][u].min + 1, l = s[c][u - 1].min + 1, f = s[c - 1][u - 1].min + a; s[c][u] = B(h, l, f); } } return s; })(t, e), r = t.length, i = e.length, o = [], a = 1, s = 1; if (n[r][i].min !== r) { for (var c = 1; c <= r; c++) { var u = n[c][c].min; s = c; for (var h = a; h <= i; h++) n[c][h].min < u && ((u = n[c][h].min), (s = h)); (a = s), n[c][a].type && o.push({ index: c - 1, type: n[c][a].type }); } for (c = o.length - 1; c >= 0; c--) (a = o[c].index), "add" === o[c].type ? t.splice(a, 0, [].concat(t[a])) : t.splice(a, 1); } var l = i - (r = t.length); if (r < i) for (c = 0; c < l; c++) "z" === t[r - 1][0] || "Z" === t[r - 1][0] ? t.splice(r - 2, 0, t[r - 2]) : t.push(t[r - 1]), (r += 1); return t; }; function D(t, e, n) { for ( var r, i = [].concat(t), o = 1 / (n + 1), a = _(e)[0], s = 1; s <= n; s++ ) (o *= s), 0 === (r = Math.floor(t.length * o)) ? i.unshift([ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]) : i.splice(r, 0, [ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]); return i; } function _(t) { var e = []; switch (t[0]) { case "M": case "L": e.push([t[1], t[2]]); break; case "A": e.push([t[6], t[7]]); break; case "Q": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "T": e.push([t[1], t[2]]); break; case "C": e.push([t[5], t[6]]), e.push([t[1], t[2]]), e.push([t[3], t[4]]); break; case "S": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "H": case "V": e.push([t[1], t[1]]); } return e; } var R = function (t, e) { if (t.length <= 1) return t; for (var n, r = 0; r < e.length; r++) if (t[r][0] !== e[r][0]) switch (((n = _(t[r])), e[r][0])) { case "M": t[r] = ["M"].concat(n[0]); break; case "L": t[r] = ["L"].concat(n[0]); break; case "A": (t[r] = [].concat(e[r])), (t[r][6] = n[0][0]), (t[r][7] = n[0][1]); break; case "Q": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = D(n, t[r - 1], 1); } t[r] = ["Q"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "T": t[r] = ["T"].concat(n[0]); break; case "C": if (n.length < 3) { if (!(r > 0)) { t[r] = e[r]; break; } n = D(n, t[r - 1], 2); } t[r] = ["C"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "S": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = D(n, t[r - 1], 1); } t[r] = ["S"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; default: t[r] = e[r]; } return t; }, F = (function () { function t(t, e) { (this.bubbles = !0), (this.target = null), (this.currentTarget = null), (this.delegateTarget = null), (this.delegateObject = null), (this.defaultPrevented = !1), (this.propagationStopped = !1), (this.shape = null), (this.fromShape = null), (this.toShape = null), (this.propagationPath = []), (this.type = t), (this.name = t), (this.originalEvent = e), (this.timeStamp = e.timeStamp); } return ( (t.prototype.preventDefault = function () { (this.defaultPrevented = !0), this.originalEvent.preventDefault && this.originalEvent.preventDefault(); }), (t.prototype.stopPropagation = function () { this.propagationStopped = !0; }), (t.prototype.toString = function () { return "[Event (type=" + this.type + ")]"; }), (t.prototype.save = function () {}), (t.prototype.restore = function () {}), t ); })(), Y = n(1), X = n(73); function z(t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); } var W = "undefined" != typeof window && void 0 !== window.document; function q(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } function V(t) { return t.cfg.visible && t.cfg.capture; } var G = (function (t) { function e(e) { var n = t.call(this) || this; n.destroyed = !1; var r = n.getDefaultCfg(); return (n.cfg = Object(o.mix)(r, e)), n; } return ( Object(Y.c)(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.set = function (t, e) { this.cfg[t] = e; }), (e.prototype.destroy = function () { (this.cfg = { destroyed: !0 }), this.off(), (this.destroyed = !0); }), e ); })(X.a), H = n(157); function U(t, e) { var n = [], r = t[0], i = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( (n[0] = f * r + d * a + p * u), (n[1] = f * i + d * s + p * h), (n[2] = f * o + d * c + p * l), (n[3] = g * r + v * a + y * u), (n[4] = g * i + v * s + y * h), (n[5] = g * o + v * c + y * l), (n[6] = m * r + b * a + x * u), (n[7] = m * i + b * s + x * h), (n[8] = m * o + b * c + x * l), n ); } function Z(t, e) { var n = [], r = e[0], i = e[1]; return ( (n[0] = t[0] * r + t[3] * i + t[6]), (n[1] = t[1] * r + t[4] * i + t[7]), n ); } function K(t) { var e = [], n = t[0], r = t[1], i = t[2], o = t[3], a = t[4], s = t[5], c = t[6], u = t[7], h = t[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (e[0] = l * p), (e[1] = (-h * r + i * u) * p), (e[2] = (s * r - i * a) * p), (e[3] = f * p), (e[4] = (h * n - i * c) * p), (e[5] = (-s * n + i * o) * p), (e[6] = d * p), (e[7] = (-u * n + r * c) * p), (e[8] = (a * n - r * o) * p), e) : null; } var $ = n(3).a.transform, Q = ["zIndex", "capture", "visible", "type"], J = ["repeat"]; function tt(t, e) { var n = {}, r = e.attrs; for (var i in t) n[i] = r[i]; return n; } function et(t, e) { var n = {}, r = e.attr(); return ( Object(o.each)(t, function (t, e) { -1 !== J.indexOf(e) || Object(o.isEqual)(r[e], t) || (n[e] = t); }), n ); } function nt(t, e) { if (e.onFrame) return t; var n = e.startTime, r = e.delay, i = e.duration, a = Object.prototype.hasOwnProperty; return ( Object(o.each)(t, function (t) { n + r < t.startTime + t.delay + t.duration && i > t.delay && Object(o.each)(e.toAttrs, function (e, n) { a.call(t.toAttrs, n) && (delete t.toAttrs[n], delete t.fromAttrs[n]); }); }), t ); } var rt = (function (t) { function e(e) { var n = t.call(this, e) || this; n.attrs = {}; var r = n.getDefaultAttrs(); return ( Object(o.mix)(r, e.attrs), (n.attrs = r), n.initAttrs(r), n.initAnimate(), n ); } return ( Object(Y.c)(e, t), (e.prototype.getDefaultCfg = function () { return { visible: !0, capture: !0, zIndex: 0 }; }), (e.prototype.getDefaultAttrs = function () { return { matrix: this.getDefaultMatrix(), opacity: 1 }; }), (e.prototype.onCanvasChange = function (t) {}), (e.prototype.initAttrs = function (t) {}), (e.prototype.initAnimate = function () { this.set("animable", !0), this.set("animating", !1); }), (e.prototype.isGroup = function () { return !1; }), (e.prototype.getParent = function () { return this.get("parent"); }), (e.prototype.getCanvas = function () { return this.get("canvas"); }), (e.prototype.attr = function () { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; var r = e[0], i = e[1]; if (!r) return this.attrs; if (Object(o.isObject)(r)) { for (var a in r) this.setAttr(a, r[a]); return this.afterAttrsChange(r), this; } return 2 === e.length ? (this.setAttr(r, i), this.afterAttrsChange((((t = {})[r] = i), t)), this) : this.attrs[r]; }), (e.prototype.isClipped = function (t, e) { var n = this.getClip(); return n && !n.isHit(t, e); }), (e.prototype.setAttr = function (t, e) { var n = this.attrs[t]; n !== e && ((this.attrs[t] = e), this.onAttrChange(t, e, n)); }), (e.prototype.onAttrChange = function (t, e, n) { "matrix" === t && this.set("totalMatrix", null); }), (e.prototype.afterAttrsChange = function (t) { if (this.cfg.isClipShape) { var e = this.cfg.applyTo; e && e.onCanvasChange("clip"); } else this.onCanvasChange("attr"); }), (e.prototype.show = function () { return this.set("visible", !0), this.onCanvasChange("show"), this; }), (e.prototype.hide = function () { return this.set("visible", !1), this.onCanvasChange("hide"), this; }), (e.prototype.setZIndex = function (t) { this.set("zIndex", t); var e = this.getParent(); return e && e.sort(), this; }), (e.prototype.toFront = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.push(this), this.onCanvasChange("zIndex"); } }), (e.prototype.toBack = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.unshift(this), this.onCanvasChange("zIndex"); } }), (e.prototype.remove = function (t) { void 0 === t && (t = !0); var e = this.getParent(); e ? (z(e.getChildren(), this), e.get("clearing") || this.onCanvasChange("remove")) : this.onCanvasChange("remove"), t && this.destroy(); }), (e.prototype.resetMatrix = function () { this.attr("matrix", this.getDefaultMatrix()), this.onCanvasChange("matrix"); }), (e.prototype.getMatrix = function () { return this.attr("matrix"); }), (e.prototype.setMatrix = function (t) { this.attr("matrix", t), this.onCanvasChange("matrix"); }), (e.prototype.getTotalMatrix = function () { var t = this.cfg.totalMatrix; if (!t) { var e = this.attr("matrix"), n = this.cfg.parentMatrix; (t = n && e ? U(n, e) : e || n), this.set("totalMatrix", t); } return t; }), (e.prototype.applyMatrix = function (t) { var e = this.attr("matrix"), n = null; (n = t && e ? U(t, e) : e || t), this.set("totalMatrix", n), this.set("parentMatrix", t); }), (e.prototype.getDefaultMatrix = function () { return null; }), (e.prototype.applyToMatrix = function (t) { var e = this.attr("matrix"); return e ? Z(e, t) : t; }), (e.prototype.invertFromMatrix = function (t) { var e = this.attr("matrix"); if (e) { var n = K(e); if (n) return Z(n, t); } return t; }), (e.prototype.setClip = function (t) { var e = this.getCanvas(), n = null; if (t) { var r = this.getShapeBase()[Object(o.upperFirst)(t.type)]; r && (n = new r({ type: t.type, isClipShape: !0, applyTo: this, attrs: t.attrs, canvas: e, })); } return this.set("clipShape", n), this.onCanvasChange("clip"), n; }), (e.prototype.getClip = function () { var t = this.cfg.clipShape; return t || null; }), (e.prototype.clone = function () { var t = this, e = this.attrs, n = {}; Object(o.each)(e, function (t, r) { Object(o.isArray)(e[r]) ? (n[r] = (function (t) { for (var e = [], n = 0; n < t.length; n++) Object(o.isArray)(t[n]) ? e.push([].concat(t[n])) : e.push(t[n]); return e; })(e[r])) : (n[r] = e[r]); }); var r = new (0, this.constructor)({ attrs: n }); return ( Object(o.each)(Q, function (e) { r.set(e, t.get(e)); }), r ); }), (e.prototype.destroy = function () { this.destroyed || ((this.attrs = {}), t.prototype.destroy.call(this)); }), (e.prototype.isAnimatePaused = function () { return this.get("_pause").isPaused; }), (e.prototype.animate = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this.get("timeline") || this.get("canvas")) { this.set("animating", !0); var n = this.get("timeline"); n || ((n = this.get("canvas").get("timeline")), this.set("timeline", n)); var r = this.get("animations") || []; n.timer || n.initTimer(); var i, a, s, c, u, h = t[0], l = t[1], f = t[2], d = void 0 === f ? "easeLinear" : f, p = t[3], g = void 0 === p ? o.noop : p, v = t[4], y = void 0 === v ? 0 : v; Object(o.isFunction)(h) ? ((i = h), (h = {})) : Object(o.isObject)(h) && h.onFrame && ((i = h.onFrame), (a = h.repeat)), Object(o.isObject)(l) ? ((l = (u = l).duration), (d = u.easing || "easeLinear"), (y = u.delay || 0), (a = u.repeat || a || !1), (g = u.callback || o.noop), (s = u.pauseCallback || o.noop), (c = u.resumeCallback || o.noop)) : (Object(o.isNumber)(g) && ((y = g), (g = null)), Object(o.isFunction)(d) ? ((g = d), (d = "easeLinear")) : (d = d || "easeLinear")); var m = et(h, this), b = { fromAttrs: tt(m, this), toAttrs: m, duration: l, easing: d, repeat: a, callback: g, pauseCallback: s, resumeCallback: c, delay: y, startTime: n.getTime(), id: Object(o.uniqueId)(), onFrame: i, pathFormatted: !1, }; r.length > 0 ? (r = nt(r, b)) : n.addAnimator(this), r.push(b), this.set("animations", r), this.set("_pause", { isPaused: !1 }); } }), (e.prototype.stopAnimate = function (t) { var e = this; void 0 === t && (t = !0); var n = this.get("animations"); Object(o.each)(n, function (n) { t && (n.onFrame ? e.attr(n.onFrame(1)) : e.attr(n.toAttrs)), n.callback && n.callback(); }), this.set("animating", !1), this.set("animations", []); }), (e.prototype.pauseAnimate = function () { var t = this.get("timeline"), e = this.get("animations"), n = t.getTime(); return ( Object(o.each)(e, function (t) { (t._paused = !0), (t._pauseTime = n), t.pauseCallback && t.pauseCallback(); }), this.set("_pause", { isPaused: !0, pauseTime: n }), this ); }), (e.prototype.resumeAnimate = function () { var t = this.get("timeline").getTime(), e = this.get("animations"), n = this.get("_pause").pauseTime; return ( Object(o.each)(e, function (e) { (e.startTime = e.startTime + (t - n)), (e._paused = !1), (e._pauseTime = null), e.resumeCallback && e.resumeCallback(); }), this.set("_pause", { isPaused: !1 }), this.set("animations", e), this ); }), (e.prototype.emitDelegation = function (t, e) { var n, r = this, i = e.propagationPath; this.getEvents(); "mouseenter" === t ? (n = e.fromShape) : "mouseleave" === t && (n = e.toShape); for ( var a = function (t) { var a = i[t], c = a.get("name"); if (c) { if ( (a.isGroup() || (a.isCanvas && a.isCanvas())) && n && q(a, n) ) return "break"; Object(o.isArray)(c) ? Object(o.each)(c, function (t) { r.emitDelegateEvent(a, t, e); }) : s.emitDelegateEvent(a, c, e); } }, s = this, c = 0; c < i.length; c++ ) { if ("break" === a(c)) break; } }), (e.prototype.emitDelegateEvent = function (t, e, n) { var r = this.getEvents(), i = e + ":" + n.type; (r[i] || r["*"]) && ((n.name = i), (n.currentTarget = t), (n.delegateTarget = this), (n.delegateObject = t.get("delegateObject")), this.emit(i, n)); }), (e.prototype.translate = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0); var n = this.getMatrix(), r = $(n, [["t", t, e]]); return this.setMatrix(r), this; }), (e.prototype.move = function (t, e) { var n = this.attr("x") || 0, r = this.attr("y") || 0; return this.translate(t - n, e - r), this; }), (e.prototype.moveTo = function (t, e) { return this.move(t, e); }), (e.prototype.scale = function (t, e) { var n = this.getMatrix(), r = $(n, [["s", t, e || t]]); return this.setMatrix(r), this; }), (e.prototype.rotate = function (t) { var e = this.getMatrix(), n = $(e, [["r", t]]); return this.setMatrix(n), this; }), (e.prototype.rotateAtStart = function (t) { var e = this.attr(), n = e.x, r = e.y, i = this.getMatrix(), o = $(i, [ ["t", -n, -r], ["r", t], ["t", n, r], ]); return this.setMatrix(o), this; }), (e.prototype.rotateAtPoint = function (t, e, n) { var r = this.getMatrix(), i = $(r, [ ["t", -t, -e], ["r", n], ["t", t, e], ]); return this.setMatrix(i), this; }), e ); })(G), it = {}; var ot = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(Y.c)(e, t), (e.prototype.isCanvas = function () { return !1; }), (e.prototype.getBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, i = [], a = [], s = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( s.length > 0 ? (Object(o.each)(s, function (t) { var e = t.getBBox(); i.push(e.minX, e.maxX), a.push(e.minY, e.maxY); }), (t = Object(o.min)(i)), (e = Object(o.max)(i)), (n = Object(o.min)(a)), (r = Object(o.max)(a))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getCanvasBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, i = [], a = [], s = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( s.length > 0 ? (Object(o.each)(s, function (t) { var e = t.getCanvasBBox(); i.push(e.minX, e.maxX), a.push(e.minY, e.maxY); }), (t = Object(o.min)(i)), (e = Object(o.max)(i)), (n = Object(o.min)(a)), (r = Object(o.max)(a))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.children = []), e; }), (e.prototype.onAttrChange = function (e, n, r) { if ( (t.prototype.onAttrChange.call(this, e, n, r), "matrix" === e) ) { var i = this.getTotalMatrix(); this._applyChildrenMarix(i); } }), (e.prototype.applyMatrix = function (e) { var n = this.getTotalMatrix(); t.prototype.applyMatrix.call(this, e); var r = this.getTotalMatrix(); r !== n && this._applyChildrenMarix(r); }), (e.prototype._applyChildrenMarix = function (t) { var e = this.getChildren(); Object(o.each)(e, function (e) { e.applyMatrix(t); }); }), (e.prototype.addShape = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = t[0], r = t[1]; Object(o.isObject)(n) ? (r = n) : (r.type = n); var i = it[r.type]; i || ((i = Object(o.upperFirst)(r.type)), (it[r.type] = i)); var a = this.getShapeBase(), s = new a[i](r); return this.add(s), s; }), (e.prototype.addGroup = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n, r = t[0], i = t[1]; if (Object(o.isFunction)(r)) n = new r(i || { parent: this }); else { var a = r || {}, s = this.getGroupBase(); n = new s(a); } return this.add(n), n; }), (e.prototype.getCanvas = function () { return this.isCanvas() ? this : this.get("canvas"); }), (e.prototype.getShape = function (t, e, n) { if (!V(this)) return null; var r, i = this.getChildren(); if (this.isCanvas()) r = this._findShape(i, t, e, n); else { var o = [t, e, 1]; (o = this.invertFromMatrix(o)), this.isClipped(o[0], o[1]) || (r = this._findShape(i, o[0], o[1], n)); } return r; }), (e.prototype._findShape = function (t, e, n, r) { for (var i = null, o = t.length - 1; o >= 0; o--) { var a = t[o]; if ( (V(a) && (a.isGroup() ? (i = a.getShape(e, n, r)) : a.isHit(e, n) && (i = a)), i) ) break; } return i; }), (e.prototype.add = function (t) { var e = this.getCanvas(), n = this.getChildren(), r = this.get("timeline"), i = t.getParent(); i && (function (t, e, n) { void 0 === n && (n = !0), n ? e.destroy() : (e.set("parent", null), e.set("canvas", null)), z(t.getChildren(), e); })(i, t, !1), t.set("parent", this), e && (function t(e, n) { if ((e.set("canvas", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, e), r && (function t(e, n) { if ((e.set("timeline", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, r), n.push(t), t.onCanvasChange("add"), this._applyElementMatrix(t); }), (e.prototype._applyElementMatrix = function (t) { var e = this.getTotalMatrix(); e && t.applyMatrix(e); }), (e.prototype.getChildren = function () { return this.get("children"); }), (e.prototype.sort = function () { var t, e = this.getChildren(); Object(o.each)(e, function (t, e) { return (t._INDEX = e), t; }), e.sort( ((t = function (t, e) { return t.get("zIndex") - e.get("zIndex"); }), function (e, n) { var r = t(e, n); return 0 === r ? e._INDEX - n._INDEX : r; }), ), this.onCanvasChange("sort"); }), (e.prototype.clear = function () { if ((this.set("clearing", !0), !this.destroyed)) { for (var t = this.getChildren(), e = t.length - 1; e >= 0; e--) t[e].destroy(); this.set("children", []), this.onCanvasChange("clear"), this.set("clearing", !1); } }), (e.prototype.destroy = function () { this.get("destroyed") || (this.clear(), t.prototype.destroy.call(this)); }), (e.prototype.getFirst = function () { return this.getChildByIndex(0); }), (e.prototype.getLast = function () { var t = this.getChildren(); return this.getChildByIndex(t.length - 1); }), (e.prototype.getChildByIndex = function (t) { return this.getChildren()[t]; }), (e.prototype.getCount = function () { return this.getChildren().length; }), (e.prototype.contain = function (t) { return this.getChildren().indexOf(t) > -1; }), (e.prototype.removeChild = function (t, e) { void 0 === e && (e = !0), this.contain(t) && t.remove(e); }), (e.prototype.findAll = function (t) { var e = [], n = this.getChildren(); return ( Object(o.each)(n, function (n) { t(n) && e.push(n), n.isGroup() && (e = e.concat(n.findAll(t))); }), e ); }), (e.prototype.find = function (t) { var e = null, n = this.getChildren(); return ( Object(o.each)(n, function (n) { if ((t(n) ? (e = n) : n.isGroup() && (e = n.find(t)), e)) return !1; }), e ); }), (e.prototype.findById = function (t) { return this.find(function (e) { return e.get("id") === t; }); }), (e.prototype.findByClassName = function (t) { return this.find(function (e) { return e.get("className") === t; }); }), (e.prototype.findAllByName = function (t) { return this.findAll(function (e) { return e.get("name") === t; }); }), e ); })(rt); function at(t) { return (at = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var st, ct, ut = 0, ht = 0, lt = 0, ft = 0, dt = 0, pt = 0, gt = "object" === ("undefined" == typeof performance ? "undefined" : at(performance)) && performance.now ? performance : Date, vt = "object" === ("undefined" == typeof window ? "undefined" : at(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function yt() { return dt || (vt(mt), (dt = gt.now() + pt)); } function mt() { dt = 0; } function bt() { this._call = this._time = this._next = null; } function xt(t, e, n) { var r = new bt(); return r.restart(t, e, n), r; } function wt() { (dt = (ft = gt.now()) + pt), (ut = ht = 0); try { !(function () { yt(), ++ut; for (var t, e = st; e; ) (t = dt - e._time) >= 0 && e._call.call(null, t), (e = e._next); --ut; })(); } finally { (ut = 0), (function () { var t, e, n = st, r = 1 / 0; for (; n; ) n._call ? (r > n._time && (r = n._time), (t = n), (n = n._next)) : ((e = n._next), (n._next = null), (n = t ? (t._next = e) : (st = e))); (ct = t), Ot(r); })(), (dt = 0); } } function St() { var t = gt.now(), e = t - ft; e > 1e3 && ((pt -= e), (ft = t)); } function Ot(t) { ut || (ht && (ht = clearTimeout(ht)), t - dt > 24 ? (t < 1 / 0 && (ht = setTimeout(wt, t - gt.now() - pt)), lt && (lt = clearInterval(lt))) : (lt || ((ft = gt.now()), (lt = setInterval(St, 1e3))), (ut = 1), vt(wt))); } bt.prototype = xt.prototype = { constructor: bt, restart: function (t, e, n) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (n = (null == n ? yt() : +n) + (null == e ? 0 : +e)), this._next || ct === this || (ct ? (ct._next = this) : (st = this), (ct = this)), (this._call = t), (this._time = n), Ot(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), Ot()); }, }; var Mt = function (t, e, n) { (t.prototype = e.prototype = n), (n.constructor = t); }; function kt(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function Ct() {} var Et = "\\s*([+-]?\\d+)\\s*", jt = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", Pt = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", At = /^#([0-9a-f]{3,8})$/, It = new RegExp("^rgb\\(" + [Et, Et, Et] + "\\)$"), Tt = new RegExp("^rgb\\(" + [Pt, Pt, Pt] + "\\)$"), Nt = new RegExp("^rgba\\(" + [Et, Et, Et, jt] + "\\)$"), Bt = new RegExp("^rgba\\(" + [Pt, Pt, Pt, jt] + "\\)$"), Lt = new RegExp("^hsl\\(" + [jt, Pt, Pt] + "\\)$"), Dt = new RegExp("^hsla\\(" + [jt, Pt, Pt, jt] + "\\)$"), _t = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074, }; function Rt() { return this.rgb().formatHex(); } function Ft() { return this.rgb().formatRgb(); } function Yt(t) { var e, n; return ( (t = (t + "").trim().toLowerCase()), (e = At.exec(t)) ? ((n = e[1].length), (e = parseInt(e[1], 16)), 6 === n ? Xt(e) : 3 === n ? new Vt( ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), ((15 & e) << 4) | (15 & e), 1, ) : 8 === n ? zt( (e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, (255 & e) / 255, ) : 4 === n ? zt( ((e >> 12) & 15) | ((e >> 8) & 240), ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), (((15 & e) << 4) | (15 & e)) / 255, ) : null) : (e = It.exec(t)) ? new Vt(e[1], e[2], e[3], 1) : (e = Tt.exec(t)) ? new Vt( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, 1, ) : (e = Nt.exec(t)) ? zt(e[1], e[2], e[3], e[4]) : (e = Bt.exec(t)) ? zt( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, e[4], ) : (e = Lt.exec(t)) ? Zt(e[1], e[2] / 100, e[3] / 100, 1) : (e = Dt.exec(t)) ? Zt(e[1], e[2] / 100, e[3] / 100, e[4]) : _t.hasOwnProperty(t) ? Xt(_t[t]) : "transparent" === t ? new Vt(NaN, NaN, NaN, 0) : null ); } function Xt(t) { return new Vt((t >> 16) & 255, (t >> 8) & 255, 255 & t, 1); } function zt(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new Vt(t, e, n, r); } function Wt(t) { return ( t instanceof Ct || (t = Yt(t)), t ? new Vt((t = t.rgb()).r, t.g, t.b, t.opacity) : new Vt() ); } function qt(t, e, n, r) { return 1 === arguments.length ? Wt(t) : new Vt(t, e, n, null == r ? 1 : r); } function Vt(t, e, n, r) { (this.r = +t), (this.g = +e), (this.b = +n), (this.opacity = +r); } function Gt() { return "#" + Ut(this.r) + Ut(this.g) + Ut(this.b); } function Ht() { var t = this.opacity; return ( (1 === (t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (1 === t ? ")" : ", " + t + ")") ); } function Ut(t) { return ( ((t = Math.max(0, Math.min(255, Math.round(t) || 0))) < 16 ? "0" : "") + t.toString(16) ); } function Zt(t, e, n, r) { return ( r <= 0 ? (t = e = n = NaN) : n <= 0 || n >= 1 ? (t = e = NaN) : e <= 0 && (t = NaN), new $t(t, e, n, r) ); } function Kt(t) { if (t instanceof $t) return new $t(t.h, t.s, t.l, t.opacity); if ((t instanceof Ct || (t = Yt(t)), !t)) return new $t(); if (t instanceof $t) return t; var e = (t = t.rgb()).r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, s = o - i, c = (o + i) / 2; return ( s ? ((a = e === o ? (n - r) / s + 6 * (n < r) : n === o ? (r - e) / s + 2 : (e - n) / s + 4), (s /= c < 0.5 ? o + i : 2 - o - i), (a *= 60)) : (s = c > 0 && c < 1 ? 0 : a), new $t(a, s, c, t.opacity) ); } function $t(t, e, n, r) { (this.h = +t), (this.s = +e), (this.l = +n), (this.opacity = +r); } function Qt(t, e, n) { return ( 255 * (t < 60 ? e + ((n - e) * t) / 60 : t < 180 ? n : t < 240 ? e + ((n - e) * (240 - t)) / 60 : e) ); } function Jt(t, e, n, r, i) { var o = t * t, a = o * t; return ( ((1 - 3 * t + 3 * o - a) * e + (4 - 6 * o + 3 * a) * n + (1 + 3 * t + 3 * o - 3 * a) * r + a * i) / 6 ); } Mt(Ct, Yt, { copy: function (t) { return Object.assign(new this.constructor(), this, t); }, displayable: function () { return this.rgb().displayable(); }, hex: Rt, formatHex: Rt, formatHsl: function () { return Kt(this).formatHsl(); }, formatRgb: Ft, toString: Ft, }), Mt( Vt, qt, kt(Ct, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new Vt(this.r * t, this.g * t, this.b * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new Vt(this.r * t, this.g * t, this.b * t, this.opacity) ); }, rgb: function () { return this; }, displayable: function () { return ( -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1 ); }, hex: Gt, formatHex: Gt, formatRgb: Ht, toString: Ht, }), ), Mt( $t, function (t, e, n, r) { return 1 === arguments.length ? Kt(t) : new $t(t, e, n, null == r ? 1 : r); }, kt(Ct, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new $t(this.h, this.s, this.l * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new $t(this.h, this.s, this.l * t, this.opacity) ); }, rgb: function () { var t = (this.h % 360) + 360 * (this.h < 0), e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new Vt( Qt(t >= 240 ? t - 240 : t + 120, i, r), Qt(t, i, r), Qt(t < 120 ? t + 240 : t - 120, i, r), this.opacity, ); }, displayable: function () { return ( ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1 ); }, formatHsl: function () { var t = this.opacity; return ( (1 === (t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) ? "hsl(" : "hsla(") + (this.h || 0) + ", " + 100 * (this.s || 0) + "%, " + 100 * (this.l || 0) + "%" + (1 === t ? ")" : ", " + t + ")") ); }, }), ); var te = function (t) { return function () { return t; }; }; function ee(t, e) { return function (n) { return t + n * e; }; } function ne(t) { return 1 == (t = +t) ? re : function (e, n) { return n - e ? (function (t, e, n) { return ( (t = Math.pow(t, n)), (e = Math.pow(e, n) - t), (n = 1 / n), function (r) { return Math.pow(t + r * e, n); } ); })(e, n, t) : te(isNaN(e) ? n : e); }; } function re(t, e) { var n = e - t; return n ? ee(t, n) : te(isNaN(t) ? e : t); } var ie = (function t(e) { var n = ne(e); function r(t, e) { var r = n((t = qt(t)).r, (e = qt(e)).r), i = n(t.g, e.g), o = n(t.b, e.b), a = re(t.opacity, e.opacity); return function (e) { return ( (t.r = r(e)), (t.g = i(e)), (t.b = o(e)), (t.opacity = a(e)), t + "" ); }; } return (r.gamma = t), r; })(1); function oe(t) { return function (e) { var n, r, i = e.length, o = new Array(i), a = new Array(i), s = new Array(i); for (n = 0; n < i; ++n) (r = qt(e[n])), (o[n] = r.r || 0), (a[n] = r.g || 0), (s[n] = r.b || 0); return ( (o = t(o)), (a = t(a)), (s = t(s)), (r.opacity = 1), function (t) { return (r.r = o(t)), (r.g = a(t)), (r.b = s(t)), r + ""; } ); }; } oe(function (t) { var e = t.length - 1; return function (n) { var r = n <= 0 ? (n = 0) : n >= 1 ? ((n = 1), e - 1) : Math.floor(n * e), i = t[r], o = t[r + 1], a = r > 0 ? t[r - 1] : 2 * i - o, s = r < e - 1 ? t[r + 2] : 2 * o - i; return Jt((n - r / e) * e, a, i, o, s); }; }), oe(function (t) { var e = t.length; return function (n) { var r = Math.floor(((n %= 1) < 0 ? ++n : n) * e), i = t[(r + e - 1) % e], o = t[r % e], a = t[(r + 1) % e], s = t[(r + 2) % e]; return Jt((n - r / e) * e, i, o, a, s); }; }); var ae = function (t, e) { e || (e = []); var n, r = t ? Math.min(e.length, t.length) : 0, i = e.slice(); return function (o) { for (n = 0; n < r; ++n) i[n] = t[n] * (1 - o) + e[n] * o; return i; }; }; function se(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function ce(t, e) { var n, r = e ? e.length : 0, i = t ? Math.min(r, t.length) : 0, o = new Array(i), a = new Array(r); for (n = 0; n < i; ++n) o[n] = ye(t[n], e[n]); for (; n < r; ++n) a[n] = e[n]; return function (t) { for (n = 0; n < i; ++n) a[n] = o[n](t); return a; }; } var ue = function (t, e) { var n = new Date(); return ( (t = +t), (e = +e), function (r) { return n.setTime(t * (1 - r) + e * r), n; } ); }, he = function (t, e) { return ( (t = +t), (e = +e), function (n) { return t * (1 - n) + e * n; } ); }; function le(t) { return (le = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var fe = function (t, e) { var n, r = {}, i = {}; for (n in ((null !== t && "object" === le(t)) || (t = {}), (null !== e && "object" === le(e)) || (e = {}), e)) n in t ? (r[n] = ye(t[n], e[n])) : (i[n] = e[n]); return function (t) { for (n in r) i[n] = r[n](t); return i; }; }, de = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, pe = new RegExp(de.source, "g"); var ge = function (t, e) { var n, r, i, o = (de.lastIndex = pe.lastIndex = 0), a = -1, s = [], c = []; for (t += "", e += ""; (n = de.exec(t)) && (r = pe.exec(e)); ) (i = r.index) > o && ((i = e.slice(o, i)), s[a] ? (s[a] += i) : (s[++a] = i)), (n = n[0]) === (r = r[0]) ? s[a] ? (s[a] += r) : (s[++a] = r) : ((s[++a] = null), c.push({ i: a, x: he(n, r) })), (o = pe.lastIndex); return ( o < e.length && ((i = e.slice(o)), s[a] ? (s[a] += i) : (s[++a] = i)), s.length < 2 ? c[0] ? (function (t) { return function (e) { return t(e) + ""; }; })(c[0].x) : (function (t) { return function () { return t; }; })(e) : ((e = c.length), function (t) { for (var n, r = 0; r < e; ++r) s[(n = c[r]).i] = n.x(t); return s.join(""); }) ); }; function ve(t) { return (ve = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var ye = function (t, e) { var n, r = ve(e); return null == e || "boolean" === r ? te(e) : ("number" === r ? he : "string" === r ? (n = Yt(e)) ? ((e = n), ie) : ge : e instanceof Yt ? ie : e instanceof Date ? ue : se(e) ? ae : Array.isArray(e) ? ce : ("function" != typeof e.valueOf && "function" != typeof e.toString) || isNaN(e) ? fe : he)(t, e); }; function me(t) { return +t; } function be(t) { return t * t; } function xe(t) { return t * (2 - t); } function we(t) { return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; } function Se(t) { return t * t * t; } function Oe(t) { return --t * t * t + 1; } function Me(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } var ke = (function t(e) { function n(t) { return Math.pow(t, e); } return (e = +e), (n.exponent = t), n; })(3), Ce = (function t(e) { function n(t) { return 1 - Math.pow(1 - t, e); } return (e = +e), (n.exponent = t), n; })(3), Ee = (function t(e) { function n(t) { return ( ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2 ); } return (e = +e), (n.exponent = t), n; })(3), je = Math.PI, Pe = je / 2; function Ae(t) { return 1 == +t ? 1 : 1 - Math.cos(t * Pe); } function Ie(t) { return Math.sin(t * Pe); } function Te(t) { return (1 - Math.cos(je * t)) / 2; } function Ne(t) { return 1.0009775171065494 * (Math.pow(2, -10 * t) - 0.0009765625); } function Be(t) { return Ne(1 - +t); } function Le(t) { return 1 - Ne(t); } function De(t) { return ((t *= 2) <= 1 ? Ne(1 - t) : 2 - Ne(t - 1)) / 2; } function _e(t) { return 1 - Math.sqrt(1 - t * t); } function Re(t) { return Math.sqrt(1 - --t * t); } function Fe(t) { return ( ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2 ); } var Ye = 7.5625; function Xe(t) { return 1 - ze(1 - t); } function ze(t) { return (t = +t) < 4 / 11 ? Ye * t * t : t < 8 / 11 ? Ye * (t -= 6 / 11) * t + 3 / 4 : t < 10 / 11 ? Ye * (t -= 9 / 11) * t + 15 / 16 : Ye * (t -= 21 / 22) * t + 63 / 64; } function We(t) { return ((t *= 2) <= 1 ? 1 - ze(1 - t) : ze(t - 1) + 1) / 2; } var qe = (function t(e) { function n(t) { return (t = +t) * t * (e * (t - 1) + t); } return (e = +e), (n.overshoot = t), n; })(1.70158), Ve = (function t(e) { function n(t) { return --t * t * ((t + 1) * e + t) + 1; } return (e = +e), (n.overshoot = t), n; })(1.70158), Ge = (function t(e) { function n(t) { return ( ((t *= 2) < 1 ? t * t * ((e + 1) * t - e) : (t -= 2) * t * ((e + 1) * t + e) + 2) / 2 ); } return (e = +e), (n.overshoot = t), n; })(1.70158), He = 2 * Math.PI, Ue = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= He); function i(t) { return e * Ne(-(--t)) * Math.sin((r - t) / n); } return ( (i.amplitude = function (e) { return t(e, n * He); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), Ze = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= He); function i(t) { return 1 - e * Ne((t = +t)) * Math.sin((t + r) / n); } return ( (i.amplitude = function (e) { return t(e, n * He); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), Ke = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= He); function i(t) { return ( ((t = 2 * t - 1) < 0 ? e * Ne(-t) * Math.sin((r - t) / n) : 2 - e * Ne(t) * Math.sin((r + t) / n)) / 2 ); } return ( (i.amplitude = function (e) { return t(e, n * He); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), $e = {}; var Qe = [1, 0, 0, 0, 1, 0, 0, 0, 1]; function Je(t, e, n) { var r, a = e.startTime; if (n < a + e.delay || e._paused) return !1; var s, c = e.duration, h = e.easing, l = $e[(s = h).toLowerCase()] || i[s]; if (((n = n - a - e.delay), e.repeat)) r = l((r = (n % c) / c)); else { if (!((r = n / c) < 1)) return e.onFrame ? t.attr(e.onFrame(1)) : t.attr(e.toAttrs), !0; r = l(r); } if (e.onFrame) { var f = e.onFrame(r); t.attr(f); } else !(function (t, e, n) { var r = {}, i = e.fromAttrs, a = e.toAttrs; if (!t.destroyed) { var s, c, h, l; for (var f in a) if (!Object(o.isEqual)(i[f], a[f])) if ("path" === f) { var d = a[f], p = i[f]; d.length > p.length ? ((d = u(a[f])), (p = u(i[f])), (p = L(p, d)), (p = R(p, d)), (e.fromAttrs.path = p), (e.toAttrs.path = d)) : e.pathFormatted || ((d = u(a[f])), (p = u(i[f])), (p = R(p, d)), (e.fromAttrs.path = p), (e.toAttrs.path = d), (e.pathFormatted = !0)), (r[f] = []); for (var g = 0; g < d.length; g++) { for ( var v = d[g], y = p[g], m = [], b = 0; b < v.length; b++ ) Object(o.isNumber)(v[b]) && y && Object(o.isNumber)(y[b]) ? ((s = ye(y[b], v[b])), m.push(s(n))) : m.push(v[b]); r[f].push(m); } } else if ("matrix" === f) { var x = ((h = i[f] || Qe), (se((l = a[f] || Qe)) ? ae : ce)(h, l))(n); r[f] = x; } else ["fill", "stroke", "fillStyle", "strokeStyle"].includes( f, ) && ((c = a[f]), /^[r,R,L,l]{1}[\s]*\(/.test(c)) ? (r[f] = a[f]) : Object(o.isFunction)(a[f]) || ((s = ye(i[f], a[f])), (r[f] = s(n))); t.attr(r); } })(t, e, r); return !1; } var tn = (function () { function t(t) { (this.animators = []), (this.current = 0), (this.timer = null), (this.canvas = t); } return ( (t.prototype.initTimer = function () { var t, e, n, r = this; this.timer = xt(function (i) { if (((r.current = i), r.animators.length > 0)) { for (var o = r.animators.length - 1; o >= 0; o--) if ((t = r.animators[o]).destroyed) r.removeAnimator(o); else { if (!t.isAnimatePaused()) for ( var a = (e = t.get("animations")).length - 1; a >= 0; a-- ) (n = e[a]), Je(t, n, i) && (e.splice(a, 1), !1, n.callback && n.callback()); 0 === e.length && r.removeAnimator(o); } r.canvas.get("autoDraw") || r.canvas.draw(); } }); }), (t.prototype.addAnimator = function (t) { this.animators.push(t); }), (t.prototype.removeAnimator = function (t) { this.animators.splice(t, 1); }), (t.prototype.isAnimating = function () { return !!this.animators.length; }), (t.prototype.stop = function () { this.timer && this.timer.stop(); }), (t.prototype.stopAllAnimations = function (t) { void 0 === t && (t = !0), this.animators.forEach(function (e) { e.stopAnimate(t); }), (this.animators = []), this.canvas.draw(); }), (t.prototype.getTime = function () { return this.current; }), t ); })(), en = [ "mousedown", "mouseup", "dblclick", "mouseout", "mouseover", "mousemove", "mouseleave", "mouseenter", "touchstart", "touchmove", "touchend", "dragenter", "dragover", "dragleave", "drop", "contextmenu", "mousewheel", ]; function nn(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function rn(t, e, n) { if (n.bubbles) { var r = void 0, i = !1; if ( ("mouseenter" === e ? ((r = n.fromShape), (i = !0)) : "mouseleave" === e && ((i = !0), (r = n.toShape)), t.isCanvas() && i) ) return; if (r && q(t, r)) return void (n.bubbles = !1); (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var on = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.mousedownShape = null), (this.mousedownPoint = null), (this._eventCallback = function (t) { var n = t.type; e._triggerEvent(n, t); }), (this._onDocumentMove = function (t) { if ( e.canvas.get("el") !== t.target && (e.dragging || e.currentShape) ) { var n = e._getPointInfo(t); e.dragging && e._emitEvent("drag", t, n, e.draggingShape); } }), (this._onDocumentMouseUp = function (t) { if (e.canvas.get("el") !== t.target && e.dragging) { var n = e._getPointInfo(t); e.draggingShape && e._emitEvent("drop", t, n, null), e._emitEvent("dragend", t, n, e.draggingShape), e._afterDrag(e.draggingShape, n, t); } }), (this.canvas = t.canvas); } return ( (t.prototype.init = function () { this._bindEvents(); }), (t.prototype._bindEvents = function () { var t = this, e = this.canvas.get("el"); Object(o.each)(en, function (n) { e.addEventListener(n, t._eventCallback); }), document && (document.addEventListener("mousemove", this._onDocumentMove), document.addEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._clearEvents = function () { var t = this, e = this.canvas.get("el"); Object(o.each)(en, function (n) { e.removeEventListener(n, t._eventCallback); }), document && (document.removeEventListener( "mousemove", this._onDocumentMove, ), document.removeEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._getEventObj = function (t, e, n, r, i, o) { var a = new F(t, e); return ( (a.fromShape = i), (a.toShape = o), (a.x = n.x), (a.y = n.y), (a.clientX = n.clientX), (a.clientY = n.clientY), a.propagationPath.push(r), a ); }), (t.prototype._getShape = function (t, e) { return this.canvas.getShape(t.x, t.y, e); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t], o = !1; if (i) i.call(this, n, r, e); else { var a = this.currentShape; "mouseenter" === t || "dragenter" === t || "mouseover" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "mouseenter" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "mouseleave" === t || "dragleave" === t || "mouseout" === t ? ((o = !0), a && this._emitEvent(t, e, n, a, a, null), this._emitEvent(t, e, n, null, a, null), "mouseleave" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } if ((o || (this.currentShape = r), r && !r.get("destroyed"))) { var s = this.canvas; s.get("el").style.cursor = r.attr("cursor") || s.get("cursor"); } }), (t.prototype._onmousedown = function (t, e, n) { 0 === n.button && ((this.mousedownShape = e), (this.mousedownPoint = t), (this.mousedownTimeStamp = n.timeStamp)), this._emitEvent("mousedown", n, t, e, null, null); }), (t.prototype._emitMouseoverEvents = function (t, e, n, r) { var i = this.canvas.get("el"); n !== r && (n && (this._emitEvent("mouseout", t, e, n, n, r), this._emitEvent("mouseleave", t, e, n, n, r), (r && !r.get("destroyed")) || (i.style.cursor = this.canvas.get("cursor"))), r && (this._emitEvent("mouseover", t, e, r, n, r), this._emitEvent("mouseenter", t, e, r, n, r))); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); r !== t && this._emitMouseoverEvents(n, e, t, r), (this.currentShape = r); }), (t.prototype._onmouseup = function (t, e, n) { if (0 === n.button) { var r = this.draggingShape; this.dragging ? (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)) : (this._emitEvent("mouseup", n, t, e), e === this.mousedownShape && this._emitEvent("click", n, t, e), (this.mousedownShape = null), (this.mousedownPoint = null)); } }), (t.prototype._ondragover = function (t, e, n) { n.preventDefault(); var r = this.currentShape; this._emitDragoverEvents(n, t, r, e, !0); }), (t.prototype._onmousemove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.mousedownPoint; if (a) { var s = this.mousedownShape, c = n.timeStamp - this.mousedownTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; c > 120 || u * u + h * h > 40 ? s && s.get("draggable") ? ((o = this.mousedownShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.mousedownShape = null), (this.mousedownPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.mousedownShape = null), (this.mousedownPoint = null)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)); } else this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e); } }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), nn(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || rn(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { nn(this.canvas, t, a); } }), (t.prototype.destroy = function () { this._clearEvents(), (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.mousedownPoint = null), (this.mousedownShape = null), (this.mousedownTimeStamp = null); }), t ); })(), an = Object(H.a)(), sn = an && "firefox" === an.name, cn = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( n.initContainer(), n.initDom(), n.initEvents(), n.initTimeline(), n ); } return ( Object(Y.c)(e, t), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.cursor = "default"), (e.supportCSSTransform = !1), e; }), (e.prototype.initContainer = function () { var t = this.get("container"); Object(o.isString)(t) && ((t = document.getElementById(t)), this.set("container", t)); }), (e.prototype.initDom = function () { var t = this.createDom(); this.set("el", t), this.get("container").appendChild(t), this.setDOMSize(this.get("width"), this.get("height")); }), (e.prototype.initEvents = function () { var t = new on({ canvas: this }); t.init(), this.set("eventController", t); }), (e.prototype.initTimeline = function () { var t = new tn(this); this.set("timeline", t); }), (e.prototype.setDOMSize = function (t, e) { var n = this.get("el"); W && ((n.style.width = t + "px"), (n.style.height = e + "px")); }), (e.prototype.changeSize = function (t, e) { this.setDOMSize(t, e), this.set("width", t), this.set("height", e), this.onCanvasChange("changeSize"); }), (e.prototype.getRenderer = function () { return this.get("renderer"); }), (e.prototype.getCursor = function () { return this.get("cursor"); }), (e.prototype.setCursor = function (t) { this.set("cursor", t); var e = this.get("el"); W && e && (e.style.cursor = t); }), (e.prototype.getPointByEvent = function (t) { if (this.get("supportCSSTransform")) { if (sn && !Object(o.isNil)(t.layerX) && t.layerX !== t.offsetX) return { x: t.layerX, y: t.layerY }; if (!Object(o.isNil)(t.offsetX)) return { x: t.offsetX, y: t.offsetY }; } var e = this.getClientByEvent(t), n = e.x, r = e.y; return this.getPointByClient(n, r); }), (e.prototype.getClientByEvent = function (t) { var e = t; return ( t.touches && (e = "touchend" === t.type ? t.changedTouches[0] : t.touches[0]), { x: e.clientX, y: e.clientY } ); }), (e.prototype.getPointByClient = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t - n.left, y: e - n.top }; }), (e.prototype.getClientByPoint = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t + n.left, y: e + n.top }; }), (e.prototype.draw = function () {}), (e.prototype.removeDom = function () { var t = this.get("el"); t.parentNode.removeChild(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.isCanvas = function () { return !0; }), (e.prototype.getParent = function () { return null; }), (e.prototype.destroy = function () { var e = this.get("timeline"); this.get("destroyed") || (this.clear(), e && e.stop(), this.clearEvents(), this.removeDom(), t.prototype.destroy.call(this)); }), e ); })(ot), un = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(Y.c)(e, t), (e.prototype.isGroup = function () { return !0; }), (e.prototype.isEntityGroup = function () { return !1; }), (e.prototype.clone = function () { for ( var e = t.prototype.clone.call(this), n = this.getChildren(), r = 0; r < n.length; r++ ) { var i = n[r]; e.add(i.clone()); } return e; }), e ); })(ot), hn = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(Y.c)(e, t), (e.prototype._isInBBox = function (t, e) { var n = this.getBBox(); return n.minX <= t && n.maxX >= t && n.minY <= e && n.maxY >= e; }), (e.prototype.afterAttrsChange = function (e) { t.prototype.afterAttrsChange.call(this, e), this.clearCacheBBox(); }), (e.prototype.getBBox = function () { var t = this.cfg.bbox; return t || ((t = this.calculateBBox()), this.set("bbox", t)), t; }), (e.prototype.getCanvasBBox = function () { var t = this.cfg.canvasBBox; return ( t || ((t = this.calculateCanvasBBox()), this.set("canvasBBox", t)), t ); }), (e.prototype.applyMatrix = function (e) { t.prototype.applyMatrix.call(this, e), this.set("canvasBBox", null); }), (e.prototype.calculateCanvasBBox = function () { var t = this.getBBox(), e = this.getTotalMatrix(), n = t.minX, r = t.minY, i = t.maxX, o = t.maxY; if (e) { var a = Z(e, [t.minX, t.minY]), s = Z(e, [t.maxX, t.minY]), c = Z(e, [t.minX, t.maxY]), u = Z(e, [t.maxX, t.maxY]); (n = Math.min(a[0], s[0], c[0], u[0])), (i = Math.max(a[0], s[0], c[0], u[0])), (r = Math.min(a[1], s[1], c[1], u[1])), (o = Math.max(a[1], s[1], c[1], u[1])); } var h = this.attrs; if (h.shadowColor) { var l = h.shadowBlur, f = void 0 === l ? 0 : l, d = h.shadowOffsetX, p = void 0 === d ? 0 : d, g = h.shadowOffsetY, v = void 0 === g ? 0 : g, y = n - f + p, m = i + f + p, b = r - f + v, x = o + f + v; (n = Math.min(n, y)), (i = Math.max(i, m)), (r = Math.min(r, b)), (o = Math.max(o, x)); } return { x: n, y: r, minX: n, minY: r, maxX: i, maxY: o, width: i - n, height: o - r, }; }), (e.prototype.clearCacheBBox = function () { this.set("bbox", null), this.set("canvasBBox", null); }), (e.prototype.isClipShape = function () { return this.get("isClipShape"); }), (e.prototype.isInShape = function (t, e) { return !1; }), (e.prototype.isOnlyHitBox = function () { return !1; }), (e.prototype.isHit = function (t, e) { var n = this.get("startArrowShape"), r = this.get("endArrowShape"), i = [t, e, 1], o = (i = this.invertFromMatrix(i))[0], a = i[1], s = this._isInBBox(o, a); if (this.isOnlyHitBox()) return s; if (s && !this.isClipped(o, a)) { if (this.isInShape(o, a)) return !0; if (n && n.isHit(o, a)) return !0; if (r && r.isHit(o, a)) return !0; } return !1; }), e ); })(rt), ln = new Map(); function fn(t, e) { ln.set(t, e); } function dn(t) { return ln.get(t); } var pn = function (t) { var e = t.attr(); return { x: e.x, y: e.y, width: e.width, height: e.height }; }, gn = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.r; return { x: n - i, y: r - i, width: 2 * i, height: 2 * i }; }, vn = n(7); function yn(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function mn(t, e) { var n = t.get("startArrowShape"), r = t.get("endArrowShape"); return ( n && (e = yn(e, n.getCanvasBBox())), r && (e = yn(e, r.getCanvasBBox())), e ); } var bn = null; function xn(t, e, n) { var r = 1; return ( Object(o.isString)(t) && (r = t.split("\n").length), r > 1 ? e * r + (function (t, e) { return e ? e - t : 0.14 * t; })(e, n) * (r - 1) : e ); } function wn(t, e) { var n = (function () { if (!bn) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (bn = t.getContext("2d")); } return bn; })(), r = 0; if (Object(o.isNil)(t) || "" === t) return r; if ( (n.save(), (n.font = e), Object(o.isString)(t) && t.includes("\n")) ) { var i = t.split("\n"); Object(o.each)(i, function (t) { var e = n.measureText(t).width; r < e && (r = e); }); } else r = n.measureText(t).width; return n.restore(), r; } function Sn(t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); } var On = n(22); function Mn(t, e) { var n = t.prePoint, r = t.currentPoint, i = t.nextPoint, a = Math.pow(r[0] - n[0], 2) + Math.pow(r[1] - n[1], 2), s = Math.pow(r[0] - i[0], 2) + Math.pow(r[1] - i[1], 2), c = Math.pow(n[0] - i[0], 2) + Math.pow(n[1] - i[1], 2), u = Math.acos((a + s - c) / (2 * Math.sqrt(a) * Math.sqrt(s))); if (!u || 0 === Math.sin(u) || Object(o.isNumberEqual)(u, 0)) return { xExtra: 0, yExtra: 0 }; var h = Math.abs(Math.atan2(i[1] - r[1], i[0] - r[0])), l = Math.abs(Math.atan2(i[0] - r[0], i[1] - r[1])); return ( (h = h > Math.PI / 2 ? Math.PI - h : h), (l = l > Math.PI / 2 ? Math.PI - l : l), { xExtra: Math.cos(u / 2 - h) * ((e / 2) * (1 / Math.sin(u / 2))) - e / 2 || 0, yExtra: Math.cos(l - u / 2) * ((e / 2) * (1 / Math.sin(u / 2))) - e / 2 || 0, } ); } fn("rect", pn), fn("image", pn), fn("circle", gn), fn("marker", gn), fn("polyline", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } var a = vn.f.getBBoxByArray(n, r), s = a.x, c = a.y, u = { minX: s, minY: c, maxX: s + a.width, maxY: c + a.height }; return { x: (u = mn(t, u)).minX, y: u.minY, width: u.maxX - u.minX, height: u.maxY - u.minY, }; }), fn("polygon", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } return vn.f.getBBoxByArray(n, r); }), fn("text", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Sn(e)); var c, u = wn(i, s); if (u) { var h = e.textAlign, l = e.textBaseline, f = xn(i, o, a), d = { x: n, y: r - f }; h && ("end" === h || "right" === h ? (d.x -= u) : "center" === h && (d.x -= u / 2)), l && ("top" === l ? (d.y += f) : "middle" === l && (d.y += f / 2)), (c = { x: d.x, y: d.y, width: u, height: f }); } else c = { x: n, y: r, width: 0, height: 0 }; return c; }), fn("path", function (t) { var e = t.attr(), n = e.path, r = e.stroke ? e.lineWidth : 0, i = (function (t, e) { for (var n = [], r = [], i = [], a = 0; a < t.length; a++) { var s = (v = t[a]).currentPoint, c = v.params, u = v.prePoint, h = void 0; switch (v.command) { case "Q": h = vn.e.box(u[0], u[1], c[1], c[2], c[3], c[4]); break; case "C": h = vn.b.box( u[0], u[1], c[1], c[2], c[3], c[4], c[5], c[6], ); break; case "A": var l = v.arcParams; h = vn.a.box( l.cx, l.cy, l.rx, l.ry, l.xRotation, l.startAngle, l.endAngle, ); break; default: n.push(s[0]), r.push(s[1]); } h && ((v.box = h), n.push(h.x, h.x + h.width), r.push(h.y, h.y + h.height)), e && ("L" === v.command || "M" === v.command) && v.prePoint && v.nextPoint && i.push(v); } (n = n.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })), (r = r.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })); var f = Object(o.min)(n), d = Object(o.min)(r), p = Object(o.max)(n), g = Object(o.max)(r); if (0 === i.length) return { x: f, y: d, width: p - f, height: g - d }; for (a = 0; a < i.length; a++) { var v; (s = (v = i[a]).currentPoint)[0] === f ? (f -= Mn(v, e).xExtra) : s[0] === p && (p += Mn(v, e).xExtra), s[1] === d ? (d -= Mn(v, e).yExtra) : s[1] === g && (g += Mn(v, e).yExtra); } return { x: f, y: d, width: p - f, height: g - d }; })(t.get("segments") || Object(On.d)(n), r), a = i.x, s = i.y, c = { minX: a, minY: s, maxX: a + i.width, maxY: s + i.height }; return { x: (c = mn(t, c)).minX, y: c.minY, width: c.maxX - c.minX, height: c.maxY - c.minY, }; }), fn("line", function (t) { var e = t.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = { minX: Math.min(n, i), maxX: Math.max(n, i), minY: Math.min(r, o), maxY: Math.max(r, o), }; return { x: (a = mn(t, a)).minX, y: a.minY, width: a.maxX - a.minX, height: a.maxY - a.minY, }; }), fn("ellipse", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; return { x: n - i, y: r - o, width: 2 * i, height: 2 * o }; }); }, 7: function (t, e, n) { "use strict"; n.d(e, "e", function () { return m; }), n.d(e, "b", function () { return M; }), n.d(e, "a", function () { return I; }), n.d(e, "c", function () { return f; }), n.d(e, "d", function () { return _; }), n.d(e, "f", function () { return r; }); var r = {}; function i(t) { return Math.min.apply(null, t); } function o(t) { return Math.max.apply(null, t); } function a(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function s(t, e) { return Math.abs(t - e) < 0.001; } function c(t, e) { var n = i(t), r = i(e); return { x: n, y: r, width: o(t) - n, height: o(e) - r }; } function u(t, e, n, r) { return { minX: i([t, n]), maxX: o([t, n]), minY: i([e, r]), maxY: o([e, r]), }; } function h(t) { return (t + 2 * Math.PI) % (2 * Math.PI); } n.r(r), n.d(r, "distance", function () { return a; }), n.d(r, "isNumberEqual", function () { return s; }), n.d(r, "getBBoxByArray", function () { return c; }), n.d(r, "getBBoxRange", function () { return u; }), n.d(r, "piMod", function () { return h; }); var l = n(42), f = { box: function (t, e, n, r) { return c([t, n], [e, r]); }, length: function (t, e, n, r) { return a(t, e, n, r); }, pointAt: function (t, e, n, r, i) { return { x: (1 - i) * t + i * n, y: (1 - i) * e + i * r }; }, pointDistance: function (t, e, n, r, i, o) { var s = (n - t) * (i - t) + (r - e) * (o - e); return s < 0 ? a(t, e, i, o) : s > (n - t) * (n - t) + (r - e) * (r - e) ? a(n, r, i, o) : this.pointToLine(t, e, n, r, i, o); }, pointToLine: function (t, e, n, r, i, o) { var a = [n - t, r - e]; if (l.exactEquals(a, [0, 0])) return Math.sqrt((i - t) * (i - t) + (o - e) * (o - e)); var s = [-a[1], a[0]]; l.normalize(s, s); var c = [i - t, o - e]; return Math.abs(l.dot(c, s)); }, tangentAngle: function (t, e, n, r) { return Math.atan2(r - e, n - t); }, }; function d(t, e, n, r, i, o) { var s, c = 1 / 0, u = [n, r], h = 20; o && o > 200 && (h = o / 10); for (var l = 1 / h, f = l / 10, d = 0; d <= h; d++) { var p = d * l, g = [i.apply(null, t.concat([p])), i.apply(null, e.concat([p]))]; (b = a(u[0], u[1], g[0], g[1])) < c && ((s = p), (c = b)); } if (0 === s) return { x: t[0], y: e[0] }; if (1 === s) { var v = t.length; return { x: t[v - 1], y: e[v - 1] }; } c = 1 / 0; for (d = 0; d < 32 && !(f < 1e-4); d++) { var y = s - f, m = s + f, b = ((g = [ i.apply(null, t.concat([y])), i.apply(null, e.concat([y])), ]), a(u[0], u[1], g[0], g[1])); if (y >= 0 && b < c) (s = y), (c = b); else { var x = [ i.apply(null, t.concat([m])), i.apply(null, e.concat([m])), ], w = a(u[0], u[1], x[0], x[1]); m <= 1 && w < c ? ((s = m), (c = w)) : (f *= 0.5); } } return { x: i.apply(null, t.concat([s])), y: i.apply(null, e.concat([s])), }; } function p(t, e, n, r) { var i = 1 - r; return i * i * t + 2 * r * i * e + r * r * n; } function g(t, e, n) { var r = t + n - 2 * e; if (s(r, 0)) return [0.5]; var i = (t - e) / r; return i <= 1 && i >= 0 ? [i] : []; } function v(t, e, n, r) { return 2 * (1 - r) * (e - t) + 2 * r * (n - e); } function y(t, e, n, r, i, o, a) { var s = p(t, n, i, a), c = p(e, r, o, a), u = f.pointAt(t, e, n, r, a), h = f.pointAt(n, r, i, o, a); return [ [t, e, u.x, u.y, s, c], [s, c, h.x, h.y, i, o], ]; } var m = { box: function (t, e, n, r, i, o) { var a = g(t, n, i)[0], s = g(e, r, o)[0], u = [t, i], h = [e, o]; return ( void 0 !== a && u.push(p(t, n, i, a)), void 0 !== s && h.push(p(e, r, o, s)), c(u, h) ); }, length: function (t, e, n, r, i, o) { return (function t(e, n, r, i, o, s, c) { if (0 === c) return (a(e, n, r, i) + a(r, i, o, s) + a(e, n, o, s)) / 2; var u = y(e, n, r, i, o, s, 0.5), h = u[0], l = u[1]; return ( h.push(c - 1), l.push(c - 1), t.apply(null, h) + t.apply(null, l) ); })(t, e, n, r, i, o, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s) { return d([t, n, i], [e, r, o], a, s, p); }, pointDistance: function (t, e, n, r, i, o, s, c) { var u = this.nearestPoint(t, e, n, r, i, o, s, c); return a(u.x, u.y, s, c); }, interpolationAt: p, pointAt: function (t, e, n, r, i, o, a) { return { x: p(t, n, i, a), y: p(e, r, o, a) }; }, divide: function (t, e, n, r, i, o, a) { return y(t, e, n, r, i, o, a); }, tangentAngle: function (t, e, n, r, i, o, a) { var s = v(t, n, i, a), c = v(e, r, o, a); return h(Math.atan2(c, s)); }, }; function b(t, e, n, r, i) { var o = 1 - i; return ( o * o * o * t + 3 * e * i * o * o + 3 * n * i * i * o + r * i * i * i ); } function x(t, e, n, r, i) { var o = 1 - i; return 3 * (o * o * (e - t) + 2 * o * i * (n - e) + i * i * (r - n)); } function w(t, e, n, r) { var i, o, a, c = -3 * t + 9 * e - 9 * n + 3 * r, u = 6 * t - 12 * e + 6 * n, h = 3 * e - 3 * t, l = []; if (s(c, 0)) s(u, 0) || ((i = -h / u) >= 0 && i <= 1 && l.push(i)); else { var f = u * u - 4 * c * h; s(f, 0) ? l.push(-u / (2 * c)) : f > 0 && ((o = (-u - (a = Math.sqrt(f))) / (2 * c)), (i = (-u + a) / (2 * c)) >= 0 && i <= 1 && l.push(i), o >= 0 && o <= 1 && l.push(o)); } return l; } function S(t, e, n, r, i, o, a, s, c) { var u = b(t, n, i, a, c), h = b(e, r, o, s, c), l = f.pointAt(t, e, n, r, c), d = f.pointAt(n, r, i, o, c), p = f.pointAt(i, o, a, s, c), g = f.pointAt(l.x, l.y, d.x, d.y, c), v = f.pointAt(d.x, d.y, p.x, p.y, c); return [ [t, e, l.x, l.y, g.x, g.y, u, h], [u, h, v.x, v.y, p.x, p.y, a, s], ]; } function O(t, e, n, r, i, o, s, c, u) { if (0 === u) return (function (t, e) { for (var n = 0, r = t.length, i = 0; i < r; i++) { n += a(t[i], e[i], t[(i + 1) % r], e[(i + 1) % r]); } return n / 2; })([t, n, i, s], [e, r, o, c]); var h = S(t, e, n, r, i, o, s, c, 0.5), l = h[0], f = h[1]; return ( l.push(u - 1), f.push(u - 1), O.apply(null, l) + O.apply(null, f) ); } var M = { extrema: w, box: function (t, e, n, r, i, o, a, s) { for ( var u = [t, a], h = [e, s], l = w(t, n, i, a), f = w(e, r, o, s), d = 0; d < l.length; d++ ) u.push(b(t, n, i, a, l[d])); for (d = 0; d < f.length; d++) h.push(b(e, r, o, s, f[d])); return c(u, h); }, length: function (t, e, n, r, i, o, a, s) { return O(t, e, n, r, i, o, a, s, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s, c, u, h) { return d([t, n, i, a], [e, r, o, s], c, u, b, h); }, pointDistance: function (t, e, n, r, i, o, s, c, u, h, l) { var f = this.nearestPoint(t, e, n, r, i, o, s, c, u, h, l); return a(f.x, f.y, u, h); }, interpolationAt: b, pointAt: function (t, e, n, r, i, o, a, s, c) { return { x: b(t, n, i, a, c), y: b(e, r, o, s, c) }; }, divide: function (t, e, n, r, i, o, a, s, c) { return S(t, e, n, r, i, o, a, s, c); }, tangentAngle: function (t, e, n, r, i, o, a, s, c) { var u = x(t, n, i, a, c), l = x(e, r, o, s, c); return h(Math.atan2(l, u)); }, }; function k(t, e) { var n = Math.abs(t); return e > 0 ? n : -1 * n; } var C = function (t, e, n, r, i, o) { var a = n, s = r; if (0 === a || 0 === s) return { x: t, y: e }; for ( var c, u, h = i - t, l = o - e, f = Math.abs(h), d = Math.abs(l), p = a * a, g = s * s, v = Math.PI / 4, y = 0; y < 4; y++ ) { (c = a * Math.cos(v)), (u = s * Math.sin(v)); var m = ((p - g) * Math.pow(Math.cos(v), 3)) / a, b = ((g - p) * Math.pow(Math.sin(v), 3)) / s, x = c - m, w = u - b, S = f - m, O = d - b, M = Math.hypot(w, x), C = Math.hypot(O, S); (v += (M * Math.asin((x * O - w * S) / (M * C))) / Math.sqrt(p + g - c * c - u * u)), (v = Math.min(Math.PI / 2, Math.max(0, v))); } return { x: t + k(c, h), y: e + k(u, l) }; }; function E(t, e, n, r, i, o) { return ( n * Math.cos(i) * Math.cos(o) - r * Math.sin(i) * Math.sin(o) + t ); } function j(t, e, n, r, i, o) { return ( n * Math.sin(i) * Math.cos(o) + r * Math.cos(i) * Math.sin(o) + e ); } function P(t, e, n) { return { x: t * Math.cos(n), y: e * Math.sin(n) }; } function A(t, e, n) { var r = Math.cos(n), i = Math.sin(n); return [t * r - e * i, t * i + e * r]; } var I = { box: function (t, e, n, r, i, o, a) { for ( var s = (function (t, e, n) { return Math.atan((-e / t) * Math.tan(n)); })(n, r, i), c = 1 / 0, u = -1 / 0, h = [o, a], l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI ) { var f = s + l; o < a ? o < f && f < a && h.push(f) : a < f && f < o && h.push(f); } for (l = 0; l < h.length; l++) { var d = E(t, 0, n, r, i, h[l]); d < c && (c = d), d > u && (u = d); } var p = (function (t, e, n) { return Math.atan(e / (t * Math.tan(n))); })(n, r, i), g = 1 / 0, v = -1 / 0, y = [o, a]; for (l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI) { var m = p + l; o < a ? o < m && m < a && y.push(m) : a < m && m < o && y.push(m); } for (l = 0; l < y.length; l++) { var b = j(0, e, n, r, i, y[l]); b < g && (g = b), b > v && (v = b); } return { x: c, y: g, width: u - c, height: v - g }; }, length: function (t, e, n, r, i, o, a) {}, nearestPoint: function (t, e, n, r, i, o, a, s, c) { var u = A(s - t, c - e, -i), h = u[0], l = u[1], f = C(0, 0, n, r, h, l), d = (function (t, e, n, r) { return (Math.atan2(r * t, n * e) + 2 * Math.PI) % (2 * Math.PI); })(n, r, f.x, f.y); d < o ? (f = P(n, r, o)) : d > a && (f = P(n, r, a)); var p = A(f.x, f.y, i); return { x: p[0] + t, y: p[1] + e }; }, pointDistance: function (t, e, n, r, i, o, s, c, u) { var h = this.nearestPoint(t, e, n, r, c, u); return a(h.x, h.y, c, u); }, pointAt: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o; return { x: E(t, 0, n, r, i, c), y: j(0, e, n, r, i, c) }; }, tangentAngle: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o, u = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.cos(i) * Math.sin(s) - r * Math.sin(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c), l = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.sin(i) * Math.sin(s) + r * Math.cos(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c); return h(Math.atan2(l, u)); }, }; function T(t) { for (var e = 0, n = [], r = 0; r < t.length - 1; r++) { var i = t[r], o = t[r + 1], s = a(i[0], i[1], o[0], o[1]), c = { from: i, to: o, length: s }; n.push(c), (e += s); } return { segments: n, totalLength: e }; } function N(t) { if (t.length < 2) return 0; for (var e = 0, n = 0; n < t.length - 1; n++) { var r = t[n], i = t[n + 1]; e += a(r[0], r[1], i[0], i[1]); } return e; } function B(t, e) { if (e > 1 || e < 0 || t.length < 2) return null; var n = T(t), r = n.segments, i = n.totalLength; if (0 === i) return { x: t[0][0], y: t[0][1] }; for (var o = 0, a = null, s = 0; s < r.length; s++) { var c = r[s], u = c.from, h = c.to, l = c.length / i; if (e >= o && e <= o + l) { var d = (e - o) / l; a = f.pointAt(u[0], u[1], h[0], h[1], d); break; } o += l; } return a; } function L(t, e) { if (e > 1 || e < 0 || t.length < 2) return 0; for ( var n = T(t), r = n.segments, i = n.totalLength, o = 0, a = 0, s = 0; s < r.length; s++ ) { var c = r[s], u = c.from, h = c.to, l = c.length / i; if (e >= o && e <= o + l) { a = Math.atan2(h[1] - u[1], h[0] - u[0]); break; } o += l; } return a; } function D(t, e, n) { for (var r = 1 / 0, i = 0; i < t.length - 1; i++) { var o = t[i], a = t[i + 1], s = f.pointDistance(o[0], o[1], a[0], a[1], e, n); s < r && (r = s); } return r; } var _ = { box: function (t) { for (var e = [], n = [], r = 0; r < t.length; r++) { var i = t[r]; e.push(i[0]), n.push(i[1]); } return c(e, n); }, length: function (t) { return N(t); }, pointAt: function (t, e) { return B(t, e); }, pointDistance: function (t, e, n) { return D(t, e, n); }, tangentAngle: function (t, e) { return L(t, e); }, }; }, 72: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "length", function () { return a; }), n.d(e, "fromValues", function () { return s; }), n.d(e, "copy", function () { return c; }), n.d(e, "set", function () { return u; }), n.d(e, "add", function () { return h; }), n.d(e, "subtract", function () { return l; }), n.d(e, "multiply", function () { return f; }), n.d(e, "divide", function () { return d; }), n.d(e, "ceil", function () { return p; }), n.d(e, "floor", function () { return g; }), n.d(e, "min", function () { return v; }), n.d(e, "max", function () { return y; }), n.d(e, "round", function () { return m; }), n.d(e, "scale", function () { return b; }), n.d(e, "scaleAndAdd", function () { return x; }), n.d(e, "distance", function () { return w; }), n.d(e, "squaredDistance", function () { return S; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return C; }), n.d(e, "dot", function () { return E; }), n.d(e, "cross", function () { return j; }), n.d(e, "lerp", function () { return P; }), n.d(e, "hermite", function () { return A; }), n.d(e, "bezier", function () { return I; }), n.d(e, "random", function () { return T; }), n.d(e, "transformMat4", function () { return N; }), n.d(e, "transformMat3", function () { return B; }), n.d(e, "transformQuat", function () { return L; }), n.d(e, "rotateX", function () { return D; }), n.d(e, "rotateY", function () { return _; }), n.d(e, "rotateZ", function () { return R; }), n.d(e, "angle", function () { return F; }), n.d(e, "zero", function () { return Y; }), n.d(e, "str", function () { return X; }), n.d(e, "exactEquals", function () { return z; }), n.d(e, "equals", function () { return W; }), n.d(e, "sub", function () { return V; }), n.d(e, "mul", function () { return G; }), n.d(e, "div", function () { return H; }), n.d(e, "dist", function () { return U; }), n.d(e, "sqrDist", function () { return Z; }), n.d(e, "len", function () { return K; }), n.d(e, "sqrLen", function () { return $; }), n.d(e, "forEach", function () { return Q; }); var r = n(5); function i() { var t = new r.a(3); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0), (t[2] = 0)), t; } function o(t) { var e = new r.a(3); return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), e; } function a(t) { var e = t[0], n = t[1], r = t[2]; return Math.hypot(e, n, r); } function s(t, e, n) { var i = new r.a(3); return (i[0] = t), (i[1] = e), (i[2] = n), i; } function c(t, e) { return (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), t; } function u(t, e, n, r) { return (t[0] = e), (t[1] = n), (t[2] = r), t; } function h(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), t ); } function l(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), t ); } function f(t, e, n) { return ( (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), (t[2] = e[2] * n[2]), t ); } function d(t, e, n) { return ( (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), (t[2] = e[2] / n[2]), t ); } function p(t, e) { return ( (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), (t[2] = Math.ceil(e[2])), t ); } function g(t, e) { return ( (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), (t[2] = Math.floor(e[2])), t ); } function v(t, e, n) { return ( (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), (t[2] = Math.min(e[2], n[2])), t ); } function y(t, e, n) { return ( (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), (t[2] = Math.max(e[2], n[2])), t ); } function m(t, e) { return ( (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), (t[2] = Math.round(e[2])), t ); } function b(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), t; } function x(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), t ); } function w(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return Math.hypot(n, r, i); } function S(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return n * n + r * r + i * i; } function O(t) { var e = t[0], n = t[1], r = t[2]; return e * e + n * n + r * r; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), (t[2] = -e[2]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), (t[2] = 1 / e[2]), t; } function C(t, e) { var n = e[0], r = e[1], i = e[2], o = n * n + r * r + i * i; return ( o > 0 && (o = 1 / Math.sqrt(o)), (t[0] = e[0] * o), (t[1] = e[1] * o), (t[2] = e[2] * o), t ); } function E(t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2]; } function j(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[0], s = n[1], c = n[2]; return ( (t[0] = i * c - o * s), (t[1] = o * a - r * c), (t[2] = r * s - i * a), t ); } function P(t, e, n, r) { var i = e[0], o = e[1], a = e[2]; return ( (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), (t[2] = a + r * (n[2] - a)), t ); } function A(t, e, n, r, i, o) { var a = o * o, s = a * (2 * o - 3) + 1, c = a * (o - 2) + o, u = a * (o - 1), h = a * (3 - 2 * o); return ( (t[0] = e[0] * s + n[0] * c + r[0] * u + i[0] * h), (t[1] = e[1] * s + n[1] * c + r[1] * u + i[1] * h), (t[2] = e[2] * s + n[2] * c + r[2] * u + i[2] * h), t ); } function I(t, e, n, r, i, o) { var a = 1 - o, s = a * a, c = o * o, u = s * a, h = 3 * o * s, l = 3 * c * a, f = c * o; return ( (t[0] = e[0] * u + n[0] * h + r[0] * l + i[0] * f), (t[1] = e[1] * u + n[1] * h + r[1] * l + i[1] * f), (t[2] = e[2] * u + n[2] * h + r[2] * l + i[2] * f), t ); } function T(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI, i = 2 * r.c() - 1, o = Math.sqrt(1 - i * i) * e; return ( (t[0] = Math.cos(n) * o), (t[1] = Math.sin(n) * o), (t[2] = i * e), t ); } function N(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[3] * r + n[7] * i + n[11] * o + n[15]; return ( (a = a || 1), (t[0] = (n[0] * r + n[4] * i + n[8] * o + n[12]) / a), (t[1] = (n[1] * r + n[5] * i + n[9] * o + n[13]) / a), (t[2] = (n[2] * r + n[6] * i + n[10] * o + n[14]) / a), t ); } function B(t, e, n) { var r = e[0], i = e[1], o = e[2]; return ( (t[0] = r * n[0] + i * n[3] + o * n[6]), (t[1] = r * n[1] + i * n[4] + o * n[7]), (t[2] = r * n[2] + i * n[5] + o * n[8]), t ); } function L(t, e, n) { var r = n[0], i = n[1], o = n[2], a = n[3], s = e[0], c = e[1], u = e[2], h = i * u - o * c, l = o * s - r * u, f = r * c - i * s, d = i * f - o * l, p = o * h - r * f, g = r * l - i * h, v = 2 * a; return ( (h *= v), (l *= v), (f *= v), (d *= 2), (p *= 2), (g *= 2), (t[0] = s + h + d), (t[1] = c + l + p), (t[2] = u + f + g), t ); } function D(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0]), (o[1] = i[1] * Math.cos(r) - i[2] * Math.sin(r)), (o[2] = i[1] * Math.sin(r) + i[2] * Math.cos(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function _(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[2] * Math.sin(r) + i[0] * Math.cos(r)), (o[1] = i[1]), (o[2] = i[2] * Math.cos(r) - i[0] * Math.sin(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function R(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0] * Math.cos(r) - i[1] * Math.sin(r)), (o[1] = i[0] * Math.sin(r) + i[1] * Math.cos(r)), (o[2] = i[2]), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function F(t, e) { var n = t[0], r = t[1], i = t[2], o = e[0], a = e[1], s = e[2], c = Math.sqrt(n * n + r * r + i * i) * Math.sqrt(o * o + a * a + s * s), u = c && E(t, e) / c; return Math.acos(Math.min(Math.max(u, -1), 1)); } function Y(t) { return (t[0] = 0), (t[1] = 0), (t[2] = 0), t; } function X(t) { return "vec3(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; } function z(t, e) { return t[0] === e[0] && t[1] === e[1] && t[2] === e[2]; } function W(t, e) { var n = t[0], i = t[1], o = t[2], a = e[0], s = e[1], c = e[2]; return ( Math.abs(n - a) <= r.b * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(i - s) <= r.b * Math.max(1, Math.abs(i), Math.abs(s)) && Math.abs(o - c) <= r.b * Math.max(1, Math.abs(o), Math.abs(c)) ); } var q, V = l, G = f, H = d, U = w, Z = S, K = a, $ = O, Q = ((q = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 3), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (q[0] = t[a]), (q[1] = t[a + 1]), (q[2] = t[a + 2]), i(q, q, o), (t[a] = q[0]), (t[a + 1] = q[1]), (t[a + 2] = q[2]); return t; }); }, 73: function (t, e, n) { "use strict"; var r = (function () { function t() { this._events = {}; } return ( (t.prototype.on = function (t, e, n) { return ( this._events[t] || (this._events[t] = []), this._events[t].push({ callback: e, once: !!n }), this ); }), (t.prototype.once = function (t, e) { return this.on(t, e, !0); }), (t.prototype.emit = function (t) { for (var e = this, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = this._events[t] || [], o = this._events["*"] || [], a = function (r) { for (var i = r.length, o = 0; o < i; o++) if (r[o]) { var a = r[o], s = a.callback; a.once && (r.splice(o, 1), 0 === r.length && delete e._events[t], i--, o--), s.apply(e, n); } }; a(i), a(o); }), (t.prototype.off = function (t, e) { if (t) if (e) { for ( var n = this._events[t] || [], r = n.length, i = 0; i < r; i++ ) n[i].callback === e && (n.splice(i, 1), r--, i--); 0 === n.length && delete this._events[t]; } else delete this._events[t]; else this._events = {}; return this; }), (t.prototype.getEvents = function () { return this._events; }), t ); })(); e.a = r; }, 74: function (t, e, n) { "use strict"; n.d(e, "b", function () { return Wt; }); var r = {}; n.r(r), n.d(r, "Base", function () { return V; }), n.d(r, "Circle", function () { return G; }), n.d(r, "Ellipse", function () { return U; }), n.d(r, "Image", function () { return $; }), n.d(r, "Line", function () { return tt; }), n.d(r, "Marker", function () { return rt; }), n.d(r, "Path", function () { return dt; }), n.d(r, "Polygon", function () { return gt; }), n.d(r, "Polyline", function () { return vt; }), n.d(r, "Rect", function () { return yt; }), n.d(r, "Text", function () { return mt; }); var i = n(1), o = n(6), a = n(0); function s(t) { return (s = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var c = {}; function u(t) { return (null == c ? void 0 : c.clearAnimationFrame) ? c.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : s(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); } function h(t) { return (h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function l(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function f(t, e, n, r, i, o) { return i >= t && i <= t + n && o >= e && o <= e + r; } function d(t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); } function p(t, e) { return t[0] === e[0] && t[1] === e[1]; } var g = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i, v = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i, y = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i, m = /[\d.]+:(#[^\s]+|[^\)]+\))/gi; function b(t, e) { var n = t.match(m); Object(a.each)(n, function (t) { var n = t.split(":"); e.addColorStop(n[0], n[1]); }); } function x(t, e, n) { if (Object(a.isString)(n)) { if ("(" === n[1] || "(" === n[2]) { if ("l" === n[0]) return (function (t, e, n) { var r, i, o = g.exec(n), a = (parseFloat(o[1]) % 360) * (Math.PI / 180), s = o[2], c = e.getBBox(); a >= 0 && a < 0.5 * Math.PI ? ((r = { x: c.minX, y: c.minY }), (i = { x: c.maxX, y: c.maxY })) : 0.5 * Math.PI <= a && a < Math.PI ? ((r = { x: c.maxX, y: c.minY }), (i = { x: c.minX, y: c.maxY })) : Math.PI <= a && a < 1.5 * Math.PI ? ((r = { x: c.maxX, y: c.maxY }), (i = { x: c.minX, y: c.minY })) : ((r = { x: c.minX, y: c.maxY }), (i = { x: c.maxX, y: c.minY })); var u = Math.tan(a), h = u * u, l = (i.x - r.x + u * (i.y - r.y)) / (h + 1) + r.x, f = (u * (i.x - r.x + u * (i.y - r.y))) / (h + 1) + r.y, d = t.createLinearGradient(r.x, r.y, l, f); return b(s, d), d; })(t, e, n); if ("r" === n[0]) return (function (t, e, n) { var r = v.exec(n), i = parseFloat(r[1]), o = parseFloat(r[2]), a = parseFloat(r[3]), s = r[4]; if (0 === a) { var c = s.match(m); return c[c.length - 1].split(":")[1]; } var u = e.getBBox(), h = u.maxX - u.minX, l = u.maxY - u.minY, f = Math.sqrt(h * h + l * l) / 2, d = t.createRadialGradient( u.minX + h * i, u.minY + l * o, 0, u.minX + h / 2, u.minY + l / 2, a * f, ); return b(s, d), d; })(t, e, n); if ("p" === n[0]) return (function (t, e, n) { if (e.get("patternSource") && e.get("patternSource") === n) return e.get("pattern"); var r, i, o = y.exec(n), a = o[1], s = o[2]; function c() { (r = t.createPattern(i, a)), e.set("pattern", r), e.set("patternSource", n); } switch (a) { case "a": a = "repeat"; break; case "x": a = "repeat-x"; break; case "y": a = "repeat-y"; break; case "n": a = "no-repeat"; break; default: a = "no-repeat"; } return ( (i = new Image()), s.match(/^data:/i) || (i.crossOrigin = "Anonymous"), (i.src = s), i.complete ? c() : ((i.onload = c), (i.src = i.src)), r ); })(t, e, n); } return n; } } function w(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function S(t, e) { return w(t) * w(e) ? (t[0] * e[0] + t[1] * e[1]) / (w(t) * w(e)) : 1; } function O(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(S(t, e)); } function M(t, e) { var n = e[1], r = e[2], i = Object(a.mod)(Object(a.toRadian)(e[3]), 2 * Math.PI), o = e[4], s = e[5], c = t[0], u = t[1], h = e[6], l = e[7], f = (Math.cos(i) * (c - h)) / 2 + (Math.sin(i) * (u - l)) / 2, d = (-1 * Math.sin(i) * (c - h)) / 2 + (Math.cos(i) * (u - l)) / 2, g = (f * f) / (n * n) + (d * d) / (r * r); g > 1 && ((n *= Math.sqrt(g)), (r *= Math.sqrt(g))); var v = n * n * (d * d) + r * r * (f * f), y = v ? Math.sqrt((n * n * (r * r) - v) / v) : 1; o === s && (y *= -1), isNaN(y) && (y = 0); var m = r ? (y * n * d) / r : 0, b = n ? (y * -r * f) / n : 0, x = (c + h) / 2 + Math.cos(i) * m - Math.sin(i) * b, w = (u + l) / 2 + Math.sin(i) * m + Math.cos(i) * b, M = [(f - m) / n, (d - b) / r], k = [(-1 * f - m) / n, (-1 * d - b) / r], C = O([1, 0], M), E = O(M, k); return ( S(M, k) <= -1 && (E = Math.PI), S(M, k) >= 1 && (E = 0), 0 === s && E > 0 && (E -= 2 * Math.PI), 1 === s && E < 0 && (E += 2 * Math.PI), { cx: x, cy: w, rx: p(t, [h, l]) ? 0 : n, ry: p(t, [h, l]) ? 0 : r, startAngle: C, endAngle: C + E, xRotation: i, arcFlag: o, sweepFlag: s, } ); } function k(t) { return (k = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var C = Math.sin, E = Math.cos, j = Math.atan2, P = Math.PI; function A(t, e, n, r, i, o, a) { var s = e.stroke, c = e.lineWidth, u = j(r - o, n - i), h = new dt({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: { path: "M" + 10 * E(P / 6) + "," + 10 * C(P / 6) + " L0,0 L" + 10 * E(P / 6) + ",-" + 10 * C(P / 6), stroke: s, lineWidth: c, }, }); h.translate(i, o), h.rotateAtPoint(i, o, u), t.set(a ? "startArrowShape" : "endArrowShape", h); } function I(t, e, n, r, o, a, s) { var c = e.startArrow, u = e.endArrow, h = e.stroke, l = e.lineWidth, f = s ? c : u, d = f.d, p = f.fill, g = f.stroke, v = f.lineWidth, y = Object(i.e)(f, ["d", "fill", "stroke", "lineWidth"]), m = j(r - a, n - o); d && ((o -= E(m) * d), (a -= C(m) * d)); var b = new dt({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: Object(i.a)(Object(i.a)({}, y), { stroke: g || h, lineWidth: v || l, fill: p, }), }); b.translate(o, a), b.rotateAtPoint(o, a, m), t.set(s ? "startArrowShape" : "endArrowShape", b); } function T(t, e, n, r, i) { var o = j(r - e, n - t); return { dx: E(o) * i, dy: C(o) * i }; } function N(t, e, n, r, i, o) { "object" === k(e.startArrow) ? I(t, e, n, r, i, o, !0) : e.startArrow ? A(t, e, n, r, i, o, !0) : t.set("startArrowShape", null); } function B(t, e, n, r, i, o) { "object" === k(e.endArrow) ? I(t, e, n, r, i, o, !1) : e.endArrow ? A(t, e, n, r, i, o, !1) : t.set("startArrowShape", null); } var L = { fill: "fillStyle", stroke: "strokeStyle", opacity: "globalAlpha", }; function D(t, e) { var n = e.attr(); for (var r in n) { var i = n[r], o = L[r] ? L[r] : r; "matrix" === o && i ? t.transform(i[0], i[1], i[3], i[4], i[6], i[7]) : "lineDash" === o && t.setLineDash ? Object(a.isArray)(i) && t.setLineDash(i) : ("strokeStyle" === o || "fillStyle" === o ? (i = x(t, e, i)) : "globalAlpha" === o && (i *= t.globalAlpha), (t[o] = i)); } } function _(t, e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; i.cfg.visible ? i.draw(t, n) : i.skipDraw(); } } function R(t, e, n) { var r = t.get("refreshElements"); Object(a.each)(r, function (e) { if (e !== t) for (var n = e.cfg.parent; n && n !== t && !n.cfg.refresh; ) (n.cfg.refresh = !0), (n = n.cfg.parent); }), r[0] === t ? F(e, n) : (function t(e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; if (i.cfg.visible) if (i.cfg.hasChanged) (i.cfg.refresh = !0), i.isGroup() && F(i.cfg.children, n); else if (i.cfg.refresh) i.isGroup() && t(i.cfg.children, n); else { var o = Y(i, n); (i.cfg.refresh = o), o && i.isGroup() && t(i.cfg.children, n); } } })(e, n); } function F(t, e) { for (var n = 0; n < t.length; n++) { var r = t[n]; (r.cfg.refresh = !0), r.isGroup() && F(r.get("children"), e); } } function Y(t, e) { var n = t.cfg.cacheCanvasBBox; return t.cfg.isInView && n && d(n, e); } function X(t, e, n, r) { var i = n.path, o = n.startArrow, a = n.endArrow; if (i) { var s = [0, 0], c = [0, 0], u = { dx: 0, dy: 0 }; e.beginPath(); for (var h = 0; h < i.length; h++) { var l = i[h], f = l[0]; if (0 === h && o && o.d) u = T( (d = t.getStartTangent())[0][0], d[0][1], d[1][0], d[1][1], o.d, ); else if (h === i.length - 2 && "Z" === i[h + 1][0] && a && a.d) { if ("Z" === i[h + 1][0]) u = T( (d = t.getEndTangent())[0][0], d[0][1], d[1][0], d[1][1], a.d, ); } else if (h === i.length - 1 && a && a.d) { var d; if ("Z" !== i[0]) u = T( (d = t.getEndTangent())[0][0], d[0][1], d[1][0], d[1][1], a.d, ); } var p = u.dx, g = u.dy; switch (f) { case "M": e.moveTo(l[1] - p, l[2] - g), (c = [l[1], l[2]]); break; case "L": e.lineTo(l[1] - p, l[2] - g); break; case "Q": e.quadraticCurveTo(l[1], l[2], l[3] - p, l[4] - g); break; case "C": e.bezierCurveTo(l[1], l[2], l[3], l[4], l[5] - p, l[6] - g); break; case "A": var v = void 0; r ? (v = r[h]) || ((v = M(s, l)), (r[h] = v)) : (v = M(s, l)); var y = v.cx, m = v.cy, b = v.rx, x = v.ry, w = v.startAngle, S = v.endAngle, O = v.xRotation, k = v.sweepFlag; if (e.ellipse) e.ellipse(y, m, b, x, O, w, S, 1 - k); else { var C = b > x ? b : x, E = b > x ? 1 : b / x, j = b > x ? x / b : 1; e.translate(y, m), e.rotate(O), e.scale(E, j), e.arc(0, 0, C, w, S, 1 - k), e.scale(1 / E, 1 / j), e.rotate(-O), e.translate(-y, -m); } break; case "Z": e.closePath(); } if ("Z" === f) s = c; else { var P = l.length; s = [l[P - 2], l[P - 1]]; } } } } function z(t, e) { var n = t.get("canvas"); n && ("remove" === e && (t._cacheCanvasBBox = t.get("cacheCanvasBBox")), t.get("hasChanged") || (t.set("hasChanged", !0), (t.cfg.parent && t.cfg.parent.get("hasChanged")) || (n.refreshElement(t, e, n), n.get("autoDraw") && n.draw()))); } function W(t) { var e, n, r; if (t.destroyed) e = t._cacheCanvasBBox; else { var i = t.get("cacheCanvasBBox"), o = i && !(!i.width || !i.height), a = t.getCanvasBBox(), s = a && !(!a.width || !a.height); o && s ? ((r = a), (e = (n = i) && r ? { minX: Math.min(n.minX, r.minX), minY: Math.min(n.minY, r.minY), maxX: Math.max(n.maxX, r.maxX), maxY: Math.max(n.maxY, r.maxY), } : n || r)) : o ? (e = i) : s && (e = a); } return e; } var q = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.onCanvasChange = function (t) { z(this, t); }), (e.prototype.getShapeBase = function () { return r; }), (e.prototype.getGroupBase = function () { return e; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), D(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.cacheCanvasBBox = function () { var t = this.cfg.children, e = [], n = []; Object(a.each)(t, function (t) { var r = t.cfg.cacheCanvasBBox; r && t.cfg.isInView && (e.push(r.minX, r.maxX), n.push(r.minY, r.maxY)); }); var r = null; if (e.length) { var i = Math.min.apply(null, e), o = Math.max.apply(null, e), s = Math.min.apply(null, n), c = Math.max.apply(null, n); r = { minX: i, minY: s, x: i, y: s, maxX: o, maxY: c, width: o - i, height: c - s, }; var u = this.cfg.canvas; if (u) { var h = u.getViewRange(); this.set("isInView", d(r, h)); } } else this.set("isInView", !1); this.set("cacheCanvasBBox", r); }), (e.prototype.draw = function (t, e) { var n = this.cfg.children, r = !e || this.cfg.refresh; n.length && r && (t.save(), D(t, this), this._applyClip(t, this.getClip()), _(t, n, e), t.restore(), this.cacheCanvasBBox()), (this.cfg.refresh = null), this.set("hasChanged", !1); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("hasChanged", !1); }), e ); })(o.b), V = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { lineWidth: 1, lineAppendWidth: 0, strokeOpacity: 1, fillOpacity: 1, }); }), (e.prototype.getShapeBase = function () { return r; }), (e.prototype.getGroupBase = function () { return q; }), (e.prototype.onCanvasChange = function (t) { z(this, t); }), (e.prototype.calculateBBox = function () { var t = this.get("type"), e = this.getHitLineWidth(), n = Object(o.g)(t)(this), r = e / 2, i = n.x - r, a = n.y - r, s = n.x + n.width + r, c = n.y + n.height + r; return { x: i, minX: i, y: a, minY: a, width: n.width + e, height: n.height + e, maxX: s, maxY: c, }; }), (e.prototype.isFill = function () { return !!this.attrs.fill || this.isClipShape(); }), (e.prototype.isStroke = function () { return !!this.attrs.stroke; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), D(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.draw = function (t, e) { var n = this.cfg.clipShape; if (e) { if (!1 === this.cfg.refresh) return void this.set("hasChanged", !1); if (!d(e, this.getCanvasBBox())) return ( this.set("hasChanged", !1), void (this.cfg.isInView && this._afterDraw()) ); } t.save(), D(t, this), this._applyClip(t, n), this.drawPath(t), t.restore(), this._afterDraw(); }), (e.prototype.getCanvasViewBox = function () { var t = this.cfg.canvas; return t ? t.getViewRange() : null; }), (e.prototype.cacheCanvasBBox = function () { var t = this.getCanvasViewBox(); if (t) { var e = this.getCanvasBBox(), n = d(e, t); this.set("isInView", n), n ? this.set("cacheCanvasBBox", e) : this.set("cacheCanvasBBox", null); } }), (e.prototype._afterDraw = function () { this.cacheCanvasBBox(), this.set("hasChanged", !1), this.set("refresh", null); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("isInView", null), this.set("hasChanged", !1); }), (e.prototype.drawPath = function (t) { this.createPath(t), this.strokeAndFill(t), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { t.fill(); }), (e.prototype.stroke = function (t) { t.stroke(); }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, o = e.fillOpacity; this.isFill() && (Object(a.isNil)(o) || 1 === o ? this.fill(t) : ((t.globalAlpha = o), this.fill(t), (t.globalAlpha = r))), this.isStroke() && n > 0 && (Object(a.isNil)(i) || 1 === i || (t.globalAlpha = i), this.stroke(t)), this.afterDrawPath(t); }), (e.prototype.createPath = function (t) {}), (e.prototype.afterDrawPath = function (t) {}), (e.prototype.isInShape = function (t, e) { var n = this.isStroke(), r = this.isFill(), i = this.getHitLineWidth(); return this.isInStrokeOrPath(t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !1; }), (e.prototype.getHitLineWidth = function () { if (!this.isStroke()) return 0; var t = this.attrs; return t.lineWidth + t.lineAppendWidth; }), e ); })(o.c), G = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, r: 0 }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr(), a = o.x, s = o.y, c = o.r, u = i / 2, h = l(a, s, t, e); return r && n ? h <= c + u : r ? h <= c : !!n && h >= c - u && h <= c + u; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.r; t.beginPath(), t.arc(n, r, i, 0, 2 * Math.PI, !1), t.closePath(); }), e ); })(V); function H(t, e, n, r) { return t / (n * n) + e / (r * r); } var U = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, rx: 0, ry: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr(), a = i / 2, s = o.x, c = o.y, u = o.rx, h = o.ry, l = (t - s) * (t - s), f = (e - c) * (e - c); return r && n ? H(l, f, u + a, h + a) <= 1 : r ? H(l, f, u, h) <= 1 : !!n && H(l, f, u - a, h - a) >= 1 && H(l, f, u + a, h + a) <= 1; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; if ((t.beginPath(), t.ellipse)) t.ellipse(n, r, i, o, 0, 0, 2 * Math.PI, !1); else { var a = i > o ? i : o, s = i > o ? 1 : i / o, c = i > o ? o / i : 1; t.save(), t.translate(n, r), t.scale(s, c), t.arc(0, 0, a, 0, 2 * Math.PI), t.restore(), t.closePath(); } }), e ); })(V); function Z(t) { return ( t instanceof HTMLElement && Object(a.isString)(t.nodeName) && "CANVAS" === t.nodeName.toUpperCase() ); } var K = null; var $ = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, width: 0, height: 0, }); }), (e.prototype.initAttrs = function (t) { this._setImage(t.img); }), (e.prototype.isStroke = function () { return !1; }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._afterLoading = function () { if (!0 === this.get("toDraw")) { var t = this.get("canvas"); t ? t.draw() : this.createPath(this.get("context")); } }), (e.prototype._setImage = function (t) { var e = this, n = this.attrs; if ( !(null == K ? void 0 : K.isMini()) || (null == K ? void 0 : K.isMiniNative()) ) if (Object(a.isString)(t)) { var r = null; ((r = (null == K ? void 0 : K.isMiniNative()) ? null == K ? void 0 : K.get("container").createImage() : new Image()).onload = function () { if (e.destroyed) return !1; e.attr("img", r), e.set("loading", !1), e._afterLoading(); var t = e.get("callback"); t && t.call(e); }), (r.crossOrigin = "Anonymous"), (r.src = t), this.set("loading", !0); } else (null == K ? void 0 : K.isMiniNative()) || t instanceof Image ? (n.width || (n.width = t.width), n.height || (n.height = t.height)) : Z(t) && (n.width || (n.width = Number(t.getAttribute("width"))), n.height || (n.height, Number(t.getAttribute("height")))); else this.attr("img", t); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "img" === e && this._setImage(n); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.img, r = e.x, i = e.y, o = e.width, s = e.height, c = e.sx, u = e.sy, h = e.swidth, l = e.sheight; if (this.get("loading")) return this.set("toDraw", !0), void this.set("context", t); (null == K ? void 0 : K.isMini()) ? t.drawImage(n, r, i, o, s) : (n instanceof Image || Z(n)) && (Object(a.isNil)(c) || Object(a.isNil)(u) || Object(a.isNil)(h) || Object(a.isNil)(l) ? t.drawImage(n, r, i, o, s) : t.drawImage(n, c, u, h, l, r, i, o, s)); }), e ); })(V), Q = n(7); function J(t, e, n, r, i, o, a) { var s = Math.min(t, n), c = Math.max(t, n), u = Math.min(e, r), h = Math.max(e, r), l = i / 2; return ( o >= s - l && o <= c + l && a >= u - l && a <= h + l && Q.c.pointToLine(t, e, n, r, o, a) <= i / 2 ); } var tt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(); }), (e.prototype.setArrow = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2, o = t.startArrow, a = t.endArrow; o && N(this, t, r, i, e, n), a && B(this, t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { if (!n || !i) return !1; var o = this.attr(); return J(o.x1, o.y1, o.x2, o.y2, i, t, e); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = e.startArrow, s = e.endArrow, c = { dx: 0, dy: 0 }, u = { dx: 0, dy: 0 }; a && a.d && (c = T(n, r, i, o, e.startArrow.d)), s && s.d && (u = T(n, r, i, o, e.endArrow.d)), t.beginPath(), t.moveTo(n + c.dx, r + c.dy), t.lineTo(i - u.dx, o - u.dy); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2; return Q.c.length(e, n, r, i); }), (e.prototype.getPoint = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2; return Q.c.pointAt(n, r, i, o, t); }), e ); })(V), et = n(22), nt = { circle: function (t, e, n) { return [ ["M", t - n, e], ["A", n, n, 0, 1, 0, t + n, e], ["A", n, n, 0, 1, 0, t - n, e], ]; }, square: function (t, e, n) { return [ ["M", t - n, e - n], ["L", t + n, e - n], ["L", t + n, e + n], ["L", t - n, e + n], ["Z"], ]; }, diamond: function (t, e, n) { return [ ["M", t - n, e], ["L", t, e - n], ["L", t + n, e], ["L", t, e + n], ["Z"], ]; }, triangle: function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e + r], ["L", t, e - r], ["L", t + n, e + r], ["Z"], ]; }, "triangle-down": function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e - r], ["L", t + n, e - r], ["L", t, e + r], ["Z"], ]; }, }, rt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.initAttrs = function (t) { this._resetParamsCache(); }), (e.prototype._resetParamsCache = function () { this.set("paramsCache", {}); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), -1 !== ["symbol", "x", "y", "r", "radius"].indexOf(e) && this._resetParamsCache(); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._getR = function (t) { return Object(a.isNil)(t.r) ? t.radius : t.r; }), (e.prototype._getPath = function () { var t, n, r = this.attr(), i = r.x, o = r.y, s = r.symbol || "circle", c = this._getR(r); if (Object(a.isFunction)(s)) (n = (t = s)(i, o, c)), (n = Object(et.c)(n)); else { if (!(t = e.Symbols[s])) return console.warn(s + " marker is not supported."), null; n = t(i, o, c); } return n; }), (e.prototype.createPath = function (t) { X(this, t, { path: this._getPath() }, this.get("paramsCache")); }), (e.Symbols = nt), e ); })(V); function it(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } function ot(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } function at(t, e, n) { var r = !1, i = t.length; if (i <= 2) return !1; for (var o = 0; o < i; o++) { var a = t[o], s = t[(o + 1) % i]; if (ot(a, s, [e, n])) return !0; it(a[1] - n) > 0 != it(s[1] - n) > 0 && it(e - ((n - a[1]) * (a[0] - s[0])) / (a[1] - s[1]) - a[0]) < 0 && (r = !r); } return r; } var st = n(3), ct = n(72); function ut(t, e, n, r, i, o, a, s) { var c = (Math.atan2(s - e, a - t) + 2 * Math.PI) % (2 * Math.PI); if (c < r || c > i) return !1; var u = { x: t + n * Math.cos(c), y: e + n * Math.sin(c) }; return l(u.x, u.y, a, s) <= o / 2; } var ht = st.a.transform; var lt = Object(i.a)( { hasArc: function (t) { for (var e = !1, n = t.length, r = 0; r < n; r++) { var i = t[r][0]; if ("C" === i || "A" === i || "Q" === i) { e = !0; break; } } return e; }, extractPolygons: function (t) { for (var e = t.length, n = [], r = [], i = [], o = 0; o < e; o++) { var a = t[o], s = a[0]; "M" === s ? (i.length && (r.push(i), (i = [])), i.push([a[1], a[2]])) : "Z" === s ? i.length && (n.push(i), (i = [])) : i.push([a[1], a[2]]); } return i.length > 0 && r.push(i), { polygons: n, polylines: r }; }, isPointInStroke: function (t, e, n, r, i) { for (var o = !1, a = e / 2, s = 0; s < t.length; s++) { var c = t[s], u = c.currentPoint, h = c.params, l = c.prePoint, d = c.box; if (!d || f(d.x - a, d.y - a, d.width + e, d.height + e, n, r)) { switch (c.command) { case "L": case "Z": o = J(l[0], l[1], u[0], u[1], e, n, r); break; case "Q": o = Q.e.pointDistance( l[0], l[1], h[1], h[2], h[3], h[4], n, r, ) <= e / 2; break; case "C": o = Q.b.pointDistance( l[0], l[1], h[1], h[2], h[3], h[4], h[5], h[6], n, r, i, ) <= e / 2; break; case "A": var p = c.arcParams, g = p.cx, v = p.cy, y = p.rx, m = p.ry, b = p.startAngle, x = p.endAngle, w = p.xRotation, S = [n, r, 1], O = y > m ? y : m, M = ht(null, [ ["t", -g, -v], ["r", -w], ["s", 1 / (y > m ? 1 : y / m), 1 / (y > m ? m / y : 1)], ]); ct.transformMat3(S, S, M), (o = ut(0, 0, O, b, x, e, S[0], S[1])); } if (o) break; } } return o; }, }, o.e, ); function ft(t, e, n) { for (var r = !1, i = 0; i < t.length; i++) { if ((r = at(t[i], e, n))) break; } return r; } var dt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this._setPathArr(t.path), this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "path" === e && this._setPathArr(n), this.setArrow(); }), (e.prototype._setPathArr = function (t) { this.attrs.path = Object(et.c)(t); var e = lt.hasArc(t); this.set("hasArc", e), this.set("paramsCache", {}), this.set("segments", null), this.set("curve", null), this.set("tCache", null), this.set("totalLength", null); }), (e.prototype.getSegments = function () { var t = this.get("segements"); return ( t || ((t = Object(et.d)(this.attr("path"))), this.set("segments", t)), t ); }), (e.prototype.setArrow = function () { var t, e = this.attr(), n = e.startArrow, r = e.endArrow; n && N( this, e, (t = this.getStartTangent())[0][0], t[0][1], t[1][0], t[1][1], ); r && B( this, e, (t = this.getEndTangent())[0][0], t[0][1], t[1][0], t[1][1], ); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.getSegments(), a = (this.get("hasArc"), !1); if (n) { var s = this.getTotalLength(); a = lt.isPointInStroke(o, i, t, e, s); } if (!a && r) { var c = this.attr("path"), u = lt.extractPolygons(c); a = ft(u.polygons, t, e) || ft(u.polylines, t, e); } return a; }), (e.prototype.createPath = function (t) { X(this, t, this.attr(), this.get("paramsCache")); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.get("totalLength"); return Object(a.isNil)(t) ? (this._calculateCurve(), this._setTcache(), this.get("totalLength")) : t; }), (e.prototype.getPoint = function (t) { var e, n, r = this.get("tCache"); r || (this._calculateCurve(), this._setTcache(), (r = this.get("tCache"))); var i = this.get("curve"); if (!r || 0 === r.length) return i ? { x: i[0][1], y: i[0][2] } : null; Object(a.each)(r, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }); var o = i[n]; if (Object(a.isNil)(o) || Object(a.isNil)(n)) return null; var s = o.length, c = i[n + 1]; return Q.b.pointAt( o[s - 2], o[s - 1], c[1], c[2], c[3], c[4], c[5], c[6], e, ); }), (e.prototype._calculateCurve = function () { var t = this.attr().path; this.set("curve", lt.pathToCurve(t)); }), (e.prototype._setTcache = function () { var t, e, n, r, i = 0, o = 0, s = [], c = this.get("curve"); c && (Object(a.each)(c, function (t, e) { (n = c[e + 1]), (r = t.length), n && (i += Q.b.length( t[r - 2], t[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], ) || 0); }), this.set("totalLength", i), 0 !== i ? (Object(a.each)(c, function (a, u) { (n = c[u + 1]), (r = a.length), n && (((t = [])[0] = o / i), (e = Q.b.length( a[r - 2], a[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], )), (o += e || 0), (t[1] = o / i), s.push(t)); }), this.set("tCache", s)) : this.set("tCache", [])); }), (e.prototype.getStartTangent = function () { var t, e = this.getSegments(); if (e.length > 1) { var n = e[0].currentPoint, r = e[1].currentPoint, i = e[1].startTangent; (t = []), i ? (t.push([n[0] - i[0], n[1] - i[1]]), t.push([n[0], n[1]])) : (t.push([r[0], r[1]]), t.push([n[0], n[1]])); } return t; }), (e.prototype.getEndTangent = function () { var t, e = this.getSegments(), n = e.length; if (n > 1) { var r = e[n - 2].currentPoint, i = e[n - 1].currentPoint, o = e[n - 1].endTangent; (t = []), o ? (t.push([i[0] - o[0], i[1] - o[1]]), t.push([i[0], i[1]])) : (t.push([r[0], r[1]]), t.push([i[0], i[1]])); } return t; }), e ); })(V); function pt(t, e, n, r, i) { var o = t.length; if (o < 2) return !1; for (var a = 0; a < o - 1; a++) { if (J(t[a][0], t[a][1], t[a + 1][0], t[a + 1][1], e, n, r)) return !0; } if (i) { var s = t[0], c = t[o - 1]; if (J(s[0], s[1], c[0], c[1], e, n, r)) return !0; } return !1; } var gt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr().points, a = !1; return ( n && (a = pt(o, i, t, e, !0)), !a && r && (a = at(o, t, e)), a ); }), (e.prototype.createPath = function (t) { var e = this.attr().points; if (!(e.length < 2)) { t.beginPath(); for (var n = 0; n < e.length; n++) { var r = e[n]; 0 === n ? t.moveTo(r[0], r[1]) : t.lineTo(r[0], r[1]); } t.closePath(); } }), e ); })(V), vt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(), -1 !== ["points"].indexOf(e) && this._resetCache(); }), (e.prototype._resetCache = function () { this.set("totalLength", null), this.set("tCache", null); }), (e.prototype.setArrow = function () { var t = this.attr(), e = this.attrs, n = e.points, r = e.startArrow, i = e.endArrow, o = n.length, a = n[0][0], s = n[0][1], c = n[o - 1][0], u = n[o - 1][1]; r && N(this, t, n[1][0], n[1][1], a, s), i && B(this, t, n[o - 2][0], n[o - 2][1], c, u); }), (e.prototype.isFill = function () { return !1; }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !(!n || !i) && pt(this.attr().points, i, t, e, !1); }), (e.prototype.isStroke = function () { return !0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.points, r = e.startArrow, i = e.endArrow, o = n.length; if (!(n.length < 2)) { var a, s = n[0][0], c = n[0][1], u = n[o - 1][0], h = n[o - 1][1]; if (r && r.d) (s += (a = T(s, c, n[1][0], n[1][1], r.d)).dx), (c += a.dy); if (i && i.d) (u -= (a = T(n[o - 2][0], n[o - 2][1], u, h, i.d)).dx), (h -= a.dy); t.beginPath(), t.moveTo(s, c); for (var l = 0; l < o - 1; l++) { var f = n[l]; t.lineTo(f[0], f[1]); } t.lineTo(u, h); } }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr().points, e = this.get("totalLength"); return Object(a.isNil)(e) ? (this.set("totalLength", Q.d.length(t)), this.get("totalLength")) : e; }), (e.prototype.getPoint = function (t) { var e, n, r = this.attr().points, i = this.get("tCache"); return ( i || (this._setTcache(), (i = this.get("tCache"))), Object(a.each)(i, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }), Q.c.pointAt(r[n][0], r[n][1], r[n + 1][0], r[n + 1][1], e) ); }), (e.prototype._setTcache = function () { var t = this.attr().points; if (t && 0 !== t.length) { var e = this.getTotalLength(); if (!(e <= 0)) { var n, r, i = 0, o = []; Object(a.each)(t, function (a, s) { t[s + 1] && (((n = [])[0] = i / e), (r = Q.c.length(a[0], a[1], t[s + 1][0], t[s + 1][1])), (i += r), (n[1] = i / e), o.push(n)); }), this.set("tCache", o); } } }), (e.prototype.getStartTangent = function () { var t = this.attr().points, e = []; return e.push([t[1][0], t[1][1]]), e.push([t[0][0], t[0][1]]), e; }), (e.prototype.getEndTangent = function () { var t = this.attr().points, e = t.length - 1, n = []; return ( n.push([t[e - 1][0], t[e - 1][1]]), n.push([t[e][0], t[e][1]]), n ); }), e ); })(V); var yt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, width: 0, height: 0, radius: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr(), a = o.x, s = o.y, c = o.width, u = o.height, h = o.radius; if (h) { var l = !1; return ( n && (l = (function (t, e, n, r, i, o, a, s) { return ( J(t + i, e, t + n - i, e, o, a, s) || J(t + n, e + i, t + n, e + r - i, o, a, s) || J(t + n - i, e + r, t + i, e + r, o, a, s) || J(t, e + r - i, t, e + i, o, a, s) || ut( t + n - i, e + i, i, 1.5 * Math.PI, 2 * Math.PI, o, a, s, ) || ut( t + n - i, e + r - i, i, 0, 0.5 * Math.PI, o, a, s, ) || ut( t + i, e + r - i, i, 0.5 * Math.PI, Math.PI, o, a, s, ) || ut(t + i, e + i, i, Math.PI, 1.5 * Math.PI, o, a, s) ); })(a, s, c, u, h, i, t, e)), !l && r && (l = f(a, s, c, u, t, e)), l ); } var d = i / 2; return r && n ? f(a - d, s - d, c + d, u + d, t, e) : r ? f(a, s, c, u, t, e) : n ? (function (t, e, n, r, i, o, a) { var s = i / 2; return ( f(t - s, e - s, n, i, o, a) || f(t + n - s, e - s, i, r, o, a) || f(t + s, e + r - s, n, i, o, a) || f(t - s, e + s, i, r, o, a) ); })(a, s, c, u, i, t, e) : void 0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.width, o = e.height, s = e.radius; if ((t.beginPath(), 0 === s)) t.rect(n, r, i, o); else { var c = (function (t) { var e = 0, n = 0, r = 0, i = 0; return ( Object(a.isArray)(t) ? 1 === t.length ? (e = n = r = i = t[0]) : 2 === t.length ? ((e = r = t[0]), (n = i = t[1])) : 3 === t.length ? ((e = t[0]), (n = i = t[1]), (r = t[2])) : ((e = t[0]), (n = t[1]), (r = t[2]), (i = t[3])) : (e = n = r = i = t), [e, n, r, i] ); })(s), u = c[0], h = c[1], l = c[2], f = c[3]; t.moveTo(n + u, r), t.lineTo(n + i - h, r), 0 !== h && t.arc(n + i - h, r + h, h, -Math.PI / 2, 0), t.lineTo(n + i, r + o - l), 0 !== l && t.arc(n + i - l, r + o - l, l, 0, Math.PI / 2), t.lineTo(n + f, r + o), 0 !== f && t.arc(n + f, r + o - f, f, Math.PI / 2, Math.PI), t.lineTo(n, r + u), 0 !== u && t.arc(n + u, r + u, u, Math.PI, 1.5 * Math.PI), t.closePath(); } }), e ); })(V), mt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: "sans-serif", fontStyle: "normal", fontWeight: "normal", fontVariant: "normal", textAlign: "start", textBaseline: "bottom", }); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype.initAttrs = function (t) { this._assembleFont(), t.text && this._setText(t.text); }), (e.prototype._assembleFont = function () { var t = this.attrs; t.font = Object(o.f)(t); }), (e.prototype._setText = function (t) { var e = null; Object(a.isString)(t) && -1 !== t.indexOf("\n") && (e = t.split("\n")), this.set("textArr", e); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), e.startsWith("font") && this._assembleFont(), "text" === e && this._setText(n); }), (e.prototype._getSpaceingY = function () { var t = this.attrs, e = t.lineHeight, n = 1 * t.fontSize; return e ? e - n : 0.14 * n; }), (e.prototype._drawTextArr = function (t, e, n) { var r, i = this.attrs, s = i.textBaseline, c = i.x, u = i.y, h = 1 * i.fontSize, l = this._getSpaceingY(), f = Object(o.h)(i.text, i.fontSize, i.lineHeight); Object(a.each)(e, function (e, i) { (r = u + i * (l + h) - f + h), "middle" === s && (r += f - h - (f - h) / 2), "top" === s && (r += f - h), n ? t.fillText(e, c, r) : t.strokeText(e, c, r); }); }), (e.prototype._drawText = function (t, e) { var n = this.attr(), r = n.x, i = n.y, o = this.get("textArr"); if (o) this._drawTextArr(t, o, e); else { var a = n.text; e ? t.fillText(a, r, i) : t.strokeText(a, r, i); } }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, o = e.fillOpacity; this.isStroke() && n > 0 && (Object(a.isNil)(i) || 1 === i || (t.globalAlpha = r), this.stroke(t)), this.isFill() && (Object(a.isNil)(o) || 1 === o ? this.fill(t) : ((t.globalAlpha = o), this.fill(t), (t.globalAlpha = r))), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { this._drawText(t, !0); }), (e.prototype.stroke = function (t) { this._drawText(t, !1); }), e ); })(V); function bt(t, e, n) { var r = t.getTotalMatrix(); if (r) { var i = (function (t, e) { if (e) { var n = Object(o.i)(e); return Object(o.k)(n, t); } return t; })([e, n, 1], r); return [i[0], i[1]]; } return [e, n]; } function xt(t, e, n) { if (t.isCanvas && t.isCanvas()) return !0; if (!Object(o.j)(t) || !1 === t.cfg.isInView) return !1; if (t.cfg.clipShape) { var r = bt(t, e, n), i = r[0], a = r[1]; if (t.isClipped(i, a)) return !1; } var s = t.cfg.cacheCanvasBBox || t.getCanvasBBox(); return e >= s.minX && e <= s.maxX && n >= s.minY && n <= s.maxY; } var wt = n(30), St = n.n(wt); function Ot(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function Mt(t, e, n) { if (n.bubbles) { t.isCanvas(), 0, (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var kt = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.panstartShape = null), (this.panstartPoint = null), (this.handleEvent = function (t) { e.hammerRuntime.emit("origin_input:" + t.type, t); }), (this.canvas = t.canvas), this._initEvent(); } return ( (t.prototype._initEvent = function () { var t = this; (this.hammerRuntime = new St.a( {}, { inputClass: wt.TouchInput }, )), this.hammerRuntime.add( new St.a.Pan({ threshold: 0, pointers: 1 }), ), this.hammerRuntime .add(new St.a.Swipe()) .recognizeWith(this.hammerRuntime.get("pan")), this.hammerRuntime.add( new St.a.Pinch({ threshold: 0, pointers: 2 }), ), this.hammerRuntime.add( new St.a.Tap({ event: "dbltap", taps: 2 }), ), this.hammerRuntime.add(new St.a.Tap()), this.hammerRuntime.add(new St.a.Press({ time: 500 })), this.hammerRuntime.on( "panstart panmove panend pancancel", function (e) { e.srcEvent.extra = e; var n = t._getPointInfo(e), r = t._getShape(n, e); ("panend" !== e.type && "pancancel" !== e.type) || t._onpanend(n, r, e), "panstart" === e.type && (t.dragging && ((t.draggingShape = null), (t.dragging = !1), (t.panstartShape = null), (t.panstartPoint = null)), t._onpanstart(n, r, e)), "panmove" === e.type && t._onpanmove(n, r, e), (t.currentShape = r); }, ), this.hammerRuntime.on( "tap dbltap press swipe rotatestart rotatemove", function (e) { t._emitMobileEvent(e.type, e); }, ), this.hammerRuntime.on( "pinchstart pinchmove pinchend pinchcancel", function (e) { "pinchend" !== e.type && "pinchcancel" !== e.type ? ((e.srcEvent.extra = { scale: e.scale }), t._emitMobileEvent(e.type, e)) : t._emitMobileEvent(e.type, e); }, ); }), (t.prototype._emitMobileEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e); this._emitEvent(t, e, n, r); }), (t.prototype._getEventObj = function (t, e, n, r, i, a) { var s = new o.d(t, e); return ( (s.fromShape = i), (s.toShape = a), (s.x = n.x), (s.y = n.y), (s.clientX = n.clientX), (s.clientY = n.clientY), s.propagationPath.push(r), s ); }), (t.prototype._getShape = function (t, e) { var n = e.srcEvent; return this.canvas.getShape(t.x, t.y, n); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t]; if (i) i.call(this, n, r, e); else { var o = this.currentShape; "panstart" === t || "dragenter" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "panstart" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "panend" === t || "dragleave" === t ? (o && this._emitEvent(t, e, n, o, o, null), this._emitEvent(t, e, n, null, o, null), "panend" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } }), (t.prototype._onpanstart = function (t, e, n) { (this.panstartShape = e), (this.panstartPoint = t), (this.panstartTimeStamp = n.timeStamp), this._emitEvent("panstart", n, t, e, null, null); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); this.currentShape = r; }), (t.prototype._onpanend = function (t, e, n) { var r = this.draggingShape; this.dragging && (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)), this._emitEvent("panend", n, t, e), (this.panstartShape = null), (this.panstartPoint = null); }), (t.prototype._onpanmove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.panstartPoint; if (a) { var s = this.panstartShape, c = n.timeStamp - this.panstartTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; (c > 120 || u * u + h * h > 40) && (s && s.get("draggable") ? ((o = this.panstartShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.panstartShape = null), (this.panstartPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.panstartShape = null), (this.panstartPoint = null)) : this._emitEvent("panmove", n, t, e)); } } this._emitEvent("panmove", n, t, e); }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), Ot(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || Mt(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { Ot(this.canvas, t, a); } }), (t.prototype.destroy = function () { (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.panstartPoint = null), (this.panstartShape = null), (this.panstartTimeStamp = null); }), t ); })(), Ct = (function () { function t() {} return ( (t.prototype.set = function (t, e, n) { switch (e) { case "strokeStyle": t.setStrokeStyle(n); break; case "fillStyle": t.setFillStyle(n); break; case "lineWidth": t.setLineWidth(n); break; case "lineDash": t.setLineDash(n); break; case "globalAlpha": (n || 0 === n) && ((t.globalAlpha = n), t.setGlobalAlpha(n)); break; case "fontSize": t.setFontSize(n); break; case "textAlign": t.setTextAlign(n); break; case "fontStyle": case "font": t.setFont(n); break; case "textBaseline": t.setTextBaseline(n); break; default: t[e] = n; } return !0; }), (t.prototype.get = function (t, e) { return "globalAlpha" === e && void 0 === t[e] ? 1 : "function" == typeof t[e] ? t[e].bind(t) : t[e]; }), t ); })(), Et = n(98), jt = null; var Pt = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, s = e.lineHeight, c = e.font; c || (c = Object(Et.assembleFont)(e)); var u, h = (function (t, e) { var n = 0; if (Object(a.isNil)(t) || "" === t) return n; if ( (jt.save(), (jt.font = e), Object(a.isString)(t) && t.includes("\n")) ) { var r = t.split("\n"); Object(a.each)(r, function (t) { var e = jt.measureText(t).width; n < e && (n = e); }); } else n = jt.measureText(t).width; return jt.restore(), n; })(i, c); if (h) { var l = e.textAlign, f = e.textBaseline, d = Object(Et.getTextHeight)(i, o, s), p = { x: n, y: r - d }; l && ("end" === l || "right" === l ? (p.x -= h) : "center" === l && (p.x -= h / 2)), f && ("top" === f ? (p.y += d) : "middle" === f && (p.y += d / 2)), (u = { x: p.x, y: p.y, width: h, height: d }); } else u = { x: n, y: r, width: 0, height: 0 }; return u; }, At = function (t) { (jt = t), Object(o.l)("text", Pt); }, It = function (t, e) { !(function (t) { K = t; })(e), At(t); }, Tt = (function (t) { function e(e) { var n, r = t.call(this, e) || this, i = r.get("context"); return ( r.isMini() && (r.isMiniNative() ? (void 0 === (n = r.get("container")) && (n = {}), (n = n)) : r.set("context", new Proxy(i, new Ct())), It(i, r)), r ); } return ( Object(i.c)(e, t), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return ( (e.renderer = "canvas"), (e.autoDraw = !0), (e.localRefresh = !0), (e.refreshElements = []), (e.clipView = !0), (e.quickHit = !1), (e.boundingClientRect = { width: 0, height: 0, left: 0, top: 0, bottom: 0, right: 0, }), e ); }), (e.prototype.initEvents = function () { var t = new kt({ canvas: this }); this.set("eventController", t); }), (e.prototype.registerEventCallback = function (t) { this.get("eventController").handleEvent(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.onCanvasChange = function (t) { ("attr" !== t && "sort" !== t && "changeSize" !== t) || (this.set("refreshElements", [this]), this.draw()); }), (e.prototype.getShapeBase = function () { return r; }), (e.prototype.getGroupBase = function () { return q; }), (e.prototype.getPixelRatio = function () { var t = this.get("pixelRatio") || ("object" === ("undefined" == typeof window ? "undefined" : h(window)) && window.devicePixelRatio ? window.devicePixelRatio : 1); return t >= 1 ? Math.ceil(t) : 1; }), (e.prototype.getViewRange = function () { return { minX: 0, minY: 0, maxX: this.cfg.width, maxY: this.cfg.height, }; }), (e.prototype.initDom = function () { if (this.isMini()) { var e = this.get("context"), n = this.getPixelRatio(); n > 1 && e.scale(n, n); } else t.prototype.initDom.call(this); }), (e.prototype.createDom = function () { var t = document.createElement("canvas"), e = t.getContext("2d"); return this.set("context", e), t; }), (e.prototype.setDOMSize = function (e, n) { t.prototype.setDOMSize.call(this, e, n); var r = this.get("context"), i = this.get("el"), o = this.getPixelRatio(); (i.width = o * e), (i.height = o * n), o > 1 && r.scale(o, o); }), (e.prototype.clear = function () { t.prototype.clear.call(this), this._clearFrame(), this.get("context").clearRect( 0, 0, this.get("width"), this.get("height"), ); }), (e.prototype.getShape = function (e, n) { return this.get("quickHit") ? (function t(e, n, r) { if (!xt(e, n, r)) return null; for ( var i = null, o = e.getChildren(), a = o.length - 1; a >= 0; a-- ) { var s = o[a]; if (s.isGroup()) i = t(s, n, r); else if (xt(s, n, r)) { var c = s, u = bt(s, n, r), h = u[0], l = u[1]; c.isInShape(h, l) && (i = s); } if (i) break; } return i; })(this, e, n) : t.prototype.getShape.call(this, e, n, null); }), (e.prototype._getRefreshRegion = function () { var t, e = this.get("refreshElements"), n = this.getViewRange(); e.length && e[0] === this ? (t = n) : (t = (function (t) { if (!t.length) return null; var e = [], n = [], r = [], i = []; return ( Object(a.each)(t, function (t) { var o = W(t); o && (e.push(o.minX), n.push(o.minY), r.push(o.maxX), i.push(o.maxY)); }), { minX: Math.min.apply(null, e), minY: Math.min.apply(null, n), maxX: Math.max.apply(null, r), maxY: Math.max.apply(null, i), } ); })(e)) && ((t.minX = Math.floor(t.minX)), (t.minY = Math.floor(t.minY)), (t.maxX = Math.ceil(t.maxX)), (t.maxY = Math.ceil(t.maxY)), (t.maxY += 1), this.get("clipView") && (t = (function (t, e) { return t && e && d(t, e) ? { minX: Math.max(t.minX, e.minX), minY: Math.max(t.minY, e.minY), maxX: Math.min(t.maxX, e.maxX), maxY: Math.min(t.maxY, e.maxY), } : null; })(t, n))); return t; }), (e.prototype._clearFrame = function () { var t = this.get("drawFrame"); t && (u(t), this.set("drawFrame", null), this.set("refreshElements", [])); }), (e.prototype.draw = function () { var t = this.get("drawFrame"); (this.get("autoDraw") && t) || this._startDraw(); }), (e.prototype._startDraw = function () { var t, e = this, n = this.get("drawFrame"); n || ((t = function () { e.get("localRefresh") ? e._drawRegion() : e._drawAll(), u(n), e.set("drawFrame", null); }), (n = (null == c ? void 0 : c.requestAnimationFrame) ? c.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : s(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t)), this.set("drawFrame", n)); }), (e.prototype._drawRegion = function () { var t = this.get("context"), e = this.get("refreshElements"), n = this.getChildren(), r = this._getRefreshRegion(); r ? (t.clearRect( r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY, ), t.save(), t.beginPath(), t.rect(r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY), t.clip(), D(t, this), R(this, n, r), _(t, n, r), t.restore()) : e.length && (function t(e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.cfg.hasChanged = !1), r.isGroup() && !r.destroyed && t(r.cfg.children); } })(e), Object(a.each)(e, function (t) { t.get("hasChanged") && t.set("hasChanged", !1); }), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype._drawAll = function () { var t = this.get("context"), e = this.getChildren(); t.clearRect(0, 0, this.get("width"), this.get("height")), D(t, this), _(t, e), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype.skipDraw = function () {}), (e.prototype.refreshElement = function (t) { this.get("refreshElements").push(t); }), (e.prototype.getPointByEvent = function (e) { if (this.isMini()) { var n = this.getClientByEvent(e), r = n.x, i = n.y; return this.getPointByClient(r, i); } return t.prototype.getPointByEvent.call(this, e); }), (e.prototype.getClientByEvent = function (t) { var e = t.srcEvent, n = null; return ( e.touches && (n = "touchend" === e.type ? e.changedTouches[0] : e.touches[0]), n ? { x: n.clientX, y: n.clientY } : {} ); }), (e.prototype.getPointByClient = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t - r.left, y: e - r.top }; }), (e.prototype.removeDom = function () { this.isMini() || t.prototype.removeDom.call(this); }), (e.prototype.getClientByPoint = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t + r.left, y: e + r.top }; }), e ); })(o.a), Nt = n(4); var Bt = n(2), Lt = n(18), Dt = Bt.h.cloneEvent, _t = Bt.h.isViewportChanged, Rt = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.extendEvents = []), (n.dragging = !1), (n.preItem = null), (n.graph = e), (n.destroyed = !1), n ); } return ( Object(i.c)(e, t), (e.prototype.initEvents = function () { var t = this.graph, e = (this.extendEvents, t.get("canvas")); (this.canvasHandler = Object(a.wrapBehavior)( this, "onCanvasEvents", )), e.off("*").on("*", this.canvasHandler); }), (e.getItemRoot = function (t) { for (; t && !t.get("item"); ) t = t.get("parent"); return t; }), (e.prototype.onCanvasEvents = function (t) { var n = this.graph, r = n.get("canvas"), i = t.target, o = t.type; (t.canvasX = t.x), (t.canvasY = t.y); var a = { x: t.canvasX, y: t.canvasY }, s = n.get("group").getMatrix(); if ( (s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), _t(s) && (a = n.getPointByClient(t.clientX, t.clientY)), (t.x = a.x), (t.y = a.y), (t.currentTarget = n), i === r) ) return ( "panmove" === o && this.handleTouchMove(t, "canvas"), (t.target = r), (t.item = null), n.emit(o, t), void n.emit("canvas:" + o, t) ); var c = e.getItemRoot(i); if (c) { var u = c.get("item"); if (!u.destroyed) { var h = u.getType(); if ( ((t.target = i), (t.item = u), t.canvasX === t.x && t.canvasY === t.y) ) { var l = n.getCanvasByPoint(t.x, t.y); (t.canvasX = l.x), (t.canvasY = l.y); } n.emit(o, t), t.name && !t.name.includes(":") ? n.emit(h + ":" + o, t) : n.emit(t.name, t), "dragstart" === o && (this.dragging = !0), "dragend" === o && (this.dragging = !1), "panmove" === o && this.handleTouchMove(t, h); } } else n.emit(o, t); }), (e.prototype.onExtendEvents = function (t) { this.graph.emit(t.type, t); }), (e.prototype.emitCustomEvent = function (t, e, n) { (n.type = e), this.graph.emit(t + ":" + e, n); }), (e.prototype.destroy = function () { var t = this.graph, e = this.canvasHandler, n = this.extendEvents; t.get("canvas").off("*", e), Object(a.each)(n, function (t) { t.remove(); }), (this.dragging = !1), (this.preItem = null), (this.extendEvents.length = 0), (this.canvasHandler = null), (this.destroyed = !0); }), (e.prototype.handleTouchMove = function (t, e) { var n = this.graph, r = this.preItem, i = n.get("canvas"), o = t.target === i ? null : t.item; (t = Dt(t)), r && r !== o && !r.destroyed && ((t.item = r), this.emitCustomEvent(r.getType(), "touchleave", t), this.dragging && this.emitCustomEvent(r.getType(), "dragleave", t)), o && r !== o && ((t.item = o), this.emitCustomEvent(e, "touchenter", t), this.dragging && this.emitCustomEvent(e, "dragenter", t)), (this.preItem = o); }), e ); })(Bt.a), Ft = n(26), Yt = ["force", "grid", "circular"], Xt = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.graph = e), (n.layoutCfg = e.get("layout") || {}), (n.layoutType = n.getLayoutType()), n ); } return ( Object(i.c)(e, t), (e.prototype.updateLayoutCfg = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = Object(a.mix)({}, this.layoutCfg, t); if (((this.layoutCfg = i), null == r ? void 0 : r.length)) { (this.data = this.setDataFromGraph()), n.emit("beforelayout"); var o = Promise.resolve(); 1 === r.length ? (o = o.then(function () { return e.updateLayoutMethod(r[0], i); })) : null == r || r.forEach(function (t, n) { var r = i.pipes[n]; o = o.then(function () { return e.updateLayoutMethod(t, r); }); }), (this.data = this.setDataFromGraph()), o .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("layout failed", t); }); } else this.layout(); }), (e.prototype.layout = function (t) { var e = this, n = this.graph; this.data = this.setDataFromGraph(); var r = this.data, o = r.nodes, a = r.hiddenNodes; if (!o) return !1; var s = n.get("width"), c = n.get("height"), u = {}; Object.assign( u, { width: s, height: c, center: [s / 2, c / 2] }, this.layoutCfg, ), (this.layoutCfg = u), this.destoryLayoutMethods(), n.emit("beforelayout"), this.initPositions(u.center, o), this.initPositions(u.center, a); var h = u.onLayoutEnd, l = u.layoutEndFormatted, f = u.adjust; l || ((u.layoutEndFormatted = !0), (u.onAllLayoutEnd = function () { return Object(i.b)(e, void 0, void 0, function () { return Object(i.d)(this, function (t) { switch (t.label) { case 0: return ( h && h(), this.refreshLayout(), f && u.pipes ? [4, this.adjustPipesBox(this.data, f)] : [3, 2] ); case 1: t.sent(), this.refreshLayout(), (t.label = 2); case 2: return n.emit("afterlayout"), [2]; } }); }); })); var d = Promise.resolve(); return ( u.type ? (d = d.then(function () { return e.execLayoutMethod(u, 0); })) : u.pipes && u.pipes.forEach(function (t, n) { d = d.then(function () { return e.execLayoutMethod(t, n); }); }), d .then(function () { u.onAllLayoutEnd && u.onAllLayoutEnd(), t && t(); }) .catch(function (t) { console.warn("graph layout failed,", t); }), !1 ); }), (e.prototype.execLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = t.type; if ( ((t.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), "force" === a || "g6force" === a || "gForce" === a) ) { var s = t.onTick, c = function () { s && s(), o.refreshPositions(); }; t.tick = c; } else "comboForce" === t.type && (t.comboTrees = o.get("comboTrees")); var u; try { u = new Ft.a(t); } catch (t) { console.warn( "The layout method: '" + a + "' does not exist! Please specify it first.", ), i(); } if (u.enableTick) { var h = t.onTick; c = function () { h && h(), o.refreshPositions(); }; u.tick = c; } var l = n.filterLayoutData(n.data, t); !(function (t, e) { var n; if ( !(null === (n = null == t ? void 0 : t.nodes) || void 0 === n ? void 0 : n.length) ) return; t.nodes.forEach(function (t) { t.layoutOrder = e; }); })(l, e), u.init(l), o.emit("beforesublayout", { type: a }), u.execute(), u.isCustomLayout && t.onLayoutEnd && t.onLayoutEnd(), n.layoutMethods.push(u); }); }), (e.prototype.updateLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }; var s = n.filterLayoutData(n.data, e); t.init(s), t.updateCfg(e), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (e.prototype.adjustPipesBox = function (t, e) { var n = this; return new Promise(function (r) { var i = t.nodes; (null == i ? void 0 : i.length) || r(), Yt.includes(e) || (console.warn( "The adjust type " + e + " is not supported yet, please assign it with 'force', 'grid', or 'circular'.", ), r()); var o = { center: n.layoutCfg.center, nodeSize: function (t) { return Math.max(t.height, t.width); }, preventOverlap: !0, onLayoutEnd: function () {}, }, s = n.getLayoutBBox(i), c = s.groupNodes, u = s.layoutNodes, h = Object(a.clone)(u); (o.onLayoutEnd = function () { null == u || u.forEach(function (t, e) { var n, r, i, o = t.x - (null === (n = h[e]) || void 0 === n ? void 0 : n.x), a = t.y - (null === (r = h[e]) || void 0 === r ? void 0 : r.y); null === (i = c[e]) || void 0 === i || i.forEach(function (t) { (t.x += o), (t.y += a); }); }), r(); }), new Ft.a(o).layout({ nodes: u }); }); }), (e.prototype.destroy = function () { this.destoryLayoutMethods(), (this.destroyed = !0), this.graph.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0), (this.graph = null); }), e ); })(Bt.c); var zt = n(43), Wt = function (t, e, n) { return ( n[t] && console.warn( "The graph with the name " + t + " exists already, it will be overridden", ), (n[t] = e(n)), n ); }, qt = (function (t) { function e(e) { var n = t.call(this, e) || this; n.get("renderer").startsWith("mini") && n.set("context", e.context), t.prototype.init.call(n); var r = n.get("defaultNode"); return ( r || n.set("defaultNode", { type: "circle" }), r.type || ((r.type = "circle"), n.set("defaultNode", r)), (n.destroyed = !1), n ); } return ( Object(i.c)(e, t), (e.prototype.init = function () {}), (e.prototype.emitEvent = function (t) { var e = this.get("canvas"); (t.type = t.type.toLowerCase()), e.registerEventCallback(t); }), (e.prototype.initLayoutController = function () { var t = new Xt(this); this.set({ layoutController: t }); }), (e.prototype.initEventController = function () { var t = new Rt(this); if ( (this.set({ eventController: t }), !this.get("renderer").startsWith("mini")) ) { var e = this.get("canvas"), n = e.get("el"); "touchstart touchmove touchend touchcancel" .split(" ") .forEach(function (t) { n.addEventListener(t, e.registerEventCallback.bind(e), !1); }); } }), (e.prototype.initCanvas = function () { var t = this.get("container"); null !== t && "string" == typeof t && ((t = document.getElementById(t)), this.set("container", t)); var e = this.get("renderer"); if (!t && !e.startsWith("mini")) throw new Error("invalid container"); var n = this.get("width"), r = this.get("height"), i = { container: t, context: this.get("context"), width: n, height: r, renderer: e, fitView: this.get("fitView"), }, o = this.get("pixelRatio"); o && (i.pixelRatio = o); var a = new Tt(i); this.set("canvas", a); }), (e.prototype.initPlugins = function () { var t = this; Object(a.each)(t.get("plugins"), function (e) { !e.destroyed && e.initPlugin && e.initPlugin(t); }); }), (e.prototype.toDataURL = function (t, e) { var n = this.get("canvas"), r = n.getRenderer(), i = n.get("el"); t || (t = "image/png"); var o = ""; if ("svg" === r) { var a = i.cloneNode(!0), s = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), c = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", s, ); c.replaceChild(a, c.documentElement); var u = new XMLSerializer().serializeToString(c); o = "data:image/svg+xml;charset=utf8," + encodeURIComponent(u); } else { var h = void 0, l = i.getContext("2d"), f = this.get("width"), d = this.get("height"), p = void 0; if (e) { var g = "undefined" != typeof window ? window.devicePixelRatio : 1; (h = l.getImageData(0, 0, f * g, d * g)), (p = l.globalCompositeOperation), (l.globalCompositeOperation = "destination-over"), (l.fillStyle = e), l.fillRect(0, 0, f, d); } (o = i.toDataURL(t)), e && (l.clearRect(0, 0, f, d), l.putImageData(h, 0, 0), (l.globalCompositeOperation = p)); } return o; }), (e.prototype.toFullDataURL = function (t, e, n) { var r = this.get("group").getCanvasBBox(), i = r.height, o = r.width, s = this.get("renderer"), c = Object(zt.a)('
'), u = n ? n.backgroundColor : void 0, h = n ? n.padding : void 0; h ? Object(a.isNumber)(h) && (h = [h, h, h, h]) : (h = [0, 0, 0, 0]); var l = i + h[0] + h[2], f = o + h[1] + h[3], d = new Tt({ container: c, height: l, width: f, quickHit: !0 }), p = this.get("group").clone(), g = Object(a.clone)(p.getMatrix()); g || (g = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var v = (r.maxX + r.minX) / 2, y = (r.maxY + r.minY) / 2; Nt.a.translate(g, g, [-v, -y]), Nt.a.translate(g, g, [o / 2 + h[3], i / 2 + h[0]]), p.resetMatrix(), p.setMatrix(g), d.add(p); var m = d.get("el"), b = ""; e || (e = "image/png"), setTimeout(function () { if ("svg" === s) { var n = m.cloneNode(!0), r = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), i = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", r, ); i.replaceChild(n, i.documentElement); var o = new XMLSerializer().serializeToString(i); b = "data:image/svg+xml;charset=utf8," + encodeURIComponent(o); } else { var a = void 0, c = m.getContext("2d"), h = void 0; if (u) { var d = "undefined" != typeof window ? window.devicePixelRatio : 1; (a = c.getImageData(0, 0, f * d, l * d)), (h = c.globalCompositeOperation), (c.globalCompositeOperation = "destination-over"), (c.fillStyle = u), c.fillRect(0, 0, f, l); } (b = m.toDataURL(e)), u && (c.clearRect(0, 0, f, l), c.putImageData(a, 0, 0), (c.globalCompositeOperation = h)); } t && t(b); }, 16); }), (e.prototype.downloadFullImage = function (t, e, n) { var r = this, i = this.get("group").getCanvasBBox(), o = i.height, s = i.width, c = this.get("renderer"), u = Object(zt.a)(''), h = n ? n.backgroundColor : void 0, l = n ? n.padding : void 0; l ? Object(a.isNumber)(l) && (l = [l, l, l, l]) : (l = [0, 0, 0, 0]); var f = o + l[0] + l[2], d = s + l[1] + l[3], p = new Tt({ container: u, height: f, width: d }), g = this.get("group").clone(), v = Object(a.clone)(g.getMatrix()); v || (v = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var y = (i.maxX + i.minX) / 2, m = (i.maxY + i.minY) / 2; Nt.a.translate(v, v, [-y, -m]), Nt.a.translate(v, v, [s / 2 + l[3], o / 2 + l[0]]), g.resetMatrix(), g.setMatrix(v), p.add(g); var b = p.get("el"); e || (e = "image/png"), setTimeout(function () { var n = ""; if ("svg" === c) { var i = b.cloneNode(!0), o = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), a = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", o, ); a.replaceChild(i, a.documentElement); var s = new XMLSerializer().serializeToString(a); n = "data:image/svg+xml;charset=utf8," + encodeURIComponent(s); } else { var u = void 0, l = b.getContext("2d"), p = void 0; if (h) { var g = "undefined" != typeof window ? window.devicePixelRatio : 1; (u = l.getImageData(0, 0, d * g, f * g)), (p = l.globalCompositeOperation), (l.globalCompositeOperation = "destination-over"), (l.fillStyle = h), l.fillRect(0, 0, d, f); } (n = b.toDataURL(e)), h && (l.clearRect(0, 0, d, f), l.putImageData(u, 0, 0), (l.globalCompositeOperation = p)); } var v = document.createElement("a"), y = (t || "graph") + ("svg" === c ? ".svg" : "." + e.split("/")[1]); r.dataURLToImage(n, c, v, y); var m = document.createEvent("MouseEvents"); m.initEvent("click", !1, !1), v.dispatchEvent(m); }, 16); }), (e.prototype.downloadImage = function (t, e, n) { var r = this, i = this; i.isAnimating() && i.stopAnimate(); var o = i.get("canvas").getRenderer(); e || (e = "image/png"); var a = (t || "graph") + ("svg" === o ? ".svg" : e.split("/")[1]), s = document.createElement("a"); setTimeout(function () { var t = i.toDataURL(e, n); r.dataURLToImage(t, o, s, a); var c = document.createEvent("MouseEvents"); c.initEvent("click", !1, !1), s.dispatchEvent(c); }, 16); }), (e.prototype.dataURLToImage = function (t, e, n, r) { if ("undefined" != typeof window) if (window.Blob && window.URL && "svg" !== e) { var i = t.split(","), o = ""; if (i && i.length > 0) { var a = i[0].match(/:(.*?);/); a && a.length >= 2 && (o = a[1]); } for ( var s = atob(i[1]), c = s.length, u = new Uint8Array(c); c--; ) u[c] = s.charCodeAt(c); var h = new Blob([u], { type: o }); window.navigator.msSaveBlob ? window.navigator.msSaveBlob(h, r) : n.addEventListener("click", function () { (n.download = r), (n.href = window.URL.createObjectURL(h)); }); } else n.addEventListener("click", function () { (n.download = r), (n.href = t); }); }), (e.prototype.addPlugin = function (t) { t.destroyed || (this.get("plugins").push(t), t.initPlugin(this)); }), (e.prototype.removePlugin = function (t) { var e = this.get("plugins"), n = e.indexOf(t); n >= 0 && (t.destroyPlugin(), e.splice(n, 1)); }), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.isBrowser = function () { return "canvas" === this.get("renderer"); }), (e.prototype.setImageWaterMarker = function (t, e, n) { var r = this, i = Object(a.deepMix)({}, Lt.a.imageWaterMarkerConfig, e), o = i.width, s = i.height, c = i.image, u = c.rotate, h = (c.x, c.y, c.width), l = c.height; if ((this.isMini() && this.isMiniNative(), this.isMiniNative())) { (n.width = o || this.get("width")), (n.height = s || this.get("height")); var f = n.getContext("2d"), d = (0, this.get("extra").createImage)(); (d.crossOrigin = "anonymous"), (d.src = t), (d.onload = function () { if (!r.destroyed) { var t = h / d.width, e = l / d.height; f.rotate((-u * Math.PI) / 180); var i = f.createPattern(d, "repeat"); (f.fillStyle = i), f.scale(t, e), f.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ), r .get("waterGroup") .addShape("image", { attrs: { img: n } }); } }); } if (this.isBrowser()) { var p = document.createElement("canvas"); (p.width = o || this.get("width")), (p.height = s || this.get("height")); var g = p.getContext("2d"), v = new Image(); (v.crossOrigin = "anonymous"), (v.src = t), (v.onload = function () { if (!r.destroyed) { var t = h / v.width, e = l / v.height; g.rotate((-u * Math.PI) / 180); var n = g.createPattern(v, "repeat"); (g.fillStyle = n), g.scale(t, e), g.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ); var i = p.toDataURL(); r.get("waterGroup").addShape("image", { attrs: { img: i }, }); } }); } }), (e.prototype.setTextWaterMarker = function (t, e) { var n = this.get("container"); Object(a.isString)(n) && (n = document.getElementById(n)), n.style.position || (n.style.position = "relative"); var r = this.get("graphWaterMarker"), i = Object(a.deepMix)({}, Lt.a.textWaterMarkerConfig, e), o = i.width, s = i.height, c = i.compatible, u = i.text; if (!r) { var h = { container: n, width: o, height: s, capture: !1 }, l = this.get("pixelRatio"); l && (h.pixelRatio = l), (r = new Tt(h)), this.set("graphWaterMarker", r); } r.get("el").style.display = "none"; var f = r.get("context"), d = u.rotate, p = u.fill, g = u.fontFamily, v = u.fontSize, y = u.baseline, m = u.x, b = u.y, x = u.lineHeight; f.rotate((-d * Math.PI) / 180), (f.font = v + "px " + g), (f.fillStyle = p), (f.textBaseline = y); for (var w = t.length - 1; w >= 0; w--) f.fillText(t[w], m, b + w * x); if ((f.rotate((d * Math.PI) / 180), c)) n.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;"; else { var S = document.querySelector(".g6-graph-watermarker"); S || ((S = document.createElement("div")).className = "g6-graph-watermarker"), (S.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"), n.appendChild(S); } }), (e.prototype.destroy = function () { Object(a.each)(this.get("plugins"), function (t) { t.destroyPlugin(); }); var e = this.get("tooltips"); if (e) for (var n = 0; n < e.length; n++) { var r = e[n]; if (r) { var i = r.parentElement; i && i.removeChild(r); } } this.get("eventController").destroy(), this.get("layoutController").destroy(), this.get("graphWaterMarker") && this.get("graphWaterMarker").destroy(), "undefined" != typeof document && document.querySelector && document.querySelector(".g6-graph-watermarker") && document.querySelector(".g6-graph-watermarker").remove(), t.prototype.destroy.call(this); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = t.addGroup({ id: "root", className: Lt.a.rootContainerClassName, }), n = t.addGroup({ id: "water", className: Lt.a.waterContainerClassName, }); if (this.get("groupByTypes")) { var r = e.addGroup({ id: "edge", className: Lt.a.edgeContainerClassName, }), i = e.addGroup({ id: "node", className: Lt.a.nodeContainerClassName, }), o = e.addGroup({ id: "combo", className: Lt.a.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = t.addGroup({ id: "uiGroup", className: Lt.a.uiContainerClassName, }), s = e.addGroup({ id: "delegate", className: Lt.a.delegateContainerClassName, }); this.set({ delegateGroup: s }), this.set("group", e), this.set("uiGroup", a), this.set("waterGroup", n); }), e ); })(Bt.b); e.a = qt; }, 75: function (t, e, n) { "use strict"; n.r(e), n.d(e, "mixColor", function () { return B; }), n.d(e, "getColorsWithSubjectColor", function () { return L; }), n.d(e, "getColorSetsBySubjectColors", function () { return D; }); var r = n(44), i = n.n(r); function o(t, e) { (function (t) { return ( "string" == typeof t && -1 !== t.indexOf(".") && 1 === parseFloat(t) ); })(t) && (t = "100%"); var n = (function (t) { return "string" == typeof t && -1 !== t.indexOf("%"); })(t); return ( (t = 360 === e ? t : Math.min(e, Math.max(0, parseFloat(t)))), n && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (t = 360 === e ? (t < 0 ? (t % e) + e : t % e) / parseFloat(String(e)) : (t % e) / parseFloat(String(e))) ); } function a(t) { return Math.min(1, Math.max(0, t)); } function s(t) { return (t = parseFloat(t)), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function c(t) { return t <= 1 ? "".concat(100 * Number(t), "%") : t; } function u(t) { return 1 === t.length ? "0" + t : String(t); } function h(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = 0, c = (r + i) / 2; if (r === i) (s = 0), (a = 0); else { var u = r - i; switch (((s = c > 0.5 ? u / (2 - r - i) : u / (r + i)), r)) { case t: a = (e - n) / u + (e < n ? 6 : 0); break; case e: a = (n - t) / u + 2; break; case n: a = (t - e) / u + 4; } a /= 6; } return { h: a, s: s, l: c }; } function l(t, e, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + 6 * n * (e - t) : n < 0.5 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t ); } function f(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = r, c = r - i, u = 0 === r ? 0 : c / r; if (r === i) a = 0; else { switch (r) { case t: a = (e - n) / c + (e < n ? 6 : 0); break; case e: a = (n - t) / c + 2; break; case n: a = (t - e) / c + 4; } a /= 6; } return { h: a, s: u, v: s }; } function d(t, e, n, r) { var i = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), ]; return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join(""); } function p(t) { return Math.round(255 * parseFloat(t)).toString(16); } function g(t) { return v(t) / 255; } function v(t) { return parseInt(t, 16); } var y = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32", }; function m(t) { return (m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function b(t) { var e, n, r, i = { r: 0, g: 0, b: 0 }, a = 1, u = null, h = null, f = null, d = !1, p = !1; return ( "string" == typeof t && (t = (function (t) { if (0 === (t = t.trim().toLowerCase()).length) return !1; var e = !1; if (y[t]) (t = y[t]), (e = !0); else if ("transparent" === t) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var n = O.rgb.exec(t); if (n) return { r: n[1], g: n[2], b: n[3] }; if ((n = O.rgba.exec(t))) return { r: n[1], g: n[2], b: n[3], a: n[4] }; if ((n = O.hsl.exec(t))) return { h: n[1], s: n[2], l: n[3] }; if ((n = O.hsla.exec(t))) return { h: n[1], s: n[2], l: n[3], a: n[4] }; if ((n = O.hsv.exec(t))) return { h: n[1], s: n[2], v: n[3] }; if ((n = O.hsva.exec(t))) return { h: n[1], s: n[2], v: n[3], a: n[4] }; if ((n = O.hex8.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), a: g(n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex6.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), format: e ? "name" : "hex", }; if ((n = O.hex4.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), a: g(n[4] + n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex3.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), format: e ? "name" : "hex", }; return !1; })(t)), "object" === m(t) && (M(t.r) && M(t.g) && M(t.b) ? ((e = t.r), (n = t.g), (r = t.b), (i = { r: 255 * o(e, 255), g: 255 * o(n, 255), b: 255 * o(r, 255), }), (d = !0), (p = "%" === String(t.r).substr(-1) ? "prgb" : "rgb")) : M(t.h) && M(t.s) && M(t.v) ? ((u = c(t.s)), (h = c(t.v)), (i = (function (t, e, n) { (t = 6 * o(t, 360)), (e = o(e, 100)), (n = o(n, 100)); var r = Math.floor(t), i = t - r, a = n * (1 - e), s = n * (1 - i * e), c = n * (1 - (1 - i) * e), u = r % 6; return { r: 255 * [n, s, a, a, c, n][u], g: 255 * [c, n, n, s, a, a][u], b: 255 * [a, a, c, n, n, s][u], }; })(t.h, u, h)), (d = !0), (p = "hsv")) : M(t.h) && M(t.s) && M(t.l) && ((u = c(t.s)), (f = c(t.l)), (i = (function (t, e, n) { var r, i, a; if ( ((t = o(t, 360)), (e = o(e, 100)), (n = o(n, 100)), 0 === e) ) (i = n), (a = n), (r = n); else { var s = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - s; (r = l(c, s, t + 1 / 3)), (i = l(c, s, t)), (a = l(c, s, t - 1 / 3)); } return { r: 255 * r, g: 255 * i, b: 255 * a }; })(t.h, u, f)), (d = !0), (p = "hsl")), Object.prototype.hasOwnProperty.call(t, "a") && (a = t.a)), (a = s(a)), { ok: d, format: t.format || p, r: Math.min(255, Math.max(i.r, 0)), g: Math.min(255, Math.max(i.g, 0)), b: Math.min(255, Math.max(i.b, 0)), a: a, } ); } var x = "(?:" .concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:") .concat("[-\\+]?\\d+%?", ")"), w = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), S = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), O = { CSS_UNIT: new RegExp(x), rgb: new RegExp("rgb" + w), rgba: new RegExp("rgba" + S), hsl: new RegExp("hsl" + w), hsla: new RegExp("hsla" + S), hsv: new RegExp("hsv" + w), hsva: new RegExp("hsva" + S), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, }; function M(t) { return Boolean(O.CSS_UNIT.exec(String(t))); } var k = (function () { function t(e, n) { var r; if ( (void 0 === e && (e = ""), void 0 === n && (n = {}), e instanceof t) ) return e; "number" == typeof e && (e = (function (t) { return { r: t >> 16, g: (65280 & t) >> 8, b: 255 & t }; })(e)), (this.originalInput = e); var i = b(e); (this.originalInput = e), (this.r = i.r), (this.g = i.g), (this.b = i.b), (this.a = i.a), (this.roundA = Math.round(100 * this.a) / 100), (this.format = null !== (r = n.format) && void 0 !== r ? r : i.format), (this.gradientType = n.gradientType), this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), (this.isValid = i.ok); } return ( (t.prototype.isDark = function () { return this.getBrightness() < 128; }), (t.prototype.isLight = function () { return !this.isDark(); }), (t.prototype.getBrightness = function () { var t = this.toRgb(); return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3; }), (t.prototype.getLuminance = function () { var t = this.toRgb(), e = t.r / 255, n = t.g / 255, r = t.b / 255; return ( 0.2126 * (e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)) + 0.7152 * (n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4)) + 0.0722 * (r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)) ); }), (t.prototype.getAlpha = function () { return this.a; }), (t.prototype.setAlpha = function (t) { return ( (this.a = s(t)), (this.roundA = Math.round(100 * this.a) / 100), this ); }), (t.prototype.toHsv = function () { var t = f(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, v: t.v, a: this.a }; }), (t.prototype.toHsvString = function () { var t = f(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.v); return 1 === this.a ? "hsv(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsva(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHsl = function () { var t = h(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, l: t.l, a: this.a }; }), (t.prototype.toHslString = function () { var t = h(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.l); return 1 === this.a ? "hsl(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsla(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHex = function (t) { return void 0 === t && (t = !1), d(this.r, this.g, this.b, t); }), (t.prototype.toHexString = function (t) { return void 0 === t && (t = !1), "#" + this.toHex(t); }), (t.prototype.toHex8 = function (t) { return ( void 0 === t && (t = !1), (function (t, e, n, r, i) { var o = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), u(p(r)), ]; return i && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join(""); })(this.r, this.g, this.b, this.a, t) ); }), (t.prototype.toHex8String = function (t) { return void 0 === t && (t = !1), "#" + this.toHex8(t); }), (t.prototype.toRgb = function () { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a, }; }), (t.prototype.toRgbString = function () { var t = Math.round(this.r), e = Math.round(this.g), n = Math.round(this.b); return 1 === this.a ? "rgb(".concat(t, ", ").concat(e, ", ").concat(n, ")") : "rgba(" .concat(t, ", ") .concat(e, ", ") .concat(n, ", ") .concat(this.roundA, ")"); }), (t.prototype.toPercentageRgb = function () { var t = function (t) { return "".concat(Math.round(100 * o(t, 255)), "%"); }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a }; }), (t.prototype.toPercentageRgbString = function () { var t = function (t) { return Math.round(100 * o(t, 255)); }; return 1 === this.a ? "rgb(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%)") : "rgba(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%, ") .concat(this.roundA, ")"); }), (t.prototype.toName = function () { if (0 === this.a) return "transparent"; if (this.a < 1) return !1; for ( var t = "#" + d(this.r, this.g, this.b, !1), e = 0, n = Object.entries(y); e < n.length; e++ ) { var r = n[e], i = r[0]; if (t === r[1]) return i; } return !1; }), (t.prototype.toString = function (t) { var e = Boolean(t); t = null != t ? t : this.format; var n = !1, r = this.a < 1 && this.a >= 0; return e || !r || (!t.startsWith("hex") && "name" !== t) ? ("rgb" === t && (n = this.toRgbString()), "prgb" === t && (n = this.toPercentageRgbString()), ("hex" !== t && "hex6" !== t) || (n = this.toHexString()), "hex3" === t && (n = this.toHexString(!0)), "hex4" === t && (n = this.toHex8String(!0)), "hex8" === t && (n = this.toHex8String()), "name" === t && (n = this.toName()), "hsl" === t && (n = this.toHslString()), "hsv" === t && (n = this.toHsvString()), n || this.toHexString()) : "name" === t && 0 === this.a ? this.toName() : this.toRgbString(); }), (t.prototype.toNumber = function () { return ( (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b) ); }), (t.prototype.clone = function () { return new t(this.toString()); }), (t.prototype.lighten = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l += e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.brighten = function (e) { void 0 === e && (e = 10); var n = this.toRgb(); return ( (n.r = Math.max( 0, Math.min(255, n.r - Math.round((-e / 100) * 255)), )), (n.g = Math.max( 0, Math.min(255, n.g - Math.round((-e / 100) * 255)), )), (n.b = Math.max( 0, Math.min(255, n.b - Math.round((-e / 100) * 255)), )), new t(n) ); }), (t.prototype.darken = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l -= e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.tint = function (t) { return void 0 === t && (t = 10), this.mix("white", t); }), (t.prototype.shade = function (t) { return void 0 === t && (t = 10), this.mix("black", t); }), (t.prototype.desaturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s -= e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.saturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s += e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.greyscale = function () { return this.desaturate(100); }), (t.prototype.spin = function (e) { var n = this.toHsl(), r = (n.h + e) % 360; return (n.h = r < 0 ? 360 + r : r), new t(n); }), (t.prototype.mix = function (e, n) { void 0 === n && (n = 50); var r = this.toRgb(), i = new t(e).toRgb(), o = n / 100; return new t({ r: (i.r - r.r) * o + r.r, g: (i.g - r.g) * o + r.g, b: (i.b - r.b) * o + r.b, a: (i.a - r.a) * o + r.a, }); }), (t.prototype.analogous = function (e, n) { void 0 === e && (e = 6), void 0 === n && (n = 30); var r = this.toHsl(), i = 360 / n, o = [this]; for (r.h = (r.h - ((i * e) >> 1) + 720) % 360; --e; ) (r.h = (r.h + i) % 360), o.push(new t(r)); return o; }), (t.prototype.complement = function () { var e = this.toHsl(); return (e.h = (e.h + 180) % 360), new t(e); }), (t.prototype.monochromatic = function (e) { void 0 === e && (e = 6); for ( var n = this.toHsv(), r = n.h, i = n.s, o = n.v, a = [], s = 1 / e; e--; ) a.push(new t({ h: r, s: i, v: o })), (o = (o + s) % 1); return a; }), (t.prototype.splitcomplement = function () { var e = this.toHsl(), n = e.h; return [ this, new t({ h: (n + 72) % 360, s: e.s, l: e.l }), new t({ h: (n + 216) % 360, s: e.s, l: e.l }), ]; }), (t.prototype.onBackground = function (e) { var n = this.toRgb(), r = new t(e).toRgb(); return new t({ r: r.r + (n.r - r.r) * n.a, g: r.g + (n.g - r.g) * n.a, b: r.b + (n.b - r.b) * n.a, }); }), (t.prototype.triad = function () { return this.polyad(3); }), (t.prototype.tetrad = function () { return this.polyad(4); }), (t.prototype.polyad = function (e) { for ( var n = this.toHsl(), r = n.h, i = [this], o = 360 / e, a = 1; a < e; a++ ) i.push(new t({ h: (r + a * o) % 360, s: n.s, l: n.l })); return i; }), (t.prototype.equals = function (e) { return this.toRgbString() === new t(e).toRgbString(); }), t ); })(); var C = [ { index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }, ]; function E(t, e, n) { var r; return ( (r = Math.round(t.h) >= 60 && Math.round(t.h) <= 240 ? n ? Math.round(t.h) - 2 * e : Math.round(t.h) + 2 * e : n ? Math.round(t.h) + 2 * e : Math.round(t.h) - 2 * e) < 0 ? (r += 360) : r >= 360 && (r -= 360), r ); } function j(t, e, n) { return 0 === t.h && 0 === t.s ? t.s : ((r = n ? t.s - 0.16 * e : 4 === e ? t.s + 0.16 : t.s + 0.05 * e) > 1 && (r = 1), n && 5 === e && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Number(r.toFixed(2))); var r; } function P(t, e, n) { var r; return ( (r = n ? t.v + 0.05 * e : t.v - 0.15 * e) > 1 && (r = 1), Number(r.toFixed(2)) ); } function A(t) { for ( var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = [], r = new k(t), i = 5; i > 0; i -= 1 ) { var o = r.toHsv(), a = new k({ h: E(o, i, !0), s: j(o, i, !0), v: P(o, i, !0), }).toHexString(); n.push(a); } n.push(r.toHexString()); for (var s = 1; s <= 4; s += 1) { var c = r.toHsv(), u = new k({ h: E(c, s), s: j(c, s), v: P(c, s) }).toHexString(); n.push(u); } return "dark" === e.theme ? C.map(function (t) { var r = t.index, i = t.opacity; return new k(e.backgroundColor || "#141414") .mix(n[r], 100 * i) .toHexString(); }) : n; } var I = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1890FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666", }, T = {}, N = {}; Object.keys(I).forEach(function (t) { (T[t] = A(I[t])), (T[t].primary = T[t][5]), (N[t] = A(I[t], { theme: "dark", backgroundColor: "#141414" })), (N[t].primary = N[t][5]); }); T.red, T.volcano, T.gold, T.orange, T.yellow, T.lime, T.green, T.cyan, T.blue, T.geekblue, T.purple, T.magenta, T.grey; var B = function (t, e, n) { var r = i()(t), o = i()(e); return i()([ (1 - n) * r.red() + n * o.red(), (1 - n) * r.green() + n * o.green(), (1 - n) * r.blue() + n * o.blue(), ]).rgb(); }, L = function (t, e, n, r) { return ( void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"), "default" === n ? (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "rgb(150, 150, 150)"); var r = B(e, t, 0.05).rgb().toString(), o = B(e, t, 0.1).rgb().toString(), a = B(e, t, 0.2).rgb().toString(), s = B(e, t, 0.4).rgb().toString(), c = B(e, n, 0.02).rgb().toString(), u = B(e, n, 0.05).rgb().toString(), h = B(e, n, 0.1).rgb().toString(), l = B(e, n, 0.2).rgb().toString(), f = B(e, n, 0.3).rgb().toString(), d = A(t, { theme: "default", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: t, mainFill: o, activeStroke: t, activeFill: r, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: e, highlightStroke: v, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: f, edgeActiveStroke: t, edgeInactiveStroke: l, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: f, comboMainFill: c, comboActiveStroke: t, comboActiveFill: r, comboInactiveStroke: f, comboInactiveFill: c, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: c, comboDisableStroke: l, comboDisableFill: u, } ); })(t, e, "rgb(150, 150, 150)") : (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "#777"); var r = B(e, t, 0.2).rgb().toString(), o = B(e, t, 0.3).rgb().toString(), a = B(e, t, 0.6).rgb().toString(), s = B(e, t, 0.8).rgb().toString(), c = B(e, n, 0.2).rgb().toString(), u = B(e, n, 0.25).rgb().toString(), h = B(e, n, 0.3).rgb().toString(), l = B(e, n, 0.4).rgb().toString(), f = B(e, n, 0.5).rgb().toString(), d = A(t, { theme: "dark", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: s, mainFill: r, activeStroke: t, activeFill: o, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: r, highlightStroke: t, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: n, edgeActiveStroke: t, edgeInactiveStroke: n, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: l, comboMainFill: u, comboActiveStroke: t, comboActiveFill: c, comboInactiveStroke: l, comboInactiveFill: u, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: u, comboDisableStroke: l, comboDisableFill: c, } ); })(t, e, "#777") ); }, D = function (t, e, n, r) { void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"); var i = []; return ( t.forEach(function (t) { i.push(L(t, e, n, r)); }), i ); }; }, 76: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } Object.defineProperty(e, "__esModule", { value: !0 }), (e.clearAnimationFrame = function (t) { return o.clearAnimationFrame ? o.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); }), (e.requestAnimationFrame = function (t) { return o.requestAnimationFrame ? o.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); }), (e.setExtraFunction = function (t) { void 0 === t && (t = {}), (t = t); }); var o = {}; }, 77: function (t, e) { function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : n(window)) && (r = window); } t.exports = r; }, 78: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Layouts = e.Layout = void 0); var r = n(51), i = (function () { function t(t) { var e = r.getLayoutByName(t.type); this.layoutInstance = new e(t); } return ( (t.prototype.layout = function (t) { return this.layoutInstance.layout(t); }), (t.prototype.updateCfg = function (t) { this.layoutInstance.updateCfg(t); }), (t.prototype.init = function (t) { this.layoutInstance.init(t); }), (t.prototype.execute = function () { this.layoutInstance.execute(); }), (t.prototype.getDefaultCfg = function () { return this.layoutInstance.getDefaultCfg(); }), (t.prototype.destroy = function () { return this.layoutInstance.destroy(); }), t ); })(); (e.Layout = i), (e.Layouts = new Proxy( {}, { get: function (t, e) { return r.getLayoutByName(e); }, set: function (t, e, n) { return r.registerLayout(e, n), !0; }, }, )); }, 97: function (t, e, n) { "use strict"; var r = n(1), i = n(2), o = (n(6), n(27)), a = n(74), s = n(26), c = n(18), u = n(32), h = (n(395), n(396), n(101), n(102), { version: c.a.version, Graph: a.a, Util: u.a, Layout: s.a, Layouts: s.b, registerLayout: s.c, unRegisterLayout: s.d, Global: c.a, registerBehavior: i.i, registerCombo: i.j, registerEdge: i.k, registerNode: i.l, Algorithm: o, Arrow: i.d, Marker: i.f, Shape: i.g, }); var l, f = ((l = a.b), function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return l.apply(null, Object(r.g)(t, [h])); }); (h.registerGraph = f), (e.default = h); }, 98: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.assembleFont = e.getTextWidth = e.getLineSpaceing = e.getTextHeight = void 0); var r = n(179), i = n(180); function o(t, e) { return e ? e - t : 0.14 * t; } (e.getTextHeight = function (t, e, n) { var i = 1; return ( (0, r.isString)(t) && (i = t.split("\n").length), i > 1 ? e * i + o(e, n) * (i - 1) : e ); }), (e.getLineSpaceing = o), (e.getTextWidth = function (t, e) { var n = (0, i.getOffScreenContext)(), o = 0; if ((0, r.isNil)(t) || "" === t) return o; if ( (n.save(), (n.font = e), (0, r.isString)(t) && t.includes("\n")) ) { var a = t.split("\n"); (0, r.each)(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; }), (e.assembleFont = function (t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); }); }, }).default; }); //# sourceMappingURL=index.js.map ================================================ FILE: packages/examples-uniapp/index.html ================================================
================================================ FILE: packages/examples-uniapp/main.js ================================================ import App from "./App"; // #ifndef VUE3 import Vue from "vue"; Vue.config.productionTip = false; App.mpType = "app"; const app = new Vue({ ...App, }); app.$mount(); // #endif // #ifdef VUE3 import { createSSRApp } from "vue"; export function createApp() { const app = createSSRApp(App); return { app, }; } // #endif ================================================ FILE: packages/examples-uniapp/manifest.json ================================================ { "name": "test", "appid": "", "description": "", "versionName": "1.0.0", "versionCode": "100", "transformPx": false, /* 5+App特有相关 */ "app-plus": { "usingComponents": true, "nvueStyleCompiler": "uni-app", "compilerVersion": 3, "splashscreen": { "alwaysShowBeforeRender": true, "waiting": true, "autoclose": true, "delay": 0 }, /* 模块配置 */ "modules": {}, /* 应用发布信息 */ "distribute": { /* android打包配置 */ "android": { "permissions": [ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ] }, /* ios打包配置 */ "ios": {}, /* SDK配置 */ "sdkConfigs": {} } }, /* 快应用特有相关 */ "quickapp": {}, /* 小程序特有相关 */ "mp-weixin": { "appid": "", "setting": { "urlCheck": false }, "usingComponents": true }, "mp-alipay": { "usingComponents": true }, "mp-baidu": { "usingComponents": true }, "mp-toutiao": { "usingComponents": true }, "uniStatistics": { "enable": false }, "vueVersion": "2" } ================================================ FILE: packages/examples-uniapp/pages/index/index.vue ================================================ ================================================ FILE: packages/examples-uniapp/pages.json ================================================ { "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { "path": "pages/index/index", "style": { "navigationBarTitleText": "uni-app" } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "uni-app", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } } ================================================ FILE: packages/examples-uniapp/uni.scss ================================================ /** * 这里是uni-app内置的常用样式变量 * * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App * */ /** * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 * * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 */ /* 颜色变量 */ /* 行为相关颜色 */ $uni-color-primary: #007aff; $uni-color-success: #4cd964; $uni-color-warning: #f0ad4e; $uni-color-error: #dd524d; /* 文字基本颜色 */ $uni-text-color: #333; //基本色 $uni-text-color-inverse: #fff; //反色 $uni-text-color-grey: #999; //辅助灰色,如加载更多的提示信息 $uni-text-color-placeholder: #808080; $uni-text-color-disable: #c0c0c0; /* 背景颜色 */ $uni-bg-color: #ffffff; $uni-bg-color-grey: #f8f8f8; $uni-bg-color-hover: #f1f1f1; //点击状态颜色 $uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色 /* 边框颜色 */ $uni-border-color: #c8c7cc; /* 尺寸变量 */ /* 文字尺寸 */ $uni-font-size-sm: 12px; $uni-font-size-base: 14px; $uni-font-size-lg: 16; /* 图片尺寸 */ $uni-img-size-sm: 20px; $uni-img-size-base: 26px; $uni-img-size-lg: 40px; /* Border Radius */ $uni-border-radius-sm: 2px; $uni-border-radius-base: 3px; $uni-border-radius-lg: 6px; $uni-border-radius-circle: 50%; /* 水平间距 */ $uni-spacing-row-sm: 5px; $uni-spacing-row-base: 10px; $uni-spacing-row-lg: 15px; /* 垂直间距 */ $uni-spacing-col-sm: 4px; $uni-spacing-col-base: 8px; $uni-spacing-col-lg: 12px; /* 透明度 */ $uni-opacity-disabled: 0.3; // 组件禁用态的透明度 /* 文章场景相关 */ $uni-color-title: #2c405a; // 文章标题颜色 $uni-font-size-title: 20px; $uni-color-subtitle: #555555; // 二级标题颜色 $uni-font-size-subtitle: 26px; $uni-color-paragraph: #3f536e; // 文章段落颜色 $uni-font-size-paragraph: 15px; ================================================ FILE: packages/examples-wx/app.js ================================================ App({}); ================================================ FILE: packages/examples-wx/app.json ================================================ { "pages": ["pages/index/index"], "subpackages": [ { "root": "package-animation", "pages": [ "pages/animation/change-position-default/index", "pages/animation/custom-animate-position/index", "pages/animation/edge-edge/index", "pages/animation/edge-line-growth/index", "pages/animation/node-node/index", "pages/animation/point-in-line/index", "pages/animation/state-change-hover/index" ] }, { "root": "package-elements", "name": "package-elements", "pages": [ "pages/elements/diamond/index", "pages/elements/cubic2/index", "pages/elements/point-chart/index", "pages/elements/card/index", "pages/elements/bar-chart/index", "pages/elements/rect/index", "pages/elements/donut/index", "pages/elements/edge-mul-label/index", "pages/elements/mode-rect/index", "pages/elements/polyline3/index", "pages/elements/c-circle/index", "pages/elements/triangle/index", "pages/elements/polyline2/index", "pages/elements/label-len/index", "pages/elements/pie-chart/index", "pages/elements/image/index", "pages/elements/cubic1/index", "pages/elements/star/index", "pages/elements/card-node/index", "pages/elements/multi-edges/index", "pages/elements/extra-shape/index", "pages/elements/label-len1/index", "pages/elements/line-chart/index", "pages/elements/edge-bg/index", "pages/elements/stack-chart/index", "pages/elements/rect-with-combo/index", "pages/elements/custom-polyline/index", "pages/elements/list/index", "pages/elements/c-rect/index", "pages/elements/circle-with-combo/index", "pages/elements/circle/index", "pages/elements/custom-arrows/index", "pages/elements/ellipse/index", "pages/elements/area-chart/index", "pages/elements/custom-polyline2/index", "pages/elements/arc/index", "pages/elements/built-in-arrows/index", "pages/elements/node-bg/index", "pages/elements/loop/index", "pages/elements/polyline1/index" ] }, { "root": "package-general-graph", "name": "package-general-graph", "pages": [ "pages/general-graph/degree-circular/index", "pages/general-graph/force-bubbles/index", "pages/general-graph/layout-timing/index", "pages/general-graph/subgraph-layout/index", "pages/general-graph/circular-configuration-translate/index", "pages/general-graph/basic-arc-diagram/index", "pages/general-graph/division-circular/index", "pages/general-graph/data-change/index", "pages/general-graph/basic-grid/index", "pages/general-graph/fruchterman/index", "pages/general-graph/dagre-configuration-translate/index", "pages/general-graph/basic-force-directed/index", "pages/general-graph/sublayout-pipes/index", "pages/general-graph/sort-radial/index", "pages/general-graph/basic-concentric/index", "pages/general-graph/prevent-overlap-unstrict-radial/index", "pages/general-graph/dagre-UL/index", "pages/general-graph/force-directed-force-clustering/index", "pages/general-graph/basic-radial/index", "pages/general-graph/basic-MDS/index", "pages/general-graph/force-directed-functional-params/index", "pages/general-graph/fruchterman-clustering/index", "pages/general-graph/force-directed-configuration-translate/index", "pages/general-graph/force-constrained-in-rect/index", "pages/general-graph/fruchterman-configuration-translate/index", "pages/general-graph/basic-FA2/index", "pages/general-graph/interact-radial/index", "pages/general-graph/cluster-grid/index", "pages/general-graph/basic-circular/index", "pages/general-graph/basic-dagre/index", "pages/general-graph/spiral-circular/index", "pages/general-graph/custom-bi-graph/index", "pages/general-graph/dagre/index", "pages/general-graph/dagre-combo/index", "pages/general-graph/prevent-overlap-radial/index", "pages/general-graph/radial-configuration-translate/index", "pages/general-graph/layoutTranslate/index", "pages/general-graph/basic-combo-force/index", "pages/general-graph/force-directed-prevent-overlap/index", "pages/general-graph/basic-force-directed-drag-fix/index", "pages/general-graph/circular-arc-diagram/index" ] }, { "root": "package-interactive", "name": "package-interactive", "pages": [ "pages/interactive/move/index", "pages/interactive/hide-item/index", "pages/interactive/activate-relations/index", "pages/interactive/hull/index", "pages/interactive/combo-rect/index", "pages/interactive/fix-item/index", "pages/interactive/canvas-two-fingers/index", "pages/interactive/add-child/index", "pages/interactive/combo-circle/index", "pages/interactive/change-data/index", "pages/interactive/move-animate/index", "pages/interactive/drag-subtree/index", "pages/interactive/collapse-slibing/index", "pages/interactive/set-mode/index", "pages/interactive/partial-node/index", "pages/interactive/change-members/index", "pages/interactive/highlight-dark/index" ] }, { "root": "package-scene-case", "name": "package-scene-case", "pages": [ "pages/scene-case/sankey/index", "pages/scene-case/knowledge-tree-graph/index", "pages/scene-case/metro-lines/index", "pages/scene-case/decision-tree/index", "pages/scene-case/custom-flow/index", "pages/scene-case/donut-transfer/index", "pages/scene-case/mind-map/index" ] }, { "root": "package-tree-graph", "name": "package-tree-graph", "pages": [ "pages/tree-graph/compact-box/index", "pages/tree-graph/custom-side-mind-map/index", "pages/tree-graph/compact-box-left-align/index", "pages/tree-graph/basic-dendrogram/index", "pages/tree-graph/left-mind-map/index", "pages/tree-graph/file-system/index", "pages/tree-graph/custom-tree/index", "pages/tree-graph/radial-dendrogram/index", "pages/tree-graph/custom-edge-tree/index", "pages/tree-graph/tb-dendrogram/index", "pages/tree-graph/intend-align-top/index", "pages/tree-graph/tb-compact-box/index", "pages/tree-graph/radial-compact-box/index", "pages/tree-graph/mind-map/index", "pages/tree-graph/tree-edge-label/index", "pages/tree-graph/h-intended/index", "pages/tree-graph/right-mind-map/index" ] }, { "root": "package-plugin", "name": "package-plugin", "pages": [ "pages/plugin/edge-filter/index", "pages/plugin/fish-eye/index", "pages/plugin/legend/index", "pages/plugin/time-bar/index", "pages/plugin/tool-tip/index", "pages/plugin/zoom-slider/index", "pages/plugin/bundling/index", "pages/plugin/menu/index", "pages/plugin/snap-line/index", "pages/plugin/mini-map/index" ] } ], "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "Weixin", "navigationBarTextStyle": "black" }, "style": "v2", "sitemapLocation": "sitemap.json" } ================================================ FILE: packages/examples-wx/app.wxss ================================================ /**app.wxss**/ .container { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 200rpx 0; box-sizing: border-box; } ================================================ FILE: packages/examples-wx/components/wx.js ================================================ Component({ data: {}, properties: { style: { type: String, value: "", }, width: { type: Number, value: 100, }, height: { type: Number, value: 100, }, onInit: { type: Function, value: function value() {}, }, onTouchEvent: { type: Function, value: function value() {}, }, onError: { type: Function, value: function value() {}, }, pixelRatio: { type: Number, value: 1, }, }, ready: function ready() { const _this = this; const query = wx.createSelectorQuery().in(this); query .select("#g6-canvas") .fields({ node: true, size: true, }) .exec((ret) => { const canvas = ret[0].node; canvas.width = _this.data.width * _this.data.pixelRatio; canvas.height = _this.data.height * _this.data.pixelRatio; _this.rect = { width: _this.data.width * _this.data.pixelRatio, height: _this.data.height * _this.data.pixelRatio, left: canvas._left, top: canvas._top, }; _this.ctx = canvas.getContext("2d"); _this.triggerEvent("onInit", { ctx: _this.ctx, rect: _this.rect, canvas, renderer: "mini-native", }); // _this.data.onInit(_this.ctx, _this.rect, canvas, 'mini-native'); }); }, methods: { error: function error(e) { this.data.onError(e); }, ontouch: function ontouch(e) { let i = 0; for (i = 0; i < e.touches.length; i++) { modifyEvent(e.touches[i], this.data.pixelRatio); } for (i = 0; i < e.changedTouches.length; i++) { modifyEvent(e.changedTouches[i], this.data.pixelRatio); } this.triggerEvent("onTouchEvent", e); }, }, }); function modifyEvent(touchEvent = {}, pixelRatio) { touchEvent.clientX = touchEvent.x * pixelRatio; touchEvent.clientY = touchEvent.y * pixelRatio; touchEvent.pageX = touchEvent.x * pixelRatio; touchEvent.pageY = touchEvent.y * pixelRatio; } ================================================ FILE: packages/examples-wx/components/wx.json ================================================ { "component": true, "usingComponents": {} } ================================================ FILE: packages/examples-wx/components/wx.wxml ================================================ ================================================ FILE: packages/examples-wx/components/wx.wxss ================================================ /* components/wx.wxss */ ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-plugin/f6Plugin.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6ui = e()) : (t.f6ui = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var i in t) n.d( r, i, function (e) { return t[e]; }.bind(null, i), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 33)) ); })([ function (t, e, n) { "use strict"; n.d(e, "i", function () { return m; }), n.d(e, "k", function () { return w; }), n.d(e, "y", function () { return O; }), n.d(e, "f", function () { return i; }), n.d(e, "j", function () { return S; }), n.d(e, "K", function () { return C; }), n.d(e, "g", function () { return j; }), n.d(e, "u", function () { return E; }), n.d(e, "A", function () { return y; }), n.d(e, "B", function () { return v; }), n.d(e, "D", function () { return N; }), n.d(e, "H", function () { return P; }), n.d(e, "J", function () { return B; }), n.d(e, "m", function () { return c; }), n.d(e, "n", function () { return D; }), n.d(e, "o", function () { return _; }), n.d(e, "r", function () { return s; }), n.d(e, "s", function () { return u; }), n.d(e, "t", function () { return k; }), n.d(e, "v", function () { return l; }), n.d(e, "w", function () { return g; }), n.d(e, "x", function () { return x; }), n.d(e, "b", function () { return W; }), n.d(e, "c", function () { return G; }), n.d(e, "d", function () { return H; }), n.d(e, "e", function () { return d; }), n.d(e, "l", function () { return V; }), n.d(e, "p", function () { return Z; }), n.d(e, "q", function () { return K; }), n.d(e, "z", function () { return Q; }), n.d(e, "C", function () { return z; }), n.d(e, "a", function () { return z; }), n.d(e, "h", function () { return $; }), n.d(e, "G", function () { return J; }), n.d(e, "I", function () { return et; }), n.d(e, "E", function () { return nt; }), n.d(e, "F", function () { return rt; }); var r = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; e(o, i) && n.push(o); } return n; }, o = {}.toString, a = function (t, e) { return o.call(t) === "[object " + e + "]"; }, s = function (t) { return a(t, "Function"); }, u = function (t) { return null == t; }, c = function (t) { return Array.isArray ? Array.isArray(t) : a(t, "Array"); }; function h(t) { return (h = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var l = function (t) { var e = h(t); return (null !== t && "object" === e) || "function" === e; }; var d = function (t, e) { if (t) if (c(t)) for (var n = 0, r = t.length; n < r && !1 !== e(t[n], n); n++); else if (l(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === e(t[i], i)) break; }; Object.keys; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var p = function (t) { return "object" === f(t) && null !== t; }, g = function (t) { if (!p(t) || !a(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var e = t; null !== Object.getPrototypeOf(e); ) e = Object.getPrototypeOf(e); return Object.getPrototypeOf(t) === e; }; var y = function (t) { if (c(t)) return t.reduce(function (t, e) { return Math.max(t, e); }, t[0]); }, v = function (t) { if (c(t)) return t.reduce(function (t, e) { return Math.min(t, e); }, t[0]); }, m = function (t) { var e = t.filter(function (t) { return !isNaN(t); }); if (!e.length) return { min: 0, max: 0 }; if (c(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); e = n; } var i = y(e); return { min: v(e), max: i }; }, b = Array.prototype, x = (b.splice, b.indexOf, Array.prototype.splice, function (t) { return a(t, "String"); }); function w(t) { if (r(t)) return t[0]; } function O(t) { if (r(t)) { return t[t.length - 1]; } } var M = Object.prototype.hasOwnProperty; var S = function (t, e) { if (!e || !c(t)) return {}; for ( var n, r = {}, i = s(e) ? e : function (t) { return t[e]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (n = i(a)), M.call(r, n) ? r[n].push(a) : (r[n] = [a]); } return r; }; var C = function (t, e) { if (t["_wrap_" + e]) return t["_wrap_" + e]; var n = function (n) { t[e](n); }; return (t["_wrap_" + e] = n), n; }; var j = function (t, e) { var n = e.toString(), r = n.indexOf("."); if (-1 === r) return Math.round(t); var i = n.substr(r + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }, k = function (t) { return a(t, "Number"); }; Number.isInteger && Number.isInteger; function E(t, e, n) { return void 0 === n && (n = 1e-5), Math.abs(t - e) < n; } var N = function (t, e) { return ((t % e) + e) % e; }, T = (Math.PI, parseInt, Math.PI / 180), P = function (t) { return T * t; }, I = (Object.values, function (t) { return u(t) ? "" : t.toString(); }); var B = function (t) { var e = I(t); return e.charAt(0).toUpperCase() + e.substring(1); }, A = {}.toString, L = function (t) { return A.call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }, D = function (t) { return a(t, "Boolean"); }, _ = function (t) { return a(t, "Date"); }, R = Object.prototype, Y = function (t) { var e = t && t.constructor; return t === (("function" == typeof e && e.prototype) || R); }; function F(t, e) { for (var n in e) e.hasOwnProperty(n) && "constructor" !== n && void 0 !== e[n] && (t[n] = e[n]); } function z(t, e, n, r) { return e && F(t, e), n && F(t, n), r && F(t, r), t; } function X(t) { return (X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var W = function t(e) { if ("object" !== X(e) || null === e) return e; var n; if (c(e)) { n = []; for (var r = 0, i = e.length; r < i; r++) "object" === X(e[r]) && null != e[r] ? (n[r] = t(e[r])) : (n[r] = e[r]); } else for (var o in ((n = {}), e)) "object" === X(e[o]) && null != e[o] ? (n[o] = t(e[o])) : (n[o] = e[o]); return n; }; var G = function (t, e, n) { var r; return function () { var i = this, o = arguments, a = function () { (r = null), n || t.apply(i, o); }, s = n && !r; clearTimeout(r), (r = setTimeout(a, e)), s && t.apply(i, o); }; }; function q(t, e, n, r) { for (var i in ((n = n || 0), (r = r || 5), e)) if (e.hasOwnProperty(i)) { var o = e[i]; null !== o && g(o) ? (g(t[i]) || (t[i] = {}), n < r ? q(t[i], o, n + 1, r) : (t[i] = e[i])) : c(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var H = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r += 1) q(t, e[r]); return t; }, V = function (t, e) { if (!r(t)) return -1; var n = Array.prototype.indexOf; if (n) return n.call(t, e); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === e) { i = o; break; } return i; }, U = Object.prototype.hasOwnProperty; var Z = function (t) { if (u(t)) return !0; if (r(t)) return !t.length; var e = L(t); if ("Map" === e || "Set" === e) return !t.size; if (Y(t)) return !Object.keys(t).length; for (var n in t) if (U.call(t, n)) return !1; return !0; }, K = function t(e, n) { if (e === n) return !0; if (!e || !n) return !1; if (x(e) || x(n)) return !1; if (r(e) || r(n)) { if (e.length !== n.length) return !1; for (var i = !0, o = 0; o < e.length && (i = t(e[o], n[o])); o++); return i; } if (p(e) || p(n)) { var a = Object.keys(e), s = Object.keys(n); if (a.length !== s.length) return !1; for (i = !0, o = 0; o < a.length && (i = t(e[a[o]], n[a[o]])); o++); return i; } return !1; }, Q = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; n.push(e(o, i)); } return n; }, $ = function (t, e, n) { for (var r = 0, i = x(e) ? e.split(".") : e; t && r < i.length; ) t = t[i[r++]]; return void 0 === t || r < i.length ? n : t; }, J = (Object.prototype.hasOwnProperty, function (t, e, n) { var r, i, o, a, s = 0; n || (n = {}); var u = function () { (s = !1 === n.leading ? 0 : Date.now()), (r = null), (a = t.apply(i, o)), r || (i = o = null); }, c = function () { var c = Date.now(); s || !1 !== n.leading || (s = c); var h = e - (c - s); return ( (i = this), (o = arguments), h <= 0 || h > e ? (r && (clearTimeout(r), (r = null)), (s = c), (a = t.apply(i, o)), r || (i = o = null)) : r || !1 === n.trailing || (r = setTimeout(u, h)), a ); }; return ( (c.cancel = function () { clearTimeout(r), (s = 0), (r = i = o = null); }), c ); }), tt = {}, et = function (t) { return tt[(t = t || "g")] ? (tt[t] += 1) : (tt[t] = 1), t + tt[t]; }, nt = function () {}; function rt(t) { return u(t) ? 0 : r(t) ? t.length : Object.keys(t).length; } !(function () { function t() { this.map = {}; } (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, e) { var n = this.map[t]; return void 0 === n ? e : n; }), (t.prototype.set = function (t, e) { this.map[t] = e; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }); })(); }, function (t, e, n) { "use strict"; n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }), n.d(e, "e", function () { return a; }), n.d(e, "b", function () { return s; }), n.d(e, "d", function () { return u; }), n.d(e, "g", function () { return c; }), n.d(e, "f", function () { return h; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }; function i(t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); } var o = function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function a(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } function s(t, e, n, r) { return new (n || (n = Promise))(function (i, o) { function a(t) { try { u(r.next(t)); } catch (t) { o(t); } } function s(t) { try { u(r.throw(t)); } catch (t) { o(t); } } function u(t) { var e; t.done ? i(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((r = r.apply(t, e || [])).next()); }); } function u(t, e) { var n, r, i, o, a = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: s(0), throw: s(1), return: s(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function s(o) { return function (s) { return (function (o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if ( ((n = 1), r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) ) return i; switch (((r = 0), i && (o = [2 & o[0], i.value]), o[0])) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, (r = o[1]), (o = [0]); continue; case 7: (o = a.ops.pop()), a.trys.pop(); continue; default: if ( !((i = a.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== o[0] && 2 !== o[0])) ) { a = 0; continue; } if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) { a.label = o[1]; break; } if (6 === o[0] && a.label < i[1]) { (a.label = i[1]), (i = o); break; } if (i && a.label < i[2]) { (a.label = i[2]), a.ops.push(o); break; } i[2] && a.ops.pop(), a.trys.pop(); continue; } o = e.call(t, a); } catch (t) { (o = [6, t]), (r = 0); } finally { n = i = 0; } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 }; })([o, s]); }; } } Object.create; function c() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; } function h(t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || e); } Object.create; }, function (t, e, n) { "use strict"; n.d(e, "b", function () { return r; }), n.d(e, "c", function () { return Y; }), n.d(e, "d", function () { return i; }), n.d(e, "a", function () { return o; }); var r = {}; n.r(r), n.d(r, "create", function () { return s; }), n.d(r, "fromMat4", function () { return u; }), n.d(r, "clone", function () { return c; }), n.d(r, "copy", function () { return h; }), n.d(r, "fromValues", function () { return l; }), n.d(r, "set", function () { return d; }), n.d(r, "identity", function () { return f; }), n.d(r, "transpose", function () { return p; }), n.d(r, "invert", function () { return g; }), n.d(r, "adjoint", function () { return y; }), n.d(r, "determinant", function () { return v; }), n.d(r, "multiply", function () { return m; }), n.d(r, "translate", function () { return b; }), n.d(r, "rotate", function () { return x; }), n.d(r, "scale", function () { return w; }), n.d(r, "fromTranslation", function () { return O; }), n.d(r, "fromRotation", function () { return M; }), n.d(r, "fromScaling", function () { return S; }), n.d(r, "fromMat2d", function () { return C; }), n.d(r, "fromQuat", function () { return j; }), n.d(r, "normalFromMat4", function () { return k; }), n.d(r, "projection", function () { return E; }), n.d(r, "str", function () { return N; }), n.d(r, "frob", function () { return T; }), n.d(r, "add", function () { return P; }), n.d(r, "subtract", function () { return I; }), n.d(r, "multiplyScalar", function () { return B; }), n.d(r, "multiplyScalarAndAdd", function () { return A; }), n.d(r, "exactEquals", function () { return L; }), n.d(r, "equals", function () { return D; }), n.d(r, "mul", function () { return _; }), n.d(r, "sub", function () { return R; }); var i = {}; n.r(i), n.d(i, "create", function () { return F; }), n.d(i, "clone", function () { return z; }), n.d(i, "length", function () { return X; }), n.d(i, "fromValues", function () { return W; }), n.d(i, "copy", function () { return G; }), n.d(i, "set", function () { return q; }), n.d(i, "add", function () { return H; }), n.d(i, "subtract", function () { return V; }), n.d(i, "multiply", function () { return U; }), n.d(i, "divide", function () { return Z; }), n.d(i, "ceil", function () { return K; }), n.d(i, "floor", function () { return Q; }), n.d(i, "min", function () { return $; }), n.d(i, "max", function () { return J; }), n.d(i, "round", function () { return tt; }), n.d(i, "scale", function () { return et; }), n.d(i, "scaleAndAdd", function () { return nt; }), n.d(i, "distance", function () { return rt; }), n.d(i, "squaredDistance", function () { return it; }), n.d(i, "squaredLength", function () { return ot; }), n.d(i, "negate", function () { return at; }), n.d(i, "inverse", function () { return st; }), n.d(i, "normalize", function () { return ut; }), n.d(i, "dot", function () { return ct; }), n.d(i, "cross", function () { return ht; }), n.d(i, "lerp", function () { return lt; }), n.d(i, "hermite", function () { return dt; }), n.d(i, "bezier", function () { return ft; }), n.d(i, "random", function () { return pt; }), n.d(i, "transformMat4", function () { return gt; }), n.d(i, "transformMat3", function () { return yt; }), n.d(i, "transformQuat", function () { return vt; }), n.d(i, "rotateX", function () { return mt; }), n.d(i, "rotateY", function () { return bt; }), n.d(i, "rotateZ", function () { return xt; }), n.d(i, "angle", function () { return wt; }), n.d(i, "zero", function () { return Ot; }), n.d(i, "str", function () { return Mt; }), n.d(i, "exactEquals", function () { return St; }), n.d(i, "equals", function () { return Ct; }), n.d(i, "sub", function () { return kt; }), n.d(i, "mul", function () { return Et; }), n.d(i, "div", function () { return Nt; }), n.d(i, "dist", function () { return Tt; }), n.d(i, "sqrDist", function () { return Pt; }), n.d(i, "len", function () { return It; }), n.d(i, "sqrLen", function () { return Bt; }), n.d(i, "forEach", function () { return At; }); var o = {}; n.r(o), n.d(o, "leftTranslate", function () { return Lt; }), n.d(o, "leftRotate", function () { return Dt; }), n.d(o, "leftScale", function () { return _t; }), n.d(o, "transform", function () { return Rt; }), n.d(o, "direction", function () { return Yt; }), n.d(o, "angleTo", function () { return Ft; }), n.d(o, "vertical", function () { return zt; }); var a = n(4); function s() { var t = new a.a(9); return ( a.a != Float32Array && ((t[1] = 0), (t[2] = 0), (t[3] = 0), (t[5] = 0), (t[6] = 0), (t[7] = 0)), (t[0] = 1), (t[4] = 1), (t[8] = 1), t ); } function u(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[4]), (t[4] = e[5]), (t[5] = e[6]), (t[6] = e[8]), (t[7] = e[9]), (t[8] = e[10]), t ); } function c(t) { var e = new a.a(9); return ( (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), e ); } function h(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function l(t, e, n, r, i, o, s, u, c) { var h = new a.a(9); return ( (h[0] = t), (h[1] = e), (h[2] = n), (h[3] = r), (h[4] = i), (h[5] = o), (h[6] = s), (h[7] = u), (h[8] = c), h ); } function d(t, e, n, r, i, o, a, s, u, c) { return ( (t[0] = e), (t[1] = n), (t[2] = r), (t[3] = i), (t[4] = o), (t[5] = a), (t[6] = s), (t[7] = u), (t[8] = c), t ); } function f(t) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function p(t, e) { if (t === e) { var n = e[1], r = e[2], i = e[5]; (t[1] = e[3]), (t[2] = e[6]), (t[3] = n), (t[5] = e[7]), (t[6] = r), (t[7] = i); } else (t[0] = e[0]), (t[1] = e[3]), (t[2] = e[6]), (t[3] = e[1]), (t[4] = e[4]), (t[5] = e[7]), (t[6] = e[2]), (t[7] = e[5]), (t[8] = e[8]); return t; } function g(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], u = e[6], c = e[7], h = e[8], l = h * a - s * c, d = -h * o + s * u, f = c * o - a * u, p = n * l + r * d + i * f; return p ? ((p = 1 / p), (t[0] = l * p), (t[1] = (-h * r + i * c) * p), (t[2] = (s * r - i * a) * p), (t[3] = d * p), (t[4] = (h * n - i * u) * p), (t[5] = (-s * n + i * o) * p), (t[6] = f * p), (t[7] = (-c * n + r * u) * p), (t[8] = (a * n - r * o) * p), t) : null; } function y(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], u = e[6], c = e[7], h = e[8]; return ( (t[0] = a * h - s * c), (t[1] = i * c - r * h), (t[2] = r * s - i * a), (t[3] = s * u - o * h), (t[4] = n * h - i * u), (t[5] = i * o - n * s), (t[6] = o * c - a * u), (t[7] = r * u - n * c), (t[8] = n * a - r * o), t ); } function v(t) { var e = t[0], n = t[1], r = t[2], i = t[3], o = t[4], a = t[5], s = t[6], u = t[7], c = t[8]; return e * (c * o - a * u) + n * (-c * i + a * s) + r * (u * i - o * s); } function m(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], u = e[5], c = e[6], h = e[7], l = e[8], d = n[0], f = n[1], p = n[2], g = n[3], y = n[4], v = n[5], m = n[6], b = n[7], x = n[8]; return ( (t[0] = d * r + f * a + p * c), (t[1] = d * i + f * s + p * h), (t[2] = d * o + f * u + p * l), (t[3] = g * r + y * a + v * c), (t[4] = g * i + y * s + v * h), (t[5] = g * o + y * u + v * l), (t[6] = m * r + b * a + x * c), (t[7] = m * i + b * s + x * h), (t[8] = m * o + b * u + x * l), t ); } function b(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], u = e[5], c = e[6], h = e[7], l = e[8], d = n[0], f = n[1]; return ( (t[0] = r), (t[1] = i), (t[2] = o), (t[3] = a), (t[4] = s), (t[5] = u), (t[6] = d * r + f * a + c), (t[7] = d * i + f * s + h), (t[8] = d * o + f * u + l), t ); } function x(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], u = e[5], c = e[6], h = e[7], l = e[8], d = Math.sin(n), f = Math.cos(n); return ( (t[0] = f * r + d * a), (t[1] = f * i + d * s), (t[2] = f * o + d * u), (t[3] = f * a - d * r), (t[4] = f * s - d * i), (t[5] = f * u - d * o), (t[6] = c), (t[7] = h), (t[8] = l), t ); } function w(t, e, n) { var r = n[0], i = n[1]; return ( (t[0] = r * e[0]), (t[1] = r * e[1]), (t[2] = r * e[2]), (t[3] = i * e[3]), (t[4] = i * e[4]), (t[5] = i * e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function O(t, e) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = e[0]), (t[7] = e[1]), (t[8] = 1), t ); } function M(t, e) { var n = Math.sin(e), r = Math.cos(e); return ( (t[0] = r), (t[1] = n), (t[2] = 0), (t[3] = -n), (t[4] = r), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function S(t, e) { return ( (t[0] = e[0]), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = e[1]), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function C(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = 0), (t[3] = e[2]), (t[4] = e[3]), (t[5] = 0), (t[6] = e[4]), (t[7] = e[5]), (t[8] = 1), t ); } function j(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = n + n, s = r + r, u = i + i, c = n * a, h = r * a, l = r * s, d = i * a, f = i * s, p = i * u, g = o * a, y = o * s, v = o * u; return ( (t[0] = 1 - l - p), (t[3] = h - v), (t[6] = d + y), (t[1] = h + v), (t[4] = 1 - c - p), (t[7] = f - g), (t[2] = d - y), (t[5] = f + g), (t[8] = 1 - c - l), t ); } function k(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], u = e[6], c = e[7], h = e[8], l = e[9], d = e[10], f = e[11], p = e[12], g = e[13], y = e[14], v = e[15], m = n * s - r * a, b = n * u - i * a, x = n * c - o * a, w = r * u - i * s, O = r * c - o * s, M = i * c - o * u, S = h * g - l * p, C = h * y - d * p, j = h * v - f * p, k = l * y - d * g, E = l * v - f * g, N = d * v - f * y, T = m * N - b * E + x * k + w * j - O * C + M * S; return T ? ((T = 1 / T), (t[0] = (s * N - u * E + c * k) * T), (t[1] = (u * j - a * N - c * C) * T), (t[2] = (a * E - s * j + c * S) * T), (t[3] = (i * E - r * N - o * k) * T), (t[4] = (n * N - i * j + o * C) * T), (t[5] = (r * j - n * E - o * S) * T), (t[6] = (g * M - y * O + v * w) * T), (t[7] = (y * x - p * M - v * b) * T), (t[8] = (p * O - g * x + v * m) * T), t) : null; } function E(t, e, n) { return ( (t[0] = 2 / e), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = -2 / n), (t[5] = 0), (t[6] = -1), (t[7] = 1), (t[8] = 1), t ); } function N(t) { return ( "mat3(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ", " + t[4] + ", " + t[5] + ", " + t[6] + ", " + t[7] + ", " + t[8] + ")" ); } function T(t) { return Math.hypot(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8]); } function P(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), (t[3] = e[3] + n[3]), (t[4] = e[4] + n[4]), (t[5] = e[5] + n[5]), (t[6] = e[6] + n[6]), (t[7] = e[7] + n[7]), (t[8] = e[8] + n[8]), t ); } function I(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), (t[3] = e[3] - n[3]), (t[4] = e[4] - n[4]), (t[5] = e[5] - n[5]), (t[6] = e[6] - n[6]), (t[7] = e[7] - n[7]), (t[8] = e[8] - n[8]), t ); } function B(t, e, n) { return ( (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), (t[3] = e[3] * n), (t[4] = e[4] * n), (t[5] = e[5] * n), (t[6] = e[6] * n), (t[7] = e[7] * n), (t[8] = e[8] * n), t ); } function A(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), (t[3] = e[3] + n[3] * r), (t[4] = e[4] + n[4] * r), (t[5] = e[5] + n[5] * r), (t[6] = e[6] + n[6] * r), (t[7] = e[7] + n[7] * r), (t[8] = e[8] + n[8] * r), t ); } function L(t, e) { return ( t[0] === e[0] && t[1] === e[1] && t[2] === e[2] && t[3] === e[3] && t[4] === e[4] && t[5] === e[5] && t[6] === e[6] && t[7] === e[7] && t[8] === e[8] ); } function D(t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], s = t[4], u = t[5], c = t[6], h = t[7], l = t[8], d = e[0], f = e[1], p = e[2], g = e[3], y = e[4], v = e[5], m = e[6], b = e[7], x = e[8]; return ( Math.abs(n - d) <= a.b * Math.max(1, Math.abs(n), Math.abs(d)) && Math.abs(r - f) <= a.b * Math.max(1, Math.abs(r), Math.abs(f)) && Math.abs(i - p) <= a.b * Math.max(1, Math.abs(i), Math.abs(p)) && Math.abs(o - g) <= a.b * Math.max(1, Math.abs(o), Math.abs(g)) && Math.abs(s - y) <= a.b * Math.max(1, Math.abs(s), Math.abs(y)) && Math.abs(u - v) <= a.b * Math.max(1, Math.abs(u), Math.abs(v)) && Math.abs(c - m) <= a.b * Math.max(1, Math.abs(c), Math.abs(m)) && Math.abs(h - b) <= a.b * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(l - x) <= a.b * Math.max(1, Math.abs(l), Math.abs(x)) ); } var _ = m, R = I, Y = n(9); function F() { var t = new a.a(3); return a.a != Float32Array && ((t[0] = 0), (t[1] = 0), (t[2] = 0)), t; } function z(t) { var e = new a.a(3); return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), e; } function X(t) { var e = t[0], n = t[1], r = t[2]; return Math.hypot(e, n, r); } function W(t, e, n) { var r = new a.a(3); return (r[0] = t), (r[1] = e), (r[2] = n), r; } function G(t, e) { return (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), t; } function q(t, e, n, r) { return (t[0] = e), (t[1] = n), (t[2] = r), t; } function H(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), t ); } function V(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), t ); } function U(t, e, n) { return ( (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), (t[2] = e[2] * n[2]), t ); } function Z(t, e, n) { return ( (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), (t[2] = e[2] / n[2]), t ); } function K(t, e) { return ( (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), (t[2] = Math.ceil(e[2])), t ); } function Q(t, e) { return ( (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), (t[2] = Math.floor(e[2])), t ); } function $(t, e, n) { return ( (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), (t[2] = Math.min(e[2], n[2])), t ); } function J(t, e, n) { return ( (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), (t[2] = Math.max(e[2], n[2])), t ); } function tt(t, e) { return ( (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), (t[2] = Math.round(e[2])), t ); } function et(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), t; } function nt(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), t ); } function rt(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return Math.hypot(n, r, i); } function it(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return n * n + r * r + i * i; } function ot(t) { var e = t[0], n = t[1], r = t[2]; return e * e + n * n + r * r; } function at(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), (t[2] = -e[2]), t; } function st(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), (t[2] = 1 / e[2]), t; } function ut(t, e) { var n = e[0], r = e[1], i = e[2], o = n * n + r * r + i * i; return ( o > 0 && (o = 1 / Math.sqrt(o)), (t[0] = e[0] * o), (t[1] = e[1] * o), (t[2] = e[2] * o), t ); } function ct(t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2]; } function ht(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[0], s = n[1], u = n[2]; return ( (t[0] = i * u - o * s), (t[1] = o * a - r * u), (t[2] = r * s - i * a), t ); } function lt(t, e, n, r) { var i = e[0], o = e[1], a = e[2]; return ( (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), (t[2] = a + r * (n[2] - a)), t ); } function dt(t, e, n, r, i, o) { var a = o * o, s = a * (2 * o - 3) + 1, u = a * (o - 2) + o, c = a * (o - 1), h = a * (3 - 2 * o); return ( (t[0] = e[0] * s + n[0] * u + r[0] * c + i[0] * h), (t[1] = e[1] * s + n[1] * u + r[1] * c + i[1] * h), (t[2] = e[2] * s + n[2] * u + r[2] * c + i[2] * h), t ); } function ft(t, e, n, r, i, o) { var a = 1 - o, s = a * a, u = o * o, c = s * a, h = 3 * o * s, l = 3 * u * a, d = u * o; return ( (t[0] = e[0] * c + n[0] * h + r[0] * l + i[0] * d), (t[1] = e[1] * c + n[1] * h + r[1] * l + i[1] * d), (t[2] = e[2] * c + n[2] * h + r[2] * l + i[2] * d), t ); } function pt(t, e) { e = e || 1; var n = 2 * a.c() * Math.PI, r = 2 * a.c() - 1, i = Math.sqrt(1 - r * r) * e; return ( (t[0] = Math.cos(n) * i), (t[1] = Math.sin(n) * i), (t[2] = r * e), t ); } function gt(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[3] * r + n[7] * i + n[11] * o + n[15]; return ( (a = a || 1), (t[0] = (n[0] * r + n[4] * i + n[8] * o + n[12]) / a), (t[1] = (n[1] * r + n[5] * i + n[9] * o + n[13]) / a), (t[2] = (n[2] * r + n[6] * i + n[10] * o + n[14]) / a), t ); } function yt(t, e, n) { var r = e[0], i = e[1], o = e[2]; return ( (t[0] = r * n[0] + i * n[3] + o * n[6]), (t[1] = r * n[1] + i * n[4] + o * n[7]), (t[2] = r * n[2] + i * n[5] + o * n[8]), t ); } function vt(t, e, n) { var r = n[0], i = n[1], o = n[2], a = n[3], s = e[0], u = e[1], c = e[2], h = i * c - o * u, l = o * s - r * c, d = r * u - i * s, f = i * d - o * l, p = o * h - r * d, g = r * l - i * h, y = 2 * a; return ( (h *= y), (l *= y), (d *= y), (f *= 2), (p *= 2), (g *= 2), (t[0] = s + h + f), (t[1] = u + l + p), (t[2] = c + d + g), t ); } function mt(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0]), (o[1] = i[1] * Math.cos(r) - i[2] * Math.sin(r)), (o[2] = i[1] * Math.sin(r) + i[2] * Math.cos(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function bt(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[2] * Math.sin(r) + i[0] * Math.cos(r)), (o[1] = i[1]), (o[2] = i[2] * Math.cos(r) - i[0] * Math.sin(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function xt(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0] * Math.cos(r) - i[1] * Math.sin(r)), (o[1] = i[0] * Math.sin(r) + i[1] * Math.cos(r)), (o[2] = i[2]), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function wt(t, e) { var n = t[0], r = t[1], i = t[2], o = e[0], a = e[1], s = e[2], u = Math.sqrt(n * n + r * r + i * i) * Math.sqrt(o * o + a * a + s * s), c = u && ct(t, e) / u; return Math.acos(Math.min(Math.max(c, -1), 1)); } function Ot(t) { return (t[0] = 0), (t[1] = 0), (t[2] = 0), t; } function Mt(t) { return "vec3(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; } function St(t, e) { return t[0] === e[0] && t[1] === e[1] && t[2] === e[2]; } function Ct(t, e) { var n = t[0], r = t[1], i = t[2], o = e[0], s = e[1], u = e[2]; return ( Math.abs(n - o) <= a.b * Math.max(1, Math.abs(n), Math.abs(o)) && Math.abs(r - s) <= a.b * Math.max(1, Math.abs(r), Math.abs(s)) && Math.abs(i - u) <= a.b * Math.max(1, Math.abs(i), Math.abs(u)) ); } var jt, kt = V, Et = U, Nt = Z, Tt = rt, Pt = it, It = X, Bt = ot, At = ((jt = F()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 3), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (jt[0] = t[a]), (jt[1] = t[a + 1]), (jt[2] = t[a + 2]), i(jt, jt, o), (t[a] = jt[0]), (t[a + 1] = jt[1]), (t[a + 2] = jt[2]); return t; }); function Lt(t, e, n) { var i = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return r.fromTranslation(i, n), r.multiply(t, i, e); } function Dt(t, e, n) { var i = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return r.fromRotation(i, n), r.multiply(t, i, e); } function _t(t, e, n) { var i = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return r.fromScaling(i, n), r.multiply(t, i, e); } function Rt(t, e) { for ( var n, i, o, a = t ? [].concat(t) : [1, 0, 0, 0, 1, 0, 0, 0, 1], s = 0, u = e.length; s < u; s++ ) { var c = e[s]; switch (c[0]) { case "t": Lt(a, a, [c[1], c[2]]); break; case "s": _t(a, a, [c[1], c[2]]); break; case "r": Dt(a, a, c[1]); break; case "m": (n = a), (i = a), (o = c[1]), r.multiply(n, o, i); } } return a; } function Yt(t, e) { return t[0] * e[1] - e[0] * t[1]; } function Ft(t, e, n) { var r = Y.angle(t, e), i = Yt(t, e) >= 0; return n ? (i ? 2 * Math.PI - r : r) : i ? r : 2 * Math.PI - r; } function zt(t, e, n) { return ( n ? ((t[0] = e[1]), (t[1] = -1 * e[0])) : ((t[0] = -1 * e[1]), (t[1] = e[0])), t ); } }, function (t, e, n) { "use strict"; n.d(e, "j", function () { return i; }), n.d(e, "c", function () { return o; }), n.d(e, "g", function () { return a; }), n.d(e, "b", function () { return s; }); var r = n(0); function i(t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); } n.d(e, "e", function () { return r.s; }), n.d(e, "d", function () { return r.r; }), n.d(e, "h", function () { return r.x; }), n.d(e, "f", function () { return r.v; }), n.d(e, "i", function () { return r.C; }), n.d(e, "a", function () { return r.e; }), n.d(e, "k", function () { return r.J; }); var o = "undefined" != typeof window && void 0 !== window.document; function a(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } function s(t) { return t.cfg.visible && t.cfg.capture; } }, function (t, e, n) { "use strict"; n.d(e, "b", function () { return r; }), n.d(e, "a", function () { return i; }), n.d(e, "c", function () { return o; }); var r = 1e-6, i = "undefined" != typeof Float32Array ? Float32Array : Array, o = Math.random; Math.PI; Math.hypot || (Math.hypot = function () { for (var t = 0, e = arguments.length; e--; ) t += arguments[e] * arguments[e]; return Math.sqrt(t); }); }, function (t, e, n) { "use strict"; function r(t, e) { var n = [], r = t[0], i = t[1], o = t[2], a = t[3], s = t[4], u = t[5], c = t[6], h = t[7], l = t[8], d = e[0], f = e[1], p = e[2], g = e[3], y = e[4], v = e[5], m = e[6], b = e[7], x = e[8]; return ( (n[0] = d * r + f * a + p * c), (n[1] = d * i + f * s + p * h), (n[2] = d * o + f * u + p * l), (n[3] = g * r + y * a + v * c), (n[4] = g * i + y * s + v * h), (n[5] = g * o + y * u + v * l), (n[6] = m * r + b * a + x * c), (n[7] = m * i + b * s + x * h), (n[8] = m * o + b * u + x * l), n ); } function i(t, e) { var n = [], r = e[0], i = e[1]; return ( (n[0] = t[0] * r + t[3] * i + t[6]), (n[1] = t[1] * r + t[4] * i + t[7]), n ); } function o(t) { var e = [], n = t[0], r = t[1], i = t[2], o = t[3], a = t[4], s = t[5], u = t[6], c = t[7], h = t[8], l = h * a - s * c, d = -h * o + s * u, f = c * o - a * u, p = n * l + r * d + i * f; return p ? ((p = 1 / p), (e[0] = l * p), (e[1] = (-h * r + i * c) * p), (e[2] = (s * r - i * a) * p), (e[3] = d * p), (e[4] = (h * n - i * u) * p), (e[5] = (-s * n + i * o) * p), (e[6] = f * p), (e[7] = (-c * n + r * u) * p), (e[8] = (a * n - r * o) * p), e) : null; } n.d(e, "b", function () { return r; }), n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }); }, function (t, e, n) { "use strict"; n.d(e, "a", function () { return h; }), n.d(e, "b", function () { return f; }), n.d(e, "c", function () { return s; }); var r = n(0), i = "\t\n\v\f\r   ᠎              \u2028\u2029", o = new RegExp( "([a-z])[" + i + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + i + "]*,?[" + i + "]*)+)", "ig", ), a = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + i + "]*,?[" + i + "]*", "ig", ), s = function (t) { if (!t) return null; if (Object(r.m)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(o, function (r, i, o) { var s = [], u = i.toLowerCase(); if ( (o.replace(a, function (t, e) { e && s.push(+e); }), "m" === u && s.length > 2 && (n.push([i].concat(s.splice(0, 2))), (u = "l"), (i = "m" === i ? "l" : "L")), "o" === u && 1 === s.length && n.push([i, s[0]]), "r" === u) ) n.push([i].concat(s)); else for ( ; s.length >= e[u] && (n.push([i].concat(s.splice(0, e[u]))), e[u]); ); return t; }), n ); }; var u = function (t, e) { if (t.length !== e.length) return !1; var n = !0; return ( Object(r.e)(t, function (t, r) { if (t !== e[r]) return (n = !1), !1; }), n ); }; function c(t, e, n) { var r = null, i = n; return ( e < i && ((i = e), (r = "add")), t < i && ((i = t), (r = "del")), { type: r, min: i } ); } var h = function (t, e) { var n = (function (t, e) { var n, r, i = t.length, o = e.length, a = 0; if (0 === i || 0 === o) return null; for (var s = [], h = 0; h <= i; h++) (s[h] = []), (s[h][0] = { min: h }); for (var l = 0; l <= o; l++) s[0][l] = { min: l }; for (h = 1; h <= i; h++) { n = t[h - 1]; for (l = 1; l <= o; l++) { (r = e[l - 1]), (a = u(n, r) ? 0 : 1); var d = s[h - 1][l].min + 1, f = s[h][l - 1].min + 1, p = s[h - 1][l - 1].min + a; s[h][l] = c(d, f, p); } } return s; })(t, e), r = t.length, i = e.length, o = [], a = 1, s = 1; if (n[r][i].min !== r) { for (var h = 1; h <= r; h++) { var l = n[h][h].min; s = h; for (var d = a; d <= i; d++) n[h][d].min < l && ((l = n[h][d].min), (s = d)); (a = s), n[h][a].type && o.push({ index: h - 1, type: n[h][a].type }); } for (h = o.length - 1; h >= 0; h--) (a = o[h].index), "add" === o[h].type ? t.splice(a, 0, [].concat(t[a])) : t.splice(a, 1); } var f = i - (r = t.length); if (r < i) for (h = 0; h < f; h++) "z" === t[r - 1][0] || "Z" === t[r - 1][0] ? t.splice(r - 2, 0, t[r - 2]) : t.push(t[r - 1]), (r += 1); return t; }; function l(t, e, n) { for ( var r, i = [].concat(t), o = 1 / (n + 1), a = d(e)[0], s = 1; s <= n; s++ ) (o *= s), 0 === (r = Math.floor(t.length * o)) ? i.unshift([ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]) : i.splice(r, 0, [ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]); return i; } function d(t) { var e = []; switch (t[0]) { case "M": case "L": e.push([t[1], t[2]]); break; case "A": e.push([t[6], t[7]]); break; case "Q": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "T": e.push([t[1], t[2]]); break; case "C": e.push([t[5], t[6]]), e.push([t[1], t[2]]), e.push([t[3], t[4]]); break; case "S": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "H": case "V": e.push([t[1], t[1]]); } return e; } var f = function (t, e) { if (t.length <= 1) return t; for (var n, r = 0; r < e.length; r++) if (t[r][0] !== e[r][0]) switch (((n = d(t[r])), e[r][0])) { case "M": t[r] = ["M"].concat(n[0]); break; case "L": t[r] = ["L"].concat(n[0]); break; case "A": (t[r] = [].concat(e[r])), (t[r][6] = n[0][0]), (t[r][7] = n[0][1]); break; case "Q": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = l(n, t[r - 1], 1); } t[r] = ["Q"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "T": t[r] = ["T"].concat(n[0]); break; case "C": if (n.length < 3) { if (!(r > 0)) { t[r] = e[r]; break; } n = l(n, t[r - 1], 2); } t[r] = ["C"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "S": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = l(n, t[r - 1], 1); } t[r] = ["S"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; default: t[r] = e[r]; } return t; }; }, function (t, e, n) { "use strict"; n.d(e, "a", function () { return s; }), n.d(e, "b", function () { return l; }), n.d(e, "c", function () { return m; }); var r = n(0), i = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi, o = /[^\s\,]+/gi; var a = function (t) { var e = t || []; return Object(r.m)(e) ? e : Object(r.x)(e) ? ((e = e.match(i)), Object(r.e)(e, function (t, n) { if ((t = t.match(o))[0].length > 1) { var i = t[0].charAt(0); t.splice(1, 0, t[0].substr(1)), (t[0] = i); } Object(r.e)(t, function (e, n) { isNaN(e) || (t[n] = +e); }), (e[n] = t); }), e) : void 0; }; function s(t, e) { for (var n = [], r = 0, i = t.length; i - 2 * !e > r; r += 2) { var o = [ { x: +t[r - 2], y: +t[r - 1] }, { x: +t[r], y: +t[r + 1] }, { x: +t[r + 2], y: +t[r + 3] }, { x: +t[r + 4], y: +t[r + 5] }, ]; e ? r ? i - 4 === r ? (o[3] = { x: +t[0], y: +t[1] }) : i - 2 === r && ((o[2] = { x: +t[0], y: +t[1] }), (o[3] = { x: +t[2], y: +t[3] })) : (o[0] = { x: +t[i - 2], y: +t[i - 1] }) : i - 4 === r ? (o[3] = o[2]) : r || (o[0] = { x: +t[r], y: +t[r + 1] }), n.push([ "C", (-o[0].x + 6 * o[1].x + o[2].x) / 6, (-o[0].y + 6 * o[1].y + o[2].y) / 6, (o[1].x + 6 * o[2].x - o[3].x) / 6, (o[1].y + 6 * o[2].y - o[3].y) / 6, o[2].x, o[2].y, ]); } return n; } var u = "\t\n\v\f\r   ᠎              \u2028\u2029", c = new RegExp( "([a-z])[" + u + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + u + "]*,?[" + u + "]*)+)", "ig", ), h = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + u + "]*,?[" + u + "]*", "ig", ); function l(t) { if (!t) return null; if (Object(r.m)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(c, function (t, r, i) { var o = [], a = r.toLowerCase(); if ( (i.replace(h, function (t, e) { e && o.push(+e); }), "m" === a && o.length > 2 && (n.push([r].concat(o.splice(0, 2))), (a = "l"), (r = "m" === r ? "l" : "L")), "o" === a && 1 === o.length && n.push([r, o[0]]), "r" === a) ) n.push([r].concat(o)); else for ( ; o.length >= e[a] && (n.push([r].concat(o.splice(0, e[a]))), e[a]); ); return ""; }), n ); } function d(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function f(t, e) { return d(t) * d(e) ? (t[0] * e[0] + t[1] * e[1]) / (d(t) * d(e)) : 1; } function p(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(f(t, e)); } function g(t, e) { return t[0] === e[0] && t[1] === e[1]; } function y(t, e) { var n = e[1], i = e[2], o = Object(r.D)(Object(r.H)(e[3]), 2 * Math.PI), a = e[4], s = e[5], u = t[0], c = t[1], h = e[6], l = e[7], d = (Math.cos(o) * (u - h)) / 2 + (Math.sin(o) * (c - l)) / 2, y = (-1 * Math.sin(o) * (u - h)) / 2 + (Math.cos(o) * (c - l)) / 2, v = (d * d) / (n * n) + (y * y) / (i * i); v > 1 && ((n *= Math.sqrt(v)), (i *= Math.sqrt(v))); var m = n * n * (y * y) + i * i * (d * d), b = m ? Math.sqrt((n * n * (i * i) - m) / m) : 1; a === s && (b *= -1), isNaN(b) && (b = 0); var x = i ? (b * n * y) / i : 0, w = n ? (b * -i * d) / n : 0, O = (u + h) / 2 + Math.cos(o) * x - Math.sin(o) * w, M = (c + l) / 2 + Math.sin(o) * x + Math.cos(o) * w, S = [(d - x) / n, (y - w) / i], C = [(-1 * d - x) / n, (-1 * y - w) / i], j = p([1, 0], S), k = p(S, C); return ( f(S, C) <= -1 && (k = Math.PI), f(S, C) >= 1 && (k = 0), 0 === s && k > 0 && (k -= 2 * Math.PI), 1 === s && k < 0 && (k += 2 * Math.PI), { cx: O, cy: M, rx: g(t, [h, l]) ? 0 : n, ry: g(t, [h, l]) ? 0 : i, startAngle: j, endAngle: j + k, xRotation: o, arcFlag: a, sweepFlag: s, } ); } function v(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function m(t) { for ( var e = [], n = null, r = null, i = null, o = 0, s = (t = a(t)).length, u = 0; u < s; u++ ) { var c = t[u]; r = t[u + 1]; var h = c[0], l = { command: h, prePoint: n, params: c, startTangent: null, endTangent: null, }; switch (h) { case "M": (i = [c[1], c[2]]), (o = u); break; case "A": var d = y(n, c); l.arcParams = d; } if ("Z" === h) (n = i), (r = t[o + 1]); else { var f = c.length; n = [c[f - 2], c[f - 1]]; } r && "Z" === r[0] && ((r = t[o]), e[o] && (e[o].prePoint = n)), (l.currentPoint = n), e[o] && g(n, e[o].currentPoint) && (e[o].prePoint = l.prePoint); var p = r ? [r[r.length - 2], r[r.length - 1]] : null; l.nextPoint = p; var m = l.prePoint; if (["L", "H", "V"].includes(h)) (l.startTangent = [m[0] - n[0], m[1] - n[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]]); else if ("Q" === h) { var b = [c[1], c[2]]; (l.startTangent = [m[0] - b[0], m[1] - b[1]]), (l.endTangent = [n[0] - b[0], n[1] - b[1]]); } else if ("T" === h) { b = v((O = e[u - 1]).currentPoint, m); "Q" === O.command ? ((l.command = "Q"), (l.startTangent = [m[0] - b[0], m[1] - b[1]]), (l.endTangent = [n[0] - b[0], n[1] - b[1]])) : ((l.command = "TL"), (l.startTangent = [m[0] - n[0], m[1] - n[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])); } else if ("C" === h) { var x = [c[1], c[2]], w = [c[3], c[4]]; (l.startTangent = [m[0] - x[0], m[1] - x[1]]), (l.endTangent = [n[0] - w[0], n[1] - w[1]]); } else if ("S" === h) { var O; (x = v((O = e[u - 1]).currentPoint, m)), (w = [c[1], c[2]]); "C" === O.command ? ((l.command = "C"), (l.startTangent = [m[0] - x[0], m[1] - x[1]]), (l.endTangent = [n[0] - w[0], n[1] - w[1]])) : ((l.command = "SQ"), (l.startTangent = [m[0] - w[0], m[1] - w[1]]), (l.endTangent = [n[0] - w[0], n[1] - w[1]])); } else if ("A" === h) { var M = 0.001, S = l.arcParams || {}, C = S.cx, j = void 0 === C ? 0 : C, k = S.cy, E = void 0 === k ? 0 : k, N = S.rx, T = void 0 === N ? 0 : N, P = S.ry, I = void 0 === P ? 0 : P, B = S.sweepFlag, A = void 0 === B ? 0 : B, L = S.startAngle, D = void 0 === L ? 0 : L, _ = S.endAngle, R = void 0 === _ ? 0 : _; 0 === A && (M *= -1); var Y = T * Math.cos(D - M) + j, F = I * Math.sin(D - M) + E; l.startTangent = [Y - i[0], F - i[1]]; var z = T * Math.cos(D + R + M) + j, X = I * Math.sin(D + R - M) + E; l.endTangent = [m[0] - z, m[1] - X]; } e.push(l); } return e; } }, function (t, e, n) { "use strict"; n.d(e, "b", function () { return o; }), n.d(e, "c", function () { return a; }), n.d(e, "a", function () { return s; }); var r = n(3), i = n(12); function o(t, e, n) { var i = 1; return ( Object(r.h)(t) && (i = t.split("\n").length), i > 1 ? e * i + (function (t, e) { return e ? e - t : 0.14 * t; })(e, n) * (i - 1) : e ); } function a(t, e) { var n = Object(i.a)(), o = 0; if (Object(r.e)(t) || "" === t) return o; if ((n.save(), (n.font = e), Object(r.h)(t) && t.includes("\n"))) { var a = t.split("\n"); Object(r.a)(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; } function s(t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); } }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "fromValues", function () { return a; }), n.d(e, "copy", function () { return s; }), n.d(e, "set", function () { return u; }), n.d(e, "add", function () { return c; }), n.d(e, "subtract", function () { return h; }), n.d(e, "multiply", function () { return l; }), n.d(e, "divide", function () { return d; }), n.d(e, "ceil", function () { return f; }), n.d(e, "floor", function () { return p; }), n.d(e, "min", function () { return g; }), n.d(e, "max", function () { return y; }), n.d(e, "round", function () { return v; }), n.d(e, "scale", function () { return m; }), n.d(e, "scaleAndAdd", function () { return b; }), n.d(e, "distance", function () { return x; }), n.d(e, "squaredDistance", function () { return w; }), n.d(e, "length", function () { return O; }), n.d(e, "squaredLength", function () { return M; }), n.d(e, "negate", function () { return S; }), n.d(e, "inverse", function () { return C; }), n.d(e, "normalize", function () { return j; }), n.d(e, "dot", function () { return k; }), n.d(e, "cross", function () { return E; }), n.d(e, "lerp", function () { return N; }), n.d(e, "random", function () { return T; }), n.d(e, "transformMat2", function () { return P; }), n.d(e, "transformMat2d", function () { return I; }), n.d(e, "transformMat3", function () { return B; }), n.d(e, "transformMat4", function () { return A; }), n.d(e, "rotate", function () { return L; }), n.d(e, "angle", function () { return D; }), n.d(e, "zero", function () { return _; }), n.d(e, "str", function () { return R; }), n.d(e, "exactEquals", function () { return Y; }), n.d(e, "equals", function () { return F; }), n.d(e, "len", function () { return X; }), n.d(e, "sub", function () { return W; }), n.d(e, "mul", function () { return G; }), n.d(e, "div", function () { return q; }), n.d(e, "dist", function () { return H; }), n.d(e, "sqrDist", function () { return V; }), n.d(e, "sqrLen", function () { return U; }), n.d(e, "forEach", function () { return Z; }); var r = n(4); function i() { var t = new r.a(2); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0)), t; } function o(t) { var e = new r.a(2); return (e[0] = t[0]), (e[1] = t[1]), e; } function a(t, e) { var n = new r.a(2); return (n[0] = t), (n[1] = e), n; } function s(t, e) { return (t[0] = e[0]), (t[1] = e[1]), t; } function u(t, e, n) { return (t[0] = e), (t[1] = n), t; } function c(t, e, n) { return (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), t; } function h(t, e, n) { return (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), t; } function l(t, e, n) { return (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), t; } function d(t, e, n) { return (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), t; } function f(t, e) { return (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), t; } function p(t, e) { return (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), t; } function g(t, e, n) { return (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), t; } function y(t, e, n) { return (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), t; } function v(t, e) { return (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), t; } function m(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), t; } function b(t, e, n, r) { return (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), t; } function x(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return Math.hypot(n, r); } function w(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return n * n + r * r; } function O(t) { var e = t[0], n = t[1]; return Math.hypot(e, n); } function M(t) { var e = t[0], n = t[1]; return e * e + n * n; } function S(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), t; } function C(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), t; } function j(t, e) { var n = e[0], r = e[1], i = n * n + r * r; return ( i > 0 && (i = 1 / Math.sqrt(i)), (t[0] = e[0] * i), (t[1] = e[1] * i), t ); } function k(t, e) { return t[0] * e[0] + t[1] * e[1]; } function E(t, e, n) { var r = e[0] * n[1] - e[1] * n[0]; return (t[0] = t[1] = 0), (t[2] = r), t; } function N(t, e, n, r) { var i = e[0], o = e[1]; return (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), t; } function T(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI; return (t[0] = Math.cos(n) * e), (t[1] = Math.sin(n) * e), t; } function P(t, e, n) { var r = e[0], i = e[1]; return (t[0] = n[0] * r + n[2] * i), (t[1] = n[1] * r + n[3] * i), t; } function I(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[2] * i + n[4]), (t[1] = n[1] * r + n[3] * i + n[5]), t ); } function B(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[3] * i + n[6]), (t[1] = n[1] * r + n[4] * i + n[7]), t ); } function A(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[4] * i + n[12]), (t[1] = n[1] * r + n[5] * i + n[13]), t ); } function L(t, e, n, r) { var i = e[0] - n[0], o = e[1] - n[1], a = Math.sin(r), s = Math.cos(r); return (t[0] = i * s - o * a + n[0]), (t[1] = i * a + o * s + n[1]), t; } function D(t, e) { var n = t[0], r = t[1], i = e[0], o = e[1], a = Math.sqrt(n * n + r * r) * Math.sqrt(i * i + o * o), s = a && (n * i + r * o) / a; return Math.acos(Math.min(Math.max(s, -1), 1)); } function _(t) { return (t[0] = 0), (t[1] = 0), t; } function R(t) { return "vec2(" + t[0] + ", " + t[1] + ")"; } function Y(t, e) { return t[0] === e[0] && t[1] === e[1]; } function F(t, e) { var n = t[0], i = t[1], o = e[0], a = e[1]; return ( Math.abs(n - o) <= r.b * Math.max(1, Math.abs(n), Math.abs(o)) && Math.abs(i - a) <= r.b * Math.max(1, Math.abs(i), Math.abs(a)) ); } var z, X = O, W = h, G = l, q = d, H = x, V = w, U = M, Z = ((z = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 2), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (z[0] = t[a]), (z[1] = t[a + 1]), i(z, z, o), (t[a] = z[0]), (t[a + 1] = z[1]); return t; }); }, function (t, e, n) { "use strict"; var r = (function () { function t(t, e) { (this.bubbles = !0), (this.target = null), (this.currentTarget = null), (this.delegateTarget = null), (this.delegateObject = null), (this.defaultPrevented = !1), (this.propagationStopped = !1), (this.shape = null), (this.fromShape = null), (this.toShape = null), (this.propagationPath = []), (this.type = t), (this.name = t), (this.originalEvent = e), (this.timeStamp = e.timeStamp); } return ( (t.prototype.preventDefault = function () { (this.defaultPrevented = !0), this.originalEvent.preventDefault && this.originalEvent.preventDefault(); }), (t.prototype.stopPropagation = function () { this.propagationStopped = !0; }), (t.prototype.toString = function () { return "[Event (type=" + this.type + ")]"; }), (t.prototype.save = function () {}), (t.prototype.restore = function () {}), t ); })(); e.a = r; }, function (t, e, n) { "use strict"; var r = n(1), i = n(14), o = n(3), a = (function (t) { function e(e) { var n = t.call(this) || this; n.destroyed = !1; var r = n.getDefaultCfg(); return (n.cfg = Object(o.i)(r, e)), n; } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.set = function (t, e) { this.cfg[t] = e; }), (e.prototype.destroy = function () { (this.cfg = { destroyed: !0 }), this.off(), (this.destroyed = !0); }), e ); })(i.a); e.a = a; }, function (t, e, n) { "use strict"; n.d(e, "a", function () { return i; }); var r = null; function i() { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; } }, function (t, e, n) { "use strict"; n(6), n(17), n(18); var r = n(10); n.d(e, "Event", function () { return r.a; }); n(11), n(21), n(19), n(20), n(22); var i = n(8); n.d(e, "assembleFont", function () { return i.a; }); n(3), n(5), n(12); }, function (t, e, n) { "use strict"; var r = (function () { function t() { this._events = {}; } return ( (t.prototype.on = function (t, e, n) { return ( this._events[t] || (this._events[t] = []), this._events[t].push({ callback: e, once: !!n }), this ); }), (t.prototype.once = function (t, e) { return this.on(t, e, !0), this; }), (t.prototype.emit = function (t) { for (var e = this, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = this._events[t] || [], o = this._events["*"] || [], a = function (r) { for (var i = r.length, o = 0; o < i; o++) if (r[o]) { var a = r[o], s = a.callback; a.once && (r.splice(o, 1), 0 === r.length && delete e._events[t], i--, o--), s.apply(e, n); } }; a(i), a(o); }), (t.prototype.off = function (t, e) { if (t) if (e) { for ( var n = this._events[t] || [], r = n.length, i = 0; i < r; i++ ) n[i].callback === e && (n.splice(i, 1), r--, i--); 0 === n.length && delete this._events[t]; } else delete this._events[t]; else this._events = {}; return this; }), (t.prototype.getEvents = function () { return this._events; }), t ); })(); e.a = r; }, function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(16), a = n(3), s = {}; var u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.isCanvas = function () { return !1; }), (e.prototype.getBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], u = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( u.length > 0 ? (Object(a.a)(u, function (t) { var e = t.getBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.B)(o)), (e = Object(i.A)(o)), (n = Object(i.B)(s)), (r = Object(i.A)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getCanvasBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], u = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( u.length > 0 ? (Object(a.a)(u, function (t) { var e = t.getCanvasBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.B)(o)), (e = Object(i.A)(o)), (n = Object(i.B)(s)), (r = Object(i.A)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.children = []), e; }), (e.prototype.onAttrChange = function (e, n, r) { if ( (t.prototype.onAttrChange.call(this, e, n, r), "matrix" === e) ) { var i = this.getTotalMatrix(); this._applyChildrenMarix(i); } }), (e.prototype.applyMatrix = function (e) { var n = this.getTotalMatrix(); t.prototype.applyMatrix.call(this, e); var r = this.getTotalMatrix(); r !== n && this._applyChildrenMarix(r); }), (e.prototype._applyChildrenMarix = function (t) { var e = this.getChildren(); Object(a.a)(e, function (e) { e.applyMatrix(t); }); }), (e.prototype.addShape = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = t[0], r = t[1]; Object(a.f)(n) ? (r = n) : (r.type = n); var i = s[r.type]; i || ((i = Object(a.k)(r.type)), (s[r.type] = i)); var o = this.getShapeBase(), u = new o[i](r); return this.add(u), u; }), (e.prototype.addGroup = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n, r = t[0], i = t[1]; if (Object(a.d)(r)) n = new r(i || { parent: this }); else { var o = r || {}, s = this.getGroupBase(); n = new s(o); } return this.add(n), n; }), (e.prototype.getCanvas = function () { return this.isCanvas() ? this : this.get("canvas"); }), (e.prototype.getShape = function (t, e, n) { if (!Object(a.b)(this)) return null; var r, i = this.getChildren(); if (this.isCanvas()) r = this._findShape(i, t, e, n); else { var o = [t, e, 1]; (o = this.invertFromMatrix(o)), this.isClipped(o[0], o[1]) || (r = this._findShape(i, o[0], o[1], n)); } return r; }), (e.prototype._findShape = function (t, e, n, r) { for (var i = null, o = t.length - 1; o >= 0; o--) { var s = t[o]; if ( (Object(a.b)(s) && (s.isGroup() ? (i = s.getShape(e, n, r)) : s.isHit(e, n) && (i = s)), i) ) break; } return i; }), (e.prototype.add = function (t) { var e = this.getCanvas(), n = this.getChildren(), r = this.get("timeline"), i = t.getParent(); i && (function (t, e, n) { void 0 === n && (n = !0), n ? e.destroy() : (e.set("parent", null), e.set("canvas", null)), Object(a.j)(t.getChildren(), e); })(i, t, !1), t.set("parent", this), e && (function t(e, n) { if ((e.set("canvas", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, e), r && (function t(e, n) { if ((e.set("timeline", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, r), n.push(t), t.onCanvasChange("add"), this._applyElementMatrix(t); }), (e.prototype._applyElementMatrix = function (t) { var e = this.getTotalMatrix(); e && t.applyMatrix(e); }), (e.prototype.getChildren = function () { return this.get("children"); }), (e.prototype.sort = function () { var t, e = this.getChildren(); Object(a.a)(e, function (t, e) { return (t._INDEX = e), t; }), e.sort( ((t = function (t, e) { return t.get("zIndex") - e.get("zIndex"); }), function (e, n) { var r = t(e, n); return 0 === r ? e._INDEX - n._INDEX : r; }), ), this.onCanvasChange("sort"); }), (e.prototype.clear = function () { if ((this.set("clearing", !0), !this.destroyed)) { for (var t = this.getChildren(), e = t.length - 1; e >= 0; e--) t[e].destroy(); this.set("children", []), this.onCanvasChange("clear"), this.set("clearing", !1); } }), (e.prototype.destroy = function () { this.get("destroyed") || (this.clear(), t.prototype.destroy.call(this)); }), (e.prototype.getFirst = function () { return this.getChildByIndex(0); }), (e.prototype.getLast = function () { var t = this.getChildren(); return this.getChildByIndex(t.length - 1); }), (e.prototype.getChildByIndex = function (t) { return this.getChildren()[t]; }), (e.prototype.getCount = function () { return this.getChildren().length; }), (e.prototype.contain = function (t) { return this.getChildren().indexOf(t) > -1; }), (e.prototype.removeChild = function (t, e) { void 0 === e && (e = !0), this.contain(t) && t.remove(e); }), (e.prototype.findAll = function (t) { var e = [], n = this.getChildren(); return ( Object(a.a)(n, function (n) { t(n) && e.push(n), n.isGroup() && (e = e.concat(n.findAll(t))); }), e ); }), (e.prototype.find = function (t) { var e = null, n = this.getChildren(); return ( Object(a.a)(n, function (n) { if ((t(n) ? (e = n) : n.isGroup() && (e = n.find(t)), e)) return !1; }), e ); }), (e.prototype.findById = function (t) { return this.find(function (e) { return e.get("id") === t; }); }), (e.prototype.findByClassName = function (t) { return this.find(function (e) { return e.get("className") === t; }); }), (e.prototype.findAllByName = function (t) { return this.findAll(function (e) { return e.get("name") === t; }); }), e ); })(o.a); e.a = u; }, function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(2), a = n(3), s = n(5), u = n(11), c = o.a.transform, h = ["zIndex", "capture", "visible", "type"], l = ["repeat"]; function d(t, e) { var n = {}, r = e.attrs; for (var i in t) n[i] = r[i]; return n; } function f(t, e) { var n = {}, r = e.attr(); return ( Object(i.e)(t, function (t, e) { -1 !== l.indexOf(e) || Object(i.q)(r[e], t) || (n[e] = t); }), n ); } function p(t, e) { if (e.onFrame) return t; var n = e.startTime, r = e.delay, o = e.duration, a = Object.prototype.hasOwnProperty; return ( Object(i.e)(t, function (t) { n + r < t.startTime + t.delay + t.duration && o > t.delay && Object(i.e)(e.toAttrs, function (e, n) { a.call(t.toAttrs, n) && (delete t.toAttrs[n], delete t.fromAttrs[n]); }); }), t ); } var g = (function (t) { function e(e) { var n = t.call(this, e) || this; n.attrs = {}; var r = n.getDefaultAttrs(); return ( Object(i.C)(r, e.attrs), (n.attrs = r), n.initAttrs(r), n.initAnimate(), n ); } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return { visible: !0, capture: !0, zIndex: 0 }; }), (e.prototype.getDefaultAttrs = function () { return { matrix: this.getDefaultMatrix(), opacity: 1 }; }), (e.prototype.onCanvasChange = function (t) {}), (e.prototype.initAttrs = function (t) {}), (e.prototype.initAnimate = function () { this.set("animable", !0), this.set("animating", !1); }), (e.prototype.isGroup = function () { return !1; }), (e.prototype.getParent = function () { return this.get("parent"); }), (e.prototype.getCanvas = function () { return this.get("canvas"); }), (e.prototype.attr = function () { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; var r = e[0], o = e[1]; if (!r) return this.attrs; if (Object(i.v)(r)) { for (var a in r) this.setAttr(a, r[a]); return this.afterAttrsChange(r), this; } return 2 === e.length ? (this.setAttr(r, o), this.afterAttrsChange((((t = {})[r] = o), t)), this) : this.attrs[r]; }), (e.prototype.isClipped = function (t, e) { var n = this.getClip(); return n && !n.isHit(t, e); }), (e.prototype.setAttr = function (t, e) { var n = this.attrs[t]; n !== e && ((this.attrs[t] = e), this.onAttrChange(t, e, n)); }), (e.prototype.onAttrChange = function (t, e, n) { "matrix" === t && this.set("totalMatrix", null); }), (e.prototype.afterAttrsChange = function (t) { if (this.cfg.isClipShape) { var e = this.cfg.applyTo; e && e.onCanvasChange("clip"); } else this.onCanvasChange("attr"); }), (e.prototype.show = function () { return this.set("visible", !0), this.onCanvasChange("show"), this; }), (e.prototype.hide = function () { return this.set("visible", !1), this.onCanvasChange("hide"), this; }), (e.prototype.setZIndex = function (t) { this.set("zIndex", t); var e = this.getParent(); return e && e.sort(), this; }), (e.prototype.toFront = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.push(this), this.onCanvasChange("zIndex"); } }), (e.prototype.toBack = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.unshift(this), this.onCanvasChange("zIndex"); } }), (e.prototype.remove = function (t) { void 0 === t && (t = !0); var e = this.getParent(); e ? (Object(a.j)(e.getChildren(), this), e.get("clearing") || this.onCanvasChange("remove")) : this.onCanvasChange("remove"), t && this.destroy(); }), (e.prototype.resetMatrix = function () { this.attr("matrix", this.getDefaultMatrix()), this.onCanvasChange("matrix"); }), (e.prototype.getMatrix = function () { return this.attr("matrix"); }), (e.prototype.setMatrix = function (t) { this.attr("matrix", t), this.onCanvasChange("matrix"); }), (e.prototype.getTotalMatrix = function () { var t = this.cfg.totalMatrix; if (!t) { var e = this.attr("matrix"), n = this.cfg.parentMatrix; (t = n && e ? Object(s.b)(n, e) : e || n), this.set("totalMatrix", t); } return t; }), (e.prototype.applyMatrix = function (t) { var e = this.attr("matrix"), n = null; (n = t && e ? Object(s.b)(t, e) : e || t), this.set("totalMatrix", n), this.set("parentMatrix", t); }), (e.prototype.getDefaultMatrix = function () { return null; }), (e.prototype.applyToMatrix = function (t) { var e = this.attr("matrix"); return e ? Object(s.c)(e, t) : t; }), (e.prototype.invertFromMatrix = function (t) { var e = this.attr("matrix"); if (e) { var n = Object(s.a)(e); if (n) return Object(s.c)(n, t); } return t; }), (e.prototype.setClip = function (t) { var e = this.getCanvas(), n = null; if (t) { var r = this.getShapeBase()[Object(i.J)(t.type)]; r && (n = new r({ type: t.type, isClipShape: !0, applyTo: this, attrs: t.attrs, canvas: e, })); } return this.set("clipShape", n), this.onCanvasChange("clip"), n; }), (e.prototype.getClip = function () { var t = this.cfg.clipShape; return t || null; }), (e.prototype.clone = function () { var t = this, e = this.attrs, n = {}; Object(i.e)(e, function (t, r) { Object(i.m)(e[r]) ? (n[r] = (function (t) { for (var e = [], n = 0; n < t.length; n++) Object(i.m)(t[n]) ? e.push([].concat(t[n])) : e.push(t[n]); return e; })(e[r])) : (n[r] = e[r]); }); var r = new (0, this.constructor)({ attrs: n }); return ( Object(i.e)(h, function (e) { r.set(e, t.get(e)); }), r ); }), (e.prototype.destroy = function () { this.destroyed || ((this.attrs = {}), t.prototype.destroy.call(this)); }), (e.prototype.isAnimatePaused = function () { return this.get("_pause").isPaused; }), (e.prototype.animate = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this.get("timeline") || this.get("canvas")) { this.set("animating", !0); var n = this.get("timeline"); n || ((n = this.get("canvas").get("timeline")), this.set("timeline", n)); var r = this.get("animations") || []; n.timer || n.initTimer(); var o, a, s, u, c, h = t[0], l = t[1], g = t[2], y = void 0 === g ? "easeLinear" : g, v = t[3], m = void 0 === v ? i.E : v, b = t[4], x = void 0 === b ? 0 : b; Object(i.r)(h) ? ((o = h), (h = {})) : Object(i.v)(h) && h.onFrame && ((o = h.onFrame), (a = h.repeat)), Object(i.v)(l) ? ((l = (c = l).duration), (y = c.easing || "easeLinear"), (x = c.delay || 0), (a = c.repeat || a || !1), (m = c.callback || i.E), (s = c.pauseCallback || i.E), (u = c.resumeCallback || i.E)) : (Object(i.t)(m) && ((x = m), (m = null)), Object(i.r)(y) ? ((m = y), (y = "easeLinear")) : (y = y || "easeLinear")); var w = f(h, this), O = { fromAttrs: d(w, this), toAttrs: w, duration: l, easing: y, repeat: a, callback: m, pauseCallback: s, resumeCallback: u, delay: x, startTime: n.getTime(), id: Object(i.I)(), onFrame: o, pathFormatted: !1, }; r.length > 0 ? (r = p(r, O)) : n.addAnimator(this), r.push(O), this.set("animations", r), this.set("_pause", { isPaused: !1 }); } }), (e.prototype.stopAnimate = function (t) { var e = this; void 0 === t && (t = !0); var n = this.get("animations"); Object(i.e)(n, function (n) { t && (n.onFrame ? e.attr(n.onFrame(1)) : e.attr(n.toAttrs)), n.callback && n.callback(); }), this.set("animating", !1), this.set("animations", []); }), (e.prototype.pauseAnimate = function () { var t = this.get("timeline"), e = this.get("animations"), n = t.getTime(); return ( Object(i.e)(e, function (t) { (t._paused = !0), (t._pauseTime = n), t.pauseCallback && t.pauseCallback(); }), this.set("_pause", { isPaused: !0, pauseTime: n }), this ); }), (e.prototype.resumeAnimate = function () { var t = this.get("timeline").getTime(), e = this.get("animations"), n = this.get("_pause").pauseTime; return ( Object(i.e)(e, function (e) { (e.startTime = e.startTime + (t - n)), (e._paused = !1), (e._pauseTime = null), e.resumeCallback && e.resumeCallback(); }), this.set("_pause", { isPaused: !1 }), this.set("animations", e), this ); }), (e.prototype.emitDelegation = function (t, e) { var n, r = this, o = e.propagationPath; this.getEvents(); "mouseenter" === t ? (n = e.fromShape) : "mouseleave" === t && (n = e.toShape); for ( var s = function (t) { var s = o[t], c = s.get("name"); if (c) { if ( (s.isGroup() || (s.isCanvas && s.isCanvas())) && n && Object(a.g)(s, n) ) return "break"; Object(i.m)(c) ? Object(i.e)(c, function (t) { r.emitDelegateEvent(s, t, e); }) : u.emitDelegateEvent(s, c, e); } }, u = this, c = 0; c < o.length; c++ ) { if ("break" === s(c)) break; } }), (e.prototype.emitDelegateEvent = function (t, e, n) { var r = this.getEvents(), i = e + ":" + n.type; (r[i] || r["*"]) && ((n.name = i), (n.currentTarget = t), (n.delegateTarget = this), (n.delegateObject = t.get("delegateObject")), this.emit(i, n)); }), (e.prototype.translate = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0); var n = this.getMatrix(), r = c(n, [["t", t, e]]); return this.setMatrix(r), this; }), (e.prototype.move = function (t, e) { var n = this.attr("x") || 0, r = this.attr("y") || 0; return this.translate(t - n, e - r), this; }), (e.prototype.moveTo = function (t, e) { return this.move(t, e); }), (e.prototype.scale = function (t, e) { var n = this.getMatrix(), r = c(n, [["s", t, e || t]]); return this.setMatrix(r), this; }), (e.prototype.rotate = function (t) { var e = this.getMatrix(), n = c(e, [["r", t]]); return this.setMatrix(n), this; }), (e.prototype.rotateAtStart = function (t) { var e = this.attr(), n = e.x, r = e.y, i = this.getMatrix(), o = c(i, [ ["t", -n, -r], ["r", t], ["t", n, r], ]); return this.setMatrix(o), this; }), (e.prototype.rotateAtPoint = function (t, e, n) { var r = this.getMatrix(), i = c(r, [ ["t", -t, -e], ["r", n], ["t", t, e], ]); return this.setMatrix(i), this; }), e ); })(u.a); e.a = g; }, function (t, e) {}, function (t, e) {}, function (t, e, n) { "use strict"; var r = n(1); !(function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } Object(r.c)(e, t), (e.prototype.isGroup = function () { return !0; }), (e.prototype.isEntityGroup = function () { return !1; }), (e.prototype.clone = function () { for ( var e = t.prototype.clone.call(this), n = this.getChildren(), r = 0; r < n.length; r++ ) { var i = n[r]; e.add(i.clone()); } return e; }); })(n(15).a); }, function (t, e, n) { "use strict"; var r = n(1), i = n(16), o = n(5); !(function (t) { function e(e) { return t.call(this, e) || this; } Object(r.c)(e, t), (e.prototype._isInBBox = function (t, e) { var n = this.getBBox(); return n.minX <= t && n.maxX >= t && n.minY <= e && n.maxY >= e; }), (e.prototype.afterAttrsChange = function (e) { t.prototype.afterAttrsChange.call(this, e), this.clearCacheBBox(); }), (e.prototype.getBBox = function () { var t = this.cfg.bbox; return t || ((t = this.calculateBBox()), this.set("bbox", t)), t; }), (e.prototype.getCanvasBBox = function () { var t = this.cfg.canvasBBox; return ( t || ((t = this.calculateCanvasBBox()), this.set("canvasBBox", t)), t ); }), (e.prototype.applyMatrix = function (e) { t.prototype.applyMatrix.call(this, e), this.set("canvasBBox", null); }), (e.prototype.calculateCanvasBBox = function () { var t = this.getBBox(), e = this.getTotalMatrix(), n = t.minX, r = t.minY, i = t.maxX, a = t.maxY; if (e) { var s = Object(o.c)(e, [t.minX, t.minY]), u = Object(o.c)(e, [t.maxX, t.minY]), c = Object(o.c)(e, [t.minX, t.maxY]), h = Object(o.c)(e, [t.maxX, t.maxY]); (n = Math.min(s[0], u[0], c[0], h[0])), (i = Math.max(s[0], u[0], c[0], h[0])), (r = Math.min(s[1], u[1], c[1], h[1])), (a = Math.max(s[1], u[1], c[1], h[1])); } var l = this.attrs; if (l.shadowColor) { var d = l.shadowBlur, f = void 0 === d ? 0 : d, p = l.shadowOffsetX, g = void 0 === p ? 0 : p, y = l.shadowOffsetY, v = void 0 === y ? 0 : y, m = n - f + g, b = i + f + g, x = r - f + v, w = a + f + v; (n = Math.min(n, m)), (i = Math.max(i, b)), (r = Math.min(r, x)), (a = Math.max(a, w)); } return { x: n, y: r, minX: n, minY: r, maxX: i, maxY: a, width: i - n, height: a - r, }; }), (e.prototype.clearCacheBBox = function () { this.set("bbox", null), this.set("canvasBBox", null); }), (e.prototype.isClipShape = function () { return this.get("isClipShape"); }), (e.prototype.isInShape = function (t, e) { return !1; }), (e.prototype.isOnlyHitBox = function () { return !1; }), (e.prototype.isHit = function (t, e) { var n = this.get("startArrowShape"), r = this.get("endArrowShape"), i = [t, e, 1], o = (i = this.invertFromMatrix(i))[0], a = i[1], s = this._isInBBox(o, a); if (this.isOnlyHitBox()) return s; if (s && !this.isClipped(o, a)) { if (this.isInShape(o, a)) return !0; if (n && n.isHit(o, a)) return !0; if (r && r.isHit(o, a)) return !0; } return !1; }); })(i.a); }, function (t, e, n) { "use strict"; var r = {}; n.r(r), n.d(r, "easeLinear", function () { return k; }), n.d(r, "easeQuad", function () { return T; }), n.d(r, "easeQuadIn", function () { return E; }), n.d(r, "easeQuadOut", function () { return N; }), n.d(r, "easeQuadInOut", function () { return T; }), n.d(r, "easeCubic", function () { return B; }), n.d(r, "easeCubicIn", function () { return P; }), n.d(r, "easeCubicOut", function () { return I; }), n.d(r, "easeCubicInOut", function () { return B; }), n.d(r, "easePoly", function () { return D; }), n.d(r, "easePolyIn", function () { return A; }), n.d(r, "easePolyOut", function () { return L; }), n.d(r, "easePolyInOut", function () { return D; }), n.d(r, "easeSin", function () { return z; }), n.d(r, "easeSinIn", function () { return Y; }), n.d(r, "easeSinOut", function () { return F; }), n.d(r, "easeSinInOut", function () { return z; }), n.d(r, "easeExp", function () { return q; }), n.d(r, "easeExpIn", function () { return W; }), n.d(r, "easeExpOut", function () { return G; }), n.d(r, "easeExpInOut", function () { return q; }), n.d(r, "easeCircle", function () { return U; }), n.d(r, "easeCircleIn", function () { return H; }), n.d(r, "easeCircleOut", function () { return V; }), n.d(r, "easeCircleInOut", function () { return U; }), n.d(r, "easeBounce", function () { return Q; }), n.d(r, "easeBounceIn", function () { return K; }), n.d(r, "easeBounceOut", function () { return Q; }), n.d(r, "easeBounceInOut", function () { return $; }), n.d(r, "easeBack", function () { return et; }), n.d(r, "easeBackIn", function () { return J; }), n.d(r, "easeBackOut", function () { return tt; }), n.d(r, "easeBackInOut", function () { return et; }), n.d(r, "easeElastic", function () { return it; }), n.d(r, "easeElasticIn", function () { return rt; }), n.d(r, "easeElasticOut", function () { return it; }), n.d(r, "easeElasticInOut", function () { return ot; }); var i = n(1), o = n(24), a = n(15), s = n(3), u = n(0); function c(t) { return (c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var h, l, d = 0, f = 0, p = 0, g = 0, y = 0, v = 0, m = "object" === ("undefined" == typeof performance ? "undefined" : c(performance)) && performance.now ? performance : Date, b = "object" === ("undefined" == typeof window ? "undefined" : c(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function x() { return y || (b(w), (y = m.now() + v)); } function w() { y = 0; } function O() { this._call = this._time = this._next = null; } function M(t, e, n) { var r = new O(); return r.restart(t, e, n), r; } function S() { (y = (g = m.now()) + v), (d = f = 0); try { !(function () { x(), ++d; for (var t, e = h; e; ) (t = y - e._time) >= 0 && e._call.call(null, t), (e = e._next); --d; })(); } finally { (d = 0), (function () { var t, e, n = h, r = 1 / 0; for (; n; ) n._call ? (r > n._time && (r = n._time), (t = n), (n = n._next)) : ((e = n._next), (n._next = null), (n = t ? (t._next = e) : (h = e))); (l = t), j(r); })(), (y = 0); } } function C() { var t = m.now(), e = t - g; e > 1e3 && ((v -= e), (g = t)); } function j(t) { d || (f && (f = clearTimeout(f)), t - y > 24 ? (t < 1 / 0 && (f = setTimeout(S, t - m.now() - v)), p && (p = clearInterval(p))) : (p || ((g = m.now()), (p = setInterval(C, 1e3))), (d = 1), b(S))); } function k(t) { return +t; } function E(t) { return t * t; } function N(t) { return t * (2 - t); } function T(t) { return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; } function P(t) { return t * t * t; } function I(t) { return --t * t * t + 1; } function B(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } O.prototype = M.prototype = { constructor: O, restart: function (t, e, n) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (n = (null == n ? x() : +n) + (null == e ? 0 : +e)), this._next || l === this || (l ? (l._next = this) : (h = this), (l = this)), (this._call = t), (this._time = n), j(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), j()); }, }; var A = (function t(e) { function n(t) { return Math.pow(t, e); } return (e = +e), (n.exponent = t), n; })(3), L = (function t(e) { function n(t) { return 1 - Math.pow(1 - t, e); } return (e = +e), (n.exponent = t), n; })(3), D = (function t(e) { function n(t) { return ( ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2 ); } return (e = +e), (n.exponent = t), n; })(3), _ = Math.PI, R = _ / 2; function Y(t) { return 1 == +t ? 1 : 1 - Math.cos(t * R); } function F(t) { return Math.sin(t * R); } function z(t) { return (1 - Math.cos(_ * t)) / 2; } function X(t) { return 1.0009775171065494 * (Math.pow(2, -10 * t) - 0.0009765625); } function W(t) { return X(1 - +t); } function G(t) { return 1 - X(t); } function q(t) { return ((t *= 2) <= 1 ? X(1 - t) : 2 - X(t - 1)) / 2; } function H(t) { return 1 - Math.sqrt(1 - t * t); } function V(t) { return Math.sqrt(1 - --t * t); } function U(t) { return ( ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2 ); } var Z = 7.5625; function K(t) { return 1 - Q(1 - t); } function Q(t) { return (t = +t) < 4 / 11 ? Z * t * t : t < 8 / 11 ? Z * (t -= 6 / 11) * t + 3 / 4 : t < 10 / 11 ? Z * (t -= 9 / 11) * t + 15 / 16 : Z * (t -= 21 / 22) * t + 63 / 64; } function $(t) { return ((t *= 2) <= 1 ? 1 - Q(1 - t) : Q(t - 1) + 1) / 2; } var J = (function t(e) { function n(t) { return (t = +t) * t * (e * (t - 1) + t); } return (e = +e), (n.overshoot = t), n; })(1.70158), tt = (function t(e) { function n(t) { return --t * t * ((t + 1) * e + t) + 1; } return (e = +e), (n.overshoot = t), n; })(1.70158), et = (function t(e) { function n(t) { return ( ((t *= 2) < 1 ? t * t * ((e + 1) * t - e) : (t -= 2) * t * ((e + 1) * t + e) + 2) / 2 ); } return (e = +e), (n.overshoot = t), n; })(1.70158), nt = 2 * Math.PI, rt = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= nt); function i(t) { return e * X(-(--t)) * Math.sin((r - t) / n); } return ( (i.amplitude = function (e) { return t(e, n * nt); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), it = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= nt); function i(t) { return 1 - e * X((t = +t)) * Math.sin((t + r) / n); } return ( (i.amplitude = function (e) { return t(e, n * nt); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), ot = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= nt); function i(t) { return ( ((t = 2 * t - 1) < 0 ? e * X(-t) * Math.sin((r - t) / n) : 2 - e * X(t) * Math.sin((r + t) / n)) / 2 ); } return ( (i.amplitude = function (e) { return t(e, n * nt); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), at = function (t, e, n) { (t.prototype = e.prototype = n), (n.constructor = t); }; function st(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function ut() {} var ct = "\\s*([+-]?\\d+)\\s*", ht = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", lt = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", dt = /^#([0-9a-f]{3,8})$/, ft = new RegExp("^rgb\\(" + [ct, ct, ct] + "\\)$"), pt = new RegExp("^rgb\\(" + [lt, lt, lt] + "\\)$"), gt = new RegExp("^rgba\\(" + [ct, ct, ct, ht] + "\\)$"), yt = new RegExp("^rgba\\(" + [lt, lt, lt, ht] + "\\)$"), vt = new RegExp("^hsl\\(" + [ht, lt, lt] + "\\)$"), mt = new RegExp("^hsla\\(" + [ht, lt, lt, ht] + "\\)$"), bt = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074, }; function xt() { return this.rgb().formatHex(); } function wt() { return this.rgb().formatRgb(); } function Ot(t) { var e, n; return ( (t = (t + "").trim().toLowerCase()), (e = dt.exec(t)) ? ((n = e[1].length), (e = parseInt(e[1], 16)), 6 === n ? Mt(e) : 3 === n ? new kt( ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), ((15 & e) << 4) | (15 & e), 1, ) : 8 === n ? St( (e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, (255 & e) / 255, ) : 4 === n ? St( ((e >> 12) & 15) | ((e >> 8) & 240), ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), (((15 & e) << 4) | (15 & e)) / 255, ) : null) : (e = ft.exec(t)) ? new kt(e[1], e[2], e[3], 1) : (e = pt.exec(t)) ? new kt( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, 1, ) : (e = gt.exec(t)) ? St(e[1], e[2], e[3], e[4]) : (e = yt.exec(t)) ? St( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, e[4], ) : (e = vt.exec(t)) ? Pt(e[1], e[2] / 100, e[3] / 100, 1) : (e = mt.exec(t)) ? Pt(e[1], e[2] / 100, e[3] / 100, e[4]) : bt.hasOwnProperty(t) ? Mt(bt[t]) : "transparent" === t ? new kt(NaN, NaN, NaN, 0) : null ); } function Mt(t) { return new kt((t >> 16) & 255, (t >> 8) & 255, 255 & t, 1); } function St(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new kt(t, e, n, r); } function Ct(t) { return ( t instanceof ut || (t = Ot(t)), t ? new kt((t = t.rgb()).r, t.g, t.b, t.opacity) : new kt() ); } function jt(t, e, n, r) { return 1 === arguments.length ? Ct(t) : new kt(t, e, n, null == r ? 1 : r); } function kt(t, e, n, r) { (this.r = +t), (this.g = +e), (this.b = +n), (this.opacity = +r); } function Et() { return "#" + Tt(this.r) + Tt(this.g) + Tt(this.b); } function Nt() { var t = this.opacity; return ( (1 === (t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (1 === t ? ")" : ", " + t + ")") ); } function Tt(t) { return ( ((t = Math.max(0, Math.min(255, Math.round(t) || 0))) < 16 ? "0" : "") + t.toString(16) ); } function Pt(t, e, n, r) { return ( r <= 0 ? (t = e = n = NaN) : n <= 0 || n >= 1 ? (t = e = NaN) : e <= 0 && (t = NaN), new Bt(t, e, n, r) ); } function It(t) { if (t instanceof Bt) return new Bt(t.h, t.s, t.l, t.opacity); if ((t instanceof ut || (t = Ot(t)), !t)) return new Bt(); if (t instanceof Bt) return t; var e = (t = t.rgb()).r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, s = o - i, u = (o + i) / 2; return ( s ? ((a = e === o ? (n - r) / s + 6 * (n < r) : n === o ? (r - e) / s + 2 : (e - n) / s + 4), (s /= u < 0.5 ? o + i : 2 - o - i), (a *= 60)) : (s = u > 0 && u < 1 ? 0 : a), new Bt(a, s, u, t.opacity) ); } function Bt(t, e, n, r) { (this.h = +t), (this.s = +e), (this.l = +n), (this.opacity = +r); } function At(t, e, n) { return ( 255 * (t < 60 ? e + ((n - e) * t) / 60 : t < 180 ? n : t < 240 ? e + ((n - e) * (240 - t)) / 60 : e) ); } function Lt(t, e, n, r, i) { var o = t * t, a = o * t; return ( ((1 - 3 * t + 3 * o - a) * e + (4 - 6 * o + 3 * a) * n + (1 + 3 * t + 3 * o - 3 * a) * r + a * i) / 6 ); } at(ut, Ot, { copy: function (t) { return Object.assign(new this.constructor(), this, t); }, displayable: function () { return this.rgb().displayable(); }, hex: xt, formatHex: xt, formatHsl: function () { return It(this).formatHsl(); }, formatRgb: wt, toString: wt, }), at( kt, jt, st(ut, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new kt(this.r * t, this.g * t, this.b * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new kt(this.r * t, this.g * t, this.b * t, this.opacity) ); }, rgb: function () { return this; }, displayable: function () { return ( -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1 ); }, hex: Et, formatHex: Et, formatRgb: Nt, toString: Nt, }), ), at( Bt, function (t, e, n, r) { return 1 === arguments.length ? It(t) : new Bt(t, e, n, null == r ? 1 : r); }, st(ut, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new Bt(this.h, this.s, this.l * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new Bt(this.h, this.s, this.l * t, this.opacity) ); }, rgb: function () { var t = (this.h % 360) + 360 * (this.h < 0), e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new kt( At(t >= 240 ? t - 240 : t + 120, i, r), At(t, i, r), At(t < 120 ? t + 240 : t - 120, i, r), this.opacity, ); }, displayable: function () { return ( ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1 ); }, formatHsl: function () { var t = this.opacity; return ( (1 === (t = isNaN(t) ? 1 : Math.max(0, Math.min(1, t))) ? "hsl(" : "hsla(") + (this.h || 0) + ", " + 100 * (this.s || 0) + "%, " + 100 * (this.l || 0) + "%" + (1 === t ? ")" : ", " + t + ")") ); }, }), ); var Dt = function (t) { return function () { return t; }; }; function _t(t, e) { return function (n) { return t + n * e; }; } function Rt(t) { return 1 == (t = +t) ? Yt : function (e, n) { return n - e ? (function (t, e, n) { return ( (t = Math.pow(t, n)), (e = Math.pow(e, n) - t), (n = 1 / n), function (r) { return Math.pow(t + r * e, n); } ); })(e, n, t) : Dt(isNaN(e) ? n : e); }; } function Yt(t, e) { var n = e - t; return n ? _t(t, n) : Dt(isNaN(t) ? e : t); } var Ft = (function t(e) { var n = Rt(e); function r(t, e) { var r = n((t = jt(t)).r, (e = jt(e)).r), i = n(t.g, e.g), o = n(t.b, e.b), a = Yt(t.opacity, e.opacity); return function (e) { return ( (t.r = r(e)), (t.g = i(e)), (t.b = o(e)), (t.opacity = a(e)), t + "" ); }; } return (r.gamma = t), r; })(1); function zt(t) { return function (e) { var n, r, i = e.length, o = new Array(i), a = new Array(i), s = new Array(i); for (n = 0; n < i; ++n) (r = jt(e[n])), (o[n] = r.r || 0), (a[n] = r.g || 0), (s[n] = r.b || 0); return ( (o = t(o)), (a = t(a)), (s = t(s)), (r.opacity = 1), function (t) { return (r.r = o(t)), (r.g = a(t)), (r.b = s(t)), r + ""; } ); }; } zt(function (t) { var e = t.length - 1; return function (n) { var r = n <= 0 ? (n = 0) : n >= 1 ? ((n = 1), e - 1) : Math.floor(n * e), i = t[r], o = t[r + 1], a = r > 0 ? t[r - 1] : 2 * i - o, s = r < e - 1 ? t[r + 2] : 2 * o - i; return Lt((n - r / e) * e, a, i, o, s); }; }), zt(function (t) { var e = t.length; return function (n) { var r = Math.floor(((n %= 1) < 0 ? ++n : n) * e), i = t[(r + e - 1) % e], o = t[r % e], a = t[(r + 1) % e], s = t[(r + 2) % e]; return Lt((n - r / e) * e, i, o, a, s); }; }); var Xt = function (t, e) { e || (e = []); var n, r = t ? Math.min(e.length, t.length) : 0, i = e.slice(); return function (o) { for (n = 0; n < r; ++n) i[n] = t[n] * (1 - o) + e[n] * o; return i; }; }; function Wt(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function Gt(t, e) { var n, r = e ? e.length : 0, i = t ? Math.min(r, t.length) : 0, o = new Array(i), a = new Array(r); for (n = 0; n < i; ++n) o[n] = Jt(t[n], e[n]); for (; n < r; ++n) a[n] = e[n]; return function (t) { for (n = 0; n < i; ++n) a[n] = o[n](t); return a; }; } var qt = function (t, e) { var n = new Date(); return ( (t = +t), (e = +e), function (r) { return n.setTime(t * (1 - r) + e * r), n; } ); }, Ht = function (t, e) { return ( (t = +t), (e = +e), function (n) { return t * (1 - n) + e * n; } ); }; function Vt(t) { return (Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Ut = function (t, e) { var n, r = {}, i = {}; for (n in ((null !== t && "object" === Vt(t)) || (t = {}), (null !== e && "object" === Vt(e)) || (e = {}), e)) n in t ? (r[n] = Jt(t[n], e[n])) : (i[n] = e[n]); return function (t) { for (n in r) i[n] = r[n](t); return i; }; }, Zt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Kt = new RegExp(Zt.source, "g"); var Qt = function (t, e) { var n, r, i, o = (Zt.lastIndex = Kt.lastIndex = 0), a = -1, s = [], u = []; for (t += "", e += ""; (n = Zt.exec(t)) && (r = Kt.exec(e)); ) (i = r.index) > o && ((i = e.slice(o, i)), s[a] ? (s[a] += i) : (s[++a] = i)), (n = n[0]) === (r = r[0]) ? s[a] ? (s[a] += r) : (s[++a] = r) : ((s[++a] = null), u.push({ i: a, x: Ht(n, r) })), (o = Kt.lastIndex); return ( o < e.length && ((i = e.slice(o)), s[a] ? (s[a] += i) : (s[++a] = i)), s.length < 2 ? u[0] ? (function (t) { return function (e) { return t(e) + ""; }; })(u[0].x) : (function (t) { return function () { return t; }; })(e) : ((e = u.length), function (t) { for (var n, r = 0; r < e; ++r) s[(n = u[r]).i] = n.x(t); return s.join(""); }) ); }; function $t(t) { return ($t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Jt = function (t, e) { var n, r = $t(e); return null == e || "boolean" === r ? Dt(e) : ("number" === r ? Ht : "string" === r ? (n = Ot(e)) ? ((e = n), Ft) : Qt : e instanceof Ot ? Ft : e instanceof Date ? qt : Wt(e) ? Xt : Array.isArray(e) ? Gt : ("function" != typeof e.valueOf && "function" != typeof e.toString) || isNaN(e) ? Ut : Ht)(t, e); }, te = n(6), ee = [1, 0, 0, 0, 1, 0, 0, 0, 1]; function ne(t, e, n) { var i, o = e.startTime; if (n < o + e.delay || e._paused) return !1; var a = e.duration, s = e.easing; if (((n = n - o - e.delay), e.repeat)) (i = (n % a) / a), (i = r[s](i)); else { if (!((i = n / a) < 1)) return e.onFrame ? t.attr(e.onFrame(1)) : t.attr(e.toAttrs), !0; i = r[s](i); } if (e.onFrame) { var c = e.onFrame(i); t.attr(c); } else !(function (t, e, n) { var r = {}, i = e.fromAttrs, o = e.toAttrs; if (!t.destroyed) { var a, s, c, h; for (var l in o) if (!Object(u.q)(i[l], o[l])) if ("path" === l) { var d = o[l], f = i[l]; d.length > f.length ? ((d = te.c(o[l])), (f = te.c(i[l])), (f = te.a(f, d)), (f = te.b(f, d)), (e.fromAttrs.path = f), (e.toAttrs.path = d)) : e.pathFormatted || ((d = te.c(o[l])), (f = te.c(i[l])), (f = te.b(f, d)), (e.fromAttrs.path = f), (e.toAttrs.path = d), (e.pathFormatted = !0)), (r[l] = []); for (var p = 0; p < d.length; p++) { for ( var g = d[p], y = f[p], v = [], m = 0; m < g.length; m++ ) Object(u.t)(g[m]) && y && Object(u.t)(y[m]) ? ((a = Jt(y[m], g[m])), v.push(a(n))) : v.push(g[m]); r[l].push(v); } } else if ("matrix" === l) { var b = ((c = i[l] || ee), (Wt((h = o[l] || ee)) ? Xt : Gt)(c, h))(n); r[l] = b; } else ["fill", "stroke", "fillStyle", "strokeStyle"].includes( l, ) && ((s = o[l]), /^[r,R,L,l]{1}[\s]*\(/.test(s)) ? (r[l] = o[l]) : Object(u.r)(o[l]) || ((a = Jt(i[l], o[l])), (r[l] = a(n))); t.attr(r); } })(t, e, i); return !1; } var re = (function () { function t(t) { (this.animators = []), (this.current = 0), (this.timer = null), (this.canvas = t); } return ( (t.prototype.initTimer = function () { var t, e, n, r = this; this.timer = M(function (i) { if (((r.current = i), r.animators.length > 0)) { for (var o = r.animators.length - 1; o >= 0; o--) if ((t = r.animators[o]).destroyed) r.removeAnimator(o); else { if (!t.isAnimatePaused()) for ( var a = (e = t.get("animations")).length - 1; a >= 0; a-- ) (n = e[a]), ne(t, n, i) && (e.splice(a, 1), !1, n.callback && n.callback()); 0 === e.length && r.removeAnimator(o); } r.canvas.get("autoDraw") || r.canvas.draw(); } }); }), (t.prototype.addAnimator = function (t) { this.animators.push(t); }), (t.prototype.removeAnimator = function (t) { this.animators.splice(t, 1); }), (t.prototype.isAnimating = function () { return !!this.animators.length; }), (t.prototype.stop = function () { this.timer && this.timer.stop(); }), (t.prototype.stopAllAnimations = function (t) { void 0 === t && (t = !0), this.animators.forEach(function (e) { e.stopAnimate(t); }), (this.animators = []), this.canvas.draw(); }), (t.prototype.getTime = function () { return this.current; }), t ); })(), ie = n(10), oe = [ "mousedown", "mouseup", "dblclick", "mouseout", "mouseover", "mousemove", "mouseleave", "mouseenter", "touchstart", "touchmove", "touchend", "dragenter", "dragover", "dragleave", "drop", "contextmenu", "mousewheel", ]; function ae(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function se(t, e, n) { if (n.bubbles) { var r = void 0, i = !1; if ( ("mouseenter" === e ? ((r = n.fromShape), (i = !0)) : "mouseleave" === e && ((i = !0), (r = n.toShape)), t.isCanvas() && i) ) return; if (r && Object(s.g)(t, r)) return void (n.bubbles = !1); (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var ue = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.mousedownShape = null), (this.mousedownPoint = null), (this._eventCallback = function (t) { var n = t.type; e._triggerEvent(n, t); }), (this._onDocumentMove = function (t) { if ( e.canvas.get("el") !== t.target && (e.dragging || e.currentShape) ) { var n = e._getPointInfo(t); e.dragging && e._emitEvent("drag", t, n, e.draggingShape); } }), (this._onDocumentMouseUp = function (t) { if (e.canvas.get("el") !== t.target && e.dragging) { var n = e._getPointInfo(t); e.draggingShape && e._emitEvent("drop", t, n, null), e._emitEvent("dragend", t, n, e.draggingShape), e._afterDrag(e.draggingShape, n, t); } }), (this.canvas = t.canvas); } return ( (t.prototype.init = function () { this._bindEvents(); }), (t.prototype._bindEvents = function () { var t = this, e = this.canvas.get("el"); Object(s.a)(oe, function (n) { e.addEventListener(n, t._eventCallback); }), document && (document.addEventListener("mousemove", this._onDocumentMove), document.addEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._clearEvents = function () { var t = this, e = this.canvas.get("el"); Object(s.a)(oe, function (n) { e.removeEventListener(n, t._eventCallback); }), document && (document.removeEventListener( "mousemove", this._onDocumentMove, ), document.removeEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._getEventObj = function (t, e, n, r, i, o) { var a = new ie.a(t, e); return ( (a.fromShape = i), (a.toShape = o), (a.x = n.x), (a.y = n.y), (a.clientX = n.clientX), (a.clientY = n.clientY), a.propagationPath.push(r), a ); }), (t.prototype._getShape = function (t, e) { return this.canvas.getShape(t.x, t.y, e); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t], o = !1; if (i) i.call(this, n, r, e); else { var a = this.currentShape; "mouseenter" === t || "dragenter" === t || "mouseover" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "mouseenter" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "mouseleave" === t || "dragleave" === t || "mouseout" === t ? ((o = !0), a && this._emitEvent(t, e, n, a, a, null), this._emitEvent(t, e, n, null, a, null), "mouseleave" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } if ((o || (this.currentShape = r), r && !r.get("destroyed"))) { var s = this.canvas; s.get("el").style.cursor = r.attr("cursor") || s.get("cursor"); } }), (t.prototype._onmousedown = function (t, e, n) { 0 === n.button && ((this.mousedownShape = e), (this.mousedownPoint = t), (this.mousedownTimeStamp = n.timeStamp)), this._emitEvent("mousedown", n, t, e, null, null); }), (t.prototype._emitMouseoverEvents = function (t, e, n, r) { var i = this.canvas.get("el"); n !== r && (n && (this._emitEvent("mouseout", t, e, n, n, r), this._emitEvent("mouseleave", t, e, n, n, r), (r && !r.get("destroyed")) || (i.style.cursor = this.canvas.get("cursor"))), r && (this._emitEvent("mouseover", t, e, r, n, r), this._emitEvent("mouseenter", t, e, r, n, r))); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); r !== t && this._emitMouseoverEvents(n, e, t, r), (this.currentShape = r); }), (t.prototype._onmouseup = function (t, e, n) { if (0 === n.button) { var r = this.draggingShape; this.dragging ? (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)) : (this._emitEvent("mouseup", n, t, e), e === this.mousedownShape && this._emitEvent("click", n, t, e), (this.mousedownShape = null), (this.mousedownPoint = null)); } }), (t.prototype._ondragover = function (t, e, n) { n.preventDefault(); var r = this.currentShape; this._emitDragoverEvents(n, t, r, e, !0); }), (t.prototype._onmousemove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.mousedownPoint; if (a) { var s = this.mousedownShape, u = n.timeStamp - this.mousedownTimeStamp, c = a.clientX - t.clientX, h = a.clientY - t.clientY; u > 120 || c * c + h * h > 40 ? s && s.get("draggable") ? ((o = this.mousedownShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.mousedownShape = null), (this.mousedownPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.mousedownShape = null), (this.mousedownPoint = null)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)); } else this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e); } }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), ae(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || se(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { ae(this.canvas, t, a); } }), (t.prototype.destroy = function () { this._clearEvents(), (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.mousedownPoint = null), (this.mousedownShape = null), (this.mousedownTimeStamp = null); }), t ); })(), ce = Object(o.a)(), he = ce && "firefox" === ce.name; !(function (t) { function e(e) { var n = t.call(this, e) || this; return ( n.initContainer(), n.initDom(), n.initEvents(), n.initTimeline(), n ); } Object(i.c)(e, t), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.cursor = "default"), (e.supportCSSTransform = !1), e; }), (e.prototype.initContainer = function () { var t = this.get("container"); Object(s.h)(t) && ((t = document.getElementById(t)), this.set("container", t)); }), (e.prototype.initDom = function () { var t = this.createDom(); this.set("el", t), this.get("container").appendChild(t), this.setDOMSize(this.get("width"), this.get("height")); }), (e.prototype.initEvents = function () { var t = new ue({ canvas: this }); t.init(), this.set("eventController", t); }), (e.prototype.initTimeline = function () { var t = new re(this); this.set("timeline", t); }), (e.prototype.setDOMSize = function (t, e) { var n = this.get("el"); s.c && ((n.style.width = t + "px"), (n.style.height = e + "px")); }), (e.prototype.changeSize = function (t, e) { this.setDOMSize(t, e), this.set("width", t), this.set("height", e), this.onCanvasChange("changeSize"); }), (e.prototype.getRenderer = function () { return this.get("renderer"); }), (e.prototype.getCursor = function () { return this.get("cursor"); }), (e.prototype.setCursor = function (t) { this.set("cursor", t); var e = this.get("el"); s.c && e && (e.style.cursor = t); }), (e.prototype.getPointByEvent = function (t) { if (this.get("supportCSSTransform")) { if (he && !Object(s.e)(t.layerX) && t.layerX !== t.offsetX) return { x: t.layerX, y: t.layerY }; if (!Object(s.e)(t.offsetX)) return { x: t.offsetX, y: t.offsetY }; } var e = this.getClientByEvent(t), n = e.x, r = e.y; return this.getPointByClient(n, r); }), (e.prototype.getClientByEvent = function (t) { var e = t; return ( t.touches && (e = "touchend" === t.type ? t.changedTouches[0] : t.touches[0]), { x: e.clientX, y: e.clientY } ); }), (e.prototype.getPointByClient = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t - n.left, y: e - n.top }; }), (e.prototype.getClientByPoint = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t + n.left, y: e + n.top }; }), (e.prototype.draw = function () {}), (e.prototype.removeDom = function () { var t = this.get("el"); t.parentNode.removeChild(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.isCanvas = function () { return !0; }), (e.prototype.getParent = function () { return null; }), (e.prototype.destroy = function () { var e = this.get("timeline"); this.get("destroyed") || (this.clear(), e && e.stop(), this.clearEvents(), this.removeDom(), t.prototype.destroy.call(this)); }); })(a.a); }, function (t, e, n) { "use strict"; var r = {}; n.r(r), n.d(r, "distance", function () { return h; }), n.d(r, "isNumberEqual", function () { return l; }), n.d(r, "getBBoxByArray", function () { return d; }), n.d(r, "getBBoxRange", function () { return f; }), n.d(r, "piMod", function () { return p; }); var i = new Map(); function o(t, e) { i.set(t, e); } var a = function (t) { var e = t.attr(); return { x: e.x, y: e.y, width: e.width, height: e.height }; }, s = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.r; return { x: n - i, y: r - i, width: 2 * i, height: 2 * i }; }; function u(t) { return Math.min.apply(null, t); } function c(t) { return Math.max.apply(null, t); } function h(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function l(t, e) { return Math.abs(t - e) < 0.001; } function d(t, e) { var n = u(t), r = u(e); return { x: n, y: r, width: c(t) - n, height: c(e) - r }; } function f(t, e, n, r) { return { minX: u([t, n]), maxX: c([t, n]), minY: u([e, r]), maxY: c([e, r]), }; } function p(t) { return (t + 2 * Math.PI) % (2 * Math.PI); } n(9); function g(t, e, n, r) { var i = 1 - r; return i * i * t + 2 * r * i * e + r * r * n; } function y(t, e, n) { var r = t + n - 2 * e; if (l(r, 0)) return [0.5]; var i = (t - e) / r; return i <= 1 && i >= 0 ? [i] : []; } var v = function (t, e, n, r, i, o) { var a = y(t, n, i)[0], s = y(e, r, o)[0], u = [t, i], c = [e, o]; return ( void 0 !== a && u.push(g(t, n, i, a)), void 0 !== s && c.push(g(e, r, o, s)), d(u, c) ); }; function m(t, e, n, r, i) { var o = 1 - i; return ( o * o * o * t + 3 * e * i * o * o + 3 * n * i * i * o + r * i * i * i ); } function b(t, e, n, r) { var i, o, a, s = -3 * t + 9 * e - 9 * n + 3 * r, u = 6 * t - 12 * e + 6 * n, c = 3 * e - 3 * t, h = []; if (l(s, 0)) l(u, 0) || ((i = -c / u) >= 0 && i <= 1 && h.push(i)); else { var d = u * u - 4 * s * c; l(d, 0) ? h.push(-u / (2 * s)) : d > 0 && ((o = (-u - (a = Math.sqrt(d))) / (2 * s)), (i = (-u + a) / (2 * s)) >= 0 && i <= 1 && h.push(i), o >= 0 && o <= 1 && h.push(o)); } return h; } var x = function (t, e, n, r, i, o, a, s) { for ( var u = [t, a], c = [e, s], h = b(t, n, i, a), l = b(e, r, o, s), f = 0; f < h.length; f++ ) u.push(m(t, n, i, a, h[f])); for (f = 0; f < l.length; f++) c.push(m(e, r, o, s, l[f])); return d(u, c); }; function w(t, e, n, r, i, o) { return ( n * Math.cos(i) * Math.cos(o) - r * Math.sin(i) * Math.sin(o) + t ); } function O(t, e, n, r, i, o) { return ( n * Math.sin(i) * Math.cos(o) + r * Math.cos(i) * Math.sin(o) + e ); } var M = function (t, e, n, r, i, o, a) { for ( var s = (function (t, e, n) { return Math.atan((-e / t) * Math.tan(n)); })(n, r, i), u = 1 / 0, c = -1 / 0, h = [o, a], l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI ) { var d = s + l; o < a ? o < d && d < a && h.push(d) : a < d && d < o && h.push(d); } for (l = 0; l < h.length; l++) { var f = w(t, 0, n, r, i, h[l]); f < u && (u = f), f > c && (c = f); } var p = (function (t, e, n) { return Math.atan(e / (t * Math.tan(n))); })(n, r, i), g = 1 / 0, y = -1 / 0, v = [o, a]; for (l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI) { var m = p + l; o < a ? o < m && m < a && v.push(m) : a < m && m < o && v.push(m); } for (l = 0; l < v.length; l++) { var b = O(0, e, n, r, i, v[l]); b < g && (g = b), b > y && (y = b); } return { x: u, y: g, width: c - u, height: y - g }; }; function S(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function C(t, e) { var n = t.get("startArrowShape"), r = t.get("endArrowShape"); return ( n && (e = S(e, n.getCanvasBBox())), r && (e = S(e, r.getCanvasBBox())), e ); } var j = n(8), k = n(7), E = n(0); function N(t, e) { var n = t.prePoint, r = t.currentPoint, i = t.nextPoint, o = Math.pow(r[0] - n[0], 2) + Math.pow(r[1] - n[1], 2), a = Math.pow(r[0] - i[0], 2) + Math.pow(r[1] - i[1], 2), s = Math.pow(n[0] - i[0], 2) + Math.pow(n[1] - i[1], 2), u = Math.acos((o + a - s) / (2 * Math.sqrt(o) * Math.sqrt(a))); if (!u || 0 === Math.sin(u) || Object(E.u)(u, 0)) return { xExtra: 0, yExtra: 0 }; var c = Math.abs(Math.atan2(i[1] - r[1], i[0] - r[0])), h = Math.abs(Math.atan2(i[0] - r[0], i[1] - r[1])); return ( (c = c > Math.PI / 2 ? Math.PI - c : c), (h = h > Math.PI / 2 ? Math.PI - h : h), { xExtra: Math.cos(u / 2 - c) * ((e / 2) * (1 / Math.sin(u / 2))) - e / 2 || 0, yExtra: Math.cos(h - u / 2) * ((e / 2) * (1 / Math.sin(u / 2))) - e / 2 || 0, } ); } o("rect", a), o("image", a), o("circle", s), o("marker", s), o("polyline", function (t) { for ( var e = t.attr().points, n = [], i = [], o = 0; o < e.length; o++ ) { var a = e[o]; n.push(a[0]), i.push(a[1]); } var s = r.getBBoxByArray(n, i), u = s.x, c = s.y, h = { minX: u, minY: c, maxX: u + s.width, maxY: c + s.height }; return { x: (h = C(t, h)).minX, y: h.minY, width: h.maxX - h.minX, height: h.maxY - h.minY, }; }), o("polygon", function (t) { for ( var e = t.attr().points, n = [], i = [], o = 0; o < e.length; o++ ) { var a = e[o]; n.push(a[0]), i.push(a[1]); } return r.getBBoxByArray(n, i); }), o("text", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Object(j.a)(e)); var u, c = Object(j.c)(i, s); if (c) { var h = e.textAlign, l = e.textBaseline, d = Object(j.b)(i, o, a), f = { x: n, y: r - d }; h && ("end" === h || "right" === h ? (f.x -= c) : "center" === h && (f.x -= c / 2)), l && ("top" === l ? (f.y += d) : "middle" === l && (f.y += d / 2)), (u = { x: f.x, y: f.y, width: c, height: d }); } else u = { x: n, y: r, width: 0, height: 0 }; return u; }), o("path", function (t) { var e = t.attr(), n = e.path, r = e.stroke ? e.lineWidth : 0, i = (function (t, e) { for (var n = [], r = [], i = [], o = 0; o < t.length; o++) { var a = (g = t[o]).currentPoint, s = g.params, u = g.prePoint, c = void 0; switch (g.command) { case "Q": c = v(u[0], u[1], s[1], s[2], s[3], s[4]); break; case "C": c = x(u[0], u[1], s[1], s[2], s[3], s[4], s[5], s[6]); break; case "A": var h = g.arcParams; c = M( h.cx, h.cy, h.rx, h.ry, h.xRotation, h.startAngle, h.endAngle, ); break; default: n.push(a[0]), r.push(a[1]); } c && ((g.box = c), n.push(c.x, c.x + c.width), r.push(c.y, c.y + c.height)), e && ("L" === g.command || "M" === g.command) && g.prePoint && g.nextPoint && i.push(g); } (n = n.filter(function (t) { return !Number.isNaN(t); })), (r = r.filter(function (t) { return !Number.isNaN(t); })); var l = Object(E.B)(n), d = Object(E.B)(r), f = Object(E.A)(n), p = Object(E.A)(r); if (0 === i.length) return { x: l, y: d, width: f - l, height: p - d }; for (o = 0; o < i.length; o++) { var g; (a = (g = i[o]).currentPoint)[0] === l ? (l -= N(g, e).xExtra) : a[0] === f && (f += N(g, e).xExtra), a[1] === d ? (d -= N(g, e).yExtra) : a[1] === p && (p += N(g, e).yExtra); } return { x: l, y: d, width: f - l, height: p - d }; })(t.get("segments") || Object(k.c)(n), r), o = i.x, a = i.y, s = { minX: o, minY: a, maxX: o + i.width, maxY: a + i.height }; return { x: (s = C(t, s)).minX, y: s.minY, width: s.maxX - s.minX, height: s.maxY - s.minY, }; }), o("line", function (t) { var e = t.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = { minX: Math.min(n, i), maxX: Math.max(n, i), minY: Math.min(r, o), maxY: Math.max(r, o), }; return { x: (a = C(t, a)).minX, y: a.minY, width: a.maxX - a.minX, height: a.maxY - a.minY, }; }), o("ellipse", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; return { x: n - i, y: r - o, width: 2 * i, height: 2 * o }; }); }, function (t, e, n) { var r, i, o; function a(t) { return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } (i = []), void 0 === (o = "function" == typeof (r = function () { var n = (function () { var t = { row: "left", "row-reverse": "right", column: "top", "column-reverse": "bottom", }, e = { row: "right", "row-reverse": "left", column: "bottom", "column-reverse": "top", }, n = { row: "left", "row-reverse": "right", column: "top", "column-reverse": "bottom", }, r = { row: "width", "row-reverse": "width", column: "height", "column-reverse": "height", }; function i(t) { return void 0 === t; } function o(t) { return "row" === t || "row-reverse" === t; } function a(t, e) { if (void 0 !== t.style.marginStart && o(e)) return t.style.marginStart; var n = null; switch (e) { case "row": n = t.style.marginLeft; break; case "row-reverse": n = t.style.marginRight; break; case "column": n = t.style.marginTop; break; case "column-reverse": n = t.style.marginBottom; } return void 0 !== n ? n : void 0 !== t.style.margin ? t.style.margin : 0; } function s(t, e) { if (void 0 !== t.style.marginEnd && o(e)) return t.style.marginEnd; var n = null; switch (e) { case "row": n = t.style.marginRight; break; case "row-reverse": n = t.style.marginLeft; break; case "column": n = t.style.marginBottom; break; case "column-reverse": n = t.style.marginTop; } return null != n ? n : void 0 !== t.style.margin ? t.style.margin : 0; } function u(t, e) { if ( void 0 !== t.style.borderStartWidth && t.style.borderStartWidth >= 0 && o(e) ) return t.style.borderStartWidth; var n = null; switch (e) { case "row": n = t.style.borderLeftWidth; break; case "row-reverse": n = t.style.borderRightWidth; break; case "column": n = t.style.borderTopWidth; break; case "column-reverse": n = t.style.borderBottomWidth; } return null != n && n >= 0 ? n : void 0 !== t.style.borderWidth && t.style.borderWidth >= 0 ? t.style.borderWidth : 0; } function c(t, e) { if ( void 0 !== t.style.borderEndWidth && t.style.borderEndWidth >= 0 && o(e) ) return t.style.borderEndWidth; var n = null; switch (e) { case "row": n = t.style.borderRightWidth; break; case "row-reverse": n = t.style.borderLeftWidth; break; case "column": n = t.style.borderBottomWidth; break; case "column-reverse": n = t.style.borderTopWidth; } return null != n && n >= 0 ? n : void 0 !== t.style.borderWidth && t.style.borderWidth >= 0 ? t.style.borderWidth : 0; } function h(t, e) { return ( (function (t, e) { if ( void 0 !== t.style.paddingStart && t.style.paddingStart >= 0 && o(e) ) return t.style.paddingStart; var n = null; switch (e) { case "row": n = t.style.paddingLeft; break; case "row-reverse": n = t.style.paddingRight; break; case "column": n = t.style.paddingTop; break; case "column-reverse": n = t.style.paddingBottom; } return null != n && n >= 0 ? n : void 0 !== t.style.padding && t.style.padding >= 0 ? t.style.padding : 0; })(t, e) + u(t, e) ); } function l(t, e) { return ( (function (t, e) { if ( void 0 !== t.style.paddingEnd && t.style.paddingEnd >= 0 && o(e) ) return t.style.paddingEnd; var n = null; switch (e) { case "row": n = t.style.paddingRight; break; case "row-reverse": n = t.style.paddingLeft; break; case "column": n = t.style.paddingBottom; break; case "column-reverse": n = t.style.paddingTop; } return null != n && n >= 0 ? n : void 0 !== t.style.padding && t.style.padding >= 0 ? t.style.padding : 0; })(t, e) + c(t, e) ); } function d(t, e) { return u(t, e) + c(t, e); } function f(t, e) { return a(t, e) + s(t, e); } function p(t, e) { return h(t, e) + l(t, e); } function g(t, e) { return e.style.alignSelf ? e.style.alignSelf : t.style.alignItems ? t.style.alignItems : "stretch"; } function y(t, e) { if ("rtl" === e) { if ("row" === t) return "row-reverse"; if ("row-reverse" === t) return "row"; } return t; } function v(t) { return t.style.position ? t.style.position : "relative"; } function m(t) { return "relative" === v(t) && t.style.flex > 0; } function b(t, e) { return t.layout[r[e]] + f(t, e); } function x(t, e) { return void 0 !== t.style[r[e]] && t.style[r[e]] >= 0; } function w(t, e) { return void 0 !== t.style[e]; } function O(t, e) { return void 0 !== t.style[e] ? t.style[e] : 0; } function M(t, e, n) { var r = { row: t.style.minWidth, "row-reverse": t.style.minWidth, column: t.style.minHeight, "column-reverse": t.style.minHeight, }[e], i = { row: t.style.maxWidth, "row-reverse": t.style.maxWidth, column: t.style.maxHeight, "column-reverse": t.style.maxHeight, }[e], o = n; return ( void 0 !== i && i >= 0 && o > i && (o = i), void 0 !== r && r >= 0 && o < r && (o = r), o ); } function S(t, e) { return t > e ? t : e; } function C(t, e) { void 0 === t.layout[r[e]] && x(t, e) && (t.layout[r[e]] = S(M(t, e, t.style[r[e]]), p(t, e))); } function j(t, i, o) { i.layout[e[o]] = t.layout[r[o]] - i.layout[r[o]] - i.layout[n[o]]; } function k(n, r) { return void 0 !== n.style[t[r]] ? O(n, t[r]) : -O(n, e[r]); } function E(c, E, T) { var P = (function (t, e) { var n; return ( "inherit" === (n = t.style.direction ? t.style.direction : "inherit") && (n = void 0 === e ? "ltr" : e), n ); })(c, T), I = y( (function (t) { return t.style.flexDirection ? t.style.flexDirection : "column"; })(c), P, ), B = (function (t, e) { return (function (t) { return "column" === t || "column-reverse" === t; })(t) ? y("row", e) : "column"; })(I, P), A = y("row", P); C(c, I), C(c, B), (c.layout.direction = P), (c.layout[t[I]] += a(c, I) + k(c, I)), (c.layout[e[I]] += s(c, I) + k(c, I)), (c.layout[t[B]] += a(c, B) + k(c, B)), (c.layout[e[B]] += s(c, B) + k(c, B)); var L = c.children.length, D = p(c, A); if ( (function (t) { return void 0 !== t.style.measure; })(c) ) { var _ = !i(c.layout[r[A]]), R = void 0; (R = x(c, A) ? c.style.width : _ ? c.layout[r[A]] : E - f(c, A)), (R -= D); var Y = !x(c, A) && !_, F = !x(c, "column") && i(c.layout[r.column]); if (Y || F) { var z = c.style.measure(R); Y && (c.layout.width = z.width + D), F && (c.layout.height = z.height + p(c, "column")); } if (0 === L) return; } var X, W, G, q, H = (function (t) { return "wrap" === t.style.flexWrap; })(c), V = (function (t) { return t.style.justifyContent ? t.style.justifyContent : "flex-start"; })(c), U = h(c, I), Z = h(c, B), K = p(c, I), Q = p(c, B), $ = !i(c.layout[r[I]]), J = !i(c.layout[r[B]]), tt = o(I), et = null, nt = null, rt = void 0; $ && (rt = c.layout[r[I]] - K); for ( var it = 0, ot = 0, at = 0, st = 0, ut = 0, ct = 0; ot < L; ) { var ht, lt = 0, dt = 0, ft = 0, pt = 0, gt = ($ && "flex-start" === V) || (!$ && "center" !== V), yt = gt ? L : it, vt = !0, mt = L, bt = null, xt = null, wt = U, Ot = 0; for (X = it; X < L; ++X) { if ( (((G = c.children[X]).lineIndex = ct), (G.nextAbsoluteChild = null), (G.nextFlexChild = null), "stretch" === (Pt = g(c, G)) && "relative" === v(G) && J && !x(G, B)) ) G.layout[r[B]] = S( M(G, B, c.layout[r[B]] - Q - f(G, B)), p(G, B), ); else if ("absolute" === v(G)) for ( null === et && (et = G), null !== nt && (nt.nextAbsoluteChild = G), nt = G, W = 0; W < 2; W++ ) (q = 0 !== W ? "row" : "column"), !i(c.layout[r[q]]) && !x(G, q) && w(G, t[q]) && w(G, e[q]) && (G.layout[r[q]] = S( M( G, q, c.layout[r[q]] - p(c, q) - f(G, q) - O(G, t[q]) - O(G, e[q]), ), p(G, q), )); var Mt = 0; if ( ($ && m(G) ? (dt++, (ft += G.style.flex), null === bt && (bt = G), null !== xt && (xt.nextFlexChild = G), (xt = G), (Mt = p(G, I) + f(G, I))) : ((ht = void 0), tt || (ht = x(c, A) ? c.layout[r[A]] - D : E - f(c, A) - D), 0 === at && N(G, ht, P), "relative" === v(G) && (pt++, (Mt = b(G, I)))), H && $ && lt + Mt > rt && X !== it) ) { pt--, (at = 1); break; } gt && ("relative" !== v(G) || m(G)) && ((gt = !1), (yt = X)), vt && ("relative" !== v(G) || ("stretch" !== Pt && "flex-start" !== Pt) || i(G.layout[r[B]])) && ((vt = !1), (mt = X)), gt && ((G.layout[n[I]] += wt), $ && j(c, G, I), (wt += b(G, I)), (Ot = S(Ot, M(G, B, b(G, B))))), vt && ((G.layout[n[B]] += st + Z), J && j(c, G, B)), (at = 0), (lt += Mt), (ot = X + 1); } var St = 0, Ct = 0, jt = 0; if (((jt = $ ? rt - lt : S(lt, 0) - lt), 0 !== dt)) { var kt, Et, Nt = jt / ft; for (xt = bt; null !== xt; ) (kt = Nt * xt.style.flex + p(xt, I)) !== (Et = M(xt, I, kt)) && ((jt -= Et), (ft -= xt.style.flex)), (xt = xt.nextFlexChild); for ( (Nt = jt / ft) < 0 && (Nt = 0), xt = bt; null !== xt; ) (xt.layout[r[I]] = M( xt, I, Nt * xt.style.flex + p(xt, I), )), (ht = void 0), x(c, A) ? (ht = c.layout[r[A]] - D) : tt || (ht = E - f(c, A) - D), N(xt, ht, P), (G = xt), (xt = xt.nextFlexChild), (G.nextFlexChild = null); } else "flex-start" !== V && ("center" === V ? (St = jt / 2) : "flex-end" === V ? (St = jt) : "space-between" === V ? ((jt = S(jt, 0)), (Ct = dt + pt - 1 != 0 ? jt / (dt + pt - 1) : 0)) : "space-around" === V && (St = (Ct = jt / (dt + pt)) / 2)); for (wt += St, X = yt; X < ot; ++X) "absolute" === v((G = c.children[X])) && w(G, t[I]) ? (G.layout[n[I]] = O(G, t[I]) + u(c, I) + a(G, I)) : ((G.layout[n[I]] += wt), $ && j(c, G, I), "relative" === v(G) && ((wt += Ct + b(G, I)), (Ot = S(Ot, M(G, B, b(G, B)))))); var Tt = c.layout[r[B]]; for (J || (Tt = S(M(c, B, Ot + Q), Q)), X = mt; X < ot; ++X) if ("absolute" === v((G = c.children[X])) && w(G, t[B])) G.layout[n[B]] = O(G, t[B]) + u(c, B) + a(G, B); else { var Pt, It = Z; if ("relative" === v(G)) if ("stretch" === (Pt = g(c, G))) i(G.layout[r[B]]) && (G.layout[r[B]] = S( M(G, B, Tt - Q - f(G, B)), p(G, B), )); else if ("flex-start" !== Pt) { var Bt = Tt - Q - b(G, B); It += "center" === Pt ? Bt / 2 : Bt; } (G.layout[n[B]] += st + It), J && j(c, G, B); } (st += Ot), (ut = S(ut, wt)), (ct += 1), (it = ot); } if (ct > 1 && J) { var At = c.layout[r[B]] - Q, Lt = At - st, Dt = 0, _t = Z, Rt = (function (t) { return t.style.alignContent ? t.style.alignContent : "flex-start"; })(c); "flex-end" === Rt ? (_t += Lt) : "center" === Rt ? (_t += Lt / 2) : "stretch" === Rt && At > st && (Dt = Lt / ct); var Yt = 0; for (X = 0; X < ct; ++X) { var Ft = Yt, zt = 0; for (W = Ft; W < L; ++W) if ("relative" === v((G = c.children[W]))) { if (G.lineIndex !== X) break; i(G.layout[r[B]]) || (zt = S(zt, G.layout[r[B]] + f(G, B))); } for (Yt = W, zt += Dt, W = Ft; W < Yt; ++W) if ("relative" === v((G = c.children[W]))) { var Xt = g(c, G); if ("flex-start" === Xt) G.layout[n[B]] = _t + a(G, B); else if ("flex-end" === Xt) G.layout[n[B]] = _t + zt - s(G, B) - G.layout[r[B]]; else if ("center" === Xt) { var Wt = G.layout[r[B]]; G.layout[n[B]] = _t + (zt - Wt) / 2; } else "stretch" === Xt && (G.layout[n[B]] = _t + a(G, B)); } _t += zt; } } var Gt = !1, qt = !1; if ( ($ || ((c.layout[r[I]] = S(M(c, I, ut + l(c, I)), K)), ("row-reverse" !== I && "column-reverse" !== I) || (Gt = !0)), J || ((c.layout[r[B]] = S(M(c, B, st + Q), Q)), ("row-reverse" !== B && "column-reverse" !== B) || (qt = !0)), Gt || qt) ) for (X = 0; X < L; ++X) (G = c.children[X]), Gt && j(c, G, I), qt && j(c, G, B); for (nt = et; null !== nt; ) { for (W = 0; W < 2; W++) (q = 0 !== W ? "row" : "column"), !i(c.layout[r[q]]) && !x(nt, q) && w(nt, t[q]) && w(nt, e[q]) && (nt.layout[r[q]] = S( M( nt, q, c.layout[r[q]] - d(c, q) - f(nt, q) - O(nt, t[q]) - O(nt, e[q]), ), p(nt, q), )), w(nt, e[q]) && !w(nt, t[q]) && (nt.layout[t[q]] = c.layout[r[q]] - nt.layout[r[q]] - O(nt, e[q])); (G = nt), (nt = nt.nextAbsoluteChild), (G.nextAbsoluteChild = null); } } function N(t, e, n) { t.shouldUpdate = !0; var r = t.style.direction || "ltr"; !t.isDirty && t.lastLayout && t.lastLayout.requestedHeight === t.layout.height && t.lastLayout.requestedWidth === t.layout.width && t.lastLayout.parentMaxWidth === e && t.lastLayout.direction === r ? ((t.layout.width = t.lastLayout.width), (t.layout.height = t.lastLayout.height), (t.layout.top = t.lastLayout.top), (t.layout.left = t.lastLayout.left)) : (t.lastLayout || (t.lastLayout = {}), (t.lastLayout.requestedWidth = t.layout.width), (t.lastLayout.requestedHeight = t.layout.height), (t.lastLayout.parentMaxWidth = e), (t.lastLayout.direction = r), t.children.forEach(function (t) { (t.layout.width = void 0), (t.layout.height = void 0), (t.layout.top = 0), (t.layout.left = 0); }), E(t, e, n), (t.lastLayout.width = t.layout.width), (t.lastLayout.height = t.layout.height), (t.lastLayout.top = t.layout.top), (t.lastLayout.left = t.layout.left)); } return { layoutNodeImpl: E, computeLayout: N, fillNodes: function t(e) { return ( (e.layout && !e.isDirty) || (e.layout = { width: void 0, height: void 0, top: 0, left: 0, right: 0, bottom: 0, }), e.style || (e.style = {}), e.children || (e.children = []), e.children.forEach(t), e ); }, }; })(); return ( "object" === a(e) && (t.exports = n), function (t) { n.fillNodes(t), n.computeLayout(t); } ); }) ? r.apply(e, i) : r) || (t.exports = o); }, function (t, e, n) { "use strict"; (function (t) { n.d(e, "a", function () { return d; }); var r = function () { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; }, i = function (t, e, n) { (this.name = t), (this.version = e), (this.os = n), (this.type = "browser"); }, o = function (e) { (this.version = e), (this.type = "node"), (this.name = "node"), (this.os = t.platform); }, a = function (t, e, n, r) { (this.name = t), (this.version = e), (this.os = n), (this.bot = r), (this.type = "bot-device"); }, s = function () { (this.type = "bot"), (this.bot = !0), (this.name = "bot"), (this.version = null), (this.os = null); }, u = function () { (this.type = "react-native"), (this.name = "react-native"), (this.version = null), (this.os = null); }, c = /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/, h = [ ["aol", /AOLShield\/([0-9\._]+)/], ["edge", /Edge\/([0-9\._]+)/], ["edge-ios", /EdgiOS\/([0-9\._]+)/], ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], ["samsung", /SamsungBrowser\/([0-9\.]+)/], ["silk", /\bSilk\/([0-9._-]+)\b/], ["miui", /MiuiBrowser\/([0-9\.]+)$/], ["beaker", /BeakerBrowser\/([0-9\.]+)/], ["edge-chromium", /EdgA?\/([0-9\.]+)/], [ "chromium-webview", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, ], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["fxios", /FxiOS\/([0-9\.]+)/], ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], ["android", /Android\s([0-9\.]+)/], ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], ["safari", /Version\/([0-9\._]+).*Safari/], ["facebook", /FBAV\/([0-9\.]+)/], ["instagram", /Instagram\s([0-9\.]+)/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], [ "searchbot", /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/, ], ], l = [ ["iOS", /iP(hone|od|ad)/], ["Android OS", /Android/], ["BlackBerry OS", /BlackBerry|BB10/], ["Windows Mobile", /IEMobile/], ["Amazon OS", /Kindle/], ["Windows 3.11", /Win16/], ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows 98", /(Windows 98)|(Win98)/], ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows Server 2003", /(Windows NT 5.2)/], ["Windows Vista", /(Windows NT 6.0)/], ["Windows 7", /(Windows NT 6.1)/], ["Windows 8", /(Windows NT 6.2)/], ["Windows 8.1", /(Windows NT 6.3)/], ["Windows 10", /(Windows NT 10.0)/], ["Windows ME", /Windows ME/], ["Open BSD", /OpenBSD/], ["Sun OS", /SunOS/], ["Chrome OS", /CrOS/], ["Linux", /(Linux)|(X11)/], ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], ["QNX", /QNX/], ["BeOS", /BeOS/], ["OS/2", /OS\/2/], ]; function d(e) { return e ? p(e) : "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" === navigator.product ? new u() : "undefined" != typeof navigator ? p(navigator.userAgent) : void 0 !== t && t.version ? new o(t.version.slice(1)) : null; } function f(t) { return ( "" !== t && h.reduce(function (e, n) { var r = n[0], i = n[1]; if (e) return e; var o = i.exec(t); return !!o && [r, o]; }, !1) ); } function p(t) { var e = f(t); if (!e) return null; var n = e[0], o = e[1]; if ("searchbot" === n) return new s(); var u = o[1] && o[1].split(/[._]/).slice(0, 3); u ? u.length < 3 && (u = r( u, (function (t) { for (var e = [], n = 0; n < t; n++) e.push("0"); return e; })(3 - u.length), )) : (u = []); var h = u.join("."), d = (function (t) { for (var e = 0, n = l.length; e < n; e++) { var r = l[e], i = r[0]; if (r[1].exec(t)) return i; } return null; })(t), p = c.exec(t); return p && p[1] ? new a(n, h, d, p[1]) : new i(n, h, d); } }).call(this, n(32)); }, , , , , , , , function (t, e) { var n, r, i = (t.exports = {}); function o() { throw new Error("setTimeout has not been defined"); } function a() { throw new Error("clearTimeout has not been defined"); } function s(t) { if (n === setTimeout) return setTimeout(t, 0); if ((n === o || !n) && setTimeout) return (n = setTimeout), setTimeout(t, 0); try { return n(t, 0); } catch (e) { try { return n.call(null, t, 0); } catch (e) { return n.call(this, t, 0); } } } !(function () { try { n = "function" == typeof setTimeout ? setTimeout : o; } catch (t) { n = o; } try { r = "function" == typeof clearTimeout ? clearTimeout : a; } catch (t) { r = a; } })(); var u, c = [], h = !1, l = -1; function d() { h && u && ((h = !1), u.length ? (c = u.concat(c)) : (l = -1), c.length && f()); } function f() { if (!h) { var t = s(d); h = !0; for (var e = c.length; e; ) { for (u = c, c = []; ++l < e; ) u && u[l].run(); (l = -1), (e = c.length); } (u = null), (h = !1), (function (t) { if (r === clearTimeout) return clearTimeout(t); if ((r === a || !r) && clearTimeout) return (r = clearTimeout), clearTimeout(t); try { r(t); } catch (e) { try { return r.call(null, t); } catch (e) { return r.call(this, t); } } })(t); } } function p(t, e) { (this.fun = t), (this.array = e); } function g() {} (i.nextTick = function (t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; c.push(new p(t, e)), 1 !== c.length || h || s(f); }), (p.prototype.run = function () { this.fun.apply(null, this.array); }), (i.title = "browser"), (i.browser = !0), (i.env = {}), (i.argv = []), (i.version = ""), (i.versions = {}), (i.on = g), (i.addListener = g), (i.once = g), (i.off = g), (i.removeListener = g), (i.removeAllListeners = g), (i.emit = g), (i.prependListener = g), (i.prependOnceListener = g), (i.listeners = function (t) { return []; }), (i.binding = function (t) { throw new Error("process.binding is not supported"); }), (i.cwd = function () { return "/"; }), (i.chdir = function (t) { throw new Error("process.chdir is not supported"); }), (i.umask = function () { return 0; }); }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "TimeBar", function () { return $e; }), n.d(e, "SnapLine", function () { return qi; }), n.d(e, "Tooltip", function () { return Hi; }), n.d(e, "Legend", function () { return Zi; }), n.d(e, "ZoomSlider", function () { return Ki; }), n.d(e, "EdgeFilterLens", function () { return Ji; }), n.d(e, "Fisheye", function () { return eo; }), n.d(e, "MiniMap", function () { return io; }), n.d(e, "Bundling", function () { return so; }), n.d(e, "Menu", function () { return uo; }); var r = {}; n.r(r), n.d(r, "default", function () { return Ut; }), n.d(r, "assign", function () { return Et; }), n.d(r, "format", function () { return Ht; }), n.d(r, "parse", function () { return Vt; }), n.d(r, "defaultI18n", function () { return It; }), n.d(r, "setGlobalDateI18n", function () { return At; }), n.d(r, "setGlobalDateMasks", function () { return qt; }); var i = {}; n.r(i), n.d(i, "compare", function () { return Sn; }), n.d(i, "getLineIntersect", function () { return jn; }), n.d(i, "getRectIntersectByPoint", function () { return kn; }), n.d(i, "getCircleIntersectByPoint", function () { return En; }), n.d(i, "getEllipseIntersectByPoint", function () { return Nn; }), n.d(i, "applyMatrix", function () { return Tn; }), n.d(i, "invertMatrix", function () { return Pn; }), n.d(i, "getCircleCenterByPoints", function () { return In; }), n.d(i, "distance", function () { return Bn; }), n.d(i, "scaleMatrix", function () { return An; }), n.d(i, "floydWarshall", function () { return Ln; }), n.d(i, "getAdjMatrix", function () { return Dn; }), n.d(i, "translate", function () { return _n; }), n.d(i, "move", function () { return Rn; }), n.d(i, "scale", function () { return Yn; }), n.d(i, "rotate", function () { return Fn; }), n.d(i, "getDegree", function () { return zn; }), n.d(i, "isPointInPolygon", function () { return Wn; }), n.d(i, "intersectBBox", function () { return Gn; }), n.d(i, "isPolygonsIntersect", function () { return qn; }), n.d(i, "Line", function () { return Hn; }), n.d(i, "getBBoxBoundLine", function () { return Vn; }), n.d(i, "itemIntersectByLine", function () { return Zn; }), n.d(i, "fractionToLine", function () { return Kn; }), n.d(i, "getPointsCenter", function () { return Qn; }), n.d(i, "squareDist", function () { return $n; }), n.d(i, "pointLineSquareDist", function () { return Jn; }), n.d(i, "isPointsOverlap", function () { return tr; }), n.d(i, "pointRectSquareDist", function () { return er; }), n.d(i, "pointLineDistance", function () { return nr; }); var o = {}; n.r(o), n.d(o, "getBBox", function () { return gr; }), n.d(o, "getLoopCfgs", function () { return yr; }), n.d(o, "getLabelPosition", function () { return vr; }), n.d(o, "traverseTree", function () { return br; }), n.d(o, "traverseTreeUp", function () { return xr; }), n.d(o, "getLetterWidth", function () { return wr; }), n.d(o, "getTextSize", function () { return Or; }), n.d(o, "plainCombosToTrees", function () { return Mr; }), n.d(o, "reconstructTree", function () { return Sr; }), n.d(o, "getComboBBox", function () { return Cr; }), n.d(o, "shouldRefreshEdge", function () { return jr; }), n.d(o, "cloneBesidesImg", function () { return kr; }); var a = {}; n.r(a), n.d(a, "uniqueId", function () { return Ir; }), n.d(a, "formatPadding", function () { return Br; }), n.d(a, "cloneEvent", function () { return Ar; }), n.d(a, "isViewportChanged", function () { return Lr; }), n.d(a, "isNaN", function () { return Dr; }), n.d(a, "calculationItemsBBox", function () { return _r; }), n.d(a, "processParallelEdges", function () { return Rr; }); var s = {}; n.r(s), n.d(s, "getSpline", function () { return oi; }), n.d(s, "getControlPoint", function () { return ai; }), n.d(s, "pointsToPolygon", function () { return si; }), n.d(s, "pathToPoints", function () { return ui; }), n.d(s, "getClosedSpline", function () { return ci; }), n.d(s, "roundedHull", function () { return fi; }), n.d(s, "paddedHull", function () { return pi; }); var u = {}; n.r(u), n.d(u, "defaultSubjectColors", function () { return Fi; }); var c, h = n(1); function l(t) { if (/^[-\+\.\d]+$/.test(t)) return Number(t); if (/true|false/.test(t)) return Boolean(t); if (/^\s*\[/.test(t)) try { return JSON.parse(t); } catch (e) { throw new Error("解析数组" + t + "失败"); } if (/^\s*\{/.test(t)) try { return JSON.parse(t); } catch (e) { throw new Error("解析对象" + t + "失败"); } return t; } function d(t) { return ( c[t] || t.startsWith("rgb(") || t.startsWith("rgba(") || (t.startsWith("#") && !isNaN(Number("0x" + t.slice(1)))) ); } function f(t, e) { t && e && (t.attrs.id && e("id", t.attrs.id), t.attrs.class && p(t.attrs.class, /\s+/g).forEach(function (t) { return e("class", t); }), e("tagName", t.tagName)); } function p(t, e) { return e ? t.split(e).filter(function (t) { return "" != t; }) : [t]; } function g(t, e) { if (!t || !e) return !1; var n = e.match(/(^[^\.#]+)/g), r = e.match(/#[^\.#]+/g), i = e.match(/\.[^\.#]+/g), o = Object(h.f)( Object(h.f)(Object(h.f)([], n || []), r || []), i || [], ), a = {}; f(t, function (t, e) { switch (t) { case "id": a["#" + e] = 1; break; case "class": a["." + e] = 1; break; case "tagName": a["" + e] = 1; } }); for (var s = 0, u = o; s < u.length; s++) { var c = u[s]; if (!a[c]) return !1; } return !0; } !(function (t) { (t[(t.aliceblue = 0)] = "aliceblue"), (t[(t.antiquewhite = 1)] = "antiquewhite"), (t[(t.aqua = 2)] = "aqua"), (t[(t.aquamarine = 3)] = "aquamarine"), (t[(t.azure = 4)] = "azure"), (t[(t.beige = 5)] = "beige"), (t[(t.bisque = 6)] = "bisque"), (t[(t.black = 7)] = "black"), (t[(t.blanchedalmond = 8)] = "blanchedalmond"), (t[(t.blue = 9)] = "blue"), (t[(t.blueviolet = 10)] = "blueviolet"), (t[(t.brown = 11)] = "brown"), (t[(t.burlywood = 12)] = "burlywood"), (t[(t.cadetblue = 13)] = "cadetblue"), (t[(t.chartreuse = 14)] = "chartreuse"), (t[(t.chocolate = 15)] = "chocolate"), (t[(t.coral = 16)] = "coral"), (t[(t.cornflowerblue = 17)] = "cornflowerblue"), (t[(t.cornsilk = 18)] = "cornsilk"), (t[(t.crimson = 19)] = "crimson"), (t[(t.cyan = 20)] = "cyan"), (t[(t.darkblue = 21)] = "darkblue"), (t[(t.darkcyan = 22)] = "darkcyan"), (t[(t.darkgoldenrod = 23)] = "darkgoldenrod"), (t[(t.darkgray = 24)] = "darkgray"), (t[(t.darkgreen = 25)] = "darkgreen"), (t[(t.darkgrey = 26)] = "darkgrey"), (t[(t.darkkhaki = 27)] = "darkkhaki"), (t[(t.darkmagenta = 28)] = "darkmagenta"), (t[(t.darkolivegreen = 29)] = "darkolivegreen"), (t[(t.darkorange = 30)] = "darkorange"), (t[(t.darkorchid = 31)] = "darkorchid"), (t[(t.darkred = 32)] = "darkred"), (t[(t.darksalmon = 33)] = "darksalmon"), (t[(t.darkseagreen = 34)] = "darkseagreen"), (t[(t.darkslateblue = 35)] = "darkslateblue"), (t[(t.darkslategray = 36)] = "darkslategray"), (t[(t.darkslategrey = 37)] = "darkslategrey"), (t[(t.darkturquoise = 38)] = "darkturquoise"), (t[(t.darkviolet = 39)] = "darkviolet"), (t[(t.deeppink = 40)] = "deeppink"), (t[(t.deepskyblue = 41)] = "deepskyblue"), (t[(t.dimgray = 42)] = "dimgray"), (t[(t.dimgrey = 43)] = "dimgrey"), (t[(t.dodgerblue = 44)] = "dodgerblue"), (t[(t.firebrick = 45)] = "firebrick"), (t[(t.floralwhite = 46)] = "floralwhite"), (t[(t.forestgreen = 47)] = "forestgreen"), (t[(t.fuchsia = 48)] = "fuchsia"), (t[(t.gainsboro = 49)] = "gainsboro"), (t[(t.ghostwhite = 50)] = "ghostwhite"), (t[(t.gold = 51)] = "gold"), (t[(t.goldenrod = 52)] = "goldenrod"), (t[(t.gray = 53)] = "gray"), (t[(t.green = 54)] = "green"), (t[(t.greenyellow = 55)] = "greenyellow"), (t[(t.grey = 56)] = "grey"), (t[(t.honeydew = 57)] = "honeydew"), (t[(t.hotpink = 58)] = "hotpink"), (t[(t.indianred = 59)] = "indianred"), (t[(t.indigo = 60)] = "indigo"), (t[(t.ivory = 61)] = "ivory"), (t[(t.khaki = 62)] = "khaki"), (t[(t.lavender = 63)] = "lavender"), (t[(t.lavenderblush = 64)] = "lavenderblush"), (t[(t.lawngreen = 65)] = "lawngreen"), (t[(t.lemonchiffon = 66)] = "lemonchiffon"), (t[(t.lightblue = 67)] = "lightblue"), (t[(t.lightcoral = 68)] = "lightcoral"), (t[(t.lightcyan = 69)] = "lightcyan"), (t[(t.lightgoldenrodyellow = 70)] = "lightgoldenrodyellow"), (t[(t.lightgray = 71)] = "lightgray"), (t[(t.lightgreen = 72)] = "lightgreen"), (t[(t.lightgrey = 73)] = "lightgrey"), (t[(t.lightpink = 74)] = "lightpink"), (t[(t.lightsalmon = 75)] = "lightsalmon"), (t[(t.lightseagreen = 76)] = "lightseagreen"), (t[(t.lightskyblue = 77)] = "lightskyblue"), (t[(t.lightslategray = 78)] = "lightslategray"), (t[(t.lightslategrey = 79)] = "lightslategrey"), (t[(t.lightsteelblue = 80)] = "lightsteelblue"), (t[(t.lightyellow = 81)] = "lightyellow"), (t[(t.lime = 82)] = "lime"), (t[(t.limegreen = 83)] = "limegreen"), (t[(t.linen = 84)] = "linen"), (t[(t.magenta = 85)] = "magenta"), (t[(t.maroon = 86)] = "maroon"), (t[(t.mediumaquamarine = 87)] = "mediumaquamarine"), (t[(t.mediumblue = 88)] = "mediumblue"), (t[(t.mediumorchid = 89)] = "mediumorchid"), (t[(t.mediumpurple = 90)] = "mediumpurple"), (t[(t.mediumseagreen = 91)] = "mediumseagreen"), (t[(t.mediumslateblue = 92)] = "mediumslateblue"), (t[(t.mediumspringgreen = 93)] = "mediumspringgreen"), (t[(t.mediumturquoise = 94)] = "mediumturquoise"), (t[(t.mediumvioletred = 95)] = "mediumvioletred"), (t[(t.midnightblue = 96)] = "midnightblue"), (t[(t.mintcream = 97)] = "mintcream"), (t[(t.mistyrose = 98)] = "mistyrose"), (t[(t.moccasin = 99)] = "moccasin"), (t[(t.navajowhite = 100)] = "navajowhite"), (t[(t.navy = 101)] = "navy"), (t[(t.oldlace = 102)] = "oldlace"), (t[(t.olive = 103)] = "olive"), (t[(t.olivedrab = 104)] = "olivedrab"), (t[(t.orange = 105)] = "orange"), (t[(t.orangered = 106)] = "orangered"), (t[(t.orchid = 107)] = "orchid"), (t[(t.palegoldenrod = 108)] = "palegoldenrod"), (t[(t.palegreen = 109)] = "palegreen"), (t[(t.paleturquoise = 110)] = "paleturquoise"), (t[(t.palevioletred = 111)] = "palevioletred"), (t[(t.papayawhip = 112)] = "papayawhip"), (t[(t.peachpuff = 113)] = "peachpuff"), (t[(t.peru = 114)] = "peru"), (t[(t.pink = 115)] = "pink"), (t[(t.plum = 116)] = "plum"), (t[(t.powderblue = 117)] = "powderblue"), (t[(t.purple = 118)] = "purple"), (t[(t.red = 119)] = "red"), (t[(t.rosybrown = 120)] = "rosybrown"), (t[(t.royalblue = 121)] = "royalblue"), (t[(t.saddlebrown = 122)] = "saddlebrown"), (t[(t.salmon = 123)] = "salmon"), (t[(t.sandybrown = 124)] = "sandybrown"), (t[(t.seagreen = 125)] = "seagreen"), (t[(t.seashell = 126)] = "seashell"), (t[(t.sienna = 127)] = "sienna"), (t[(t.silver = 128)] = "silver"), (t[(t.skyblue = 129)] = "skyblue"), (t[(t.slateblue = 130)] = "slateblue"), (t[(t.slategray = 131)] = "slategray"), (t[(t.slategrey = 132)] = "slategrey"), (t[(t.snow = 133)] = "snow"), (t[(t.springgreen = 134)] = "springgreen"), (t[(t.steelblue = 135)] = "steelblue"), (t[(t.tan = 136)] = "tan"), (t[(t.teal = 137)] = "teal"), (t[(t.thistle = 138)] = "thistle"), (t[(t.tomato = 139)] = "tomato"), (t[(t.turquoise = 140)] = "turquoise"), (t[(t.violet = 141)] = "violet"), (t[(t.wheat = 142)] = "wheat"), (t[(t.white = 143)] = "white"), (t[(t.whitesmoke = 144)] = "whitesmoke"), (t[(t.yellow = 145)] = "yellow"), (t[(t.yellowgreen = 146)] = "yellowgreen"); })(c || (c = {})); var y = { position: 1, display: 1, width: 1, height: 1, minWidth: 1, minHeight: 1, top: 1, left: 1, right: 1, bottom: 1, flex: 1, margin: 1, marginLeft: 1, marginRight: 1, marginTop: 1, marginBottom: 1, padding: 1, paddingLeft: 1, paddingRight: 1, paddingTop: 1, paddingBottom: 1, borderWidth: 1, borderLeftWidth: 1, borderRightWidth: 1, borderTopWidth: 1, borderBottomWidth: 1, flexDirection: 1, justifyContent: 1, alignItems: 1, alignSelf: 1, flexWrap: 1, }, v = {}; function m(t, e) { if (t) { var n = t; Array.isArray(n) || (n = [n]), n.forEach(function (t) { v[t] = "function" == typeof e ? e : l; }); } } var b = function (t, e) { var n = {}, r = e.split(/\s/g).filter(function (t) { return "" !== t; }); return ( 1 !== r.length || isNaN(r[0]) || (n["" + t] = Number(r[0])), 2 === r.length && (!isNaN(Number(r[0])) && (n[t + "Bottom"] = n[t + "Top"] = Number(r[0])), !isNaN(Number(r[1])) && (n[t + "Left"] = n[t + "Right"] = Number(r[1]))), 3 === r.length && (!isNaN(Number(r[0])) && (n[t + "Top"] = Number(r[0])), !isNaN(Number(r[1])) && (n[t + "Left"] = n[t + "Right"] = Number(r[1])), !isNaN(Number(r[2])) && (n[t + "Bottom"] = Number(r[2]))), 4 === r.length && (!isNaN(Number(r[0])) && (n[t + "Top"] = Number(r[0])), !isNaN(Number(r[1])) && (n[t + "Right"] = Number(r[1])), !isNaN(Number(r[2])) && (n[t + "Bottom"] = Number(r[2])), !isNaN(Number(r[3])) && (n[t + "Left"] = Number(r[3]))), n ); }, x = ["solid", "dashed"]; function w(t, e) { if (v[t]) return v[t](e); try { return l(e); } catch (t) { return console.error(t), e; } } m("padding", b.bind(null, "padding")), m("margin", b.bind(null, "margin")), m("border-radius", function (t) { var e = {}, n = t.split(/\s/g).filter(function (t) { return "" !== t; }); return ( 1 !== n.length || isNaN(n[0]) || ((e.borderTopLeftRadius = Number(n[0])), (e.borderTopRightRadius = Number(n[0])), (e.borderBottomRightRadius = Number(n[0])), (e.borderBottomLeftRadius = Number(n[0]))), 2 === n.length && (!isNaN(Number(n[0])) && (e.borderTopLeftRadius = e.borderBottomRightRadius = Number(n[0])), !isNaN(Number(n[2])) && (e.borderBottomLeftRadius = e.borderTopRightRadius = Number(n[1]))), 3 === n.length && (!isNaN(Number(n[0])) && (e.borderTopLeftRadius = Number(n[0])), !isNaN(Number(n[1])) && (e.borderBottomLeftRadius = e.borderTopRightRadius = Number(n[1])), !isNaN(Number(n[2])) && (e.borderBottomRightRadius = Number(n[2]))), 4 === n.length && (!isNaN(Number(n[0])) && (e.borderTopLeftRadius = Number(n[0])), !isNaN(Number(n[1])) && (e.borderTopRightRadius = Number(n[1])), !isNaN(Number(n[2])) && (e.borderBottomRightRadius = Number(n[2])), !isNaN(Number(n[3])) && (e.borderBottomLeftRadius = Number(n[3]))), e ); }), m("border", function (t) { for ( var e = {}, n = 0, r = t.split(/\s/g).filter(function (t) { return "" !== t; }); n < r.length; n++ ) { var i = r[n]; isNaN(Number(i)) ? d(i) ? (e.borderColor = i) : x.includes(i) && (e.borderStyle = i) : (e.borderWidth = Number(i)); } return e; }), m("background", function (t) { for ( var e = {}, n = 0, r = t.split(/\s/g).filter(function (t) { return "" !== t; }); n < r.length; n++ ) if (d((t = r[n]))) e.backgroundColor = t; else if (null == t ? void 0 : t.startsWith("url")) { var i = t.match(/url\((.+?)\)/); i && (e.backgroundImage = i[1]); } return e; }), m(["box-shadow", "text-shadow"], function (t) { for ( var e = {}, n = t.split(/\s/g).filter(function (t) { return "" !== t; }), r = [ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", ]; n.length; ) { var i = n.shift(); if (isNaN(Number(i))) d(i) && (e.shadowColor = i); else e[r.shift()] = Number(i); } return e; }); var O = function () { (this.type = ""), (this.tagName = ""), (this.attrs = {}), (this.children = []), (this.text = ""); }, M = (function () { function t(t) { (this.input = ""), (this.index = 0), (this.input = t); } return ( (t.prototype.stepNext = function () { this.index++; }), (t.prototype.cur = function () { return this.input[this.index]; }), (t.prototype.twoChar = function () { return this.input[this.index] + this.input[this.index + 1]; }), (t.prototype.stepWhile = function (t) { for ( var e = ""; this.index < this.input.length && t && t(this.input[this.index]); ) e += this.input[this.index++]; return e; }), (t.prototype.skipWhiteSpace = function () { this.stepWhile(function (t) { return /\s/.test(t); }); }), (t.prototype.getText = function () { return this.stepWhile(function (t) { return /[a-zA-Z0-9_]/.test(t); }); }), (t.prototype.eof = function () { return this.index >= this.input.length; }), t ); })(), S = (function () { function t(t) { this.helper = new M(t); } return ( (t.prototype.parse = function () { return this.parseNodes(); }), (t.prototype.parseNodes = function () { for ( var t = []; t.push(this.parseNode()), this.helper.skipWhiteSpace(), !this.helper.eof() && "" === this.helper.twoChar()) ) return this.helper.stepNext(), this.helper.stepNext(), e; if (">" !== this.helper.cur()) throw new Error("解析标签开始失败"); if ( (this.helper.stepNext(), this.helper.skipWhiteSpace(), "" !== this.helper.cur()) throw new Error("解析标签结束失败"); return this.helper.stepNext(), e; }), (t.prototype.parseTextNode = function () { var t = new O(), e = this.helper.stepWhile(function (t) { return /[^<]/.test(t); }); return (t.type = "text"), (t.tagName = "text"), (t.text = e), t; }), (t.prototype.parseAttributes = function () { var t = {}; for ( this.helper.skipWhiteSpace(); !this.helper.eof() && ">" !== this.helper.cur() && "/>" !== this.helper.twoChar(); ) { var e = this.helper.stepWhile(function (t) { return /[^\s=]/.test(t); }); this.helper.skipWhiteSpace(), this.helper.stepNext(), this.helper.skipWhiteSpace(); var n = ""; '"' === this.helper.cur() ? (this.helper.stepNext(), (n = this.helper.stepWhile(function (t) { return /[^"]/.test(t); })), this.helper.stepNext()) : "'" === this.helper.cur() ? (this.helper.stepNext(), (n = this.helper.stepWhile(function (t) { return /[^']/.test(t); })), this.helper.stepNext()) : (n = this.helper.stepWhile(function (t) { return /[^\s/]/.test(t); })), (t[e] = w(e, n)), this.helper.skipWhiteSpace(); } return t; }), (t.prototype.removeQuote = function (t) { var e = t; return ( /^["']/.test(e[0]) && (e = e.slice(1)), /["']$/.test(e[e.length - 1]) && (e = e.slice(0, -1)), e ); }), t ); })(); function C(t) { return (C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var j = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; function k(t) { return t ? t.replace(/^\s+|\s+$/g, "") : ""; } var E = function (t, e) { e = e || {}; var n = 1, r = 1; function i(t) { var e = t.match(/\n/g); e && (n += e.length); var i = t.lastIndexOf("\n"); r = ~i ? t.length - i : r + t.length; } function o() { var t = { line: n, column: r }; return function (e) { return (e.position = new a(t)), f(), e; }; } function a(t) { (this.start = t), (this.end = { line: n, column: r }), (this.source = e.source); } a.prototype.content = t; var s = []; function u(i) { var o = new Error(e.source + ":" + n + ":" + r + ": " + i); if ( ((o.reason = i), (o.filename = e.source), (o.line = n), (o.column = r), (o.source = t), !e.silent) ) throw o; s.push(o); } function c() { return d(/^{\s*/); } function h() { return d(/^}/); } function l() { var e, n = []; for ( f(), p(n); t.length && "}" != t.charAt(0) && (e = E() || N()); ) !1 !== e && (n.push(e), p(n)); return n; } function d(e) { var n = e.exec(t); if (n) { var r = n[0]; return i(r), (t = t.slice(r.length)), n; } } function f() { d(/^\s*/); } function p(t) { var e; for (t = t || []; (e = g()); ) !1 !== e && t.push(e); return t; } function g() { var e = o(); if ("/" == t.charAt(0) && "*" == t.charAt(1)) { for ( var n = 2; "" != t.charAt(n) && ("*" != t.charAt(n) || "/" != t.charAt(n + 1)); ) ++n; if (((n += 2), "" === t.charAt(n - 1))) return u("End of comment missing"); var a = t.slice(2, n - 2); return ( (r += 2), i(a), (t = t.slice(n)), (r += 2), e({ type: "comment", comment: a }) ); } } function y() { var t = d(/^([^{]+)/); if (t) return k(t[0]) .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "") .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (t) { return t.replace(/,/g, "‌"); }) .split(/\s*(?![^(]*\)),\s*/) .map(function (t) { return t.replace(/\u200C/g, ","); }); } function v() { var t = o(), e = d(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/); if (e) { if (((e = k(e[0])), !d(/^:\s*/))) return u("property missing ':'"); var n = d( /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/, ), r = t({ type: "declaration", property: e.replace(j, ""), value: n ? k(n[0]).replace(j, "") : "", }); return d(/^[;\s]*/), r; } } function m() { var t, e = []; if (!c()) return u("missing '{'"); for (p(e); (t = v()); ) !1 !== t && (e.push(t), p(e)); return h() ? e : u("missing '}'"); } function b() { for ( var t, e = [], n = o(); (t = d(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)); ) e.push(t[1]), d(/^,\s*/); if (e.length) return n({ type: "keyframe", values: e, declarations: m() }); } var x, w = S("import"), O = S("charset"), M = S("namespace"); function S(t) { var e = new RegExp("^@" + t + "\\s*([^;]+);"); return function () { var n = o(), r = d(e); if (r) { var i = { type: t }; return (i[t] = r[1].trim()), n(i); } }; } function E() { if ("@" == t[0]) return ( (function () { var t = o(); if ((e = d(/^@([-\w]+)?keyframes\s*/))) { var e, n = e[1]; if (!(e = d(/^([-\w]+)\s*/))) return u("@keyframes missing name"); var r, i = e[1]; if (!c()) return u("@keyframes missing '{'"); for (var a = p(); (r = b()); ) a.push(r), (a = a.concat(p())); return h() ? t({ type: "keyframes", name: i, vendor: n, keyframes: a, }) : u("@keyframes missing '}'"); } })() || (function () { var t = o(), e = d(/^@media *([^{]+)/); if (e) { var n = k(e[1]); if (!c()) return u("@media missing '{'"); var r = p().concat(l()); return h() ? t({ type: "media", media: n, rules: r }) : u("@media missing '}'"); } })() || (function () { var t = o(), e = d(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/); if (e) return t({ type: "custom-media", name: k(e[1]), media: k(e[2]), }); })() || (function () { var t = o(), e = d(/^@supports *([^{]+)/); if (e) { var n = k(e[1]); if (!c()) return u("@supports missing '{'"); var r = p().concat(l()); return h() ? t({ type: "supports", supports: n, rules: r }) : u("@supports missing '}'"); } })() || w() || O() || M() || (function () { var t = o(), e = d(/^@([-\w]+)?document *([^{]+)/); if (e) { var n = k(e[1]), r = k(e[2]); if (!c()) return u("@document missing '{'"); var i = p().concat(l()); return h() ? t({ type: "document", document: r, vendor: n, rules: i, }) : u("@document missing '}'"); } })() || (function () { var t = o(); if (d(/^@page */)) { var e = y() || []; if (!c()) return u("@page missing '{'"); for (var n, r = p(); (n = v()); ) r.push(n), (r = r.concat(p())); return h() ? t({ type: "page", selectors: e, declarations: r }) : u("@page missing '}'"); } })() || (function () { var t = o(); if (d(/^@host\s*/)) { if (!c()) return u("@host missing '{'"); var e = p().concat(l()); return h() ? t({ type: "host", rules: e }) : u("@host missing '}'"); } })() || (function () { var t = o(); if (d(/^@font-face\s*/)) { if (!c()) return u("@font-face missing '{'"); for (var e, n = p(); (e = v()); ) n.push(e), (n = n.concat(p())); return h() ? t({ type: "font-face", declarations: n }) : u("@font-face missing '}'"); } })() ); } function N() { var t = o(), e = y(); return e ? (p(), t({ type: "rule", selectors: e, declarations: m() })) : u("selector missing"); } return (function t(e, n) { var r = e && "string" == typeof e.type, i = r ? e : n; for (var o in e) { var a = e[o]; Array.isArray(a) ? a.forEach(function (e) { t(e, i); }) : a && "object" === C(a) && t(a, i); } r && Object.defineProperty(e, "parent", { configurable: !0, writable: !0, enumerable: !1, value: n || null, }); return e; })( ((x = l()), { type: "stylesheet", stylesheet: { source: e.source, rules: x, parsingErrors: s }, }), ); }, N = n(23), T = n.n(N); function P(t) { return (P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var I = function () { (this.dom = null), (this.style = null), (this.children = []), (this.originChildren = []); }, B = { "font-family": "serif" }, A = [ "font", "fontFamily", "fontWeight", "fontSize", "fontVariant", "fontStretch", "textIndent", "textAlign", "textShadow", "lineHeight", "color", "direction", "wordSpacing", "letterSpacing", "textTransform", "captionSide", "borderCollapse", "emptyCells", "listStyleType", "listStyleImage", "listStylePosition", "listStyle", "visibility", "cursor", ], L = (function () { function t(t, e) { (this.domTree = null), (this.cssTree = null), (this.rulesHash = { ids: {}, classes: {}, tagNames: {} }), (this.domTree = t), (this.cssTree = e); } return ( (t.prototype.parse = function () { return ( this.parseRulesHash(this.cssTree), this.genStyleTree(this.domTree) ); }), (t.prototype.parseRulesHash = function (t) { for ( var e = this.rulesHash, n = 0, r = t.stylesheet.rules; n < r.length; n++ ) { var i = r[n]; if ("rule" === i.type) for (var o = 0, a = i.selectors; o < a.length; o++) { var s = a[o], u = this.genKeySelector(s); switch (u[0]) { case "#": var c = u.slice(1); e.ids[c] = Object(h.f)( Object(h.f)([], e.ids[c] || []), [ { selector: s, specificity: this.genSpecificity(s), style: this.genStyleFromRule(i), }, ], ); break; case ".": var l = u.slice(1); e.classes[l] = Object(h.f)( Object(h.f)([], e.classes[l] || []), [ { selector: s, specificity: this.genSpecificity(s), style: this.genStyleFromRule(i), }, ], ); break; default: e.tagNames[u] = Object(h.f)( Object(h.f)([], e.tagNames[u] || []), [ { selector: s, specificity: this.genSpecificity(s), style: this.genStyleFromRule(i), }, ], ); } } } }), (t.prototype.genStyleTree = function (t) { for (var e = new I(), n = [[t, [], e]]; n.length; ) { var r = n.pop(), i = r[0], o = r[1], a = r[2], s = r[3]; (a.dom = i), (a.style = this.computeCSS( i, o, null == s ? void 0 : s.style, )); for (var u = 0, c = i.children; u < c.length; u++) { var l = c[u], d = new I(); a.originChildren.push(d), n.push([l, Object(h.f)(Object(h.f)([], o), [i]), d, a]); } } return e; }), (t.prototype.genSpecificity = function (t) { var e, n, r = (null === (e = t.match(/#\w+/g)) || void 0 === e ? void 0 : e.length) || 0, i = (null === (n = t.match(/\.\w+/g)) || void 0 === n ? void 0 : n.length) || 0; return ( 100 * r + 10 * i + (t.split(/\s+|#|\./).filter(function (t) { return "" !== t; }).length - r - i) ); }), (t.prototype.genKeySelector = function (t) { var e = p(t, /\s/).pop(), n = e.match(/(#[^\.#]+)/); return (null == n ? void 0 : n.length) > 0 || (null == (n = e.match(/\.[^\.#]+/)) ? void 0 : n.length) > 0 ? n[0] : e; }), (t.prototype.genStyleFromRule = function (t) { return this.genStyleFromDeclaration(t.declarations); }), (t.prototype.genStyleFromDeclaration = function (t) { var e = {}; return ( t.forEach(function (t) { var n = t.value; e[t.property] = n; }), e ); }), (t.prototype.computeCSS = function (t, e, n) { var r = this, i = []; f(t, function (t, e) { switch (t) { case "id": i.push.apply(i, r.rulesHash.ids[e] || []); break; case "class": i.push.apply(i, r.rulesHash.classes[e] || []); break; case "tagName": i.push.apply(i, r.rulesHash.tagNames[e] || []); } }); var o = i.filter(function (t) { for ( var n = p(t.selector, /\s+/g), r = n.length - 2, i = e.length - 1, o = !0; r > -1; r-- ) { for (var a = !1; i > -1; i--) { if (g(e[i], n[r])) { a = !0; break; } } if (!a) { o = !1; break; } } return o; }); o.sort(function (t, e) { return t.specificity - e.specificity; }); for ( var a = o.reduce( function (t, e) { return Object.assign(t, e.style); }, Object(h.a)({}, B), ), s = {}, u = 0, c = Object.entries(a); u < c.length; u++ ) { var l = c[u], d = l[0], y = l[1], v = d .split("-") .map(function (t, e) { return e > 0 ? "" + t[0].toUpperCase() + t.slice(1) : t; }) .join(""), m = w(d, y); "object" === P(m) ? (s = Object(h.a)(Object(h.a)({}, s), m)) : (s[v] = m); } if (n) { for (var b = 0, x = Object.entries(s); b < x.length; b++) { var O = x[b]; d = O[0]; "inherit" === (y = O[1]) && A.includes(d) && (delete s[d], void 0 !== n[d] && (s[d] = n[d])); } for (var M = 0, S = Object.entries(n); M < S.length; M++) { var C = S[M]; (d = C[0]), (y = C[1]); A.includes(d) && !s[d] && (s[d] = y); } } return s; }), t ); })(), D = {}; function _(t, e) { D[t] = e; } function R(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; var r = D[t]; if (!r) throw new Error("找不到标签" + t + "的构造函数"); var i = new (r.bind.apply(r, Object(h.f)([void 0], e)))(); return i; } var Y = (function () { function t(t) { var e = this; (this.styleNode = null), (this.gNode = null), (this.parent = null), (this.children = []), (this.isMounted = !1), (this.isDisplay = !0), (this._parentGNode = null), (this._prevAttrs = null), (this._prevStyle = null), (this._prevLayout = null), (this.events = {}), (this.trigger = function (t) { for (var n, r, i = t.target; i && !i.get("uiNode"); ) i = i.get("parent"); (t.targetGNode = i || null), (t.uiNode = null !== (n = null == i ? void 0 : i.get("uiNode")) && void 0 !== n ? n : null), null === (r = e.events[t.type]) || void 0 === r || r.forEach(function (n) { return n(t, e); }); }), (this.styleNode = t); } return ( Object.defineProperty(t.prototype, "top", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.layout) || void 0 === e ? void 0 : e.top; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "left", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.layout) || void 0 === e ? void 0 : e.left; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "width", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.layout) || void 0 === e ? void 0 : e.width; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "height", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.layout) || void 0 === e ? void 0 : e.height; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "tagName", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.dom) || void 0 === e ? void 0 : e.tagName; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "style", { get: function () { var t; return null === (t = this.styleNode) || void 0 === t ? void 0 : t.style; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "attributes", { get: function () { var t, e; return null === (e = null === (t = this.styleNode) || void 0 === t ? void 0 : t.dom) || void 0 === e ? void 0 : e.attrs; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "_layout", { get: function () { var t; return null === (t = this.styleNode) || void 0 === t ? void 0 : t._layout; }, enumerable: !1, configurable: !0, }), Object.defineProperty(t.prototype, "parentGNode", { get: function () { var t; return ( (null === (t = this.parent) || void 0 === t ? void 0 : t.gNode) || this._parentGNode ); }, set: function (t) { this._parentGNode = t; }, enumerable: !1, configurable: !0, }), (t.prototype.setParent = function (t) { this.parent = t; }), (t.prototype.appendChild = function () { for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; e.forEach(function (e) { e.setParent(t), t.children.push(e), e.styleNode && t.styleNode && !t.styleNode.originChildren.includes(e.styleNode) && t.styleNode.originChildren.push(e.styleNode); }), this.reflow(); }), (t.prototype.removeChild = function (t) { t && t.remove(); }), (t.prototype.remove = function () { var t, e, n = this.parent; null === (t = this.gNode) || void 0 === t || t.remove(), n && (n.children.splice(1, n.children.indexOf(this)), null === (e = n.styleNode) || void 0 === e || e.children.splice(1, n.children.indexOf(this.styleNode)), this.isMounted && n.reflow()), this.isMounted && this.unmount(); }), (t.prototype.query = function (t) { if ("string" == typeof t) for ( var e = [ [ this, t.split(/\s+/g).filter(function (t) { return "" !== t; }), ], ]; e.length; ) for ( var n = e.shift(), r = n[0], i = n[1], o = 0, a = r.children; o < a.length; o++ ) { var s = a[o], u = []; if (s.styleNode && g(s.styleNode.dom, i[0])) { if (0 === i.slice(1).length) return s; u = i.slice(1); } else u = i; e.push([s, u]); } }), (t.prototype.queryAll = function (t) { if ("string" == typeof t) { for ( var e = [], n = [ [ this, t.split(/\s+/g).filter(function (t) { return "" !== t; }), e, ], ]; n.length; ) for ( var r = n.shift(), i = r[0], o = r[1], a = r[2], s = 0, u = i.children; s < u.length; s++ ) { var c = u[s], h = []; c.styleNode && g(c.styleNode.dom, o[0]) ? 0 === o.slice(1).length ? (a.push(c), (h = [o[0]])) : (h = o.slice(1)) : (h = o), n.push([c, h, a]); } return e; } }), (t.prototype.manualMount = function (t) { (this.parentGNode = t), this.layout(), this.mount(); }), (t.prototype.reflow = function () { var t; this.parentGNode && ("absolute" !== (null === (t = this.style) || void 0 === t ? void 0 : t.position) && this.parent ? this.parent.reflow() : (this.layout(), this.render())); }), (t.prototype.layout = function () { (this._prevLayout = Object(h.a)({}, this._layout || {})), this.clearLayout(), (function (t) { for (var e = [t]; e.length; ) { var n = e.pop(); n.children = n.originChildren.filter(function (t) { return "none" !== t.style.display && (e.push(t), !0); }); } T()(t); })(this.styleNode); }), (t.prototype.mount = function () { var t; this.isMounted || ("none" !== (null === (t = this.style) || void 0 === t ? void 0 : t.display) ? ((this._prevAttrs = this.attributes), (this._prevStyle = this.style), this.draw(this.parentGNode), (this.isMounted = !0), this.gNode.set("uiNode", this), this.gNode.on("*", this.trigger), this.children.forEach(function (t) { return t.mount(); }), this.didMount()) : (this.isDisplay = !1)); }), (t.prototype.didMount = function () {}), (t.prototype.unmount = function () { this.isMounted && ((this.isMounted = !1), this.children.forEach(function (t) { return t.unmount(); }), this.didUnmount()); }), (t.prototype.didUnmount = function () {}), (t.prototype.render = function () { var t, e, n; if (this.isMounted) { if ( "none" === (null === (t = this.style) || void 0 === t ? void 0 : t.display) ) return ( (this.isDisplay = !1), null === (e = this.gNode) || void 0 === e || e.remove(!1), !1 ); !1 === this.isDisplay && ((this.isDisplay = !0), null === (n = this.parentGNode) || void 0 === n || n.add(this.gNode)); var r = this.shouldUpdate( this._prevAttrs, this._prevStyle, this._prevLayout, ); r && this.draw(), this.children.forEach(function (t) { return t.render(); }), r && this.didUpdate(); } else this.mount(); }), (t.prototype.didUpdate = function () {}), (t.prototype.shouldUpdate = function (t, e, n) { return !0; }), (t.prototype.draw = function (t) {}), (t.prototype.animate = function () {}), (t.prototype.clearLayout = function () { (this.styleNode.isDirty = !0), this.children.forEach(function (t) { t.clearLayout(); }); }), (t.prototype.setAttribute = function (t, e) { var n; if (this.styleNode && this.styleNode.dom) { if ( ((this._prevAttrs = Object(h.a)( {}, this.styleNode.dom.attrs, )), (this.styleNode.dom.attrs[t] = e), !(null === (n = this.parent) || void 0 === n ? void 0 : n.isMounted)) ) return; this.render(); } }), (t.prototype.setStyle = function (t, e) { if (this.styleNode && this.styleNode.style) { if ( ((this._prevStyle = Object(h.a)( {}, this.styleNode.dom.style, )), (this.styleNode.style[t] = e), this.parent && !this.parent.isMounted) ) return; y[t] ? this.reflow() : this.render(); } }), (t.prototype.getAttribute = function (t) { var e, n; return null === (n = null === (e = this.styleNode) || void 0 === e ? void 0 : e.dom) || void 0 === n ? void 0 : n.attrs[t]; }), (t.prototype.getStyle = function (t) { var e, n, r; return null !== (n = null === (e = this.styleNode) || void 0 === e ? void 0 : e.layout[t]) && void 0 !== n ? n : null === (r = this.styleNode) || void 0 === r ? void 0 : r.style[t]; }), (t.prototype.setText = function (t) { var e = this.query("text"); e && e.styleNode && e.styleNode.dom && ((e.styleNode.dom.text = t), e.render()); }), (t.prototype.on = function (t, e) { this.events[t] = Object(h.f)( Object(h.f)([], this.events[t] || []), [e], ); }), (t.prototype.off = function (t, e) { if (e) { var n = this.events[t], r = null == n ? void 0 : n.indexOf(e); r && -1 !== r && (null == n || n.splice(r, 1)); } else delete this.events[t]; }), t ); })(), F = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.backgroudNode = null), e; } return ( Object(h.c)(e, t), (e.prototype.draw = function (t) { var e, n; this.gNode || (this.gNode = t.addGroup({ id: null === (e = this.attributes) || void 0 === e ? void 0 : e.id, className: this.styleNode.dom.attrs.class, })); var r = this.gNode, i = this.styleNode; r.resetMatrix(), null === (n = this.backgroudNode) || void 0 === n || n.remove(); var o = (this.backgroudNode = r.addGroup()); r.translate(this.left, this.top); var a = i.style; "number" == typeof a.zIndex && r.setZIndex(a.zIndex), o.addShape("rect", { attrs: { x: 0, y: 0, fill: a.backgroundColor || "#fff", fillOpacity: a.backgroundOpacity, opacity: a.opacity, width: this.width, height: this.height, radius: [ a.borderTopLeftRadius || 0, a.borderTopRightRadius || 0, a.borderBottomLeftRadius || 0, a.borderBottomLeftRadius || 0, ], shadowBlur: a.shadowBlur || 0, shadowColor: a.shadowColor || null, shadowOffsetX: a.shadowOffsetX || 0, shadowOffsetY: a.shadowOffsetY || 0, }, capture: "none" !== a.pointerEvents, }), a.backgroundImage && o.addShape("image", { attrs: { x: 0, y: 0, img: a.url, width: this.width, height: this.height, }, capture: !1, }); var s = { attrs: { x: (a.borderWidth || 0) / 2, y: (a.borderWidth || 0) / 2, lineWidth: a.borderWidth, stroke: a.borderColor, width: this.width - (a.borderWidth || 0), height: this.height - (a.borderWidth || 0), radius: [ (a.borderTopLeftRadius || 0) * ((this.width - (a.borderWidth || 0)) / this.width), (a.borderTopRightRadius || 0) * ((this.width - (a.borderWidth || 0)) / this.width), (a.borderBottomLeftRadius || 0) * ((this.width - (a.borderWidth || 0)) / this.width), (a.borderBottomLeftRadius || 0) * ((this.width - (a.borderWidth || 0)) / this.width), ], }, capture: !1, }; "dashed" === a.borderStyle && (s.attrs.lineDash = a.lineDash || [2, 2]), o.addShape("rect", s), "hidden" === a.overflow && r.setClip({ type: "rect", attrs: { width: this.width, height: this.height, radius: [ a.borderTopLeftRadius || 0, a.borderTopRightRadius || 0, a.borderBottomLeftRadius || 0, a.borderBottomLeftRadius || 0, ], }, }), o.toBack(); }), e ); })(Y), z = n(13), X = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getAttrs = function () { var t = this.styleNode.style; return { x: this.styleNode.layout.left, y: this.styleNode.layout.top, textAlign: t.textAlign, fill: t.color, fontSize: t.fontSize || 12, fontStyle: t.fontStyle, fontFamily: t.fontFamily, lineHeight: t.lineHeight || 0, fontVariant: t.fontVariant, fontWeight: t.fontWeight, textBaseline: "top", opacity: t.opacity, fillOpacity: t.backgroundOpacity, }; }), (e.prototype.draw = function (t) { var e = this.getAttrs(); this.gNode || (this.gNode = t.addShape("text", { type: "text", attrs: e, capture: !1, })), this.update(); }), (e.prototype.getMultiLineText = function (t, e, n) { var r, i = null === (r = this.parent.gNode.get("canvas")) || void 0 === r ? void 0 : r.get("context"); if (!i) return t; i.save(); var o = Object(z.assembleFont)(e); if (((i.font = o), i.measureText(t).width < n)) return t; for (var a = "", s = 0, u = 0, c = t; u < c.length; u++) { var h = c[u], l = i.measureText(h).width; (s += l) >= n ? ((s = l), (a += "\n" + h)) : (a += h); } return i.restore(), a; }), (e.prototype.update = function () { var t = this.styleNode.style, e = this.getAttrs(), n = this.gNode; switch ((n.attr(e), n.resetMatrix(), t.textAlign)) { case "center": n.translate(this.styleNode.layout.width / 2); break; case "right": n.translate(this.styleNode.layout.width); } "nowrap" === t.whiteSpace ? n.attr("text", String(this.styleNode.dom.text)) : n.attr( "text", this.getMultiLineText( String(this.styleNode.dom.text), e, this.styleNode.layout.width, ), ); }), e ); })(Y), W = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getAttrs = function () { var t = this.styleNode, e = t.style, n = t.layout, r = t.dom; return Object(h.a)( { fill: e.backgroundColor, lineWidth: e.borderWidth, fillOpacity: e.backgroundOpacity, stroke: e.borderColor, width: n.width - (e.borderWidth || 0), height: n.height - (e.borderWidth || 0), }, r.attrs, ); }), (e.prototype.draw = function (t) { var e = this.styleNode, n = this.getAttrs(), r = e.dom; this.gNode || (this.gNode = t.addShape(r.attrs.type, { attrs: n })), this.update(); }), (e.prototype.update = function () { var t, e = this.getAttrs(), n = this.gNode, r = "none" !== this.styleNode.style.pointerEvents; n.attr(e), n.set("capture", r), n.resetMatrix(), n.translate(this.left, this.top), "number" == typeof (null === (t = this.style) || void 0 === t ? void 0 : t.zIndex) && n.setZIndex(this.style.zIndex); }), e ); })(Y), G = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.draw = function (t) { var e = { x: this.styleNode.layout.left, y: this.styleNode.layout.top, img: this.styleNode.dom.attrs.src, width: this.styleNode.layout.width || 0, height: this.styleNode.layout.height || 0, }, n = "none" !== this.styleNode.style.pointerEvents; this.gNode || (this.gNode = t.addShape("image", { type: "image", attrs: e, capture: n, })); var r = this.gNode; switch ( (r.resetMatrix(), r.set("capture", n), r.attr(e), "number" == typeof this.styleNode.style.zIndex && r.setZIndex(this.styleNode.style.zIndex), this.styleNode.style.textAlign) ) { case "center": r.translate(this.styleNode.layout.width / 2); break; case "right": r.translate(this.styleNode.layout.width); } }), e ); })(Y), q = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return Object(h.c)(e, t), e; })(F); function H(t, e, n) { var r = U(t, e, !0); return r.manualMount(n), r; } function V(t, e, n) { var r = U(t, e, !1); return n && r.manualMount(n), r; } function U(t, e, n) { void 0 === n && (n = !1); for ( var r = (function (t, e) { return new L(t, e).parse(); })( (function (t, e) { var n; void 0 === e && (e = !0); var r = new S(t).parse(), i = r[0]; return ( "root" !== (null === (n = r[0]) || void 0 === n ? void 0 : n.tagName) && e && (((i = new O()).tagName = "root"), (i.children = r)), i ); })(t, n), E(e), ), i = R(r.dom.tagName, r), o = [[r, i]]; o.length; ) for ( var a = o.pop(), s = a[0], u = a[1], c = 0, h = s.originChildren; c < h.length; c++ ) { var l = h[c], d = R(l.dom.tagName, l); u.children.push(d), d.setParent(u), o.push([l, d]); } return i; } _("div", F), _("text", X), _("shape", W), _("image", G), _("root", q); var Z = {}; function K(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; var r = Z[t]; null == r || r.forEach(function (t) { t.apply(null, e); }); } function Q(t, e) { Z[t] = Object(h.g)(Z[t] || [], [e]); } var $ = { fill: "#416180", opacity: 0.05 }, J = { fill: "#416180", opacity: 0.15, radius: 5 }, tt = { fill: "#5B8FF9", opacity: 0.3, cursor: "grab" }, et = { width: 2, height: 26, fill: "#1890ff", stroke: "#1890ff", opacity: 1, cursor: "ew-resize", highLightFill: "#0050b3", }, nt = { fill: "#fff", stroke: "#1890ff", radius: 15, opacity: 1, lineWidth: 2, cursor: "ew-resize", }, rt = { textBaseline: "middle", fill: "#000", opacity: 0.45, fontSize: 12, }, it = { fill: "#607889", opacity: 0.35, fontSize: 12, width: 50 }, ot = { width: 1, height: 4, fill: "#ccc" }, at = 2, st = 18, ut = { height: 4, width: 1, fill: "#BFBFBF" }, ct = { fill: "#8c8c8c", fontSize: 10, width: 50 }, ht = { fill: "#5B8FF9" }, lt = { fill: "#e6e8e9" }, dt = { speed: 1, contentWidth: 200, height: 60, fill: "#fff", stroke: "#fff", hideTimeTypeController: !1, preBtnStyle: { fill: "#aaa" }, nextBtnStyle: { fill: "#aaa" }, playBtnStyle: { fill: "#aaa" }, }; var ft = function (t, e) { var n = e.height, r = (void 0 === n ? 16 : n) / 2, i = ""; return ( "next" === t && (i = "\n \n '), "prev" === t && (i = "\n \n '), V( i, "\n shape {\n margin-left: " + r + ";\n width: " + r + ";\n background: " + e.fill + ";\n }\n ", ) ); }; var pt = function (t) { var e = t || {}, n = e.radius, r = void 0 === n ? 15 : n, i = e.fill, o = (r * Math.sqrt(3)) / 2, a = V( '\n
\n \n
\n \n \n
\n
", "\n #play_Btn {\n width: " + 2 * r + ";\n height: " + 2 * r + ";\n background: #fff;\n border: 1 solid " + i + ";\n border-radius: " + r + ";\n }\n .start{\n position: absolute;\n top: " + r / 2 + ";\n left: " + (r - o / 2 + 1) + " ;\n background: " + i + ";\n width: " + r + ";\n height: " + r + ";\n }\n .pause {\n display: none;\n }\n .pause shape {\n position: absolute;\n background: " + i + ";\n width: " + r / 4 + ";\n height: " + r + ";\n }\n .pause_1 {\n left: " + (4 * r) / 8 + ";\n }\n .pause {\n position: absolute;\n top: " + r / 2 + ";\n left: " + (5 * r) / 8 + ";\n }\n ", ), s = a.query(".start"), u = a.query(".pause"), c = !0; function h() { s.setStyle("display", c ? "flex" : "none"), u.setStyle("display", c ? "none" : "flex"); } return ( h(), a.on("tap", function () { K(c ? "SLIDER_PLAY" : "SLIDER_PAUSE"), (c = !c), h(); }), a ); }, gt = n(0); var yt = function (t) { var e = Object(gt.d)({}, dt, t), n = e.wrapperWidth, r = e.contentWidth, i = e.height, o = e.fill, a = e.stroke, s = e.nextBtnStyle, u = e.preBtnStyle, c = e.playBtnStyle, h = e.speed, l = V( "\n
\n
\n\n
\n
\n ", "\n .wrapper {\n display: flex;\n width: " + n + ";\n height: " + i + ";\n flex-wrap: nowrap;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n background: " + o + ";\n " + (a ? "border: 1 solid " + a + ";" : "") + "\n }\n .content{\n display: flex;\n width: " + r + ";\n flex-wrap: nowrap;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-opacity: 0;\n }\n", ), d = ft("next", s), f = ft("prev", u), p = pt(c); return ( K("SPEED_CHANGE", h), d.on("tap", function () { K("CONTROL_NEXT"); }), f.on("tap", function () { K("CONTROL_PREV"); }), l.query(".content").appendChild(f, p, d), l ); }; function vt(t, e) { void 0 === e && (e = 20); var n = !0, r = null, i = function () { n ? clearTimeout(r) : (null == t || t(), (r = setTimeout(function () { i(); }, e))); }; return { play: function () { (n = !1), i(); }, stop: function () { n = !0; }, setSpeed: function (t) { t > 10 && (t = 10), t < 1 && (t = 1), (e = 800 - (500 * t) / 9); }, }; } var mt = n(7), bt = {}; function xt(t, e) { bt[t] = e; } var wt = (function () { function t(t) { (this.type = "base"), (this.isCategory = !1), (this.isLinear = !1), (this.isContinuous = !1), (this.isIdentity = !1), (this.values = []), (this.range = [0, 1]), (this.ticks = []), (this.__cfg__ = t), this.initCfg(), this.init(); } return ( (t.prototype.translate = function (t) { return t; }), (t.prototype.change = function (t) { Object(gt.a)(this.__cfg__, t), this.init(); }), (t.prototype.clone = function () { return this.constructor(this.__cfg__); }), (t.prototype.getTicks = function () { var t = this; return Object(gt.z)(this.ticks, function (e, n) { return Object(gt.v)(e) ? e : { text: t.getText(e, n), tickValue: e, value: t.scale(e) }; }); }), (t.prototype.getText = function (t, e) { var n = this.formatter, r = n ? n(t, e) : t; return Object(gt.s)(r) || !Object(gt.r)(r.toString) ? "" : r.toString(); }), (t.prototype.getConfig = function (t) { return this.__cfg__[t]; }), (t.prototype.init = function () { Object(gt.a)(this, this.__cfg__), this.setDomain(), Object(gt.p)(this.getConfig("ticks")) && (this.ticks = this.calculateTicks()); }), (t.prototype.initCfg = function () {}), (t.prototype.setDomain = function () {}), (t.prototype.calculateTicks = function () { var t = this.tickMethod, e = []; if (Object(gt.x)(t)) { var n = bt[t]; if (!n) throw new Error("There is no method to to calculate ticks!"); e = n(this); } else Object(gt.r)(t) && (e = t(this)); return e; }), (t.prototype.rangeMin = function () { return this.range[0]; }), (t.prototype.rangeMax = function () { return this.range[1]; }), (t.prototype.calcPercent = function (t, e, n) { return Object(gt.t)(t) ? (t - e) / (n - e) : NaN; }), (t.prototype.calcValue = function (t, e, n) { return e + t * (n - e); }), t ); })(), Ot = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "cat"), (e.isCategory = !0), e; } return ( Object(h.c)(e, t), (e.prototype.buildIndexMap = function () { if (!this.translateIndexMap) { this.translateIndexMap = new Map(); for (var t = 0; t < this.values.length; t++) this.translateIndexMap.set(this.values[t], t); } }), (e.prototype.translate = function (t) { this.buildIndexMap(); var e = this.translateIndexMap.get(t); return void 0 === e && (e = Object(gt.t)(t) ? t : NaN), e; }), (e.prototype.scale = function (t) { var e = this.translate(t), n = this.calcPercent(e, this.min, this.max); return this.calcValue(n, this.rangeMin(), this.rangeMax()); }), (e.prototype.invert = function (t) { var e = this.max - this.min, n = this.calcPercent(t, this.rangeMin(), this.rangeMax()), r = Math.round(e * n) + this.min; return r < this.min || r > this.max ? NaN : this.values[r]; }), (e.prototype.getText = function (e) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = e; return ( Object(gt.t)(e) && !this.values.includes(e) && (i = this.values[i]), t.prototype.getText.apply(this, Object(h.g)([i], n)) ); }), (e.prototype.initCfg = function () { this.tickMethod = "cat"; }), (e.prototype.setDomain = function () { if ( (Object(gt.s)(this.getConfig("min")) && (this.min = 0), Object(gt.s)(this.getConfig("max"))) ) { var t = this.values.length; this.max = t > 1 ? t - 1 : t; } this.translateIndexMap && (this.translateIndexMap = void 0); }), e ); })(wt), Mt = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g, St = "[^\\s]+", Ct = /\[([^]*?)\]/gm; function jt(t, e) { for (var n = [], r = 0, i = t.length; r < i; r++) n.push(t[r].substr(0, e)); return n; } var kt = function (t) { return function (e, n) { var r = n[t] .map(function (t) { return t.toLowerCase(); }) .indexOf(e.toLowerCase()); return r > -1 ? r : null; }; }; function Et(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0, i = e; r < i.length; r++) { var o = i[r]; for (var a in o) t[a] = o[a]; } return t; } var Nt = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", ], Tt = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ], Pt = jt(Tt, 3), It = { dayNamesShort: jt(Nt, 3), dayNames: Nt, monthNamesShort: Pt, monthNames: Tt, amPm: ["am", "pm"], DoFn: function (t) { return ( t + ["th", "st", "nd", "rd"][ t % 10 > 3 ? 0 : ((t - (t % 10) != 10 ? 1 : 0) * t) % 10 ] ); }, }, Bt = Et({}, It), At = function (t) { return (Bt = Et(Bt, t)); }, Lt = function (t) { return t.replace(/[|\\{()[^$+*?.-]/g, "\\$&"); }, Dt = function (t, e) { for (void 0 === e && (e = 2), t = String(t); t.length < e; ) t = "0" + t; return t; }, _t = { D: function (t) { return String(t.getDate()); }, DD: function (t) { return Dt(t.getDate()); }, Do: function (t, e) { return e.DoFn(t.getDate()); }, d: function (t) { return String(t.getDay()); }, dd: function (t) { return Dt(t.getDay()); }, ddd: function (t, e) { return e.dayNamesShort[t.getDay()]; }, dddd: function (t, e) { return e.dayNames[t.getDay()]; }, M: function (t) { return String(t.getMonth() + 1); }, MM: function (t) { return Dt(t.getMonth() + 1); }, MMM: function (t, e) { return e.monthNamesShort[t.getMonth()]; }, MMMM: function (t, e) { return e.monthNames[t.getMonth()]; }, YY: function (t) { return Dt(String(t.getFullYear()), 4).substr(2); }, YYYY: function (t) { return Dt(t.getFullYear(), 4); }, h: function (t) { return String(t.getHours() % 12 || 12); }, hh: function (t) { return Dt(t.getHours() % 12 || 12); }, H: function (t) { return String(t.getHours()); }, HH: function (t) { return Dt(t.getHours()); }, m: function (t) { return String(t.getMinutes()); }, mm: function (t) { return Dt(t.getMinutes()); }, s: function (t) { return String(t.getSeconds()); }, ss: function (t) { return Dt(t.getSeconds()); }, S: function (t) { return String(Math.round(t.getMilliseconds() / 100)); }, SS: function (t) { return Dt(Math.round(t.getMilliseconds() / 10), 2); }, SSS: function (t) { return Dt(t.getMilliseconds(), 3); }, a: function (t, e) { return t.getHours() < 12 ? e.amPm[0] : e.amPm[1]; }, A: function (t, e) { return t.getHours() < 12 ? e.amPm[0].toUpperCase() : e.amPm[1].toUpperCase(); }, ZZ: function (t) { var e = t.getTimezoneOffset(); return ( (e > 0 ? "-" : "+") + Dt(100 * Math.floor(Math.abs(e) / 60) + (Math.abs(e) % 60), 4) ); }, Z: function (t) { var e = t.getTimezoneOffset(); return ( (e > 0 ? "-" : "+") + Dt(Math.floor(Math.abs(e) / 60), 2) + ":" + Dt(Math.abs(e) % 60, 2) ); }, }, Rt = function (t) { return +t - 1; }, Yt = [null, "[1-9]\\d?"], Ft = [null, St], zt = [ "isPm", St, function (t, e) { var n = t.toLowerCase(); return n === e.amPm[0] ? 0 : n === e.amPm[1] ? 1 : null; }, ], Xt = [ "timezoneOffset", "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?", function (t) { var e = (t + "").match(/([+-]|\d\d)/gi); if (e) { var n = 60 * +e[1] + parseInt(e[2], 10); return "+" === e[0] ? n : -n; } return 0; }, ], Wt = { D: ["day", "[1-9]\\d?"], DD: ["day", "\\d\\d"], Do: [ "day", "[1-9]\\d?" + St, function (t) { return parseInt(t, 10); }, ], M: ["month", "[1-9]\\d?", Rt], MM: ["month", "\\d\\d", Rt], YY: [ "year", "\\d\\d", function (t) { var e = +("" + new Date().getFullYear()).substr(0, 2); return +("" + (+t > 68 ? e - 1 : e) + t); }, ], h: ["hour", "[1-9]\\d?", void 0, "isPm"], hh: ["hour", "\\d\\d", void 0, "isPm"], H: ["hour", "[1-9]\\d?"], HH: ["hour", "\\d\\d"], m: ["minute", "[1-9]\\d?"], mm: ["minute", "\\d\\d"], s: ["second", "[1-9]\\d?"], ss: ["second", "\\d\\d"], YYYY: ["year", "\\d{4}"], S: [ "millisecond", "\\d", function (t) { return 100 * +t; }, ], SS: [ "millisecond", "\\d\\d", function (t) { return 10 * +t; }, ], SSS: ["millisecond", "\\d{3}"], d: Yt, dd: Yt, ddd: Ft, dddd: Ft, MMM: ["month", St, kt("monthNamesShort")], MMMM: ["month", St, kt("monthNames")], a: zt, A: zt, ZZ: Xt, Z: Xt, }, Gt = { default: "ddd MMM DD YYYY HH:mm:ss", shortDate: "M/D/YY", mediumDate: "MMM D, YYYY", longDate: "MMMM D, YYYY", fullDate: "dddd, MMMM D, YYYY", isoDate: "YYYY-MM-DD", isoDateTime: "YYYY-MM-DDTHH:mm:ssZ", shortTime: "HH:mm", mediumTime: "HH:mm:ss", longTime: "HH:mm:ss.SSS", }, qt = function (t) { return Et(Gt, t); }, Ht = function (t, e, n) { if ( (void 0 === e && (e = Gt.default), void 0 === n && (n = {}), "number" == typeof t && (t = new Date(t)), "[object Date]" !== Object.prototype.toString.call(t) || isNaN(t.getTime())) ) throw new Error("Invalid Date pass to format"); var r = []; e = (e = Gt[e] || e).replace(Ct, function (t, e) { return r.push(e), "@@@"; }); var i = Et(Et({}, Bt), n); return (e = e.replace(Mt, function (e) { return _t[e](t, i); })).replace(/@@@/g, function () { return r.shift(); }); }; function Vt(t, e, n) { if ((void 0 === n && (n = {}), "string" != typeof e)) throw new Error("Invalid format in fecha parse"); if (((e = Gt[e] || e), t.length > 1e3)) return null; var r = { year: new Date().getFullYear(), month: 0, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0, isPm: null, timezoneOffset: null, }, i = [], o = [], a = e.replace(Ct, function (t, e) { return o.push(Lt(e)), "@@@"; }), s = {}, u = {}; (a = Lt(a).replace(Mt, function (t) { var e = Wt[t], n = e[0], r = e[1], o = e[3]; if (s[n]) throw new Error( "Invalid format. " + n + " specified twice in format", ); return (s[n] = !0), o && (u[o] = !0), i.push(e), "(" + r + ")"; })), Object.keys(u).forEach(function (t) { if (!s[t]) throw new Error( "Invalid format. " + t + " is required in specified format", ); }), (a = a.replace(/@@@/g, function () { return o.shift(); })); var c = t.match(new RegExp(a, "i")); if (!c) return null; for (var h = Et(Et({}, Bt), n), l = 1; l < c.length; l++) { var d = i[l - 1], f = d[0], p = d[2], g = p ? p(c[l], h) : +c[l]; if (null == g) return null; r[f] = g; } 1 === r.isPm && null != r.hour && 12 != +r.hour ? (r.hour = +r.hour + 12) : 0 === r.isPm && 12 == +r.hour && (r.hour = 0); for ( var y = new Date( r.year, r.month, r.day, r.hour, r.minute, r.second, r.millisecond, ), v = [ ["month", "getMonth"], ["day", "getDate"], ["hour", "getHours"], ["minute", "getMinutes"], ["second", "getSeconds"], ], m = ((l = 0), v.length); l < m; l++ ) if (s[v[l][0]] && r[v[l][0]] !== y[v[l][1]]()) return null; return null == r.timezoneOffset ? y : new Date( Date.UTC( r.year, r.month, r.day, r.hour, r.minute - r.timezoneOffset, r.second, r.millisecond, ), ); } var Ut = { format: Ht, parse: Vt, defaultI18n: It, setGlobalDateI18n: At, setGlobalDateMasks: qt, }; function Zt(t, e) { return (r.format || Ut.format)(t, e); } function Kt(t) { return ( Object(gt.x)(t) && (t = t.indexOf("T") > 0 ? new Date(t).getTime() : new Date(t.replace(/-/gi, "/")).getTime()), Object(gt.o)(t) && (t = t.getTime()), t ); } var Qt = 36e5, $t = 24 * Qt, Jt = 31 * $t, te = [ ["HH:mm:ss", 1e3], ["HH:mm:ss", 1e4], ["HH:mm:ss", 3e4], ["HH:mm", 6e4], ["HH:mm", 6e5], ["HH:mm", 18e5], ["HH", Qt], ["HH", 6 * Qt], ["HH", 12 * Qt], ["YYYY-MM-DD", $t], ["YYYY-MM-DD", 4 * $t], ["YYYY-WW", 7 * $t], ["YYYY-MM", Jt], ["YYYY-MM", 4 * Jt], ["YYYY-MM", 6 * Jt], ["YYYY", 380 * $t], ]; function ee(t, e, n) { var r, i = ((r = function (t) { return t[1]; }), function (t, e, n, i) { for ( var o = Object(gt.s)(n) ? 0 : n, a = Object(gt.s)(i) ? t.length : i; o < a; ) { var s = (o + a) >>> 1; r(t[s]) > e ? (a = s) : (o = s + 1); } return o; })(te, (e - t) / n) - 1, o = te[i]; return ( i < 0 ? (o = te[0]) : i >= te.length && (o = Object(gt.y)(te)), o ); } var ne = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "timeCat"), e; } return ( Object(h.c)(e, t), (e.prototype.translate = function (t) { t = Kt(t); var e = this.values.indexOf(t); return ( -1 === e && (e = Object(gt.t)(t) && t < this.values.length ? t : NaN), e ); }), (e.prototype.getText = function (t, e) { var n = this.translate(t); if (n > -1) { var r = this.values[n], i = this.formatter; return (r = i ? i(r, e) : Zt(r, this.mask)); } return t; }), (e.prototype.initCfg = function () { (this.tickMethod = "time-cat"), (this.mask = "YYYY-MM-DD"), (this.tickCount = 7); }), (e.prototype.setDomain = function () { var e = this.values; Object(gt.e)(e, function (t, n) { e[n] = Kt(t); }), e.sort(function (t, e) { return t - e; }), t.prototype.setDomain.call(this); }), e ); })(Ot), re = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.isContinuous = !0), e; } return ( Object(h.c)(e, t), (e.prototype.scale = function (t) { if (Object(gt.s)(t)) return NaN; var e = this.rangeMin(), n = this.rangeMax(); return this.max === this.min ? e : e + this.getScalePercent(t) * (n - e); }), (e.prototype.init = function () { t.prototype.init.call(this); var e = this.ticks, n = Object(gt.k)(e), r = Object(gt.y)(e); n < this.min && (this.min = n), r > this.max && (this.max = r), Object(gt.s)(this.minLimit) || (this.min = n), Object(gt.s)(this.maxLimit) || (this.max = r); }), (e.prototype.setDomain = function () { var t = Object(gt.i)(this.values), e = t.min, n = t.max; Object(gt.s)(this.min) && (this.min = e), Object(gt.s)(this.max) && (this.max = n), this.min > this.max && ((this.min = e), (this.max = n)); }), (e.prototype.calculateTicks = function () { var e = this, n = t.prototype.calculateTicks.call(this); return ( this.nice || (n = Object(gt.f)(n, function (t) { return t >= e.min && t <= e.max; })), n ); }), (e.prototype.getScalePercent = function (t) { var e = this.max, n = this.min; return (t - n) / (e - n); }), (e.prototype.getInvertPercent = function (t) { return ( (t - this.rangeMin()) / (this.rangeMax() - this.rangeMin()) ); }), e ); })(wt), ie = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "linear"), (e.isLinear = !0), e; } return ( Object(h.c)(e, t), (e.prototype.invert = function (t) { var e = this.getInvertPercent(t); return this.min + e * (this.max - this.min); }), (e.prototype.initCfg = function () { (this.tickMethod = "wilkinson-extended"), (this.nice = !1); }), e ); })(re); function oe(t, e) { var n = Math.E; return e >= 0 ? Math.pow(n, Math.log(e) / t) : -1 * Math.pow(n, Math.log(-e) / t); } function ae(t, e) { return 1 === t ? 1 : Math.log(e) / Math.log(t); } function se(t, e, n) { Object(gt.s)(n) && (n = Math.max.apply(null, t)); var r = n; return ( Object(gt.e)(t, function (t) { t > 0 && t < r && (r = t); }), r === n && (r = n / e), r > 1 && (r = 1), r ); } var ue = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "log"), e; } return ( Object(h.c)(e, t), (e.prototype.invert = function (t) { var e, n = this.base, r = ae(n, this.max), i = this.rangeMin(), o = this.rangeMax() - i, a = this.positiveMin; if (a) { if (0 === t) return 0; var s = (1 / (r - (e = ae(n, a / n)))) * o; if (t < s) return (t / s) * a; } else e = ae(n, this.min); var u = ((t - i) / o) * (r - e) + e; return Math.pow(n, u); }), (e.prototype.initCfg = function () { (this.tickMethod = "log"), (this.base = 10), (this.tickCount = 6), (this.nice = !0); }), (e.prototype.setDomain = function () { t.prototype.setDomain.call(this); var e = this.min; if (e < 0) throw new Error( "When you use log scale, the minimum value must be greater than zero!", ); 0 === e && (this.positiveMin = se(this.values, this.base, this.max)); }), (e.prototype.getScalePercent = function (t) { var e = this.max, n = this.min; if (e === n) return 0; if (t <= 0) return 0; var r = this.base, i = this.positiveMin; return ( i && (n = (1 * i) / r), t < i ? t / i / (ae(r, e) - ae(r, n)) : (ae(r, t) - ae(r, n)) / (ae(r, e) - ae(r, n)) ); }), e ); })(re), ce = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "pow"), e; } return ( Object(h.c)(e, t), (e.prototype.invert = function (t) { var e = this.getInvertPercent(t), n = this.exponent, r = oe(n, this.max), i = oe(n, this.min), o = e * (r - i) + i, a = o >= 0 ? 1 : -1; return Math.pow(o, n) * a; }), (e.prototype.initCfg = function () { (this.tickMethod = "pow"), (this.exponent = 2), (this.tickCount = 5), (this.nice = !0); }), (e.prototype.getScalePercent = function (t) { var e = this.max, n = this.min; if (e === n) return 0; var r = this.exponent; return (oe(r, t) - oe(r, n)) / (oe(r, e) - oe(r, n)); }), e ); })(re), he = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "time"), e; } return ( Object(h.c)(e, t), (e.prototype.getText = function (t, e) { var n = this.translate(t), r = this.formatter; return r ? r(n, e) : Zt(n, this.mask); }), (e.prototype.scale = function (e) { var n = e; return ( (Object(gt.x)(n) || Object(gt.o)(n)) && (n = this.translate(n)), t.prototype.scale.call(this, n) ); }), (e.prototype.translate = function (t) { return Kt(t); }), (e.prototype.initCfg = function () { (this.tickMethod = "time-pretty"), (this.mask = "YYYY-MM-DD"), (this.tickCount = 7), (this.nice = !1); }), (e.prototype.setDomain = function () { var t = this.values, e = this.getConfig("min"), n = this.getConfig("max"); if ( ((Object(gt.s)(e) && Object(gt.t)(e)) || (this.min = this.translate(this.min)), (Object(gt.s)(n) && Object(gt.t)(n)) || (this.max = this.translate(this.max)), t && t.length) ) { var r = [], i = 1 / 0, o = i, a = 0; Object(gt.e)(t, function (t) { var e = Kt(t); if (isNaN(e)) throw new TypeError( "Invalid Time: " + t + " in time scale!", ); i > e ? ((o = i), (i = e)) : o > e && (o = e), a < e && (a = e), r.push(e); }), t.length > 1 && (this.minTickInterval = o - i), Object(gt.s)(e) && (this.min = i), Object(gt.s)(n) && (this.max = a); } }), e ); })(ie), le = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "quantize"), e; } return ( Object(h.c)(e, t), (e.prototype.invert = function (t) { var e = this.ticks, n = e.length, r = this.getInvertPercent(t), i = Math.floor(r * (n - 1)); if (i >= n - 1) return Object(gt.y)(e); if (i < 0) return Object(gt.k)(e); var o = e[i], a = i / (n - 1); return o + ((r - a) / ((i + 1) / (n - 1) - a)) * (e[i + 1] - o); }), (e.prototype.initCfg = function () { (this.tickMethod = "r-pretty"), (this.tickCount = 5), (this.nice = !0); }), (e.prototype.calculateTicks = function () { var e = t.prototype.calculateTicks.call(this); return ( this.nice || (Object(gt.y)(e) !== this.max && e.push(this.max), Object(gt.k)(e) !== this.min && e.unshift(this.min)), e ); }), (e.prototype.getScalePercent = function (t) { var e = this.ticks; if (t < Object(gt.k)(e)) return 0; if (t > Object(gt.y)(e)) return 1; var n = 0; return ( Object(gt.e)(e, function (e, r) { if (!(t >= e)) return !1; n = r; }), n / (e.length - 1) ); }), e ); })(re), de = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "quantile"), e; } return ( Object(h.c)(e, t), (e.prototype.initCfg = function () { (this.tickMethod = "quantile"), (this.tickCount = 5), (this.nice = !0); }), e ); })(le), fe = {}; function pe(t, e) { if ( (function (t) { return fe[t]; })(t) ) throw new Error("type '" + t + "' existed."); fe[t] = e; } var ge = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.type = "identity"), (e.isIdentity = !0), e; } return ( Object(h.c)(e, t), (e.prototype.calculateTicks = function () { return this.values; }), (e.prototype.scale = function (t) { return this.values[0] !== t && Object(gt.t)(t) ? t : this.range[0]; }), (e.prototype.invert = function (t) { var e = this.range; return t < e[0] || t > e[1] ? NaN : this.values[0]; }), e ); })(wt), ye = [1, 5, 2, 2.5, 4, 3], ve = 100 * Number.EPSILON; function me(t, e, n, r, i, o) { var a = Object(gt.F)(e), s = Object(gt.l)(e, t), u = 0, c = (function (t, e) { return ((t % e) + e) % e; })(r, o); return ( (c < ve || o - c < ve) && r <= 0 && i >= 0 && (u = 1), 1 - s / (a - 1) - n + u ); } function be(t, e, n) { var r = Object(gt.F)(e); return 1 - Object(gt.l)(e, t) / (r - 1) - n + 1; } function xe(t, e, n, r, i, o) { var a = (t - 1) / (o - i), s = (e - 1) / (Math.max(o, r) - Math.min(n, i)); return 2 - Math.max(a / s, s / a); } function we(t, e) { return t >= e ? 2 - (t - 1) / (e - 1) : 1; } function Oe(t, e, n, r) { var i = e - t; return ( 1 - (0.5 * (Math.pow(e - r, 2) + Math.pow(t - n, 2))) / Math.pow(0.1 * i, 2) ); } function Me(t, e, n) { var r = e - t; if (n > r) { var i = (n - r) / 2; return 1 - Math.pow(i, 2) / Math.pow(0.1 * r, 2); } return 1; } function Se(t, e, n, r, i, o) { if ( (void 0 === n && (n = 5), void 0 === r && (r = !0), void 0 === i && (i = ye), void 0 === o && (o = [0.25, 0.2, 0.5, 0.05]), Number.isNaN(t) || Number.isNaN(e) || "number" != typeof t || "number" != typeof e || !n) ) return { min: 0, max: 0, ticks: [] }; if (e - t < 1e-15 || 1 === n) return { min: t, max: e, ticks: [t] }; for ( var a = { score: -2, lmin: 0, lmax: 0, lstep: 0 }, s = 1; s < 1 / 0; ) { for (var u = 0; u < i.length; u += 1) { var c = i[u], h = be(c, i, s); if (o[0] * h + o[1] + o[2] + o[3] < a.score) { s = 1 / 0; break; } for (var l = 2; l < 1 / 0; ) { var d = we(l, n); if (o[0] * h + o[1] + o[2] * d + o[3] < a.score) break; for ( var f = (e - t) / (l + 1) / s / c, p = Math.ceil(Math.log10(f)); p < 1 / 0; ) { var g = s * c * Math.pow(10, p), y = Me(t, e, g * (l - 1)); if (o[0] * h + o[1] * y + o[2] * d + o[3] < a.score) break; var v = Math.floor(e / g) * s - (l - 1) * s, m = Math.ceil(t / g) * s; if (v <= m) for (var b = m - v, x = 0; x <= b; x += 1) { var w = (v + x) * (g / s), O = w + g * (l - 1), M = g, S = me(c, i, s, w, O, M), C = Oe(t, e, w, O), j = xe(l, n, t, e, w, O), k = o[0] * S + o[1] * C + o[2] * j + 1 * o[3]; k > a.score && (!r || (w <= t && O >= e)) && ((a.lmin = w), (a.lmax = O), (a.lstep = M), (a.score = k)); } p += 1; } l += 1; } } s += 1; } var E, N = a.lmax, T = a.lmin, P = a.lstep, I = Math.floor((N - T) / P) + 1, B = new Array(I); for (u = 0; u < I; u++) B[u] = (E = T + u * P) < 1e-15 ? E : parseFloat(E.toFixed(15)); return { min: Math.min(t, Object(gt.k)(B)), max: Math.max(e, Object(gt.y)(B)), ticks: B, }; } function Ce(t) { var e = t.values, n = t.tickInterval, r = t.tickCount, i = e; if (Object(gt.t)(n)) return Object(gt.f)(i, function (t, e) { return e % n == 0; }); var o = t.min, a = t.max; if ( (Object(gt.s)(o) && (o = 0), Object(gt.s)(a) && (a = e.length - 1), Object(gt.t)(r) && r < a - o) ) { var s = Se(o, a, r, !1, [1, 2, 5, 3, 4, 7, 6, 8, 9]).ticks; return Object(gt.f)(s, function (t) { return t >= o && t <= a; }).map(function (t) { return e[t]; }); } return e.slice(o, a + 1); } var je = Math.sqrt(50), ke = Math.sqrt(10), Ee = Math.sqrt(2), Ne = (function () { function t() { this._domain = [0, 1]; } return ( (t.prototype.domain = function (t) { return t ? ((this._domain = Array.from(t, Number)), this) : this._domain.slice(); }), (t.prototype.nice = function (t) { var e, n; void 0 === t && (t = 5); var r, i = this._domain.slice(), o = 0, a = this._domain.length - 1, s = this._domain[o], u = this._domain[a]; return ( u < s && ((s = (e = [u, s])[0]), (u = e[1]), (o = (n = [a, o])[0]), (a = n[1])), (r = Te(s, u, t)) > 0 ? (r = Te( (s = Math.floor(s / r) * r), (u = Math.ceil(u / r) * r), t, )) : r < 0 && (r = Te( (s = Math.ceil(s * r) / r), (u = Math.floor(u * r) / r), t, )), r > 0 ? ((i[o] = Math.floor(s / r) * r), (i[a] = Math.ceil(u / r) * r), this.domain(i)) : r < 0 && ((i[o] = Math.ceil(s * r) / r), (i[a] = Math.floor(u * r) / r), this.domain(i)), this ); }), (t.prototype.ticks = function (t) { return ( void 0 === t && (t = 5), (function (t, e, n) { var r, i, o, a, s = -1; if (((n = +n), (t = +t) === (e = +e) && n > 0)) return [t]; (r = e < t) && ((i = t), (t = e), (e = i)); if (0 === (a = Te(t, e, n)) || !isFinite(a)) return []; if (a > 0) for ( t = Math.ceil(t / a), e = Math.floor(e / a), o = new Array((i = Math.ceil(e - t + 1))); ++s < i; ) o[s] = (t + s) * a; else for ( t = Math.floor(t * a), e = Math.ceil(e * a), o = new Array((i = Math.ceil(t - e + 1))); ++s < i; ) o[s] = (t - s) / a; r && o.reverse(); return o; })( this._domain[0], this._domain[this._domain.length - 1], t || 5, ) ); }), t ); })(); function Te(t, e, n) { var r = (e - t) / Math.max(0, n), i = Math.floor(Math.log(r) / Math.LN10), o = r / Math.pow(10, i); return i >= 0 ? (o >= je ? 10 : o >= ke ? 5 : o >= Ee ? 2 : 1) * Math.pow(10, i) : -Math.pow(10, -i) / (o >= je ? 10 : o >= ke ? 5 : o >= Ee ? 2 : 1); } function Pe(t, e, n) { return ( ("ceil" === n ? Math.ceil(t / e) : "floor" === n ? Math.floor(t / e) : Math.round(t / e)) * e ); } function Ie(t, e, n) { var r = Pe(t, n, "floor"), i = Pe(e, n, "ceil"); (r = Object(gt.g)(r, n)), (i = Object(gt.g)(i, n)); for (var o = [], a = r; a <= i; a += n) { var s = Object(gt.g)(a, n); o.push(s); } return { min: r, max: i, ticks: o }; } function Be(t, e, n) { var r, i = t.minLimit, o = t.maxLimit, a = t.min, s = t.max, u = t.tickCount, c = void 0 === u ? 5 : u, h = Object(gt.s)(i) ? (Object(gt.s)(e) ? a : e) : i, l = Object(gt.s)(o) ? (Object(gt.s)(n) ? s : n) : o; if ((h > l && ((l = (r = [h, l])[0]), (h = r[1])), c <= 2)) return [h, l]; for (var d = (l - h) / (c - 1), f = [], p = 0; p < c; p++) f.push(h + d * p); return f; } function Ae(t) { return t < 1e-15 ? t : parseFloat(t.toFixed(15)); } function Le(t, e, n) { if ((void 0 === n && (n = 5), t === e)) return { max: e, min: t, ticks: [t] }; var r = (e - t) / n, i = Math.pow(10, Math.floor(Math.log10(r))), o = i; 2 * i - r < 1.5 * (r - o) && 5 * i - r < 2.75 * (r - (o = 2 * i)) && 10 * i - r < 1.5 * (r - (o = 5 * i)) && (o = 10 * i); for ( var a = Math.ceil(e / o), s = Math.floor(t / o), u = Math.max(a * o, e), c = Math.min(s * o, t), h = Math.floor((u - c) / o) + 1, l = new Array(h), d = 0; d < h; d++ ) l[d] = Ae(c + d * o); return { min: c, max: u, ticks: l }; } function De(t, e) { var n = t.length * e; return 1 === e ? t[t.length - 1] : 0 === e ? t[0] : n % 1 != 0 ? t[Math.ceil(n) - 1] : t.length % 2 == 0 ? (t[n - 1] + t[n]) / 2 : t[n]; } function _e(t) { return new Date(t).getFullYear(); } function Re(t) { return new Date(t, 0, 1).getTime(); } function Ye(t) { return new Date(t).getMonth(); } function Fe(t, e) { return new Date(t, e, 1).getTime(); } function ze(t) { return (function (t) { return Object(gt.z)(t, function (t, e) { return [0 === e ? "M" : "L", t[0], t[1]]; }); })(t); } function Xe(t, e, n, r) { void 0 === r && (r = !0); var i = new ie({ values: t }), o = new Ot({ values: Object(gt.z)(t, function (t, e) { return e; }), }), a = Object(gt.z)(t, function (t, r) { return [o.scale(r) * e, n - i.scale(t) * n]; }); return r ? (function (t) { if (t.length <= 2) return ze(t); var e = []; Object(gt.e)(t, function (t) { Object(gt.q)(t, e.slice(e.length - 2)) || e.push(t[0], t[1]); }); var n = mt.a(e, !1), r = Object(gt.k)(t), i = r[0], o = r[1]; return n.unshift(["M", i, o]), n; })(a) : ze(a); } xt("cat", Ce), xt("time-cat", function (t) { var e = Ce(t), n = Object(gt.y)(t.values); return n !== Object(gt.y)(e) && e.push(n), e; }), xt("wilkinson-extended", function (t) { var e = t.min, n = t.max, r = t.tickCount, i = t.nice, o = t.tickInterval, a = t.minLimit, s = t.maxLimit, u = Se(e, n, r, i).ticks; return Object(gt.s)(a) && Object(gt.s)(s) ? o ? Ie(e, n, o).ticks : u : Be(t, Object(gt.k)(u), Object(gt.y)(u)); }), xt("r-pretty", function (t) { var e = t.min, n = t.max, r = t.tickCount, i = t.tickInterval, o = t.minLimit, a = t.maxLimit, s = Le(e, n, r).ticks; return Object(gt.s)(o) && Object(gt.s)(a) ? i ? Ie(e, n, i).ticks : s : Be(t, Object(gt.k)(s), Object(gt.y)(s)); }), xt("time", function (t) { var e = t.min, n = t.max, r = t.minTickInterval, i = t.tickInterval, o = t.tickCount; if (i) o = Math.ceil((n - e) / i); else { var a = (n - e) / (i = ee(e, n, o)[1]) / o; a > 1 && (i *= Math.ceil(a)), r && i < r && (i = r); } for (var s = [], u = e; u < n + i; u += i) s.push(u); return s; }), xt("time-pretty", function (t) { var e = t.min, n = t.max, r = t.minTickInterval, i = t.tickCount, o = t.tickInterval, a = []; o || ((o = (n - e) / i), r && o < r && (o = r)); var s = _e(e); if (o > 31536e6) for ( var u = _e(n), c = Math.ceil(o / 31536e6), h = s; h <= u + c; h += c ) a.push(Re(h)); else if (o > Jt) { var l = Math.ceil(o / Jt), d = Ye(e), f = (function (t, e) { var n = _e(t), r = _e(e), i = Ye(t); return 12 * (r - n) + ((Ye(e) - i) % 12); })(e, n); for (h = 0; h <= f + l; h += l) a.push(Fe(s, h + d)); } else if (o > $t) { var p = (b = new Date(e)).getFullYear(), g = b.getMonth(), y = b.getDate(), v = Math.ceil(o / $t), m = (function (t, e) { return Math.ceil((e - t) / $t); })(e, n); for (h = 0; h < m + v; h += v) a.push(new Date(p, g, y + h).getTime()); } else if (o > Qt) { (p = (b = new Date(e)).getFullYear()), (g = b.getMonth()), (v = b.getDate()); var b, x = b.getHours(), w = Math.ceil(o / Qt), O = (function (t, e) { return Math.ceil((e - t) / Qt); })(e, n); for (h = 0; h <= O + w; h += w) a.push(new Date(p, g, v, x + h).getTime()); } else if (o > 6e4) { var M = (function (t, e) { return Math.ceil((e - t) / 6e4); })(e, n), S = Math.ceil(o / 6e4); for (h = 0; h <= M + S; h += S) a.push(e + 6e4 * h); } else { var C = o; C < 1e3 && (C = 1e3); var j = 1e3 * Math.floor(e / 1e3), k = Math.ceil((n - e) / 1e3), E = Math.ceil(C / 1e3); for (h = 0; h < k + E; h += E) a.push(j + 1e3 * h); } return ( a.length >= 512 && console.warn( "Notice: current ticks length(" + a.length + ') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is ' + o + ") is too small, increase the value to solve the problem!", ), a ); }), xt("log", function (t) { var e, n = t.base, r = t.tickCount, i = t.min, o = t.max, a = t.values, s = ae(n, o); if (i > 0) e = Math.floor(ae(n, i)); else { var u = se(a, n, o); e = Math.floor(ae(n, u)); } for ( var c = s - e, h = Math.ceil(c / r), l = [], d = e; d < s + h; d += h ) l.push(Math.pow(n, d)); return i <= 0 && l.unshift(0), l; }), xt("pow", function (t) { var e = t.exponent, n = t.tickCount, r = Math.ceil(oe(e, t.max)); return Le(Math.floor(oe(e, t.min)), r, n).ticks.map(function (t) { var n = t >= 0 ? 1 : -1; return Math.pow(t, e) * n; }); }), xt("quantile", function (t) { var e = t.tickCount, n = t.values; if (!n || !n.length) return []; for ( var r = n.slice().sort(function (t, e) { return t - e; }), i = [], o = 0; o < e; o++ ) { var a = o / (e - 1); i.push(De(r, a)); } return i; }), xt("d3-linear", function (t) { var e = t.min, n = t.max, r = t.tickInterval, i = t.minLimit, o = t.maxLimit, a = (function (t) { var e = t.min, n = t.max, r = t.nice, i = t.tickCount, o = new Ne(); return o.domain([e, n]), r && o.nice(i), o.ticks(i); })(t); return Object(gt.s)(i) && Object(gt.s)(o) ? r ? Ie(e, n, r).ticks : a : Be(t, Object(gt.k)(a), Object(gt.y)(a)); }), pe("cat", Ot), pe("category", Ot), pe("identity", ge), pe("linear", ie), pe("log", ue), pe("pow", ce), pe("time", he), pe("timeCat", ne), pe("quantize", le), pe("quantile", de); var We = { stroke: "#C5C5C5", strokeOpacity: 0.85 }; function Ge(t) { var e = t.data, n = void 0 === e ? [] : e, r = t.width, i = t.slider, o = t.sliderTick, a = (function (t) { var e = t.width, n = t.height, r = void 0 === n ? 4 : n, i = Object.assign({}, nt, t.handlerStyle), o = Object.assign({}, J, t.backgroundStyle), a = Object.assign({}, tt, t.foregroundStyle), s = Object.assign({}, rt, t.textStyle), u = V( "\n
\n
\n
\n
0
\n
\n
\n
0
\n
\n
\n ", "\n .slider-bg {\n width: " + e + ";\n height: " + r + ";\n background: " + o.fill + ";\n opacity: " + o.opacity + ";\n border-radius: " + o.radius + ";\n z-index: 10;\n margin-top: 30;\n }\n \n .slider-inner{\n position: absolute;\n width: " + e + ";\n height: " + r + ";\n border-radius: " + r / 2 + ";\n background: " + a.fill + ";\n background-opacity: " + a.opacity + "\n z-index: 1;\n }\n\n .control {\n position: absolute;\n top: " + (-i.radius / 2 + r / 2) + ";\n width: " + i.radius + ";\n height: " + i.radius + ";\n border-radius: " + i.radius / 2 + ";\n background: " + i.fill + ";\n border: " + i.lineWidth + " solid " + i.stroke + ";\n z-index: 2;\n }\n\n .text{\n position: absolute;\n left: " + i.radius / 2 + ";\n top: -" + (i.radius / 2 + s.fontSize / 2) + ";\n width: 0;\n color: " + s.fill + ";\n font-size: " + s.fontSize + ";\n text-align: center;\n }\n\n text{\n opacity: " + s.opacity + ";\n white-space: nowrap;\n }\n \n .left-control {\n left: 0;\n }\n\n .right-control{\n left: " + (e - i.radius) + ";\n }\n ", ); return { slideContainer: u, leftControl: u.query(".left-control"), rightControl: u.query(".right-control"), slideInner: u.query(".slider-inner"), }; })(i); return He( { data: n, width: r, start: i.start, end: i.end, sliderTick: o }, a, ); } function qe(t) { var e = t.data, n = t.width, r = t.slider, i = t.sliderTick, o = (function (t) { var e = t.slider, n = void 0 === e ? {} : e, r = t.trend, i = void 0 === r ? {} : r, o = n.width, a = n.height, s = void 0 === a ? 24 : a, u = i.data, c = void 0 === u ? [] : u, h = i.lineStyle, l = i.smooth, d = void 0 === l || l, f = Object.assign({}, et, n.handlerStyle), p = Object.assign({}, $, n.backgroundStyle), g = Object.assign({}, tt, n.foregroundStyle), y = Object.assign({}, rt, n.textStyle), v = Object.assign({}, We, h), m = f.width, b = 2 * m, x = 2 * b + 10, w = V( "\n
\n \n
\n
\n
\n
1
\n \n \n \n
\n
\n
\n
\n
1
\n \n \n \n
\n
\n
\n ", "\n .slider-bg {\n width: " + o + ";\n height: " + s + ";\n background: " + p.fill + ";\n opacity: " + p.opacity + ";\n z-index: 10;\n }\n\n .trend-bg{\n position: absolute;\n width: " + o + ";\n height: " + s + ";\n border: 1 solid " + v.stroke + ";\n opacity: " + v.strokeOpacity + ";\n }\n \n .slider-inner{\n position: absolute;\n width: " + o + ";\n height: " + s + ";\n background: " + g.fill + ";\n opacity: " + g.opacity + ";\n }\n\n .control {\n position: absolute;\n width: " + x + ";\n height: " + s + ";\n font-size: 10;\n background-opacity: 0;\n }\n\n .handler{\n position: absolute;\n height: " + f.height + ";\n width: " + m + ";\n }\n \n .rect {\n position: absolute;\n width: " + m + ";\n height: " + f.height + ";\n background: " + f.fill + ";\n }\n\n .circle {\n background: " + f.fill + ";\n position: absolute;\n left: " + m / 2 + "\n }\n\n .top-circle{\n top: 0\n }\n\n .bottom-circle{\n bottom: 0\n }\n\n .right-control .handler{\n right: 0\n }\n\n .control .text{\n position: absolute;\n top: " + (s / 2 - 5) + ";\n }\n \n .text{\n color: " + y.fill + ";\n width: 40;\n text-align: center;\n }\n\n .text text{\n opacity:" + y.opacity + "\n }\n\n .left-control .text{\n margin-left: 0;\n }\n\n .right-control .text{\n \n }\n \n .left-control {\n left: 0;\n }\n\n .right-control{\n left: " + (o - x) + ";\n }\n ", ), O = Xe(c, o, s, d); w.query(".trend-bg").setAttribute("path", O); var M = w.query(".left-control"), S = w.query(".right-control"), C = M.query(".text"), j = S.query(".text"); return ( (M.onLeftChange = function (t) { t < C.width ? C.setStyle("marginLeft", 0) : C.setStyle("marginLeft", -C.width); }), (S.onLeftChange = function (t) { t > w.width - S.width - j.width ? j.setStyle("marginLeft", -j.width) : j.setStyle("marginLeft", 0); }), { slideContainer: w, leftControl: w.query(".left-control"), rightControl: w.query(".right-control"), slideInner: w.query(".slider-inner"), } ); })({ slider: r, trend: t.trend }); return He( { data: e, width: n, start: r.start, end: r.end, sliderTick: i }, o, ); } function He(t, e) { var n = t.data, r = void 0 === n ? [] : n, i = t.width, o = t.start, a = void 0 === o ? 0.1 : o, s = t.end, u = void 0 === s ? 0.9 : s, c = t.sliderTick, h = c.width, l = (void 0 === h ? 0 : h) / r.length, d = (function (t) { return V( "\n
\n ", "\n #slider {\n width: " + t + ";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n ", ); })(i), f = e.slideContainer, p = e.leftControl, g = e.rightControl, y = e.slideInner, v = (function (t, e, n) { var r = n.width, i = void 0 === r ? 0 : r, o = Object.assign({}, it, n.textStyle), a = Object.assign({}, ot, n.lineStyle), s = Math.floor(o.width / e); return V( "\n
\n " + t.reduce(function (t, e, n) { return ( t + "\n
\n " + (n % s == 0 ? "\n \n
" + e.date + "
" : "") + "\n
\n " ); }, "") + "\n
", "\n .tiker {\n width: " + i + ";\n background-opacity: 0;\n display: flex;\n flex-direction: row;\n z-index: 1;\n color: black;\n }\n .single-tick {\n width: " + e + ";\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .single-tick shape{\n width: " + a.width + ";\n height: " + a.height + ";\n background: " + a.fill + ";\n }\n .single-tick .text {\n height: " + o.fontSize + ";\n text-align: center;\n font-size: " + o.fontSize + ";\n width: 0; \n color: " + o.fill + ";\n }\n text {\n opacity: " + o.opacity + ";;\n white-space: nowrap;\n }\n ", ); })(r, l, c); d.appendChild(f, v); var m = (function (t) { var e = t.delegateNode, n = t.leftControl, r = t.rightControl, i = t.slideInner, o = t.data, a = t.tickWidth, s = t.slideContainer, u = t.speed, c = 0, h = 1, l = 0; function d() { var t = r.width, e = s.width; l > e - t || v((l += a)); } var f = vt(d, void 0 === u ? 100 : u); function p() { return r.left - n.left + n.width; } function g(t) { var e = (t / s.width) * o.length; return o[Math.floor(e)]; } function y(t, e) { var r; void 0 === e && (e = !0); var o = n.width, a = s.width; t < 0 && (t = 0), t > a - o && (t = a - o), null === (r = n.onLeftChange) || void 0 === r || r.call(n, t), n.setStyle("left", t), e && i.setStyle("width", p()), i.setStyle("left", t < 0 ? 0 : t); var u = g(t); u && (n.setText(u.date), K("RANGE_CHANGE", { value: [(c = t / a), h] })); } function v(t, e) { var n; void 0 === e && (e = !0); var o = r.width, a = s.width; t < 0 && (t = 0), t >= a - o && (t = a - o), null === (n = r.onLeftChange) || void 0 === n || n.call(r, t), r.setStyle("left", t), e && i.setStyle("width", p()); var u = g(t + o); u && ((l = t), r.setText(u.date), K("RANGE_CHANGE", { value: [c, (h = (t + o) / a)] })); } var m = new Map(); m.set(n, { getStart: function () { return n.left; }, handler: y, }), m.set(r, { getStart: function () { return r.left; }, handler: v, }), m.set(i, { getStart: function () { return i.left; }, handler: function (t) { var e = r.width, n = i.width, o = s.width; t < 0 && (t = 0), t > o - n && (t = o - n), y(t, !1), v(t + n - e, !1); }, }); var b, x = 0, w = 0; return ( e.on("panstart", function (t) { if (t.uiNode) { b = void 0; var e = m.get(t.uiNode); e && ((b = t.uiNode), (x = t.clientX), (w = e.getStart())); } }), e.on("panmove", function (t) { if (b) { var e = m.get(b), n = t.clientX - x; e.handler(w + n); } }), { goLeftPercent: function (t) { t < 0 || t > 1 || y(t * s.width); }, goRightPercent: function (t) { t < 0 || t > 1 || v(t * s.width); }, goNext: d, goPrev: function () { l < 0 || v((l -= a)); }, player: f, } ); })({ data: r, slideContainer: f, leftControl: p, rightControl: g, slideInner: y, tickWidth: l, delegateNode: d, }); return ( (f.didMount = function () { m.goLeftPercent(a), m.goRightPercent(u); }), Q("SLIDER_PLAY", m.player.play), Q("SLIDER_PAUSE", m.player.stop), Q("SPEED_CHANGE", m.player.setSpeed), Q("CONTROL_NEXT", m.goNext), Q("CONTROL_PREV", m.goPrev), d ); } function Ve(t, e, n) { var r = Math.max(t, e), i = Math.min(t, e); (n.start = i), (n.end = r), Ue(n), n.tickBoxs.forEach(function (t) { n.selects.includes(t) || (t.getAttribute("disFromStart") >= i && t.getAttribute("disFromStart") <= r && (t.setStyle("backgroundColor", n.selectedFill), n.selects.push(t))); }), n.selects.length > 0 && K("RANGE_CHANGE", { value: [ n.selects[0].getAttribute("disFromStart") / n.width, n.selects[n.selects.length - 1].getAttribute("disFromStart") / n.width, ], }); } function Ue(t) { t.selects.forEach(function (e) { e.setStyle("backgroundColor", t.unSelectFill); }), (t.selects = []); } var Ze = function (t) { var e, n, r, i, o, a = t.data, s = t.tick, u = s.start, c = void 0 === u ? 0.1 : u, h = s.end, l = void 0 === h ? 0.9 : h, d = s.width, f = s.padding; console.log(t); var p = Object.assign( {}, ht, null === (e = null == t ? void 0 : t.tick) || void 0 === e ? void 0 : e.selectedTickStyle, ), g = Object.assign( {}, lt, null === (n = null == t ? void 0 : t.tick) || void 0 === n ? void 0 : n.unSelectedTickStyle, ), y = {}; (y.data = a), (y.width = d), (y.padding = f || "10 0"), (y.selectedFill = p.fill), (y.unSelectFill = g.fill), (y.gap = at), (y.tickBoxHeight = (null === (r = null == t ? void 0 : t.tick) || void 0 === r ? void 0 : r.tickBoxHeight) || st), (y.lineStyle = Object.assign( {}, ut, null === (i = null == t ? void 0 : t.tick) || void 0 === i ? void 0 : i.tickLineStyle, )), (y.textStyle = Object.assign( {}, ct, null === (o = null == t ? void 0 : t.tick) || void 0 === o ? void 0 : o.tickLabelStyle, )), (y.tickWidth = d / a.length), (y.count = Math.floor(y.textStyle.width / y.tickWidth)), (y.start = c), (y.end = l), (y.selects = []); var v = (function (t) { var e = t.data, n = t.tickWidth, r = t.count, i = t.width, o = t.gap, a = t.tickBoxHeight, s = t.textStyle, u = t.lineStyle, c = t.start, h = t.end, l = t.unSelectFill, d = "\n
\n " + e.reduce(function (t, e, i) { return ( t + "\n
\n
\n " + (i % r == 0 ? "\n
\n \n
" + e.date + "
\n
" : "") + "\n
" ); }, "") + "\n
\n", f = "\n #slider {\n width: " + i + ";\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: flex-start;\n padding: " + t.padding + ";\n }\n\n .ticker {\n width: " + (n - o) + ";\n display: flex;\n background-opacity: 0;\n align-items: center;\n }\n\n .tick-box {\n width: " + (n - o) + ";\n height: " + a + ";\n background: " + l + ";\n }\n\n .tick-desc {\n display: flex;\n align-items: center;\n }\n\n .text{\n width: 0;\n height: " + s.fontSize + ";\n text-align:center;\n color: " + s.fill + ";\n font-size: " + s.fontSize + ";\n }\n\n .text text{\n white-space: nowrap;\n }\n\n .line {\n width: " + u.width + ";\n height: " + u.height + ";\n background: " + u.fill + ";\n margin: 2 0;\n }\n", p = V(d, f); return ( (p.didMount = function () { (t.start = c * i), (t.end = h * i), Ve(t.start, t.end, t); }), p ); })(y); return ( (y.tickBoxs = v.queryAll(".tick-box")), (function (t) { var e = function () { (t.end += t.tickWidth), Ve(t.start, t.end, t); }, n = vt(e, 1e3); Q("CONTROL_NEXT", e), Q("CONTROL_PREV", function () { (t.end -= t.tickWidth), Ve(t.start, t.end, t); }), Q("SLIDER_PLAY", n.play), Q("SLIDER_PAUSE", n.stop), Q("SPEED_CHANGE", n.setSpeed); })(y), (function (t, e) { var n = 0, r = !1, i = 0, o = Object(gt.G)(Ve, 30, { trailing: !0, leading: !0 }); t.on("panstart", function (t) { (r = !1), t.uiNode && "tick-box" === t.uiNode.getAttribute("class") && ((r = !0), (n = t.clientX), (i = t.uiNode.getAttribute("disFromStart")), Ue(e)); }), t.on("panmove", function (t) { if (r) { var a = t.clientX - n; o(i, i + a, e); } }), t.on("tap", function (t) { t.uiNode && "tick-box" === t.uiNode.getAttribute("class") && (function (t, e) { Ue(e), e.selects.push(t), (e.start = e.end = t.getAttribute("disFromStart")), K("RANGE_CHANGE", { value: [ t.getAttribute("disFromStart") / e.width, t.getAttribute("disFromStart") / e.width, ], }), t.setStyle("backgroundColor", e.selectedFill); })(t.uiNode, e); }); })(v, y), v ); }; function Ke(t, e) { var n = t.width, r = t.group, i = t.control, o = H( "", "\n root {\n /** 盒模型 **/\n width: " + n + ";\n /** flex **/\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n }\n", r, ), a = yt(i); return o.appendChild(e, a), o; } var Qe = (function () { function t(t) { (this._cfgs = Object(gt.d)(this.getDefaultCfgs(), t)), (this._events = {}), (this.destroyed = !1); } return ( (t.prototype.getDefaultCfgs = function () { return {}; }), (t.prototype.initPlugin = function (t) { var e = this; e.set("graph", t); var n = e.getEvents(), r = {}; Object(gt.e)(n, function (n, i) { var o = Object(gt.K)(e, n); (r[i] = o), t.on(i, o); }), (this._events = r), this.init(); }), (t.prototype.init = function () {}), (t.prototype.getEvents = function () { return {}; }), (t.prototype.get = function (t) { return this._cfgs[t]; }), (t.prototype.set = function (t, e) { this._cfgs[t] = e; }), (t.prototype.destroy = function () {}), (t.prototype.destroyPlugin = function () { this.destroy(); var t = this.get("graph"), e = this._events; Object(gt.e)(e, function (e, n) { t.off(n, e); }), (this._events = null), (this._cfgs = null), (this.destroyed = !0); }), t ); })(), $e = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { className: "f6-component-timebar", padding: 10, type: "trend", data: [], trend: { smooth: !0 }, controllerCfg: { speed: 1 }, slider: { start: 0.1, end: 0.9 }, tick: { start: 0.1, end: 0.9 }, filterEdge: !1, }; }), (e.prototype.init = function () { var t = this; setTimeout(function () { t.render(), t.initEvent(); }); }), (e.prototype.filterData = function (t) { var e, n = t.value, r = this.get("data"); if (r && 0 !== r.length) { var i = this.get("rangeChange"), o = this.get("graph"), a = Math.round(r.length * n[0]), s = Math.round(r.length * n[1]); (s = s >= r.length ? r.length - 1 : s), (a = a >= r.length ? r.length - 1 : a); var u = null === (e = this._cfgs.tick) || void 0 === e ? void 0 : e.tickLabelFormatter, c = u ? u(r[a]) : r[a].date, h = u ? u(r[s]) : r[s].date; if (i) i(o, c, h); else { (!this.cacheGraphData || (this.cacheGraphData.nodes && 0 === this.cacheGraphData.nodes.length)) && (this.cacheGraphData = o.get("data")); var l = this.cacheGraphData.nodes.filter(function (t) { return t.date >= r[a].date && t.date <= r[s].date; }), d = l.map(function (t) { return t.id; }), f = []; this.cacheGraphData.edges && ((f = this.cacheGraphData.edges.filter(function (t) { return d.includes(t.source) && d.includes(t.target); })), this.get("filterEdge") && (f = f.filter(function (t) { return t.date >= r[a].date && t.date <= r[s].date; }))), o.changeData({ nodes: l, edges: f }); } } else console.warn("请配置 TimeBar 组件的数据"); }), (e.prototype.render = function () { var t = this._cfgs, e = t.data, n = t.width, r = t.padding, i = t.type, o = t.trend, a = t.slider, s = t.controllerCfg, u = t.tick, c = t.sliderTick, l = this.get("graph"), d = l.get("uiGroup"), f = null; switch (i) { case "trend": f = (function (t) { var e = t.width, n = void 0 === e ? 0 : e, r = t.padding, i = void 0 === r ? 0 : r, o = t.group, a = t.data, s = void 0 === a ? [] : a, u = t.slider, c = void 0 === u ? {} : u, l = t.controllerCfg, d = void 0 === l ? {} : l, f = t.trend, p = void 0 === f ? {} : f, g = t.sliderTick, y = void 0 === g ? {} : g, v = qe({ data: s, width: n, slider: Object(h.a)( { width: c.width || n - 2 * i, paddingTop: 0 }, c || {}, ), sliderTick: Object(h.a)({ width: n - 2 * i }, y || {}), trend: Object(h.a)( { data: null == s ? void 0 : s.map(function (t) { return t.value; }), }, p || {}, ), }); return Ke( { width: n, group: o, control: Object(h.a)({ wrapperWidth: n }, d), }, v, ); })({ group: d, width: n, padding: r, data: e, trend: o, slider: a, controllerCfg: s, sliderTick: c, }); break; case "tick": f = (function (t) { var e = t.group, n = t.data, r = void 0 === n ? [] : n, i = t.width, o = t.padding, a = t.controllerCfg, s = void 0 === a ? {} : a, u = t.tick, c = void 0 === u ? {} : u, l = Ze({ data: r, tick: Object(h.a)({ width: i - o }, c), }); return Ke( { width: i, group: e, control: Object(h.a)({ wrapperWidth: i }, s), }, l, ); })({ group: d, width: n, padding: r, tick: u, data: e, controllerCfg: s, }); break; case "simple": f = (function (t) { var e = t.width, n = void 0 === e ? 0 : e, r = t.padding, i = void 0 === r ? 0 : r, o = t.group, a = t.data, s = void 0 === a ? [] : a, u = t.slider, c = void 0 === u ? {} : u, l = t.controllerCfg, d = void 0 === l ? {} : l, f = t.sliderTick, p = void 0 === f ? {} : f, g = Ge({ data: s, width: n, slider: Object(h.a)( { width: c.width || n - 2 * i, paddingTop: 0 }, c, ), sliderTick: Object(h.a)({ width: n - 2 * i }, p), }); return Ke( { width: n, group: o, control: Object(h.a)({ wrapperWidth: n }, d), }, g, ); })({ group: d, width: n, padding: r, slider: a, data: e, controllerCfg: s, sliderTick: c, }); } var p = l.get("height"); d.translate(0, p - f.height); }), (e.prototype.initEvent = function () { Q( "RANGE_CHANGE", Object(gt.G)(this.filterData.bind(this), 200, { trailing: !0, leading: !0, }), ); }), (e.prototype.destroy = function () { Z = {}; }), e ); })(Qe), Je = { getDefaultCfg: function () { return {}; }, getEvents: function () { return {}; }, updateCfg: function (t) { return Object.assign(this, t), !0; }, shouldBegin: function () { return !0; }, shouldUpdate: function () { return !0; }, shouldEnd: function () { return !0; }, bind: function (t) { var e = this.events; (this.graph = t), ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !0), Object(gt.e)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !1), Object(gt.e)(e, function (e, n) { t.off(n, e); }); }, get: function (t) { return this[t]; }, set: function (t, e) { return (this[t] = e), this; }, }, tn = (function () { function t() {} return ( (t.registerBehavior = function (e, n) { if (!n) throw new Error( "please specify handler for this behavior: " + e, ); var r = Object(gt.b)(Je); Object.assign(r, n); var i = function (t) { var e = this; Object.assign(this, this.getDefaultCfg(), t); var n = this.getEvents(); this.events = null; var r = {}; n && (Object(gt.e)(n, function (t, n) { r[n] = Object(gt.K)(e, t); }), (this.events = r)); }; (i.prototype = r), (t.types[e] = i); }), (t.hasBehavior = function (e) { return !!t.types[e]; }), (t.getBehavior = function (e) { return t.types[e]; }), (t.types = {}), t ); })(), en = tn, nn = n(14); function rn(t) { return (rn = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var on = {}; function an(t) { return on.requestAnimationFrame ? on.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : rn(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); } var sn = n(2), un = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (!a && 0 !== a) || (!s && 0 !== s) || ((i[a][s] = 1), e || (i[s][a] = 1)); }), i ); }, cn = function (t, e) { return t === e; }, hn = (function () { function t(t, e) { void 0 === e && (e = null), (this.value = t), (this.next = e); } return ( (t.prototype.toString = function (t) { return t ? t(this.value) : "" + this.value; }), t ); })(), ln = (function () { function t(t) { void 0 === t && (t = cn), (this.head = null), (this.tail = null), (this.compare = t); } return ( (t.prototype.prepend = function (t) { var e = new hn(t, this.head); return (this.head = e), this.tail || (this.tail = e), this; }), (t.prototype.append = function (t) { var e = new hn(t); return this.head ? ((this.tail.next = e), (this.tail = e), this) : ((this.head = e), (this.tail = e), this); }), (t.prototype.delete = function (t) { if (!this.head) return null; for ( var e = null; this.head && this.compare(this.head.value, t); ) (e = this.head), (this.head = this.head.next); var n = this.head; if (null !== n) for (; n.next; ) this.compare(n.next.value, t) ? ((e = n.next), (n.next = n.next.next)) : (n = n.next); return this.compare(this.tail.value, t) && (this.tail = n), e; }), (t.prototype.find = function (t) { var e = t.value, n = void 0 === e ? void 0 : e, r = t.callback, i = void 0 === r ? void 0 : r; if (!this.head) return null; for (var o = this.head; o; ) { if (i && i(o.value)) return o; if (void 0 !== n && this.compare(o.value, n)) return o; o = o.next; } return null; }), (t.prototype.deleteTail = function () { var t = this.tail; if (this.head === this.tail) return (this.head = null), (this.tail = null), t; for (var e = this.head; e.next; ) e.next.next ? (e = e.next) : (e.next = null); return (this.tail = e), t; }), (t.prototype.deleteHead = function () { if (!this.head) return null; var t = this.head; return ( this.head.next ? (this.head = this.head.next) : ((this.head = null), (this.tail = null)), t ); }), (t.prototype.fromArray = function (t) { var e = this; return ( t.forEach(function (t) { return e.append(t); }), this ); }), (t.prototype.toArray = function () { for (var t = [], e = this.head; e; ) t.push(e), (e = e.next); return t; }), (t.prototype.reverse = function () { for (var t = this.head, e = null, n = null; t; ) (n = t.next), (t.next = e), (e = t), (t = n); (this.tail = this.head), (this.head = e); }), (t.prototype.toString = function (t) { return ( void 0 === t && (t = void 0), this.toArray() .map(function (e) { return e.toString(t); }) .toString() ); }), t ); })(); !(function () { function t() { this.linkedList = new ln(); } (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.peek = function () { return this.linkedList.head ? this.linkedList.head.value : null; }), (t.prototype.enqueue = function (t) { this.linkedList.append(t); }), (t.prototype.dequeue = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toString = function (t) { return this.linkedList.toString(t); }); })(); var dn = function (t) { var e = {}, n = t.nodes, r = void 0 === n ? [] : n, i = t.edges, o = void 0 === i ? [] : i; return ( r.forEach(function (t) { e[t.id] = { degree: 0, inDegree: 0, outDegree: 0 }; }), o.forEach(function (t) { e[t.source].degree++, e[t.source].outDegree++, e[t.target].degree++, e[t.target].inDegree++; }), e ); }, fn = dn; var pn = function (t, e) { for (var n = un(t, e), r = [], i = n.length, o = 0; o < i; o += 1) { r[o] = []; for (var a = 0; a < i; a += 1) o === a ? (r[o][a] = 0) : 0 !== n[o][a] && n[o][a] ? (r[o][a] = n[o][a]) : (r[o][a] = 1 / 0); } for (var s = 0; s < i; s += 1) for (o = 0; o < i; o += 1) for (a = 0; a < i; a += 1) r[o][a] > r[o][s] + r[s][a] && (r[o][a] = r[o][s] + r[s][a]); return r; }, gn = ((function () { function t(t) { (this.count = t.length), (this.parent = {}); for (var e = 0, n = t; e < n.length; e++) { var r = n[e]; this.parent[r] = r; } } (t.prototype.find = function (t) { for (; this.parent[t] !== t; ) t = this.parent[t]; return t; }), (t.prototype.union = function (t, e) { var n = this.find(t), r = this.find(e); n !== r && (n < r ? (this.parent[e] !== e && this.union(this.parent[e], t), (this.parent[e] = this.parent[t])) : (this.parent[t] !== t && this.union(this.parent[t], e), (this.parent[t] = this.parent[e]))); }), (t.prototype.connected = function (t, e) { return this.find(t) === this.find(e); }); })(), function (t, e) { return t - e; }), yn = ((function () { function t(t) { void 0 === t && (t = gn), (this.compareFn = t), (this.list = []); } (t.prototype.getLeft = function (t) { return 2 * t + 1; }), (t.prototype.getRight = function (t) { return 2 * t + 2; }), (t.prototype.getParent = function (t) { return 0 === t ? null : Math.floor((t - 1) / 2); }), (t.prototype.isEmpty = function () { return this.list.length <= 0; }), (t.prototype.top = function () { return this.isEmpty() ? void 0 : this.list[0]; }), (t.prototype.delMin = function () { var t = this.top(), e = this.list.pop(); return ( this.list.length > 0 && ((this.list[0] = e), this.moveDown(0)), t ); }), (t.prototype.insert = function (t) { if (null !== t) { this.list.push(t); var e = this.list.length - 1; return this.moveUp(e), !0; } return !1; }), (t.prototype.moveUp = function (t) { for ( var e = this.getParent(t); t && t > 0 && this.compareFn(this.list[e], this.list[t]) > 0; ) { var n = this.list[e]; (this.list[e] = this.list[t]), (this.list[t] = n), (t = e), (e = this.getParent(t)); } }), (t.prototype.moveDown = function (t) { var e, n = t, r = this.getLeft(t), i = this.getRight(t), o = this.list.length; null !== r && r < o && this.compareFn(this.list[n], this.list[r]) > 0 ? (n = r) : null !== i && i < o && this.compareFn(this.list[n], this.list[i]) > 0 && (n = i), t !== n && ((e = [this.list[n], this.list[t]]), (this.list[t] = e[0]), (this.list[n] = e[1]), this.moveDown(n)); }); })(), function (t, e, n, r) { void 0 === t && (t = -1), void 0 === e && (e = -1), void 0 === n && (n = -1), void 0 === r && (r = "-1"), (this.id = t), (this.from = e), (this.to = n), (this.label = r); }), vn = (function () { function t(t, e) { void 0 === t && (t = -1), void 0 === e && (e = "-1"), (this.id = t), (this.label = e), (this.edges = []), (this.edgeMap = {}); } return ( (t.prototype.addEdge = function (t) { this.edges.push(t), (this.edgeMap[t.id] = t); }), t ); })(), mn = (function () { function t(t, e, n) { void 0 === t && (t = -1), void 0 === e && (e = !0), void 0 === n && (n = !1), (this.id = t), (this.edgeIdAutoIncrease = e), (this.edges = []), (this.nodes = []), (this.nodeMap = {}), (this.edgeMap = {}), (this.nodeLabelMap = {}), (this.edgeLabelMap = {}), (this.counter = 0), (this.directed = n); } return ( (t.prototype.getNodeNum = function () { return this.nodes.length; }), (t.prototype.addNode = function (t, e) { if (!this.nodeMap[t]) { var n = new vn(t, e); this.nodes.push(n), (this.nodeMap[t] = n), this.nodeLabelMap[e] || (this.nodeLabelMap[e] = []), this.nodeLabelMap[e].push(t); } }), (t.prototype.addEdge = function (t, e, n, r) { if ( ((this.edgeIdAutoIncrease || void 0 === t) && (t = this.counter++), !( this.nodeMap[e] && this.nodeMap[n] && this.nodeMap[n].edgeMap[t] )) ) { var i = new yn(t, e, n, r); if ( (this.edges.push(i), (this.edgeMap[t] = i), this.nodeMap[e].addEdge(i), this.edgeLabelMap[r] || (this.edgeLabelMap[r] = []), this.edgeLabelMap[r].push(i), !this.directed) ) { var o = new yn(t, n, e, r); this.nodeMap[n].addEdge(o), this.edgeLabelMap[r].push(o); } } }), t ); })(), bn = (function () { function t(t, e, n, r, i) { (this.fromNode = t), (this.toNode = e), (this.nodeEdgeNodeLabel = { nodeLabel1: n || "-1", edgeLabel: r || "-1", nodeLabel2: i || "-1", }); } return ( (t.prototype.equalTo = function (t) { return ( this.fromNode === t.formNode && this.toNode === t.toNode && this.nodeEdgeNodeLabel === t.nodeEdgeNodeLabel ); }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), t ); })(), xn = (function () { function t() { (this.rmpath = []), (this.dfsEdgeList = []); } return ( (t.prototype.equalTo = function (t) { var e = this.dfsEdgeList.length; if (e !== t.length) return !1; for (var n = 0; n < e; n++) if (this.dfsEdgeList[n] !== t[n]) return !1; return !0; }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), (t.prototype.pushBack = function (t, e, n, r, i) { return ( this.dfsEdgeList.push(new bn(t, e, n, r, i)), this.dfsEdgeList ); }), (t.prototype.toGraph = function (t, e) { void 0 === t && (t = -1), void 0 === e && (e = !1); var n = new mn(t, !0, e); return ( this.dfsEdgeList.forEach(function (t) { var e = t.fromNode, r = t.toNode, i = t.nodeEdgeNodeLabel, o = i.nodeLabel1, a = i.edgeLabel, s = i.nodeLabel2; "-1" !== o && n.addNode(e, o), "-1" !== s && n.addNode(r, s), n.addEdge(void 0, e, r, a); }), n ); }), (t.prototype.buildRmpath = function () { this.rmpath = []; for ( var t = void 0, e = this.dfsEdgeList.length - 1; e >= 0; e-- ) { var n = this.dfsEdgeList[e], r = n.fromNode, i = n.toNode; r < i && (void 0 === t || i === t) && (this.rmpath.push(e), (t = r)); } return this.rmpath; }), (t.prototype.getNodeNum = function () { var t = {}; return ( this.dfsEdgeList.forEach(function (e) { t[e.fromNode] || (t[e.fromNode] = !0), t[e.toNode] || (t[e.toNode] = !0); }), Object.keys(t).length ); }), t ); })(), wn = (function () { function t(t) { if ( ((this.his = {}), (this.nodesUsed = {}), (this.edgesUsed = {}), (this.edges = []), t) ) { for (; t; ) { var e = t.edge; this.edges.push(e), (this.nodesUsed[e.from] = 1), (this.nodesUsed[e.to] = 1), (this.edgesUsed[e.id] = 1), (t = t.preNode); } this.edges = this.edges.reverse(); } } return ( (t.prototype.hasNode = function (t) { return 1 === this.nodesUsed[t.id]; }), (t.prototype.hasEdge = function (t) { return 1 === this.edgesUsed[t.id]; }), t ); })(); !(function () { function t(t) { var e = t.graphs, n = t.minSupport, r = void 0 === n ? 2 : n, i = t.minNodeNum, o = void 0 === i ? 1 : i, a = t.maxNodeNum, s = void 0 === a ? 4 : a, u = t.top, c = void 0 === u ? 10 : u, h = t.directed, l = void 0 !== h && h, d = t.verbose, f = void 0 !== d && d; (this.graphs = e), (this.dfsCode = new xn()), (this.support = 0), (this.frequentSize1Subgraphs = []), (this.frequentSubgraphs = []), (this.minSupport = r), (this.top = c), (this.directed = l), (this.counter = 0), (this.maxNodeNum = s), (this.minNodeNum = o), (this.verbose = f), this.maxNodeNum < this.minNodeNum && (this.maxNodeNum = this.minNodeNum), (this.reportDF = []); } (t.prototype.findForwardRootEdges = function (t, e) { var n = this, r = [], i = t.nodeMap; return ( e.edges.forEach(function (t) { (n.directed || e.label <= i[t.to].label) && r.push(t); }), r ); }), (t.prototype.findBackwardEdge = function (t, e, n, r) { if (!this.directed && e === n) return null; for ( var i = t.nodeMap, o = i[n.to].edges, a = o.length, s = 0; s < a; s++ ) { var u = o[s]; if (!r.hasEdge(u) && u.to === e.from) if (this.directed) { if ( i[e.from].label < i[n.to].label || (i[e.from].label === i[n.to].label && e.label <= u.label) ) return u; } else if ( e.label < u.label || (e.label === u.label && i[e.to].label <= i[n.to].label) ) return u; } return null; }), (t.prototype.findForwardPureEdges = function (t, e, n, r) { for ( var i = [], o = e.to, a = t.nodeMap[o].edges, s = a.length, u = 0; u < s; u++ ) { var c = a[u], h = t.nodeMap[c.to]; n <= h.label && !r.hasNode(h) && i.push(c); } return i; }), (t.prototype.findForwardRmpathEdges = function (t, e, n, r) { for ( var i = [], o = t.nodeMap, a = o[e.to].label, s = o[e.from].edges, u = s.length, c = 0; c < u; c++ ) { var h = s[c], l = o[h.to].label; e.to === h.to || n > l || r.hasNode(o[h.to]) || ((e.label < h.label || (e.label === h.label && a <= l)) && i.push(h)); } return i; }), (t.prototype.getSupport = function (t) { var e = {}; return ( t.forEach(function (t) { e[t.graphId] || (e[t.graphId] = !0); }), Object.keys(e).length ); }), (t.prototype.findMinLabel = function (t) { var e = void 0; return ( Object.keys(t).forEach(function (n) { var r = t[n], i = r.nodeLabel1, o = r.edgeLabel, a = r.nodeLabel2; e ? (i < e.nodeLabel1 || (i === e.nodeLabel1 && o < e.edgeLabel) || (i === e.nodeLabel1 && o === e.edgeLabel && a < e.nodeLabel2)) && (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }) : (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }); }), e ); }), (t.prototype.isMin = function () { var t = this, e = this.dfsCode; if ( (this.verbose && console.log("isMin checking", e), 1 === e.dfsEdgeList.length) ) return !0; var n = this.directed, r = e.toGraph(-1, n), i = r.nodeMap, o = new xn(), a = {}; r.nodes.forEach(function (e) { t.findForwardRootEdges(r, e).forEach(function (t) { var n = i[t.to], o = e.label + "-" + t.label + "-" + n.label; a[o] || (a[o] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: n.label, }); var s = { graphId: r.id, edge: t, preNode: null }; a[o].projected.push(s); }); }); var s = this.findMinLabel(a); o.dfsEdgeList.push( new bn(0, 1, s.nodeLabel1, s.edgeLabel, s.nodeLabel2), ); var u = s.nodeLabel1 + "-" + s.edgeLabel + "-" + s.nodeLabel2; return (function a(s) { for ( var u = o.buildRmpath(), c = o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, h = o.dfsEdgeList[u[0]].toNode, l = {}, d = !1, f = 0, p = n ? -1 : 0, g = function (e) { if (d) return "break"; s.forEach(function (n) { var i = new wn(n), a = t.findBackwardEdge( r, i.edges[u[e]], i.edges[u[0]], i, ); a && (l[a.label] || (l[a.label] = { projected: [], edgeLabel: a.label }), l[a.label].projected.push({ graphId: r.id, edge: l, preNode: n, }), (f = o.dfsEdgeList[u[e]].fromNode), (d = !0)); }); }, y = u.length - 1; y > p; y-- ) { if ("break" === g(y)) break; } if (d) { var v = t.findMinLabel(l); o.dfsEdgeList.push(new bn(h, f, "-1", v.edgeLabel, "-1")); var m = o.dfsEdgeList.length - 1; return ( t.dfsCode.dfsEdgeList[m] === o.dfsEdgeList[m] && a(l[v.edgeLabel].projected) ); } var b = {}; d = !1; var x = 0; s.forEach(function (e) { var n = new wn(e), o = t.findForwardPureEdges(r, n.edges[u[0]], c, n); o.length > 0 && ((d = !0), (x = h), o.forEach(function (t) { var n = t.label + "-" + i[t.to].label; b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); var w = u.length, O = function (e) { if (d) return "break"; var n = u[e]; s.forEach(function (e) { var a = new wn(e), s = t.findForwardRmpathEdges(r, a.edges[n], c, a); s.length > 0 && ((d = !0), (x = o.dfsEdgeList[n].fromNode), s.forEach(function (t) { var n = t.label + "-" + i[t.to].label; b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); }; for (y = 0; y < w; y++) { if ("break" === O(y)) break; } if (!d) return !0; var M = t.findMinLabel(b); o.dfsEdgeList.push( new bn(x, h + 1, "-1", M.edgeLabel, M.nodeLabel2), ); var S = o.dfsEdgeList.length - 1; return ( e.dfsEdgeList[S] === o.dfsEdgeList[S] && a(b[M.edgeLabel + "-" + M.nodeLabel2].projected) ); })(a[u].projected); }), (t.prototype.report = function () { if (!(this.dfsCode.getNodeNum() < this.minNodeNum)) { this.counter++; var t = this.dfsCode.toGraph(this.counter, this.directed); this.frequentSubgraphs.push(Object(gt.b)(t)); } }), (t.prototype.subGraphMining = function (t) { var e = this; if (!(this.getSupport(t) < this.minSupport) && this.isMin()) { this.report(); var n = this.dfsCode.getNodeNum(), r = this.dfsCode.buildRmpath(), i = this.dfsCode.dfsEdgeList[r[0]].toNode, o = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, a = {}, s = {}; t.forEach(function (t) { for ( var u = e.graphs[t.graphId], c = u.nodeMap, h = new wn(t), l = r.length - 1; l >= 0; l-- ) { var d = e.findBackwardEdge( u, h.edges[r[l]], h.edges[r[0]], h, ); if (d) { var f = e.dfsCode.dfsEdgeList[r[l]].fromNode + "-" + d.label; s[f] || (s[f] = { projected: [], toNodeId: e.dfsCode.dfsEdgeList[r[l]].fromNode, edgeLabel: d.label, }), s[f].projected.push({ graphId: t.graphId, edge: d, preNode: t, }); } } if (!(n >= e.maxNodeNum)) { e.findForwardPureEdges(u, h.edges[r[0]], o, h).forEach( function (e) { var n = i + "-" + e.label + "-" + c[e.to].label; a[n] || (a[n] = { projected: [], fromNodeId: i, edgeLabel: e.label, nodeLabel2: c[e.to].label, }), a[n].projected.push({ graphId: t.graphId, edge: e, preNode: t, }); }, ); var p = function (n) { e.findForwardRmpathEdges(u, h.edges[r[n]], o, h).forEach( function (i) { var o = e.dfsCode.dfsEdgeList[r[n]].fromNode + "-" + i.label + "-" + c[i.to].label; a[o] || (a[o] = { projected: [], fromNodeId: e.dfsCode.dfsEdgeList[r[n]].fromNode, edgeLabel: i.label, nodeLabel2: c[i.to].label, }), a[o].projected.push({ graphId: t.graphId, edge: i, preNode: t, }); }, ); }; for (l = 0; l < r.length; l++) p(l); } }), Object.keys(s).forEach(function (t) { var n = s[t], r = n.toNodeId, o = n.edgeLabel; e.dfsCode.dfsEdgeList.push(new bn(i, r, "-1", o, "-1")), e.subGraphMining(s[t].projected), e.dfsCode.dfsEdgeList.pop(); }), Object.keys(a).forEach(function (t) { var n = a[t], r = n.fromNodeId, o = n.edgeLabel, s = n.nodeLabel2; e.dfsCode.dfsEdgeList.push(new bn(r, i + 1, "-1", o, s)), e.subGraphMining(a[t].projected), e.dfsCode.dfsEdgeList.pop(); }); } }), (t.prototype.generate1EdgeFrequentSubGraphs = function () { var t = this.graphs, e = this.directed, n = this.minSupport, r = this.frequentSize1Subgraphs, i = {}, o = {}, a = {}, s = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n], u = r.nodeMap; r.nodes.forEach(function (t, r) { var c = t.label, h = n + "-" + c; if (!a[h]) { var l = i[c] || 0; l++, (i[c] = l); } (a[h] = { graphKey: n, label: c }), t.edges.forEach(function (t) { var r = c, i = u[t.to].label; if (!e && r > i) { var a = i; (i = r), (r = a); } var h = t.label, l = n + "-" + r + "-" + h + "-" + i, d = r + "-" + h + "-" + i; if (!o[d]) { var f = o[d] || 0; f++, (o[d] = f); } s[l] = { graphId: n, nodeLabel1: r, edgeLabel: h, nodeLabel2: i, }; }); }); }), Object.keys(i).forEach(function (t) { if (!(i[t] < n)) { var e = { nodes: [], edges: [] }; e.nodes.push({ id: "0", label: t }), r.push(e); } }), r ); }), (t.prototype.run = function () { var t = this; if ( ((this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs()), !(this.maxNodeNum < 2)) ) { var e = this.graphs, n = (this.directed, {}); Object.keys(e).forEach(function (r) { var i = e[r], o = i.nodeMap; i.nodes.forEach(function (e) { t.findForwardRootEdges(i, e).forEach(function (t) { var i = o[t.to], a = e.label + "-" + t.label + "-" + i.label; n[a] || (n[a] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: i.label, }); var s = { graphId: r, edge: t, preNode: null }; n[a].projected.push(s); }); }); }), Object.keys(n).forEach(function (e) { var r = n[e], i = r.projected, o = r.nodeLabel1, a = r.edgeLabel, s = r.nodeLabel2; t.dfsCode.dfsEdgeList.push(new bn(0, 1, o, a, s)), t.subGraphMining(i), t.dfsCode.dfsEdgeList.pop(); }); } }); })(); var On = (function () { function t(t) { void 0 === t && (t = 10), (this.linkedList = new ln()), (this.maxStep = t); } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this.linkedList.toArray().length; }, enumerable: !1, configurable: !0, }), (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.isMaxStack = function () { return this.toArray().length >= this.maxStep; }), (t.prototype.peek = function () { return this.isEmpty() ? null : this.linkedList.head.value; }), (t.prototype.push = function (t) { this.linkedList.prepend(t), this.length > this.maxStep && this.linkedList.deleteTail(); }), (t.prototype.pop = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toArray = function () { return this.linkedList.toArray().map(function (t) { return t.value; }); }), (t.prototype.clear = function () { for (; !this.isEmpty(); ) this.pop(); }), t ); })(), Mn = sn.a.transform, Sn = function (t) { return function (e, n) { return e[t] - n[t]; }; }, Cn = function (t, e, n) { return t >= e && t <= n; }, jn = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = e.x - t.x, s = e.y - t.y, u = r.x - n.x, c = r.y - n.y, h = a * c - s * u, l = 1 / h; if (h * h > 1e-4 * (a * a + s * s) * (u * u + c * c)) { var d = (i * c - o * u) * l, f = (i * s - o * a) * l; return Cn(d, 0, 1) && Cn(f, 0, 1) ? { x: t.x + d * a, y: t.y + d * s } : null; } return null; }, kn = function (t, e) { var n = t.x, r = t.y, i = t.width, o = t.height, a = [], s = { x: n + i / 2, y: r + o / 2 }; a.push({ x: n, y: r }), a.push({ x: n + i, y: r }), a.push({ x: n + i, y: r + o }), a.push({ x: n, y: r + o }), a.push({ x: n, y: r }); for ( var u = null, c = 1; c < a.length && !(u = jn(a[c - 1], a[c], s, e)); c++ ); return u; }, En = function (t, e) { var n = t.x, r = t.y, i = t.r, o = e.x - n, a = e.y - r; if (Math.sqrt(o * o + a * a) < i) return null; var s = Math.sign(o), u = Math.sign(a), c = Math.atan(a / o); return { x: n + Math.abs(i * Math.cos(c)) * s, y: r + Math.abs(i * Math.sin(c)) * u, }; }, Nn = function (t, e) { var n = t.rx, r = t.ry, i = t.x, o = t.y, a = e.x - i, s = e.y - o, u = Math.atan2(s / r, a / n); return ( u < 0 && (u += 2 * Math.PI), { x: i + n * Math.cos(u), y: o + r * Math.sin(u) } ); }, Tn = function (t, e, n) { void 0 === n && (n = 1); var r = [t.x, t.y, n]; return ( (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]), sn.d.transformMat3(r, r, e), { x: r[0], y: r[1] } ); }, Pn = function (t, e, n) { void 0 === n && (n = 1), (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = sn.b.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], e); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var i = [t.x, t.y, n]; return sn.d.transformMat3(i, i, r), { x: i[0], y: i[1] }; }, In = function (t, e, n) { var r = t.x - e.x, i = t.y - e.y, o = t.x - n.x, a = t.y - n.y, s = (t.x * t.x - e.x * e.x - e.y * e.y + t.y * t.y) / 2, u = (t.x * t.x - n.x * n.x - n.y * n.y + t.y * t.y) / 2, c = i * o - r * a; return { x: -(a * s - i * u) / c, y: -(r * u - o * s) / c }; }, Bn = function (t, e) { var n = t.x - e.x, r = t.y - e.y; return Math.sqrt(n * n + r * r); }, An = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }, Ln = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var i = 0; i < n; i += 1) r === i ? (e[r][i] = 0) : 0 !== t[r][i] && t[r][i] ? (e[r][i] = t[r][i]) : (e[r][i] = 1 / 0); } for (var o = 0; o < n; o += 1) for (r = 0; r < n; r += 1) for (i = 0; i < n; i += 1) e[r][i] > e[r][o] + e[o][i] && (e[r][i] = e[r][o] + e[o][i]); return e; }, Dn = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }, _n = function (t, e) { t.translate(e.x, e.y); }, Rn = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = t.getCanvasBBox(), i = e.x - r.minX, o = e.y - r.minY, a = Mn(n, [["t", i, o]]); t.setMatrix(a); }, Yn = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e; Object(gt.m)(e) || (r = [e, e]), Object(gt.m)(e) && 1 === e.length && (r = [e[0], e[0]]), (n = Mn(n, [["s", r[0], r[1]]])), t.setMatrix(n); }, Fn = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (n = Mn(n, [["r", e]])), t.setMatrix(n); }, zn = function (t, e, n) { for (var r = [], i = 0; i < t; i++) r[i] = 0; return ( n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r ); }; function Xn(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } var Wn = function (t, e, n) { var r = !1, i = t.length; function o(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } if (i <= 2) return !1; for (var a = 0; a < i; a++) { var s = t[a], u = t[(a + 1) % i]; if (Xn(s, u, [e, n])) return !0; o(s[1] - n) > 0 != o(u[1] - n) > 0 && o(e - ((n - s[1]) * (s[0] - u[0])) / (s[1] - u[1]) - s[0]) < 0 && (r = !r); } return r; }, Gn = function (t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); }, qn = function (t, e) { var n = function (t) { var e = t.map(function (t) { return t[0]; }), n = t.map(function (t) { return t[1]; }); return { minX: Math.min.apply(null, e), maxX: Math.max.apply(null, e), minY: Math.min.apply(null, n), maxY: Math.max.apply(null, n), }; }, r = function (t) { for (var e = [], n = t.length, r = 0; r < n - 1; r++) { var i = t[r], o = t[r + 1]; e.push({ from: { x: i[0], y: i[1] }, to: { x: o[0], y: o[1] }, }); } if (e.length > 1) { var a = t[0], s = t[n - 1]; e.push({ from: { x: s[0], y: s[1] }, to: { x: a[0], y: a[1] }, }); } return e; }; if (t.length < 2 || e.length < 2) return !1; var i = n(t), o = n(e); if (!Gn(i, o)) return !1; var a = !1; if ( (Object(gt.e)(e, function (e) { if (Wn(t, e[0], e[1])) return (a = !0), !1; }), a) ) return !0; if ( (Object(gt.e)(t, function (t) { if (Wn(e, t[0], t[1])) return (a = !0), !1; }), a) ) return !0; var s = r(t), u = r(e), c = !1; return ( Object(gt.e)(u, function (t) { if ( (function (t, e) { var n = !1; return ( Object(gt.e)(t, function (t) { if (jn(t.from, t.to, e.from, e.to)) return (n = !0), !1; }), n ); })(s, t) ) return (c = !0), !1; }), c ); }, Hn = (function () { function t(t, e, n, r) { (this.x1 = t), (this.y1 = e), (this.x2 = n), (this.y2 = r); } return ( (t.prototype.getBBox = function () { var t = Math.min(this.x1, this.x2), e = Math.min(this.y1, this.y2), n = Math.max(this.x1, this.x2), r = Math.max(this.y1, this.y2); return { x: t, y: e, minX: t, minY: e, maxX: n, maxY: r, width: n - t, height: r - e, }; }), t ); })(), Vn = function (t, e) { return { top: [t.minX, t.minY, t.maxX, t.minY], left: [t.minX, t.minY, t.minX, t.maxY], bottom: [t.minX, t.maxY, t.maxX, t.maxY], right: [t.maxX, t.minY, t.maxX, t.maxY], }[e]; }, Un = function (t, e) { var n = (e.x2 - e.x1) * (t.y1 - e.y1) - (e.y2 - e.y1) * (t.x1 - e.x1), r = (t.x2 - t.x1) * (t.y1 - e.y1) - (t.y2 - t.y1) * (t.x1 - e.x1), i = (e.y2 - e.y1) * (t.x2 - t.x1) - (e.x2 - e.x1) * (t.y2 - t.y1); if (i) { var o = n / i, a = r / i; if (o >= 0 && o <= 1 && a >= 0 && a <= 1) return o; } return Number.POSITIVE_INFINITY; }, Zn = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = 0, o = [], a = 0; a < 4; a++ ) { var s = Vn(r, n[a]), u = s[0], c = s[1], h = s[2], l = s[3]; (o[a] = jn( { x: e.x1, y: e.y1 }, { x: e.x2, y: e.y2 }, { x: u, y: c }, { x: h, y: l }, )), o[a] && (i += 1); } return [o, i]; }, Kn = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = Number.POSITIVE_INFINITY, o = 0, a = 0; a < 4; a++ ) { var s = Vn(r, n[a]), u = s[0], c = s[1], h = s[2], l = s[3], d = Un(e, new Hn(u, c, h, l)); (d = Math.abs(d - 0.5)) >= 0 && d <= 1 && ((o += 1), (i = d < i ? d : i)); } return 0 === o ? -1 : i; }, Qn = function (t) { var e = 0, n = 0; if (t.length > 0) { for (var r = 0, i = t; r < i.length; r++) { var o = i[r]; (e += o.x), (n += o.y); } (e /= t.length), (n /= t.length); } return { x: e, y: n }; }, $n = function (t, e) { return Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2); }, Jn = function (t, e) { var n, r = e.x1, i = e.y1, o = e.x2 - r, a = e.y2 - i, s = t.x - r, u = t.y - i, c = s * o + u * a; n = c <= 0 || (c = (s = o - s) * o + (u = a - u) * a) <= 0 ? 0 : (c * c) / (o * o + a * a); var h = s * s + u * u - n; return h < 0 && (h = 0), h; }, tr = function (t, e, n) { return ( void 0 === n && (n = 0.001), Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2) < Math.pow(n, 2) ); }, er = function (t, e) { var n = t.x < e.x, r = t.x > e.x + e.width, i = t.y > e.y + e.height, o = t.y < e.y; if (!(n || r || i || o)) return 0; if (i && !n && !r) return Math.pow(e.y + e.height - t.y, 2); if (o && !n && !r) return Math.pow(t.y - e.y, 2); if (n && !i && !o) return Math.pow(e.x - t.x, 2); if (r && !i && !o) return Math.pow(e.x + e.width - t.x, 2); var a = Math.min(Math.abs(e.x - t.x), Math.abs(e.x + e.width - t.x)), s = Math.min(Math.abs(e.y - t.y), Math.abs(e.y + e.height - t.y)); return a * a + s * s; }, nr = function (t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], a = e.x, s = e.y, u = [i - n, o - r]; if (sn.c.exactEquals(u, [0, 0])) return NaN; var c = [-u[1], u[0]]; sn.c.normalize(c, c); var h = [a - n, s - r]; return Math.abs(sn.c.dot(h, c)); }, rr = "rgb(95, 149, 255)", ir = "rgb(253, 253, 253)", or = "rgb(247, 250, 255)", ar = "rgb(224, 224, 224)", sr = "rgb(224, 224, 224)", ur = { version: "0.3.0", rootContainerClassName: "root-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: rr, fill: "rgb(239, 244, 255)" }, size: 20, color: rr, linkPoints: { size: 8, lineWidth: 1, fill: or, stroke: rr }, }, nodeStateStyles: { active: { fill: or, stroke: rr, lineWidth: 2, shadowColor: rr, shadowBlur: 10, }, selected: { fill: "rgb(255, 255, 255)", stroke: rr, lineWidth: 4, shadowColor: rr, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: "rgb(223, 234, 255)", stroke: "#4572d9", lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: "rgb(247, 250, 255)", stroke: "rgb(191, 213, 255)", lineWidth: 1, }, disable: { fill: "rgb(250, 250, 250)", stroke: "rgb(224, 224, 224)", lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: ar, lineAppendWidth: 2 }, color: ar, }, edgeStateStyles: { active: { stroke: rr, lineWidth: 1 }, selected: { stroke: rr, lineWidth: 2, shadowColor: rr, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: rr, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(234, 234, 234)", lineWidth: 1 }, disable: { stroke: "rgb(245, 245, 245)", lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12, }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: ir, lineWidth: 1, stroke: sr, r: 5, width: 20, height: 10, }, size: [20, 5], color: sr, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: rr, lineWidth: 1, fill: "rgb(247, 250, 255)" }, selected: { stroke: rr, lineWidth: 2, fill: ir, shadowColor: rr, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: "#4572d9", lineWidth: 2, fill: ir, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(224, 224, 224)", fill: ir, lineWidth: 1 }, disable: { stroke: "rgb(234, 234, 234)", fill: "rgb(250, 250, 250)", lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, }, cr = { " ": 0.3329986572265625, a: 0.5589996337890625, A: 0.6569992065429687, b: 0.58599853515625, B: 0.6769989013671875, c: 0.5469985961914062, C: 0.7279998779296875, d: 0.58599853515625, D: 0.705999755859375, e: 0.554998779296875, E: 0.63699951171875, f: 0.37299957275390627, F: 0.5769989013671875, g: 0.5909988403320312, G: 0.7479995727539063, h: 0.555999755859375, H: 0.7199996948242188, i: 0.255999755859375, I: 0.23699951171875, j: 0.26699981689453123, J: 0.5169998168945312, k: 0.5289993286132812, K: 0.6899993896484375, l: 0.23499908447265624, L: 0.5879989624023437, m: 0.854998779296875, M: 0.8819992065429687, n: 0.5589996337890625, N: 0.7189987182617188, o: 0.58599853515625, O: 0.7669998168945312, p: 0.58599853515625, P: 0.6419998168945312, q: 0.58599853515625, Q: 0.7669998168945312, r: 0.3649993896484375, R: 0.6759994506835938, s: 0.504998779296875, S: 0.6319992065429687, t: 0.354998779296875, T: 0.6189987182617187, u: 0.5599990844726562, U: 0.7139999389648437, v: 0.48199920654296874, V: 0.6389999389648438, w: 0.754998779296875, W: 0.929998779296875, x: 0.5089996337890625, X: 0.63699951171875, y: 0.4959991455078125, Y: 0.66199951171875, z: 0.48699951171875, Z: 0.6239990234375, 0: 0.6, 1: 0.40099945068359377, 2: 0.6, 3: 0.6, 4: 0.6, 5: 0.6, 6: 0.6, 7: 0.5469985961914062, 8: 0.6, 9: 0.6, "[": 0.3329986572265625, "]": 0.3329986572265625, ",": 0.26399993896484375, ".": 0.26399993896484375, ";": 0.26399993896484375, ":": 0.26399993896484375, "{": 0.3329986572265625, "}": 0.3329986572265625, "\\": 0.5, "|": 0.19499969482421875, "=": 0.604998779296875, "+": 0.604998779296875, "-": 0.604998779296875, _: 0.5, "`": 0.3329986572265625, " ~": 0.8329986572265625, "!": 0.3329986572265625, "@": 0.8579986572265625, "#": 0.6, $: 0.6, "%": 0.9699996948242188, "^": 0.517999267578125, "&": 0.7259994506835937, "*": 0.505999755859375, "(": 0.3329986572265625, ")": 0.3329986572265625, "<": 0.604998779296875, ">": 0.604998779296875, "/": 0.5, "?": 0.53699951171875, }, hr = Math.PI, lr = Math.sin, dr = Math.cos, fr = lr(hr / 8), pr = dr(hr / 8), gr = function (t, e) { var n = t.getBBox(), r = { x: n.minX, y: n.minY }, i = { x: n.maxX, y: n.maxY }; if (e) { var o = e.getMatrix(); o || (o = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = Tn(r, o)), (i = Tn(i, o)); } var a = r.x, s = r.y, u = i.x, c = i.y; return { x: a, y: s, minX: a, minY: s, maxX: u, maxY: c, width: u - a, height: c - s, }; }, yr = function (t) { var e = t.sourceNode || t.targetNode, n = e.get("group").getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e.getKeyShape().getBBox(), i = t.loopCfg || {}, o = i.dist || 2 * Math.max(r.width, r.height), a = i.position || ur.defaultLoopPosition, s = [n[6], n[7]], u = [t.startPoint.x, t.startPoint.y], c = [t.endPoint.x, t.endPoint.y], h = r.height / 2, l = r.height / 2, d = h * fr, f = h * pr, p = l * fr, g = l * pr; if (u[0] === c[0] && u[1] === c[1]) { switch (a) { case "top": (u = [s[0] - d, s[1] - f]), (c = [s[0] + p, s[1] - g]); break; case "top-right": (h = r.height / 2), (l = r.width / 2), (u = [s[0] + (d = h * fr), s[1] - (f = h * pr)]), (c = [s[0] + (g = l * pr), s[1] - (p = l * fr)]); break; case "right": (h = r.width / 2), (l = r.width / 2), (u = [s[0] + (f = h * pr), s[1] - (d = h * fr)]), (c = [s[0] + (g = l * pr), s[1] + (p = l * fr)]); break; case "bottom-right": (h = r.width / 2), (l = r.height / 2), (u = [s[0] + (f = h * pr), s[1] + (d = h * fr)]), (c = [s[0] + (p = l * fr), s[1] + (g = l * pr)]); break; case "bottom": (h = r.height / 2), (l = r.height / 2), (u = [s[0] + (d = h * fr), s[1] + (f = h * pr)]), (c = [s[0] - (p = l * fr), s[1] + (g = l * pr)]); break; case "bottom-left": (h = r.height / 2), (l = r.width / 2), (u = [s[0] - (d = h * fr), s[1] + (f = h * pr)]), (c = [s[0] - (g = l * pr), s[1] + (p = l * fr)]); break; case "left": (h = r.width / 2), (l = r.width / 2), (u = [s[0] - (f = h * pr), s[1] + (d = h * fr)]), (c = [s[0] - (g = l * pr), s[1] - (p = l * fr)]); break; case "top-left": (h = r.width / 2), (l = r.height / 2), (u = [s[0] - (f = h * pr), s[1] - (d = h * fr)]), (c = [s[0] - (p = l * fr), s[1] - (g = l * pr)]); break; default: (h = r.width / 2), (l = r.width / 2), (u = [s[0] - (d = h * fr), s[1] - (f = h * pr)]), (c = [s[0] + (p = l * fr), s[1] - (g = l * pr)]); } if (!1 === i.clockwise) { var y = [u[0], u[1]]; (u = [c[0], c[1]]), (c = [y[0], y[1]]); } } var v = [u[0] - s[0], u[1] - s[1]], m = (h + o) / h, b = (l + o) / l; !1 === i.clockwise && ((m = (l + o) / l), (b = (h + o) / h)); var x = sn.c.scale([0, 0], v, m), w = [s[0] + x[0], s[1] + x[1]], O = [c[0] - s[0], c[1] - s[1]], M = sn.c.scale([0, 0], O, b), S = [s[0] + M[0], s[1] + M[1]]; return ( (t.startPoint = { x: u[0], y: u[1] }), (t.endPoint = { x: c[0], y: c[1] }), (t.controlPoints = [ { x: w[0], y: w[1] }, { x: S[0], y: S[1] }, ]), t ); }, vr = function (t, e, n, r, i) { var o = [], a = t.getPoint(e); if (null === a) return { x: 0, y: 0, angle: 0 }; if (e < 1e-4) o = t.getStartTangent().reverse(); else if (e > 0.9999) o = t.getEndTangent(); else { var s = t.getPoint(e + 1e-4); o.push([a.x, a.y]), o.push([s.x, s.y]); } var u = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]); if ( (u < 0 && (u += 2 * hr), n && ((a.x += dr(u) * n), (a.y += lr(u) * n)), r) ) { var c = u - hr / 2; u > 0.5 * hr && u < 1.5 * hr && (c -= hr), (a.x += dr(c) * r), (a.y += lr(c) * r); } var l = { x: a.x, y: a.y, angle: u }; return i ? (u > 0.5 * hr && u < 1.5 * hr && (u -= hr), Object(h.a)({ rotate: u }, l)) : l; }, mr = function t(e, n) { if (!1 === n(e)) return !1; if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return !1; return !0; }, br = function (t, e) { "function" == typeof e && mr(t, e); }, xr = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !1 !== n(e); })(t, e); }, wr = function (t, e) { return e * (cr[t] || 1); }, Or = function (t, e) { var n = 0, r = new RegExp("[一-龥]+"); return ( t.split("").forEach(function (t) { r.test(t) ? (n += e) : (n += wr(t, e)); }), [n, e] ); }, Mr = function (t, e) { var n = [], r = {}, i = {}; t.forEach(function (t) { i[t.id] = t; }), t.forEach(function (t, e) { var o = Object(gt.b)(t); (o.itemType = "combo"), (o.children = void 0), o.parentId === o.id ? (console.warn( "The parentId for combo " + o.id + " can not be the same as the combo's id", ), delete o.parentId) : o.parentId && !i[o.parentId] && (console.warn( "The parent combo for combo " + o.id + " does not exist!", ), delete o.parentId); var a = r[o.id]; if (a) { if ( ((o.children = a.children), (r[o.id] = o), !(a = o).parentId) ) return void n.push(a); var s = r[a.parentId]; if (s) s.children ? s.children.push(o) : (s.children = [o]); else { var u = { id: a.parentId, children: [a] }; (r[a.parentId] = u), (r[o.id] = o); } } else if (Object(gt.x)(t.parentId)) { var c = r[t.parentId]; if (c) c.children ? c.children.push(o) : (c.children = [o]), (r[o.id] = o); else { var h = { id: t.parentId, children: [o] }; (r[h.id] = h), (r[o.id] = o); } } else n.push(o), (r[o.id] = o); }); var o = {}; (e || []).forEach(function (t) { o[t.id] = t; var e = r[t.comboId]; if (e) { var n = { id: t.id, comboId: t.comboId }; e.children ? e.children.push(n) : (e.children = [n]), (n.itemType = "node"), (r[t.id] = n); } }); var a = 0; return ( n.forEach(function (t) { (t.depth = a + 10), mr(t, function (t) { var e, n = r[t.id].itemType; (e = "node" === n ? r[t.comboId] : r[t.parentId]), (t.depth = e && "node" === n ? a + 1 : a + 10), a < t.depth && (a = t.depth); var i = o[t.id]; return i && (i.depth = t.depth), !0; }); }), n ); }, Sr = function (t, e, n) { var r, i = t, o = { root: { children: t } }, a = !1, s = "root"; (t || []).forEach(function (t) { if (!a) return t.id === e ? ((r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), void (a = !0)) : void br(t, function (t) { return ( (o[t.id] = { children: t.children }), (i = o[t.parentId || t.comboId || "root"].children), !t || (!t.removed && e !== t.id) || !i || ((s = t.parentId || t.comboId || "root"), (r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), (a = !0), !1) ); }); }); var u = (i = o[s].children) ? i.indexOf(r) : -1; if ( (u > -1 && i.splice(u, 1), a || ((r = { id: e, itemType: "node", comboId: n }), (o[e] = { children: void 0 })), e) ) { var c = !1; if (n) { var h = 0; (t || []).forEach(function (t) { c || br(t, function (t) { return ( n !== t.id || ((c = !0), t.children ? t.children.push(r) : (t.children = [r]), (h = t.depth), "node" === r.itemType ? (r.depth = h + 2) : (r.depth = h + 1), !1) ); }); }); } else (n && c) || "node" === r.itemType || t.push(r); var l = r.depth; br(r, function (t) { return ( "node" === t.itemType ? (l += 2) : (l += 1), (t.depth = l), !0 ); }); } return t; }, Cr = function (t, e) { var n = { minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0, x: void 0, y: void 0, width: void 0, height: void 0, centerX: void 0, centerY: void 0, }; return t && 0 !== t.length ? (t.forEach(function (t) { var r = e.findById(t.id); if (r && r.isVisible()) { r.set("bboxCanvasCache", void 0); var i = r.getCanvasBBox(); i.x && n.minX > i.minX && (n.minX = i.minX), i.y && n.minY > i.minY && (n.minY = i.minY), i.x && n.maxX < i.maxX && (n.maxX = i.maxX), i.y && n.maxY < i.maxY && (n.maxY = i.maxY); } }), (n.x = (n.minX + n.maxX) / 2), (n.y = (n.minY + n.maxY) / 2), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), Object.keys(n).forEach(function (t) { (n[t] !== 1 / 0 && n[t] !== -1 / 0) || (n[t] = void 0); }), n) : n; }, jr = function (t) { var e = Object(gt.t)(t.x) || Object(gt.t)(t.y) || t.type || t.anchorPoints || t.size; return ( t.style && (e = e || Object(gt.t)(t.style.r) || Object(gt.t)(t.style.width) || Object(gt.t)(t.style.height) || Object(gt.t)(t.style.rx) || Object(gt.t)(t.style.ry)), e ); }, kr = function (t) { var e = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n]; if (Object(gt.v)(r)) { var i = {}; Object.keys(r).forEach(function (t) { var e = r[t]; ("img" !== t || Object(gt.x)(e)) && (i[t] = Object(gt.b)(e)); }), (e[n] = i); } else e[n] = Object(gt.b)(r); }), e ); }, Er = function (t) { if (!t) return console.error("G6 Error Tips: the data must be defined"), !1; var e = t.nodes, n = t.edges, r = t.combos, i = void 0 === r ? [] : r; if (!e && !n) { var o = !0; return ( br(t, function (t) { return !!Object(gt.x)(t.id) || ((o = !1), !1); }), o ); } var a = (e || []).find(function (t) { return !Object(gt.x)(t.id); }); if (a) return ( console.warn( "G6 Warning Tips: missing 'id' property, or %c" + a.id + "%c is not a string.", "font-size: 20px; color: red;", "", ), !1 ); var s = (e || []).map(function (t) { return t.id; }), u = i.map(function (t) { return t.id; }), c = Object(h.f)(Object(h.f)([], s), u), l = (n || []).find(function (t) { return !c.includes(t.source) || !c.includes(t.target); }); return ( !l || (console.warn( "G6 Warning Tips: The source %c" + l.source + "%c or the target %c" + l.target + "%c of the edge do not exist in the nodes or combos.", "font-size: 20px; color: red;", "", "font-size: 20px; color: red;", "", ), !1) ); }, Nr = (function () { function t(t) { (this.graph = t), (this.destroyed = !1), (this.modes = t.get("modes") || { default: [] }), this.formatModes(), (this.mode = t.get("defaultMode") || "default"), (this.currentBehaves = []), this.setMode(this.mode); } return ( (t.prototype.formatModes = function () { var t = this.modes; Object(gt.e)(t, function (t) { Object(gt.e)(t, function (e, n) { Object(gt.x)(e) && (t[n] = { type: e }); }); }); }), (t.prototype.setBehaviors = function (t) { var e, n = this.graph, r = this.modes[t], i = []; Object(gt.e)(r || [], function (t) { var r = tn.getBehavior(t.type || t); r && (e = new r(t)) && (e.bind(n), i.push(e)); }), (this.currentBehaves = i); }), (t.mergeBehaviors = function (t, e) { return ( Object(gt.e)(e, function (e) { t.indexOf(e) < 0 && (Object(gt.x)(e) && (e = { type: e }), t.push(e)); }), t ); }), (t.filterBehaviors = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = ""; (r = Object(gt.x)(t) ? t : t.type), e.indexOf(r) < 0 && n.push(t); }), n ); }), (t.prototype.setMode = function (t) { var e = this.modes, n = this.graph, r = t; e[r] && (n.emit("beforemodechange", { mode: t }), Object(gt.e)(this.currentBehaves, function (t) { t.delegate && t.delegate.remove(), t.unbind(n); }), this.setBehaviors(r), n.emit("aftermodechange", { mode: t }), (this.mode = t)); }), (t.prototype.getMode = function () { return this.mode; }), (t.prototype.manipulateBehaviors = function (e, n, r) { var i, o = this; if (((i = Object(gt.m)(e) ? e : [e]), Object(gt.m)(n))) return ( Object(gt.e)(n, function (e) { o.modes[e] ? (o.modes[e] = r ? t.mergeBehaviors(o.modes[e] || [], i) : t.filterBehaviors(o.modes[e] || [], i)) : r && (o.modes[e] = i); }), this ); var a = n; return ( n || (a = this.mode), this.modes[a] || (r && (this.modes[a] = i)), (this.modes[a] = r ? t.mergeBehaviors(this.modes[a] || [], i) : t.filterBehaviors(this.modes[a] || [], i)), this.setMode(this.mode), this ); }), (t.prototype.updateBehavior = function (t, e, n) { Object(gt.x)(t) && (t = { type: t }); var r = []; if (n && n !== this.mode && "default" !== n) { if (!(r = this.modes[n]) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); var i = r.length; for (a = 0; a < i; a++) { if ((s = r[a]).type === t.type || s === t.type) return ( s === t.type && (s = { type: s }), Object.assign(s, e), (r[a] = s), this ); a === i - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } else { if (!(r = this.currentBehaves) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); for (var o = r.length, a = 0; a < o; a++) { var s; if ((s = r[a]).type === t.type) return s.updateCfg(e), this; a === o - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } return this; }), (t.prototype.destroy = function () { (this.graph = null), (this.modes = null), (this.currentBehaves = null), (this.destroyed = !0); }), t ); })(); function Tr(t, e) { if (t) for (var n in e) e.hasOwnProperty(n) && (t.style[n] = e[n]); return t; } var Pr = (function (t) { function e(e, n) { var r = t.call(this, e, n) || this; return ( (r.item = n.item), (r.canvasX = n.canvasX), (r.canvasY = n.canvasY), (r.detail = n.detail), r ); } return Object(h.c)(e, t), e; })(z.Event), Ir = function (t) { return t + "-" + Math.random() + Date.now(); }, Br = function (t) { var e = 0, n = 0, r = 0, i = 0; if (Object(gt.t)(t)) e = n = r = i = t; else if (Object(gt.x)(t)) { e = n = r = i = parseInt(t, 10); } else Object(gt.m)(t) && ((e = t[0]), (r = Object(gt.s)(t[1]) ? t[0] : t[1]), (i = Object(gt.s)(t[2]) ? t[0] : t[2]), (n = Object(gt.s)(t[3]) ? r : t[3])); return [e, r, i, n]; }, Ar = function (t) { var e = new Pr(t.type, t); return ( (e.clientX = t.clientX), (e.clientY = t.clientY), (e.x = t.x), (e.y = t.y), (e.target = t.target), (e.currentTarget = t.currentTarget), (e.bubbles = !0), (e.item = t.item), e ); }, Lr = function (t) { if (!t) return !1; for (var e = [1, 0, 0, 0, 1, 0, 0, 0, 1], n = 0; n < 9; n++) if (t[n] !== e[n]) return !0; return !1; }, Dr = function (t) { return Number.isNaN(Number(t)); }, _r = function (t) { for ( var e = 1 / 0, n = -1 / 0, r = 1 / 0, i = -1 / 0, o = 0; o < t.length; o++ ) { var a = t[o].getBBox(), s = a.minX, u = a.minY, c = a.maxX, h = a.maxY; s < e && (e = s), u < r && (r = u), c > n && (n = c), h > i && (i = h); } return { x: Math.floor(e), y: Math.floor(r), width: Math.ceil(n) - Math.floor(e), height: Math.ceil(i) - Math.floor(r), minX: e, minY: r, maxX: n, maxY: i, }; }, Rr = function (t, e, n, r, i) { void 0 === e && (e = 15), void 0 === n && (n = "quadratic"), void 0 === r && (r = void 0), void 0 === i && (i = void 0); for ( var o = t.length, a = 2 * e, s = [ "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ], u = {}, c = [], h = {}, l = 0; l < o; l++ ) { var d = t[l], f = d.source, p = d.target, g = f + "-" + p; if (!c[l]) { u[g] || (u[g] = []), (c[l] = !0), u[g].push(d); for (var y = 0; y < o; y++) if (l !== y) { var v = t[y], m = v.source, b = v.target; c[y] || (f === b && p === m ? (u[g].push(v), (c[y] = !0), (h[m + "|" + b + "|" + (u[g].length - 1)] = !0)) : f === m && p === b && (u[g].push(v), (c[y] = !0))); } } } for (var x in u) for (var w = u[x], O = w.length, M = 0; M < O; M++) { var S = w[M]; if (S.source !== S.target) if (1 === O && r && S.source !== S.target) S.type = r; else { S.type = n; var C = (M % 2 == 0 ? 1 : -1) * (h[S.source + "|" + S.target + "|" + M] ? -1 : 1); S.curveOffset = O % 2 == 1 ? C * Math.ceil(M / 2) * a : C * (Math.floor(M / 2) * a + e); } else i && (S.type = i), (S.loopCfg = { position: s[M % 8], dist: 20 * Math.floor(M / 8) + 50, }); } return t; }, Yr = (function () { function t(t) { (this.destroyed = !1), (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.getViewCenter = function () { var t = this.getFormatPadding(), e = this.graph, n = this.graph.get("width"), r = e.get("height"); return { x: (n - t[1] - t[3]) / 2 + t[3], y: (r - t[0] - t[2]) / 2 + t[0], }; }), (t.prototype.fitCenter = function () { var t = this.graph, e = t.get("group"); e.resetMatrix(); var n = e.getCanvasBBox(); if (0 !== n.width && 0 !== n.height) { var r = this.getViewCenter(), i = n.x + n.width / 2, o = n.y + n.height / 2; t.translate(r.x - i, r.y - o); } }), (t.prototype.fitView = function () { var t = this.graph, e = this.getFormatPadding(), n = t.get("width"), r = t.get("height"), i = t.get("group"); i.resetMatrix(); var o = i.getCanvasBBox(); if (0 !== o.width && 0 !== o.height) { var a = this.getViewCenter(), s = o.x + o.width / 2, u = o.y + o.height / 2; t.translate(a.x - s, a.y - u); var c = (n - e[1] - e[3]) / o.width, h = (r - e[0] - e[2]) / o.height, l = c; c > h && (l = h), t.zoom(l, a); } }), (t.prototype.getFormatPadding = function () { var t = this.graph.get("fitViewPadding"); return Br(t); }), (t.prototype.focusPoint = function (t, e, n) { var r = this, i = this.getViewCenter(), o = this.getPointByCanvas(i.x, i.y), a = this.graph.get("group").getMatrix(); if ((a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), e)) { var s = (o.x - t.x) * a[0], u = (o.y - t.y) * a[4], c = 0, l = 0, d = 0, f = 0; this.graph.get("canvas").animate( function (t) { (d = s * t), (f = u * t), r.graph.translate(d - c, f - l), (c = d), (l = f); }, Object(h.a)({}, n), ); } else this.graph.translate((o.x - t.x) * a[0], (o.y - t.y) * a[4]); }), (t.prototype.getPointByCanvas = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), Pn({ x: t, y: e }, n) ); }), (t.prototype.getPointByClient = function (t, e) { var n = this.graph.get("canvas").getPointByClient(t, e); return this.getPointByCanvas(n.x, n.y); }), (t.prototype.getClientByPoint = function (t, e) { var n = this.graph.get("canvas"), r = this.getCanvasByPoint(t, e), i = n.getClientByPoint(r.x, r.y); return { x: i.x, y: i.y }; }), (t.prototype.getCanvasByPoint = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), Tn({ x: t, y: e }, n) ); }), (t.prototype.focus = function (t, e, n) { if ((Object(gt.x)(t) && (t = this.graph.findById(t)), t)) { var r = 0, i = 0; if (t.getType && "edge" === t.getType()) { var o = t.getSource().get("group").getMatrix(), a = t.getTarget().get("group").getMatrix(); o && a ? ((r = (o[6] + a[6]) / 2), (i = (o[7] + a[7]) / 2)) : (o || a) && ((r = o ? o[6] : a[6]), (i = o ? o[7] : a[7])); } else { var s = t.get("group").getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = s[6]), (i = s[7]); } this.focusPoint({ x: r, y: i }, e, n); } }), (t.prototype.changeSize = function (t, e) { var n = this.graph; if (!Object(gt.t)(t) || !Object(gt.t)(e)) throw Error( "invalid canvas width & height, please make sure width & height type is number", ); n.set({ width: t, height: e }), n.get("canvas").changeSize(t, e), n.get("plugins").forEach(function (r) { if (r.get("gridContainer")) { var i = n.get("minZoom"); Tr(r.get("container"), { width: t + "px", height: e + "px", }), Tr(r.get("gridContainer"), { width: t / i + "px", height: e / i + "px", left: 0, top: 0, }); } }); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !1); }), t ); })(); function Fr(t) { return (Fr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function zr(t) { if ("string" != typeof t) return t; var e = function (t) { if ("string" != typeof t) return t; try { return JSON.parse(t.trim()); } catch (e) { return t.trim(); } }, n = e(t); if ("string" != typeof n) return n; for ( var r = function (t) { return t[t.length - 1]; }, i = t.trim(), o = [], a = [], s = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return t.some(function (t) { return r(a) === t; }); }, u = null, c = 0, h = ""; c < i.length; ) { var l = i[c], d = s('"', "'"); if (d || l.trim()) { var f = "\\" === i[c - 1], p = s("}"), g = s("]"), y = s(","), v = r(o); if (d) if (r(a) !== l || f) h += l; else { a.pop(); var m = e(h); v.push(m), (u = m), (h = ""); } else if (g && "," === l) h && (v.push(e(h)), (h = "")); else if (p && ":" === l) a.push(","), h && (v.push(h), (h = "")); else if (y && "," === l) h && (v.push(e(h)), (h = "")), a.pop(); else if ("}" === l && (p || y)) { h && (v.push(e(h)), (h = "")), y && a.pop(); for (var b = {}, x = 1; x < v.length; x += 2) b[v[x - 1]] = v[x]; o.pop(), o.length && r(o).push(b), a.pop(), (u = b); } else "]" === l && g ? (h && (v.push(e(h)), (h = "")), o.pop(), o.length && r(o).push(v), a.pop(), (u = v)) : "{" === l ? (o.push([]), a.push("}")) : "[" === l ? (o.push([]), a.push("]")) : '"' === l ? a.push('"') : "'" === l ? a.push("'") : (h += l); c += 1; } else c += 1; } return u || h; } function Xr(t, e) { var n; void 0 === e && (e = { x: 0, y: 0 }); var r = Object(h.a)({ x: 0, y: 0, width: 0, height: 0 }, e); if (null === (n = t.children) || void 0 === n ? void 0 : n.length) { var i = t.attrs, o = void 0 === i ? {} : i, a = o.marginTop, s = Object(h.a)({}, e); a && (s.y += a); for (var u = 0; u < t.children.length; u++) { t.children[u].attrs.key = (o.key || "root") + " -" + u + " "; var c = Xr(t.children[u], s); if (c.bbox) { var l = c.bbox; "inline" === c.attrs.next ? (s.x += c.bbox.width) : (s.y += c.bbox.height), l.width + l.x > r.width && (r.width = l.width + l.x), l.height + l.y > r.height && (r.height = l.height + l.y); } } } return ( (t.bbox = (function (t, e, n) { var r, i, o = t.attrs, a = void 0 === o ? {} : o, s = { x: e.x || 0, y: e.y || 0, width: n.width || 0, height: n.height || 0, }; switch (t.type) { case "maker": case "circle": a.r && ((i = 2 * a.r), (r = 2 * a.r)); break; case "text": a.text && ((i = Or(a.text, a.fontSize || 12)[0]), (r = 16), (s.y += r), (s.height = r), (s.width = i), (t.attrs = Object(h.a)({ fontSize: 12, fill: "#000" }, a))); break; default: a.width && (i = a.width), a.height && (r = a.height); } return ( r >= 0 && (s.height = r), i >= 0 && (s.width = i), a.marginTop && (s.y += a.marginTop), a.marginLeft && (s.x += a.marginLeft), s ); })(t, e, r)), (t.attrs = Object(h.a)(Object(h.a)({}, t.attrs), t.bbox)), t ); } function Wr(t) { var e = {}, n = function (e) { var n = (function (t) { return function (e) { for (var n = t.length, r = [], i = 0, o = ""; i < n; ) if ("{" === t[i] && "{" === t[i + 1]) r.push(o), (o = ""), (i += 2); else if ("}" === t[i] && "}" === t[i + 1]) { if (r.length) { var a = r.pop(); (o = Object(gt.h)( e, o, a.endsWith("=") ? '"{' + o + '}"' : o, )), r.push(a + o); } (i += 2), (o = ""); } else (o += t[i]), (i += 1); return ( r.push(o), r .map(function (t, e) { return r[e - 1] && r[e - 1].endsWith("=") ? '"{' + t + '}"' : t; }) .join("") ); }; })("function" == typeof t ? t(e) : t)(e), r = document.createElement("div"); r.innerHTML = n; var i = Xr( (function t(e, n) { var r = {}, i = (e.getAttributeNames && e.getAttributeNames()) || [], o = e.children && Array.from(e.children).map(function (e) { return t(e, n); }), a = {}, s = e.tagName ? e.tagName.toLowerCase() : "group"; return ( "text" === s && (r.text = e.innerText), (a.type = s), "img" === s && (a.type = "image"), Array.from(i).forEach(function (t) { var n = t.split("-").reduce(function (t, e) { return t + e.charAt(0).toUpperCase() + e.slice(1); }), i = e.getAttribute(t); try { if ("style" === n || "attrs" === n) { var o = zr(i); r = Object(h.a)(Object(h.a)({}, r), o); } else a[n] = zr(i); } catch (t) { if ("style" === n) throw t; a[n] = i; } }), (a.attrs = r), n && n.style && a.name && "object" === Fr(n.style[a.name]) && (a.attrs = Object(h.a)( Object(h.a)({}, a.attrs), n.style[a.name], )), n && n.style && a.keyshape && (a.attrs = Object(h.a)(Object(h.a)({}, a.attrs), n.style)), o.length && (a.children = o), a ); })(r.children[0], e), ); return r.remove(), i; }; return { draw: function (t, r) { var i = n(t), o = r; return ( (function t(e) { var n = e.attrs, i = void 0 === n ? {} : n, a = e.bbox, s = e.type, u = e.children, c = Object(h.e)(e, ["attrs", "bbox", "type", "children"]); if ("group" !== e.type) { var l = r.addShape( e.type, Object(h.a)( { attrs: i, origin: { bbox: a, type: s, children: u } }, c, ), ); e.keyshape && (o = l); } e.children && e.children.forEach(function (e) { return t(e); }); })(i), (e[t.id] = [i]), o ); }, update: function (t, r) { e[t.id] || (e[t.id] = []); var i = r.getContainer(), o = i.get("children"), a = n(t), s = (function t(e, n) { var r, i, o, a, s = (e || {}).type, u = ((null == n ? void 0 : n.attrs) || {}).key; if ((u && e && (e.attrs.key = u), !e && n)) return { action: "delete", val: n, type: s, key: u }; if (e && !n) return { action: "add", val: e, type: s }; if (!e && !n) return { action: "same", type: s }; var c = []; if ( (null === (r = e.children) || void 0 === r ? void 0 : r.length) > 0 || (null === (i = n.children) || void 0 === i ? void 0 : i.length) > 0 ) for ( var h = Math.max( null === (o = e.children) || void 0 === o ? void 0 : o.length, null === (a = n.children) || void 0 === a ? void 0 : a.length, ), l = n.children || [], d = e.children || [], f = 0; f < h; f += 1 ) c.push(t(d[f], l[f])); var p = Object.keys(n.attrs), g = Object.keys(e.attrs); return n.type !== e.type ? { action: "restructure", nowTarget: e, formerTarget: n, key: u, children: c, } : p .filter(function (t) { return "children" !== t; }) .some(function (t) { return e.attrs[t] !== n.attrs[t] || !g.includes(t); }) ? { action: "change", val: e, children: c, type: s, key: u } : { action: "same", children: c, type: s, key: u }; })(a, e[t.id].pop()), u = function t(e) { var n; "group" !== e.type && i.addShape(e.type, { attrs: e.attrs }), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }, c = function t(e) { var n, r = o.find(function (t) { return t.attrs.key === e.attrs.key; }); r && i.removeChild(r), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }; !(function t(e) { var n = e.key; if ("group" !== e.type) { var i = o.find(function (t) { return t.attrs.key === n; }); switch (e.action) { case "change": if (i) { var a = e.val.keyshape ? r.getOriginStyle() : {}; i.attr(Object(h.a)(Object(h.a)({}, a), e.val.attrs)); } break; case "add": u(e.val); break; case "delete": c(e.val); break; case "restructure": c(e.formerTarget), u(e.nowTarget); } } e.children && e.children.forEach(function (e) { return t(e); }); })(s), e[t.id].push(a); }, getAnchorPoints: function () { return [ [0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0], ]; }, }; } var Gr = {}; function qr(t) { return Gr[t] || (Gr[t] = Object(gt.J)(t)), Gr[t]; } var Hr = { defaultShapeType: "defaultType", className: null, getShape: function (t) { return ( this[t] || this[this.defaultShapeType] || this["simple-circle"] ); }, draw: function (t, e, n) { var r = this.getShape(t), i = r.draw(e, n); return r.afterDraw && r.afterDraw(e, n, i), i; }, baseUpdate: function (t, e, n) { var r = this.getShape(t); r.update && r.update(e, n), r.afterUpdate && r.afterUpdate(e, n); }, setState: function (t, e, n, r) { this.getShape(t).setState(e, n, r); }, shouldUpdate: function (t) { return !!this.getShape(t).update; }, getControlPoints: function (t, e) { return this.getShape(t).getControlPoints(e); }, getAnchorPoints: function (t, e) { return this.getShape(t).getAnchorPoints(e); }, }, Vr = { options: {}, draw: function (t, e) { return this.drawShape(t, e); }, drawShape: function () {}, afterDraw: function () {}, afterUpdate: function () {}, setState: function () {}, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { var e = this.options.anchorPoints; return t.anchorPoints || e; }, }, Ur = (function () { function t() {} return ( (t.registerFactory = function (e, n) { var r = qr(e), i = Hr, o = Object(h.a)(Object(h.a)({}, i), n); return (t[r] = o), (o.className = r), o; }), (t.getFactory = function (e) { return t[qr(e)]; }), (t.registerNode = function (e, n, r) { var i, o = t.Node; if ("string" == typeof n || "function" == typeof n) { var a = Wr(n); i = Object(h.a)(Object(h.a)({}, o.getShape("single-node")), a); } else if (n.jsx) { a = Wr(n.jsx); i = Object(h.a)( Object(h.a)(Object(h.a)({}, o.getShape("single-node")), a), n, ); } else { o.getShape(r); var s = r ? o.getShape(r) : Vr; i = Object(h.a)(Object(h.a)({}, s), n); } return (i.type = e), (i.itemType = "node"), (o[e] = i), i; }), (t.registerEdge = function (e, n, r) { var i = t.Edge, o = r ? i.getShape(r) : Vr, a = Object(h.a)(Object(h.a)({}, o), n); return (a.type = e), (a.itemType = "edge"), (i[e] = a), a; }), (t.registerCombo = function (e, n, r) { var i = t.Combo, o = r ? i.getShape(r) : Vr, a = Object(h.a)(Object(h.a)({}, o), n); return (a.type = e), (a.itemType = "combo"), (i[e] = a), a; }), t ); })(), Zr = Ur; Ur.registerFactory("node", { defaultShapeType: "circle" }), Ur.registerFactory("edge", { defaultShapeType: "line" }), Ur.registerFactory("combo", { defaultShapeType: "circle" }); var Kr = (function () { function t(t) { (this._cfg = {}), (this.destroyed = !1); var e = { id: void 0, type: "item", model: {}, group: void 0, animate: !1, visible: !0, locked: !1, event: !0, keyShape: void 0, states: [], }; this._cfg = Object.assign(e, this.getDefaultCfg(), t); var n = this.get("model"), r = n.id, i = this.get("type"); r || ((r = Ir(i)), (this.get("model").id = r)), this.set("id", r); var o = t.group; o && (o.set("item", this), o.set("id", r)), this.init(), this.draw(); var a = n.shape || n.type || ("edge" === i ? "line" : "circle"), s = this.get("shapeFactory"); if (s && s[a]) { var u = s[a].options; if (u && u.stateStyles) { var c = this.get("styles") || n.stateStyles; (c = Object(gt.d)({}, u.stateStyles, c)), this.set("styles", c); } } } return ( (t.prototype.calculateBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = gr(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.calculateCanvasBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = gr(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.drawInner = function () { var t = this.get("shapeFactory"), e = this.get("group"), n = this.get("model"); e.clear(); var r = n.visible; if ((void 0 === r || r || this.changeVisibility(r), t)) { this.updatePosition(n); var i = this.getShapeCfg(n), o = i.type, a = t.draw(o, i, e); a && (this.set("keyShape", a), a.set("isKeyShape", !0), a.set("draggable", !0)), this.setOriginStyle(), this.set("currentShape", o), this.restoreStates(t, o); } }), (t.prototype.setOriginStyle = function () { var t = this.get("group").get("children"), e = this.getKeyShape(), n = this, r = e.get("name"); if (this.get("originStyle")) { var i = this.getOriginStyle(); r && !i[r] && (i[r] = {}); var o = this.getCurrentStatesStyle(); Object(gt.e)(t, function (t) { var e = t.get("name"), a = t.attr(); if (e && e !== r) { var s = o[e]; i[e] || (i[e] = {}), s ? Object.keys(a).forEach(function (t) { var n = a[t]; n !== s[t] && (i[e][t] = n); }) : (i[e] = "image" !== t.get("type") ? Object(gt.b)(a) : n.getShapeStyleByName(e)); } else { var u = t.attr(), c = Object(h.a)(Object(h.a)({}, o), o[r]); Object.keys(u).forEach(function (t) { var e = u[t]; c[t] !== e && (r ? (i[r][t] = e) : (i[t] = e)); }); } }), i.path && delete i.path, i.matrix && delete i.matrix, i.x && delete i.x, i.y && delete i.y, i[r] && i[r].x && delete i[r].x, i[r] && i[r].y && delete i[r].y, n.set("originStyle", i); } else { var a = {}; Object(gt.e)(t, function (t) { var e = t.get("type"), i = t.get("name"); if (i && i !== r) a[i] = "image" !== e ? Object(gt.b)(t.attr()) : n.getShapeStyleByName(i); else { var o = n.getShapeStyleByName(); if ( (o.path && delete o.path, o.matrix && delete o.matrix, r) ) if (i) a[r] = o; else { var s = Ir("shape"); t.set("name", s), (a[s] = "image" !== e ? Object(gt.b)(t.attr()) : n.getShapeStyleByName(i)); } else Object.assign(a, o); } }), n.set("originStyle", a); } }), (t.prototype.restoreStates = function (t, e) { var n = this, r = n.get("states"); Object(gt.e)(r, function (r) { t.setState(e, r, !0, n); }); }), (t.prototype.init = function () { var t = Zr.getFactory(this.get("type")); this.set("shapeFactory", t); }), (t.prototype.get = function (t) { return this._cfg[t]; }), (t.prototype.set = function (t, e) { Object(gt.w)(t) ? (this._cfg = Object(h.a)(Object(h.a)({}, this._cfg), t)) : (this._cfg[t] = e); }), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null); }), (t.prototype.beforeDraw = function () {}), (t.prototype.afterDraw = function () {}), (t.prototype.afterUpdate = function () {}), (t.prototype.draw = function () { this.beforeDraw(), this.drawInner(), this.afterDraw(); }), (t.prototype.getShapeStyleByName = function (t) { var e, n = this.get("group"); if ( (e = t ? n.find(function (e) { return e.get("name") === t; }) : this.getKeyShape()) ) { var r = {}; return ( Object(gt.e)(e.attr(), function (t, e) { "img" !== e && (r[e] = t); }), r ); } return {}; }), (t.prototype.getShapeCfg = function (t) { var e = this.get("styles"); if (e) { var n = t; return (n.style = Object(h.a)(Object(h.a)({}, e), t.style)), n; } return t; }), (t.prototype.getStateStyle = function (t) { var e = this.get("styles"); return e && e[t]; }), (t.prototype.getOriginStyle = function () { return this.get("originStyle"); }), (t.prototype.getCurrentStatesStyle = function () { var t = this, e = {}, n = t.getStates(); return n && n.length ? (Object(gt.e)(t.getStates(), function (n) { e = Object.assign(e, t.getStateStyle(n)); }), e) : this.getOriginStyle(); }), (t.prototype.setState = function (t, e) { var n = this.get("states"), r = this.get("shapeFactory"), i = t, o = t; Object(gt.x)(e) && ((i = t + ":" + e), (o = t + ":")); var a = n; if (Object(gt.n)(e)) { var s = n.indexOf(o); if (e) { if (s > -1) return; n.push(i); } else s > -1 && n.splice(s, 1); } else if (Object(gt.x)(e)) { var u = n.filter(function (t) { return t.includes(o); }); u.length > 0 && this.clearStates(u), (a = a.filter(function (t) { return !t.includes(o); })).push(i), this.set("states", a); } if (r) { var c = this.get("model").type; r.setState(c, t, e, this); } }), (t.prototype.clearStates = function (t) { var e = this, n = e.getStates(), r = e.get("shapeFactory"), i = e.get("model").type; t || (t = n), Object(gt.x)(t) && (t = [t]); var o = n.filter(function (e) { return -1 === t.indexOf(e); }); e.set("states", o), t.forEach(function (t) { r.setState(i, t, !1, e); }); }), (t.prototype.getContainer = function () { return this.get("group"); }), (t.prototype.getKeyShape = function () { return this.get("keyShape"); }), (t.prototype.getModel = function () { return this.get("model"); }), (t.prototype.getType = function () { return this.get("type"); }), (t.prototype.getID = function () { return this.get("id"); }), (t.prototype.isItem = function () { return !0; }), (t.prototype.getStates = function () { return this.get("states"); }), (t.prototype.hasState = function (t) { return this.getStates().indexOf(t) >= 0; }), (t.prototype.refresh = function () { var t = this.get("model"); this.updatePosition(t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (t.prototype.isOnlyMove = function (t) { return !1; }), (t.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = n.x, a = n.y; (t.x = isNaN(t.x) ? n.x : t.x), (t.y = isNaN(t.y) ? n.y : t.y); var s = this.get("styles"); if (t.stateStyles) { var u = t.stateStyles; Object(gt.C)(s, u), delete t.stateStyles; } Object.assign(n, t), e ? this.updatePosition(t) : ((o === t.x && a === t.y) || this.updatePosition(t), this.updateShape()), this.afterUpdate(), this.clearCache(); }), (t.prototype.updateShape = function () { var t = this.get("shapeFactory"), e = this.get("model"), n = e.type; if (t.shouldUpdate(n) && n === this.get("currentShape")) { var r = this.getShapeCfg(e); t.baseUpdate(n, r, this), this.setOriginStyle(); } else this.draw(); this.restoreStates(t, n); }), (t.prototype.updatePosition = function (t) { var e = this.get("model"), n = Object(gt.s)(t.x) ? e.x : t.x, r = Object(gt.s)(t.y) ? e.y : t.y, i = this.get("group"); if (Object(gt.s)(n) || Object(gt.s)(r)) return !1; (e.x = n), (e.y = r); var o = i.getMatrix(); return ( (!o || o[6] !== n || o[7] !== r) && (i.resetMatrix(), _n(i, { x: n, y: r }), this.clearCache(), !0) ); }), (t.prototype.getBBox = function () { var t = this.get("bboxCache"); return ( t || ((t = this.calculateBBox()), this.set("bboxCache", t)), t ); }), (t.prototype.getCanvasBBox = function () { var t = this.get("bboxCanvasCache"); return ( t || ((t = this.calculateCanvasBBox()), this.set("bboxCanvasCache", t)), t ); }), (t.prototype.toFront = function () { this.get("group").toFront(); }), (t.prototype.toBack = function () { this.get("group").toBack(); }), (t.prototype.show = function () { this.changeVisibility(!0); }), (t.prototype.hide = function () { this.changeVisibility(!1); }), (t.prototype.changeVisibility = function (t) { var e = this.get("group"); t ? e.show() : e.hide(), this.set("visible", t); }), (t.prototype.isVisible = function () { return this.get("visible"); }), (t.prototype.enableCapture = function (t) { var e = this.get("group"); e && e.set("capture", t); }), (t.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), t ); })(), Qr = { source: "start", target: "end" }, $r = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "edge", sourceNode: null, targetNode: null, startPoint: null, endPoint: null, linkCenter: !1, }; }), (e.prototype.setEnd = function (t, e) { var n = Qr[t] + "Point", r = t + "Node", i = this.get(r); i && !i.destroyed && i.removeEdge(this), Object(gt.w)(e) ? (this.set(n, e), this.set(r, null)) : (e.addEdge(this), this.set(r, e), this.set(n, null)); }), (e.prototype.getLinkPoint = function (t, e, n) { var r = Qr[t] + "Point", i = t + "Node", o = this.get(r); if (!o) { var a = this.get(i), s = t + "Anchor", u = this.getPrePoint(t, n), c = e[s]; Object(gt.s)(c) || (o = a.getLinkPointByAnchor(c)), (o = o || a.getLinkPoint(u)), Object(gt.s)(o.index) || this.set(t + "AnchorIndex", o.index); } return o; }), (e.prototype.getPrePoint = function (t, e) { if (e && e.length) return e["source" === t ? 0 : e.length - 1]; var n = "source" === t ? "target" : "source"; return this.getEndPoint(n); }), (e.prototype.getEndPoint = function (t) { var e = t + "Node", n = Qr[t] + "Point", r = this.get(e); return r ? r.get("model") : this.get(n); }), (e.prototype.getControlPointsByCenter = function (t) { var e = this.getEndPoint("source"), n = this.getEndPoint("target"), r = this.get("shapeFactory"), i = t.type; return r.getControlPoints(i, { startPoint: e, endPoint: n }); }), (e.prototype.getEndCenter = function (t) { var e = t + "Node", n = Qr[t] + "Point", r = this.get(e); if (r) { var i = r.getBBox(); return { x: i.centerX, y: i.centerY }; } return this.get(n); }), (e.prototype.init = function () { t.prototype.init.call(this), this.setSource(this.get("source")), this.setTarget(this.get("target")); }), (e.prototype.getShapeCfg = function (e) { var n = this.get("linkCenter"), r = t.prototype.getShapeCfg.call(this, e); if (n) (r.startPoint = this.getEndCenter("source")), (r.endPoint = this.getEndCenter("target")); else { var i = r.controlPoints || this.getControlPointsByCenter(r); (r.startPoint = this.getLinkPoint("source", e, i)), (r.endPoint = this.getLinkPoint("target", e, i)); } return ( (r.sourceNode = this.get("sourceNode")), (r.targetNode = this.get("targetNode")), r ); }), (e.prototype.getModel = function () { var t = this.get("model"), e = this.get("sourceNode"), n = this.get("targetNode"); return ( e ? delete t.sourceNode : (t.source = this.get("startPoint")), n ? delete t.targetNode : (t.target = this.get("endPoint")), Object(gt.x)(t.source) || Object(gt.w)(t.source) || (t.source = t.source.getID()), Object(gt.x)(t.target) || Object(gt.w)(t.target) || (t.target = t.target.getID()), t ); }), (e.prototype.setSource = function (t) { this.setEnd("source", t), this.set("source", t); }), (e.prototype.setTarget = function (t) { this.setEnd("target", t), this.set("target", t); }), (e.prototype.getSource = function () { return this.get("source"); }), (e.prototype.getTarget = function () { return this.get("target"); }), (e.prototype.updatePosition = function () { return !1; }), (e.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = this.get("styles"); if (t.stateStyles) { var a = t.stateStyles; Object(gt.C)(o, a), delete t.stateStyles; } Object.assign(n, t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (e.prototype.destroy = function () { var e = this.get("sourceNode"), n = this.get("targetNode"); e && !e.destroyed && e.removeEdge(this), n && !n.destroyed && n.removeEdge(this), t.prototype.destroy.call(this); }), e ); })(Kr), Jr = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getNearestPoint = function (t, e) { for ( var n = 0, r = t[0], i = Bn(t[0], e), o = 0; o < t.length; o++ ) { var a = t[o], s = Bn(a, e); s < i && ((r = a), (i = s), (n = o)); } return (r.anchorIndex = n), r; }), (e.prototype.getDefaultCfg = function () { return { type: "node", edges: [] }; }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getInEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("target") === t; }); }), (e.prototype.getOutEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("source") === t; }); }), (e.prototype.getNeighbors = function (t) { var e = this, n = this.get("edges"); if ("target" === t) { return n .filter(function (t) { return t.getSource() === e; }) .map(function (t) { return t.getTarget(); }); } if ("source" === t) { return n .filter(function (t) { return t.getTarget() === e; }) .map(function (t) { return t.getSource(); }); } return n.map(function (t) { return t.getSource() === e ? t.getTarget() : t.getSource(); }); }), (e.prototype.getLinkPointByAnchor = function (t) { return this.getAnchorPoints()[t]; }), (e.prototype.getLinkPoint = function (t) { var e, n, r = this.get("keyShape").get("type"), i = this.get("type"), o = this.getBBox(); "combo" === i ? ((e = o.centerX || (o.maxX + o.minX) / 2), (n = o.centerY || (o.maxY + o.minY) / 2)) : ((e = o.centerX), (n = o.centerY)); var a, s = this.getAnchorPoints(); switch (r) { case "circle": a = En({ x: e, y: n, r: o.width / 2 }, t); break; case "ellipse": a = Nn({ x: e, y: n, rx: o.width / 2, ry: o.height / 2 }, t); break; default: a = kn(o, t); } var u = a; return ( s.length && (u || (u = t), (u = this.getNearestPoint(s, u))), u || (u = { x: e, y: n }), u ); }), (e.prototype.getAnchorPoints = function () { var t = this.get("anchorPointsCache"); if (!t) { t = []; var e = this.get("shapeFactory"), n = this.getBBox(), r = this.get("model"), i = this.getShapeCfg(r), o = r.type, a = e.getAnchorPoints(o, i) || []; Object(gt.e)(a, function (e, r) { var i = { x: n.minX + e[0] * n.width, y: n.minY + e[1] * n.height, anchorIndex: r, }; t.push(i); }), this.set("anchorPointsCache", t); } return t; }), (e.prototype.addEdge = function (t) { this.get("edges").push(t); }), (e.prototype.lock = function () { this.set("locked", !0); }), (e.prototype.unlock = function () { this.set("locked", !1); }), (e.prototype.hasLocked = function () { return this.get("locked"); }), (e.prototype.removeEdge = function (t) { var e = this.getEdges(), n = e.indexOf(t); n > -1 && e.splice(n, 1); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("anchorPointsCache", null); }), (e.prototype.isOnlyMove = function (t) { if (!t) return !1; var e = !Object(gt.s)(t.x), n = !Object(gt.s)(t.y), r = Object.keys(t); return (1 === r.length && (e || n)) || (2 === r.length && e && n); }), e ); })(Kr), ti = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "combo", nodes: [], edges: [], combos: [] }; }), (e.prototype.getShapeCfg = function (t) { var e = this.get("styles"), n = this.get("bbox"); if (e && n) { var r = t, i = { r: Math.hypot(n.height, n.width) / 2 || ur.defaultCombo.size[0] / 2, width: n.width || ur.defaultCombo.size[0], height: n.height || ur.defaultCombo.size[1], }; r.style = Object(h.a)( Object(h.a)(Object(h.a)({}, e), t.style), i, ); var o = t.padding || ur.defaultCombo.padding; return ( Object(gt.t)(o) ? ((i.r += o), (i.width += 2 * o), (i.height += 2 * o)) : ((i.r += o[0]), (i.width += o[1] + o[3] || 2 * o[1]), (i.height += o[0] + o[2] || 2 * o[0])), this.set("sizeCache", i), r ); } return t; }), (e.prototype.calculateCanvasBBox = function () { if (!this.destroyed) { var t = this.get("keyShape"), e = this.get("group"), n = gr(t, e); (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); var r = this.get("sizeCache"), i = this.get("bboxCache") || {}, o = i.x, a = i.x; if (r) (r.width = Math.max(r.width, n.width)), (r.height = Math.max(r.height, n.height)), "circle" === t.get("type") ? ((n.width = 2 * r.r), (n.height = 2 * r.r)) : ((n.width = r.width), (n.height = r.height)), (n.minX = n.centerX - n.width / 2), (n.minY = n.centerY - n.height / 2), (n.maxX = n.centerX + n.width / 2), (n.maxY = n.centerY + n.height / 2); else (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); return ( (n.x = n.minX), (n.y = n.minY), (n.x === o && n.y === a) || this.set("anchorPointsCache", null), n ); } }), (e.prototype.getChildren = function () { return { nodes: this.getNodes(), combos: this.getCombos() }; }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.addChild = function (t) { switch (t.getType()) { case "node": this.addNode(t); break; case "combo": this.addCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.addCombo = function (t) { return this.get("combos").push(t), !0; }), (e.prototype.addNode = function (t) { return this.get("nodes").push(t), !0; }), (e.prototype.removeChild = function (t) { switch (t.getType()) { case "node": this.removeNode(t); break; case "combo": this.removeCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.removeCombo = function (t) { if (t) { var e = this.getCombos(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.removeNode = function (t) { if (t) { var e = this.getNodes(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.isOnlyMove = function (t) { return !1; }), (e.prototype.getBBox = function () { return ( this.set("bboxCanvasCache", null), this.calculateCanvasBBox() ); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null), this.set("anchorPointsCache", null); }), (e.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), this.set("sizeCache", null), this.set("bbox", null), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), e ); })(Jr), ei = (function () { function t(t) { (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.addItem = function (t, e) { var n = this.graph, r = "vedge" === t ? "edge" : t, i = n.get(r + "Group") || n.get("group"), o = Object(gt.J)(r), a = null, s = n.get(r + Object(gt.J)("stateStyles")) || {}, u = n.get("default" + o); e.stateStyles && (s = e.stateStyles), u && Object(gt.e)(u, function (t, n) { Object(gt.v)(t) && !Object(gt.m)(t) ? (e[n] = Object(gt.d)({}, t, e[n])) : Object(gt.m)(t) ? (e[n] = e[n] || Object(gt.b)(u[n])) : (e[n] = e[n] || u[n]); }); var c = n.get(r + "Mapper"); if (c) { var h = c(e); h.stateStyles && ((s = h.stateStyles), delete h.stateStyles), Object(gt.e)(h, function (t, n) { Object(gt.v)(t) && !Object(gt.m)(t) ? (e[n] = Object(gt.d)({}, e[n], t)) : (e[n] = h[n] || e[n]); }); } if ( (n.emit("beforeadditem", { type: t, model: e }), "edge" === t || "vedge" === t) ) { var l = void 0, d = void 0; if ( ((l = e.source), (d = e.target), l && Object(gt.x)(l) && (l = n.findById(l)), d && Object(gt.x)(d) && (d = n.findById(d)), !l || !d) ) return void console.warn( "The source or target node of edge " + e.id + " does not exist!", ); l.getType && "combo" === l.getType() && (e.isComboEdge = !0), d.getType && "combo" === d.getType() && (e.isComboEdge = !0), (a = new $r({ model: e, source: l, target: d, styles: s, linkCenter: n.get("linkCenter"), group: i.addGroup(), })); } else if ("node" === t) a = new Jr({ model: e, styles: s, group: i.addGroup() }); else if ("combo" === t) { var f = e.children, p = Cr(f, n); isNaN(p.x) ? isNaN(e.x) && (e.x = 100 * Math.random()) : (e.x = p.x), isNaN(p.y) ? isNaN(e.y) && (e.y = 100 * Math.random()) : (e.y = p.y); var g = i.addGroup(); g.setZIndex(e.depth); var y = (a = new ti({ model: e, styles: s, bbox: e.collapsed ? Cr([], n) : p, group: g, })).getModel(); (f || []).forEach(function (t) { var e = n.findById(t.id); a.addChild(e), (t.depth = y.depth + 2); }), e.collapsed && setTimeout(function () { n.collapseCombo(a); }, 16); } if (a) return ( n.get(t + "s").push(a), (n.get("itemMap")[a.get("id")] = a), n.emit("afteradditem", { item: a, model: e }), a ); }), (t.prototype.updateItem = function (t, e) { var n, r, i = this.graph; if ((Object(gt.x)(t) && (t = i.findById(t)), t && !t.destroyed)) { var o = ""; t.getType && (o = t.getType()); var a = i.get(o + "Mapper"), s = t.getModel(), u = t.isOnlyMove(e); if (a) { var c = a(Object(gt.d)({}, s, e)), l = Object(gt.d)({}, s, c, e); c.stateStyles && (t.set("styles", l.stateStyles), delete l.stateStyles), Object(gt.e)(l, function (t, n) { e[n] = t; }); } else Object(gt.e)(e, function (t, n) { s[n] && Object(gt.v)(t) && !Object(gt.m)(t) && (e[n] = Object(h.a)(Object(h.a)({}, s[n]), e[n])); }); if ( (i.emit("beforeupdateitem", { item: t, cfg: e }), "edge" === o) ) { if (e.source) { var d = e.source; Object(gt.x)(d) && (d = i.findById(d)), t.setSource(d); } if (e.target) { var f = e.target; Object(gt.x)(f) && (f = i.findById(f)), t.setTarget(f); } t.update(e); } if ("node" === o || "combo" === o) { t.update(e, u); var p = t.getEdges(), g = jr(e); if (g && "node" === o) Object(gt.e)(p, function (t) { t.refresh(); }); else if (g && "combo" === o) { var y = t.get("shapeFactory"), v = s.type || "circle"; ( void 0 === s.animate || void 0 === e.animate ? null === (r = null === (n = y[v]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : s.animate || e.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && Object(gt.e)(p, function (t) { t && !t.destroyed && t.refresh(); }); } }, 201) : Object(gt.e)(p, function (t) { t.refresh(); }); } } i.emit("afterupdateitem", { item: t, cfg: e }); } }), (t.prototype.updateCombo = function (t, e) { var n, r, i = this, o = this.graph; if ((Object(gt.x)(t) && (t = o.findById(t)), t && !t.destroyed)) { var a = t.getModel(), s = Cr(a.collapsed ? [] : e, o); t.set("bbox", s), t.update({ x: s.x, y: s.y }); var u = t.get("shapeFactory"), c = a.type || "circle"; ( void 0 === a.animate ? null === (r = null === (n = u[c]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : a.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && (t.getShapeCfg(a), i.updateComboEdges(t)); } }, 201) : this.updateComboEdges(t); } }), (t.prototype.updateComboEdges = function (t) { for (var e = t.getEdges() || [], n = 0; n < e.length; n++) { var r = e[n]; if (r && !r.destroyed) { var i = r.get("shapeFactory"), o = r.getShapeCfg(r.getModel()), a = r.getContainer(); a.clear(); var s = i.draw(o.type, o, a); r.set("keyShape", s), s.set("isKeyShape", !0), s.set("draggable", !0), r.setOriginStyle(); } } }), (t.prototype.collapseCombo = function (t) { var e = this.graph; Object(gt.x)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.hideItem(t); }), n.combos.forEach(function (t) { e.hideItem(t); }); }), (t.prototype.expandCombo = function (t) { var e = this.graph; Object(gt.x)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.showItem(t); }), n.combos.forEach(function (t) { t.getModel().collapsed ? t.show() : e.showItem(t); }); }), (t.prototype.removeItem = function (t) { var e = this, n = this.graph; if ((Object(gt.x)(t) && (t = n.findById(t)), t && !t.destroyed)) { var r = Object(gt.b)(t.getModel()); n.emit("beforeremoveitem", { item: r }); var i = ""; t.getType && (i = t.getType()); var o = n.get(i + "s"), a = o.indexOf(t); if ((a > -1 && o.splice(a, 1), "edge" === i)) { var s = n.get("v" + i + "s"), u = s.indexOf(t); u > -1 && s.splice(u, 1); } var c = t.get("id"); delete n.get("itemMap")[c]; var h = n.get("comboTrees"), l = t.get("id"); if ("node" === i) { var d = t.getModel().comboId; if (h && d) { var f = h, p = !1; h.forEach(function (t) { p || br(t, function (t) { if (t.id === l && f) { var e = f.indexOf(t); return f.splice(e, 1), (p = !0), !1; } return (f = t.children), !0; }); }); } for (var g = (b = t.getEdges()).length - 1; g >= 0; g--) n.removeItem(b[g], !1); d && n.updateCombo(d); } else if ("combo" === i) { var y, v = t.getModel().parentId, m = !1; (h || []).forEach(function (t) { m || br(t, function (t) { return t.id !== l || ((y = t), (m = !0), !1); }); }), (y.removed = !0), y && y.children && y.children.forEach(function (t) { e.removeItem(t.id); }); var b; for (g = (b = t.getEdges()).length; g >= 0; g--) n.removeItem(b[g], !1); v && n.updateCombo(v); } t.destroy(), n.emit("afterremoveitem", { item: r }); } }), (t.prototype.setItemState = function (t, e, n) { var r = this.graph, i = e; Object(gt.x)(n) && (i = e + ":" + n), (t.hasState(i) === n && n) || (Object(gt.x)(n) && t.hasState(i)) || (r.emit("beforeitemstatechange", { item: t, state: i, enabled: n, }), t.setState(e, n), r.autoPaint(), r.emit("afteritemstatechange", { item: t, state: i, enabled: n, })); }), (t.prototype.priorityState = function (t, e) { var n = this.graph, r = t; Object(gt.x)(t) && (r = n.findById(t)), this.setItemState(r, e, !1), this.setItemState(r, e, !0); }), (t.prototype.clearItemStates = function (t, e) { var n = this.graph; Object(gt.x)(t) && (t = n.findById(t)), n.emit("beforeitemstatesclear", { item: t, states: e }), t.clearStates(e), n.emit("afteritemstatesclear", { item: t, states: e }); }), (t.prototype.refreshItem = function (t) { var e = this.graph; Object(gt.x)(t) && (t = e.findById(t)), e.emit("beforeitemrefresh", { item: t }), t.refresh(), e.emit("afteritemrefresh", { item: t }); }), (t.prototype.addCombos = function (t, e) { var n = this, r = this.graph; (t || []).forEach(function (t) { xr(t, function (t) { var r; return ( e.forEach(function (e) { e.id === t.id && ((e.children = t.children), (e.depth = t.depth), (r = e)); }), r && n.addItem("combo", r), !0 ); }); }); var i = r.get("comboGroup"); i && i.sort(); }), (t.prototype.changeItemVisibility = function (t, e) { var n = this, r = this.graph; if ((Object(gt.x)(t) && (t = r.findById(t)), t)) { if ( (r.emit("beforeitemvisibilitychange", { item: t, visible: e, }), t.changeVisibility(e), t.getType && "node" === t.getType()) ) { var i = t.getEdges(); Object(gt.e)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } else if (t.getType && "combo" === t.getType()) { var o = r.get("comboTrees"), a = t.get("id"), s = [], u = !1; (o || []).forEach(function (t) { u || (t.children && 0 !== t.children.length && br(t, function (t) { return t.id !== a || ((s = t.children), (u = !0), !1); })); }), s && (!e || (e && !t.getModel().collapsed)) && s.forEach(function (t) { var i = r.findById(t.id); n.changeItemVisibility(i, e); }); i = t.getEdges(); Object(gt.e)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } return ( r.emit("afteritemvisibilitychange", { item: t, visible: e }), t ); } console.warn("The item to be shown or hidden does not exist!"); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !0); }), t ); })(), ni = null, ri = (function () { function t(t) { (this.graph = t), (this.cachedStates = { enabled: {}, disabled: {} }), (this.destroyed = !1); } return ( (t.checkCache = function (t, e, n) { if (n[e]) { var r = n[e].indexOf(t); r >= 0 && n[e].splice(r, 1); } }), (t.cacheState = function (t, e, n) { n[e] || (n[e] = []), n[e].push(t); }), (t.prototype.updateState = function (e, n, r) { var i = this, o = t.checkCache, a = t.cacheState; if (!e.destroyed) { var s = this.cachedStates, u = s.enabled, c = s.disabled; r ? (o(e, n, c), a(e, n, u)) : (o(e, n, u), a(e, n, c)), ni && clearTimeout(ni), (ni = setTimeout(function () { (ni = null), i.updateGraphStates(); }, 16)); } }), (t.prototype.updateStates = function (t, e, n) { var r = this; Object(gt.x)(e) ? this.updateState(t, e, n) : e.forEach(function (e) { r.updateState(t, e, n); }); }), (t.prototype.updateGraphStates = function () { var t = this.graph.get("states"), e = this.cachedStates; Object(gt.e)(e.disabled, function (e, n) { t[n] && (t[n] = t[n].filter(function (t) { return e.indexOf(t) < 0 && !e.destroyed; })); }), Object(gt.e)(e.enabled, function (e, n) { if (t[n]) { var r = {}; t[n].forEach(function (t) { t.destroyed || (r[t.get("id")] = !0); }), e.forEach(function (e) { if (!e.destroyed) { var i = e.get("id"); r[i] || ((r[i] = !0), t[n].push(e)); } }); } else t[n] = e; }), this.graph.emit("graphstatechange", { states: t }), (this.cachedStates = { enabled: {}, disabled: {} }); }), (t.prototype.destroy = function () { (this.graph = null), (this.cachedStates = null), ni && clearTimeout(ni), (ni = null), (this.destroyed = !0); }), t ); })(), ii = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { if ("\\" === t.charAt(0)) return t.slice(1); var r = e[n]; return 0 === r && (r = "0"), r || ""; }) : t; }, oi = function (t) { var e = []; if (t.length < 2) throw new Error( "point length must largn than 2, now it's " + t.length, ); for (var n = 0, r = t; n < r.length; n++) { var i = r[n], o = i.x, a = i.y; e.push(o), e.push(a); } var s = Object(mt.a)(e); return s.unshift(["M", t[0].x, t[0].y]), s; }, ai = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 0); var i = { x: (1 - n) * t.x + n * e.x, y: (1 - n) * t.y + n * e.y }, o = [0, 0]; sn.c.normalize(o, [e.x - t.x, e.y - t.y]), (o && (o[0] || o[1])) || (o = [0, 0]); var a = [-o[1] * r, o[0] * r]; return (i.x += a[0]), (i.y += a[1]), i; }, si = function (t, e) { var n = t.length; if (!n) return ""; for (var r = "", i = 0; i < n; i++) { var o = t[i]; r += ii(0 === i ? "M{x} {y}" : "L{x} {y}", o); } return e && (r += "Z"), r; }, ui = function (t) { var e = []; return ( t.forEach(function (t) { if ("A" !== t[0]) for (var n = 1; n < t.length; n += 2) e.push([t[n], t[n + 1]]); else { var r = t.length; e.push([t[r - 2], t[r - 1]]); } }), e ); }, ci = function (t) { if (t.length < 2) throw new Error( "point length must largn than 2, now it's " + t.length, ); var e = t[0], n = t[1], r = t[t.length - 1], i = t[t.length - 2]; t.unshift(r), t.unshift(i), t.push(e), t.push(n); for (var o = [], a = 1; a < t.length - 2; a += 1) { var s = t[a - 1].x, u = t[a - 1].y, c = t[a].x, h = t[a].y, l = t[a + 1].x, d = t[a + 1].y, f = c + (l - s) / 6, p = h + (d - u) / 6, g = l - ((a !== t.length - 2 ? t[a + 2].x : l) - c) / 6, y = d - ((a !== t.length - 2 ? t[a + 2].y : d) - h) / 6; o.push(["C", f, p, g, y, l, d]); } return o.unshift(["M", r.x, r.y]), o; }, hi = function (t, e) { return sn.c.scale([0, 0], sn.c.normalize([0, 0], t), e); }, li = function (t, e) { var n = [t[1] - e[1], e[0] - t[0]], r = Math.sqrt(n[0] * n[0] + n[1] * n[1]); if (0 === r) throw new Error("p0 should not be equal to p1"); return [n[0] / r, n[1] / r]; }, di = function (t, e) { return [e[0] - t[0], e[1] - t[1]]; }; function fi(t, e) { if (!t || t.length < 1) return ""; if (1 === t.length) return (function (t) { var n = [t[0][0], t[0][1] - e], r = [t[0][0], t[0][1] + e]; return ( "M " + n + " A " + e + "," + e + ",0,0,0," + r + " A " + e + "," + e + ",0,0,0," + n ); })(t); if (2 === t.length) return (function (t) { var n = sn.c.scale([0, 0], li(t[0], t[1]), e), r = sn.c.scale([0, 0], n, -1), i = sn.c.add([0, 0], t[0], n), o = sn.c.add([0, 0], t[1], n), a = sn.c.add([0, 0], t[1], r), s = sn.c.add([0, 0], t[0], r); return ( "M " + i + " L " + o + " A " + [e, e, "0,0,0", a].join(",") + " L " + s + " A " + [e, e, "0,0,0", i].join(",") ); })(t); for (var n = new Array(t.length), r = 0; r < n.length; ++r) { var i = 0 === r ? t[t.length - 1] : t[r - 1], o = t[r], a = sn.c.scale([0, 0], li(i, o), e); n[r] = [sn.c.add([0, 0], i, a), sn.c.add([0, 0], o, a)]; } var s = "A " + [e, e, "0,0,0,"].join(","); return (n = n.map(function (t, e) { var r = ""; return ( 0 === e && (r = "M " + n[n.length - 1][1] + " "), (r += s + t[0] + " L " + t[1]) ); })).join(" "); } function pi(t, e) { var n, r, i, o = t.length; if (!t || o < 1) return ""; if (1 === o) return ( (r = [(n = t)[0][0], n[0][1] - e]), (i = [n[0][0], n[0][1] + e]), "M " + r + " A " + [e, e, "0,0,0", i].join(",") + " A " + [e, e, "0,0,0", r].join(",") ); if (2 === o) return (function (t) { var n = di(t[0], t[1]), r = hi(n, e), i = sn.c.add([0, 0], t[0], sn.c.scale([0, 0], r, -1)), o = sn.c.add([0, 0], t[1], r), a = 1.2 * e, s = hi(sn.c.normalize([0, 0], n), a), u = sn.c.scale([0, 0], s, -1), c = sn.c.add([0, 0], i, u), h = sn.c.add([0, 0], o, u), l = sn.c.add([0, 0], i, s); return ( "M " + i + " C " + [c, h, o].join(",") + " S " + [l, i].join(",") + " Z" ); })(t); for ( var a = t.map(function (e, n) { var r = t[(n + 1) % o]; return { p: e, v: sn.c.normalize([0, 0], di(e, r)) }; }), s = 0; s < a.length; ++s ) { var u = s > 0 ? s - 1 : o - 1, c = sn.c.normalize( [0, 0], sn.c.add([0, 0], a[u].v, sn.c.scale([0, 0], a[s].v, -1)), ); a[s].p = sn.c.add([0, 0], a[s].p, sn.c.scale([0, 0], c, e)); } return a.map(function (t) { var e = t.p; return { x: e[0], y: e[1] }; }); } var gi = function (t, e, n) { return (t.y - n.y) * (e.x - n.x) - (t.x - n.x) * (e.y - n.y); }, yi = function (t) { var e = t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }); if ( (e.sort(function (t, e) { return t.x === e.x ? t.y - e.y : t.x - e.x; }), 1 === e.length) ) return e; for (var n = [], r = 0; r < e.length; r++) { for ( ; n.length >= 2 && gi(n[n.length - 2], n[n.length - 1], e[r]) <= 0; ) n.pop(); n.push(e[r]); } var i = []; for (r = e.length - 1; r >= 0; r--) { for ( ; i.length >= 2 && gi(i[i.length - 2], i[i.length - 1], e[r]) <= 0; ) i.pop(); i.push(e[r]); } return i.pop(), n.pop(), n.concat(i); }, vi = { maxRoutingIterations: 100, maxMarchingIterations: 100, pixelGroupSize: 2, edgeR0: 10, edgeR1: 10, nodeR0: 5, nodeR1: 10, morphBuffer: 5, threshold: 0.001, skip: 16, nodeInfluenceFactor: 1, edgeInfluenceFactor: 1, negativeNodeInfluenceFactor: -0.5, }; function mi(t, e, n) { var r = !1, i = function (t, n) { return e.cells[t + n * e.width]; }, o = function (t, e) { var r = 0; return ( i(t - 1, e - 1) >= n && (r += 1), i(t, e - 1) > n && (r += 2), i(t - 1, e) > n && (r += 4), i(t, e) > n && (r += 8), r ); }, a = function (n, r) { for (var i, a, s = n, u = r, c = 0; c < e.width * e.height; c++) { if ( ((i = s), (a = u), t.findIndex(function (t) { return t.x === s && t.y === u; }) > -1) ) { if (t[0].x === s && t[0].y === u) return !0; } else t.push({ x: s, y: u }); var h = o(s, u); switch (h) { case -1: return console.warn("Marched out of bounds"), !0; case 0: case 3: case 2: case 7: s++; break; case 12: case 14: case 4: s--; break; case 6: 0 === i && (-1 === a ? (s -= 1) : (s += 1)); break; case 1: case 13: case 5: u--; break; case 9: 1 === i && (0 === a ? (u -= 1) : (u += 1)); break; case 10: case 8: case 11: u++; break; default: return ( console.warn("Marching squares invalid state: " + h), !0 ); } } }; this.march = function () { for (var t = 0; t < e.width && !r; t += 1) for (var s = 0; s < e.height && !r; s += 1) i(t, s) > n && 15 !== o(t, s) && (r = a(t, s)); return r; }; } var bi = function (t, e) { var n = Number.POSITIVE_INFINITY, r = null; return ( t.forEach(function (t) { var i = Kn(t, e); i >= 0 && i < n && ((r = t), (n = i)); }), r ); }; function xi(t, e, n, r, i) { var o = (function (t, e, n) { var r = null, i = Number.POSITIVE_INFINITY; return ( e.forEach(function (e) { var o = { x: t.getModel().x, y: t.getModel().y }, a = { x: e.getModel().x, y: e.getModel().y }, s = $n(o, a), u = new Hn(o.x, o.y, a.x, a.y), c = n.reduce(function (t, e) { return Kn(e, u) > 0 ? t + 1 : t; }, 0); s * Math.pow(c + 1, 2) < i && ((r = e), (i = s * Math.pow(c + 1, 2))); }), r ); })(t, n, e); if (null === o) return []; return (function (t) { for (var n = []; t.length > 0; ) { var r = t.pop(); if (0 === t.length) { n.push(r); break; } var i = t.pop(), o = new Hn(r.x1, r.y1, i.x2, i.y2); bi(e, o) ? (n.push(r), t.push(i)) : t.push(o); } return n; })( (function (t, e, n, r) { var i = [], o = []; o.push(t); for ( var a = !0, s = 0, u = function (t, e) { var n = !1; return ( e.forEach(function (e) { n || ((tr(t, { x: e.x1, y: e.y1 }) || tr(t, { x: e.x2, y: e.y2 })) && (n = !0)); }), n ); }, c = function (t, e) { for (var n = 0, r = e; n < r.length; n++) { var i = r[n].getBBox(), o = [ [i.x, i.y], [i.x + i.width, i.y], [i.x, i.y + i.height], [i.x + i.width, i.y + i.height], ]; if (Wn(o, t.x, t.y)) return !0; } return !1; }; a && s < n; ) { a = !1; for ( var h = function () { var t = o.pop(), n = bi(e, t); if (n) { var h = Zn(n, t), l = h[0]; if (2 === h[1]) { var d = function (s) { for ( var h = r, d = Mi(n, h, l, s), f = u(d, o) || u(d, i), p = c(d, e); !f && p && h >= 1; ) (d = Mi(n, (h /= 1.5), l, s)), (f = u(d, o) || u(d, i)), (p = c(d, e)); !d || f || (s && p) || (o.push(new Hn(t.x1, t.y1, d.x, d.y)), o.push(new Hn(d.x, d.y, t.x2, t.y2)), (a = !0)); }; d(!0), a || d(!1); } } a || i.push(t), (s += 1); }; !a && o.length; ) h(); } for (; o.length; ) i.push(o.pop()); return i; })( new Hn( t.getModel().x, t.getModel().y, o.getModel().x, o.getModel().y, ), e, r, i, ), ); } var wi = function (t, e, n) { var r = Object.assign(vi, n), i = Qn( t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }), ); t = t.sort(function (t, e) { return ( $n({ x: t.getModel().x, y: t.getModel().y }, i) - $n({ x: e.getModel().x, y: e.getModel().y }, i) ); }); var o = [], a = []; t.forEach(function (t) { xi(t, e, o, r.maxRoutingIterations, r.morphBuffer).forEach( function (t) { a.push(t); }, ), o.push(t); }); for ( var s, u, c, h, l, d = (function (t, e, n) { var r = { minX: Number.POSITIVE_INFINITY, minY: Number.POSITIVE_INFINITY, maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, width: 0, height: 0, x: 0, y: 0, }, i = []; t.forEach(function (t) { i.push(t.getBBox()); }), e.forEach(function (t) { i.push(t.getBBox()); }); for (var o = 0, a = i; o < a.length; o++) { var s = a[o]; (r.minX = (s.minX < r.minX ? s.minX : r.minX) - n), (r.minY = (s.minY < r.minY ? s.minY : r.minY) - n), (r.maxX = (s.maxX > r.maxX ? s.maxX : r.maxX) + n), (r.maxY = (s.maxY > r.maxY ? s.maxY : r.maxY) + n); } return ( (r.width = r.maxX - r.minX), (r.height = r.maxY - r.minY), (r.x = r.minX), (r.y = r.minY), r ); })(t, a, r.nodeR0), f = ((s = d.width), (u = d.height), (c = r.pixelGroupSize), (h = Math.ceil(s / c)), (l = Math.ceil(u / c)), { cells: new Float32Array(Math.max(0, h * l)).fill(0), width: h, height: l, }), p = [], g = [], y = 0; y < r.maxMarchingIterations; y++ ) if ( (Oi(t, e, a, d, f, r), (g = []), new mi((p = []), f, r.threshold).march()) ) { var v = p.map(function (t) { return { x: Math.round(t.x * r.pixelGroupSize + d.minX), y: Math.round(t.y * r.pixelGroupSize + d.minY), }; }); if (v) { var m = v.length; if (r.skip > 1) for (m = Math.floor(v.length / r.skip); m < 3 && r.skip > 1; ) (r.skip -= 1), (m = Math.floor(v.length / r.skip)); for (var b = 0, x = 0; x < m; x += 1, b += r.skip) g.push({ x: v[b].x, y: v[b].y }); } if ( g && (function () { for (var e = 0, n = t; e < n.length; e++) { var r = n[e], i = g.map(function (t) { return [t.x, t.y]; }); if (!Wn(i, r.getBBox().centerX, r.getBBox().centerY)) return !1; } return !0; })() ) return g; if (((r.threshold *= 0.9), y <= 0.5 * r.maxMarchingIterations)) (r.memberInfluenceFactor *= 1.2), (r.edgeInfluenceFactor *= 1.2); else { if (!(0 !== r.nonMemberInfluenceFactor && e.length > 0)) break; r.nonMemberInfluenceFactor *= 0.8; } } return g; }; function Oi(t, e, n, r, i, o) { function a(t, e) { var n = Math.floor((t - e) / o.pixelGroupSize); return n < 0 ? 0 : n; } function s(t, e) { return t * o.pixelGroupSize + e; } var u = (o.nodeR0 - o.nodeR1) * (o.nodeR0 - o.nodeR1), c = (o.edgeR0 - o.edgeR1) * (o.edgeR0 - o.edgeR1), h = function (t, e) { return [ Math.min(a(t.minX, e + r.minX), i.width), Math.min(a(t.minY, e + r.minY), i.height), Math.min(a(t.maxX, -e + r.minX), i.width), Math.min(a(t.maxY, -e + r.minY), i.height), ]; }, l = function (t, e) { for ( var n = t.getBBox(), a = h(n, o.nodeR1), u = a[0], c = a[1], l = a[2], d = a[3], f = c; f < d; f += 1 ) for (var p = u; p < l; p += 1) if (!(e < 0 && i[p + f * i.width] <= 0)) { var g = s(p, r.minX), y = s(f, r.minY), v = er( { x: g, y: y }, { x: n.minX, y: n.minY, width: n.width, height: n.height, }, ); if (v < Math.pow(o.nodeR1, 2)) { var m = Math.sqrt(v) - o.nodeR1; i.cells[p + f * i.width] += e * m * m; } } }; o.nodeInfluenceFactor && t.forEach(function (t) { l(t, o.nodeInfluenceFactor / u); }), o.edgeInfluenceFactor && n.forEach(function (t) { !(function (t, e) { for ( var n = t.getBBox(), a = h(n, o.edgeR1), u = a[0], c = a[1], l = a[2], d = a[3], f = c; f < d; f += 1 ) for (var p = u; p < l; p += 1) if (!(e < 0 && i.cells[p + f * i.width] <= 0)) { var g = s(p, r.minX), y = s(f, r.minY), v = Jn({ x: g, y: y }, t); if (v < Math.pow(o.edgeR1, 2)) { var m = Math.sqrt(v) - o.edgeR1; i.cells[p + f * i.width] += e * m * m; } } })(t, o.edgeInfluenceFactor / c); }), o.negativeNodeInfluenceFactor && e.forEach(function (t) { l(t, o.negativeNodeInfluenceFactor / u); }); } function Mi(t, e, n, r) { var i = t.getBBox(), o = n[0], a = n[1], s = n[2], u = n[3], c = { topLeft: { x: i.minX - e, y: i.minY - e }, topRight: { x: i.maxX + e, y: i.minY - e }, bottomLeft: { x: i.minX - e, y: i.maxY + e }, bottomRight: { x: i.maxX + e, y: i.maxY + e }, }, h = i.height * i.width; function l(t, e) { return i.width * (0.5 * (t.y - i.minY + (e.y - i.minY))); } if (a) return o ? r ? c.topLeft : c.bottomRight : s ? r ? c.bottomLeft : c.topRight : l(a, u) < 0.5 * h ? a.y > u.y ? r ? c.topLeft : c.bottomRight : r ? c.topRight : c.bottomLeft : a.y < u.y ? r ? c.bottomLeft : c.topRight : r ? c.bottomRight : c.topLeft; if (u) { if (o) return r ? c.topRight : c.bottomLeft; if (s) return r ? c.bottomRight : c.topLeft; } return l(o, s) < 0.5 * h ? o.x > s.x ? r ? c.topLeft : c.bottomRight : r ? c.bottomLeft : c.topRight : o.x < s.x ? r ? c.topRight : c.bottomLeft : r ? c.bottomRight : c.topLeft; } var Si = (function () { function t(t, e) { (this.cfg = Object(gt.d)(this.getDefaultCfg(), e)), (this.graph = t), (this.id = this.cfg.id), (this.group = this.cfg.group), (this.members = this.cfg.members.map(function (e) { return Object(gt.x)(e) ? t.findById(e) : e; })), (this.nonMembers = this.cfg.nonMembers.map(function (e) { return Object(gt.x)(e) ? t.findById(e) : e; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); } return ( (t.prototype.getDefaultCfg = function () { return { id: "g6-hull", type: "round-convex", members: [], nonMembers: [], style: { fill: "lightblue", stroke: "blue", opacity: 0.2 }, padding: 10, }; }), (t.prototype.setPadding = function () { var t = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2; (this.padding = this.cfg.padding > 0 ? this.cfg.padding + t : 10 + t), (this.cfg.bubbleCfg = { nodeR0: this.padding - t, nodeR1: this.padding - t, morphBuffer: this.padding - t, }); }), (t.prototype.setType = function () { (this.type = this.cfg.type), this.members.length < 3 && (this.type = "round-convex"), "round-convex" !== this.type && "smooth-convex" !== this.type && "bubble" !== this.type && (console.warn( "The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.", ), (this.type = "round-convex")); }), (t.prototype.calcPath = function (t, e) { var n, r, i; switch (this.type) { case "round-convex": (i = fi( (n = yi(t)).map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(mt.b)(i)); break; case "smooth-convex": 2 === (n = yi(t)).length ? ((i = fi( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(mt.b)(i))) : n.length > 2 && ((i = pi( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = ci(i))); break; case "bubble": r = (n = wi(t, e, this.cfg.bubbleCfg)).length >= 2 && ci(n); } return r; }), (t.prototype.render = function () { this.group.addShape("path", { attrs: Object(h.a)({ path: this.path }, this.cfg.style), id: this.id, name: this.cfg.id, }), this.group.toBack(); }), (t.prototype.addMember = function (t) { if (t) { Object(gt.x)(t) && (t = this.graph.findById(t)), this.members.push(t); var e = this.nonMembers.indexOf(t); return ( e > -1 && this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.addNonMember = function (t) { if (t) { Object(gt.x)(t) && (t = this.graph.findById(t)), this.nonMembers.push(t); var e = this.members.indexOf(t); return ( e > -1 && this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.removeMember = function (t) { if (t) { Object(gt.x)(t) && (t = this.graph.findById(t)); var e = this.members.indexOf(t); return ( e > -1 && (this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.removeNonMember = function (t) { if (t) { Object(gt.x)(t) && (t = this.graph.findById(t)); var e = this.nonMembers.indexOf(t); return ( e > -1 && (this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.updateData = function (t, e) { var n = this; this.group.findById(this.id).remove(), t && (this.members = t.map(function (t) { return Object(gt.x)(t) ? n.graph.findById(t) : t; })), e && (this.nonMembers = e.map(function (t) { return Object(gt.x)(t) ? n.graph.findById(t) : t; })), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.updateStyle = function (t) { this.group.findById(this.id).attr(Object(h.a)({}, t)); }), (t.prototype.updateCfg = function (t) { var e = this; (this.cfg = Object(gt.d)(this.cfg, t)), (this.id = this.cfg.id), (this.group = this.cfg.group), t.members && (this.members = this.cfg.members.map(function (t) { return Object(gt.x)(t) ? e.graph.findById(t) : t; })), t.nonMembers && (this.nonMembers = this.cfg.nonMembers.map(function (t) { return Object(gt.x)(t) ? e.graph.findById(t) : t; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.contain = function (t) { var e, n, r = this, i = (e = Object(gt.x)(t) ? this.graph.findById(t) : t).getKeyShape(); if ("path" === e.get("type")) n = ui(i.attr("path")); else { var o = i.getCanvasBBox(); n = [ [o.minX, o.minY], [o.maxX, o.minY], [o.maxX, o.maxY], [o.minX, o.maxY], ]; } return ( (n = n.map(function (t) { var e = r.graph.getPointByCanvas(t[0], t[1]); return [e.x, e.y]; })), qn(n, ui(this.path)) ); }), (t.prototype.destroy = function () { this.group.remove(), (this.cfg = null); }), t ); })(), Ci = sn.a.transform; !(function (t) { function e(e) { var n = t.call(this) || this; return ( (n.cfg = Object(gt.d)(n.getDefaultCfg(), e)), n.init(), (n.animating = !1), (n.destroyed = !1), n.cfg.enabledStack && ((n.undoStack = new On(n.cfg.maxStep)), (n.redoStack = new On(n.cfg.maxStep))), n ); } Object(h.c)(e, t), (e.prototype.init = function () { this.initCanvas(); var t = new Yr(this), e = new Nr(this), n = new ei(this), r = new ri(this); this.set({ viewController: t, modeController: e, itemController: n, stateController: r, }), this.initLayoutController(), this.initEventController(), this.initGroups(), this.initPlugins(), an(this.onTick.bind(this)); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = this.get("canvas").get("el").id, n = t.addGroup({ id: e + "-root", className: ur.rootContainerClassName, }); if (this.get("groupByTypes")) { var r = n.addGroup({ id: e + "-edge", className: ur.edgeContainerClassName, }), i = n.addGroup({ id: e + "-node", className: ur.nodeContainerClassName, }), o = n.addGroup({ id: e + "-combo", className: ur.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = n.addGroup({ id: e + "-delegate", className: ur.delegateContainerClassName, }); this.set({ delegateGroup: a }), this.set("group", n); }), (e.prototype.getDefaultCfg = function () { return { container: void 0, width: void 0, height: void 0, renderer: "canvas", modes: {}, plugins: [], data: {}, fitViewPadding: 10, minZoom: 0.2, maxZoom: 10, event: !0, groupByTypes: !0, directed: !1, autoPaint: !0, nodes: [], edges: [], combos: [], vedges: [], itemMap: {}, linkCenter: !1, defaultNode: {}, defaultEdge: {}, nodeStateStyles: {}, edgeStateStyles: {}, states: {}, animate: !1, animateCfg: { onFrame: void 0, duration: 500, easing: "easeLinear", }, callback: void 0, enabledStack: !1, maxStep: 10, tooltips: [], }; }), (e.prototype.set = function (t, e) { return ( Object(gt.w)(t) ? (this.cfg = Object(h.a)(Object(h.a)({}, this.cfg), t)) : (this.cfg[t] = e), this ); }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.getGroup = function () { return this.get("group"); }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.getMinZoom = function () { return this.get("minZoom"); }), (e.prototype.setMinZoom = function (t) { return this.set("minZoom", t); }), (e.prototype.getMaxZoom = function () { return this.get("maxZoom"); }), (e.prototype.setMaxZoom = function (t) { return this.set("maxZoom", t); }), (e.prototype.getWidth = function () { return this.get("width"); }), (e.prototype.getHeight = function () { return this.get("height"); }), (e.prototype.clearItemStates = function (t, e) { Object(gt.x)(t) && (t = this.findById(t)); var n = this.get("itemController"); e || (e = t.get("states")), n.clearItemStates(t, e), this.get("stateController").updateStates(t, e, !1); }), (e.prototype.node = function (t) { "function" == typeof t && this.set("nodeMapper", t); }), (e.prototype.edge = function (t) { "function" == typeof t && this.set("edgeMapper", t); }), (e.prototype.combo = function (t) { "function" == typeof t && this.set("comboMapper", t); }), (e.prototype.findById = function (t) { return this.get("itemMap")[t]; }), (e.prototype.find = function (t, e) { var n, r = this.get(t + "s"); return ( Object(gt.e)(r, function (t, r) { if (e(t, r)) return (n = t); }), n ); }), (e.prototype.findAll = function (t, e) { var n = []; return ( Object(gt.e)(this.get(t + "s"), function (t, r) { e(t, r) && n.push(t); }), n ); }), (e.prototype.findAllByState = function (t, e) { return this.findAll(t, function (t) { return t.hasState(e); }); }), (e.prototype.translate = function (t, e) { var n = this.get("group"), r = Object(gt.b)(n.getMatrix()); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = Ci(r, [["t", t, e]])), n.setMatrix(r), this.emit("viewportchange", { action: "translate", matrix: n.getMatrix(), }), this.autoPaint(); }), (e.prototype.moveTo = function (t, e) { var n = this.get("group"); Rn(n, { x: t, y: e }), this.emit("viewportchange", { action: "move", matrix: n.getMatrix(), }); }), (e.prototype.fitView = function (t) { t && this.set("fitViewPadding", t), this.get("viewController").fitView(), this.autoPaint(); }), (e.prototype.fitCenter = function () { this.get("viewController").fitCenter(), this.autoPaint(); }), (e.prototype.addBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !0), this ); }), (e.prototype.removeBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !1), this ); }), (e.prototype.updateBehavior = function (t, e, n) { return this.get("modeController").updateBehavior(t, e, n), this; }), (e.prototype.zoom = function (t, e) { var n = this.get("group"), r = Object(gt.b)(n.getMatrix()), i = this.get("minZoom"), o = this.get("maxZoom"); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = Ci( r, e ? [ ["t", -e.x, -e.y], ["s", t, t], ["t", e.x, e.y], ] : [["s", t, t]], )), (i && r[0] < i) || (o && r[0] > o) || (n.setMatrix(r), this.emit("viewportchange", { action: "zoom", matrix: r }), this.autoPaint()); }), (e.prototype.zoomTo = function (t, e) { var n = t / this.getZoom(); this.zoom(n, e); }), (e.prototype.focusItem = function (t, e, n) { var r = this.get("viewController"), i = !1; e ? (i = !0) : void 0 === e && (i = this.get("animate")); var o = {}; n ? (o = n) : void 0 === n && (o = this.get("animateCfg")), r.focus(t, i, o), this.autoPaint(); }), (e.prototype.autoPaint = function () { this.get("autoPaint") && this.paint(); }), (e.prototype.paint = function () { this.emit("beforepaint"), this.get("canvas").draw(), this.emit("afterpaint"); }), (e.prototype.getPointByClient = function (t, e) { return this.get("viewController").getPointByClient(t, e); }), (e.prototype.getClientByPoint = function (t, e) { return this.get("viewController").getClientByPoint(t, e); }), (e.prototype.getPointByCanvas = function (t, e) { return this.get("viewController").getPointByCanvas(t, e); }), (e.prototype.getCanvasByPoint = function (t, e) { return this.get("viewController").getCanvasByPoint(t, e); }), (e.prototype.getGraphCenterPoint = function () { var t = this.get("group").getCanvasBBox(); return { x: (t.minX + t.maxX) / 2, y: (t.minY + t.maxY) / 2 }; }), (e.prototype.getViewPortCenterPoint = function () { return this.getPointByCanvas( this.get("width") / 2, this.get("height") / 2, ); }), (e.prototype.showItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !0); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !1 }]), (o.nodes = [{ id: r, visible: !0 }]); break; case "edge": (i.nodes = [{ id: r, visible: !1 }]), (o.edges = [{ id: r, visible: !0 }]); break; case "combo": (i.nodes = [{ id: r, visible: !1 }]), (o.combos = [{ id: r, visible: !0 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.hideItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !1); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !0 }]), (o.nodes = [{ id: r, visible: !1 }]); break; case "edge": (i.nodes = [{ id: r, visible: !0 }]), (o.edges = [{ id: r, visible: !1 }]); break; case "combo": (i.nodes = [{ id: r, visible: !0 }]), (o.combos = [{ id: r, visible: !1 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.refreshItem = function (t) { this.get("itemController").refreshItem(t); }), (e.prototype.setAutoPaint = function (t) { this.set("autoPaint", t), this.get("canvas").set("autoDraw", t); }), (e.prototype.remove = function (t, e) { void 0 === e && (e = !0), this.removeItem(t, e); }), (e.prototype.removeItem = function (t, e) { void 0 === e && (e = !0); var n = t; if ( (Object(gt.x)(t) && (n = this.findById(t)), !n && Object(gt.x)(t)) ) console.warn("The item to be removed does not exist!"); else if (n) { var r = ""; if ( (n.getType && (r = n.getType()), e && this.get("enabledStack")) ) { var i = Object(h.a)(Object(h.a)({}, n.getModel()), { itemType: r, }), o = {}; switch (r) { case "node": (o.nodes = [i]), (o.edges = []); for (var a = n.getEdges(), s = a.length - 1; s >= 0; s--) o.edges.push( Object(h.a)(Object(h.a)({}, a[s].getModel()), { itemType: "edge", }), ); break; case "edge": o.edges = [i]; break; case "combo": o.combos = [i]; } this.pushStack("delete", { before: o, after: {} }); } if ("node" === r) n.getModel().comboId && this.updateComboTree(n); if ((this.get("itemController").removeItem(n), "combo" === r)) { var u = Sr(this.get("comboTrees")); this.set("comboTrees", u); } } }), (e.prototype.addItem = function (t, e, n, r) { void 0 === n && (n = !0), void 0 === r && (r = !0); var i = this.get("comboSorted"); this.set("comboSorted", i && !r); var o = this.get("itemController"); if ( !(function (t, e) { if ("node" === t || "combo" === t) { if (e.id && !Object(gt.x)(e.id)) return ( console.warn( "G6 Warning Tips: missing 'id' property, or the 'id' %c" + e.id + "%c is not a string.", "font-size: 20px; color: red;", "", ), !1 ); } else if (!("edge" !== t || (e.source && e.target))) return ( console.warn( "G6 Warning Tips: missing 'source' or 'target' for the edge.", ), !1 ); return !0; })(t, e) ) return !1; if (!e.id || !this.findById(e.id)) { var a, s = this.get("comboTrees"); if ((s || (s = []), "combo" === t)) { var u = this.get("itemMap"), c = !1; if ( (s.forEach(function (n) { c || xr(n, function (n) { if (e.parentId === n.id) { c = !0; var r = Object(h.a)( { id: e.id, depth: n.depth + 2 }, e, ); n.children ? n.children.push(r) : (n.children = [r]), (e.depth = r.depth), (a = o.addItem(t, e)); } var i = u[n.id]; return ( c && i && i.getType && "combo" === i.getType() && o.updateCombo(i, n.children), !0 ); }); }), !c) ) { var l = Object(h.a)({ id: e.id, depth: 0 }, e); (e.depth = l.depth), s.push(l), (a = o.addItem(t, e)); } this.set("comboTrees", s); } else if ("node" === t && Object(gt.x)(e.comboId) && s) { var d; (d = this.findById(e.comboId)) && d.getType && "combo" !== d.getType() && console.warn( "'" + e.comboId + "' is not a id of a combo in the graph, the node will be added without combo.", ), (a = o.addItem(t, e)); var f = this.get("itemMap"), p = !1, g = !1; (s || []).forEach(function (t) { g || p || xr(t, function (t) { if (t.id === e.id) return (g = !0), !1; if (e.comboId === t.id && !g) { p = !0; var n = Object(gt.b)(e); (n.itemType = "node"), t.children ? t.children.push(n) : (t.children = [n]), (n.depth = t.depth + 1); } return ( p && f[t.id].getType && "combo" === f[t.id].getType() && o.updateCombo(f[t.id], t.children), !0 ); }); }); } else a = o.addItem(t, e); if (("node" === t && e.comboId) || ("combo" === t && e.parentId)) (d = this.findById(e.comboId || e.parentId)) && d.getType && "combo" === d.getType() && d.addChild(a); var y = this.get("combos"); if ( (y && y.length > 0 && this.sortCombos(), this.autoPaint(), n && this.get("enabledStack")) ) { var v = Object(h.a)(Object(h.a)({}, a.getModel()), { itemType: t, }), m = {}; switch (t) { case "node": m.nodes = [v]; break; case "edge": m.edges = [v]; break; case "combo": m.combos = [v]; } this.pushStack("add", { before: {}, after: m }); } return a; } console.warn( "This item exists already. Be sure the id %c" + e.id + "%c is unique.", "font-size: 20px; color: red;", "", ); }), (e.prototype.add = function (t, e, n, r) { return ( void 0 === n && (n = !0), void 0 === r && (r = !0), this.addItem(t, e, n, r) ); }), (e.prototype.updateItem = function (t, e, n) { var r = this; void 0 === n && (n = !0); var i, o = this.get("itemController"); i = Object(gt.x)(t) ? this.findById(t) : t; var a = Object(gt.b)(i.getModel()), s = ""; i.getType && (s = i.getType()); var u = Object(h.f)([], i.getStates()); if ( ("combo" === s && Object(gt.e)(u, function (t) { return r.setItemState(i, t, !1); }), o.updateItem(i, e), "combo" === s && Object(gt.e)(u, function (t) { return r.setItemState(i, t, !0); }), n && this.get("enabledStack")) ) { var c = { nodes: [], edges: [], combos: [] }, l = { nodes: [], edges: [], combos: [] }, d = Object(h.a)({ id: a.id }, e); switch (s) { case "node": c.nodes.push(a), l.nodes.push(d); break; case "edge": c.edges.push(a), l.edges.push(d); break; case "combo": c.combos.push(a), l.combos.push(d); } "node" === s && c.nodes.push(a), this.pushStack("update", { before: c, after: l }); } }), (e.prototype.update = function (t, e, n) { void 0 === n && (n = !0), this.updateItem(t, e, n); }), (e.prototype.setItemState = function (t, e, n) { Object(gt.x)(t) && (t = this.findById(t)), this.get("itemController").setItemState(t, e, n); var r = this.get("stateController"); Object(gt.x)(n) ? r.updateState(t, e + ":" + n, !0) : r.updateState(t, e, n); }), (e.prototype.priorityState = function (t, e) { this.get("itemController").priorityState(t, e); }), (e.prototype.data = function (t) { Er(t), this.set("data", t); }), (e.prototype.render = function () { var t = this; this.set("comboSorted", !1); var e = this.get("data"); if ((this.get("enabledStack") && this.clearStack(), !e)) throw new Error("data must be defined first"); var n = e.nodes, r = void 0 === n ? [] : n, i = e.edges, o = void 0 === i ? [] : i, a = e.combos, s = void 0 === a ? [] : a; if ( (this.clear(!0), this.emit("beforerender"), Object(gt.e)(r, function (e) { t.add("node", e, !1, !1); }), s && 0 !== s.length) ) { var u = Mr(s, r); this.set("comboTrees", u), t.addCombos(s); } Object(gt.e)(o, function (e) { t.add("edge", e, !1, !1); }); var c = t.get("animate"); (t.get("fitView") || t.get("fitCenter")) && t.set("animate", !1); var h = t.get("layoutController"); if (h) { if ( (h.layout(function () { t.get("fitView") ? t.fitView() : t.get("fitCenter") && t.fitCenter(); t.autoPaint(), t.emit("afterrender"), (t.get("fitView") || t.get("fitCenter")) && t.set("animate", c); }), this.refreshPositions(), this.destroyed) ) return; } else t.get("fitView") && t.fitView(), t.get("fitCenter") && t.fitCenter(), t.emit("afterrender"), t.set("animate", c); this.get("groupByTypes") || (s && 0 !== s.length ? this.sortCombos() : e.nodes && e.edges && e.nodes.length < e.edges.length ? this.getNodes().forEach(function (t) { t.toFront(); }) : this.getEdges().forEach(function (t) { t.toBack(); })); this.get("enabledStack") && this.pushStack("render"); }), (e.prototype.read = function (t) { this.data(t), this.render(); }), (e.prototype.diffItems = function (t, e, n) { var r, i = this, o = this.get("itemMap"); Object(gt.e)(n, function (n) { if ((r = o[n.id])) { if (i.get("animate") && "node" === t) { var a = r.getContainer().getMatrix(); a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.set("originAttrs", { x: a[6], y: a[7] }); } i.updateItem(r, n, !1); } else r = i.addItem(t, n, !1); r && e[t + "s"].push(r); }); }), (e.prototype.changeData = function (t, e) { void 0 === e && (e = !0); var n = this; if (!Er(t)) return this; e && this.get("enabledStack") && this.pushStack("changedata", { before: n.save(), after: t }), this.set("comboSorted", !1), this.removeHulls(), this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }); var r = this.get("canvas"), i = r.get("localRefresh"); r.set("localRefresh", !1), n.get("data") || (n.data(t), n.render()); var o = this.get("itemMap"), a = { nodes: [], edges: [] }, s = t.combos; if (s) { var u = Mr(s, t.nodes); this.set("comboTrees", u); } this.diffItems("node", a, t.nodes), Object(gt.e)(o, function (t, e) { (o[e].getModel().depth = 0), (t.getType && "edge" === t.getType()) || (t.getType && "combo" === t.getType() ? (delete o[e], t.destroy()) : a.nodes.indexOf(t) < 0 && (delete o[e], n.remove(t, !1))); }); for (var c = this.getCombos(), h = c.length - 1; h >= 0; h--) c[h].destroyed && c.splice(h, 1); s && (n.addCombos(s), this.get("groupByTypes") || this.sortCombos()), this.diffItems("edge", a, t.edges), Object(gt.e)(o, function (t, e) { (!t.getType || ("node" !== t.getType() && "combo" !== t.getType())) && a.edges.indexOf(t) < 0 && (delete o[e], n.remove(t, !1)); }), this.set({ nodes: a.nodes, edges: a.edges }); var l = this.get("layoutController"); return ( l && (l.changeData(), n.get("animate") && !l.getLayoutType() ? n.positionsAnimate() : n.autoPaint()), setTimeout(function () { r.set("localRefresh", i); }, 16), this ); }), (e.prototype.addCombos = function (t) { var e = this.get("comboTrees"); this.get("itemController").addCombos(e, t); }), (e.prototype.createCombo = function (t, e) { var n = this; this.set("comboSorted", !1); var r, i = ""; if (t) { if (Object(gt.x)(t)) (i = t), (r = { id: t }); else { if (!(i = t.id)) return void console.warn( "Create combo failed. Please assign a unique string id for the adding combo.", ); r = t; } var o = e.map(function (t) { var e = n.findById(t), r = e.getModel(), o = ""; e.getType && (o = e.getType()); var a = { id: e.getID(), itemType: o }; return ( "combo" === o ? ((a.parentId = i), (r.parentId = i)) : "node" === o && ((a.comboId = i), (r.comboId = i)), a ); }); (r.children = o), this.addItem("combo", r, !1), this.set("comboSorted", !1); var a = this.get("comboTrees"); (a || []).forEach(function (t) { xr(t, function (t) { return ( t.id !== i || ((t.itemType = "combo"), (t.children = o), !1) ); }); }), a && this.sortCombos(); } }), (e.prototype.uncombo = function (t) { var e = this, n = t; if ( (Object(gt.x)(t) && (n = this.findById(t)), !n || (n.getType && "combo" !== n.getType())) ) console.warn("The item is not a combo!"); else { var r = n.getModel().parentId, i = this.get("comboTrees"); i || (i = []); var o, a = this.get("itemMap"), s = n.get("id"), u = [], c = this.get("combos"), h = this.findById(r); if ( (i.forEach(function (i) { o || xr(i, function (i) { if (i.id === s) { (o = i), n.getEdges().forEach(function (t) { e.removeItem(t, !1); }); var l = c.indexOf(t); c.splice(l, 1), delete a[s], n.destroy(); } return ( !r || !o || i.id !== r || (h.removeCombo(n), -1 !== (l = (u = i.children).indexOf(o)) && u.splice(l, 1), o.children.forEach(function (t) { var n = e.findById(t.id), i = n.getModel(); n.getType && "combo" === n.getType() ? ((t.parentId = r), delete t.comboId, (i.parentId = r), delete i.comboId) : n.getType && "node" === n.getType() && ((t.comboId = r), (i.comboId = r)), h.addChild(n), u.push(t); }), !1) ); }); }), !r && o) ) { var l = i.indexOf(o); i.splice(l, 1), o.children.forEach(function (t) { t.parentId = void 0; var n = e.findById(t.id).getModel(); delete n.parentId, delete n.comboId, "node" !== t.itemType && i.push(t); }); } } }), (e.prototype.updateCombos = function () { var t = this, e = this.get("comboTrees"), n = this.get("itemController"), r = this.get("itemMap"); (e || []).forEach(function (e) { xr(e, function (e) { if (!e) return !0; var i = r[e.id]; if (i && i.getType && "combo" === i.getType()) { var o = Object(h.f)([], i.getStates()); Object(gt.e)(o, function (e) { return t.setItemState(i, e, !1); }), n.updateCombo(i, e.children), Object(gt.e)(o, function (e) { return t.setItemState(i, e, !0); }); } return !0; }); }), this.sortCombos(); }), (e.prototype.updateCombo = function (t) { var e, n = this, r = t; if ( (Object(gt.x)(t) && (r = this.findById(t)), !r || (r.getType && "combo" !== r.getType())) ) console.warn("The item to be updated is not a combo!"); else { e = r.get("id"); var i = this.get("comboTrees"), o = this.get("itemController"), a = this.get("itemMap"); (i || []).forEach(function (t) { xr(t, function (t) { if (!t) return !0; var r = a[t.id]; if (e === t.id && r && r.getType && "combo" === r.getType()) { var i = Object(h.f)([], r.getStates()); Object(gt.e)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !1); }), o.updateCombo(r, t.children), Object(gt.e)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !0); }), e && (e = t.parentId); } return !0; }); }); } }), (e.prototype.updateComboTree = function (t, e, n) { void 0 === n && (n = !0); var r; this.set("comboSorted", !1); var i, o = (r = Object(gt.x)(t) ? this.findById(t) : t).getModel(), a = o.comboId || o.parentId, s = ""; if ((r.getType && (s = r.getType()), e && "combo" === s)) { var u, c = this.get("comboTrees"), h = !0; if ( ((c || []).forEach(function (t) { u || br(t, function (t) { if (!u) return t.id === r.getID() && (u = t), !0; }); }), br(u, function (t) { return t.id !== e || ((h = !1), !1); }), !h) ) return void console.warn( "Failed to update the combo tree! The parentId points to a descendant of the combo!", ); } if (n && this.get("enabledStack")) { var l = {}, d = {}; "combo" === s ? ((l.combos = [{ id: o.id, parentId: o.parentId }]), (d.combos = [{ id: o.id, parentId: e }])) : "node" === s && ((l.nodes = [{ id: o.id, parentId: o.comboId }]), (d.nodes = [{ id: o.id, parentId: e }])), this.pushStack("updateComboTree", { before: l, after: d }); } if (o.parentId || o.comboId) { var f = this.findById(o.parentId || o.comboId); f && f.removeChild(r); } ("combo" === s ? (o.parentId = e) : "node" === s && (o.comboId = e), e) && (i = this.findById(e)) && i.addChild(r); a && (i = this.findById(a)) && i.removeChild(r); var p = Sr(this.get("comboTrees"), o.id, e); this.set("comboTrees", p), this.updateCombos(); }), (e.prototype.save = function () { var t = [], e = [], n = []; return ( Object(gt.e)(this.get("nodes"), function (e) { t.push(e.getModel()); }), Object(gt.e)(this.get("edges"), function (t) { e.push(t.getModel()); }), Object(gt.e)(this.get("combos"), function (t) { n.push(t.getModel()); }), { nodes: t, edges: e, combos: n } ); }), (e.prototype.changeSize = function (t, e) { return this.get("viewController").changeSize(t, e), this; }), (e.prototype.refresh = function () { if ((this.emit("beforegraphrefresh"), this.get("animate"))) this.positionsAnimate(); else { var t = this.get("nodes"), e = this.get("edges"), n = this.get("edges"); Object(gt.e)(t, function (t) { t.refresh(); }), Object(gt.e)(e, function (t) { t.refresh(); }), Object(gt.e)(n, function (t) { t.refresh(); }); } this.emit("aftergraphrefresh"), this.autoPaint(); }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.getComboChildren = function (t) { if ( (Object(gt.x)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) return t.getChildren(); console.warn("The combo does not exist!"); }), (e.prototype.positionsAnimate = function () { var t = this; t.emit("beforeanimate"); var e = t.get("animateCfg"), n = e.onFrame, r = t.getNodes(), i = r.map(function (t) { var e = t.getModel(); return { id: e.id, x: e.x, y: e.y }; }); t.isAnimating() && t.stopAnimate(), t.get("canvas").animate( function (e) { Object(gt.e)(i, function (r) { var i = t.findById(r.id); if (i && !i.destroyed) { var o = i.get("originAttrs"), a = i.get("model"); if (!o) { var s = i.getContainer().getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (o = { x: s[6], y: s[7] }), i.set("originAttrs", o); } if (n) { var u = n(i, e, r, o); i.set("model", Object.assign(a, u)); } else (a.x = o.x + (r.x - o.x) * e), (a.y = o.y + (r.y - o.y) * e); } }), t.refreshPositions(); }, { duration: e.duration, easing: e.easing, callback: function () { Object(gt.e)(r, function (t) { t.set("originAttrs", null); }), e.callback && e.callback(), t.emit("afteranimate"), (t.animating = !1); }, }, ); }), (e.prototype.refreshPositions = function () { this.emit("beforegraphrefreshposition"); var t, e = this.get("nodes"), n = this.get("edges"), r = this.get("vedges"), i = this.get("combos"), o = {}; Object(gt.e)(e, function (e) { t = e.getModel(); var n = e.get("originAttrs"); if (!n || t.x !== n.x || t.y !== n.y) { var r = e.updatePosition({ x: t.x, y: t.y }); (o[t.id] = r), t.comboId && (o[t.comboId] = o[t.comboId] || r); } }), i && 0 !== i.length && this.updateCombos(), Object(gt.e)(n, function (t) { var e = t.getSource().getModel(), n = t.getTarget(); if (!Object(gt.w)(n)) { var r = n.getModel(); (o[e.id] || o[r.id] || t.getModel().isComboEdge) && t.refresh(); } }), Object(gt.e)(r, function (t) { t.refresh(); }), this.emit("aftergraphrefreshposition"), this.autoPaint(); }), (e.prototype.stopAnimate = function () { this.get("canvas").stopAnimate(); }), (e.prototype.isAnimating = function () { return this.animating; }), (e.prototype.getZoom = function () { var t = this.get("group").getMatrix(); return t ? t[0] : 1; }), (e.prototype.getCurrentMode = function () { return this.get("modeController").getMode(); }), (e.prototype.setMode = function (t) { return this.get("modeController").setMode(t), this; }), (e.prototype.clear = function (t) { return ( void 0 === t && (t = !1), this.get("canvas").clear(), this.initGroups(), this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [], }), t || this.emit("afterrender"), this ); }), (e.prototype.updateLayout = function (t) { var e = this.get("layoutController"); Object(gt.x)(t) && (t = { type: t }); var n = this.get("layout"), r = {}; Object.assign(r, n, t), this.set("layout", r), e.isLayoutTypeSame(r) && r.gpuEnabled === n.gpuEnabled ? e.updateLayoutCfg(r) : e.changeLayout(r); }), (e.prototype.destroyLayout = function () { this.get("layoutController").destroyLayout(); }), (e.prototype.layout = function () { var t = this.get("layoutController"), e = this.get("layout"); e && t && (e.workerEnabled ? t.layout() : t.layoutMethod ? t.relayout(!0) : t.layout()); }), (e.prototype.collapseCombo = function (t) { var e = this; if ((Object(gt.x)(t) && (t = this.findById(t)), t)) { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").collapseCombo(t), (n.collapsed = !0); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || br(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, c = []; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || r.getModel().id === n.id ) { if ((d = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var s = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(s.parentId || s.comboId)) || (!s.parentId && !s.comboId) ) return; s = a.getModel(); } var h = s.id; if (u[n.id + "-" + h]) return void (u[n.id + "-" + h] += d.size || 1); var l = e.addItem( "vedge", { source: n.id, target: h, isVEdge: !0 }, !1, ); (u[n.id + "-" + h] = d.size || 1), c.push(l); } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || a.getModel().id === n.id ) { var d; if ((d = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.parentId || f.comboId)) || (!f.parentId && !f.comboId) ) return; f = r.getModel(); } var p = f.id; if (u[p + "-" + n.id]) return void (u[p + "-" + n.id] += d.size || 1); l = e.addItem( "vedge", { target: n.id, source: p, isVEdge: !0 }, !1, ); (u[p + "-" + n.id] = d.size || 1), c.push(l); } } }), c.forEach(function (t) { var n = t.getModel(); e.updateItem(t, { size: u[n.source + "-" + n.target] }, !1); }), this.emit("aftercollapseexpandcombo", { action: "collapse", item: t, }); } else console.warn("The combo to be collapsed does not exist!"); }), (e.prototype.expandCombo = function (t) { var e = this; if ( (Object(gt.x)(t) && (t = this.findById(t)), !t || (t.getType && "combo" !== t.getType())) ) console.warn("The combo to be collapsed does not exist!"); else { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").expandCombo(t), (n.collapsed = !1); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || br(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, c = {}; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(), s = r.get("id"), h = a.get("id"); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || s === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (var l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; l = a.getModel(); } h = l.id; for (var d = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(d.comboId || d.parentId)) || (!d.parentId && !d.comboId) ) return; if (d.comboId === n.id || d.parentId === n.id) break; d = r.getModel(); } if (((s = d.id), h)) { if (u[(p = s + "-" + h)]) return ( (u[p] += t.getModel().size || 1), void e.updateItem(c[p], { size: u[p] }, !1) ); var f = e.addItem( "vedge", { source: s, target: h, isVEdge: !0 }, !1, ); (u[p] = t.getModel().size || 1), (c[p] = f); } } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || h === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (d = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(d.comboId || d.parentId)) || (!d.parentId && !d.comboId) ) return; d = r.getModel(); } s = d.id; for (l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; if (l.comboId === n.id || l.parentId === n.id) break; l = a.getModel(); } if (((h = l.id), s)) { var p; if (u[(p = s + "-" + h)]) return ( (u[p] += t.getModel().size || 1), void e.updateItem(c[p], { size: u[p] }, !1) ); f = e.addItem( "vedge", { target: h, source: s, isVEdge: !0 }, !1, ); (u[p] = t.getModel().size || 1), (c[p] = f); } } else (i.includes(r) || o.includes(r)) && (i.includes(a) || o.includes(a)) && r.isVisible() && a.isVisible() && t.show(); } }), this.emit("aftercollapseexpandcombo", { action: "expand", item: t, }); } }), (e.prototype.collapseExpandCombo = function (t) { if ( (Object(gt.x)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) { for (var e = t.getModel(), n = this.findById(e.parentId); n; ) { var r = n.getModel(); if (r.collapsed) return ( console.warn( "Fail to expand the combo since it's ancestor combo is collapsed.", ), void (n = void 0) ); n = this.findById(r.parentId); } e.collapsed ? this.expandCombo(t) : this.collapseCombo(t), this.updateCombo(t); } }), (e.prototype.sortCombos = function () { var t = this; if (!this.get("comboSorted")) { this.set("comboSorted", !0); var e = [], n = {}; (this.get("comboTrees") || []).forEach(function (t) { br(t, function (t) { return ( e[t.depth] ? e[t.depth].push(t.id) : (e[t.depth] = [t.id]), (n[t.id] = t.depth), !0 ); }); }), (this.getEdges().concat(this.get("vedges")) || []).forEach( function (t) { var r = t.getModel(), i = n[r.source] || 0, o = n[r.target] || 0, a = Math.max(i, o); e[a] ? e[a].push(r.id) : (e[a] = [r.id]); }, ), e.forEach(function (e) { if (e && e.length) for (var n = e.length - 1; n >= 0; n--) { var r = t.findById(e[n]); r && r.toFront(); } }); } }), (e.prototype.getNeighbors = function (t, e) { var n = t; return Object(gt.x)(t) && (n = this.findById(t)), n.getNeighbors(e); }), (e.prototype.getNodeDegree = function (t, e, n) { void 0 === e && (e = void 0), void 0 === n && (n = !1); var r = t; Object(gt.x)(t) && (r = this.findById(t)); var i = this.get("degrees"); (i && !n) || ((i = fn(this.save())), this.set("degrees", i)); var o = i[r.getID()], a = 0; if (!o) return 0; switch (e) { case "in": a = o.inDegree; break; case "out": a = o.outDegree; break; case "all": a = o; break; default: a = o.degree; } return a; }), (e.prototype.getUndoStack = function () { return this.undoStack; }), (e.prototype.getRedoStack = function () { return this.redoStack; }), (e.prototype.getStackData = function () { return this.get("enabledStack") ? { undoStack: this.undoStack.toArray(), redoStack: this.redoStack.toArray(), } : null; }), (e.prototype.clearStack = function () { this.get("enabledStack") && (this.undoStack.clear(), this.redoStack.clear()); }), (e.prototype.pushStack = function (t, e, n) { if ( (void 0 === t && (t = "update"), void 0 === n && (n = "undo"), this.get("enabledStack")) ) { var r = e ? Object(gt.b)(e) : { before: {}, after: Object(gt.b)(this.save()) }; "redo" === n ? this.redoStack.push({ action: t, data: r }) : this.undoStack.push({ action: t, data: r }), this.emit("stackchange", { undoStack: this.undoStack, redoStack: this.redoStack, }); } else console.warn( "请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !", ); }), (e.prototype.getAdjMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"); return ( (n && t) || ((n = un(this.save(), e)), this.set("adjMatrix", n)), n ); }), (e.prototype.getShortestPathMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"), r = this.get("shortestPathMatrix"); return ( (n && t) || ((n = un(this.save(), e)), this.set("adjMatrix", n)), (r && t) || ((r = pn(this.save(), e)), this.set("shortestPathMatrix", r)), r ); }), (e.prototype.on = function (e, n, r) { return t.prototype.on.call(this, e, n, r); }), (e.prototype.destroy = function () { this.clear(), this.clearStack(), this.get("itemController").destroy(), this.get("modeController").destroy(), this.get("viewController").destroy(), this.get("stateController").destroy(), this.get("canvas").destroy(), (this.cfg = null), (this.destroyed = !0), (this.redoStack = null), (this.undoStack = null); }), (e.prototype.createHull = function (t) { if (t.members && !(t.members.length < 1)) { var e = this.get("hullGroup"), n = this.get("hullMap"); if ( (n || ((n = {}), this.set("hullMap", n)), (e && !e.get("destroyed")) || ((e = this.get("group").addGroup({ id: "hullGroup", })).toBack(), this.set("hullGroup", e)), n[t.id]) ) return console.warn("Existed hull id."), n[t.id]; var r = e.addGroup({ id: t.id + "-container" }), i = new Si(this, Object(h.a)(Object(h.a)({}, t), { group: r })); return (n[i.id] = i), i; } console.warn("Create hull failed! The members is empty."); }), (e.prototype.getHulls = function () { return this.get("hullMap"); }), (e.prototype.getHullById = function (t) { return this.get("hullMap")[t]; }), (e.prototype.removeHull = function (t) { var e; (e = Object(gt.x)(t) ? this.getHullById(t) : t), delete this.get("hullMap")[e.id], e.destroy(); }), (e.prototype.removeHulls = function () { var t = this.getHulls(); t && Object.keys(t).length && (Object.keys(t).forEach(function (e) { t[e].destroy(); }), this.set("hullMap", {})); }), (e.prototype.onTick = function (t) { this.get("layoutController").onTick(t), an(this.onTick.bind(this)); }); })(nn.a); function ji(t) { return (ji = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var ki = sn.a.transform, Ei = ["startArrow", "endArrow"], Ni = { lineWidth: 1, stroke: void 0, fill: void 0, lineAppendWidth: 1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, x: 0, y: 0, r: 10, width: 20, height: 20, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, Ti = { edge: { lineWidth: 1, stroke: "#000", lineDash: void 0, startArrow: !1, endArrow: !1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, node: Ni, combo: Ni, }, Pi = { options: {}, itemType: "", type: "", getCustomConfig: function (t) { return {}; }, getOptions: function (t) { return Object(gt.d)( { labelCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, descriptionCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, }, this.options, this.getCustomConfig(t) || {}, t, ); }, draw: function (t, e) { var n = this.drawShape(t, e); (n.set("className", this.itemType + "-shape"), t.label) && this.drawLabel(t, e).set("className", this.itemType + "-label"); return n; }, afterDraw: function (t, e, n) {}, drawShape: function (t, e) { return null; }, drawLabel: function (t, e) { var n = this.getOptions(t).labelCfg || {}, r = this.getLabelStyle(t, n, e), i = r.rotate; delete r.rotate; var o = e.addShape("text", { attrs: r, draggable: !0, className: "text-shape", name: "text-shape", }); if (i) { var a = o.getBBox(), s = o.getMatrix(); if ((s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.rotateCenter)) switch (r.rotateCenter) { case "center": s = ki(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); break; case "lefttop": s = ki(s, [ ["t", -r.x, -r.y], ["r", i], ["t", r.x, r.y], ]); break; case "leftcenter": s = ki(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); break; default: s = ki(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); } else s = ki(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); o.setMatrix(s); } if (r.background) { var u = this.drawLabelBg(t, e, o), c = this.itemType + "-label-bg"; u.set("classname", c), o.toFront(); } return o; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(gt.C)({}, r, t.labelCfg), o = this.getLabelBgStyleByPosition(n, t, i, e); return e.addShape("rect", { name: "text-bg-shape", attrs: o }); }, getLabelStyleByPosition: function (t, e, n) { return { text: t.label }; }, getLabelBgStyleByPosition: function (t, e, n, r) { return {}; }, getLabelStyle: function (t, e, n) { var r = this.getLabelStyleByPosition(t, e, n), i = this.itemType + "Label", o = ur[i] ? ur[i].style : null; return Object(h.a)(Object(h.a)(Object(h.a)({}, o), r), e.style); }, getShapeStyle: function (t) { return t.style; }, update: function (t, e) { this.updateShapeStyle(t, e), this.updateLabel(t, e); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = e.getKeyShape(), i = Object(gt.C)({}, r.attr(), t.style), o = function (t) { var e, o = i[t]; if (Object(gt.w)(o)) { var a = n.find(function (e) { return e.get("name") === t; }); a && a.attr(o); } else r.attr((((e = {})[t] = o), e)); }; for (var a in i) o(a); }, updateLabel: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).labelCfg, i = this.itemType + "-label", o = n.find(function (t) { return t.get("className") === i; }), a = this.itemType + "-label-bg", s = n.find(function (t) { return t.get("classname") === a; }); if (t.label || "" === t.label) if (o) { var u = {}; e.getModel && (u = e.getModel().labelCfg); var c = Object(gt.d)({}, r, u, t.labelCfg), l = this.getLabelStyleByPosition(t, c, n), d = t.labelCfg ? t.labelCfg.style : void 0, f = c.style && c.style.background, p = Object(h.a)(Object(h.a)(Object(h.a)({}, o.attr()), l), d), g = p.rotate; if ((delete p.rotate, g)) { var y = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (y = ki(y, [ ["t", -p.x, -p.y], ["r", g], ["t", p.x, p.y], ])), o.resetMatrix(), o.attr(Object(h.a)(Object(h.a)({}, p), { matrix: y })); } else o.resetMatrix(), o.attr(p); if (s) if (p.background) { var v = this.getLabelBgStyleByPosition(o, t, c, n), m = Object(h.a)(Object(h.a)({}, v), f); if ((s.resetMatrix(), g)) { var b = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (b = ki(b, [ ["t", -m.x, -m.y], ["r", g], ["t", m.x, m.y], ])), (m.matrix = b); } s.attr(m); } else n.removeChild(s); else p.background && ((s = this.drawLabelBg(t, n, o)).set("classname", a), o.toFront()); } else { this.drawLabel(t, n).set("className", i); } }, afterUpdate: function (t, e) {}, setState: function (t, e, n) { var r, i, o = n.get("keyShape"); if (o && !o.destroyed) { var a = n.getType(), s = Object(gt.n)(e) ? t : t + ":" + e, u = this.getStateStyle(s, n), c = n.getStateStyle(s); if (c || u) { var h = Object(gt.C)({}, c || u), l = n.getContainer(), d = { x: 1, y: 1, cx: 1, cy: 1 }; if ( ("combo" === a && ((d.r = 1), (d.width = 1), (d.height = 1)), e) ) { var f = function (t) { var e, n = h[t]; if (Object(gt.w)(n) && !Ei.includes(t)) { var r = l.find(function (e) { return e.get("name") === t; }); r && r.attr(n); } else o.attr((((e = {})[t] = n), e)); }; for (var p in h) f(p); } else { var g = kr(n.getCurrentStatesStyle()), y = n.getModel(), v = Object(gt.C)({}, y.style, kr(n.getOriginStyle())), m = o.get("name"), b = o.attr(), x = {}; Object.keys(b).forEach(function (t) { if ("img" !== t) { var e = b[t]; e && "object" === ji(e) ? (x[t] = Object(gt.b)(e)) : (x[t] = e); } }); var w = {}, O = function (t) { var e = h[t]; if (Object(gt.w)(e) && !Ei.includes(t)) { var n = l.find(function (e) { return e.get("name") === t; }); if (n) { var r = Object(gt.b)(n.attr()); Object(gt.e)(e, function (e, i) { if (t === m && x[i] && !d[i]) { delete x[i]; var s = v[t][i] || Ti[a][i]; o.attr(i, s); } else if (r[i] || 0 === r[i]) { delete r[i]; var u = v[t][i] || Ti[a][i]; n.attr(i, u); } }), (w[t] = r); } } else if (x[t] && !d[t]) { delete x[t]; var i = v[t] || (v[m] ? v[m][t] : void 0) || Ti[a][t]; o.attr(t, i); } }; for (var M in h) O(M); for (var p in (m ? (w[m] = x) : Object(gt.C)(w, x), g)) if (!d[p]) { var S = g[p]; (Object(gt.w)(S) && !Ei.includes(p)) || (m ? (Object(gt.C)(v[m], (((i = {})[p] = S), i)), delete v[p]) : Object(gt.C)(v, (((r = {})[p] = S), r)), delete g[p]); } var C = {}; Object(gt.d)(C, v, w, g); var j = !1, k = function (t) { var e, n, r = C[t]; if (Object(gt.w)(r) && !Ei.includes(t)) { var i = l.find(function (e) { return e.get("name") === t; }); i && (t === m && ("combo" === a && (delete r.r, delete r.width, delete r.height), (j = !0)), i.attr(r)); } else if (!j) { var s = r || Ti[a][t]; "combo" === a ? m || o.attr((((e = {})[t] = s), e)) : o.attr((((n = {})[t] = s), n)); } }; for (var E in C) k(E); } } } }, getStateStyle: function (t, e) { var n = e.getModel(), r = e.getType(), i = this.getOptions(n), o = i.stateStyles, a = i.style, s = void 0 === a ? {} : a, u = n.stateStyles ? n.stateStyles[t] : o && o[t]; return "combo" === r ? Object(gt.b)(u) : Object(gt.C)({}, s, u); }, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { return this.getOptions(t).anchorPoints; }, }, Ii = { itemType: "node", shapeType: "single-node", labelPosition: "center", offset: ur.nodeLabel.offset, getSize: function (t) { var e = t.size || this.getOptions({}).size || ur.defaultNode.size; return ( Object(gt.m)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(gt.m)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition; if ("center" === n) return { x: 0, y: 0, text: t.label }; var r = e.offset; Object(gt.s)(r) && (r = this.offset); var i, o = this.getSize(t), a = o[0], s = o[1]; switch (n) { case "top": i = { x: 0, y: 0 - s / 2 - r, textBaseline: "bottom" }; break; case "bottom": i = { x: 0, y: s / 2 + r, textBaseline: "top" }; break; case "left": i = { x: 0 - a / 2 - r, y: 0, textAlign: "right" }; break; default: i = { x: a / 2 + r, y: 0, textAlign: "left" }; } return (i.text = t.label), i; }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = Br(o.padding), u = i.width + s[1] + s[3], c = i.height + s[0] + s[2], l = n.offset; return ( Object(gt.s)(l) && (l = this.offset), (a = { x: i.minX - s[3], y: i.minY - s[0] }), (a = Object(h.a)(Object(h.a)(Object(h.a)({}, a), o), { width: u, height: c, })) ); }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "node-shape", }); }, updateLinkPoints: function (t, e) { var n, r = this.getOptions(t).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), a = e.find(function (t) { return "link-point-top" === t.get("className"); }), s = e.find(function (t) { return "link-point-bottom" === t.get("className"); }); i && (n = i.attr()), o && !n && (n = o.attr()), a && !n && (n = a.attr()), s && !n && (n = s.attr()), n || (n = r); var u = Object(gt.C)({}, n, t.linkPoints), c = u.fill, l = u.stroke, d = u.lineWidth, f = u.size / 2; f || (f = u.r); var p = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0 }, g = p.left, y = p.right, v = p.top, m = p.bottom, b = this.getSize(t), x = b[0], w = b[1], O = { r: f, fill: c, stroke: l, lineWidth: d }; i ? g || void 0 === g ? i.attr(Object(h.a)(Object(h.a)({}, O), { x: -x / 2, y: 0 })) : i.remove() : g && e.addShape("circle", { attrs: Object(h.a)(Object(h.a)({}, O), { x: -x / 2, y: 0 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), o ? (y || void 0 === y || o.remove(), o.attr(Object(h.a)(Object(h.a)({}, O), { x: x / 2, y: 0 }))) : y && e.addShape("circle", { attrs: Object(h.a)(Object(h.a)({}, O), { x: x / 2, y: 0 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a ? (v || void 0 === v || a.remove(), a.attr(Object(h.a)(Object(h.a)({}, O), { x: 0, y: -w / 2 }))) : v && e.addShape("circle", { attrs: Object(h.a)(Object(h.a)({}, O), { x: 0, y: -w / 2 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), s ? m || void 0 === m ? s.attr(Object(h.a)(Object(h.a)({}, O), { x: 0, y: w / 2 })) : s.remove() : m && e.addShape("circle", { attrs: Object(h.a)(Object(h.a)({}, O), { x: 0, y: w / 2 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, updateShape: function (t, e, n, r) { e.get("keyShape").attr(Object(h.a)({}, n)), this.updateLabel(t, e), r && this.updateIcon(t, e); }, updateIcon: function (t, e) { var n = this, r = e.getContainer(), i = this.getOptions(t).icon, o = (t.icon ? t.icon : { show: void 0 }).show, a = r.find(function (t) { return t.get("className") === n.type + "-icon"; }); if (a) if (o || void 0 === o) { var s = Object(gt.C)({}, a.attr(), i), u = s.width, c = s.height; a.attr( Object(h.a)(Object(h.a)({}, s), { x: -u / 2, y: -c / 2 }), ); } else a.remove(); else if (o) { (u = i.width), (c = i.height); r.addShape("image", { attrs: Object(h.a)(Object(h.a)({}, i), { x: -u / 2, y: -c / 2, }), className: this.type + "-icon", name: this.type + "-icon", }); var l = r.find(function (t) { return "node-label" === t.get("className"); }); l && l.toFront(); } }, }, Bi = Object(h.a)(Object(h.a)({}, Pi), Ii); Zr.registerNode("single-node", Bi); var Ai = { itemType: "edge", labelPosition: "center", refX: 0, refY: 0, labelAutoRotate: !1, options: { size: ur.defaultEdge.size, style: { x: 0, y: 0, stroke: ur.defaultEdge.style.stroke, lineAppendWidth: ur.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: ur.edgeLabel.style.fill, fontSize: ur.edgeLabel.style.fontSize, }, }, stateStyles: Object(h.a)({}, ur.edgeStateStyles), }, getPath: function (t) { var e = []; return ( Object(gt.e)(t, function (t, n) { 0 === n ? e.push(["M", t.x, t.y]) : e.push(["L", t.x, t.y]); }), e ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(gt.C)({}, e, n, t.style), i = t.size || ur.defaultEdge.size, o = (t = this.getPathPoints(t)).startPoint, a = t.endPoint, s = this.getControlPoints(t), u = [o]; s && (u = u.concat(s)), u.push(a); var c = this.getPath(u); return Object(gt.C)( {}, ur.defaultEdge.style, { stroke: ur.defaultEdge.color, lineWidth: i, path: c }, r, ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, a = (t = this.getPathPoints(t)).startPoint, s = t.endPoint, u = this.getControlPoints(t), c = [a]; u && (c = c.concat(u)), c.push(s); var h = i.attr(), l = Object(gt.C)({}, r, h, t.style), d = t.sourceNode, f = t.targetNode, p = { radius: l.radius }; u || (p = { source: d, target: f, offset: l.offset, radius: l.radius, }), h.endArrow && !1 === l.endArrow && (t.style.endArrow = { path: "" }), h.startArrow && !1 === l.startArrow && (t.style.startArrow = { path: "" }); var g = this.getPath(c, p), y = Object(gt.C)(r, i.attr(), { lineWidth: o, path: g }, t.style); i && i.attr(y); }, getLabelStyleByPosition: function (t, e, n) { var r, i = e.position || this.labelPosition, o = {}, a = n && n.find(function (t) { return "edge-shape" === t.get("className"); }); r = "start" === i ? 0 : "end" === i ? 1 : 0.5; var s, u = e.refX || this.refX, c = e.refY || this.refY; if ( t.startPoint.x === t.endPoint.x && t.startPoint.y === t.endPoint.y ) return ( (o.x = t.startPoint.x + u), (o.y = t.startPoint.y + c), (o.text = t.label), o ); s = Object(gt.s)(e.autoRotate) ? this.labelAutoRotate : e.autoRotate; var h = vr(a, r, u, c, s); return ( (o.x = h.x), (o.y = h.y), (o.rotate = h.rotate), (o.textAlign = this._getTextAlign(i, h.angle)), (o.text = t.label), o ); }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = o.padding, u = i.width + s[1] + s[3], c = i.height + s[0] + s[2], l = n.position || this.labelPosition, d = Object(h.a)(Object(h.a)({}, o), { width: u, height: c, x: i.minX - s[2], y: i.minY - s[0], rotate: 0, }); a = Object(gt.s)(n.autoRotate) ? this.labelAutoRotate : n.autoRotate; var f, p = r && r.find(function (t) { return "edge-shape" === t.get("className"); }); f = "start" === l ? 0 : "end" === l ? 1 : 0.5; var g = n.refX || this.refX, y = n.refY || this.refY; if ( e.startPoint.x === e.endPoint.x && e.startPoint.y === e.endPoint.y ) return ( (d.x = e.startPoint.x + g - u / 2), (d.y = e.startPoint.y + y - c / 2), d ); var v = vr(p, f, g - u / 2, y + c / 2, a), m = v.angle; return ( m > 0.5 * Math.PI && m < 1.5 * Math.PI && (v = vr(p, f, g + u / 2, y + c / 2, a)), a && ((d.x = v.x), (d.y = v.y)), (d.rotate = v.rotate), d ); }, _getTextAlign: function (t, e) { var n = "center"; return e ? ((e %= 2 * Math.PI), "center" !== t && (n = (e >= 0 && e <= Math.PI / 2) || (e >= 1.5 * Math.PI && e < 2 * Math.PI) ? t : (function (t) { var e = t; return ( "start" === t ? (e = "end") : "end" === t && (e = "start"), e ); })(t)), n) : t; }, getControlPoints: function (t) { return t.controlPoints; }, getPathPoints: function (t) { return t; }, drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }); }, drawLabel: function (t, e) { var n, r = this.options.labelCfg; n = ("undefined" != typeof window && void 0 !== window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif"; var i = Object(gt.d)({ fontFamily: n }, r, t.labelCfg), o = this.getLabelStyle(t, i, e), a = o.rotate; delete o.rotate; var s = e.addShape("text", { attrs: o, name: "text-shape" }); if ((a && s.rotateAtStart(a), o.background)) { var u = this.drawLabelBg(t, e, s), c = this.itemType + "-label-bg"; u.set("classname", c), s.toFront(); } return s; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(gt.d)({}, r, t.labelCfg), o = this.getLabelStyle(t, i, e).rotate, a = this.getLabelBgStyleByPosition(n, t, i, e); delete a.rotate; var s = e.addShape("rect", { name: "text-bg-shape", attrs: a }); return o && s.rotateAtStart(o), s; }, }, Li = Object(h.a)(Object(h.a)({}, Pi), Ai); Zr.registerEdge("single-edge", Li), Zr.registerEdge( "line", { getControlPoints: function () {} }, "single-edge", ), Zr.registerEdge( "spline", { getPath: function (t) { return oi(t); }, }, "single-edge", ), Zr.registerEdge( "arc", { curveOffset: 20, clockwise: 1, getControlPoints: function (t) { var e, n, r = t.startPoint, i = t.endPoint, o = (r.x + i.x) / 2, a = (r.y + i.y) / 2; if (void 0 !== t.controlPoints) { if ( ((n = t.controlPoints[0]), (e = In(r, n, i)), r.x <= i.x && r.y > i.y ? (this.clockwise = e.x > n.x ? 0 : 1) : r.x <= i.x && r.y < i.y ? (this.clockwise = e.x > n.x ? 1 : 0) : r.x > i.x && r.y <= i.y ? (this.clockwise = e.y < n.y ? 0 : 1) : (this.clockwise = e.y < n.y ? 1 : 0), (n.x - r.x) / (n.y - r.y) == (i.x - r.x) / (i.y - r.y)) ) return []; } else { void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), Object(gt.m)(t.curveOffset) && (t.curveOffset = t.curveOffset[0]), t.curveOffset < 0 ? (this.clockwise = 0) : (this.clockwise = 1); var s = { x: i.x - r.x, y: i.y - r.y }, u = Math.atan2(s.y, s.x); (n = { x: t.curveOffset * Math.cos(-Math.PI / 2 + u) + o, y: t.curveOffset * Math.sin(-Math.PI / 2 + u) + a, }), (e = In(r, n, i)); } var c = Bn(r, e); return [{ x: c, y: c }]; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), 2 === t.length ? e.push(["L", t[1].x, t[1].y]) : e.push([ "A", t[1].x, t[1].y, 0, 0, this.clockwise, t[2].x, t[2].y, ]), e ); }, }, "single-edge", ), Zr.registerEdge( "quadratic", { curvePosition: 0.5, curveOffset: -20, getControlPoints: function (t) { var e = t.controlPoints; if (!e || !e.length) { var n = t.startPoint, r = t.endPoint; void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(gt.m)(this.curveOffset) && (t.curveOffset = t.curveOffset[0]), Object(gt.m)(this.curvePosition) && (t.curvePosition = t.curveOffset[0]), (e = [ai(n, r, t.curvePosition, t.curveOffset)]); } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["Q", t[1].x, t[1].y, t[2].x, t[2].y]), e ); }, }, "single-edge", ), Zr.registerEdge( "cubic", { curvePosition: [0.5, 0.5], curveOffset: [-20, 20], getControlPoints: function (t) { var e = t.controlPoints; if ( (void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(gt.t)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(gt.t)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]), !e || !e.length || e.length < 2) ) { var n = t.startPoint, r = t.endPoint; e = [ ai(n, r, t.curvePosition[0], t.curveOffset[0]), ai(n, r, t.curvePosition[1], t.curveOffset[1]), ]; } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["C", t[1].x, t[1].y, t[2].x, t[2].y, t[3].x, t[3].y]), e ); }, }, "single-edge", ), Zr.registerEdge( "cubic-vertical", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(gt.t)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(gt.t)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(gt.t)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.y - e.y, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x, y: e.y + r * this.curvePosition[0] + i[0] }, { x: n.x, y: n.y - r * this.curvePosition[1] + i[1] }, ] ); }, }, "cubic", ), Zr.registerEdge( "cubic-horizontal", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(gt.t)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(gt.t)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(gt.t)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.x - e.x, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x + r * this.curvePosition[0] + i[0], y: e.y }, { x: n.x - r * this.curvePosition[1] + i[1], y: n.y }, ] ); }, }, "cubic", ), Zr.registerEdge( "loop", { getPathPoints: function (t) { return yr(t); }, getControlPoints: function (t) { return t.controlPoints; }, afterDraw: function (t) { t.controlPoints = void 0; }, afterUpdate: function (t) { t.controlPoints = void 0; }, }, "cubic", ); var Di = { itemType: "combo", shapeType: "single-combo", labelPosition: "top", refX: ur.comboLabel.refX, refY: ur.comboLabel.refY, options: { style: { stroke: ur.defaultCombo.style.stroke, fill: ur.defaultCombo.style.fill, lineWidth: ur.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: ur.comboLabel.style.fill, fontSize: ur.comboLabel.style.fontSize, }, }, stateStyles: Object(h.a)({}, ur.comboStateStyles), }, getSize: function (t) { var e = Object(gt.b)( t.size || this.options.size || ur.defaultCombo.size, ); return ( Object(gt.m)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(gt.m)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(gt.m)(i) && (i = i[0]); var o = e.refX, a = e.refY; Object(gt.s)(o) && (o = this.refX), Object(gt.s)(a) && (a = this.refY); var s, u = this.getSize(t), c = (Math.max(r.r, u[0] / 2) || u[0] / 2) + i; switch (n) { case "top": s = { x: 0, y: -c - a, textBaseline: "bottom", textAlign: "center", }; break; case "bottom": s = { x: 0, y: c + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: -c + o, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: c + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "combo-shape", }); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(h.a)({}, n)), this.updateLabel(t, e); }, }, _i = Object(h.a)(Object(h.a)({}, Pi), Di); Zr.registerCombo("single-combo", _i), Zr.registerCombo( "circle", { options: { size: [ur.defaultCombo.size[0], ur.defaultCombo.size[0]], padding: ur.defaultCombo.padding[0], animate: !0, style: { stroke: ur.defaultCombo.style.stroke, fill: ur.defaultCombo.style.fill, lineWidth: ur.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: ur.comboLabel.style.fill, fontSize: ur.comboLabel.style.fontSize, }, refX: 0, refY: 0, }, stateStyles: Object(h.a)({}, ur.comboStateStyles), }, shapeType: "circle", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( delete n.height, delete n.width, e.addShape("circle", { attrs: n, className: "circle-combo", name: "circle-combo", draggable: !0, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(gt.m)(n) && (n = n[0]); var r, i = { stroke: t.color }, o = Object(gt.C)({}, e, i, t.style); if (t.fixSize) r = Object(gt.t)(t.fixSize) ? t.fixSize : t.fixSize[0]; else { var a = this.getSize(t); r = !Object(gt.t)(o.r) || isNaN(o.r) ? a[0] / 2 || ur.defaultCombo.style.r : Math.max(o.r, a[0] / 2) || a[0] / 2; } o.r = r + n; var s = Object(h.a)({ x: 0, y: 0 }, o); return t.style ? (t.style.r = r) : (t.style = { r: r }), s; }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(gt.m)(r) && (r = r[0]); var i, o = Object(gt.b)(t.style); (i = t.fixSize ? Object(gt.t)(t.fixSize) ? t.fixSize : t.fixSize[0] : Math.max(o.r, n[0] / 2) || n[0] / 2), (o.r = i + r); var a = e.get("sizeCache"); a && (a.r = o.r); var s = { stroke: t.color }, u = e.get("keyShape"), c = Object(gt.C)({}, u.attr(), s, o); t.style ? (t.style.r = i) : (t.style = { r: i }), this.updateShape(t, e, c, !0); }, }, "single-combo", ), Zr.registerCombo( "rect", { options: { size: [40, 5], padding: [25, 20, 15, 20], animate: !0, style: { radius: 0, stroke: ur.defaultCombo.style.stroke, fill: ur.defaultCombo.style.fill, lineWidth: ur.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: ur.comboLabel.style.fill, fontSize: ur.comboLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(h.a)({}, ur.comboStateStyles), }, shapeType: "rect", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "rect-combo", name: "rect-combo", draggable: !0, }); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(gt.t)(i) && (i = [i, i, i, i]); var o = e.refX, a = e.refY; Object(gt.s)(o) && (o = this.refX), Object(gt.s)(a) && (a = this.refY); var s, u = r.width / 2 + i[3], c = r.height / 2 + i[0]; switch (n) { case "top": s = { x: 0 - u + o, y: 0 - c + a, textBaseline: "top", textAlign: "left", }; break; case "bottom": s = { x: 0, y: c + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: 0 - u + a, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: u + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(gt.t)(n) && (n = [n, n, n, n]); var r, i, o = { stroke: t.color }, a = Object(gt.C)({}, e, o, t.style), s = this.getSize(t), u = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; u ? Object(gt.t)(u) ? ((r = u), (i = u)) : ((r = u[0]), (i = u[1])) : ((r = !Object(gt.t)(a.width) || isNaN(a.width) ? s[0] || ur.defaultCombo.style.width : Math.max(a.width, s[0]) || s[0]), (i = !Object(gt.t)(a.height) || isNaN(a.height) ? s[1] || ur.defaultCombo.style.height : Math.max(a.height, s[1]) || s[1])); var c = -r / 2 - n[3], l = -i / 2 - n[0]; (a.width = r + n[1] + n[3]), (a.height = i + n[0] + n[2]); var d = Object(h.a)({ x: c, y: l }, a); return ( t.style ? ((t.style.width = r), (t.style.height = i)) : (t.style = { width: r, height: i }), d ); }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(gt.t)(r) && (r = [r, r, r, r]); var i, o, a = Object(gt.b)(t.style), s = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; s ? Object(gt.t)(s) ? ((i = s), (o = s)) : ((i = s[0]), (o = s[1])) : ((i = Math.max(a.width, n[0]) || n[0]), (o = Math.max(a.height, n[1]) || n[1])), (a.width = i + r[1] + r[3]), (a.height = o + r[0] + r[2]); var u = e.get("sizeCache"); u && ((u.width = a.width), (u.height = a.height)), (a.x = -i / 2 - r[3]), (a.y = -o / 2 - r[0]); var c = { stroke: t.color }, h = e.get("keyShape"), l = Object(gt.C)({}, h.attr(), c, a); t.style ? ((t.style.width = i), (t.style.height = o)) : (t.style = { width: i, height: o }), this.updateShape(t, e, l, !1); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(h.a)({}, n)), this.updateLabel(t, e); }, }, "single-combo", ), Zr.registerNode( "simple-circle", { options: { size: ur.defaultNode.size, style: { x: 0, y: 0, stroke: ur.defaultNode.style.stroke, fill: ur.defaultNode.style.fill, lineWidth: ur.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: ur.nodeLabel.style.fill, fontSize: ur.nodeLabel.style.fontSize, }, }, stateStyles: Object(h.a)({}, ur.nodeStateStyles), }, shapeType: "simple-circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("circle", { attrs: n, className: this.type + "-keyShape", draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(gt.d)({}, e, n), i = this.getSize(t)[0] / 2; return Object(h.a)({ x: 0, y: 0, r: i }, r); }, update: function (t, e) { var n = this.getSize(t), r = { stroke: t.color, r: n[0] / 2 }, i = e.get("keyShape"), o = Object(gt.d)({}, i.attr(), r, t.style); this.updateShape(t, e, o, !0); }, }, "single-node", ), Zr.registerNode( "simple-rect", { options: { size: [100, 30], style: { radius: 0, stroke: ur.defaultNode.style.stroke, fill: ur.defaultNode.style.fill, lineWidth: ur.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: ur.nodeLabel.style.fill, fontSize: ur.nodeLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(h.a)({}, ur.nodeStateStyles), }, shapeType: "simple-rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: this.type + "-keyShape", name: this.type + "-keyShape", draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(gt.C)({}, e, n), i = this.getSize(t), o = r.width || i[0], a = r.height || i[1]; return Object(h.a)( { x: -o / 2, y: -a / 2, width: o, height: a }, r, ); }, update: function (t, e) { e.getContainer(); var n = this.getOptions({}).style, r = this.getSize(t), i = e.get("keyShape"); t.size || ((r[0] = i.attr("width") || n.width), (r[1] = i.attr("height") || n.height)); var o = { stroke: t.color, x: -r[0] / 2, y: -r[1] / 2, width: r[0], height: r[1], }, a = Object(gt.C)({}, n, i.attr(), o); (a = Object(gt.C)(a, t.style)), this.updateShape(t, e, a, !1); }, }, "single-node", ), Zr.registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: !1, type: "circle", r: 50, rx: 50, ry: 35, width: 50, height: 35, points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], x: 0, y: 0, }, }, shapeType: "image", labelPosition: "bottom", drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); delete r.fill; var i = e.addShape(n, { attrs: r, className: this.type + "-keyShape", name: this.type + "-keyShape", draggable: !0, }); return this.drawClip(t, i), i; }, drawClip: function (t, e) { var n = this.getOptions(t).clipCfg; if (n.show) { var r = n.type, i = n.x, o = n.y, a = n.style; if ("circle" === r) { var s = n.r; e.setClip({ type: "circle", attrs: Object(h.a)({ r: s, x: i, y: o }, a), }); } else if ("rect" === r) { var u = n.width, c = n.height, l = i - u / 2, d = o - c / 2; e.setClip({ type: "rect", attrs: Object(h.a)({ x: l, y: d, width: u, height: c }, a), }); } else if ("ellipse" === r) { var f = n.rx, p = n.ry; e.setClip({ type: "ellipse", attrs: Object(h.a)({ x: i, y: o, rx: f, ry: p }, a), }); } else if ("polygon" === r) { var g = n.points; e.setClip({ type: "polygon", attrs: Object(h.a)({ points: g }, a), }); } else if ("path" === r) { var y = n.path; e.setClip({ type: "path", attrs: Object(h.a)({ path: y }, a), }); } } }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = this.getSize(t), r = this.getOptions(t).img, i = n[0], o = n[1]; return ( e && ((i = e.width || n[0]), (o = e.height || n[1])), Object(h.a)( { x: -i / 2, y: -o / 2, width: i, height: o, img: r }, e, ) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = this.itemType + "-shape", i = n.find(function (t) { return t.get("className") === r; }) || e.getKeyShape(), o = this.getShapeStyle(t); i && i.attr(o); }, }, "single-node", ); var Ri, Yi = Zr, Fi = [ "#5F95FF", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4", ], zi = sn.a.transform, Xi = Object(h.a)( Object(h.a)( Object(h.a)(Object(h.a)(Object(h.a)(Object(h.a)({}, a), o), s), i), u, ), { transform: zi, mat3: sn.b }, ); !(function () { function t(t) { (this.graph = t), (this.layoutCfg = t.get("layout") || {}), (this.layoutType = this.getLayoutType()), (this.layoutMethods = []), this.initLayout(); } (t.prototype.initLayout = function () {}), (t.prototype.getLayoutType = function () { return this.getLayoutCfgType(this.layoutCfg); }), (t.prototype.getLayoutCfgType = function (t) { var e = t.type; if (e) return e; var n = t.pipes; return Array.isArray(n) ? n.map(function (t) { return (null == t ? void 0 : t.type) || ""; }) : null; }), (t.prototype.isLayoutTypeSame = function (t) { var e = this.getLayoutCfgType(t); return Array.isArray(this.layoutType) ? this.layoutType.every(function (t, n) { return t === e[n]; }) : (null == t ? void 0 : t.type) === this.layoutType; }), (t.prototype.refreshLayout = function () { var t = this.graph; t && (t.get("animate") ? t.positionsAnimate() : t.refreshPositions()); }), (t.prototype.changeLayout = function (t) { (this.layoutCfg = t), this.destoryLayoutMethods(), this.layout(); }), (t.prototype.changeData = function () { this.destoryLayoutMethods(), this.layout(); }), (t.prototype.destoryLayoutMethods = function () { var t = this.layoutMethods; null == t || t.forEach(function (t) { t.destroy(); }), (this.layoutMethods = []); }), (t.prototype.destroyLayout = function () { var t = this.graph; this.destoryLayoutMethods(), t.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0); }), (t.prototype.setDataFromGraph = function () { for ( var t = [], e = [], n = [], r = [], i = [], o = [], a = this.graph.getNodes(), s = this.graph.getEdges(), u = this.graph.getCombos(), c = a.length, h = 0; h < c; h++ ) { var l = a[h]; if (l && !l.destroyed) { var d = l.getModel(); l.isVisible() ? t.push(d) : e.push(d); } } var f = s.length; for (h = 0; h < f; h++) { var p = s[h]; if (p && !p.destroyed) { d = p.getModel(); p.isVisible() ? d.isComboEdge ? i.push(d) : n.push(d) : r.push(d); } } var g = u.length; for (h = 0; h < g; h++) { var y = u[h]; if (!y.destroyed) { d = y.getModel(); y.isVisible() ? o.push(d) : r.push(d); } } return { nodes: t, hiddenNodes: e, edges: n, hiddenEdges: r, combos: o, hiddenCombos: [], comboEdges: i, }; }), (t.prototype.reLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; (e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), t.init(n.data), "force" === a && ((t.ticking = !1), t.forceSimulation.stop()), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (t.prototype.relayout = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = this.layoutCfg; if (t) { this.data = this.setDataFromGraph(); var o = this.data.nodes; if (!o) return !1; this.initPositions(i.center, o); } n.emit("beforelayout"); var a = Promise.resolve(); null == r || r.forEach(function (t, n) { var r = i[n]; a = a.then(function () { return e.reLayoutMethod(t, r); }); }), a .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("relayout failed", t); }); }), (t.prototype.filterLayoutData = function (t, e) { var n, r, i = t.nodes, o = t.edges, a = Object(h.e)(t, ["nodes", "edges"]); if (!i) return t; if ( ((n = Object(gt.r)(null == e ? void 0 : e.nodesFilter) ? e.nodesFilter : function () { return !0; }), Object(gt.r)(null == e ? void 0 : e.edgesFilter)) ) r = e.edgesFilter; else { var s = i.reduce(function (t, e) { return (t[e.id] = !0), t; }, {}); r = function (t) { return s[t.source] && s[t.target]; }; } return Object(h.a)({ nodes: i.filter(n), edges: o.filter(r) }, a); }), (t.prototype.getLayoutBBox = function (t) { var e = this.graph, n = Object(gt.j)(e.getNodes(), function (t) { return t.getModel().layoutOrder; }), r = Object.values(n).map(function (t) { var e = _r(t); return (e.size = [e.width, e.height]), e; }); return { groupNodes: Object.values(Object(gt.j)(t, "layoutOrder")), layoutNodes: r, }; }), (t.prototype.layoutAnimate = function () {}), (t.prototype.moveToZero = function () { var t = this.graph.get("data").nodes; if (void 0 !== t[0].x && null !== t[0].x && !Dr(t[0].x)) { for (var e = [0, 0], n = t.length, r = 0; r < n; r++) { var i = t[r]; (e[0] += i.x), (e[1] += i.y); } (e[0] /= t.length), (e[1] /= t.length); for (r = 0; r < n; r++) { ((i = t[r]).x -= e[0]), (i.y -= e[1]); } } }), (t.prototype.initPositions = function (t, e) { var n = this.graph; if (!e) return !1; var r = e ? e.length : 0; if (r) { var i = 0.85 * n.get("width"), o = 0.85 * n.get("height"), a = Math.ceil(Math.sqrt(r) * (i / o)), s = i / (a - 1), u = o / (Math.ceil(r / a) - 1); (isFinite(s) && s) || (s = 0), (isFinite(u) && s) || (u = 0); for ( var c = t[0] - i / 2, h = t[1] - o / 2, l = !0, d = 0; d < r; d++ ) { var f = e[d]; Dr(f.x) && ((l = !1), (f.x = (d % a) * s + c)), Dr(f.y) && ((l = !1), (f.y = Math.floor(d / a) * u + h)); } return l; } }), (t.prototype.destroy = function () { (this.graph = null), this.destoryLayoutMethods(), (this.destroyed = !0); }), (t.prototype.onTick = function (t) { var e; null === (e = this.layoutMethods) || void 0 === e || e.forEach(function (e) { null == e || e.onTick(t); }); }); })(); !(function (t) { (t.CLICK = "click"), (t.DBLCLICK = "dblclick"), (t.TAP = "tap"), (t.DBLTAP = "dbltap"), (t.DRAGSTART = "dragstart"), (t.DRAGEND = "dragend"), (t.DRAG = "drag"), (t.DRAGENTER = "dragenter"), (t.DRAGLEAVE = "dragleave"), (t.DRAGOVER = "dragover"), (t.DRAGOUT = "dragout"), (t.DDROP = "drop"), (t.PINCHSTART = "pinchstart"), (t.PINCHMOVE = "pinchmove"), (t.PANSTART = "panstart"), (t.PANMOVE = "panmove"), (t.PANEND = "panend"), (t.PRESS = "press"), (t.ACTION_END = "actionend"), (t.TOUCHSTART = "touchstart"), (t.TOUCHMOVE = "touchmove"), (t.TOUCHEND = "touchend"), (t.CANVAS_TOUCHSTART = "canvas:touchstart"), (t.CANVAS_TOUCHMOVE = "canvas:touchmove"), (t.CANVAS_TOUCHEND = "canvas:touchend"), (t.NODE_TOUCHSTART = "node:touchstart"), (t.NODE_TOUCHMOVE = "node:touchmove"), (t.NODE_TOUCHEND = "node:touchend"), (t.COMBO_TOUCHSTART = "combo:touchstart"), (t.COMBO_TOUCHMOVE = "combo:touchmove"), (t.COMBO_TOUCHEND = "combo:touchend"), (t.EDGE_TOUCHSTART = "edge:touchstart"), (t.EDGE_TOUCHMOVE = "edge:touchmove"), (t.EDGE_TOUCHEND = "edge:touchend"), (t.NODE_CLICK = "node:click"), (t.NODE_DBLCLICK = "node:dblclick"), (t.NODE_DROP = "node:drop"), (t.NODE_DRAGOVER = "node:dragover"), (t.NODE_DRAGENTER = "node:dragenter"), (t.NODE_DRAGLEAVE = "node:dragleave"), (t.NODE_DRAGSTART = "node:dragstart"), (t.NODE_DRAG = "node:drag"), (t.NODE_DRAGEND = "node:dragend"), (t.NODE_TAP = "node:tap"), (t.NODE_DBLTAP = "node:dbltap"), (t.NODE_PANSTART = "node:panstart"), (t.NODE_PANMOVE = "node:panmove"), (t.NODE_PANEND = "node:panend"), (t.NODE_PRESS = "node:press"), (t.COMBO_CLICK = "combo:click"), (t.COMBO_DBLCLICK = "combo:dblclick"), (t.COMBO_DROP = "combo:drop"), (t.COMBO_DRAGOVER = "combo:dragover"), (t.COMBO_DRAGENTER = "combo:dragenter"), (t.COMBO_DRAGLEAVE = "combo:dragleave"), (t.COMBO_DRAGSTART = "combo:dragstart"), (t.COMBO_DRAG = "combo:drag"), (t.COMBO_DRAGEND = "combo:dragend"), (t.COMBO_TAP = "combo:tap"), (t.COMBO_DBLTAP = "combo:dbltap"), (t.COMBO_PANSTART = "combo:panstart"), (t.COMBO_PANMOVE = "combo:panmove"), (t.COMBO_PANEND = "combo:panend"), (t.COMBO_PRESS = "combo:press"), (t.EDGE_CLICK = "edge:click"), (t.EDGE_DBLCLICK = "edge:dblclick"), (t.EDGE_DROP = "edge:drop"), (t.EDGE_DRAGOVER = "edge:dragover"), (t.EDGE_DRAGENTER = "edge:dragenter"), (t.EDGE_DRAGLEAVE = "edge:dragleave"), (t.EDGE_TAP = "edge:tap"), (t.EDGE_DBLTAP = "edge:dbltap"), (t.EDGE_PRESS = "edge:press"), (t.CANVAS_CLICK = "canvas:click"), (t.CANVAS_DBLCLICK = "canvas:dblclick"), (t.CANVAS_DROP = "canvas:drop"), (t.CANVAS_DRAGENTER = "canvas:dragenter"), (t.CANVAS_DRAGLEAVE = "canvas:dragleave"), (t.CANVAS_DRAGSTART = "canvas:dragstart"), (t.CANVAS_DRAG = "canvas:drag"), (t.CANVAS_DRAGEND = "canvas:dragend"), (t.CANVAS_TAP = "canvas:tap"), (t.CANVAS_DBLTAP = "canvas:dbltap"), (t.CANVAS_PANSTART = "canvas:panstart"), (t.CANVAS_PANMOVE = "canvas:panmove"), (t.CANVAS_PANEND = "canvas:panend"), (t.CANVAS_PRESS = "canvas:press"), (t.BEFORERENDER = "beforerender"), (t.AFTERRENDER = "afterrender"), (t.BEFOREADDITEM = "beforeadditem"), (t.AFTERADDITEM = "afteradditem"), (t.BEFOREREMOVEITEM = "beforeremoveitem"), (t.AFTERREMOVEITEM = "afterremoveitem"), (t.BEFOREUPDATEITEM = "beforeupdateitem"), (t.AFTERUPDATEITEM = "afterupdateitem"), (t.BEFOREITEMVISIBILITYCHANGE = "beforeitemvisibilitychange"), (t.AFTERITEMVISIBILITYCHANGE = "afteritemvisibilitychange"), (t.BEFOREITEMSTATECHANGE = "beforeitemstatechange"), (t.AFTERITEMSTATECHANGE = "afteritemstatechange"), (t.BEFOREITEMREFRESH = "beforeitemrefresh"), (t.AFTERITEMREFRESH = "afteritemrefresh"), (t.BEFOREITEMSTATESCLEAR = "beforeitemstatesclear"), (t.AFTERITEMSTATESCLEAR = "afteritemstatesclear"), (t.BEFOREMODECHANGE = "beforemodechange"), (t.AFTERMODECHANGE = "aftermodechange"), (t.BEFORELAYOUT = "beforelayout"), (t.AFTERLAYOUT = "afterlayout"), (t.BEFORECREATEEDGE = "beforecreateedge"), (t.AFTERCREATEEDGE = "aftercreateedge"), (t.BEFOREGRAPHREFRESHPOSITION = "beforegraphrefreshposition"), (t.AFTERGRAPHREFRESHPOSITION = "aftergraphrefreshposition"), (t.BEFOREGRAPHREFRESH = "beforegraphrefresh"), (t.AFTERGRAPHREFRESH = "aftergraphrefresh"), (t.BEFOREANIMATE = "beforeanimate"), (t.AFTERANIMATE = "afteranimate"), (t.BEFOREPAINT = "beforepaint"), (t.AFTERPAINT = "afterpaint"), (t.BEFORECOLLAPSEEXPANDCOMBO = "beforecollapseexpandcombo"), (t.AFTERCOLLAPSEEXPANDCOMBO = "aftercollapseexpandcombo"), (t.GRAPHSTATECHANGE = "graphstatechange"), (t.AFTERACTIVATERELATIONS = "afteractivaterelations"), (t.NODESELECTCHANGE = "nodeselectchange"), (t.TOOLTIPCHANGE = "tooltipchange"), (t.WHEELZOOM = "wheelzoom"), (t.VIEWPORTCHANGE = "viewportchange"), (t.DRAGNODEEND = "dragnodeend"), (t.STACKCHANGE = "stackchange"); })(Ri || (Ri = {})); Yi.registerNode, Yi.registerEdge, Yi.registerCombo, en.registerBehavior, Yi.registerNode, Yi.registerEdge, Yi.registerCombo, en.registerBehavior; var Wi = Xi.pointLineDistance, Gi = { stroke: "#FA8C16", lineWidth: 1 }, qi = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { line: Gi, itemAlignType: "center", tolerance: 5, horizontalLines: {}, verticalLines: {}, alignLines: [], }; }), (e.prototype.init = function () {}), (e.prototype.getEvents = function () { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", }; }), (e.prototype.onDragStart = function () { this.initBoxLine(); }), (e.prototype.onDrag = function (t) { var e = t.item, n = (e.get("delegateShape") || e).getBBox(), r = e.getModel(), i = r.x - n.x, o = r.y - n.y; this.show( { x: n.minX + i, y: n.minY + o }, { width: n.width, height: n.height }, ); }), (e.prototype.onDragEnd = function () { this.destory(); }), (e.prototype.initBoxLine = function () { var t = this._cfgs, e = t.horizontalLines, n = t.verticalLines, r = t.itemAlignType; this.get("graph") .getNodes() .forEach(function (t) { var i = t.getBBox(), o = t.get("id"); !0 === r || "horizontal" === r ? ((e[o + "tltr"] = [i.minX, i.minY, i.maxX, i.minY, t]), (e[o + "lcrc"] = [ i.minX, i.centerY, i.maxX, i.centerY, t, ]), (e[o + "blbr"] = [i.minX, i.maxY, i.maxX, i.maxY, t])) : "center" === r && (e[o + "lcrc"] = [ i.minX, i.centerY, i.maxX, i.centerY, t, ]), !0 === r || "vertical" === r ? ((n[o + "tlbl"] = [i.minX, i.minY, i.minX, i.maxY, t]), (n[o + "tcbc"] = [ i.centerX, i.minY, i.centerX, i.maxY, t, ]), (n[o + "trbr"] = [i.maxX, i.minY, i.maxX, i.maxY, t])) : "center" === r && (n[o + "tcbc"] = [ i.centerX, i.minY, i.centerX, i.maxY, t, ]); }); }), (e.prototype.show = function (t, e) { var n = Object(gt.C)({}, t); return this.itemAlign(t, e, n), t; }), (e.prototype.itemAlign = function (t, e, n) { var r = this, i = this._cfgs, o = i.horizontalLines, a = i.verticalLines, s = i.tolerance, u = { x: n.x + e.width / 2, y: n.y }, c = { x: n.x + e.width / 2, y: n.y + e.height / 2 }, h = { x: n.x + e.width / 2, y: n.y + e.height }, l = { x: n.x, y: n.y + e.height / 2 }, d = { x: n.x + e.width, y: n.y + e.height / 2 }, f = [], p = [], g = null; if ( (this.clearAlignLine(), Object(gt.e)(o, function (t) { t[4].isVisible && (f.push(r.getLineDisObject(t, u)), f.push(r.getLineDisObject(t, c)), f.push(r.getLineDisObject(t, h))); }), Object(gt.e)(a, function (t) { t[4].isVisible && (p.push(r.getLineDisObject(t, l)), p.push(r.getLineDisObject(t, c)), p.push(r.getLineDisObject(t, d))); }), f.sort(function (t, e) { return t.dis - e.dis; }), p.sort(function (t, e) { return t.dis - e.dis; }), 0 !== f.length && f[0].dis < s) ) { (t.y = f[0].line[1] - f[0].point.y + n.y), (g = { type: "item", horizontals: [f[0]] }); for (var y = 1; y < 3; y++) f[0].dis === f[y].dis && g.horizontals.push(f[y]); } if (0 !== p.length && p[0].dis < s) { (t.x = p[0].line[0] - p[0].point.x + n.x), g ? (g.verticals = [p[0]]) : (g = { type: "item", verticals: [p[0]] }); for (y = 1; y < 3; y++) p[0].dis === p[y].dis && g.verticals.push(p[y]); } g && ((g.bbox = e), this.addAlignLine(g)); }), (e.prototype.addAlignLine = function (t) { var e = t.bbox, n = t.type, r = t.horizontals, i = t.verticals, o = this._cfgs, a = o.line, s = o.alignLines, u = this.get("graph").get("group"); "item" === n && (r && Object(gt.e)(r, function (t) { var n, r, i = t.line, o = t.point, c = (i[0] + i[2]) / 2; o.x < c ? ((n = o.x - e.width / 2), (r = Math.max(i[0], i[2]))) : ((n = o.x + e.width / 2), (r = Math.min(i[0], i[2]))); var h = Object(gt.C)( { x1: n, y1: i[1], x2: r, y2: i[1] }, a, ), l = u.addShape("line", { attrs: h, capture: !1 }); s.push(l); }), i && Object(gt.e)(i, function (t) { var n, r, i = t.line, o = t.point, c = (i[1] + i[3]) / 2; o.y < c ? ((n = o.y - e.height / 2), (r = Math.max(i[1], i[3]))) : ((n = o.y + e.height / 2), (r = Math.min(i[1], i[3]))); var h = Object(gt.C)( { x1: i[0], y1: n, x2: i[0], y2: r }, a, ), l = u.addShape("line", { attrs: h, capture: !1 }); s.push(l); })); }), (e.prototype.getLineDisObject = function (t, e) { return { line: t, point: e, dis: Wi(t, e) }; }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.clearAlignLine = function () { var t = this._cfgs.alignLines; Object(gt.e)(t, function (t) { t.remove(); }), (t.length = 0); }), (e.prototype.destory = function () { var t = this._cfgs, e = t.horizontalLines, n = t.verticalLines; this.get("graph") .getNodes() .forEach(function (t) { var r = t.get("id"); delete e[r + "tltr"], delete e[r + "lcrc"], delete e[r + "blbr"], delete n[r + "tlbl"], delete n[r + "tcbc"], delete n[r + "trbr"]; }), this.clearAlignLine(); }), e ); })(Qe); var Hi = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { offsetX: 6, offsetY: 6, getContent: function (t) { var e, n; return ( "\n
\n
类型:" + (null === (e = t.item) || void 0 === e ? void 0 : e.getType()) + "
\n
ID:" + (null === (n = t.item) || void 0 === n ? void 0 : n.getID()) + "
\n
\n " ); }, getCss: function () { return "\n .f6-tooltip-container {\n position: absolute;\n width: 200;\n border: 1 solid #e2e2e2;\n border-radius: 4;\n font-size: 12;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10 8;\n }\n \n .f6-tooltip-container div{\n height: 20;\n }\n \n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n "; }, shouldBegin: function (t) { return !0; }, itemTypes: ["node", "edge", "combo"], trigger: "mouseenter", fixToNode: void 0, }; }), (e.prototype.getEvents = function () { return "click" === this.get("trigger") ? { "node:tap": "onClick", "edge:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onMouseLeave", afterremoveitem: "onMouseLeave", contextmenu: "onMouseLeave", drag: "onMouseLeave", } : { "node:press": "onClick", "edge:press": "onClick", "combo:press": "onClick", "canvas:press": "onMouseLeave", "node:tap": "onMouseLeave", "edge:tap": "onMouseLeave", "combo:tap": "onMouseLeave", "canvas:tap": "onMouseLeave", afterremoveitem: "onMouseLeave", contextmenu: "onMouseLeave", drag: "onMouseLeave", }; }), (e.prototype.onClick = function (t) { var e = this.get("itemTypes"); if ( !t.item || !t.item.getType || -1 !== e.indexOf(t.item.getType()) ) { var n = t.item, r = this.get("graph"); this.currentTarget === n ? ((this.currentTarget = null), this.hideTooltip(), r.emit("tooltipchange", { item: t.item, action: "hide" })) : ((this.currentTarget = n), this.showTooltip(t), r.emit("tooltipchange", { item: t.item, action: "show" })); } }), (e.prototype.onMouseEnter = function (t) { var e = this.get("itemTypes"); if ( !t.item || !t.item.getType || -1 !== e.indexOf(t.item.getType()) ) { var n = t.item, r = this.get("graph"); (this.currentTarget = n), this.showTooltip(t), r.emit("tooltipchange", { item: t.item, action: "show" }); } }), (e.prototype.onMouseMove = function (t) { var e = this.get("itemTypes"); (t.item && t.item.getType && -1 === e.indexOf(t.item.getType())) || (this.currentTarget && t.item === this.currentTarget && this.showTooltip(t)); }), (e.prototype.onMouseLeave = function () { this.hideTooltip(), this.get("graph").emit("tooltipchange", { item: this.currentTarget, action: "hide", }), (this.currentTarget = null); }), (e.prototype.showTooltip = function (t) { var e, n, r; if (t.item) { var i = this.get("itemTypes"); if (!t.item.getType || -1 !== i.indexOf(t.item.getType())) { var o, a, s = this.get("graph").get("uiGroup"), u = H( (void 0 === (o = null === (e = this.get("getContent")) || void 0 === e ? void 0 : e(t)) && (o = ""), "\n \n " + o + "\n "), (void 0 === (a = null === (n = this.get("getCss")) || void 0 === n ? void 0 : n()) && (a = ""), "\n text {\n opacity: 1\n }\n " + a + "\n "), s, ); null === (r = this.get("tooltip")) || void 0 === r || r.remove(), this.set("tooltip", u), this.updatePosition(t); } } }), (e.prototype.hideTooltip = function () { var t = this.get("tooltip"); t && t.setStyle("display", "none"); }), (e.prototype.updatePosition = function (t) { var e = this.get("shouldBegin"), n = this.get("tooltip"); if (e(t)) { var r = this.get("graph"), i = r.get("width"), o = r.get("height"), a = this.get("offsetX") || 0, s = this.get("offsetY") || 0, u = r.getPointByClient(t.clientX, t.clientY), c = this.get("fixToNode"), h = t.item; if ( h.getType && "node" === h.getType() && c && Object(gt.m)(c) && c.length >= 2 ) { var l = h.getBBox(); u = { x: l.minX + l.width * c[0], y: l.minY + l.height * c[1] }; } var d = r.getCanvasByPoint(u.x, u.y), f = d.x, p = d.y, g = { x: f + a, y: p + s }; n.setStyle("display", "flex"), f + n.width + a > i && (g.x -= n.width + a), p + n.height + s > o && (g.y -= n.height + s), n.setStyle("left", g.x), n.setStyle("top", g.y); } else this.hideTooltip(); }), (e.prototype.hide = function () { this.onMouseLeave(); }), (e.prototype.destroy = function () { var t = this.get("tooltip"); t && t.remove(); }), e ); })(Qe); function Vi(t, e, n) { var r, i = t.type, o = (function (t) { var e, n, r; t.size && (Array.isArray(t.size) ? ((e = t.size[0]), (n = t.size[1] || t.size[0]), (r = t.size[0] / 2)) : "number" == typeof t.size && ((e = t.size), (n = t.size), (r = t.size / 2))); t.style && (t.style.width && (e = t.style.width), t.style.height && (n = t.style.height), t.style.r && (r = t.style.r)); r || (r = 5); e || (e = r); n || (n = r); return { width: e, height: n, r: r }; })(t), a = o.width, s = o.height, u = o.r; switch (t.type) { case "circle": r = { r: u, x: 0, y: 0 }; break; case "rect": r = { width: a, height: s, x: -a / 2, y: -s / 2 }; break; case "ellipse": r = { r1: a, r2: s, x: 0, y: 0 }; break; case "line": (r = { x1: -a / 2, y1: 0, x2: a / 2, y2: 0 }), (i = "line"); break; case "quadratic": (r = { path: [ ["M", -a / 2, 0], ["Q", 0, a / 2, a / 2, 0], ], }), (i = "path"); break; case "cubic": (r = { path: [ ["M", -a / 2, 0], ["C", -a / 6, a / 2, a / 6, -a / 2, a / 2, 0], ], }), (i = "path"); break; default: r = { r: u, x: 0, y: 0 }; } var c = "\n
\n \n " + (t.label && "
" + t.label + "
") + "\n
\n", l = Object(h.a)( { textAlign: "begin", fontSize: 12, fill: "#000", opacity: 1, fontWeight: "normal", }, t.labelStyle, ); return V( c, "\n .node-container {\n width: " + n.width + ";\n height: " + (n.height || Math.max(s, n.fontSize)) + ";\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n background-opacity: 0;\n font-size: " + l.fontSize + ";\n margin: " + n.margin + "\n }\n shape {\n top: " + s / 2 + ";\n left: " + a / 2 + ";\n width: " + a + ";\n height: " + s + ";\n background: " + e.fill + ";\n border: " + (e.lineWidth || "1") + " solid " + e.stroke + ";\n margin-right: 3;\n }\n .text {\n flex: 1;\n height: " + (l.fontSize + 2) + ";\n color: " + l.fill + ";\n background-opacity: 0;\n pointer-events: none;\n text-align: " + l.textAlign + ";\n font-weight: " + l.fontWeight + "\n }\n text {\n opacity: " + l.opacity + ";\n white-space: nowrap;\n }\n", ); } var Ui = ["click", "mouseenter"], Zi = (function (t) { function e(e) { var n = t.call(this, e) || this; return (n.active = []), (n.inActive = []), n; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { data: {}, position: "top", padding: 0, margin: 0, offsetX: -10, offsetY: 0, layout: "horizontal", containerStyle: {}, align: void 0, filter: { enable: !1, trigger: "click" }, itemConfig: { width: 100, height: 50, fontSize: 12 }, }; }), (e.prototype.init = function () { var t = this; this.formatArray("padding"), this.formatArray("margin"), (this.get("filter") || {}).multiple && this.set("multiple", !1); var e = this.get("align"); if (!e) { var n = this.get("position").split("-"); n.includes("left") && (e = "left"), (e = n.includes("right") ? "right" : "center"), this.set("align", e); } setTimeout(function () { var e = t.render(), n = t.getContainerPos(e); t.get("graph").get("uiGroup").translate(n.left, n.top), t.bindEvents(); }); }), (e.prototype.getContainerPos = function (t) { void 0 === t && (t = [0, 0]); var e = this.get("graph"), n = this.get("offsetX"), r = this.get("offsetY"), i = this.get("margin"), o = this.get("position").split("-"), a = { top: 0, right: 1, bottom: 2, left: 3 }, s = { left: (e.getWidth() - t[0]) / 2 + 0, top: (e.getHeight() - t[1]) / 2 + 0, }; return ( o.forEach(function (n) { var r = i[a[n]], o = n; switch (n) { case "top": case "left": r += 0; break; case "bottom": (r = e.getHeight() - t[1] - r + 0), (o = "top"); break; default: (r = e.getWidth() - t[0] - r + 0), (o = "left"); } s[o] = r; }), (s.top += r), (s.left += n), Object.keys(s).forEach(function (t) { s[t] = "" + s[t]; }), s ); }), (e.prototype.bindEvents = function () { var t = this, e = t.get("filter"); if (e && e.enable) { var n = e.trigger || "click"; Ui.includes(n) || (console.warn( "Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default.", ), (n = "click")), this.get("legendUI").on("tap", function (e) { var n; "node-container" === (null === (n = null == e ? void 0 : e.uiNode) || void 0 === n ? void 0 : n.getAttribute("class")) ? t.filterData(e.uiNode) : (t.clearFilter(), t.clearActiveLegend()); }); } }), (e.prototype.changeData = function (t) { this.set("data", t); var e = this.render(), n = this.getContainerPos(e); this.get("graph").get("uiGroup").translate(n.left, n.top); }), (e.prototype.goActive = function (t) { this.goDefault(t); var e = this.get("filter"), n = (null == e ? void 0 : e.lengedStateStyles) || {}, r = (null == n ? void 0 : n.active) || { stroke: "#000", lineWidth: 2, "text-shape": { fontWeight: "bold", opacity: 1 }, }; t.query("shape").setStyle("borderColor", r.stroke), t.query("shape").setStyle("borderWidth", r.lineWidth), t .query("text") .setStyle("fontWeight", r["text-shape"].fontWeight), t.query("text").setStyle("opacity", r["text-shape"].opacity), this.active.push(t), this.inActive.includes(t) && this.inActive.splice(this.inActive.indexOf(t), 1); }), (e.prototype.goDefault = function (t) { var e = t.getAttribute("orignStyle"); t.query("shape").setStyle("borderColor", e.stroke), t.query("shape").setStyle("opacity", 1), t.query("shape").setStyle("borderWidth", e.lineWidth || 1), t.query("text").setStyle("fontWeight", "normal"), t.query("text").setStyle("opacity", 1); }), (e.prototype.goInActive = function (t) { this.goDefault(t); var e = this.get("filter"), n = (null == e ? void 0 : e.lengedStateStyles) || {}, r = (null == n ? void 0 : n.inactive) || { opacity: 0.5, "text-shape": { opacity: 0.5 }, }; t.query("shape").setStyle("opacity", r.opacity), t.query("text").setStyle("opacity", r["text-shape"].opacity), this.inActive.push(t), this.active.includes(t) && this.active.splice(this.active.indexOf(t), 1); }), (e.prototype.activateLegend = function (t) { var e = this, n = this.get("filter"); if ( ((null == n ? void 0 : n.multiple) || this.clearActiveLegend(), !this.active.includes(t)) ) { var r = this.get("legendUI").queryAll(".node-container"); this.goActive(t), r.forEach(function (t) { e.active.includes(t) || e.goInActive(t); }); } }), (e.prototype.clearActiveLegend = function () { var t = this; this.get("legendUI") .queryAll(".node-container") .forEach(function (e) { t.goDefault(e); }), (this.active = []), (this.inActive = []); }), (e.prototype.filterData = function (t) { var e = this, n = this.get("filter"), r = null == n ? void 0 : n.filterFunctions; if (n && r) { var i = this.get("graph"), o = n.graphActiveState || "active", a = n.graphInactiveState || "inactive", s = n.multiple; if ( (this.clearFilter(), s || this.clearActiveLegend(), this.active.includes(t) ? this.goInActive(t) : this.activateLegend(t), 0 === this.active.length) ) this.get("legendUI") .queryAll(".node-container") .forEach(function (t) { return e.goDefault(t); }); var u = 0, c = ["getNodes", "getEdges"]; c.forEach(function (t) { i[t]().forEach(function (t) { var n = !1; e.active.forEach(function (e) { var i = r[e.getAttribute("legendId")]; n = n || i(t.getModel()); }), n ? (i.setItemState(t, a, !1), i.setItemState(t, o, !0), u++) : (i.setItemState(t, o, !1), i.setItemState(t, a, !0)); }); }), u || c.forEach(function (t) { i[t]().forEach(function (t) { i.clearItemStates(t, [a]); }); }); } }), (e.prototype.clearFilter = function () { var t = this.get("graph"), e = this.get("filter"); if (e) { var n = e.graphActiveState || "active", r = e.graphInactiveState || "inactive"; t.getNodes().forEach(function (e) { t.clearItemStates(e, [n, r]); }), t.getEdges().forEach(function (e) { t.clearItemStates(e, [n, r]); }); } }), (e.prototype.render = function () { var t, e, n = this; this.processData(); var r = this.get("itemsData"), i = [[], []]; ["nodes", "edges"].forEach(function (t, e) { r[t].forEach(function (r) { var o = n.getStyle(t.substr(0, 4), r); i[e].push(Vi(r, o, n.get("itemConfig"))); }); }); var o = this.get("title"), a = " \n
\n " + (o && "
" + o + "
") + "\n
\n
\n
\n
\n
", s = this.get("titleConfig") || {}, u = Object.assign( { fontSize: 20, fontFamily: "Arial", fontWeight: 300, textBaseline: "top", textAlign: "center", fill: "#000", }, s.style || {}, ), c = this.get("containerStyle"), h = this.get("padding"), l = this.get("margin"), d = H( a, "\n .g6-legend-container{\n width: " + this.get("width") + ";\n height: " + this.get("height") + ";\n padding: " + h.join(" ") + ";\n margin: " + l.join(" ") + ";\n background: " + (c.fill || "#f00") + ";\n border: " + (c.lineWidth || "1") + " solid " + (c.stroke || "#000") + ";\n opacity: " + (c.opacity || "0.5") + "\n }\n .text-container {\n font-size: " + u.fontSize + ";\n font-family: " + u.fontFamily + ";\n font-weight: " + u.fontWeight + ";\n text-align: " + u.textAlign + ";\n color: " + u.fill + ";\n height: " + u.fontSize + ";\n background-opacity: 0;\n top: " + s.offsetY + ";\n left: " + s.offsetX + ";\n }\n .edge-row, .node-row {\n display: flex;\n flex-direction: " + ("vertical" === this.get("layout") ? "column" : "row") + ";\n flex-wrap: nowrap;\n justify-content: space-between;\n background-opacity: 0;\n }\n .node-wrap {\n flex: 1;\n flex-direction: " + ("vertical" === this.get("layout") ? "row" : "column") + ";\n justify-content: space-between;\n background-opacity: 0;\n }\n ", this.get("graph").get("uiGroup"), ); return ( (t = d.query(".node-row")).appendChild.apply(t, i[0]), (e = d.query(".edge-row")).appendChild.apply(e, i[1]), this.set("legendUI", d), [d.width, d.height] ); }), (e.prototype.processData = function () { var t = this.get("data"), e = { nodes: [], edges: [] }; t.nodes && (t.nodes.sort(function (t, e) { return t.order - e.order; }), t.nodes.forEach(function (t) { var n, r, i, o, a, s = t.size || [ (null === (n = t.style) || void 0 === n ? void 0 : n.width) || (null === (r = t.style) || void 0 === r ? void 0 : r.r) || 8, (null === (i = t.style) || void 0 === i ? void 0 : i.height) || (null === (o = t.style) || void 0 === o ? void 0 : o.r) || 8, ], u = (null === (a = t.labelCfg) || void 0 === a ? void 0 : a.style) || {}; e.nodes.push({ id: t.id || Object(gt.I)(), type: t.type || "circle", style: Object(h.a)({}, t.style), order: t.order, label: t.label, itemType: "node", size: s, labelCfg: { position: "right", style: Object(h.a)({ fontFamily: "Arial" }, u), }, }); })), t.edges && (t.edges.sort(function (t, e) { return t.order - e.order; }), t.edges.forEach(function (t) { var n, r, i = t.type || "line"; "cubic-horizontal" === t.type && (i = "cubic"); var o = (null === (n = t.labelCfg) || void 0 === n ? void 0 : n.style) || {}, a = t.size || [ (null === (r = t.style) || void 0 === r ? void 0 : r.width) || 8, 1, ]; e.edges.push({ id: t.id || Object(gt.I)(), type: i, size: a, style: Object(h.a)( { lineWidth: Object(gt.m)(a) ? a[1] : 1 }, t.style, ), order: t.order, label: t.label, itemType: "edge", labelCfg: { position: "right", style: Object(h.a)({ fontFamily: "Arial" }, o), }, }); })), this.set("itemsData", e); }), (e.prototype.formatArray = function (t) { var e = this.get(t); if (Object(gt.t)(e)) this.set(t, [e, e, e, e]); else if (Object(gt.m)(e)) switch (e.length) { case 0: this.set(t, [0, 0, 0, 0]); break; case 1: this.set(t, [e[0], e[0], e[0], e[0]]); break; case 2: this.set(t, [e[0], e[1], e[0], e[1]]); break; case 3: this.set(t, [e[0], e[1], e[2], e[1]]); } return this.get(t); }), (e.prototype.getStyle = function (t, e) { var n = "node" === t ? { fill: "#ccc", lineWidth: 0 } : { stroke: "#000", lineWidth: 1 }; return Object(h.a)(Object(h.a)({}, n), e.style || {}); }), (e.prototype.destroy = function () { var t = this.get("graph").get("container"), e = this.get("container"); t.removeChild(e); }), e ); })(Qe), Ki = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { var t = this; return { minZoom: 0.5, maxZoom: 3, sliderWidthPercent: 0.3, dragTimestamp: +new Date(), getContent: function () { return '\n \n
\n
\n
\n
1 times
\n
\n
\n
\n '; }, getCss: function () { var e = t.get("graph"), n = e.get("width"), r = e.get("height"), i = t.get("minZoom"), o = t.get("maxZoom"), a = t.get("sliderWidthPercent"), s = Math.floor(n * a), u = s * ((1 - i) / (o - i)); return ( "\n .f6-zoom-slider {\n width: " + s + ";\n height: 30;\n margin-left: " + Math.floor((n * (1 - a)) / 2) + ";\n padding: 13 0;\n top: " + (r - 40) + ";\n position: relative;\n opacity: 0;\n }\n\n .rail {\n width: " + s + ";\n height: 4;\n background-color: #f5f5f5;\n border-radius: 2;\n opacity: 1;\n }\n\n .track {\n width: " + (u + 2) + ";\n height: 4;\n background-color: #91d5ff;\n position: absolute;\n top: 13;\n border-radius: 2;\n opacity: 1;\n }\n\n .handle {\n height: 30;\n width: 40;\n position: absolute;\n top: 0;\n left: " + (u - 9) + ";\n padding: 9;\n opacity: 0;\n }\n\n .circle {\n height: 13;\n width: 13;\n border-radius: 6.5;\n border: 2px solid #1890ff;\n background-color: #fff;\n opacity: 1;\n }\n\n .text {\n position: absolute;\n top: -9;\n margin-left: -12;\n color: #666;\n width: 45;\n }\n " ); }, }; }), (e.prototype.getEvents = function () { return { dragstart: "onDragStart", dragend: "onDragEnd" }; }), (e.prototype.init = function () { var t = this; setTimeout(function () { t.initSlider(); }); }), (e.prototype.initSlider = function () { var t = this; console.log("initSlider", this); var e = this.get("graph").get("uiGroup"), n = H(this.get("getContent")(), this.get("getCss")(), e), r = n.query(".handle"), i = 0; r.on("panstart", function (t) { i = t.clientX; }), r.on("panmove", function (e) { var n = e.clientX - i; (i = e.clientX), t.set("dragTimestamp", +new Date()), t.updateHandlePosition(n); }), n.setStyle("display", "none"), this.set("zoomSlider", n); }), (e.prototype.onDragStart = function () { var t = this.get("graph"), e = t.getZoom(), n = t.get("width"), r = this.get("zoomSlider"), i = this.get("minZoom"), o = this.get("maxZoom"), a = this.get("sliderWidthPercent"), s = r.query(".track"), u = Math.floor(n * a) * ((e - i) / (o - i)) - s.getStyle("width"); this.updateHandlePosition(u), clearInterval(this.get("clearHandle")), r.setStyle("display", "block"); }), (e.prototype.onDragEnd = function () { return Object(h.b)(this, void 0, void 0, function () { var t, e, n = this; return Object(h.d)(this, function (r) { return ( (t = this.get("zoomSlider")), clearInterval(this.get("clearHandle")), (e = setInterval(function () { +new Date() - n.get("dragTimestamp") > 3e3 && (clearInterval(n.get("clearHandle")), t.setStyle("display", "none")); }, 3e3)), this.set("clearHandle", e), [2] ); }); }); }), (e.prototype.updateHandlePosition = function (t) { var e = this.get("graph"), n = this.get("zoomSlider"), r = this.get("sliderWidthPercent"), i = this.get("minZoom"), o = this.get("maxZoom"), a = n.query(".track"), s = n.query(".handle"), u = a.getStyle("width"), c = e.get("width") * r, h = u + t; h < 0 && (h = 0), h > c && (h = c); var l = (h / c) * (o - i) + i; a.setStyle("width", h), s.setStyle("left", h - 9), s.setText(Math.round(10 * l) / 10 + " times"), this.updateScale(l); }), (e.prototype.updateScale = function (t) { var e = this.get("graph"); e.zoom(t / e.getZoom()); }), e ); })(Qe), Qi = Xi.distance, $i = { stroke: "#000", strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 1, fill: "#fff", }, Ji = (function (t) { function e(e) { var n = t.call(this, e) || this; return (n.isUp = !0), (n.scaleTimer = null), n; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { type: "both", trigger: "drag", r: 60, delegateStyle: Object(gt.b)($i), showLabel: "edge", }; }), (e.prototype.getEvents = function () { var t; switch (this.get("trigger")) { case "click": t = { tap: "filter" }; break; case "drag": t = { press: "createDelegate" }; break; default: t = { mousemove: "filter" }; } return t; }), (e.prototype.init = function () { var t = this.get("showLabel"), e = "node" === t || "both" === t, n = "edge" === t || "both" === t; this.set("showNodeLabel", e), this.set("showEdgeLabel", n), this.get("shouldShow") || this.set("shouldShow", function () { return !0; }); }), (e.prototype.createDelegate = function (t) { var e = this, n = this, r = n.get("delegate"); if (!r || r.destroyed) { var i = this.get("graph"), o = i.getPointByClient(t.clientX, t.clientY); n.filter(o), (r = n.get("delegate")).on("dragstart", function (t) {}), r.on("drag", function (t) { var e = i.getPointByClient(t.clientX, t.clientY); n.filter(e); }), r.on("dragend", function (t) { e.clear(); }); } }), (e.prototype.scaleRByWheel = function (t, e) { if (t) { t.preventDefault && t.preventDefault(); var n, r = this.get("graph"), i = this.get("delegate"); (i ? { x: i.attr("x"), y: i.attr("y") } : void 0) || r.getPointByClient(t.clientX, t.clientY); n = e ? 1 / 0.95 : 0.95; var o = this.get("maxR"), a = this.get("minR"), s = this.get("r"); ((s > (o || r.get("height")) && n > 1) || (s < (a || 0.05 * r.get("height")) && n < 1)) && (n = 1), (s *= n), this.set("r", s), this.filter(t); } }), (e.prototype.filter = function (t) { var e = t.x, n = t.y, r = this.get("graph"), i = r.getNodes(), o = {}, a = this.get("r"), s = this.get("type"), u = { x: e, y: n }; this.updateDelegate(u, a); var c = this.get("shouldShow"), h = this.get("vShapes"); h && h.forEach(function (t) { t.remove(), t.destroy(); }), (h = []), i.forEach(function (t) { var e = t.getModel(), n = e.x, r = e.y; Qi({ x: n, y: r }, u) < a && (o[e.id] = t); }); var l = r.getEdges(), d = []; l.forEach(function (t) { var e = t.getModel(), n = e.source, r = e.target; c(e) && ("only-source" === s || "one" === s ? o[n] && !o[r] && d.push(t) : "only-target" === s || "one" === s ? o[r] && !o[n] && d.push(t) : "both" === s && o[n] && o[r] && d.push(t)); }); var f = this.get("showNodeLabel"), p = this.get("showEdgelabel"), g = r.get("group"); d.forEach(function (t) { t.get("group") .get("children") .forEach(function (t) { var e = t.get("type"), n = g.addShape(e, { attrs: t.attr(), capture: !1 }); h.push(n), f && "text" === e && n.set("visible", !0); }); }), Object.keys(o).forEach(function (t) { var e = o[t].get("group").clone(); if ((e.set("capture", !1), g.add(e), h.push(e), p)) for (var n = e.get("children"), r = 0; r < n.length; r++) { var i = n[r]; "text" === i.get("type") && i.set("visible", !0); } }), this.set("vShapes", h); }), (e.prototype.updateParams = function (t) { var e = t.r, n = t.trigger, r = t.minR, i = t.maxR, o = t.showLabel, a = t.shouldShow; isNaN(t.r) || this.set("r", e), isNaN(i) || this.set("maxR", i), isNaN(r) || this.set("minR", r), "tab" === n && this.set("trigger", n), ("node" !== o && "both" !== o) || this.set("showNodeLabel", !0), ("edge" !== o && "both" !== o) || this.set("showEdgeLabel", !0), a && this.set("shouldShow", a); }), (e.prototype.updateDelegate = function (t, e) { var n = this.get("graph"), r = this.get("delegate"); if (!r || r.destroyed) { var i = n.get("group"), o = this.get("delegateStyle") || $i; r = i.addShape("circle", { attrs: Object(h.a)({ r: e, x: t.x, y: t.y }, o), name: "lens-shape", draggable: !0, zIndex: 1e3, }); } else r.attr({ x: t.x, y: t.y, r: e }); this.set("delegate", r); }), (e.prototype.clear = function () { var t = this.get("vShapes"); t && t.forEach(function (t) { t.remove(), t.destroy(); }), (t = []), this.set("vShapes", t); var e = this.get("delegate"); e && !e.destroyed && (e.remove(), e.destroy()); }), (e.prototype.destroy = function () { this.clear(); }), e ); })(Qe), to = { stroke: "#000", strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 0.1, fill: "#ccc", }, eo = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { trigger: "tap", d: 1.5, r: 300, delegateStyle: Object(gt.b)(to), showLabel: !1, maxD: 5, minD: 0, scaleRBy: "unset", scaleDBy: "unset", showDPercent: !0, }; }), (e.prototype.getEvents = function () { var t; switch (this.get("trigger")) { case "tap": t = { tap: "magnify" }; break; case "drag": t = { press: "createDelegate" }; break; default: t = { tap: "magnify" }; } return t; }), (e.prototype.init = function () { var t = this.get("r"); this.set("cachedMagnifiedModels", []), this.set("cachedOriginPositions", {}), this.set("r2", t * t); var e = this.get("d"); this.set("molecularParam", (e + 1) * t); }), (e.prototype.createDelegate = function (t) { var e = this, n = this, r = n.get("delegate"); (r && !r.destroyed) || (n.magnify(t), (r = n.get("delegate")).on("dragstart", function (t) { n.set("delegateCenterDiff", { x: r.attr("x") - t.x, y: r.attr("y") - t.y, }); }), r.on("drag", function (t) { n.magnify(t); }), r.on("dragend", function (t) { e.clear(); }), "wheel" === this.get("scaleDBy") && r.on("mousewheel", function (t) { e.scaleDByWheel(t); }), "wheel" === this.get("scaleRBy") && r.on("mousewheel", function (t) { n.scaleRByWheel(t); })); }), (e.prototype.scaleRByWheel = function (t) { if (t && t.originalEvent) { t.preventDefault && t.preventDefault(); var e, n = this.get("graph"), r = this.get("delegate"), i = (r ? { x: r.attr("x"), y: r.attr("y") } : void 0) || n.getPointByClient(t.clientX, t.clientY); e = t.originalEvent.wheelDelta < 0 ? 0.95 : 1 / 0.95; var o = this.get("maxR"), a = this.get("minR"), s = this.get("r"); ((s > (o || n.get("height")) && e > 1) || (s < (a || 0.05 * n.get("height")) && e < 1)) && (e = 1), (s *= e), this.set("r", s), this.set("r2", s * s); var u = this.get("d"); this.set("molecularParam", (u + 1) * s), this.set("delegateCenterDiff", void 0), this.magnify(t, i); } }), (e.prototype.scaleRByDrag = function (t) { if (t) { var e, n = this.get("dragPrePos"), r = this.get("graph"), i = r.getPointByClient(t.clientX, t.clientY); e = t.x - n.x < 0 ? 0.95 : 1 / 0.95; var o = this.get("maxR"), a = this.get("minR"), s = this.get("r"); ((s > (o || r.get("height")) && e > 1) || (s < (a || 0.05 * r.get("height")) && e < 1)) && (e = 1), (s *= e), this.set("r", s), this.set("r2", s * s); var u = this.get("d"); this.set("molecularParam", (u + 1) * s), this.magnify(t, i), this.set("dragPrePos", { x: t.x, y: t.y }); } }), (e.prototype.scaleDByWheel = function (t) { if (t || t.originalEvent) { t.preventDefault && t.preventDefault(); var e = 0; e = t.originalEvent.wheelDelta < 0 ? -0.1 : 0.1; var n = this.get("d") + e, r = this.get("maxD"), i = this.get("minD"); if (n < r && n > i) { this.set("d", n); var o = this.get("r"); this.set("molecularParam", (n + 1) * o); var a = this.get("delegate"), s = a ? { x: a.attr("x"), y: a.attr("y") } : void 0; this.set("delegateCenterDiff", void 0), this.magnify(t, s); } } }), (e.prototype.scaleDByDrag = function (t) { var e = this.get("dragPrePos"), n = t.x - e.x > 0 ? 0.1 : -0.1, r = this.get("d") + n, i = this.get("maxD"), o = this.get("minD"); if (r < i && r > o) { this.set("d", r); var a = this.get("r"); this.set("molecularParam", (r + 1) * a), this.magnify(t); } this.set("dragPrePos", { x: t.x, y: t.y }); }), (e.prototype.magnify = function (t, e) { this.restoreCache(); var n = this.get("graph"), r = this.get("cachedMagnifiedModels"), i = this.get("cachedOriginPositions"), o = this.get("showLabel"), a = this.get("r"), s = this.get("r2"), u = this.get("d"), c = this.get("molecularParam"), h = n.getNodes(), l = h.length, d = e ? { x: e.x, y: e.y } : { x: t.x, y: t.y }; !this.get("dragging") || ("mousemove" !== this.get("trigger") && "tap" !== this.get("trigger")) || ((d = this.get("cacheCenter")), (d = n.getPointByClient(d.x, d.y))); var f = this.get("delegateCenterDiff"); f && ((d.x += f.x), (d.y += f.y)), this.updateDelegate(d, a); for (var p = 0; p < l; p++) { var g = h[p].getModel(), y = g.x, v = g.y; if (!isNaN(y) && !isNaN(v)) { var m = (y - d.x) * (y - d.x) + (v - d.y) * (v - d.y); if (!isNaN(m) && m < s && 0 !== m) { var b = Math.sqrt(m), x = (c * b) / (u * b + a), w = (y - d.x) / b, O = (v - d.y) / b; if ( ((g.x = w * x + d.x), (g.y = O * x + d.y), i[g.id] || (i[g.id] = { x: y, y: v, texts: [] }), r.push(g), o && 2 * b < a) ) for ( var M = h[p].getContainer().getChildren(), S = M.length, C = 0; C < S; C++ ) { var j = M[C]; "text" === j.get("type") && (i[g.id].texts.push({ visible: j.get("visible"), shape: j, }), j.set("visible", !0)); } } } } n.refreshPositions(); }), (e.prototype.restoreCache = function () { for ( var t = this.get("cachedMagnifiedModels"), e = this.get("cachedOriginPositions"), n = t.length, r = 0; r < n; r++ ) { var i = t[r], o = e[i.id]; (i.x = o.x), (i.y = o.y); for (var a = o.texts.length, s = 0; s < a; s++) { var u = o.texts[s]; u.shape.set("visible", u.visible); } } this.set("cachedMagnifiedModels", []), this.set("cachedOriginPositions", {}); }), (e.prototype.updateParams = function (t) { var e = t.r, n = t.d, r = t.trigger, i = t.minD, o = t.maxD, a = t.minR, s = t.maxR, u = t.scaleDBy, c = t.scaleRBy; isNaN(t.r) || (this.set("r", e), this.set("r2", e * e)), isNaN(n) || this.set("d", n), isNaN(o) || this.set("maxD", o), isNaN(i) || this.set("minD", i), isNaN(s) || this.set("maxR", s), isNaN(a) || this.set("minR", a); var h, l = this.get("d"), d = this.get("r"); (this.set("molecularParam", (l + 1) * d), ("mousemove" !== r && "tap" !== r && "drag" !== r) || this.set("trigger", r), "drag" === u || "unset" === u) && (this.set("scaleDBy", u), this.get("delegate").remove(), this.get("delegate").destroy(), (h = this.get("dPercentText")) && (h.remove(), h.destroy())); ("drag" !== c && "unset" !== c) || (this.set("scaleRBy", c), this.get("delegate").remove(), this.get("delegate").destroy(), (h = this.get("dPercentText")) && (h.remove(), h.destroy())); }), (e.prototype.updateDelegate = function (t, e) { var n = this, r = this, i = r.get("graph"), o = r.get("delegate"); if (!o || o.destroyed) { var a = i.get("group"), s = r.get("delegateStyle") || to; (o = a.addShape("circle", { attrs: Object(h.a)({ r: e / 1.5, x: t.x, y: t.y }, s), name: "lens-shape", draggable: !0, })), "drag" !== this.get("trigger") && ("wheel" === this.get("scaleRBy") ? o.on("mousewheel", function (t) { r.scaleRByWheel(t); }) : "drag" === this.get("scaleRBy") && (o.on("dragstart", function (t) { r.set("dragging", !0), r.set("cacheCenter", { x: t.x, y: t.y }), r.set("dragPrePos", { x: t.x, y: t.y }); }), o.on("drag", function (t) { r.scaleRByDrag(t); }), o.on("dragend", function (t) { r.set("dragging", !1); })), "wheel" === this.get("scaleDBy") ? o.on("mousewheel", function (t) { n.scaleDByWheel(t); }) : "drag" === this.get("scaleDBy") && (o.on("dragstart", function (t) { r.set("dragging", !0), r.set("cacheCenter", { x: t.x, y: t.y }), r.set("dragPrePos", { x: t.x, y: t.y }); }), o.on("drag", function (t) { n.scaleDByDrag(t); }), o.on("dragend", function (t) { r.set("dragging", !1); }))); } else o.attr({ x: t.x, y: t.y, r: e / 1.5 }); if (r.get("showDPercent")) { var u = Math.round( ((r.get("d") - r.get("minD")) / (r.get("maxD") - r.get("minD"))) * 100, ), c = r.get("dPercentText"), l = t.y + e / 1.5 + 16; if (!c || c.destroyed) (c = (a = i.get("group")).addShape("text", { attrs: { text: u + "%", x: t.x, y: l, fill: "#aaa", stroke: "#fff", lineWidth: 1, fontSize: 12, }, })), r.set("dPercentText", c); else c.attr({ text: u + "%", x: t.x, y: l }); } r.set("delegate", o); }), (e.prototype.clear = function () { var t = this.get("graph"); this.restoreCache(), t.refreshPositions(); var e = this.get("delegate"); e && !e.destroyed && (e.remove(), e.destroy()); var n = this.get("dPercentText"); n && !n.destroyed && (n.remove(), n.destroy()), this.set("delegateCenterDiff", void 0); }), (e.prototype.destroy = function () { this.clear(); }), e ); })(Qe), no = Math.max, ro = sn.a.transform, io = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.handleUpdateCanvas = Object(gt.c)( function (t) { var e = n; e.destroyed || e.updateCanvas(); }, 100, !1, )), n ); } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { container: null, className: "", viewportClassName: "", type: "default", padding: 50, size: [200, 120], delegateStyle: { fill: "#40a9ff", stroke: "#096dd9" }, refresh: !0, }; }), (e.prototype.getEvents = function () { return { beforepaint: "updateViewport", beforeanimate: "disableRefresh", afteranimate: "enableRefresh", viewportchange: "disableOneRefresh", }; }), (e.prototype.disableRefresh = function () { this.set("refresh", !1); }), (e.prototype.enableRefresh = function () { this.set("refresh", !0), this.updateCanvas(); }), (e.prototype.disableOneRefresh = function () { this.set("viewportChange", !0); }), (e.prototype.initViewport = function () { var t = this, e = this._cfgs, n = e.size, r = e.graph; if (!this.destroyed) { var i = this.get("container").query(".viewport"), o = 0, a = 0, s = !1, u = 0, c = 0, h = 0, l = 0, d = 0, f = 0; i.on("panstart", function (p) { (e.refresh = !1), (u = parseInt(i.getStyle("left"), 10)), (c = parseInt(i.getStyle("top"), 10)), (h = parseInt(i.getStyle("width"), 10)), (l = parseInt(i.getStyle("height"), 10)), h > n[0] || l > n[1] || ((f = r.getZoom()), (d = t.get("ratio")), (s = !0), (o = p.x), (a = p.y)); }), i.on( "panmove", function (t) { if (s && !Object(gt.s)(t.x) && !Object(gt.s)(t.y)) { var e = o - t.x, i = a - t.y; (u - e < 0 || u - e + h >= n[0]) && (e = 0), (c - i < 0 || c - i + l >= n[1]) && (i = 0), (u -= e), (c -= i), r.translate((e * f) / d, (i * f) / d), (o = t.x), (a = t.y); } }, !1, ), i.on( "panend", function () { (s = !1), (e.refresh = !0); }, !1, ), this.set("viewport", i); } }), (e.prototype.updateViewport = function () { if (!this.destroyed) { var t = this.get("ratio"), e = this.get("totaldx"), n = this.get("totaldy"), r = this.get("graph"), i = this.get("size"), o = r.get("width"), a = r.get("height"), s = r.getPointByCanvas(0, 0), u = r.getPointByCanvas(o, a), c = this.get("viewport"), h = (u.x - s.x) * t, l = (u.y - s.y) * t, d = s.x * t + e, f = s.y * t + n, p = d + h, g = f + l; d < 0 && ((h += d), (d = 0)), p > i[0] && (h -= p - i[0]), f < 0 && ((l += f), (f = 0)), g > i[1] && (l -= g - i[1]), this.set("ratio", t), c && (c.setStyle("left", d), c.setStyle("top", f), c.setStyle("width", h), c.setStyle("height", l)); } }), (e.prototype.updateGraphShapes = function () { var t = this._cfgs.graph.get("group"); if (!t.destroyed) { var e = t.clone(), n = this.get("groupCanvas"); e.resetMatrix(), n.clear(), n.add(e); } }), (e.prototype.updateKeyShapes = function () { var t = this, e = this._cfgs.graph, n = this.get("groupCanvas"); Object(gt.e)(e.getEdges(), function (e) { t.updateOneEdgeKeyShape(e, n); }), Object(gt.e)(e.getNodes(), function (e) { t.updateOneNodeKeyShape(e, n); }); var r = e.getCombos(); if (r && r.length) { var i = n.find(function (t) { return "comboGroup" === t.get("name"); }) || n.addGroup({ name: "comboGroup" }); setTimeout(function () { t.destroyed || (Object(gt.e)(r, function (e) { t.updateOneComboKeyShape(e, i); }), null == i || i.sort(), null == i || i.toBack(), t.updateCanvas()); }, 250); } this.clearDestroyedShapes(); }), (e.prototype.updateOneComboKeyShape = function (t, e) { if (!this.destroyed) { var n = this.get("itemMap") || {}, r = n[t.get("id")], i = t.getBBox(), o = t.get("keyShape").clone(), a = o.attr(), s = { x: i.centerX, y: i.centerY }; r ? (s = Object.assign(a, s)) : ((r = o), e.add(r)); var u = r.get("type"); ("rect" !== u && "image" !== u) || ((s.x = i.minX), (s.y = i.minY)), r.attr(s), t.isVisible() ? r.show() : r.hide(), (r.exist = !0); var c = t.getModel().depth; isNaN(c) || r.set("zIndex", c), (n[t.get("id")] = r), this.set("itemMap", n); } }), (e.prototype.updateOneNodeKeyShape = function (t, e) { var n = this.get("itemMap") || {}, r = n[t.get("id")], i = t.getBBox(), o = t.get("keyShape").clone(), a = o.attr(), s = { x: i.centerX, y: i.centerY }; r ? (s = Object.assign(a, s)) : ((r = o), e.add(r)); var u = r.get("type"); ("rect" !== u && "image" !== u) || ((s.x = i.minX), (s.y = i.minY)), r.attr(s), t.isVisible() ? r.show() : r.hide(), (r.exist = !0); var c = t.getModel().depth; isNaN(c) || r.set("zIndex", c), (n[t.get("id")] = r), this.set("itemMap", n); }), (e.prototype.updateDelegateShapes = function () { var t = this, e = this._cfgs.graph, n = this.get("groupCanvas"); Object(gt.e)(e.getEdges(), function (e) { t.updateOneEdgeKeyShape(e, n); }), Object(gt.e)(e.getNodes(), function (e) { t.updateOneNodeDelegateShape(e, n); }); var r = e.getCombos(); if (r && r.length) { var i = n.find(function (t) { return "comboGroup" === t.get("name"); }) || n.addGroup({ name: "comboGroup" }); setTimeout(function () { t.destroyed || (Object(gt.e)(r, function (e) { t.updateOneComboKeyShape(e, i); }), null == i || i.sort(), null == i || i.toBack(), t.updateCanvas()); }, 250); } this.clearDestroyedShapes(); }), (e.prototype.clearDestroyedShapes = function () { var t = this.get("itemMap") || {}, e = Object.keys(t); if (e && 0 !== e.length) for (var n = e.length - 1; n >= 0; n--) { var r = t[e[n]], i = r.exist; (r.exist = !1), i || (r.remove(), delete t[e[n]]); } }), (e.prototype.updateOneEdgeKeyShape = function (t, e) { var n = this.get("itemMap") || {}, r = n[t.get("id")]; if (r) { var i = t.get("keyShape").attr("path"); r.attr("path", i); } else (r = t.get("keyShape").clone()), e.add(r); t.isVisible() ? r.show() : r.hide(), (r.exist = !0), (n[t.get("id")] = r), this.set("itemMap", n); }), (e.prototype.updateOneNodeDelegateShape = function (t, e) { var n = this.get("delegateStyle"), r = this.get("itemMap") || {}, i = r[t.get("id")], o = t.getBBox(); if (i) { var a = { x: o.minX, y: o.minY, width: o.width, height: o.height, }; i.attr(a); } else i = e.addShape("rect", { attrs: Object(h.a)( { x: o.minX, y: o.minY, width: o.width, height: o.height }, n, ), name: "minimap-node-shape", }); t.isVisible() ? i.show() : i.hide(), (i.exist = !0), (r[t.get("id")] = i), this.set("itemMap", r); }), (e.prototype.init = function () { var t = this; this.get("graph").on("afterupdateitem", this.handleUpdateCanvas), this.get("graph").on( "afteritemstatechange", this.handleUpdateCanvas, ), this.get("graph").on("afteradditem", this.handleUpdateCanvas), this.get("graph").on( "afterremoveitem", this.handleUpdateCanvas, ), this.get("graph").on("afterrender", this.handleUpdateCanvas), this.get("graph").on("afterlayout", this.handleUpdateCanvas), setTimeout(function () { t.initContainer(); }); }), (e.prototype.initContainer = function () { var t, e = this.get("graph"), n = this.get("size"), r = this.get("className"), i = this.get("viewportClassName"), o = this.get("getCss"), a = H( "\n
\n
\n
\n
', "\n root {\n width: " + e.getWidth() + ";\n height: " + e.getHeight() + ";\n opacity: 0;\n pointer-events: none;\n }\n .f6-minimap{ \n position: absolute;\n left: 0;\n bottom: 0;\n width: " + n[0] + "; height: " + n[1] + ";\n } \n .f6-minimap-container{\n position: relative;\n background: rgba(0,0,0,0);\n width: " + n[0] + "; height: " + n[1] + ";\n }\n .viewport{\n position: absolute;\n border: 3 solid blue;\n width: 100;\n height: 100;\n background: rgba(0,0,0,0);\n z-index: 1000;\n }\n " + (null !== (t = null == o ? void 0 : o()) && void 0 !== t ? t : "") + "\n ", e.get("uiGroup"), ), s = a.query(".f6-minimap-container").gNode.addGroup(); this.set("groupCanvas", s), this.set("container", a), this.updateCanvas(), this.initViewport(); }), (e.prototype.updateCanvas = function () { if (!this.destroyed && this.get("refresh")) { var t = this.get("graph"); if (!t.get("destroyed")) { this.get("viewportChange") && (this.set("viewportChange", !1), this.updateViewport()); var e = this.get("size"), n = this.get("type"), r = this.get("padding"); switch (n) { case "default": this.updateGraphShapes(); break; case "keyShape": this.updateKeyShapes(); break; case "delegate": this.updateDelegateShapes(); } var i = this.get("groupCanvas"); if (i) { i.resetMatrix(); var o = i.getBBox(), a = t.get("group").getCanvasBBox(), s = t.getZoom() || 1, u = a.width / s, c = a.height / s; Number.isFinite(o.width) && ((u = no(o.width, u)), (c = no(o.height, c))), (u += 2 * r), (c += 2 * r); var h = Math.min(e[0] / u, e[1] / c), l = [1, 0, 0, 0, 1, 0, 0, 0, 1], d = 0, f = 0; Number.isFinite(o.minX) && (d = -o.minX), Number.isFinite(o.minY) && (f = -o.minY); var p = (e[0] - (u - 2 * r) * h) / 2, g = (e[1] - (c - 2 * r) * h) / 2; (l = ro(l, [ ["t", d, f], ["s", h, h], ["t", p, g], ])), i.setMatrix(l), this.set("ratio", h), this.set("totaldx", p + d * h), this.set("totaldy", g + f * h), this.set("dx", p), this.set("dy", g), this.updateViewport(); } } } }), (e.prototype.getCanvas = function () { return this.get("canvas"); }), (e.prototype.getViewport = function () { return this.get("viewport"); }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.destroy = function () { var t; null === (t = this.get("container")) || void 0 === t || t.remove(); }), e ); })(Qe); function oo(t, e, n) { var r = t.x - e.x, i = t.y - e.y; return !n || Math.abs(r) > n || Math.abs(i) > n ? Math.sqrt(r * r + i * i) : n; } function ao(t, e) { var n = (e.source.y - e.target.y) / (e.source.x - e.target.x), r = (n * n * e.source.x + n * (t.y - e.source.y) + t.x) / (n * n + 1); return { x: r, y: n * (r - e.source.x) + e.source.y }; } var so = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { edgeBundles: [], edgePoints: [], K: 0.1, lambda: 0.1, divisions: 1, divRate: 2, cycles: 6, iterations: 90, iterRate: 0.6666667, bundleThreshold: 0.6, eps: 1e-6, onLayoutEnd: function () {}, onTick: function () {}, }; }), (e.prototype.init = function () { var t = this.get("graph"), e = this.get("onTick"); this.set("tick", function () { e && e(), t.refreshPositions(); }); }), (e.prototype.bundling = function (t) { var e = this; if ((e.set("data", t), !e.isTicking())) { var n = t.edges || [], r = t.nodes || [], i = {}, o = !1; if ( (r.forEach(function (t) { (null !== t.x && null !== !t.y && void 0 !== t.x && void 0 !== !t.y) || (o = !0), (i[t.id] = t); }), o) ) throw new Error( "please layout the graph or assign x and y for nodes first", ); e.set("nodeIdMap", i); var a = e.get("divisions"), s = e.get("divRate"), u = e.divideEdges(a); e.set("edgePoints", u); var c = e.getEdgeBundles(); e.set("edgeBundles", c); for ( var h = e.get("cycles"), l = e.get("iterations"), d = e.get("iterRate"), f = e.get("lambda"), p = 0; p < h; p++ ) { for ( var g = function (t) { var r = []; n.forEach(function (t, n) { if (t.source !== t.target) { var o = i[t.source], s = i[t.target]; r[n] = e.getEdgeForces( { source: o, target: s }, n, a, f, ); for (var c = 0; c < a + 1; c++) (u[n][c].x += r[n][c].x), (u[n][c].y += r[n][c].y); } }); }, y = 0; y < l; y++ ) g(); (f /= 2), (a *= s), (l *= d), (u = e.divideEdges(a)), e.set("edgePoints", u); } n.forEach(function (t, e) { t.source !== t.target && ((t.type = "polyline"), (t.controlPoints = u[e].slice(1, u[e].length - 1))); }), e.get("graph").refresh(); } }), (e.prototype.updateBundling = function (t) { var e = this, n = t.data; if ( (n && e.set("data", n), e.get("ticking") && e.set("ticking", !1), Object.keys(t).forEach(function (n) { e.set(n, t[n]); }), t.onTick) ) { var r = this.get("graph"); e.set("tick", function () { t.onTick(), r.refresh(); }); } e.bundling(n); }), (e.prototype.divideEdges = function (t) { var e = this, n = e.get("data").edges, r = e.get("nodeIdMap"), i = e.get("edgePoints"); return ( (i && void 0 !== i) || (i = []), n.forEach(function (n, o) { (i[o] && void 0 !== i[o]) || (i[o] = []); var a = r[n.source], s = r[n.target]; if (1 === t) i[o].push({ x: a.x, y: a.y }), i[o].push({ x: 0.5 * (a.x + s.x), y: 0.5 * (a.y + s.y) }), i[o].push({ x: s.x, y: s.y }); else { var u = (i[o] && i[o] !== [] ? e.getEdgeLength(i[o]) : oo({ x: a.x, y: a.y }, { x: s.x, y: s.y })) / (t + 1), c = u, h = [{ x: a.x, y: a.y }]; i[o].forEach(function (t, e) { if (0 !== e) { for (var n = oo(t, i[o][e - 1]); n > c; ) { var r = c / n, a = { x: i[o][e - 1].x, y: i[o][e - 1].y }; (a.x += r * (t.x - i[o][e - 1].x)), (a.y += r * (t.y - i[o][e - 1].y)), h.push(a), (n -= c), (c = u); } c -= n; } }), h.push({ x: s.x, y: s.y }), (i[o] = h); } }), i ); }), (e.prototype.getEdgeLength = function (t) { var e = 0; return ( t.forEach(function (n, r) { 0 !== r && (e += oo(n, t[r - 1])); }), e ); }), (e.prototype.getEdgeBundles = function () { var t = this, e = t.get("data").edges || [], n = t.get("bundleThreshold"), r = t.get("nodeIdMap"), i = t.get("edgeBundles"); return ( i || (i = []), e.forEach(function (t, e) { (i[e] && void 0 !== i[e]) || (i[e] = []); }), e.forEach(function (o, a) { var s = r[o.source], u = r[o.target]; e.forEach(function (e, o) { if (!(o <= a)) { var c = r[e.source], h = r[e.target]; t.getBundleScore( { source: s, target: u }, { source: c, target: h }, ) >= n && (i[a].push(o), i[o].push(a)); } }); }), i ); }), (e.prototype.getBundleScore = function (t, e) { return ( (t.vx = t.target.x - t.source.x), (t.vy = t.target.y - t.source.y), (e.vx = e.target.x - e.source.x), (e.vy = e.target.y - e.source.y), (t.length = oo( { x: t.source.x, y: t.source.y }, { x: t.target.x, y: t.target.y }, )), (e.length = oo( { x: e.source.x, y: e.source.y }, { x: e.target.x, y: e.target.y }, )), this.getAngleScore(t, e) * this.getScaleScore(t, e) * this.getPositionScore(t, e) * this.getVisibilityScore(t, e) ); }), (e.prototype.getAngleScore = function (t, e) { return ( (function (t, e) { return t.x * e.x + t.y * e.y; })({ x: t.vx, y: t.vy }, { x: e.vx, y: e.vy }) / (t.length * e.length) ); }), (e.prototype.getScaleScore = function (t, e) { var n = (t.length + e.length) / 2; return ( 2 / (n / Math.min(t.length, e.length) + Math.max(t.length, e.length) / n) ); }), (e.prototype.getPositionScore = function (t, e) { var n = (t.length + e.length) / 2; return ( n / (n + oo( { x: (t.source.x + t.target.x) / 2, y: (t.source.y + t.target.y) / 2, }, { x: (e.source.x + e.target.x) / 2, y: (e.source.y + e.target.y) / 2, }, )) ); }), (e.prototype.getVisibilityScore = function (t, e) { var n = this.getEdgeVisibility(t, e), r = this.getEdgeVisibility(e, t); return n < r ? n : r; }), (e.prototype.getEdgeVisibility = function (t, e) { var n = ao(e.source, t), r = ao(e.target, t), i = { x: (n.x + r.x) / 2, y: (n.y + r.y) / 2 }, o = { x: (t.source.x + t.target.x) / 2, y: (t.source.y + t.target.y) / 2, }; return Math.max(0, 1 - (2 * oo(i, o)) / oo(n, r)); }), (e.prototype.getEdgeForces = function (t, e, n, r) { for ( var i = this.get("edgePoints"), o = this.get("K") / (oo(t.source, t.target) * (n + 1)), a = [{ x: 0, y: 0 }], s = 1; s < n; s++ ) { var u = { x: 0, y: 0 }, c = this.getSpringForce( { pre: i[e][s - 1], cur: i[e][s], next: i[e][s + 1] }, o, ), h = this.getElectrostaticForce(s, e); (u.x = r * (c.x + h.x)), (u.y = r * (c.y + h.y)), a.push(u); } return a.push({ x: 0, y: 0 }), a; }), (e.prototype.getSpringForce = function (t, e) { var n = t.pre.x + t.next.x - 2 * t.cur.x, r = t.pre.y + t.next.y - 2 * t.cur.y; return { x: (n *= e), y: (r *= e) }; }), (e.prototype.getElectrostaticForce = function (t, e) { var n = this.get("eps"), r = this.get("edgeBundles"), i = this.get("edgePoints"), o = r[e], a = { x: 0, y: 0 }; return ( o.forEach(function (r) { var o = { x: i[r][t].x - i[e][t].x, y: i[r][t].y - i[e][t].y, }; if (Math.abs(o.x) > n || Math.abs(o.y) > n) { var s = 1 / oo(i[r][t], i[e][t]); (a.x += o.x * s), (a.y += o.y * s); } }), a ); }), (e.prototype.isTicking = function () { return this.get("ticking"); }), (e.prototype.getSimulation = function () { return this.get("forceSimulation"); }), (e.prototype.destroy = function () { this.get("ticking") && this.getSimulation().stop(), t.prototype.destroy.call(this); }), e ); })(Qe), uo = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(h.c)(e, t), (e.prototype.getDefaultCfgs = function () { return { offsetX: 6, offsetY: 6, handleMenuClick: void 0, getContent: function (t) { return "\n
\n
菜单项1
\n
菜单项2
\n
\n "; }, getCss: function () { return "\n .f6-contextmenu-ul {\n display: flex;\n width: 100;\n border: 1 solid #e2e2e2;\n border-radius: 4;\n font-size: 12;\n color: #545454;\n padding: 10 8;\n background-color: rgba(255, 255, 255, 0.9);\n }\n .f6-contextmenu-li {\n opacity: 0;\n justify-content: center;\n text-align: center;\n height: 50;\n }\n "; }, shouldBegin: function (t) { return !0; }, onHide: function () { return !0; }, itemTypes: ["node", "edge", "combo"], }; }), (e.prototype.getEvents = function () { return { press: "onMenuShow" }; }), (e.prototype.init = function () { var t = this; this.get("graph").on("tap", function () { t.onMenuHide(); }); }), (e.prototype.onMenuShow = function (t) { var e, n; t.preventDefault(); var r = this.get("itemTypes"); if (t.item) { if ( t.item && t.item.getType && -1 === r.indexOf(t.item.getType()) ) return void this.onMenuHide(); } else if (-1 === r.indexOf("canvas")) return void this.onMenuHide(); if (this.get("shouldBegin")(t)) { var i = this.get("className"), o = this.get("graph"), a = o.get("uiGroup"), s = this.get("getContent"), u = this.get("getCss"), c = "\n root {\n display: flex;\n font-size: 12;\n color: #545454;\n }\n text {\n height: 12;\n opacity: 1;\n }\n " + (null !== (e = null == u ? void 0 : u()) && void 0 !== e ? e : "") + "\n ", h = H( "" + s(t, o) + "", c, a, ); null === (n = this.get("menu")) || void 0 === n || n.remove(), this.set("menu", h); var l = this.get("handleMenuClick"); if (l) { var d = function (e) { var n; e.stopPropagation(), l( null === (n = e.uiNode) || void 0 === n ? void 0 : n.attributes, t.item, o, ); }; this.set("handleMenuClickWrapper", d), h.on("tap", d); } var f = o.get("width"), p = o.get("height"), g = h.width, y = h.height, v = (h.left, h.right, this.get("offsetX") || 0), m = this.get("offsetY") || 0, b = t.canvasX + v, x = t.canvasY + m; b + g > f && (b = t.canvasX - g - v), x + y > p && (x = t.canvasY - y - m), h.setStyle("left", b), h.setStyle("top", x); } }), (e.prototype.onMenuHide = function () { var t = this.get("menu"); null == t || t.remove(); }), (e.prototype.destroy = function () { var t = this.get("menu"); null == t || t.remove(); }), e ); })(Qe), co = { TimeBar: $e, SnapLine: qi, Tooltip: Hi, Legend: Zi, ZoomSlider: Ki, EdgeFilterLens: Ji, Fisheye: eo, MiniMap: io, Bundling: so, Menu: uo, }; e.default = co; }, ]).default; }); //# sourceMappingURL=f6Plugin.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/canvas/canvas.js ================================================ Component({ data: { finalPixelRatio: 1, }, properties: { style: { type: String, value: "", }, width: { type: Number, value: 100, }, height: { type: Number, value: 100, }, onInit: { type: Function, value: function value() {}, }, onTouchEvent: { type: Function, value: function value() {}, }, onError: { type: Function, value: function value() {}, }, pixelRatio: { type: Number, value: 1, }, }, observers: { pixelRatio: function (pixelRatio) { this.setData({ finalPixelRatio: pixelRatio >= 1 ? Math.ceil(pixelRatio) : 1, }); }, }, ready: function ready() { const query = wx.createSelectorQuery().in(this); query .select("#f6-canvas") .fields({ node: true, size: true, }) .exec((ret) => { console.log("ret", ret); var canvas = ret[0].node; const finalPixelRatio = this.data.finalPixelRatio; canvas.width = this.data.width * finalPixelRatio; canvas.height = this.data.height * finalPixelRatio; this.rect = { width: this.data.width * finalPixelRatio, height: this.data.height * finalPixelRatio, left: canvas._left, top: canvas._top, }; console.log("rect", this.rect); this.ctx = canvas.getContext("2d"); this.triggerEvent("onInit", { ctx: this.ctx, rect: this.rect, canvas: canvas, renderer: "mini-native", }); }); }, methods: { error: function error(e) { this.data.onError(e); }, ontouch: function ontouch(e) { var i = 0; for (i = 0; i < e.touches.length; i++) { modifyEvent(e.touches[i]); } for (i = 0; i < e.changedTouches.length; i++) { modifyEvent(e.changedTouches[i]); } this.triggerEvent("onTouchEvent", e); }, }, }); function modifyEvent(touchEvent) { touchEvent.clientX = touchEvent.x; touchEvent.clientY = touchEvent.y; touchEvent.pageX = touchEvent.x; touchEvent.pageY = touchEvent.y; } ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/canvas/canvas.json ================================================ { "component": true, "usingComponents": {} } ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/canvas/canvas.wxml ================================================ ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/container/container.js ================================================ Component({ data: {}, properties: { style: { type: String, value: "", }, width: { type: Number, value: 100, }, height: { type: Number, value: 100, }, onInit: { type: Function, value: () => {}, }, onTouchEvent: { type: Function, value: () => {}, }, onError: { type: Function, value: () => {}, }, pixelRatio: { type: Number, value: 1, }, }, observers: { pixelRatio: function (pixelRatio) { this.setData({ finalPixelRatio: pixelRatio >= 1 ? Math.ceil(pixelRatio) : 1, }); }, }, ready() { const query = wx.createSelectorQuery().in(this); query .select("#g6-canvas") .fields({ node: true, size: true, }) .exec((ret) => { console.log("ret", ret); const { node: canvas } = ret[0]; const finalPixelRatio = this.data.finalPixelRatio; canvas.width = this.data.width * finalPixelRatio; canvas.height = this.data.height * finalPixelRatio; this.rect = { width: this.data.width * finalPixelRatio, height: this.data.height * finalPixelRatio, left: canvas._left, top: canvas._top, }; console.log("rect", this.rect); this.ctx = canvas.getContext("2d"); this.data.onInit(this.ctx, this.rect, canvas, "mini-native"); }); }, methods: { error(e) { this.data.onError(e); }, ontouch(e) { let i = 0; for (i = 0; i < e.touches.length; i++) { modifyEvent(e.touches[i]); } for (i = 0; i < e.changedTouches.length; i++) { modifyEvent(e.changedTouches[i]); } this.data.onTouchEvent(e); }, }, }); function modifyEvent(touchEvent) { touchEvent.clientX = touchEvent.x; touchEvent.clientY = touchEvent.y; touchEvent.pageX = touchEvent.x; touchEvent.pageY = touchEvent.y; } ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/container/container.json ================================================ { "component": true, "usingComponents": {} } ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/container/container.wxml ================================================ ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/graph/treeGraph.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports; } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: e }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, n) { if ((1 & n && (t = r(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var e = Object.create(null); if ( (r.r(e), Object.defineProperty(e, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var i in t) r.d( e, i, function (n) { return t[n]; }.bind(null, i), ); return e; }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 214)) ); })({ 0: function (t, n, r) { "use strict"; r.d(n, "e", function () { return O; }), r.d(n, "x", function () { return j; }), r.d(n, "l", function () { return w; }), r.d(n, "p", function () { return v; }), r.d(n, "q", function () { return y; }), r.d(n, "s", function () { return A; }), r.d(n, "u", function () { return P; }), r.d(n, "w", function () { return M; }), r.d(n, "f", function () { return c; }), r.d(n, "g", function () { return C; }), r.d(n, "i", function () { return u; }), r.d(n, "j", function () { return a; }), r.d(n, "k", function () { return x; }), r.d(n, "m", function () { return s; }), r.d(n, "n", function () { return p; }), r.d(n, "o", function () { return b; }), r.d(n, "a", function () { return N; }), r.d(n, "b", function () { return k; }), r.d(n, "c", function () { return l; }), r.d(n, "h", function () { return T; }), r.d(n, "r", function () { return I; }), r.d(n, "d", function () { return D; }), r.d(n, "v", function () { return F; }), r.d(n, "t", function () { return R; }); var e = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = {}.toString, o = function (t, n) { return i.call(t) === "[object " + n + "]"; }, u = function (t) { return o(t, "Function"); }, a = function (t) { return null == t; }, c = function (t) { return Array.isArray ? Array.isArray(t) : o(t, "Array"); }; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var s = function (t) { var n = f(t); return (null !== t && "object" === n) || "function" === n; }; var l = function (t, n) { if (t) if (c(t)) for (var r = 0, e = t.length; r < e && !1 !== n(t[r], r); r++); else if (s(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === n(t[i], i)) break; }; Object.keys; function d(t) { return (d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var h = function (t) { return "object" === d(t) && null !== t; }, p = function (t) { if (!h(t) || !o(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; var v = function (t) { if (c(t)) return t.reduce(function (t, n) { return Math.max(t, n); }, t[0]); }, y = function (t) { if (c(t)) return t.reduce(function (t, n) { return Math.min(t, n); }, t[0]); }, g = Array.prototype, b = (g.splice, g.indexOf, Array.prototype.splice, function (t) { return o(t, "String"); }); var m = Object.prototype.hasOwnProperty; var O = function (t, n) { if (!n || !c(t)) return {}; for ( var r, e = {}, i = u(n) ? n : function (t) { return t[n]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (r = i(a)), m.call(e, r) ? e[r].push(a) : (e[r] = [a]); } return e; }; var j = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }; var x = function (t) { return o(t, "Number"); }; Number.isInteger && Number.isInteger; function w(t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; } var A = function (t, n) { return ((t % n) + n) % n; }, S = (Math.PI, parseInt, Math.PI / 180), P = function (t) { return S * t; }, _ = (Object.values, function (t) { return a(t) ? "" : t.toString(); }); var M = function (t) { var n = _(t); return n.charAt(0).toUpperCase() + n.substring(1); }, C = function (t) { return o(t, "Boolean"); }; Object.prototype; function E(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } function I(t, n, r, e) { return n && E(t, n), r && E(t, r), e && E(t, e), t; } function B(t) { return (B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var N = function t(n) { if ("object" !== B(n) || null === n) return n; var r; if (c(n)) { r = []; for (var e = 0, i = n.length; e < i; e++) "object" === B(n[e]) && null != n[e] ? (r[e] = t(n[e])) : (r[e] = n[e]); } else for (var o in ((r = {}), n)) "object" === B(n[o]) && null != n[o] ? (r[o] = t(n[o])) : (r[o] = n[o]); return r; }; function L(t, n, r, e) { for (var i in ((r = r || 0), (e = e || 5), n)) if (n.hasOwnProperty(i)) { var o = n[i]; null !== o && p(o) ? (p(t[i]) || (t[i] = {}), r < e ? L(t[i], o, r + 1, e) : (t[i] = n[i])) : c(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var k = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) L(t, n[e]); return t; }; Object.prototype.hasOwnProperty; var T = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (b(n) || b(r)) return !1; if (e(n) || e(r)) { if (n.length !== r.length) return !1; for (var i = !0, o = 0; o < n.length && (i = t(n[o], r[o])); o++); return i; } if (h(n) || h(r)) { var u = Object.keys(n), a = Object.keys(r); if (u.length !== a.length) return !1; for (i = !0, o = 0; o < u.length && (i = t(n[u[o]], r[u[o]])); o++); return i; } return !1; }, D = function (t, n, r) { for (var e = 0, i = b(n) ? n.split(".") : n; t && e < i.length; ) t = t[i[e++]]; return void 0 === t || e < i.length ? r : t; }, H = (Object.prototype.hasOwnProperty, {}), F = function (t) { return H[(t = t || "g")] ? (H[t] += 1) : (H[t] = 1), t + H[t]; }, R = function () {}; !(function () { function t() { this.map = {}; } (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }); })(); }, 1: function (t, n, r) { "use strict"; r.d(n, "c", function () { return i; }), r.d(n, "a", function () { return o; }), r.d(n, "e", function () { return u; }), r.d(n, "b", function () { return a; }), r.d(n, "d", function () { return c; }), r.d(n, "g", function () { return f; }), r.d(n, "f", function () { return s; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var e = function (t, n) { return (e = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); })(t, n); }; function i(t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function r() { this.constructor = t; } e(t, n), (t.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); } var o = function () { return (o = Object.assign || function (t) { for (var n, r = 1, e = arguments.length; r < e; r++) for (var i in (n = arguments[r])) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]); return t; }).apply(this, arguments); }; function u(t, n) { var r = {}; for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (e = Object.getOwnPropertySymbols(t); i < e.length; i++) n.indexOf(e[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[i]) && (r[e[i]] = t[e[i]]); } return r; } function a(t, n, r, e) { return new (r || (r = Promise))(function (i, o) { function u(t) { try { c(e.next(t)); } catch (t) { o(t); } } function a(t) { try { c(e.throw(t)); } catch (t) { o(t); } } function c(t) { var n; t.done ? i(t.value) : ((n = t.value), n instanceof r ? n : new r(function (t) { t(n); })).then(u, a); } c((e = e.apply(t, n || [])).next()); }); } function c(t, n) { var r, e, i, o, u = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: a(0), throw: a(1), return: a(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function a(o) { return function (a) { return (function (o) { if (r) throw new TypeError("Generator is already executing."); for (; u; ) try { if ( ((r = 1), e && (i = 2 & o[0] ? e.return : o[0] ? e.throw || ((i = e.return) && i.call(e), 0) : e.next) && !(i = i.call(e, o[1])).done) ) return i; switch (((e = 0), i && (o = [2 & o[0], i.value]), o[0])) { case 0: case 1: i = o; break; case 4: return u.label++, { value: o[1], done: !1 }; case 5: u.label++, (e = o[1]), (o = [0]); continue; case 7: (o = u.ops.pop()), u.trys.pop(); continue; default: if ( !((i = u.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== o[0] && 2 !== o[0])) ) { u = 0; continue; } if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) { u.label = o[1]; break; } if (6 === o[0] && u.label < i[1]) { (u.label = i[1]), (i = o); break; } if (i && u.label < i[2]) { (u.label = i[2]), u.ops.push(o); break; } i[2] && u.ops.pop(), u.trys.pop(); continue; } o = n.call(t, u); } catch (t) { (o = [6, t]), (e = 0); } finally { r = i = 0; } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 }; })([o, a]); }; } } Object.create; function f() { for (var t = 0, n = 0, r = arguments.length; n < r; n++) t += arguments[n].length; var e = Array(t), i = 0; for (n = 0; n < r; n++) for (var o = arguments[n], u = 0, a = o.length; u < a; u++, i++) e[i] = o[u]; return e; } function s(t, n, r) { if (r || 2 === arguments.length) for (var e, i = 0, o = n.length; i < o; i++) (!e && i in n) || (e || (e = Array.prototype.slice.call(n, 0, i)), (e[i] = n[i])); return t.concat(e || n); } Object.create; }, 104: function (t, n, r) { (function (t) { var r, e, i, o; function u(t) { return (u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } "undefined" != typeof self && self, (o = function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return ( t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports ); } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { configurable: !1, enumerable: !0, get: e, }); }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 31)) ); })([ function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Array.isArray ? Array.isArray(t) : Object(e.a)(t, "Array"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( null !== t && "function" != typeof t && isFinite(t.length) ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(13); n.a = function (t, n) { if (t) if (Object(e.a)(t)) for ( var r = 0, o = t.length; r < o && !1 !== n(t[r], r); r++ ); else if (Object(i.a)(t)) for (var u in t) if (t.hasOwnProperty(u) && !1 === n(t[u], u)) break; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Function"); }; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t, n) { return e.call(t) === "[object " + n + "]"; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Number"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null == t; }; }, function (t, n, r) { var e = r(33).mix; t.exports = { assign: e }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "String"); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(4); n.a = function (t) { if (!Object(e.a)(t) || !Object(i.a)(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; }, function (t, n, r) { "use strict"; var e = r(6); n.a = function (t) { return Object(e.a)(t) ? "" : t.toString(); }; }, function (t, n, r) { var e = r(18), i = (function () { function t(t, n) { void 0 === n && (n = {}), (this.options = n), (this.rootNode = e(t, n)); } return ( (t.prototype.execute = function () { throw new Error("please override this method"); }), t ); })(); t.exports = i; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { return !!Object(e.a)(t) && t.indexOf(n) > -1; }; }, function (t, n, r) { "use strict"; n.a = function (t) { var n = u(t); return (null !== t && "object" === n) || "function" === n; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { n(t, e) && r.push(t); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return "object" === u(t) && null !== t; }; }, function (t, n, r) { "use strict"; function e(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } n.a = function (t, n, r, i) { return n && e(t, n), r && e(t, r), i && e(t, i), t; }; }, function (t, n, r) { var e = r(30), i = ["LR", "RL", "TB", "BT", "H", "V"], o = ["LR", "RL", "H"], u = i[0]; t.exports = function (t, n, r) { var a = n.direction || u; if ( ((n.isHorizontal = (function (t) { return o.indexOf(t) > -1; })(a)), a && -1 === i.indexOf(a)) ) throw new TypeError("Invalid direction: " + a); if (a === i[0]) r(t, n); else if (a === i[1]) r(t, n), t.right2left(); else if (a === i[2]) r(t, n); else if (a === i[3]) r(t, n), t.bottom2top(); else if (a === i[4] || a === i[5]) { var c = e(t, n), f = c.left, s = c.right; r(f, n), r(s, n), n.isHorizontal ? f.right2left() : f.bottom2top(), s.translate(f.x - s.x, f.y - s.y), (t.x = f.x), (t.y = s.y); var l = t.getBoundingBox(); n.isHorizontal ? l.top < 0 && t.translate(0, -l.top) : l.left < 0 && t.translate(-l.left, 0); } var d = n.fixedRoot; return ( void 0 === d && (d = !0), d && t.translate( -(t.x + t.width / 2 + t.hgap), -(t.y + t.height / 2 + t.vgap), ), t ); }; }, function (t, n, r) { var e = r(7), i = { getId: function (t) { return t.id || t.name; }, getPreH: function (t) { return t.preH || 0; }, getPreV: function (t) { return t.preV || 0; }, getHGap: function (t) { return t.hgap || 18; }, getVGap: function (t) { return t.vgap || 18; }, getChildren: function (t) { return t.children; }, getHeight: function (t) { return t.height || 36; }, getWidth: function (t) { var n = t.label || " "; return t.width || 18 * n.split("").length; }, }; function o(t, n) { var r = this; if (((r.vgap = r.hgap = 0), t instanceof o)) return t; r.data = t; var e = n.getHGap(t), i = n.getVGap(t); return ( (r.preH = n.getPreH(t)), (r.preV = n.getPreV(t)), (r.width = n.getWidth(t)), (r.height = n.getHeight(t)), (r.width += r.preH), (r.height += r.preV), (r.id = n.getId(t)), (r.x = r.y = 0), (r.depth = 0), r.children || (r.children = []), r.addGap(e, i), r ); } e.assign(o.prototype, { isRoot: function () { return 0 === this.depth; }, isLeaf: function () { return 0 === this.children.length; }, addGap: function (t, n) { (this.hgap += t), (this.vgap += n), (this.width += 2 * t), (this.height += 2 * n); }, eachNode: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = n.children.concat(r)); }, DFTraverse: function (t) { this.eachNode(t); }, BFTraverse: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = r.concat(n.children)); }, getBoundingBox: function () { var t = { left: Number.MAX_VALUE, top: Number.MAX_VALUE, width: 0, height: 0, }; return ( this.eachNode(function (n) { (t.left = Math.min(t.left, n.x)), (t.top = Math.min(t.top, n.y)), (t.width = Math.max(t.width, n.x + n.width)), (t.height = Math.max(t.height, n.y + n.height)); }), t ); }, translate: function (t, n) { void 0 === t && (t = 0), void 0 === n && (n = 0), this.eachNode(function (r) { (r.x += t), (r.y += n), (r.x += r.preH), (r.y += r.preV); }); }, right2left: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.x = n.x - 2 * (n.x - t.left) - n.width; }), this.translate(t.width, 0); }, bottom2top: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.y = n.y - 2 * (n.y - t.top) - n.height; }), this.translate(0, t.height); }, }), (t.exports = function (t, n, r) { void 0 === n && (n = {}); var u, a = new o(t, (n = e.assign({}, i, n))), c = [a]; if (!r && !t.collapsed) for (; (u = c.shift()); ) if (!u.data.collapsed) { var f = n.getChildren(u.data), s = f ? f.length : 0; if (((u.children = new Array(s)), f && s)) for (var l = 0; l < s; l++) { var d = new o(f[l], n); (u.children[l] = d), c.push(d), (d.parent = u), (d.depth = u.depth + 1); } } return a; }); }, function (t, n, r) { "use strict"; var e = r(6), i = r(20); n.a = function (t, n) { var r = Object(i.a)(n), o = r.length; if (Object(e.a)(t)) return !o; for (var u = 0; u < o; u += 1) { var a = r[u]; if (n[a] !== t[a] || !(a in t)) return !1; } return !0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), o = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(e); }), n ); }; n.a = o; }, function (t, n, r) { "use strict"; var e = r(1), i = Array.prototype.splice; n.a = function (t, n) { if (!Object(e.a)(t)) return []; for (var r = t ? n.length : 0, o = r - 1; r--; ) { var u = void 0, a = n[r]; (r !== o && a === u) || ((u = a), i.call(t, a, 1)); } return t; }; }, function (t, n, r) { "use strict"; var e = r(12), i = r(2); n.a = function (t) { var n = []; return ( Object(i.a)(t, function (t) { Object(e.a)(n, t) || n.push(t); }), n ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(3), o = r(24); n.a = function (t, n) { if (!n) return { 0: t }; if (!Object(i.a)(n)) { var r = Object(e.a)(n) ? n : n.replace(/\s+/g, "").split("*"); n = function (t) { for (var n = "_", e = 0, i = r.length; e < i; e++) n += t[r[e]] && t[r[e]].toString(); return n; }; } return Object(o.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3), u = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (!n || !Object(i.a)(t)) return {}; var r, a = {}, c = Object(o.a)(n) ? n : function (t) { return t[n]; }; return ( Object(e.a)(t, function (t) { (r = c(t)), u.call(a, r) ? a[r].push(t) : (a[r] = [t]); }), a ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t.hasOwnProperty(n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), o = Object.values ? function (t) { return Object.values(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(r); }), n ); }; n.a = o; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t) { return e .call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }; }, function (t, n, r) { "use strict"; var e = Object.prototype; n.a = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(1), o = r(8); n.a = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (Object(o.a)(n) || Object(o.a)(r)) return !1; if (Object(i.a)(n) || Object(i.a)(r)) { if (n.length !== r.length) return !1; for ( var u = !0, a = 0; a < n.length && (u = t(n[a], r[a])); a++ ); return u; } if (Object(e.a)(n) || Object(e.a)(r)) { var c = Object.keys(n), f = Object.keys(r); if (c.length !== f.length) return !1; for ( u = !0, a = 0; a < c.length && (u = t(n[c[a]], r[c[a]])); a++ ); return u; } return !1; }; }, function (t, n, r) { var e = r(18); t.exports = function (t, n) { for ( var r = e(t.data, n, !0), i = e(t.data, n, !0), o = t.children.length, u = Math.round(o / 2), a = n.getSide || function (t, n) { return n < u ? "right" : "left"; }, c = 0; c < o; c++ ) { var f = t.children[c]; "right" === a(f, c) ? i.children.push(f) : r.children.push(f); } return ( r.eachNode(function (t) { t.isRoot() || (t.side = "left"); }), i.eachNode(function (t) { t.isRoot() || (t.side = "right"); }), { left: r, right: i } ); }; }, function (t, n, r) { var e = { compactBox: r(32), dendrogram: r(114), indented: r(116), mindmap: r(118), }; t.exports = e; }, function (t, n, r) { var e = r(11), i = r(113), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return o(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }); var e = r(12); r.d(n, "contains", function () { return e.a; }), r.d(n, "includes", function () { return e.a; }); var i = r(34); r.d(n, "difference", function () { return i.a; }); var o = r(35); r.d(n, "find", function () { return o.a; }); var u = r(36); r.d(n, "findIndex", function () { return u.a; }); var a = r(37); r.d(n, "firstValue", function () { return a.a; }); var c = r(38); r.d(n, "flatten", function () { return c.a; }); var f = r(39); r.d(n, "flattenDeep", function () { return f.a; }); var s = r(40); r.d(n, "getRange", function () { return s.a; }); var l = r(41); r.d(n, "pull", function () { return l.a; }); var d = r(21); r.d(n, "pullAt", function () { return d.a; }); var h = r(42); r.d(n, "reduce", function () { return h.a; }); var p = r(43); r.d(n, "remove", function () { return p.a; }); var v = r(44); r.d(n, "sortBy", function () { return v.a; }); var y = r(45); r.d(n, "union", function () { return y.a; }); var g = r(22); r.d(n, "uniq", function () { return g.a; }); var b = r(46); r.d(n, "valuesOfKey", function () { return b.a; }); var m = r(47); r.d(n, "head", function () { return m.a; }); var O = r(48); r.d(n, "last", function () { return O.a; }); var j = r(49); r.d(n, "startsWith", function () { return j.a; }); var x = r(50); r.d(n, "endsWith", function () { return x.a; }); var w = r(14); r.d(n, "filter", function () { return w.a; }); var A = r(51); r.d(n, "every", function () { return A.a; }); var S = r(52); r.d(n, "some", function () { return S.a; }); var P = r(53); r.d(n, "group", function () { return P.a; }); var _ = r(24); r.d(n, "groupBy", function () { return _.a; }); var M = r(23); r.d(n, "groupToMap", function () { return M.a; }); var C = r(54); r.d(n, "getWrapBehavior", function () { return C.a; }); var E = r(55); r.d(n, "wrapBehavior", function () { return E.a; }); var I = r(56); r.d(n, "number2color", function () { return I.a; }); var B = r(57); r.d(n, "parseRadius", function () { return B.a; }); var N = r(58); r.d(n, "clamp", function () { return N.a; }); var L = r(59); r.d(n, "fixedBase", function () { return L.a; }); var k = r(60); r.d(n, "isDecimal", function () { return k.a; }); var T = r(61); r.d(n, "isEven", function () { return T.a; }); var D = r(62); r.d(n, "isInteger", function () { return D.a; }); var H = r(63); r.d(n, "isNegative", function () { return H.a; }); var F = r(64); r.d(n, "isNumberEqual", function () { return F.a; }); var R = r(65); r.d(n, "isOdd", function () { return R.a; }); var V = r(66); r.d(n, "isPositive", function () { return V.a; }); var z = r(67); r.d(n, "maxBy", function () { return z.a; }); var q = r(68); r.d(n, "minBy", function () { return q.a; }); var U = r(69); r.d(n, "mod", function () { return U.a; }); var G = r(70); r.d(n, "toDegree", function () { return G.a; }); var Y = r(71); r.d(n, "toInteger", function () { return Y.a; }); var W = r(72); r.d(n, "toRadian", function () { return W.a; }); var K = r(73); r.d(n, "forIn", function () { return K.a; }); var X = r(25); r.d(n, "has", function () { return X.a; }); var $ = r(74); r.d(n, "hasKey", function () { return $.a; }); var J = r(75); r.d(n, "hasValue", function () { return J.a; }); var Q = r(20); r.d(n, "keys", function () { return Q.a; }); var Z = r(19); r.d(n, "isMatch", function () { return Z.a; }); var tt = r(26); r.d(n, "values", function () { return tt.a; }); var nt = r(76); r.d(n, "lowerCase", function () { return nt.a; }); var rt = r(77); r.d(n, "lowerFirst", function () { return rt.a; }); var et = r(78); r.d(n, "substitute", function () { return et.a; }); var it = r(79); r.d(n, "upperCase", function () { return it.a; }); var ot = r(80); r.d(n, "upperFirst", function () { return ot.a; }); var ut = r(27); r.d(n, "getType", function () { return ut.a; }); var at = r(81); r.d(n, "isArguments", function () { return at.a; }); var ct = r(0); r.d(n, "isArray", function () { return ct.a; }); var ft = r(1); r.d(n, "isArrayLike", function () { return ft.a; }); var st = r(82); r.d(n, "isBoolean", function () { return st.a; }); var lt = r(83); r.d(n, "isDate", function () { return lt.a; }); var dt = r(84); r.d(n, "isError", function () { return dt.a; }); var ht = r(3); r.d(n, "isFunction", function () { return ht.a; }); var pt = r(85); r.d(n, "isFinite", function () { return pt.a; }); var vt = r(6); r.d(n, "isNil", function () { return vt.a; }); var yt = r(86); r.d(n, "isNull", function () { return yt.a; }); var gt = r(5); r.d(n, "isNumber", function () { return gt.a; }); var bt = r(13); r.d(n, "isObject", function () { return bt.a; }); var mt = r(15); r.d(n, "isObjectLike", function () { return mt.a; }); var Ot = r(9); r.d(n, "isPlainObject", function () { return Ot.a; }); var jt = r(28); r.d(n, "isPrototype", function () { return jt.a; }); var xt = r(87); r.d(n, "isRegExp", function () { return xt.a; }); var wt = r(8); r.d(n, "isString", function () { return wt.a; }); var At = r(4); r.d(n, "isType", function () { return At.a; }); var St = r(88); r.d(n, "isUndefined", function () { return St.a; }); var Pt = r(89); r.d(n, "isElement", function () { return Pt.a; }); var _t = r(90); r.d(n, "requestAnimationFrame", function () { return _t.a; }); var Mt = r(91); r.d(n, "clearAnimationFrame", function () { return Mt.a; }); var Ct = r(92); r.d(n, "augment", function () { return Ct.a; }); var Et = r(93); r.d(n, "clone", function () { return Et.a; }); var It = r(94); r.d(n, "debounce", function () { return It.a; }); var Bt = r(95); r.d(n, "memoize", function () { return Bt.a; }); var Nt = r(96); r.d(n, "deepMix", function () { return Nt.a; }); var Lt = r(2); r.d(n, "each", function () { return Lt.a; }); var kt = r(97); r.d(n, "extend", function () { return kt.a; }); var Tt = r(98); r.d(n, "indexOf", function () { return Tt.a; }); var Dt = r(99); r.d(n, "isEmpty", function () { return Dt.a; }); var Ht = r(29); r.d(n, "isEqual", function () { return Ht.a; }); var Ft = r(100); r.d(n, "isEqualWith", function () { return Ft.a; }); var Rt = r(101); r.d(n, "map", function () { return Rt.a; }); var Vt = r(102); r.d(n, "mapValues", function () { return Vt.a; }); var zt = r(16); r.d(n, "mix", function () { return zt.a; }), r.d(n, "assign", function () { return zt.a; }); var qt = r(103); r.d(n, "get", function () { return qt.a; }); var Ut = r(104); r.d(n, "set", function () { return Ut.a; }); var Gt = r(105); r.d(n, "pick", function () { return Gt.a; }); var Yt = r(106); r.d(n, "throttle", function () { return Yt.a; }); var Wt = r(107); r.d(n, "toArray", function () { return Wt.a; }); var Kt = r(10); r.d(n, "toString", function () { return Kt.a; }); var Xt = r(108); r.d(n, "uniqueId", function () { return Xt.a; }); var $t = r(109); r.d(n, "noop", function () { return $t.a; }); var Jt = r(110); r.d(n, "identity", function () { return Jt.a; }); var Qt = r(111); r.d(n, "size", function () { return Qt.a; }); var Zt = r(112); r.d(n, "Cache", function () { return Zt.a; }); }, function (t, n, r) { "use strict"; var e = r(14), i = r(12); n.a = function (t, n) { return ( void 0 === n && (n = []), Object(e.a)(t, function (t) { return !Object(i.a)(n, t); }) ); }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(19), o = r(0), u = r(9); n.a = function (t, n) { if (!Object(o.a)(t)) return null; var r; if ( (Object(e.a)(n) && (r = n), Object(u.a)(n) && (r = function (t) { return Object(i.a)(t, n); }), r) ) for (var a = 0; a < t.length; a += 1) if (r(t[a])) return t[a]; return null; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { void 0 === r && (r = 0); for (var e = r; e < t.length; e++) if (n(t[e], e)) return e; return -1; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(0); n.a = function (t, n) { for (var r = null, o = 0; o < t.length; o++) { var u = t[o][n]; if (!Object(e.a)(u)) { r = Object(i.a)(u) ? u[0] : u; break; } } return r; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { if (!Object(e.a)(t)) return []; for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n, r) { if ((void 0 === r && (r = []), Object(e.a)(n))) for (var i = 0; i < n.length; i += 1) t(n[i], r); else r.push(n); return r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(14); n.a = function (t) { if ( !(t = Object(i.a)(t, function (t) { return !isNaN(t); })).length ) return { min: 0, max: 0 }; if (Object(e.a)(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); t = n; } var o = Math.max.apply(null, t); return { min: Math.min.apply(null, t), max: o }; }; }, function (t, n, r) { "use strict"; var e = Array.prototype, i = e.splice, o = e.indexOf; n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e++) for (var u = n[e], a = -1; (a = o.call(t, u)) > -1; ) i.call(t, a, 1); return t; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(9); n.a = function (t, n, r) { if (!Object(i.a)(t) && !Object(o.a)(t)) return t; var u = r; return ( Object(e.a)(t, function (t, r) { u = n(u, t, r); }), u ); }; }, function (t, n, r) { "use strict"; var e = r(1), i = r(21); n.a = function (t, n) { var r = []; if (!Object(e.a)(t)) return r; for (var o = -1, u = [], a = t.length; ++o < a; ) { var c = t[o]; n(c, o, t) && (r.push(c), u.push(o)); } return Object(i.a)(t, u), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8), o = r(3); n.a = function (t, n) { var r; if (Object(o.a)(n)) r = function (t, r) { return n(t) - n(r); }; else { var u = []; Object(i.a)(n) ? u.push(n) : Object(e.a)(n) && (u = n), (r = function (t, n) { for (var r = 0; r < u.length; r += 1) { var e = u[r]; if (t[e] > n[e]) return 1; if (t[e] < n[e]) return -1; } return 0; }); } return t.sort(r), t; }; }, function (t, n, r) { "use strict"; var e = r(22); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; return Object(e.a)([].concat.apply([], t)); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(6); n.a = function (t, n) { var r = [], u = {}; return ( t.forEach(function (t) { var a = t[n]; Object(o.a)(a) || (Object(i.a)(a) || (a = [a]), Object(e.a)(a, function (t) { u[t] || (r.push(t), (u[t] = !0)); })); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[0]; }; var e = r(1); }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[t.length - 1]; }; var e = r(1); }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return !(!Object(e.a)(t) && !Object(i.a)(t)) && t[0] === n; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return ( !(!Object(e.a)(t) && !Object(i.a)(t)) && t[t.length - 1] === n ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (!n(t[r], r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (n(t[r], r)) return !0; return !1; }; }, function (t, n, r) { "use strict"; var e = r(23); n.a = function (t, n) { if (!n) return [t]; var r = Object(e.a)(t, n), i = []; for (var o in r) i.push(r[o]); return i; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t["_wrap_" + n]; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { var n = e[t]; if (!n) { for (var r = t.toString(16), i = r.length; i < 6; i++) r = "0" + r; (n = "#" + r), (e[t] = n); } return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { var n = 0, r = 0, i = 0, o = 0; return ( Object(e.a)(t) ? 1 === t.length ? (n = r = i = o = t[0]) : 2 === t.length ? ((n = i = t[0]), (r = o = t[1])) : 3 === t.length ? ((n = t[0]), (r = o = t[1]), (i = t[2])) : ((n = t[0]), (r = t[1]), (i = t[2]), (o = t[3])) : (n = r = i = o = t), { r1: n, r2: r, r3: i, r4: o } ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return t < n ? n : t > r ? r : t; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { var r = n.toString(), e = r.indexOf("."); if (-1 === e) return Math.round(t); var i = r.substr(e + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 1 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 == 0; }; }, function (t, n, r) { "use strict"; var e = r(5), i = Number.isInteger ? Number.isInteger : function (t) { return Object(e.a)(t) && t % 1 == 0; }; n.a = i; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t < 0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t > 0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, u, a = t[0]; return ( (r = Object(o.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (u = Object(o.a)(n) ? n(t) : t[n]) > r && ((a = t), (r = u)); }), a ); } }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, u, a = t[0]; return ( (r = Object(o.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (u = Object(o.a)(n) ? n(t) : t[n]) < r && ((a = t), (r = u)); }), a ); } }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return ((t % n) + n) % n; }; }, function (t, n, r) { "use strict"; var e = 180 / Math.PI; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; n.a = parseInt; }, function (t, n, r) { "use strict"; var e = Math.PI / 180; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; var e = r(2); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(25); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(12), i = r(26); n.a = function (t, n) { return Object(e.a)(Object(i.a)(t), n); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toLowerCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toLowerCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t && n ? t.replace(/\\?\{([^{}]+)\}/g, function (t, r) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === n[r] ? "" : n[r]; }) : t; }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toUpperCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toUpperCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Arguments"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Boolean"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Date"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Error"); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && isFinite(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null === t; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "RegExp"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return void 0 === t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; for (var r = t[0], o = 1; o < t.length; o++) { var u = t[o]; Object(i.a)(u) && (u = u.prototype), Object(e.a)(r.prototype, u); } }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n) { if ("object" !== u(n) || null === n) return n; var r; if (Object(e.a)(n)) { r = []; for (var i = 0, o = n.length; i < o; i++) "object" === u(n[i]) && null != n[i] ? (r[i] = t(n[i])) : (r[i] = n[i]); } else for (var a in ((r = {}), n)) "object" === u(n[a]) && null != n[a] ? (r[a] = t(n[a])) : (r[a] = n[a]); return r; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e; return function () { var i = this, o = arguments, u = function () { (e = null), r || t.apply(i, o); }, a = r && !e; clearTimeout(e), (e = setTimeout(u, n)), a && t.apply(i, o); }; }; }, function (t, n, r) { "use strict"; var e = r(3); n.a = function (t, n) { if (!Object(e.a)(t)) throw new TypeError("Expected a function"); var r = function r() { for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i]; var o = n ? n.apply(this, e) : e[0], u = r.cache; if (u.has(o)) return u.get(o); var a = t.apply(this, e); return u.set(o, a), a; }; return (r.cache = new Map()), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(9); function o(t, n, r, u) { for (var a in ((r = r || 0), (u = u || 5), n)) if (n.hasOwnProperty(a)) { var c = n[a]; null !== c && Object(i.a)(c) ? (Object(i.a)(t[a]) || (t[a] = {}), r < u ? o(t[a], c, r + 1, u) : (t[a] = n[a])) : Object(e.a)(c) ? ((t[a] = []), (t[a] = t[a].concat(c))) : void 0 !== c && (t[a] = c); } } n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) o(t, n[e]); return t; }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function (t, n, r, o) { Object(i.a)(n) || ((r = n), (n = t), (t = function () {})); var u = Object.create ? function (t, n) { return Object.create(t, { constructor: { value: n }, }); } : function (t, n) { function r() {} r.prototype = t; var e = new r(); return (e.constructor = n), e; }, a = u(n.prototype, t); return ( (t.prototype = Object(e.a)(a, t.prototype)), (t.superclass = u(n.prototype, n)), Object(e.a)(a, r), Object(e.a)(t, o), t ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { if (!Object(e.a)(t)) return -1; var r = Array.prototype.indexOf; if (r) return r.call(t, n); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === n) { i = o; break; } return i; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(1), o = r(27), u = r(28), a = Object.prototype.hasOwnProperty; n.a = function (t) { if (Object(e.a)(t)) return !0; if (Object(i.a)(t)) return !t.length; var n = Object(o.a)(t); if ("Map" === n || "Set" === n) return !t.size; if (Object(u.a)(t)) return !Object.keys(t).length; for (var r in t) if (a.call(t, r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(29); n.a = function (t, n, r) { return Object(e.a)(r) ? !!r(t, n) : Object(i.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { r.push(n(t, e)); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(13), o = function (t) { return t; }; n.a = function (t, n) { void 0 === n && (n = o); var r = {}; return ( Object(i.a)(t) && !Object(e.a)(t) && Object.keys(t).forEach(function (e) { r[e] = n(t[e], e); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(8); n.a = function (t, n, r) { for ( var i = 0, o = Object(e.a)(n) ? n.split(".") : n; t && i < o.length; ) t = t[o[i++]]; return void 0 === t || i < o.length ? r : t; }; }, function (t, n, r) { "use strict"; var e = r(13), i = r(8), o = r(5); n.a = function (t, n, r) { var u = t, a = Object(i.a)(n) ? n.split(".") : n; return ( a.forEach(function (t, n) { n < a.length - 1 ? (Object(e.a)(u[t]) || (u[t] = Object(o.a)(a[n + 1]) ? [] : {}), (u = u[t])) : (u[t] = r); }), t ); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(9), o = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (null === t || !Object(i.a)(t)) return {}; var r = {}; return ( Object(e.a)(n, function (n) { o.call(t, n) && (r[n] = t[n]); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e, i, o, u, a = 0; r || (r = {}); var c = function () { (a = !1 === r.leading ? 0 : Date.now()), (e = null), (u = t.apply(i, o)), e || (i = o = null); }, f = function () { var f = Date.now(); a || !1 !== r.leading || (a = f); var s = n - (f - a); return ( (i = this), (o = arguments), s <= 0 || s > n ? (e && (clearTimeout(e), (e = null)), (a = f), (u = t.apply(i, o)), e || (i = o = null)) : e || !1 === r.trailing || (e = setTimeout(c, s)), u ); }; return ( (f.cancel = function () { clearTimeout(e), (a = 0), (e = i = o = null); }), f ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t) { return Object(e.a)(t) ? Array.prototype.slice.call(t) : []; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { return e[(t = t || "g")] ? (e[t] += 1) : (e[t] = 1), t + e[t]; }; }, function (t, n, r) { "use strict"; n.a = function () {}; }, function (t, n, r) { "use strict"; n.a = function (t) { return t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return Object(e.a)(t) ? 0 : Object(i.a)(t) ? t.length : Object.keys(t).length; }; var e = r(6), i = r(1); }, function (t, n, r) { "use strict"; var e = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); n.a = e; }, function (t, n) { function r(t, n, r, e) { void 0 === e && (e = []); var i = this; (i.w = t || 0), (i.h = n || 0), (i.y = r || 0), (i.x = 0), (i.c = e || []), (i.cs = e.length), (i.prelim = 0), (i.mod = 0), (i.shift = 0), (i.change = 0), (i.tl = null), (i.tr = null), (i.el = null), (i.er = null), (i.msel = 0), (i.mser = 0); } function e(t, n) { var r = (function t(n, r) { var e = r ? n.y : n.x; return ( n.children.forEach(function (n) { e = Math.min(t(n, r), e); }), e ); })(t, n); !(function t(n, r, e) { e ? (n.y += r) : (n.x += r), n.children.forEach(function (n) { t(n, r, e); }); })(t, -r, n); } (r.fromNode = function (t, n) { if (!t) return null; var e = []; return ( t.children.forEach(function (t) { e.push(r.fromNode(t, n)); }), n ? new r(t.height, t.width, t.x, e) : new r(t.width, t.height, t.y, e) ); }), (t.exports = function (t, n) { void 0 === n && (n = {}); var i = n.isHorizontal; function o(t) { 0 === t.cs ? ((t.el = t), (t.er = t), (t.msel = t.mser = 0)) : ((t.el = t.c[0].el), (t.msel = t.c[0].msel), (t.er = t.c[t.cs - 1].er), (t.mser = t.c[t.cs - 1].mser)); } function u(t, n, r) { for ( var e = t.c[n - 1], i = e.mod, o = t.c[n], u = o.mod; null !== e && null !== o; ) { s(e) > r.low && (r = r.nxt); var l = i + e.prelim + e.w - (u + o.prelim); l > 0 && ((u += l), a(t, n, r.index, l)); var d = s(e), h = s(o); d <= h && null !== (e = f(e)) && (i += e.mod), d >= h && null !== (o = c(o)) && (u += o.mod); } !e && o ? (function (t, n, r, e) { var i = t.c[0].el; i.tl = r; var o = e - r.mod - t.c[0].msel; (i.mod += o), (i.prelim -= o), (t.c[0].el = t.c[n].el), (t.c[0].msel = t.c[n].msel); })(t, n, o, u) : e && !o && (function (t, n, r, e) { var i = t.c[n].er; i.tr = r; var o = e - r.mod - t.c[n].mser; (i.mod += o), (i.prelim -= o), (t.c[n].er = t.c[n - 1].er), (t.c[n].mser = t.c[n - 1].mser); })(t, n, e, i); } function a(t, n, r, e) { (t.c[n].mod += e), (t.c[n].msel += e), (t.c[n].mser += e), (function (t, n, r, e) { if (r !== n - 1) { var i = n - r; (t.c[r + 1].shift += e / i), (t.c[n].shift -= e / i), (t.c[n].change -= e - e / i); } })(t, n, r, e); } function c(t) { return 0 === t.cs ? t.tl : t.c[0]; } function f(t) { return 0 === t.cs ? t.tr : t.c[t.cs - 1]; } function s(t) { return t.y + t.h; } function l(t, n, r) { for (; null !== r && t >= r.low; ) r = r.nxt; return { low: t, index: n, nxt: r }; } !(function t(n, r, e) { void 0 === e && (e = 0), r ? ((n.x = e), (e += n.width)) : ((n.y = e), (e += n.height)), n.children.forEach(function (n) { t(n, r, e); }); })(t, i); var d = r.fromNode(t, i); return ( (function t(n) { if (0 !== n.cs) { t(n.c[0]); for ( var r = l(s(n.c[0].el), 0, null), e = 1; e < n.cs; ++e ) { t(n.c[e]); var i = s(n.c[e].er); u(n, e, r), (r = l(i, e, r)); } !(function (t) { t.prelim = (t.c[0].prelim + t.c[0].mod + t.c[t.cs - 1].mod + t.c[t.cs - 1].prelim + t.c[t.cs - 1].w) / 2 - t.w / 2; })(n), o(n); } else o(n); })(d), (function t(n, r) { (r += n.mod), (n.x = n.prelim + r), (function (t) { for (var n = 0, r = 0, e = 0; e < t.cs; e++) (n += t.c[e].shift), (r += n + t.c[e].change), (t.c[e].mod += r); })(n); for (var e = 0; e < n.cs; e++) t(n.c[e], r); })(d, 0), (function t(n, r, e) { e ? (r.y = n.x) : (r.x = n.x), n.c.forEach(function (n, i) { t(n, r.children[i], e); }); })(d, t, i), e(t, i), t ); }); }, function (t, n, r) { var e = r(11), i = r(115), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return ( (this.rootNode.width = 0), o(this.rootNode, this.options, i) ); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7); function i(t, n) { void 0 === t && (t = 0), void 0 === n && (n = []); var r = this; (r.x = r.y = 0), (r.leftChild = r.rightChild = null), (r.height = 0), (r.children = n); } var o = { isHorizontal: !0, nodeSep: 20, nodeSize: 20, rankSep: 200, subTreeSep: 10, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, o, n)); var r, u = 0, a = (function t(n) { if (!n) return null; (n.width = 0), n.depth && n.depth > u && (u = n.depth); var r = n.children, e = r.length, o = new i(n.height, []); return ( r.forEach(function (n, r) { var i = t(n); o.children.push(i), 0 === r && (o.leftChild = i), r === e - 1 && (o.rightChild = i); }), (o.originNode = n), (o.isLeaf = n.isLeaf()), o ); })(t); return ( (function t(n) { if (n.isLeaf || 0 === n.children.length) n.drawingDepth = u; else { var r = n.children.map(function (n) { return t(n); }), e = Math.min.apply(null, r); n.drawingDepth = e - 1; } return n.drawingDepth; })(a), (function t(e) { (e.x = e.drawingDepth * n.rankSep), e.isLeaf ? ((e.y = 0), r && ((e.y = r.y + r.height + n.nodeSep), e.originNode.parent !== r.originNode.parent && (e.y += n.subTreeSep)), (r = e)) : (e.children.forEach(function (n) { t(n); }), (e.y = (e.leftChild.y + e.rightChild.y) / 2)); })(a), (function t(n, r, e) { e ? ((r.x = n.x), (r.y = n.y)) : ((r.x = n.y), (r.y = n.x)), n.children.forEach(function (n, i) { t(n, r.children[i], e); }); })(a, t, n.isHorizontal), t ); }; }, function (t, n, r) { var e = r(11), i = r(117), o = r(30), u = r(7), a = ["LR", "RL", "H"], c = a[0], f = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { var t = this.options, n = this.rootNode; t.isHorizontal = !0; var r = t.indent, e = void 0 === r ? 20 : r, u = t.dropCap, f = void 0 === u || u, s = t.direction || c; if (s && -1 === a.indexOf(s)) throw new TypeError("Invalid direction: " + s); if (s === a[0]) i(n, e, f); else if (s === a[1]) i(n, e, f), n.right2left(); else if (s === a[2]) { var l = o(n, t), d = l.left, h = l.right; i(d, e, f), d.right2left(), i(h, e, f); var p = d.getBoundingBox(); h.translate(p.width, 0), (n.x = h.x - n.width / 2); } return n; }), e ); })(e), s = {}; t.exports = function (t, n) { return (n = u.assign({}, s, n)), new f(t, n).execute(); }; }, function (t, n) { t.exports = function (t, n, r) { var e = null; t.eachNode(function (t) { !(function (t, n, r, e) { if (!e) try { if (t.id === t.parent.children[0].id) return ( (t.x += r * t.depth), void (t.y = n ? n.y : 0) ); } catch (t) {} (t.x += r * t.depth), (t.y = n ? n.y + n.height : 0); })(t, e, n, r), (e = t); }); }; }, function (t, n, r) { var e = r(11), i = r(119), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return o(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7), i = { getSubTreeSep: function () { return 0; }, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, i, n)), (t.parent = { x: 0, width: 0, height: 0, y: 0 }), t.BFTraverse(function (t) { t.x = t.parent.x + t.parent.width; }), (t.parent = null), (function t(n, r) { var e = 0; return ( n.children.length ? n.children.forEach(function (n) { e += t(n, r); }) : (e = n.height), (n._subTreeSep = r.getSubTreeSep(n.data)), (n.totalHeight = Math.max(n.height, e) + 2 * n._subTreeSep), n.totalHeight ); })(t, n), (t.startY = 0), (t.y = t.totalHeight / 2 - t.height / 2), t.eachNode(function (t) { var n = t.children, r = n.length; if (r) { var e = n[0]; if (((e.startY = t.startY + t._subTreeSep), 1 === r)) e.y = t.y + t.height / 2 - e.height / 2; else { e.y = e.startY + e.totalHeight / 2 - e.height / 2; for (var i = 1; i < r; i++) { var o = n[i]; (o.startY = n[i - 1].startY + n[i - 1].totalHeight), (o.y = o.startY + o.totalHeight / 2 - o.height / 2); } } } }), (function t(n) { var r = n.children, e = r.length; if (e) { r.forEach(function (n) { t(n); }); var i = r[0], o = r[e - 1], u = o.y - i.y + o.height, a = 0; if ( (r.forEach(function (t) { a += t.totalHeight; }), u > n.height) ) n.y = i.y + u / 2 - n.height / 2; else if (1 !== r.length || n.height > a) { var c = n.y + (n.height - u) / 2 - i.y; r.forEach(function (t) { t.translate(0, c); }); } else n.y = (i.y + i.height / 2 + o.y + o.height / 2) / 2 - n.height / 2; } })(t); }; }, ]); }), "object" === u(n) && "object" === u(t) ? (t.exports = o()) : ((e = []), void 0 === (i = "function" == typeof (r = o) ? r.apply(n, e) : r) || (t.exports = i)); }).call(this, r(50)(t)); }, 214: function (t, n, r) { "use strict"; r.r(n); var e = r(1), i = r(104), o = r.n(i), u = r(0); n.default = function (t) { var n = t.Graph, r = t.Util, i = r.radialLayout, a = r.traverseTree; return (function (t) { function n(n) { var r = t.call(this, n) || this; return ( (r.layoutAnimating = !1), r.set("removeList", []), r.set("layoutMethod", r.getLayout()), r ); } return ( Object(e.c)(n, t), (n.prototype.getLayout = function () { var t = this.get("layout"); return t ? "function" == typeof t ? t : (t.type || (t.type = "dendrogram"), t.direction || (t.direction = "TB"), t.radial ? function (n) { var r = o.a[t.type](n, t); return i(r), r; } : function (n) { return o.a[t.type](n, t); }) : null; }), (n.indexOfChild = function (t, n) { var r = -1; return ( Object(u.c)(t, function (t, e) { if (n === t.id) return (r = e), !1; }), r ); }), (n.prototype.getDefaultCfg = function () { var n = t.prototype.getDefaultCfg.call(this); return (n.animate = !0), n; }), (n.prototype.innerAddChild = function (t, n, r) { var e = this, i = t.data; i && ((i.x = t.x), (i.y = t.y), (i.depth = t.depth)); var o = e.addItem("node", i, !1); if (n) { if ((o.set("parent", n), r)) { var a = n.get("originAttrs"); if (a) o.set("originAttrs", a); else { var c = n.getModel(); o.set("originAttrs", { x: c.x, y: c.y }); } } var f = n.get("children"); f ? f.push(o) : n.set("children", [o]), e.addItem( "edge", { source: n, target: o, id: n.get("id") + ":" + o.get("id"), }, !1, ); } return ( Object(u.c)(t.children || [], function (t) { e.innerAddChild(t, o, r); }), e.emit("afteraddchild", { item: o, parent: n }), o ); }), (n.prototype.innerUpdateChild = function (t, r, e) { var i = this, o = i.findById(t.id); if (o) { Object(u.c)(t.children || [], function (t) { i.innerUpdateChild(t, o, e); }); var a, c, f = o.get("children"); if (f) if (f.length > 0) for (var s = f.length - 1; s >= 0; s--) { var l = f[s].getModel(); -1 === n.indexOfChild(t.children || [], l.id) && (i.innerRemoveChild(l.id, { x: t.x, y: t.y }, e), f.splice(s, 1)); } o.get("originAttrs") && ((a = o.get("originAttrs").x), (c = o.get("originAttrs").y)); var d = o.getModel(); e && o.set("originAttrs", { x: d.x, y: d.y }), o.set("model", t.data), (a === t.x && c === t.y) || o.updatePosition({ x: t.x, y: t.y }); } else i.innerAddChild(t, r, e); }), (n.prototype.innerRemoveChild = function (t, n, r) { var e = this, i = e.findById(t); if (i) if ( (Object(u.c)(i.get("children"), function (t) { e.innerRemoveChild(t.getModel().id, n, r); }), r) ) { var o = i.getModel(); i.set("to", n), i.set("originAttrs", { x: o.x, y: o.y }), e.get("removeList").push(i); } else e.removeItem(i); }), (n.prototype.changeData = function (t) { var n = this; this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }), t ? (n.data(t), n.render()) : n.layout(this.get("fitView")); }), (n.prototype.changeLayout = function (t) { console.warn( "Please call updateLayout instead of changeLayout. changeLayout will be discarded soon", ); this.updateLayout(t); }), (n.prototype.updateLayout = function (t) { t ? (this.set("layout", t), this.set("layoutMethod", this.getLayout()), this.layout()) : console.warn("layout cannot be null"); }), (n.prototype.refreshLayout = function (t) { console.warn( "Please call layout instead of refreshLayout. refreshLayout will be discarded soon", ); this.layout(t); }), (n.prototype.layout = function (t) { var n = this.get("data"), r = this.get("layoutMethod")(n, this.get("layout")), e = this.get("animate"); (this.emit("beforerefreshlayout", { data: n, layoutData: r }), this.emit("beforelayout"), this.innerUpdateChild(r, void 0, e), t) && this.get("viewController").fitView(); e ? this.layoutAnimate(r) : (this.refresh(), this.paint()), this.emit("afterrefreshlayout", { data: n, layoutData: r }), this.emit("afterlayout"); }), (n.prototype.addChild = function (t, n) { this.emit("beforeaddchild", { model: t, parent: n }), Object(u.o)(n) || (n = n.get("id")); var r = this.findDataById(n); r && (r.children || (r.children = []), r.children.push(t), this.changeData()); }), (n.prototype.updateChildren = function (t, n) { n && this.findById(n) ? ((this.findDataById(n).children = t), this.changeData()) : console.warn( "Update children failed! There is no node with id '" + n + "'", ); }), (n.prototype.updateChild = function (t, r) { if (r && this.findById(r)) { var e = this.findDataById(r), i = this.findById(t.id); if ((e.children || (e.children = []), i)) { var o = n.indexOfChild(e.children, t.id); e.children[o] = t; } else e.children.push(t); this.changeData(); } else this.changeData(t); }), (n.prototype.removeChild = function (t) { var r = this.findById(t); if (r) { var e = r.get("parent"); if (e && !e.destroyed) { var i = this.findDataById(e.get("id")), o = (i && i.children) || [], u = r.getModel(), a = n.indexOfChild(o, u.id); o.splice(a, 1); } this.changeData(); } }), (n.prototype.findDataById = function (t, n) { var r = this; if ((n || (n = r.get("data")), t === n.id)) return n; var e = null; return ( Object(u.c)(n.children || [], function (n) { return n.id === t ? ((e = n), !1) : !(e = r.findDataById(t, n)) && void 0; }), e ); }), (n.prototype.layoutAnimate = function (t, n) { var r = this, e = this.get("animateCfg"); r.emit("beforeanimate", { data: t }), r.getEdges().forEach(function (t) { var n = t.get("model"); n.sourceAnchor || (n.sourceAnchor = t.get("sourceAnchorIndex")); }), this.get("canvas").animate( function (e) { a(t, function (i) { var o = r.findById(i.id); if (o) { var u = o.get("originAttrs"), a = o.get("model"); if ( (u || ((u = { x: a.x, y: a.y }), o.set("originAttrs", u)), n) ) { var c = n(o, e, u, t); o.set("model", Object.assign(a, c)); } else (a.x = u.x + (i.x - u.x) * e), (a.y = u.y + (i.y - u.y) * e); } return !0; }), Object(u.c)(r.get("removeList"), function (t) { var n = t.getModel(), r = t.get("originAttrs"), i = t.get("to"); (n.x = r.x + (i.x - r.x) * e), (n.y = r.y + (i.y - r.y) * e); }), r.refreshPositions(); }, { duration: e.duration, easing: e.ease, callback: function () { Object(u.c)(r.getNodes(), function (t) { t.set("originAttrs", null); }), Object(u.c)(r.get("removeList"), function (t) { r.removeItem(t); }), r.set("removeList", []), e.callback && e.callback(), r.emit("afteranimate", { data: t }); }, delay: e.delay, }, ); }), (n.prototype.stopLayoutAnimate = function () { this.get("canvas").stopAnimate(), this.emit("layoutanimateend", { data: this.get("data") }), (this.layoutAnimating = !1); }), (n.prototype.isLayoutAnimating = function () { return this.layoutAnimating; }), (n.prototype.render = function () { if (!this.get("data")) throw new Error("data must be defined first"); this.clear(), this.emit("beforerender"), this.layout(this.get("fitView")), this.emit("afterrender"); }), (n.prototype.save = function () { return this.get("data"); }), n ); })(n); }; }, 50: function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, }).default; }); //# sourceMappingURL=treeGraph.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/circularLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function r(n) { if (e[n]) return e[n].exports; var o = (e[n] = { i: n, l: !1, exports: {} }); return t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; } return ( (r.m = t), (r.c = e), (r.d = function (t, e, n) { r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, e) { if ((1 & e && (t = r(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if ( (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) r.d( n, o, function (e) { return t[e]; }.bind(null, o), ); return n; }), (r.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(e, "a", e), e; }), (r.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (r.p = ""), r((r.s = 215)) ); })({ 10: function (t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? function (t, e, r, n) { void 0 === n && (n = r), Object.defineProperty(t, n, { enumerable: !0, get: function () { return e[r]; }, }); } : function (t, e, r, n) { void 0 === n && (n = r), (t[n] = e[r]); }), o = (this && this.__exportStar) || function (t, e) { for (var r in t) "default" === r || Object.prototype.hasOwnProperty.call(e, r) || n(e, t, r); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(r(11), e), o(r(12), e), o(r(13), e), o(r(14), e), o(r(15), e), o(r(16), e); }, 11: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var n, o, i = /-(\w)/g; e.camelize = ((n = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = n(t)); }); }, 12: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var r = parseFloat(t); return e.isNaN(r) ? t : r; }; }, 14: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, r) { for (var n = [], o = 0; o < t; o++) n[o] = 0; return r ? (r.forEach(function (t) { t.source && (n[e[t.source]] += 1), t.target && (n[e[t.target]] += 1); }), n) : n; }; e.floydWarshall = function (t) { for (var e = [], r = t.length, n = 0; n < r; n += 1) { e[n] = []; for (var o = 0; o < r; o += 1) n === o ? (e[n][o] = 0) : 0 !== t[n][o] && t[n][o] ? (e[n][o] = t[n][o]) : (e[n][o] = 1 / 0); } for (var i = 0; i < r; i += 1) for (n = 0; n < r; n += 1) for (o = 0; o < r; o += 1) e[n][o] > e[n][i] + e[i][o] && (e[n][o] = e[n][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var r = t.nodes, n = t.edges, o = [], i = {}; if (!r) throw new Error("invalid nodes data!"); return ( r && r.forEach(function (t, e) { i[t.id] = e; o.push([]); }), n && n.forEach(function (t) { var r = t.source, n = t.target, u = i[r], s = i[n]; (o[u][s] = 1), e || (o[s][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var r = []; return ( t.forEach(function (t) { var n = []; t.forEach(function (t) { n.push(t * e); }), r.push(n); }), r ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, r) { if (e && e.children) for (var n = e.children.length - 1; n >= 0; n--) if (!t(e.children[n], r)) return; return !!r(e); })(t, e); }; }, 15: function (t, e, r) { "use strict"; function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in (e = arguments[r])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === n(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var r = []; return ( t.forEach(function (t) { r.push(t); }), r.map(function (t) { return e.clone(t); }) ); } if ("object" === n(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 171: function (t, e, r) { "use strict"; var n, o = (this && this.__extends) || ((n = function (t, e) { return (n = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function r() { this.constructor = t; } n(t, e), (t.prototype = null === e ? Object.create(e) : ((r.prototype = e.prototype), new r())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.CircularLayout = void 0); var i = r(7), u = r(10); function s(t, e) { var r = t.degree, n = e.degree; return r < n ? -1 : r > n ? 1 : 0; } var c = (function (t) { function e(e) { var r = t.call(this) || this; return ( (r.radius = null), (r.startRadius = null), (r.endRadius = null), (r.startAngle = 0), (r.endAngle = 2 * Math.PI), (r.clockwise = !0), (r.divisions = 1), (r.ordering = null), (r.angleRatio = 1), (r.nodes = []), (r.edges = []), (r.nodeMap = {}), (r.degrees = []), (r.width = 300), (r.height = 300), r.updateCfg(e), r ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { radius: null, startRadius: null, endRadius: null, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0, divisions: 1, ordering: null, angleRatio: 1, }; }), (e.prototype.execute = function () { var t = this.nodes, e = this.edges, r = t.length; if (0 !== r) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === r) return ( (t[0].x = n[0]), (t[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var o = this.radius, i = this.startRadius, s = this.endRadius, c = this.divisions, a = this.startAngle, f = this.endAngle, d = (f - a) / r, l = {}; t.forEach(function (t, e) { l[t.id] = e; }), (this.nodeMap = l); var h = u.getDegree(t.length, l, e); (this.degrees = h), o || i || s ? !i && s ? (i = s) : i && !s && (s = i) : (o = this.height > this.width ? this.width / 2 : this.height / 2); var p = d * this.angleRatio, y = this.ordering, g = []; g = "topology" === y ? this.topologyOrdering() : "topology-directed" === y ? this.topologyOrdering(!0) : "degree" === y ? this.degreeOrdering() : t; for ( var v = this.clockwise, b = Math.ceil(r / c), _ = 0; _ < r; ++_ ) { var O = o; O || null === i || null === s || (O = i + (_ * (s - i)) / (r - 1)), O || (O = 10 + (100 * _) / (r - 1)); var j = a + (_ % b) * p + ((2 * Math.PI) / c) * Math.floor(_ / b); v || (j = f - (_ % b) * p - ((2 * Math.PI) / c) * Math.floor(_ / b)), (g[_].x = n[0] + Math.cos(j) * O), (g[_].y = n[1] + Math.sin(j) * O), (g[_].weight = h[_]); } return ( this.onLayoutEnd && this.onLayoutEnd(), { nodes: g, edges: this.edges } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.topologyOrdering = function (t) { void 0 === t && (t = !1); var e = this.degrees, r = this.edges, n = this.nodes, o = u.clone(n), i = this.nodeMap, s = [o[0]], c = [n[0]], a = [], f = n.length; (a[0] = !0), (function (t, e, r, n) { t.forEach(function (e, r) { (t[r].children = []), (t[r].parent = []); }), n ? e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].parent; i.push(t[o].id), u.push(t[n].id); }) : e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].children; i.push(t[o].id), u.push(t[n].id); }); })(o, r, i, t); var d = 0; return ( o.forEach(function (t, u) { if (0 !== u) if ( (u !== f - 1 && e[u] === e[u + 1] && !(function (t, e, r) { for (var n = r.length, o = 0; o < n; o++) if ( (t.id === r[o].source && e.id === r[o].target) || (e.id === r[o].source && t.id === r[o].target) ) return !0; return !1; })(s[d], t, r)) || a[u] ) { for ( var l = s[d].children, h = !1, p = 0; p < l.length; p++ ) { var y = i[l[p]]; if (e[y] === e[u] && !a[y]) { s.push(o[y]), c.push(n[i[o[y].id]]), (a[y] = !0), (h = !0); break; } } for ( var g = 0; !h && (a[g] || (s.push(o[g]), c.push(n[i[o[g].id]]), (a[g] = !0), (h = !0)), ++g !== f); ); } else s.push(t), c.push(n[i[t.id]]), (a[u] = !0), d++; }), c ); }), (e.prototype.degreeOrdering = function () { var t = this.nodes, e = [], r = this.degrees; return ( t.forEach(function (t, n) { (t.degree = r[n]), e.push(t); }), e.sort(s), e ); }), (e.prototype.getType = function () { return "circular"; }), e ); })(i.Base); e.CircularLayout = c; }, 215: function (t, e, r) { "use strict"; r.r(e); var n = r(171); e.default = n.CircularLayout; }, 7: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var n = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = n; }, }).default; }); //# sourceMappingURL=circularLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/comboForceLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 216)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, c = i[o], a = i[r]; (n[c][a] = 1), t || (n[a][c] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 172: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ComboForceLayout = void 0); var i = o(7), c = o(10), a = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.center = [0, 0]), (o.maxIteration = 100), (o.gravity = 10), (o.comboGravity = 10), (o.linkDistance = 10), (o.alpha = 1), (o.alphaMin = 0.001), (o.alphaDecay = 1 - Math.pow(o.alphaMin, 1 / 300)), (o.alphaTarget = 0), (o.velocityDecay = 0.6), (o.edgeStrength = 0.6), (o.nodeStrength = 30), (o.preventOverlap = !1), (o.preventNodeOverlap = !1), (o.preventComboOverlap = !1), (o.collideStrength = void 0), (o.nodeCollideStrength = 0.5), (o.comboCollideStrength = 0.5), (o.comboSpacing = 20), (o.comboPadding = 10), (o.optimizeRangeFactor = 1), (o.onTick = function () {}), (o.onLayoutEnd = function () {}), (o.depthAttractiveForceScale = 1), (o.depthRepulsiveForceScale = 2), (o.nodes = []), (o.edges = []), (o.combos = []), (o.comboTrees = []), (o.width = 300), (o.height = 300), (o.bias = []), (o.nodeMap = {}), (o.oriComboMap = {}), (o.indexMap = {}), (o.comboMap = {}), (o.previousLayouted = !1), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { maxIteration: 100, center: [0, 0], gravity: 10, speed: 1, comboGravity: 30, preventOverlap: !1, preventComboOverlap: !0, preventNodeOverlap: !0, nodeSpacing: void 0, collideStrength: void 0, nodeCollideStrength: 0.5, comboCollideStrength: 0.5, comboSpacing: 20, comboPadding: 10, edgeStrength: 0.6, nodeStrength: 30, linkDistance: 10, }; }), (t.prototype.execute = function () { var e = this.nodes, t = this.center; if ( ((this.comboTree = { id: "comboTreeRoot", depth: -1, children: this.comboTrees, }), e && 0 !== e.length) ) { if (1 === e.length) return ( (e[0].x = t[0]), (e[0].y = t[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); this.initVals(), this.run(), this.onLayoutEnd && this.onLayoutEnd(); } else this.onLayoutEnd && this.onLayoutEnd(); }), (t.prototype.run = function () { var e = this, t = e.nodes, o = e.previousLayouted ? e.maxIteration / 5 : e.maxIteration; e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var r = e.center, n = e.velocityDecay, i = e.comboMap; e.previousLayouted || e.initPos(i); for ( var a = function (o) { var r = []; t.forEach(function (e, t) { r[t] = { x: 0, y: 0 }; }), e.applyCalculate(r), e.applyComboCenterForce(r), t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += r[t].x * n), (e.y += r[t].y * n)); }), (e.alpha += (e.alphaTarget - e.alpha) * e.alphaDecay), e.onTick(); }, u = 0; u < o; u++ ) a(); var s = [0, 0]; t.forEach(function (e) { c.isNumber(e.x) && c.isNumber(e.y) && ((s[0] += e.x), (s[1] += e.y)); }), (s[0] /= t.length), (s[1] /= t.length); var f = [r[0] - s[0], r[1] - s[1]]; t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += f[0]), (e.y += f[1])); }), e.combos.forEach(function (e) { var t = i[e.id]; t && t.empty && ((e.x = t.cx || e.x), (e.y = t.cy || e.y)); }), (e.previousLayouted = !0); }), (t.prototype.initVals = function () { var e = this.edges, t = this.nodes, o = this.combos, r = {}, n = {}, i = {}; t.forEach(function (e, t) { (n[e.id] = e), (i[e.id] = t); }), (this.nodeMap = n), (this.indexMap = i); var a = {}; o.forEach(function (e) { a[e.id] = e; }), (this.oriComboMap = a), (this.comboMap = this.getComboMap()); var u = this.preventOverlap; (this.preventComboOverlap = this.preventComboOverlap || u), (this.preventNodeOverlap = this.preventNodeOverlap || u); var s = this.collideStrength; s && ((this.comboCollideStrength = s), (this.nodeCollideStrength = s)), (this.comboCollideStrength = this.comboCollideStrength ? this.comboCollideStrength : 0), (this.nodeCollideStrength = this.nodeCollideStrength ? this.nodeCollideStrength : 0); for (var f = 0; f < e.length; ++f) r[e[f].source] ? r[e[f].source]++ : (r[e[f].source] = 1), r[e[f].target] ? r[e[f].target]++ : (r[e[f].target] = 1); var d = []; for (f = 0; f < e.length; ++f) d[f] = r[e[f].source] / (r[e[f].source] + r[e[f].target]); this.bias = d; var p, h, l = this.nodeSize, y = this.nodeSpacing; if ( ((h = c.isNumber(y) ? function () { return y; } : c.isFunction(y) ? y : function () { return 0; }), (this.nodeSpacing = h), l) ) if (c.isFunction(l)) p = function (e) { return l(e); }; else if (c.isArray(l)) { var v = (l[0] > l[1] ? l[0] : l[1]) / 2; p = function (e) { return v; }; } else { var m = l / 2; p = function (e) { return m; }; } else p = function (e) { return e.size ? c.isArray(e.size) ? (e.size[0] > e.size[1] ? e.size[0] : e.size[1]) / 2 : e.size / 2 : 10; }; this.nodeSize = p; var b, g = this.comboSpacing; (b = c.isNumber(g) ? function () { return g; } : c.isFunction(g) ? g : function () { return 0; }), (this.comboSpacing = b); var x, S = this.comboPadding; (x = c.isNumber(S) ? function () { return S; } : c.isArray(S) ? function () { return Math.max.apply(null, S); } : c.isFunction(S) ? S : function () { return 0; }), (this.comboPadding = x); var M, O = this.linkDistance; O || (O = 10), (M = c.isNumber(O) ? function (e) { return O; } : O), (this.linkDistance = M); var N, C = this.edgeStrength; C || (C = 1), (N = c.isNumber(C) ? function (e) { return C; } : C), (this.edgeStrength = N); var E, _ = this.nodeStrength; _ || (_ = 30), (E = c.isNumber(_) ? function (e) { return _; } : _), (this.nodeStrength = E); }), (t.prototype.initPos = function (e) { this.nodes.forEach(function (t, o) { var r = t.comboId, n = e[r]; r && n ? ((t.x = n.cx + 100 / (o + 1)), (t.y = n.cy + 100 / (o + 1))) : ((t.x = 100 / (o + 1)), (t.y = 100 / (o + 1))); }); }), (t.prototype.getComboMap = function () { var e = this, t = e.nodeMap, o = e.indexMap, r = e.comboTrees, n = e.oriComboMap, i = {}; return ( (r || []).forEach(function (r) { var a = []; c.traverseTreeUp(r, function (r) { if ("node" === r.itemType) return !0; if (!n[r.id]) return !0; if (void 0 === i[r.id]) { var u = { id: r.id, name: r.id, cx: 0, cy: 0, count: 0, depth: e.oriComboMap[r.id].depth, children: [], }; i[r.id] = u; } var s = r.children; s && s.forEach(function (e) { if (!i[e.id] && !t[e.id]) return !0; a.push(e); }); var f = i[r.id]; if (((f.cx = 0), (f.cy = 0), 0 === a.length)) { f.empty = !0; var d = n[r.id], p = Object.keys(t).length, h = r.id + "-visual-child-" + p, l = { id: h, x: d.x, y: d.y, depth: f.depth + 1, itemType: "node", }; e.nodes.push(l), (t[h] = l), (o[h] = p), (f.cx = d.x), (f.cy = d.y), a.push(l); } return ( a.forEach(function (e) { if ((f.count++, "node" !== e.itemType)) { var o = i[e.id]; return ( c.isNumber(o.cx) && (f.cx += o.cx), void (c.isNumber(o.cy) && (f.cy += o.cy)) ); } var r = t[e.id]; r && (c.isNumber(r.x) && (f.cx += r.x), c.isNumber(r.y) && (f.cy += r.y)); }), (f.cx /= f.count), (f.cy /= f.count), (f.children = a), !0 ); }); }), i ); }), (t.prototype.applyComboCenterForce = function (e) { var t = this.gravity, o = this.comboGravity || t, r = this.alpha, n = this.comboTrees, i = this.indexMap, a = this.nodeMap, u = this.comboMap; (n || []).forEach(function (t) { c.traverseTreeUp(t, function (t) { if ("node" === t.itemType) return !0; if (!u[t.id]) return !0; var n = u[t.id], s = ((n.depth + 1) / 10) * 0.5, f = n.cx, d = n.cy; return ( (n.cx = 0), (n.cy = 0), n.children.forEach(function (t) { if ("node" !== t.itemType) { var p = u[t.id]; return ( p && c.isNumber(p.cx) && (n.cx += p.cx), void (p && c.isNumber(p.cy) && (n.cy += p.cy)) ); } var h = a[t.id], l = h.x - f || 0.005, y = h.y - d || 0.005, v = Math.sqrt(l * l + y * y), m = i[h.id], b = ((o * r) / v) * s; (e[m].x -= l * b), (e[m].y -= y * b), c.isNumber(h.x) && (n.cx += h.x), c.isNumber(h.y) && (n.cy += h.y); }), (n.cx /= n.count), (n.cy /= n.count), !0 ); }); }); }), (t.prototype.applyCalculate = function (e) { var t = this.comboMap, o = this.nodes, r = {}; o.forEach(function (e, t) { o.forEach(function (o, n) { if (!(t < n)) { var i = e.x - o.x || 0.005, c = e.y - o.y || 0.005, a = i * i + c * c, u = Math.sqrt(a); a < 1 && (a = u), (r[e.id + "-" + o.id] = { vx: i, vy: c, vl2: a, vl: u }), (r[o.id + "-" + e.id] = { vl2: a, vl: u, vx: -i, vy: -c, }); } }); }), this.updateComboSizes(t), this.calRepulsive(e, r), this.calAttractive(e, r), this.preventComboOverlap && this.comboNonOverlapping(e, t); }), (t.prototype.updateComboSizes = function (e) { var t = this, o = t.comboTrees, r = t.nodeMap, n = t.nodeSize, i = t.comboSpacing, a = t.comboPadding; (o || []).forEach(function (o) { var u = []; c.traverseTreeUp(o, function (o) { if ("node" === o.itemType) return !0; var s = e[o.id]; if (!s) return !1; var f = o.children; f && f.forEach(function (t) { (e[t.id] || r[t.id]) && u.push(t); }), (s.minX = 1 / 0), (s.minY = 1 / 0), (s.maxX = -1 / 0), (s.maxY = -1 / 0), u.forEach(function (e) { if ("node" !== e.itemType) return !0; var t = r[e.id]; if (!t) return !0; var o = n(t), i = t.x - o, c = t.y - o, a = t.x + o, u = t.y + o; s.minX > i && (s.minX = i), s.minY > c && (s.minY = c), s.maxX < a && (s.maxX = a), s.maxY < u && (s.maxY = u); }); var d = t.oriComboMap[o.id].size || 10; c.isArray(d) && (d = d[0]); var p = Math.max(s.maxX - s.minX, s.maxY - s.minY, d); return (s.r = p / 2 + i(s) / 2 + a(s)), !0; }); }); }), (t.prototype.comboNonOverlapping = function (e, t) { var o = this.comboTree, r = this.comboCollideStrength, n = this.indexMap, i = this.nodeMap; c.traverseTreeUp(o, function (o) { if (!t[o.id] && !i[o.id] && "comboTreeRoot" !== o.id) return !1; var c = o.children; return ( c && c.length > 1 && c.forEach(function (o, a) { if ("node" === o.itemType) return !1; var u = t[o.id]; u && c.forEach(function (c, s) { if (a <= s) return !1; if ("node" === c.itemType) return !1; var f = t[c.id]; if (!f) return !1; var d = u.cx - f.cx || 0.005, p = u.cy - f.cy || 0.005, h = d * d + p * p, l = u.r, y = f.r, v = l + y, m = y * y, b = l * l; if (h < v * v) { var g = o.children; if (!g || 0 === g.length) return !1; var x = c.children; if (!x || 0 === x.length) return !1; var S = Math.sqrt(h), M = ((v - S) / S) * r, O = d * M, N = p * M, C = m / (b + m), E = 1 - C; g.forEach(function (t) { if ("node" !== t.itemType) return !1; if (i[t.id]) { var o = n[t.id]; x.forEach(function (t) { if ("node" !== t.itemType) return !1; if (!i[t.id]) return !1; var r = n[t.id]; (e[o].x += O * C), (e[o].y += N * C), (e[r].x -= O * E), (e[r].y -= N * E); }); } }); } }); }), !0 ); }); }), (t.prototype.calRepulsive = function (e, t) { var o = this, r = o.nodes, n = o.width * o.optimizeRangeFactor, i = o.nodeStrength, c = o.alpha, a = o.nodeCollideStrength, u = o.preventNodeOverlap, s = o.nodeSize, f = o.nodeSpacing, d = o.depthRepulsiveForceScale, p = o.center; r.forEach(function (h, l) { if (h.x && h.y) { if (p) { var y = o.gravity, v = h.x - p[0] || 0.005, m = h.y - p[1] || 0.005, b = Math.sqrt(v * v + m * m); (e[l].x -= (v * y * c) / b), (e[l].y -= (m * y * c) / b); } r.forEach(function (o, r) { if (l !== r && o.x && o.y) { var p = t[h.id + "-" + o.id], y = p.vl2, v = p.vl; if (!(v > n)) { var m = t[h.id + "-" + o.id], b = m.vx, g = m.vy, x = Math.log(Math.abs(o.depth - h.depth) / 10) + 1 || 1; (x = x < 1 ? 1 : x), o.comboId !== h.comboId && (x += 1); var S = x ? Math.pow(d, x) : 1, M = ((i(o) * c) / y) * S; if ( ((e[l].x += b * M), (e[l].y += g * M), l < r && u) ) { var O = s(h) + f(h), N = s(o) + f(o), C = O + N; if (y < C * C) { var E = ((C - v) / v) * a, _ = N * N, j = _ / (O * O + _), T = b * E, w = g * E; (e[l].x += T * j), (e[l].y += w * j), (j = 1 - j), (e[r].x -= T * j), (e[r].y -= w * j); } } } } }); } }); }), (t.prototype.calAttractive = function (e, t) { var o = this, r = o.edges, n = o.linkDistance, i = o.alpha, a = o.edgeStrength, u = o.bias, s = o.depthAttractiveForceScale; r.forEach(function (r, f) { if (r.source && r.target && r.source !== r.target) { var d = o.indexMap[r.source], p = o.indexMap[r.target], h = o.nodeMap[r.source], l = o.nodeMap[r.target]; if (h && l) { var y = Math.log(Math.abs(h.depth - l.depth) / 10); h.comboId === l.comboId && (y /= 2); var v = y ? Math.pow(s, y) : 1; if ( (h.comboId !== l.comboId && 1 === v ? (v = s / 2) : h.comboId === l.comboId && (v = 2), c.isNumber(l.x) && c.isNumber(h.x) && c.isNumber(l.y) && c.isNumber(h.y)) ) { var m = t[r.target + "-" + r.source], b = m.vl, g = m.vx, x = m.vy, S = ((b - n(r)) / b) * i * a(r) * v, M = g * S, O = x * S, N = u[f]; (e[p].x -= M * N), (e[p].y -= O * N), (e[d].x += M * (1 - N)), (e[d].y += O * (1 - N)); } } } }); }), (t.prototype.getType = function () { return "comboForce"; }), t ); })(i.Base); t.ComboForceLayout = a; }, 216: function (e, t, o) { "use strict"; o.r(t); var r = o(172); t.default = r.ComboForceLayout; }, 7: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=comboForceLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/concentricLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function n(r) { if (t[r]) return t[r].exports; var o = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = e), (n.c = t), (n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (n.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (n.t = function (e, t) { if ((1 & t && (e = n(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var o in e) n.d( r, o, function (t) { return e[t]; }.bind(null, o), ); return r; }), (n.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return n.d(t, "a", t), t; }), (n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (n.p = ""), n((n.s = 217)) ); })({ 10: function (e, t, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, n, r) { void 0 === r && (r = n), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[n]; }, }); } : function (e, t, n, r) { void 0 === r && (r = n), (e[r] = t[n]); }), o = (this && this.__exportStar) || function (e, t) { for (var n in e) "default" === n || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n); }; Object.defineProperty(t, "__esModule", { value: !0 }), o(n(11), t), o(n(12), t), o(n(13), t), o(n(14), t), o(n(15), t), o(n(16), t); }, 11: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, o, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (o = Object.create(null)), function (e) { return o[e] || (o[e] = r(e)); }); }, 12: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var n = parseFloat(e); return t.isNaN(n) ? e : n; }; }, 14: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, n) { for (var r = [], o = 0; o < e; o++) r[o] = 0; return n ? (n.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], n = e.length, r = 0; r < n; r += 1) { t[r] = []; for (var o = 0; o < n; o += 1) r === o ? (t[r][o] = 0) : 0 !== e[r][o] && e[r][o] ? (t[r][o] = e[r][o]) : (t[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) t[r][o] > t[r][i] + t[i][o] && (t[r][o] = t[r][i] + t[i][o]); return t; }; t.getAdjMatrix = function (e, t) { var n = e.nodes, r = e.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (e, t) { i[e.id] = t; o.push([]); }), r && r.forEach(function (e) { var n = e.source, r = e.target, u = i[n], c = i[r]; (o[u][c] = 1), t || (o[c][u] = 1); }), o ); }; t.scaleMatrix = function (e, t) { var n = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), n.push(r); }), n ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, n) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], n)) return; return !!n(t); })(e, t); }; }, 15: function (e, t, n) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var n = []; return ( e.forEach(function (e) { n.push(e); }), n.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = o({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 173: function (e, t, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function n() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ConcentricLayout = void 0); var i = n(10), u = (function (e) { function t(t) { var n = e.call(this) || this; return ( (n.nodeSize = 30), (n.minNodeSpacing = 10), (n.preventOverlap = !1), (n.equidistant = !1), (n.startAngle = 1.5 * Math.PI), (n.clockwise = !0), (n.sortBy = "degree"), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.onLayoutEnd = function () {}), n.updateCfg(t), n ); } return ( o(t, e), (t.prototype.getDefaultCfg = function () { return { nodeSize: 30, minNodeSpacing: 10, preventOverlap: !1, sweep: void 0, equidistant: !1, startAngle: 1.5 * Math.PI, clockwise: !0, maxLevelDiff: void 0, sortBy: "degree", }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, n = e.edges, r = t.length; if (0 !== r) { e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight), e.center || (e.center = [e.width / 2, e.height / 2]); var o = e.center; if (1 === r) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var u, c = []; (u = i.isArray(e.nodeSize) ? Math.max(e.nodeSize[0], e.nodeSize[1]) : e.nodeSize), t.forEach(function (e) { c.push(e); var t = u; i.isArray(e.size) ? (t = Math.max(e.size[0], e.size[1])) : i.isNumber(e.size) && (t = e.size), (u = Math.max(u, t)); }), (e.clockwise = void 0 !== e.counterclockwise ? !e.counterclockwise : e.clockwise); var a = {}, s = {}; if ( (c.forEach(function (e, t) { (a[e.id] = e), (s[e.id] = t); }), !( ("degree" !== e.sortBy && i.isString(e.sortBy) && void 0 !== c[0][e.sortBy]) || ((e.sortBy = "degree"), i.isNumber(t[0].degree)) )) ) { var f = i.getDegree(t.length, s, n); c.forEach(function (e, t) { e.degree = f[t]; }); } c.sort(function (t, n) { return n[e.sortBy] - t[e.sortBy]; }), (e.maxValueNode = c[0]), (e.maxLevelDiff = e.maxLevelDiff || e.maxValueNode[e.sortBy] / 4); var d = [[]], l = d[0]; c.forEach(function (t) { if (l.length > 0) { var n = Math.abs(l[0][e.sortBy] - t[e.sortBy]); e.maxLevelDiff && n >= e.maxLevelDiff && ((l = []), d.push(l)); } l.push(t); }); var p = u + e.minNodeSpacing; if (!e.preventOverlap) { var h = d.length > 0 && d[0].length > 1, y = (Math.min(e.width, e.height) / 2 - p) / (d.length + (h ? 1 : 0)); p = Math.min(p, y); } var v = 0; if ( (d.forEach(function (t) { var n = e.sweep; void 0 === n && (n = 2 * Math.PI - (2 * Math.PI) / t.length); var r = (t.dTheta = n / Math.max(1, t.length - 1)); if (t.length > 1 && e.preventOverlap) { var o = Math.cos(r) - Math.cos(0), i = Math.sin(r) - Math.sin(0), u = Math.sqrt((p * p) / (o * o + i * i)); v = Math.max(u, v); } (t.r = v), (v += p); }), e.equidistant) ) { for (var g = 0, b = 0, m = 0; m < d.length; m++) { var _ = d[m].r - b; g = Math.max(g, _); } (b = 0), d.forEach(function (e, t) { 0 === t && (b = e.r), (e.r = b), (b += g); }); } return ( d.forEach(function (t) { var n = t.dTheta, r = t.r; t.forEach(function (t, i) { var u = e.startAngle + (e.clockwise ? 1 : -1) * n * i; (t.x = o[0] + r * Math.cos(u)), (t.y = o[1] + r * Math.sin(u)); }); }), e.onLayoutEnd && e.onLayoutEnd(), { nodes: t, edges: n } ); } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.getType = function () { return "concentric"; }), t ); })(n(7).Base); t.ConcentricLayout = u; }, 217: function (e, t, n) { "use strict"; n.r(t); var r = n(173); t.default = r.ConcentricLayout; }, 7: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=concentricLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/dagreLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 218)) ); })([ , , , , , , , function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, , function (t, n, e) { var r; try { r = { cloneDeep: e(335), constant: e(95), defaults: e(336), each: e(131), filter: e(134), find: e(337), flatten: e(161), forEach: e(132), forIn: e(344), has: e(145), isUndefined: e(146), last: e(345), map: e(147), mapValues: e(346), max: e(347), merge: e(349), min: e(355), minBy: e(356), now: e(357), pick: e(358), range: e(363), reduce: e(149), sortBy: e(366), uniqueId: e(371), values: e(154), zipObject: e(372), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, function (t, n) { var e = Array.isArray; t.exports = e; }, , function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph; function i(t, n, e, o) { var i; do { i = r.uniqueId(o); } while (t.hasNode(i)); return (e.dummy = n), t.setNode(i, e), i; } function u(t) { return r.max( r.map(t.nodes(), function (n) { var e = t.node(n).rank; if (!r.isUndefined(e)) return e; }), ); } t.exports = { addDummyNode: i, simplify: function (t) { var n = new o().setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { var r = n.edge(e.v, e.w) || { weight: 0, minlen: 1 }, o = t.edge(e); n.setEdge(e.v, e.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen), }); }), n ); }, asNonCompoundGraph: function (t) { var n = new o({ multigraph: t.isMultigraph() }).setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { t.children(e).length || n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { n.setEdge(e, t.edge(e)); }), n ); }, successorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.outEdges(n), function (n) { e[n.w] = (e[n.w] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, predecessorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.inEdges(n), function (n) { e[n.v] = (e[n.v] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, intersectRect: function (t, n) { var e, r, o = t.x, i = t.y, u = n.x - o, c = n.y - i, a = t.width / 2, f = t.height / 2; if (!u && !c) throw new Error( "Not possible to find intersection inside of the rectangle", ); Math.abs(c) * a > Math.abs(u) * f ? (c < 0 && (f = -f), (e = (f * u) / c), (r = f)) : (u < 0 && (a = -a), (e = a), (r = (a * c) / u)); return { x: o + e, y: i + r }; }, buildLayerMatrix: function (t) { var n = r.map(r.range(u(t) + 1), function () { return []; }); return ( r.forEach(t.nodes(), function (e) { var o = t.node(e), i = o.rank; r.isUndefined(i) || (n[i][o.order] = e); }), n ); }, normalizeRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ); r.forEach(t.nodes(), function (e) { var o = t.node(e); r.has(o, "rank") && (o.rank -= n); }); }, removeEmptyRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ), e = []; r.forEach(t.nodes(), function (r) { var o = t.node(r).rank - n; e[o] || (e[o] = []), e[o].push(r); }); var o = 0, i = t.graph().nodeRankFactor; r.forEach(e, function (n, e) { r.isUndefined(n) && e % i != 0 ? --o : o && r.forEach(n, function (n) { t.node(n).rank += o; }); }); }, addBorderNode: function (t, n, e, r) { var o = { width: 0, height: 0 }; arguments.length >= 4 && ((o.rank = e), (o.order = r)); return i(t, "border", o, n); }, maxRank: u, partition: function (t, n) { var e = { lhs: [], rhs: [] }; return ( r.forEach(t, function (t) { n(t) ? e.lhs.push(t) : e.rhs.push(t); }), e ); }, time: function (t, n) { var e = r.now(); try { return n(); } finally { console.log(t + " time: " + (r.now() - e) + "ms"); } }, notime: function (t, n) { return n(); }, }; }, , function (t, n, e) { var r; try { r = { clone: e(222), constant: e(95), each: e(131), filter: e(134), has: e(145), isArray: e(17), isEmpty: e(299), isFunction: e(51), isUndefined: e(146), keys: e(33), map: e(147), reduce: e(149), size: e(302), transform: e(308), union: e(309), values: e(154), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return null != t && ("object" == n || "function" == n); }; }, function (t, n, e) { var r; try { r = e(220); } catch (t) {} r || (r = window.graphlib), (t.exports = r); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(114), i = "object" == ("undefined" == typeof self ? "undefined" : r(self)) && self && self.Object === Object && self, u = o || i || Function("return this")(); t.exports = u; }, , function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { return null != t && "object" == e(t); }; }, , , , function (t, n, e) { var r = e(51), o = e(89); t.exports = function (t) { return null != t && o(t.length) && !r(t); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(279), i = e(289), u = e(38), c = e(17), a = e(296); t.exports = function (t) { return "function" == typeof t ? t : null == t ? u : "object" == r(t) ? c(t) ? i(t[0], t[1]) : o(t) : a(t); }; }, , function (t, n, e) { var r = e(117), o = e(91), i = e(30); t.exports = function (t) { return i(t) ? r(t) : o(t); }; }, , function (t, n, e) { var r = e(233), o = e(239); t.exports = function (t, n) { var e = o(t, n); return r(e) ? e : void 0; }; }, function (t, n, e) { var r = e(42), o = e(235), i = e(236), u = r ? r.toStringTag : void 0; t.exports = function (t) { return null == t ? void 0 === t ? "[object Undefined]" : "[object Null]" : u && u in Object(t) ? o(t) : i(t); }; }, function (t, n, e) { var r = e(117), o = e(259), i = e(30); t.exports = function (t) { return i(t) ? r(t, !0) : o(t); }; }, function (t, n) { t.exports = function (t) { return t; }; }, , , function (t, n) { t.exports = function (t, n) { return t === n || (t != t && n != n); }; }, function (t, n, e) { var r = e(24).Symbol; t.exports = r; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = e(255), u = "object" == r(n) && n && !n.nodeType && n, c = u && "object" == r(t) && t && !t.nodeType && t, a = c && c.exports === u ? o.Buffer : void 0, f = (a ? a.isBuffer : void 0) || i; t.exports = f; }).call(this, e(50)(t)); }, function (t, n, e) { var r = e(264), o = e(86), i = e(265), u = e(126), c = e(266), a = e(36), f = e(115), s = f(r), p = f(o), d = f(i), h = f(u), l = f(c), v = a; ((r && "[object DataView]" != v(new r(new ArrayBuffer(1)))) || (o && "[object Map]" != v(new o())) || (i && "[object Promise]" != v(i.resolve())) || (u && "[object Set]" != v(new u())) || (c && "[object WeakMap]" != v(new c()))) && (v = function (t) { var n = a(t), e = "[object Object]" == n ? t.constructor : void 0, r = e ? f(e) : ""; if (r) switch (r) { case s: return "[object DataView]"; case p: return "[object Map]"; case d: return "[object Promise]"; case h: return "[object Set]"; case l: return "[object WeakMap]"; } return n; }), (t.exports = v); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(36), i = e(26); t.exports = function (t) { return "symbol" == r(t) || (i(t) && "[object Symbol]" == o(t)); }; }, , , , , function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, function (t, n, e) { var r = e(36), o = e(22); t.exports = function (t) { if (!o(t)) return !1; var n = r(t); return ( "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n ); }; }, function (t, n, e) { var r = e(63), o = e(64); t.exports = function (t, n, e, i) { var u = !e; e || (e = {}); for (var c = -1, a = n.length; ++c < a; ) { var f = n[c], s = i ? i(e[f], t[f], f, e, t) : void 0; void 0 === s && (s = t[f]), u ? o(e, f, s) : r(e, f, s); } return e; }; }, function (t, n, e) { var r = e(254), o = e(26), i = Object.prototype, u = i.hasOwnProperty, c = i.propertyIsEnumerable, a = r( (function () { return arguments; })(), ) ? r : function (t) { return o(t) && u.call(t, "callee") && !c.call(t, "callee"); }; t.exports = a; }, function (t, n, e) { var r = e(256), o = e(66), i = e(90), u = i && i.isTypedArray, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(45); t.exports = function (t) { if ("string" == typeof t || r(t)) return t; var n = t + ""; return "0" == n && 1 / t == -1 / 0 ? "-0" : n; }; }, , , function (t, n, e) { var r = e(59), o = e(228), i = e(229), u = e(230), c = e(231), a = e(232); function f(t) { var n = (this.__data__ = new r(t)); this.size = n.size; } (f.prototype.clear = o), (f.prototype.delete = i), (f.prototype.get = u), (f.prototype.has = c), (f.prototype.set = a), (t.exports = f); }, function (t, n, e) { var r = e(223), o = e(224), i = e(225), u = e(226), c = e(227); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(41); t.exports = function (t, n) { for (var e = t.length; e--; ) if (r(t[e][0], n)) return e; return -1; }; }, function (t, n, e) { var r = e(35)(Object, "create"); t.exports = r; }, function (t, n, e) { var r = e(248); t.exports = function (t, n) { var e = t.__data__; return r(n) ? e["string" == typeof n ? "string" : "hash"] : e.map; }; }, function (t, n, e) { var r = e(64), o = e(41), i = Object.prototype.hasOwnProperty; t.exports = function (t, n, e) { var u = t[n]; (i.call(t, n) && o(u, e) && (void 0 !== e || n in t)) || r(t, n, e); }; }, function (t, n, e) { var r = e(116); t.exports = function (t, n, e) { "__proto__" == n && r ? r(t, n, { configurable: !0, enumerable: !0, value: e, writable: !0, }) : (t[n] = e); }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = /^(?:0|[1-9]\d*)$/; t.exports = function (t, n) { var o = e(t); return ( !!(n = null == n ? 9007199254740991 : n) && ("number" == o || ("symbol" != o && r.test(t))) && t > -1 && t % 1 == 0 && t < n ); }; }, function (t, n) { t.exports = function (t) { return function (n) { return t(n); }; }; }, function (t, n) { var e = Object.prototype; t.exports = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, e) { var r = e(118)(Object.getPrototypeOf, Object); t.exports = r; }, function (t, n, e) { var r = e(96), o = e(277)(r); t.exports = o; }, function (t, n, e) { var r = e(71), o = e(55); t.exports = function (t, n) { for (var e = 0, i = (n = r(n, t)).length; null != t && e < i; ) t = t[o(n[e++])]; return e && e == i ? t : void 0; }; }, function (t, n, e) { var r = e(17), o = e(99), i = e(291), u = e(141); t.exports = function (t, n) { return r(t) ? t : o(t, n) ? [t] : i(u(t)); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length, o = Array(r); ++e < r; ) o[e] = n(t[e], e, t); return o; }; }, function (t, n, e) { var r = e(38), o = e(150), i = e(151); t.exports = function (t, n) { return i(o(t, n, r), t + ""); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(41), i = e(30), u = e(65), c = e(22); t.exports = function (t, n, e) { if (!c(e)) return !1; var a = r(n); return ( !!("number" == a ? i(e) && u(n, e.length) : "string" == a && n in e) && o(e[n], t) ); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = { longestPath: function (t) { var n = {}; r.forEach(t.sources(), function e(o) { var i = t.node(o); if (r.has(n, o)) return i.rank; n[o] = !0; var u = r.min( r.map(t.outEdges(o), function (n) { return e(n.w) - t.edge(n).minlen; }), ); return ( (u !== Number.POSITIVE_INFINITY && null != u) || (u = 0), (i.rank = u) ); }); }, slack: function (t, n) { return t.node(n.w).rank - t.node(n.v).rank - t.edge(n).minlen; }, }; }, , , , , , , , , , function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(21); t.exports = i; function i(t) { (this._isDirected = !o.has(t, "directed") || t.directed), (this._isMultigraph = !!o.has(t, "multigraph") && t.multigraph), (this._isCompound = !!o.has(t, "compound") && t.compound), (this._label = void 0), (this._defaultNodeLabelFn = o.constant(void 0)), (this._defaultEdgeLabelFn = o.constant(void 0)), (this._nodes = {}), this._isCompound && ((this._parent = {}), (this._children = {}), (this._children["\0"] = {})), (this._in = {}), (this._preds = {}), (this._out = {}), (this._sucs = {}), (this._edgeObjs = {}), (this._edgeLabels = {}); } function u(t, n) { t[n] ? t[n]++ : (t[n] = 1); } function c(t, n) { --t[n] || delete t[n]; } function a(t, n, e, r) { var i = "" + n, u = "" + e; if (!t && i > u) { var c = i; (i = u), (u = c); } return i + "" + u + "" + (o.isUndefined(r) ? "\0" : r); } function f(t, n, e, r) { var o = "" + n, i = "" + e; if (!t && o > i) { var u = o; (o = i), (i = u); } var c = { v: o, w: i }; return r && (c.name = r), c; } function s(t, n) { return a(t, n.v, n.w, n.name); } (i.prototype._nodeCount = 0), (i.prototype._edgeCount = 0), (i.prototype.isDirected = function () { return this._isDirected; }), (i.prototype.isMultigraph = function () { return this._isMultigraph; }), (i.prototype.isCompound = function () { return this._isCompound; }), (i.prototype.setGraph = function (t) { return (this._label = t), this; }), (i.prototype.graph = function () { return this._label; }), (i.prototype.setDefaultNodeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultNodeLabelFn = t), this ); }), (i.prototype.nodeCount = function () { return this._nodeCount; }), (i.prototype.nodes = function () { return o.keys(this._nodes); }), (i.prototype.sources = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._in[n]); }); }), (i.prototype.sinks = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._out[n]); }); }), (i.prototype.setNodes = function (t, n) { var e = arguments, r = this; return ( o.each(t, function (t) { e.length > 1 ? r.setNode(t, n) : r.setNode(t); }), this ); }), (i.prototype.setNode = function (t, n) { return o.has(this._nodes, t) ? (arguments.length > 1 && (this._nodes[t] = n), this) : ((this._nodes[t] = arguments.length > 1 ? n : this._defaultNodeLabelFn(t)), this._isCompound && ((this._parent[t] = "\0"), (this._children[t] = {}), (this._children["\0"][t] = !0)), (this._in[t] = {}), (this._preds[t] = {}), (this._out[t] = {}), (this._sucs[t] = {}), ++this._nodeCount, this); }), (i.prototype.node = function (t) { return this._nodes[t]; }), (i.prototype.hasNode = function (t) { return o.has(this._nodes, t); }), (i.prototype.removeNode = function (t) { var n = this; if (o.has(this._nodes, t)) { var e = function (t) { n.removeEdge(n._edgeObjs[t]); }; delete this._nodes[t], this._isCompound && (this._removeFromParentsChildList(t), delete this._parent[t], o.each(this.children(t), function (t) { n.setParent(t); }), delete this._children[t]), o.each(o.keys(this._in[t]), e), delete this._in[t], delete this._preds[t], o.each(o.keys(this._out[t]), e), delete this._out[t], delete this._sucs[t], --this._nodeCount; } return this; }), (i.prototype.setParent = function (t, n) { if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); if (o.isUndefined(n)) n = "\0"; else { for (var e = (n += ""); !o.isUndefined(e); e = this.parent(e)) if (e === t) throw new Error( "Setting " + n + " as parent of " + t + " would create a cycle", ); this.setNode(n); } return ( this.setNode(t), this._removeFromParentsChildList(t), (this._parent[t] = n), (this._children[n][t] = !0), this ); }), (i.prototype._removeFromParentsChildList = function (t) { delete this._children[this._parent[t]][t]; }), (i.prototype.parent = function (t) { if (this._isCompound) { var n = this._parent[t]; if ("\0" !== n) return n; } }), (i.prototype.children = function (t) { if ((o.isUndefined(t) && (t = "\0"), this._isCompound)) { var n = this._children[t]; if (n) return o.keys(n); } else { if ("\0" === t) return this.nodes(); if (this.hasNode(t)) return []; } }), (i.prototype.predecessors = function (t) { var n = this._preds[t]; if (n) return o.keys(n); }), (i.prototype.successors = function (t) { var n = this._sucs[t]; if (n) return o.keys(n); }), (i.prototype.neighbors = function (t) { var n = this.predecessors(t); if (n) return o.union(n, this.successors(t)); }), (i.prototype.isLeaf = function (t) { return ( 0 === (this.isDirected() ? this.successors(t) : this.neighbors(t)).length ); }), (i.prototype.filterNodes = function (t) { var n = new this.constructor({ directed: this._isDirected, multigraph: this._isMultigraph, compound: this._isCompound, }); n.setGraph(this.graph()); var e = this; o.each(this._nodes, function (e, r) { t(r) && n.setNode(r, e); }), o.each(this._edgeObjs, function (t) { n.hasNode(t.v) && n.hasNode(t.w) && n.setEdge(t, e.edge(t)); }); var r = {}; return ( this._isCompound && o.each(n.nodes(), function (t) { n.setParent( t, (function t(o) { var i = e.parent(o); return void 0 === i || n.hasNode(i) ? ((r[o] = i), i) : i in r ? r[i] : t(i); })(t), ); }), n ); }), (i.prototype.setDefaultEdgeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultEdgeLabelFn = t), this ); }), (i.prototype.edgeCount = function () { return this._edgeCount; }), (i.prototype.edges = function () { return o.values(this._edgeObjs); }), (i.prototype.setPath = function (t, n) { var e = this, r = arguments; return ( o.reduce(t, function (t, o) { return r.length > 1 ? e.setEdge(t, o, n) : e.setEdge(t, o), o; }), this ); }), (i.prototype.setEdge = function () { var t, n, e, i, c = !1, s = arguments[0]; "object" === r(s) && null !== s && "v" in s ? ((t = s.v), (n = s.w), (e = s.name), 2 === arguments.length && ((i = arguments[1]), (c = !0))) : ((t = s), (n = arguments[1]), (e = arguments[3]), arguments.length > 2 && ((i = arguments[2]), (c = !0))), (t = "" + t), (n = "" + n), o.isUndefined(e) || (e = "" + e); var p = a(this._isDirected, t, n, e); if (o.has(this._edgeLabels, p)) return c && (this._edgeLabels[p] = i), this; if (!o.isUndefined(e) && !this._isMultigraph) throw new Error( "Cannot set a named edge when isMultigraph = false", ); this.setNode(t), this.setNode(n), (this._edgeLabels[p] = c ? i : this._defaultEdgeLabelFn(t, n, e)); var d = f(this._isDirected, t, n, e); return ( (t = d.v), (n = d.w), Object.freeze(d), (this._edgeObjs[p] = d), u(this._preds[n], t), u(this._sucs[t], n), (this._in[n][p] = d), (this._out[t][p] = d), this._edgeCount++, this ); }), (i.prototype.edge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return this._edgeLabels[r]; }), (i.prototype.hasEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return o.has(this._edgeLabels, r); }), (i.prototype.removeEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e), o = this._edgeObjs[r]; return ( o && ((t = o.v), (n = o.w), delete this._edgeLabels[r], delete this._edgeObjs[r], c(this._preds[n], t), c(this._sucs[t], n), delete this._in[n][r], delete this._out[t][r], this._edgeCount--), this ); }), (i.prototype.inEdges = function (t, n) { var e = this._in[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.v === n; }) : r; } }), (i.prototype.outEdges = function (t, n) { var e = this._out[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.w === n; }) : r; } }), (i.prototype.nodeEdges = function (t, n) { var e = this.inEdges(t, n); if (e) return e.concat(this.outEdges(t, n)); }); }, function (t, n, e) { var r = e(35)(e(24), "Map"); t.exports = r; }, function (t, n, e) { var r = e(240), o = e(247), i = e(249), u = e(250), c = e(251); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length; ++e < r && !1 !== n(t[e], e, t); ); return t; }; }, function (t, n) { t.exports = function (t) { return ( "number" == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991 ); }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(114), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i && o.process, a = (function () { try { var t = u && u.require && u.require("util").types; return t || (c && c.binding && c.binding("util")); } catch (t) {} })(); t.exports = a; }).call(this, e(50)(t)); }, function (t, n, e) { var r = e(67), o = e(257), i = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return o(t); var n = []; for (var e in Object(t)) i.call(t, e) && "constructor" != e && n.push(e); return n; }; }, function (t, n, e) { var r = e(121), o = e(122), i = Object.prototype.propertyIsEnumerable, u = Object.getOwnPropertySymbols, c = u ? function (t) { return null == t ? [] : ((t = Object(t)), r(u(t), function (n) { return i.call(t, n); })); } : o; t.exports = c; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = n.length, o = t.length; ++e < r; ) t[o + e] = n[e]; return t; }; }, function (t, n, e) { var r = e(127); t.exports = function (t) { var n = new t.constructor(t.byteLength); return new r(n).set(new r(t)), n; }; }, function (t, n) { t.exports = function (t) { return function () { return t; }; }; }, function (t, n, e) { var r = e(97), o = e(33); t.exports = function (t, n) { return t && r(t, n, o); }; }, function (t, n, e) { var r = e(276)(); t.exports = r; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t) { e[++n] = t; }), e ); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(17), i = e(45), u = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, c = /^\w*$/; t.exports = function (t, n) { if (o(t)) return !1; var e = r(t); return ( !( "number" != e && "symbol" != e && "boolean" != e && null != t && !i(t) ) || c.test(t) || !u.test(t) || (null != n && t in Object(n)) ); }; }, function (t, n, e) { var r = e(93), o = e(310); t.exports = function t(n, e, i, u, c) { var a = -1, f = n.length; for (i || (i = o), c || (c = []); ++a < f; ) { var s = n[a]; e > 0 && i(s) ? e > 1 ? t(s, e - 1, i, u, c) : r(c, s) : u || (c[c.length] = s); } return c; }; }, function (t, n, e) { var r = e(45); t.exports = function (t, n, e) { for (var o = -1, i = t.length; ++o < i; ) { var u = t[o], c = n(u); if (null != c && (void 0 === a ? c == c && !r(c) : e(c, a))) var a = c, f = u; } return f; }; }, , , , , , , , , , , , function (t, n, e) { var r = e(58), o = e(88), i = e(63), u = e(252), c = e(258), a = e(119), f = e(120), s = e(261), p = e(262), d = e(124), h = e(263), l = e(44), v = e(267), y = e(268), g = e(129), b = e(17), m = e(43), x = e(272), _ = e(22), w = e(274), E = e(33), j = e(37), k = {}; (k["[object Arguments]"] = k["[object Array]"] = k["[object ArrayBuffer]"] = k["[object DataView]"] = k["[object Boolean]"] = k["[object Date]"] = k["[object Float32Array]"] = k["[object Float64Array]"] = k["[object Int8Array]"] = k["[object Int16Array]"] = k["[object Int32Array]"] = k["[object Map]"] = k["[object Number]"] = k["[object Object]"] = k["[object RegExp]"] = k["[object Set]"] = k["[object String]"] = k["[object Symbol]"] = k["[object Uint8Array]"] = k["[object Uint8ClampedArray]"] = k["[object Uint16Array]"] = k["[object Uint32Array]"] = !0), (k["[object Error]"] = k["[object Function]"] = k["[object WeakMap]"] = !1), (t.exports = function t(n, e, S, O, N, I) { var P, M = 1 & e, C = 2 & e, A = 4 & e; if ((S && (P = N ? S(n, O, N, I) : S(n)), void 0 !== P)) return P; if (!_(n)) return n; var L = b(n); if (L) { if (((P = v(n)), !M)) return f(n, P); } else { var T = l(n), z = "[object Function]" == T || "[object GeneratorFunction]" == T; if (m(n)) return a(n, M); if ( "[object Object]" == T || "[object Arguments]" == T || (z && !N) ) { if (((P = C || z ? {} : g(n)), !M)) return C ? p(n, c(P, n)) : s(n, u(P, n)); } else { if (!k[T]) return N ? n : {}; P = y(n, T, M); } } I || (I = new r()); var F = I.get(n); if (F) return F; I.set(n, P), w(n) ? n.forEach(function (r) { P.add(t(r, e, S, r, n, I)); }) : x(n) && n.forEach(function (r, o) { P.set(o, t(r, e, S, o, n, I)); }); var D = L ? void 0 : (A ? (C ? h : d) : C ? j : E)(n); return ( o(D || n, function (r, o) { D && (r = n[(o = r)]), i(P, o, t(r, e, S, o, n, I)); }), P ); }); }, function (t, n, e) { (function (n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = "object" == (void 0 === n ? "undefined" : e(n)) && n && n.Object === Object && n; t.exports = r; }).call(this, e(234)); }, function (t, n) { var e = Function.prototype.toString; t.exports = function (t) { if (null != t) { try { return e.call(t); } catch (t) {} try { return t + ""; } catch (t) {} } return ""; }; }, function (t, n, e) { var r = e(35), o = (function () { try { var t = r(Object, "defineProperty"); return t({}, "", {}), t; } catch (t) {} })(); t.exports = o; }, function (t, n, e) { var r = e(253), o = e(53), i = e(17), u = e(43), c = e(65), a = e(54), f = Object.prototype.hasOwnProperty; t.exports = function (t, n) { var e = i(t), s = !e && o(t), p = !e && !s && u(t), d = !e && !s && !p && a(t), h = e || s || p || d, l = h ? r(t.length, String) : [], v = l.length; for (var y in t) (!n && !f.call(t, y)) || (h && ("length" == y || (p && ("offset" == y || "parent" == y)) || (d && ("buffer" == y || "byteLength" == y || "byteOffset" == y)) || c(y, v))) || l.push(y); return l; }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return t(n(e)); }; }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i ? o.Buffer : void 0, a = c ? c.allocUnsafe : void 0; t.exports = function (t, n) { if (n) return t.slice(); var e = t.length, r = a ? a(e) : new t.constructor(e); return t.copy(r), r; }; }).call(this, e(50)(t)); }, function (t, n) { t.exports = function (t, n) { var e = -1, r = t.length; for (n || (n = Array(r)); ++e < r; ) n[e] = t[e]; return n; }; }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length, o = 0, i = []; ++e < r; ) { var u = t[e]; n(u, e, t) && (i[o++] = u); } return i; }; }, function (t, n) { t.exports = function () { return []; }; }, function (t, n, e) { var r = e(93), o = e(68), i = e(92), u = e(122), c = Object.getOwnPropertySymbols ? function (t) { for (var n = []; t; ) r(n, i(t)), (t = o(t)); return n; } : u; t.exports = c; }, function (t, n, e) { var r = e(125), o = e(92), i = e(33); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(93), o = e(17); t.exports = function (t, n, e) { var i = n(t); return o(t) ? i : r(i, e(t)); }; }, function (t, n, e) { var r = e(35)(e(24), "Set"); t.exports = r; }, function (t, n, e) { var r = e(24).Uint8Array; t.exports = r; }, function (t, n, e) { var r = e(94); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.length); }; }, function (t, n, e) { var r = e(130), o = e(68), i = e(67); t.exports = function (t) { return "function" != typeof t.constructor || i(t) ? {} : r(o(t)); }; }, function (t, n, e) { var r = e(22), o = Object.create, i = (function () { function t() {} return function (n) { if (!r(n)) return {}; if (o) return o(n); t.prototype = n; var e = new t(); return (t.prototype = void 0), e; }; })(); t.exports = i; }, function (t, n, e) { t.exports = e(132); }, function (t, n, e) { var r = e(88), o = e(69), i = e(133), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n)); }; }, function (t, n, e) { var r = e(38); t.exports = function (t) { return "function" == typeof t ? t : r; }; }, function (t, n, e) { var r = e(121), o = e(278), i = e(31), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n, 3)); }; }, function (t, n, e) { var r = e(281), o = e(26); t.exports = function t(n, e, i, u, c) { return ( n === e || (null == n || null == e || (!o(n) && !o(e)) ? n != n && e != e : r(n, e, i, u, t, c)) ); }; }, function (t, n, e) { var r = e(137), o = e(284), i = e(138); t.exports = function (t, n, e, u, c, a) { var f = 1 & e, s = t.length, p = n.length; if (s != p && !(f && p > s)) return !1; var d = a.get(t), h = a.get(n); if (d && h) return d == n && h == t; var l = -1, v = !0, y = 2 & e ? new r() : void 0; for (a.set(t, n), a.set(n, t); ++l < s; ) { var g = t[l], b = n[l]; if (u) var m = f ? u(b, g, l, n, t, a) : u(g, b, l, t, n, a); if (void 0 !== m) { if (m) continue; v = !1; break; } if (y) { if ( !o(n, function (t, n) { if (!i(y, n) && (g === t || c(g, t, e, u, a))) return y.push(n); }) ) { v = !1; break; } } else if (g !== b && !c(g, b, e, u, a)) { v = !1; break; } } return a.delete(t), a.delete(n), v; }; }, function (t, n, e) { var r = e(87), o = e(282), i = e(283); function u(t) { var n = -1, e = null == t ? 0 : t.length; for (this.__data__ = new r(); ++n < e; ) this.add(t[n]); } (u.prototype.add = u.prototype.push = o), (u.prototype.has = i), (t.exports = u); }, function (t, n) { t.exports = function (t, n) { return t.has(n); }; }, function (t, n, e) { var r = e(22); t.exports = function (t) { return t == t && !r(t); }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return null != e && e[t] === n && (void 0 !== n || t in Object(e)); }; }; }, function (t, n, e) { var r = e(294); t.exports = function (t) { return null == t ? "" : r(t); }; }, function (t, n, e) { var r = e(295), o = e(143); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n, e) { var r = e(71), o = e(53), i = e(17), u = e(65), c = e(89), a = e(55); t.exports = function (t, n, e) { for (var f = -1, s = (n = r(n, t)).length, p = !1; ++f < s; ) { var d = a(n[f]); if (!(p = null != t && e(t, d))) break; t = t[d]; } return p || ++f != s ? p : !!(s = null == t ? 0 : t.length) && c(s) && u(d, s) && (i(t) || o(t)); }; }, function (t, n) { t.exports = function (t) { return function (n) { return null == n ? void 0 : n[t]; }; }; }, function (t, n, e) { var r = e(298), o = e(143); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n) { t.exports = function (t) { return void 0 === t; }; }, function (t, n, e) { var r = e(72), o = e(31), i = e(148), u = e(17); t.exports = function (t, n) { return (u(t) ? r : i)(t, o(n, 3)); }; }, function (t, n, e) { var r = e(69), o = e(30); t.exports = function (t, n) { var e = -1, i = o(t) ? Array(t.length) : []; return ( r(t, function (t, r, o) { i[++e] = n(t, r, o); }), i ); }; }, function (t, n, e) { var r = e(300), o = e(69), i = e(31), u = e(301), c = e(17); t.exports = function (t, n, e) { var a = c(t) ? r : u, f = arguments.length < 3; return a(t, i(n, 4), e, f, o); }; }, function (t, n, e) { var r = e(311), o = Math.max; t.exports = function (t, n, e) { return ( (n = o(void 0 === n ? t.length - 1 : n, 0)), function () { for ( var i = arguments, u = -1, c = o(i.length - n, 0), a = Array(c); ++u < c; ) a[u] = i[n + u]; u = -1; for (var f = Array(n + 1); ++u < n; ) f[u] = i[u]; return (f[n] = e(a)), r(t, this, f); } ); }; }, function (t, n, e) { var r = e(312), o = e(313)(r); t.exports = o; }, function (t, n) { t.exports = function (t, n, e, r) { for (var o = t.length, i = e + (r ? 1 : -1); r ? i-- : ++i < o; ) if (n(t[i], i, t)) return i; return -1; }; }, function (t, n, e) { var r = e(30), o = e(26); t.exports = function (t) { return o(t) && r(t); }; }, function (t, n, e) { var r = e(322), o = e(33); t.exports = function (t) { return null == t ? [] : r(t, o(t)); }; }, function (t, n, e) { var r = e(21), o = e(156); t.exports = function (t, n, e, r) { return (function (t, n, e, r) { var i, u, c = {}, a = new o(), f = function (t) { var n = t.v !== i ? t.v : t.w, r = c[n], o = e(t), f = u.distance + o; if (o < 0) throw new Error( "dijkstra does not allow negative edge weights. Bad edge: " + t + " Weight: " + o, ); f < r.distance && ((r.distance = f), (r.predecessor = i), a.decrease(n, f)); }; t.nodes().forEach(function (t) { var e = t === n ? 0 : Number.POSITIVE_INFINITY; (c[t] = { distance: e }), a.add(t, e); }); for ( ; a.size() > 0 && ((i = a.removeMin()), (u = c[i]).distance !== Number.POSITIVE_INFINITY); ) r(i).forEach(f); return c; })( t, String(n), e || i, r || function (n) { return t.outEdges(n); }, ); }; var i = r.constant(1); }, function (t, n, e) { var r = e(21); function o() { (this._arr = []), (this._keyIndices = {}); } (t.exports = o), (o.prototype.size = function () { return this._arr.length; }), (o.prototype.keys = function () { return this._arr.map(function (t) { return t.key; }); }), (o.prototype.has = function (t) { return r.has(this._keyIndices, t); }), (o.prototype.priority = function (t) { var n = this._keyIndices[t]; if (void 0 !== n) return this._arr[n].priority; }), (o.prototype.min = function () { if (0 === this.size()) throw new Error("Queue underflow"); return this._arr[0].key; }), (o.prototype.add = function (t, n) { var e = this._keyIndices; if (((t = String(t)), !r.has(e, t))) { var o = this._arr, i = o.length; return ( (e[t] = i), o.push({ key: t, priority: n }), this._decrease(i), !0 ); } return !1; }), (o.prototype.removeMin = function () { this._swap(0, this._arr.length - 1); var t = this._arr.pop(); return delete this._keyIndices[t.key], this._heapify(0), t.key; }), (o.prototype.decrease = function (t, n) { var e = this._keyIndices[t]; if (n > this._arr[e].priority) throw new Error( "New priority is greater than current priority. Key: " + t + " Old: " + this._arr[e].priority + " New: " + n, ); (this._arr[e].priority = n), this._decrease(e); }), (o.prototype._heapify = function (t) { var n = this._arr, e = 2 * t, r = e + 1, o = t; e < n.length && ((o = n[e].priority < n[o].priority ? e : o), r < n.length && (o = n[r].priority < n[o].priority ? r : o), o !== t && (this._swap(t, o), this._heapify(o))); }), (o.prototype._decrease = function (t) { for ( var n, e = this._arr, r = e[t].priority; 0 !== t && !(e[(n = t >> 1)].priority < r); ) this._swap(t, n), (t = n); }), (o.prototype._swap = function (t, n) { var e = this._arr, r = this._keyIndices, o = e[t], i = e[n]; (e[t] = i), (e[n] = o), (r[i.key] = t), (r[o.key] = n); }); }, function (t, n, e) { var r = e(21); t.exports = function (t) { var n = 0, e = [], o = {}, i = []; return ( t.nodes().forEach(function (u) { r.has(o, u) || (function u(c) { var a = (o[c] = { onStack: !0, lowlink: n, index: n++ }); if ( (e.push(c), t.successors(c).forEach(function (t) { r.has(o, t) ? o[t].onStack && (a.lowlink = Math.min(a.lowlink, o[t].index)) : (u(t), (a.lowlink = Math.min(a.lowlink, o[t].lowlink))); }), a.lowlink === a.index) ) { var f, s = []; do { (f = e.pop()), (o[f].onStack = !1), s.push(f); } while (c !== f); i.push(s); } })(u); }), i ); }; }, function (t, n, e) { var r = e(21); function o(t) { var n = {}, e = {}, o = []; if ( (r.each(t.sinks(), function u(c) { if (r.has(e, c)) throw new i(); r.has(n, c) || ((e[c] = !0), (n[c] = !0), r.each(t.predecessors(c), u), delete e[c], o.push(c)); }), r.size(n) !== t.nodeCount()) ) throw new i(); return o; } function i() {} (t.exports = o), (o.CycleException = i), (i.prototype = new Error()); }, function (t, n, e) { var r = e(21); t.exports = function (t, n, e) { r.isArray(n) || (n = [n]); var o = (t.isDirected() ? t.successors : t.neighbors).bind(t), i = [], u = {}; return ( r.each(n, function (n) { if (!t.hasNode(n)) throw new Error("Graph does not have node: " + n); !(function t(n, e, o, i, u, c) { r.has(i, e) || ((i[e] = !0), o || c.push(e), r.each(u(e), function (e) { t(n, e, o, i, u, c); }), o && c.push(e)); })(t, n, "post" === e, u, o, i); }), i ); }; }, function (t, n, e) { var r = e(341); t.exports = function (t) { return t ? (t = r(t)) === 1 / 0 || t === -1 / 0 ? 17976931348623157e292 * (t < 0 ? -1 : 1) : t == t ? t : 0 : 0 === t ? t : 0; }; }, function (t, n, e) { var r = e(100); t.exports = function (t) { return (null == t ? 0 : t.length) ? r(t, 1) : []; }; }, function (t, n, e) { var r = e(64), o = e(41); t.exports = function (t, n, e) { ((void 0 !== e && !o(t[n], e)) || (void 0 === e && !(n in t))) && r(t, n, e); }; }, function (t, n) { t.exports = function (t, n) { if ( ("constructor" !== n || "function" != typeof t[n]) && "__proto__" != n ) return t[n]; }; }, function (t, n) { t.exports = function (t, n) { return t < n; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph, i = e(75).slack; function u(t, n) { return ( r.forEach(t.nodes(), function e(o) { r.forEach(n.nodeEdges(o), function (r) { var u = r.v, c = o === u ? r.w : u; t.hasNode(c) || i(n, r) || (t.setNode(c, {}), t.setEdge(o, c, {}), e(c)); }); }), t.nodeCount() ); } function c(t, n) { return r.minBy(n.edges(), function (e) { if (t.hasNode(e.v) !== t.hasNode(e.w)) return i(n, e); }); } function a(t, n, e) { r.forEach(t.nodes(), function (t) { n.node(t).rank += e; }); } t.exports = function (t) { var n, e, r = new o({ directed: !1 }), f = t.nodes()[0], s = t.nodeCount(); r.setNode(f, {}); for (; u(r, t) < s; ) (n = c(r, t)), (e = r.hasNode(n.v) ? i(t, n) : -i(t, n)), a(r, t, e); return r; }; }, , , , , , , , , function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.DagreLayout = void 0); var u = i(e(219)), c = e(10), a = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.rankdir = "TB"), (e.nodesep = 50), (e.ranksep = 50), (e.controlPoints = !1), (e.sortByCombo = !1), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { rankdir: "TB", align: void 0, nodeSize: void 0, nodesepFunc: void 0, ranksepFunc: void 0, nodesep: 50, ranksep: 50, controlPoints: !1, }; }), (n.prototype.execute = function () { var t = this, n = this, e = n.nodes, r = n.nodeSize, o = n.rankdir, i = n.combos; if (e) { var a, s = n.edges || [], p = new u.default.graphlib.Graph({ multigraph: !0, compound: !0, }); a = r ? c.isArray(r) ? function () { return r; } : function () { return [r, r]; } : function (t) { return t.size ? c.isArray(t.size) ? t.size : [t.size, t.size] : [40, 40]; }; var d = f(n.nodesepFunc, n.nodesep, 50), h = f(n.ranksepFunc, n.ranksep, 50); ("LR" !== o && "RL" !== o) || ((d = f(n.ranksepFunc, n.ranksep, 50)), (h = f(n.nodesepFunc, n.nodesep, 50))), p.setDefaultEdgeLabel(function () { return {}; }), p.setGraph(n); var l, v = {}; return ( e.forEach(function (n) { var e = a(n), r = h(n), o = d(n), i = e[0] + 2 * o, u = e[1] + 2 * r; p.setNode(n.id, { width: i, height: u }), t.sortByCombo && n.comboId && (v[n.comboId] || ((v[n.comboId] = !0), p.setNode(n.comboId, {})), p.setParent(n.id, n.comboId)); }), this.sortByCombo && i && i.forEach(function (t) { t.parentId && (v[t.parentId] || ((v[t.parentId] = !0), p.setNode(t.parentId, {})), p.setParent(t.id, t.parentId)); }), s.forEach(function (t) { p.setEdge(t.source, t.target, { weight: t.weight || 1 }); }), u.default.layout(p), p.nodes().forEach(function (t) { l = p.node(t); var n = e.findIndex(function (n) { return n.id === t; }); e[n] && ((e[n].x = l.x), (e[n].y = l.y)); }), p.edges().forEach(function (t) { l = p.edge(t); var e = s.findIndex(function (n) { return n.source === t.v && n.target === t.w; }); n.controlPoints && "loop" !== s[e].type && (s[e].controlPoints = l.points.slice( 1, l.points.length - 1, )); }), n.onLayoutEnd && n.onLayoutEnd(), { nodes: e, edges: s } ); } }), (n.prototype.getType = function () { return "dagre"; }), n ); })(e(7).Base); function f(t, n, e) { return ( t || (c.isNumber(n) ? function () { return n; } : function () { return e; }) ); } n.DagreLayout = a; }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (t, n, e) { "use strict"; e.r(n); var r = e(174); n.default = r.DagreLayout; }, function (t, n, e) { t.exports = { graphlib: e(23), layout: e(334), debug: e(395), util: { time: e(19).time, notime: e(19).notime }, version: e(396), }; }, function (t, n, e) { var r = e(221); t.exports = { Graph: r.Graph, json: e(324), alg: e(325), version: r.version, }; }, function (t, n, e) { t.exports = { Graph: e(85), version: e(323) }; }, function (t, n, e) { var r = e(113); t.exports = function (t) { return r(t, 4); }; }, function (t, n) { t.exports = function () { (this.__data__ = []), (this.size = 0); }; }, function (t, n, e) { var r = e(60), o = Array.prototype.splice; t.exports = function (t) { var n = this.__data__, e = r(n, t); return ( !(e < 0) && (e == n.length - 1 ? n.pop() : o.call(n, e, 1), --this.size, !0) ); }; }, function (t, n, e) { var r = e(60); t.exports = function (t) { var n = this.__data__, e = r(n, t); return e < 0 ? void 0 : n[e][1]; }; }, function (t, n, e) { var r = e(60); t.exports = function (t) { return r(this.__data__, t) > -1; }; }, function (t, n, e) { var r = e(60); t.exports = function (t, n) { var e = this.__data__, o = r(e, t); return o < 0 ? (++this.size, e.push([t, n])) : (e[o][1] = n), this; }; }, function (t, n, e) { var r = e(59); t.exports = function () { (this.__data__ = new r()), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.__data__, e = n.delete(t); return (this.size = n.size), e; }; }, function (t, n) { t.exports = function (t) { return this.__data__.get(t); }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n, e) { var r = e(59), o = e(86), i = e(87); t.exports = function (t, n) { var e = this.__data__; if (e instanceof r) { var u = e.__data__; if (!o || u.length < 199) return u.push([t, n]), (this.size = ++e.size), this; e = this.__data__ = new i(u); } return e.set(t, n), (this.size = e.size), this; }; }, function (t, n, e) { var r = e(51), o = e(237), i = e(22), u = e(115), c = /^\[object .+?Constructor\]$/, a = Function.prototype, f = Object.prototype, s = a.toString, p = f.hasOwnProperty, d = RegExp( "^" + s .call(p) .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") .replace( /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?", ) + "$", ); t.exports = function (t) { return !(!i(t) || o(t)) && (r(t) ? d : c).test(u(t)); }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : e(window)) && (r = window); } t.exports = r; }, function (t, n, e) { var r = e(42), o = Object.prototype, i = o.hasOwnProperty, u = o.toString, c = r ? r.toStringTag : void 0; t.exports = function (t) { var n = i.call(t, c), e = t[c]; try { t[c] = void 0; var r = !0; } catch (t) {} var o = u.call(t); return r && (n ? (t[c] = e) : delete t[c]), o; }; }, function (t, n) { var e = Object.prototype.toString; t.exports = function (t) { return e.call(t); }; }, function (t, n, e) { var r, o = e(238), i = (r = /[^.]+$/.exec((o && o.keys && o.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + r : ""; t.exports = function (t) { return !!i && i in t; }; }, function (t, n, e) { var r = e(24)["__core-js_shared__"]; t.exports = r; }, function (t, n) { t.exports = function (t, n) { return null == t ? void 0 : t[n]; }; }, function (t, n, e) { var r = e(241), o = e(59), i = e(86); t.exports = function () { (this.size = 0), (this.__data__ = { hash: new r(), map: new (i || o)(), string: new r(), }); }; }, function (t, n, e) { var r = e(242), o = e(243), i = e(244), u = e(245), c = e(246); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(61); t.exports = function () { (this.__data__ = r ? r(null) : {}), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.has(t) && delete this.__data__[t]; return (this.size -= n ? 1 : 0), n; }; }, function (t, n, e) { var r = e(61), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; if (r) { var e = n[t]; return "__lodash_hash_undefined__" === e ? void 0 : e; } return o.call(n, t) ? n[t] : void 0; }; }, function (t, n, e) { var r = e(61), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; return r ? void 0 !== n[t] : o.call(n, t); }; }, function (t, n, e) { var r = e(61); t.exports = function (t, n) { var e = this.__data__; return ( (this.size += this.has(t) ? 0 : 1), (e[t] = r && void 0 === n ? "__lodash_hash_undefined__" : n), this ); }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { var n = r(this, t).delete(t); return (this.size -= n ? 1 : 0), n; }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return "string" == n || "number" == n || "symbol" == n || "boolean" == n ? "__proto__" !== t : null === t; }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { return r(this, t).get(t); }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { return r(this, t).has(t); }; }, function (t, n, e) { var r = e(62); t.exports = function (t, n) { var e = r(this, t), o = e.size; return e.set(t, n), (this.size += e.size == o ? 0 : 1), this; }; }, function (t, n, e) { var r = e(52), o = e(33); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = Array(t); ++e < t; ) r[e] = n(e); return r; }; }, function (t, n, e) { var r = e(36), o = e(26); t.exports = function (t) { return o(t) && "[object Arguments]" == r(t); }; }, function (t, n) { t.exports = function () { return !1; }; }, function (t, n, e) { var r = e(36), o = e(89), i = e(26), u = {}; (u["[object Float32Array]"] = u["[object Float64Array]"] = u["[object Int8Array]"] = u["[object Int16Array]"] = u["[object Int32Array]"] = u["[object Uint8Array]"] = u["[object Uint8ClampedArray]"] = u["[object Uint16Array]"] = u["[object Uint32Array]"] = !0), (u["[object Arguments]"] = u["[object Array]"] = u["[object ArrayBuffer]"] = u["[object Boolean]"] = u["[object DataView]"] = u["[object Date]"] = u["[object Error]"] = u["[object Function]"] = u["[object Map]"] = u["[object Number]"] = u["[object Object]"] = u["[object RegExp]"] = u["[object Set]"] = u["[object String]"] = u["[object WeakMap]"] = !1), (t.exports = function (t) { return i(t) && o(t.length) && !!u[r(t)]; }); }, function (t, n, e) { var r = e(118)(Object.keys, Object); t.exports = r; }, function (t, n, e) { var r = e(52), o = e(37); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n, e) { var r = e(22), o = e(67), i = e(260), u = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return i(t); var n = o(t), e = []; for (var c in t) ("constructor" != c || (!n && u.call(t, c))) && e.push(c); return e; }; }, function (t, n) { t.exports = function (t) { var n = []; if (null != t) for (var e in Object(t)) n.push(e); return n; }; }, function (t, n, e) { var r = e(52), o = e(92); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(52), o = e(123); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(125), o = e(123), i = e(37); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(35)(e(24), "DataView"); t.exports = r; }, function (t, n, e) { var r = e(35)(e(24), "Promise"); t.exports = r; }, function (t, n, e) { var r = e(35)(e(24), "WeakMap"); t.exports = r; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = t.length, r = new t.constructor(n); return ( n && "string" == typeof t[0] && e.call(t, "index") && ((r.index = t.index), (r.input = t.input)), r ); }; }, function (t, n, e) { var r = e(94), o = e(269), i = e(270), u = e(271), c = e(128); t.exports = function (t, n, e) { var a = t.constructor; switch (n) { case "[object ArrayBuffer]": return r(t); case "[object Boolean]": case "[object Date]": return new a(+t); case "[object DataView]": return o(t, e); case "[object Float32Array]": case "[object Float64Array]": case "[object Int8Array]": case "[object Int16Array]": case "[object Int32Array]": case "[object Uint8Array]": case "[object Uint8ClampedArray]": case "[object Uint16Array]": case "[object Uint32Array]": return c(t, e); case "[object Map]": return new a(); case "[object Number]": case "[object String]": return new a(t); case "[object RegExp]": return i(t); case "[object Set]": return new a(); case "[object Symbol]": return u(t); } }; }, function (t, n, e) { var r = e(94); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.byteLength); }; }, function (t, n) { var e = /\w*$/; t.exports = function (t) { var n = new t.constructor(t.source, e.exec(t)); return (n.lastIndex = t.lastIndex), n; }; }, function (t, n, e) { var r = e(42), o = r ? r.prototype : void 0, i = o ? o.valueOf : void 0; t.exports = function (t) { return i ? Object(i.call(t)) : {}; }; }, function (t, n, e) { var r = e(273), o = e(66), i = e(90), u = i && i.isMap, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(44), o = e(26); t.exports = function (t) { return o(t) && "[object Map]" == r(t); }; }, function (t, n, e) { var r = e(275), o = e(66), i = e(90), u = i && i.isSet, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(44), o = e(26); t.exports = function (t) { return o(t) && "[object Set]" == r(t); }; }, function (t, n) { t.exports = function (t) { return function (n, e, r) { for (var o = -1, i = Object(n), u = r(n), c = u.length; c--; ) { var a = u[t ? c : ++o]; if (!1 === e(i[a], a, i)) break; } return n; }; }; }, function (t, n, e) { var r = e(30); t.exports = function (t, n) { return function (e, o) { if (null == e) return e; if (!r(e)) return t(e, o); for ( var i = e.length, u = n ? i : -1, c = Object(e); (n ? u-- : ++u < i) && !1 !== o(c[u], u, c); ); return e; }; }; }, function (t, n, e) { var r = e(69); t.exports = function (t, n) { var e = []; return ( r(t, function (t, r, o) { n(t, r, o) && e.push(t); }), e ); }; }, function (t, n, e) { var r = e(280), o = e(288), i = e(140); t.exports = function (t) { var n = o(t); return 1 == n.length && n[0][2] ? i(n[0][0], n[0][1]) : function (e) { return e === t || r(e, t, n); }; }; }, function (t, n, e) { var r = e(58), o = e(135); t.exports = function (t, n, e, i) { var u = e.length, c = u, a = !i; if (null == t) return !c; for (t = Object(t); u--; ) { var f = e[u]; if (a && f[2] ? f[1] !== t[f[0]] : !(f[0] in t)) return !1; } for (; ++u < c; ) { var s = (f = e[u])[0], p = t[s], d = f[1]; if (a && f[2]) { if (void 0 === p && !(s in t)) return !1; } else { var h = new r(); if (i) var l = i(p, d, s, t, n, h); if (!(void 0 === l ? o(d, p, 3, i, h) : l)) return !1; } } return !0; }; }, function (t, n, e) { var r = e(58), o = e(136), i = e(285), u = e(287), c = e(44), a = e(17), f = e(43), s = e(54), p = "[object Object]", d = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, h, l, v) { var y = a(t), g = a(n), b = y ? "[object Array]" : c(t), m = g ? "[object Array]" : c(n), x = (b = "[object Arguments]" == b ? p : b) == p, _ = (m = "[object Arguments]" == m ? p : m) == p, w = b == m; if (w && f(t)) { if (!f(n)) return !1; (y = !0), (x = !1); } if (w && !x) return ( v || (v = new r()), y || s(t) ? o(t, n, e, h, l, v) : i(t, n, b, e, h, l, v) ); if (!(1 & e)) { var E = x && d.call(t, "__wrapped__"), j = _ && d.call(n, "__wrapped__"); if (E || j) { var k = E ? t.value() : t, S = j ? n.value() : n; return v || (v = new r()), l(k, S, e, h, v); } } return !!w && (v || (v = new r()), u(t, n, e, h, l, v)); }; }, function (t, n) { t.exports = function (t) { return this.__data__.set(t, "__lodash_hash_undefined__"), this; }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length; ++e < r; ) if (n(t[e], e, t)) return !0; return !1; }; }, function (t, n, e) { var r = e(42), o = e(127), i = e(41), u = e(136), c = e(286), a = e(98), f = r ? r.prototype : void 0, s = f ? f.valueOf : void 0; t.exports = function (t, n, e, r, f, p, d) { switch (e) { case "[object DataView]": if (t.byteLength != n.byteLength || t.byteOffset != n.byteOffset) return !1; (t = t.buffer), (n = n.buffer); case "[object ArrayBuffer]": return !(t.byteLength != n.byteLength || !p(new o(t), new o(n))); case "[object Boolean]": case "[object Date]": case "[object Number]": return i(+t, +n); case "[object Error]": return t.name == n.name && t.message == n.message; case "[object RegExp]": case "[object String]": return t == n + ""; case "[object Map]": var h = c; case "[object Set]": var l = 1 & r; if ((h || (h = a), t.size != n.size && !l)) return !1; var v = d.get(t); if (v) return v == n; (r |= 2), d.set(t, n); var y = u(h(t), h(n), r, f, p, d); return d.delete(t), y; case "[object Symbol]": if (s) return s.call(t) == s.call(n); } return !1; }; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t, r) { e[++n] = [r, t]; }), e ); }; }, function (t, n, e) { var r = e(124), o = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, i, u, c) { var a = 1 & e, f = r(t), s = f.length; if (s != r(n).length && !a) return !1; for (var p = s; p--; ) { var d = f[p]; if (!(a ? d in n : o.call(n, d))) return !1; } var h = c.get(t), l = c.get(n); if (h && l) return h == n && l == t; var v = !0; c.set(t, n), c.set(n, t); for (var y = a; ++p < s; ) { var g = t[(d = f[p])], b = n[d]; if (i) var m = a ? i(b, g, d, n, t, c) : i(g, b, d, t, n, c); if (!(void 0 === m ? g === b || u(g, b, e, i, c) : m)) { v = !1; break; } y || (y = "constructor" == d); } if (v && !y) { var x = t.constructor, _ = n.constructor; x == _ || !("constructor" in t) || !("constructor" in n) || ("function" == typeof x && x instanceof x && "function" == typeof _ && _ instanceof _) || (v = !1); } return c.delete(t), c.delete(n), v; }; }, function (t, n, e) { var r = e(139), o = e(33); t.exports = function (t) { for (var n = o(t), e = n.length; e--; ) { var i = n[e], u = t[i]; n[e] = [i, u, r(u)]; } return n; }; }, function (t, n, e) { var r = e(135), o = e(290), i = e(142), u = e(99), c = e(139), a = e(140), f = e(55); t.exports = function (t, n) { return u(t) && c(n) ? a(f(t), n) : function (e) { var u = o(e, t); return void 0 === u && u === n ? i(e, t) : r(n, u, 3); }; }; }, function (t, n, e) { var r = e(70); t.exports = function (t, n, e) { var o = null == t ? void 0 : r(t, n); return void 0 === o ? e : o; }; }, function (t, n, e) { var r = e(292), o = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g, u = r(function (t) { var n = []; return ( 46 === t.charCodeAt(0) && n.push(""), t.replace(o, function (t, e, r, o) { n.push(r ? o.replace(i, "$1") : e || t); }), n ); }); t.exports = u; }, function (t, n, e) { var r = e(293); t.exports = function (t) { var n = r(t, function (t) { return 500 === e.size && e.clear(), t; }), e = n.cache; return n; }; }, function (t, n, e) { var r = e(87); function o(t, n) { if ("function" != typeof t || (null != n && "function" != typeof n)) throw new TypeError("Expected a function"); var e = function e() { var r = arguments, o = n ? n.apply(this, r) : r[0], i = e.cache; if (i.has(o)) return i.get(o); var u = t.apply(this, r); return (e.cache = i.set(o, u) || i), u; }; return (e.cache = new (o.Cache || r)()), e; } (o.Cache = r), (t.exports = o); }, function (t, n, e) { var r = e(42), o = e(72), i = e(17), u = e(45), c = r ? r.prototype : void 0, a = c ? c.toString : void 0; t.exports = function t(n) { if ("string" == typeof n) return n; if (i(n)) return o(n, t) + ""; if (u(n)) return a ? a.call(n) : ""; var e = n + ""; return "0" == e && 1 / n == -1 / 0 ? "-0" : e; }; }, function (t, n) { t.exports = function (t, n) { return null != t && n in Object(t); }; }, function (t, n, e) { var r = e(144), o = e(297), i = e(99), u = e(55); t.exports = function (t) { return i(t) ? r(u(t)) : o(t); }; }, function (t, n, e) { var r = e(70); t.exports = function (t) { return function (n) { return r(n, t); }; }; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t, n) { return null != t && e.call(t, n); }; }, function (t, n, e) { var r = e(91), o = e(44), i = e(53), u = e(17), c = e(30), a = e(43), f = e(67), s = e(54), p = Object.prototype.hasOwnProperty; t.exports = function (t) { if (null == t) return !0; if ( c(t) && (u(t) || "string" == typeof t || "function" == typeof t.splice || a(t) || s(t) || i(t)) ) return !t.length; var n = o(t); if ("[object Map]" == n || "[object Set]" == n) return !t.size; if (f(t)) return !r(t).length; for (var e in t) if (p.call(t, e)) return !1; return !0; }; }, function (t, n) { t.exports = function (t, n, e, r) { var o = -1, i = null == t ? 0 : t.length; for (r && i && (e = t[++o]); ++o < i; ) e = n(e, t[o], o, t); return e; }; }, function (t, n) { t.exports = function (t, n, e, r, o) { return ( o(t, function (t, o, i) { e = r ? ((r = !1), t) : n(e, t, o, i); }), e ); }; }, function (t, n, e) { var r = e(91), o = e(44), i = e(30), u = e(303), c = e(304); t.exports = function (t) { if (null == t) return 0; if (i(t)) return u(t) ? c(t) : t.length; var n = o(t); return "[object Map]" == n || "[object Set]" == n ? t.size : r(t).length; }; }, function (t, n, e) { var r = e(36), o = e(17), i = e(26); t.exports = function (t) { return ( "string" == typeof t || (!o(t) && i(t) && "[object String]" == r(t)) ); }; }, function (t, n, e) { var r = e(305), o = e(306), i = e(307); t.exports = function (t) { return o(t) ? i(t) : r(t); }; }, function (t, n, e) { var r = e(144)("length"); t.exports = r; }, function (t, n) { var e = RegExp( "[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]", ); t.exports = function (t) { return e.test(t); }; }, function (t, n) { var e = "[\\ud800-\\udfff]", r = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", o = "\\ud83c[\\udffb-\\udfff]", i = "[^\\ud800-\\udfff]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", c = "[\\ud800-\\udbff][\\udc00-\\udfff]", a = "(?:" + r + "|" + o + ")" + "?", f = "[\\ufe0e\\ufe0f]?" + a + ("(?:\\u200d(?:" + [i, u, c].join("|") + ")[\\ufe0e\\ufe0f]?" + a + ")*"), s = "(?:" + [i + r + "?", r, u, c, e].join("|") + ")", p = RegExp(o + "(?=" + o + ")|" + s + f, "g"); t.exports = function (t) { for (var n = (p.lastIndex = 0); p.test(t); ) ++n; return n; }; }, function (t, n, e) { var r = e(88), o = e(130), i = e(96), u = e(31), c = e(68), a = e(17), f = e(43), s = e(51), p = e(22), d = e(54); t.exports = function (t, n, e) { var h = a(t), l = h || f(t) || d(t); if (((n = u(n, 4)), null == e)) { var v = t && t.constructor; e = l ? (h ? new v() : []) : p(t) && s(v) ? o(c(t)) : {}; } return ( (l ? r : i)(t, function (t, r, o) { return n(e, t, r, o); }), e ); }; }, function (t, n, e) { var r = e(100), o = e(73), i = e(314), u = e(153), c = o(function (t) { return i(r(t, 1, u, !0)); }); t.exports = c; }, function (t, n, e) { var r = e(42), o = e(53), i = e(17), u = r ? r.isConcatSpreadable : void 0; t.exports = function (t) { return i(t) || o(t) || !!(u && t && t[u]); }; }, function (t, n) { t.exports = function (t, n, e) { switch (e.length) { case 0: return t.call(n); case 1: return t.call(n, e[0]); case 2: return t.call(n, e[0], e[1]); case 3: return t.call(n, e[0], e[1], e[2]); } return t.apply(n, e); }; }, function (t, n, e) { var r = e(95), o = e(116), i = e(38), u = o ? function (t, n) { return o(t, "toString", { configurable: !0, enumerable: !1, value: r(n), writable: !0, }); } : i; t.exports = u; }, function (t, n) { var e = Date.now; t.exports = function (t) { var n = 0, r = 0; return function () { var o = e(), i = 16 - (o - r); if (((r = o), i > 0)) { if (++n >= 800) return arguments[0]; } else n = 0; return t.apply(void 0, arguments); }; }; }, function (t, n, e) { var r = e(137), o = e(315), i = e(319), u = e(138), c = e(320), a = e(98); t.exports = function (t, n, e) { var f = -1, s = o, p = t.length, d = !0, h = [], l = h; if (e) (d = !1), (s = i); else if (p >= 200) { var v = n ? null : c(t); if (v) return a(v); (d = !1), (s = u), (l = new r()); } else l = n ? [] : h; t: for (; ++f < p; ) { var y = t[f], g = n ? n(y) : y; if (((y = e || 0 !== y ? y : 0), d && g == g)) { for (var b = l.length; b--; ) if (l[b] === g) continue t; n && l.push(g), h.push(y); } else s(l, g, e) || (l !== h && l.push(g), h.push(y)); } return h; }; }, function (t, n, e) { var r = e(316); t.exports = function (t, n) { return !!(null == t ? 0 : t.length) && r(t, n, 0) > -1; }; }, function (t, n, e) { var r = e(152), o = e(317), i = e(318); t.exports = function (t, n, e) { return n == n ? i(t, n, e) : r(t, o, e); }; }, function (t, n) { t.exports = function (t) { return t != t; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = e - 1, o = t.length; ++r < o; ) if (t[r] === n) return r; return -1; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = null == t ? 0 : t.length; ++r < o; ) if (e(n, t[r])) return !0; return !1; }; }, function (t, n, e) { var r = e(126), o = e(321), i = e(98), u = r && 1 / i(new r([, -0]))[1] == 1 / 0 ? function (t) { return new r(t); } : o; t.exports = u; }, function (t, n) { t.exports = function () {}; }, function (t, n, e) { var r = e(72); t.exports = function (t, n) { return r(n, function (n) { return t[n]; }); }; }, function (t, n) { t.exports = "2.1.8"; }, function (t, n, e) { var r = e(21), o = e(85); function i(t) { return r.map(t.nodes(), function (n) { var e = t.node(n), o = t.parent(n), i = { v: n }; return ( r.isUndefined(e) || (i.value = e), r.isUndefined(o) || (i.parent = o), i ); }); } function u(t) { return r.map(t.edges(), function (n) { var e = t.edge(n), o = { v: n.v, w: n.w }; return ( r.isUndefined(n.name) || (o.name = n.name), r.isUndefined(e) || (o.value = e), o ); }); } t.exports = { write: function (t) { var n = { options: { directed: t.isDirected(), multigraph: t.isMultigraph(), compound: t.isCompound(), }, nodes: i(t), edges: u(t), }; r.isUndefined(t.graph()) || (n.value = r.clone(t.graph())); return n; }, read: function (t) { var n = new o(t.options).setGraph(t.value); return ( r.each(t.nodes, function (t) { n.setNode(t.v, t.value), t.parent && n.setParent(t.v, t.parent); }), r.each(t.edges, function (t) { n.setEdge({ v: t.v, w: t.w, name: t.name }, t.value); }), n ); }, }; }, function (t, n, e) { t.exports = { components: e(326), dijkstra: e(155), dijkstraAll: e(327), findCycles: e(328), floydWarshall: e(329), isAcyclic: e(330), postorder: e(331), preorder: e(332), prim: e(333), tarjan: e(157), topsort: e(158), }; }, function (t, n, e) { var r = e(21); t.exports = function (t) { var n, e = {}, o = []; function i(o) { r.has(e, o) || ((e[o] = !0), n.push(o), r.each(t.successors(o), i), r.each(t.predecessors(o), i)); } return ( r.each(t.nodes(), function (t) { (n = []), i(t), n.length && o.push(n); }), o ); }; }, function (t, n, e) { var r = e(155), o = e(21); t.exports = function (t, n, e) { return o.transform( t.nodes(), function (o, i) { o[i] = r(t, i, n, e); }, {}, ); }; }, function (t, n, e) { var r = e(21), o = e(157); t.exports = function (t) { return r.filter(o(t), function (n) { return n.length > 1 || (1 === n.length && t.hasEdge(n[0], n[0])); }); }; }, function (t, n, e) { var r = e(21); t.exports = function (t, n, e) { return (function (t, n, e) { var r = {}, o = t.nodes(); return ( o.forEach(function (t) { (r[t] = {}), (r[t][t] = { distance: 0 }), o.forEach(function (n) { t !== n && (r[t][n] = { distance: Number.POSITIVE_INFINITY }); }), e(t).forEach(function (e) { var o = e.v === t ? e.w : e.v, i = n(e); r[t][o] = { distance: i, predecessor: t }; }); }), o.forEach(function (t) { var n = r[t]; o.forEach(function (e) { var i = r[e]; o.forEach(function (e) { var r = i[t], o = n[e], u = i[e], c = r.distance + o.distance; c < u.distance && ((u.distance = c), (u.predecessor = o.predecessor)); }); }); }), r ); })( t, n || o, e || function (n) { return t.outEdges(n); }, ); }; var o = r.constant(1); }, function (t, n, e) { var r = e(158); t.exports = function (t) { try { r(t); } catch (t) { if (t instanceof r.CycleException) return !1; throw t; } return !0; }; }, function (t, n, e) { var r = e(159); t.exports = function (t, n) { return r(t, n, "post"); }; }, function (t, n, e) { var r = e(159); t.exports = function (t, n) { return r(t, n, "pre"); }; }, function (t, n, e) { var r = e(21), o = e(85), i = e(156); t.exports = function (t, n) { var e, u = new o(), c = {}, a = new i(); function f(t) { var r = t.v === e ? t.w : t.v, o = a.priority(r); if (void 0 !== o) { var i = n(t); i < o && ((c[r] = e), a.decrease(r, i)); } } if (0 === t.nodeCount()) return u; r.each(t.nodes(), function (t) { a.add(t, Number.POSITIVE_INFINITY), u.setNode(t); }), a.decrease(t.nodes()[0], 0); var s = !1; for (; a.size() > 0; ) { if (((e = a.removeMin()), r.has(c, e))) u.setEdge(e, c[e]); else { if (s) throw new Error("Input graph is not connected: " + t); s = !0; } t.nodeEdges(e).forEach(f); } return u; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(374), i = e(377), u = e(378), c = e(19).normalizeRanks, a = e(380), f = e(19).removeEmptyRanks, s = e(381), p = e(382), d = e(383), h = e(384), l = e(393), v = e(19), y = e(23).Graph; t.exports = function (t, n) { var e = n && n.debugTiming ? v.time : v.notime; e("layout", function () { var n = e(" buildLayoutGraph", function () { return (function (t) { var n = new y({ multigraph: !0, compound: !0 }), e = S(t.graph()); return ( n.setGraph(r.merge({}, b, k(e, g), r.pick(e, m))), r.forEach(t.nodes(), function (e) { var o = S(t.node(e)); n.setNode(e, r.defaults(k(o, x), _)), n.setParent(e, t.parent(e)); }), r.forEach(t.edges(), function (e) { var o = S(t.edge(e)); n.setEdge(e, r.merge({}, E, k(o, w), r.pick(o, j))); }), n ); })(t); }); e(" runLayout", function () { !(function (t, n) { n(" makeSpaceForEdgeLabels", function () { !(function (t) { var n = t.graph(); (n.ranksep /= 2), r.forEach(t.edges(), function (e) { var r = t.edge(e); (r.minlen *= 2), "c" !== r.labelpos.toLowerCase() && ("TB" === n.rankdir || "BT" === n.rankdir ? (r.width += r.labeloffset) : (r.height += r.labeloffset)); }); })(t); }), n(" removeSelfEdges", function () { !(function (t) { r.forEach(t.edges(), function (n) { if (n.v === n.w) { var e = t.node(n.v); e.selfEdges || (e.selfEdges = []), e.selfEdges.push({ e: n, label: t.edge(n) }), t.removeEdge(n); } }); })(t); }), n(" acyclic", function () { o.run(t); }), n(" nestingGraph.run", function () { s.run(t); }), n(" rank", function () { u(v.asNonCompoundGraph(t)); }), n(" injectEdgeLabelProxies", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.width && e.height) { var r = t.node(n.v), o = { rank: (t.node(n.w).rank - r.rank) / 2 + r.rank, e: n, }; v.addDummyNode(t, "edge-proxy", o, "_ep"); } }); })(t); }), n(" removeEmptyRanks", function () { f(t); }), n(" nestingGraph.cleanup", function () { s.cleanup(t); }), n(" normalizeRanks", function () { c(t); }), n(" assignRankMinMax", function () { !(function (t) { var n = 0; r.forEach(t.nodes(), function (e) { var o = t.node(e); o.borderTop && ((o.minRank = t.node(o.borderTop).rank), (o.maxRank = t.node(o.borderBottom).rank), (n = r.max(n, o.maxRank))); }), (t.graph().maxRank = n); })(t); }), n(" removeEdgeLabelProxies", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); "edge-proxy" === e.dummy && ((t.edge(e.e).labelRank = e.rank), t.removeNode(n)); }); })(t); }), n(" normalize.run", function () { i.run(t); }), n(" parentDummyChains", function () { a(t); }), n(" addBorderSegments", function () { p(t); }), n(" order", function () { h(t); }), n(" insertSelfEdges", function () { !(function (t) { var n = v.buildLayerMatrix(t); r.forEach(n, function (n) { var e = 0; r.forEach(n, function (n, o) { var i = t.node(n); (i.order = o + e), r.forEach(i.selfEdges, function (n) { v.addDummyNode( t, "selfedge", { width: n.label.width, height: n.label.height, rank: i.rank, order: o + ++e, e: n.e, label: n.label, }, "_se", ); }), delete i.selfEdges; }); }); })(t); }), n(" adjustCoordinateSystem", function () { d.adjust(t); }), n(" position", function () { l(t); }), n(" positionSelfEdges", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); if ("selfedge" === e.dummy) { var r = t.node(e.e.v), o = r.x + r.width / 2, i = r.y, u = e.x - o, c = r.height / 2; t.setEdge(e.e, e.label), t.removeNode(n), (e.label.points = [ { x: o + (2 * u) / 3, y: i - c }, { x: o + (5 * u) / 6, y: i - c }, { x: o + u, y: i }, { x: o + (5 * u) / 6, y: i + c }, { x: o + (2 * u) / 3, y: i + c }, ]), (e.label.x = e.x), (e.label.y = e.y); } }); })(t); }), n(" removeBorderNodes", function () { !(function (t) { r.forEach(t.nodes(), function (n) { if (t.children(n).length) { var e = t.node(n), o = t.node(e.borderTop), i = t.node(e.borderBottom), u = t.node(r.last(e.borderLeft)), c = t.node(r.last(e.borderRight)); (e.width = Math.abs(c.x - u.x)), (e.height = Math.abs(i.y - o.y)), (e.x = u.x + e.width / 2), (e.y = o.y + e.height / 2); } }), r.forEach(t.nodes(), function (n) { "border" === t.node(n).dummy && t.removeNode(n); }); })(t); }), n(" normalize.undo", function () { i.undo(t); }), n(" fixupEdgeLabelCoords", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (r.has(e, "x")) switch ( (("l" !== e.labelpos && "r" !== e.labelpos) || (e.width -= e.labeloffset), e.labelpos) ) { case "l": e.x -= e.width / 2 + e.labeloffset; break; case "r": e.x += e.width / 2 + e.labeloffset; } }); })(t); }), n(" undoCoordinateSystem", function () { d.undo(t); }), n(" translateGraph", function () { !(function (t) { var n = Number.POSITIVE_INFINITY, e = 0, o = Number.POSITIVE_INFINITY, i = 0, u = t.graph(), c = u.marginx || 0, a = u.marginy || 0; function f(t) { var r = t.x, u = t.y, c = t.width, a = t.height; (n = Math.min(n, r - c / 2)), (e = Math.max(e, r + c / 2)), (o = Math.min(o, u - a / 2)), (i = Math.max(i, u + a / 2)); } r.forEach(t.nodes(), function (n) { f(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.has(e, "x") && f(e); }), (n -= c), (o -= a), r.forEach(t.nodes(), function (e) { var r = t.node(e); (r.x -= n), (r.y -= o); }), r.forEach(t.edges(), function (e) { var i = t.edge(e); r.forEach(i.points, function (t) { (t.x -= n), (t.y -= o); }), r.has(i, "x") && (i.x -= n), r.has(i, "y") && (i.y -= o); }), (u.width = e - n + c), (u.height = i - o + a); })(t); }), n(" assignNodeIntersects", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e, r, o = t.edge(n), i = t.node(n.v), u = t.node(n.w); o.points ? ((e = o.points[0]), (r = o.points[o.points.length - 1])) : ((o.points = []), (e = u), (r = i)), o.points.unshift(v.intersectRect(i, e)), o.points.push(v.intersectRect(u, r)); }); })(t); }), n(" reversePoints", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); e.reversed && e.points.reverse(); }); })(t); }), n(" acyclic.undo", function () { o.undo(t); }); })(n, e); }), e(" updateInputGraph", function () { !(function (t, n) { r.forEach(t.nodes(), function (e) { var r = t.node(e), o = n.node(e); r && ((r.x = o.x), (r.y = o.y), n.children(e).length && ((r.width = o.width), (r.height = o.height))); }), r.forEach(t.edges(), function (e) { var o = t.edge(e), i = n.edge(e); (o.points = i.points), r.has(i, "x") && ((o.x = i.x), (o.y = i.y)); }), (t.graph().width = n.graph().width), (t.graph().height = n.graph().height); })(t, n); }); }); }; var g = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], b = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, m = ["acyclicer", "ranker", "rankdir", "align"], x = ["width", "height"], _ = { width: 0, height: 0 }, w = ["minlen", "weight", "width", "height", "labeloffset"], E = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r", }, j = ["labelpos"]; function k(t, n) { return r.mapValues(r.pick(t, n), Number); } function S(t) { var n = {}; return ( r.forEach(t, function (t, e) { n[e.toLowerCase()] = t; }), n ); } }, function (t, n, e) { var r = e(113); t.exports = function (t) { return r(t, 5); }; }, function (t, n, e) { var r = e(73), o = e(41), i = e(74), u = e(37), c = Object.prototype, a = c.hasOwnProperty, f = r(function (t, n) { t = Object(t); var e = -1, r = n.length, f = r > 2 ? n[2] : void 0; for (f && i(n[0], n[1], f) && (r = 1); ++e < r; ) for (var s = n[e], p = u(s), d = -1, h = p.length; ++d < h; ) { var l = p[d], v = t[l]; (void 0 === v || (o(v, c[l]) && !a.call(t, l))) && (t[l] = s[l]); } return t; }); t.exports = f; }, function (t, n, e) { var r = e(338)(e(339)); t.exports = r; }, function (t, n, e) { var r = e(31), o = e(30), i = e(33); t.exports = function (t) { return function (n, e, u) { var c = Object(n); if (!o(n)) { var a = r(e, 3); (n = i(n)), (e = function (t) { return a(c[t], t, c); }); } var f = t(n, e, u); return f > -1 ? c[a ? n[f] : f] : void 0; }; }; }, function (t, n, e) { var r = e(152), o = e(31), i = e(340), u = Math.max; t.exports = function (t, n, e) { var c = null == t ? 0 : t.length; if (!c) return -1; var a = null == e ? 0 : i(e); return a < 0 && (a = u(c + a, 0)), r(t, o(n, 3), a); }; }, function (t, n, e) { var r = e(160); t.exports = function (t) { var n = r(t), e = n % 1; return n == n ? (e ? n - e : n) : 0; }; }, function (t, n, e) { var r = e(342), o = e(22), i = e(45), u = /^[-+]0x[0-9a-f]+$/i, c = /^0b[01]+$/i, a = /^0o[0-7]+$/i, f = parseInt; t.exports = function (t) { if ("number" == typeof t) return t; if (i(t)) return NaN; if (o(t)) { var n = "function" == typeof t.valueOf ? t.valueOf() : t; t = o(n) ? n + "" : n; } if ("string" != typeof t) return 0 === t ? t : +t; t = r(t); var e = c.test(t); return e || a.test(t) ? f(t.slice(2), e ? 2 : 8) : u.test(t) ? NaN : +t; }; }, function (t, n, e) { var r = e(343), o = /^\s+/; t.exports = function (t) { return t ? t.slice(0, r(t) + 1).replace(o, "") : t; }; }, function (t, n) { var e = /\s/; t.exports = function (t) { for (var n = t.length; n-- && e.test(t.charAt(n)); ); return n; }; }, function (t, n, e) { var r = e(97), o = e(133), i = e(37); t.exports = function (t, n) { return null == t ? t : r(t, o(n), i); }; }, function (t, n) { t.exports = function (t) { var n = null == t ? 0 : t.length; return n ? t[n - 1] : void 0; }; }, function (t, n, e) { var r = e(64), o = e(96), i = e(31); t.exports = function (t, n) { var e = {}; return ( (n = i(n, 3)), o(t, function (t, o, i) { r(e, o, n(t, o, i)); }), e ); }; }, function (t, n, e) { var r = e(101), o = e(348), i = e(38); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n) { t.exports = function (t, n) { return t > n; }; }, function (t, n, e) { var r = e(350), o = e(354)(function (t, n, e) { r(t, n, e); }); t.exports = o; }, function (t, n, e) { var r = e(58), o = e(162), i = e(97), u = e(351), c = e(22), a = e(37), f = e(163); t.exports = function t(n, e, s, p, d) { n !== e && i( e, function (i, a) { if ((d || (d = new r()), c(i))) u(n, e, a, s, t, p, d); else { var h = p ? p(f(n, a), i, a + "", n, e, d) : void 0; void 0 === h && (h = i), o(n, a, h); } }, a, ); }; }, function (t, n, e) { var r = e(162), o = e(119), i = e(128), u = e(120), c = e(129), a = e(53), f = e(17), s = e(153), p = e(43), d = e(51), h = e(22), l = e(352), v = e(54), y = e(163), g = e(353); t.exports = function (t, n, e, b, m, x, _) { var w = y(t, e), E = y(n, e), j = _.get(E); if (j) r(t, e, j); else { var k = x ? x(w, E, e + "", t, n, _) : void 0, S = void 0 === k; if (S) { var O = f(E), N = !O && p(E), I = !O && !N && v(E); (k = E), O || N || I ? f(w) ? (k = w) : s(w) ? (k = u(w)) : N ? ((S = !1), (k = o(E, !0))) : I ? ((S = !1), (k = i(E, !0))) : (k = []) : l(E) || a(E) ? ((k = w), a(w) ? (k = g(w)) : (h(w) && !d(w)) || (k = c(E))) : (S = !1); } S && (_.set(E, k), m(k, E, b, x, _), _.delete(E)), r(t, e, k); } }; }, function (t, n, e) { var r = e(36), o = e(68), i = e(26), u = Function.prototype, c = Object.prototype, a = u.toString, f = c.hasOwnProperty, s = a.call(Object); t.exports = function (t) { if (!i(t) || "[object Object]" != r(t)) return !1; var n = o(t); if (null === n) return !0; var e = f.call(n, "constructor") && n.constructor; return "function" == typeof e && e instanceof e && a.call(e) == s; }; }, function (t, n, e) { var r = e(52), o = e(37); t.exports = function (t) { return r(t, o(t)); }; }, function (t, n, e) { var r = e(73), o = e(74); t.exports = function (t) { return r(function (n, e) { var r = -1, i = e.length, u = i > 1 ? e[i - 1] : void 0, c = i > 2 ? e[2] : void 0; for ( u = t.length > 3 && "function" == typeof u ? (i--, u) : void 0, c && o(e[0], e[1], c) && ((u = i < 3 ? void 0 : u), (i = 1)), n = Object(n); ++r < i; ) { var a = e[r]; a && t(n, a, r, u); } return n; }); }; }, function (t, n, e) { var r = e(101), o = e(164), i = e(38); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n, e) { var r = e(101), o = e(31), i = e(164); t.exports = function (t, n) { return t && t.length ? r(t, o(n, 2), i) : void 0; }; }, function (t, n, e) { var r = e(24); t.exports = function () { return r.Date.now(); }; }, function (t, n, e) { var r = e(359), o = e(362)(function (t, n) { return null == t ? {} : r(t, n); }); t.exports = o; }, function (t, n, e) { var r = e(360), o = e(142); t.exports = function (t, n) { return r(t, n, function (n, e) { return o(t, e); }); }; }, function (t, n, e) { var r = e(70), o = e(361), i = e(71); t.exports = function (t, n, e) { for (var u = -1, c = n.length, a = {}; ++u < c; ) { var f = n[u], s = r(t, f); e(s, f) && o(a, i(f, t), s); } return a; }; }, function (t, n, e) { var r = e(63), o = e(71), i = e(65), u = e(22), c = e(55); t.exports = function (t, n, e, a) { if (!u(t)) return t; for ( var f = -1, s = (n = o(n, t)).length, p = s - 1, d = t; null != d && ++f < s; ) { var h = c(n[f]), l = e; if ("__proto__" === h || "constructor" === h || "prototype" === h) return t; if (f != p) { var v = d[h]; void 0 === (l = a ? a(v, h, d) : void 0) && (l = u(v) ? v : i(n[f + 1]) ? [] : {}); } r(d, h, l), (d = d[h]); } return t; }; }, function (t, n, e) { var r = e(161), o = e(150), i = e(151); t.exports = function (t) { return i(o(t, void 0, r), t + ""); }; }, function (t, n, e) { var r = e(364)(); t.exports = r; }, function (t, n, e) { var r = e(365), o = e(74), i = e(160); t.exports = function (t) { return function (n, e, u) { return ( u && "number" != typeof u && o(n, e, u) && (e = u = void 0), (n = i(n)), void 0 === e ? ((e = n), (n = 0)) : (e = i(e)), (u = void 0 === u ? (n < e ? 1 : -1) : i(u)), r(n, e, u, t) ); }; }; }, function (t, n) { var e = Math.ceil, r = Math.max; t.exports = function (t, n, o, i) { for (var u = -1, c = r(e((n - t) / (o || 1)), 0), a = Array(c); c--; ) (a[i ? c : ++u] = t), (t += o); return a; }; }, function (t, n, e) { var r = e(100), o = e(367), i = e(73), u = e(74), c = i(function (t, n) { if (null == t) return []; var e = n.length; return ( e > 1 && u(t, n[0], n[1]) ? (n = []) : e > 2 && u(n[0], n[1], n[2]) && (n = [n[0]]), o(t, r(n, 1), []) ); }); t.exports = c; }, function (t, n, e) { var r = e(72), o = e(70), i = e(31), u = e(148), c = e(368), a = e(66), f = e(369), s = e(38), p = e(17); t.exports = function (t, n, e) { n = n.length ? r(n, function (t) { return p(t) ? function (n) { return o(n, 1 === t.length ? t[0] : t); } : t; }) : [s]; var d = -1; n = r(n, a(i)); var h = u(t, function (t, e, o) { return { criteria: r(n, function (n) { return n(t); }), index: ++d, value: t, }; }); return c(h, function (t, n) { return f(t, n, e); }); }; }, function (t, n) { t.exports = function (t, n) { var e = t.length; for (t.sort(n); e--; ) t[e] = t[e].value; return t; }; }, function (t, n, e) { var r = e(370); t.exports = function (t, n, e) { for ( var o = -1, i = t.criteria, u = n.criteria, c = i.length, a = e.length; ++o < c; ) { var f = r(i[o], u[o]); if (f) return o >= a ? f : f * ("desc" == e[o] ? -1 : 1); } return t.index - n.index; }; }, function (t, n, e) { var r = e(45); t.exports = function (t, n) { if (t !== n) { var e = void 0 !== t, o = null === t, i = t == t, u = r(t), c = void 0 !== n, a = null === n, f = n == n, s = r(n); if ( (!a && !s && !u && t > n) || (u && c && f && !a && !s) || (o && c && f) || (!e && f) || !i ) return 1; if ( (!o && !u && !s && t < n) || (s && e && i && !o && !u) || (a && e && i) || (!c && i) || !f ) return -1; } return 0; }; }, function (t, n, e) { var r = e(141), o = 0; t.exports = function (t) { var n = ++o; return r(t) + n; }; }, function (t, n, e) { var r = e(63), o = e(373); t.exports = function (t, n) { return o(t || [], n || [], r); }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = t.length, i = n.length, u = {}; ++r < o; ) { var c = r < i ? n[r] : void 0; e(u, t[r], c); } return u; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(375); t.exports = { run: function (t) { var n = "greedy" === t.graph().acyclicer ? o( t, (function (t) { return function (n) { return t.edge(n).weight; }; })(t), ) : (function (t) { var n = [], e = {}, o = {}; function i(u) { r.has(o, u) || ((o[u] = !0), (e[u] = !0), r.forEach(t.outEdges(u), function (t) { r.has(e, t.w) ? n.push(t) : i(t.w); }), delete e[u]); } return r.forEach(t.nodes(), i), n; })(t); r.forEach(n, function (n) { var e = t.edge(n); t.removeEdge(n), (e.forwardName = n.name), (e.reversed = !0), t.setEdge(n.w, n.v, e, r.uniqueId("rev")); }); }, undo: function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.reversed) { t.removeEdge(n); var r = e.forwardName; delete e.reversed, delete e.forwardName, t.setEdge(n.w, n.v, e, r); } }); }, }; }, function (t, n, e) { var r = e(9), o = e(23).Graph, i = e(376); t.exports = function (t, n) { if (t.nodeCount() <= 1) return []; var e = (function (t, n) { var e = new o(), u = 0, c = 0; r.forEach(t.nodes(), function (t) { e.setNode(t, { v: t, in: 0, out: 0 }); }), r.forEach(t.edges(), function (t) { var r = e.edge(t.v, t.w) || 0, o = n(t), i = r + o; e.setEdge(t.v, t.w, i), (c = Math.max(c, (e.node(t.v).out += o))), (u = Math.max(u, (e.node(t.w).in += o))); }); var f = r.range(c + u + 3).map(function () { return new i(); }), s = u + 1; return ( r.forEach(e.nodes(), function (t) { a(f, s, e.node(t)); }), { graph: e, buckets: f, zeroIdx: s } ); })(t, n || u), f = (function (t, n, e) { var r, o = [], i = n[n.length - 1], u = n[0]; for (; t.nodeCount(); ) { for (; (r = u.dequeue()); ) c(t, n, e, r); for (; (r = i.dequeue()); ) c(t, n, e, r); if (t.nodeCount()) for (var a = n.length - 2; a > 0; --a) if ((r = n[a].dequeue())) { o = o.concat(c(t, n, e, r, !0)); break; } } return o; })(e.graph, e.buckets, e.zeroIdx); return r.flatten( r.map(f, function (n) { return t.outEdges(n.v, n.w); }), !0, ); }; var u = r.constant(1); function c(t, n, e, o, i) { var u = i ? [] : void 0; return ( r.forEach(t.inEdges(o.v), function (r) { var o = t.edge(r), c = t.node(r.v); i && u.push({ v: r.v, w: r.w }), (c.out -= o), a(n, e, c); }), r.forEach(t.outEdges(o.v), function (r) { var o = t.edge(r), i = r.w, u = t.node(i); (u.in -= o), a(n, e, u); }), t.removeNode(o.v), u ); } function a(t, n, e) { e.out ? e.in ? t[e.out - e.in + n].enqueue(e) : t[t.length - 1].enqueue(e) : t[0].enqueue(e); } }, function (t, n) { function e() { var t = {}; (t._next = t._prev = t), (this._sentinel = t); } function r(t) { (t._prev._next = t._next), (t._next._prev = t._prev), delete t._next, delete t._prev; } function o(t, n) { if ("_next" !== t && "_prev" !== t) return n; } (t.exports = e), (e.prototype.dequeue = function () { var t = this._sentinel, n = t._prev; if (n !== t) return r(n), n; }), (e.prototype.enqueue = function (t) { var n = this._sentinel; t._prev && t._next && r(t), (t._next = n._next), (n._next._prev = t), (n._next = t), (t._prev = n); }), (e.prototype.toString = function () { for (var t = [], n = this._sentinel, e = n._prev; e !== n; ) t.push(JSON.stringify(e, o)), (e = e._prev); return "[" + t.join(", ") + "]"; }); }, function (t, n, e) { "use strict"; var r = e(9), o = e(19); t.exports = { run: function (t) { (t.graph().dummyChains = []), r.forEach(t.edges(), function (n) { !(function (t, n) { var e, r, i, u = n.v, c = t.node(u).rank, a = n.w, f = t.node(a).rank, s = n.name, p = t.edge(n), d = p.labelRank; if (f === c + 1) return; for (t.removeEdge(n), i = 0, ++c; c < f; ++i, ++c) (p.points = []), (r = { width: 0, height: 0, edgeLabel: p, edgeObj: n, rank: c, }), (e = o.addDummyNode(t, "edge", r, "_d")), c === d && ((r.width = p.width), (r.height = p.height), (r.dummy = "edge-label"), (r.labelpos = p.labelpos)), t.setEdge(u, e, { weight: p.weight }, s), 0 === i && t.graph().dummyChains.push(e), (u = e); t.setEdge(u, a, { weight: p.weight }, s); })(t, n); }); }, undo: function (t) { r.forEach(t.graph().dummyChains, function (n) { var e, r = t.node(n), o = r.edgeLabel; for (t.setEdge(r.edgeObj, o); r.dummy; ) (e = t.successors(n)[0]), t.removeNode(n), o.points.push({ x: r.x, y: r.y }), "edge-label" === r.dummy && ((o.x = r.x), (o.y = r.y), (o.width = r.width), (o.height = r.height)), (n = e), (r = t.node(n)); }); }, }; }, function (t, n, e) { "use strict"; var r = e(75).longestPath, o = e(165), i = e(379); t.exports = function (t) { switch (t.graph().ranker) { case "network-simplex": c(t); break; case "tight-tree": !(function (t) { r(t), o(t); })(t); break; case "longest-path": u(t); break; default: c(t); } }; var u = r; function c(t) { i(t); } }, function (t, n, e) { "use strict"; var r = e(9), o = e(165), i = e(75).slack, u = e(75).longestPath, c = e(23).alg.preorder, a = e(23).alg.postorder, f = e(19).simplify; function s(t) { (t = f(t)), u(t); var n, e = o(t); for (h(e), p(e, t); (n = v(e)); ) g(e, t, n, y(e, t, n)); } function p(t, n) { var e = a(t, t.nodes()); (e = e.slice(0, e.length - 1)), r.forEach(e, function (e) { !(function (t, n, e) { var r = t.node(e).parent; t.edge(e, r).cutvalue = d(t, n, e); })(t, n, e); }); } function d(t, n, e) { var o = t.node(e).parent, i = !0, u = n.edge(e, o), c = 0; return ( u || ((i = !1), (u = n.edge(o, e))), (c = u.weight), r.forEach(n.nodeEdges(e), function (r) { var u, a, f = r.v === e, s = f ? r.w : r.v; if (s !== o) { var p = f === i, d = n.edge(r).weight; if (((c += p ? d : -d), (u = e), (a = s), t.hasEdge(u, a))) { var h = t.edge(e, s).cutvalue; c += p ? -h : h; } } }), c ); } function h(t, n) { arguments.length < 2 && (n = t.nodes()[0]), l(t, {}, 1, n); } function l(t, n, e, o, i) { var u = e, c = t.node(o); return ( (n[o] = !0), r.forEach(t.neighbors(o), function (i) { r.has(n, i) || (e = l(t, n, e, i, o)); }), (c.low = u), (c.lim = e++), i ? (c.parent = i) : delete c.parent, e ); } function v(t) { return r.find(t.edges(), function (n) { return t.edge(n).cutvalue < 0; }); } function y(t, n, e) { var o = e.v, u = e.w; n.hasEdge(o, u) || ((o = e.w), (u = e.v)); var c = t.node(o), a = t.node(u), f = c, s = !1; c.lim > a.lim && ((f = a), (s = !0)); var p = r.filter(n.edges(), function (n) { return s === b(t, t.node(n.v), f) && s !== b(t, t.node(n.w), f); }); return r.minBy(p, function (t) { return i(n, t); }); } function g(t, n, e, o) { var i = e.v, u = e.w; t.removeEdge(i, u), t.setEdge(o.v, o.w, {}), h(t), p(t, n), (function (t, n) { var e = r.find(t.nodes(), function (t) { return !n.node(t).parent; }), o = c(t, e); (o = o.slice(1)), r.forEach(o, function (e) { var r = t.node(e).parent, o = n.edge(e, r), i = !1; o || ((o = n.edge(r, e)), (i = !0)), (n.node(e).rank = n.node(r).rank + (i ? o.minlen : -o.minlen)); }); })(t, n); } function b(t, n, e) { return e.low <= n.lim && n.lim <= e.lim; } (t.exports = s), (s.initLowLimValues = h), (s.initCutValues = p), (s.calcCutValue = d), (s.leaveEdge = v), (s.enterEdge = y), (s.exchangeEdges = g); }, function (t, n, e) { var r = e(9); t.exports = function (t) { var n = (function (t) { var n = {}, e = 0; function o(i) { var u = e; r.forEach(t.children(i), o), (n[i] = { low: u, lim: e++ }); } return r.forEach(t.children(), o), n; })(t); r.forEach(t.graph().dummyChains, function (e) { for ( var r = t.node(e), o = r.edgeObj, i = (function (t, n, e, r) { var o, i, u = [], c = [], a = Math.min(n[e].low, n[r].low), f = Math.max(n[e].lim, n[r].lim); o = e; do { (o = t.parent(o)), u.push(o); } while (o && (n[o].low > a || f > n[o].lim)); (i = o), (o = r); for (; (o = t.parent(o)) !== i; ) c.push(o); return { path: u.concat(c.reverse()), lca: i }; })(t, n, o.v, o.w), u = i.path, c = i.lca, a = 0, f = u[a], s = !0; e !== o.w; ) { if (((r = t.node(e)), s)) { for (; (f = u[a]) !== c && t.node(f).maxRank < r.rank; ) a++; f === c && (s = !1); } if (!s) { for ( ; a < u.length - 1 && t.node((f = u[a + 1])).minRank <= r.rank; ) a++; f = u[a]; } t.setParent(e, f), (e = t.successors(e)[0]); } }); }; }, function (t, n, e) { var r = e(9), o = e(19); t.exports = { run: function (t) { var n = o.addDummyNode(t, "root", {}, "_root"), e = (function (t) { var n = {}; return ( r.forEach(t.children(), function (e) { !(function e(o, i) { var u = t.children(o); u && u.length && r.forEach(u, function (t) { e(t, i + 1); }); n[o] = i; })(e, 1); }), n ); })(t), i = r.max(r.values(e)) - 1, u = 2 * i + 1; (t.graph().nestingRoot = n), r.forEach(t.edges(), function (n) { t.edge(n).minlen *= u; }); var c = (function (t) { return r.reduce( t.edges(), function (n, e) { return n + t.edge(e).weight; }, 0, ); })(t) + 1; r.forEach(t.children(), function (a) { !(function t(n, e, i, u, c, a, f) { var s = n.children(f); if (!s.length) return void ( f !== e && n.setEdge(e, f, { weight: 0, minlen: i }) ); var p = o.addBorderNode(n, "_bt"), d = o.addBorderNode(n, "_bb"), h = n.node(f); n.setParent(p, f), (h.borderTop = p), n.setParent(d, f), (h.borderBottom = d), r.forEach(s, function (r) { t(n, e, i, u, c, a, r); var o = n.node(r), s = o.borderTop ? o.borderTop : r, h = o.borderBottom ? o.borderBottom : r, l = o.borderTop ? u : 2 * u, v = s !== h ? 1 : c - a[f] + 1; n.setEdge(p, s, { weight: l, minlen: v, nestingEdge: !0 }), n.setEdge(h, d, { weight: l, minlen: v, nestingEdge: !0 }); }), n.parent(f) || n.setEdge(e, p, { weight: 0, minlen: c + a[f] }); })(t, n, u, c, i, e, a); }), (t.graph().nodeRankFactor = u); }, cleanup: function (t) { var n = t.graph(); t.removeNode(n.nestingRoot), delete n.nestingRoot, r.forEach(t.edges(), function (n) { t.edge(n).nestingEdge && t.removeEdge(n); }); }, }; }, function (t, n, e) { var r = e(9), o = e(19); function i(t, n, e, r, i, u) { var c = { width: 0, height: 0, rank: u, borderType: n }, a = i[n][u - 1], f = o.addDummyNode(t, "border", c, e); (i[n][u] = f), t.setParent(f, r), a && t.setEdge(a, f, { weight: 1 }); } t.exports = function (t) { r.forEach(t.children(), function n(e) { var o = t.children(e), u = t.node(e); if ((o.length && r.forEach(o, n), r.has(u, "minRank"))) { (u.borderLeft = []), (u.borderRight = []); for (var c = u.minRank, a = u.maxRank + 1; c < a; ++c) i(t, "borderLeft", "_bl", e, u, c), i(t, "borderRight", "_br", e, u, c); } }); }; }, function (t, n, e) { "use strict"; var r = e(9); function o(t) { r.forEach(t.nodes(), function (n) { i(t.node(n)); }), r.forEach(t.edges(), function (n) { i(t.edge(n)); }); } function i(t) { var n = t.width; (t.width = t.height), (t.height = n); } function u(t) { t.y = -t.y; } function c(t) { var n = t.x; (t.x = t.y), (t.y = n); } t.exports = { adjust: function (t) { var n = t.graph().rankdir.toLowerCase(); ("lr" !== n && "rl" !== n) || o(t); }, undo: function (t) { var n = t.graph().rankdir.toLowerCase(); ("bt" !== n && "rl" !== n) || (function (t) { r.forEach(t.nodes(), function (n) { u(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, u), r.has(e, "y") && u(e); }); })(t); ("lr" !== n && "rl" !== n) || (!(function (t) { r.forEach(t.nodes(), function (n) { c(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, c), r.has(e, "x") && c(e); }); })(t), o(t)); }, }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(385), i = e(386), u = e(387), c = e(391), a = e(392), f = e(23).Graph, s = e(19); function p(t, n, e) { return r.map(n, function (n) { return c(t, n, e); }); } function d(t, n) { var e = new f(); r.forEach(t, function (t) { var o = t.graph().root, i = u(t, o, e, n); r.forEach(i.vs, function (n, e) { t.node(n).order = e; }), a(t, e, i.vs); }); } function h(t, n) { r.forEach(n, function (n) { r.forEach(n, function (n, e) { t.node(n).order = e; }); }); } t.exports = function (t) { var n = s.maxRank(t), e = p(t, r.range(1, n + 1), "inEdges"), u = p(t, r.range(n - 1, -1, -1), "outEdges"), c = o(t); h(t, c); for ( var a, f = Number.POSITIVE_INFINITY, l = 0, v = 0; v < 4; ++l, ++v ) { d(l % 2 ? e : u, l % 4 >= 2), (c = s.buildLayerMatrix(t)); var y = i(t, c); y < f && ((v = 0), (a = r.cloneDeep(c)), (f = y)); } h(t, a); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = function (t) { var n = {}, e = r.filter(t.nodes(), function (n) { return !t.children(n).length; }), o = r.max( r.map(e, function (n) { return t.node(n).rank; }), ), i = r.map(r.range(o + 1), function () { return []; }); var u = r.sortBy(e, function (n) { return t.node(n).rank; }); return ( r.forEach(u, function e(o) { if (r.has(n, o)) return; n[o] = !0; var u = t.node(o); i[u.rank].push(o), r.forEach(t.successors(o), e); }), i ); }; }, function (t, n, e) { "use strict"; var r = e(9); function o(t, n, e) { for ( var o = r.zipObject( e, r.map(e, function (t, n) { return n; }), ), i = r.flatten( r.map(n, function (n) { return r.sortBy( r.map(t.outEdges(n), function (n) { return { pos: o[n.w], weight: t.edge(n).weight }; }), "pos", ); }), !0, ), u = 1; u < e.length; ) u <<= 1; var c = 2 * u - 1; u -= 1; var a = r.map(new Array(c), function () { return 0; }), f = 0; return ( r.forEach( i.forEach(function (t) { var n = t.pos + u; a[n] += t.weight; for (var e = 0; n > 0; ) n % 2 && (e += a[n + 1]), (a[(n = (n - 1) >> 1)] += t.weight); f += t.weight * e; }), ), f ); } t.exports = function (t, n) { for (var e = 0, r = 1; r < n.length; ++r) e += o(t, n[r - 1], n[r]); return e; }; }, function (t, n, e) { var r = e(9), o = e(388), i = e(389), u = e(390); t.exports = function t(n, e, c, a) { var f = n.children(e), s = n.node(e), p = s ? s.borderLeft : void 0, d = s ? s.borderRight : void 0, h = {}; p && (f = r.filter(f, function (t) { return t !== p && t !== d; })); var l = o(n, f); r.forEach(l, function (e) { if (n.children(e.v).length) { var o = t(n, e.v, c, a); (h[e.v] = o), r.has(o, "barycenter") && ((i = e), (u = o), r.isUndefined(i.barycenter) ? ((i.barycenter = u.barycenter), (i.weight = u.weight)) : ((i.barycenter = (i.barycenter * i.weight + u.barycenter * u.weight) / (i.weight + u.weight)), (i.weight += u.weight))); } var i, u; }); var v = i(l, c); !(function (t, n) { r.forEach(t, function (t) { t.vs = r.flatten( t.vs.map(function (t) { return n[t] ? n[t].vs : t; }), !0, ); }); })(v, h); var y = u(v, a); if ( p && ((y.vs = r.flatten([p, y.vs, d], !0)), n.predecessors(p).length) ) { var g = n.node(n.predecessors(p)[0]), b = n.node(n.predecessors(d)[0]); r.has(y, "barycenter") || ((y.barycenter = 0), (y.weight = 0)), (y.barycenter = (y.barycenter * y.weight + g.order + b.order) / (y.weight + 2)), (y.weight += 2); } return y; }; }, function (t, n, e) { var r = e(9); t.exports = function (t, n) { return r.map(n, function (n) { var e = t.inEdges(n); if (e.length) { var o = r.reduce( e, function (n, e) { var r = t.edge(e), o = t.node(e.v); return { sum: n.sum + r.weight * o.order, weight: n.weight + r.weight, }; }, { sum: 0, weight: 0 }, ); return { v: n, barycenter: o.sum / o.weight, weight: o.weight }; } return { v: n }; }); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = function (t, n) { var e = {}; return ( r.forEach(t, function (t, n) { var o = (e[t.v] = { indegree: 0, in: [], out: [], vs: [t.v], i: n, }); r.isUndefined(t.barycenter) || ((o.barycenter = t.barycenter), (o.weight = t.weight)); }), r.forEach(n.edges(), function (t) { var n = e[t.v], o = e[t.w]; r.isUndefined(n) || r.isUndefined(o) || (o.indegree++, n.out.push(e[t.w])); }), (function (t) { var n = []; function e(t) { return function (n) { n.merged || ((r.isUndefined(n.barycenter) || r.isUndefined(t.barycenter) || n.barycenter >= t.barycenter) && (function (t, n) { var e = 0, r = 0; t.weight && ((e += t.barycenter * t.weight), (r += t.weight)); n.weight && ((e += n.barycenter * n.weight), (r += n.weight)); (t.vs = n.vs.concat(t.vs)), (t.barycenter = e / r), (t.weight = r), (t.i = Math.min(n.i, t.i)), (n.merged = !0); })(t, n)); }; } function o(n) { return function (e) { e.in.push(n), 0 == --e.indegree && t.push(e); }; } for (; t.length; ) { var i = t.pop(); n.push(i), r.forEach(i.in.reverse(), e(i)), r.forEach(i.out, o(i)); } return r.map( r.filter(n, function (t) { return !t.merged; }), function (t) { return r.pick(t, ["vs", "i", "barycenter", "weight"]); }, ); })( r.filter(e, function (t) { return !t.indegree; }), ) ); }; }, function (t, n, e) { var r = e(9), o = e(19); function i(t, n, e) { for (var o; n.length && (o = r.last(n)).i <= e; ) n.pop(), t.push(o.vs), e++; return e; } t.exports = function (t, n) { var e = o.partition(t, function (t) { return r.has(t, "barycenter"); }), u = e.lhs, c = r.sortBy(e.rhs, function (t) { return -t.i; }), a = [], f = 0, s = 0, p = 0; u.sort( ((d = !!n), function (t, n) { return t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : d ? n.i - t.i : t.i - n.i; }), ), (p = i(a, c, p)), r.forEach(u, function (t) { (p += t.vs.length), a.push(t.vs), (f += t.barycenter * t.weight), (s += t.weight), (p = i(a, c, p)); }); var d; var h = { vs: r.flatten(a, !0) }; s && ((h.barycenter = f / s), (h.weight = s)); return h; }; }, function (t, n, e) { var r = e(9), o = e(23).Graph; t.exports = function (t, n, e) { var i = (function (t) { var n; for (; t.hasNode((n = r.uniqueId("_root"))); ); return n; })(t), u = new o({ compound: !0 }) .setGraph({ root: i }) .setDefaultNodeLabel(function (n) { return t.node(n); }); return ( r.forEach(t.nodes(), function (o) { var c = t.node(o), a = t.parent(o); (c.rank === n || (c.minRank <= n && n <= c.maxRank)) && (u.setNode(o), u.setParent(o, a || i), r.forEach(t[e](o), function (n) { var e = n.v === o ? n.w : n.v, i = u.edge(e, o), c = r.isUndefined(i) ? 0 : i.weight; u.setEdge(e, o, { weight: t.edge(n).weight + c }); }), r.has(c, "minRank") && u.setNode(o, { borderLeft: c.borderLeft[n], borderRight: c.borderRight[n], })); }), u ); }; }, function (t, n, e) { var r = e(9); t.exports = function (t, n, e) { var o, i = {}; r.forEach(e, function (e) { for (var r, u, c = t.parent(e); c; ) { if ( ((r = t.parent(c)) ? ((u = i[r]), (i[r] = c)) : ((u = o), (o = c)), u && u !== c) ) return void n.setEdge(u, c); c = r; } }); }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(19), i = e(394).positionX; t.exports = function (t) { (function (t) { var n = o.buildLayerMatrix(t), e = t.graph().ranksep, i = 0; r.forEach(n, function (n) { var o = r.max( r.map(n, function (n) { return t.node(n).height; }), ); r.forEach(n, function (n) { t.node(n).y = i + o / 2; }), (i += o + e); }); })((t = o.asNonCompoundGraph(t))), r.forEach(i(t), function (n, e) { t.node(e).x = n; }); }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph, i = e(19); function u(t, n) { var e = {}; return ( r.reduce(n, function (n, o) { var i = 0, u = 0, c = n.length, f = r.last(o); return ( r.forEach(o, function (n, s) { var p = (function (t, n) { if (t.node(n).dummy) return r.find(t.predecessors(n), function (n) { return t.node(n).dummy; }); })(t, n), d = p ? t.node(p).order : c; (p || n === f) && (r.forEach(o.slice(u, s + 1), function (n) { r.forEach(t.predecessors(n), function (r) { var o = t.node(r), u = o.order; !(u < i || d < u) || (o.dummy && t.node(n).dummy) || a(e, r, n); }); }), (u = s + 1), (i = d)); }), o ); }), e ); } function c(t, n) { var e = {}; function o(n, o, i, u, c) { var f; r.forEach(r.range(o, i), function (o) { (f = n[o]), t.node(f).dummy && r.forEach(t.predecessors(f), function (n) { var r = t.node(n); r.dummy && (r.order < u || r.order > c) && a(e, n, f); }); }); } return ( r.reduce(n, function (n, e) { var i, u = -1, c = 0; return ( r.forEach(e, function (r, a) { if ("border" === t.node(r).dummy) { var f = t.predecessors(r); f.length && ((i = t.node(f[0]).order), o(e, c, a, u, i), (c = a), (u = i)); } o(e, c, e.length, i, n.length); }), e ); }), e ); } function a(t, n, e) { if (n > e) { var r = n; (n = e), (e = r); } var o = t[n]; o || (t[n] = o = {}), (o[e] = !0); } function f(t, n, e) { if (n > e) { var o = n; (n = e), (e = o); } return r.has(t[n], e); } function s(t, n, e, o) { var i = {}, u = {}, c = {}; return ( r.forEach(n, function (t) { r.forEach(t, function (t, n) { (i[t] = t), (u[t] = t), (c[t] = n); }); }), r.forEach(n, function (t) { var n = -1; r.forEach(t, function (t) { var a = o(t); if (a.length) for ( var s = ((a = r.sortBy(a, function (t) { return c[t]; })).length - 1) / 2, p = Math.floor(s), d = Math.ceil(s); p <= d; ++p ) { var h = a[p]; u[t] === t && n < c[h] && !f(e, t, h) && ((u[h] = t), (u[t] = i[t] = i[h]), (n = c[h])); } }); }), { root: i, align: u } ); } function p(t, n, e, i, u) { var c = {}, a = (function (t, n, e, i) { var u = new o(), c = t.graph(), a = (function (t, n, e) { return function (o, i, u) { var c, a = o.node(i), f = o.node(u), s = 0; if (((s += a.width / 2), r.has(a, "labelpos"))) switch (a.labelpos.toLowerCase()) { case "l": c = -a.width / 2; break; case "r": c = a.width / 2; } if ( (c && (s += e ? c : -c), (c = 0), (s += (a.dummy ? n : t) / 2), (s += (f.dummy ? n : t) / 2), (s += f.width / 2), r.has(f, "labelpos")) ) switch (f.labelpos.toLowerCase()) { case "l": c = f.width / 2; break; case "r": c = -f.width / 2; } return c && (s += e ? c : -c), (c = 0), s; }; })(c.nodesep, c.edgesep, i); return ( r.forEach(n, function (n) { var o; r.forEach(n, function (n) { var r = e[n]; if ((u.setNode(r), o)) { var i = e[o], c = u.edge(i, r); u.setEdge(i, r, Math.max(a(t, n, o), c || 0)); } o = n; }); }), u ); })(t, n, e, u), f = u ? "borderLeft" : "borderRight"; function s(t, n) { for (var e = a.nodes(), r = e.pop(), o = {}; r; ) o[r] ? t(r) : ((o[r] = !0), e.push(r), (e = e.concat(n(r)))), (r = e.pop()); } return ( s(function (t) { c[t] = a.inEdges(t).reduce(function (t, n) { return Math.max(t, c[n.v] + a.edge(n)); }, 0); }, a.predecessors.bind(a)), s(function (n) { var e = a.outEdges(n).reduce(function (t, n) { return Math.min(t, c[n.w] - a.edge(n)); }, Number.POSITIVE_INFINITY), r = t.node(n); e !== Number.POSITIVE_INFINITY && r.borderType !== f && (c[n] = Math.max(c[n], e)); }, a.successors.bind(a)), r.forEach(i, function (t) { c[t] = c[e[t]]; }), c ); } function d(t, n) { return r.minBy(r.values(n), function (n) { var e = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY; return ( r.forIn(n, function (n, r) { var i = (function (t, n) { return t.node(n).width; })(t, r) / 2; (e = Math.max(n + i, e)), (o = Math.min(n - i, o)); }), e - o ); }); } function h(t, n) { var e = r.values(n), o = r.min(e), i = r.max(e); r.forEach(["u", "d"], function (e) { r.forEach(["l", "r"], function (u) { var c, a = e + u, f = t[a]; if (f !== n) { var s = r.values(f); (c = "l" === u ? o - r.min(s) : i - r.max(s)) && (t[a] = r.mapValues(f, function (t) { return t + c; })); } }); }); } function l(t, n) { return r.mapValues(t.ul, function (e, o) { if (n) return t[n.toLowerCase()][o]; var i = r.sortBy(r.map(t, o)); return (i[1] + i[2]) / 2; }); } t.exports = { positionX: function (t) { var n, e = i.buildLayerMatrix(t), o = r.merge(u(t, e), c(t, e)), a = {}; r.forEach(["u", "d"], function (i) { (n = "u" === i ? e : r.values(e).reverse()), r.forEach(["l", "r"], function (e) { "r" === e && (n = r.map(n, function (t) { return r.values(t).reverse(); })); var u = ("u" === i ? t.predecessors : t.successors).bind(t), c = s(t, n, o, u), f = p(t, n, c.root, c.align, "r" === e); "r" === e && (f = r.mapValues(f, function (t) { return -t; })), (a[i + e] = f); }); }); var f = d(t, a); return h(a, f), l(a, t.graph().align); }, findType1Conflicts: u, findType2Conflicts: c, addConflict: a, hasConflict: f, verticalAlignment: s, horizontalCompaction: p, alignCoordinates: h, findSmallestWidthAlignment: d, balance: l, }; }, function (t, n, e) { var r = e(9), o = e(19), i = e(23).Graph; t.exports = { debugOrdering: function (t) { var n = o.buildLayerMatrix(t), e = new i({ compound: !0, multigraph: !0 }).setGraph({}); return ( r.forEach(t.nodes(), function (n) { e.setNode(n, { label: n }), e.setParent(n, "layer" + t.node(n).rank); }), r.forEach(t.edges(), function (t) { e.setEdge(t.v, t.w, {}, t.name); }), r.forEach(n, function (t, n) { var o = "layer" + n; e.setNode(o, { rank: "same" }), r.reduce(t, function (t, n) { return e.setEdge(t, n, { style: "invis" }), n; }); }), e ); }, }; }, function (t, n) { t.exports = "0.8.5"; }, ]).default; }); //# sourceMappingURL=dagreLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/forceAtlas2Layout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function i(r) { if (e[r]) return e[r].exports; var n = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(n.exports, n, n.exports, i), (n.l = !0), n.exports; } return ( (i.m = t), (i.c = e), (i.d = function (t, e, r) { i.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (i.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (i.t = function (t, e) { if ((1 & e && (t = i(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (i.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var n in t) i.d( r, n, function (e) { return t[e]; }.bind(null, n), ); return r; }), (i.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return i.d(e, "a", e), e; }), (i.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (i.p = ""), i((i.s = 397)) ); })({ 10: function (t, e, i) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, i, r) { void 0 === r && (r = i), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[i]; }, }); } : function (t, e, i, r) { void 0 === r && (r = i), (t[r] = e[i]); }), n = (this && this.__exportStar) || function (t, e) { for (var i in t) "default" === i || Object.prototype.hasOwnProperty.call(e, i) || r(e, t, i); }; Object.defineProperty(e, "__esModule", { value: !0 }), n(i(11), e), n(i(12), e), n(i(13), e), n(i(14), e), n(i(15), e), n(i(16), e); }, 11: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, n, o = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(o, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = r(t)); }); }, 12: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var i = parseFloat(t); return e.isNaN(i) ? t : i; }; }, 14: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, i) { for (var r = [], n = 0; n < t; n++) r[n] = 0; return i ? (i.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], i = t.length, r = 0; r < i; r += 1) { e[r] = []; for (var n = 0; n < i; n += 1) r === n ? (e[r][n] = 0) : 0 !== t[r][n] && t[r][n] ? (e[r][n] = t[r][n]) : (e[r][n] = 1 / 0); } for (var o = 0; o < i; o += 1) for (r = 0; r < i; r += 1) for (n = 0; n < i; n += 1) e[r][n] > e[r][o] + e[o][n] && (e[r][n] = e[r][o] + e[o][n]); return e; }; e.getAdjMatrix = function (t, e) { var i = t.nodes, r = t.edges, n = [], o = {}; if (!i) throw new Error("invalid nodes data!"); return ( i && i.forEach(function (t, e) { o[t.id] = e; n.push([]); }), r && r.forEach(function (t) { var i = t.source, r = t.target, s = o[i], u = o[r]; (n[s][u] = 1), e || (n[u][s] = 1); }), n ); }; e.scaleMatrix = function (t, e) { var i = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), i.push(r); }), i ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, i) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], i)) return; return !!i(e); })(t, e); }; }, 15: function (t, e, i) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var e, i = 1, r = arguments.length; i < r; i++) for (var n in (e = arguments[i])) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var i = []; return ( t.forEach(function (t) { i.push(t); }), i.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var o = n({}, t); return ( Object.keys(o).forEach(function (t) { o[t] = e.clone(o[t]); }), o ); } return t; }; }, 16: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 175: function (t, e, i) { "use strict"; var r, n = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function i() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i())); }), o = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.ForceAtlas2Layout = void 0); var s = i(7), u = i(10), h = o(i(398)), a = o(i(399)), c = o(i(400)), d = (function (t) { function e(e) { var i = t.call(this) || this; return ( (i.center = [0, 0]), (i.width = 300), (i.height = 300), (i.nodes = []), (i.edges = []), (i.kr = 5), (i.kg = 1), (i.mode = "normal"), (i.preventOverlap = !1), (i.dissuadeHubs = !1), (i.barnesHut = !1), (i.maxIteration = 0), (i.ks = 0.1), (i.ksmax = 10), (i.tao = 0.1), (i.onLayoutEnd = function () {}), (i.prune = !1), i.updateCfg(e), i ); } return ( n(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.execute = function () { var t = this.nodes, e = this.maxIteration, i = this.onLayoutEnd, r = this.prune; this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight); for (var n = [], o = t.length, s = 0; s < o; s += 1) { var h = t[s], a = 10, c = 10; u.isNumber(h.size) && ((a = h.size), (c = h.size)), u.isArray(h.size) && (isNaN(h.size[0]) || (a = h.size[0]), isNaN(h.size[1]) || (c = h.size[1])), this.getWidth && !isNaN(this.getWidth(h)) && (c = this.getWidth(h)), this.getHeight && !isNaN(this.getHeight(h)) && (a = this.getHeight(h)); var d = Math.max(a, c); n.push(d); } !this.barnesHut && o > 250 && (this.barnesHut = !0), !this.prune && o > 100 && (this.prune = !0), 0 !== this.maxIteration || this.prune ? 0 === this.maxIteration && r && ((e = 100), o <= 200 && o > 100 ? (e = 500) : o > 200 && (e = 950), (this.maxIteration = e)) : ((e = 250), o <= 200 && o > 100 ? (e = 1e3) : o > 200 && (e = 1200), (this.maxIteration = e)), this.kr || ((this.kr = 50), o > 100 && o <= 500 ? (this.kr = 20) : o > 500 && (this.kr = 1)), this.kg || ((this.kg = 20), o > 100 && o <= 500 ? (this.kg = 10) : o > 500 && (this.kg = 1)), (this.nodes = this.updateNodesByForces(n)), i(); }), (e.prototype.updateNodesByForces = function (t) { for ( var e = this.nodes, i = this.edges, r = this.maxIteration, n = i.filter(function (t) { return t.source !== t.target; }), o = e.length, s = n.length, u = [], h = {}, a = {}, c = [], d = 0; d < o; d += 1 ) (h[e[d].id] = d), (u[d] = 0), (void 0 === e[d].x || isNaN(e[d].x)) && (e[d].x = 1e3 * Math.random()), (void 0 === e[d].y || isNaN(e[d].y)) && (e[d].y = 1e3 * Math.random()), c.push({ x: e[d].x, y: e[d].y }); for (d = 0; d < s; d += 1) { for ( var f = void 0, p = void 0, l = 0, y = 0, g = 0; g < o; g += 1 ) e[g].id === n[d].source ? ((f = e[g]), (l = g)) : e[g].id === n[d].target && ((p = e[g]), (y = g)), (a[d] = { sourceIdx: l, targetIdx: y }); f && (u[h[f.id]] += 1), p && (u[h[p.id]] += 1); } var v = r; if (((e = this.iterate(v, h, a, s, u, t)), this.prune)) { for (g = 0; g < s; g += 1) u[a[g].sourceIdx] <= 1 ? ((e[a[g].sourceIdx].x = e[a[g].targetIdx].x), (e[a[g].sourceIdx].y = e[a[g].targetIdx].y)) : u[a[g].targetIdx] <= 1 && ((e[a[g].targetIdx].x = e[a[g].sourceIdx].x), (e[a[g].targetIdx].y = e[a[g].sourceIdx].y)); (this.prune = !1), (this.barnesHut = !1), (v = 100), (e = this.iterate(v, h, a, s, u, t)); } return e; }), (e.prototype.iterate = function (t, e, i, r, n, o) { for ( var s = this.nodes, u = this.kr, a = this.preventOverlap, c = this.barnesHut, d = s.length, f = 0, p = t, l = [], y = [], g = [], v = 0; v < d; v += 1 ) if (((l[2 * v] = 0), (l[2 * v + 1] = 0), c)) { var x = { id: v, rx: s[v].x, ry: s[v].y, mass: 1, g: u, degree: n[v], }; g[v] = new h.default(x); } for (; p > 0; ) { for (v = 0; v < d; v += 1) (y[2 * v] = l[2 * v]), (y[2 * v + 1] = l[2 * v + 1]), (l[2 * v] = 0), (l[2 * v + 1] = 0); (l = this.getAttrForces(p, 50, r, e, i, n, o, l)), (l = c && ((a && p > 50) || !a) ? this.getOptRepGraForces(l, g, n) : this.getRepGraForces(p, 50, l, 100, o, n)); var m = this.updatePos(l, y, f, n); (s = m.nodes), (f = m.sg), p--, this.tick && this.tick(); } return s; }), (e.prototype.getAttrForces = function (t, e, i, r, n, o, s, u) { for ( var h = this.nodes, a = this.preventOverlap, c = this.dissuadeHubs, d = this.mode, f = this.prune, p = 0; p < i; p += 1 ) { var l = h[n[p].sourceIdx], y = n[p].sourceIdx, g = h[n[p].targetIdx], v = n[p].targetIdx; if (!f || !(o[y] <= 1 || o[v] <= 1)) { var x = [g.x - l.x, g.y - l.y], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m), a && t < e && (m = m - s[y] - s[v]); var b = m, _ = b; "linlog" === d && (_ = b = Math.log(1 + m)), c && ((b = m / o[y]), (_ = m / o[v])), a && t < e && m <= 0 ? ((b = 0), (_ = 0)) : a && t < e && m > 0 && ((b = m), (_ = m)), (u[2 * r[l.id]] += b * x[0]), (u[2 * r[g.id]] -= _ * x[0]), (u[2 * r[l.id] + 1] += b * x[1]), (u[2 * r[g.id] + 1] -= _ * x[1]); } } return u; }), (e.prototype.getRepGraForces = function (t, e, i, r, n, o) { for ( var s = this.nodes, u = this.preventOverlap, h = this.kr, a = this.kg, c = this.center, d = this.prune, f = s.length, p = 0; p < f; p += 1 ) { for (var l = p + 1; l < f; l += 1) if (!d || !(o[p] <= 1 || o[l] <= 1)) { var y = [s[l].x - s[p].x, s[l].y - s[p].y], g = Math.hypot(y[0], y[1]); (g = g < 1e-4 ? 1e-4 : g), (y[0] = y[0] / g), (y[1] = y[1] / g), u && t < e && (g = g - n[p] - n[l]); var v = (h * (o[p] + 1) * (o[l] + 1)) / g; u && t < e && g < 0 ? (v = r * (o[p] + 1) * (o[l] + 1)) : u && t < e && 0 === g ? (v = 0) : u && t < e && g > 0 && (v = (h * (o[p] + 1) * (o[l] + 1)) / g), (i[2 * p] -= v * y[0]), (i[2 * l] += v * y[0]), (i[2 * p + 1] -= v * y[1]), (i[2 * l + 1] += v * y[1]); } var x = [s[p].x - c[0], s[p].y - c[1]], m = Math.hypot(x[0], x[1]); (x[0] = x[0] / m), (x[1] = x[1] / m); var b = a * (o[p] + 1); (i[2 * p] -= b * x[0]), (i[2 * p + 1] -= b * x[1]); } return i; }), (e.prototype.getOptRepGraForces = function (t, e, i) { for ( var r = this.nodes, n = this.kg, o = this.center, s = this.prune, u = r.length, h = 9e10, d = -9e10, f = 9e10, p = -9e10, l = 0; l < u; l += 1 ) (s && i[l] <= 1) || (e[l].setPos(r[l].x, r[l].y), r[l].x >= d && (d = r[l].x), r[l].x <= h && (h = r[l].x), r[l].y >= p && (p = r[l].y), r[l].y <= f && (f = r[l].y)); var y = { xmid: (d + h) / 2, ymid: (p + f) / 2, length: Math.max(d - h, p - f), massCenter: o, mass: u, }, g = new a.default(y), v = new c.default(g); for (l = 0; l < u; l += 1) (s && i[l] <= 1) || (e[l].in(g) && v.insert(e[l])); for (l = 0; l < u; l += 1) if (!(s && i[l] <= 1)) { e[l].resetForce(), v.updateForce(e[l]), (t[2 * l] -= e[l].fx), (t[2 * l + 1] -= e[l].fy); var x = [r[l].x - o[0], r[l].y - o[1]], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m); var b = n * (i[l] + 1); (t[2 * l] -= b * x[0]), (t[2 * l + 1] -= b * x[1]); } return t; }), (e.prototype.updatePos = function (t, e, i, r) { for ( var n = this.nodes, o = this.ks, s = this.tao, u = this.prune, h = this.ksmax, a = n.length, c = [], d = [], f = 0, p = 0, l = 0; l < a; l += 1 ) if (!(u && r[l] <= 1)) { var y = [t[2 * l] - e[2 * l], t[2 * l + 1] - e[2 * l + 1]], g = Math.hypot(y[0], y[1]), v = [t[2 * l] + e[2 * l], t[2 * l + 1] + e[2 * l + 1]], x = Math.hypot(v[0], v[1]); (c[l] = g), (d[l] = x / 2), (f += (r[l] + 1) * c[l]), (p += (r[l] + 1) * d[l]); } var m = i; (i = (s * p) / f), 0 !== m && (i = i > 1.5 * m ? 1.5 * m : i); for (l = 0; l < a; l += 1) if (!(u && r[l] <= 1)) { var b = (o * i) / (1 + i * Math.sqrt(c[l])), _ = Math.hypot(t[2 * l], t[2 * l + 1]), N = h / (_ = _ < 1e-4 ? 1e-4 : _), O = (b = b > N ? N : b) * t[2 * l], j = b * t[2 * l + 1]; (n[l].x += O), (n[l].y += j); } return { nodes: n, sg: i }; }), e ); })(s.Base); e.ForceAtlas2Layout = d; }, 397: function (t, e, i) { "use strict"; i.r(e); var r = i(175); e.default = r.ForceAtlas2Layout; }, 398: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.id = t.id || 0), (this.rx = t.rx), (this.ry = t.ry), (this.fx = 0), (this.fy = 0), (this.mass = t.mass), (this.degree = t.degree), (this.g = t.g || 0); } return ( (t.prototype.distanceTo = function (t) { var e = this.rx - t.rx, i = this.ry - t.ry; return Math.hypot(e, i); }), (t.prototype.setPos = function (t, e) { (this.rx = t), (this.ry = e); }), (t.prototype.resetForce = function () { (this.fx = 0), (this.fy = 0); }), (t.prototype.addForce = function (t) { var e = t.rx - this.rx, i = t.ry - this.ry, r = Math.hypot(e, i); r = r < 1e-4 ? 1e-4 : r; var n = (this.g * (this.degree + 1) * (t.degree + 1)) / r; (this.fx += (n * e) / r), (this.fy += (n * i) / r); }), (t.prototype.in = function (t) { return t.contains(this.rx, this.ry); }), (t.prototype.add = function (e) { var i = this.mass + e.mass; return new t({ rx: (this.rx * this.mass + e.rx * e.mass) / i, ry: (this.ry * this.mass + e.ry * e.mass) / i, mass: i, degree: this.degree + e.degree, }); }), t ); })(); e.default = r; }, 399: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.xmid = t.xmid), (this.ymid = t.ymid), (this.length = t.length), (this.massCenter = t.massCenter || [0, 0]), (this.mass = t.mass || 1); } return ( (t.prototype.getLength = function () { return this.length; }), (t.prototype.contains = function (t, e) { var i = this.length / 2; return ( t <= this.xmid + i && t >= this.xmid - i && e <= this.ymid + i && e >= this.ymid - i ); }), (t.prototype.NW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.NE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.SW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), (t.prototype.SE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), t ); })(); e.default = r; }, 400: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.body = null), (this.quad = null), (this.NW = null), (this.NE = null), (this.SW = null), (this.SE = null), (this.theta = 0.5), null != t && (this.quad = t); } return ( (t.prototype.insert = function (e) { null != this.body ? this._isExternal() ? (this.quad && ((this.NW = new t(this.quad.NW())), (this.NE = new t(this.quad.NE())), (this.SW = new t(this.quad.SW())), (this.SE = new t(this.quad.SE()))), this._putBody(this.body), this._putBody(e), (this.body = this.body.add(e))) : ((this.body = this.body.add(e)), this._putBody(e)) : (this.body = e); }), (t.prototype._putBody = function (t) { this.quad && (t.in(this.quad.NW()) && this.NW ? this.NW.insert(t) : t.in(this.quad.NE()) && this.NE ? this.NE.insert(t) : t.in(this.quad.SW()) && this.SW ? this.SW.insert(t) : t.in(this.quad.SE()) && this.SE && this.SE.insert(t)); }), (t.prototype._isExternal = function () { return ( null == this.NW && null == this.NE && null == this.SW && null == this.SE ); }), (t.prototype.updateForce = function (t) { null != this.body && t !== this.body && (this._isExternal() || (this.quad ? this.quad.getLength() : 0) / this.body.distanceTo(t) < this.theta ? t.addForce(this.body) : (this.NW && this.NW.updateForce(t), this.NE && this.NE.updateForce(t), this.SW && this.SW.updateForce(t), this.SE && this.SE.updateForce(t))); }), t ); })(); e.default = r; }, 7: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=forceAtlas2Layout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/forceLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 401)) ); })({ 10: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, 11: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, 13: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, 14: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, 15: function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, 16: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, 167: function (t, n, e) { "use strict"; e.r(n), e.d(n, "forceCenter", function () { return r; }), e.d(n, "forceCollide", function () { return v; }), e.d(n, "forceLink", function () { return b; }), e.d(n, "forceManyBody", function () { return V; }), e.d(n, "forceRadial", function () { return Z; }), e.d(n, "forceSimulation", function () { return Q; }), e.d(n, "forceX", function () { return $; }), e.d(n, "forceY", function () { return tt; }); var r = function (t, n) { var e, r = 1; function o() { var o, i, u = e.length, c = 0, f = 0; for (o = 0; o < u; ++o) (c += (i = e[o]).x), (f += i.y); for (c = (c / u - t) * r, f = (f / u - n) * r, o = 0; o < u; ++o) ((i = e[o]).x -= c), (i.y -= f); } return ( null == t && (t = 0), null == n && (n = 0), (o.initialize = function (t) { e = t; }), (o.x = function (n) { return arguments.length ? ((t = +n), o) : t; }), (o.y = function (t) { return arguments.length ? ((n = +t), o) : n; }), (o.strength = function (t) { return arguments.length ? ((r = +t), o) : r; }), o ); }; function o(t, n, e, r) { if (isNaN(n) || isNaN(e)) return t; var o, i, u, c, f, a, l, s, h, d = t._root, y = { data: r }, p = t._x0, v = t._y0, g = t._x1, _ = t._y1; if (!d) return (t._root = y), t; for (; d.length; ) if ( ((a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u), (o = d), !(d = d[(s = (l << 1) | a)])) ) return (o[s] = y), t; if ( ((c = +t._x.call(null, d.data)), (f = +t._y.call(null, d.data)), n === c && e === f) ) return (y.next = d), o ? (o[s] = y) : (t._root = y), t; do { (o = o ? (o[s] = new Array(4)) : (t._root = new Array(4))), (a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u); } while ((s = (l << 1) | a) == (h = ((f >= u) << 1) | (c >= i))); return (o[h] = d), (o[s] = y), t; } var i = function (t, n, e, r, o) { (this.node = t), (this.x0 = n), (this.y0 = e), (this.x1 = r), (this.y1 = o); }; function u(t) { return t[0]; } function c(t) { return t[1]; } function f(t, n, e) { var r = new a(null == n ? u : n, null == e ? c : e, NaN, NaN, NaN, NaN); return null == t ? r : r.addAll(t); } function a(t, n, e, r, o, i) { (this._x = t), (this._y = n), (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), (this._root = void 0); } function l(t) { for (var n = { data: t.data }, e = n; (t = t.next); ) e = e.next = { data: t.data }; return n; } var s = (f.prototype = a.prototype); (s.copy = function () { var t, n, e = new a(this._x, this._y, this._x0, this._y0, this._x1, this._y1), r = this._root; if (!r) return e; if (!r.length) return (e._root = l(r)), e; for ( t = [{ source: r, target: (e._root = new Array(4)) }]; (r = t.pop()); ) for (var o = 0; o < 4; ++o) (n = r.source[o]) && (n.length ? t.push({ source: n, target: (r.target[o] = new Array(4)) }) : (r.target[o] = l(n))); return e; }), (s.add = function (t) { var n = +this._x.call(null, t), e = +this._y.call(null, t); return o(this.cover(n, e), n, e, t); }), (s.addAll = function (t) { var n, e, r, i, u = t.length, c = new Array(u), f = new Array(u), a = 1 / 0, l = 1 / 0, s = -1 / 0, h = -1 / 0; for (e = 0; e < u; ++e) isNaN((r = +this._x.call(null, (n = t[e])))) || isNaN((i = +this._y.call(null, n))) || ((c[e] = r), (f[e] = i), r < a && (a = r), r > s && (s = r), i < l && (l = i), i > h && (h = i)); if (a > s || l > h) return this; for (this.cover(a, l).cover(s, h), e = 0; e < u; ++e) o(this, c[e], f[e], t[e]); return this; }), (s.cover = function (t, n) { if (isNaN((t = +t)) || isNaN((n = +n))) return this; var e = this._x0, r = this._y0, o = this._x1, i = this._y1; if (isNaN(e)) (o = (e = Math.floor(t)) + 1), (i = (r = Math.floor(n)) + 1); else { for ( var u, c, f = o - e || 1, a = this._root; e > t || t >= o || r > n || n >= i; ) switch ( ((c = ((n < r) << 1) | (t < e)), ((u = new Array(4))[c] = a), (a = u), (f *= 2), c) ) { case 0: (o = e + f), (i = r + f); break; case 1: (e = o - f), (i = r + f); break; case 2: (o = e + f), (r = i - f); break; case 3: (e = o - f), (r = i - f); } this._root && this._root.length && (this._root = a); } return ( (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), this ); }), (s.data = function () { var t = []; return ( this.visit(function (n) { if (!n.length) do { t.push(n.data); } while ((n = n.next)); }), t ); }), (s.extent = function (t) { return arguments.length ? this.cover(+t[0][0], +t[0][1]).cover(+t[1][0], +t[1][1]) : isNaN(this._x0) ? void 0 : [ [this._x0, this._y0], [this._x1, this._y1], ]; }), (s.find = function (t, n, e) { var r, o, u, c, f, a, l, s = this._x0, h = this._y0, d = this._x1, y = this._y1, p = [], v = this._root; for ( v && p.push(new i(v, s, h, d, y)), null == e ? (e = 1 / 0) : ((s = t - e), (h = n - e), (d = t + e), (y = n + e), (e *= e)); (a = p.pop()); ) if ( !( !(v = a.node) || (o = a.x0) > d || (u = a.y0) > y || (c = a.x1) < s || (f = a.y1) < h ) ) if (v.length) { var g = (o + c) / 2, _ = (u + f) / 2; p.push( new i(v[3], g, _, c, f), new i(v[2], o, _, g, f), new i(v[1], g, u, c, _), new i(v[0], o, u, g, _), ), (l = ((n >= _) << 1) | (t >= g)) && ((a = p[p.length - 1]), (p[p.length - 1] = p[p.length - 1 - l]), (p[p.length - 1 - l] = a)); } else { var x = t - +this._x.call(null, v.data), b = n - +this._y.call(null, v.data), w = x * x + b * b; if (w < e) { var m = Math.sqrt((e = w)); (s = t - m), (h = n - m), (d = t + m), (y = n + m), (r = v.data); } } return r; }), (s.remove = function (t) { if ( isNaN((i = +this._x.call(null, t))) || isNaN((u = +this._y.call(null, t))) ) return this; var n, e, r, o, i, u, c, f, a, l, s, h, d = this._root, y = this._x0, p = this._y0, v = this._x1, g = this._y1; if (!d) return this; if (d.length) for (;;) { if ( ((a = i >= (c = (y + v) / 2)) ? (y = c) : (v = c), (l = u >= (f = (p + g) / 2)) ? (p = f) : (g = f), (n = d), !(d = d[(s = (l << 1) | a)])) ) return this; if (!d.length) break; (n[(s + 1) & 3] || n[(s + 2) & 3] || n[(s + 3) & 3]) && ((e = n), (h = s)); } for (; d.data !== t; ) if (((r = d), !(d = d.next))) return this; return ( (o = d.next) && delete d.next, r ? (o ? (r.next = o) : delete r.next, this) : n ? (o ? (n[s] = o) : delete n[s], (d = n[0] || n[1] || n[2] || n[3]) && d === (n[3] || n[2] || n[1] || n[0]) && !d.length && (e ? (e[h] = d) : (this._root = d)), this) : ((this._root = o), this) ); }), (s.removeAll = function (t) { for (var n = 0, e = t.length; n < e; ++n) this.remove(t[n]); return this; }), (s.root = function () { return this._root; }), (s.size = function () { var t = 0; return ( this.visit(function (n) { if (!n.length) do { ++t; } while ((n = n.next)); }), t ); }), (s.visit = function (t) { var n, e, r, o, u, c, f = [], a = this._root; for ( a && f.push(new i(a, this._x0, this._y0, this._x1, this._y1)); (n = f.pop()); ) if ( !t( (a = n.node), (r = n.x0), (o = n.y0), (u = n.x1), (c = n.y1), ) && a.length ) { var l = (r + u) / 2, s = (o + c) / 2; (e = a[3]) && f.push(new i(e, l, s, u, c)), (e = a[2]) && f.push(new i(e, r, s, l, c)), (e = a[1]) && f.push(new i(e, l, o, u, s)), (e = a[0]) && f.push(new i(e, r, o, l, s)); } return this; }), (s.visitAfter = function (t) { var n, e = [], r = []; for ( this._root && e.push(new i(this._root, this._x0, this._y0, this._x1, this._y1)); (n = e.pop()); ) { var o = n.node; if (o.length) { var u, c = n.x0, f = n.y0, a = n.x1, l = n.y1, s = (c + a) / 2, h = (f + l) / 2; (u = o[0]) && e.push(new i(u, c, f, s, h)), (u = o[1]) && e.push(new i(u, s, f, a, h)), (u = o[2]) && e.push(new i(u, c, h, s, l)), (u = o[3]) && e.push(new i(u, s, h, a, l)); } r.push(n); } for (; (n = r.pop()); ) t(n.node, n.x0, n.y0, n.x1, n.y1); return this; }), (s.x = function (t) { return arguments.length ? ((this._x = t), this) : this._x; }), (s.y = function (t) { return arguments.length ? ((this._y = t), this) : this._y; }); var h = function (t) { return function () { return t; }; }, d = function (t) { return 1e-6 * (t() - 0.5); }; function y(t) { return t.x + t.vx; } function p(t) { return t.y + t.vy; } var v = function (t) { var n, e, r, o = 1, i = 1; function u() { for (var t, u, a, l, s, h, v, g = n.length, _ = 0; _ < i; ++_) for (u = f(n, y, p).visitAfter(c), t = 0; t < g; ++t) (a = n[t]), (h = e[a.index]), (v = h * h), (l = a.x + a.vx), (s = a.y + a.vy), u.visit(x); function x(t, n, e, i, u) { var c = t.data, f = t.r, y = h + f; if (!c) return n > l + y || i < l - y || e > s + y || u < s - y; if (c.index > a.index) { var p = l - c.x - c.vx, g = s - c.y - c.vy, _ = p * p + g * g; _ < y * y && (0 === p && (_ += (p = d(r)) * p), 0 === g && (_ += (g = d(r)) * g), (_ = ((y - (_ = Math.sqrt(_))) / _) * o), (a.vx += (p *= _) * (y = (f *= f) / (v + f))), (a.vy += (g *= _) * y), (c.vx -= p * (y = 1 - y)), (c.vy -= g * y)); } } } function c(t) { if (t.data) return (t.r = e[t.data.index]); for (var n = (t.r = 0); n < 4; ++n) t[n] && t[n].r > t.r && (t.r = t[n].r); } function a() { if (n) { var r, o, i = n.length; for (e = new Array(i), r = 0; r < i; ++r) (o = n[r]), (e[o.index] = +t(o, r, n)); } } return ( "function" != typeof t && (t = h(null == t ? 1 : +t)), (u.initialize = function (t, e) { (n = t), (r = e), a(); }), (u.iterations = function (t) { return arguments.length ? ((i = +t), u) : i; }), (u.strength = function (t) { return arguments.length ? ((o = +t), u) : o; }), (u.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), a(), u) : t; }), u ); }; function g(t) { return (g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function _(t) { return t.index; } function x(t, n) { var e = t.get(n); if (!e) throw new Error("node not found: " + n); return e; } var b = function (t) { var n, e, r, o, i, u, c = _, f = function (t) { return 1 / Math.min(o[t.source.index], o[t.target.index]); }, a = h(30), l = 1; function s(r) { for (var o = 0, c = t.length; o < l; ++o) for (var f, a, s, h, y, p, v, g = 0; g < c; ++g) (a = (f = t[g]).source), (h = (s = f.target).x + s.vx - a.x - a.vx || d(u)), (y = s.y + s.vy - a.y - a.vy || d(u)), (h *= p = (((p = Math.sqrt(h * h + y * y)) - e[g]) / p) * r * n[g]), (y *= p), (s.vx -= h * (v = i[g])), (s.vy -= y * v), (a.vx += h * (v = 1 - v)), (a.vy += y * v); } function y() { if (r) { var u, f, a = r.length, l = t.length, s = new Map( r.map(function (t, n) { return [c(t, n, r), t]; }), ); for (u = 0, o = new Array(a); u < l; ++u) ((f = t[u]).index = u), "object" !== g(f.source) && (f.source = x(s, f.source)), "object" !== g(f.target) && (f.target = x(s, f.target)), (o[f.source.index] = (o[f.source.index] || 0) + 1), (o[f.target.index] = (o[f.target.index] || 0) + 1); for (u = 0, i = new Array(l); u < l; ++u) (f = t[u]), (i[u] = o[f.source.index] / (o[f.source.index] + o[f.target.index])); (n = new Array(l)), p(), (e = new Array(l)), v(); } } function p() { if (r) for (var e = 0, o = t.length; e < o; ++e) n[e] = +f(t[e], e, t); } function v() { if (r) for (var n = 0, o = t.length; n < o; ++n) e[n] = +a(t[n], n, t); } return ( null == t && (t = []), (s.initialize = function (t, n) { (r = t), (u = n), y(); }), (s.links = function (n) { return arguments.length ? ((t = n), y(), s) : t; }), (s.id = function (t) { return arguments.length ? ((c = t), s) : c; }), (s.iterations = function (t) { return arguments.length ? ((l = +t), s) : l; }), (s.strength = function (t) { return arguments.length ? ((f = "function" == typeof t ? t : h(+t)), p(), s) : f; }), (s.distance = function (t) { return arguments.length ? ((a = "function" == typeof t ? t : h(+t)), v(), s) : a; }), s ); }, w = { value: function () {} }; function m() { for (var t, n = 0, e = arguments.length, r = {}; n < e; ++n) { if (!(t = arguments[n] + "") || t in r || /[\s.]/.test(t)) throw new Error("illegal type: " + t); r[t] = []; } return new S(r); } function S(t) { this._ = t; } function N(t, n) { return t .trim() .split(/^|\s+/) .map(function (t) { var e = "", r = t.indexOf("."); if ( (r >= 0 && ((e = t.slice(r + 1)), (t = t.slice(0, r))), t && !n.hasOwnProperty(t)) ) throw new Error("unknown type: " + t); return { type: t, name: e }; }); } function O(t, n) { for (var e, r = 0, o = t.length; r < o; ++r) if ((e = t[r]).name === n) return e.value; } function k(t, n, e) { for (var r = 0, o = t.length; r < o; ++r) if (t[r].name === n) { (t[r] = w), (t = t.slice(0, r).concat(t.slice(r + 1))); break; } return null != e && t.push({ name: n, value: e }), t; } S.prototype = m.prototype = { constructor: S, on: function (t, n) { var e, r = this._, o = N(t + "", r), i = -1, u = o.length; if (!(arguments.length < 2)) { if (null != n && "function" != typeof n) throw new Error("invalid callback: " + n); for (; ++i < u; ) if ((e = (t = o[i]).type)) r[e] = k(r[e], t.name, n); else if (null == n) for (e in r) r[e] = k(r[e], t.name, null); return this; } for (; ++i < u; ) if ((e = (t = o[i]).type) && (e = O(r[e], t.name))) return e; }, copy: function () { var t = {}, n = this._; for (var e in n) t[e] = n[e].slice(); return new S(t); }, call: function (t, n) { if ((e = arguments.length - 2) > 0) for (var e, r, o = new Array(e), i = 0; i < e; ++i) o[i] = arguments[i + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (i = 0, e = (r = this._[t]).length; i < e; ++i) r[i].value.apply(n, o); }, apply: function (t, n, e) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], o = 0, i = r.length; o < i; ++o) r[o].value.apply(n, e); }, }; var M = m; function j(t) { return (j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var E, A, P = 0, z = 0, D = 0, T = 0, L = 0, F = 0, U = "object" === ("undefined" == typeof performance ? "undefined" : j(performance)) && performance.now ? performance : Date, C = "object" === ("undefined" == typeof window ? "undefined" : j(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function q() { return L || (C(B), (L = U.now() + F)); } function B() { L = 0; } function Y() { this._call = this._time = this._next = null; } function R(t, n, e) { var r = new Y(); return r.restart(t, n, e), r; } function G() { (L = (T = U.now()) + F), (P = z = 0); try { !(function () { q(), ++P; for (var t, n = E; n; ) (t = L - n._time) >= 0 && n._call.call(null, t), (n = n._next); --P; })(); } finally { (P = 0), (function () { var t, n, e = E, r = 1 / 0; for (; e; ) e._call ? (r > e._time && (r = e._time), (t = e), (e = e._next)) : ((n = e._next), (e._next = null), (e = t ? (t._next = n) : (E = n))); (A = t), W(r); })(), (L = 0); } } function I() { var t = U.now(), n = t - T; n > 1e3 && ((F -= n), (T = t)); } function W(t) { P || (z && (z = clearTimeout(z)), t - L > 24 ? (t < 1 / 0 && (z = setTimeout(G, t - U.now() - F)), D && (D = clearInterval(D))) : (D || ((T = U.now()), (D = setInterval(I, 1e3))), (P = 1), C(G))); } Y.prototype = R.prototype = { constructor: Y, restart: function (t, n, e) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (e = (null == e ? q() : +e) + (null == n ? 0 : +n)), this._next || A === this || (A ? (A._next = this) : (E = this), (A = this)), (this._call = t), (this._time = e), W(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), W()); }, }; var X = 4294967296; function K(t) { return t.x; } function H(t) { return t.y; } var J = Math.PI * (3 - Math.sqrt(5)), Q = function (t) { var n, e, r = 1, o = 0.001, i = 1 - Math.pow(o, 1 / 300), u = 0, c = 0.6, f = new Map(), a = R(h), l = M("tick", "end"), s = ((e = 1), function () { return (e = (1664525 * e + 1013904223) % X) / X; }); function h() { d(), l.call("tick", n), r < o && (a.stop(), l.call("end", n)); } function d(e) { var o, a, l = t.length; void 0 === e && (e = 1); for (var s = 0; s < e; ++s) for ( r += (u - r) * i, f.forEach(function (t) { t(r); }), o = 0; o < l; ++o ) null == (a = t[o]).fx ? (a.x += a.vx *= c) : ((a.x = a.fx), (a.vx = 0)), null == a.fy ? (a.y += a.vy *= c) : ((a.y = a.fy), (a.vy = 0)); return n; } function y() { for (var n, e = 0, r = t.length; e < r; ++e) { if ( (((n = t[e]).index = e), null != n.fx && (n.x = n.fx), null != n.fy && (n.y = n.fy), isNaN(n.x) || isNaN(n.y)) ) { var o = 10 * Math.sqrt(0.5 + e), i = e * J; (n.x = o * Math.cos(i)), (n.y = o * Math.sin(i)); } (isNaN(n.vx) || isNaN(n.vy)) && (n.vx = n.vy = 0); } } function p(n) { return n.initialize && n.initialize(t, s), n; } return ( null == t && (t = []), y(), (n = { tick: d, restart: function () { return a.restart(h), n; }, stop: function () { return a.stop(), n; }, nodes: function (e) { return arguments.length ? ((t = e), y(), f.forEach(p), n) : t; }, alpha: function (t) { return arguments.length ? ((r = +t), n) : r; }, alphaMin: function (t) { return arguments.length ? ((o = +t), n) : o; }, alphaDecay: function (t) { return arguments.length ? ((i = +t), n) : +i; }, alphaTarget: function (t) { return arguments.length ? ((u = +t), n) : u; }, velocityDecay: function (t) { return arguments.length ? ((c = 1 - t), n) : 1 - c; }, randomSource: function (t) { return arguments.length ? ((s = t), f.forEach(p), n) : s; }, force: function (t, e) { return arguments.length > 1 ? (null == e ? f.delete(t) : f.set(t, p(e)), n) : f.get(t); }, find: function (n, e, r) { var o, i, u, c, f, a = 0, l = t.length; for (null == r ? (r = 1 / 0) : (r *= r), a = 0; a < l; ++a) (u = (o = n - (c = t[a]).x) * o + (i = e - c.y) * i) < r && ((f = c), (r = u)); return f; }, on: function (t, e) { return arguments.length > 1 ? (l.on(t, e), n) : l.on(t); }, }) ); }, V = function () { var t, n, e, r, o, i = h(-30), u = 1, c = 1 / 0, a = 0.81; function l(e) { var o, i = t.length, u = f(t, K, H).visitAfter(y); for (r = e, o = 0; o < i; ++o) (n = t[o]), u.visit(p); } function s() { if (t) { var n, e, r = t.length; for (o = new Array(r), n = 0; n < r; ++n) (e = t[n]), (o[e.index] = +i(e, n, t)); } } function y(t) { var n, e, r, i, u, c = 0, f = 0; if (t.length) { for (r = i = u = 0; u < 4; ++u) (n = t[u]) && (e = Math.abs(n.value)) && ((c += n.value), (f += e), (r += e * n.x), (i += e * n.y)); (t.x = r / f), (t.y = i / f); } else { ((n = t).x = n.data.x), (n.y = n.data.y); do { c += o[n.data.index]; } while ((n = n.next)); } t.value = c; } function p(t, i, f, l) { if (!t.value) return !0; var s = t.x - n.x, h = t.y - n.y, y = l - i, p = s * s + h * h; if ((y * y) / a < p) return ( p < c && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p)), (n.vx += (s * t.value * r) / p), (n.vy += (h * t.value * r) / p)), !0 ); if (!(t.length || p >= c)) { (t.data !== n || t.next) && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p))); do { t.data !== n && ((y = (o[t.data.index] * r) / p), (n.vx += s * y), (n.vy += h * y)); } while ((t = t.next)); } } return ( (l.initialize = function (n, r) { (t = n), (e = r), s(); }), (l.strength = function (t) { return arguments.length ? ((i = "function" == typeof t ? t : h(+t)), s(), l) : i; }), (l.distanceMin = function (t) { return arguments.length ? ((u = t * t), l) : Math.sqrt(u); }), (l.distanceMax = function (t) { return arguments.length ? ((c = t * t), l) : Math.sqrt(c); }), (l.theta = function (t) { return arguments.length ? ((a = t * t), l) : Math.sqrt(a); }), l ); }, Z = function (t, n, e) { var r, o, i, u = h(0.1); function c(t) { for (var u = 0, c = r.length; u < c; ++u) { var f = r[u], a = f.x - n || 1e-6, l = f.y - e || 1e-6, s = Math.sqrt(a * a + l * l), h = ((i[u] - s) * o[u] * t) / s; (f.vx += a * h), (f.vy += l * h); } } function f() { if (r) { var n, e = r.length; for (o = new Array(e), i = new Array(e), n = 0; n < e; ++n) (i[n] = +t(r[n], n, r)), (o[n] = isNaN(i[n]) ? 0 : +u(r[n], n, r)); } } return ( "function" != typeof t && (t = h(+t)), null == n && (n = 0), null == e && (e = 0), (c.initialize = function (t) { (r = t), f(); }), (c.strength = function (t) { return arguments.length ? ((u = "function" == typeof t ? t : h(+t)), f(), c) : u; }), (c.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), f(), c) : t; }), (c.x = function (t) { return arguments.length ? ((n = +t), c) : n; }), (c.y = function (t) { return arguments.length ? ((e = +t), c) : e; }), c ); }, $ = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vx += (r[i] - o.x) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.x = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }, tt = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vy += (r[i] - o.y) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.y = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }; }, 176: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(402), n); }, 401: function (t, n, e) { "use strict"; e.r(n); var r = e(176); n.default = r.ForceLayout; }, 402: function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), u = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), c = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && i(n, t, e); return u(n, t), n; }, f = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.ForceLayout = void 0); var a = c(e(167)), l = f(e(403)), s = e(10), h = e(7), d = e(404), y = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.nodeStrength = null), (e.edgeStrength = null), (e.preventOverlap = !1), (e.clusterNodeStrength = null), (e.clusterEdgeStrength = null), (e.clusterEdgeDistance = null), (e.clusterNodeSize = null), (e.clusterFociStrength = null), (e.linkDistance = 50), (e.alphaDecay = 0.028), (e.alphaMin = 0.001), (e.alpha = 0.3), (e.collideStrength = 1), (e.workerEnabled = !1), (e.tick = function () {}), (e.onLayoutEnd = function () {}), (e.ticking = void 0), n && e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { center: [0, 0], nodeStrength: null, edgeStrength: null, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, linkDistance: 50, forceSimulation: null, alphaDecay: 0.028, alphaMin: 0.001, alpha: 0.3, collideStrength: 1, clustering: !1, clusterNodeStrength: -1, clusterEdgeStrength: 0.1, clusterEdgeDistance: 100, clusterFociStrength: 0.8, clusterNodeSize: 10, tick: function () {}, onLayoutEnd: function () {}, workerEnabled: !1, }; }), (n.prototype.init = function (t) { this.nodes = t.nodes || []; var n = t.edges || []; (this.edges = n.map(function (t) { var n = {}, e = ["targetNode", "sourceNode", "startPoint", "endPoint"]; return ( Object.keys(t).forEach(function (r) { e.indexOf(r) > -1 || (n[r] = t[r]); }), n ); })), (this.ticking = !1); }), (n.prototype.execute = function (t) { var n = this, e = n.nodes, r = n.edges; if (!n.ticking) { var o = n.forceSimulation, i = n.alphaMin, u = n.alphaDecay, c = n.alpha; if (o) { if (t) if ( (n.clustering && n.clusterForce && (n.clusterForce.nodes(e), n.clusterForce.links(r)), o.nodes(e), r && n.edgeForce) ) n.edgeForce.links(r); else if (r && !n.edgeForce) { h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } n.preventOverlap && n.overlapProcess(o), o.alpha(c).restart(), (this.ticking = !0); } else try { var f = a.forceManyBody(); if ( (n.nodeStrength && f.strength(n.nodeStrength), (o = a.forceSimulation().nodes(e)), n.clustering) ) { var s = l.default(); s .centerX(n.center[0]) .centerY(n.center[1]) .template("force") .strength(n.clusterFociStrength), r && s.links(r), e && s.nodes(e), s .forceLinkDistance(n.clusterEdgeDistance) .forceLinkStrength(n.clusterEdgeStrength) .forceCharge(n.clusterNodeStrength) .forceNodeSize(n.clusterNodeSize), (n.clusterForce = s), o.force("group", s); } if ( (o .force( "center", a.forceCenter(n.center[0], n.center[1]), ) .force("charge", f) .alpha(c) .alphaDecay(u) .alphaMin(i), n.preventOverlap && n.overlapProcess(o), r) ) { var h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } if ( (n.workerEnabled && !p() && ((n.workerEnabled = !1), console.warn( "workerEnabled option is only supported when running in web worker.", )), n.workerEnabled) ) { o.stop(); for ( var y = (function (t) { var n = t.alphaMin(), e = t.alphaTarget(), r = t.alpha(), o = Math.log((n - e) / (r - e)) / Math.log(1 - t.alphaDecay()); return Math.ceil(o); })(o), v = 1; v <= y; v++ ) o.tick(), postMessage( { nodes: e, currentTick: v, totalTicks: y, type: d.LAYOUT_MESSAGE.TICK, }, void 0, ); n.ticking = !1; } else o .on("tick", function () { n.tick(); }) .on("end", function () { (n.ticking = !1), n.onLayoutEnd && n.onLayoutEnd(); }), (n.ticking = !0); (n.forceSimulation = o), (n.ticking = !0); } catch (t) { (n.ticking = !1), console.warn(t); } } }), (n.prototype.overlapProcess = function (t) { var n, e, r = this.nodeSize, o = this.nodeSpacing, i = this.collideStrength; if ( ((e = s.isNumber(o) ? function () { return o; } : s.isFunction(o) ? o : function () { return 0; }), r) ) if (s.isFunction(r)) n = function (t) { return r(t) + e(t); }; else if (s.isArray(r)) { var u = (r[0] > r[1] ? r[0] : r[1]) / 2; n = function (t) { return u + e(t); }; } else if (s.isNumber(r)) { var c = r / 2; n = function (t) { return c + e(t); }; } else n = function () { return 10; }; else n = function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) / 2 + e(t) : t.size / 2 + e(t) : 10 + e(t); }; t.force("collisionForce", a.forceCollide(n).strength(i)); }), (n.prototype.updateCfg = function (t) { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.forceSimulation = null), Object.assign(this, t); }), (n.prototype.destroy = function () { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), n ); })(h.Base); function p() { return ( "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope ); } n.ForceLayout = y; }, 403: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), i = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && r(n, t, e); return o(n, t), n; }; Object.defineProperty(n, "__esModule", { value: !0 }); var u = i(e(167)); n.default = function () { function t(t) { return function () { return t; }; } var n, e = function (t) { return t.cluster; }, r = t(1), o = t(-1), i = t(100), c = t(0.1), f = [0, 0], a = [], l = {}, s = [], h = 100, d = 100, y = { none: { x: 0, y: 0 } }, p = [], v = "force", g = !0, _ = 0.1; function x(t) { if (!g) return x; n.tick(), w(); for (var r = 0, o = a.length, i = void 0, u = t * _; r < o; ++r) ((i = a[r]).vx += (y[e(i)].x - i.x) * u), (i.vy += (y[e(i)].y - i.y) * u); } function b() { a && (function () { if (!a || !a.length) return; if (void 0 === e(a[0])) throw Error( "Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()", ); var t = ((y = []), (v = []), (g = {}), (_ = []), (f = (function (t) { var n = {}; return ( t.forEach(function (t) { var r = e(t); n[r] || (n[r] = { count: 0, sumforceNodeSize: 0 }); }), t.forEach(function (t) { var o = e(t), i = r(t), u = n[o]; (u.count = u.count + 1), (u.sumforceNodeSize = u.sumforceNodeSize + Math.PI * (i * i) * 1.3), (n[o] = u); }), n ); })(a)), (_ = (function (t) { var n = {}, r = []; return ( t.forEach(function (t) { var r = (function (t) { var n = e(l[t.source]), r = e(l[t.target]); return n <= r ? n + "~" + r : r + "~" + n; })(t), o = 0; void 0 !== n[r] && (o = n[r]), (o += 1), (n[r] = o); }), Object.entries(n).forEach(function (t) { var n = t[0], e = t[1], o = n.split("~")[0], i = n.split("~")[1]; void 0 !== o && void 0 !== i && r.push({ source: o, target: i, count: e }); }), r ); })(s)), Object.keys(f).forEach(function (t, n) { var e = f[t]; y.push({ id: t, size: e.count, r: Math.sqrt(e.sumforceNodeSize / Math.PI), }), (g[t] = n); }), _.forEach(function (t) { var n = g[t.source], e = g[t.target]; void 0 !== n && void 0 !== e && v.push({ source: n, target: e, count: t.count }); }), { nodes: y, links: v }); var f, y, v, g, _; (n = u .forceSimulation(t.nodes) .force("x", u.forceX(h).strength(0.1)) .force("y", u.forceY(d).strength(0.1)) .force( "collide", u .forceCollide(function (t) { return t.r; }) .iterations(4), ) .force("charge", u.forceManyBody().strength(o)) .force( "links", u .forceLink(t.nodes.length ? t.links : []) .distance(i) .strength(c), )), (p = n.nodes()), w(); })(); } function w() { return ( (y = { none: { x: 0, y: 0 } }), p.forEach(function (t) { y[t.id] = { x: t.x - f[0], y: t.y - f[1] }; }), y ); } function m(t) { (l = {}), t.forEach(function (t) { l[t.id] = t; }); } return ( (x.initialize = function (t) { (a = t), b(); }), (x.template = function (t) { return arguments.length ? ((v = t), b(), x) : v; }), (x.groupBy = function (t) { return arguments.length ? "string" == typeof t ? ((e = function (n) { return n[t]; }), x) : ((e = t), x) : e; }), (x.enableGrouping = function (t) { return arguments.length ? ((g = t), x) : g; }), (x.strength = function (t) { return arguments.length ? ((_ = t), x) : _; }), (x.centerX = function (t) { return arguments.length ? ((h = t), x) : h; }), (x.centerY = function (t) { return arguments.length ? ((d = t), x) : d; }), (x.nodes = function (t) { return arguments.length ? (m(t || []), (a = t || []), x) : a; }), (x.links = function (t) { return arguments.length ? ((s = t || []), b(), x) : s; }), (x.forceNodeSize = function (n) { return arguments.length ? ((r = "function" == typeof n ? n : t(+n)), b(), x) : r; }), (x.nodeSize = x.forceNodeSize), (x.forceCharge = function (n) { return arguments.length ? ((o = "function" == typeof n ? n : t(+n)), b(), x) : o; }), (x.forceLinkDistance = function (n) { return arguments.length ? ((i = "function" == typeof n ? n : t(+n)), b(), x) : i; }), (x.forceLinkStrength = function (n) { return arguments.length ? ((c = "function" == typeof n ? n : t(+n)), b(), x) : c; }), (x.offset = function (t) { return arguments.length ? ((f = t), x) : f; }), (x.getFocis = w), x ); }; }, 404: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.LAYOUT_MESSAGE = void 0), (n.LAYOUT_MESSAGE = { RUN: "LAYOUT_RUN", END: "LAYOUT_END", ERROR: "LAYOUT_ERROR", TICK: "LAYOUT_TICK", GPURUN: "GPU_LAYOUT_RUN", GPUEND: "GPU_LAYOUT_END", }); }, 7: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, }).default; }); //# sourceMappingURL=forceLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/fruchtermanLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 405)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], c = i[r]; (o[u][c] = 1), e || (o[c][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 177: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.FruchtermanLayout = void 0); var i = n(7), u = n(10), c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.gravity = 10), (n.speed = 5), (n.clustering = !1), (n.clusterGravity = 10), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), (n.onLayoutEnd = function () {}), (n.tick = function () {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, gravity: 10, speed: 1, clustering: !1, clusterGravity: 10, }; }), (e.prototype.execute = function () { var t = this, e = this.nodes; if ( (void 0 !== this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval), e && 0 !== e.length) ) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var r = {}, o = {}; return ( e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (this.nodeMap = r), (this.nodeIdxMap = o), this.run() ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes; if (e) { var n = t.edges, r = t.maxIteration, o = t.center, i = t.height * t.width, c = Math.sqrt(i) / 10, s = i / (e.length + 1), a = Math.sqrt(s), f = t.gravity, y = t.speed, l = t.clustering, d = {}; if (l) for (var p in (e.forEach(function (t) { if (void 0 === d[t.cluster]) { var e = { name: t.cluster, cx: 0, cy: 0, count: 0 }; d[t.cluster] = e; } var n = d[t.cluster]; u.isNumber(t.x) && (n.cx += t.x), u.isNumber(t.y) && (n.cy += t.y), n.count++; }), d)) (d[p].cx /= d[p].count), (d[p].cy /= d[p].count); if ("undefined" != typeof window) { var h = 0; return ( (this.timeInterval = window.setInterval(function () { if (e) { var i = []; if ( (e.forEach(function (t, e) { i[e] = { x: 0, y: 0 }; }), t.applyCalculate(e, n, i, a, s), l) ) { var p = t.clusterGravity || f; for (var v in (e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = d[t.cluster], r = Math.sqrt( (t.x - n.cx) * (t.x - n.cx) + (t.y - n.cy) * (t.y - n.cy), ), o = a * p; (i[e].x -= (o * (t.x - n.cx)) / r), (i[e].y -= (o * (t.y - n.cy)) / r); } }), d)) (d[v].cx = 0), (d[v].cy = 0), (d[v].count = 0); for (var v in (e.forEach(function (t) { var e = d[t.cluster]; u.isNumber(t.x) && (e.cx += t.x), u.isNumber(t.y) && (e.cy += t.y), e.count++; }), d)) (d[v].cx /= d[v].count), (d[v].cy /= d[v].count); } e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = 0.01 * a * f; (i[e].x -= n * (t.x - o[0])), (i[e].y -= n * (t.y - o[1])); } }), e.forEach(function (t, e) { if (u.isNumber(t.fx) && u.isNumber(t.fy)) return (t.x = t.fx), void (t.y = t.fy); if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = Math.sqrt( i[e].x * i[e].x + i[e].y * i[e].y, ); if (n > 0) { var r = Math.min(c * (y / 800), n); (t.x += (i[e].x / n) * r), (t.y += (i[e].y / n) * r); } } }), t.tick && t.tick(), ++h >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0)), { nodes: e, edges: n } ); } } }), (e.prototype.applyCalculate = function (t, e, n, r, o) { this.calRepulsive(t, n, o), e && this.calAttractive(e, n, r); }), (e.prototype.calRepulsive = function (t, e, n) { t.forEach(function (r, o) { (e[o] = { x: 0, y: 0 }), t.forEach(function (t, i) { if ( o !== i && u.isNumber(r.x) && u.isNumber(t.x) && u.isNumber(r.y) && u.isNumber(t.y) ) { var c = r.x - t.x, s = r.y - t.y, a = c * c + s * s; if (0 === a) { a = 1; var f = o > i ? 1 : -1; (c = 0.01 * f), (s = 0.01 * f); } var y = n / a; (e[o].x += c * y), (e[o].y += s * y); } }); }); }), (e.prototype.calAttractive = function (t, e, n) { var r = this; t.forEach(function (t) { if (t.source && t.target) { var o = r.nodeIdxMap[t.source], i = r.nodeIdxMap[t.target]; if (o !== i) { var c = r.nodeMap[t.source], s = r.nodeMap[t.target]; if ( u.isNumber(s.x) && u.isNumber(c.x) && u.isNumber(s.y) && u.isNumber(c.y) ) { var a = s.x - c.x, f = s.y - c.y, y = Math.sqrt(a * a + f * f), l = (y * y) / n; (e[i].x -= (a / y) * l), (e[i].y -= (f / y) * l), (e[o].x += (a / y) * l), (e[o].y += (f / y) * l); } } } }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "fruchterman"; }), e ); })(i.Base); e.FruchtermanLayout = c; }, 405: function (t, e, n) { "use strict"; n.r(e); var r = n(177); e.default = r.FruchtermanLayout; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=fruchtermanLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/gForceLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 406)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], a = i[r]; (o[u][a] = 1), e || (o[a][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 178: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.GForceLayout = void 0); var i = n(7), u = n(10), a = function (t, e) { return t ? u.isNumber(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.edgeStrength = 200), (n.nodeStrength = 1e3), (n.coulombDisScale = 0.005), (n.damping = 0.9), (n.maxSpeed = 1e3), (n.minMovement = 0.5), (n.interval = 0.02), (n.factor = 1), (n.linkDistance = 1), (n.gravity = 10), (n.preventOverlap = !0), (n.tick = function () {}), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 500, gravity: 10, enableTick: !0 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes; if ( (void 0 !== t.timeInterval && "undefined" != typeof window && window.clearInterval(t.timeInterval), e && 0 !== e.length) ) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var n = t.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var r = {}, o = {}; e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (t.nodeMap = r), (t.nodeIdxMap = o), (t.linkDistance = a(t.linkDistance, 1)), (t.nodeStrength = a(t.nodeStrength, 1)), (t.edgeStrength = a(t.edgeStrength, 1)); var i, c = t.nodeSize; if (t.preventOverlap) { var s, f = t.nodeSpacing; (s = u.isNumber(f) ? function () { return f; } : u.isFunction(f) ? f : function () { return 0; }), (i = c ? u.isArray(c) ? function (t) { return (c[0] > c[1] ? c[0] : c[1]) + s(t); } : function (t) { return c + s(t); } : function (t) { return t.size ? u.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + s(t) : t.size + s(t) : 10 + s(t); }); } t.nodeSize = i; var d = t.edges; (t.degrees = u.getDegree(e.length, t.nodeIdxMap, d)), t.getMass || (t.getMass = function (e) { return t.degrees[t.nodeIdxMap[e.id]] || 1; }), t.run(); } else t.onLayoutEnd && t.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes, n = t.edges, r = t.maxIteration; if ("undefined" != typeof window) { var o = 0; this.timeInterval = window.setInterval(function () { var i = [], u = []; if (e) { e.forEach(function (t, e) { (i[2 * e] = 0), (i[2 * e + 1] = 0), (u[2 * e] = 0), (u[2 * e + 1] = 0); }), t.calRepulsive(i, e), n && t.calAttractive(i, n), t.calGravity(i, e); var a = Math.max(0.02, t.interval - 0.002 * o); t.updateVelocity(i, u, a, e); var c = []; e.forEach(function (t) { c.push({ x: t.x, y: t.y }); }), t.updatePosition(u, a, e), t.tick && t.tick(); var s = 0; e.forEach(function (t, e) { var n = t.x - c[e].x, r = t.y - c[e].y; s += Math.sqrt(n * n + r * r); }), (s /= e.length) < t.minMovement && (window.clearInterval(t.timeInterval), t.onLayoutEnd && t.onLayoutEnd()), ++o >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0); } }), (e.prototype.calRepulsive = function (t, e) { var n = this.getMass, r = this.nodeStrength, o = this.factor, i = this.coulombDisScale, u = this.preventOverlap, a = this.nodeSize; e.forEach(function (c, s) { var f = n ? n(c) : 1; e.forEach(function (e, d) { if (!(s >= d)) { var l = c.x - e.x, p = c.y - e.y, y = Math.sqrt(l * l + p * p) + 0.01, h = (y + 0.1) * i, v = l / y, g = p / y, b = (((r(c) + r(e)) / 2) * o) / (h * h), m = n ? n(e) : 1; if ( ((t[2 * s] += v * b), (t[2 * s + 1] += g * b), (t[2 * d] -= v * b), (t[2 * d + 1] -= g * b), u && y < (a(c) + a(e)) / 2) ) { var x = (r(c) + r(e)) / 2 / (y * y); (t[2 * s] += (v * x) / f), (t[2 * s + 1] += (g * x) / f), (t[2 * d] -= (v * x) / m), (t[2 * d + 1] -= (g * x) / m); } } }); }); }), (e.prototype.calAttractive = function (t, e) { var n = this.nodeMap, r = this.nodeIdxMap, o = this.linkDistance, i = this.edgeStrength, u = this.getMass; e.forEach(function (e, a) { var c = n[e.source], s = n[e.target], f = s.x - c.x, d = s.y - c.y, l = Math.sqrt(f * f + d * d) + 0.01, p = f / l, y = d / l, h = ((o(e) || 1) - l) * i(e), v = r[e.source], g = r[e.target], b = u ? u(c) : 1, m = u ? u(s) : 1; (t[2 * v] -= (p * h) / b), (t[2 * v + 1] -= (y * h) / b), (t[2 * g] += (p * h) / m), (t[2 * g + 1] += (y * h) / m); }); }), (e.prototype.calGravity = function (t, e) { for ( var n = this.center, r = this.gravity, o = this.degrees, i = e.length, a = 0; a < i; a++ ) { var c = e[a], s = c.x - n[0], f = c.y - n[1], d = r; if (this.getCenter) { var l = this.getCenter(c, o[a]); l && u.isNumber(l[0]) && u.isNumber(l[1]) && u.isNumber(l[2]) && ((s = c.x - l[0]), (f = c.y - l[1]), (d = l[2])); } d && ((t[2 * a] -= d * s), (t[2 * a + 1] -= d * f)); } }), (e.prototype.updateVelocity = function (t, e, n, r) { var o = this, i = n * o.damping; r.forEach(function (n, r) { var u = t[2 * r] * i || 0.01, a = t[2 * r + 1] * i || 0.01, c = Math.sqrt(u * u + a * a); if (c > o.maxSpeed) { var s = o.maxSpeed / c; (u *= s), (a *= s); } (e[2 * r] = u), (e[2 * r + 1] = a); }); }), (e.prototype.updatePosition = function (t, e, n) { n.forEach(function (n, r) { if (u.isNumber(n.fx) && u.isNumber(n.fy)) return (n.x = n.fx), void (n.y = n.fy); var o = t[2 * r] * e, i = t[2 * r + 1] * e; (n.x += o), (n.y += i); }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "gForce"; }), e ); })(i.Base); e.GForceLayout = c; }, 406: function (t, e, n) { "use strict"; n.r(e); var r = n(178); e.default = r.GForceLayout; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=gForceLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/gridLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 407)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, s = i[o], u = i[r]; (n[s][u] = 1), t || (n[u][s] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 179: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.GridLayout = void 0); var i = o(10), s = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.begin = [0, 0]), (o.preventOverlap = !0), (o.preventOverlapPadding = 10), (o.condense = !1), (o.sortBy = "degree"), (o.nodeSize = 30), (o.nodes = []), (o.edges = []), (o.width = 300), (o.height = 300), (o.row = 0), (o.col = 0), (o.cellWidth = 0), (o.cellHeight = 0), (o.cellUsed = {}), (o.id2manPos = {}), (o.onLayoutEnd = function () {}), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { begin: [0, 0], preventOverlap: !0, preventOverlapPadding: 10, condense: !1, rows: void 0, cols: void 0, position: void 0, sortBy: "degree", nodeSize: 30, }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, o = t.length, r = e.begin; if (0 !== o) { if (1 === o) return ( (t[0].x = r[0]), (t[0].y = r[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var n = e.edges, s = []; t.forEach(function (e) { s.push(e); }); var u = {}; if ( (s.forEach(function (e, t) { u[e.id] = t; }), ("degree" === e.sortBy || !i.isString(e.sortBy) || void 0 === s[0][e.sortBy]) && ((e.sortBy = "degree"), i.isNaN(t[0].degree))) ) { var c = i.getDegree(s.length, u, n); s.forEach(function (e, t) { e.degree = c[t]; }); } s.sort(function (t, o) { return o[e.sortBy] - t[e.sortBy]; }), e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var l = e.rows, a = null != e.cols ? e.cols : e.columns; if ( ((e.cells = o), null != l && null != a ? ((e.rows = l), (e.cols = a)) : null != l && null == a ? ((e.rows = l), (e.cols = Math.ceil(e.cells / e.rows))) : null == l && null != a ? ((e.cols = a), (e.rows = Math.ceil(e.cells / e.cols))) : ((e.splits = Math.sqrt((e.cells * e.height) / e.width)), (e.rows = Math.round(e.splits)), (e.cols = Math.round((e.width / e.height) * e.splits))), e.cols * e.rows > e.cells) ) ((d = e.small()) - 1) * (f = e.large()) >= e.cells ? e.small(d - 1) : (f - 1) * d >= e.cells && e.large(f - 1); else for (; e.cols * e.rows < e.cells; ) { var f, d = e.small(); ((f = e.large()) + 1) * d >= e.cells ? e.large(f + 1) : e.small(d + 1); } (e.cellWidth = e.width / e.cols), (e.cellHeight = e.height / e.rows), e.condense && ((e.cellWidth = 0), (e.cellHeight = 0)), e.preventOverlap && s.forEach(function (t) { var o, r; (t.x && t.y) || ((t.x = 0), (t.y = 0)), i.isArray(t.size) ? ((o = t.size[0]), (r = t.size[1])) : i.isNumber(t.size) && ((o = t.size), (r = t.size)), (void 0 !== o && void 0 !== r) || (i.isArray(e.nodeSize) ? ((o = e.nodeSize[0]), (r = e.nodeSize[1])) : i.isNumber(e.nodeSize) ? ((o = e.nodeSize), (r = e.nodeSize)) : ((o = 30), (r = 30))); var n = e.preventOverlapPadding, s = o + n, u = r + n; (e.cellWidth = Math.max(e.cellWidth, s)), (e.cellHeight = Math.max(e.cellHeight, u)); }), (e.cellUsed = {}), (e.row = 0), (e.col = 0), (e.id2manPos = {}); for (var p = 0; p < s.length; p++) { var h = s[p], y = void 0; if ( (e.position && (y = e.position(h)), y && (void 0 !== y.row || void 0 !== y.col)) ) { var v = { row: y.row, col: y.col }; if (void 0 === v.col) for (v.col = 0; e.used(v.row, v.col); ) v.col++; else if (void 0 === v.row) for (v.row = 0; e.used(v.row, v.col); ) v.row++; (e.id2manPos[h.id] = v), e.use(v.row, v.col); } e.getPos(h); } return e.onLayoutEnd && e.onLayoutEnd(), { edges: n, nodes: s }; } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.small = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.min(o, r)) : Math.min(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.large = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.max(o, r)) : Math.max(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.used = function (e, t) { return this.cellUsed["c-" + e + "-" + t] || !1; }), (t.prototype.use = function (e, t) { this.cellUsed["c-" + e + "-" + t] = !0; }), (t.prototype.moveToNextCell = function () { var e = this.cols || 5; this.col++, this.col >= e && ((this.col = 0), this.row++); }), (t.prototype.getPos = function (e) { var t, o, r = this.begin, n = this.cellWidth, i = this.cellHeight, s = this.id2manPos[e.id]; if (s) (t = s.col * n + n / 2 + r[0]), (o = s.row * i + i / 2 + r[1]); else { for (; this.used(this.row, this.col); ) this.moveToNextCell(); (t = this.col * n + n / 2 + r[0]), (o = this.row * i + i / 2 + r[1]), this.use(this.row, this.col), this.moveToNextCell(); } (e.x = t), (e.y = o); }), (t.prototype.getType = function () { return "grid"; }), t ); })(o(7).Base); t.GridLayout = s; }, 407: function (e, t, o) { "use strict"; o.r(t); var r = o(179); t.default = r.GridLayout; }, 7: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=gridLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/mdsLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.f6 = r()) : (t.f6 = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 408)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 102: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return Q; }), e.d(r, "default", function () { return K; }), e.d(r, "Matrix", function () { return K; }), e.d(r, "MatrixColumnView", function () { return at; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return xt; }), e.d(r, "MatrixFlipRowView", function () { return _t; }), e.d(r, "MatrixRowView", function () { return Vt; }), e.d(r, "MatrixRowSelectionView", function () { return Ut; }), e.d(r, "MatrixSelectionView", function () { return Xt; }), e.d(r, "MatrixSubView", function () { return or; }), e.d(r, "MatrixTransposeView", function () { return cr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return wr; }), e.d(r, "WrapperMatrix2D", function () { return Er; }), e.d(r, "solve", function () { return Vr; }), e.d(r, "inverse", function () { return Ir; }), e.d(r, "determinant", function () { return qr; }), e.d(r, "linearDependencies", function () { return Br; }), e.d(r, "pseudoInverse", function () { return Lr; }), e.d(r, "covariance", function () { return Ur; }), e.d(r, "correlation", function () { return Qr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Hr; }), e.d(r, "EVD", function () { return Hr; }), e.d(r, "CholeskyDecomposition", function () { return re; }), e.d(r, "CHO", function () { return re; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return Tr; }), e.d(r, "QR", function () { return Tr; }), e.d(r, "Nipals", function () { return oe; }), e.d(r, "NIPALS", function () { return oe; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } var i = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; }; var s = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; }; var u = function (t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError( "output option must be an array if specified", ); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; }, a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t) { return (p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function v(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function g(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function w(t, r, e) { return { row: b(t, r), column: d(t, e) }; } function b(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for row indices"); if ( r.some(function (r) { return r < 0 || r >= t.rows; }) ) throw new RangeError("row indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function d(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for column indices"); if ( r.some(function (r) { return r < 0 || r >= t.columns; }) ) throw new RangeError("column indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function M(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (k("startRow", r), k("endRow", e), k("startColumn", o), k("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function x(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function k(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function S(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function E(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function O(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function R(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function P(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function T(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function A(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function C(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function N(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function I(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function V(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function q(t, r) { return (q = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function D(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = B(t); if (r) { var n = B(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return F(this, e); }; } function F(t, r) { return !r || ("object" !== L(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function B(t) { return (B = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function L(t) { return (L = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function z(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function U(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function W(t, r, e) { return r && U(t.prototype, r), e && U(t, e), t; } var Q = (function () { function t() { z(this, t); } return ( W( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new K(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { v(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return K.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { v(this, t), (r = m(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { v(this, t), v(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return K.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = g(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { v(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { S(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { S(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { v(this, t), S(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { v(this, t), S(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), S(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), S(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new K(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = K.checkMatrix(t); var r = new K(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), v = (e + n) * f, y = c + p - v + (n - a) * (u + f), m = l + v, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, y), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = K.checkMatrix(t); var r = new K(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), v = t.get(1, 0), y = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), b = t.get(2, 2), d = (e - i) * (-l + y), M = (-e + i + s) * (h - l + y), x = (i + s) * (-h + l), k = e * h, S = (-e + a + f) * (h - p + m), E = (-e + a) * (p - m), O = (a + f) * (-h + p), R = (-n + f + c) * (y + g - w), j = (n - c) * (y - w), _ = n * g, P = (f + c) * (-g + w), T = (-n + s + u) * (m + g - b), A = (n - u) * (m - b), C = (s + u) * (-g + b), N = k + _ + o * v, I = (e + o + n - i - s - f - c) * y + M + x + k + R + _ + P, V = k + S + O + (e + o + n - s - u - a - f) * m + _ + T + C, q = d + s * (-h + l + v - y - m - g + b) + M + k + _ + T + A, D = d + M + x + k + u * w, F = _ + T + A + C + i * p, B = k + S + E + f * (-h + p + v - y - m - g + w) + R + j + _, L = R + j + _ + P + a * l, z = k + S + E + O + c * b; return ( r.set(0, 0, N), r.set(0, 1, I), r.set(0, 2, V), r.set(1, 0, q), r.set(1, 1, D), r.set(1, 2, F), r.set(2, 0, B), r.set(2, 1, L), r.set(2, 2, z), r ); }, }, { key: "mmulStrassen", value: function (r) { r = K.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), v = o.subMatrix(s, o.rows - 1, 0, a - 1), y = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, y), t.add(c, m), s, a), w = r(t.add(p, y), c, s, a), b = r(f, t.sub(l, m), s, a), d = r(y, t.sub(v, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), k = r(t.sub(h, y), t.add(v, m), s, a), S = t.add(g, d); S.sub(M), S.add(k); var E = t.add(b, M), O = t.add(w, d), R = t.sub(g, w); R.add(b), R.add(x); var j = t.zeros(2 * S.rows, 2 * S.columns); return (j = (j = (j = (j = j.setSubMatrix( S, 0, 0, )).setSubMatrix(E, S.rows, 0)).setSubMatrix( O, 0, S.columns, )).setSubMatrix(R, S.rows, S.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new K(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = K.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(K.eye(e, e)), n = K.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new K(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { M(this, t, r, e, o); for (var n = new K(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new K(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new K(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = K.checkMatrix(t)).isEmpty()) return this; M(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { for ( var e = w(this, t, r), o = new K(t.length, r.length), n = 0; n < e.row.length; n++ ) for (var i = e.row[n], s = 0; s < e.column.length; s++) { var u = e.column[s]; o.set(n, s, this.get(i, u)); } return o; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new K(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, n = void 0 === o || o, i = e.mean, s = void 0 === i ? this.mean(t) : i; if ("boolean" != typeof n) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return E(this, n, s); case "column": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return O(this, n, s); case void 0: if ("number" != typeof s) throw new TypeError("mean must be a number"); return R(this, n, s); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === L(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, n = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return j(this, n), this; case "column": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return _(this, n), this; case void 0: if ("number" != typeof n) throw new TypeError("center must be a number"); return P(this, n), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = T(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return A(this, e), this; case "column": if (void 0 === e) e = C(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return N(this, e), this; case void 0: if (void 0 === e) e = I(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return V(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new K(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new K(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new K(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new K(t, r); }, }, { key: "ones", value: function (t, r) { return new K(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== L(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new K(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== L(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new K(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new K(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new K(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function J(t, r) { return t - r; } (Q.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (Q.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (Q.random = Q.rand), (Q.randomInt = Q.randInt), (Q.diagonal = Q.diag), (Q.prototype.diagonal = Q.prototype.diag), (Q.identity = Q.eye), (Q.prototype.negate = Q.prototype.neg), (Q.prototype.tensorProduct = Q.prototype.kroneckerProduct); var Y, H, K = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && q(t, r); })(e, t); var r = D(e); function e(t, o) { var n; if ((z(this, e), (n = r.call(this)), e.isMatrix(t))) return F(n, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((n.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var i = 0; i < t; i++) n.data.push(new Float64Array(o)); } else { if (!Array.isArray(t)) throw new TypeError( "First argument must be a positive number or an array", ); var s = t; if ("number" != typeof (o = (t = s.length) ? s[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); n.data = []; for (var u = 0; u < t; u++) { if (s[u].length !== o) throw new RangeError("Inconsistent array dimensions"); n.data.push(Float64Array.from(s[u])); } } return (n.rows = t), (n.columns = o), n; } return ( W(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( v(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), v(this, t, !0), (r = Float64Array.from(m(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = g(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(Q); function X(t) { return (X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function G(t, r) { return (G = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Z(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = tt(t); if (r) { var n = tt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return $(this, e); }; } function $(t, r) { return !r || ("object" !== X(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function tt(t) { return (tt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (H = K), ((Y = Q).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (Y.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (Y.prototype.addM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (Y.add = function (t, r) { return new H(t).add(r); }), (Y.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (Y.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (Y.prototype.subM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (Y.sub = function (t, r) { return new H(t).sub(r); }), (Y.prototype.subtract = Y.prototype.sub), (Y.prototype.subtractS = Y.prototype.subS), (Y.prototype.subtractM = Y.prototype.subM), (Y.subtract = Y.sub), (Y.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (Y.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (Y.prototype.mulM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (Y.mul = function (t, r) { return new H(t).mul(r); }), (Y.prototype.multiply = Y.prototype.mul), (Y.prototype.multiplyS = Y.prototype.mulS), (Y.prototype.multiplyM = Y.prototype.mulM), (Y.multiply = Y.mul), (Y.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (Y.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (Y.prototype.divM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (Y.div = function (t, r) { return new H(t).div(r); }), (Y.prototype.divide = Y.prototype.div), (Y.prototype.divideS = Y.prototype.divS), (Y.prototype.divideM = Y.prototype.divM), (Y.divide = Y.div), (Y.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (Y.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (Y.prototype.modM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (Y.mod = function (t, r) { return new H(t).mod(r); }), (Y.prototype.modulus = Y.prototype.mod), (Y.prototype.modulusS = Y.prototype.modS), (Y.prototype.modulusM = Y.prototype.modM), (Y.modulus = Y.mod), (Y.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (Y.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (Y.prototype.andM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (Y.and = function (t, r) { return new H(t).and(r); }), (Y.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (Y.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (Y.prototype.orM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (Y.or = function (t, r) { return new H(t).or(r); }), (Y.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (Y.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (Y.prototype.xorM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (Y.xor = function (t, r) { return new H(t).xor(r); }), (Y.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (Y.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (Y.prototype.leftShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (Y.leftShift = function (t, r) { return new H(t).leftShift(r); }), (Y.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (Y.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (Y.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (Y.signPropagatingRightShift = function (t, r) { return new H(t).signPropagatingRightShift(r); }), (Y.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (Y.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (Y.prototype.rightShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (Y.rightShift = function (t, r) { return new H(t).rightShift(r); }), (Y.prototype.zeroFillRightShift = Y.prototype.rightShift), (Y.prototype.zeroFillRightShiftS = Y.prototype.rightShiftS), (Y.prototype.zeroFillRightShiftM = Y.prototype.rightShiftM), (Y.zeroFillRightShift = Y.rightShift), (Y.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (Y.not = function (t) { return new H(t).not(); }), (Y.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (Y.abs = function (t) { return new H(t).abs(); }), (Y.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (Y.acos = function (t) { return new H(t).acos(); }), (Y.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (Y.acosh = function (t) { return new H(t).acosh(); }), (Y.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (Y.asin = function (t) { return new H(t).asin(); }), (Y.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (Y.asinh = function (t) { return new H(t).asinh(); }), (Y.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (Y.atan = function (t) { return new H(t).atan(); }), (Y.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (Y.atanh = function (t) { return new H(t).atanh(); }), (Y.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (Y.cbrt = function (t) { return new H(t).cbrt(); }), (Y.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (Y.ceil = function (t) { return new H(t).ceil(); }), (Y.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (Y.clz32 = function (t) { return new H(t).clz32(); }), (Y.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (Y.cos = function (t) { return new H(t).cos(); }), (Y.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (Y.cosh = function (t) { return new H(t).cosh(); }), (Y.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (Y.exp = function (t) { return new H(t).exp(); }), (Y.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (Y.expm1 = function (t) { return new H(t).expm1(); }), (Y.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (Y.floor = function (t) { return new H(t).floor(); }), (Y.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (Y.fround = function (t) { return new H(t).fround(); }), (Y.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (Y.log = function (t) { return new H(t).log(); }), (Y.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (Y.log1p = function (t) { return new H(t).log1p(); }), (Y.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (Y.log10 = function (t) { return new H(t).log10(); }), (Y.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (Y.log2 = function (t) { return new H(t).log2(); }), (Y.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (Y.round = function (t) { return new H(t).round(); }), (Y.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (Y.sign = function (t) { return new H(t).sign(); }), (Y.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (Y.sin = function (t) { return new H(t).sin(); }), (Y.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (Y.sinh = function (t) { return new H(t).sinh(); }), (Y.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (Y.sqrt = function (t) { return new H(t).sqrt(); }), (Y.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (Y.tan = function (t) { return new H(t).tan(); }), (Y.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (Y.tanh = function (t) { return new H(t).tanh(); }), (Y.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (Y.trunc = function (t) { return new H(t).trunc(); }), (Y.pow = function (t, r) { return new H(t).pow(r); }), (Y.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (Y.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (Y.prototype.powM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && G(t, r); })(e, t); var r = Z(e); function e(t, o, n) { var i; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, e), ((i = r.call(this)).matrix = t), (i.rows = o), (i.columns = n), i ); } return e; })(Q); function et(t) { return (et = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ot(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function nt(t, r) { return (nt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function it(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ut(t); if (r) { var n = ut(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return st(this, e); }; } function st(t, r) { return !r || ("object" !== et(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function ut(t) { return (ut = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var at = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && nt(t, r); })(i, t); var r, e, o, n = it(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && ot(r.prototype, e), o && ot(r, o), i ); })(rt); function ft(t) { return (ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ct(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ht(t, r) { return (ht = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function lt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = vt(t); if (r) { var n = vt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return pt(this, e); }; } function pt(t, r) { return !r || ("object" !== ft(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function vt(t) { return (vt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && ht(t, r); })(i, t); var r, e, o, n = lt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = d(t, r)), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ct(r.prototype, e), o && ct(r, o), i ); })(rt); function mt(t) { return (mt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function wt(t, r) { return (wt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Mt(t); if (r) { var n = Mt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return dt(this, e); }; } function dt(t, r) { return !r || ("object" !== mt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Mt(t) { return (Mt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && wt(t, r); })(i, t); var r, e, o, n = bt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && gt(r.prototype, e), o && gt(r, o), i ); })(rt); function kt(t) { return (kt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function St(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Et(t, r) { return (Et = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Rt(this, e); }; } function Rt(t, r) { return !r || ("object" !== kt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var _t = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Et(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && St(r.prototype, e), o && St(r, o), i ); })(rt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Tt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ct(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = It(t); if (r) { var n = It(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { return !r || ("object" !== Pt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function It(t) { return (It = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Vt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && At(t, r); })(i, t); var r, e, o, n = Ct(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), v(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && Tt(r.prototype, e), o && Tt(r, o), i ); })(rt); function qt(t) { return (qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Dt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Ft(t, r) { return (Ft = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = zt(t); if (r) { var n = zt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Lt(this, e); }; } function Lt(t, r) { return !r || ("object" !== qt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function zt(t) { return (zt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Ft(t, r); })(i, t); var r, e, o, n = Bt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = b(t, r)), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && Dt(r.prototype, e), o && Dt(r, o), i ); })(rt); function Wt(t) { return (Wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Jt(t, r) { return (Jt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Yt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Kt(t); if (r) { var n = Kt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Ht(this, e); }; } function Ht(t, r) { return !r || ("object" !== Wt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Kt(t) { return (Kt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Jt(t, r); })(i, t); var r, e, o, n = Yt(i); function i(t, r, e) { var o; !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i); var s = w(t, r, e); return ( ((o = n.call(this, t, s.row.length, s.column.length)).rowIndices = s.row), (o.columnIndices = s.column), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Qt(r.prototype, e), o && Qt(r, o), i ); })(rt); function Gt(t) { return (Gt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Zt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function $t(t, r) { return ($t = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function tr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = er(t); if (r) { var n = er(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return rr(this, e); }; } function rr(t, r) { return !r || ("object" !== Gt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function er(t) { return (er = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var or = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && $t(t, r); })(i, t); var r, e, o, n = tr(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), M(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Zt(r.prototype, e), o && Zt(r, o), i ); })(rt); function nr(t) { return (nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function sr(t, r) { return (sr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ur(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = fr(t); if (r) { var n = fr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ar(this, e); }; } function ar(t, r) { return !r || ("object" !== nr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function fr(t) { return (fr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var cr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && sr(t, r); })(i, t); var r, e, o, n = ur(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && ir(r.prototype, e), o && ir(r, o), i ); })(rt); function hr(t) { return (hr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function lr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function vr(t, r) { return (vr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = gr(t); if (r) { var n = gr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return mr(this, e); }; } function mr(t, r) { return !r || ("object" !== hr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function gr(t) { return (gr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var wr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && vr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; lr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && pr(r.prototype, e), o && pr(r, o), i ); })(Q); function br(t) { return (br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function dr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Mr(t, r) { return (Mr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function xr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Sr(t); if (r) { var n = Sr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return kr(this, e); }; } function kr(t, r) { return !r || ("object" !== br(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Sr(t) { return (Sr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Mr(t, r); })(i, t); var r, e, o, n = xr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && dr(r.prototype, e), o && dr(r, o), i ); })(Q); function Or(t, r) { if (Array.isArray(t)) return t[0] && Array.isArray(t[0]) ? new Er(t) : new wr(t, r); throw new Error("the argument is not an array"); } function Rr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Er.checkMatrix(r)).clone(), l = h.rows, p = h.columns, v = new Float64Array(l), y = 1; for (e = 0; e < l; e++) v[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = v[i]), (v[i] = v[o]), (v[o] = a), (y = -y); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = v), (this.pivotSign = y); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Rr(r.prototype, e), o && Rr(r, o), t ); })(); function _r(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Tr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Er.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = _r(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new K(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new K(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), t ); })(); function Ar(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Cr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Ar(this, t), (r = Er.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), v = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (v = !0); var y = l; (l = p), (p = y); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), b = new K(n, m), d = new K(i, i), M = new Float64Array(i), x = new Float64Array(n), k = new Float64Array(g), S = 0; S < g; S++ ) k[S] = S; for ( var E = Math.min(n - 1, i), O = Math.max(0, Math.min(i - 2, n)), R = Math.max(E, O), j = 0; j < R; j++ ) { if (j < E) { w[j] = 0; for (var _ = j; _ < n; _++) w[j] = _r(w[j], o.get(_, j)); if (0 !== w[j]) { o.get(j, j) < 0 && (w[j] = -w[j]); for (var P = j; P < n; P++) o.set(P, j, o.get(P, j) / w[j]); o.set(j, j, o.get(j, j) + 1); } w[j] = -w[j]; } for (var T = j + 1; T < i; T++) { if (j < E && 0 !== w[j]) { for (var A = 0, C = j; C < n; C++) A += o.get(C, j) * o.get(C, T); A = -A / o.get(j, j); for (var N = j; N < n; N++) o.set(N, T, o.get(N, T) + A * o.get(N, j)); } M[T] = o.get(j, T); } if (l && j < E) for (var I = j; I < n; I++) b.set(I, j, o.get(I, j)); if (j < O) { M[j] = 0; for (var V = j + 1; V < i; V++) M[j] = _r(M[j], M[V]); if (0 !== M[j]) { M[j + 1] < 0 && (M[j] = 0 - M[j]); for (var q = j + 1; q < i; q++) M[q] /= M[j]; M[j + 1] += 1; } if (((M[j] = -M[j]), j + 1 < n && 0 !== M[j])) { for (var D = j + 1; D < n; D++) x[D] = 0; for (var F = j + 1; F < n; F++) for (var B = j + 1; B < i; B++) x[F] += M[B] * o.get(F, B); for (var L = j + 1; L < i; L++) for (var z = -M[L] / M[j + 1], U = j + 1; U < n; U++) o.set(U, L, o.get(U, L) + z * x[U]); } if (p) for (var W = j + 1; W < i; W++) d.set(W, j, M[W]); } } var Q = Math.min(i, n + 1); if ( (E < i && (w[E] = o.get(E, E)), n < Q && (w[Q - 1] = 0), O + 1 < Q && (M[O] = o.get(O, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = E; J < m; J++) { for (var Y = 0; Y < n; Y++) b.set(Y, J, 0); b.set(J, J, 1); } for (var H = E - 1; H >= 0; H--) if (0 !== w[H]) { for (var X = H + 1; X < m; X++) { for (var G = 0, Z = H; Z < n; Z++) G += b.get(Z, H) * b.get(Z, X); G = -G / b.get(H, H); for (var $ = H; $ < n; $++) b.set($, X, b.get($, X) + G * b.get($, H)); } for (var tt = H; tt < n; tt++) b.set(tt, H, -b.get(tt, H)); b.set(H, H, 1 + b.get(H, H)); for (var rt = 0; rt < H - 1; rt++) b.set(rt, H, 0); } else { for (var et = 0; et < n; et++) b.set(et, H, 0); b.set(H, H, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < O && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += d.get(st, ot) * d.get(st, nt); it = -it / d.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) d.set(ut, nt, d.get(ut, nt) + it * d.get(ut, ot)); } for (var at = 0; at < i; at++) d.set(at, ot, 0); d.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var vt = void 0; for (vt = Q - 1; vt >= ht && vt !== ht; vt--) { var yt = (vt !== Q ? Math.abs(M[vt]) : 0) + (vt !== ht + 1 ? Math.abs(M[vt - 1]) : 0); if (Math.abs(w[vt]) <= ct * yt) { w[vt] = 0; break; } } vt === ht ? (lt = 3) : vt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = vt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = _r(w[gt], mt), bt = w[gt] / wt, dt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -dt * M[gt - 1]), (M[gt - 1] = bt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = bt * d.get(Mt, gt) + dt * d.get(Mt, Q - 1)), d.set( Mt, Q - 1, -dt * d.get(Mt, gt) + bt * d.get(Mt, Q - 1), ), d.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var kt = ht; kt < Q; kt++) { var St = _r(w[kt], xt), Et = w[kt] / St, Ot = xt / St; if ( ((w[kt] = St), (xt = -Ot * M[kt]), (M[kt] = Et * M[kt]), l) ) for (var Rt = 0; Rt < n; Rt++) (St = Et * b.get(Rt, kt) + Ot * b.get(Rt, ht - 1)), b.set( Rt, ht - 1, -Ot * b.get(Rt, kt) + Et * b.get(Rt, ht - 1), ), b.set(Rt, kt, St); } break; case 3: var jt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), _t = w[Q - 1] / jt, Pt = w[Q - 2] / jt, Tt = M[Q - 2] / jt, At = w[ht] / jt, Ct = M[ht] / jt, Nt = ((Pt + _t) * (Pt - _t) + Tt * Tt) / 2, It = _t * Tt * (_t * Tt), Vt = 0; (0 === Nt && 0 === It) || (Vt = It / (Nt + (Vt = Nt < 0 ? 0 - Math.sqrt(Nt * Nt + It) : Math.sqrt(Nt * Nt + It)))); for ( var qt = (At + _t) * (At - _t) + Vt, Dt = At * Ct, Ft = ht; Ft < Q - 1; Ft++ ) { var Bt = _r(qt, Dt); 0 === Bt && (Bt = Number.MIN_VALUE); var Lt = qt / Bt, zt = Dt / Bt; if ( (Ft !== ht && (M[Ft - 1] = Bt), (qt = Lt * w[Ft] + zt * M[Ft]), (M[Ft] = Lt * M[Ft] - zt * w[Ft]), (Dt = zt * w[Ft + 1]), (w[Ft + 1] = Lt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Bt = Lt * d.get(Ut, Ft) + zt * d.get(Ut, Ft + 1)), d.set( Ut, Ft + 1, -zt * d.get(Ut, Ft) + Lt * d.get(Ut, Ft + 1), ), d.set(Ut, Ft, Bt); if ( (0 === (Bt = _r(qt, Dt)) && (Bt = Number.MIN_VALUE), (Lt = qt / Bt), (zt = Dt / Bt), (w[Ft] = Bt), (qt = Lt * M[Ft] + zt * w[Ft + 1]), (w[Ft + 1] = -zt * M[Ft] + Lt * w[Ft + 1]), (Dt = zt * M[Ft + 1]), (M[Ft + 1] = Lt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Bt = Lt * b.get(Wt, Ft) + zt * b.get(Wt, Ft + 1)), b.set( Wt, Ft + 1, -zt * b.get(Wt, Ft) + Lt * b.get(Wt, Ft + 1), ), b.set(Wt, Ft, Bt); } (M[Q - 2] = qt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) d.set(Qt, ht, -d.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Yt = 0; Yt < i; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); if (l && ht < n - 1) for (var Ht = 0; Ht < n; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); ht++; } 0, Q--; } } if (v) { var Kt = d; (d = b), (b = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = b), (this.V = d); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = K.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = K.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var v = 0, y = 0; y < o; y++) v += a.get(l, y) * s.get(p, y); h.set(l, p, v); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(K.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new K(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new K(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, v = 0; v < f; v++) p += n.get(h, v) * u.get(l, v); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return K.diag(this.s); }, }, ]) && Cr(r.prototype, e), o && Cr(r, o), t ); })(); function Ir(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Er.checkMatrix(t)), r ? new Nr(t).inverse() : Vr(t, K.eye(t.rows)) ); } function Vr(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Er.checkMatrix(t)), (r = Er.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new Tr(t).solve(r) ); } function qr(t) { var r, e, o, n, i, s; if ((t = K.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Xt(t, [1, 2], [1, 2])), (i = new Xt(t, [1, 2], [0, 2])), (s = new Xt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * qr(n) - e * qr(i) + o * qr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function Dr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Fr(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Br(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = K.checkMatrix(t)).rows, u = new K(s, s), a = 0; a < s; a++ ) { var f = K.columnVector(t.getRow(a)), c = t.subMatrixRow(Dr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = K.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Fr(p, l, a, o, i)); } return u; } function Lr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = K.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(K.diag(i).mmul(o.transpose())); } function zr(t) { return (zr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Ur(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== zr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i; s && ((t = t.center("column")), o || (r = r.center("column"))); for (var u = t.transpose().mmul(r), a = 0; a < u.rows; a++) for (var f = 0; f < u.columns; f++) u.set(a, f, u.get(a, f) * (1 / (t.rows - 1))); return u; } function Wr(t) { return (Wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Wr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i, u = n.scale, a = void 0 === u || u; s && (t.center("column"), o || r.center("column")), a && (t.scale("column"), o || r.scale("column")); for ( var f = t.standardDeviation("column", { unbiased: !0 }), c = o ? f : r.standardDeviation("column", { unbiased: !0 }), h = t.transpose().mmul(r), l = 0; l < h.rows; l++ ) for (var p = 0; p < h.columns; p++) h.set(l, p, h.get(l, p) * (1 / (f[l] * c[p])) * (1 / (t.rows - 1))); return h; } function Jr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Yr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Hr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Jr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Er.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new K(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Kr(u, c, f, a), Xr(u, c, f, a); } else { var l = new K(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Gr(u, l, p, a), Zr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new K(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Yr(r.prototype, e), o && Yr(r, o), t ); })(); function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, v, y, m, g, w, b; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var d = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = _r((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( d += i, h = e[c], y = v = 1, m = v, g = r[f + 1], w = 0, b = 0, s = c - 1; s >= f; s-- ) for ( m = y, y = v, b = w, n = v * r[s], i = v * h, l = _r(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (v = h / l) * e[s] - w * n, e[s + 1] = i + w * (v * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + v * i), o.set(a, s, v * o.get(a, s) - w * i); (h = (-w * b * m * g * r[f]) / p), (r[f] = w * h), (e[f] = v * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + d), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Gr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Zr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, v, y, m, g, w, b, d = t - 1, M = t - 1, x = Number.EPSILON, k = 0, S = 0, E = 0, O = 0, R = 0, j = 0, _ = 0, P = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) S += Math.abs(n.get(i, s)); for (; d >= 0; ) { for ( a = d; a > 0 && (0 === (j = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (j = S), !(Math.abs(n.get(a, a - 1)) < x * j)); ) a--; if (a === d) n.set(d, d, n.get(d, d) + k), (e[d] = n.get(d, d)), (r[d] = 0), d--, (P = 0); else if (a === d - 1) { if ( ((h = n.get(d, d - 1) * n.get(d - 1, d)), (O = (E = (n.get(d - 1, d - 1) - n.get(d, d)) / 2) * E + h), (_ = Math.sqrt(Math.abs(O))), n.set(d, d, n.get(d, d) + k), n.set(d - 1, d - 1, n.get(d - 1, d - 1) + k), (l = n.get(d, d)), O >= 0) ) { for ( _ = E >= 0 ? E + _ : E - _, e[d - 1] = l + _, e[d] = e[d - 1], 0 !== _ && (e[d] = l - h / _), r[d - 1] = 0, r[d] = 0, E = (l = n.get(d, d - 1)) / (j = Math.abs(l) + Math.abs(_)), O = _ / j, E /= R = Math.sqrt(E * E + O * O), O /= R, s = d - 1; s < t; s++ ) (_ = n.get(d - 1, s)), n.set(d - 1, s, O * _ + E * n.get(d, s)), n.set(d, s, O * n.get(d, s) - E * _); for (i = 0; i <= d; i++) (_ = n.get(i, d - 1)), n.set(i, d - 1, O * _ + E * n.get(i, d)), n.set(i, d, O * n.get(i, d) - E * _); for (i = 0; i <= M; i++) (_ = o.get(i, d - 1)), o.set(i, d - 1, O * _ + E * o.get(i, d)), o.set(i, d, O * o.get(i, d) - E * _); } else (e[d - 1] = l + E), (e[d] = l + E), (r[d - 1] = _), (r[d] = -_); (d -= 2), (P = 0); } else { if ( ((l = n.get(d, d)), (p = 0), (h = 0), a < d && ((p = n.get(d - 1, d - 1)), (h = n.get(d, d - 1) * n.get(d - 1, d))), 10 === P) ) { for (k += l, i = 0; i <= d; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (j = Math.abs(n.get(d, d - 1)) + Math.abs(n.get(d - 1, d - 2)))), (h = -0.4375 * j * j); } if (30 === P && (j = (j = (p - l) / 2) * j + h) > 0) { for ( j = Math.sqrt(j), p < l && (j = -j), j = l - h / ((p - l) / 2 + j), i = 0; i <= d; i++ ) n.set(i, i, n.get(i, i) - j); (k += j), (l = p = h = 0.964); } for ( P += 1, f = d - 2; f >= a && ((E = ((R = l - (_ = n.get(f, f))) * (j = p - _) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (O = n.get(f + 1, f + 1) - _ - R - j), (R = n.get(f + 2, f + 1)), (E /= j = Math.abs(E) + Math.abs(O) + Math.abs(R)), (O /= j), (R /= j), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(O) + Math.abs(R)) < x * (Math.abs(E) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(_) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= d; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= d - 1 && ((w = u !== d - 1), u !== f && ((E = n.get(u, u - 1)), (O = n.get(u + 1, u - 1)), (R = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(E) + Math.abs(O) + Math.abs(R)) && ((E /= l), (O /= l), (R /= l))), 0 !== l); u++ ) if ( ((j = Math.sqrt(E * E + O * O + R * R)), E < 0 && (j = -j), 0 !== j) ) { for ( u !== f ? n.set(u, u - 1, -j * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (E += j) / j, p = O / j, _ = R / j, O /= E, R /= E, s = u; s < t; s++ ) (E = n.get(u, s) + O * n.get(u + 1, s)), w && ((E += R * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - E * _)), n.set(u, s, n.get(u, s) - E * l), n.set(u + 1, s, n.get(u + 1, s) - E * p); for (i = 0; i <= Math.min(d, u + 3); i++) (E = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((E += _ * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - E * R)), n.set(i, u, n.get(i, u) - E), n.set(i, u + 1, n.get(i, u + 1) - E * O); for (i = 0; i <= M; i++) (E = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((E += _ * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - E * R)), o.set(i, u, o.get(i, u) - E), o.set(i, u + 1, o.get(i, u + 1) - E * O); } } } if (0 !== S) { for (d = t - 1; d >= 0; d--) if (((E = e[d]), 0 === (O = r[d]))) for (a = d, n.set(d, d, 1), i = d - 1; i >= 0; i--) { for (h = n.get(i, i) - E, R = 0, s = a; s <= d; s++) R += n.get(i, s) * n.get(s, d); if (r[i] < 0) (_ = h), (j = R); else if ( ((a = i), 0 === r[i] ? n.set(i, d, 0 !== h ? -R / h : -R / (x * S)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * j - _ * R) / (O = (e[i] - E) * (e[i] - E) + r[i] * r[i])), n.set(i, d, c), n.set( i + 1, d, Math.abs(l) > Math.abs(_) ? (-R - h * c) / l : (-j - p * c) / _, )), x * (c = Math.abs(n.get(i, d))) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d, n.get(s, d) / c); } else if (O < 0) for ( a = d - 1, Math.abs(n.get(d, d - 1)) > Math.abs(n.get(d - 1, d)) ? (n.set(d - 1, d - 1, O / n.get(d, d - 1)), n.set(d - 1, d, -(n.get(d, d) - E) / n.get(d, d - 1))) : ((b = $r( 0, -n.get(d - 1, d), n.get(d - 1, d - 1) - E, O, )), n.set(d - 1, d - 1, b[0]), n.set(d - 1, d, b[1])), n.set(d, d - 1, 0), n.set(d, d, 1), i = d - 2; i >= 0; i-- ) { for (v = 0, y = 0, s = a; s <= d; s++) (v += n.get(i, s) * n.get(s, d - 1)), (y += n.get(i, s) * n.get(s, d)); if (((h = n.get(i, i) - E), r[i] < 0)) (_ = h), (R = v), (j = y); else if ( ((a = i), 0 === r[i] ? ((b = $r(-v, -y, h, O)), n.set(i, d - 1, b[0]), n.set(i, d, b[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - E) * (e[i] - E) + r[i] * r[i] - O * O), (g = 2 * (e[i] - E) * O), 0 === m && 0 === g && (m = x * S * (Math.abs(h) + Math.abs(O) + Math.abs(l) + Math.abs(p) + Math.abs(_))), (b = $r( l * R - _ * v + O * y, l * j - _ * y - O * v, m, g, )), n.set(i, d - 1, b[0]), n.set(i, d, b[1]), Math.abs(l) > Math.abs(_) + Math.abs(O) ? (n.set( i + 1, d - 1, (-v - h * n.get(i, d - 1) + O * n.get(i, d)) / l, ), n.set( i + 1, d, (-y - h * n.get(i, d) - O * n.get(i, d - 1)) / l, )) : ((b = $r( -R - p * n.get(i, d - 1), -j - p * n.get(i, d), _, O, )), n.set(i + 1, d - 1, b[0]), n.set(i + 1, d, b[1]))), x * (c = Math.max( Math.abs(n.get(i, d - 1)), Math.abs(n.get(i, d)), )) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d - 1, n.get(s, d - 1) / c), n.set(s, d, n.get(s, d) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (_ = 0, u = 0; u <= Math.min(s, M); u++) _ += o.get(i, u) * n.get(u, s); o.set(i, s, _); } } } function $r(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function te(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var re = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Er.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new K(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Er.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && te(r.prototype, e), o && te(r, o), t ); })(); function ee(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var oe = function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; ee(this, t), (r = Er.checkMatrix(r)); var o, n = e.Y, i = e.scaleScores, s = void 0 !== i && i, u = e.maxIterations, a = void 0 === u ? 1e3 : u, f = e.terminationCriteria, c = void 0 === f ? 1e-10 : f; if (n) { if ( (n = Array.isArray(n) && "number" == typeof n[0] ? K.columnVector(n) : Er.checkMatrix(n)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = n.getColumnVector(0); } else o = r.getColumnVector(0); for (var h, l, p, v, y = 1, m = 0; m < a && y > c; m++) (p = (p = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(p.norm())), (h = r.mmul(p).div(p.transpose().mmul(p).get(0, 0))), m > 0 && (y = h.clone().sub(v).pow(2).sum()), (v = h.clone()), n ? ((l = (l = n .transpose() .mmul(h) .div(h.transpose().mmul(h).get(0, 0))).div(l.norm())), (o = n.mmul(l).div(l.transpose().mmul(l).get(0, 0)))) : (o = h); if (n) { var g = r.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)); g = g.div(g.norm()); var w = r.clone().sub(h.clone().mmul(g.transpose())), b = o.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)), d = n.clone().sub(h.clone().mulS(b.get(0, 0)).mmul(l.transpose())); (this.t = h), (this.p = g.transpose()), (this.w = p.transpose()), (this.q = l), (this.u = o), (this.s = h.transpose().mmul(h)), (this.xResidual = w), (this.yResidual = d), (this.betas = b); } else (this.w = p.transpose()), (this.s = h.transpose().mmul(h).sqrt()), (this.t = s ? h.clone().div(this.s.get(0, 0)) : h), (this.xResidual = r.sub(h.mmul(p.transpose()))); }; }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 180: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }); Object.defineProperty(r, "__esModule", { value: !0 }), (r.MDSLayout = void 0); var i = e(102), s = e(10), u = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.linkDistance = 50), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { center: [0, 0], linkDistance: 50 }; }), (r.prototype.execute = function () { var t = this.nodes, r = this.edges, e = void 0 === r ? [] : r, o = this.center; if (t && 0 !== t.length) { if (1 === t.length) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var n = this.linkDistance, i = s.getAdjMatrix({ nodes: t, edges: e }, !1), u = s.floydWarshall(i); this.handleInfinity(u); var a = s.scaleMatrix(u, n); this.scaledDistances = a; var f = this.runMDS(); return ( (this.positions = f), f.forEach(function (r, e) { (t[e].x = r[0] + o[0]), (t[e].y = r[1] + o[1]); }), this.onLayoutEnd && this.onLayoutEnd(), { nodes: t, edges: e } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (r.prototype.runMDS = function () { var t = this.scaledDistances, r = i.Matrix.mul(i.Matrix.pow(t, 2), -0.5), e = r.mean("row"), o = r.mean("column"), n = r.mean(); r.add(n).subRowVector(e).subColumnVector(o); var s = new i.SingularValueDecomposition(r), u = i.Matrix.sqrt(s.diagonalMatrix).diagonal(); return s.leftSingularVectors.toJSON().map(function (t) { return i.Matrix.mul([t], [u]).toJSON()[0].splice(0, 2); }); }), (r.prototype.handleInfinity = function (t) { var r = -999999; t.forEach(function (t) { t.forEach(function (t) { t !== 1 / 0 && r < t && (r = t); }); }), t.forEach(function (e, o) { e.forEach(function (e, n) { e === 1 / 0 && (t[o][n] = r); }); }); }), (r.prototype.getType = function () { return "mds"; }), r ); })(e(7).Base); r.MDSLayout = u; }, 408: function (t, r, e) { "use strict"; e.r(r); var o = e(180); r.default = o.MDSLayout; }, 7: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, }).default; }); //# sourceMappingURL=mdsLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/radialLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.f6 = r()) : (t.f6 = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 409)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 102: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return Q; }), e.d(r, "default", function () { return K; }), e.d(r, "Matrix", function () { return K; }), e.d(r, "MatrixColumnView", function () { return at; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return xt; }), e.d(r, "MatrixFlipRowView", function () { return _t; }), e.d(r, "MatrixRowView", function () { return Dt; }), e.d(r, "MatrixRowSelectionView", function () { return Ut; }), e.d(r, "MatrixSelectionView", function () { return Xt; }), e.d(r, "MatrixSubView", function () { return or; }), e.d(r, "MatrixTransposeView", function () { return cr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return wr; }), e.d(r, "WrapperMatrix2D", function () { return Er; }), e.d(r, "solve", function () { return Dr; }), e.d(r, "inverse", function () { return Cr; }), e.d(r, "determinant", function () { return Vr; }), e.d(r, "linearDependencies", function () { return Br; }), e.d(r, "pseudoInverse", function () { return zr; }), e.d(r, "covariance", function () { return Ur; }), e.d(r, "correlation", function () { return Qr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Yr; }), e.d(r, "EVD", function () { return Yr; }), e.d(r, "CholeskyDecomposition", function () { return re; }), e.d(r, "CHO", function () { return re; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return Tr; }), e.d(r, "QR", function () { return Tr; }), e.d(r, "Nipals", function () { return oe; }), e.d(r, "NIPALS", function () { return oe; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } var i = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; }; var s = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; }; var u = function (t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError( "output option must be an array if specified", ); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; }, a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t) { return (p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function v(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function g(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function w(t, r, e) { return { row: d(t, r), column: b(t, e) }; } function d(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for row indices"); if ( r.some(function (r) { return r < 0 || r >= t.rows; }) ) throw new RangeError("row indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function b(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for column indices"); if ( r.some(function (r) { return r < 0 || r >= t.columns; }) ) throw new RangeError("column indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function M(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (S("startRow", r), S("endRow", e), S("startColumn", o), S("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function x(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function S(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function k(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function E(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function O(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function R(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function P(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function T(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function A(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function I(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function N(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function C(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function D(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function V(t, r) { return (V = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function q(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = B(t); if (r) { var n = B(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return F(this, e); }; } function F(t, r) { return !r || ("object" !== z(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function B(t) { return (B = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function z(t) { return (z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function L(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function U(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function W(t, r, e) { return r && U(t.prototype, r), e && U(t, e), t; } var Q = (function () { function t() { L(this, t); } return ( W( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new K(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { v(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return K.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { v(this, t), (r = m(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { v(this, t), v(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return K.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = g(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { v(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { k(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { k(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { v(this, t), k(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { v(this, t), k(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), k(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), k(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new K(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = K.checkMatrix(t); var r = new K(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), v = (e + n) * f, y = c + p - v + (n - a) * (u + f), m = l + v, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, y), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = K.checkMatrix(t); var r = new K(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), v = t.get(1, 0), y = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), d = t.get(2, 2), b = (e - i) * (-l + y), M = (-e + i + s) * (h - l + y), x = (i + s) * (-h + l), S = e * h, k = (-e + a + f) * (h - p + m), E = (-e + a) * (p - m), O = (a + f) * (-h + p), R = (-n + f + c) * (y + g - w), j = (n - c) * (y - w), _ = n * g, P = (f + c) * (-g + w), T = (-n + s + u) * (m + g - d), A = (n - u) * (m - d), I = (s + u) * (-g + d), N = S + _ + o * v, C = (e + o + n - i - s - f - c) * y + M + x + S + R + _ + P, D = S + k + O + (e + o + n - s - u - a - f) * m + _ + T + I, V = b + s * (-h + l + v - y - m - g + d) + M + S + _ + T + A, q = b + M + x + S + u * w, F = _ + T + A + I + i * p, B = S + k + E + f * (-h + p + v - y - m - g + w) + R + j + _, z = R + j + _ + P + a * l, L = S + k + E + O + c * d; return ( r.set(0, 0, N), r.set(0, 1, C), r.set(0, 2, D), r.set(1, 0, V), r.set(1, 1, q), r.set(1, 2, F), r.set(2, 0, B), r.set(2, 1, z), r.set(2, 2, L), r ); }, }, { key: "mmulStrassen", value: function (r) { r = K.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), v = o.subMatrix(s, o.rows - 1, 0, a - 1), y = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, y), t.add(c, m), s, a), w = r(t.add(p, y), c, s, a), d = r(f, t.sub(l, m), s, a), b = r(y, t.sub(v, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), S = r(t.sub(h, y), t.add(v, m), s, a), k = t.add(g, b); k.sub(M), k.add(S); var E = t.add(d, M), O = t.add(w, b), R = t.sub(g, w); R.add(d), R.add(x); var j = t.zeros(2 * k.rows, 2 * k.columns); return (j = (j = (j = (j = j.setSubMatrix( k, 0, 0, )).setSubMatrix(E, k.rows, 0)).setSubMatrix( O, 0, k.columns, )).setSubMatrix(R, k.rows, k.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new K(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = K.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(K.eye(e, e)), n = K.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new K(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { M(this, t, r, e, o); for (var n = new K(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new K(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new K(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = K.checkMatrix(t)).isEmpty()) return this; M(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { for ( var e = w(this, t, r), o = new K(t.length, r.length), n = 0; n < e.row.length; n++ ) for (var i = e.row[n], s = 0; s < e.column.length; s++) { var u = e.column[s]; o.set(n, s, this.get(i, u)); } return o; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new K(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, n = void 0 === o || o, i = e.mean, s = void 0 === i ? this.mean(t) : i; if ("boolean" != typeof n) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return E(this, n, s); case "column": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return O(this, n, s); case void 0: if ("number" != typeof s) throw new TypeError("mean must be a number"); return R(this, n, s); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === z(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, n = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return j(this, n), this; case "column": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return _(this, n), this; case void 0: if ("number" != typeof n) throw new TypeError("center must be a number"); return P(this, n), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = T(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return A(this, e), this; case "column": if (void 0 === e) e = I(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return N(this, e), this; case void 0: if (void 0 === e) e = C(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return D(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new K(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new K(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new K(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new K(t, r); }, }, { key: "ones", value: function (t, r) { return new K(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== z(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new K(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== z(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new K(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new K(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new K(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function J(t, r) { return t - r; } (Q.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (Q.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (Q.random = Q.rand), (Q.randomInt = Q.randInt), (Q.diagonal = Q.diag), (Q.prototype.diagonal = Q.prototype.diag), (Q.identity = Q.eye), (Q.prototype.negate = Q.prototype.neg), (Q.prototype.tensorProduct = Q.prototype.kroneckerProduct); var H, Y, K = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && V(t, r); })(e, t); var r = q(e); function e(t, o) { var n; if ((L(this, e), (n = r.call(this)), e.isMatrix(t))) return F(n, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((n.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var i = 0; i < t; i++) n.data.push(new Float64Array(o)); } else { if (!Array.isArray(t)) throw new TypeError( "First argument must be a positive number or an array", ); var s = t; if ("number" != typeof (o = (t = s.length) ? s[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); n.data = []; for (var u = 0; u < t; u++) { if (s[u].length !== o) throw new RangeError("Inconsistent array dimensions"); n.data.push(Float64Array.from(s[u])); } } return (n.rows = t), (n.columns = o), n; } return ( W(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( v(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), v(this, t, !0), (r = Float64Array.from(m(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = g(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(Q); function X(t) { return (X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function G(t, r) { return (G = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Z(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = tt(t); if (r) { var n = tt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return $(this, e); }; } function $(t, r) { return !r || ("object" !== X(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function tt(t) { return (tt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (Y = K), ((H = Q).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (H.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (H.prototype.addM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (H.add = function (t, r) { return new Y(t).add(r); }), (H.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (H.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (H.prototype.subM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (H.sub = function (t, r) { return new Y(t).sub(r); }), (H.prototype.subtract = H.prototype.sub), (H.prototype.subtractS = H.prototype.subS), (H.prototype.subtractM = H.prototype.subM), (H.subtract = H.sub), (H.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (H.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (H.prototype.mulM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (H.mul = function (t, r) { return new Y(t).mul(r); }), (H.prototype.multiply = H.prototype.mul), (H.prototype.multiplyS = H.prototype.mulS), (H.prototype.multiplyM = H.prototype.mulM), (H.multiply = H.mul), (H.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (H.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (H.prototype.divM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (H.div = function (t, r) { return new Y(t).div(r); }), (H.prototype.divide = H.prototype.div), (H.prototype.divideS = H.prototype.divS), (H.prototype.divideM = H.prototype.divM), (H.divide = H.div), (H.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (H.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (H.prototype.modM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (H.mod = function (t, r) { return new Y(t).mod(r); }), (H.prototype.modulus = H.prototype.mod), (H.prototype.modulusS = H.prototype.modS), (H.prototype.modulusM = H.prototype.modM), (H.modulus = H.mod), (H.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (H.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (H.prototype.andM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (H.and = function (t, r) { return new Y(t).and(r); }), (H.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (H.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (H.prototype.orM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (H.or = function (t, r) { return new Y(t).or(r); }), (H.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (H.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (H.prototype.xorM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (H.xor = function (t, r) { return new Y(t).xor(r); }), (H.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (H.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (H.prototype.leftShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (H.leftShift = function (t, r) { return new Y(t).leftShift(r); }), (H.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (H.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (H.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (H.signPropagatingRightShift = function (t, r) { return new Y(t).signPropagatingRightShift(r); }), (H.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (H.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (H.prototype.rightShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (H.rightShift = function (t, r) { return new Y(t).rightShift(r); }), (H.prototype.zeroFillRightShift = H.prototype.rightShift), (H.prototype.zeroFillRightShiftS = H.prototype.rightShiftS), (H.prototype.zeroFillRightShiftM = H.prototype.rightShiftM), (H.zeroFillRightShift = H.rightShift), (H.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (H.not = function (t) { return new Y(t).not(); }), (H.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (H.abs = function (t) { return new Y(t).abs(); }), (H.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (H.acos = function (t) { return new Y(t).acos(); }), (H.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (H.acosh = function (t) { return new Y(t).acosh(); }), (H.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (H.asin = function (t) { return new Y(t).asin(); }), (H.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (H.asinh = function (t) { return new Y(t).asinh(); }), (H.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (H.atan = function (t) { return new Y(t).atan(); }), (H.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (H.atanh = function (t) { return new Y(t).atanh(); }), (H.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (H.cbrt = function (t) { return new Y(t).cbrt(); }), (H.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (H.ceil = function (t) { return new Y(t).ceil(); }), (H.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (H.clz32 = function (t) { return new Y(t).clz32(); }), (H.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (H.cos = function (t) { return new Y(t).cos(); }), (H.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (H.cosh = function (t) { return new Y(t).cosh(); }), (H.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (H.exp = function (t) { return new Y(t).exp(); }), (H.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (H.expm1 = function (t) { return new Y(t).expm1(); }), (H.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (H.floor = function (t) { return new Y(t).floor(); }), (H.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (H.fround = function (t) { return new Y(t).fround(); }), (H.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (H.log = function (t) { return new Y(t).log(); }), (H.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (H.log1p = function (t) { return new Y(t).log1p(); }), (H.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (H.log10 = function (t) { return new Y(t).log10(); }), (H.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (H.log2 = function (t) { return new Y(t).log2(); }), (H.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (H.round = function (t) { return new Y(t).round(); }), (H.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (H.sign = function (t) { return new Y(t).sign(); }), (H.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (H.sin = function (t) { return new Y(t).sin(); }), (H.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (H.sinh = function (t) { return new Y(t).sinh(); }), (H.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (H.sqrt = function (t) { return new Y(t).sqrt(); }), (H.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (H.tan = function (t) { return new Y(t).tan(); }), (H.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (H.tanh = function (t) { return new Y(t).tanh(); }), (H.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (H.trunc = function (t) { return new Y(t).trunc(); }), (H.pow = function (t, r) { return new Y(t).pow(r); }), (H.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (H.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (H.prototype.powM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && G(t, r); })(e, t); var r = Z(e); function e(t, o, n) { var i; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, e), ((i = r.call(this)).matrix = t), (i.rows = o), (i.columns = n), i ); } return e; })(Q); function et(t) { return (et = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ot(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function nt(t, r) { return (nt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function it(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ut(t); if (r) { var n = ut(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return st(this, e); }; } function st(t, r) { return !r || ("object" !== et(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function ut(t) { return (ut = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var at = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && nt(t, r); })(i, t); var r, e, o, n = it(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && ot(r.prototype, e), o && ot(r, o), i ); })(rt); function ft(t) { return (ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ct(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ht(t, r) { return (ht = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function lt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = vt(t); if (r) { var n = vt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return pt(this, e); }; } function pt(t, r) { return !r || ("object" !== ft(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function vt(t) { return (vt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && ht(t, r); })(i, t); var r, e, o, n = lt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = b(t, r)), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ct(r.prototype, e), o && ct(r, o), i ); })(rt); function mt(t) { return (mt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function wt(t, r) { return (wt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function dt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Mt(t); if (r) { var n = Mt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return bt(this, e); }; } function bt(t, r) { return !r || ("object" !== mt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Mt(t) { return (Mt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && wt(t, r); })(i, t); var r, e, o, n = dt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && gt(r.prototype, e), o && gt(r, o), i ); })(rt); function St(t) { return (St = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function kt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Et(t, r) { return (Et = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Rt(this, e); }; } function Rt(t, r) { return !r || ("object" !== St(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var _t = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Et(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && kt(r.prototype, e), o && kt(r, o), i ); })(rt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Tt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function It(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Ct(t); if (r) { var n = Ct(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { return !r || ("object" !== Pt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Dt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && At(t, r); })(i, t); var r, e, o, n = It(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), v(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && Tt(r.prototype, e), o && Tt(r, o), i ); })(rt); function Vt(t) { return (Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Ft(t, r) { return (Ft = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Lt(t); if (r) { var n = Lt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return zt(this, e); }; } function zt(t, r) { return !r || ("object" !== Vt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Lt(t) { return (Lt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Ft(t, r); })(i, t); var r, e, o, n = Bt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = d(t, r)), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && qt(r.prototype, e), o && qt(r, o), i ); })(rt); function Wt(t) { return (Wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Jt(t, r) { return (Jt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ht(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Kt(t); if (r) { var n = Kt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Yt(this, e); }; } function Yt(t, r) { return !r || ("object" !== Wt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Kt(t) { return (Kt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Jt(t, r); })(i, t); var r, e, o, n = Ht(i); function i(t, r, e) { var o; !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i); var s = w(t, r, e); return ( ((o = n.call(this, t, s.row.length, s.column.length)).rowIndices = s.row), (o.columnIndices = s.column), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Qt(r.prototype, e), o && Qt(r, o), i ); })(rt); function Gt(t) { return (Gt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Zt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function $t(t, r) { return ($t = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function tr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = er(t); if (r) { var n = er(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return rr(this, e); }; } function rr(t, r) { return !r || ("object" !== Gt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function er(t) { return (er = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var or = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && $t(t, r); })(i, t); var r, e, o, n = tr(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), M(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Zt(r.prototype, e), o && Zt(r, o), i ); })(rt); function nr(t) { return (nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function sr(t, r) { return (sr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ur(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = fr(t); if (r) { var n = fr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ar(this, e); }; } function ar(t, r) { return !r || ("object" !== nr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function fr(t) { return (fr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var cr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && sr(t, r); })(i, t); var r, e, o, n = ur(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && ir(r.prototype, e), o && ir(r, o), i ); })(rt); function hr(t) { return (hr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function lr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function vr(t, r) { return (vr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = gr(t); if (r) { var n = gr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return mr(this, e); }; } function mr(t, r) { return !r || ("object" !== hr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function gr(t) { return (gr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var wr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && vr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; lr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && pr(r.prototype, e), o && pr(r, o), i ); })(Q); function dr(t) { return (dr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function br(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Mr(t, r) { return (Mr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function xr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = kr(t); if (r) { var n = kr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Sr(this, e); }; } function Sr(t, r) { return !r || ("object" !== dr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function kr(t) { return (kr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Mr(t, r); })(i, t); var r, e, o, n = xr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && br(r.prototype, e), o && br(r, o), i ); })(Q); function Or(t, r) { if (Array.isArray(t)) return t[0] && Array.isArray(t[0]) ? new Er(t) : new wr(t, r); throw new Error("the argument is not an array"); } function Rr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Er.checkMatrix(r)).clone(), l = h.rows, p = h.columns, v = new Float64Array(l), y = 1; for (e = 0; e < l; e++) v[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = v[i]), (v[i] = v[o]), (v[o] = a), (y = -y); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = v), (this.pivotSign = y); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Rr(r.prototype, e), o && Rr(r, o), t ); })(); function _r(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Tr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Er.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = _r(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new K(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new K(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), t ); })(); function Ar(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Ar(this, t), (r = Er.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), v = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (v = !0); var y = l; (l = p), (p = y); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), d = new K(n, m), b = new K(i, i), M = new Float64Array(i), x = new Float64Array(n), S = new Float64Array(g), k = 0; k < g; k++ ) S[k] = k; for ( var E = Math.min(n - 1, i), O = Math.max(0, Math.min(i - 2, n)), R = Math.max(E, O), j = 0; j < R; j++ ) { if (j < E) { w[j] = 0; for (var _ = j; _ < n; _++) w[j] = _r(w[j], o.get(_, j)); if (0 !== w[j]) { o.get(j, j) < 0 && (w[j] = -w[j]); for (var P = j; P < n; P++) o.set(P, j, o.get(P, j) / w[j]); o.set(j, j, o.get(j, j) + 1); } w[j] = -w[j]; } for (var T = j + 1; T < i; T++) { if (j < E && 0 !== w[j]) { for (var A = 0, I = j; I < n; I++) A += o.get(I, j) * o.get(I, T); A = -A / o.get(j, j); for (var N = j; N < n; N++) o.set(N, T, o.get(N, T) + A * o.get(N, j)); } M[T] = o.get(j, T); } if (l && j < E) for (var C = j; C < n; C++) d.set(C, j, o.get(C, j)); if (j < O) { M[j] = 0; for (var D = j + 1; D < i; D++) M[j] = _r(M[j], M[D]); if (0 !== M[j]) { M[j + 1] < 0 && (M[j] = 0 - M[j]); for (var V = j + 1; V < i; V++) M[V] /= M[j]; M[j + 1] += 1; } if (((M[j] = -M[j]), j + 1 < n && 0 !== M[j])) { for (var q = j + 1; q < n; q++) x[q] = 0; for (var F = j + 1; F < n; F++) for (var B = j + 1; B < i; B++) x[F] += M[B] * o.get(F, B); for (var z = j + 1; z < i; z++) for (var L = -M[z] / M[j + 1], U = j + 1; U < n; U++) o.set(U, z, o.get(U, z) + L * x[U]); } if (p) for (var W = j + 1; W < i; W++) b.set(W, j, M[W]); } } var Q = Math.min(i, n + 1); if ( (E < i && (w[E] = o.get(E, E)), n < Q && (w[Q - 1] = 0), O + 1 < Q && (M[O] = o.get(O, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = E; J < m; J++) { for (var H = 0; H < n; H++) d.set(H, J, 0); d.set(J, J, 1); } for (var Y = E - 1; Y >= 0; Y--) if (0 !== w[Y]) { for (var X = Y + 1; X < m; X++) { for (var G = 0, Z = Y; Z < n; Z++) G += d.get(Z, Y) * d.get(Z, X); G = -G / d.get(Y, Y); for (var $ = Y; $ < n; $++) d.set($, X, d.get($, X) + G * d.get($, Y)); } for (var tt = Y; tt < n; tt++) d.set(tt, Y, -d.get(tt, Y)); d.set(Y, Y, 1 + d.get(Y, Y)); for (var rt = 0; rt < Y - 1; rt++) d.set(rt, Y, 0); } else { for (var et = 0; et < n; et++) d.set(et, Y, 0); d.set(Y, Y, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < O && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += b.get(st, ot) * b.get(st, nt); it = -it / b.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) b.set(ut, nt, b.get(ut, nt) + it * b.get(ut, ot)); } for (var at = 0; at < i; at++) b.set(at, ot, 0); b.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var vt = void 0; for (vt = Q - 1; vt >= ht && vt !== ht; vt--) { var yt = (vt !== Q ? Math.abs(M[vt]) : 0) + (vt !== ht + 1 ? Math.abs(M[vt - 1]) : 0); if (Math.abs(w[vt]) <= ct * yt) { w[vt] = 0; break; } } vt === ht ? (lt = 3) : vt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = vt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = _r(w[gt], mt), dt = w[gt] / wt, bt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -bt * M[gt - 1]), (M[gt - 1] = dt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = dt * b.get(Mt, gt) + bt * b.get(Mt, Q - 1)), b.set( Mt, Q - 1, -bt * b.get(Mt, gt) + dt * b.get(Mt, Q - 1), ), b.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var St = ht; St < Q; St++) { var kt = _r(w[St], xt), Et = w[St] / kt, Ot = xt / kt; if ( ((w[St] = kt), (xt = -Ot * M[St]), (M[St] = Et * M[St]), l) ) for (var Rt = 0; Rt < n; Rt++) (kt = Et * d.get(Rt, St) + Ot * d.get(Rt, ht - 1)), d.set( Rt, ht - 1, -Ot * d.get(Rt, St) + Et * d.get(Rt, ht - 1), ), d.set(Rt, St, kt); } break; case 3: var jt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), _t = w[Q - 1] / jt, Pt = w[Q - 2] / jt, Tt = M[Q - 2] / jt, At = w[ht] / jt, It = M[ht] / jt, Nt = ((Pt + _t) * (Pt - _t) + Tt * Tt) / 2, Ct = _t * Tt * (_t * Tt), Dt = 0; (0 === Nt && 0 === Ct) || (Dt = Ct / (Nt + (Dt = Nt < 0 ? 0 - Math.sqrt(Nt * Nt + Ct) : Math.sqrt(Nt * Nt + Ct)))); for ( var Vt = (At + _t) * (At - _t) + Dt, qt = At * It, Ft = ht; Ft < Q - 1; Ft++ ) { var Bt = _r(Vt, qt); 0 === Bt && (Bt = Number.MIN_VALUE); var zt = Vt / Bt, Lt = qt / Bt; if ( (Ft !== ht && (M[Ft - 1] = Bt), (Vt = zt * w[Ft] + Lt * M[Ft]), (M[Ft] = zt * M[Ft] - Lt * w[Ft]), (qt = Lt * w[Ft + 1]), (w[Ft + 1] = zt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Bt = zt * b.get(Ut, Ft) + Lt * b.get(Ut, Ft + 1)), b.set( Ut, Ft + 1, -Lt * b.get(Ut, Ft) + zt * b.get(Ut, Ft + 1), ), b.set(Ut, Ft, Bt); if ( (0 === (Bt = _r(Vt, qt)) && (Bt = Number.MIN_VALUE), (zt = Vt / Bt), (Lt = qt / Bt), (w[Ft] = Bt), (Vt = zt * M[Ft] + Lt * w[Ft + 1]), (w[Ft + 1] = -Lt * M[Ft] + zt * w[Ft + 1]), (qt = Lt * M[Ft + 1]), (M[Ft + 1] = zt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Bt = zt * d.get(Wt, Ft) + Lt * d.get(Wt, Ft + 1)), d.set( Wt, Ft + 1, -Lt * d.get(Wt, Ft) + zt * d.get(Wt, Ft + 1), ), d.set(Wt, Ft, Bt); } (M[Q - 2] = Vt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) b.set(Qt, ht, -b.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Ht = 0; Ht < i; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); if (l && ht < n - 1) for (var Yt = 0; Yt < n; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); ht++; } 0, Q--; } } if (v) { var Kt = b; (b = d), (d = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = d), (this.V = b); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = K.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = K.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var v = 0, y = 0; y < o; y++) v += a.get(l, y) * s.get(p, y); h.set(l, p, v); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(K.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new K(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new K(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, v = 0; v < f; v++) p += n.get(h, v) * u.get(l, v); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return K.diag(this.s); }, }, ]) && Ir(r.prototype, e), o && Ir(r, o), t ); })(); function Cr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Er.checkMatrix(t)), r ? new Nr(t).inverse() : Dr(t, K.eye(t.rows)) ); } function Dr(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Er.checkMatrix(t)), (r = Er.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new Tr(t).solve(r) ); } function Vr(t) { var r, e, o, n, i, s; if ((t = K.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Xt(t, [1, 2], [1, 2])), (i = new Xt(t, [1, 2], [0, 2])), (s = new Xt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * Vr(n) - e * Vr(i) + o * Vr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function qr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Fr(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Br(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = K.checkMatrix(t)).rows, u = new K(s, s), a = 0; a < s; a++ ) { var f = K.columnVector(t.getRow(a)), c = t.subMatrixRow(qr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = K.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Fr(p, l, a, o, i)); } return u; } function zr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = K.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(K.diag(i).mmul(o.transpose())); } function Lr(t) { return (Lr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Ur(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Lr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i; s && ((t = t.center("column")), o || (r = r.center("column"))); for (var u = t.transpose().mmul(r), a = 0; a < u.rows; a++) for (var f = 0; f < u.columns; f++) u.set(a, f, u.get(a, f) * (1 / (t.rows - 1))); return u; } function Wr(t) { return (Wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Wr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i, u = n.scale, a = void 0 === u || u; s && (t.center("column"), o || r.center("column")), a && (t.scale("column"), o || r.scale("column")); for ( var f = t.standardDeviation("column", { unbiased: !0 }), c = o ? f : r.standardDeviation("column", { unbiased: !0 }), h = t.transpose().mmul(r), l = 0; l < h.rows; l++ ) for (var p = 0; p < h.columns; p++) h.set(l, p, h.get(l, p) * (1 / (f[l] * c[p])) * (1 / (t.rows - 1))); return h; } function Jr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Hr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Yr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Jr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Er.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new K(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Kr(u, c, f, a), Xr(u, c, f, a); } else { var l = new K(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Gr(u, l, p, a), Zr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new K(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Hr(r.prototype, e), o && Hr(r, o), t ); })(); function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, v, y, m, g, w, d; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var b = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = _r((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( b += i, h = e[c], y = v = 1, m = v, g = r[f + 1], w = 0, d = 0, s = c - 1; s >= f; s-- ) for ( m = y, y = v, d = w, n = v * r[s], i = v * h, l = _r(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (v = h / l) * e[s] - w * n, e[s + 1] = i + w * (v * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + v * i), o.set(a, s, v * o.get(a, s) - w * i); (h = (-w * d * m * g * r[f]) / p), (r[f] = w * h), (e[f] = v * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + b), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Gr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Zr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, v, y, m, g, w, d, b = t - 1, M = t - 1, x = Number.EPSILON, S = 0, k = 0, E = 0, O = 0, R = 0, j = 0, _ = 0, P = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) k += Math.abs(n.get(i, s)); for (; b >= 0; ) { for ( a = b; a > 0 && (0 === (j = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (j = k), !(Math.abs(n.get(a, a - 1)) < x * j)); ) a--; if (a === b) n.set(b, b, n.get(b, b) + S), (e[b] = n.get(b, b)), (r[b] = 0), b--, (P = 0); else if (a === b - 1) { if ( ((h = n.get(b, b - 1) * n.get(b - 1, b)), (O = (E = (n.get(b - 1, b - 1) - n.get(b, b)) / 2) * E + h), (_ = Math.sqrt(Math.abs(O))), n.set(b, b, n.get(b, b) + S), n.set(b - 1, b - 1, n.get(b - 1, b - 1) + S), (l = n.get(b, b)), O >= 0) ) { for ( _ = E >= 0 ? E + _ : E - _, e[b - 1] = l + _, e[b] = e[b - 1], 0 !== _ && (e[b] = l - h / _), r[b - 1] = 0, r[b] = 0, E = (l = n.get(b, b - 1)) / (j = Math.abs(l) + Math.abs(_)), O = _ / j, E /= R = Math.sqrt(E * E + O * O), O /= R, s = b - 1; s < t; s++ ) (_ = n.get(b - 1, s)), n.set(b - 1, s, O * _ + E * n.get(b, s)), n.set(b, s, O * n.get(b, s) - E * _); for (i = 0; i <= b; i++) (_ = n.get(i, b - 1)), n.set(i, b - 1, O * _ + E * n.get(i, b)), n.set(i, b, O * n.get(i, b) - E * _); for (i = 0; i <= M; i++) (_ = o.get(i, b - 1)), o.set(i, b - 1, O * _ + E * o.get(i, b)), o.set(i, b, O * o.get(i, b) - E * _); } else (e[b - 1] = l + E), (e[b] = l + E), (r[b - 1] = _), (r[b] = -_); (b -= 2), (P = 0); } else { if ( ((l = n.get(b, b)), (p = 0), (h = 0), a < b && ((p = n.get(b - 1, b - 1)), (h = n.get(b, b - 1) * n.get(b - 1, b))), 10 === P) ) { for (S += l, i = 0; i <= b; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (j = Math.abs(n.get(b, b - 1)) + Math.abs(n.get(b - 1, b - 2)))), (h = -0.4375 * j * j); } if (30 === P && (j = (j = (p - l) / 2) * j + h) > 0) { for ( j = Math.sqrt(j), p < l && (j = -j), j = l - h / ((p - l) / 2 + j), i = 0; i <= b; i++ ) n.set(i, i, n.get(i, i) - j); (S += j), (l = p = h = 0.964); } for ( P += 1, f = b - 2; f >= a && ((E = ((R = l - (_ = n.get(f, f))) * (j = p - _) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (O = n.get(f + 1, f + 1) - _ - R - j), (R = n.get(f + 2, f + 1)), (E /= j = Math.abs(E) + Math.abs(O) + Math.abs(R)), (O /= j), (R /= j), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(O) + Math.abs(R)) < x * (Math.abs(E) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(_) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= b; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= b - 1 && ((w = u !== b - 1), u !== f && ((E = n.get(u, u - 1)), (O = n.get(u + 1, u - 1)), (R = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(E) + Math.abs(O) + Math.abs(R)) && ((E /= l), (O /= l), (R /= l))), 0 !== l); u++ ) if ( ((j = Math.sqrt(E * E + O * O + R * R)), E < 0 && (j = -j), 0 !== j) ) { for ( u !== f ? n.set(u, u - 1, -j * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (E += j) / j, p = O / j, _ = R / j, O /= E, R /= E, s = u; s < t; s++ ) (E = n.get(u, s) + O * n.get(u + 1, s)), w && ((E += R * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - E * _)), n.set(u, s, n.get(u, s) - E * l), n.set(u + 1, s, n.get(u + 1, s) - E * p); for (i = 0; i <= Math.min(b, u + 3); i++) (E = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((E += _ * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - E * R)), n.set(i, u, n.get(i, u) - E), n.set(i, u + 1, n.get(i, u + 1) - E * O); for (i = 0; i <= M; i++) (E = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((E += _ * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - E * R)), o.set(i, u, o.get(i, u) - E), o.set(i, u + 1, o.get(i, u + 1) - E * O); } } } if (0 !== k) { for (b = t - 1; b >= 0; b--) if (((E = e[b]), 0 === (O = r[b]))) for (a = b, n.set(b, b, 1), i = b - 1; i >= 0; i--) { for (h = n.get(i, i) - E, R = 0, s = a; s <= b; s++) R += n.get(i, s) * n.get(s, b); if (r[i] < 0) (_ = h), (j = R); else if ( ((a = i), 0 === r[i] ? n.set(i, b, 0 !== h ? -R / h : -R / (x * k)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * j - _ * R) / (O = (e[i] - E) * (e[i] - E) + r[i] * r[i])), n.set(i, b, c), n.set( i + 1, b, Math.abs(l) > Math.abs(_) ? (-R - h * c) / l : (-j - p * c) / _, )), x * (c = Math.abs(n.get(i, b))) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b, n.get(s, b) / c); } else if (O < 0) for ( a = b - 1, Math.abs(n.get(b, b - 1)) > Math.abs(n.get(b - 1, b)) ? (n.set(b - 1, b - 1, O / n.get(b, b - 1)), n.set(b - 1, b, -(n.get(b, b) - E) / n.get(b, b - 1))) : ((d = $r( 0, -n.get(b - 1, b), n.get(b - 1, b - 1) - E, O, )), n.set(b - 1, b - 1, d[0]), n.set(b - 1, b, d[1])), n.set(b, b - 1, 0), n.set(b, b, 1), i = b - 2; i >= 0; i-- ) { for (v = 0, y = 0, s = a; s <= b; s++) (v += n.get(i, s) * n.get(s, b - 1)), (y += n.get(i, s) * n.get(s, b)); if (((h = n.get(i, i) - E), r[i] < 0)) (_ = h), (R = v), (j = y); else if ( ((a = i), 0 === r[i] ? ((d = $r(-v, -y, h, O)), n.set(i, b - 1, d[0]), n.set(i, b, d[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - E) * (e[i] - E) + r[i] * r[i] - O * O), (g = 2 * (e[i] - E) * O), 0 === m && 0 === g && (m = x * k * (Math.abs(h) + Math.abs(O) + Math.abs(l) + Math.abs(p) + Math.abs(_))), (d = $r( l * R - _ * v + O * y, l * j - _ * y - O * v, m, g, )), n.set(i, b - 1, d[0]), n.set(i, b, d[1]), Math.abs(l) > Math.abs(_) + Math.abs(O) ? (n.set( i + 1, b - 1, (-v - h * n.get(i, b - 1) + O * n.get(i, b)) / l, ), n.set( i + 1, b, (-y - h * n.get(i, b) - O * n.get(i, b - 1)) / l, )) : ((d = $r( -R - p * n.get(i, b - 1), -j - p * n.get(i, b), _, O, )), n.set(i + 1, b - 1, d[0]), n.set(i + 1, b, d[1]))), x * (c = Math.max( Math.abs(n.get(i, b - 1)), Math.abs(n.get(i, b)), )) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b - 1, n.get(s, b - 1) / c), n.set(s, b, n.get(s, b) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (_ = 0, u = 0; u <= Math.min(s, M); u++) _ += o.get(i, u) * n.get(u, s); o.set(i, s, _); } } } function $r(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function te(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var re = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Er.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new K(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Er.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && te(r.prototype, e), o && te(r, o), t ); })(); function ee(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var oe = function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; ee(this, t), (r = Er.checkMatrix(r)); var o, n = e.Y, i = e.scaleScores, s = void 0 !== i && i, u = e.maxIterations, a = void 0 === u ? 1e3 : u, f = e.terminationCriteria, c = void 0 === f ? 1e-10 : f; if (n) { if ( (n = Array.isArray(n) && "number" == typeof n[0] ? K.columnVector(n) : Er.checkMatrix(n)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = n.getColumnVector(0); } else o = r.getColumnVector(0); for (var h, l, p, v, y = 1, m = 0; m < a && y > c; m++) (p = (p = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(p.norm())), (h = r.mmul(p).div(p.transpose().mmul(p).get(0, 0))), m > 0 && (y = h.clone().sub(v).pow(2).sum()), (v = h.clone()), n ? ((l = (l = n .transpose() .mmul(h) .div(h.transpose().mmul(h).get(0, 0))).div(l.norm())), (o = n.mmul(l).div(l.transpose().mmul(l).get(0, 0)))) : (o = h); if (n) { var g = r.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)); g = g.div(g.norm()); var w = r.clone().sub(h.clone().mmul(g.transpose())), d = o.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)), b = n.clone().sub(h.clone().mulS(d.get(0, 0)).mmul(l.transpose())); (this.t = h), (this.p = g.transpose()), (this.w = p.transpose()), (this.q = l), (this.u = o), (this.s = h.transpose().mmul(h)), (this.xResidual = w), (this.yResidual = b), (this.betas = d); } else (this.w = p.transpose()), (this.s = h.transpose().mmul(h).sqrt()), (this.t = s ? h.clone().div(this.s.get(0, 0)) : h), (this.xResidual = r.sub(h.mmul(p.transpose()))); }; }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 181: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(410), r); }, 409: function (t, r, e) { "use strict"; e.r(r); var o = e(181); r.default = o.RadialLayout; }, 410: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.RadialLayout = void 0); var s = e(10), u = e(7), a = i(e(411)), f = i(e(412)); function c(t, r) { return Math.sqrt( (t[0] - r[0]) * (t[0] - r[0]) + (t[1] - r[1]) * (t[1] - r[1]), ); } var h = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.maxIteration = 1e3), (e.focusNode = null), (e.unitRadius = null), (e.linkDistance = 50), (e.preventOverlap = !1), (e.strictRadial = !0), (e.maxPreventOverlapIteration = 200), (e.sortStrength = 10), (e.nodes = []), (e.edges = []), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, focusNode: null, unitRadius: null, linkDistance: 50, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, strictRadial: !0, maxPreventOverlapIteration: 200, sortBy: void 0, sortStrength: 10, }; }), (r.prototype.execute = function () { var t = this, r = t.nodes, e = t.edges || []; if (r && 0 !== r.length) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var o = t.center; if (1 === r.length) return ( (r[0].x = o[0]), (r[0].y = o[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var n = t.linkDistance, i = null; if (s.isString(t.focusNode)) { for (var u = !1, c = 0; c < r.length; c++) r[c].id === t.focusNode && ((i = r[c]), (t.focusNode = i), (u = !0), (c = r.length)); u || (i = null); } else i = t.focusNode; i || ((i = r[0]), (t.focusNode = i)); var h, l, p, v = ((h = r), (l = i.id), (p = -1), h.forEach(function (t, r) { t.id === l && (p = r); }), p); t.focusIndex = v; var y = s.getAdjMatrix({ nodes: r, edges: e }, !1), m = s.floydWarshall(y), g = t.maxToFocus(m, v); t.handleInfinity(m, v, g + 1), (t.distances = m); var w = m[v], d = t.width || 500, b = t.height || 500, M = d - o[0] > o[0] ? o[0] : d - o[0], x = b - o[1] > o[1] ? o[1] : b - o[1]; 0 === M && (M = d / 2), 0 === x && (x = b / 2); var S = x > M ? M : x, k = Math.max.apply(Math, w), E = []; w.forEach(function (r, e) { t.unitRadius || (t.unitRadius = S / k), (E[e] = r * t.unitRadius); }), (t.radii = E); var O = t.eIdealDisMatrix(); t.eIdealDistances = O; var R = (function (t) { for ( var r = t.length, e = t[0].length, o = [], n = 0; n < r; n++ ) { for (var i = [], s = 0; s < e; s++) 0 !== t[n][s] ? i.push(1 / (t[n][s] * t[n][s])) : i.push(0); o.push(i); } return o; })(O); t.weights = R; var j = new a.default({ linkDistance: n, distances: O }).layout(); j.forEach(function (t) { s.isNaN(t[0]) && (t[0] = Math.random() * n), s.isNaN(t[1]) && (t[1] = Math.random() * n); }), (t.positions = j), j.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), j.forEach(function (t) { (t[0] -= j[v][0]), (t[1] -= j[v][1]); }), t.run(); var _, P = t.preventOverlap, T = t.nodeSize, A = t.strictRadial; if (P) { var I, N = t.nodeSpacing; (I = s.isNumber(N) ? function () { return N; } : s.isFunction(N) ? N : function () { return 0; }), (_ = T ? s.isArray(T) ? function (t) { return (T[0] > T[1] ? T[0] : T[1]) + I(t); } : function (t) { return T + I(t); } : function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + I(t) : t.size + I(t) : 10 + I(t); }); var C = { nodes: r, nodeSizeFunc: _, adjMatrix: y, positions: j, radii: E, height: b, width: d, strictRadial: A, focusID: v, iterations: t.maxPreventOverlapIteration || 200, k: j.length / 4.5, }, D = new f.default(C); j = D.layout(); } return ( j.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: r, edges: e } ); } t.onLayoutEnd && t.onLayoutEnd(); }), (r.prototype.run = function () { for ( var t = this.maxIteration, r = this.positions || [], e = this.weights || [], o = this.eIdealDistances || [], n = this.radii || [], i = 0; i <= t; i++ ) { var s = i / t; this.oneIteration(s, r, n, o, e); } }), (r.prototype.oneIteration = function (t, r, e, o, n) { var i = 1 - t, s = this.focusIndex; r.forEach(function (u, a) { var f = c(u, [0, 0]), h = 0 === f ? 0 : 1 / f; if (a !== s) { var l = 0, p = 0, v = 0; r.forEach(function (t, r) { if (a !== r) { var e = c(u, t), i = 0 === e ? 0 : 1 / e, s = o[r][a]; (v += n[a][r]), (l += n[a][r] * (t[0] + s * (u[0] - t[0]) * i)), (p += n[a][r] * (t[1] + s * (u[1] - t[1]) * i)); } }); var y = 0 === e[a] ? 0 : 1 / e[a]; (v *= i), (v += t * y * y), (l *= i), (l += t * y * u[0] * h), (u[0] = l / v), (p *= i), (p += t * y * u[1] * h), (u[1] = p / v); } }); }), (r.prototype.eIdealDisMatrix = function () { var t = this, r = t.nodes; if (!r) return []; var e = t.distances, o = t.linkDistance, n = t.radii || [], i = t.unitRadius || 50, u = []; return ( e && e.forEach(function (e, a) { var f = []; e.forEach(function (e, u) { if (a === u) f.push(0); else if (n[a] === n[u]) if ("data" === t.sortBy) f.push( (e * (Math.abs(a - u) * t.sortStrength)) / (n[a] / i), ); else if (t.sortBy) { var c = r[a][t.sortBy] || 0, h = r[u][t.sortBy] || 0; s.isString(c) && (c = c.charCodeAt(0)), s.isString(h) && (h = h.charCodeAt(0)), f.push( (e * (Math.abs(c - h) * t.sortStrength)) / (n[a] / i), ); } else f.push((e * o) / (n[a] / i)); else { var l = (o + i) / 2; f.push(e * l); } }), u.push(f); }), u ); }), (r.prototype.handleInfinity = function (t, r, e) { for (var o = t.length, n = 0; n < o; n++) if (t[r][n] === 1 / 0) { (t[r][n] = e), (t[n][r] = e); for (var i = 0; i < o; i++) t[n][i] !== 1 / 0 && t[r][i] === 1 / 0 && ((t[r][i] = e + t[n][i]), (t[i][r] = e + t[n][i])); } for (n = 0; n < o; n++) if (n !== r) for (i = 0; i < o; i++) if (t[n][i] === 1 / 0) { var s = Math.abs(t[r][n] - t[r][i]); (s = 0 === s ? 1 : s), (t[n][i] = s); } }), (r.prototype.maxToFocus = function (t, r) { for (var e = 0, o = 0; o < t[r].length; o++) t[r][o] !== 1 / 0 && (e = t[r][o] > e ? t[r][o] : e); return e; }), (r.prototype.getType = function () { return "radial"; }), r ); })(u.Base); r.RadialLayout = h; }, 411: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = e(102), n = (function () { function t(t) { (this.distances = t.distances), (this.dimension = t.dimension || 2), (this.linkDistance = t.linkDistance); } return ( (t.prototype.layout = function () { var t = this.dimension, r = this.distances, e = this.linkDistance; try { var n = o.Matrix.mul(o.Matrix.pow(r, 2), -0.5), i = n.mean("row"), s = n.mean("column"), u = n.mean(); n.add(u).subRowVector(i).subColumnVector(s); var a = new o.SingularValueDecomposition(n), f = o.Matrix.sqrt(a.diagonalMatrix).diagonal(); return a.leftSingularVectors.toJSON().map(function (r) { return o.Matrix.mul([r], [f]).toJSON()[0].splice(0, t); }); } catch (t) { for (var c = [], h = 0; h < r.length; h++) { var l = Math.random() * e, p = Math.random() * e; c.push([l, p]); } return c; } }), t ); })(); r.default = n; }, 412: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = (function () { function t(t) { (this.disp = []), (this.positions = t.positions), (this.adjMatrix = t.adjMatrix), (this.focusID = t.focusID), (this.radii = t.radii), (this.iterations = t.iterations || 10), (this.height = t.height || 10), (this.width = t.width || 10), (this.speed = t.speed || 100), (this.gravity = t.gravity || 10), (this.nodeSizeFunc = t.nodeSizeFunc), (this.k = t.k || 5), (this.strictRadial = t.strictRadial), (this.nodes = t.nodes); } return ( (t.prototype.layout = function () { var t = this.positions, r = [], e = this.iterations, o = this.width / 10; (this.maxDisplace = o), (this.disp = r); for (var n = 0; n < e; n++) t.forEach(function (t, e) { r[e] = { x: 0, y: 0 }; }), this.getRepulsion(), this.updatePositions(); return t; }), (t.prototype.getRepulsion = function () { var t = this, r = t.positions, e = t.nodes, o = t.disp, n = t.k, i = t.radii || []; r.forEach(function (s, u) { (o[u] = { x: 0, y: 0 }), r.forEach(function (r, a) { if (u !== a && i[u] === i[a]) { var f = s[0] - r[0], c = s[1] - r[1], h = Math.sqrt(f * f + c * c); if (0 === h) { h = 1; var l = u > a ? 1 : -1; (f = 0.01 * l), (c = 0.01 * l); } if ( h < t.nodeSizeFunc(e[u]) / 2 + t.nodeSizeFunc(e[a]) / 2 ) { var p = (n * n) / h; (o[u].x += (f / h) * p), (o[u].y += (c / h) * p); } } }); }); }), (t.prototype.updatePositions = function () { var t = this.positions, r = this.disp, e = this.speed, o = this.strictRadial, n = this.focusID, i = this.maxDisplace || this.width / 10; o && r.forEach(function (r, e) { var o = t[e][0] - t[n][0], i = t[e][1] - t[n][1], s = Math.sqrt(o * o + i * i), u = i / s, a = -o / s, f = Math.sqrt(r.x * r.x + r.y * r.y), c = Math.acos((u * r.x + a * r.y) / f); c > Math.PI / 2 && ((c -= Math.PI / 2), (u *= -1), (a *= -1)); var h = Math.cos(c) * f; (r.x = u * h), (r.y = a * h); }); var s = this.radii; t.forEach(function (u, a) { if (a !== n) { var f = Math.sqrt(r[a].x * r[a].x + r[a].y * r[a].y); if (f > 0 && a !== n) { var c = Math.min(i * (e / 800), f); if ( ((u[0] += (r[a].x / f) * c), (u[1] += (r[a].y / f) * c), o) ) { var h = u[0] - t[n][0], l = u[1] - t[n][1], p = Math.sqrt(h * h + l * l); (h = (h / p) * s[a]), (l = (l / p) * s[a]), (u[0] = t[n][0] + h), (u[1] = t[n][1] + l); } } } }); }), t ); })(); r.default = o; }, 7: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, }).default; }); //# sourceMappingURL=radialLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/extends/layout/randomLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(o) { if (e[o]) return e[o].exports; var r = (e[o] = { i: o, l: !1, exports: {} }); return t[o].call(r.exports, r, r.exports, n), (r.l = !0), r.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, o) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: o }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (n.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var r in t) n.d( o, r, function (e) { return t[e]; }.bind(null, r), ); return o; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 413)) ); })({ 413: function (t, e, n) { "use strict"; n.r(e); var o = n(57); e.default = o.RandomLayout; }, 57: function (t, e, n) { "use strict"; var o, r = (this && this.__extends) || ((o = function (t, e) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var i = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.center = [0, 0]), (n.width = 300), (n.height = 300), (n.nodes = []), (n.edges = []), (n.onLayoutEnd = function () {}), n.updateCfg(e), n ); } return ( r(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, n = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + n[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + n[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(n(7).Base); e.RandomLayout = i; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = o; }, }).default; }); //# sourceMappingURL=randomLayout.js.map ================================================ FILE: packages/examples-wx/miniprogram_npm/@antv/f6-wx/index.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.F6 = e()) : (t.F6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var i in t) n.d( r, i, function (e) { return t[e]; }.bind(null, i), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 205)) ); })({ 0: function (t, e, n) { "use strict"; n.r(e), n.d(e, "contains", function () { return i; }), n.d(e, "includes", function () { return i; }), n.d(e, "difference", function () { return a; }), n.d(e, "find", function () { return x; }), n.d(e, "findIndex", function () { return S; }), n.d(e, "firstValue", function () { return w; }), n.d(e, "flatten", function () { return O; }), n.d(e, "flattenDeep", function () { return M; }), n.d(e, "getRange", function () { return C; }), n.d(e, "pull", function () { return I; }), n.d(e, "pullAt", function () { return N; }), n.d(e, "reduce", function () { return B; }), n.d(e, "remove", function () { return L; }), n.d(e, "sortBy", function () { return _; }), n.d(e, "union", function () { return F; }), n.d(e, "uniq", function () { return R; }), n.d(e, "valuesOfKey", function () { return Y; }), n.d(e, "head", function () { return X; }), n.d(e, "last", function () { return z; }), n.d(e, "startsWith", function () { return W; }), n.d(e, "endsWith", function () { return q; }), n.d(e, "filter", function () { return o; }), n.d(e, "every", function () { return V; }), n.d(e, "some", function () { return G; }), n.d(e, "group", function () { return K; }), n.d(e, "groupBy", function () { return U; }), n.d(e, "groupToMap", function () { return Z; }), n.d(e, "getWrapBehavior", function () { return $; }), n.d(e, "wrapBehavior", function () { return Q; }), n.d(e, "number2color", function () { return tt; }), n.d(e, "parseRadius", function () { return et; }), n.d(e, "clamp", function () { return nt; }), n.d(e, "fixedBase", function () { return rt; }), n.d(e, "isDecimal", function () { return ot; }), n.d(e, "isEven", function () { return at; }), n.d(e, "isInteger", function () { return st; }), n.d(e, "isNegative", function () { return ct; }), n.d(e, "isNumberEqual", function () { return ut; }), n.d(e, "isOdd", function () { return ht; }), n.d(e, "isPositive", function () { return lt; }), n.d(e, "max", function () { return k; }), n.d(e, "maxBy", function () { return ft; }), n.d(e, "min", function () { return j; }), n.d(e, "minBy", function () { return dt; }), n.d(e, "mod", function () { return pt; }), n.d(e, "toDegree", function () { return vt; }), n.d(e, "toInteger", function () { return yt; }), n.d(e, "toRadian", function () { return bt; }), n.d(e, "forIn", function () { return xt; }), n.d(e, "has", function () { return St; }), n.d(e, "hasKey", function () { return wt; }), n.d(e, "hasValue", function () { return Mt; }), n.d(e, "keys", function () { return g; }), n.d(e, "isMatch", function () { return v; }), n.d(e, "values", function () { return Ot; }), n.d(e, "lowerCase", function () { return jt; }), n.d(e, "lowerFirst", function () { return Ct; }), n.d(e, "substitute", function () { return Et; }), n.d(e, "upperCase", function () { return Pt; }), n.d(e, "upperFirst", function () { return At; }), n.d(e, "getType", function () { return Tt; }), n.d(e, "isArguments", function () { return Nt; }), n.d(e, "isArray", function () { return l; }), n.d(e, "isArrayLike", function () { return r; }), n.d(e, "isBoolean", function () { return Bt; }), n.d(e, "isDate", function () { return Lt; }), n.d(e, "isError", function () { return Dt; }), n.d(e, "isFunction", function () { return u; }), n.d(e, "isFinite", function () { return _t; }), n.d(e, "isNil", function () { return h; }), n.d(e, "isNull", function () { return Rt; }), n.d(e, "isNumber", function () { return it; }), n.d(e, "isObject", function () { return d; }), n.d(e, "isObjectLike", function () { return m; }), n.d(e, "isPlainObject", function () { return b; }), n.d(e, "isPrototype", function () { return Yt; }), n.d(e, "isRegExp", function () { return Xt; }), n.d(e, "isString", function () { return D; }), n.d(e, "isType", function () { return c; }), n.d(e, "isUndefined", function () { return zt; }), n.d(e, "isElement", function () { return Wt; }), n.d(e, "requestAnimationFrame", function () { return qt; }), n.d(e, "clearAnimationFrame", function () { return Vt; }), n.d(e, "augment", function () { return Ut; }), n.d(e, "clone", function () { return Kt; }), n.d(e, "debounce", function () { return $t; }), n.d(e, "memoize", function () { return Qt; }), n.d(e, "deepMix", function () { return te; }), n.d(e, "each", function () { return p; }), n.d(e, "extend", function () { return ee; }), n.d(e, "indexOf", function () { return ne; }), n.d(e, "isEmpty", function () { return ie; }), n.d(e, "isEqual", function () { return oe; }), n.d(e, "isEqualWith", function () { return ae; }), n.d(e, "map", function () { return se; }), n.d(e, "mapValues", function () { return ue; }), n.d(e, "mix", function () { return Ht; }), n.d(e, "assign", function () { return Ht; }), n.d(e, "get", function () { return he; }), n.d(e, "set", function () { return le; }), n.d(e, "pick", function () { return de; }), n.d(e, "omit", function () { return pe; }), n.d(e, "throttle", function () { return ge; }), n.d(e, "toArray", function () { return ve; }), n.d(e, "toString", function () { return kt; }), n.d(e, "uniqueId", function () { return me; }), n.d(e, "noop", function () { return be; }), n.d(e, "identity", function () { return xe; }), n.d(e, "size", function () { return Se; }), n.d(e, "measureTextWidth", function () { return Me; }), n.d(e, "getEllipsisText", function () { return ke; }), n.d(e, "Cache", function () { return je; }); var r = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = function (t, e) { return !!r(t) && t.indexOf(e) > -1; }, o = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; e(o, i) && n.push(o); } return n; }, a = function (t, e) { return ( void 0 === e && (e = []), o(t, function (t) { return !i(e, t); }) ); }, s = {}.toString, c = function (t, e) { return s.call(t) === "[object " + e + "]"; }, u = function (t) { return c(t, "Function"); }, h = function (t) { return null == t; }, l = function (t) { return Array.isArray ? Array.isArray(t) : c(t, "Array"); }; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var d = function (t) { var e = f(t); return (null !== t && "object" === e) || "function" === e; }; var p = function (t, e) { if (t) if (l(t)) for (var n = 0, r = t.length; n < r && !1 !== e(t[n], n); n++); else if (d(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === e(t[i], i)) break; }, g = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(r); }), e ); }; var v = function (t, e) { var n = g(e), r = n.length; if (h(t)) return !r; for (var i = 0; i < r; i += 1) { var o = n[i]; if (e[o] !== t[o] || !(o in t)) return !1; } return !0; }; function y(t) { return (y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var m = function (t) { return "object" === y(t) && null !== t; }, b = function (t) { if (!m(t) || !c(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var e = t; null !== Object.getPrototypeOf(e); ) e = Object.getPrototypeOf(e); return Object.getPrototypeOf(t) === e; }; var x = function (t, e) { if (!l(t)) return null; var n; if ( (u(e) && (n = e), b(e) && (n = function (t) { return v(t, e); }), n) ) for (var r = 0; r < t.length; r += 1) if (n(t[r])) return t[r]; return null; }; var S = function (t, e, n) { void 0 === n && (n = 0); for (var r = n; r < t.length; r++) if (e(t[r], r)) return r; return -1; }, w = function (t, e) { for (var n = null, r = 0; r < t.length; r++) { var i = t[r][e]; if (!h(i)) { n = l(i) ? i[0] : i; break; } } return n; }, O = function (t) { if (!l(t)) return []; for (var e = [], n = 0; n < t.length; n++) e = e.concat(t[n]); return e; }, M = function t(e, n) { if ((void 0 === n && (n = []), l(e))) for (var r = 0; r < e.length; r += 1) t(e[r], n); else n.push(e); return n; }, k = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.max(t, e); }, t[0]); }, j = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.min(t, e); }, t[0]); }, C = function (t) { var e = t.filter(function (t) { return !isNaN(t); }); if (!e.length) return { min: 0, max: 0 }; if (l(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); e = n; } var i = k(e); return { min: j(e), max: i }; }, E = Array.prototype, P = E.splice, A = E.indexOf, I = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r++) for (var i = e[r], o = -1; (o = A.call(t, i)) > -1; ) P.call(t, o, 1); return t; }, T = Array.prototype.splice, N = function (t, e) { if (!r(t)) return []; for (var n = t ? e.length : 0, i = n - 1; n--; ) { var o = void 0, a = e[n]; (n !== i && a === o) || ((o = a), T.call(t, a, 1)); } return t; }, B = function (t, e, n) { if (!l(t) && !b(t)) return t; var r = n; return ( p(t, function (t, n) { r = e(r, t, n); }), r ); }, L = function (t, e) { var n = []; if (!r(t)) return n; for (var i = -1, o = [], a = t.length; ++i < a; ) { var s = t[i]; e(s, i, t) && (n.push(s), o.push(i)); } return N(t, o), n; }, D = function (t) { return c(t, "String"); }; var _ = function (t, e) { var n; if (u(e)) n = function (t, n) { return e(t) - e(n); }; else { var r = []; D(e) ? r.push(e) : l(e) && (r = e), (n = function (t, e) { for (var n = 0; n < r.length; n += 1) { var i = r[n]; if (t[i] > e[i]) return 1; if (t[i] < e[i]) return -1; } return 0; }); } return t.sort(n), t; }; function R(t, e) { void 0 === e && (e = new Map()); var n = []; if (Array.isArray(t)) for (var r = 0, i = t.length; r < i; r++) { var o = t[r]; e.has(o) || (n.push(o), e.set(o, !0)); } return n; } var F = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return R([].concat.apply([], t)); }, Y = function (t, e) { for (var n = [], r = {}, i = 0; i < t.length; i++) { var o = t[i][e]; if (!h(o)) { l(o) || (o = [o]); for (var a = 0; a < o.length; a++) { var s = o[a]; r[s] || (n.push(s), (r[s] = !0)); } } } return n; }; function X(t) { if (r(t)) return t[0]; } function z(t) { if (r(t)) { return t[t.length - 1]; } } var W = function (t, e) { return !(!l(t) && !D(t)) && t[0] === e; }; var q = function (t, e) { return !(!l(t) && !D(t)) && t[t.length - 1] === e; }, V = function (t, e) { for (var n = 0; n < t.length; n++) if (!e(t[n], n)) return !1; return !0; }, G = function (t, e) { for (var n = 0; n < t.length; n++) if (e(t[n], n)) return !0; return !1; }, H = Object.prototype.hasOwnProperty; var U = function (t, e) { if (!e || !l(t)) return {}; for ( var n, r = {}, i = u(e) ? e : function (t) { return t[e]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (n = i(a)), H.call(r, n) ? r[n].push(a) : (r[n] = [a]); } return r; }; function Z(t, e) { if (!e) return { 0: t }; if (!u(e)) { var n = l(e) ? e : e.replace(/\s+/g, "").split("*"); e = function (t) { for (var e = "_", r = 0, i = n.length; r < i; r++) e += t[n[r]] && t[n[r]].toString(); return e; }; } return U(t, e); } var K = function (t, e) { if (!e) return [t]; var n = Z(t, e), r = []; for (var i in n) r.push(n[i]); return r; }; var $ = function (t, e) { return t["_wrap_" + e]; }; var Q = function (t, e) { if (t["_wrap_" + e]) return t["_wrap_" + e]; var n = function (n) { t[e](n); }; return (t["_wrap_" + e] = n), n; }, J = {}; var tt = function (t) { var e = J[t]; if (!e) { for (var n = t.toString(16), r = n.length; r < 6; r++) n = "0" + n; (e = "#" + n), (J[t] = e); } return e; }; var et = function (t) { var e = 0, n = 0, r = 0, i = 0; return ( l(t) ? 1 === t.length ? (e = n = r = i = t[0]) : 2 === t.length ? ((e = r = t[0]), (n = i = t[1])) : 3 === t.length ? ((e = t[0]), (n = i = t[1]), (r = t[2])) : ((e = t[0]), (n = t[1]), (r = t[2]), (i = t[3])) : (e = n = r = i = t), { r1: e, r2: n, r3: r, r4: i } ); }, nt = function (t, e, n) { return t < e ? e : t > n ? n : t; }, rt = function (t, e) { var n = e.toString(), r = n.indexOf("."); if (-1 === r) return Math.round(t); var i = n.substr(r + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }, it = function (t) { return c(t, "Number"); }, ot = function (t) { return it(t) && t % 1 != 0; }, at = function (t) { return it(t) && t % 2 == 0; }, st = Number.isInteger ? Number.isInteger : function (t) { return it(t) && t % 1 == 0; }, ct = function (t) { return it(t) && t < 0; }; function ut(t, e, n) { return void 0 === n && (n = 1e-5), Math.abs(t - e) < n; } var ht = function (t) { return it(t) && t % 2 != 0; }, lt = function (t) { return it(t) && t > 0; }, ft = function (t, e) { if (l(t)) { for (var n, r = -1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a > r && ((n = o), (r = a)); } return n; } }, dt = function (t, e) { if (l(t)) { for (var n, r = 1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a < r && ((n = o), (r = a)); } return n; } }, pt = function (t, e) { return ((t % e) + e) % e; }, gt = 180 / Math.PI, vt = function (t) { return gt * t; }, yt = parseInt, mt = Math.PI / 180, bt = function (t) { return mt * t; }, xt = p, St = function (t, e) { return t.hasOwnProperty(e); }, wt = St, Ot = Object.values ? function (t) { return Object.values(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(n); }), e ); }, Mt = function (t, e) { return i(Ot(t), e); }, kt = function (t) { return h(t) ? "" : t.toString(); }, jt = function (t) { return kt(t).toLowerCase(); }, Ct = function (t) { var e = kt(t); return e.charAt(0).toLowerCase() + e.substring(1); }; var Et = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === e[n] ? "" : e[n]; }) : t; }, Pt = function (t) { return kt(t).toUpperCase(); }, At = function (t) { var e = kt(t); return e.charAt(0).toUpperCase() + e.substring(1); }, It = {}.toString, Tt = function (t) { return It.call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }, Nt = function (t) { return c(t, "Arguments"); }, Bt = function (t) { return c(t, "Boolean"); }, Lt = function (t) { return c(t, "Date"); }, Dt = function (t) { return c(t, "Error"); }, _t = function (t) { return it(t) && isFinite(t); }, Rt = function (t) { return null === t; }, Ft = Object.prototype, Yt = function (t) { var e = t && t.constructor; return t === (("function" == typeof e && e.prototype) || Ft); }, Xt = function (t) { return c(t, "RegExp"); }, zt = function (t) { return void 0 === t; }, Wt = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; function qt(t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); } function Vt(t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); } function Gt(t, e) { for (var n in e) e.hasOwnProperty(n) && "constructor" !== n && void 0 !== e[n] && (t[n] = e[n]); } function Ht(t, e, n, r) { return e && Gt(t, e), n && Gt(t, n), r && Gt(t, r), t; } var Ut = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var n = t[0], r = 1; r < t.length; r++) { var i = t[r]; u(i) && (i = i.prototype), Ht(n.prototype, i); } }; function Zt(t) { return (Zt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Kt = function t(e) { if ("object" !== Zt(e) || null === e) return e; var n; if (l(e)) { n = []; for (var r = 0, i = e.length; r < i; r++) "object" === Zt(e[r]) && null != e[r] ? (n[r] = t(e[r])) : (n[r] = e[r]); } else for (var o in ((n = {}), e)) "object" === Zt(e[o]) && null != e[o] ? (n[o] = t(e[o])) : (n[o] = e[o]); return n; }; var $t = function (t, e, n) { var r; return function () { var i = this, o = arguments, a = function () { (r = null), n || t.apply(i, o); }, s = n && !r; clearTimeout(r), (r = setTimeout(a, e)), s && t.apply(i, o); }; }, Qt = function (t, e) { if (!u(t)) throw new TypeError("Expected a function"); var n = function n() { for (var r = [], i = 0; i < arguments.length; i++) r[i] = arguments[i]; var o = e ? e.apply(this, r) : r[0], a = n.cache; if (a.has(o)) return a.get(o); var s = t.apply(this, r); return a.set(o, s), s; }; return (n.cache = new Map()), n; }; function Jt(t, e, n, r) { for (var i in ((n = n || 0), (r = r || 5), e)) if (e.hasOwnProperty(i)) { var o = e[i]; null !== o && b(o) ? (b(t[i]) || (t[i] = {}), n < r ? Jt(t[i], o, n + 1, r) : (t[i] = e[i])) : l(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var te = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r += 1) Jt(t, e[r]); return t; }, ee = function (t, e, n, r) { u(e) || ((n = e), (e = t), (t = function () {})); var i = Object.create ? function (t, e) { return Object.create(t, { constructor: { value: e } }); } : function (t, e) { function n() {} n.prototype = t; var r = new n(); return (r.constructor = e), r; }, o = i(e.prototype, t); return ( (t.prototype = Ht(o, t.prototype)), (t.superclass = i(e.prototype, e)), Ht(o, n), Ht(t, r), t ); }, ne = function (t, e) { if (!r(t)) return -1; var n = Array.prototype.indexOf; if (n) return n.call(t, e); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === e) { i = o; break; } return i; }, re = Object.prototype.hasOwnProperty; var ie = function (t) { if (h(t)) return !0; if (r(t)) return !t.length; var e = Tt(t); if ("Map" === e || "Set" === e) return !t.size; if (Yt(t)) return !Object.keys(t).length; for (var n in t) if (re.call(t, n)) return !1; return !0; }, oe = function t(e, n) { if (e === n) return !0; if (!e || !n) return !1; if (D(e) || D(n)) return !1; if (r(e) || r(n)) { if (e.length !== n.length) return !1; for (var i = !0, o = 0; o < e.length && (i = t(e[o], n[o])); o++); return i; } if (m(e) || m(n)) { var a = Object.keys(e), s = Object.keys(n); if (a.length !== s.length) return !1; for (i = !0, o = 0; o < a.length && (i = t(e[a[o]], n[a[o]])); o++); return i; } return !1; }, ae = function (t, e, n) { return u(n) ? !!n(t, e) : oe(t, e); }, se = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; n.push(e(o, i)); } return n; }, ce = function (t) { return t; }, ue = function (t, e) { void 0 === e && (e = ce); var n = {}; return ( d(t) && !h(t) && Object.keys(t).forEach(function (r) { n[r] = e(t[r], r); }), n ); }, he = function (t, e, n) { for (var r = 0, i = D(e) ? e.split(".") : e; t && r < i.length; ) t = t[i[r++]]; return void 0 === t || r < i.length ? n : t; }, le = function (t, e, n) { var r = t, i = D(e) ? e.split(".") : e; return ( i.forEach(function (t, e) { e < i.length - 1 ? (d(r[t]) || (r[t] = it(i[e + 1]) ? [] : {}), (r = r[t])) : (r[t] = n); }), t ); }, fe = Object.prototype.hasOwnProperty, de = function (t, e) { if (null === t || !b(t)) return {}; var n = {}; return ( p(e, function (e) { fe.call(t, e) && (n[e] = t[e]); }), n ); }, pe = function (t, e) { return B( t, function (t, n, r) { return e.includes(r) || (t[r] = n), t; }, {}, ); }, ge = function (t, e, n) { var r, i, o, a, s = 0; n || (n = {}); var c = function () { (s = !1 === n.leading ? 0 : Date.now()), (r = null), (a = t.apply(i, o)), r || (i = o = null); }, u = function () { var u = Date.now(); s || !1 !== n.leading || (s = u); var h = e - (u - s); return ( (i = this), (o = arguments), h <= 0 || h > e ? (r && (clearTimeout(r), (r = null)), (s = u), (a = t.apply(i, o)), r || (i = o = null)) : r || !1 === n.trailing || (r = setTimeout(c, h)), a ); }; return ( (u.cancel = function () { clearTimeout(r), (s = 0), (r = i = o = null); }), u ); }, ve = function (t) { return r(t) ? Array.prototype.slice.call(t) : []; }, ye = {}, me = function (t) { return ye[(t = t || "g")] ? (ye[t] += 1) : (ye[t] = 1), t + ye[t]; }, be = function () {}, xe = function (t) { return t; }; function Se(t) { return h(t) ? 0 : r(t) ? t.length : Object.keys(t).length; } var we, Oe = n(1), Me = Qt( function (t, e) { void 0 === e && (e = {}); var n = e.fontSize, r = e.fontFamily, i = e.fontWeight, o = e.fontStyle, a = e.fontVariant; return ( we || (we = document.createElement("canvas").getContext("2d")), (we.font = [o, a, i, n + "px", r].join(" ")), we.measureText(D(t) ? t : "").width ); }, function (t, e) { return void 0 === e && (e = {}), Object(Oe.g)([t], Ot(e)).join(""); }, ), ke = function (t, e, n, r) { void 0 === r && (r = "..."); var i, o, a = Me(r, n), s = D(t) ? t : kt(t), c = e, u = []; if (Me(t, n) <= e) return t; for (; (i = s.substr(0, 16)), !((o = Me(i, n)) + a > c && o > c); ) if ((u.push(i), (c -= o), !(s = s.substr(16)))) return u.join(""); for (; (i = s.substr(0, 1)), !((o = Me(i, n)) + a > c); ) if ((u.push(i), (c -= o), !(s = s.substr(1)))) return u.join(""); return "" + u.join("") + r; }, je = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, e) { var n = this.map[t]; return void 0 === n ? e : n; }), (t.prototype.set = function (t, e) { this.map[t] = e; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); }, 1: function (t, e, n) { "use strict"; n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }), n.d(e, "e", function () { return a; }), n.d(e, "b", function () { return s; }), n.d(e, "d", function () { return c; }), n.d(e, "g", function () { return u; }), n.d(e, "f", function () { return h; }); var r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }; function i(t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); } var o = function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function a(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } function s(t, e, n, r) { return new (n || (n = Promise))(function (i, o) { function a(t) { try { c(r.next(t)); } catch (t) { o(t); } } function s(t) { try { c(r.throw(t)); } catch (t) { o(t); } } function c(t) { var e; t.done ? i(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } c((r = r.apply(t, e || [])).next()); }); } function c(t, e) { var n, r, i, o, a = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: s(0), throw: s(1), return: s(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function s(s) { return function (c) { return (function (s) { if (n) throw new TypeError("Generator is already executing."); for (; o && ((o = 0), s[0] && (a = 0)), a; ) try { if ( ((n = 1), r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) ) return i; switch (((r = 0), i && (s = [2 & s[0], i.value]), s[0])) { case 0: case 1: i = s; break; case 4: return a.label++, { value: s[1], done: !1 }; case 5: a.label++, (r = s[1]), (s = [0]); continue; case 7: (s = a.ops.pop()), a.trys.pop(); continue; default: if ( !((i = a.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== s[0] && 2 !== s[0])) ) { a = 0; continue; } if (3 === s[0] && (!i || (s[1] > i[0] && s[1] < i[3]))) { a.label = s[1]; break; } if (6 === s[0] && a.label < i[1]) { (a.label = i[1]), (i = s); break; } if (i && a.label < i[2]) { (a.label = i[2]), a.ops.push(s); break; } i[2] && a.ops.pop(), a.trys.pop(); continue; } s = e.call(t, a); } catch (t) { (s = [6, t]), (r = 0); } finally { n = i = 0; } if (5 & s[0]) throw s[1]; return { value: s[0] ? s[1] : void 0, done: !0 }; })([s, c]); }; } } Object.create; function u() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; } function h(t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); } Object.create; }, 11: function (t, e, n) { "use strict"; var r = n(1), i = n(8), o = n(3), a = n(12), s = n(31), c = n(52), u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(r.a)(Object(r.a)({}, e), { lineWidth: 1, lineAppendWidth: 0, strokeOpacity: 1, fillOpacity: 1, }); }), (e.prototype.getShapeBase = function () { return s; }), (e.prototype.getGroupBase = function () { return c.a; }), (e.prototype.onCanvasChange = function (t) { Object(a.h)(this, t); }), (e.prototype.calculateBBox = function () { var t = this.get("type"), e = this.getHitLineWidth(), n = Object(i.getBBoxMethod)(t)(this), r = e / 2, o = n.x - r, a = n.y - r, s = n.x + n.width + r, c = n.y + n.height + r; return { x: o, minX: o, y: a, minY: a, width: n.width + e, height: n.height + e, maxX: s, maxY: c, }; }), (e.prototype.isFill = function () { return !!this.attrs.fill || this.isClipShape(); }), (e.prototype.isStroke = function () { return !!this.attrs.stroke; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), Object(a.a)(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.draw = function (t, e) { var n = this.cfg.clipShape; if (e) { if (!1 === this.cfg.refresh) return void this.set("hasChanged", !1); var r = this.getCanvasBBox(); if (!Object(o.e)(e, r)) return ( this.set("hasChanged", !1), void (this.cfg.isInView && this._afterDraw()) ); } t.save(), Object(a.a)(t, this), this._applyClip(t, n), this.drawPath(t), t.restore(), this._afterDraw(); }), (e.prototype.getCanvasViewBox = function () { var t = this.cfg.canvas; return t ? t.getViewRange() : null; }), (e.prototype.cacheCanvasBBox = function () { var t = this.getCanvasViewBox(); if (t) { var e = this.getCanvasBBox(), n = Object(o.e)(e, t); this.set("isInView", n), n ? this.set("cacheCanvasBBox", e) : this.set("cacheCanvasBBox", null); } }), (e.prototype._afterDraw = function () { this.cacheCanvasBBox(), this.set("hasChanged", !1), this.set("refresh", null); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("isInView", null), this.set("hasChanged", !1); }), (e.prototype.drawPath = function (t) { this.createPath(t), this.strokeAndFill(t), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { t.fill(); }), (e.prototype.stroke = function (t) { t.stroke(); }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, a = e.fillOpacity; this.isFill() && (Object(o.h)(a) || 1 === a ? this.fill(t) : ((t.globalAlpha = a), this.fill(t), (t.globalAlpha = r))), this.isStroke() && n > 0 && (Object(o.h)(i) || 1 === i || (t.globalAlpha = i), this.stroke(t)), this.afterDrawPath(t); }), (e.prototype.createPath = function (t) {}), (e.prototype.afterDrawPath = function (t) {}), (e.prototype.isInShape = function (t, e) { var n = this.isStroke(), r = this.isFill(), i = this.getHitLineWidth(); return this.isInStrokeOrPath(t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !1; }), (e.prototype.getHitLineWidth = function () { if (!this.isStroke()) return 0; var t = this.attrs; return t.lineWidth + t.lineAppendWidth; }), e ); })(i.AbstractShape); e.a = u; }, 118: function (t, e, n) { "use strict"; n.d(e, "a", function () { return o; }), n.d(e, "b", function () { return i; }); var r = new Map(); function i(t, e) { r.set(t, e); } function o(t) { return r.get(t); } var a = function (t) { var e = t.attr(); return { x: e.x, y: e.y, width: e.width, height: e.height }; }, s = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.r; return { x: n - i, y: r - i, width: 2 * i, height: 2 * i }; }, c = n(9); function u(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function h(t, e) { var n = t.get("startArrowShape"), r = t.get("endArrowShape"); return ( n && (e = u(e, n.getCanvasBBox())), r && (e = u(e, r.getCanvasBBox())), e ); } var l = n(46), f = n(28), d = n(0); function p(t, e) { var n = t.prePoint, r = t.currentPoint, i = t.nextPoint, o = Math.pow(r[0] - n[0], 2) + Math.pow(r[1] - n[1], 2), a = Math.pow(r[0] - i[0], 2) + Math.pow(r[1] - i[1], 2), s = Math.pow(n[0] - i[0], 2) + Math.pow(n[1] - i[1], 2), c = Math.acos((o + a - s) / (2 * Math.sqrt(o) * Math.sqrt(a))); if (!c || 0 === Math.sin(c) || Object(d.isNumberEqual)(c, 0)) return { xExtra: 0, yExtra: 0 }; var u = Math.abs(Math.atan2(i[1] - r[1], i[0] - r[0])), h = Math.abs(Math.atan2(i[0] - r[0], i[1] - r[1])); return ( (u = u > Math.PI / 2 ? Math.PI - u : u), (h = h > Math.PI / 2 ? Math.PI - h : h), { xExtra: Math.cos(c / 2 - u) * ((e / 2) * (1 / Math.sin(c / 2))) - e / 2 || 0, yExtra: Math.cos(h - c / 2) * ((e / 2) * (1 / Math.sin(c / 2))) - e / 2 || 0, } ); } i("rect", a), i("image", a), i("circle", s), i("marker", s), i("polyline", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } var a = c.f.getBBoxByArray(n, r), s = a.x, u = a.y, l = { minX: s, minY: u, maxX: s + a.width, maxY: u + a.height }; return { x: (l = h(t, l)).minX, y: l.minY, width: l.maxX - l.minX, height: l.maxY - l.minY, }; }), i("polygon", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } return c.f.getBBoxByArray(n, r); }), i("text", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Object(l.a)(e)); var c, u = Object(l.c)(i, s); if (u) { var h = e.textAlign, f = e.textBaseline, d = Object(l.b)(i, o, a), p = { x: n, y: r - d }; h && ("end" === h || "right" === h ? (p.x -= u) : "center" === h && (p.x -= u / 2)), f && ("top" === f ? (p.y += d) : "middle" === f && (p.y += d / 2)), (c = { x: p.x, y: p.y, width: u, height: d }); } else c = { x: n, y: r, width: 0, height: 0 }; return c; }), i("path", function (t) { var e = t.attr(), n = e.path, r = e.stroke ? e.lineWidth : 0, i = (function (t, e) { for (var n = [], r = [], i = [], o = 0; o < t.length; o++) { var a = (m = t[o]).currentPoint, s = m.params, u = m.prePoint, h = void 0; switch (m.command) { case "Q": h = c.e.box(u[0], u[1], s[1], s[2], s[3], s[4]); break; case "C": h = c.b.box(u[0], u[1], s[1], s[2], s[3], s[4], s[5], s[6]); break; case "A": var l = m.arcParams; h = c.a.box( l.cx, l.cy, l.rx, l.ry, l.xRotation, l.startAngle, l.endAngle, ); break; default: n.push(a[0]), r.push(a[1]); } h && ((m.box = h), n.push(h.x, h.x + h.width), r.push(h.y, h.y + h.height)), e && ("L" === m.command || "M" === m.command) && m.prePoint && m.nextPoint && i.push(m); } (n = n.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })), (r = r.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })); var f = Object(d.min)(n), g = Object(d.min)(r), v = Object(d.max)(n), y = Object(d.max)(r); if (0 === i.length) return { x: f, y: g, width: v - f, height: y - g }; for (o = 0; o < i.length; o++) { var m; (a = (m = i[o]).currentPoint)[0] === f ? (f -= p(m, e).xExtra) : a[0] === v && (v += p(m, e).xExtra), a[1] === g ? (g -= p(m, e).yExtra) : a[1] === y && (y += p(m, e).yExtra); } return { x: f, y: g, width: v - f, height: y - g }; })(t.get("segments") || Object(f.d)(n), r), o = i.x, a = i.y, s = { minX: o, minY: a, maxX: o + i.width, maxY: a + i.height }; return { x: (s = h(t, s)).minX, y: s.minY, width: s.maxX - s.minX, height: s.maxY - s.minY, }; }), i("line", function (t) { var e = t.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = { minX: Math.min(n, i), maxX: Math.max(n, i), minY: Math.min(r, o), maxY: Math.max(r, o), }; return { x: (a = h(t, a)).minX, y: a.minY, width: a.maxX - a.minX, height: a.maxY - a.minY, }; }), i("ellipse", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; return { x: n - i, y: r - o, width: 2 * i, height: 2 * o }; }); }, 119: function (t, e, n) { "use strict"; var r = n(1), i = n(2), o = (n(8), n(35)), a = n(96), s = n(33), c = n(22), u = n(41), h = (n(423), n(424), n(127), n(128), { version: c.a.version, Graph: a.a, Util: u.a, Layout: s.a, Layouts: s.b, registerLayout: s.c, unRegisterLayout: s.d, Global: c.a, registerBehavior: i.i, registerCombo: i.j, registerEdge: i.k, registerNode: i.l, Algorithm: o, Arrow: i.d, Marker: i.f, Shape: i.g, }); var l, f = ((l = a.b), function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return l.apply(null, Object(r.g)(t, [h])); }); (h.registerGraph = f), (e.default = h); }, 12: function (t, e, n) { "use strict"; n.d(e, "a", function () { return u; }), n.d(e, "d", function () { return h; }), n.d(e, "b", function () { return l; }), n.d(e, "c", function () { return f; }), n.d(e, "e", function () { return g; }), n.d(e, "h", function () { return v; }), n.d(e, "f", function () { return y; }), n.d(e, "g", function () { return m; }); var r = n(0), i = n(94), o = n(63), a = n(3), s = n(23), c = { fill: "fillStyle", stroke: "strokeStyle", opacity: "globalAlpha", }; function u(t, e) { var n = e.attr(); for (var o in n) { var a = n[o], s = c[o] ? c[o] : o; "matrix" === s && a ? t.transform(a[0], a[1], a[3], a[4], a[6], a[7]) : "lineDash" === s && t.setLineDash ? Object(r.isArray)(a) && t.setLineDash(a) : ("strokeStyle" === s || "fillStyle" === s ? (a = Object(i.b)(t, e, a)) : "globalAlpha" === s && (a *= t.globalAlpha), (t[s] = a)); } } function h(t, e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; i.cfg.visible ? i.draw(t, n) : i.skipDraw(); } } function l(t, e, n) { var i = t.get("refreshElements"); Object(r.each)(i, function (e) { if (e !== t) for (var n = e.cfg.parent; n && n !== t && !n.cfg.refresh; ) (n.cfg.refresh = !0), (n = n.cfg.parent); }), i[0] === t ? d(e, n) : (function t(e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; if (i.cfg.visible) if (i.cfg.hasChanged) (i.cfg.refresh = !0), i.isGroup() && d(i.cfg.children, n); else if (i.cfg.refresh) i.isGroup() && t(i.cfg.children, n); else { var o = p(i, n); (i.cfg.refresh = o), o && i.isGroup() && t(i.cfg.children, n); } } })(e, n); } function f(t) { for (var e = 0; e < t.length; e++) { var n = t[e]; (n.cfg.hasChanged = !1), n.isGroup() && !n.destroyed && f(n.cfg.children); } } function d(t, e) { for (var n = 0; n < t.length; n++) { var r = t[n]; (r.cfg.refresh = !0), r.isGroup() && d(r.get("children"), e); } } function p(t, e) { var n = t.cfg.cacheCanvasBBox; return t.cfg.isInView && n && Object(a.e)(n, e); } function g(t, e, n, r) { var i = n.path, a = n.startArrow, c = n.endArrow; if (i) { var u = [0, 0], h = [0, 0], l = { dx: 0, dy: 0 }; e.beginPath(); for (var f = 0; f < i.length; f++) { var d = i[f], p = d[0]; if (0 === f && a && a.d) { var g = t.getStartTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], a.d); } else if (f === i.length - 2 && "Z" === i[f + 1][0] && c && c.d) { if ("Z" === i[f + 1][0]) { g = t.getEndTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], c.d); } } else if (f === i.length - 1 && c && c.d && "Z" !== i[0]) { g = t.getEndTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], c.d); } var v = l.dx, y = l.dy; switch (p) { case "M": e.moveTo(d[1] - v, d[2] - y), (h = [d[1], d[2]]); break; case "L": e.lineTo(d[1] - v, d[2] - y); break; case "Q": e.quadraticCurveTo(d[1], d[2], d[3] - v, d[4] - y); break; case "C": e.bezierCurveTo(d[1], d[2], d[3], d[4], d[5] - v, d[6] - y); break; case "A": var m = void 0; r ? (m = r[f]) || ((m = Object(o.a)(u, d)), (r[f] = m)) : (m = Object(o.a)(u, d)); var b = m.cx, x = m.cy, S = m.rx, w = m.ry, O = m.startAngle, M = m.endAngle, k = m.xRotation, j = m.sweepFlag; if (e.ellipse) e.ellipse(b, x, S, w, k, O, M, 1 - j); else { var C = S > w ? S : w, E = S > w ? 1 : S / w, P = S > w ? w / S : 1; e.translate(b, x), e.rotate(k), e.scale(E, P), e.arc(0, 0, C, O, M, 1 - j), e.scale(1 / E, 1 / P), e.rotate(-k), e.translate(-b, -x); } break; case "Z": e.closePath(); } if ("Z" === p) u = h; else { var A = d.length; u = [d[A - 2], d[A - 1]]; } } } } function v(t, e) { var n = t.get("canvas"); n && ("remove" === e && (t._cacheCanvasBBox = t.get("cacheCanvasBBox")), t.get("hasChanged") || (t.set("hasChanged", !0), (t.cfg.parent && t.cfg.parent.get("hasChanged")) || (n.refreshElement(t, e, n), n.get("autoDraw") && n.draw()))); } function y(t) { if (!t.length) return null; var e = [], n = [], i = [], o = []; return ( Object(r.each)(t, function (t) { var r = (function (t) { var e; if (t.destroyed) e = t._cacheCanvasBBox; else { var n = t.get("cacheCanvasBBox"), r = n && !(!n.width || !n.height), i = t.getCanvasBBox(), o = i && !(!i.width || !i.height); r && o ? (e = Object(a.l)(n, i)) : r ? (e = n) : o && (e = i); } return e; })(t); r && (e.push(r.minX), n.push(r.minY), i.push(r.maxX), o.push(r.maxY)); }), { minX: Math.min.apply(null, e), minY: Math.min.apply(null, n), maxX: Math.max.apply(null, i), maxY: Math.max.apply(null, o), } ); } function m(t, e) { return t && e && Object(a.e)(t, e) ? { minX: Math.max(t.minX, e.minX), minY: Math.max(t.minY, e.minY), maxX: Math.min(t.maxX, e.maxX), maxY: Math.min(t.maxY, e.maxY), } : null; } }, 120: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.assembleFont = e.getTextWidth = e.getLineSpaceing = e.getTextHeight = void 0); var r = n(207), i = n(208); function o(t, e) { return e ? e - t : 0.14 * t; } (e.getTextHeight = function (t, e, n) { var i = 1; return ( r.isString(t) && (i = t.split("\n").length), i > 1 ? e * i + o(e, n) * (i - 1) : e ); }), (e.getLineSpaceing = o), (e.getTextWidth = function (t, e) { var n = i.getOffScreenContext(), o = 0; if (r.isNil(t) || "" === t) return o; if ((n.save(), (n.font = e), r.isString(t) && t.includes("\n"))) { var a = t.split("\n"); r.each(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; }), (e.assembleFont = function (t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); }); }, 122: function (t, e) {}, 123: function (t, e) {}, 124: function (t, e, n) { "use strict"; var r = n(1), i = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.isGroup = function () { return !0; }), (e.prototype.isEntityGroup = function () { return !1; }), (e.prototype.clone = function () { for ( var e = t.prototype.clone.call(this), n = this.getChildren(), r = 0; r < n.length; r++ ) { var i = n[r]; e.add(i.clone()); } return e; }), e ); })(n(92).a); e.a = i; }, 125: function (t, e, n) { "use strict"; var r = n(1), i = n(93), o = n(25), a = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(r.c)(e, t), (e.prototype._isInBBox = function (t, e) { var n = this.getBBox(); return n.minX <= t && n.maxX >= t && n.minY <= e && n.maxY >= e; }), (e.prototype.afterAttrsChange = function (e) { t.prototype.afterAttrsChange.call(this, e), this.clearCacheBBox(); }), (e.prototype.getBBox = function () { var t = this.cfg.bbox; return t || ((t = this.calculateBBox()), this.set("bbox", t)), t; }), (e.prototype.getCanvasBBox = function () { var t = this.cfg.canvasBBox; return ( t || ((t = this.calculateCanvasBBox()), this.set("canvasBBox", t)), t ); }), (e.prototype.applyMatrix = function (e) { t.prototype.applyMatrix.call(this, e), this.set("canvasBBox", null); }), (e.prototype.calculateCanvasBBox = function () { var t = this.getBBox(), e = this.getTotalMatrix(), n = t.minX, r = t.minY, i = t.maxX, a = t.maxY; if (e) { var s = Object(o.c)(e, [t.minX, t.minY]), c = Object(o.c)(e, [t.maxX, t.minY]), u = Object(o.c)(e, [t.minX, t.maxY]), h = Object(o.c)(e, [t.maxX, t.maxY]); (n = Math.min(s[0], c[0], u[0], h[0])), (i = Math.max(s[0], c[0], u[0], h[0])), (r = Math.min(s[1], c[1], u[1], h[1])), (a = Math.max(s[1], c[1], u[1], h[1])); } var l = this.attrs; if (l.shadowColor) { var f = l.shadowBlur, d = void 0 === f ? 0 : f, p = l.shadowOffsetX, g = void 0 === p ? 0 : p, v = l.shadowOffsetY, y = void 0 === v ? 0 : v, m = n - d + g, b = i + d + g, x = r - d + y, S = a + d + y; (n = Math.min(n, m)), (i = Math.max(i, b)), (r = Math.min(r, x)), (a = Math.max(a, S)); } return { x: n, y: r, minX: n, minY: r, maxX: i, maxY: a, width: i - n, height: a - r, }; }), (e.prototype.clearCacheBBox = function () { this.set("bbox", null), this.set("canvasBBox", null); }), (e.prototype.isClipShape = function () { return this.get("isClipShape"); }), (e.prototype.isInShape = function (t, e) { return !1; }), (e.prototype.isOnlyHitBox = function () { return !1; }), (e.prototype.isHit = function (t, e) { var n = this.get("startArrowShape"), r = this.get("endArrowShape"), i = [t, e, 1], o = (i = this.invertFromMatrix(i))[0], a = i[1], s = this._isInBBox(o, a); if (this.isOnlyHitBox()) return s; if (s && !this.isClipped(o, a)) { if (this.isInShape(o, a)) return !0; if (n && n.isHit(o, a)) return !0; if (r && r.isHit(o, a)) return !0; } return !1; }), e ); })(i.a); e.a = a; }, 126: function (t, e, n) { "use strict"; var r = n(214), i = {}; for (var o in r) r.hasOwnProperty(o) && (i[r[o]] = o); var a = (t.exports = { rgb: { channels: 3, labels: "rgb" }, hsl: { channels: 3, labels: "hsl" }, hsv: { channels: 3, labels: "hsv" }, hwb: { channels: 3, labels: "hwb" }, cmyk: { channels: 4, labels: "cmyk" }, xyz: { channels: 3, labels: "xyz" }, lab: { channels: 3, labels: "lab" }, lch: { channels: 3, labels: "lch" }, hex: { channels: 1, labels: ["hex"] }, keyword: { channels: 1, labels: ["keyword"] }, ansi16: { channels: 1, labels: ["ansi16"] }, ansi256: { channels: 1, labels: ["ansi256"] }, hcg: { channels: 3, labels: ["h", "c", "g"] }, apple: { channels: 3, labels: ["r16", "g16", "b16"] }, gray: { channels: 1, labels: ["gray"] }, }); for (var s in a) if (a.hasOwnProperty(s)) { if (!("channels" in a[s])) throw new Error("missing channels property: " + s); if (!("labels" in a[s])) throw new Error("missing channel labels property: " + s); if (a[s].labels.length !== a[s].channels) throw new Error("channel and label counts mismatch: " + s); var c = a[s].channels, u = a[s].labels; delete a[s].channels, delete a[s].labels, Object.defineProperty(a[s], "channels", { value: c }), Object.defineProperty(a[s], "labels", { value: u }); } function h(t, e) { return ( Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2) + Math.pow(t[2] - e[2], 2) ); } (a.rgb.hsl = function (t) { var e, n, r = t[0] / 255, i = t[1] / 255, o = t[2] / 255, a = Math.min(r, i, o), s = Math.max(r, i, o), c = s - a; return ( s === a ? (e = 0) : r === s ? (e = (i - o) / c) : i === s ? (e = 2 + (o - r) / c) : o === s && (e = 4 + (r - i) / c), (e = Math.min(60 * e, 360)) < 0 && (e += 360), (n = (a + s) / 2), [ e, 100 * (s === a ? 0 : n <= 0.5 ? c / (s + a) : c / (2 - s - a)), 100 * n, ] ); }), (a.rgb.hsv = function (t) { var e, n, r, i, o, a = t[0] / 255, s = t[1] / 255, c = t[2] / 255, u = Math.max(a, s, c), h = u - Math.min(a, s, c), l = function (t) { return (u - t) / 6 / h + 0.5; }; return ( 0 === h ? (i = o = 0) : ((o = h / u), (e = l(a)), (n = l(s)), (r = l(c)), a === u ? (i = r - n) : s === u ? (i = 1 / 3 + e - r) : c === u && (i = 2 / 3 + n - e), i < 0 ? (i += 1) : i > 1 && (i -= 1)), [360 * i, 100 * o, 100 * u] ); }), (a.rgb.hwb = function (t) { var e = t[0], n = t[1], r = t[2]; return [ a.rgb.hsl(t)[0], (1 / 255) * Math.min(e, Math.min(n, r)) * 100, 100 * (r = 1 - (1 / 255) * Math.max(e, Math.max(n, r))), ]; }), (a.rgb.cmyk = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255, i = Math.min(1 - e, 1 - n, 1 - r); return [ 100 * ((1 - e - i) / (1 - i) || 0), 100 * ((1 - n - i) / (1 - i) || 0), 100 * ((1 - r - i) / (1 - i) || 0), 100 * i, ]; }), (a.rgb.keyword = function (t) { var e, n = i[t]; if (n) return n; var o, a = 1 / 0; for (var s in r) r.hasOwnProperty(s) && (e = h(t, r[s])) < a && ((a = e), (o = s)); return o; }), (a.keyword.rgb = function (t) { return r[t]; }), (a.rgb.xyz = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255; return [ 100 * (0.4124 * (e = e > 0.04045 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92) + 0.3576 * (n = n > 0.04045 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92) + 0.1805 * (r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92)), 100 * (0.2126 * e + 0.7152 * n + 0.0722 * r), 100 * (0.0193 * e + 0.1192 * n + 0.9505 * r), ]; }), (a.rgb.lab = function (t) { var e = a.rgb.xyz(t), n = e[0], r = e[1], i = e[2]; return ( (r /= 100), (i /= 108.883), (n = (n /= 95.047) > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116), [ 116 * (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116) - 16, 500 * (n - r), 200 * (r - (i = i > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116)), ] ); }), (a.hsl.rgb = function (t) { var e, n, r, i, o, a, s = t[0] / 360, c = t[1] / 100, u = t[2] / 100; if (0 === c) return [(a = 255 * u), a, a]; for ( n = 2 * u - (r = u < 0.5 ? u * (1 + c) : u + c - u * c), o = [0, 0, 0], e = 0; e < 3; e++ ) (i = s + (1 / 3) * -(e - 1)) < 0 && i++, i > 1 && i--, (a = 6 * i < 1 ? n + 6 * (r - n) * i : 2 * i < 1 ? r : 3 * i < 2 ? n + (r - n) * (2 / 3 - i) * 6 : n), (o[e] = 255 * a); return o; }), (a.hsl.hsv = function (t) { var e = t[0], n = t[1] / 100, r = t[2] / 100, i = n, o = Math.max(r, 0.01); return ( (n *= (r *= 2) <= 1 ? r : 2 - r), (i *= o <= 1 ? o : 2 - o), [ e, 100 * (0 === r ? (2 * i) / (o + i) : (2 * n) / (r + n)), ((r + n) / 2) * 100, ] ); }), (a.hsv.rgb = function (t) { var e = t[0] / 60, n = t[1] / 100, r = t[2] / 100, i = Math.floor(e) % 6, o = e - Math.floor(e), a = 255 * r * (1 - n), s = 255 * r * (1 - n * o), c = 255 * r * (1 - n * (1 - o)); switch (((r *= 255), i)) { case 0: return [r, c, a]; case 1: return [s, r, a]; case 2: return [a, r, c]; case 3: return [a, s, r]; case 4: return [c, a, r]; case 5: return [r, a, s]; } }), (a.hsv.hsl = function (t) { var e, n, r = t[0], i = t[1] / 100, o = t[2] / 100, a = Math.max(o, 0.01), s = (2 - i) * o; return ( (n = i * a), [ r, 100 * (n = (n /= (e = (2 - i) * a) <= 1 ? e : 2 - e) || 0), 100 * (s /= 2), ] ); }), (a.hwb.rgb = function (t) { var e, n, r, i, o, a, s, c = t[0] / 360, u = t[1] / 100, h = t[2] / 100, l = u + h; switch ( (l > 1 && ((u /= l), (h /= l)), (r = 6 * c - (e = Math.floor(6 * c))), 0 != (1 & e) && (r = 1 - r), (i = u + r * ((n = 1 - h) - u)), e) ) { default: case 6: case 0: (o = n), (a = i), (s = u); break; case 1: (o = i), (a = n), (s = u); break; case 2: (o = u), (a = n), (s = i); break; case 3: (o = u), (a = i), (s = n); break; case 4: (o = i), (a = u), (s = n); break; case 5: (o = n), (a = u), (s = i); } return [255 * o, 255 * a, 255 * s]; }), (a.cmyk.rgb = function (t) { var e = t[0] / 100, n = t[1] / 100, r = t[2] / 100, i = t[3] / 100; return [ 255 * (1 - Math.min(1, e * (1 - i) + i)), 255 * (1 - Math.min(1, n * (1 - i) + i)), 255 * (1 - Math.min(1, r * (1 - i) + i)), ]; }), (a.xyz.rgb = function (t) { var e, n, r, i = t[0] / 100, o = t[1] / 100, a = t[2] / 100; return ( (n = -0.9689 * i + 1.8758 * o + 0.0415 * a), (r = 0.0557 * i + -0.204 * o + 1.057 * a), (e = (e = 3.2406 * i + -1.5372 * o + -0.4986 * a) > 0.0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - 0.055 : 12.92 * e), (n = n > 0.0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - 0.055 : 12.92 * n), (r = r > 0.0031308 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : 12.92 * r), [ 255 * (e = Math.min(Math.max(0, e), 1)), 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (r = Math.min(Math.max(0, r), 1)), ] ); }), (a.xyz.lab = function (t) { var e = t[0], n = t[1], r = t[2]; return ( (n /= 100), (r /= 108.883), (e = (e /= 95.047) > 0.008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116), [ 116 * (n = n > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (e - n), 200 * (n - (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116)), ] ); }), (a.lab.xyz = function (t) { var e, n, r, i = t[0]; (e = t[1] / 500 + (n = (i + 16) / 116)), (r = n - t[2] / 200); var o = Math.pow(n, 3), a = Math.pow(e, 3), s = Math.pow(r, 3); return ( (n = o > 0.008856 ? o : (n - 16 / 116) / 7.787), (e = a > 0.008856 ? a : (e - 16 / 116) / 7.787), (r = s > 0.008856 ? s : (r - 16 / 116) / 7.787), [(e *= 95.047), (n *= 100), (r *= 108.883)] ); }), (a.lab.lch = function (t) { var e, n = t[0], r = t[1], i = t[2]; return ( (e = (360 * Math.atan2(i, r)) / 2 / Math.PI) < 0 && (e += 360), [n, Math.sqrt(r * r + i * i), e] ); }), (a.lch.lab = function (t) { var e = t[0], n = t[1], r = (t[2] / 360) * 2 * Math.PI; return [e, n * Math.cos(r), n * Math.sin(r)]; }), (a.rgb.ansi16 = function (t) { var e = t[0], n = t[1], r = t[2], i = 1 in arguments ? arguments[1] : a.rgb.hsv(t)[2]; if (0 === (i = Math.round(i / 50))) return 30; var o = 30 + ((Math.round(r / 255) << 2) | (Math.round(n / 255) << 1) | Math.round(e / 255)); return 2 === i && (o += 60), o; }), (a.hsv.ansi16 = function (t) { return a.rgb.ansi16(a.hsv.rgb(t), t[2]); }), (a.rgb.ansi256 = function (t) { var e = t[0], n = t[1], r = t[2]; return e === n && n === r ? e < 8 ? 16 : e > 248 ? 231 : Math.round(((e - 8) / 247) * 24) + 232 : 16 + 36 * Math.round((e / 255) * 5) + 6 * Math.round((n / 255) * 5) + Math.round((r / 255) * 5); }), (a.ansi16.rgb = function (t) { var e = t % 10; if (0 === e || 7 === e) return t > 50 && (e += 3.5), [(e = (e / 10.5) * 255), e, e]; var n = 0.5 * (1 + ~~(t > 50)); return [ (1 & e) * n * 255, ((e >> 1) & 1) * n * 255, ((e >> 2) & 1) * n * 255, ]; }), (a.ansi256.rgb = function (t) { return t >= 232 ? [(n = 10 * (t - 232) + 8), n, n] : ((t -= 16), [ (Math.floor(t / 36) / 5) * 255, (Math.floor((e = t % 36) / 6) / 5) * 255, ((e % 6) / 5) * 255, ]); var e, n; }), (a.rgb.hex = function (t) { var e = ( ((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2])) ) .toString(16) .toUpperCase(); return "000000".substring(e.length) + e; }), (a.hex.rgb = function (t) { var e = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!e) return [0, 0, 0]; var n = e[0]; 3 === e[0].length && (n = n .split("") .map(function (t) { return t + t; }) .join("")); var r = parseInt(n, 16); return [(r >> 16) & 255, (r >> 8) & 255, 255 & r]; }), (a.rgb.hcg = function (t) { var e, n = t[0] / 255, r = t[1] / 255, i = t[2] / 255, o = Math.max(Math.max(n, r), i), a = Math.min(Math.min(n, r), i), s = o - a; return ( (e = s <= 0 ? 0 : o === n ? ((r - i) / s) % 6 : o === r ? 2 + (i - n) / s : 4 + (n - r) / s + 4), (e /= 6), [360 * (e %= 1), 100 * s, 100 * (s < 1 ? a / (1 - s) : 0)] ); }), (a.hsl.hcg = function (t) { var e, n = t[1] / 100, r = t[2] / 100, i = 0; return ( (e = r < 0.5 ? 2 * n * r : 2 * n * (1 - r)) < 1 && (i = (r - 0.5 * e) / (1 - e)), [t[0], 100 * e, 100 * i] ); }), (a.hsv.hcg = function (t) { var e = t[1] / 100, n = t[2] / 100, r = e * n, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.hcg.rgb = function (t) { var e = t[0] / 360, n = t[1] / 100, r = t[2] / 100; if (0 === n) return [255 * r, 255 * r, 255 * r]; var i, o = [0, 0, 0], a = (e % 1) * 6, s = a % 1, c = 1 - s; switch (Math.floor(a)) { case 0: (o[0] = 1), (o[1] = s), (o[2] = 0); break; case 1: (o[0] = c), (o[1] = 1), (o[2] = 0); break; case 2: (o[0] = 0), (o[1] = 1), (o[2] = s); break; case 3: (o[0] = 0), (o[1] = c), (o[2] = 1); break; case 4: (o[0] = s), (o[1] = 0), (o[2] = 1); break; default: (o[0] = 1), (o[1] = 0), (o[2] = c); } return ( (i = (1 - n) * r), [255 * (n * o[0] + i), 255 * (n * o[1] + i), 255 * (n * o[2] + i)] ); }), (a.hcg.hsv = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e), r = 0; return n > 0 && (r = e / n), [t[0], 100 * r, 100 * n]; }), (a.hcg.hsl = function (t) { var e = t[1] / 100, n = (t[2] / 100) * (1 - e) + 0.5 * e, r = 0; return ( n > 0 && n < 0.5 ? (r = e / (2 * n)) : n >= 0.5 && n < 1 && (r = e / (2 * (1 - n))), [t[0], 100 * r, 100 * n] ); }), (a.hcg.hwb = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e); return [t[0], 100 * (n - e), 100 * (1 - n)]; }), (a.hwb.hcg = function (t) { var e = t[1] / 100, n = 1 - t[2] / 100, r = n - e, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.apple.rgb = function (t) { return [ (t[0] / 65535) * 255, (t[1] / 65535) * 255, (t[2] / 65535) * 255, ]; }), (a.rgb.apple = function (t) { return [ (t[0] / 255) * 65535, (t[1] / 255) * 65535, (t[2] / 255) * 65535, ]; }), (a.gray.rgb = function (t) { return [(t[0] / 100) * 255, (t[0] / 100) * 255, (t[0] / 100) * 255]; }), (a.gray.hsl = a.gray.hsv = function (t) { return [0, 0, t[0]]; }), (a.gray.hwb = function (t) { return [0, 100, t[0]]; }), (a.gray.cmyk = function (t) { return [0, 0, 0, t[0]]; }), (a.gray.lab = function (t) { return [t[0], 0, 0]; }), (a.gray.hex = function (t) { var e = 255 & Math.round((t[0] / 100) * 255), n = ((e << 16) + (e << 8) + e).toString(16).toUpperCase(); return "000000".substring(n.length) + n; }), (a.rgb.gray = function (t) { return [((t[0] + t[1] + t[2]) / 3 / 255) * 100]; }); }, 127: function (t, e) {}, 128: function (t, e) {}, 183: function (t, e, n) { "use strict"; var r = n(1), i = n(185), o = n(92), a = n(6), s = n(0); function c(t) { return (c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var u, h, l = 0, f = 0, d = 0, p = 0, g = 0, v = 0, y = "object" === ("undefined" == typeof performance ? "undefined" : c(performance)) && performance.now ? performance : Date, m = "object" === ("undefined" == typeof window ? "undefined" : c(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function b() { return g || (m(x), (g = y.now() + v)); } function x() { g = 0; } function S() { this._call = this._time = this._next = null; } function w(t, e, n) { var r = new S(); return r.restart(t, e, n), r; } function O() { (g = (p = y.now()) + v), (l = f = 0); try { !(function () { b(), ++l; for (var t, e = u; e; ) (t = g - e._time) >= 0 && e._call.call(null, t), (e = e._next); --l; })(); } finally { (l = 0), (function () { var t, e, n = u, r = 1 / 0; for (; n; ) n._call ? (r > n._time && (r = n._time), (t = n), (n = n._next)) : ((e = n._next), (n._next = null), (n = t ? (t._next = e) : (u = e))); (h = t), k(r); })(), (g = 0); } } function M() { var t = y.now(), e = t - p; e > 1e3 && ((v -= e), (p = t)); } function k(t) { l || (f && (f = clearTimeout(f)), t - g > 24 ? (t < 1 / 0 && (f = setTimeout(O, t - y.now() - v)), d && (d = clearInterval(d))) : (d || ((p = y.now()), (d = setInterval(M, 1e3))), (l = 1), m(O))); } S.prototype = w.prototype = { constructor: S, restart: function (t, e, n) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (n = (null == n ? b() : +n) + (null == e ? 0 : +e)), this._next || h === this || (h ? (h._next = this) : (u = this), (h = this)), (this._call = t), (this._time = n), k(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), k()); }, }; var j = function (t, e, n) { (t.prototype = e.prototype = n), (n.constructor = t); }; function C(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function E() {} var P = "\\s*([+-]?\\d+)\\s*", A = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", I = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", T = /^#([0-9a-f]{3,8})$/, N = new RegExp( "^rgb\\(".concat(P, ",").concat(P, ",").concat(P, "\\)$"), ), B = new RegExp( "^rgb\\(".concat(I, ",").concat(I, ",").concat(I, "\\)$"), ), L = new RegExp( "^rgba\\(" .concat(P, ",") .concat(P, ",") .concat(P, ",") .concat(A, "\\)$"), ), D = new RegExp( "^rgba\\(" .concat(I, ",") .concat(I, ",") .concat(I, ",") .concat(A, "\\)$"), ), _ = new RegExp( "^hsl\\(".concat(A, ",").concat(I, ",").concat(I, "\\)$"), ), R = new RegExp( "^hsla\\(" .concat(A, ",") .concat(I, ",") .concat(I, ",") .concat(A, "\\)$"), ), F = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074, }; function Y() { return this.rgb().formatHex(); } function X() { return this.rgb().formatRgb(); } function z(t) { var e, n; return ( (t = (t + "").trim().toLowerCase()), (e = T.exec(t)) ? ((n = e[1].length), (e = parseInt(e[1], 16)), 6 === n ? W(e) : 3 === n ? new H( ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), ((15 & e) << 4) | (15 & e), 1, ) : 8 === n ? q( (e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, (255 & e) / 255, ) : 4 === n ? q( ((e >> 12) & 15) | ((e >> 8) & 240), ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), (((15 & e) << 4) | (15 & e)) / 255, ) : null) : (e = N.exec(t)) ? new H(e[1], e[2], e[3], 1) : (e = B.exec(t)) ? new H( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, 1, ) : (e = L.exec(t)) ? q(e[1], e[2], e[3], e[4]) : (e = D.exec(t)) ? q( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, e[4], ) : (e = _.exec(t)) ? J(e[1], e[2] / 100, e[3] / 100, 1) : (e = R.exec(t)) ? J(e[1], e[2] / 100, e[3] / 100, e[4]) : F.hasOwnProperty(t) ? W(F[t]) : "transparent" === t ? new H(NaN, NaN, NaN, 0) : null ); } function W(t) { return new H((t >> 16) & 255, (t >> 8) & 255, 255 & t, 1); } function q(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new H(t, e, n, r); } function V(t) { return ( t instanceof E || (t = z(t)), t ? new H((t = t.rgb()).r, t.g, t.b, t.opacity) : new H() ); } function G(t, e, n, r) { return 1 === arguments.length ? V(t) : new H(t, e, n, null == r ? 1 : r); } function H(t, e, n, r) { (this.r = +t), (this.g = +e), (this.b = +n), (this.opacity = +r); } function U() { return "#".concat(Q(this.r)).concat(Q(this.g)).concat(Q(this.b)); } function Z() { var t = K(this.opacity); return "" .concat(1 === t ? "rgb(" : "rgba(") .concat($(this.r), ", ") .concat($(this.g), ", ") .concat($(this.b)) .concat(1 === t ? ")" : ", ".concat(t, ")")); } function K(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function $(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function Q(t) { return ((t = $(t)) < 16 ? "0" : "") + t.toString(16); } function J(t, e, n, r) { return ( r <= 0 ? (t = e = n = NaN) : n <= 0 || n >= 1 ? (t = e = NaN) : e <= 0 && (t = NaN), new et(t, e, n, r) ); } function tt(t) { if (t instanceof et) return new et(t.h, t.s, t.l, t.opacity); if ((t instanceof E || (t = z(t)), !t)) return new et(); if (t instanceof et) return t; var e = (t = t.rgb()).r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, s = o - i, c = (o + i) / 2; return ( s ? ((a = e === o ? (n - r) / s + 6 * (n < r) : n === o ? (r - e) / s + 2 : (e - n) / s + 4), (s /= c < 0.5 ? o + i : 2 - o - i), (a *= 60)) : (s = c > 0 && c < 1 ? 0 : a), new et(a, s, c, t.opacity) ); } function et(t, e, n, r) { (this.h = +t), (this.s = +e), (this.l = +n), (this.opacity = +r); } function nt(t) { return (t = (t || 0) % 360) < 0 ? t + 360 : t; } function rt(t) { return Math.max(0, Math.min(1, t || 0)); } function it(t, e, n) { return ( 255 * (t < 60 ? e + ((n - e) * t) / 60 : t < 180 ? n : t < 240 ? e + ((n - e) * (240 - t)) / 60 : e) ); } function ot(t, e, n, r, i) { var o = t * t, a = o * t; return ( ((1 - 3 * t + 3 * o - a) * e + (4 - 6 * o + 3 * a) * n + (1 + 3 * t + 3 * o - 3 * a) * r + a * i) / 6 ); } j(E, z, { copy: function (t) { return Object.assign(new this.constructor(), this, t); }, displayable: function () { return this.rgb().displayable(); }, hex: Y, formatHex: Y, formatHex8: function () { return this.rgb().formatHex8(); }, formatHsl: function () { return tt(this).formatHsl(); }, formatRgb: X, toString: X, }), j( H, G, C(E, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new H(this.r * t, this.g * t, this.b * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new H(this.r * t, this.g * t, this.b * t, this.opacity) ); }, rgb: function () { return this; }, clamp: function () { return new H($(this.r), $(this.g), $(this.b), K(this.opacity)); }, displayable: function () { return ( -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1 ); }, hex: U, formatHex: U, formatHex8: function () { return "#" .concat(Q(this.r)) .concat(Q(this.g)) .concat(Q(this.b)) .concat(Q(255 * (isNaN(this.opacity) ? 1 : this.opacity))); }, formatRgb: Z, toString: Z, }), ), j( et, function (t, e, n, r) { return 1 === arguments.length ? tt(t) : new et(t, e, n, null == r ? 1 : r); }, C(E, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new et(this.h, this.s, this.l * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new et(this.h, this.s, this.l * t, this.opacity) ); }, rgb: function () { var t = (this.h % 360) + 360 * (this.h < 0), e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new H( it(t >= 240 ? t - 240 : t + 120, i, r), it(t, i, r), it(t < 120 ? t + 240 : t - 120, i, r), this.opacity, ); }, clamp: function () { return new et( nt(this.h), rt(this.s), rt(this.l), K(this.opacity), ); }, displayable: function () { return ( ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1 ); }, formatHsl: function () { var t = K(this.opacity); return "" .concat(1 === t ? "hsl(" : "hsla(") .concat(nt(this.h), ", ") .concat(100 * rt(this.s), "%, ") .concat(100 * rt(this.l), "%") .concat(1 === t ? ")" : ", ".concat(t, ")")); }, }), ); var at = function (t) { return function () { return t; }; }; function st(t, e) { return function (n) { return t + n * e; }; } function ct(t) { return 1 == (t = +t) ? ut : function (e, n) { return n - e ? (function (t, e, n) { return ( (t = Math.pow(t, n)), (e = Math.pow(e, n) - t), (n = 1 / n), function (r) { return Math.pow(t + r * e, n); } ); })(e, n, t) : at(isNaN(e) ? n : e); }; } function ut(t, e) { var n = e - t; return n ? st(t, n) : at(isNaN(t) ? e : t); } var ht = (function t(e) { var n = ct(e); function r(t, e) { var r = n((t = G(t)).r, (e = G(e)).r), i = n(t.g, e.g), o = n(t.b, e.b), a = ut(t.opacity, e.opacity); return function (e) { return ( (t.r = r(e)), (t.g = i(e)), (t.b = o(e)), (t.opacity = a(e)), t + "" ); }; } return (r.gamma = t), r; })(1); function lt(t) { return function (e) { var n, r, i = e.length, o = new Array(i), a = new Array(i), s = new Array(i); for (n = 0; n < i; ++n) (r = G(e[n])), (o[n] = r.r || 0), (a[n] = r.g || 0), (s[n] = r.b || 0); return ( (o = t(o)), (a = t(a)), (s = t(s)), (r.opacity = 1), function (t) { return (r.r = o(t)), (r.g = a(t)), (r.b = s(t)), r + ""; } ); }; } lt(function (t) { var e = t.length - 1; return function (n) { var r = n <= 0 ? (n = 0) : n >= 1 ? ((n = 1), e - 1) : Math.floor(n * e), i = t[r], o = t[r + 1], a = r > 0 ? t[r - 1] : 2 * i - o, s = r < e - 1 ? t[r + 2] : 2 * o - i; return ot((n - r / e) * e, a, i, o, s); }; }), lt(function (t) { var e = t.length; return function (n) { var r = Math.floor(((n %= 1) < 0 ? ++n : n) * e), i = t[(r + e - 1) % e], o = t[r % e], a = t[(r + 1) % e], s = t[(r + 2) % e]; return ot((n - r / e) * e, i, o, a, s); }; }); var ft = function (t, e) { e || (e = []); var n, r = t ? Math.min(e.length, t.length) : 0, i = e.slice(); return function (o) { for (n = 0; n < r; ++n) i[n] = t[n] * (1 - o) + e[n] * o; return i; }; }; function dt(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function pt(t, e) { var n, r = e ? e.length : 0, i = t ? Math.min(r, t.length) : 0, o = new Array(i), a = new Array(r); for (n = 0; n < i; ++n) o[n] = Ot(t[n], e[n]); for (; n < r; ++n) a[n] = e[n]; return function (t) { for (n = 0; n < i; ++n) a[n] = o[n](t); return a; }; } var gt = function (t, e) { var n = new Date(); return ( (t = +t), (e = +e), function (r) { return n.setTime(t * (1 - r) + e * r), n; } ); }, vt = function (t, e) { return ( (t = +t), (e = +e), function (n) { return t * (1 - n) + e * n; } ); }; function yt(t) { return (yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var mt = function (t, e) { var n, r = {}, i = {}; for (n in ((null !== t && "object" === yt(t)) || (t = {}), (null !== e && "object" === yt(e)) || (e = {}), e)) n in t ? (r[n] = Ot(t[n], e[n])) : (i[n] = e[n]); return function (t) { for (n in r) i[n] = r[n](t); return i; }; }, bt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, xt = new RegExp(bt.source, "g"); var St = function (t, e) { var n, r, i, o = (bt.lastIndex = xt.lastIndex = 0), a = -1, s = [], c = []; for (t += "", e += ""; (n = bt.exec(t)) && (r = xt.exec(e)); ) (i = r.index) > o && ((i = e.slice(o, i)), s[a] ? (s[a] += i) : (s[++a] = i)), (n = n[0]) === (r = r[0]) ? s[a] ? (s[a] += r) : (s[++a] = r) : ((s[++a] = null), c.push({ i: a, x: vt(n, r) })), (o = xt.lastIndex); return ( o < e.length && ((i = e.slice(o)), s[a] ? (s[a] += i) : (s[++a] = i)), s.length < 2 ? c[0] ? (function (t) { return function (e) { return t(e) + ""; }; })(c[0].x) : (function (t) { return function () { return t; }; })(e) : ((e = c.length), function (t) { for (var n, r = 0; r < e; ++r) s[(n = c[r]).i] = n.x(t); return s.join(""); }) ); }; function wt(t) { return (wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Ot = function (t, e) { var n, r = wt(e); return null == e || "boolean" === r ? at(e) : ("number" === r ? vt : "string" === r ? (n = z(e)) ? ((e = n), ht) : St : e instanceof z ? ht : e instanceof Date ? gt : dt(e) ? ft : Array.isArray(e) ? pt : ("function" != typeof e.valueOf && "function" != typeof e.toString) || isNaN(e) ? mt : vt)(t, e); }, Mt = n(90), kt = n(34), jt = [1, 0, 0, 0, 1, 0, 0, 0, 1]; function Ct(t, e, n) { var r, i = e.startTime; if (n < i + e.delay || e._paused) return !1; var o = e.duration, a = e.easing, c = Object(Mt.a)(a); if (((n = n - i - e.delay), e.repeat)) r = c((r = (n % o) / o)); else { if (!((r = n / o) < 1)) return e.onFrame ? t.attr(e.onFrame(1)) : t.attr(e.toAttrs), !0; r = c(r); } if (e.onFrame) { var u = e.onFrame(r); t.attr(u); } else !(function (t, e, n) { var r = {}, i = e.fromAttrs, o = e.toAttrs; if (!t.destroyed) { var a, c, u, h; for (var l in o) if (!Object(s.isEqual)(i[l], o[l])) if ("path" === l) { var f = o[l], d = i[l]; f.length > d.length ? ((f = kt.parsePathString(o[l])), (d = kt.parsePathString(i[l])), (d = kt.fillPathByDiff(d, f)), (d = kt.formatPath(d, f)), (e.fromAttrs.path = d), (e.toAttrs.path = f)) : e.pathFormatted || ((f = kt.parsePathString(o[l])), (d = kt.parsePathString(i[l])), (d = kt.formatPath(d, f)), (e.fromAttrs.path = d), (e.toAttrs.path = f), (e.pathFormatted = !0)), (r[l] = []); for (var p = 0; p < f.length; p++) { for ( var g = f[p], v = d[p], y = [], m = 0; m < g.length; m++ ) Object(s.isNumber)(g[m]) && v && Object(s.isNumber)(v[m]) ? ((a = Ot(v[m], g[m])), y.push(a(n))) : y.push(g[m]); r[l].push(y); } } else if ("matrix" === l) { var b = ((u = i[l] || jt), (dt((h = o[l] || jt)) ? ft : pt)(u, h))(n); r[l] = b; } else ["fill", "stroke", "fillStyle", "strokeStyle"].includes( l, ) && ((c = o[l]), /^[r,R,L,l]{1}[\s]*\(/.test(c)) ? (r[l] = o[l]) : Object(s.isFunction)(o[l]) || ((a = Ot(i[l], o[l])), (r[l] = a(n))); t.attr(r); } })(t, e, r); return !1; } var Et = (function () { function t(t) { (this.animators = []), (this.current = 0), (this.timer = null), (this.canvas = t); } return ( (t.prototype.initTimer = function () { var t, e, n, r = this; this.timer = w(function (i) { if (((r.current = i), r.animators.length > 0)) { for (var o = r.animators.length - 1; o >= 0; o--) if ((t = r.animators[o]).destroyed) r.removeAnimator(o); else { if (!t.isAnimatePaused()) for ( var a = (e = t.get("animations")).length - 1; a >= 0; a-- ) (n = e[a]), Ct(t, n, i) && (e.splice(a, 1), !1, n.callback && n.callback()); 0 === e.length && r.removeAnimator(o); } r.canvas.get("autoDraw") || r.canvas.draw(); } }); }), (t.prototype.addAnimator = function (t) { this.animators.push(t); }), (t.prototype.removeAnimator = function (t) { this.animators.splice(t, 1); }), (t.prototype.isAnimating = function () { return !!this.animators.length; }), (t.prototype.stop = function () { this.timer && this.timer.stop(); }), (t.prototype.stopAllAnimations = function (t) { void 0 === t && (t = !0), this.animators.forEach(function (e) { e.stopAnimate(t); }), (this.animators = []), this.canvas.draw(); }), (t.prototype.getTime = function () { return this.current; }), t ); })(), Pt = n(86), At = [ "mousedown", "mouseup", "dblclick", "mouseout", "mouseover", "mousemove", "mouseleave", "mouseenter", "touchstart", "touchmove", "touchend", "dragenter", "dragover", "dragleave", "drop", "contextmenu", "mousewheel", ]; function It(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function Tt(t, e, n) { if (n.bubbles) { var r = void 0, i = !1; if ( ("mouseenter" === e ? ((r = n.fromShape), (i = !0)) : "mouseleave" === e && ((i = !0), (r = n.toShape)), t.isCanvas() && i) ) return; if (r && Object(a.g)(t, r)) return void (n.bubbles = !1); (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var Nt = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.mousedownShape = null), (this.mousedownPoint = null), (this._eventCallback = function (t) { var n = t.type; e._triggerEvent(n, t); }), (this._onDocumentMove = function (t) { if ( e.canvas.get("el") !== t.target && (e.dragging || e.currentShape) ) { var n = e._getPointInfo(t); e.dragging && e._emitEvent("drag", t, n, e.draggingShape); } }), (this._onDocumentMouseUp = function (t) { if (e.canvas.get("el") !== t.target && e.dragging) { var n = e._getPointInfo(t); e.draggingShape && e._emitEvent("drop", t, n, null), e._emitEvent("dragend", t, n, e.draggingShape), e._afterDrag(e.draggingShape, n, t); } }), (this.canvas = t.canvas); } return ( (t.prototype.init = function () { this._bindEvents(); }), (t.prototype._bindEvents = function () { var t = this, e = this.canvas.get("el"); Object(a.a)(At, function (n) { e.addEventListener(n, t._eventCallback); }), document && (document.addEventListener("mousemove", this._onDocumentMove), document.addEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._clearEvents = function () { var t = this, e = this.canvas.get("el"); Object(a.a)(At, function (n) { e.removeEventListener(n, t._eventCallback); }), document && (document.removeEventListener( "mousemove", this._onDocumentMove, ), document.removeEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._getEventObj = function (t, e, n, r, i, o) { var a = new Pt.a(t, e); return ( (a.fromShape = i), (a.toShape = o), (a.x = n.x), (a.y = n.y), (a.clientX = n.clientX), (a.clientY = n.clientY), a.propagationPath.push(r), a ); }), (t.prototype._getShape = function (t, e) { return this.canvas.getShape(t.x, t.y, e); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t], o = !1; if (i) i.call(this, n, r, e); else { var a = this.currentShape; "mouseenter" === t || "dragenter" === t || "mouseover" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "mouseenter" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "mouseleave" === t || "dragleave" === t || "mouseout" === t ? ((o = !0), a && this._emitEvent(t, e, n, a, a, null), this._emitEvent(t, e, n, null, a, null), "mouseleave" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } if ((o || (this.currentShape = r), r && !r.get("destroyed"))) { var s = this.canvas; s.get("el").style.cursor = r.attr("cursor") || s.get("cursor"); } }), (t.prototype._onmousedown = function (t, e, n) { 0 === n.button && ((this.mousedownShape = e), (this.mousedownPoint = t), (this.mousedownTimeStamp = n.timeStamp)), this._emitEvent("mousedown", n, t, e, null, null); }), (t.prototype._emitMouseoverEvents = function (t, e, n, r) { var i = this.canvas.get("el"); n !== r && (n && (this._emitEvent("mouseout", t, e, n, n, r), this._emitEvent("mouseleave", t, e, n, n, r), (r && !r.get("destroyed")) || (i.style.cursor = this.canvas.get("cursor"))), r && (this._emitEvent("mouseover", t, e, r, n, r), this._emitEvent("mouseenter", t, e, r, n, r))); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); r !== t && this._emitMouseoverEvents(n, e, t, r), (this.currentShape = r); }), (t.prototype._onmouseup = function (t, e, n) { if (0 === n.button) { var r = this.draggingShape; this.dragging ? (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)) : (this._emitEvent("mouseup", n, t, e), e === this.mousedownShape && this._emitEvent("click", n, t, e), (this.mousedownShape = null), (this.mousedownPoint = null)); } }), (t.prototype._ondragover = function (t, e, n) { n.preventDefault(); var r = this.currentShape; this._emitDragoverEvents(n, t, r, e, !0); }), (t.prototype._onmousemove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.mousedownPoint; if (a) { var s = this.mousedownShape, c = n.timeStamp - this.mousedownTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; c > 120 || u * u + h * h > 40 ? s && s.get("draggable") ? ((o = this.mousedownShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.mousedownShape = null), (this.mousedownPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.mousedownShape = null), (this.mousedownPoint = null)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)); } else this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e); } }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), It(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || Tt(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { It(this.canvas, t, a); } }), (t.prototype.destroy = function () { this._clearEvents(), (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.mousedownPoint = null), (this.mousedownShape = null), (this.mousedownTimeStamp = null); }), t ); })(), Bt = Object(i.a)(), Lt = Bt && "firefox" === Bt.name, Dt = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( n.initContainer(), n.initDom(), n.initEvents(), n.initTimeline(), n ); } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.cursor = "default"), (e.supportCSSTransform = !1), e; }), (e.prototype.initContainer = function () { var t = this.get("container"); Object(a.h)(t) && ((t = document.getElementById(t)), this.set("container", t)); }), (e.prototype.initDom = function () { var t = this.createDom(); this.set("el", t), this.get("container").appendChild(t), this.setDOMSize(this.get("width"), this.get("height")); }), (e.prototype.initEvents = function () { var t = new Nt({ canvas: this }); t.init(), this.set("eventController", t); }), (e.prototype.initTimeline = function () { var t = new Et(this); this.set("timeline", t); }), (e.prototype.setDOMSize = function (t, e) { var n = this.get("el"); a.c && ((n.style.width = t + "px"), (n.style.height = e + "px")); }), (e.prototype.changeSize = function (t, e) { this.setDOMSize(t, e), this.set("width", t), this.set("height", e), this.onCanvasChange("changeSize"); }), (e.prototype.getRenderer = function () { return this.get("renderer"); }), (e.prototype.getCursor = function () { return this.get("cursor"); }), (e.prototype.setCursor = function (t) { this.set("cursor", t); var e = this.get("el"); a.c && e && (e.style.cursor = t); }), (e.prototype.getPointByEvent = function (t) { if (this.get("supportCSSTransform")) { if (Lt && !Object(a.e)(t.layerX) && t.layerX !== t.offsetX) return { x: t.layerX, y: t.layerY }; if (!Object(a.e)(t.offsetX)) return { x: t.offsetX, y: t.offsetY }; } var e = this.getClientByEvent(t), n = e.x, r = e.y; return this.getPointByClient(n, r); }), (e.prototype.getClientByEvent = function (t) { var e = t; return ( t.touches && (e = "touchend" === t.type ? t.changedTouches[0] : t.touches[0]), { x: e.clientX, y: e.clientY } ); }), (e.prototype.getPointByClient = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t - n.left, y: e - n.top }; }), (e.prototype.getClientByPoint = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t + n.left, y: e + n.top }; }), (e.prototype.draw = function () {}), (e.prototype.removeDom = function () { var t = this.get("el"); t.parentNode.removeChild(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.isCanvas = function () { return !0; }), (e.prototype.getParent = function () { return null; }), (e.prototype.destroy = function () { var e = this.get("timeline"); this.get("destroyed") || (this.clear(), e && e.stop(), this.clearEvents(), this.removeDom(), t.prototype.destroy.call(this)); }), e ); })(o.a); e.a = Dt; }, 184: function (t, e, n) { "use strict"; var r = n(1), i = n(8); function o(t, e, n) { var r = t.getTotalMatrix(); if (r) { var o = (function (t, e) { if (e) { var n = Object(i.invert)(e); return Object(i.multiplyVec2)(n, t); } return t; })([e, n, 1], r); return [o[0], o[1]]; } return [e, n]; } function a(t, e, n) { if (t.isCanvas && t.isCanvas()) return !0; if (!Object(i.isAllowCapture)(t) || !1 === t.cfg.isInView) return !1; if (t.cfg.clipShape) { var r = o(t, e, n), a = r[0], s = r[1]; if (t.isClipped(a, s)) return !1; } var c = t.cfg.cacheCanvasBBox || t.getCanvasBBox(); return e >= c.minX && e <= c.maxX && n >= c.minY && n <= c.maxY; } var s = n(31), c = n(52), u = n(3), h = n(40), l = n(12), f = n(38), d = n.n(f); function p(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function g(t, e, n) { if (n.bubbles) { t.isCanvas(), 0, (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var v = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.panstartShape = null), (this.panstartPoint = null), (this.handleEvent = function (t) { e.hammerRuntime.emit("origin_input:" + t.type, t); }), (this.canvas = t.canvas), this._initEvent(); } return ( (t.prototype._initEvent = function () { var t = this; (this.hammerRuntime = new d.a({}, { inputClass: f.TouchInput })), this.hammerRuntime.add( new d.a.Pan({ threshold: 0, pointers: 1 }), ), this.hammerRuntime .add(new d.a.Swipe()) .recognizeWith(this.hammerRuntime.get("pan")), this.hammerRuntime.add( new d.a.Pinch({ threshold: 0, pointers: 2 }), ), this.hammerRuntime.add( new d.a.Tap({ event: "dbltap", taps: 2 }), ), this.hammerRuntime.add(new d.a.Tap()), this.hammerRuntime.add(new d.a.Press({ time: 500 })), this.hammerRuntime.on( "panstart panmove panend pancancel", function (e) { e.srcEvent.extra = e; var n = t._getPointInfo(e), r = t._getShape(n, e); ("panend" !== e.type && "pancancel" !== e.type) || t._onpanend(n, r, e), "panstart" === e.type && (t.dragging && ((t.draggingShape = null), (t.dragging = !1), (t.panstartShape = null), (t.panstartPoint = null)), t._onpanstart(n, r, e)), "panmove" === e.type && t._onpanmove(n, r, e), (t.currentShape = r); }, ), this.hammerRuntime.on( "tap dbltap press swipe rotatestart rotatemove", function (e) { t._emitMobileEvent(e.type, e); }, ), this.hammerRuntime.on( "pinchstart pinchmove pinchend pinchcancel", function (e) { "pinchend" !== e.type && "pinchcancel" !== e.type ? ((e.srcEvent.extra = { scale: e.scale }), t._emitMobileEvent(e.type, e)) : t._emitMobileEvent(e.type, e); }, ); }), (t.prototype._emitMobileEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e); this._emitEvent(t, e, n, r); }), (t.prototype._getEventObj = function (t, e, n, r, o, a) { var s = new i.Event(t, e); return ( (s.fromShape = o), (s.toShape = a), (s.x = n.x), (s.y = n.y), (s.clientX = n.clientX), (s.clientY = n.clientY), s.propagationPath.push(r), s ); }), (t.prototype._getShape = function (t, e) { var n = e.srcEvent; return this.canvas.getShape(t.x, t.y, n); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t]; if (i) i.call(this, n, r, e); else { var o = this.currentShape; "panstart" === t || "dragenter" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "panstart" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "panend" === t || "dragleave" === t ? (o && this._emitEvent(t, e, n, o, o, null), this._emitEvent(t, e, n, null, o, null), "panend" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } }), (t.prototype._onpanstart = function (t, e, n) { (this.panstartShape = e), (this.panstartPoint = t), (this.panstartTimeStamp = n.timeStamp), this._emitEvent("panstart", n, t, e, null, null); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); this.currentShape = r; }), (t.prototype._onpanend = function (t, e, n) { var r = this.draggingShape; this.dragging && (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)), this._emitEvent("panend", n, t, e), (this.panstartShape = null), (this.panstartPoint = null); }), (t.prototype._onpanmove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.panstartPoint; if (a) { var s = this.panstartShape, c = n.timeStamp - this.panstartTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; (c > 120 || u * u + h * h > 40) && (s && s.get("draggable") ? ((o = this.panstartShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.panstartShape = null), (this.panstartPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.panstartShape = null), (this.panstartPoint = null)) : this._emitEvent("panmove", n, t, e)); } } this._emitEvent("panmove", n, t, e); }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), p(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || g(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { p(this.canvas, t, a); } }), (t.prototype.destroy = function () { (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.panstartPoint = null), (this.panstartShape = null), (this.panstartTimeStamp = null); }), t ); })(), y = (function () { function t() {} return ( (t.prototype.set = function (t, e, n) { switch (e) { case "strokeStyle": t.setStrokeStyle(n); break; case "fillStyle": t.setFillStyle(n); break; case "lineWidth": t.setLineWidth(n); break; case "lineDash": t.setLineDash(n); break; case "globalAlpha": (n || 0 === n) && ((t.globalAlpha = n), t.setGlobalAlpha(n)); break; case "fontSize": t.setFontSize(n); break; case "textAlign": t.setTextAlign(n); break; case "fontStyle": case "font": t.setFont(n); break; case "textBaseline": t.setTextBaseline(n); break; default: t[e] = n; } return !0; }), (t.prototype.get = function (t, e) { return "globalAlpha" === e && void 0 === t[e] ? 1 : "function" == typeof t[e] ? t[e].bind(t) : t[e]; }), t ); })(), m = n(0), b = n(120), x = null; var S = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Object(b.assembleFont)(e)); var c, u = (function (t, e) { var n = 0; if (Object(m.isNil)(t) || "" === t) return n; if ( (x.save(), (x.font = e), Object(m.isString)(t) && t.includes("\n")) ) { var r = t.split("\n"); Object(m.each)(r, function (t) { var e = x.measureText(t).width; n < e && (n = e); }); } else n = x.measureText(t).width; return x.restore(), n; })(i, s); if (u) { var h = e.textAlign, l = e.textBaseline, f = Object(b.getTextHeight)(i, o, a), d = { x: n, y: r - f }; h && ("end" === h || "right" === h ? (d.x -= u) : "center" === h && (d.x -= u / 2)), l && ("top" === l ? (d.y += f) : "middle" === l && (d.y += f / 2)), (c = { x: d.x, y: d.y, width: u, height: f }); } else c = { x: n, y: r, width: 0, height: 0 }; return c; }, w = function (t) { (x = t), Object(i.registerBBox)("text", S); }, O = n(89), M = (function (t) { function e(e) { var n, r, i = t.call(this, e) || this, o = i.get("context"); return ( i.isMini() && (i.isMiniNative() ? Object(h.c)(i.get("container")) : i.set("context", new Proxy(o, new y())), (n = o), (r = i), Object(O.b)(r), w(n)), i ); } return ( Object(r.c)(e, t), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return ( (e.renderer = "canvas"), (e.autoDraw = !0), (e.localRefresh = !0), (e.refreshElements = []), (e.clipView = !0), (e.quickHit = !1), (e.boundingClientRect = { width: 0, height: 0, left: 0, top: 0, bottom: 0, right: 0, }), e ); }), (e.prototype.initEvents = function () { var t = new v({ canvas: this }); this.set("eventController", t); }), (e.prototype.registerEventCallback = function (t) { this.get("eventController").handleEvent(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.onCanvasChange = function (t) { ("attr" !== t && "sort" !== t && "changeSize" !== t) || (this.set("refreshElements", [this]), this.draw()); }), (e.prototype.getShapeBase = function () { return s; }), (e.prototype.getGroupBase = function () { return c.a; }), (e.prototype.getPixelRatio = function () { var t = this.get("pixelRatio") || Object(u.c)(); return t >= 1 ? Math.ceil(t) : 1; }), (e.prototype.getViewRange = function () { return { minX: 0, minY: 0, maxX: this.cfg.width, maxY: this.cfg.height, }; }), (e.prototype.initDom = function () { if (this.isMini()) { var e = this.get("context"), n = this.getPixelRatio(); n > 1 && e.scale(n, n); } else t.prototype.initDom.call(this); }), (e.prototype.createDom = function () { var t = document.createElement("canvas"), e = t.getContext("2d"); return this.set("context", e), t; }), (e.prototype.setDOMSize = function (e, n) { t.prototype.setDOMSize.call(this, e, n); var r = this.get("context"), i = this.get("el"), o = this.getPixelRatio(); (i.width = o * e), (i.height = o * n), o > 1 && r.scale(o, o); }), (e.prototype.clear = function () { t.prototype.clear.call(this), this._clearFrame(), this.get("context").clearRect( 0, 0, this.get("width"), this.get("height"), ); }), (e.prototype.getShape = function (e, n) { return this.get("quickHit") ? (function t(e, n, r) { if (!a(e, n, r)) return null; for ( var i = null, s = e.getChildren(), c = s.length - 1; c >= 0; c-- ) { var u = s[c]; if (u.isGroup()) i = t(u, n, r); else if (a(u, n, r)) { var h = u, l = o(u, n, r), f = l[0], d = l[1]; h.isInShape(f, d) && (i = u); } if (i) break; } return i; })(this, e, n) : t.prototype.getShape.call(this, e, n, null); }), (e.prototype._getRefreshRegion = function () { var t, e = this.get("refreshElements"), n = this.getViewRange(); e.length && e[0] === this ? (t = n) : (t = Object(l.f)(e)) && ((t.minX = Math.floor(t.minX)), (t.minY = Math.floor(t.minY)), (t.maxX = Math.ceil(t.maxX)), (t.maxY = Math.ceil(t.maxY)), (t.maxY += 1), this.get("clipView") && (t = Object(l.g)(t, n))); return t; }), (e.prototype._clearFrame = function () { var t = this.get("drawFrame"); t && (Object(h.a)(t), this.set("drawFrame", null), this.set("refreshElements", [])); }), (e.prototype.draw = function () { var t = this.get("drawFrame"); (this.get("autoDraw") && t) || this._startDraw(); }), (e.prototype._startDraw = function () { var t = this, e = this.get("drawFrame"); e || ((e = Object(h.b)(function () { t.get("localRefresh") ? t._drawRegion() : t._drawAll(), Object(h.a)(e), t.set("drawFrame", null); })), this.set("drawFrame", e)); }), (e.prototype._drawRegion = function () { var t = this.get("context"), e = this.get("refreshElements"), n = this.getChildren(), r = this._getRefreshRegion(); r ? (t.clearRect( r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY, ), t.save(), t.beginPath(), t.rect(r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY), t.clip(), Object(l.a)(t, this), Object(l.b)(this, n, r), Object(l.d)(t, n, r), t.restore()) : e.length && Object(l.c)(e), Object(u.b)(e, function (t) { t.get("hasChanged") && t.set("hasChanged", !1); }), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype._drawAll = function () { var t = this.get("context"), e = this.getChildren(); t.clearRect(0, 0, this.get("width"), this.get("height")), Object(l.a)(t, this), Object(l.d)(t, e), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype.skipDraw = function () {}), (e.prototype.refreshElement = function (t) { this.get("refreshElements").push(t); }), (e.prototype.getPointByEvent = function (e) { if (this.isMini()) { var n = this.getClientByEvent(e), r = n.x, i = n.y; return this.getPointByClient(r, i); } return t.prototype.getPointByEvent.call(this, e); }), (e.prototype.getClientByEvent = function (t) { var e = t.srcEvent, n = null; return ( e.touches && (n = "touchend" === e.type ? e.changedTouches[0] : e.touches[0]), n ? { x: n.clientX, y: n.clientY } : {} ); }), (e.prototype.getPointByClient = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t - r.left, y: e - r.top }; }), (e.prototype.removeDom = function () { this.isMini() || t.prototype.removeDom.call(this); }), (e.prototype.getClientByPoint = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t + r.left, y: e + r.top }; }), e ); })(i.AbstractCanvas); e.a = M; }, 185: function (t, e, n) { "use strict"; (function (t) { n.d(e, "a", function () { return f; }); var r = function (t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); }, i = function (t, e, n) { (this.name = t), (this.version = e), (this.os = n), (this.type = "browser"); }, o = function (e) { (this.version = e), (this.type = "node"), (this.name = "node"), (this.os = t.platform); }, a = function (t, e, n, r) { (this.name = t), (this.version = e), (this.os = n), (this.bot = r), (this.type = "bot-device"); }, s = function () { (this.type = "bot"), (this.bot = !0), (this.name = "bot"), (this.version = null), (this.os = null); }, c = function () { (this.type = "react-native"), (this.name = "react-native"), (this.version = null), (this.os = null); }, u = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/, h = [ ["aol", /AOLShield\/([0-9\._]+)/], ["edge", /Edge\/([0-9\._]+)/], ["edge-ios", /EdgiOS\/([0-9\._]+)/], ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], ["samsung", /SamsungBrowser\/([0-9\.]+)/], ["silk", /\bSilk\/([0-9._-]+)\b/], ["miui", /MiuiBrowser\/([0-9\.]+)$/], ["beaker", /BeakerBrowser\/([0-9\.]+)/], ["edge-chromium", /EdgA?\/([0-9\.]+)/], [ "chromium-webview", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, ], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["fxios", /FxiOS\/([0-9\.]+)/], ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], [ "pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/, ], ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], ["android", /Android\s([0-9\.]+)/], ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], ["safari", /Version\/([0-9\._]+).*Safari/], ["facebook", /FB[AS]V\/([0-9\.]+)/], ["instagram", /Instagram\s([0-9\.]+)/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ["curl", /^curl\/([0-9\.]+)$/], [ "searchbot", /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/, ], ], l = [ ["iOS", /iP(hone|od|ad)/], ["Android OS", /Android/], ["BlackBerry OS", /BlackBerry|BB10/], ["Windows Mobile", /IEMobile/], ["Amazon OS", /Kindle/], ["Windows 3.11", /Win16/], ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows 98", /(Windows 98)|(Win98)/], ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows Server 2003", /(Windows NT 5.2)/], ["Windows Vista", /(Windows NT 6.0)/], ["Windows 7", /(Windows NT 6.1)/], ["Windows 8", /(Windows NT 6.2)/], ["Windows 8.1", /(Windows NT 6.3)/], ["Windows 10", /(Windows NT 10.0)/], ["Windows ME", /Windows ME/], [ "Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/, ], ["Open BSD", /OpenBSD/], ["Sun OS", /SunOS/], ["Chrome OS", /CrOS/], ["Linux", /(Linux)|(X11)/], ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], ["QNX", /QNX/], ["BeOS", /BeOS/], ["OS/2", /OS\/2/], ]; function f(e) { return e ? p(e) : "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" === navigator.product ? new c() : "undefined" != typeof navigator ? p(navigator.userAgent) : void 0 !== t && t.version ? new o(t.version.slice(1)) : null; } function d(t) { return ( "" !== t && h.reduce(function (e, n) { var r = n[0], i = n[1]; if (e) return e; var o = i.exec(t); return !!o && [r, o]; }, !1) ); } function p(t) { var e = d(t); if (!e) return null; var n = e[0], o = e[1]; if ("searchbot" === n) return new s(); var c = o[1] && o[1].split(".").join("_").split("_").slice(0, 3); c ? c.length < 3 && (c = r( r([], c, !0), (function (t) { for (var e = [], n = 0; n < t; n++) e.push("0"); return e; })(3 - c.length), !0, )) : (c = []); var h = c.join("."), f = (function (t) { for (var e = 0, n = l.length; e < n; e++) { var r = l[e], i = r[0]; if (r[1].exec(t)) return i; } return null; })(t), p = u.exec(t); return p && p[1] ? new a(n, h, f, p[1]) : new i(n, h, f); } }).call(this, n(206)); }, 2: function (t, e, n) { "use strict"; n.d(e, "d", function () { return Le; }), n.d(e, "g", function () { return _e; }), n.d(e, "f", function () { return De; }), n.d(e, "l", function () { return We; }), n.d(e, "j", function () { return Ve; }), n.d(e, "b", function () { return Se; }), n.d(e, "h", function () { return Ye; }), n.d(e, "k", function () { return qe; }), n.d(e, "i", function () { return Ge; }), n.d(e, "c", function () { return Xe; }), n.d(e, "a", function () { return ze; }), n.d(e, "e", function () { return He; }); var r = {}; n.r(r), n.d(r, "compare", function () { return m; }), n.d(r, "getLineIntersect", function () { return x; }), n.d(r, "getRectIntersectByPoint", function () { return S; }), n.d(r, "getCircleIntersectByPoint", function () { return w; }), n.d(r, "getEllipseIntersectByPoint", function () { return O; }), n.d(r, "applyMatrix", function () { return M; }), n.d(r, "invertMatrix", function () { return k; }), n.d(r, "getCircleCenterByPoints", function () { return j; }), n.d(r, "distance", function () { return C; }), n.d(r, "scaleMatrix", function () { return E; }), n.d(r, "floydWarshall", function () { return P; }), n.d(r, "getAdjMatrix", function () { return A; }), n.d(r, "translate", function () { return I; }), n.d(r, "move", function () { return T; }), n.d(r, "scale", function () { return N; }), n.d(r, "rotate", function () { return B; }), n.d(r, "getDegree", function () { return L; }), n.d(r, "isPointInPolygon", function () { return _; }), n.d(r, "intersectBBox", function () { return R; }), n.d(r, "isPolygonsIntersect", function () { return F; }), n.d(r, "Line", function () { return Y; }), n.d(r, "getBBoxBoundLine", function () { return X; }), n.d(r, "itemIntersectByLine", function () { return W; }), n.d(r, "fractionToLine", function () { return q; }), n.d(r, "getPointsCenter", function () { return V; }), n.d(r, "squareDist", function () { return G; }), n.d(r, "pointLineSquareDist", function () { return H; }), n.d(r, "isPointsOverlap", function () { return U; }), n.d(r, "pointRectSquareDist", function () { return Z; }), n.d(r, "pointLineDistance", function () { return K; }); var i = {}; n.r(i), n.d(i, "getBBox", function () { return ut; }), n.d(i, "getLoopCfgs", function () { return ht; }), n.d(i, "getLabelPosition", function () { return lt; }), n.d(i, "traverseTree", function () { return dt; }), n.d(i, "traverseTreeUp", function () { return pt; }), n.d(i, "getLetterWidth", function () { return gt; }), n.d(i, "getTextSize", function () { return vt; }), n.d(i, "plainCombosToTrees", function () { return yt; }), n.d(i, "reconstructTree", function () { return mt; }), n.d(i, "getComboBBox", function () { return bt; }), n.d(i, "shouldRefreshEdge", function () { return xt; }), n.d(i, "cloneBesidesImg", function () { return St; }); var o = {}; n.r(o), n.d(o, "uniqueId", function () { return jt; }), n.d(o, "formatPadding", function () { return Ct; }), n.d(o, "cloneEvent", function () { return Et; }), n.d(o, "isViewportChanged", function () { return Pt; }), n.d(o, "isNaN", function () { return At; }), n.d(o, "calculationItemsBBox", function () { return It; }), n.d(o, "processParallelEdges", function () { return Tt; }); var a = {}; n.r(a), n.d(a, "getSpline", function () { return te; }), n.d(a, "getControlPoint", function () { return ee; }), n.d(a, "pointsToPolygon", function () { return ne; }), n.d(a, "pathToPoints", function () { return re; }), n.d(a, "getClosedSpline", function () { return ie; }), n.d(a, "roundedHull", function () { return ce; }), n.d(a, "paddedHull", function () { return ue; }); var s = {}; n.r(s), n.d(s, "defaultSubjectColors", function () { return Re; }); var c = n(0), u = { getDefaultCfg: function () { return {}; }, getEvents: function () { return {}; }, updateCfg: function (t) { return Object.assign(this, t), !0; }, shouldBegin: function () { return !0; }, shouldUpdate: function () { return !0; }, shouldEnd: function () { return !0; }, bind: function (t) { var e = this.events; (this.graph = t), ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !0), Object(c.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !1), Object(c.each)(e, function (e, n) { t.off(n, e); }); }, get: function (t) { return this[t]; }, set: function (t, e) { return (this[t] = e), this; }, }, h = (function () { function t() {} return ( (t.registerBehavior = function (e, n) { if (!n) throw new Error( "please specify handler for this behavior: ".concat(e), ); var r = Object(c.clone)(u); Object.assign(r, n); var i = function (t) { var e = this; Object.assign(this, this.getDefaultCfg(), t); var n = this.getEvents(); this.events = null; var r = {}; n && (Object(c.each)(n, function (t, n) { r[n] = Object(c.wrapBehavior)(e, t); }), (this.events = r)); }; (i.prototype = r), (t.types[e] = i); }), (t.hasBehavior = function (e) { return !!t.types[e]; }), (t.getBehavior = function (e) { return t.types[e]; }), (t.types = {}), t ); })(), l = h, f = n(1), d = n(91), p = n(97), g = n(4), v = n(35), y = g.a.transform, m = function (t) { return function (e, n) { return e[t] - n[t]; }; }, b = function (t, e, n) { return t >= e && t <= n; }, x = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = e.x - t.x, s = e.y - t.y, c = r.x - n.x, u = r.y - n.y, h = a * u - s * c, l = 1 / h; if (h * h > 1e-4 * (a * a + s * s) * (c * c + u * u)) { var f = (i * u - o * c) * l, d = (i * s - o * a) * l; return b(f, 0, 1) && b(d, 0, 1) ? { x: t.x + f * a, y: t.y + f * s } : null; } return null; }, S = function (t, e) { var n = t.x, r = t.y, i = t.width, o = t.height, a = [], s = { x: n + i / 2, y: r + o / 2 }; a.push({ x: n, y: r }), a.push({ x: n + i, y: r }), a.push({ x: n + i, y: r + o }), a.push({ x: n, y: r + o }), a.push({ x: n, y: r }); for ( var c = null, u = 1; u < a.length && !(c = x(a[u - 1], a[u], s, e)); u++ ); return c; }, w = function (t, e) { var n = t.x, r = t.y, i = t.r, o = e.x - n, a = e.y - r; if (Math.sqrt(o * o + a * a) < i) return null; var s = Math.sign(o), c = Math.sign(a), u = Math.atan(a / o); return { x: n + Math.abs(i * Math.cos(u)) * s, y: r + Math.abs(i * Math.sin(u)) * c, }; }, O = function (t, e) { var n = t.rx, r = t.ry, i = t.x, o = t.y, a = e.x - i, s = e.y - o, c = Math.atan2(s / r, a / n); return ( c < 0 && (c += 2 * Math.PI), { x: i + n * Math.cos(c), y: o + r * Math.sin(c) } ); }, M = function (t, e, n) { void 0 === n && (n = 1); var r = [t.x, t.y, n]; return ( (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]), g.d.transformMat3(r, r, e), { x: r[0], y: r[1] } ); }, k = function (t, e, n) { void 0 === n && (n = 1), (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = g.b.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], e); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var i = [t.x, t.y, n]; return g.d.transformMat3(i, i, r), { x: i[0], y: i[1] }; }, j = function (t, e, n) { var r = t.x - e.x, i = t.y - e.y, o = t.x - n.x, a = t.y - n.y, s = (t.x * t.x - e.x * e.x - e.y * e.y + t.y * t.y) / 2, c = (t.x * t.x - n.x * n.x - n.y * n.y + t.y * t.y) / 2, u = i * o - r * a; return { x: -(a * s - i * c) / u, y: -(r * c - o * s) / u }; }, C = function (t, e) { var n = t.x - e.x, r = t.y - e.y; return Math.sqrt(n * n + r * r); }, E = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }, P = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var i = 0; i < n; i += 1) r === i ? (e[r][i] = 0) : 0 !== t[r][i] && t[r][i] ? (e[r][i] = t[r][i]) : (e[r][i] = 1 / 0); } for (var o = 0; o < n; o += 1) for (r = 0; r < n; r += 1) for (i = 0; i < n; i += 1) e[r][i] > e[r][o] + e[o][i] && (e[r][i] = e[r][o] + e[o][i]); return e; }, A = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }, I = function (t, e) { t.translate(e.x, e.y); }, T = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = t.getCanvasBBox(), i = e.x - r.minX, o = e.y - r.minY, a = y(n, [["t", i, o]]); t.setMatrix(a); }, N = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e; Object(c.isArray)(e) || (r = [e, e]), Object(c.isArray)(e) && 1 === e.length && (r = [e[0], e[0]]), (n = y(n, [["s", r[0], r[1]]])), t.setMatrix(n); }, B = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (n = y(n, [["r", e]])), t.setMatrix(n); }, L = function (t, e, n) { for (var r = [], i = 0; i < t; i++) r[i] = 0; return ( n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r ); }; function D(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } var _ = function (t, e, n) { var r = !1, i = t.length; function o(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } if (i <= 2) return !1; for (var a = 0; a < i; a++) { var s = t[a], c = t[(a + 1) % i]; if (D(s, c, [e, n])) return !0; o(s[1] - n) > 0 != o(c[1] - n) > 0 && o(e - ((n - s[1]) * (s[0] - c[0])) / (s[1] - c[1]) - s[0]) < 0 && (r = !r); } return r; }, R = function (t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); }, F = function (t, e) { var n = function (t) { var e = t.map(function (t) { return t[0]; }), n = t.map(function (t) { return t[1]; }); return { minX: Math.min.apply(null, e), maxX: Math.max.apply(null, e), minY: Math.min.apply(null, n), maxY: Math.max.apply(null, n), }; }, r = function (t) { for (var e = [], n = t.length, r = 0; r < n - 1; r++) { var i = t[r], o = t[r + 1]; e.push({ from: { x: i[0], y: i[1] }, to: { x: o[0], y: o[1] }, }); } if (e.length > 1) { var a = t[0], s = t[n - 1]; e.push({ from: { x: s[0], y: s[1] }, to: { x: a[0], y: a[1] }, }); } return e; }; if (t.length < 2 || e.length < 2) return !1; var i = n(t), o = n(e); if (!R(i, o)) return !1; var a = !1; if ( (Object(c.each)(e, function (e) { if (_(t, e[0], e[1])) return (a = !0), !1; }), a) ) return !0; if ( (Object(c.each)(t, function (t) { if (_(e, t[0], t[1])) return (a = !0), !1; }), a) ) return !0; var s = r(t), u = r(e), h = !1; return ( Object(c.each)(u, function (t) { if ( (function (t, e) { var n = !1; return ( Object(c.each)(t, function (t) { if (x(t.from, t.to, e.from, e.to)) return (n = !0), !1; }), n ); })(s, t) ) return (h = !0), !1; }), h ); }, Y = (function () { function t(t, e, n, r) { (this.x1 = t), (this.y1 = e), (this.x2 = n), (this.y2 = r); } return ( (t.prototype.getBBox = function () { var t = Math.min(this.x1, this.x2), e = Math.min(this.y1, this.y2), n = Math.max(this.x1, this.x2), r = Math.max(this.y1, this.y2); return { x: t, y: e, minX: t, minY: e, maxX: n, maxY: r, width: n - t, height: r - e, }; }), t ); })(), X = function (t, e) { return { top: [t.minX, t.minY, t.maxX, t.minY], left: [t.minX, t.minY, t.minX, t.maxY], bottom: [t.minX, t.maxY, t.maxX, t.maxY], right: [t.maxX, t.minY, t.maxX, t.maxY], }[e]; }, z = function (t, e) { var n = (e.x2 - e.x1) * (t.y1 - e.y1) - (e.y2 - e.y1) * (t.x1 - e.x1), r = (t.x2 - t.x1) * (t.y1 - e.y1) - (t.y2 - t.y1) * (t.x1 - e.x1), i = (e.y2 - e.y1) * (t.x2 - t.x1) - (e.x2 - e.x1) * (t.y2 - t.y1); if (i) { var o = n / i, a = r / i; if (o >= 0 && o <= 1 && a >= 0 && a <= 1) return o; } return Number.POSITIVE_INFINITY; }, W = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = 0, o = [], a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3]; (o[a] = x( { x: e.x1, y: e.y1 }, { x: e.x2, y: e.y2 }, { x: c, y: u }, { x: h, y: l }, )), o[a] && (i += 1); } return [o, i]; }, q = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = Number.POSITIVE_INFINITY, o = 0, a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3], f = z(e, new Y(c, u, h, l)); (f = Math.abs(f - 0.5)) >= 0 && f <= 1 && ((o += 1), (i = f < i ? f : i)); } return 0 === o ? -1 : i; }, V = function (t) { var e = 0, n = 0; if (t.length > 0) { for (var r = 0, i = t; r < i.length; r++) { var o = i[r]; (e += o.x), (n += o.y); } (e /= t.length), (n /= t.length); } return { x: e, y: n }; }, G = function (t, e) { return Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2); }, H = function (t, e) { var n, r = e.x1, i = e.y1, o = e.x2 - r, a = e.y2 - i, s = t.x - r, c = t.y - i, u = s * o + c * a; n = u <= 0 || (u = (s = o - s) * o + (c = a - c) * a) <= 0 ? 0 : (u * u) / (o * o + a * a); var h = s * s + c * c - n; return h < 0 && (h = 0), h; }, U = function (t, e, n) { return ( void 0 === n && (n = 0.001), Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2) < Math.pow(n, 2) ); }, Z = function (t, e) { var n = t.x < e.x, r = t.x > e.x + e.width, i = t.y > e.y + e.height, o = t.y < e.y; if (!(n || r || i || o)) return 0; if (i && !n && !r) return Math.pow(e.y + e.height - t.y, 2); if (o && !n && !r) return Math.pow(t.y - e.y, 2); if (n && !i && !o) return Math.pow(e.x - t.x, 2); if (r && !i && !o) return Math.pow(e.x + e.width - t.x, 2); var a = Math.min(Math.abs(e.x - t.x), Math.abs(e.x + e.width - t.x)), s = Math.min(Math.abs(e.y - t.y), Math.abs(e.y + e.height - t.y)); return a * a + s * s; }, K = function (t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], a = e.x, s = e.y, c = [i - n, o - r]; if (g.c.exactEquals(c, [0, 0])) return NaN; var u = [-c[1], c[0]]; g.c.normalize(u, u); var h = [a - n, s - r]; return Math.abs(g.c.dot(h, u)); }, $ = "rgb(95, 149, 255)", Q = "rgb(253, 253, 253)", J = "rgb(247, 250, 255)", tt = "rgb(224, 224, 224)", et = "rgb(224, 224, 224)", nt = { version: "0.0.2", rootContainerClassName: "root-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: $, fill: "rgb(239, 244, 255)" }, size: 20, color: $, linkPoints: { size: 8, lineWidth: 1, fill: J, stroke: $ }, }, nodeStateStyles: { active: { fill: J, stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, }, selected: { fill: "rgb(255, 255, 255)", stroke: $, lineWidth: 4, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: "rgb(223, 234, 255)", stroke: "#4572d9", lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: "rgb(247, 250, 255)", stroke: "rgb(191, 213, 255)", lineWidth: 1, }, disable: { fill: "rgb(250, 250, 250)", stroke: "rgb(224, 224, 224)", lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: tt, lineAppendWidth: 2 }, color: tt, }, edgeStateStyles: { active: { stroke: $, lineWidth: 1 }, selected: { stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: $, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(234, 234, 234)", lineWidth: 1 }, disable: { stroke: "rgb(245, 245, 245)", lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12, }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: Q, lineWidth: 1, stroke: et, r: 5, width: 20, height: 10, }, size: [20, 5], color: et, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: $, lineWidth: 1, fill: "rgb(247, 250, 255)" }, selected: { stroke: $, lineWidth: 2, fill: Q, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: "#4572d9", lineWidth: 2, fill: Q, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(224, 224, 224)", fill: Q, lineWidth: 1 }, disable: { stroke: "rgb(234, 234, 234)", fill: "rgb(250, 250, 250)", lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, }, rt = { " ": 0.3329986572265625, a: 0.5589996337890625, A: 0.6569992065429687, b: 0.58599853515625, B: 0.6769989013671875, c: 0.5469985961914062, C: 0.7279998779296875, d: 0.58599853515625, D: 0.705999755859375, e: 0.554998779296875, E: 0.63699951171875, f: 0.37299957275390627, F: 0.5769989013671875, g: 0.5909988403320312, G: 0.7479995727539063, h: 0.555999755859375, H: 0.7199996948242188, i: 0.255999755859375, I: 0.23699951171875, j: 0.26699981689453123, J: 0.5169998168945312, k: 0.5289993286132812, K: 0.6899993896484375, l: 0.23499908447265624, L: 0.5879989624023437, m: 0.854998779296875, M: 0.8819992065429687, n: 0.5589996337890625, N: 0.7189987182617188, o: 0.58599853515625, O: 0.7669998168945312, p: 0.58599853515625, P: 0.6419998168945312, q: 0.58599853515625, Q: 0.7669998168945312, r: 0.3649993896484375, R: 0.6759994506835938, s: 0.504998779296875, S: 0.6319992065429687, t: 0.354998779296875, T: 0.6189987182617187, u: 0.5599990844726562, U: 0.7139999389648437, v: 0.48199920654296874, V: 0.6389999389648438, w: 0.754998779296875, W: 0.929998779296875, x: 0.5089996337890625, X: 0.63699951171875, y: 0.4959991455078125, Y: 0.66199951171875, z: 0.48699951171875, Z: 0.6239990234375, 0: 0.6, 1: 0.40099945068359377, 2: 0.6, 3: 0.6, 4: 0.6, 5: 0.6, 6: 0.6, 7: 0.5469985961914062, 8: 0.6, 9: 0.6, "[": 0.3329986572265625, "]": 0.3329986572265625, ",": 0.26399993896484375, ".": 0.26399993896484375, ";": 0.26399993896484375, ":": 0.26399993896484375, "{": 0.3329986572265625, "}": 0.3329986572265625, "\\": 0.5, "|": 0.19499969482421875, "=": 0.604998779296875, "+": 0.604998779296875, "-": 0.604998779296875, _: 0.5, "`": 0.3329986572265625, " ~": 0.8329986572265625, "!": 0.3329986572265625, "@": 0.8579986572265625, "#": 0.6, $: 0.6, "%": 0.9699996948242188, "^": 0.517999267578125, "&": 0.7259994506835937, "*": 0.505999755859375, "(": 0.3329986572265625, ")": 0.3329986572265625, "<": 0.604998779296875, ">": 0.604998779296875, "/": 0.5, "?": 0.53699951171875, }, it = Math.PI, ot = Math.sin, at = Math.cos, st = ot(it / 8), ct = at(it / 8), ut = function (t, e) { var n = t.getBBox(), r = { x: n.minX, y: n.minY }, i = { x: n.maxX, y: n.maxY }; if (e) { var o = e.getMatrix(); o || (o = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = M(r, o)), (i = M(i, o)); } var a = r.x, s = r.y, c = i.x, u = i.y; return { x: a, y: s, minX: a, minY: s, maxX: c, maxY: u, width: c - a, height: u - s, }; }, ht = function (t) { var e = t.sourceNode || t.targetNode, n = e.get("group").getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e.getKeyShape().getBBox(), i = t.loopCfg || {}, o = i.dist || 2 * Math.max(r.width, r.height), a = i.position || nt.defaultLoopPosition, s = [n[6], n[7]], c = [t.startPoint.x, t.startPoint.y], u = [t.endPoint.x, t.endPoint.y], h = r.height / 2, l = r.height / 2, f = h * st, d = h * ct, p = l * st, v = l * ct; if (c[0] === u[0] && c[1] === u[1]) { switch (a) { case "top": (c = [s[0] - f, s[1] - d]), (u = [s[0] + p, s[1] - v]); break; case "top-right": (h = r.height / 2), (l = r.width / 2), (c = [s[0] + (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (v = l * ct), s[1] - (p = l * st)]); break; case "right": (h = r.width / 2), (l = r.width / 2), (c = [s[0] + (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] + (v = l * ct), s[1] + (p = l * st)]); break; case "bottom-right": (h = r.width / 2), (l = r.height / 2), (c = [s[0] + (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] + (p = l * st), s[1] + (v = l * ct)]); break; case "bottom": (h = r.height / 2), (l = r.height / 2), (c = [s[0] + (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (p = l * st), s[1] + (v = l * ct)]); break; case "bottom-left": (h = r.height / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (v = l * ct), s[1] + (p = l * st)]); break; case "left": (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] - (v = l * ct), s[1] - (p = l * st)]); break; case "top-left": (h = r.width / 2), (l = r.height / 2), (c = [s[0] - (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] - (p = l * st), s[1] - (v = l * ct)]); break; default: (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (p = l * st), s[1] - (v = l * ct)]); } if (!1 === i.clockwise) { var y = [c[0], c[1]]; (c = [u[0], u[1]]), (u = [y[0], y[1]]); } } var m = [c[0] - s[0], c[1] - s[1]], b = (h + o) / h, x = (l + o) / l; !1 === i.clockwise && ((b = (l + o) / l), (x = (h + o) / h)); var S = g.c.scale([0, 0], m, b), w = [s[0] + S[0], s[1] + S[1]], O = [u[0] - s[0], u[1] - s[1]], M = g.c.scale([0, 0], O, x), k = [s[0] + M[0], s[1] + M[1]]; return ( (t.startPoint = { x: c[0], y: c[1] }), (t.endPoint = { x: u[0], y: u[1] }), (t.controlPoints = [ { x: w[0], y: w[1] }, { x: k[0], y: k[1] }, ]), t ); }, lt = function (t, e, n, r, i) { var o = [], a = t.getPoint(e); if (null === a) return { x: 0, y: 0, angle: 0 }; if (e < 1e-4) o = t.getStartTangent().reverse(); else if (e > 0.9999) o = t.getEndTangent(); else { var s = t.getPoint(e + 1e-4); o.push([a.x, a.y]), o.push([s.x, s.y]); } var c = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]); if ( (c < 0 && (c += 2 * it), n && ((a.x += at(c) * n), (a.y += ot(c) * n)), r) ) { var u = c - it / 2; c > 0.5 * it && c < 1.5 * it && (u -= it), (a.x += at(u) * r), (a.y += ot(u) * r); } var h = { x: a.x, y: a.y, angle: c }; return i ? (c > 0.5 * it && c < 1.5 * it && (c -= it), Object(f.a)({ rotate: c }, h)) : h; }, ft = function t(e, n) { if (!1 === n(e)) return !1; if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return !1; return !0; }, dt = function (t, e) { "function" == typeof e && ft(t, e); }, pt = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !1 !== n(e); })(t, e); }, gt = function (t, e) { return e * (rt[t] || 1); }, vt = function (t, e) { var n = 0, r = new RegExp("[一-龥]+"); return ( t.split("").forEach(function (t) { r.test(t) ? (n += e) : (n += gt(t, e)); }), [n, e] ); }, yt = function (t, e) { var n = [], r = {}, i = {}; t.forEach(function (t) { i[t.id] = t; }), t.forEach(function (t, e) { var o = Object(c.clone)(t); (o.itemType = "combo"), (o.children = void 0), o.parentId === o.id ? (console.warn( "The parentId for combo ".concat( o.id, " can not be the same as the combo's id", ), ), delete o.parentId) : o.parentId && !i[o.parentId] && (console.warn( "The parent combo for combo ".concat( o.id, " does not exist!", ), ), delete o.parentId); var a = r[o.id]; if (a) { if ( ((o.children = a.children), (r[o.id] = o), !(a = o).parentId) ) return void n.push(a); var s = r[a.parentId]; if (s) s.children ? s.children.push(o) : (s.children = [o]); else { var u = { id: a.parentId, children: [a] }; (r[a.parentId] = u), (r[o.id] = o); } } else if (Object(c.isString)(t.parentId)) { var h = r[t.parentId]; if (h) h.children ? h.children.push(o) : (h.children = [o]), (r[o.id] = o); else { var l = { id: t.parentId, children: [o] }; (r[l.id] = l), (r[o.id] = o); } } else n.push(o), (r[o.id] = o); }); var o = {}; (e || []).forEach(function (t) { o[t.id] = t; var e = r[t.comboId]; if (e) { var n = { id: t.id, comboId: t.comboId }; e.children ? e.children.push(n) : (e.children = [n]), (n.itemType = "node"), (r[t.id] = n); } }); var a = 0; return ( n.forEach(function (t) { (t.depth = a + 10), ft(t, function (t) { var e, n = r[t.id].itemType; (e = "node" === n ? r[t.comboId] : r[t.parentId]), (t.depth = e && "node" === n ? a + 1 : a + 10), a < t.depth && (a = t.depth); var i = o[t.id]; return i && (i.depth = t.depth), !0; }); }), n ); }, mt = function (t, e, n) { var r, i = t, o = { root: { children: t } }, a = !1, s = "root"; (t || []).forEach(function (t) { if (!a) return t.id === e ? ((r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), void (a = !0)) : void dt(t, function (t) { return ( (o[t.id] = { children: t.children }), (i = o[t.parentId || t.comboId || "root"].children), !t || (!t.removed && e !== t.id) || !i || ((s = t.parentId || t.comboId || "root"), (r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), (a = !0), !1) ); }); }); var c = (i = o[s].children) ? i.indexOf(r) : -1; if ( (c > -1 && i.splice(c, 1), a || ((r = { id: e, itemType: "node", comboId: n }), (o[e] = { children: void 0 })), e) ) { var u = !1; if (n) { var h = 0; (t || []).forEach(function (t) { u || dt(t, function (t) { return ( n !== t.id || ((u = !0), t.children ? t.children.push(r) : (t.children = [r]), (h = t.depth), "node" === r.itemType ? (r.depth = h + 2) : (r.depth = h + 1), !1) ); }); }); } else (n && u) || "node" === r.itemType || t.push(r); var l = r.depth; dt(r, function (t) { return ( "node" === t.itemType ? (l += 2) : (l += 1), (t.depth = l), !0 ); }); } return t; }, bt = function (t, e) { var n = { minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0, x: void 0, y: void 0, width: void 0, height: void 0, centerX: void 0, centerY: void 0, }; return t && 0 !== t.length ? (t.forEach(function (t) { var r = e.findById(t.id); if (r && r.isVisible()) { r.set("bboxCanvasCache", void 0); var i = r.getCanvasBBox(); i.x && n.minX > i.minX && (n.minX = i.minX), i.y && n.minY > i.minY && (n.minY = i.minY), i.x && n.maxX < i.maxX && (n.maxX = i.maxX), i.y && n.maxY < i.maxY && (n.maxY = i.maxY); } }), (n.x = (n.minX + n.maxX) / 2), (n.y = (n.minY + n.maxY) / 2), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), Object.keys(n).forEach(function (t) { (n[t] !== 1 / 0 && n[t] !== -1 / 0) || (n[t] = void 0); }), n) : n; }, xt = function (t) { var e = Object(c.isNumber)(t.x) || Object(c.isNumber)(t.y) || t.type || t.anchorPoints || t.size; return ( t.style && (e = e || Object(c.isNumber)(t.style.r) || Object(c.isNumber)(t.style.width) || Object(c.isNumber)(t.style.height) || Object(c.isNumber)(t.style.rx) || Object(c.isNumber)(t.style.ry)), e ); }, St = function (t) { var e = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n]; if (Object(c.isObject)(r)) { var i = {}; Object.keys(r).forEach(function (t) { var e = r[t]; ("img" !== t || Object(c.isString)(e)) && (i[t] = Object(c.clone)(e)); }), (e[n] = i); } else e[n] = Object(c.clone)(r); }), e ); }, wt = function (t) { if (!t) return console.error("G6 Error Tips: the data must be defined"), !1; var e = t.nodes, n = t.edges, r = t.combos, i = void 0 === r ? [] : r; if (!e && !n) { var o = !0; return ( dt(t, function (t) { return !!Object(c.isString)(t.id) || ((o = !1), !1); }), o ); } var a = (e || []).find(function (t) { return !Object(c.isString)(t.id); }); if (a) return ( console.warn( "G6 Warning Tips: missing 'id' property, or %c".concat( a.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); var s = (e || []).map(function (t) { return t.id; }), u = i.map(function (t) { return t.id; }), h = Object(f.f)(Object(f.f)([], s, !0), u, !0), l = (n || []).find(function (t) { return !h.includes(t.source) || !h.includes(t.target); }); return ( !l || (console.warn( "G6 Warning Tips: The source %c" .concat(l.source, "%c or the target %c") .concat( l.target, "%c of the edge do not exist in the nodes or combos.", ), "font-size: 20px; color: red;", "", "font-size: 20px; color: red;", "", ), !1) ); }, Ot = (function () { function t(t) { (this.graph = t), (this.destroyed = !1), (this.modes = t.get("modes") || { default: [] }), this.formatModes(), (this.mode = t.get("defaultMode") || "default"), (this.currentBehaves = []), this.setMode(this.mode); } return ( (t.prototype.formatModes = function () { var t = this.modes; Object(c.each)(t, function (t) { Object(c.each)(t, function (e, n) { Object(c.isString)(e) && (t[n] = { type: e }); }); }); }), (t.prototype.setBehaviors = function (t) { var e, n = this.graph, r = this.modes[t], i = []; Object(c.each)(r || [], function (t) { var r = h.getBehavior(t.type || t); r && (e = new r(t)) && (e.bind(n), i.push(e)); }), (this.currentBehaves = i); }), (t.mergeBehaviors = function (t, e) { return ( Object(c.each)(e, function (e) { t.indexOf(e) < 0 && (Object(c.isString)(e) && (e = { type: e }), t.push(e)); }), t ); }), (t.filterBehaviors = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = ""; (r = Object(c.isString)(t) ? t : t.type), e.indexOf(r) < 0 && n.push(t); }), n ); }), (t.prototype.setMode = function (t) { var e = this.modes, n = this.graph, r = t; e[r] && (n.emit("beforemodechange", { mode: t }), Object(c.each)(this.currentBehaves, function (t) { t.delegate && t.delegate.remove(), t.unbind(n); }), this.setBehaviors(r), n.emit("aftermodechange", { mode: t }), (this.mode = t)); }), (t.prototype.getMode = function () { return this.mode; }), (t.prototype.manipulateBehaviors = function (e, n, r) { var i, o = this; if (((i = Object(c.isArray)(e) ? e : [e]), Object(c.isArray)(n))) return ( Object(c.each)(n, function (e) { o.modes[e] ? (o.modes[e] = r ? t.mergeBehaviors(o.modes[e] || [], i) : t.filterBehaviors(o.modes[e] || [], i)) : r && (o.modes[e] = i); }), this ); var a = n; return ( n || (a = this.mode), this.modes[a] || (r && (this.modes[a] = i)), (this.modes[a] = r ? t.mergeBehaviors(this.modes[a] || [], i) : t.filterBehaviors(this.modes[a] || [], i)), this.setMode(this.mode), this ); }), (t.prototype.updateBehavior = function (t, e, n) { Object(c.isString)(t) && (t = { type: t }); var r = []; if (n && n !== this.mode && "default" !== n) { if (!(r = this.modes[n]) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); var i = r.length; for (a = 0; a < i; a++) { if ((s = r[a]).type === t.type || s === t.type) return ( s === t.type && (s = { type: s }), Object.assign(s, e), (r[a] = s), this ); a === i - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } else { if (!(r = this.currentBehaves) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); for (var o = r.length, a = 0; a < o; a++) { var s; if ((s = r[a]).type === t.type) return s.updateCfg(e), this; a === o - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } return this; }), (t.prototype.destroy = function () { (this.graph = null), (this.modes = null), (this.currentBehaves = null), (this.destroyed = !0); }), t ); })(), Mt = n(54), kt = (function (t) { function e(e, n) { var r = t.call(this, e, n) || this; return ( (r.item = n.item), (r.canvasX = n.canvasX), (r.canvasY = n.canvasY), (r.detail = n.detail), r ); } return Object(f.c)(e, t), e; })(n(8).Event), jt = function (t) { return "".concat(t, "-").concat(Math.random()).concat(Date.now()); }, Ct = function (t) { var e = 0, n = 0, r = 0, i = 0; if (Object(c.isNumber)(t)) e = n = r = i = t; else if (Object(c.isString)(t)) { e = n = r = i = parseInt(t, 10); } else Object(c.isArray)(t) && ((e = t[0]), (r = Object(c.isNil)(t[1]) ? t[0] : t[1]), (i = Object(c.isNil)(t[2]) ? t[0] : t[2]), (n = Object(c.isNil)(t[3]) ? r : t[3])); return [e, r, i, n]; }, Et = function (t) { var e = new kt(t.type, t); return ( (e.clientX = t.clientX), (e.clientY = t.clientY), (e.x = t.x), (e.y = t.y), (e.target = t.target), (e.currentTarget = t.currentTarget), (e.bubbles = !0), (e.item = t.item), e ); }, Pt = function (t) { if (!t) return !1; for (var e = [1, 0, 0, 0, 1, 0, 0, 0, 1], n = 0; n < 9; n++) if (t[n] !== e[n]) return !0; return !1; }, At = function (t) { return Number.isNaN(Number(t)); }, It = function (t) { for ( var e = 1 / 0, n = -1 / 0, r = 1 / 0, i = -1 / 0, o = 0; o < t.length; o++ ) { var a = t[o].getBBox(), s = a.minX, c = a.minY, u = a.maxX, h = a.maxY; s < e && (e = s), c < r && (r = c), u > n && (n = u), h > i && (i = h); } return { x: Math.floor(e), y: Math.floor(r), width: Math.ceil(n) - Math.floor(e), height: Math.ceil(i) - Math.floor(r), minX: e, minY: r, maxX: n, maxY: i, }; }, Tt = function (t, e, n, r, i) { void 0 === e && (e = 15), void 0 === n && (n = "quadratic"), void 0 === r && (r = void 0), void 0 === i && (i = void 0); for ( var o = t.length, a = 2 * e, s = [ "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ], c = {}, u = [], h = {}, l = 0; l < o; l++ ) { var f = t[l], d = f.source, p = f.target, g = "".concat(d, "-").concat(p); if (!u[l]) { c[g] || (c[g] = []), (u[l] = !0), c[g].push(f); for (var v = 0; v < o; v++) if (l !== v) { var y = t[v], m = y.source, b = y.target; u[v] || (d === b && p === m ? (c[g].push(y), (u[v] = !0), (h[ "" .concat(m, "|") .concat(b, "|") .concat(c[g].length - 1) ] = !0)) : d === m && p === b && (c[g].push(y), (u[v] = !0))); } } } for (var x in c) for (var S = c[x], w = S.length, O = 0; O < w; O++) { var M = S[O]; if (M.source !== M.target) if (1 === w && r && M.source !== M.target) M.type = r; else { M.type = n; var k = (O % 2 == 0 ? 1 : -1) * (h["".concat(M.source, "|").concat(M.target, "|").concat(O)] ? -1 : 1); M.curveOffset = w % 2 == 1 ? k * Math.ceil(O / 2) * a : k * (Math.floor(O / 2) * a + e); } else i && (M.type = i), (M.loopCfg = { position: s[O % 8], dist: 20 * Math.floor(O / 8) + 50, }); } return t; }, Nt = (function () { function t(t) { (this.destroyed = !1), (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.getViewCenter = function () { var t = this.getFormatPadding(), e = this.graph, n = this.graph.get("width"), r = e.get("height"); return { x: (n - t[1] - t[3]) / 2 + t[3], y: (r - t[0] - t[2]) / 2 + t[0], }; }), (t.prototype.fitCenter = function () { var t = this.graph, e = t.get("group"); e.resetMatrix(); var n = e.getCanvasBBox(); if (0 !== n.width && 0 !== n.height) { var r = this.getViewCenter(), i = n.x + n.width / 2, o = n.y + n.height / 2; t.translate(r.x - i, r.y - o); } }), (t.prototype.fitView = function () { var t = this.graph, e = this.getFormatPadding(), n = t.get("width"), r = t.get("height"), i = t.get("group"); i.resetMatrix(); var o = i.getCanvasBBox(); if (0 !== o.width && 0 !== o.height) { var a = this.getViewCenter(), s = o.x + o.width / 2, c = o.y + o.height / 2; t.translate(a.x - s, a.y - c); var u = (n - e[1] - e[3]) / o.width, h = (r - e[0] - e[2]) / o.height, l = u; u > h && (l = h), t.zoom(l, a); } }), (t.prototype.getFormatPadding = function () { var t = this.graph.get("fitViewPadding"); return Ct(t); }), (t.prototype.focusPoint = function (t, e, n) { var r = this, i = this.getViewCenter(), o = this.getPointByCanvas(i.x, i.y), a = this.graph.get("group").getMatrix(); if ((a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), e)) { var s = (o.x - t.x) * a[0], c = (o.y - t.y) * a[4], u = 0, h = 0, l = 0, d = 0; this.graph.get("canvas").animate( function (t) { (l = s * t), (d = c * t), r.graph.translate(l - u, d - h), (u = l), (h = d); }, Object(f.a)({}, n), ); } else this.graph.translate((o.x - t.x) * a[0], (o.y - t.y) * a[4]); }), (t.prototype.getPointByCanvas = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), k({ x: t, y: e }, n) ); }), (t.prototype.getPointByClient = function (t, e) { var n = this.graph.get("canvas").getPointByClient(t, e); return this.getPointByCanvas(n.x, n.y); }), (t.prototype.getClientByPoint = function (t, e) { var n = this.graph.get("canvas"), r = this.getCanvasByPoint(t, e), i = n.getClientByPoint(r.x, r.y); return { x: i.x, y: i.y }; }), (t.prototype.getCanvasByPoint = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), M({ x: t, y: e }, n) ); }), (t.prototype.focus = function (t, e, n) { if ((Object(c.isString)(t) && (t = this.graph.findById(t)), t)) { var r = 0, i = 0; if (t.getType && "edge" === t.getType()) { var o = t.getSource().get("group").getMatrix(), a = t.getTarget().get("group").getMatrix(); o && a ? ((r = (o[6] + a[6]) / 2), (i = (o[7] + a[7]) / 2)) : (o || a) && ((r = o ? o[6] : a[6]), (i = o ? o[7] : a[7])); } else { var s = t.get("group").getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = s[6]), (i = s[7]); } this.focusPoint({ x: r, y: i }, e, n); } }), (t.prototype.changeSize = function (t, e) { var n = this.graph; if (!Object(c.isNumber)(t) || !Object(c.isNumber)(e)) throw Error( "invalid canvas width & height, please make sure width & height type is number", ); n.set({ width: t, height: e }), n.get("canvas").changeSize(t, e), n.get("plugins").forEach(function (r) { if (r.get("gridContainer")) { var i = n.get("minZoom"); Object(Mt.b)(r.get("container"), { width: "".concat(t, "px"), height: "".concat(e, "px"), }), Object(Mt.b)(r.get("gridContainer"), { width: "".concat(t / i, "px"), height: "".concat(e / i, "px"), left: 0, top: 0, }); } }); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !1); }), t ); })(); function Bt(t) { return (Bt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Lt(t) { if ("string" != typeof t) return t; var e = function (t) { if ("string" != typeof t) return t; try { return JSON.parse(t.trim()); } catch (e) { return t.trim(); } }, n = e(t); if ("string" != typeof n) return n; for ( var r = function (t) { return t[t.length - 1]; }, i = t.trim(), o = [], a = [], s = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return t.some(function (t) { return r(a) === t; }); }, c = null, u = 0, h = ""; u < i.length; ) { var l = i[u], f = s('"', "'"); if (f || l.trim()) { var d = "\\" === i[u - 1], p = s("}"), g = s("]"), v = s(","), y = r(o); if (f) if (r(a) !== l || d) h += l; else { a.pop(); var m = e(h); y.push(m), (c = m), (h = ""); } else if (g && "," === l) h && (y.push(e(h)), (h = "")); else if (p && ":" === l) a.push(","), h && (y.push(h), (h = "")); else if (v && "," === l) h && (y.push(e(h)), (h = "")), a.pop(); else if ("}" === l && (p || v)) { h && (y.push(e(h)), (h = "")), v && a.pop(); for (var b = {}, x = 1; x < y.length; x += 2) b[y[x - 1]] = y[x]; o.pop(), o.length && r(o).push(b), a.pop(), (c = b); } else "]" === l && g ? (h && (y.push(e(h)), (h = "")), o.pop(), o.length && r(o).push(y), a.pop(), (c = y)) : "{" === l ? (o.push([]), a.push("}")) : "[" === l ? (o.push([]), a.push("]")) : '"' === l ? a.push('"') : "'" === l ? a.push("'") : (h += l); u += 1; } else u += 1; } return c || h; } function Dt(t, e) { var n; void 0 === e && (e = { x: 0, y: 0 }); var r = Object(f.a)({ x: 0, y: 0, width: 0, height: 0 }, e); if (null === (n = t.children) || void 0 === n ? void 0 : n.length) { var i = t.attrs, o = void 0 === i ? {} : i, a = o.marginTop, s = Object(f.a)({}, e); a && (s.y += a); for (var c = 0; c < t.children.length; c++) { t.children[c].attrs.key = "" .concat(o.key || "root", " -") .concat(c, " "); var u = Dt(t.children[c], s); if (u.bbox) { var h = u.bbox; "inline" === u.attrs.next ? (s.x += u.bbox.width) : (s.y += u.bbox.height), h.width + h.x > r.width && (r.width = h.width + h.x), h.height + h.y > r.height && (r.height = h.height + h.y); } } } return ( (t.bbox = (function (t, e, n) { var r, i, o = t.attrs, a = void 0 === o ? {} : o, s = { x: e.x || 0, y: e.y || 0, width: n.width || 0, height: n.height || 0, }; switch (t.type) { case "maker": case "circle": a.r && ((i = 2 * a.r), (r = 2 * a.r)); break; case "text": a.text && ((i = vt(a.text, a.fontSize || 12)[0]), (r = 16), (s.y += r), (s.height = r), (s.width = i), (t.attrs = Object(f.a)({ fontSize: 12, fill: "#000" }, a))); break; default: a.width && (i = a.width), a.height && (r = a.height); } return ( r >= 0 && (s.height = r), i >= 0 && (s.width = i), a.marginTop && (s.y += a.marginTop), a.marginLeft && (s.x += a.marginLeft), s ); })(t, e, r)), (t.attrs = Object(f.a)(Object(f.a)({}, t.attrs), t.bbox)), t ); } function _t(t) { var e = {}, n = function (e) { var n = (function (t) { return function (e) { for (var n = t.length, r = [], i = 0, o = ""; i < n; ) if ("{" === t[i] && "{" === t[i + 1]) r.push(o), (o = ""), (i += 2); else if ("}" === t[i] && "}" === t[i + 1]) { if (r.length) { var a = r.pop(); (o = Object(c.get)( e, o, a.endsWith("=") ? '"{'.concat(o, '}"') : o, )), r.push(a + o); } (i += 2), (o = ""); } else (o += t[i]), (i += 1); return ( r.push(o), r .map(function (t, e) { return r[e - 1] && r[e - 1].endsWith("=") ? '"{'.concat(t, '}"') : t; }) .join("") ); }; })("function" == typeof t ? t(e) : t)(e), r = document.createElement("div"); r.innerHTML = n; var i = Dt( (function t(e, n) { var r = {}, i = (e.getAttributeNames && e.getAttributeNames()) || [], o = e.children && Array.from(e.children).map(function (e) { return t(e, n); }), a = {}, s = e.tagName ? e.tagName.toLowerCase() : "group"; return ( "text" === s && (r.text = e.innerText), (a.type = s), "img" === s && (a.type = "image"), Array.from(i).forEach(function (t) { var n = t.split("-").reduce(function (t, e) { return t + e.charAt(0).toUpperCase() + e.slice(1); }), i = e.getAttribute(t); try { if ("style" === n || "attrs" === n) { var o = Lt(i); r = Object(f.a)(Object(f.a)({}, r), o); } else a[n] = Lt(i); } catch (t) { if ("style" === n) throw t; a[n] = i; } }), (a.attrs = r), n && n.style && a.name && "object" === Bt(n.style[a.name]) && (a.attrs = Object(f.a)( Object(f.a)({}, a.attrs), n.style[a.name], )), n && n.style && a.keyshape && (a.attrs = Object(f.a)(Object(f.a)({}, a.attrs), n.style)), o.length && (a.children = o), a ); })(r.children[0], e), ); return r.remove(), i; }; return { draw: function (t, r) { var i = n(t), o = r; return ( (function t(e) { var n = e.attrs, i = void 0 === n ? {} : n, a = e.bbox, s = e.type, c = e.children, u = Object(f.e)(e, ["attrs", "bbox", "type", "children"]); if ("group" !== e.type) { var h = r.addShape( e.type, Object(f.a)( { attrs: i, origin: { bbox: a, type: s, children: c } }, u, ), ); e.keyshape && (o = h); } e.children && e.children.forEach(function (e) { return t(e); }); })(i), (e[t.id] = [i]), o ); }, update: function (t, r) { e[t.id] || (e[t.id] = []); var i = r.getContainer(), o = i.get("children"), a = n(t), s = (function t(e, n) { var r, i, o, a, s = (e || {}).type, c = ((null == n ? void 0 : n.attrs) || {}).key; if ((c && e && (e.attrs.key = c), !e && n)) return { action: "delete", val: n, type: s, key: c }; if (e && !n) return { action: "add", val: e, type: s }; if (!e && !n) return { action: "same", type: s }; var u = []; if ( (null === (r = e.children) || void 0 === r ? void 0 : r.length) > 0 || (null === (i = n.children) || void 0 === i ? void 0 : i.length) > 0 ) for ( var h = Math.max( null === (o = e.children) || void 0 === o ? void 0 : o.length, null === (a = n.children) || void 0 === a ? void 0 : a.length, ), l = n.children || [], f = e.children || [], d = 0; d < h; d += 1 ) u.push(t(f[d], l[d])); var p = Object.keys(n.attrs), g = Object.keys(e.attrs); return n.type !== e.type ? { action: "restructure", nowTarget: e, formerTarget: n, key: c, children: u, } : p .filter(function (t) { return "children" !== t; }) .some(function (t) { return e.attrs[t] !== n.attrs[t] || !g.includes(t); }) ? { action: "change", val: e, children: u, type: s, key: c } : { action: "same", children: u, type: s, key: c }; })(a, e[t.id].pop()), c = function t(e) { var n; "group" !== e.type && i.addShape(e.type, { attrs: e.attrs }), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }, u = function t(e) { var n, r = o.find(function (t) { return t.attrs.key === e.attrs.key; }); r && i.removeChild(r), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }; !(function t(e) { var n = e.key; if ("group" !== e.type) { var i = o.find(function (t) { return t.attrs.key === n; }); switch (e.action) { case "change": if (i) { var a = e.val.keyshape ? r.getOriginStyle() : {}; i.attr(Object(f.a)(Object(f.a)({}, a), e.val.attrs)); } break; case "add": c(e.val); break; case "delete": u(e.val); break; case "restructure": u(e.formerTarget), c(e.nowTarget); } } e.children && e.children.forEach(function (e) { return t(e); }); })(s), e[t.id].push(a); }, getAnchorPoints: function () { return [ [0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0], ]; }, }; } var Rt = {}; function Ft(t) { return Rt[t] || (Rt[t] = Object(c.upperFirst)(t)), Rt[t]; } var Yt = { defaultShapeType: "defaultType", className: null, getShape: function (t) { return ( this[t] || this[this.defaultShapeType] || this["simple-circle"] ); }, draw: function (t, e, n) { var r = this.getShape(t), i = r.draw(e, n); return r.afterDraw && r.afterDraw(e, n, i), i; }, baseUpdate: function (t, e, n) { var r = this.getShape(t); r.update && r.update(e, n), r.afterUpdate && r.afterUpdate(e, n); }, setState: function (t, e, n, r) { this.getShape(t).setState(e, n, r); }, shouldUpdate: function (t) { return !!this.getShape(t).update; }, getControlPoints: function (t, e) { return this.getShape(t).getControlPoints(e); }, getAnchorPoints: function (t, e) { return this.getShape(t).getAnchorPoints(e); }, }, Xt = { options: {}, draw: function (t, e) { return this.drawShape(t, e); }, drawShape: function () {}, afterDraw: function () {}, afterUpdate: function () {}, setState: function () {}, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { var e = this.options.anchorPoints; return t.anchorPoints || e; }, }, zt = (function () { function t() {} return ( (t.registerFactory = function (e, n) { var r = Ft(e), i = Yt, o = Object(f.a)(Object(f.a)({}, i), n); return (t[r] = o), (o.className = r), o; }), (t.getFactory = function (e) { return t[Ft(e)]; }), (t.registerNode = function (e, n, r) { var i, o = t.Node; if ("string" == typeof n || "function" == typeof n) { var a = _t(n); i = Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a); } else if (n.jsx) { a = _t(n.jsx); i = Object(f.a)( Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a), n, ); } else { o.getShape(r); var s = r ? o.getShape(r) : Xt; i = Object(f.a)(Object(f.a)({}, s), n); } return (i.type = e), (i.itemType = "node"), (o[e] = i), i; }), (t.registerEdge = function (e, n, r) { var i = t.Edge, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "edge"), (i[e] = a), a; }), (t.registerCombo = function (e, n, r) { var i = t.Combo, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "combo"), (i[e] = a), a; }), t ); })(), Wt = zt; zt.registerFactory("node", { defaultShapeType: "circle" }), zt.registerFactory("edge", { defaultShapeType: "line" }), zt.registerFactory("combo", { defaultShapeType: "circle" }); var qt = (function () { function t(t) { (this._cfg = {}), (this.destroyed = !1); var e = { id: void 0, type: "item", model: {}, group: void 0, animate: !1, visible: !0, locked: !1, event: !0, keyShape: void 0, states: [], }; this._cfg = Object.assign(e, this.getDefaultCfg(), t); var n = this.get("model"), r = n.id, i = this.get("type"); r || ((r = jt(i)), (this.get("model").id = r)), this.set("id", r); var o = t.group; o && (o.set("item", this), o.set("id", r)), this.init(), this.draw(); var a = n.shape || n.type || ("edge" === i ? "line" : "circle"), s = this.get("shapeFactory"); if (s && s[a]) { var u = s[a].options; if (u && u.stateStyles) { var h = this.get("styles") || n.stateStyles; (h = Object(c.deepMix)({}, u.stateStyles, h)), this.set("styles", h); } } } return ( (t.prototype.calculateBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.calculateCanvasBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.drawInner = function () { var t = this.get("shapeFactory"), e = this.get("group"), n = this.get("model"); e.clear(); var r = n.visible; if ((void 0 === r || r || this.changeVisibility(r), t)) { this.updatePosition(n); var i = this.getShapeCfg(n), o = i.type, a = t.draw(o, i, e); a && (this.set("keyShape", a), a.set("isKeyShape", !0), a.set("draggable", !0)), this.setOriginStyle(), this.set("currentShape", o), this.restoreStates(t, o); } }), (t.prototype.setOriginStyle = function () { var t = this.get("group").get("children"), e = this.getKeyShape(), n = this, r = e.get("name"); if (this.get("originStyle")) { var i = this.getOriginStyle(); r && !i[r] && (i[r] = {}); var o = this.getCurrentStatesStyle(); Object(c.each)(t, function (t) { var e = t.get("name"), a = t.attr(); if (e && e !== r) { var s = o[e]; i[e] || (i[e] = {}), s ? Object.keys(a).forEach(function (t) { var n = a[t]; n !== s[t] && (i[e][t] = n); }) : (i[e] = "image" !== t.get("type") ? Object(c.clone)(a) : n.getShapeStyleByName(e)); } else { var u = t.attr(), h = Object(f.a)(Object(f.a)({}, o), o[r]); Object.keys(u).forEach(function (t) { var e = u[t]; h[t] !== e && (r ? (i[r][t] = e) : (i[t] = e)); }); } }), i.path && delete i.path, i.matrix && delete i.matrix, i.x && delete i.x, i.y && delete i.y, i[r] && i[r].x && delete i[r].x, i[r] && i[r].y && delete i[r].y, n.set("originStyle", i); } else { var a = {}; Object(c.each)(t, function (t) { var e = t.get("type"), i = t.get("name"); if (i && i !== r) a[i] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i); else { var o = n.getShapeStyleByName(); if ( (o.path && delete o.path, o.matrix && delete o.matrix, r) ) if (i) a[r] = o; else { var s = jt("shape"); t.set("name", s), (a[s] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i)); } else Object.assign(a, o); } }), n.set("originStyle", a); } }), (t.prototype.restoreStates = function (t, e) { var n = this, r = n.get("states"); Object(c.each)(r, function (r) { t.setState(e, r, !0, n); }); }), (t.prototype.init = function () { var t = Wt.getFactory(this.get("type")); this.set("shapeFactory", t); }), (t.prototype.get = function (t) { return this._cfg[t]; }), (t.prototype.set = function (t, e) { Object(c.isPlainObject)(t) ? (this._cfg = Object(f.a)(Object(f.a)({}, this._cfg), t)) : (this._cfg[t] = e); }), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null); }), (t.prototype.beforeDraw = function () {}), (t.prototype.afterDraw = function () {}), (t.prototype.afterUpdate = function () {}), (t.prototype.draw = function () { this.beforeDraw(), this.drawInner(), this.afterDraw(); }), (t.prototype.getShapeStyleByName = function (t) { var e, n = this.get("group"); if ( (e = t ? n.find(function (e) { return e.get("name") === t; }) : this.getKeyShape()) ) { var r = {}; return ( Object(c.each)(e.attr(), function (t, e) { "img" !== e && (r[e] = t); }), r ); } return {}; }), (t.prototype.getShapeCfg = function (t) { var e = this.get("styles"); if (e) { var n = t; return (n.style = Object(f.a)(Object(f.a)({}, e), t.style)), n; } return t; }), (t.prototype.getStateStyle = function (t) { var e = this.get("styles"); return e && e[t]; }), (t.prototype.getOriginStyle = function () { return this.get("originStyle"); }), (t.prototype.getCurrentStatesStyle = function () { var t = this, e = {}, n = t.getStates(); return n && n.length ? (Object(c.each)(t.getStates(), function (n) { e = Object.assign(e, t.getStateStyle(n)); }), e) : this.getOriginStyle(); }), (t.prototype.setState = function (t, e) { var n = this.get("states"), r = this.get("shapeFactory"), i = t, o = t; Object(c.isString)(e) && ((i = "".concat(t, ":").concat(e)), (o = "".concat(t, ":"))); var a = n; if (Object(c.isBoolean)(e)) { var s = n.indexOf(o); if (e) { if (s > -1) return; n.push(i); } else s > -1 && n.splice(s, 1); } else if (Object(c.isString)(e)) { var u = n.filter(function (t) { return t.includes(o); }); u.length > 0 && this.clearStates(u), (a = a.filter(function (t) { return !t.includes(o); })).push(i), this.set("states", a); } if (r) { var h = this.get("model").type; r.setState(h, t, e, this); } }), (t.prototype.clearStates = function (t) { var e = this, n = e.getStates(), r = e.get("shapeFactory"), i = e.get("model").type; t || (t = n), Object(c.isString)(t) && (t = [t]); var o = n.filter(function (e) { return -1 === t.indexOf(e); }); e.set("states", o), t.forEach(function (t) { r.setState(i, t, !1, e); }); }), (t.prototype.getContainer = function () { return this.get("group"); }), (t.prototype.getKeyShape = function () { return this.get("keyShape"); }), (t.prototype.getModel = function () { return this.get("model"); }), (t.prototype.getType = function () { return this.get("type"); }), (t.prototype.getID = function () { return this.get("id"); }), (t.prototype.isItem = function () { return !0; }), (t.prototype.getStates = function () { return this.get("states"); }), (t.prototype.hasState = function (t) { return this.getStates().indexOf(t) >= 0; }), (t.prototype.refresh = function () { var t = this.get("model"); this.updatePosition(t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (t.prototype.isOnlyMove = function (t) { return !1; }), (t.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = n.x, a = n.y; (t.x = isNaN(t.x) ? n.x : t.x), (t.y = isNaN(t.y) ? n.y : t.y); var s = this.get("styles"); if (t.stateStyles) { var u = t.stateStyles; Object(c.mix)(s, u), delete t.stateStyles; } Object.assign(n, t), e ? this.updatePosition(t) : ((o === t.x && a === t.y) || this.updatePosition(t), this.updateShape()), this.afterUpdate(), this.clearCache(); }), (t.prototype.updateShape = function () { var t = this.get("shapeFactory"), e = this.get("model"), n = e.type; if (t.shouldUpdate(n) && n === this.get("currentShape")) { var r = this.getShapeCfg(e); t.baseUpdate(n, r, this), this.setOriginStyle(); } else this.draw(); this.restoreStates(t, n); }), (t.prototype.updatePosition = function (t) { var e = this.get("model"), n = Object(c.isNil)(t.x) ? e.x : t.x, r = Object(c.isNil)(t.y) ? e.y : t.y, i = this.get("group"); if (Object(c.isNil)(n) || Object(c.isNil)(r)) return !1; (e.x = n), (e.y = r); var o = i.getMatrix(); return ( (!o || o[6] !== n || o[7] !== r) && (i.resetMatrix(), I(i, { x: n, y: r }), this.clearCache(), !0) ); }), (t.prototype.getBBox = function () { var t = this.get("bboxCache"); return ( t || ((t = this.calculateBBox()), this.set("bboxCache", t)), t ); }), (t.prototype.getCanvasBBox = function () { var t = this.get("bboxCanvasCache"); return ( t || ((t = this.calculateCanvasBBox()), this.set("bboxCanvasCache", t)), t ); }), (t.prototype.toFront = function () { this.get("group").toFront(); }), (t.prototype.toBack = function () { this.get("group").toBack(); }), (t.prototype.show = function () { this.changeVisibility(!0); }), (t.prototype.hide = function () { this.changeVisibility(!1); }), (t.prototype.changeVisibility = function (t) { var e = this.get("group"); t ? e.show() : e.hide(), this.set("visible", t); }), (t.prototype.isVisible = function () { return this.get("visible"); }), (t.prototype.enableCapture = function (t) { var e = this.get("group"); e && e.set("capture", t); }), (t.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), t ); })(), Vt = { source: "start", target: "end" }, Gt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "edge", sourceNode: null, targetNode: null, startPoint: null, endPoint: null, linkCenter: !1, }; }), (e.prototype.setEnd = function (t, e) { var n = Vt[t] + "Point", r = t + "Node", i = this.get(r); i && !i.destroyed && i.removeEdge(this), Object(c.isPlainObject)(e) ? (this.set(n, e), this.set(r, null)) : (e.addEdge(this), this.set(r, e), this.set(n, null)); }), (e.prototype.getLinkPoint = function (t, e, n) { var r = Vt[t] + "Point", i = t + "Node", o = this.get(r); if (!o) { var a = this.get(i), s = t + "Anchor", u = this.getPrePoint(t, n), h = e[s]; Object(c.isNil)(h) || (o = a.getLinkPointByAnchor(h)), (o = o || a.getLinkPoint(u)), Object(c.isNil)(o.index) || this.set("".concat(t, "AnchorIndex"), o.index); } return o; }), (e.prototype.getPrePoint = function (t, e) { if (e && e.length) return e["source" === t ? 0 : e.length - 1]; var n = "source" === t ? "target" : "source"; return this.getEndPoint(n); }), (e.prototype.getEndPoint = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); return r ? r.get("model") : this.get(n); }), (e.prototype.getControlPointsByCenter = function (t) { var e = this.getEndPoint("source"), n = this.getEndPoint("target"), r = this.get("shapeFactory"), i = t.type; return r.getControlPoints(i, { startPoint: e, endPoint: n }); }), (e.prototype.getEndCenter = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); if (r) { var i = r.getBBox(); return { x: i.centerX, y: i.centerY }; } return this.get(n); }), (e.prototype.init = function () { t.prototype.init.call(this), this.setSource(this.get("source")), this.setTarget(this.get("target")); }), (e.prototype.getShapeCfg = function (e) { var n = this.get("linkCenter"), r = t.prototype.getShapeCfg.call(this, e); if (n) (r.startPoint = this.getEndCenter("source")), (r.endPoint = this.getEndCenter("target")); else { var i = r.controlPoints || this.getControlPointsByCenter(r); (r.startPoint = this.getLinkPoint("source", e, i)), (r.endPoint = this.getLinkPoint("target", e, i)); } return ( (r.sourceNode = this.get("sourceNode")), (r.targetNode = this.get("targetNode")), r ); }), (e.prototype.getModel = function () { var t = this.get("model"), e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); return ( e ? delete t["source".concat("Node")] : (t.source = this.get("start".concat("Point"))), n ? delete t["target".concat("Node")] : (t.target = this.get("end".concat("Point"))), Object(c.isString)(t.source) || Object(c.isPlainObject)(t.source) || (t.source = t.source.getID()), Object(c.isString)(t.target) || Object(c.isPlainObject)(t.target) || (t.target = t.target.getID()), t ); }), (e.prototype.setSource = function (t) { this.setEnd("source", t), this.set("source", t); }), (e.prototype.setTarget = function (t) { this.setEnd("target", t), this.set("target", t); }), (e.prototype.getSource = function () { return this.get("source"); }), (e.prototype.getTarget = function () { return this.get("target"); }), (e.prototype.updatePosition = function () { return !1; }), (e.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = this.get("styles"); if (t.stateStyles) { var a = t.stateStyles; Object(c.mix)(o, a), delete t.stateStyles; } Object.assign(n, t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (e.prototype.destroy = function () { var e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); e && !e.destroyed && e.removeEdge(this), n && !n.destroyed && n.removeEdge(this), t.prototype.destroy.call(this); }), e ); })(qt), Ht = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getNearestPoint = function (t, e) { for ( var n = 0, r = t[0], i = C(t[0], e), o = 0; o < t.length; o++ ) { var a = t[o], s = C(a, e); s < i && ((r = a), (i = s), (n = o)); } return (r.anchorIndex = n), r; }), (e.prototype.getDefaultCfg = function () { return { type: "node", edges: [] }; }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getInEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("target") === t; }); }), (e.prototype.getOutEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("source") === t; }); }), (e.prototype.getNeighbors = function (t) { var e = this, n = this.get("edges"); if ("target" === t) { return n .filter(function (t) { return t.getSource() === e; }) .map(function (t) { return t.getTarget(); }); } if ("source" === t) { return n .filter(function (t) { return t.getTarget() === e; }) .map(function (t) { return t.getSource(); }); } return n.map(function (t) { return t.getSource() === e ? t.getTarget() : t.getSource(); }); }), (e.prototype.getLinkPointByAnchor = function (t) { return this.getAnchorPoints()[t]; }), (e.prototype.getLinkPoint = function (t) { var e, n, r = this.get("keyShape").get("type"), i = this.get("type"), o = this.getBBox(); "combo" === i ? ((e = o.centerX || (o.maxX + o.minX) / 2), (n = o.centerY || (o.maxY + o.minY) / 2)) : ((e = o.centerX), (n = o.centerY)); var a, s = this.getAnchorPoints(); switch (r) { case "circle": a = w({ x: e, y: n, r: o.width / 2 }, t); break; case "ellipse": a = O({ x: e, y: n, rx: o.width / 2, ry: o.height / 2 }, t); break; default: a = S(o, t); } var c = a; return ( s.length && (c || (c = t), (c = this.getNearestPoint(s, c))), c || (c = { x: e, y: n }), c ); }), (e.prototype.getAnchorPoints = function () { var t = this.get("anchorPointsCache"); if (!t) { t = []; var e = this.get("shapeFactory"), n = this.getBBox(), r = this.get("model"), i = this.getShapeCfg(r), o = r.type, a = e.getAnchorPoints(o, i) || []; Object(c.each)(a, function (e, r) { var i = { x: n.minX + e[0] * n.width, y: n.minY + e[1] * n.height, anchorIndex: r, }; t.push(i); }), this.set("anchorPointsCache", t); } return t; }), (e.prototype.addEdge = function (t) { this.get("edges").push(t); }), (e.prototype.lock = function () { this.set("locked", !0); }), (e.prototype.unlock = function () { this.set("locked", !1); }), (e.prototype.hasLocked = function () { return this.get("locked"); }), (e.prototype.removeEdge = function (t) { var e = this.getEdges(), n = e.indexOf(t); n > -1 && e.splice(n, 1); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("anchorPointsCache", null); }), (e.prototype.isOnlyMove = function (t) { if (!t) return !1; var e = !Object(c.isNil)(t.x), n = !Object(c.isNil)(t.y), r = Object.keys(t); return (1 === r.length && (e || n)) || (2 === r.length && e && n); }), e ); })(qt), Ut = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "combo", nodes: [], edges: [], combos: [] }; }), (e.prototype.getShapeCfg = function (t) { var e = this.get("styles"), n = this.get("bbox"); if (e && n) { var r = t, i = { r: Math.hypot(n.height, n.width) / 2 || nt.defaultCombo.size[0] / 2, width: n.width || nt.defaultCombo.size[0], height: n.height || nt.defaultCombo.size[1], }; r.style = Object(f.a)( Object(f.a)(Object(f.a)({}, e), t.style), i, ); var o = t.padding || nt.defaultCombo.padding; return ( Object(c.isNumber)(o) ? ((i.r += o), (i.width += 2 * o), (i.height += 2 * o)) : ((i.r += o[0]), (i.width += o[1] + o[3] || 2 * o[1]), (i.height += o[0] + o[2] || 2 * o[0])), this.set("sizeCache", i), r ); } return t; }), (e.prototype.calculateCanvasBBox = function () { if (!this.destroyed) { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); var r = this.get("sizeCache"), i = this.get("bboxCache") || {}, o = i.x, a = i.x; if (r) (r.width = Math.max(r.width, n.width)), (r.height = Math.max(r.height, n.height)), "circle" === t.get("type") ? ((n.width = 2 * r.r), (n.height = 2 * r.r)) : ((n.width = r.width), (n.height = r.height)), (n.minX = n.centerX - n.width / 2), (n.minY = n.centerY - n.height / 2), (n.maxX = n.centerX + n.width / 2), (n.maxY = n.centerY + n.height / 2); else (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); return ( (n.x = n.minX), (n.y = n.minY), (n.x === o && n.y === a) || this.set("anchorPointsCache", null), n ); } }), (e.prototype.getChildren = function () { return { nodes: this.getNodes(), combos: this.getCombos() }; }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.addChild = function (t) { switch (t.getType()) { case "node": this.addNode(t); break; case "combo": this.addCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.addCombo = function (t) { return this.get("combos").push(t), !0; }), (e.prototype.addNode = function (t) { return this.get("nodes").push(t), !0; }), (e.prototype.removeChild = function (t) { switch (t.getType()) { case "node": this.removeNode(t); break; case "combo": this.removeCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.removeCombo = function (t) { if (t) { var e = this.getCombos(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.removeNode = function (t) { if (t) { var e = this.getNodes(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.isOnlyMove = function (t) { return !1; }), (e.prototype.getBBox = function () { return ( this.set("bboxCanvasCache", null), this.calculateCanvasBBox() ); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null), this.set("anchorPointsCache", null); }), (e.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), this.set("sizeCache", null), this.set("bbox", null), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), e ); })(Ht), Zt = (function () { function t(t) { (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.addItem = function (t, e) { var n = this.graph, r = "vedge" === t ? "edge" : t, i = n.get("".concat(r, "Group")) || n.get("group"), o = Object(c.upperFirst)(r), a = null, s = n.get(r + Object(c.upperFirst)("stateStyles")) || {}, u = n.get("default" + o); e.stateStyles && (s = e.stateStyles), u && Object(c.each)(u, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, t, e[n])) : Object(c.isArray)(t) ? (e[n] = e[n] || Object(c.clone)(u[n])) : (e[n] = e[n] || u[n]); }); var h = n.get(r + "Mapper"); if (h) { var l = h(e); l.stateStyles && ((s = l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, e[n], t)) : (e[n] = l[n] || e[n]); }); } if ( (n.emit("beforeadditem", { type: t, model: e }), "edge" === t || "vedge" === t) ) { var f = void 0, d = void 0; if ( ((f = e.source), (d = e.target), f && Object(c.isString)(f) && (f = n.findById(f)), d && Object(c.isString)(d) && (d = n.findById(d)), !f || !d) ) return void console.warn( "The source or target node of edge ".concat( e.id, " does not exist!", ), ); f.getType && "combo" === f.getType() && (e.isComboEdge = !0), d.getType && "combo" === d.getType() && (e.isComboEdge = !0), (a = new Gt({ model: e, source: f, target: d, styles: s, linkCenter: n.get("linkCenter"), group: i.addGroup(), })); } else if ("node" === t) a = new Ht({ model: e, styles: s, group: i.addGroup() }); else if ("combo" === t) { var p = e.children, g = bt(p, n); isNaN(g.x) ? isNaN(e.x) && (e.x = 100 * Math.random()) : (e.x = g.x), isNaN(g.y) ? isNaN(e.y) && (e.y = 100 * Math.random()) : (e.y = g.y); var v = i.addGroup(); v.setZIndex(e.depth); var y = (a = new Ut({ model: e, styles: s, bbox: e.collapsed ? bt([], n) : g, group: v, })).getModel(); (p || []).forEach(function (t) { var e = n.findById(t.id); a.addChild(e), (t.depth = y.depth + 2); }), e.collapsed && setTimeout(function () { n.collapseCombo(a); }, 16); } if (a) return ( n.get("".concat(t, "s")).push(a), (n.get("itemMap")[a.get("id")] = a), n.emit("afteradditem", { item: a, model: e }), a ); }), (t.prototype.updateItem = function (t, e) { var n, r, i = this.graph; if ( (Object(c.isString)(t) && (t = i.findById(t)), t && !t.destroyed) ) { var o = ""; t.getType && (o = t.getType()); var a = i.get(o + "Mapper"), s = t.getModel(), u = t.isOnlyMove(e); if (a) { var h = a(Object(c.deepMix)({}, s, e)), l = Object(c.deepMix)({}, s, h, e); h.stateStyles && (t.set("styles", l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { e[n] = t; }); } else Object(c.each)(e, function (t, n) { s[n] && Object(c.isObject)(t) && !Object(c.isArray)(t) && (e[n] = Object(f.a)(Object(f.a)({}, s[n]), e[n])); }); if ( (i.emit("beforeupdateitem", { item: t, cfg: e }), "edge" === o) ) { if (e.source) { var d = e.source; Object(c.isString)(d) && (d = i.findById(d)), t.setSource(d); } if (e.target) { var p = e.target; Object(c.isString)(p) && (p = i.findById(p)), t.setTarget(p); } t.update(e); } if ("node" === o || "combo" === o) { t.update(e, u); var g = t.getEdges(), v = xt(e); if (v && "node" === o) Object(c.each)(g, function (t) { t.refresh(); }); else if (v && "combo" === o) { var y = t.get("shapeFactory"), m = s.type || "circle"; ( void 0 === s.animate || void 0 === e.animate ? null === (r = null === (n = y[m]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : s.animate || e.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && Object(c.each)(g, function (t) { t && !t.destroyed && t.refresh(); }); } }, 201) : Object(c.each)(g, function (t) { t.refresh(); }); } } i.emit("afterupdateitem", { item: t, cfg: e }); } }), (t.prototype.updateCombo = function (t, e) { var n, r, i = this, o = this.graph; if ( (Object(c.isString)(t) && (t = o.findById(t)), t && !t.destroyed) ) { var a = t.getModel(), s = bt(a.collapsed ? [] : e, o); t.set("bbox", s), t.update({ x: s.x, y: s.y }); var u = t.get("shapeFactory"), h = a.type || "circle"; ( void 0 === a.animate ? null === (r = null === (n = u[h]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : a.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && (t.getShapeCfg(a), i.updateComboEdges(t)); } }, 201) : this.updateComboEdges(t); } }), (t.prototype.updateComboEdges = function (t) { for (var e = t.getEdges() || [], n = 0; n < e.length; n++) { var r = e[n]; if (r && !r.destroyed) { var i = r.get("shapeFactory"), o = r.getShapeCfg(r.getModel()), a = r.getContainer(); a.clear(); var s = i.draw(o.type, o, a); r.set("keyShape", s), s.set("isKeyShape", !0), s.set("draggable", !0), r.setOriginStyle(); } } }), (t.prototype.collapseCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.hideItem(t); }), n.combos.forEach(function (t) { e.hideItem(t); }); }), (t.prototype.expandCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.showItem(t); }), n.combos.forEach(function (t) { t.getModel().collapsed ? t.show() : e.showItem(t); }); }), (t.prototype.removeItem = function (t) { var e = this, n = this.graph; if ( (Object(c.isString)(t) && (t = n.findById(t)), t && !t.destroyed) ) { var r = Object(c.clone)(t.getModel()); n.emit("beforeremoveitem", { item: r }); var i = ""; t.getType && (i = t.getType()); var o = n.get("".concat(i, "s")), a = o.indexOf(t); if ((a > -1 && o.splice(a, 1), "edge" === i)) { var s = n.get("v".concat(i, "s")), u = s.indexOf(t); u > -1 && s.splice(u, 1); } var h = t.get("id"); delete n.get("itemMap")[h]; var l = n.get("comboTrees"), f = t.get("id"); if ("node" === i) { var d = t.getModel().comboId; if (l && d) { var p = l, g = !1; l.forEach(function (t) { g || dt(t, function (t) { if (t.id === f && p) { var e = p.indexOf(t); return p.splice(e, 1), (g = !0), !1; } return (p = t.children), !0; }); }); } for (var v = (x = t.getEdges()).length - 1; v >= 0; v--) n.removeItem(x[v], !1); d && n.updateCombo(d); } else if ("combo" === i) { var y, m = t.getModel().parentId, b = !1; (l || []).forEach(function (t) { b || dt(t, function (t) { return t.id !== f || ((y = t), (b = !0), !1); }); }), (y.removed = !0), y && y.children && y.children.forEach(function (t) { e.removeItem(t.id); }); var x; for (v = (x = t.getEdges()).length; v >= 0; v--) n.removeItem(x[v], !1); m && n.updateCombo(m); } t.destroy(), n.emit("afterremoveitem", { item: r }); } }), (t.prototype.setItemState = function (t, e, n) { var r = this.graph, i = e; Object(c.isString)(n) && (i = "".concat(e, ":").concat(n)), (t.hasState(i) === n && n) || (Object(c.isString)(n) && t.hasState(i)) || (r.emit("beforeitemstatechange", { item: t, state: i, enabled: n, }), t.setState(e, n), r.autoPaint(), r.emit("afteritemstatechange", { item: t, state: i, enabled: n, })); }), (t.prototype.priorityState = function (t, e) { var n = this.graph, r = t; Object(c.isString)(t) && (r = n.findById(t)), this.setItemState(r, e, !1), this.setItemState(r, e, !0); }), (t.prototype.clearItemStates = function (t, e) { var n = this.graph; Object(c.isString)(t) && (t = n.findById(t)), n.emit("beforeitemstatesclear", { item: t, states: e }), t.clearStates(e), n.emit("afteritemstatesclear", { item: t, states: e }); }), (t.prototype.refreshItem = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)), e.emit("beforeitemrefresh", { item: t }), t.refresh(), e.emit("afteritemrefresh", { item: t }); }), (t.prototype.addCombos = function (t, e) { var n = this, r = this.graph; (t || []).forEach(function (t) { pt(t, function (t) { var r; return ( e.forEach(function (e) { e.id === t.id && ((e.children = t.children), (e.depth = t.depth), (r = e)); }), r && n.addItem("combo", r), !0 ); }); }); var i = r.get("comboGroup"); i && i.sort(); }), (t.prototype.changeItemVisibility = function (t, e) { var n = this, r = this.graph; if ((Object(c.isString)(t) && (t = r.findById(t)), t)) { if ( (r.emit("beforeitemvisibilitychange", { item: t, visible: e, }), t.changeVisibility(e), t.getType && "node" === t.getType()) ) { var i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } else if (t.getType && "combo" === t.getType()) { var o = r.get("comboTrees"), a = t.get("id"), s = [], u = !1; (o || []).forEach(function (t) { u || (t.children && 0 !== t.children.length && dt(t, function (t) { return t.id !== a || ((s = t.children), (u = !0), !1); })); }), s && (!e || (e && !t.getModel().collapsed)) && s.forEach(function (t) { var i = r.findById(t.id); n.changeItemVisibility(i, e); }); i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } return ( r.emit("afteritemvisibilitychange", { item: t, visible: e }), t ); } console.warn("The item to be shown or hidden does not exist!"); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !0); }), t ); })(), Kt = null, $t = (function () { function t(t) { (this.graph = t), (this.cachedStates = { enabled: {}, disabled: {} }), (this.destroyed = !1); } return ( (t.checkCache = function (t, e, n) { if (n[e]) { var r = n[e].indexOf(t); r >= 0 && n[e].splice(r, 1); } }), (t.cacheState = function (t, e, n) { n[e] || (n[e] = []), n[e].push(t); }), (t.prototype.updateState = function (e, n, r) { var i = this, o = t.checkCache, a = t.cacheState; if (!e.destroyed) { var s = this.cachedStates, c = s.enabled, u = s.disabled; r ? (o(e, n, u), a(e, n, c)) : (o(e, n, c), a(e, n, u)), Kt && clearTimeout(Kt), (Kt = setTimeout(function () { (Kt = null), i.updateGraphStates(); }, 16)); } }), (t.prototype.updateStates = function (t, e, n) { var r = this; Object(c.isString)(e) ? this.updateState(t, e, n) : e.forEach(function (e) { r.updateState(t, e, n); }); }), (t.prototype.updateGraphStates = function () { var t = this.graph.get("states"), e = this.cachedStates; Object(c.each)(e.disabled, function (e, n) { t[n] && (t[n] = t[n].filter(function (t) { return e.indexOf(t) < 0 && !e.destroyed; })); }), Object(c.each)(e.enabled, function (e, n) { if (t[n]) { var r = {}; t[n].forEach(function (t) { t.destroyed || (r[t.get("id")] = !0); }), e.forEach(function (e) { if (!e.destroyed) { var i = e.get("id"); r[i] || ((r[i] = !0), t[n].push(e)); } }); } else t[n] = e; }), this.graph.emit("graphstatechange", { states: t }), (this.cachedStates = { enabled: {}, disabled: {} }); }), (t.prototype.destroy = function () { (this.graph = null), (this.cachedStates = null), Kt && clearTimeout(Kt), (Kt = null), (this.destroyed = !0); }), t ); })(), Qt = n(28), Jt = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { if ("\\" === t.charAt(0)) return t.slice(1); var r = e[n]; return 0 === r && (r = "0"), r || ""; }) : t; }, te = function (t) { var e = []; if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); for (var n = 0, r = t; n < r.length; n++) { var i = r[n], o = i.x, a = i.y; e.push(o), e.push(a); } var s = Object(Qt.a)(e); return s.unshift(["M", t[0].x, t[0].y]), s; }, ee = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 0); var i = { x: (1 - n) * t.x + n * e.x, y: (1 - n) * t.y + n * e.y }, o = [0, 0]; g.c.normalize(o, [e.x - t.x, e.y - t.y]), (o && (o[0] || o[1])) || (o = [0, 0]); var a = [-o[1] * r, o[0] * r]; return (i.x += a[0]), (i.y += a[1]), i; }, ne = function (t, e) { var n = t.length; if (!n) return ""; for (var r = "", i = 0; i < n; i++) { var o = t[i]; r += Jt(0 === i ? "M{x} {y}" : "L{x} {y}", o); } return e && (r += "Z"), r; }, re = function (t) { var e = []; return ( t.forEach(function (t) { if ("A" !== t[0]) for (var n = 1; n < t.length; n += 2) e.push([t[n], t[n + 1]]); else { var r = t.length; e.push([t[r - 2], t[r - 1]]); } }), e ); }, ie = function (t) { if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); var e = t[0], n = t[1], r = t[t.length - 1], i = t[t.length - 2]; t.unshift(r), t.unshift(i), t.push(e), t.push(n); for (var o = [], a = 1; a < t.length - 2; a += 1) { var s = t[a - 1].x, c = t[a - 1].y, u = t[a].x, h = t[a].y, l = t[a + 1].x, f = t[a + 1].y, d = u + (l - s) / 6, p = h + (f - c) / 6, g = l - ((a !== t.length - 2 ? t[a + 2].x : l) - u) / 6, v = f - ((a !== t.length - 2 ? t[a + 2].y : f) - h) / 6; o.push(["C", d, p, g, v, l, f]); } return o.unshift(["M", r.x, r.y]), o; }, oe = function (t, e) { return g.c.scale([0, 0], g.c.normalize([0, 0], t), e); }, ae = function (t, e) { var n = [t[1] - e[1], e[0] - t[0]], r = Math.sqrt(n[0] * n[0] + n[1] * n[1]); if (0 === r) throw new Error("p0 should not be equal to p1"); return [n[0] / r, n[1] / r]; }, se = function (t, e) { return [e[0] - t[0], e[1] - t[1]]; }; function ce(t, e) { if (!t || t.length < 1) return ""; if (1 === t.length) return (function (t) { var n = [t[0][0], t[0][1] - e], r = [t[0][0], t[0][1] + e]; return "M " .concat(n, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(r, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(n); })(t); if (2 === t.length) return (function (t) { var n = g.c.scale([0, 0], ae(t[0], t[1]), e), r = g.c.scale([0, 0], n, -1), i = g.c.add([0, 0], t[0], n), o = g.c.add([0, 0], t[1], n), a = g.c.add([0, 0], t[1], r), s = g.c.add([0, 0], t[0], r); return "M " .concat(i, " L ") .concat(o, " A ") .concat([e, e, "0,0,0", a].join(","), " L ") .concat(s, " A ") .concat([e, e, "0,0,0", i].join(",")); })(t); for (var n = new Array(t.length), r = 0; r < n.length; ++r) { var i = 0 === r ? t[t.length - 1] : t[r - 1], o = t[r], a = g.c.scale([0, 0], ae(i, o), e); n[r] = [g.c.add([0, 0], i, a), g.c.add([0, 0], o, a)]; } var s = "A ".concat([e, e, "0,0,0,"].join(",")); return (n = n.map(function (t, e) { var r = ""; return ( 0 === e && (r = "M ".concat(n[n.length - 1][1], " ")), (r += "".concat(s + t[0], " L ").concat(t[1])) ); })).join(" "); } function ue(t, e) { var n, r, i, o = t.length; if (!t || o < 1) return ""; if (1 === o) return ( (r = [(n = t)[0][0], n[0][1] - e]), (i = [n[0][0], n[0][1] + e]), "M " .concat(r, " A ") .concat([e, e, "0,0,0", i].join(","), " A ") .concat([e, e, "0,0,0", r].join(",")) ); if (2 === o) return (function (t) { var n = se(t[0], t[1]), r = oe(n, e), i = g.c.add([0, 0], t[0], g.c.scale([0, 0], r, -1)), o = g.c.add([0, 0], t[1], r), a = 1.2 * e, s = oe(g.c.normalize([0, 0], n), a), c = g.c.scale([0, 0], s, -1), u = g.c.add([0, 0], i, c), h = g.c.add([0, 0], o, c), l = g.c.add([0, 0], i, s); return "M " .concat(i, " C ") .concat([u, h, o].join(","), " S ") .concat([l, i].join(","), " Z"); })(t); for ( var a = t.map(function (e, n) { var r = t[(n + 1) % o]; return { p: e, v: g.c.normalize([0, 0], se(e, r)) }; }), s = 0; s < a.length; ++s ) { var c = s > 0 ? s - 1 : o - 1, u = g.c.normalize( [0, 0], g.c.add([0, 0], a[c].v, g.c.scale([0, 0], a[s].v, -1)), ); a[s].p = g.c.add([0, 0], a[s].p, g.c.scale([0, 0], u, e)); } return a.map(function (t) { var e = t.p; return { x: e[0], y: e[1] }; }); } var he = function (t, e, n) { return (t.y - n.y) * (e.x - n.x) - (t.x - n.x) * (e.y - n.y); }, le = function (t) { var e = t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }); if ( (e.sort(function (t, e) { return t.x === e.x ? t.y - e.y : t.x - e.x; }), 1 === e.length) ) return e; for (var n = [], r = 0; r < e.length; r++) { for ( ; n.length >= 2 && he(n[n.length - 2], n[n.length - 1], e[r]) <= 0; ) n.pop(); n.push(e[r]); } var i = []; for (r = e.length - 1; r >= 0; r--) { for ( ; i.length >= 2 && he(i[i.length - 2], i[i.length - 1], e[r]) <= 0; ) i.pop(); i.push(e[r]); } return i.pop(), n.pop(), n.concat(i); }, fe = { maxRoutingIterations: 100, maxMarchingIterations: 100, pixelGroupSize: 2, edgeR0: 10, edgeR1: 10, nodeR0: 5, nodeR1: 10, morphBuffer: 5, threshold: 0.001, skip: 16, nodeInfluenceFactor: 1, edgeInfluenceFactor: 1, negativeNodeInfluenceFactor: -0.5, }; function de(t, e, n) { var r = !1, i = function (t, n) { return e.cells[t + n * e.width]; }, o = function (t, e) { var r = 0; return ( i(t - 1, e - 1) >= n && (r += 1), i(t, e - 1) > n && (r += 2), i(t - 1, e) > n && (r += 4), i(t, e) > n && (r += 8), r ); }, a = function (n, r) { for (var i, a, s = n, c = r, u = 0; u < e.width * e.height; u++) { if ( ((i = s), (a = c), t.findIndex(function (t) { return t.x === s && t.y === c; }) > -1) ) { if (t[0].x === s && t[0].y === c) return !0; } else t.push({ x: s, y: c }); var h = o(s, c); switch (h) { case -1: return console.warn("Marched out of bounds"), !0; case 0: case 3: case 2: case 7: s++; break; case 12: case 14: case 4: s--; break; case 6: 0 === i && (-1 === a ? (s -= 1) : (s += 1)); break; case 1: case 13: case 5: c--; break; case 9: 1 === i && (0 === a ? (c -= 1) : (c += 1)); break; case 10: case 8: case 11: c++; break; default: return ( console.warn("Marching squares invalid state: ".concat(h)), !0 ); } } }; this.march = function () { for (var t = 0; t < e.width && !r; t += 1) for (var s = 0; s < e.height && !r; s += 1) i(t, s) > n && 15 !== o(t, s) && (r = a(t, s)); return r; }; } var pe = function (t, e) { var n = Number.POSITIVE_INFINITY, r = null; return ( t.forEach(function (t) { var i = q(t, e); i >= 0 && i < n && ((r = t), (n = i)); }), r ); }; function ge(t, e, n, r, i) { var o = (function (t, e, n) { var r = null, i = Number.POSITIVE_INFINITY; return ( e.forEach(function (e) { var o = { x: t.getModel().x, y: t.getModel().y }, a = { x: e.getModel().x, y: e.getModel().y }, s = G(o, a), c = new Y(o.x, o.y, a.x, a.y), u = n.reduce(function (t, e) { return q(e, c) > 0 ? t + 1 : t; }, 0); s * Math.pow(u + 1, 2) < i && ((r = e), (i = s * Math.pow(u + 1, 2))); }), r ); })(t, n, e); if (null === o) return []; return (function (t) { for (var n = []; t.length > 0; ) { var r = t.pop(); if (0 === t.length) { n.push(r); break; } var i = t.pop(), o = new Y(r.x1, r.y1, i.x2, i.y2); pe(e, o) ? (n.push(r), t.push(i)) : t.push(o); } return n; })( (function (t, e, n, r) { var i = [], o = []; o.push(t); for ( var a = !0, s = 0, c = function (t, e) { var n = !1; return ( e.forEach(function (e) { n || ((U(t, { x: e.x1, y: e.y1 }) || U(t, { x: e.x2, y: e.y2 })) && (n = !0)); }), n ); }, u = function (t, e) { for (var n = 0, r = e; n < r.length; n++) { var i = r[n].getBBox(), o = [ [i.x, i.y], [i.x + i.width, i.y], [i.x, i.y + i.height], [i.x + i.width, i.y + i.height], ]; if (_(o, t.x, t.y)) return !0; } return !1; }; a && s < n; ) { a = !1; for ( var h = function () { var t = o.pop(), n = pe(e, t); if (n) { var h = W(n, t), l = h[0]; if (2 === h[1]) { var f = function (s) { for ( var h = r, f = me(n, h, l, s), d = c(f, o) || c(f, i), p = u(f, e); !d && p && h >= 1; ) (f = me(n, (h /= 1.5), l, s)), (d = c(f, o) || c(f, i)), (p = u(f, e)); !f || d || (s && p) || (o.push(new Y(t.x1, t.y1, f.x, f.y)), o.push(new Y(f.x, f.y, t.x2, t.y2)), (a = !0)); }; f(!0), a || f(!1); } } a || i.push(t), (s += 1); }; !a && o.length; ) h(); } for (; o.length; ) i.push(o.pop()); return i; })( new Y( t.getModel().x, t.getModel().y, o.getModel().x, o.getModel().y, ), e, r, i, ), ); } var ve = function (t, e, n) { var r = Object.assign(fe, n), i = V( t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }), ); t = t.sort(function (t, e) { return ( G({ x: t.getModel().x, y: t.getModel().y }, i) - G({ x: e.getModel().x, y: e.getModel().y }, i) ); }); var o = [], a = []; t.forEach(function (t) { ge(t, e, o, r.maxRoutingIterations, r.morphBuffer).forEach( function (t) { a.push(t); }, ), o.push(t); }); for ( var s, c, u, h, l, f = (function (t, e, n) { var r = { minX: Number.POSITIVE_INFINITY, minY: Number.POSITIVE_INFINITY, maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, width: 0, height: 0, x: 0, y: 0, }, i = []; t.forEach(function (t) { i.push(t.getBBox()); }), e.forEach(function (t) { i.push(t.getBBox()); }); for (var o = 0, a = i; o < a.length; o++) { var s = a[o]; (r.minX = (s.minX < r.minX ? s.minX : r.minX) - n), (r.minY = (s.minY < r.minY ? s.minY : r.minY) - n), (r.maxX = (s.maxX > r.maxX ? s.maxX : r.maxX) + n), (r.maxY = (s.maxY > r.maxY ? s.maxY : r.maxY) + n); } return ( (r.width = r.maxX - r.minX), (r.height = r.maxY - r.minY), (r.x = r.minX), (r.y = r.minY), r ); })(t, a, r.nodeR0), d = ((s = f.width), (c = f.height), (u = r.pixelGroupSize), (h = Math.ceil(s / u)), (l = Math.ceil(c / u)), { cells: new Float32Array(Math.max(0, h * l)).fill(0), width: h, height: l, }), p = [], g = [], v = 0; v < r.maxMarchingIterations; v++ ) if ( (ye(t, e, a, f, d, r), (g = []), new de((p = []), d, r.threshold).march()) ) { var y = p.map(function (t) { return { x: Math.round(t.x * r.pixelGroupSize + f.minX), y: Math.round(t.y * r.pixelGroupSize + f.minY), }; }); if (y) { var m = y.length; if (r.skip > 1) for (m = Math.floor(y.length / r.skip); m < 3 && r.skip > 1; ) (r.skip -= 1), (m = Math.floor(y.length / r.skip)); for (var b = 0, x = 0; x < m; x += 1, b += r.skip) g.push({ x: y[b].x, y: y[b].y }); } if ( g && (function () { for (var e = 0, n = t; e < n.length; e++) { var r = n[e], i = g.map(function (t) { return [t.x, t.y]; }); if (!_(i, r.getBBox().centerX, r.getBBox().centerY)) return !1; } return !0; })() ) return g; if (((r.threshold *= 0.9), v <= 0.5 * r.maxMarchingIterations)) (r.memberInfluenceFactor *= 1.2), (r.edgeInfluenceFactor *= 1.2); else { if (!(0 !== r.nonMemberInfluenceFactor && e.length > 0)) break; r.nonMemberInfluenceFactor *= 0.8; } } return g; }; function ye(t, e, n, r, i, o) { function a(t, e) { var n = Math.floor((t - e) / o.pixelGroupSize); return n < 0 ? 0 : n; } function s(t, e) { return t * o.pixelGroupSize + e; } var c = (o.nodeR0 - o.nodeR1) * (o.nodeR0 - o.nodeR1), u = (o.edgeR0 - o.edgeR1) * (o.edgeR0 - o.edgeR1), h = function (t, e) { return [ Math.min(a(t.minX, e + r.minX), i.width), Math.min(a(t.minY, e + r.minY), i.height), Math.min(a(t.maxX, -e + r.minX), i.width), Math.min(a(t.maxY, -e + r.minY), i.height), ]; }, l = function (t, e) { for ( var n = t.getBBox(), a = h(n, o.nodeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = Z( { x: g, y: v }, { x: n.minX, y: n.minY, width: n.width, height: n.height, }, ); if (y < Math.pow(o.nodeR1, 2)) { var m = Math.sqrt(y) - o.nodeR1; i.cells[p + d * i.width] += e * m * m; } } }; o.nodeInfluenceFactor && t.forEach(function (t) { l(t, o.nodeInfluenceFactor / c); }), o.edgeInfluenceFactor && n.forEach(function (t) { !(function (t, e) { for ( var n = t.getBBox(), a = h(n, o.edgeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i.cells[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = H({ x: g, y: v }, t); if (y < Math.pow(o.edgeR1, 2)) { var m = Math.sqrt(y) - o.edgeR1; i.cells[p + d * i.width] += e * m * m; } } })(t, o.edgeInfluenceFactor / u); }), o.negativeNodeInfluenceFactor && e.forEach(function (t) { l(t, o.negativeNodeInfluenceFactor / c); }); } function me(t, e, n, r) { var i = t.getBBox(), o = n[0], a = n[1], s = n[2], c = n[3], u = { topLeft: { x: i.minX - e, y: i.minY - e }, topRight: { x: i.maxX + e, y: i.minY - e }, bottomLeft: { x: i.minX - e, y: i.maxY + e }, bottomRight: { x: i.maxX + e, y: i.maxY + e }, }, h = i.height * i.width; function l(t, e) { return i.width * (0.5 * (t.y - i.minY + (e.y - i.minY))); } if (a) return o ? r ? u.topLeft : u.bottomRight : s ? r ? u.bottomLeft : u.topRight : l(a, c) < 0.5 * h ? a.y > c.y ? r ? u.topLeft : u.bottomRight : r ? u.topRight : u.bottomLeft : a.y < c.y ? r ? u.bottomLeft : u.topRight : r ? u.bottomRight : u.topLeft; if (c) { if (o) return r ? u.topRight : u.bottomLeft; if (s) return r ? u.bottomRight : u.topLeft; } return l(o, s) < 0.5 * h ? o.x > s.x ? r ? u.topLeft : u.bottomRight : r ? u.bottomLeft : u.topRight : o.x < s.x ? r ? u.topRight : u.bottomLeft : r ? u.bottomRight : u.topLeft; } var be = (function () { function t(t, e) { (this.cfg = Object(c.deepMix)(this.getDefaultCfg(), e)), (this.graph = t), (this.id = this.cfg.id), (this.group = this.cfg.group), (this.members = this.cfg.members.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), (this.nonMembers = this.cfg.nonMembers.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); } return ( (t.prototype.getDefaultCfg = function () { return { id: "g6-hull", type: "round-convex", members: [], nonMembers: [], style: { fill: "lightblue", stroke: "blue", opacity: 0.2 }, padding: 10, }; }), (t.prototype.setPadding = function () { var t = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2; (this.padding = this.cfg.padding > 0 ? this.cfg.padding + t : 10 + t), (this.cfg.bubbleCfg = { nodeR0: this.padding - t, nodeR1: this.padding - t, morphBuffer: this.padding - t, }); }), (t.prototype.setType = function () { (this.type = this.cfg.type), this.members.length < 3 && (this.type = "round-convex"), "round-convex" !== this.type && "smooth-convex" !== this.type && "bubble" !== this.type && (console.warn( "The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.", ), (this.type = "round-convex")); }), (t.prototype.calcPath = function (t, e) { var n, r, i; switch (this.type) { case "round-convex": (i = ce( (n = le(t)).map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i)); break; case "smooth-convex": 2 === (n = le(t)).length ? ((i = ce( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i))) : n.length > 2 && ((i = ue( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = ie(i))); break; case "bubble": r = (n = ve(t, e, this.cfg.bubbleCfg)).length >= 2 && ie(n); } return r; }), (t.prototype.render = function () { this.group.addShape("path", { attrs: Object(f.a)({ path: this.path }, this.cfg.style), id: this.id, name: this.cfg.id, }), this.group.toBack(); }), (t.prototype.addMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.members.push(t); var e = this.nonMembers.indexOf(t); return ( e > -1 && this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.addNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.nonMembers.push(t); var e = this.members.indexOf(t); return ( e > -1 && this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.removeMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.members.indexOf(t); return ( e > -1 && (this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.removeNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.nonMembers.indexOf(t); return ( e > -1 && (this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.updateData = function (t, e) { var n = this; this.group.findById(this.id).remove(), t && (this.members = t.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), e && (this.nonMembers = e.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.updateStyle = function (t) { this.group.findById(this.id).attr(Object(f.a)({}, t)); }), (t.prototype.updateCfg = function (t) { var e = this; (this.cfg = Object(c.deepMix)(this.cfg, t)), (this.id = this.cfg.id), (this.group = this.cfg.group), t.members && (this.members = this.cfg.members.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), t.nonMembers && (this.nonMembers = this.cfg.nonMembers.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.contain = function (t) { var e, n, r = this, i = (e = Object(c.isString)(t) ? this.graph.findById(t) : t).getKeyShape(); if ("path" === e.get("type")) n = re(i.attr("path")); else { var o = i.getCanvasBBox(); n = [ [o.minX, o.minY], [o.maxX, o.minY], [o.maxX, o.maxY], [o.minX, o.maxY], ]; } return ( (n = n.map(function (t) { var e = r.graph.getPointByCanvas(t[0], t[1]); return [e.x, e.y]; })), F(n, re(this.path)) ); }), (t.prototype.destroy = function () { this.group.remove(), (this.cfg = null); }), t ); })(), xe = g.a.transform, Se = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.cfg = Object(c.deepMix)(n.getDefaultCfg(), e)), n.init(), (n.animating = !1), (n.destroyed = !1), n.cfg.enabledStack && ((n.undoStack = new v.Stack(n.cfg.maxStep)), (n.redoStack = new v.Stack(n.cfg.maxStep))), n ); } return ( Object(f.c)(e, t), (e.prototype.init = function () { this.initCanvas(); var t = new Nt(this), e = new Ot(this), n = new Zt(this), r = new $t(this); this.set({ viewController: t, modeController: e, itemController: n, stateController: r, }), this.initLayoutController(), this.initEventController(), this.initGroups(), this.initPlugins(), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), )); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = this.get("canvas").get("el").id, n = t.addGroup({ id: "".concat(e, "-root"), className: nt.rootContainerClassName, }); if (this.get("groupByTypes")) { var r = n.addGroup({ id: "".concat(e, "-edge"), className: nt.edgeContainerClassName, }), i = n.addGroup({ id: "".concat(e, "-node"), className: nt.nodeContainerClassName, }), o = n.addGroup({ id: "".concat(e, "-combo"), className: nt.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = n.addGroup({ id: "".concat(e, "-delegate"), className: nt.delegateContainerClassName, }); this.set({ delegateGroup: a }), this.set("group", n); }), (e.prototype.getDefaultCfg = function () { return { container: void 0, width: void 0, height: void 0, renderer: "canvas", modes: {}, plugins: [], data: {}, fitViewPadding: 10, minZoom: 0.2, maxZoom: 10, event: !0, groupByTypes: !0, directed: !1, autoPaint: !0, nodes: [], edges: [], combos: [], vedges: [], itemMap: {}, linkCenter: !1, defaultNode: {}, defaultEdge: {}, nodeStateStyles: {}, edgeStateStyles: {}, states: {}, animate: !1, animateCfg: { onFrame: void 0, duration: 500, easing: "easeLinear", }, callback: void 0, enabledStack: !1, maxStep: 10, tooltips: [], }; }), (e.prototype.set = function (t, e) { return ( Object(c.isPlainObject)(t) ? (this.cfg = Object(f.a)(Object(f.a)({}, this.cfg), t)) : (this.cfg[t] = e), this ); }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.getGroup = function () { return this.get("group"); }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.getMinZoom = function () { return this.get("minZoom"); }), (e.prototype.setMinZoom = function (t) { return this.set("minZoom", t); }), (e.prototype.getMaxZoom = function () { return this.get("maxZoom"); }), (e.prototype.setMaxZoom = function (t) { return this.set("maxZoom", t); }), (e.prototype.getWidth = function () { return this.get("width"); }), (e.prototype.getHeight = function () { return this.get("height"); }), (e.prototype.clearItemStates = function (t, e) { Object(c.isString)(t) && (t = this.findById(t)); var n = this.get("itemController"); e || (e = t.get("states")), n.clearItemStates(t, e), this.get("stateController").updateStates(t, e, !1); }), (e.prototype.node = function (t) { "function" == typeof t && this.set("nodeMapper", t); }), (e.prototype.edge = function (t) { "function" == typeof t && this.set("edgeMapper", t); }), (e.prototype.combo = function (t) { "function" == typeof t && this.set("comboMapper", t); }), (e.prototype.findById = function (t) { return this.get("itemMap")[t]; }), (e.prototype.find = function (t, e) { var n, r = this.get("".concat(t, "s")); return ( Object(c.each)(r, function (t, r) { if (e(t, r)) return (n = t); }), n ); }), (e.prototype.findAll = function (t, e) { var n = []; return ( Object(c.each)(this.get("".concat(t, "s")), function (t, r) { e(t, r) && n.push(t); }), n ); }), (e.prototype.findAllByState = function (t, e) { return this.findAll(t, function (t) { return t.hasState(e); }); }), (e.prototype.translate = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe(r, [["t", t, e]])), n.setMatrix(r), this.emit("viewportchange", { action: "translate", matrix: n.getMatrix(), }), this.autoPaint(); }), (e.prototype.moveTo = function (t, e) { var n = this.get("group"); T(n, { x: t, y: e }), this.emit("viewportchange", { action: "move", matrix: n.getMatrix(), }); }), (e.prototype.fitView = function (t) { t && this.set("fitViewPadding", t), this.get("viewController").fitView(), this.autoPaint(); }), (e.prototype.fitCenter = function () { this.get("viewController").fitCenter(), this.autoPaint(); }), (e.prototype.addBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !0), this ); }), (e.prototype.removeBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !1), this ); }), (e.prototype.updateBehavior = function (t, e, n) { return this.get("modeController").updateBehavior(t, e, n), this; }), (e.prototype.zoom = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()), i = this.get("minZoom"), o = this.get("maxZoom"); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe( r, e ? [ ["t", -e.x, -e.y], ["s", t, t], ["t", e.x, e.y], ] : [["s", t, t]], )), (i && r[0] < i) || (o && r[0] > o) || (n.setMatrix(r), this.emit("viewportchange", { action: "zoom", matrix: r }), this.autoPaint()); }), (e.prototype.zoomTo = function (t, e) { var n = t / this.getZoom(); this.zoom(n, e); }), (e.prototype.focusItem = function (t, e, n) { var r = this.get("viewController"), i = !1; e ? (i = !0) : void 0 === e && (i = this.get("animate")); var o = {}; n ? (o = n) : void 0 === n && (o = this.get("animateCfg")), r.focus(t, i, o), this.autoPaint(); }), (e.prototype.autoPaint = function () { this.get("autoPaint") && this.paint(); }), (e.prototype.paint = function () { this.emit("beforepaint"), this.get("canvas").draw(), this.emit("afterpaint"); }), (e.prototype.getPointByClient = function (t, e) { return this.get("viewController").getPointByClient(t, e); }), (e.prototype.getClientByPoint = function (t, e) { return this.get("viewController").getClientByPoint(t, e); }), (e.prototype.getPointByCanvas = function (t, e) { return this.get("viewController").getPointByCanvas(t, e); }), (e.prototype.getCanvasByPoint = function (t, e) { return this.get("viewController").getCanvasByPoint(t, e); }), (e.prototype.getGraphCenterPoint = function () { var t = this.get("group").getCanvasBBox(); return { x: (t.minX + t.maxX) / 2, y: (t.minY + t.maxY) / 2 }; }), (e.prototype.getViewPortCenterPoint = function () { return this.getPointByCanvas( this.get("width") / 2, this.get("height") / 2, ); }), (e.prototype.showItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !0); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !1 }]), (o.nodes = [{ id: r, visible: !0 }]); break; case "edge": (i.nodes = [{ id: r, visible: !1 }]), (o.edges = [{ id: r, visible: !0 }]); break; case "combo": (i.nodes = [{ id: r, visible: !1 }]), (o.combos = [{ id: r, visible: !0 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.hideItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !1); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !0 }]), (o.nodes = [{ id: r, visible: !1 }]); break; case "edge": (i.nodes = [{ id: r, visible: !0 }]), (o.edges = [{ id: r, visible: !1 }]); break; case "combo": (i.nodes = [{ id: r, visible: !0 }]), (o.combos = [{ id: r, visible: !1 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.refreshItem = function (t) { this.get("itemController").refreshItem(t); }), (e.prototype.setAutoPaint = function (t) { this.set("autoPaint", t), this.get("canvas").set("autoDraw", t); }), (e.prototype.remove = function (t, e) { void 0 === e && (e = !0), this.removeItem(t, e); }), (e.prototype.removeItem = function (t, e) { void 0 === e && (e = !0); var n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n && Object(c.isString)(t)) ) console.warn("The item to be removed does not exist!"); else if (n) { var r = ""; if ( (n.getType && (r = n.getType()), e && this.get("enabledStack")) ) { var i = Object(f.a)(Object(f.a)({}, n.getModel()), { itemType: r, }), o = {}; switch (r) { case "node": (o.nodes = [i]), (o.edges = []); for (var a = n.getEdges(), s = a.length - 1; s >= 0; s--) o.edges.push( Object(f.a)(Object(f.a)({}, a[s].getModel()), { itemType: "edge", }), ); break; case "edge": o.edges = [i]; break; case "combo": o.combos = [i]; } this.pushStack("delete", { before: o, after: {} }); } if ("node" === r) n.getModel().comboId && this.updateComboTree(n); if ((this.get("itemController").removeItem(n), "combo" === r)) { var u = mt(this.get("comboTrees")); this.set("comboTrees", u); } } }), (e.prototype.addItem = function (t, e, n, r) { void 0 === n && (n = !0), void 0 === r && (r = !0); var i = this.get("comboSorted"); this.set("comboSorted", i && !r); var o = this.get("itemController"); if ( !(function (t, e) { if ("node" === t || "combo" === t) { if (e.id && !Object(c.isString)(e.id)) return ( console.warn( "G6 Warning Tips: missing 'id' property, or the 'id' %c".concat( e.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); } else if (!("edge" !== t || (e.source && e.target))) return ( console.warn( "G6 Warning Tips: missing 'source' or 'target' for the edge.", ), !1 ); return !0; })(t, e) ) return !1; if (!e.id || !this.findById(e.id)) { var a, s = this.get("comboTrees"); if ((s || (s = []), "combo" === t)) { var u = this.get("itemMap"), h = !1; if ( (s.forEach(function (n) { h || pt(n, function (n) { if (e.parentId === n.id) { h = !0; var r = Object(f.a)( { id: e.id, depth: n.depth + 2 }, e, ); n.children ? n.children.push(r) : (n.children = [r]), (e.depth = r.depth), (a = o.addItem(t, e)); } var i = u[n.id]; return ( h && i && i.getType && "combo" === i.getType() && o.updateCombo(i, n.children), !0 ); }); }), !h) ) { var l = Object(f.a)({ id: e.id, depth: 0 }, e); (e.depth = l.depth), s.push(l), (a = o.addItem(t, e)); } this.set("comboTrees", s); } else if ("node" === t && Object(c.isString)(e.comboId) && s) { var d; (d = this.findById(e.comboId)) && d.getType && "combo" !== d.getType() && console.warn( "'".concat( e.comboId, "' is not a id of a combo in the graph, the node will be added without combo.", ), ), (a = o.addItem(t, e)); var p = this.get("itemMap"), g = !1, v = !1; (s || []).forEach(function (t) { v || g || pt(t, function (t) { if (t.id === e.id) return (v = !0), !1; if (e.comboId === t.id && !v) { g = !0; var n = Object(c.clone)(e); (n.itemType = "node"), t.children ? t.children.push(n) : (t.children = [n]), (n.depth = t.depth + 1); } return ( g && p[t.id].getType && "combo" === p[t.id].getType() && o.updateCombo(p[t.id], t.children), !0 ); }); }); } else a = o.addItem(t, e); if ( ("node" === t && e.comboId) || ("combo" === t && e.parentId) ) (d = this.findById(e.comboId || e.parentId)) && d.getType && "combo" === d.getType() && d.addChild(a); var y = this.get("combos"); if ( (y && y.length > 0 && this.sortCombos(), this.autoPaint(), n && this.get("enabledStack")) ) { var m = Object(f.a)(Object(f.a)({}, a.getModel()), { itemType: t, }), b = {}; switch (t) { case "node": b.nodes = [m]; break; case "edge": b.edges = [m]; break; case "combo": b.combos = [m]; } this.pushStack("add", { before: {}, after: b }); } return a; } console.warn( "This item exists already. Be sure the id %c".concat( e.id, "%c is unique.", ), "font-size: 20px; color: red;", "", ); }), (e.prototype.add = function (t, e, n, r) { return ( void 0 === n && (n = !0), void 0 === r && (r = !0), this.addItem(t, e, n, r) ); }), (e.prototype.updateItem = function (t, e, n) { var r = this; void 0 === n && (n = !0); var i, o = this.get("itemController"); i = Object(c.isString)(t) ? this.findById(t) : t; var a = Object(c.clone)(i.getModel()), s = ""; i.getType && (s = i.getType()); var u = Object(f.f)([], i.getStates(), !0); if ( ("combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !1); }), o.updateItem(i, e), "combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !0); }), n && this.get("enabledStack")) ) { var h = { nodes: [], edges: [], combos: [] }, l = { nodes: [], edges: [], combos: [] }, d = Object(f.a)({ id: a.id }, e); switch (s) { case "node": h.nodes.push(a), l.nodes.push(d); break; case "edge": h.edges.push(a), l.edges.push(d); break; case "combo": h.combos.push(a), l.combos.push(d); } "node" === s && h.nodes.push(a), this.pushStack("update", { before: h, after: l }); } }), (e.prototype.update = function (t, e, n) { void 0 === n && (n = !0), this.updateItem(t, e, n); }), (e.prototype.setItemState = function (t, e, n) { Object(c.isString)(t) && (t = this.findById(t)), this.get("itemController").setItemState(t, e, n); var r = this.get("stateController"); Object(c.isString)(n) ? r.updateState(t, "".concat(e, ":").concat(n), !0) : r.updateState(t, e, n); }), (e.prototype.priorityState = function (t, e) { this.get("itemController").priorityState(t, e); }), (e.prototype.data = function (t) { wt(t), this.set("data", t); }), (e.prototype.render = function () { var t = this; this.set("comboSorted", !1); var e = this.get("data"); if ((this.get("enabledStack") && this.clearStack(), !e)) throw new Error("data must be defined first"); var n = e.nodes, r = void 0 === n ? [] : n, i = e.edges, o = void 0 === i ? [] : i, a = e.combos, s = void 0 === a ? [] : a; if ( (this.clear(!0), this.emit("beforerender"), Object(c.each)(r, function (e) { t.add("node", e, !1, !1); }), s && 0 !== s.length) ) { var u = yt(s, r); this.set("comboTrees", u), t.addCombos(s); } Object(c.each)(o, function (e) { t.add("edge", e, !1, !1); }); var h = t.get("animate"); (t.get("fitView") || t.get("fitCenter")) && t.set("animate", !1); var l = t.get("layoutController"); if (l) { if ( (l.layout(function () { t.get("fitView") ? t.fitView() : t.get("fitCenter") && t.fitCenter(); t.autoPaint(), t.emit("afterrender"), (t.get("fitView") || t.get("fitCenter")) && t.set("animate", h); }), this.refreshPositions(), this.destroyed) ) return; } else t.get("fitView") && t.fitView(), t.get("fitCenter") && t.fitCenter(), t.emit("afterrender"), t.set("animate", h); this.get("groupByTypes") || (s && 0 !== s.length ? this.sortCombos() : e.nodes && e.edges && e.nodes.length < e.edges.length ? this.getNodes().forEach(function (t) { t.toFront(); }) : this.getEdges().forEach(function (t) { t.toBack(); })); this.get("enabledStack") && this.pushStack("render"); }), (e.prototype.read = function (t) { this.data(t), this.render(); }), (e.prototype.diffItems = function (t, e, n) { var r, i = this, o = this.get("itemMap"); Object(c.each)(n, function (n) { if ((r = o[n.id])) { if (i.get("animate") && "node" === t) { var a = r.getContainer().getMatrix(); a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.set("originAttrs", { x: a[6], y: a[7] }); } i.updateItem(r, n, !1); } else r = i.addItem(t, n, !1); r && e["".concat(t, "s")].push(r); }); }), (e.prototype.changeData = function (t, e) { void 0 === e && (e = !0); var n = this; if (!wt(t)) return this; e && this.get("enabledStack") && this.pushStack("changedata", { before: n.save(), after: t }), this.set("comboSorted", !1), this.removeHulls(), this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }); var r = this.get("canvas"), i = r.get("localRefresh"); r.set("localRefresh", !1), n.get("data") || (n.data(t), n.render()); var o = this.get("itemMap"), a = { nodes: [], edges: [] }, s = t.combos; if (s) { var u = yt(s, t.nodes); this.set("comboTrees", u); } this.diffItems("node", a, t.nodes), Object(c.each)(o, function (t, e) { (o[e].getModel().depth = 0), (t.getType && "edge" === t.getType()) || (t.getType && "combo" === t.getType() ? (delete o[e], t.destroy()) : a.nodes.indexOf(t) < 0 && (delete o[e], n.remove(t, !1))); }); for (var h = this.getCombos(), l = h.length - 1; l >= 0; l--) h[l].destroyed && h.splice(l, 1); s && (n.addCombos(s), this.get("groupByTypes") || this.sortCombos()), this.diffItems("edge", a, t.edges), Object(c.each)(o, function (t, e) { (!t.getType || ("node" !== t.getType() && "combo" !== t.getType())) && a.edges.indexOf(t) < 0 && (delete o[e], n.remove(t, !1)); }), this.set({ nodes: a.nodes, edges: a.edges }); var f = this.get("layoutController"); return ( f && (f.changeData(), n.get("animate") && !f.getLayoutType() ? n.positionsAnimate() : n.autoPaint()), setTimeout(function () { r.set("localRefresh", i); }, 16), this ); }), (e.prototype.addCombos = function (t) { var e = this.get("comboTrees"); this.get("itemController").addCombos(e, t); }), (e.prototype.createCombo = function (t, e) { var n = this; this.set("comboSorted", !1); var r, i = ""; if (t) { if (Object(c.isString)(t)) (i = t), (r = { id: t }); else { if (!(i = t.id)) return void console.warn( "Create combo failed. Please assign a unique string id for the adding combo.", ); r = t; } var o = e.map(function (t) { var e = n.findById(t), r = e.getModel(), o = ""; e.getType && (o = e.getType()); var a = { id: e.getID(), itemType: o }; return ( "combo" === o ? ((a.parentId = i), (r.parentId = i)) : "node" === o && ((a.comboId = i), (r.comboId = i)), a ); }); (r.children = o), this.addItem("combo", r, !1), this.set("comboSorted", !1); var a = this.get("comboTrees"); (a || []).forEach(function (t) { pt(t, function (t) { return ( t.id !== i || ((t.itemType = "combo"), (t.children = o), !1) ); }); }), a && this.sortCombos(); } }), (e.prototype.uncombo = function (t) { var e = this, n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n || (n.getType && "combo" !== n.getType())) ) console.warn("The item is not a combo!"); else { var r = n.getModel().parentId, i = this.get("comboTrees"); i || (i = []); var o, a = this.get("itemMap"), s = n.get("id"), u = [], h = this.get("combos"), l = this.findById(r); if ( (i.forEach(function (i) { o || pt(i, function (i) { if (i.id === s) { (o = i), n.getEdges().forEach(function (t) { e.removeItem(t, !1); }); var c = h.indexOf(t); h.splice(c, 1), delete a[s], n.destroy(); } return ( !r || !o || i.id !== r || (l.removeCombo(n), -1 !== (c = (u = i.children).indexOf(o)) && u.splice(c, 1), o.children.forEach(function (t) { var n = e.findById(t.id), i = n.getModel(); n.getType && "combo" === n.getType() ? ((t.parentId = r), delete t.comboId, (i.parentId = r), delete i.comboId) : n.getType && "node" === n.getType() && ((t.comboId = r), (i.comboId = r)), l.addChild(n), u.push(t); }), !1) ); }); }), !r && o) ) { var f = i.indexOf(o); i.splice(f, 1), o.children.forEach(function (t) { t.parentId = void 0; var n = e.findById(t.id).getModel(); delete n.parentId, delete n.comboId, "node" !== t.itemType && i.push(t); }); } } }), (e.prototype.updateCombos = function () { var t = this, e = this.get("comboTrees"), n = this.get("itemController"), r = this.get("itemMap"); (e || []).forEach(function (e) { pt(e, function (e) { if (!e) return !0; var i = r[e.id]; if (i && i.getType && "combo" === i.getType()) { var o = Object(f.f)([], i.getStates(), !0); Object(c.each)(o, function (e) { return t.setItemState(i, e, !1); }), n.updateCombo(i, e.children), Object(c.each)(o, function (e) { return t.setItemState(i, e, !0); }); } return !0; }); }), this.sortCombos(); }), (e.prototype.updateCombo = function (t) { var e, n = this, r = t; if ( (Object(c.isString)(t) && (r = this.findById(t)), !r || (r.getType && "combo" !== r.getType())) ) console.warn("The item to be updated is not a combo!"); else { e = r.get("id"); var i = this.get("comboTrees"), o = this.get("itemController"), a = this.get("itemMap"); (i || []).forEach(function (t) { pt(t, function (t) { if (!t) return !0; var r = a[t.id]; if ( e === t.id && r && r.getType && "combo" === r.getType() ) { var i = Object(f.f)([], r.getStates(), !0); Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !1); }), o.updateCombo(r, t.children), Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !0); }), e && (e = t.parentId); } return !0; }); }); } }), (e.prototype.updateComboTree = function (t, e, n) { void 0 === n && (n = !0); var r; this.set("comboSorted", !1); var i, o = (r = Object(c.isString)(t) ? this.findById(t) : t).getModel(), a = o.comboId || o.parentId, s = ""; if ((r.getType && (s = r.getType()), e && "combo" === s)) { var u, h = this.get("comboTrees"), l = !0; if ( ((h || []).forEach(function (t) { u || dt(t, function (t) { if (!u) return t.id === r.getID() && (u = t), !0; }); }), dt(u, function (t) { return t.id !== e || ((l = !1), !1); }), !l) ) return void console.warn( "Failed to update the combo tree! The parentId points to a descendant of the combo!", ); } if (n && this.get("enabledStack")) { var f = {}, d = {}; "combo" === s ? ((f.combos = [{ id: o.id, parentId: o.parentId }]), (d.combos = [{ id: o.id, parentId: e }])) : "node" === s && ((f.nodes = [{ id: o.id, parentId: o.comboId }]), (d.nodes = [{ id: o.id, parentId: e }])), this.pushStack("updateComboTree", { before: f, after: d }); } if (o.parentId || o.comboId) { var p = this.findById(o.parentId || o.comboId); p && p.removeChild(r); } ("combo" === s ? (o.parentId = e) : "node" === s && (o.comboId = e), e) && (i = this.findById(e)) && i.addChild(r); a && (i = this.findById(a)) && i.removeChild(r); var g = mt(this.get("comboTrees"), o.id, e); this.set("comboTrees", g), this.updateCombos(); }), (e.prototype.save = function () { var t = [], e = [], n = []; return ( Object(c.each)(this.get("nodes"), function (e) { t.push(e.getModel()); }), Object(c.each)(this.get("edges"), function (t) { e.push(t.getModel()); }), Object(c.each)(this.get("combos"), function (t) { n.push(t.getModel()); }), { nodes: t, edges: e, combos: n } ); }), (e.prototype.changeSize = function (t, e) { return this.get("viewController").changeSize(t, e), this; }), (e.prototype.refresh = function () { if ((this.emit("beforegraphrefresh"), this.get("animate"))) this.positionsAnimate(); else { var t = this.get("nodes"), e = this.get("edges"), n = this.get("edges"); Object(c.each)(t, function (t) { t.refresh(); }), Object(c.each)(e, function (t) { t.refresh(); }), Object(c.each)(n, function (t) { t.refresh(); }); } this.emit("aftergraphrefresh"), this.autoPaint(); }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.getComboChildren = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) return t.getChildren(); console.warn("The combo does not exist!"); }), (e.prototype.positionsAnimate = function () { var t = this; t.emit("beforeanimate"); var e = t.get("animateCfg"), n = e.onFrame, r = t.getNodes(), i = r.map(function (t) { var e = t.getModel(); return { id: e.id, x: e.x, y: e.y }; }); t.isAnimating() && t.stopAnimate(), t.get("canvas").animate( function (e) { Object(c.each)(i, function (r) { var i = t.findById(r.id); if (i && !i.destroyed) { var o = i.get("originAttrs"), a = i.get("model"); if (!o) { var s = i.getContainer().getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (o = { x: s[6], y: s[7] }), i.set("originAttrs", o); } if (n) { var c = n(i, e, r, o); i.set("model", Object.assign(a, c)); } else (a.x = o.x + (r.x - o.x) * e), (a.y = o.y + (r.y - o.y) * e); } }), t.refreshPositions(); }, { duration: e.duration, easing: e.easing, callback: function () { Object(c.each)(r, function (t) { t.set("originAttrs", null); }), e.callback && e.callback(), t.emit("afteranimate"), (t.animating = !1); }, }, ); }), (e.prototype.refreshPositions = function () { this.emit("beforegraphrefreshposition"); var t, e = this.get("nodes"), n = this.get("edges"), r = this.get("vedges"), i = this.get("combos"), o = {}; Object(c.each)(e, function (e) { t = e.getModel(); var n = e.get("originAttrs"); if (!n || t.x !== n.x || t.y !== n.y) { var r = e.updatePosition({ x: t.x, y: t.y }); (o[t.id] = r), t.comboId && (o[t.comboId] = o[t.comboId] || r); } }), i && 0 !== i.length && this.updateCombos(), Object(c.each)(n, function (t) { var e = t.getSource().getModel(), n = t.getTarget(); if (!Object(c.isPlainObject)(n)) { var r = n.getModel(); (o[e.id] || o[r.id] || t.getModel().isComboEdge) && t.refresh(); } }), Object(c.each)(r, function (t) { t.refresh(); }), this.emit("aftergraphrefreshposition"), this.autoPaint(); }), (e.prototype.stopAnimate = function () { this.get("canvas").stopAnimate(); }), (e.prototype.isAnimating = function () { return this.animating; }), (e.prototype.getZoom = function () { var t = this.get("group").getMatrix(); return t ? t[0] : 1; }), (e.prototype.getCurrentMode = function () { return this.get("modeController").getMode(); }), (e.prototype.setMode = function (t) { return this.get("modeController").setMode(t), this; }), (e.prototype.clear = function (t) { return ( void 0 === t && (t = !1), this.get("canvas").clear(), this.initGroups(), this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [], }), t || this.emit("afterrender"), this ); }), (e.prototype.updateLayout = function (t) { var e = this.get("layoutController"); Object(c.isString)(t) && (t = { type: t }); var n = this.get("layout"), r = {}; Object.assign(r, n, t), this.set("layout", r), e.isLayoutTypeSame(r) && r.gpuEnabled === n.gpuEnabled ? e.updateLayoutCfg(r) : e.changeLayout(r); }), (e.prototype.destroyLayout = function () { this.get("layoutController").destroyLayout(); }), (e.prototype.layout = function () { var t = this.get("layoutController"), e = this.get("layout"); e && t && (e.workerEnabled ? t.layout() : t.layoutMethod ? t.relayout(!0) : t.layout()); }), (e.prototype.collapseCombo = function (t) { var e = this; if ((Object(c.isString)(t) && (t = this.findById(t)), t)) { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").collapseCombo(t), (n.collapsed = !0); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = []; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || r.getModel().id === n.id ) { if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var s = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(s.parentId || s.comboId)) || (!s.parentId && !s.comboId) ) return; s = a.getModel(); } var c = s.id; if (u["".concat(n.id, "-").concat(c)]) return void (u["".concat(n.id, "-").concat(c)] += f.size || 1); var l = e.addItem( "vedge", { source: n.id, target: c, isVEdge: !0 }, !1, ); (u["".concat(n.id, "-").concat(c)] = f.size || 1), h.push(l); } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || a.getModel().id === n.id ) { var f; if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var d = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(d.parentId || d.comboId)) || (!d.parentId && !d.comboId) ) return; d = r.getModel(); } var p = d.id; if (u["".concat(p, "-").concat(n.id)]) return void (u["".concat(p, "-").concat(n.id)] += f.size || 1); l = e.addItem( "vedge", { target: n.id, source: p, isVEdge: !0 }, !1, ); (u["".concat(p, "-").concat(n.id)] = f.size || 1), h.push(l); } } }), h.forEach(function (t) { var n = t.getModel(); e.updateItem( t, { size: u["".concat(n.source, "-").concat(n.target)] }, !1, ); }), this.emit("aftercollapseexpandcombo", { action: "collapse", item: t, }); } else console.warn("The combo to be collapsed does not exist!"); }), (e.prototype.expandCombo = function (t) { var e = this; if ( (Object(c.isString)(t) && (t = this.findById(t)), !t || (t.getType && "combo" !== t.getType())) ) console.warn("The combo to be collapsed does not exist!"); else { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").expandCombo(t), (n.collapsed = !1); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = {}; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(), s = r.get("id"), c = a.get("id"); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || s === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (var l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; l = a.getModel(); } c = l.id; for (var f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; if (f.comboId === n.id || f.parentId === n.id) break; f = r.getModel(); } if (((s = f.id), c)) { var d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); var p = e.addItem( "vedge", { source: s, target: c, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || c === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; f = r.getModel(); } s = f.id; for (l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; if (l.comboId === n.id || l.parentId === n.id) break; l = a.getModel(); } if (((c = l.id), s)) { d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); p = e.addItem( "vedge", { target: c, source: s, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else (i.includes(r) || o.includes(r)) && (i.includes(a) || o.includes(a)) && r.isVisible() && a.isVisible() && t.show(); } }), this.emit("aftercollapseexpandcombo", { action: "expand", item: t, }); } }), (e.prototype.collapseExpandCombo = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) { for (var e = t.getModel(), n = this.findById(e.parentId); n; ) { var r = n.getModel(); if (r.collapsed) return ( console.warn( "Fail to expand the combo since it's ancestor combo is collapsed.", ), void (n = void 0) ); n = this.findById(r.parentId); } e.collapsed ? this.expandCombo(t) : this.collapseCombo(t), this.updateCombo(t); } }), (e.prototype.sortCombos = function () { var t = this; if (!this.get("comboSorted")) { this.set("comboSorted", !0); var e = [], n = {}; (this.get("comboTrees") || []).forEach(function (t) { dt(t, function (t) { return ( e[t.depth] ? e[t.depth].push(t.id) : (e[t.depth] = [t.id]), (n[t.id] = t.depth), !0 ); }); }), (this.getEdges().concat(this.get("vedges")) || []).forEach( function (t) { var r = t.getModel(), i = n[r.source] || 0, o = n[r.target] || 0, a = Math.max(i, o); e[a] ? e[a].push(r.id) : (e[a] = [r.id]); }, ), e.forEach(function (e) { if (e && e.length) for (var n = e.length - 1; n >= 0; n--) { var r = t.findById(e[n]); r && r.toFront(); } }); } }), (e.prototype.getNeighbors = function (t, e) { var n = t; return ( Object(c.isString)(t) && (n = this.findById(t)), n.getNeighbors(e) ); }), (e.prototype.getNodeDegree = function (t, e, n) { void 0 === e && (e = void 0), void 0 === n && (n = !1); var r = t; Object(c.isString)(t) && (r = this.findById(t)); var i = this.get("degrees"); (i && !n) || ((i = Object(v.getDegree)(this.save())), this.set("degrees", i)); var o = i[r.getID()], a = 0; if (!o) return 0; switch (e) { case "in": a = o.inDegree; break; case "out": a = o.outDegree; break; case "all": a = o; break; default: a = o.degree; } return a; }), (e.prototype.getUndoStack = function () { return this.undoStack; }), (e.prototype.getRedoStack = function () { return this.redoStack; }), (e.prototype.getStackData = function () { return this.get("enabledStack") ? { undoStack: this.undoStack.toArray(), redoStack: this.redoStack.toArray(), } : null; }), (e.prototype.clearStack = function () { this.get("enabledStack") && (this.undoStack.clear(), this.redoStack.clear()); }), (e.prototype.pushStack = function (t, e, n) { if ( (void 0 === t && (t = "update"), void 0 === n && (n = "undo"), this.get("enabledStack")) ) { var r = e ? Object(c.clone)(e) : { before: {}, after: Object(c.clone)(this.save()) }; "redo" === n ? this.redoStack.push({ action: t, data: r }) : this.undoStack.push({ action: t, data: r }), this.emit("stackchange", { undoStack: this.undoStack, redoStack: this.redoStack, }); } else console.warn( "请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !", ); }), (e.prototype.getAdjMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), n ); }), (e.prototype.getShortestPathMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"), r = this.get("shortestPathMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), (r && t) || ((r = Object(v.floydWarshall)(this.save(), e)), this.set("shortestPathMatrix", r)), r ); }), (e.prototype.on = function (e, n, r) { return t.prototype.on.call(this, e, n, r); }), (e.prototype.destroy = function () { this.clear(), Object(p.clearAnimationFrame)(this.timeIndex), this.clearStack(), this.get("itemController").destroy(), this.get("modeController").destroy(), this.get("viewController").destroy(), this.get("stateController").destroy(), this.get("canvas").destroy(), (this.cfg = null), (this.destroyed = !0), (this.redoStack = null), (this.undoStack = null); }), (e.prototype.createHull = function (t) { if (t.members && !(t.members.length < 1)) { var e = this.get("hullGroup"), n = this.get("hullMap"); if ( (n || ((n = {}), this.set("hullMap", n)), (e && !e.get("destroyed")) || ((e = this.get("group").addGroup({ id: "hullGroup", })).toBack(), this.set("hullGroup", e)), n[t.id]) ) return console.warn("Existed hull id."), n[t.id]; var r = e.addGroup({ id: "".concat(t.id, "-container") }), i = new be( this, Object(f.a)(Object(f.a)({}, t), { group: r }), ); return (n[i.id] = i), i; } console.warn("Create hull failed! The members is empty."); }), (e.prototype.getHulls = function () { return this.get("hullMap"); }), (e.prototype.getHullById = function (t) { return this.get("hullMap")[t]; }), (e.prototype.removeHull = function (t) { var e; (e = Object(c.isString)(t) ? this.getHullById(t) : t), delete this.get("hullMap")[e.id], e.destroy(); }), (e.prototype.removeHulls = function () { var t = this.getHulls(); t && Object.keys(t).length && (Object.keys(t).forEach(function (e) { t[e].destroy(); }), this.set("hullMap", {})); }), (e.prototype.onTick = function (t) { var e = this.get("layoutController"); e && (e.onTick(t), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), ))); }), e ); })(d.a); function we(t) { return (we = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Oe = g.a.transform, Me = ["startArrow", "endArrow"], ke = { lineWidth: 1, stroke: void 0, fill: void 0, lineAppendWidth: 1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, x: 0, y: 0, r: 10, width: 20, height: 20, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, je = { edge: { lineWidth: 1, stroke: "#000", lineDash: void 0, startArrow: !1, endArrow: !1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, node: ke, combo: ke, }, Ce = { options: {}, itemType: "", type: "", getCustomConfig: function (t) { return {}; }, getOptions: function (t) { return Object(c.deepMix)( { labelCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, descriptionCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, }, this.options, this.getCustomConfig(t) || {}, t, ); }, draw: function (t, e) { var n = this.drawShape(t, e); (n.set("className", this.itemType + "-shape"), t.label) && this.drawLabel(t, e).set("className", this.itemType + "-label"); return n; }, afterDraw: function (t, e, n) {}, drawShape: function (t, e) { return null; }, drawLabel: function (t, e) { var n = this.getOptions(t).labelCfg || {}, r = this.getLabelStyle(t, n, e), i = r.rotate; delete r.rotate; var o = e.addShape("text", { attrs: r, draggable: !0, className: "text-shape", name: "text-shape", }); if (i) { var a = o.getBBox(), s = o.getMatrix(); if ((s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.rotateCenter)) switch (r.rotateCenter) { case "center": s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); break; case "lefttop": s = Oe(s, [ ["t", -r.x, -r.y], ["r", i], ["t", r.x, r.y], ]); break; case "leftcenter": s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); break; default: s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); } else s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); o.setMatrix(s); } if (r.background) { var c = this.drawLabelBg(t, e, o), u = this.itemType + "-label-bg"; c.set("classname", u), o.toFront(); } return o; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.mix)({}, r, t.labelCfg), o = this.getLabelBgStyleByPosition(n, t, i, e); return e.addShape("rect", { name: "text-bg-shape", attrs: o }); }, getLabelStyleByPosition: function (t, e, n) { return { text: t.label }; }, getLabelBgStyleByPosition: function (t, e, n, r) { return {}; }, getLabelStyle: function (t, e, n) { var r = this.getLabelStyleByPosition(t, e, n), i = "".concat(this.itemType, "Label"), o = nt[i] ? nt[i].style : null; return Object(f.a)(Object(f.a)(Object(f.a)({}, o), r), e.style); }, getShapeStyle: function (t) { return t.style; }, update: function (t, e) { this.updateShapeStyle(t, e), this.updateLabel(t, e); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = e.getKeyShape(), i = Object(c.mix)({}, r.attr(), t.style), o = function (t) { var e, o = i[t]; if (Object(c.isPlainObject)(o)) { var a = n.find(function (e) { return e.get("name") === t; }); a && a.attr(o); } else r.attr((((e = {})[t] = o), e)); }; for (var a in i) o(a); }, updateLabel: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).labelCfg, i = this.itemType + "-label", o = n.find(function (t) { return t.get("className") === i; }), a = this.itemType + "-label-bg", s = n.find(function (t) { return t.get("classname") === a; }); if (t.label || "" === t.label) if (o) { var u = {}; e.getModel && (u = e.getModel().labelCfg); var h = Object(c.deepMix)({}, r, u, t.labelCfg), l = this.getLabelStyleByPosition(t, h, n), d = t.labelCfg ? t.labelCfg.style : void 0, p = h.style && h.style.background, g = Object(f.a)(Object(f.a)(Object(f.a)({}, o.attr()), l), d), v = g.rotate; if ((delete g.rotate, v)) { var y = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (y = Oe(y, [ ["t", -g.x, -g.y], ["r", v], ["t", g.x, g.y], ])), o.resetMatrix(), o.attr(Object(f.a)(Object(f.a)({}, g), { matrix: y })); } else o.resetMatrix(), o.attr(g); if (s) if (g.background) { var m = this.getLabelBgStyleByPosition(o, t, h, n), b = Object(f.a)(Object(f.a)({}, m), p); if ((s.resetMatrix(), v)) { var x = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (x = Oe(x, [ ["t", -b.x, -b.y], ["r", v], ["t", b.x, b.y], ])), (b.matrix = x); } s.attr(b); } else n.removeChild(s); else g.background && ((s = this.drawLabelBg(t, n, o)).set("classname", a), o.toFront()); } else { this.drawLabel(t, n).set("className", i); } }, afterUpdate: function (t, e) {}, setState: function (t, e, n) { var r, i, o = n.get("keyShape"); if (o && !o.destroyed) { var a = n.getType(), s = Object(c.isBoolean)(e) ? t : "".concat(t, ":").concat(e), u = this.getStateStyle(s, n), h = n.getStateStyle(s); if (h || u) { var l = Object(c.mix)({}, h || u), f = n.getContainer(), d = { x: 1, y: 1, cx: 1, cy: 1 }; if ( ("combo" === a && ((d.r = 1), (d.width = 1), (d.height = 1)), e) ) { var p = function (t) { var e, n = l[t]; if (Object(c.isPlainObject)(n) && !Me.includes(t)) { var r = f.find(function (e) { return e.get("name") === t; }); r && r.attr(n); } else o.attr((((e = {})[t] = n), e)); }; for (var g in l) p(g); } else { var v = St(n.getCurrentStatesStyle()), y = n.getModel(), m = Object(c.mix)({}, y.style, St(n.getOriginStyle())), b = o.get("name"), x = o.attr(), S = {}; Object.keys(x).forEach(function (t) { if ("img" !== t) { var e = x[t]; e && "object" === we(e) ? (S[t] = Object(c.clone)(e)) : (S[t] = e); } }); var w = {}, O = function (t) { var e = l[t]; if (Object(c.isPlainObject)(e) && !Me.includes(t)) { var n = f.find(function (e) { return e.get("name") === t; }); if (n) { var r = Object(c.clone)(n.attr()); Object(c.each)(e, function (e, i) { if (t === b && S[i] && !d[i]) { delete S[i]; var s = m[t][i] || je[a][i]; o.attr(i, s); } else if (r[i] || 0 === r[i]) { delete r[i]; var c = m[t][i] || je[a][i]; n.attr(i, c); } }), (w[t] = r); } } else if (S[t] && !d[t]) { delete S[t]; var i = m[t] || (m[b] ? m[b][t] : void 0) || je[a][t]; o.attr(t, i); } }; for (var M in l) O(M); for (var g in (b ? (w[b] = S) : Object(c.mix)(w, S), v)) if (!d[g]) { var k = v[g]; (Object(c.isPlainObject)(k) && !Me.includes(g)) || (b ? (Object(c.mix)(m[b], (((i = {})[g] = k), i)), delete m[g]) : Object(c.mix)(m, (((r = {})[g] = k), r)), delete v[g]); } var j = {}; Object(c.deepMix)(j, m, w, v); var C = !1, E = function (t) { var e, n, r = j[t]; if (Object(c.isPlainObject)(r) && !Me.includes(t)) { var i = f.find(function (e) { return e.get("name") === t; }); i && (t === b && ("combo" === a && (delete r.r, delete r.width, delete r.height), (C = !0)), i.attr(r)); } else if (!C) { var s = r || je[a][t]; "combo" === a ? b || o.attr((((e = {})[t] = s), e)) : o.attr((((n = {})[t] = s), n)); } }; for (var P in j) E(P); } } } }, getStateStyle: function (t, e) { var n = e.getModel(), r = e.getType(), i = this.getOptions(n), o = i.stateStyles, a = i.style, s = void 0 === a ? {} : a, u = n.stateStyles ? n.stateStyles[t] : o && o[t]; return "combo" === r ? Object(c.clone)(u) : Object(c.mix)({}, s, u); }, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { return this.getOptions(t).anchorPoints; }, }, Ee = { itemType: "node", shapeType: "single-node", labelPosition: "center", offset: nt.nodeLabel.offset, getSize: function (t) { var e = t.size || this.getOptions({}).size || nt.defaultNode.size; return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition; if ("center" === n) return { x: 0, y: 0, text: t.label }; var r = e.offset; Object(c.isNil)(r) && (r = this.offset); var i, o = this.getSize(t), a = o[0], s = o[1]; switch (n) { case "top": i = { x: 0, y: 0 - s / 2 - r, textBaseline: "bottom" }; break; case "bottom": i = { x: 0, y: s / 2 + r, textBaseline: "top" }; break; case "left": i = { x: 0 - a / 2 - r, y: 0, textAlign: "right" }; break; default: i = { x: a / 2 + r, y: 0, textAlign: "left" }; } return (i.text = t.label), i; }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = Ct(o.padding), u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.offset; return ( Object(c.isNil)(l) && (l = this.offset), (a = { x: i.minX - s[3], y: i.minY - s[0] }), (a = Object(f.a)(Object(f.a)(Object(f.a)({}, a), o), { width: u, height: h, })) ); }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "node-shape", }); }, updateLinkPoints: function (t, e) { var n, r = this.getOptions(t).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), a = e.find(function (t) { return "link-point-top" === t.get("className"); }), s = e.find(function (t) { return "link-point-bottom" === t.get("className"); }); i && (n = i.attr()), o && !n && (n = o.attr()), a && !n && (n = a.attr()), s && !n && (n = s.attr()), n || (n = r); var u = Object(c.mix)({}, n, t.linkPoints), h = u.fill, l = u.stroke, d = u.lineWidth, p = u.size / 2; p || (p = u.r); var g = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0 }, v = g.left, y = g.right, m = g.top, b = g.bottom, x = this.getSize(t), S = x[0], w = x[1], O = { r: p, fill: h, stroke: l, lineWidth: d }; i ? v || void 0 === v ? i.attr(Object(f.a)(Object(f.a)({}, O), { x: -S / 2, y: 0 })) : i.remove() : v && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: -S / 2, y: 0 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), o ? (y || void 0 === y || o.remove(), o.attr(Object(f.a)(Object(f.a)({}, O), { x: S / 2, y: 0 }))) : y && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: S / 2, y: 0 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a ? (m || void 0 === m || a.remove(), a.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: -w / 2 }))) : m && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: -w / 2 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), s ? b || void 0 === b ? s.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: w / 2 })) : s.remove() : b && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: w / 2 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, updateShape: function (t, e, n, r) { e.get("keyShape").attr(Object(f.a)({}, n)), this.updateLabel(t, e), r && this.updateIcon(t, e); }, updateIcon: function (t, e) { var n = this, r = e.getContainer(), i = this.getOptions(t).icon, o = (t.icon ? t.icon : { show: void 0 }).show, a = r.find(function (t) { return t.get("className") === "".concat(n.type, "-icon"); }); if (a) if (o || void 0 === o) { var s = Object(c.mix)({}, a.attr(), i), u = s.width, h = s.height; a.attr( Object(f.a)(Object(f.a)({}, s), { x: -u / 2, y: -h / 2 }), ); } else a.remove(); else if (o) { (u = i.width), (h = i.height); r.addShape("image", { attrs: Object(f.a)(Object(f.a)({}, i), { x: -u / 2, y: -h / 2, }), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), }); var l = r.find(function (t) { return "node-label" === t.get("className"); }); l && l.toFront(); } }, }, Pe = Object(f.a)(Object(f.a)({}, Ce), Ee); Wt.registerNode("single-node", Pe); var Ae = { itemType: "edge", labelPosition: "center", refX: 0, refY: 0, labelAutoRotate: !1, options: { size: nt.defaultEdge.size, style: { x: 0, y: 0, stroke: nt.defaultEdge.style.stroke, lineAppendWidth: nt.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: nt.edgeLabel.style.fill, fontSize: nt.edgeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.edgeStateStyles), }, getPath: function (t) { var e = []; return ( Object(c.each)(t, function (t, n) { 0 === n ? e.push(["M", t.x, t.y]) : e.push(["L", t.x, t.y]); }), e ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n, t.style), i = t.size || nt.defaultEdge.size, o = (t = this.getPathPoints(t)).startPoint, a = t.endPoint, s = this.getControlPoints(t), u = [o]; s && (u = u.concat(s)), u.push(a); var h = this.getPath(u); return Object(c.mix)( {}, nt.defaultEdge.style, { stroke: nt.defaultEdge.color, lineWidth: i, path: h }, r, ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, a = (t = this.getPathPoints(t)).startPoint, s = t.endPoint, u = this.getControlPoints(t), h = [a]; u && (h = h.concat(u)), h.push(s); var l = i.attr(), f = Object(c.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = { radius: f.radius }; u || (g = { source: d, target: p, offset: f.offset, radius: f.radius, }), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var v = this.getPath(h, g), y = Object(c.mix)( r, i.attr(), { lineWidth: o, path: v }, t.style, ); i && i.attr(y); }, getLabelStyleByPosition: function (t, e, n) { var r, i = e.position || this.labelPosition, o = {}, a = n && n.find(function (t) { return "edge-shape" === t.get("className"); }); r = "start" === i ? 0 : "end" === i ? 1 : 0.5; var s, u = e.refX || this.refX, h = e.refY || this.refY; if ( t.startPoint.x === t.endPoint.x && t.startPoint.y === t.endPoint.y ) return ( (o.x = t.startPoint.x + u), (o.y = t.startPoint.y + h), (o.text = t.label), o ); s = Object(c.isNil)(e.autoRotate) ? this.labelAutoRotate : e.autoRotate; var l = lt(a, r, u, h, s); return ( (o.x = l.x), (o.y = l.y), (o.rotate = l.rotate), (o.textAlign = this._getTextAlign(i, l.angle)), (o.text = t.label), o ); }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = o.padding, u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.position || this.labelPosition, d = Object(f.a)(Object(f.a)({}, o), { width: u, height: h, x: i.minX - s[2], y: i.minY - s[0], rotate: 0, }); a = Object(c.isNil)(n.autoRotate) ? this.labelAutoRotate : n.autoRotate; var p, g = r && r.find(function (t) { return "edge-shape" === t.get("className"); }); p = "start" === l ? 0 : "end" === l ? 1 : 0.5; var v = n.refX || this.refX, y = n.refY || this.refY; if ( e.startPoint.x === e.endPoint.x && e.startPoint.y === e.endPoint.y ) return ( (d.x = e.startPoint.x + v - u / 2), (d.y = e.startPoint.y + y - h / 2), d ); var m = lt(g, p, v - u / 2, y + h / 2, a), b = m.angle; return ( b > 0.5 * Math.PI && b < 1.5 * Math.PI && (m = lt(g, p, v + u / 2, y + h / 2, a)), a && ((d.x = m.x), (d.y = m.y)), (d.rotate = m.rotate), d ); }, _getTextAlign: function (t, e) { var n = "center"; return e ? ((e %= 2 * Math.PI), "center" !== t && (n = (e >= 0 && e <= Math.PI / 2) || (e >= 1.5 * Math.PI && e < 2 * Math.PI) ? t : (function (t) { var e = t; return ( "start" === t ? (e = "end") : "end" === t && (e = "start"), e ); })(t)), n) : t; }, getControlPoints: function (t) { return t.controlPoints; }, getPathPoints: function (t) { return t; }, drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }); }, drawLabel: function (t, e) { var n, r = this.options.labelCfg; n = ("undefined" != typeof window && void 0 !== window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif"; var i = Object(c.deepMix)({ fontFamily: n }, r, t.labelCfg), o = this.getLabelStyle(t, i, e), a = o.rotate; delete o.rotate; var s = e.addShape("text", { attrs: o, name: "text-shape" }); if ((a && s.rotateAtStart(a), o.background)) { var u = this.drawLabelBg(t, e, s), h = this.itemType + "-label-bg"; u.set("classname", h), s.toFront(); } return s; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.deepMix)({}, r, t.labelCfg), o = this.getLabelStyle(t, i, e).rotate, a = this.getLabelBgStyleByPosition(n, t, i, e); delete a.rotate; var s = e.addShape("rect", { name: "text-bg-shape", attrs: a }); return o && s.rotateAtStart(o), s; }, }, Ie = Object(f.a)(Object(f.a)({}, Ce), Ae); Wt.registerEdge("single-edge", Ie), Wt.registerEdge( "line", { getControlPoints: function () {} }, "single-edge", ), Wt.registerEdge( "spline", { getPath: function (t) { return te(t); }, }, "single-edge", ), Wt.registerEdge( "arc", { curveOffset: 20, clockwise: 1, getControlPoints: function (t) { var e, n, r = t.startPoint, i = t.endPoint, o = (r.x + i.x) / 2, a = (r.y + i.y) / 2; if (void 0 !== t.controlPoints) { if ( ((n = t.controlPoints[0]), (e = j(r, n, i)), r.x <= i.x && r.y > i.y ? (this.clockwise = e.x > n.x ? 0 : 1) : r.x <= i.x && r.y < i.y ? (this.clockwise = e.x > n.x ? 1 : 0) : r.x > i.x && r.y <= i.y ? (this.clockwise = e.y < n.y ? 0 : 1) : (this.clockwise = e.y < n.y ? 1 : 0), (n.x - r.x) / (n.y - r.y) == (i.x - r.x) / (i.y - r.y)) ) return []; } else { void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), Object(c.isArray)(t.curveOffset) && (t.curveOffset = t.curveOffset[0]), t.curveOffset < 0 ? (this.clockwise = 0) : (this.clockwise = 1); var s = { x: i.x - r.x, y: i.y - r.y }, u = Math.atan2(s.y, s.x); (n = { x: t.curveOffset * Math.cos(-Math.PI / 2 + u) + o, y: t.curveOffset * Math.sin(-Math.PI / 2 + u) + a, }), (e = j(r, n, i)); } var h = C(r, e); return [{ x: h, y: h }]; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), 2 === t.length ? e.push(["L", t[1].x, t[1].y]) : e.push([ "A", t[1].x, t[1].y, 0, 0, this.clockwise, t[2].x, t[2].y, ]), e ); }, }, "single-edge", ), Wt.registerEdge( "quadratic", { curvePosition: 0.5, curveOffset: -20, getControlPoints: function (t) { var e = t.controlPoints; if (!e || !e.length) { var n = t.startPoint, r = t.endPoint; void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isArray)(this.curveOffset) && (t.curveOffset = t.curveOffset[0]), Object(c.isArray)(this.curvePosition) && (t.curvePosition = t.curveOffset[0]), (e = [ee(n, r, t.curvePosition, t.curveOffset)]); } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["Q", t[1].x, t[1].y, t[2].x, t[2].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic", { curvePosition: [0.5, 0.5], curveOffset: [-20, 20], getControlPoints: function (t) { var e = t.controlPoints; if ( (void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]), !e || !e.length || e.length < 2) ) { var n = t.startPoint, r = t.endPoint; e = [ ee(n, r, t.curvePosition[0], t.curveOffset[0]), ee(n, r, t.curvePosition[1], t.curveOffset[1]), ]; } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["C", t[1].x, t[1].y, t[2].x, t[2].y, t[3].x, t[3].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic-vertical", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.y - e.y, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x, y: e.y + r * this.curvePosition[0] + i[0] }, { x: n.x, y: n.y - r * this.curvePosition[1] + i[1] }, ] ); }, }, "cubic", ), Wt.registerEdge( "cubic-horizontal", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.x - e.x, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x + r * this.curvePosition[0] + i[0], y: e.y }, { x: n.x - r * this.curvePosition[1] + i[1], y: n.y }, ] ); }, }, "cubic", ), Wt.registerEdge( "loop", { getPathPoints: function (t) { return ht(t); }, getControlPoints: function (t) { return t.controlPoints; }, afterDraw: function (t) { t.controlPoints = void 0; }, afterUpdate: function (t) { t.controlPoints = void 0; }, }, "cubic", ); var Te = { itemType: "combo", shapeType: "single-combo", labelPosition: "top", refX: nt.comboLabel.refX, refY: nt.comboLabel.refY, options: { style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, getSize: function (t) { var e = Object(c.clone)( t.size || this.options.size || nt.defaultCombo.size, ); return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isArray)(i) && (i = i[0]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = this.getSize(t), h = (Math.max(r.r, u[0] / 2) || u[0] / 2) + i; switch (n) { case "top": s = { x: 0, y: -h - a, textBaseline: "bottom", textAlign: "center", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: -h + o, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: h + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "combo-shape", }); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, Ne = Object(f.a)(Object(f.a)({}, Ce), Te); Wt.registerCombo("single-combo", Ne), Wt.registerCombo( "circle", { options: { size: [nt.defaultCombo.size[0], nt.defaultCombo.size[0]], padding: nt.defaultCombo.padding[0], animate: !0, style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, refX: 0, refY: 0, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "circle", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( delete n.height, delete n.width, e.addShape("circle", { attrs: n, className: "circle-combo", name: "circle-combo", draggable: !0, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isArray)(n) && (n = n[0]); var r, i = { stroke: t.color }, o = Object(c.mix)({}, e, i, t.style); if (t.fixSize) r = Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0]; else { var a = this.getSize(t); r = !Object(c.isNumber)(o.r) || isNaN(o.r) ? a[0] / 2 || nt.defaultCombo.style.r : Math.max(o.r, a[0] / 2) || a[0] / 2; } o.r = r + n; var s = Object(f.a)({ x: 0, y: 0 }, o); return t.style ? (t.style.r = r) : (t.style = { r: r }), s; }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isArray)(r) && (r = r[0]); var i, o = Object(c.clone)(t.style); (i = t.fixSize ? Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0] : Math.max(o.r, n[0] / 2) || n[0] / 2), (o.r = i + r); var a = e.get("sizeCache"); a && (a.r = o.r); var s = { stroke: t.color }, u = e.get("keyShape"), h = Object(c.mix)({}, u.attr(), s, o); t.style ? (t.style.r = i) : (t.style = { r: i }), this.updateShape(t, e, h, !0); }, }, "single-combo", ), Wt.registerCombo( "rect", { options: { size: [40, 5], padding: [25, 20, 15, 20], animate: !0, style: { radius: 0, stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "rect", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "rect-combo", name: "rect-combo", draggable: !0, }); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isNumber)(i) && (i = [i, i, i, i]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = r.width / 2 + i[3], h = r.height / 2 + i[0]; switch (n) { case "top": s = { x: 0 - u + o, y: 0 - h + a, textBaseline: "top", textAlign: "left", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: 0 - u + a, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: u + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isNumber)(n) && (n = [n, n, n, n]); var r, i, o = { stroke: t.color }, a = Object(c.mix)({}, e, o, t.style), s = this.getSize(t), u = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; u ? Object(c.isNumber)(u) ? ((r = u), (i = u)) : ((r = u[0]), (i = u[1])) : ((r = !Object(c.isNumber)(a.width) || isNaN(a.width) ? s[0] || nt.defaultCombo.style.width : Math.max(a.width, s[0]) || s[0]), (i = !Object(c.isNumber)(a.height) || isNaN(a.height) ? s[1] || nt.defaultCombo.style.height : Math.max(a.height, s[1]) || s[1])); var h = -r / 2 - n[3], l = -i / 2 - n[0]; (a.width = r + n[1] + n[3]), (a.height = i + n[0] + n[2]); var d = Object(f.a)({ x: h, y: l }, a); return ( t.style ? ((t.style.width = r), (t.style.height = i)) : (t.style = { width: r, height: i }), d ); }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isNumber)(r) && (r = [r, r, r, r]); var i, o, a = Object(c.clone)(t.style), s = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; s ? Object(c.isNumber)(s) ? ((i = s), (o = s)) : ((i = s[0]), (o = s[1])) : ((i = Math.max(a.width, n[0]) || n[0]), (o = Math.max(a.height, n[1]) || n[1])), (a.width = i + r[1] + r[3]), (a.height = o + r[0] + r[2]); var u = e.get("sizeCache"); u && ((u.width = a.width), (u.height = a.height)), (a.x = -i / 2 - r[3]), (a.y = -o / 2 - r[0]); var h = { stroke: t.color }, l = e.get("keyShape"), f = Object(c.mix)({}, l.attr(), h, a); t.style ? ((t.style.width = i), (t.style.height = o)) : (t.style = { width: i, height: o }), this.updateShape(t, e, f, !1); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, "single-combo", ), Wt.registerNode( "simple-circle", { options: { size: nt.defaultNode.size, style: { x: 0, y: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("circle", { attrs: n, className: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.deepMix)({}, e, n), i = this.getSize(t)[0] / 2; return Object(f.a)({ x: 0, y: 0, r: i }, r); }, update: function (t, e) { var n = this.getSize(t), r = { stroke: t.color, r: n[0] / 2 }, i = e.get("keyShape"), o = Object(c.deepMix)({}, i.attr(), r, t.style); this.updateShape(t, e, o, !0); }, }, "single-node", ), Wt.registerNode( "simple-rect", { options: { size: [100, 30], style: { radius: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n), i = this.getSize(t), o = r.width || i[0], a = r.height || i[1]; return Object(f.a)( { x: -o / 2, y: -a / 2, width: o, height: a }, r, ); }, update: function (t, e) { e.getContainer(); var n = this.getOptions({}).style, r = this.getSize(t), i = e.get("keyShape"); t.size || ((r[0] = i.attr("width") || n.width), (r[1] = i.attr("height") || n.height)); var o = { stroke: t.color, x: -r[0] / 2, y: -r[1] / 2, width: r[0], height: r[1], }, a = Object(c.mix)({}, n, i.attr(), o); (a = Object(c.mix)(a, t.style)), this.updateShape(t, e, a, !1); }, }, "single-node", ), Wt.registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: !1, type: "circle", r: 50, rx: 50, ry: 35, width: 50, height: 35, points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], x: 0, y: 0, }, }, shapeType: "image", labelPosition: "bottom", drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); delete r.fill; var i = e.addShape(n, { attrs: r, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawClip(t, i), i; }, drawClip: function (t, e) { var n = this.getOptions(t).clipCfg; if (n.show) { var r = n.type, i = n.x, o = n.y, a = n.style; if ("circle" === r) { var s = n.r; e.setClip({ type: "circle", attrs: Object(f.a)({ r: s, x: i, y: o }, a), }); } else if ("rect" === r) { var c = n.width, u = n.height, h = i - c / 2, l = o - u / 2; e.setClip({ type: "rect", attrs: Object(f.a)({ x: h, y: l, width: c, height: u }, a), }); } else if ("ellipse" === r) { var d = n.rx, p = n.ry; e.setClip({ type: "ellipse", attrs: Object(f.a)({ x: i, y: o, rx: d, ry: p }, a), }); } else if ("polygon" === r) { var g = n.points; e.setClip({ type: "polygon", attrs: Object(f.a)({ points: g }, a), }); } else if ("path" === r) { var v = n.path; e.setClip({ type: "path", attrs: Object(f.a)({ path: v }, a), }); } } }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = this.getSize(t), r = this.getOptions(t).img, i = n[0], o = n[1]; return ( e && ((i = e.width || n[0]), (o = e.height || n[1])), Object(f.a)( { x: -i / 2, y: -o / 2, width: i, height: o, img: r }, e, ) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = "".concat(this.itemType, "-shape"), i = n.find(function (t) { return t.get("className") === r; }) || e.getKeyShape(), o = this.getShapeStyle(t); i && i.attr(o); }, }, "single-node", ); var Be, Le = { triangle: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, " L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, vee: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 20), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, "\n L ") .concat(r + (2 * e) / 3, ",0 L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, circle: function (t, e) { return ( void 0 === t && (t = 5), void 0 === e && (e = 0), "M " .concat(2 * e, ", 0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * t, ",0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * -t, ",0") ); }, rect: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 10), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(t / 2, " \n L ") .concat(r, ",") .concat(t / 2, " Z"); }, diamond: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 \n L ") .concat(r + e / 2, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",0 \n L ") .concat(r + e / 2, ",") .concat(t / 2, " Z"); }, triangleRect: function (t, e, n, r, i, o) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 15), void 0 === r && (r = 3), void 0 === i && (i = 5), void 0 === o && (o = 0); var a = 2 * o, s = a + e + i; return "M " .concat(a, ",0 L ") .concat(a + e, ",-") .concat(t / 2, " L ") .concat(a + e, ",") .concat(t / 2, " Z\n M ") .concat(s, ", -") .concat(n / 2, "\n L ") .concat(s + r, " -") .concat(n / 2, "\n L ") .concat(s + r, " ") .concat(n / 2, "\n L ") .concat(s, " ") .concat(n / 2, "\n Z"); }, }, De = { collapse: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t + n - 4, e], ]; }, expand: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t - n + 2 * n - 4, e], ["M", t - n + n, e - n + 4], ["L", t, e + n - 4], ]; }, upTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e + i], ["L", t + r, e + i], ["L", t, e - n], ["Z"], ]; }, downTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e - i], ["L", t + r, e - i], ["L", t, e + n], ["Z"], ]; }, }, _e = Wt, Re = [ "#5F95FF", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4", ], Fe = g.a.transform, Ye = Object(f.a)( Object(f.a)( Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({}, o), i), a), r), s, ), { transform: Fe, mat3: g.b }, ), Xe = (function () { function t(t) { (this.graph = t), (this.layoutCfg = t.get("layout") || {}), (this.layoutType = this.getLayoutType()), (this.layoutMethods = []), this.initLayout(); } return ( (t.prototype.initLayout = function () {}), (t.prototype.getLayoutType = function () { return this.getLayoutCfgType(this.layoutCfg); }), (t.prototype.getLayoutCfgType = function (t) { var e = t.type; if (e) return e; var n = t.pipes; return Array.isArray(n) ? n.map(function (t) { return (null == t ? void 0 : t.type) || ""; }) : null; }), (t.prototype.isLayoutTypeSame = function (t) { var e = this.getLayoutCfgType(t); return Array.isArray(this.layoutType) ? this.layoutType.every(function (t, n) { return t === e[n]; }) : (null == t ? void 0 : t.type) === this.layoutType; }), (t.prototype.refreshLayout = function () { var t = this.graph; t && (t.get("animate") ? t.positionsAnimate() : t.refreshPositions()); }), (t.prototype.changeLayout = function (t) { (this.layoutCfg = t), this.destoryLayoutMethods(), this.layout(); }), (t.prototype.changeData = function () { this.destoryLayoutMethods(), this.layout(); }), (t.prototype.destoryLayoutMethods = function () { var t = this.layoutMethods; null == t || t.forEach(function (t) { t.destroy(); }), (this.layoutMethods = []); }), (t.prototype.destroyLayout = function () { var t = this.graph; this.destoryLayoutMethods(), t.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0); }), (t.prototype.setDataFromGraph = function () { for ( var t = [], e = [], n = [], r = [], i = [], o = [], a = this.graph.getNodes(), s = this.graph.getEdges(), c = this.graph.getCombos(), u = a.length, h = 0; h < u; h++ ) { var l = a[h]; if (l && !l.destroyed) { var f = l.getModel(); l.isVisible() ? t.push(f) : e.push(f); } } var d = s.length; for (h = 0; h < d; h++) { var p = s[h]; if (p && !p.destroyed) { f = p.getModel(); p.isVisible() ? f.isComboEdge ? i.push(f) : n.push(f) : r.push(f); } } var g = c.length; for (h = 0; h < g; h++) { var v = c[h]; if (!v.destroyed) { f = v.getModel(); v.isVisible() ? o.push(f) : r.push(f); } } return { nodes: t, hiddenNodes: e, edges: n, hiddenEdges: r, combos: o, hiddenCombos: [], comboEdges: i, }; }), (t.prototype.reLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; (e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), t.init(n.data), "force" === a && ((t.ticking = !1), t.forceSimulation.stop()), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (t.prototype.relayout = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = this.layoutCfg; if (t) { this.data = this.setDataFromGraph(); var o = this.data.nodes; if (!o) return !1; this.initPositions(i.center, o); } n.emit("beforelayout"); var a = Promise.resolve(); null == r || r.forEach(function (t, n) { var r = i[n]; a = a.then(function () { return e.reLayoutMethod(t, r); }); }), a .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("relayout failed", t); }); }), (t.prototype.filterLayoutData = function (t, e) { var n, r, i = t.nodes, o = t.edges, a = Object(f.e)(t, ["nodes", "edges"]); if (!i) return t; if ( ((n = Object(c.isFunction)(null == e ? void 0 : e.nodesFilter) ? e.nodesFilter : function () { return !0; }), Object(c.isFunction)(null == e ? void 0 : e.edgesFilter)) ) r = e.edgesFilter; else { var s = i.reduce(function (t, e) { return (t[e.id] = !0), t; }, {}); r = function (t) { return s[t.source] && s[t.target]; }; } return Object(f.a)({ nodes: i.filter(n), edges: o.filter(r) }, a); }), (t.prototype.getLayoutBBox = function (t) { var e = this.graph, n = Object(c.groupBy)(e.getNodes(), function (t) { return t.getModel().layoutOrder; }), r = Object.values(n).map(function (t) { var e = It(t); return (e.size = [e.width, e.height]), e; }); return { groupNodes: Object.values(Object(c.groupBy)(t, "layoutOrder")), layoutNodes: r, }; }), (t.prototype.layoutAnimate = function () {}), (t.prototype.moveToZero = function () { var t = this.graph.get("data").nodes; if (void 0 !== t[0].x && null !== t[0].x && !At(t[0].x)) { for (var e = [0, 0], n = t.length, r = 0; r < n; r++) { var i = t[r]; (e[0] += i.x), (e[1] += i.y); } (e[0] /= t.length), (e[1] /= t.length); for (r = 0; r < n; r++) { ((i = t[r]).x -= e[0]), (i.y -= e[1]); } } }), (t.prototype.initPositions = function (t, e) { var n = this.graph; if (!e) return !1; var r = e ? e.length : 0; if (r) { var i = 0.85 * n.get("width"), o = 0.85 * n.get("height"), a = Math.ceil(Math.sqrt(r) * (i / o)), s = i / (a - 1), c = o / (Math.ceil(r / a) - 1); (isFinite(s) && s) || (s = 0), (isFinite(c) && s) || (c = 0); for ( var u = t[0] - i / 2, h = t[1] - o / 2, l = !0, f = 0; f < r; f++ ) { var d = e[f]; At(d.x) && ((l = !1), (d.x = (f % a) * s + u)), At(d.y) && ((l = !1), (d.y = Math.floor(f / a) * c + h)); } return l; } }), (t.prototype.destroy = function () { (this.graph = null), this.destoryLayoutMethods(), (this.destroyed = !0); }), (t.prototype.onTick = function (t) { var e; null === (e = this.layoutMethods) || void 0 === e || e.forEach(function (e) { var n; null === (n = null == e ? void 0 : e.onTick) || void 0 === n || n.call(e, t); }); }), t ); })(), ze = function (t) { (this.graph = t), (this.destroyed = !1), this.initEvents(); }; !(function (t) { (t.CLICK = "click"), (t.DBLCLICK = "dblclick"), (t.TAP = "tap"), (t.DBLTAP = "dbltap"), (t.DRAGSTART = "dragstart"), (t.DRAGEND = "dragend"), (t.DRAG = "drag"), (t.DRAGENTER = "dragenter"), (t.DRAGLEAVE = "dragleave"), (t.DRAGOVER = "dragover"), (t.DRAGOUT = "dragout"), (t.DDROP = "drop"), (t.PINCHSTART = "pinchstart"), (t.PINCHMOVE = "pinchmove"), (t.PANSTART = "panstart"), (t.PANMOVE = "panmove"), (t.PANEND = "panend"), (t.PRESS = "press"), (t.ACTION_END = "actionend"), (t.TOUCHSTART = "touchstart"), (t.TOUCHMOVE = "touchmove"), (t.TOUCHEND = "touchend"), (t.CANVAS_TOUCHSTART = "canvas:touchstart"), (t.CANVAS_TOUCHMOVE = "canvas:touchmove"), (t.CANVAS_TOUCHEND = "canvas:touchend"), (t.NODE_TOUCHSTART = "node:touchstart"), (t.NODE_TOUCHMOVE = "node:touchmove"), (t.NODE_TOUCHEND = "node:touchend"), (t.COMBO_TOUCHSTART = "combo:touchstart"), (t.COMBO_TOUCHMOVE = "combo:touchmove"), (t.COMBO_TOUCHEND = "combo:touchend"), (t.EDGE_TOUCHSTART = "edge:touchstart"), (t.EDGE_TOUCHMOVE = "edge:touchmove"), (t.EDGE_TOUCHEND = "edge:touchend"), (t.NODE_CLICK = "node:click"), (t.NODE_DBLCLICK = "node:dblclick"), (t.NODE_DROP = "node:drop"), (t.NODE_DRAGOVER = "node:dragover"), (t.NODE_DRAGENTER = "node:dragenter"), (t.NODE_DRAGLEAVE = "node:dragleave"), (t.NODE_DRAGSTART = "node:dragstart"), (t.NODE_DRAG = "node:drag"), (t.NODE_DRAGEND = "node:dragend"), (t.NODE_TAP = "node:tap"), (t.NODE_DBLTAP = "node:dbltap"), (t.NODE_PANSTART = "node:panstart"), (t.NODE_PANMOVE = "node:panmove"), (t.NODE_PANEND = "node:panend"), (t.NODE_PRESS = "node:press"), (t.COMBO_CLICK = "combo:click"), (t.COMBO_DBLCLICK = "combo:dblclick"), (t.COMBO_DROP = "combo:drop"), (t.COMBO_DRAGOVER = "combo:dragover"), (t.COMBO_DRAGENTER = "combo:dragenter"), (t.COMBO_DRAGLEAVE = "combo:dragleave"), (t.COMBO_DRAGSTART = "combo:dragstart"), (t.COMBO_DRAG = "combo:drag"), (t.COMBO_DRAGEND = "combo:dragend"), (t.COMBO_TAP = "combo:tap"), (t.COMBO_DBLTAP = "combo:dbltap"), (t.COMBO_PANSTART = "combo:panstart"), (t.COMBO_PANMOVE = "combo:panmove"), (t.COMBO_PANEND = "combo:panend"), (t.COMBO_PRESS = "combo:press"), (t.EDGE_CLICK = "edge:click"), (t.EDGE_DBLCLICK = "edge:dblclick"), (t.EDGE_DROP = "edge:drop"), (t.EDGE_DRAGOVER = "edge:dragover"), (t.EDGE_DRAGENTER = "edge:dragenter"), (t.EDGE_DRAGLEAVE = "edge:dragleave"), (t.EDGE_TAP = "edge:tap"), (t.EDGE_DBLTAP = "edge:dbltap"), (t.EDGE_PRESS = "edge:press"), (t.CANVAS_CLICK = "canvas:click"), (t.CANVAS_DBLCLICK = "canvas:dblclick"), (t.CANVAS_DROP = "canvas:drop"), (t.CANVAS_DRAGENTER = "canvas:dragenter"), (t.CANVAS_DRAGLEAVE = "canvas:dragleave"), (t.CANVAS_DRAGSTART = "canvas:dragstart"), (t.CANVAS_DRAG = "canvas:drag"), (t.CANVAS_DRAGEND = "canvas:dragend"), (t.CANVAS_TAP = "canvas:tap"), (t.CANVAS_DBLTAP = "canvas:dbltap"), (t.CANVAS_PANSTART = "canvas:panstart"), (t.CANVAS_PANMOVE = "canvas:panmove"), (t.CANVAS_PANEND = "canvas:panend"), (t.CANVAS_PRESS = "canvas:press"), (t.BEFORERENDER = "beforerender"), (t.AFTERRENDER = "afterrender"), (t.BEFOREADDITEM = "beforeadditem"), (t.AFTERADDITEM = "afteradditem"), (t.BEFOREREMOVEITEM = "beforeremoveitem"), (t.AFTERREMOVEITEM = "afterremoveitem"), (t.BEFOREUPDATEITEM = "beforeupdateitem"), (t.AFTERUPDATEITEM = "afterupdateitem"), (t.BEFOREITEMVISIBILITYCHANGE = "beforeitemvisibilitychange"), (t.AFTERITEMVISIBILITYCHANGE = "afteritemvisibilitychange"), (t.BEFOREITEMSTATECHANGE = "beforeitemstatechange"), (t.AFTERITEMSTATECHANGE = "afteritemstatechange"), (t.BEFOREITEMREFRESH = "beforeitemrefresh"), (t.AFTERITEMREFRESH = "afteritemrefresh"), (t.BEFOREITEMSTATESCLEAR = "beforeitemstatesclear"), (t.AFTERITEMSTATESCLEAR = "afteritemstatesclear"), (t.BEFOREMODECHANGE = "beforemodechange"), (t.AFTERMODECHANGE = "aftermodechange"), (t.BEFORELAYOUT = "beforelayout"), (t.AFTERLAYOUT = "afterlayout"), (t.BEFORECREATEEDGE = "beforecreateedge"), (t.AFTERCREATEEDGE = "aftercreateedge"), (t.BEFOREGRAPHREFRESHPOSITION = "beforegraphrefreshposition"), (t.AFTERGRAPHREFRESHPOSITION = "aftergraphrefreshposition"), (t.BEFOREGRAPHREFRESH = "beforegraphrefresh"), (t.AFTERGRAPHREFRESH = "aftergraphrefresh"), (t.BEFOREANIMATE = "beforeanimate"), (t.AFTERANIMATE = "afteranimate"), (t.BEFOREPAINT = "beforepaint"), (t.AFTERPAINT = "afterpaint"), (t.BEFORECOLLAPSEEXPANDCOMBO = "beforecollapseexpandcombo"), (t.AFTERCOLLAPSEEXPANDCOMBO = "aftercollapseexpandcombo"), (t.GRAPHSTATECHANGE = "graphstatechange"), (t.AFTERACTIVATERELATIONS = "afteractivaterelations"), (t.NODESELECTCHANGE = "nodeselectchange"), (t.TOOLTIPCHANGE = "tooltipchange"), (t.WHEELZOOM = "wheelzoom"), (t.VIEWPORTCHANGE = "viewportchange"), (t.DRAGNODEEND = "dragnodeend"), (t.STACKCHANGE = "stackchange"); })(Be || (Be = {})); var We = _e.registerNode, qe = _e.registerEdge, Ve = _e.registerCombo, Ge = l.registerBehavior, He = nt; _e.registerNode, _e.registerEdge, _e.registerCombo, l.registerBehavior; }, 205: function (t, e, n) { "use strict"; n.r(e), function (r) { var i = n(119), o = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== r ? r : void 0; ("object" == typeof exports && "object" == typeof t) || ("function" == typeof define && n(223)) || "object" == typeof exports || Object.defineProperties(o, { f6: { get: function () { return ( console.warn("废弃的特性: f6, 请使用 F6 代替 f6"), i.default ); }, }, }), (e.default = i.default); }.call(this, n(98)); }, 206: function (t, e) { var n, r, i = (t.exports = {}); function o() { throw new Error("setTimeout has not been defined"); } function a() { throw new Error("clearTimeout has not been defined"); } function s(t) { if (n === setTimeout) return setTimeout(t, 0); if ((n === o || !n) && setTimeout) return (n = setTimeout), setTimeout(t, 0); try { return n(t, 0); } catch (e) { try { return n.call(null, t, 0); } catch (e) { return n.call(this, t, 0); } } } !(function () { try { n = "function" == typeof setTimeout ? setTimeout : o; } catch (t) { n = o; } try { r = "function" == typeof clearTimeout ? clearTimeout : a; } catch (t) { r = a; } })(); var c, u = [], h = !1, l = -1; function f() { h && c && ((h = !1), c.length ? (u = c.concat(u)) : (l = -1), u.length && d()); } function d() { if (!h) { var t = s(f); h = !0; for (var e = u.length; e; ) { for (c = u, u = []; ++l < e; ) c && c[l].run(); (l = -1), (e = u.length); } (c = null), (h = !1), (function (t) { if (r === clearTimeout) return clearTimeout(t); if ((r === a || !r) && clearTimeout) return (r = clearTimeout), clearTimeout(t); try { r(t); } catch (e) { try { return r.call(null, t); } catch (e) { return r.call(this, t); } } })(t); } } function p(t, e) { (this.fun = t), (this.array = e); } function g() {} (i.nextTick = function (t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; u.push(new p(t, e)), 1 !== u.length || h || s(d); }), (p.prototype.run = function () { this.fun.apply(null, this.array); }), (i.title = "browser"), (i.browser = !0), (i.env = {}), (i.argv = []), (i.version = ""), (i.versions = {}), (i.on = g), (i.addListener = g), (i.once = g), (i.off = g), (i.removeListener = g), (i.removeAllListeners = g), (i.emit = g), (i.prependListener = g), (i.prependOnceListener = g), (i.listeners = function (t) { return []; }), (i.binding = function (t) { throw new Error("process.binding is not supported"); }), (i.cwd = function () { return "/"; }), (i.chdir = function (t) { throw new Error("process.chdir is not supported"); }), (i.umask = function () { return 0; }); }, 207: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isAllowCapture = e.isParent = e.isBrowser = e.removeFromArray = void 0), (e.removeFromArray = function (t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); }), (e.isBrowser = "undefined" != typeof window && void 0 !== window.document); var r = n(0); Object.defineProperty(e, "isNil", { enumerable: !0, get: function () { return r.isNil; }, }), Object.defineProperty(e, "isFunction", { enumerable: !0, get: function () { return r.isFunction; }, }), Object.defineProperty(e, "isString", { enumerable: !0, get: function () { return r.isString; }, }), Object.defineProperty(e, "isObject", { enumerable: !0, get: function () { return r.isObject; }, }), Object.defineProperty(e, "isArray", { enumerable: !0, get: function () { return r.isArray; }, }), Object.defineProperty(e, "mix", { enumerable: !0, get: function () { return r.mix; }, }), Object.defineProperty(e, "each", { enumerable: !0, get: function () { return r.each; }, }), Object.defineProperty(e, "upperFirst", { enumerable: !0, get: function () { return r.upperFirst; }, }), (e.isParent = function (t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; }), (e.isAllowCapture = function (t) { return t.cfg.visible && t.cfg.capture; }); }, 208: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.getOffScreenContext = void 0); var r = null; e.getOffScreenContext = function () { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; }; }, 209: function (t, e, n) { "use strict"; var r = n(210), i = n(211), o = Object.hasOwnProperty, a = Object.create(null); for (var s in r) o.call(r, s) && (a[r[s]] = s); var c = (t.exports = { to: {}, get: {} }); function u(t, e, n) { return Math.min(Math.max(e, t), n); } function h(t) { var e = Math.round(t).toString(16).toUpperCase(); return e.length < 2 ? "0" + e : e; } (c.get = function (t) { var e, n; switch (t.substring(0, 3).toLowerCase()) { case "hsl": (e = c.get.hsl(t)), (n = "hsl"); break; case "hwb": (e = c.get.hwb(t)), (n = "hwb"); break; default: (e = c.get.rgb(t)), (n = "rgb"); } return e ? { model: n, value: e } : null; }), (c.get.rgb = function (t) { if (!t) return null; var e, n, i, a, s = [0, 0, 0, 1]; if ((n = t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i))) { for (a = n[2], n = n[1], i = 0; i < 3; i++) (e = 2 * i), (s[i] = parseInt(n.slice(e, e + 2), 16)); a && (s[3] = parseInt(a, 16) / 255); } else if ((n = t.match(/^#([a-f0-9]{3,4})$/i))) { for (a = (n = n[1])[3], i = 0; i < 3; i++) s[i] = parseInt(n[i] + n[i], 16); a && (s[3] = parseInt(a + a, 16) / 255); } else if ( (n = t.match( /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) { for (i = 0; i < 3; i++) s[i] = parseInt(n[i + 1], 0); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } else { if ( !(n = t.match( /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) return (n = t.match(/^(\w+)$/)) ? "transparent" === n[1] ? [0, 0, 0, 0] : o.call(r, n[1]) ? (((s = r[n[1]])[3] = 1), s) : null : null; for (i = 0; i < 3; i++) s[i] = Math.round(2.55 * parseFloat(n[i + 1])); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } for (i = 0; i < 3; i++) s[i] = u(s[i], 0, 255); return (s[3] = u(s[3], 0, 1)), s; }), (c.get.hsl = function (t) { if (!t) return null; var e, n = t.match( /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.get.hwb = function (t) { if (!t) return null; var e, n = t.match( /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.to.hex = function () { var t = i(arguments); return ( "#" + h(t[0]) + h(t[1]) + h(t[2]) + (t[3] < 1 ? h(Math.round(255 * t[3])) : "") ); }), (c.to.rgb = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "rgb(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ")" : "rgba(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ", " + t[3] + ")"; }), (c.to.rgb.percent = function () { var t = i(arguments), e = Math.round((t[0] / 255) * 100), n = Math.round((t[1] / 255) * 100), r = Math.round((t[2] / 255) * 100); return t.length < 4 || 1 === t[3] ? "rgb(" + e + "%, " + n + "%, " + r + "%)" : "rgba(" + e + "%, " + n + "%, " + r + "%, " + t[3] + ")"; }), (c.to.hsl = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" : "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + t[3] + ")"; }), (c.to.hwb = function () { var t = i(arguments), e = ""; return ( t.length >= 4 && 1 !== t[3] && (e = ", " + t[3]), "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + e + ")" ); }), (c.to.keyword = function (t) { return a[t.slice(0, 3)]; }); }, 210: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 211: function (t, e, n) { "use strict"; var r = n(212), i = Array.prototype.concat, o = Array.prototype.slice, a = (t.exports = function (t) { var e, n, a, s = []; for (e = 0, n = t.length; e < n; e++) (a = t[e]), r(a) ? (s = i.call(s, o.call(a))) : s.push(a); return s; }); a.wrap = function (t) { return function () { return t(a(arguments)); }; }; }, 212: function (t, e, n) { "use strict"; t.exports = function (t) { return ( !(!t || "string" == typeof t) && (t instanceof Array || Array.isArray(t) || (t.length >= 0 && (t.splice instanceof Function || (Object.getOwnPropertyDescriptor(t, t.length - 1) && "String" !== t.constructor.name)))) ); }; }, 213: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(126), a = n(215), s = {}; Object.keys(o).forEach(function (t) { (s[t] = {}), Object.defineProperty(s[t], "channels", { value: o[t].channels }), Object.defineProperty(s[t], "labels", { value: o[t].labels }); var e = a(t); Object.keys(e).forEach(function (n) { var r = e[n]; (s[t][n] = (function (t) { var e = function (e) { if (null == e) return e; arguments.length > 1 && (e = Array.prototype.slice.call(arguments)); var n, r, o = t(e); if ("object" === i(o)) for (n = o.length, r = 0; r < n; r++) o[r] = Math.round(o[r]); return o; }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)), (s[t][n].raw = (function (t) { var e = function (e) { return null == e ? e : (arguments.length > 1 && (e = Array.prototype.slice.call(arguments)), t(e)); }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)); }); }), (t.exports = s); }, 214: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 215: function (t, e, n) { "use strict"; var r = n(126); function i(t) { var e, n, i, o, a, s, c = (function () { var t, e, n = {}, i = Object.keys(r); for (t = i.length, e = 0; e < t; e++) n[i[e]] = { distance: -1, parent: null }; return n; })(), u = [t]; for (c[t].distance = 0; u.length; ) for ( e = u.pop(), i = (n = Object.keys(r[e])).length, o = 0; o < i; o++ ) -1 === (s = c[(a = n[o])]).distance && ((s.distance = c[e].distance + 1), (s.parent = e), u.unshift(a)); return c; } function o(t, e) { return function (n) { return e(t(n)); }; } function a(t, e) { for ( var n = [e[t].parent, t], i = r[e[t].parent][t], a = e[t].parent; e[a].parent; ) n.unshift(e[a].parent), (i = o(r[e[a].parent][a], i)), (a = e[a].parent); return (i.conversion = n), i; } t.exports = function (t) { var e, n, r, o = i(t), s = {}, c = Object.keys(o); for (e = c.length, n = 0; n < e; n++) null !== o[(r = c[n])].parent && (s[r] = a(r, o)); return s; }; }, 216: function (t, e, n) { "use strict"; var r = Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }, i = function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), i(n(217), e), i(n(218), e), i(n(219), e), i(n(220), e), i(n(221), e), i(n(222), e); }, 217: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r = /-(\w)/g; e.camelize = (function (t) { var e = Object.create(null); return function (n) { return e[n] || (e[n] = t(n)); }; })(function (t) { return t.replace(r, function (t, e) { return e ? e.toUpperCase() : ""; }); }); }, 218: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 219: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 22: function (t, e, n) { "use strict"; var r = n(95), i = Object(r.getColorsWithSubjectColor)( "rgb(95, 149, 255)", "rgb(255, 255, 255)", ); e.a = { version: "0.0.16", rootContainerClassName: "root-container", uiContainerClassName: "ui-container", waterContainerClassName: "water-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: i.mainStroke, fill: i.mainFill }, size: 20, color: i.mainStroke, linkPoints: { size: 8, lineWidth: 1, fill: i.activeFill, stroke: i.activeStroke, }, }, nodeStateStyles: { active: { fill: i.activeFill, stroke: i.activeStroke, lineWidth: 2, shadowColor: i.mainStroke, shadowBlur: 10, }, selected: { fill: i.selectedFill, stroke: i.selectedStroke, lineWidth: 4, shadowColor: i.selectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: i.highlightFill, stroke: i.highlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: i.inactiveFill, stroke: i.inactiveStroke, lineWidth: 1, }, disable: { fill: i.disableFill, stroke: i.disableStroke, lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: i.edgeMainStroke, lineAppendWidth: 2 }, color: i.edgeMainStroke, }, edgeStateStyles: { active: { stroke: i.edgeActiveStroke, lineWidth: 1 }, selected: { stroke: i.edgeSelectedStroke, lineWidth: 2, shadowColor: i.edgeSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.edgeHighlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.edgeInactiveStroke, lineWidth: 1 }, disable: { stroke: i.edgeDisableStroke, lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12 }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: i.comboMainFill, lineWidth: 1, stroke: i.comboMainStroke, r: 5, width: 20, height: 10, }, size: [20, 5], color: i.comboMainStroke, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: i.comboActiveStroke, lineWidth: 1, fill: i.comboActiveFill, }, selected: { stroke: i.comboSelectedStroke, lineWidth: 2, fill: i.comboSelectedFill, shadowColor: i.comboSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.comboHighlightStroke, lineWidth: 2, fill: i.comboHighlightFill, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.comboInactiveStroke, fill: i.comboInactiveFill, lineWidth: 1, }, disable: { stroke: i.comboDisableStroke, fill: i.comboDisableFill, lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, textWaterMarkerConfig: { width: 150, height: 100, compatible: !1, text: { x: 0, y: 60, lineHeight: 20, rotate: 20, fontSize: 14, fontFamily: "Microsoft YaHei", fill: "rgba(0, 0, 0, 0.1)", baseline: "Middle", }, }, imageWaterMarkerConfig: { image: { x: 0, y: 0, width: 30, height: 20, rotate: 0 }, }, waterMarkerImage: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", }; }, 220: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { var r, i = []; for (r = 0; r < t; r++) i[r] = 0; return n ? (n.forEach(function (t) { t.source && (i[e[t.source]] += 1), t.target && (i[e[t.target]] += 1); }), i) : i; }; e.floydWarshall = function (t) { var e, n = [], r = t.length; for (i = 0; i < r; i += 1) for (n[i] = [], o = 0; o < r; o += 1) i === o ? (n[i][o] = 0) : 0 !== t[i][o] && t[i][o] ? (n[i][o] = t[i][o]) : (n[i][o] = 1 / 0); for (e = 0; e < r; e += 1) for (var i = 0; i < r; i += 1) for (var o = 0; o < r; o += 1) n[i][o] > n[i][e] + n[e][o] && (n[i][o] = n[i][e] + n[e][o]); return n; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { (o[t.id] = e), i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { var r; if (e && e.children) for (r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 221: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = function () { return (o = Object.assign || function (t) { var e, n, r; for (n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === i(t); }; e.clone = function (t) { var n, r; return null === t ? t : t instanceof Date ? new Date(t.getTime()) : t instanceof Array ? ((n = []), t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); })) : "object" === i(t) && t !== {} ? ((r = o({}, t)), Object.keys(r).forEach(function (t) { r[t] = e.clone(r[t]); }), r) : t; }; }, 222: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 223: function (t, e) { (function (e) { t.exports = e; }).call(this, {}); }, 23: function (t, e, n) { "use strict"; n.d(e, "c", function () { return f; }), n.d(e, "b", function () { return d; }), n.d(e, "a", function () { return p; }); var r = n(1), i = n(31); function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var a = Math.sin, s = Math.cos, c = Math.atan2, u = Math.PI; function h(t, e, n, r, o, h, l) { var f = e.stroke, d = e.lineWidth, p = c(r - h, n - o), g = new i.Path({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: { path: "M" + 10 * s(u / 6) + "," + 10 * a(u / 6) + " L0,0 L" + 10 * s(u / 6) + ",-" + 10 * a(u / 6), stroke: f, lineWidth: d, }, }); g.translate(o, h), g.rotateAtPoint(o, h, p), t.set(l ? "startArrowShape" : "endArrowShape", g); } function l(t, e, n, o, u, h, l) { var f = e.startArrow, d = e.endArrow, p = e.stroke, g = e.lineWidth, v = l ? f : d, y = v.d, m = v.fill, b = v.stroke, x = v.lineWidth, S = Object(r.e)(v, ["d", "fill", "stroke", "lineWidth"]), w = c(o - h, n - u); y && ((u -= s(w) * y), (h -= a(w) * y)); var O = new i.Path({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: Object(r.a)(Object(r.a)({}, S), { stroke: b || p, lineWidth: x || g, fill: m, }), }); O.translate(u, h), O.rotateAtPoint(u, h, w), t.set(l ? "startArrowShape" : "endArrowShape", O); } function f(t, e, n, r, i) { var o = c(r - e, n - t); return { dx: s(o) * i, dy: a(o) * i }; } function d(t, e, n, r, i, a) { "object" === o(e.startArrow) ? l(t, e, n, r, i, a, !0) : e.startArrow ? h(t, e, n, r, i, a, !0) : t.set("startArrowShape", null); } function p(t, e, n, r, i, a) { "object" === o(e.endArrow) ? l(t, e, n, r, i, a, !1) : e.endArrow ? h(t, e, n, r, i, a, !1) : t.set("startArrowShape", null); } }, 25: function (t, e, n) { "use strict"; function r(t, e) { var n = [], r = t[0], i = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( (n[0] = f * r + d * a + p * u), (n[1] = f * i + d * s + p * h), (n[2] = f * o + d * c + p * l), (n[3] = g * r + v * a + y * u), (n[4] = g * i + v * s + y * h), (n[5] = g * o + v * c + y * l), (n[6] = m * r + b * a + x * u), (n[7] = m * i + b * s + x * h), (n[8] = m * o + b * c + x * l), n ); } function i(t, e) { var n = [], r = e[0], i = e[1]; return ( (n[0] = t[0] * r + t[3] * i + t[6]), (n[1] = t[1] * r + t[4] * i + t[7]), n ); } function o(t) { var e = [], n = t[0], r = t[1], i = t[2], o = t[3], a = t[4], s = t[5], c = t[6], u = t[7], h = t[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (e[0] = l * p), (e[1] = (-h * r + i * u) * p), (e[2] = (s * r - i * a) * p), (e[3] = f * p), (e[4] = (h * n - i * c) * p), (e[5] = (-s * n + i * o) * p), (e[6] = d * p), (e[7] = (-u * n + r * c) * p), (e[8] = (a * n - r * o) * p), e) : null; } n.d(e, "b", function () { return r; }), n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }); }, 28: function (t, e, n) { "use strict"; n.d(e, "a", function () { return c; }), n.d(e, "b", function () { return f; }), n.d(e, "c", function () { return g; }), n.d(e, "d", function () { return w; }); var r = n(0), i = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi, o = /[^\s\,]+/gi; var a = function (t) { var e = t || []; return Object(r.isArray)(e) ? e : Object(r.isString)(e) ? ((e = e.match(i)), Object(r.each)(e, function (t, n) { if ((t = t.match(o))[0].length > 1) { var i = t[0].charAt(0); t.splice(1, 0, t[0].substr(1)), (t[0] = i); } Object(r.each)(t, function (e, n) { isNaN(e) || (t[n] = +e); }), (e[n] = t); }), e) : void 0; }, s = n(5); var c = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = [ [0, 0], [1, 1], ]); for (var r = !!e, i = [], o = 0, a = t.length; o < a; o += 2) i.push([t[o], t[o + 1]]); var c, u, h, l = (function (t, e, n, r) { var i, o, a, c, u, h, l, f = [], d = !!r; if (d) { (a = r[0]), (c = r[1]); for (var p = 0, g = t.length; p < g; p += 1) { var v = t[p]; (a = s.b.min([0, 0], a, v)), (c = s.b.max([0, 0], c, v)); } } p = 0; for (var y = t.length; p < y; p += 1) { v = t[p]; if (0 !== p || n) if (p !== y - 1 || n) { (i = t[[p ? p - 1 : y - 1, p - 1][n ? 0 : 1]]), (o = t[n ? (p + 1) % y : p + 1]); var m = [0, 0]; (m = s.b.sub(m, o, i)), (m = s.b.scale(m, m, e)); var b = s.b.distance(v, i), x = s.b.distance(v, o), S = b + x; 0 !== S && ((b /= S), (x /= S)); var w = s.b.scale([0, 0], m, -b), O = s.b.scale([0, 0], m, x); (h = s.b.add([0, 0], v, w)), (u = s.b.add([0, 0], v, O)), (u = s.b.min([0, 0], u, s.b.max([0, 0], o, v))), (u = s.b.max([0, 0], u, s.b.min([0, 0], o, v))), (w = s.b.sub([0, 0], u, v)), (w = s.b.scale([0, 0], w, -b / x)), (h = s.b.add([0, 0], v, w)), (h = s.b.min([0, 0], h, s.b.max([0, 0], i, v))), (h = s.b.max([0, 0], h, s.b.min([0, 0], i, v))), (O = s.b.sub([0, 0], v, h)), (O = s.b.scale([0, 0], O, x / b)), (u = s.b.add([0, 0], v, O)), d && ((h = s.b.max([0, 0], h, a)), (h = s.b.min([0, 0], h, c)), (u = s.b.max([0, 0], u, a)), (u = s.b.min([0, 0], u, c))), f.push(l), f.push(h), (l = u); } else (h = v), f.push(l), f.push(h); else l = v; } return n && f.push(f.shift()), f; })(i, 0.4, r, n), f = i.length, d = []; for (o = 0; o < f - 1; o += 1) (c = l[2 * o]), (u = l[2 * o + 1]), (h = i[o + 1]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]]); return ( r && ((c = l[f]), (u = l[f + 1]), (h = i[0]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]])), d ); }; var u = "\t\n\v\f\r   ᠎              \u2028\u2029", h = new RegExp( "([a-z])[" + u + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + u + "]*,?[" + u + "]*)+)", "ig", ), l = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + u + "]*,?[" + u + "]*", "ig", ); function f(t) { if (!t) return null; if (Object(r.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(h, function (t, r, i) { var o = [], a = r.toLowerCase(); if ( (i.replace(l, function (t, e) { e && o.push(+e); }), "m" === a && o.length > 2 && (n.push([r].concat(o.splice(0, 2))), (a = "l"), (r = "m" === r ? "l" : "L")), "o" === a && 1 === o.length && n.push([r, o[0]]), "r" === a) ) n.push([r].concat(o)); else for ( ; o.length >= e[a] && (n.push([r].concat(o.splice(0, e[a]))), e[a]); ); return ""; }), n ); } var d = /[a-z]/; function p(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function g(t) { var e = f(t); if (!e || !e.length) return [["M", 0, 0]]; for (var n = !1, r = 0; r < e.length; r++) { var i = e[r][0]; if (d.test(i) || ["V", "H", "T", "S"].indexOf(i) >= 0) { n = !0; break; } } if (!n) return e; var o = [], a = 0, s = 0, c = 0, u = 0, h = 0, l = e[0]; ("M" !== l[0] && "m" !== l[0]) || ((c = a = +l[1]), (u = s = +l[2]), h++, (o[0] = ["M", a, s])); r = h; for (var g = e.length; r < g; r++) { var v = e[r], y = o[r - 1], m = [], b = (i = v[0]).toUpperCase(); if (i !== b) switch (((m[0] = b), b)) { case "A": (m[1] = v[1]), (m[2] = v[2]), (m[3] = v[3]), (m[4] = v[4]), (m[5] = v[5]), (m[6] = +v[6] + a), (m[7] = +v[7] + s); break; case "V": m[1] = +v[1] + s; break; case "H": m[1] = +v[1] + a; break; case "M": (c = +v[1] + a), (u = +v[2] + s), (m[1] = c), (m[2] = u); break; default: for (var x = 1, S = v.length; x < S; x++) m[x] = +v[x] + (x % 2 ? a : s); } else m = e[r]; switch (b) { case "Z": (a = +c), (s = +u); break; case "H": m = ["L", (a = m[1]), s]; break; case "V": m = ["L", a, (s = m[1])]; break; case "T": (a = m[1]), (s = m[2]); var w = p([y[1], y[2]], [y[3], y[4]]); m = ["Q", w[0], w[1], a, s]; break; case "S": (a = m[m.length - 2]), (s = m[m.length - 1]); var O = y.length, M = p([y[O - 4], y[O - 3]], [y[O - 2], y[O - 1]]); m = ["C", M[0], M[1], m[1], m[2], a, s]; break; case "M": (c = m[m.length - 2]), (u = m[m.length - 1]); break; default: (a = m[m.length - 2]), (s = m[m.length - 1]); } o.push(m); } return o; } Math.PI; function v(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function y(t, e) { return v(t) * v(e) ? (t[0] * e[0] + t[1] * e[1]) / (v(t) * v(e)) : 1; } function m(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(y(t, e)); } function b(t, e) { return t[0] === e[0] && t[1] === e[1]; } function x(t, e) { var n = e[1], i = e[2], o = Object(r.mod)(Object(r.toRadian)(e[3]), 2 * Math.PI), a = e[4], s = e[5], c = t[0], u = t[1], h = e[6], l = e[7], f = (Math.cos(o) * (c - h)) / 2 + (Math.sin(o) * (u - l)) / 2, d = (-1 * Math.sin(o) * (c - h)) / 2 + (Math.cos(o) * (u - l)) / 2, p = (f * f) / (n * n) + (d * d) / (i * i); p > 1 && ((n *= Math.sqrt(p)), (i *= Math.sqrt(p))); var g = n * n * (d * d) + i * i * (f * f), v = g ? Math.sqrt((n * n * (i * i) - g) / g) : 1; a === s && (v *= -1), isNaN(v) && (v = 0); var x = i ? (v * n * d) / i : 0, S = n ? (v * -i * f) / n : 0, w = (c + h) / 2 + Math.cos(o) * x - Math.sin(o) * S, O = (u + l) / 2 + Math.sin(o) * x + Math.cos(o) * S, M = [(f - x) / n, (d - S) / i], k = [(-1 * f - x) / n, (-1 * d - S) / i], j = m([1, 0], M), C = m(M, k); return ( y(M, k) <= -1 && (C = Math.PI), y(M, k) >= 1 && (C = 0), 0 === s && C > 0 && (C -= 2 * Math.PI), 1 === s && C < 0 && (C += 2 * Math.PI), { cx: w, cy: O, rx: b(t, [h, l]) ? 0 : n, ry: b(t, [h, l]) ? 0 : i, startAngle: j, endAngle: j + C, xRotation: o, arcFlag: a, sweepFlag: s, } ); } function S(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function w(t) { for ( var e = [], n = null, r = null, i = null, o = 0, s = (t = a(t)).length, c = 0; c < s; c++ ) { var u = t[c]; r = t[c + 1]; var h = u[0], l = { command: h, prePoint: n, params: u, startTangent: null, endTangent: null, }; switch (h) { case "M": (i = [u[1], u[2]]), (o = c); break; case "A": var f = x(n, u); l.arcParams = f; } if ("Z" === h) (n = i), (r = t[o + 1]); else { var d = u.length; n = [u[d - 2], u[d - 1]]; } r && "Z" === r[0] && ((r = t[o]), e[o] && (e[o].prePoint = n)), (l.currentPoint = n), e[o] && b(n, e[o].currentPoint) && (e[o].prePoint = l.prePoint); var p = r ? [r[r.length - 2], r[r.length - 1]] : null; l.nextPoint = p; var g = l.prePoint; if (["L", "H", "V"].includes(h)) (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]]); else if ("Q" === h) { var v = [u[1], u[2]]; (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]]); } else if ("T" === h) { v = S((w = e[c - 1]).currentPoint, g); "Q" === w.command ? ((l.command = "Q"), (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]])) : ((l.command = "TL"), (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]])); } else if ("C" === h) { var y = [u[1], u[2]], m = [u[3], u[4]]; (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]]), 0 === l.startTangent[0] && 0 === l.startTangent[1] && (l.startTangent = [y[0] - m[0], y[1] - m[1]]), 0 === l.endTangent[0] && 0 === l.endTangent[1] && (l.endTangent = [m[0] - y[0], m[1] - y[1]]); } else if ("S" === h) { var w; (y = S((w = e[c - 1]).currentPoint, g)), (m = [u[1], u[2]]); "C" === w.command ? ((l.command = "C"), (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])) : ((l.command = "SQ"), (l.startTangent = [g[0] - m[0], g[1] - m[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])); } else if ("A" === h) { var O = 0.001, M = l.arcParams || {}, k = M.cx, j = void 0 === k ? 0 : k, C = M.cy, E = void 0 === C ? 0 : C, P = M.rx, A = void 0 === P ? 0 : P, I = M.ry, T = void 0 === I ? 0 : I, N = M.sweepFlag, B = void 0 === N ? 0 : N, L = M.startAngle, D = void 0 === L ? 0 : L, _ = M.endAngle, R = void 0 === _ ? 0 : _; 0 === B && (O *= -1); var F = A * Math.cos(D - O) + j, Y = T * Math.sin(D - O) + E; l.startTangent = [F - i[0], Y - i[1]]; var X = A * Math.cos(D + R + O) + j, z = T * Math.sin(D + R - O) + E; l.endTangent = [g[0] - X, g[1] - z]; } e.push(l); } return e; } }, 3: function (t, e, n) { "use strict"; n.d(e, "c", function () { return o; }), n.d(e, "a", function () { return a; }), n.d(e, "d", function () { return s; }), n.d(e, "e", function () { return c; }), n.d(e, "l", function () { return u; }), n.d(e, "j", function () { return h; }), n.d(e, "i", function () { return l; }); var r = n(0); n.d(e, "h", function () { return r.isNil; }), n.d(e, "k", function () { return r.isString; }), n.d(e, "g", function () { return r.isFunction; }), n.d(e, "f", function () { return r.isArray; }), n.d(e, "b", function () { return r.each; }), n.d(e, "n", function () { return r.toRadian; }), n.d(e, "m", function () { return r.mod; }); n(40); function i(t) { return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function o() { return "object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.devicePixelRatio ? window.devicePixelRatio : 1; } function a(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function s(t, e, n, r, i, o) { return i >= t && i <= t + n && o >= e && o <= e + r; } function c(t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); } function u(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function h(t, e) { return t[0] === e[0] && t[1] === e[1]; } function l(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } }, 31: function (t, e, n) { "use strict"; n.r(e), n.d(e, "Base", function () { return r.a; }), n.d(e, "Circle", function () { return a; }), n.d(e, "Ellipse", function () { return c; }), n.d(e, "Image", function () { return u.a; }), n.d(e, "Line", function () { return d; }), n.d(e, "Marker", function () { return m; }), n.d(e, "Path", function () { return P; }), n.d(e, "Polygon", function () { return I; }), n.d(e, "Polyline", function () { return T; }), n.d(e, "Rect", function () { return B; }), n.d(e, "Text", function () { return L; }); var r = n(11), i = n(1), o = n(3), a = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, r: 0 }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var a = this.attr(), s = a.x, c = a.y, u = a.r, h = i / 2, l = Object(o.a)(s, c, t, e); return r && n ? l <= u + h : r ? l <= u : !!n && l >= u - h && l <= u + h; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.r; t.beginPath(), t.arc(n, r, i, 0, 2 * Math.PI, !1), t.closePath(); }), e ); })(r.a); function s(t, e, n, r) { return t / (n * n) + e / (r * r); } var c = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, rx: 0, ry: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr(), a = i / 2, c = o.x, u = o.y, h = o.rx, l = o.ry, f = (t - c) * (t - c), d = (e - u) * (e - u); return r && n ? s(f, d, h + a, l + a) <= 1 : r ? s(f, d, h, l) <= 1 : !!n && s(f, d, h - a, l - a) >= 1 && s(f, d, h + a, l + a) <= 1; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; if ((t.beginPath(), t.ellipse)) t.ellipse(n, r, i, o, 0, 0, 2 * Math.PI, !1); else { var a = i > o ? i : o, s = i > o ? 1 : i / o, c = i > o ? o / i : 1; t.save(), t.translate(n, r), t.scale(s, c), t.arc(0, 0, a, 0, 2 * Math.PI), t.restore(), t.closePath(); } }), e ); })(r.a), u = n(89), h = n(9); function l(t, e, n, r, i, o, a) { var s = Math.min(t, n), c = Math.max(t, n), u = Math.min(e, r), l = Math.max(e, r), f = i / 2; return ( o >= s - f && o <= c + f && a >= u - f && a <= l + f && h.c.pointToLine(t, e, n, r, o, a) <= i / 2 ); } var f = n(23), d = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(); }), (e.prototype.setArrow = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2, o = t.startArrow, a = t.endArrow; o && f.b(this, t, r, i, e, n), a && f.a(this, t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { if (!n || !i) return !1; var o = this.attr(); return l(o.x1, o.y1, o.x2, o.y2, i, t, e); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = e.startArrow, s = e.endArrow, c = { dx: 0, dy: 0 }, u = { dx: 0, dy: 0 }; a && a.d && (c = f.c(n, r, i, o, e.startArrow.d)), s && s.d && (u = f.c(n, r, i, o, e.endArrow.d)), t.beginPath(), t.moveTo(n + c.dx, r + c.dy), t.lineTo(i - u.dx, o - u.dy); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2; return h.c.length(e, n, r, i); }), (e.prototype.getPoint = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2; return h.c.pointAt(n, r, i, o, t); }), e ); })(r.a), p = n(0), g = n(28), v = n(12), y = { circle: function (t, e, n) { return [ ["M", t - n, e], ["A", n, n, 0, 1, 0, t + n, e], ["A", n, n, 0, 1, 0, t - n, e], ]; }, square: function (t, e, n) { return [ ["M", t - n, e - n], ["L", t + n, e - n], ["L", t + n, e + n], ["L", t - n, e + n], ["Z"], ]; }, diamond: function (t, e, n) { return [ ["M", t - n, e], ["L", t, e - n], ["L", t + n, e], ["L", t, e + n], ["Z"], ]; }, triangle: function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e + r], ["L", t, e - r], ["L", t + n, e + r], ["Z"], ]; }, "triangle-down": function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e - r], ["L", t + n, e - r], ["L", t, e + r], ["Z"], ]; }, }, m = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.initAttrs = function (t) { this._resetParamsCache(); }), (e.prototype._resetParamsCache = function () { this.set("paramsCache", {}); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), -1 !== ["symbol", "x", "y", "r", "radius"].indexOf(e) && this._resetParamsCache(); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._getR = function (t) { return Object(p.isNil)(t.r) ? t.radius : t.r; }), (e.prototype._getPath = function () { var t, n, r = this.attr(), i = r.x, a = r.y, s = r.symbol || "circle", c = this._getR(r); if (Object(o.g)(s)) (n = (t = s)(i, a, c)), (n = Object(g.c)(n)); else { if (!(t = e.Symbols[s])) return console.warn(s + " marker is not supported."), null; n = t(i, a, c); } return n; }), (e.prototype.createPath = function (t) { var e = this._getPath(), n = this.get("paramsCache"); Object(v.e)(this, t, { path: e }, n); }), (e.Symbols = y), e ); })(r.a); function b(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } function x(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } function S(t, e, n) { var r = !1, i = t.length; if (i <= 2) return !1; for (var o = 0; o < i; o++) { var a = t[o], s = t[(o + 1) % i]; if (x(a, s, [e, n])) return !0; b(a[1] - n) > 0 != b(s[1] - n) > 0 && b(e - ((n - a[1]) * (a[0] - s[0])) / (a[1] - s[1]) - a[0]) < 0 && (r = !r); } return r; } var w = n(8), O = n(4), M = n(85); function k(t, e, n, r, i, a, s, c) { var u = (Math.atan2(c - e, s - t) + 2 * Math.PI) % (2 * Math.PI); if (u < r || u > i) return !1; var h = { x: t + n * Math.cos(u), y: e + n * Math.sin(u) }; return Object(o.a)(h.x, h.y, s, c) <= a / 2; } var j = O.a.transform; var C = Object(i.a)( { hasArc: function (t) { for (var e = !1, n = t.length, r = 0; r < n; r++) { var i = t[r][0]; if ("C" === i || "A" === i || "Q" === i) { e = !0; break; } } return e; }, extractPolygons: function (t) { for (var e = t.length, n = [], r = [], i = [], o = 0; o < e; o++) { var a = t[o], s = a[0]; "M" === s ? (i.length && (r.push(i), (i = [])), i.push([a[1], a[2]])) : "Z" === s ? i.length && (n.push(i), (i = [])) : i.push([a[1], a[2]]); } return i.length > 0 && r.push(i), { polygons: n, polylines: r }; }, isPointInStroke: function (t, e, n, r, i) { for (var a = !1, s = e / 2, c = 0; c < t.length; c++) { var u = t[c], f = u.currentPoint, d = u.params, p = u.prePoint, g = u.box; if ( !g || Object(o.d)(g.x - s, g.y - s, g.width + e, g.height + e, n, r) ) { switch (u.command) { case "L": case "Z": a = l(p[0], p[1], f[0], f[1], e, n, r); break; case "Q": a = h.e.pointDistance( p[0], p[1], d[1], d[2], d[3], d[4], n, r, ) <= e / 2; break; case "C": a = h.b.pointDistance( p[0], p[1], d[1], d[2], d[3], d[4], d[5], d[6], n, r, i, ) <= e / 2; break; case "A": var v = u.arcParams, y = v.cx, m = v.cy, b = v.rx, x = v.ry, S = v.startAngle, w = v.endAngle, O = v.xRotation, C = [n, r, 1], E = b > x ? b : x, P = j(null, [ ["t", -y, -m], ["r", -O], ["s", 1 / (b > x ? 1 : b / x), 1 / (b > x ? x / b : 1)], ]); M.transformMat3(C, C, P), (a = k(0, 0, E, S, w, e, C[0], C[1])); } if (a) break; } } return a; }, }, w.PathUtil, ); function E(t, e, n) { for (var r = !1, i = 0; i < t.length; i++) { if ((r = S(t[i], e, n))) break; } return r; } var P = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this._setPathArr(t.path), this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "path" === e && this._setPathArr(n), this.setArrow(); }), (e.prototype._setPathArr = function (t) { this.attrs.path = Object(g.c)(t); var e = C.hasArc(t); this.set("hasArc", e), this.set("paramsCache", {}), this.set("segments", null), this.set("curve", null), this.set("tCache", null), this.set("totalLength", null); }), (e.prototype.getSegments = function () { var t = this.get("segements"); return ( t || ((t = Object(g.d)(this.attr("path"))), this.set("segments", t)), t ); }), (e.prototype.setArrow = function () { var t = this.attr(), e = t.startArrow, n = t.endArrow; if (e) { var r = this.getStartTangent(); f.b(this, t, r[0][0], r[0][1], r[1][0], r[1][1]); } if (n) { r = this.getEndTangent(); f.a(this, t, r[0][0], r[0][1], r[1][0], r[1][1]); } }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.getSegments(), a = (this.get("hasArc"), !1); if (n) { var s = this.getTotalLength(); a = C.isPointInStroke(o, i, t, e, s); } if (!a && r) { var c = this.attr("path"), u = C.extractPolygons(c); a = E(u.polygons, t, e) || E(u.polylines, t, e); } return a; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = this.get("paramsCache"); Object(v.e)(this, t, e, n); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.get("totalLength"); return Object(p.isNil)(t) ? (this._calculateCurve(), this._setTcache(), this.get("totalLength")) : t; }), (e.prototype.getPoint = function (t) { var e, n, r = this.get("tCache"); r || (this._calculateCurve(), this._setTcache(), (r = this.get("tCache"))); var i = this.get("curve"); if (!r || 0 === r.length) return i ? { x: i[0][1], y: i[0][2] } : null; Object(p.each)(r, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }); var o = i[n]; if (Object(p.isNil)(o) || Object(p.isNil)(n)) return null; var a = o.length, s = i[n + 1]; return h.b.pointAt( o[a - 2], o[a - 1], s[1], s[2], s[3], s[4], s[5], s[6], e, ); }), (e.prototype._calculateCurve = function () { var t = this.attr().path; this.set("curve", C.pathToCurve(t)); }), (e.prototype._setTcache = function () { var t, e, n, r, i = 0, o = 0, a = [], s = this.get("curve"); s && (Object(p.each)(s, function (t, e) { (n = s[e + 1]), (r = t.length), n && (i += h.b.length( t[r - 2], t[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], ) || 0); }), this.set("totalLength", i), 0 !== i ? (Object(p.each)(s, function (c, u) { (n = s[u + 1]), (r = c.length), n && (((t = [])[0] = o / i), (e = h.b.length( c[r - 2], c[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], )), (o += e || 0), (t[1] = o / i), a.push(t)); }), this.set("tCache", a)) : this.set("tCache", [])); }), (e.prototype.getStartTangent = function () { var t, e = this.getSegments(); if (e.length > 1) { var n = e[0].currentPoint, r = e[1].currentPoint, i = e[1].startTangent; (t = []), i ? (t.push([n[0] - i[0], n[1] - i[1]]), t.push([n[0], n[1]])) : (t.push([r[0], r[1]]), t.push([n[0], n[1]])); } return t; }), (e.prototype.getEndTangent = function () { var t, e = this.getSegments(), n = e.length; if (n > 1) { var r = e[n - 2].currentPoint, i = e[n - 1].currentPoint, o = e[n - 1].endTangent; (t = []), o ? (t.push([i[0] - o[0], i[1] - o[1]]), t.push([i[0], i[1]])) : (t.push([r[0], r[1]]), t.push([i[0], i[1]])); } return t; }), e ); })(r.a); function A(t, e, n, r, i) { var o = t.length; if (o < 2) return !1; for (var a = 0; a < o - 1; a++) { if (l(t[a][0], t[a][1], t[a + 1][0], t[a + 1][1], e, n, r)) return !0; } if (i) { var s = t[0], c = t[o - 1]; if (l(s[0], s[1], c[0], c[1], e, n, r)) return !0; } return !1; } var I = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr().points, a = !1; return ( n && (a = A(o, i, t, e, !0)), !a && r && (a = S(o, t, e)), a ); }), (e.prototype.createPath = function (t) { var e = this.attr().points; if (!(e.length < 2)) { t.beginPath(); for (var n = 0; n < e.length; n++) { var r = e[n]; 0 === n ? t.moveTo(r[0], r[1]) : t.lineTo(r[0], r[1]); } t.closePath(); } }), e ); })(r.a), T = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(), -1 !== ["points"].indexOf(e) && this._resetCache(); }), (e.prototype._resetCache = function () { this.set("totalLength", null), this.set("tCache", null); }), (e.prototype.setArrow = function () { var t = this.attr(), e = this.attrs, n = e.points, r = e.startArrow, i = e.endArrow, o = n.length, a = n[0][0], s = n[0][1], c = n[o - 1][0], u = n[o - 1][1]; r && f.b(this, t, n[1][0], n[1][1], a, s), i && f.a(this, t, n[o - 2][0], n[o - 2][1], c, u); }), (e.prototype.isFill = function () { return !1; }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !(!n || !i) && A(this.attr().points, i, t, e, !1); }), (e.prototype.isStroke = function () { return !0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.points, r = e.startArrow, i = e.endArrow, o = n.length; if (!(n.length < 2)) { var a, s = n[0][0], c = n[0][1], u = n[o - 1][0], h = n[o - 1][1]; if (r && r.d) (s += (a = f.c(s, c, n[1][0], n[1][1], r.d)).dx), (c += a.dy); if (i && i.d) (u -= (a = f.c(n[o - 2][0], n[o - 2][1], u, h, i.d)).dx), (h -= a.dy); t.beginPath(), t.moveTo(s, c); for (var l = 0; l < o - 1; l++) { var d = n[l]; t.lineTo(d[0], d[1]); } t.lineTo(u, h); } }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr().points, e = this.get("totalLength"); return Object(p.isNil)(e) ? (this.set("totalLength", h.d.length(t)), this.get("totalLength")) : e; }), (e.prototype.getPoint = function (t) { var e, n, r = this.attr().points, i = this.get("tCache"); return ( i || (this._setTcache(), (i = this.get("tCache"))), Object(p.each)(i, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }), h.c.pointAt(r[n][0], r[n][1], r[n + 1][0], r[n + 1][1], e) ); }), (e.prototype._setTcache = function () { var t = this.attr().points; if (t && 0 !== t.length) { var e = this.getTotalLength(); if (!(e <= 0)) { var n, r, i = 0, o = []; Object(p.each)(t, function (a, s) { t[s + 1] && (((n = [])[0] = i / e), (r = h.c.length(a[0], a[1], t[s + 1][0], t[s + 1][1])), (i += r), (n[1] = i / e), o.push(n)); }), this.set("tCache", o); } } }), (e.prototype.getStartTangent = function () { var t = this.attr().points, e = []; return e.push([t[1][0], t[1][1]]), e.push([t[0][0], t[0][1]]), e; }), (e.prototype.getEndTangent = function () { var t = this.attr().points, e = t.length - 1, n = []; return ( n.push([t[e - 1][0], t[e - 1][1]]), n.push([t[e][0], t[e][1]]), n ); }), e ); })(r.a), N = n(94); var B = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, width: 0, height: 0, radius: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var a = this.attr(), s = a.x, c = a.y, u = a.width, h = a.height, f = a.radius; if (f) { var d = !1; return ( n && (d = (function (t, e, n, r, i, o, a, s) { return ( l(t + i, e, t + n - i, e, o, a, s) || l(t + n, e + i, t + n, e + r - i, o, a, s) || l(t + n - i, e + r, t + i, e + r, o, a, s) || l(t, e + r - i, t, e + i, o, a, s) || k( t + n - i, e + i, i, 1.5 * Math.PI, 2 * Math.PI, o, a, s, ) || k(t + n - i, e + r - i, i, 0, 0.5 * Math.PI, o, a, s) || k( t + i, e + r - i, i, 0.5 * Math.PI, Math.PI, o, a, s, ) || k(t + i, e + i, i, Math.PI, 1.5 * Math.PI, o, a, s) ); })(s, c, u, h, f, i, t, e)), !d && r && (d = Object(o.d)(s, c, u, h, t, e)), d ); } var p = i / 2; return r && n ? Object(o.d)(s - p, c - p, u + p, h + p, t, e) : r ? Object(o.d)(s, c, u, h, t, e) : n ? (function (t, e, n, r, i, a, s) { var c = i / 2; return ( Object(o.d)(t - c, e - c, n, i, a, s) || Object(o.d)(t + n - c, e - c, i, r, a, s) || Object(o.d)(t + c, e + r - c, n, i, a, s) || Object(o.d)(t - c, e + c, i, r, a, s) ); })(s, c, u, h, i, t, e) : void 0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.width, o = e.height, a = e.radius; if ((t.beginPath(), 0 === a)) t.rect(n, r, i, o); else { var s = Object(N.a)(a), c = s[0], u = s[1], h = s[2], l = s[3]; t.moveTo(n + c, r), t.lineTo(n + i - u, r), 0 !== u && t.arc(n + i - u, r + u, u, -Math.PI / 2, 0), t.lineTo(n + i, r + o - h), 0 !== h && t.arc(n + i - h, r + o - h, h, 0, Math.PI / 2), t.lineTo(n + l, r + o), 0 !== l && t.arc(n + l, r + o - l, l, Math.PI / 2, Math.PI), t.lineTo(n, r + c), 0 !== c && t.arc(n + c, r + c, c, Math.PI, 1.5 * Math.PI), t.closePath(); } }), e ); })(r.a), L = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: "sans-serif", fontStyle: "normal", fontWeight: "normal", fontVariant: "normal", textAlign: "start", textBaseline: "bottom", }); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype.initAttrs = function (t) { this._assembleFont(), t.text && this._setText(t.text); }), (e.prototype._assembleFont = function () { var t = this.attrs; t.font = Object(w.assembleFont)(t); }), (e.prototype._setText = function (t) { var e = null; Object(o.k)(t) && -1 !== t.indexOf("\n") && (e = t.split("\n")), this.set("textArr", e); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), e.startsWith("font") && this._assembleFont(), "text" === e && this._setText(n); }), (e.prototype._getSpaceingY = function () { var t = this.attrs, e = t.lineHeight, n = 1 * t.fontSize; return e ? e - n : 0.14 * n; }), (e.prototype._drawTextArr = function (t, e, n) { var r, i = this.attrs, a = i.textBaseline, s = i.x, c = i.y, u = 1 * i.fontSize, h = this._getSpaceingY(), l = Object(w.getTextHeight)(i.text, i.fontSize, i.lineHeight); Object(o.b)(e, function (e, i) { (r = c + i * (h + u) - l + u), "middle" === a && (r += l - u - (l - u) / 2), "top" === a && (r += l - u), n ? t.fillText(e, s, r) : t.strokeText(e, s, r); }); }), (e.prototype._drawText = function (t, e) { var n = this.attr(), r = n.x, i = n.y, o = this.get("textArr"); if (o) this._drawTextArr(t, o, e); else { var a = n.text; e ? t.fillText(a, r, i) : t.strokeText(a, r, i); } }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, a = e.fillOpacity; this.isStroke() && n > 0 && (Object(o.h)(i) || 1 === i || (t.globalAlpha = r), this.stroke(t)), this.isFill() && (Object(o.h)(a) || 1 === a ? this.fill(t) : ((t.globalAlpha = a), this.fill(t), (t.globalAlpha = r))), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { this._drawText(t, !0); }), (e.prototype.stroke = function (t) { this._drawText(t, !1); }), e ); })(r.a); }, 33: function (t, e, n) { "use strict"; var r = n(99); n.d(e, "a", function () { return r.Layout; }), n.d(e, "b", function () { return r.Layouts; }); var i = n(62); n.d(e, "c", function () { return i.registerLayout; }), n.d(e, "d", function () { return i.unRegisterLayout; }); var o = n(64); Object(i.registerLayout)("random", o.RandomLayout); }, 34: function (t, e, n) { "use strict"; n.r(e), n.d(e, "catmullRomToBezier", function () { return c; }), n.d(e, "fillPath", function () { return A; }), n.d(e, "fillPathByDiff", function () { return N; }), n.d(e, "formatPath", function () { return D; }), n.d(e, "intersection", function () { return C; }), n.d(e, "parsePathArray", function () { return v; }), n.d(e, "parsePathString", function () { return s; }), n.d(e, "pathToAbsolute", function () { return h; }), n.d(e, "pathToCurve", function () { return p; }), n.d(e, "rectPath", function () { return w; }); var r = n(0), i = "\t\n\v\f\r   ᠎              \u2028\u2029", o = new RegExp( "([a-z])[" + i + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + i + "]*,?[" + i + "]*)+)", "ig", ), a = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + i + "]*,?[" + i + "]*", "ig", ), s = function (t) { if (!t) return null; if (Object(r.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(o, function (r, i, o) { var s = [], c = i.toLowerCase(); if ( (o.replace(a, function (t, e) { e && s.push(+e); }), "m" === c && s.length > 2 && (n.push([i].concat(s.splice(0, 2))), (c = "l"), (i = "m" === i ? "l" : "L")), "o" === c && 1 === s.length && n.push([i, s[0]]), "r" === c) ) n.push([i].concat(s)); else for ( ; s.length >= e[c] && (n.push([i].concat(s.splice(0, e[c]))), e[c]); ); return t; }), n ); }, c = function (t, e) { for (var n = [], r = 0, i = t.length; i - 2 * !e > r; r += 2) { var o = [ { x: +t[r - 2], y: +t[r - 1] }, { x: +t[r], y: +t[r + 1] }, { x: +t[r + 2], y: +t[r + 3] }, { x: +t[r + 4], y: +t[r + 5] }, ]; e ? r ? i - 4 === r ? (o[3] = { x: +t[0], y: +t[1] }) : i - 2 === r && ((o[2] = { x: +t[0], y: +t[1] }), (o[3] = { x: +t[2], y: +t[3] })) : (o[0] = { x: +t[i - 2], y: +t[i - 1] }) : i - 4 === r ? (o[3] = o[2]) : r || (o[0] = { x: +t[r], y: +t[r + 1] }), n.push([ "C", (-o[0].x + 6 * o[1].x + o[2].x) / 6, (-o[0].y + 6 * o[1].y + o[2].y) / 6, (o[1].x + 6 * o[2].x - o[3].x) / 6, (o[1].y + 6 * o[2].y - o[3].y) / 6, o[2].x, o[2].y, ]); } return n; }, u = function (t, e, n, r, i) { var o = []; if ( (null === i && null === r && (r = n), (t = +t), (e = +e), (n = +n), (r = +r), null !== i) ) { var a = Math.PI / 180, s = t + n * Math.cos(-r * a), c = t + n * Math.cos(-i * a); o = [ ["M", s, e + n * Math.sin(-r * a)], ["A", n, n, 0, +(i - r > 180), 0, c, e + n * Math.sin(-i * a)], ]; } else o = [ ["M", t, e], ["m", 0, -r], ["a", n, r, 0, 1, 1, 0, 2 * r], ["a", n, r, 0, 1, 1, 0, -2 * r], ["z"], ]; return o; }, h = function (t) { if (!(t = s(t)) || !t.length) return [["M", 0, 0]]; var e, n, r = [], i = 0, o = 0, a = 0, h = 0, l = 0; "M" === t[0][0] && ((a = i = +t[0][1]), (h = o = +t[0][2]), l++, (r[0] = ["M", i, o])); for ( var f = 3 === t.length && "M" === t[0][0] && "R" === t[1][0].toUpperCase() && "Z" === t[2][0].toUpperCase(), d = void 0, p = void 0, g = l, v = t.length; g < v; g++ ) { if ((r.push((d = [])), (e = (p = t[g])[0]) !== e.toUpperCase())) switch (((d[0] = e.toUpperCase()), d[0])) { case "A": (d[1] = p[1]), (d[2] = p[2]), (d[3] = p[3]), (d[4] = p[4]), (d[5] = p[5]), (d[6] = +p[6] + i), (d[7] = +p[7] + o); break; case "V": d[1] = +p[1] + o; break; case "H": d[1] = +p[1] + i; break; case "R": for ( var y = 2, m = (n = [i, o].concat(p.slice(1))).length; y < m; y++ ) (n[y] = +n[y] + i), (n[++y] = +n[y] + o); r.pop(), (r = r.concat(c(n, f))); break; case "O": r.pop(), (n = u(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); break; case "U": r.pop(), (r = r.concat(u(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); break; case "M": (a = +p[1] + i), (h = +p[2] + o); break; default: for (y = 1, m = p.length; y < m; y++) d[y] = +p[y] + (y % 2 ? i : o); } else if ("R" === e) (n = [i, o].concat(p.slice(1))), r.pop(), (r = r.concat(c(n, f))), (d = ["R"].concat(p.slice(-2))); else if ("O" === e) r.pop(), (n = u(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); else if ("U" === e) r.pop(), (r = r.concat(u(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); else for (var b = 0, x = p.length; b < x; b++) d[b] = p[b]; if ("O" !== (e = e.toUpperCase())) switch (d[0]) { case "Z": (i = +a), (o = +h); break; case "H": i = d[1]; break; case "V": o = d[1]; break; case "M": (a = d[d.length - 2]), (h = d[d.length - 1]); break; default: (i = d[d.length - 2]), (o = d[d.length - 1]); } } return r; }, l = function (t, e, n, r) { return [t, e, n, r, n, r]; }, f = function (t, e, n, r, i, o) { return [ (1 / 3) * t + (2 / 3) * n, (1 / 3) * e + (2 / 3) * r, (1 / 3) * i + (2 / 3) * n, (1 / 3) * o + (2 / 3) * r, i, o, ]; }, d = function t(e, n, r, i, o, a, s, c, u, h) { r === i && (r += 1); var l, f, d, p, g, v = (120 * Math.PI) / 180, y = (Math.PI / 180) * (+o || 0), m = [], b = function (t, e, n) { return { x: t * Math.cos(n) - e * Math.sin(n), y: t * Math.sin(n) + e * Math.cos(n), }; }; if (h) (f = h[0]), (d = h[1]), (p = h[2]), (g = h[3]); else { (e = (l = b(e, n, -y)).x), (n = l.y), (c = (l = b(c, u, -y)).x), (u = l.y), e === c && n === u && ((c += 1), (u += 1)); var x = (e - c) / 2, S = (n - u) / 2, w = (x * x) / (r * r) + (S * S) / (i * i); w > 1 && ((r *= w = Math.sqrt(w)), (i *= w)); var O = r * r, M = i * i, k = (a === s ? -1 : 1) * Math.sqrt( Math.abs( (O * M - O * S * S - M * x * x) / (O * S * S + M * x * x), ), ); (p = (k * r * S) / i + (e + c) / 2), (g = (k * -i * x) / r + (n + u) / 2), (f = Math.asin(((n - g) / i).toFixed(9))), (d = Math.asin(((u - g) / i).toFixed(9))), (f = e < p ? Math.PI - f : f), (d = c < p ? Math.PI - d : d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), s && f > d && (f -= 2 * Math.PI), !s && d > f && (d -= 2 * Math.PI); } var j = d - f; if (Math.abs(j) > v) { var C = d, E = c, P = u; (d = f + v * (s && d > f ? 1 : -1)), (m = t( (c = p + r * Math.cos(d)), (u = g + i * Math.sin(d)), r, i, o, 0, s, E, P, [d, C, p, g], )); } j = d - f; var A = Math.cos(f), I = Math.sin(f), T = Math.cos(d), N = Math.sin(d), B = Math.tan(j / 4), L = (4 / 3) * r * B, D = (4 / 3) * i * B, _ = [e, n], R = [e + L * I, n - D * A], F = [c + L * N, u - D * T], Y = [c, u]; if (((R[0] = 2 * _[0] - R[0]), (R[1] = 2 * _[1] - R[1]), h)) return [R, F, Y].concat(m); for ( var X = [], z = 0, W = (m = [R, F, Y].concat(m).join().split(",")).length; z < W; z++ ) X[z] = z % 2 ? b(m[z - 1], m[z], y).y : b(m[z], m[z + 1], y).x; return X; }, p = function (t, e) { var n, r = h(t), i = e && h(e), o = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, a = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, s = [], c = [], u = "", p = "", g = function (t, e, n) { var r, i; if (!t) return ["C", e.x, e.y, e.x, e.y, e.x, e.y]; switch ( (!(t[0] in { T: 1, Q: 1 }) && (e.qx = e.qy = null), t[0]) ) { case "M": (e.X = t[1]), (e.Y = t[2]); break; case "A": t = ["C"].concat(d.apply(0, [e.x, e.y].concat(t.slice(1)))); break; case "S": "C" === n || "S" === n ? ((r = 2 * e.x - e.bx), (i = 2 * e.y - e.by)) : ((r = e.x), (i = e.y)), (t = ["C", r, i].concat(t.slice(1))); break; case "T": "Q" === n || "T" === n ? ((e.qx = 2 * e.x - e.qx), (e.qy = 2 * e.y - e.qy)) : ((e.qx = e.x), (e.qy = e.y)), (t = ["C"].concat(f(e.x, e.y, e.qx, e.qy, t[1], t[2]))); break; case "Q": (e.qx = t[1]), (e.qy = t[2]), (t = ["C"].concat(f(e.x, e.y, t[1], t[2], t[3], t[4]))); break; case "L": t = ["C"].concat(l(e.x, e.y, t[1], t[2])); break; case "H": t = ["C"].concat(l(e.x, e.y, t[1], e.y)); break; case "V": t = ["C"].concat(l(e.x, e.y, e.x, t[1])); break; case "Z": t = ["C"].concat(l(e.x, e.y, e.X, e.Y)); } return t; }, v = function (t, e) { if (t[e].length > 7) { t[e].shift(); for (var o = t[e]; o.length; ) (s[e] = "A"), i && (c[e] = "A"), t.splice(e++, 0, ["C"].concat(o.splice(0, 6))); t.splice(e, 1), (n = Math.max(r.length, (i && i.length) || 0)); } }, y = function (t, e, o, a, s) { t && e && "M" === t[s][0] && "M" !== e[s][0] && (e.splice(s, 0, ["M", a.x, a.y]), (o.bx = 0), (o.by = 0), (o.x = t[s][1]), (o.y = t[s][2]), (n = Math.max(r.length, (i && i.length) || 0))); }; n = Math.max(r.length, (i && i.length) || 0); for (var m = 0; m < n; m++) { r[m] && (u = r[m][0]), "C" !== u && ((s[m] = u), m && (p = s[m - 1])), (r[m] = g(r[m], o, p)), "A" !== s[m] && "C" === u && (s[m] = "C"), v(r, m), i && (i[m] && (u = i[m][0]), "C" !== u && ((c[m] = u), m && (p = c[m - 1])), (i[m] = g(i[m], a, p)), "A" !== c[m] && "C" === u && (c[m] = "C"), v(i, m)), y(r, i, o, a, m), y(i, r, a, o, m); var b = r[m], x = i && i[m], S = b.length, w = i && x.length; (o.x = b[S - 2]), (o.y = b[S - 1]), (o.bx = parseFloat(b[S - 4]) || o.x), (o.by = parseFloat(b[S - 3]) || o.y), (a.bx = i && (parseFloat(x[w - 4]) || a.x)), (a.by = i && (parseFloat(x[w - 3]) || a.y)), (a.x = i && x[w - 2]), (a.y = i && x[w - 1]); } return i ? [r, i] : r; }, g = /,?([a-z]),?/gi, v = function (t) { return t.join(",").replace(g, "$1"); }, y = function (t, e, n, r, i) { return ( t * (t * (-3 * e + 9 * n - 9 * r + 3 * i) + 6 * e - 12 * n + 6 * r) - 3 * e + 3 * n ); }, m = function (t, e, n, r, i, o, a, s, c) { null === c && (c = 1); for ( var u = (c = c > 1 ? 1 : c < 0 ? 0 : c) / 2, h = [ -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, ], l = [ 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472, ], f = 0, d = 0; d < 12; d++ ) { var p = u * h[d] + u, g = y(p, t, n, i, a), v = y(p, e, r, o, s), m = g * g + v * v; f += l[d] * Math.sqrt(m); } return u * f; }, b = function (t, e, n, r, i, o, a, s) { for (var c, u, h, l, f = [], d = [[], []], p = 0; p < 2; ++p) if ( (0 === p ? ((u = 6 * t - 12 * n + 6 * i), (c = -3 * t + 9 * n - 9 * i + 3 * a), (h = 3 * n - 3 * t)) : ((u = 6 * e - 12 * r + 6 * o), (c = -3 * e + 9 * r - 9 * o + 3 * s), (h = 3 * r - 3 * e)), Math.abs(c) < 1e-12) ) { if (Math.abs(u) < 1e-12) continue; (l = -h / u) > 0 && l < 1 && f.push(l); } else { var g = u * u - 4 * h * c, v = Math.sqrt(g); if (!(g < 0)) { var y = (-u + v) / (2 * c); y > 0 && y < 1 && f.push(y); var m = (-u - v) / (2 * c); m > 0 && m < 1 && f.push(m); } } for (var b, x = f.length, S = x; x--; ) (b = 1 - (l = f[x])), (d[0][x] = b * b * b * t + 3 * b * b * l * n + 3 * b * l * l * i + l * l * l * a), (d[1][x] = b * b * b * e + 3 * b * b * l * r + 3 * b * l * l * o + l * l * l * s); return ( (d[0][S] = t), (d[1][S] = e), (d[0][S + 1] = a), (d[1][S + 1] = s), (d[0].length = d[1].length = S + 2), { min: { x: Math.min.apply(0, d[0]), y: Math.min.apply(0, d[1]) }, max: { x: Math.max.apply(0, d[0]), y: Math.max.apply(0, d[1]) }, } ); }, x = function (t, e, n, r, i, o, a, s) { if ( !( Math.max(t, n) < Math.min(i, a) || Math.min(t, n) > Math.max(i, a) || Math.max(e, r) < Math.min(o, s) || Math.min(e, r) > Math.max(o, s) ) ) { var c = (t - n) * (o - s) - (e - r) * (i - a); if (c) { var u = ((t * r - e * n) * (i - a) - (t - n) * (i * s - o * a)) / c, h = ((t * r - e * n) * (o - s) - (e - r) * (i * s - o * a)) / c, l = +u.toFixed(2), f = +h.toFixed(2); if ( !( l < +Math.min(t, n).toFixed(2) || l > +Math.max(t, n).toFixed(2) || l < +Math.min(i, a).toFixed(2) || l > +Math.max(i, a).toFixed(2) || f < +Math.min(e, r).toFixed(2) || f > +Math.max(e, r).toFixed(2) || f < +Math.min(o, s).toFixed(2) || f > +Math.max(o, s).toFixed(2) ) ) return { x: u, y: h }; } } }, S = function (t, e, n) { return ( e >= t.x && e <= t.x + t.width && n >= t.y && n <= t.y + t.height ); }, w = function (t, e, n, r, i) { if (i) return [ ["M", +t + +i, e], ["l", n - 2 * i, 0], ["a", i, i, 0, 0, 1, i, i], ["l", 0, r - 2 * i], ["a", i, i, 0, 0, 1, -i, i], ["l", 2 * i - n, 0], ["a", i, i, 0, 0, 1, -i, -i], ["l", 0, 2 * i - r], ["a", i, i, 0, 0, 1, i, -i], ["z"], ]; var o = [["M", t, e], ["l", n, 0], ["l", 0, r], ["l", -n, 0], ["z"]]; return (o.parsePathArray = v), o; }, O = function (t, e, n, r) { return ( null === t && (t = e = n = r = 0), null === e && ((e = t.y), (n = t.width), (r = t.height), (t = t.x)), { x: t, y: e, width: n, w: n, height: r, h: r, x2: t + n, y2: e + r, cx: t + n / 2, cy: e + r / 2, r1: Math.min(n, r) / 2, r2: Math.max(n, r) / 2, r0: Math.sqrt(n * n + r * r) / 2, path: w(t, e, n, r), vb: [t, e, n, r].join(" "), } ); }, M = function (t, e, n, i, o, a, s, c) { Object(r.isArray)(t) || (t = [t, e, n, i, o, a, s, c]); var u = b.apply(null, t); return O(u.min.x, u.min.y, u.max.x - u.min.x, u.max.y - u.min.y); }, k = function (t, e, n, r, i, o, a, s, c) { var u = 1 - c, h = Math.pow(u, 3), l = Math.pow(u, 2), f = c * c, d = f * c, p = t + 2 * c * (n - t) + f * (i - 2 * n + t), g = e + 2 * c * (r - e) + f * (o - 2 * r + e), v = n + 2 * c * (i - n) + f * (a - 2 * i + n), y = r + 2 * c * (o - r) + f * (s - 2 * o + r); return { x: h * t + 3 * l * c * n + 3 * u * c * c * i + d * a, y: h * e + 3 * l * c * r + 3 * u * c * c * o + d * s, m: { x: p, y: g }, n: { x: v, y: y }, start: { x: u * t + c * n, y: u * e + c * r }, end: { x: u * i + c * a, y: u * o + c * s }, alpha: 90 - (180 * Math.atan2(p - v, g - y)) / Math.PI, }; }, j = function (t, e, n) { if ( !(function (t, e) { return ( (t = O(t)), (e = O(e)), S(e, t.x, t.y) || S(e, t.x2, t.y) || S(e, t.x, t.y2) || S(e, t.x2, t.y2) || S(t, e.x, e.y) || S(t, e.x2, e.y) || S(t, e.x, e.y2) || S(t, e.x2, e.y2) || (((t.x < e.x2 && t.x > e.x) || (e.x < t.x2 && e.x > t.x)) && ((t.y < e.y2 && t.y > e.y) || (e.y < t.y2 && e.y > t.y))) ); })(M(t), M(e)) ) return n ? 0 : []; for ( var r = ~~(m.apply(0, t) / 8), i = ~~(m.apply(0, e) / 8), o = [], a = [], s = {}, c = n ? 0 : [], u = 0; u < r + 1; u++ ) { var h = k.apply(0, t.concat(u / r)); o.push({ x: h.x, y: h.y, t: u / r }); } for (u = 0; u < i + 1; u++) { h = k.apply(0, e.concat(u / i)); a.push({ x: h.x, y: h.y, t: u / i }); } for (u = 0; u < r; u++) for (var l = 0; l < i; l++) { var f = o[u], d = o[u + 1], p = a[l], g = a[l + 1], v = Math.abs(d.x - f.x) < 0.001 ? "y" : "x", y = Math.abs(g.x - p.x) < 0.001 ? "y" : "x", b = x(f.x, f.y, d.x, d.y, p.x, p.y, g.x, g.y); if (b) { if (s[b.x.toFixed(4)] === b.y.toFixed(4)) continue; s[b.x.toFixed(4)] = b.y.toFixed(4); var w = f.t + Math.abs((b[v] - f[v]) / (d[v] - f[v])) * (d.t - f.t), j = p.t + Math.abs((b[y] - p[y]) / (g[y] - p[y])) * (g.t - p.t); w >= 0 && w <= 1 && j >= 0 && j <= 1 && (n ? (c += 1) : c.push({ x: b.x, y: b.y, t1: w, t2: j })); } } return c; }, C = function (t, e) { return (function (t, e, n) { var r, i, o, a, s, c, u, h, l, f; (t = p(t)), (e = p(e)); for (var d = n ? 0 : [], g = 0, v = t.length; g < v; g++) { var y = t[g]; if ("M" === y[0]) (r = s = y[1]), (i = c = y[2]); else { "C" === y[0] ? ((l = [r, i].concat(y.slice(1))), (r = l[6]), (i = l[7])) : ((l = [r, i, r, i, s, c, s, c]), (r = s), (i = c)); for (var m = 0, b = e.length; m < b; m++) { var x = e[m]; if ("M" === x[0]) (o = u = x[1]), (a = h = x[2]); else { "C" === x[0] ? ((f = [o, a].concat(x.slice(1))), (o = f[6]), (a = f[7])) : ((f = [o, a, o, a, u, h, u, h]), (o = u), (a = h)); var S = j(l, f, n); if (n) d += S; else { for (var w = 0, O = S.length; w < O; w++) (S[w].segment1 = g), (S[w].segment2 = m), (S[w].bez1 = l), (S[w].bez2 = f); d = d.concat(S); } } } } } return d; })(t, e); }; function E(t, e) { var n = [], r = []; return ( t.length && (function t(e, i) { if (1 === e.length) n.push(e[0]), r.push(e[0]); else { for (var o = [], a = 0; a < e.length - 1; a++) 0 === a && n.push(e[0]), a === e.length - 2 && r.push(e[a + 1]), (o[a] = [ (1 - i) * e[a][0] + i * e[a + 1][0], (1 - i) * e[a][1] + i * e[a + 1][1], ]); t(o, i); } })(t, e), { left: n, right: r.reverse() } ); } var P = function (t, e, n) { if (1 === n) return [[].concat(t)]; var r = []; if ("L" === e[0] || "C" === e[0] || "Q" === e[0]) r = r.concat( (function (t, e, n) { var r = [[t[1], t[2]]]; n = n || 2; var i = []; "A" === e[0] ? (r.push(e[6]), r.push(e[7])) : "C" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]]), r.push([e[5], e[6]])) : "S" === e[0] || "Q" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]])) : r.push([e[1], e[2]]); for (var o = r, a = 1 / n, s = 0; s < n - 1; s++) { var c = E(o, a / (1 - a * s)); i.push(c.left), (o = c.right); } return ( i.push(o), i.map(function (t) { var e = []; return ( 4 === t.length && (e.push("C"), (e = e.concat(t[2]))), t.length >= 3 && (3 === t.length && e.push("Q"), (e = e.concat(t[1]))), 2 === t.length && e.push("L"), (e = e.concat(t[t.length - 1])) ); }) ); })(t, e, n), ); else { var i = [].concat(t); "M" === i[0] && (i[0] = "L"); for (var o = 0; o <= n - 1; o++) r.push(i); } return r; }, A = function (t, e) { if (1 === t.length) return t; var n = t.length - 1, r = e.length - 1, i = n / r, o = []; if (1 === t.length && "M" === t[0][0]) { for (var a = 0; a < r - n; a++) t.push(t[0]); return t; } for (a = 0; a < r; a++) { var s = Math.floor(i * a); o[s] = (o[s] || 0) + 1; } var c = o.reduce(function (e, r, i) { return i === n ? e.concat(t[n]) : e.concat(P(t[i], t[i + 1], r)); }, []); return ( c.unshift(t[0]), ("Z" !== e[r] && "z" !== e[r]) || c.push("Z"), c ); }, I = function (t, e) { if (t.length !== e.length) return !1; var n = !0; return ( Object(r.each)(t, function (t, r) { if (t !== e[r]) return (n = !1), !1; }), n ); }; function T(t, e, n) { var r = null, i = n; return ( e < i && ((i = e), (r = "add")), t < i && ((i = t), (r = "del")), { type: r, min: i } ); } var N = function (t, e) { var n = (function (t, e) { var n, r, i = t.length, o = e.length, a = 0; if (0 === i || 0 === o) return null; for (var s = [], c = 0; c <= i; c++) (s[c] = []), (s[c][0] = { min: c }); for (var u = 0; u <= o; u++) s[0][u] = { min: u }; for (c = 1; c <= i; c++) { n = t[c - 1]; for (u = 1; u <= o; u++) { (r = e[u - 1]), (a = I(n, r) ? 0 : 1); var h = s[c - 1][u].min + 1, l = s[c][u - 1].min + 1, f = s[c - 1][u - 1].min + a; s[c][u] = T(h, l, f); } } return s; })(t, e), r = t.length, i = e.length, o = [], a = 1, s = 1; if (n[r][i].min !== r) { for (var c = 1; c <= r; c++) { var u = n[c][c].min; s = c; for (var h = a; h <= i; h++) n[c][h].min < u && ((u = n[c][h].min), (s = h)); (a = s), n[c][a].type && o.push({ index: c - 1, type: n[c][a].type }); } for (c = o.length - 1; c >= 0; c--) (a = o[c].index), "add" === o[c].type ? t.splice(a, 0, [].concat(t[a])) : t.splice(a, 1); } var l = i - (r = t.length); if (r < i) for (c = 0; c < l; c++) "z" === t[r - 1][0] || "Z" === t[r - 1][0] ? t.splice(r - 2, 0, t[r - 2]) : t.push(t[r - 1]), (r += 1); return t; }; function B(t, e, n) { for ( var r, i = [].concat(t), o = 1 / (n + 1), a = L(e)[0], s = 1; s <= n; s++ ) (o *= s), 0 === (r = Math.floor(t.length * o)) ? i.unshift([ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]) : i.splice(r, 0, [ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]); return i; } function L(t) { var e = []; switch (t[0]) { case "M": case "L": e.push([t[1], t[2]]); break; case "A": e.push([t[6], t[7]]); break; case "Q": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "T": e.push([t[1], t[2]]); break; case "C": e.push([t[5], t[6]]), e.push([t[1], t[2]]), e.push([t[3], t[4]]); break; case "S": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "H": case "V": e.push([t[1], t[1]]); } return e; } var D = function (t, e) { if (t.length <= 1) return t; for (var n, r = 0; r < e.length; r++) if (t[r][0] !== e[r][0]) switch (((n = L(t[r])), e[r][0])) { case "M": t[r] = ["M"].concat(n[0]); break; case "L": t[r] = ["L"].concat(n[0]); break; case "A": (t[r] = [].concat(e[r])), (t[r][6] = n[0][0]), (t[r][7] = n[0][1]); break; case "Q": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 1); } t[r] = ["Q"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "T": t[r] = ["T"].concat(n[0]); break; case "C": if (n.length < 3) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 2); } t[r] = ["C"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "S": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 1); } t[r] = ["S"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; default: t[r] = e[r]; } return t; }; }, 35: function (t, e, n) { "use strict"; n.r(e), n.d(e, "getAdjMatrix", function () { return r; }), n.d(e, "breadthFirstSearch", function () { return l; }), n.d(e, "connectedComponent", function () { return d; }), n.d(e, "getDegree", function () { return g; }), n.d(e, "getInDegree", function () { return v; }), n.d(e, "getOutDegree", function () { return y; }), n.d(e, "detectCycle", function () { return w; }), n.d(e, "detectDirectedCycle", function () { return mt; }), n.d(e, "detectAllCycles", function () { return S; }), n.d(e, "detectAllDirectedCycle", function () { return x; }), n.d(e, "detectAllUndirectedCycle", function () { return b; }), n.d(e, "depthFirstSearch", function () { return m; }), n.d(e, "dijkstra", function () { return k; }), n.d(e, "findAllPath", function () { return P; }), n.d(e, "findShortestPath", function () { return E; }), n.d(e, "floydWarshall", function () { return A; }), n.d(e, "labelPropagation", function () { return I; }), n.d(e, "louvain", function () { return F; }), n.d(e, "iLouvain", function () { return Y; }), n.d(e, "kCore", function () { return X; }), n.d(e, "kMeans", function () { return W; }), n.d(e, "cosineSimilarity", function () { return q; }), n.d(e, "nodesCosineSimilarity", function () { return V; }), n.d(e, "minimumSpanningTree", function () { return $; }), n.d(e, "pageRank", function () { return Q; }), n.d(e, "getNeighbors", function () { return c; }), n.d(e, "Stack", function () { return yt; }), n.d(e, "GADDI", function () { return vt; }); var r = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (!a && 0 !== a) || (!s && 0 !== s) || ((i[a][s] = 1), e || (i[s][a] = 1)); }), i ); }, i = function (t, e) { return t === e; }, o = (function () { function t(t, e) { void 0 === e && (e = null), (this.value = t), (this.next = e); } return ( (t.prototype.toString = function (t) { return t ? t(this.value) : "".concat(this.value); }), t ); })(), a = (function () { function t(t) { void 0 === t && (t = i), (this.head = null), (this.tail = null), (this.compare = t); } return ( (t.prototype.prepend = function (t) { var e = new o(t, this.head); return (this.head = e), this.tail || (this.tail = e), this; }), (t.prototype.append = function (t) { var e = new o(t); return this.head ? ((this.tail.next = e), (this.tail = e), this) : ((this.head = e), (this.tail = e), this); }), (t.prototype.delete = function (t) { if (!this.head) return null; for ( var e = null; this.head && this.compare(this.head.value, t); ) (e = this.head), (this.head = this.head.next); var n = this.head; if (null !== n) for (; n.next; ) this.compare(n.next.value, t) ? ((e = n.next), (n.next = n.next.next)) : (n = n.next); return this.compare(this.tail.value, t) && (this.tail = n), e; }), (t.prototype.find = function (t) { var e = t.value, n = void 0 === e ? void 0 : e, r = t.callback, i = void 0 === r ? void 0 : r; if (!this.head) return null; for (var o = this.head; o; ) { if (i && i(o.value)) return o; if (void 0 !== n && this.compare(o.value, n)) return o; o = o.next; } return null; }), (t.prototype.deleteTail = function () { var t = this.tail; if (this.head === this.tail) return (this.head = null), (this.tail = null), t; for (var e = this.head; e.next; ) e.next.next ? (e = e.next) : (e.next = null); return (this.tail = e), t; }), (t.prototype.deleteHead = function () { if (!this.head) return null; var t = this.head; return ( this.head.next ? (this.head = this.head.next) : ((this.head = null), (this.tail = null)), t ); }), (t.prototype.fromArray = function (t) { var e = this; return ( t.forEach(function (t) { return e.append(t); }), this ); }), (t.prototype.toArray = function () { for (var t = [], e = this.head; e; ) t.push(e), (e = e.next); return t; }), (t.prototype.reverse = function () { for (var t = this.head, e = null, n = null; t; ) (n = t.next), (t.next = e), (e = t), (t = n); (this.tail = this.head), (this.head = e); }), (t.prototype.toString = function (t) { return ( void 0 === t && (t = void 0), this.toArray() .map(function (e) { return e.toString(t); }) .toString() ); }), t ); })(), s = (function () { function t() { this.linkedList = new a(); } return ( (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.peek = function () { return this.linkedList.head ? this.linkedList.head.value : null; }), (t.prototype.enqueue = function (t) { this.linkedList.append(t); }), (t.prototype.dequeue = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toString = function (t) { return this.linkedList.toString(t); }), t ); })(), c = function (t, e, n) { void 0 === e && (e = []); var r = e.filter(function (e) { return e.source === t || e.target === t; }); if ("target" === n) { return r .filter(function (e) { return e.source === t; }) .map(function (t) { return t.target; }); } if ("source" === n) { return r .filter(function (e) { return e.target === t; }) .map(function (t) { return t.source; }); } return r.map(function (e) { return e.source === t ? e.target : e.source; }); }, u = function (t, e) { return e.filter(function (e) { return e.source === t || e.target === t; }); }, h = function (t) { void 0 === t && (t = 0); var e = "".concat(Math.random()).split(".")[1].substr(0, 5), n = "".concat(Math.random()).split(".")[1].substr(0, 5); return "".concat(t, "-").concat(e).concat(n); }; var l = function (t, e, n, r) { void 0 === r && (r = !0); var i = (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), o = new s(), a = t.edges, u = void 0 === a ? [] : a; o.enqueue(e); for ( var h = "", l = function () { var t = o.dequeue(); i.enter({ current: t, previous: h }), c(t, u, r ? "target" : void 0).forEach(function (e) { i.allowTraversal({ previous: h, current: t, next: e }) && o.enqueue(e); }), i.leave({ current: t, previous: h }), (h = t); }; !o.isEmpty(); ) l(); }, f = function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = {}, u = {}, h = [], l = 0, f = function t(e) { (s[e.id] = l), (u[e.id] = l), (l += 1), o.push(e), (a[e.id] = !0); for ( var r = c(e.id, i, "target").filter(function (t) { return ( n .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }), f = function (i) { var o = r[i]; if (s[o] || 0 === s[o]) a[o] && (u[e.id] = Math.min(u[e.id], s[o])); else { var c = n.filter(function (t) { return t.id === o; }); c.length > 0 && t(c[0]), (u[e.id] = Math.min(u[e.id], u[o])); } }, d = 0; d < r.length; d++ ) f(d); if (u[e.id] === s[e.id]) { for (var p = []; o.length > 0; ) { var g = o.pop(); if (((a[g.id] = !1), p.push(g), g === e)) break; } p.length > 0 && h.push(p); } }, d = 0, p = n; d < p.length; d++ ) { var g = p[d]; s[g.id] || 0 === s[g.id] || f(g); } return h; }; function d(t, e) { return e ? f(t) : (function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = [], u = function t(e) { s.push(e), (a[e.id] = !0); for ( var r = c(e.id, i), o = function (e) { var i = r[e]; if (!a[i]) { var o = n.filter(function (t) { return t.id === i; }); o.length > 0 && t(o[0]); } }, u = 0; u < r.length; ++u ) o(u); }, h = 0; h < n.length; h++ ) { var l = n[h]; if (!a[l.id]) { u(l); for (var f = []; s.length > 0; ) f.push(s.pop()); o.push(f); } } return o; })(t); } var p = function (t) { var e = {}, n = t.nodes, r = void 0 === n ? [] : n, i = t.edges, o = void 0 === i ? [] : i; return ( r.forEach(function (t) { e[t.id] = { degree: 0, inDegree: 0, outDegree: 0 }; }), o.forEach(function (t) { e[t.source].degree++, e[t.source].outDegree++, e[t.target].degree++, e[t.target].inDegree++; }), e ); }, g = p, v = function (t, e) { return p(t)[e] ? p(t)[e].inDegree : 0; }, y = function (t, e) { return p(t)[e] ? p(t)[e].outDegree : 0; }; function m(t, e, n) { !(function t(e, n, r, i) { i.enter({ current: n, previous: r }); var o = e.edges; c(n, void 0 === o ? [] : o, "target").forEach(function (o) { i.allowTraversal({ previous: r, current: n, next: o }) && t(e, o, n, i); }), i.leave({ current: n, previous: r }); })( t, e, "", (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), ); } var b = function (t, e, n) { var r, i; void 0 === n && (n = !0); for (var o = [], a = 0, s = d(t, !1); a < s.length; a++) { var u = s[a]; if (u.length) for ( var h = u[0], l = h.id, f = [h], p = (((r = {})[l] = h), r), g = (((i = {})[l] = new Set()), i); f.length > 0; ) for ( var v = f.pop(), y = v.id, m = c(y, t.edges), b = function (r) { var i, a = m[r], s = t.nodes.find(function (t) { return t.id === a; }); if (a === y) o.push((((i = {})[a] = v), i)); else if ((a in g)) { if (!g[y].has(s)) { for ( var c = !0, u = [s, v], h = p[y]; g[a].size && !g[a].has(h) && (u.push(h), h !== p[h.id]); ) h = p[h.id]; if ( (u.push(h), e && n ? ((c = !1), u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !0)) : e && !n && u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !1), c) ) { for (var l = {}, d = 1; d < u.length; d += 1) l[u[d - 1].id] = u[d]; u.length && (l[u[u.length - 1].id] = u[0]), o.push(l); } g[a].add(v); } } else (p[a] = v), f.push(s), (g[a] = new Set([v])); }, x = 0; x < m.length; x += 1 ) b(x); } return o; }, x = function (t, e, n) { void 0 === n && (n = !0); for ( var r = [], i = new Set(), o = [], a = [], s = {}, u = {}, h = function t(c, u, h) { var l = !1; if (e && !1 === n && e.indexOf(c.id) > -1) return l; r.push(c), i.add(c); for (var f = h[c.id], d = 0; d < f.length; d += 1) { if ((v = s[f[d]]) === u) { for (var p = {}, g = 1; g < r.length; g += 1) p[r[g - 1].id] = r[g]; r.length && (p[r[r.length - 1].id] = r[0]), a.push(p), (l = !0); } else i.has(v) || (t(v, u, h) && (l = !0)); } if (l) !(function (t) { for (var e = [t]; e.length > 0; ) { var n = e.pop(); i.has(n) && (i.delete(n), o[n.id].forEach(function (t) { e.push(t); }), o[n.id].clear()); } })(c); else for (d = 0; d < f.length; d += 1) { var v = s[f[d]]; o[v.id].has(c) || o[v.id].add(c); } return r.pop(), l; }, l = t.nodes, d = void 0 === l ? [] : l, p = 0; p < d.length; p += 1 ) { var g = d[p], v = g.id; (u[v] = p), (s[p] = g); } if (e && n) { var y = function (t) { var n = e[t]; (u[d[t].id] = u[n]), (u[n] = 0), (s[0] = d.find(function (t) { return t.id === n; })), (s[u[d[t].id]] = d[t]); }; for (p = 0; p < e.length; p++) y(p); } for ( var m = function (r) { for (var i, o, s = 1 / 0, h = 0; h < r.length; h += 1) for (var l = r[h], f = 0; f < l.length; f++) { var d = u[l[f].id]; d < s && ((s = d), (o = h)); } var p = r[o], g = []; for (h = 0; h < p.length; h += 1) { var v = p[h]; g[v.id] = []; for ( var y = 0, m = c(v.id, t.edges, "target").filter(function (t) { return ( p .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }); y < m.length; y++ ) { var b = m[y]; b !== v.id || (!1 === n && e.indexOf(v.id) > -1) ? g[v.id].push(u[b]) : a.push((((i = {})[v.id] = v), i)); } } return { component: p, adjList: g, minIdx: s }; }, b = 0; b < d.length; ) { var x = d.filter(function (t) { return u[t.id] >= b; }), S = f({ nodes: x, edges: t.edges }).filter(function (t) { return t.length > 1; }); if (0 === S.length) break; var w = m(S), O = w.minIdx, M = w.adjList, k = w.component; if (!(k.length > 1)) break; k.forEach(function (t) { o[t.id] = new Set(); }); var j = s[O]; if (e && n && -1 === e.indexOf(j.id)) return a; h(j, j, M), (b = O + 1); } return a; }, S = function (t, e, n, r) { return void 0 === r && (r = !0), e ? x(t, n, r) : b(t, n, r); }, w = function (t) { var e = null, n = t.nodes, r = {}, i = {}, o = {}, a = {}; (void 0 === n ? [] : n).forEach(function (t) { i[t.id] = t; }); for ( var s = { enter: function (t) { var n = t.current, a = t.previous; if (o[n]) { e = {}; for (var s = n, c = a; c !== n; ) (e[s] = c), (s = c), (c = r[c]); e[s] = c; } else (o[n] = n), delete i[n], (r[n] = a); }, leave: function (t) { var e = t.current; (a[e] = e), delete o[e]; }, allowTraversal: function (t) { var n = t.next; return !e && !a[n]; }, }; Object.keys(i).length; ) { m(t, Object.keys(i)[0], s); } return e; }, O = n(1), M = n(0), k = function (t, e, n, r) { var i = t.nodes, o = void 0 === i ? [] : i, a = t.edges, s = void 0 === a ? [] : a, c = [], h = {}, l = {}, f = {}; o.forEach(function (t, n) { var r = t.id; c.push(r), (l[r] = 1 / 0), r === e && (l[r] = 0); }); for ( var d = o.length, p = function (t) { var e = (function (t, e, n) { for (var r, i = 1 / 0, o = 0; o < e.length; o++) { var a = e[o].id; !n[a] && t[a] <= i && ((i = t[a]), (r = e[o])); } return r; })(l, o, h), i = e.id; if (((h[i] = !0), l[i] === 1 / 0)) return "continue"; (n ? (function (t, e) { return e.filter(function (e) { return e.source === t; }); })(i, s) : u(i, s) ).forEach(function (t) { var n = t.target, o = t.source, a = n === i ? o : n, s = r && t[r] ? t[r] : 1; l[a] > l[e.id] + s ? ((l[a] = l[e.id] + s), (f[a] = [e.id])) : l[a] === l[e.id] + s && f[a].push(e.id); }); }, g = 0; g < d; g++ ) p(); f[e] = [e]; var v = {}; for (var y in l) l[y] !== 1 / 0 && j(e, y, f, v); var m = {}; for (var y in v) m[y] = v[y][0]; return { length: l, path: m, allPath: v }; }; function j(t, e, n, r) { if (t === e) return [t]; if (r[e]) return r[e]; for (var i = [], o = 0, a = n[e]; o < a.length; o++) { var s = j(t, a[o], n, r); if (!s) return; for (var c = 0, u = s; c < u.length; c++) { var h = u[c]; Object(M.isArray)(h) ? i.push(Object(O.f)(Object(O.f)([], h, !0), [e], !1)) : i.push([h, e]); } } return (r[e] = i), r[e]; } var C, E = function (t, e, n, r, i) { var o = k(t, e, r, i), a = o.length, s = o.path, c = o.allPath; return { length: a[n], path: s[n], allPath: c[n] }; }, P = function (t, e, n, r) { var i; if (e === n) return [[e]]; var o = t.edges, a = void 0 === o ? [] : o, s = [e], u = (((i = {})[e] = !0), i), h = [], l = [], f = r ? c(e, a, "target") : c(e, a); for (h.push(f); s.length > 0 && h.length > 0; ) { var d = h[h.length - 1]; if (d.length) { var p = d.shift(); if ( (p && (s.push(p), (u[p] = !0), (f = r ? c(p, a, "target") : c(p, a)), h.push( f.filter(function (t) { return !u[t]; }), )), s[s.length - 1] === n) ) { var g = s.map(function (t) { return t; }); l.push(g); v = s.pop(); (u[v] = !1), h.pop(); } } else { var v = s.pop(); (u[v] = !1), h.pop(); } } return l; }, A = function (t, e) { for (var n = r(t, e), i = [], o = n.length, a = 0; a < o; a += 1) { i[a] = []; for (var s = 0; s < o; s += 1) a === s ? (i[a][s] = 0) : 0 !== n[a][s] && n[a][s] ? (i[a][s] = n[a][s]) : (i[a][s] = 1 / 0); } for (var c = 0; c < o; c += 1) for (a = 0; a < o; a += 1) for (s = 0; s < o; s += 1) i[a][s] > i[a][c] + i[c][s] && (i[a][s] = i[a][c] + i[c][s]); return i; }, I = function (t, e, n, i) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e3); var o = t.nodes, a = void 0 === o ? [] : o, s = t.edges, c = void 0 === s ? [] : s, u = {}, l = {}; a.forEach(function (t, e) { var n = h(); (t.clusterId = n), (u[n] = { id: n, nodes: [t] }), (l[t.id] = { node: t, idx: e }); }); var f = r(t, e), d = [], p = {}; f.forEach(function (t, e) { var n = 0, r = a[e].id; (p[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = a[e].id; p[r][i] = t; } }), d.push(n); }); for ( var g = 0, v = function () { var t = !1; if ( (a.forEach(function (e) { var n = {}; Object.keys(p[e.id]).forEach(function (t) { var r = p[e.id][t], i = l[t].node.clusterId; n[i] || (n[i] = 0), (n[i] += r); }); var r = -1 / 0, i = []; if ( (Object.keys(n).forEach(function (t) { r < n[t] ? ((r = n[t]), (i = [t])) : r === n[t] && i.push(t); }), 1 !== i.length || i[0] !== e.clusterId) ) { var o = i.indexOf(e.clusterId); if ((o >= 0 && i.splice(o, 1), i && i.length)) { t = !0; var a = u[e.clusterId], s = a.nodes.indexOf(e); a.nodes.splice(s, 1); var c = Math.floor(Math.random() * i.length), h = u[i[c]]; h.nodes.push(e), (e.clusterId = h.id); } } }), !t) ) return "break"; g++; }; g < i; ) { if ("break" === v()) break; } Object.keys(u).forEach(function (t) { var e = u[t]; (e.nodes && e.nodes.length) || delete u[t]; }); var y = [], m = {}; c.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = l[e].node.clusterId, a = l[r].node.clusterId, s = "".concat(o, "---").concat(a); if (m[s]) (m[s].weight += i), m[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (m[s] = c), y.push(c); } }); var b = []; return ( Object.keys(u).forEach(function (t) { b.push(u[t]); }), { clusters: b, clusterEdges: y } ); }, T = (function () { function t(t) { this.arr = t; } return ( (t.prototype.getArr = function () { return this.arr || []; }), (t.prototype.add = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] + r[o]; return new t(i); } }), (t.prototype.subtract = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] - r[o]; return new t(i); } }), (t.prototype.avg = function (e) { var n = []; if (0 !== e) for (var r in this.arr) n[r] = this.arr[r] / e; return new t(n); }), (t.prototype.negate = function () { var e = []; for (var n in this.arr) e[n] = -this.arr[n]; return new t(e); }), (t.prototype.squareEuclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return r; } }), (t.prototype.euclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return Math.sqrt(r); } console.error("The two vectors are unequal in length."); }), (t.prototype.normalize = function () { var e = [], n = Object(M.clone)(this.arr); n.sort(function (t, e) { return t - e; }); var r = n[n.length - 1], i = n[0]; for (var o in this.arr) e[o] = (this.arr[o] - i) / (r - i); return new t(e); }), (t.prototype.norm2 = function () { var t; if ( !(null === (t = this.arr) || void 0 === t ? void 0 : t.length) ) return 0; var e = 0; for (var n in this.arr) e += Math.pow(this.arr[n], 2); return Math.sqrt(e); }), (t.prototype.dot = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += this.arr[i] * t.arr[i]; return r; } console.error("The two vectors are unequal in length."); }), (t.prototype.equal = function (t) { var e, n = t.arr; if ( (null === (e = this.arr) || void 0 === e ? void 0 : e.length) !== (null == n ? void 0 : n.length) ) return !1; for (var r in this.arr) if (this.arr[r] !== n[r]) return !1; return !0; }), t ); })(), N = function (t, e) { void 0 === e && (e = void 0); var n = []; return ( t.forEach(function (t) { void 0 === e && n.push(t), void 0 !== t[e] && n.push(t[e]); }), n ); }; !(function (t) { t.EuclideanDistance = "euclideanDistance"; })(C || (C = {})); var B = function (t, e, n) { var r = []; (null == e ? void 0 : e.length) ? (r = e) : (t.forEach(function (t) { r = r.concat(Object.keys(t)); }), (r = Object(M.uniq)(r))); var i = {}; return ( r.forEach(function (e) { var r = []; t.forEach(function (t) { void 0 !== t[e] && "" !== t[e] && r.push(t[e]); }), r.length && !(null == n ? void 0 : n.includes(e)) && (i[e] = Object(M.uniq)(r)); }), i ); }, L = function (t, e, n) { var r = B(t, e, n), i = []; if (!Object.keys(r).length) return i; var o = Object.values(r).every(function (t) { return t.every(function (t) { return "number" == typeof t; }); }); return ( t.forEach(function (t, e) { var n = []; Object.keys(r).forEach(function (e) { var i = t[e], a = r[e], s = a.findIndex(function (t) { return i === t; }), c = []; if (o) c.push(i); else for (var u = 0; u < a.length; u++) u === s ? c.push(1) : c.push(0); n = n.concat(c); }), (i[e] = n); }), i ); }, D = function (t, e, n, r) { void 0 === n && (n = C.EuclideanDistance); var i = 0; switch (n) { case C.EuclideanDistance: i = new T(t).euclideanDistance(new T(e)); } return i; }, _ = function (t, e, n, r) { for (var i = e.length, o = 2 * r, a = 0, s = 0; s < i; s++) for (var c = t[s].clusterId, u = 0; u < i; u++) { if (c === t[u].clusterId) a += (e[s][u] || 0) - ((n[s] || 0) * (n[u] || 0)) / o; } return (a *= 1 / o); }, R = function (t, e) { void 0 === t && (t = []); for (var n = t.length, r = new T([]), i = 0; i < n; i++) r = r.add(new T(e[i])); var o = r.avg(n); o.normalize(); var a = 0; for (i = 0; i < n; i++) { a += (c = new T(e[i])).squareEuclideanDistance(o); } var s = []; t.forEach(function () { s.push([]); }); for (i = 0; i < n; i++) { var c = new T(e[i]); t[i].clusterInertial = 0; for (var u = 0; u < n; u++) if (i !== u) { var h = new T(e[u]); (s[i][u] = c.squareEuclideanDistance(h)), (t[i].clusterInertial += s[i][u]); } else s[i][u] = 0; } var l = 0, f = 2 * n * a; for (i = 0; i < n; i++) { var d = t[i].clusterId; for (u = 0; u < n; u++) { var p = t[u].clusterId; if (i !== u && d === p) l += (t[i].clusterInertial * t[u].clusterInertial) / Math.pow(f, 2) - s[i][u] / f; } } return Number(l.toFixed(4)); }, F = function (t, e, n, i, o, a, s, c, u) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e-4), void 0 === o && (o = !1), void 0 === a && (a = void 0), void 0 === s && (s = []), void 0 === c && (c = ["id"]), void 0 === u && (u = 1); var h = t.nodes, l = void 0 === h ? [] : h, f = t.edges, d = void 0 === f ? [] : f, p = []; if (o) { l.forEach(function (t, e) { (t.properties = t.properties || {}), (t.originIndex = e); }); var g = []; l.every(function (t) { return t.hasOwnProperty("nodeType"); }) && ((g = Array.from( new Set( l.map(function (t) { return t.nodeType; }), ), )), l.forEach(function (t) { t.properties.nodeType = g.findIndex(function (e) { return e === t.nodeType; }); })); var v = N(l, a); p = L(v, s, c); } var y = 1, m = {}, b = {}; l.forEach(function (t, e) { var n = String(y++); (t.clusterId = n), (m[n] = { id: n, nodes: [t] }), (b[t.id] = { node: t, idx: e }); }); var x = r(t, e), S = [], w = {}, O = 0; x.forEach(function (t, e) { var n = 0, r = l[e].id; (w[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = l[e].id; (w[r][i] = t), (O += t); } }), S.push(n); }), (O /= 2); for (var k = 1 / 0, j = 1 / 0, C = 0, E = [], P = {}; ; ) { (k = o && l.every(function (t) { return t.hasOwnProperty("properties"); }) ? _(l, x, S, O) + R(l, p) * u : _(l, x, S, O)), 0 === C && ((j = k), (E = l), (P = m)); var A = k > 0 && k > j && k - j < i; if ( (k > j && ((E = l.map(function (t) { return { node: t, clusterId: t.clusterId }; })), (P = Object(M.clone)(m)), (j = k)), A || C > 100) ) break; C++, Object.keys(m).forEach(function (t) { var e = 0; d.forEach(function (r) { var i = r.source, o = r.target, a = b[i].node.clusterId, s = b[o].node.clusterId; ((a === t && s !== t) || (s === t && a !== t)) && (e += r[n] || 1); }), (m[t].sumTot = e); }), l.forEach(function (t, e) { var r, i = m[t.clusterId], a = 0, s = S[e] / (2 * O), c = 0, h = i.nodes; h.forEach(function (t) { var n = b[t.id].idx; c += x[e][n] || 0; }); var l = c - i.sumTot * s, f = h.filter(function (e) { return e.id !== t.id; }), g = []; f.forEach(function (t, e) { g[e] = p[t.originIndex]; }); var v = R(f, p) * u, y = w[t.id]; if ( (Object.keys(y).forEach(function (n) { var i = b[n].node.clusterId; if (i !== t.clusterId) { var c = m[i], h = c.nodes; if (h && h.length) { var f = 0; h.forEach(function (t) { var n = b[t.id].idx; f += x[e][n] || 0; }); var d = f - c.sumTot * s, g = h.concat([t]), y = []; g.forEach(function (t, e) { y[e] = p[t.originIndex]; }); var S = R(g, p) * u, w = d - l; o && (w = d + S - (l + v)), w > a && ((a = w), (r = c)); } } }), a > 0) ) { r.nodes.push(t); var M = t.clusterId; t.clusterId = r.id; var k = i.nodes.indexOf(t); i.nodes.splice(k, 1); var j = 0, C = 0; d.forEach(function (t) { var e = t.source, i = t.target, o = b[e].node.clusterId, a = b[i].node.clusterId; ((o === r.id && a !== r.id) || (a === r.id && o !== r.id)) && (j += t[n] || 1), ((o === M && a !== M) || (a === M && o !== M)) && (C += t[n] || 1); }), (r.sumTot = j), (i.sumTot = C); } }); } var I = {}, T = 0; Object.keys(P).forEach(function (t) { var e = P[t]; if (e.nodes && e.nodes.length) { var n = String(T + 1); n !== t && ((e.id = n), (e.nodes = e.nodes.map(function (t) { return { id: t.id, clusterId: n }; })), (P[n] = e), (I[t] = n), delete P[t], T++); } else delete P[t]; }), E.forEach(function (t) { var e = t.node, n = t.clusterId; e && ((e.clusterId = n), e.clusterId && I[e.clusterId] && (e.clusterId = I[e.clusterId])); }); var B = [], D = {}; d.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = b[e].node.clusterId, a = b[r].node.clusterId; if (o && a) { var s = "".concat(o, "---").concat(a); if (D[s]) (D[s].weight += i), D[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (D[s] = c), B.push(c); } } }); var F = []; return ( Object.keys(P).forEach(function (t) { F.push(P[t]); }), { clusters: F, clusterEdges: B } ); }, Y = function (t, e, n, r, i, o, a, s) { return ( void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === r && (r = 1e-4), void 0 === i && (i = void 0), void 0 === o && (o = []), void 0 === a && (a = ["id"]), void 0 === s && (s = 1), F(t, e, n, r, !0, i, o, a, s) ); }, X = function (t, e) { var n; void 0 === e && (e = 1); for ( var r = Object(M.clone)(t), i = r.nodes, o = void 0 === i ? [] : i, a = r.edges, s = void 0 === a ? [] : a, c = function () { var t = g({ nodes: o, edges: s }), r = Object.keys(t); r.sort(function (e, n) { var r, i; return ( (null === (r = t[e]) || void 0 === r ? void 0 : r.degree) - (null === (i = t[n]) || void 0 === i ? void 0 : i.degree) ); }); var i = r[0]; if ( !o.length || (null === (n = t[i]) || void 0 === n ? void 0 : n.degree) >= e ) return "break"; var a = o.findIndex(function (t) { return t.id === i; }); o.splice(a, 1), (s = s.filter(function (t) { return !(t.source === i || t.target === i); })); }; ; ) { if ("break" === c()) break; } return { nodes: o, edges: s }; }, z = function (t, e, n) { var r = []; switch (t) { case C.EuclideanDistance: r = e[n]; break; default: r = []; } return r; }, W = function (t, e, n, r, i, o) { void 0 === e && (e = 3), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = ["id"]), void 0 === o && (o = C.EuclideanDistance); var a = t.nodes, s = void 0 === a ? [] : a, c = t.edges, u = void 0 === c ? [] : c, h = { clusters: [{ id: "0", nodes: s }], clusterEdges: [] }; if ( o === C.EuclideanDistance && !s.every(function (t) { return t.hasOwnProperty(n); }) ) return h; var l = [], f = []; if ( (o === C.EuclideanDistance && ((l = N(s, n)), (f = L(l, r, i))), !f.length) ) return h; for ( var d = Object(M.uniq)( f.map(function (t) { return t.join(""); }), ), p = Math.min(e, s.length, d.length), g = 0; g < s.length; g++ ) s[g].originIndex = g; var v = [], y = [], m = []; for (g = 0; g < p; g++) if (0 === g) { var b = Math.floor(Math.random() * s.length); switch (o) { case C.EuclideanDistance: v[g] = f[b]; break; default: v[g] = []; } y.push(b), (m[g] = [s[b]]), (s[b].clusterId = String(g)); } else { for ( var x = -1 / 0, S = 0, w = function (t) { if (!y.includes(t)) { for (var e = 0, n = 0; n < v.length; n++) { var r = 0; switch (o) { case C.EuclideanDistance: r = D(f[s[t].originIndex], v[n], o); } e += r; } var i = e / v.length; i > x && !v.find(function (e) { return Object(M.isEqual)( e, z(o, f, s[t].originIndex), ); }) && ((x = i), (S = t)); } }, O = 0; O < s.length; O++ ) w(O); (v[g] = z(o, f, S)), y.push(S), (m[g] = [s[S]]), (s[S].clusterId = String(g)); } for (var k = 0; ; ) { for (g = 0; g < s.length; g++) { var j = 0, E = 1 / 0; if (0 !== k || !y.includes(g)) { for (var P = 0; P < v.length; P++) { var A = 0; switch (o) { case C.EuclideanDistance: A = D(f[g], v[P], o); } A < E && ((E = A), (j = P)); } if (void 0 !== s[g].clusterId) for ( var I = m[Number(s[g].clusterId)].length - 1; I >= 0; I-- ) m[Number(s[g].clusterId)][I].id === s[g].id && m[Number(s[g].clusterId)].splice(I, 1); (s[g].clusterId = String(j)), m[j].push(s[g]); } } var B = !1; for (g = 0; g < m.length; g++) { var _ = m[g], R = new T([]); for (P = 0; P < _.length; P++) R = R.add(new T(f[_[P].originIndex])); var F = R.avg(_.length); F.equal(new T(v[g])) || ((B = !0), (v[g] = F.getArr())); } if ( (k++, (s.every(function (t) { return void 0 !== t.clusterId; }) && B) || k >= 1e3) ) break; } var Y = [], X = {}; return ( u.forEach(function (t) { var e, n, r = t.source, i = t.target, o = null === (e = s.find(function (t) { return t.id === r; })) || void 0 === e ? void 0 : e.clusterId, a = null === (n = s.find(function (t) { return t.id === i; })) || void 0 === n ? void 0 : n.clusterId, c = "".concat(o, "---").concat(a); if (X[c]) X[c].count++; else { var u = { source: o, target: a, count: 1 }; (X[c] = u), Y.push(u); } }), { clusters: m, clusterEdges: Y } ); }, q = function (t, e) { var n = new T(e), r = n.norm2(), i = new T(t), o = i.norm2(), a = n.dot(i), s = r * o, c = s ? a / s : 0; return c; }, V = function (t, e, n, r, i) { void 0 === t && (t = []), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = []); var o = Object(M.clone)( t.filter(function (t) { return t.id !== e.id; }), ), a = t.findIndex(function (t) { return t.id === e.id; }), s = N(t, n), c = L(s, r, i), u = c[a], h = []; return ( o.forEach(function (t, n) { if (t.id !== e.id) { var r = c[n], i = q(r, u); h.push(i), (t.cosineSimilarity = i); } }), o.sort(function (t, e) { return e.cosineSimilarity - t.cosineSimilarity; }), { allCosineSimilarity: h, similarNodes: o } ); }, G = (function () { function t(t) { (this.count = t.length), (this.parent = {}); for (var e = 0, n = t; e < n.length; e++) { var r = n[e]; this.parent[r] = r; } } return ( (t.prototype.find = function (t) { for (; this.parent[t] !== t; ) t = this.parent[t]; return t; }), (t.prototype.union = function (t, e) { var n = this.find(t), r = this.find(e); n !== r && (n < r ? (this.parent[e] !== e && this.union(this.parent[e], t), (this.parent[e] = this.parent[t])) : (this.parent[t] !== t && this.union(this.parent[t], e), (this.parent[t] = this.parent[e]))); }), (t.prototype.connected = function (t, e) { return this.find(t) === this.find(e); }), t ); })(), H = function (t, e) { return t - e; }, U = (function () { function t(t) { void 0 === t && (t = H), (this.compareFn = t), (this.list = []); } return ( (t.prototype.getLeft = function (t) { return 2 * t + 1; }), (t.prototype.getRight = function (t) { return 2 * t + 2; }), (t.prototype.getParent = function (t) { return 0 === t ? null : Math.floor((t - 1) / 2); }), (t.prototype.isEmpty = function () { return this.list.length <= 0; }), (t.prototype.top = function () { return this.isEmpty() ? void 0 : this.list[0]; }), (t.prototype.delMin = function () { var t = this.top(), e = this.list.pop(); return ( this.list.length > 0 && ((this.list[0] = e), this.moveDown(0)), t ); }), (t.prototype.insert = function (t) { if (null !== t) { this.list.push(t); var e = this.list.length - 1; return this.moveUp(e), !0; } return !1; }), (t.prototype.moveUp = function (t) { for ( var e = this.getParent(t); t && t > 0 && this.compareFn(this.list[e], this.list[t]) > 0; ) { var n = this.list[e]; (this.list[e] = this.list[t]), (this.list[t] = n), (t = e), (e = this.getParent(t)); } }), (t.prototype.moveDown = function (t) { var e, n = t, r = this.getLeft(t), i = this.getRight(t), o = this.list.length; null !== r && r < o && this.compareFn(this.list[n], this.list[r]) > 0 ? (n = r) : null !== i && i < o && this.compareFn(this.list[n], this.list[i]) > 0 && (n = i), t !== n && ((e = [this.list[n], this.list[t]]), (this.list[t] = e[0]), (this.list[n] = e[1]), this.moveDown(n)); }), t ); })(), Z = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = i[0], c = new Set(); c.add(s); var h = new U(function (t, n) { return e ? t.weight - n.weight : 0; }); for ( u(s.id, a).forEach(function (t) { h.insert(t); }); !h.isEmpty(); ) { var l = h.delMin(), f = l.source, d = l.target; (c.has(f) && c.has(d)) || (n.push(l), c.has(f) || (c.add(f), u(f, a).forEach(function (t) { h.insert(t); })), c.has(d) || (c.add(d), u(d, a).forEach(function (t) { h.insert(t); }))); } return n; }, K = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = a.map(function (t) { return t; }); e && s.sort(function (t, e) { return t.weight - e.weight; }); for ( var c = new G( i.map(function (t) { return t.id; }), ); s.length > 0; ) { var u = s.shift(), h = u.source, l = u.target; c.connected(h, l) || (n.push(u), c.union(h, l)); } return n; }, $ = function (t, e, n) { return n ? { prim: Z, kruskal: K }[n](t, e) : K(t, e); }, Q = function (t, e, n) { "number" != typeof e && (e = 1e-6), "number" != typeof n && (n = 0.85); for ( var r, i = 1, o = 0, a = 1e3, s = t.nodes, u = void 0 === s ? [] : s, h = t.edges, l = void 0 === h ? [] : h, f = u.length, d = {}, p = {}, v = 0; v < f; ++v ) { (d[(m = (O = u[v]).id)] = 1 / f), (p[m] = 1 / f); } for (var y = g(t); a > 0 && i > e; ) { o = 0; for (v = 0; v < f; ++v) { var m = (O = u[v]).id; if (((r = 0), 0 === y[O.id].inDegree)) d[m] = 0; else { for (var b = c(m, l, "source"), x = 0; x < b.length; ++x) { var S = b[x], w = y[S].outDegree; w > 0 && (r += p[S] / w); } (d[m] = n * r), (o += d[m]); } } (o = (1 - o) / f), (i = 0); for (v = 0; v < f; ++v) { var O; (r = d[(m = (O = u[v]).id)] + o), (i += Math.abs(r - p[m])), (p[m] = r); } a -= 1; } return p; }, J = function (t, e, n, r) { void 0 === t && (t = -1), void 0 === e && (e = -1), void 0 === n && (n = -1), void 0 === r && (r = "-1"), (this.id = t), (this.from = e), (this.to = n), (this.label = r); }, tt = (function () { function t(t, e) { void 0 === t && (t = -1), void 0 === e && (e = "-1"), (this.id = t), (this.label = e), (this.edges = []), (this.edgeMap = {}); } return ( (t.prototype.addEdge = function (t) { this.edges.push(t), (this.edgeMap[t.id] = t); }), t ); })(), et = (function () { function t(t, e, n) { void 0 === t && (t = -1), void 0 === e && (e = !0), void 0 === n && (n = !1), (this.id = t), (this.edgeIdAutoIncrease = e), (this.edges = []), (this.nodes = []), (this.nodeMap = {}), (this.edgeMap = {}), (this.nodeLabelMap = {}), (this.edgeLabelMap = {}), (this.counter = 0), (this.directed = n); } return ( (t.prototype.getNodeNum = function () { return this.nodes.length; }), (t.prototype.addNode = function (t, e) { if (!this.nodeMap[t]) { var n = new tt(t, e); this.nodes.push(n), (this.nodeMap[t] = n), this.nodeLabelMap[e] || (this.nodeLabelMap[e] = []), this.nodeLabelMap[e].push(t); } }), (t.prototype.addEdge = function (t, e, n, r) { if ( ((this.edgeIdAutoIncrease || void 0 === t) && (t = this.counter++), !( this.nodeMap[e] && this.nodeMap[n] && this.nodeMap[n].edgeMap[t] )) ) { var i = new J(t, e, n, r); if ( (this.edges.push(i), (this.edgeMap[t] = i), this.nodeMap[e].addEdge(i), this.edgeLabelMap[r] || (this.edgeLabelMap[r] = []), this.edgeLabelMap[r].push(i), !this.directed) ) { var o = new J(t, n, e, r); this.nodeMap[n].addEdge(o), this.edgeLabelMap[r].push(o); } } }), t ); })(), nt = (function () { function t(t, e, n, r, i) { (this.fromNode = t), (this.toNode = e), (this.nodeEdgeNodeLabel = { nodeLabel1: n || "-1", edgeLabel: r || "-1", nodeLabel2: i || "-1", }); } return ( (t.prototype.equalTo = function (t) { return ( this.fromNode === t.formNode && this.toNode === t.toNode && this.nodeEdgeNodeLabel === t.nodeEdgeNodeLabel ); }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), t ); })(), rt = (function () { function t() { (this.rmpath = []), (this.dfsEdgeList = []); } return ( (t.prototype.equalTo = function (t) { var e = this.dfsEdgeList.length; if (e !== t.length) return !1; for (var n = 0; n < e; n++) if (this.dfsEdgeList[n] !== t[n]) return !1; return !0; }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), (t.prototype.pushBack = function (t, e, n, r, i) { return ( this.dfsEdgeList.push(new nt(t, e, n, r, i)), this.dfsEdgeList ); }), (t.prototype.toGraph = function (t, e) { void 0 === t && (t = -1), void 0 === e && (e = !1); var n = new et(t, !0, e); return ( this.dfsEdgeList.forEach(function (t) { var e = t.fromNode, r = t.toNode, i = t.nodeEdgeNodeLabel, o = i.nodeLabel1, a = i.edgeLabel, s = i.nodeLabel2; "-1" !== o && n.addNode(e, o), "-1" !== s && n.addNode(r, s), "-1" !== o && s !== o && n.addEdge(void 0, e, r, a); }), n ); }), (t.prototype.buildRmpath = function () { this.rmpath = []; for ( var t = void 0, e = this.dfsEdgeList.length - 1; e >= 0; e-- ) { var n = this.dfsEdgeList[e], r = n.fromNode, i = n.toNode; r < i && (void 0 === t || i === t) && (this.rmpath.push(e), (t = r)); } return this.rmpath; }), (t.prototype.getNodeNum = function () { var t = {}; return ( this.dfsEdgeList.forEach(function (e) { t[e.fromNode] || (t[e.fromNode] = !0), t[e.toNode] || (t[e.toNode] = !0); }), Object.keys(t).length ); }), t ); })(), it = (function () { function t(t) { if ( ((this.his = {}), (this.nodesUsed = {}), (this.edgesUsed = {}), (this.edges = []), t) ) { for (; t; ) { var e = t.edge; this.edges.push(e), (this.nodesUsed[e.from] = 1), (this.nodesUsed[e.to] = 1), (this.edgesUsed[e.id] = 1), (t = t.preNode); } this.edges = this.edges.reverse(); } } return ( (t.prototype.hasNode = function (t) { return 1 === this.nodesUsed[t.id]; }), (t.prototype.hasEdge = function (t) { return 1 === this.edgesUsed[t.id]; }), t ); })(), ot = (function () { function t(t) { var e = t.graphs, n = t.minSupport, r = void 0 === n ? 2 : n, i = t.minNodeNum, o = void 0 === i ? 1 : i, a = t.maxNodeNum, s = void 0 === a ? 4 : a, c = t.top, u = void 0 === c ? 10 : c, h = t.directed, l = void 0 !== h && h, f = t.verbose, d = void 0 !== f && f; (this.graphs = e), (this.dfsCode = new rt()), (this.support = 0), (this.frequentSize1Subgraphs = []), (this.frequentSubgraphs = []), (this.minSupport = r), (this.top = u), (this.directed = l), (this.counter = 0), (this.maxNodeNum = s), (this.minNodeNum = o), (this.verbose = d), this.maxNodeNum < this.minNodeNum && (this.maxNodeNum = this.minNodeNum), (this.reportDF = []); } return ( (t.prototype.findForwardRootEdges = function (t, e) { var n = this, r = [], i = t.nodeMap; return ( e.edges.forEach(function (t) { (n.directed || e.label <= i[t.to].label) && r.push(t); }), r ); }), (t.prototype.findBackwardEdge = function (t, e, n, r) { if (!this.directed && e === n) return null; for ( var i = t.nodeMap, o = i[n.to].edges, a = o.length, s = 0; s < a; s++ ) { var c = o[s]; if (!r.hasEdge(c) && c.to === e.from) if (this.directed) { if ( i[e.from].label < i[n.to].label || (i[e.from].label === i[n.to].label && e.label <= c.label) ) return c; } else if ( e.label < c.label || (e.label === c.label && i[e.to].label <= i[n.to].label) ) return c; } return null; }), (t.prototype.findForwardPureEdges = function (t, e, n, r) { for ( var i = [], o = e.to, a = t.nodeMap[o].edges, s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = t.nodeMap[u.to]; n <= h.label && !r.hasNode(h) && i.push(u); } return i; }), (t.prototype.findForwardRmpathEdges = function (t, e, n, r) { for ( var i = [], o = t.nodeMap, a = o[e.to].label, s = o[e.from].edges, c = s.length, u = 0; u < c; u++ ) { var h = s[u], l = o[h.to].label; e.to === h.to || n > l || r.hasNode(o[h.to]) || ((e.label < h.label || (e.label === h.label && a <= l)) && i.push(h)); } return i; }), (t.prototype.getSupport = function (t) { var e = {}; return ( t.forEach(function (t) { e[t.graphId] || (e[t.graphId] = !0); }), Object.keys(e).length ); }), (t.prototype.findMinLabel = function (t) { var e = void 0; return ( Object.keys(t).forEach(function (n) { var r = t[n], i = r.nodeLabel1, o = r.edgeLabel, a = r.nodeLabel2; e ? (i < e.nodeLabel1 || (i === e.nodeLabel1 && o < e.edgeLabel) || (i === e.nodeLabel1 && o === e.edgeLabel && a < e.nodeLabel2)) && (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }) : (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }); }), e ); }), (t.prototype.isMin = function () { var t = this, e = this.dfsCode; if ( (this.verbose && console.log("isMin checking", e), 1 === e.dfsEdgeList.length) ) return !0; var n = this.directed, r = e.toGraph(-1, n), i = r.nodeMap, o = new rt(), a = {}; r.nodes.forEach(function (e) { t.findForwardRootEdges(r, e).forEach(function (t) { var n = i[t.to], o = "" .concat(e.label, "-") .concat(t.label, "-") .concat(n.label); a[o] || (a[o] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: n.label, }); var s = { graphId: r.id, edge: t, preNode: null }; a[o].projected.push(s); }); }); var s = this.findMinLabel(a); if (s) { o.dfsEdgeList.push( new nt(0, 1, s.nodeLabel1, s.edgeLabel, s.nodeLabel2), ); var c = "" .concat(s.nodeLabel1, "-") .concat(s.edgeLabel, "-") .concat(s.nodeLabel2); return (function a(s) { for ( var c = o.buildRmpath(), u = o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, h = o.dfsEdgeList[c[0]].toNode, l = {}, f = !1, d = 0, p = n ? -1 : 0, g = function (e) { if (f) return "break"; s.forEach(function (n) { var i = new it(n), a = t.findBackwardEdge( r, i.edges[c[e]], i.edges[c[0]], i, ); a && (l[a.label] || (l[a.label] = { projected: [], edgeLabel: a.label, }), l[a.label].projected.push({ graphId: r.id, edge: l, preNode: n, }), (d = o.dfsEdgeList[c[e]].fromNode), (f = !0)); }); }, v = c.length - 1; v > p; v-- ) { if ("break" === g(v)) break; } if (f) { var y = t.findMinLabel(l); o.dfsEdgeList.push(new nt(h, d, "-1", y.edgeLabel, "-1")); var m = o.dfsEdgeList.length - 1; return ( t.dfsCode.dfsEdgeList[m] === o.dfsEdgeList[m] && a(l[y.edgeLabel].projected) ); } var b = {}; f = !1; var x = 0; s.forEach(function (e) { var n = new it(e), o = t.findForwardPureEdges(r, n.edges[c[0]], u, n); o.length > 0 && ((f = !0), (x = h), o.forEach(function (t) { var n = "".concat(t.label, "-").concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); var S = c.length, w = function (e) { if (f) return "break"; var n = c[e]; s.forEach(function (e) { var a = new it(e), s = t.findForwardRmpathEdges(r, a.edges[n], u, a); s.length > 0 && ((f = !0), (x = o.dfsEdgeList[n].fromNode), s.forEach(function (t) { var n = "" .concat(t.label, "-") .concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); }; for (v = 0; v < S; v++) { if ("break" === w(v)) break; } if (!f) return !0; var O = t.findMinLabel(b); o.dfsEdgeList.push( new nt(x, h + 1, "-1", O.edgeLabel, O.nodeLabel2), ); var M = o.dfsEdgeList.length - 1; return ( e.dfsEdgeList[M] === o.dfsEdgeList[M] && a( b["".concat(O.edgeLabel, "-").concat(O.nodeLabel2)] .projected, ) ); })(a[c].projected); } }), (t.prototype.report = function () { if (!(this.dfsCode.getNodeNum() < this.minNodeNum)) { this.counter++; var t = this.dfsCode.toGraph(this.counter, this.directed); this.frequentSubgraphs.push(Object(M.clone)(t)); } }), (t.prototype.subGraphMining = function (t) { var e = this; if (!(this.getSupport(t) < this.minSupport) && this.isMin()) { this.report(); var n = this.dfsCode.getNodeNum(), r = this.dfsCode.buildRmpath(), i = this.dfsCode.dfsEdgeList[r[0]].toNode, o = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, a = {}, s = {}; t.forEach(function (t) { for ( var c = e.graphs[t.graphId], u = c.nodeMap, h = new it(t), l = r.length - 1; l >= 0; l-- ) { var f = e.findBackwardEdge( c, h.edges[r[l]], h.edges[r[0]], h, ); if (f) { var d = "" .concat(e.dfsCode.dfsEdgeList[r[l]].fromNode, "-") .concat(f.label); s[d] || (s[d] = { projected: [], toNodeId: e.dfsCode.dfsEdgeList[r[l]].fromNode, edgeLabel: f.label, }), s[d].projected.push({ graphId: t.graphId, edge: f, preNode: t, }); } } if (!(n >= e.maxNodeNum)) { e.findForwardPureEdges(c, h.edges[r[0]], o, h).forEach( function (e) { var n = "" .concat(i, "-") .concat(e.label, "-") .concat(u[e.to].label); a[n] || (a[n] = { projected: [], fromNodeId: i, edgeLabel: e.label, nodeLabel2: u[e.to].label, }), a[n].projected.push({ graphId: t.graphId, edge: e, preNode: t, }); }, ); var p = function (n) { e.findForwardRmpathEdges(c, h.edges[r[n]], o, h).forEach( function (i) { var o = "" .concat(e.dfsCode.dfsEdgeList[r[n]].fromNode, "-") .concat(i.label, "-") .concat(u[i.to].label); a[o] || (a[o] = { projected: [], fromNodeId: e.dfsCode.dfsEdgeList[r[n]].fromNode, edgeLabel: i.label, nodeLabel2: u[i.to].label, }), a[o].projected.push({ graphId: t.graphId, edge: i, preNode: t, }); }, ); }; for (l = 0; l < r.length; l++) p(l); } }), Object.keys(s).forEach(function (t) { var n = s[t], r = n.toNodeId, o = n.edgeLabel; e.dfsCode.dfsEdgeList.push(new nt(i, r, "-1", o, "-1")), e.subGraphMining(s[t].projected), e.dfsCode.dfsEdgeList.pop(); }), Object.keys(a).forEach(function (t) { var n = a[t], r = n.fromNodeId, o = n.edgeLabel, s = n.nodeLabel2; e.dfsCode.dfsEdgeList.push(new nt(r, i + 1, "-1", o, s)), e.subGraphMining(a[t].projected), e.dfsCode.dfsEdgeList.pop(); }); } }), (t.prototype.generate1EdgeFrequentSubGraphs = function () { var t = this.graphs, e = this.directed, n = this.minSupport, r = this.frequentSize1Subgraphs, i = {}, o = {}, a = {}, s = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n], c = r.nodeMap; r.nodes.forEach(function (t, r) { var u = t.label, h = "".concat(n, "-").concat(u); if (!a[h]) { var l = i[u] || 0; l++, (i[u] = l); } (a[h] = { graphKey: n, label: u }), t.edges.forEach(function (t) { var r = u, i = c[t.to].label; if (!e && r > i) { var a = i; (i = r), (r = a); } var h = t.label, l = "" .concat(n, "-") .concat(r, "-") .concat(h, "-") .concat(i), f = "".concat(r, "-").concat(h, "-").concat(i); if (!o[f]) { var d = o[f] || 0; d++, (o[f] = d); } s[l] = { graphId: n, nodeLabel1: r, edgeLabel: h, nodeLabel2: i, }; }); }); }), Object.keys(i).forEach(function (t) { if (!(i[t] < n)) { var e = { nodes: [], edges: [] }; e.nodes.push({ id: "0", label: t }), r.push(e); } }), r ); }), (t.prototype.run = function () { var t = this; if ( ((this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs()), !(this.maxNodeNum < 2)) ) { var e = this.graphs, n = (this.directed, {}); Object.keys(e).forEach(function (r) { var i = e[r], o = i.nodeMap; i.nodes.forEach(function (e) { t.findForwardRootEdges(i, e).forEach(function (t) { var i = o[t.to], a = "" .concat(e.label, "-") .concat(t.label, "-") .concat(i.label); n[a] || (n[a] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: i.label, }); var s = { graphId: r, edge: t, preNode: null }; n[a].projected.push(s); }); }); }), Object.keys(n).forEach(function (e) { var r = n[e], i = r.projected, o = r.nodeLabel1, a = r.edgeLabel, s = r.nodeLabel2; t.dfsCode.dfsEdgeList.push(new nt(0, 1, o, a, s)), t.subGraphMining(i), t.dfsCode.dfsEdgeList.pop(); }); } }), t ); })(), at = function (t) { var e = t.graphs, n = t.directed, r = void 0 !== n && n, i = t.nodeLabelProp, o = void 0 === i ? "cluster" : i, a = t.edgeLabelProp, s = void 0 === a ? "cluster" : a, c = (function (t, e, n, r) { var i = {}; return ( Object.keys(t).forEach(function (o, a) { var s = t[o], c = new et(a, !0, e), u = {}; s.nodes.forEach(function (t, e) { c.addNode(e, t[n]), (u[t.id] = e); }), s.edges.forEach(function (t, e) { var n = u[t.source], i = u[t.target]; c.addEdge(-1, n, i, t[r]); }), c && c.getNodeNum() && (i[c.id] = c); }), i ); })(e, r, o, s), u = t.minSupport, h = t.maxNodeNum, l = t.minNodeNum, f = t.verbose, d = t.top, p = new ot({ graphs: c, minSupport: u, maxNodeNum: h, minNodeNum: l, top: d, verbose: f, directed: r, }); return ( p.run(), (function (t, e, n) { var r = []; return ( t.forEach(function (t) { var i = { nodes: [], edges: [] }; t.nodes.forEach(function (t) { var n; i.nodes.push( (((n = { id: "".concat(t.id) })[e] = t.label), n), ); }), t.edges.forEach(function (t) { var e; i.edges.push( (((e = { source: "".concat(t.from), target: "".concat(t.to), })[n] = t.label), e), ); }), r.push(i); }), r ); })(p.frequentSubgraphs, o, s) ); }, st = function (t, e, n, r) { void 0 === n && (n = "cluster"), void 0 === r && (r = 2); var i = [], o = t.nodes; return ( e.forEach(function (t, e) { i.push(ct(o, t, e, n, r)); }), i ); }, ct = function (t, e, n, r, i) { var o = [n], a = [], s = {}; return ( e.forEach(function (e, c) { if (e <= i && n !== c) { o.push(c), a.push(t[c]); var u = t[c][r]; s[u] ? (s[u].count++, s[u].dists.push(e)) : (s[u] = { count: 1, dists: [e] }); } }), Object.keys(s).forEach(function (t) { s[t].dists = s[t].dists.sort(function (t, e) { return t - e; }); }), { nodeIdx: n, nodeId: t[n].id, nodeIdxs: o, neighbors: a, neighborNum: o.length - 1, nodeLabelCountMap: s, } ); }, ut = function (t, e, n, r) { var i = n.nodes; return ( r || (r = {}), Object.keys(t).forEach(function (o) { var a, s; if (!r || !r[o]) { r[o] = { nodes: [], edges: [] }; var c = t[o], u = null === (a = e[c.start]) || void 0 === a ? void 0 : a.nodeIdxs, h = null === (s = e[c.end]) || void 0 === s ? void 0 : s.nodeIdxs; if (u && h) { var l = new Set(h), f = u.filter(function (t) { return l.has(t); }); if (f && f.length) { for (var d = {}, p = f.length, g = 0; g < p; g++) { var v = i[f[g]]; r[o].nodes.push(v), (d[v.id] = !0); } n.edges.forEach(function (t) { d[t.source] && d[t.target] && r[o].edges.push(t); }); } } } }), r ); }, ht = function (t, e, n, r) { var i, o, a = {}; t.nodes.forEach(function (t) { a[t.id] = t; }); var s = 0; return !(null === (i = null == e ? void 0 : e.edges) || void 0 === i ? void 0 : i.length) || (null === (o = null == e ? void 0 : e.nodes) || void 0 === o ? void 0 : o.length) < 2 ? 0 : (t.edges.forEach(function (t) { var i = a[t.source][n], o = a[t.target][n], c = null == e ? void 0 : e.nodes[0][n], u = null == e ? void 0 : e.nodes[1][n], h = null == e ? void 0 : e.edges[0][r]; t[r] === h && ((i === c && o === u) || (i === u && o === c)) && s++; }), s); }, lt = function (t, e) { var n = {}, r = {}; return ( t.forEach(function (t, i) { n[t.id] = { idx: i, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var o = t[e]; r[o] || (r[o] = []), r[o].push(t); }), { nodeMap: n, nodeLabelMap: r } ); }, ft = function (t, e, n) { var r = {}, i = {}; return ( t.forEach(function (t, o) { r["".concat(h)] = { idx: o, edge: t }; var a = t[e]; i[a] || (i[a] = []), i[a].push(t); var s = n[t.source]; s && (s.degree++, s.outDegree++); var c = n[t.target]; c && (c.degree++, c.inDegree++); }), { edgeMap: r, edgeLabelMap: i } ); }, dt = function (t, e, n) { var r = e.length, i = {}; return ( e.forEach(function (e, o) { for (var a = n ? 0 : o + 1, s = t[o].id, c = a; c < r; c++) if (o !== c) { var u = t[c].id, h = e[c]; (i["".concat(s, "-").concat(u)] = h), n || (i["".concat(u, "-").concat(s)] = h); } }), i ); }, pt = function (t, e, n, r, i, o, a, s, c, u, h) { var l, f = "".concat(e.id, "-").concat(n.id); if (u && u[f]) return u[f]; var d = h ? h[f] : void 0; if (!d) { var p = (((l = {})[f] = { start: r[e.id].idx, end: r[n.id].idx, distance: i, }), l); d = (h = ut(p, o, t, h))[f]; } return ht(d, a, s, c); }, gt = function (t, e, n, r) { var i, o, a, s = null === (i = t[e]) || void 0 === i ? void 0 : i.degree, c = null === (o = t[e]) || void 0 === o ? void 0 : o.inDegree, u = null === (a = t[e]) || void 0 === a ? void 0 : a.outDegree; return ( void 0 === t[e] && ((s = 1 / 0), (c = 1 / 0), (u = 1 / 0), r[e].forEach(function (t) { var e = n[t.id].degree; s > e && (s = e); var r = n[t.id].inDegree; c > r && (c = r); var i = n[t.id].outDegree; u > i && (u = i); }), (t[e] = { degree: s, inDegree: c, outDegree: u })), { minPatternNodeLabelDegree: s, minPatternNodeLabelInDegree: c, minPatternNodeLabelOutDegree: u, } ); }, vt = function (t, e, n, r, i, o, a) { var s; if ( (void 0 === n && (n = !1), void 0 === o && (o = "cluster"), void 0 === a && (a = "cluster"), t && t.nodes) ) { var c = t.nodes.length; if (c) { var u = A(t, n), h = A(e, n), l = dt(t.nodes, u, n), f = dt(e.nodes, h, n), d = lt(t.nodes, o), p = d.nodeMap, g = d.nodeLabelMap, v = lt(e.nodes, o), y = v.nodeMap, m = v.nodeLabelMap; ft(t.edges, a, p); var b = ft(e.edges, a, y).edgeLabelMap, x = []; null == h || h.forEach(function (t) { x = x.concat(t); }), i || (i = Math.max.apply( Math, Object(O.f)(Object(O.f)([], x, !1), [2], !1), )), r || (r = i); var S = st(t, u, o, r), w = st(e, h, o, r), M = (function (t, e, n, r, i) { var o = Math.ceil(n / e), a = {}, s = 0; return ( r.forEach(function (t, r) { for ( var c = 0, u = 0, h = t.nodeIdxs, l = t.neighborNum - 1; c < o; ) { for ( var f = h[1 + Math.floor(Math.random() * l)], d = 0; (a["".concat(r, "-").concat(f)] || a["".concat(f, "-").concat(r)]) && ((f = Math.floor(Math.random() * e)), !(++d > 2 * e)); ); if ( d < 2 * e && ((a["".concat(r, "-").concat(f)] = { start: r, end: f, distance: i[r][f], }), c++, ++s >= n) ) return a; if (++u > 2 * e) break; } c < o && (o = (o + (o - c)) / (e - r - 1)); }), a ); })(0, c, Math.min(100, (c * (c - 1)) / 2), S, u), j = ut(M, S, t), C = at({ graphs: j, nodeLabelProp: o, edgeLabelProp: a, minSupport: 1, minNodeNum: 1, maxNodeNum: 4, directed: n, }).slice(0, 10), E = C.length, P = []; C.forEach(function (t, e) { (P[e] = {}), Object.keys(j).forEach(function (n) { var r = j[n], i = ht(r, t, o, a); P[e][n] = i; }); }); var I = (function (t, e, n) { for ( var r = 1 / 0, i = 0, o = function (e) { var n = t[e], o = Object.keys(n).sort(function (t, e) { return n[t] - n[e]; }), a = []; o.forEach(function (t, e) { a[e % 10] || (a[e % 10] = { graphs: [], totalCount: 0, aveCount: 0, }), a[e % 10].graphs.push(t), (a[e % 10].totalCount += n[t]); }); var s = 0, c = []; a.forEach(function (t) { var e = t.totalCount / t.graphs.length; (t.aveCount = e), c.push(e); var r = 0, i = t.length; t.graphs.forEach(function (e, i) { var o = n[e]; t.graphs.forEach(function (t, e) { i !== e && (r += Math.abs(o - n[t])); }); }), (s += r /= (i * (i - 1)) / 2); }), (s /= a.length); var u = 0; c.forEach(function (t, e) { c.forEach(function (n, r) { e !== r && (u += Math.abs(t - n)); }), (u /= (c.length * (c.length - 1)) / 2); }); var h = u - s; r < h && ((r = h), (i = e)); }, a = 0; a < e; a++ ) o(a); return { structure: n[i], structureCountMap: t[i] }; })(P, E, C), T = I.structure, N = I.structureCountMap, B = e.nodes[0], L = [], D = null === (s = e.nodes[0]) || void 0 === s ? void 0 : s[o], _ = -1 / 0; e.nodes.forEach(function (t) { var e = t[o], n = g[e]; (null == n ? void 0 : n.length) > _ && ((_ = n.length), (L = n), (D = e), (B = t)); }); var R = {}, F = {}, Y = {}, X = {}, z = {}, W = {}; Object.keys(m).forEach(function (r, i) { (z[r] = []), n && (W[r] = []); var s = -1 / 0, c = m[r], u = {}; c.forEach(function (t) { var e = f["".concat(B.id, "-").concat(t.id)]; if ( (e && z[r].push(e), s < e && (s = e), (u["".concat(B.id, "-").concat(t.id)] = { start: 0, end: y[t.id].idx, distance: e, }), n) ) { var i = f["".concat(t.id, "-").concat(B.id)]; i && W[r].push(i); } }), (z[r] = z[r].sort(function (t, e) { return t - e; })), n && (W[r] = W[r].sort(function (t, e) { return t - e; })), (F = ut(u, w, e, F)); var h = []; if ( (Object.keys(u).forEach(function (t) { if (Y[t]) h.push(Y[t]); else { var e = F[t]; (Y[t] = ht(e, T, o, a)), h.push(Y[t]); } }), (h = h.sort(function (t, e) { return e - t; })), (X["".concat(B.id, "-").concat(r)] = h), r !== D) ) for ( var d = function (e) { var n = L[e], i = S[p[n.id].idx], s = i.nodeLabelCountMap[r], c = m[r].length; if (!s || s.count < c) return L.splice(e, 1), "continue"; for (var u = !1, f = 0; f < c; f++) if (s.dists[f] > z[r][f]) { u = !0; break; } if (u) return L.splice(e, 1), "continue"; var d = {}; i.neighbors.forEach(function (t) { var e = l["".concat(n.id, "-").concat(t.id)]; d["".concat(n.id, "-").concat(t.id)] = { start: p[n.id].idx, end: p[t.id].idx, distance: e, }; }), (j = ut(d, S, t, j)); var g = []; Object.keys(d).forEach(function (t) { if (N[t]) g.push(N[t]); else { var e = j[t]; (N[t] = ht(e, T, o, a)), g.push(N[t]); } }), (g = g.sort(function (t, e) { return e - t; })); var v = !1; for (f = 0; f < c; f++) if (g[f] < h[f]) { v = !0; break; } return v ? (L.splice(e, 1), "continue") : void 0; }, g = ((null == L ? void 0 : L.length) || 0) - 1; g >= 0; g-- ) d(g); }); var q = []; null == L || L.forEach(function (r) { for ( var s = p[r.id].idx, c = ct(t.nodes, u[s], s, o, i).neighbors, h = !1, f = c.length - 1; f >= 0; f-- ) { if (c.length + 1 < e.nodes.length) return void (h = !0); var d = c[f], g = d[o]; if (m[g] && m[g].length) if (z[g] && z[g].length) { var v = "".concat(r.id, "-").concat(d.id), b = l[v], x = z[g].length - 1; if (b > z[g][x]) c.splice(f, 1); else { if (n) { var w = "".concat(d.id, "-").concat(r.id), O = l[w]; if (((x = W[g].length - 1), O > W[g][x])) { c.splice(f, 1); continue; } } var M = N[v] ? N[v] : pt(t, r, d, p, b, S, T, o, a, N, j), k = "".concat(B.id, "-").concat(g); if (M < X[k][X[k].length - 1]) c.splice(f, 1); else { var C = gt(R, g, y, m), E = C.minPatternNodeLabelDegree; C.minPatternNodeLabelInDegree, C.minPatternNodeLabelOutDegree; p[d.id].degree < E && c.splice(f, 1); } } } else c.splice(f, 1); else c.splice(f, 1); } h || q.push({ nodes: [r].concat(c) }); }); var V = k(e, B.id, !1).length, G = {}; n ? (Object.keys(V).forEach(function (t) { var e = y[t].node[o]; G[e] ? G[e].push(V[t]) : (G[e] = [V[t]]); }), Object.keys(G).forEach(function (t) { G[t].sort(function (t, e) { return t - e; }); })) : (G = z); for ( var H = function (r) { var i = q[r], s = i.nodes[0], c = {}, u = {}; i.nodes.forEach(function (t, e) { u[t.id] = { idx: e, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var n = t[o]; c[n] ? c[n]++ : (c[n] = 1); }); var h = [], l = {}; t.edges.forEach(function (t) { u[t.source] && u[t.target] && (h.push(t), l[t[a]] ? l[t[a]]++ : (l[t[a]] = 1), u[t.source].degree++, u[t.target].degree++, u[t.source].outDegree++, u[t.target].inDegree++); }); for ( var f = Object.keys(b).length, d = !1, g = 0; g < f; g++ ) { var v = Object.keys(b)[g]; if (!l[v] || l[v] < b[v].length) { d = !0; break; } } if (d) return q.splice(r, 1), "continue"; var x = h.length; if (x < e.edges.length) return q.splice(r, 1), "break"; var S = !1, w = function (t) { var e = h[t], r = e[a], i = b[r]; if (!i || !i.length) return ( l[r]--, i && l[r] < i.length ? ((S = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue") ); var s = u[e.source].node[o], c = u[e.target].node[o], f = !1; return ( i.forEach(function (t) { var e = y[t.source].node, r = y[t.target].node; e[o] === s && r[o] === c && (f = !0), n || e[o] !== c || r[o] !== s || (f = !0); }), f ? void 0 : (l[r]--, i && l[r] < i.length ? ((S = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue")) ); }; for (g = x - 1; g >= 0; g--) { if ("break" === w(g)) break; } if (S) return q.splice(r, 1), "continue"; i.edges = h; var O = k(i, i.nodes[0].id, !1).length; if ( (Object.keys(O) .reverse() .forEach(function (t) { if (t !== i.nodes[0].id && !S) { if (O[t] === 1 / 0) { var e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (S = !0); var n = i.nodes.indexOf(u[t].node); return i.nodes.splice(n, 1), void (u[t] = void 0); } var r = p[t].node[o]; if ( !G[r] || !G[r].length || O[t] > G[r][G[r].length - 1] ) { e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (S = !0); n = i.nodes.indexOf(u[t].node); i.nodes.splice(n, 1), (u[t] = void 0); } } }), S) ) return q.splice(r, 1), "continue"; for (var M = !0, j = 0; M && !S; ) { if ( ((M = !1), n ? u[s.id].degree < y[B.id].degree || u[s.id].inDegree < y[B.id].inDegree || u[s.id].outDegree < y[B.id].outDegree : u[s.id].degree < y[B.id].degree) ) { S = !0; break; } if (c[s[o]] < m[s[o]].length) { S = !0; break; } for (var C = i.nodes.length - 1; C >= 0; C--) { var E = i.nodes[C], P = u[E.id].degree, A = u[E.id].inDegree, I = u[E.id].outDegree, T = E[o], N = gt(R, T, y, m), L = N.minPatternNodeLabelDegree, D = N.minPatternNodeLabelInDegree, _ = N.minPatternNodeLabelOutDegree; if (n ? P < L || A < D || I < _ : P < L) { if ((c[E[o]]--, c[E[o]] < m[E[o]].length)) { S = !0; break; } i.nodes.splice(C, 1), (u[E.id] = void 0), (M = !0); } } if (S || (!M && 0 !== j)) break; for (var F = (x = h.length) - 1; F >= 0; F--) { var Y = h[F]; if (!u[Y.source] || !u[Y.target]) { h.splice(F, 1); var X = Y[a]; if ( (l[X]--, u[Y.source] && (u[Y.source].degree--, u[Y.source].outDegree--), u[Y.target] && (u[Y.target].degree--, u[Y.target].inDegree--), b[X] && l[X] < b[X].length) ) { S = !0; break; } M = !0; } } j++; } return S || S || i.nodes.length < e.nodes.length || h.length < e.edges.length ? (q.splice(r, 1), "continue") : void 0; }, U = q.length - 1; U >= 0; U-- ) { if ("break" === H(U)) break; } var Z = q.length, K = function (t) { var e = q[t], n = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); n[e] ? n[e]++ : (n[e] = 1); }); for ( var r = function (t) { var e = q[t], r = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); r[e] ? r[e]++ : (r[e] = 1); }); var i = !0; Object.keys(r).length !== Object.keys(n).length ? (i = !1) : Object.keys(n).forEach(function (t) { r[t] !== n[t] && (i = !1); }), i && q.splice(t, 1); }, i = Z - 1; i > t; i-- ) r(i); Z = q.length; }; for (U = 0; U <= Z - 1; U++) K(U); return q; } } }, yt = (function () { function t(t) { void 0 === t && (t = 10), (this.linkedList = new a()), (this.maxStep = t); } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this.linkedList.toArray().length; }, enumerable: !1, configurable: !0, }), (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.isMaxStack = function () { return this.toArray().length >= this.maxStep; }), (t.prototype.peek = function () { return this.isEmpty() ? null : this.linkedList.head.value; }), (t.prototype.push = function (t) { this.linkedList.prepend(t), this.length > this.maxStep && this.linkedList.deleteTail(); }), (t.prototype.pop = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toArray = function () { return this.linkedList.toArray().map(function (t) { return t.value; }); }), (t.prototype.clear = function () { for (; !this.isEmpty(); ) this.pop(); }), t ); })(), mt = w; e.default = { getAdjMatrix: r, breadthFirstSearch: l, connectedComponent: d, getDegree: g, getInDegree: v, getOutDegree: y, detectCycle: w, detectDirectedCycle: mt, detectAllCycles: S, detectAllDirectedCycle: x, detectAllUndirectedCycle: b, depthFirstSearch: m, dijkstra: k, findAllPath: P, findShortestPath: E, floydWarshall: A, labelPropagation: I, louvain: F, iLouvain: Y, kCore: X, kMeans: W, cosineSimilarity: q, nodesCosineSimilarity: V, minimumSpanningTree: $, pageRank: Q, getNeighbors: c, Stack: yt, GADDI: vt, }; }, 38: function (t, e, n) { self, (t.exports = (function () { "use strict"; var t = { d: function (e, n) { for (var r in n) t.o(n, r) && !t.o(e, r) && Object.defineProperty(e, r, { enumerable: !0, get: n[r] }); }, o: function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }, r: function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module", }), Object.defineProperty(t, "__esModule", { value: !0 }); }, }, e = {}; function n(t, e) { return void 0 === t ? e : t; } t.r(e), t.d(e, { default: function () { return me; }, }); var r, i = Math.round, o = Math.abs, a = Date.now, s = "compute", c = "auto", u = "manipulation", h = "none", l = "pan-x", f = "pan-y", d = ((r = {}), [ "auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none", ].forEach(function (t) { return (r[t] = !0); }), r), p = "touch", g = ["x", "y"], v = ["clientX", "clientY"], y = 32, m = "function" != typeof Object.assign ? function (t) { if (null == t) throw new TypeError( "Cannot convert undefined or null to object", ); for (var e = Object(t), n = 1; n < arguments.length; n++) { var r = arguments[n]; if (null != r) for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]); } return e; } : Object.assign, b = 1; function x(t, e, n) { var r; if (t) if (t.forEach) t.forEach(e, n); else if (void 0 !== t.length) for (r = 0; r < t.length; ) e.call(n, t[r], r, t), r++; else for (r in t) t.hasOwnProperty(r) && e.call(n, t[r], r, t); } function S(t, e, n) { return !!Array.isArray(t) && (x(t, n[e], n), !0); } function w(t, e, n) { if (t.indexOf && !n) return t.indexOf(e); for (var r = 0; r < t.length; ) { if ((n && t[r][n] == e) || (!n && t[r] === e)) return r; r++; } return -1; } function O(t) { return (O = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function M(t, e) { return "function" === O(t) ? t.apply((e && e[0]) || void 0, e) : t; } function k(t, e) { var n = e.manager; return n ? n.get(t) : t; } function j(t) { return 16 & t ? "cancel" : 8 & t ? "end" : 4 & t ? "move" : 2 & t ? "start" : ""; } function C(t) { return (C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var E = (function () { function t(e) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, this.defaults, e || {})), (this.id = b++), (this.manager = null), (this.options.enable = n(this.options.enable, !0)), (this.state = 1), (this.simultaneous = {}), (this.requireFail = []); } var e, r; return ( (e = t), (r = [ { key: "set", value: function (t) { return ( m(this.options, t), this.manager && this.manager.touchAction.update(), this ); }, }, { key: "recognizeWith", value: function (t) { if (S(t, "recognizeWith", this)) return this; var e = this.simultaneous; return ( e[(t = k(t, this)).id] || ((e[t.id] = t), t.recognizeWith(this)), this ); }, }, { key: "dropRecognizeWith", value: function (t) { return ( S(t, "dropRecognizeWith", this) || ((t = k(t, this)), delete this.simultaneous[t.id]), this ); }, }, { key: "requireFailure", value: function (t) { if (S(t, "requireFailure", this)) return this; var e = this.requireFail; return ( -1 === w(e, (t = k(t, this))) && (e.push(t), t.requireFailure(this)), this ); }, }, { key: "dropRequireFailure", value: function (t) { if (S(t, "dropRequireFailure", this)) return this; t = k(t, this); var e = w(this.requireFail, t); return e > -1 && this.requireFail.splice(e, 1), this; }, }, { key: "hasRequireFailures", value: function () { return this.requireFail.length > 0; }, }, { key: "canRecognizeWith", value: function (t) { return !!this.simultaneous[t.id]; }, }, { key: "emit", value: function (t) { var e = this, n = this.state; function r(n) { e.manager.emit(n, t); } n < 8 && r(e.options.event + j(n)), r(e.options.event), t.additionalEvent && r(t.additionalEvent), n >= 8 && r(e.options.event + j(n)); }, }, { key: "tryEmit", value: function (t) { if (this.canEmit()) return this.emit(t); this.state = y; }, }, { key: "canEmit", value: function () { for (var t = 0; t < this.requireFail.length; ) { if (!(33 & this.requireFail[t].state)) return !1; t++; } return !0; }, }, { key: "recognize", value: function (t) { var e = m({}, t); if (!M(this.options.enable, [this, e])) return this.reset(), void (this.state = y); 56 & this.state && (this.state = 1), (this.state = this.process(e)), 30 & this.state && this.tryEmit(e); }, }, { key: "process", value: function (t) {} }, { key: "getTouchAction", value: function () {} }, { key: "reset", value: function () {} }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== C(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== C(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === C(i) ? i : String(i)), r, ); } var i; })(e.prototype, r), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function P(t) { return (P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function A(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function I(t, e) { return (I = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function T(t, e) { if (e && ("object" === P(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function N(t) { return (N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } E.prototype.defaults = {}; var B = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && I(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = N(r); if (i) { var n = N(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return T(this, t); }); function a() { return A(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "attrTest", value: function (t) { var e = this.options.pointers; return 0 === e || t.pointers.length === e; }, }, { key: "process", value: function (t) { var e = this.state, n = t.eventType, r = 6 & e, i = this.attrTest(t); return r && (8 & n || !i) ? 16 | e : r || i ? 4 & n ? 8 | e : 2 & e ? 4 | e : 2 : y; }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== P(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== P(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === P(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function L(t) { return (L = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function D(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function _() { return (_ = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = R(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function R(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = X(t)); ); return t; } function F(t, e) { return (F = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function Y(t, e) { if (e && ("object" === L(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function X(t) { return (X = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } B.prototype.defaults = { pointers: 1 }; var z = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && F(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = X(r); if (i) { var n = X(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return Y(this, t); }); function a() { return D(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( _(X(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.rotation) > this.options.threshold || 2 & this.state) ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== L(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== L(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === L(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function W(t) { return (W = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function q(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function V() { return (V = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = G(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function G(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = Z(t)); ); return t; } function H(t, e) { return (H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function U(t, e) { if (e && ("object" === W(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Z(t) { return (Z = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } z.prototype.defaults = { event: "rotate", threshold: 0, pointers: 2 }; var K = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && H(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Z(r); if (i) { var n = Z(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return U(this, t); }); function a() { return q(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( V(Z(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.scale - 1) > this.options.threshold || 2 & this.state) ); }, }, { key: "emit", value: function (t) { if (1 !== t.scale) { var e = t.scale < 1 ? "in" : "out"; t.additionalEvent = this.options.event + e; } V(Z(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== W(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== W(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === W(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function $(t) { return 16 === t ? "down" : 8 === t ? "up" : 2 === t ? "left" : 4 === t ? "right" : ""; } function Q(t) { return (Q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function J(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function tt() { return (tt = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = et(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function et(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = it(t)); ); return t; } function nt(t, e) { return (nt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function rt(t, e) { if (e && ("object" === Q(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function it(t) { return (it = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } K.prototype.defaults = { event: "pinch", threshold: 0, pointers: 2 }; var ot = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && nt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = it(r); if (i) { var n = it(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return rt(this, t); }); function a() { var t; return ( J(this, a), ((t = o.apply(this, arguments)).pX = null), (t.pY = null), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { var t = this.options.direction, e = []; return 6 & t && e.push(f), 24 & t && e.push(l), e; }, }, { key: "directionTest", value: function (t) { var e = this.options, n = !0, r = t.distance, i = t.direction, o = t.deltaX, a = t.deltaY; return ( i & e.direction || (6 & e.direction ? ((i = 0 === o ? 1 : o < 0 ? 2 : 4), (n = o !== this.pX), (r = Math.abs(t.deltaX))) : ((i = 0 === a ? 1 : a < 0 ? 8 : 16), (n = a !== this.pY), (r = Math.abs(t.deltaY)))), (t.direction = i), n && r > e.threshold && i & e.direction ); }, }, { key: "attrTest", value: function (t) { return ( B.prototype.attrTest.call(this, t) && (2 & this.state || (!(2 & this.state) && this.directionTest(t))) ); }, }, { key: "emit", value: function (t) { (this.pX = t.deltaX), (this.pY = t.deltaY); var e = $(t.direction); e && (t.additionalEvent = this.options.event + e), tt(it(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Q(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Q(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Q(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function at(t) { return (at = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function st(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ct() { return (ct = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = ut(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function ut(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = ft(t)); ); return t; } function ht(t, e) { return (ht = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function lt(t, e) { if (e && ("object" === at(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ft(t) { return (ft = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } ot.prototype.defaults = { event: "pan", threshold: 10, pointers: 1, direction: 30, }; var dt = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ht(t, e); })(s, t); var e, n, r, i, a = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = ft(r); if (i) { var n = ft(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return lt(this, t); }); function s() { return st(this, s), a.apply(this, arguments); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return ot.prototype.getTouchAction.call(this); }, }, { key: "attrTest", value: function (t) { var e, n = this.options.direction; return ( 30 & n ? (e = t.overallVelocity) : 6 & n ? (e = t.overallVelocityX) : 24 & n && (e = t.overallVelocityY), ct(ft(s.prototype), "attrTest", this).call(this, t) && n & t.offsetDirection && t.distance > this.options.threshold && t.maxPointers === this.options.pointers && o(e) > this.options.velocity && 4 & t.eventType ); }, }, { key: "emit", value: function (t) { var e = $(t.offsetDirection); e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== at(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== at(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === at(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(B); function pt(t, e) { return function () { return t.apply(e, arguments); }; } function gt(t, e, n) { return setTimeout(pt(t, n), e); } function vt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return Math.sqrt(r * r + i * i); } function yt(t) { return (yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function mt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function bt(t, e) { return (bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function xt(t, e) { if (e && ("object" === yt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function St(t) { return (St = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } dt.prototype.defaults = { event: "swipe", threshold: 10, velocity: 0.3, direction: 30, pointers: 1, }; var wt = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && bt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = St(r); if (i) { var n = St(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return xt(this, t); }); function a() { var t; return ( mt(this, a), ((t = o.apply(this, arguments)).pTime = !1), (t.pCenter = !1), (t._timer = null), (t._input = null), (t.count = 0), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [u]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime < n.time; if ((this.reset(), 1 & t.eventType && 0 === this.count)) return this.failTimeout(); if (i && o && r) { if (4 !== t.eventType) return this.failTimeout(); var a = !this.pTime || t.timeStamp - this.pTime < n.interval, s = !this.pCenter || vt(this.pCenter, t.center) < n.posThreshold; if ( ((this.pTime = t.timeStamp), (this.pCenter = t.center), s && a ? (this.count += 1) : (this.count = 1), (this._input = t), 0 == this.count % n.taps) ) return this.hasRequireFailures() ? ((this._timer = gt( function () { (e.state = 8), e.tryEmit(); }, n.interval, this, )), 2) : 8; } return y; }, }, { key: "failTimeout", value: function () { var t = this; return ( (this._timer = gt( function () { t.state = y; }, this.options.interval, this, )), y ); }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function () { 8 === this.state && ((this._input.tapCount = this.count), this.manager.emit(this.options.event, this._input)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== yt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== yt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === yt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function Ot(t) { return (Ot = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Mt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function kt(t, e) { return (kt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function jt(t, e) { if (e && ("object" === Ot(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } wt.prototype.defaults = { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10, }; var Et = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && kt(t, e); })(s, t); var e, n, r, i, o = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Ct(r); if (i) { var n = Ct(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return jt(this, t); }); function s() { var t; return ( Mt(this, s), ((t = o.apply(this, arguments))._timer = null), (t._input = null), t ); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return [c]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime > n.time; if ( ((this._input = t), !i || !r || (12 & t.eventType && !o)) ) this.reset(); else if (1 & t.eventType) this.reset(), (this._timer = gt( function () { (e.state = 8), e.tryEmit(); }, n.time, this, )); else if (4 & t.eventType) return 8; return y; }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function (t) { 8 === this.state && (t && 4 & t.eventType ? this.manager.emit( "".concat(this.options.event, "up"), t, ) : ((this._input.timeStamp = a()), this.manager.emit(this.options.event, this._input))); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Ot(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Ot(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Ot(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(E); function Pt(t, e) { return t.indexOf(e) > -1; } function At(t) { return (At = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } Et.prototype.defaults = { event: "press", pointers: 1, time: 251, threshold: 9, }; var It = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.manager = e), this.set(n); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { t === s && (t = this.compute()), (this.actions = t.toLowerCase().trim()); }, }, { key: "update", value: function () { this.set(this.manager.options.touchAction); }, }, { key: "compute", value: function () { var t = []; return ( x(this.manager.recognizers, function (e) { M(e.options.enable, [e]) && (t = t.concat(e.getTouchAction())); }), (function (t) { if (Pt(t, h)) return h; var e = Pt(t, l), n = Pt(t, f); return e && n ? h : e || n ? e ? l : f : Pt(t, u) ? u : c; })(t.join(" ")) ); }, }, { key: "preventDefaults", value: function (t) { var e = t.srcEvent, n = t.offsetDirection; if (this.manager.session.prevented) e.preventDefault(); else { var r = this.actions, i = Pt(r, h) && !d[h], o = Pt(r, f) && !d[f], a = Pt(r, l) && !d[l]; if (i) { var s = 1 === t.pointers.length, c = t.distance < 2, u = t.deltaTime < 250; if (s && c && u) return; } if (!a || !o) return i || (o && 6 & n) || (a && 24 & n) ? this.preventSrc(e) : void 0; } }, }, { key: "preventSrc", value: function (t) { (this.manager.session.prevented = !0), t.preventDefault(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== At(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== At(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === At(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function Tt(t) { var e = t.length; if (1 === e) return { x: i(t[0].clientX), y: i(t[0].clientY) }; for (var n = 0, r = 0, o = 0; o < e; ) (n += t[o].clientX), (r += t[o].clientY), o++; return { x: i(n / e), y: i(r / e) }; } function Nt(t) { for (var e = [], n = 0; n < t.pointers.length; ) (e[n] = { clientX: i(t.pointers[n].clientX), clientY: i(t.pointers[n].clientY), }), n++; return { timeStamp: a(), pointers: e, center: Tt(e), deltaX: t.deltaX, deltaY: t.deltaY, }; } function Bt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return (180 * Math.atan2(i, r)) / Math.PI; } function Lt(t, e) { return t === e ? 1 : o(t) >= o(e) ? t < 0 ? 2 : 4 : e < 0 ? 8 : 16; } function Dt(t, e, n) { return { x: e / t || 0, y: n / t || 0 }; } function _t(t, e, n) { var r = n.pointers.length, i = n.changedPointers.length, s = 1 & e && r - i == 0, c = 12 & e && r - i == 0; (n.isFirst = !!s), (n.isFinal = !!c), s && (t.session = {}), (n.eventType = e), (function (t, e) { var n = t.session, r = e.pointers, i = r.length; n.firstInput || (n.firstInput = Nt(e)), i > 1 && !n.firstMultiple ? (n.firstMultiple = Nt(e)) : 1 === i && (n.firstMultiple = !1); var s = n.firstInput, c = n.firstMultiple, u = c ? c.center : s.center, h = (e.center = Tt(r)); (e.timeStamp = a()), (e.deltaTime = e.timeStamp - s.timeStamp), (e.angle = Bt(u, h)), (e.distance = vt(u, h)), (function (t, e) { var n = e.center, r = t.offsetDelta || {}, i = t.prevDelta || {}, o = t.prevInput || {}; (1 !== e.eventType && 4 !== o.eventType) || ((i = t.prevDelta = { x: o.deltaX || 0, y: o.deltaY || 0 }), (r = t.offsetDelta = { x: n.x, y: n.y })), (e.deltaX = i.x + (n.x - r.x)), (e.deltaY = i.y + (n.y - r.y)); })(n, e), (e.offsetDirection = Lt(e.deltaX, e.deltaY)); var l, f, d = Dt(e.deltaTime, e.deltaX, e.deltaY); (e.overallVelocityX = d.x), (e.overallVelocityY = d.y), (e.overallVelocity = o(d.x) > o(d.y) ? d.x : d.y), (e.scale = c ? ((l = c.pointers), vt((f = r)[0], f[1], v) / vt(l[0], l[1], v)) : 1), (e.rotation = c ? (function (t, e) { return Bt(e[1], e[0], v) + Bt(t[1], t[0], v); })(c.pointers, r) : 0), (e.maxPointers = n.prevInput ? e.pointers.length > n.prevInput.maxPointers ? e.pointers.length : n.prevInput.maxPointers : e.pointers.length), (function (t, e) { var n, r, i, a, s = t.lastInterval || e, c = e.timeStamp - s.timeStamp; if ( 8 !== e.eventType && (c > 25 || void 0 === s.velocity) ) { var u = e.deltaX - s.deltaX, h = e.deltaY - s.deltaY, l = Dt(c, u, h); (r = l.x), (i = l.y), (n = o(l.x) > o(l.y) ? l.x : l.y), (a = Lt(u, h)), (t.lastInterval = e); } else (n = s.velocity), (r = s.velocityX), (i = s.velocityY), (a = s.direction); (e.velocity = n), (e.velocityX = r), (e.velocityY = i), (e.direction = a); })(n, e); })(t, n), t.emit("hammer.input", n), t.recognize(n), (t.session.prevInput = n); } function Rt(t) { return t.trim().split(/\s+/g); } function Ft(t, e, n) { x(Rt(e), function (e) { t.addEventListener(e, n, !1); }); } function Yt(t) { return (Yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Xt = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t); var r = this; (this.manager = e), (this.callback = n), (this.eventHandler = function (t) { M(e.options.enable, [e]) && r.handler(t); }), this.init(); } var e, n; return ( (e = t), (n = [ { key: "handler", value: function () {} }, { key: "init", value: function () { var t, e, n; (t = this.manager), (e = this.events || ""), (n = this.eventHandler), x(Rt(e), function (e) { t.on("origin_input:".concat(e), n); }); }, }, { key: "destroy", value: function () { removeManagerListeners( this.manager, this.events || "", this.eventHandler, ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Yt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Yt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Yt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function zt(t) { return Array.prototype.slice.call(t, 0); } function Wt(t, e, n) { for (var r = [], i = [], o = 0; o < t.length; ) { var a = e ? t[o][e] : t[o]; w(i, a) < 0 && r.push(t[o]), (i[o] = a), o++; } return ( n && (r = e ? r.sort(function (t, n) { return t[e] > n[e]; }) : r.sort()), r ); } function qt(t) { return (qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Vt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Gt(t, e) { return (Gt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function Ht(t, e) { if (e && ("object" === qt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ut(t) { return (Ut = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Zt = { touchstart: 1, touchmove: 2, touchend: 4, touchcancel: 8 }, Kt = "touchstart touchmove touchend touchcancel", $t = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && Gt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Ut(r); if (i) { var n = Ut(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return Ht(this, t); }); function a() { var t; return ( Vt(this, a), (a.prototype.evTarget = Kt), (a.prototype.targetIds = {}), (a.prototype.events = Kt), ((t = o.apply(this, arguments)).evTarget = Kt), (t.targetIds = {}), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = Zt[t.type], n = Qt.call(this, t, e); n && this.callback(this.manager, e, { pointers: n[0], changedPointers: n[1], pointerType: p, srcEvent: t, }); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== qt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== qt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === qt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Xt); function Qt(t, e) { var n, r, i = zt(t.touches), o = this.targetIds; if (3 & e && 1 === i.length) return (o[i[0].identifier] = !0), [i, i]; var a = zt(t.changedTouches), s = []; if ((this.target, (r = i), 1 === e)) for (n = 0; n < r.length; ) (o[r[n].identifier] = !0), n++; for (n = 0; n < a.length; ) o[a[n].identifier] && s.push(a[n]), 12 & e && delete o[a[n].identifier], n++; return s.length ? [Wt(r.concat(s), "identifier", !0), s] : void 0; } function Jt(t) { return (Jt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var te = (function () { function t(e) { var n, r = this; !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, re.defaults, e || {})), (this.handlers = {}), (this.filters = []), (this.session = {}), (this.recognizers = []), (this.input = ((n = $t), this.options.inputClass && (n = inputClass), new n(this, _t))), (this.touchAction = new It(this, this.options.touchAction)), x( this.options.recognizers, function (t) { var e = r.add(new t[0](t[1])); t[2] && e.recognizeWith(t[2]), t[3] && e.requireFailure(t[3]); }, this, ); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { return ( m(this.options, t), t.touchAction && this.touchAction.update(), this ); }, }, { key: "stop", value: function (t) { this.session.stopped = t ? 2 : 1; }, }, { key: "addFilter", value: function (t) { if ("function" != typeof t) throw new Error("filter must be a function"); this.filters.push(t); }, }, { key: "recognize", value: function (t) { var e = this.session; if (!e.stopped) { var n; this.touchAction.preventDefaults(t); var r = this.recognizers, i = e.curRecognizer; (!i || (i && 8 & i.state)) && (i = e.curRecognizer = null); for (var o = 0; o < r.length; ) (n = r[o]), 2 === e.stopped || (i && n !== i && !n.canRecognizeWith(i)) ? n.reset() : n.recognize(t), !i && 14 & n.state && (i = e.curRecognizer = n), o++; } }, }, { key: "get", value: function (t) { if (t instanceof E) return t; for (var e = this.recognizers, n = 0; n < e.length; n++) if (e[n].options.event === t) return e[n]; return null; }, }, { key: "add", value: function (t) { if (S(t, "add", this)) return this; var e = this.get(t.options.event); return ( e && this.remove(e), this.recognizers.push(t), (t.manager = this), this.touchAction.update(), t ); }, }, { key: "remove", value: function (t) { if (S(t, "remove", this)) return this; if ((t = this.get(t))) { var e = this.recognizers, n = w(e, t); -1 !== n && (e.splice(n, 1), this.touchAction.update()); } return this; }, }, { key: "on", value: function (t, e) { if (void 0 !== t && void 0 !== e) { var n = this.handlers; return ( x(Rt(t), function (t) { (n[t] = n[t] || []), n[t].push(e); }), this ); } }, }, { key: "off", value: function (t, e) { if (void 0 !== t) { var n = this.handlers; return ( x(Rt(t), function (t) { e ? n[t] && n[t].splice(w(n[t], e), 1) : delete n[t]; }), this ); } }, }, { key: "emit", value: function (t, e) { var n = this.handlers[t] && this.handlers[t].slice(); if ((this.filters, n && n.length)) { t.startsWith("origin_input") || ((e.type = t), (e.preventDefault = function () { e.srcEvent.preventDefault && e.srcEvent.preventDefault(); })); for (var r = 0; r < n.length; ) n[r](e), r++; } }, }, { key: "destroy", value: function () { (this.handlers = {}), (this.filters = []), (this.session = {}), this.input.destroy(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Jt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Jt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Jt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function ee(t) { return (ee = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ne(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== ee(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== ee(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === ee(i) ? i : String(i)), r, ); } var i; } var re = (function (t, e, n) { return ( e && ne(t.prototype, e), n && ne(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t ); })(function t(e) { return ( (function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), ((e = e || {}).recognizers = n(e.recognizers, t.defaults.preset)), new te(e) ); }); function ie(t) { return (ie = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function oe(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ae(t, e) { return (ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function se(t, e) { if (e && ("object" === ie(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ce(t) { return (ce = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } re.defaults = { domEvents: !1, touchAction: s, enable: !0, inputClass: null, preset: [ [z, { enable: !1 }], [K, { enable: !1 }, ["rotate"]], [dt, { direction: 6 }], [ot, { direction: 6 }, ["swipe"]], [wt], [wt, { event: "doubletap", taps: 2 }, ["tap"]], [Et], ], }; var ue = { pointerdown: 1, pointermove: 2, pointerup: 4, pointercancel: 8, pointerout: 8, }, he = { 2: p, 3: "pen", 4: "mouse", 5: "kinect" }, le = "pointerdown", fe = "pointermove pointerup pointercancel", de = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ae(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = ce(r); if (i) { var n = ce(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return se(this, t); }); function a() { var t; return ( oe(this, a), (a.prototype.events = "".concat(le, " ").concat(fe)), ((t = o.apply(this, arguments)).evEl = le), (t.evWin = fe), (t.store = t.manager.session.pointerEvents = []), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = this.store, n = !1, r = t.type.toLowerCase().replace("ms", ""), i = ue[r], o = he[t.pointerType] || t.pointerType, a = o === p, s = w(e, t.pointerId, "pointerId"); 1 & i && (0 === t.button || a) ? s < 0 && (e.push(t), (s = e.length - 1)) : 12 & i && (n = !0), s < 0 || ((e[s] = t), this.callback(this.manager, i, { pointers: e, changedPointers: [t], pointerType: o, srcEvent: t, }), n && e.splice(s, 1)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== ie(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== ie(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === ie(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Xt); function pe(t, e, n) { x(Rt(e), function (e) { t.removeEventListener(e, n, !1); }); } function ge(t, e, n) { var r = "DEPRECATED METHOD: ".concat(e, "\n").concat(n, " AT \n"); return function () { var e = new Error("get-stack-trace"), n = e && e.stack ? e.stack .replace(/^[^\(]+?[\n$]/gm, "") .replace(/^\s+at\s+/gm, "") .replace(/^Object.\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", i = console.warn; return i && i(r, n), t.apply(this, arguments); }; } var ve = ge( function (t, e, n) { for (var r = Object.keys(e), i = 0; i < r.length; ) (!n || (n && void 0 === t[r[i]])) && (t[r[i]] = e[r[i]]), i++; return t; }, "extend", "Use `assign`.", ), ye = ge( function (t, e) { return ve(t, e, !0); }, "merge", "Use `assign`.", ), me = m(re, { INPUT_START: 1, INPUT_MOVE: 2, INPUT_END: 4, INPUT_CANCEL: 8, STATE_POSSIBLE: 1, STATE_BEGAN: 2, STATE_CHANGED: 4, STATE_ENDED: 8, STATE_RECOGNIZED: 8, STATE_CANCELLED: 16, STATE_FAILED: y, DIRECTION_NONE: 1, DIRECTION_LEFT: 2, DIRECTION_RIGHT: 4, DIRECTION_UP: 8, DIRECTION_DOWN: 16, DIRECTION_HORIZONTAL: 6, DIRECTION_VERTICAL: 24, DIRECTION_ALL: 30, Manager: te, Input: Xt, TouchAction: It, TouchInput: $t, PointerEventInput: de, Recognizer: E, AttrRecognizer: B, Tap: wt, Pan: ot, Swipe: dt, Pinch: K, Rotate: z, Press: Et, on: Ft, off: pe, each: x, merge: ye, extend: ve, assign: m, inherit: function (t, e, n) { var r, i = e.prototype; ((r = t.prototype = Object.create(i)).constructor = t), (r._super = i), n && m(r, n); }, bindFn: pt, toArray: zt, inArray: w, uniqueArray: Wt, splitStr: Rt, boolOrFn: M, hasParent: function (t, e) { for (; t; ) { if (t === e) return !0; t = t.parentNode; } return !1; }, addEventListeners: Ft, removeEventListeners: pe, }); return e; })()); }, 4: function (t, e, n) { "use strict"; n.d(e, "b", function () { return i.a; }), n.d(e, "c", function () { return i.b; }), n.d(e, "d", function () { return i.c; }), n.d(e, "a", function () { return r; }); var r = {}; n.r(r), n.d(r, "leftTranslate", function () { return o; }), n.d(r, "leftRotate", function () { return a; }), n.d(r, "leftScale", function () { return s; }), n.d(r, "transform", function () { return c; }), n.d(r, "direction", function () { return u; }), n.d(r, "angleTo", function () { return h; }), n.d(r, "vertical", function () { return l; }); var i = n(5); function o(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromTranslation(r, n), i.a.multiply(t, r, e); } function a(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromRotation(r, n), i.a.multiply(t, r, e); } function s(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromScaling(r, n), i.a.multiply(t, r, e); } function c(t, e) { for ( var n, r, c, u = t ? [].concat(t) : [1, 0, 0, 0, 1, 0, 0, 0, 1], h = 0, l = e.length; h < l; h++ ) { var f = e[h]; switch (f[0]) { case "t": o(u, u, [f[1], f[2]]); break; case "s": s(u, u, [f[1], f[2]]); break; case "r": a(u, u, f[1]); break; case "m": (n = u), (r = u), (c = f[1]), i.a.multiply(n, c, r); } } return u; } function u(t, e) { return t[0] * e[1] - e[0] * t[1]; } function h(t, e, n) { var r = i.b.angle(t, e), o = u(t, e) >= 0; return n ? (o ? 2 * Math.PI - r : r) : o ? r : 2 * Math.PI - r; } function l(t, e, n) { return ( n ? ((t[0] = e[1]), (t[1] = -1 * e[0])) : ((t[0] = -1 * e[1]), (t[1] = e[0])), t ); } }, 40: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } n.d(e, "c", function () { return o; }), n.d(e, "b", function () { return a; }), n.d(e, "a", function () { return s; }); var i = {}; function o(t) { void 0 === t && (t = {}), (t = t); } function a(t) { return (null == i ? void 0 : i.requestAnimationFrame) ? i.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : r(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); } function s(t) { return (null == i ? void 0 : i.clearAnimationFrame) ? i.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : r(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); } }, 41: function (t, e, n) { "use strict"; var r = {}; n.r(r), n.d(r, "proccessToFunc", function () { return u; }), n.d(r, "buildTextureData", function () { return h; }), n.d(r, "buildTextureDataWithOneEdgeAttr", function () { return l; }), n.d(r, "buildTextureDataWithTwoEdgeAttr", function () { return f; }), n.d(r, "attributesToTextureData", function () { return d; }), n.d(r, "arrayToTextureData", function () { return p; }), n.d(r, "radialLayout", function () { return g; }); var i = n(1), o = n(95), a = n(2), s = n(0), c = a.h.traverseTree, u = function (t, e) { return t ? Object(s.isNumber)(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, h = function (t, e) { var n = [], r = [], i = {}, o = 0; for (o = 0; o < t.length; o++) { var a = t[o]; (i[a.id] = o), n.push(a.x), n.push(a.y), n.push(0), n.push(0), r.push([]); } for (o = 0; o < e.length; o++) { var s = e[o]; r[i[s.source]].push(i[s.target]), r[i[s.target]].push(i[s.source]); } var c = 0; for (o = 0; o < t.length; o++) { var u = n.length, h = r[o], l = h.length; (n[4 * o + 2] = u), (n[4 * o + 3] = h.length), (c = Math.max(c, h.length)); for (var f = 0; f < l; ++f) { var d = h[f]; n.push(+d); } } for (; n.length % 4 != 0; ) n.push(0); return { array: new Float32Array(n), maxEdgePerVetex: c }; }, l = function (t, e, n) { var r = [], i = [], o = {}, a = 0; for (a = 0; a < t.length; a++) { var s = t[a]; (o[s.id] = a), r.push(s.x), r.push(s.y), r.push(0), r.push(0), i.push([]); } for (a = 0; a < e.length; a++) { var c = e[a]; i[o[c.source]].push(o[c.target]), i[o[c.source]].push(n(c)), i[o[c.target]].push(o[c.source]), i[o[c.target]].push(n(c)); } var u = 0; for (a = 0; a < t.length; a++) { var h = r.length, l = i[a], f = l.length; (r[4 * a + 2] = h), (r[4 * a + 3] = f / 2), (u = Math.max(u, f / 2)); for (var d = 0; d < f; ++d) { var p = l[d]; r.push(+p); } } for (; r.length % 4 != 0; ) r.push(0); return { array: new Float32Array(r), maxEdgePerVetex: u }; }, f = function (t, e, n, r) { var i = [], o = [], a = {}, s = 0; for (s = 0; s < t.length; s++) { var c = t[s]; (a[c.id] = s), i.push(c.x), i.push(c.y), i.push(0), i.push(0), o.push([]); } for (s = 0; s < e.length; s++) { var u = e[s]; o[a[u.source]].push(a[u.target]), o[a[u.source]].push(n(u)), o[a[u.source]].push(r(u)), o[a[u.source]].push(0), o[a[u.target]].push(a[u.source]), o[a[u.target]].push(n(u)), o[a[u.target]].push(r(u)), o[a[u.target]].push(0); } var h = 0; for (s = 0; s < t.length; s++) { var l = i.length, f = o[s], d = f.length; (i[4 * s + 2] = l + (1048576 * d) / 4), (i[4 * s + 3] = 0), (h = Math.max(h, d / 4)); for (var p = 0; p < d; ++p) { var g = f[p]; i.push(+g); } } for (; i.length % 4 != 0; ) i.push(0); return { array: new Float32Array(i), maxEdgePerVetex: h }; }, d = function (t, e) { var n = [], r = t.length, i = {}; return ( e.forEach(function (e) { t.forEach(function (t, o) { if ( (void 0 === i[e[t]] && (i[e[t]] = Object.keys(i).length), n.push(i[e[t]]), o === r - 1) ) for (; n.length % 4 != 0; ) n.push(0); }); }), { array: new Float32Array(n), count: Object.keys(i).length } ); }, p = function (t) { for ( var e = [], n = t.length, r = t[0].length, i = function (r) { t.forEach(function (t, i) { if ((e.push(t[r]), i === n - 1)) for (; e.length % 4 != 0; ) e.push(0); }); }, o = 0; o < r; o++ ) i(o); return new Float32Array(e); }, g = function (t, e) { var n = { x: 1 / 0, y: 1 / 0 }, r = { x: -1 / 0, y: -1 / 0 }, i = "x", o = "y"; e && ["V", "TB", "BT"].indexOf(e) >= 0 && ((o = "x"), (i = "y")); var a = 0; c(t, function (t) { return ( a++, t.x > r.x && (r.x = t.x), t.x < n.x && (n.x = t.x), t.y > r.y && (r.y = t.y), t.y < n.y && (n.y = t.y), !0 ); }); var s = (2 * Math.PI) / a, u = r[o] - n[o]; return ( 0 === u || c(t, function (e) { var r = ((e[o] - n[o]) / u) * (2 * Math.PI - s) + s, a = Math.abs("x" === i ? e.x - t.x : e.y - t.y); return (e.x = a * Math.cos(r)), (e.y = a * Math.sin(r)), !0; }), t ); }, v = Object(i.a)(Object(i.a)(Object(i.a)({}, a.h), o), r); e.a = v; }, 423: function (t, e, n) { "use strict"; var r = function () { return (r = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function i(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } var o = n(2), a = n(0); Object(o.l)( "circle", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), s = Object(a.deepMix)({}, i, t.icon), c = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, }), u = s.width, h = s.height, l = s.show, f = s.text; return ( l && (f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, s, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -u / 2, y: -h / 2 }, s), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), c ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t)[0] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -d, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: d, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -d, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: d, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.deepMix)({}, e, n), o = this.getSize(t)[0] / 2; return r({ x: 0, y: 0, r: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getSize(t), i = { stroke: t.color, r: r[0] / 2 }, o = e.get("keyShape"), s = Object(a.deepMix)({}, o.attr(), i, t.style); this.updateShape(t, e, s, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "rect", { options: { size: [100, 30], style: { radius: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t), r = e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawLinkPoints(t, e), r; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = e.get("keyShape"); t.size || ((i[0] = o.attr("width") || r.width), (i[1] = o.attr("height") || r.height)); var s = { stroke: t.color, x: -i[0] / 2, y: -i[1] / 2, width: i[0], height: i[1], }, c = Object(a.mix)({}, r, o.attr(), s); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !1), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "ellipse", { options: { size: [80, 40], style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "ellipse", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("ellipse", { attrs: o, className: "ellipse-keyShape", name: "ellipse-keyShape", draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0] / 2, g = d[1] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = o[0] / 2, c = o[1] / 2; return r({ x: 0, y: 0, rx: s, ry: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = { stroke: t.color, rx: i[0] / 2, ry: i[1] / 2 }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "diamond", { options: { size: [80, 80], style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "diamond", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getPath: function (t) { var e = this.getSize(t), n = e[0], r = e[1]; return [ ["M", 0, -r / 2], ["L", n / 2, 0], ["L", 0, r / 2], ["L", -n / 2, 0], ["Z"], ]; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "triangle", { options: { size: 40, direction: "up", style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, offset: 15, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, offset: 6, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "triangle", labelPosition: "bottom", drawShape: function (t, e) { var n = this.getOptions(t), i = n.icon, o = void 0 === i ? {} : i, a = n.direction, s = this.getShapeStyle(t), c = t.direction || a, u = e.addShape("path", { attrs: s, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), h = o.width, l = o.height, f = o.show, d = o.offset, p = o.text; if (f) if (p) e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, o, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); else { var g = -h / 2, v = -l / 2; ("up" !== c && "down" !== c) || (v += d), ("left" !== c && "right" !== c) || (g += d), e.addShape("image", { attrs: r({ x: g, y: v }, o), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); } return this.drawLinkPoints(t, e), u; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t), o = n.linkPoints, a = void 0 === o ? {} : o, s = n.direction, c = t.direction || s, u = a.top, h = a.left, l = a.right, f = a.bottom, d = a.size, p = a.r, g = i(a, ["top", "left", "right", "bottom", "size", "r"]), v = this.getSize(t)[0]; if (h) { var y = null, m = v * Math.sin((1 / 3) * Math.PI), b = v * Math.sin((1 / 3) * Math.PI); "up" === c ? (y = [-b, m]) : "down" === c ? (y = [-b, -m]) : "left" === c && (y = [-b, b - m]), y && e.addShape("circle", { attrs: r(r({}, g), { x: y[0], y: y[1], r: d / 2 || p || 5, }), className: "link-point-left", name: "link-point-left", }); } if (l) { var x = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (x = [b, m]) : "down" === c ? (x = [b, -m]) : "right" === c && (x = [b, b - m]), x && e.addShape("circle", { attrs: r(r({}, g), { x: x[0], y: x[1], r: d / 2 || p || 5, }), className: "link-point-right", name: "link-point-right", }); } if (u) { var S = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (S = [b - m, -m]) : "left" === c ? (S = [b, -m]) : "right" === c && (S = [-b, -m]), S && e.addShape("circle", { attrs: r(r({}, g), { x: S[0], y: S[1], r: d / 2 || p || 5, }), className: "link-point-top", name: "link-point-top", }); } if (f) { var w = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "down" === c ? (w = [-b + m, m]) : "left" === c ? (w = [b, m]) : "right" === c && (w = [-b, m]), w && e.addShape("circle", { attrs: r(r({}, g), { x: w[0], y: w[1], r: d / 2 || p || 5, }), className: "link-point-bottom", name: "link-point-bottom", }); } }, getPath: function (t) { var e = this.getOptions(t).direction, n = t.direction || e, r = this.getSize(t)[0], i = r * Math.sin((1 / 3) * Math.PI), o = r * Math.sin((1 / 3) * Math.PI), a = [["M", -o, i], ["L", 0, -i], ["L", o, i], ["Z"]]; return ( "down" === n ? (a = [["M", -o, -i], ["L", o, -i], ["L", 0, i], ["Z"]]) : "left" === n ? (a = [["M", -o, o - i], ["L", o, -o], ["L", o, o], ["Z"]]) : "right" === n && (a = [["M", o, o - i], ["L", -o, o], ["L", -o, -o], ["Z"]]), a ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}), i = n.linkPoints, o = n.direction, s = t.direction || o, c = e.find(function (t) { return "link-point-left" === t.get("className"); }), u = e.find(function (t) { return "link-point-right" === t.get("className"); }), h = e.find(function (t) { return "link-point-top" === t.get("className"); }), l = e.find(function (t) { return "link-point-bottom" === t.get("className"); }), f = i, d = c || u || h || l; d && (f = d.attr()); var p = Object(a.mix)({}, f, t.linkPoints), g = p.fill, v = p.stroke, y = p.lineWidth, m = p.size / 2; m || (m = p.r); var b = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0, }, x = b.left, S = b.right, w = b.top, O = b.bottom, M = this.getSize(t)[0], k = { r: m, fill: g, stroke: v, lineWidth: y }, j = null, C = M * Math.sin((1 / 3) * Math.PI), E = M * Math.sin((1 / 3) * Math.PI); "up" === s ? (j = [-E, C]) : "down" === s ? (j = [-E, -C]) : "left" === s && (j = [-E, E - C]), j && (c ? x || void 0 === x ? c.attr(r(r({}, k), { x: j[0], y: j[1] })) : c.remove() : x && e.addShape("circle", { attrs: r(r({}, k), { x: j[0], y: j[1] }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, })); var P = null; "up" === s ? (P = [E, C]) : "down" === s ? (P = [E, -C]) : "right" === s && (P = [E, E - C]), P && (u ? S || void 0 === S ? u.attr(r(r({}, k), { x: P[0], y: P[1] })) : u.remove() : S && e.addShape("circle", { attrs: r(r({}, k), { x: P[0], y: P[1] }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, })); var A = null; "up" === s ? (A = [E - C, -C]) : "left" === s ? (A = [E, -C]) : "right" === s && (A = [-E, -C]), A && (h ? w || void 0 === w ? h.attr(r(r({}, k), { x: A[0], y: A[1] })) : h.remove() : w && e.addShape("circle", { attrs: r(r({}, k), { x: A[0], y: A[1] }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, })); var I = null; "down" === s ? (I = [-E + C, C]) : "left" === s ? (I = [E, C]) : "right" === s && (I = [-E, C]), I && (l ? O || void 0 === O ? l.attr(r(r({}, k), { x: I[0], y: I[1] })) : l.remove() : O && e.addShape("circle", { attrs: r(r({}, k), { x: I[0], y: I[1] }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, })); }, }, "single-node", ), Object(o.l)( "modelRect", { options: { size: [185, 70], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: o.e.defaultNode.style.lineWidth, fillOpacity: 1, }, labelCfg: { style: { fill: "#595959", fontSize: 14 }, offset: 30, }, descriptionCfg: { style: { fontSize: 12, fill: "#bfbfbf" }, paddingTop: 0, }, preRect: { show: !0, width: 4, fill: "#40a9ff", radius: 2 }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, logoIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, offset: 0, }, stateIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, offset: -5, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, shapeType: "modelRect", drawShape: function (t, e) { var n = this.getOptions(t).preRect, o = void 0 === n ? {} : n, a = this.getShapeStyle(t), s = this.getSize(t), c = s[0], u = s[1], h = e.addShape("rect", { attrs: a, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), l = o.show, f = i(o, ["show"]); return ( l && e.addShape("rect", { attrs: r({ x: -c / 2, y: -u / 2, height: u }, f), className: "pre-rect", name: "pre-rect", draggable: !0, }), this.drawLogoIcon(t, e), this.drawStateIcon(t, e), this.drawLinkPoints(t, e), h ); }, drawLogoIcon: function (t, e) { var n = this.getOptions(t).logoIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || -a / 2 + s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }); } }, drawStateIcon: function (t, e) { var n = this.getOptions(t).stateIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || a / 2 - s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }); } }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, drawLabel: function (t, e) { var n = this.getOptions(t), i = n.labelCfg, o = void 0 === i ? {} : i, s = n.logoIcon, c = void 0 === s ? {} : s, u = n.descriptionCfg, h = void 0 === u ? {} : u, l = this.getSize(t)[0], f = null, d = c.show, p = c.width, g = -l / 2 + o.offset; d && (g = -l / 2 + p + o.offset); var v = o.style, y = h.style, m = h.paddingTop; return ( Object(a.isString)(t.description) ? ((f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: -5, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), e.addShape("text", { attrs: r(r({}, y), { x: g, y: 17 + (m || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, })) : (f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: 7, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), f ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = this.getOptions(t), o = n.style, s = void 0 === o ? {} : o, c = n.labelCfg, u = void 0 === c ? {} : c, h = n.descriptionCfg, l = void 0 === h ? {} : h, f = this.getSize(t), d = f[0], p = f[1]; e.get("keyShape").attr( r(r({}, s), { x: -d / 2, y: -p / 2, width: d, height: p }), ); var g = e.getContainer(), v = g.find(function (t) { return "rect-logo-icon" === t.get("className"); }), y = v ? v.attr() : {}, m = Object(a.mix)({}, y, t.logoIcon), b = m.width; void 0 === b && (b = this.options.logoIcon.width); var x = t.logoIcon ? t.logoIcon.show : void 0, S = u.offset, w = -d / 2 + b + S; x || void 0 === x || (w = -d / 2 + S); var O = g.find(function (t) { return "node-label" === t.get("className"); }), M = g.find(function (t) { return "rect-description" === t.get("className"); }); if (t.label) if (O) { var k = t.labelCfg ? t.labelCfg.style : {}, j = Object(a.mix)({}, O.attr(), k); t.label && (j.text = t.label), (j.x = w), Object(a.isString)(t.description) && (j.y = -5), M && (M.resetMatrix(), M.attr({ x: w })), O.resetMatrix(), O.attr(j); } else g.addShape("text", { attrs: r(r({}, u.style), { x: w, y: t.description ? -5 : 7, text: t.label, }), className: "node-label", name: "node-label", draggable: !0, }); if (Object(a.isString)(t.description)) { var C = l.paddingTop; if (M) { k = t.descriptionCfg ? t.descriptionCfg.style : {}; var E = Object(a.mix)({}, M.attr(), k); Object(a.isString)(t.description) && (E.text = t.description), (E.x = w), M.resetMatrix(), M.attr(r(r({}, E), { y: 17 + (C || 0) })); } else g.addShape("text", { attrs: r(r({}, l.style), { x: w, y: 17 + (C || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, }); } var P = g.find(function (t) { return "pre-rect" === t.get("className"); }); if (P) { var A = Object(a.mix)({}, P.attr(), t.preRect); P.attr(r(r({}, A), { x: -d / 2, y: -p / 2, height: p })); } if (v) if (x || void 0 === x) { var I = m.width, T = m.height, N = m.x, B = m.y, L = m.offset, D = i(m, ["width", "height", "x", "y", "offset"]); v.attr( r(r({}, D), { x: N || -d / 2 + I + L, y: B || -T / 2, width: I, height: T, }), ); } else v.remove(); else x && this.drawLogoIcon(t, g); var _ = g.find(function (t) { return "rect-state-icon" === t.get("className"); }), R = _ ? _.attr() : {}, F = Object(a.mix)({}, R, t.stateIcon); if (_) { F.show || void 0 === F.show || _.remove(); var Y = F.width, X = ((T = F.height), (N = F.x), (B = F.y), F.offset), z = i(F, ["width", "height", "x", "y", "offset"]); _.attr( r(r({}, z), { x: N || d / 2 - Y + X, y: B || -T / 2, width: Y, height: T, }), ); } else F.show && this.drawStateIcon(t, g); this.updateLinkPoints(t, g); }, }, "single-node", ), Object(o.l)( "star", { options: { size: 60, style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "star", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.leftBottom, h = o.rightBottom, l = o.size, f = o.r, d = i(o, [ "top", "left", "right", "leftBottom", "rightBottom", "size", "r", ]), p = this.getSize(t)[0]; if (c) { var g = Math.cos(0.1 * Math.PI) * p, v = Math.sin(0.1 * Math.PI) * p; e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right", name: "link-point-right", }); } if (a) { (g = Math.cos(0.5 * Math.PI) * p), (v = Math.sin(0.5 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-top", name: "link-point-top", }); } if (s) { (g = Math.cos(0.9 * Math.PI) * p), (v = Math.sin(0.9 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left", name: "link-point-left", }); } if (u) { (g = Math.cos(1.3 * Math.PI) * p), (v = Math.sin(1.3 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left-bottom", name: "link-point-left-bottom", }); } if (h) { (g = Math.cos(1.7 * Math.PI) * p), (v = Math.sin(1.7 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right-bottom", name: "link-point-right-bottom", }); } }, getPath: function (t) { for ( var e = this.getSize(t)[0], n = (3 * e) / 8, r = t.innerR || n, i = [], o = 0; o < 5; o++ ) { var a = Math.cos(((18 + 72 * o) / 180) * Math.PI) * e, s = Math.sin(((18 + 72 * o) / 180) * Math.PI) * e, c = Math.cos(((54 + 72 * o) / 180) * Math.PI) * r, u = Math.sin(((54 + 72 * o) / 180) * Math.PI) * r; 0 === o ? i.push(["M", a, -s]) : i.push(["L", a, -s]), i.push(["L", c, -u]); } return i.push(["Z"]), i; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), s = e.find(function (t) { return "link-point-top" === t.get("className"); }), c = e.find(function (t) { return "link-point-left-bottom" === t.get("className"); }), u = e.find(function (t) { return "link-point-right-bottom" === t.get("className"); }), h = n, l = i || o || s || c || u; l && (h = l.attr()); var f = Object(a.mix)({}, h, t.linkPoints), d = f.fill, p = f.stroke, g = f.lineWidth, v = f.size / 2; v || (v = f.r); var y = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, leftBottom: void 0, rightBottom: void 0, }, m = y.left, b = y.right, x = y.top, S = y.leftBottom, w = y.rightBottom, O = this.getSize(t)[0], M = { r: v, fill: d, stroke: p, lineWidth: g }, k = Math.cos(0.1 * Math.PI) * O, j = Math.sin(0.1 * Math.PI) * O; o ? b || void 0 === b ? o.attr(r(r({}, M), { x: k, y: -j })) : o.remove() : b && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), (k = Math.cos(0.5 * Math.PI) * O), (j = Math.sin(0.5 * Math.PI) * O), s ? x || void 0 === x ? s.attr(r(r({}, M), { x: k, y: -j })) : s.remove() : x && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), (k = Math.cos(0.9 * Math.PI) * O), (j = Math.sin(0.9 * Math.PI) * O), i ? m || void 0 === m ? i.attr(r(r({}, M), { x: k, y: -j })) : i.remove() : m && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), (k = Math.cos(1.3 * Math.PI) * O), (j = Math.sin(1.3 * Math.PI) * O), c ? S || void 0 === S ? c.attr(r(r({}, M), { x: k, y: -j })) : c.remove() : S && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-left-bottom", name: "link-point-left-bottom", isAnchorPoint: !0, }), (k = Math.cos(1.7 * Math.PI) * O), (j = Math.sin(1.7 * Math.PI) * O), u ? w || void 0 === w ? u.attr(r(r({}, M), { x: k, y: -j })) : c.remove() : w && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-right-bottom", name: "link-point-right-bottom", isAnchorPoint: !0, }); }, }, "single-node", ); var s = o.h.defaultSubjectColors; Object(o.l)( "donut", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), c = Object(a.deepMix)({}, i, t.icon), u = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, name: "".concat(this.type, "-keyShape"), }), h = c.width, l = c.height, f = c.show, d = c.text; f && (d ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, c, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -h / 2, y: -l / 2 }, c), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })); var p = u.attr("r"), g = 0.6 * p, v = (p + g) / 2, y = t, m = y.donutAttrs, b = void 0 === m ? {} : m, x = y.donutColorMap, S = void 0 === x ? {} : x, w = Object.keys(b).length; if (b && w > 1) { var O = [], M = 0; if ( (Object.keys(b).forEach(function (t) { var e = b[t] || 0; Object(a.isNumber)(e) && (O.push({ key: t, value: e, color: S[t] }), (M += e)); }), M) ) { var k = p - g; if (1 === w) return void e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: O[0].color || s[0], lineWidth: k, }, name: "fan-shape-0", }); var j = [v, 0], C = 0; O.forEach(function (t, n) { var r = t.value / M; if (!(r < 0.001)) if ((r > 0.999 && (r = 1), 1 !== r)) { (t.percent = r), (t.angle = r * Math.PI * 2), (t.beginAgnle = C), (C += t.angle), (t.endAngle = C), (t.arcBegin = j), (t.arcEnd = [ v * Math.cos(t.endAngle), -v * Math.sin(t.endAngle), ]); var i = t.angle > Math.PI ? 1 : 0, o = [ ["M", t.arcBegin[0], t.arcBegin[1]], ["A", v, v, 0, i, 0, t.arcEnd[0], t.arcEnd[1]], ["L", t.arcEnd[0], t.arcEnd[1]], ]; e.addShape("path", { attrs: { path: o, lineWidth: k, stroke: t.color || s[n % s.length], }, name: "fan-shape-".concat(n), }), (j = t.arcEnd); } else e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: t.color || s[n % s.length], lineWidth: k, }, name: "fan-shape-".concat(n), }); }); } } return this.drawLinkPoints(t, e), u; }, update: void 0, }, "circle", ); var c = function (t) { var e = t.x, n = t.y; return { x: e, y: n, centerX: e, centerY: n, minX: e, minY: n, maxX: e, maxY: n, height: 0, width: 0, }; }, u = function (t) { for (var e = [], n = {}, r = t.length - 1; r >= 0; r--) { var i = t[r]; (i.id = "".concat(i.x, "|||").concat(i.y)), (n[i.id] = i), e.push(i); } return e; }, h = function (t) { return u(t); }, l = function (t, e) { return t.width || t.height ? { centerX: t.centerX, centerY: t.centerY, minX: t.minX - e, minY: t.minY - e, maxX: t.maxX + e, maxY: t.maxY + e, height: t.height + 2 * e, width: t.width + 2 * e, } : t; }, f = function (t, e, n) { var r = (function (t, e) { var n = Math.abs(t.x - e.centerX), r = Math.abs(t.y - e.centerY); return 0 === n && 0 === r ? 0 : n / e.width > r / e.height; })(e, t); if (0 === r) { var i = t.centerX, o = t.centerY; return ( n.y < e.y ? (o = t.minY) : n.x > e.x ? (i = t.maxX) : n.x < e.x ? (i = t.minX) : n.x === e.x && (o = t.maxY), { x: i, y: o } ); } return r ? { x: e.x > t.centerX ? t.maxX : t.minX, y: e.y } : { x: e.x, y: e.y > t.centerY ? t.maxY : t.minY }; }, d = function (t, e) { var n = Math.min(t.minX, e.minX), r = Math.min(t.minY, e.minY), i = Math.max(t.maxX, e.maxX), o = Math.max(t.maxY, e.maxY); return { centerX: (n + i) / 2, centerY: (r + o) / 2, minX: n, minY: r, maxX: i, maxY: o, height: o - r, width: i - n, }; }, p = function (t) { return [ { x: t.minX, y: t.minY }, { x: t.maxX, y: t.minY }, { x: t.maxX, y: t.maxY }, { x: t.minX, y: t.maxY }, ]; }, g = function (t, e) { var n = t.x, r = t.y; return n < e.minX || n > e.maxX || r < e.minY || r > e.maxY; }, v = function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, y = function (t, e, n, r, i) { return ( v(t, e) + v(t, n) + (function (t, e) { var n = 0; return ( e.forEach(function (e) { e && (t.x === e.x && (n += -2), t.y === e.y && (n += -2)); }), n ); })(t, [e, n, r, i]) ); }, m = function t(e, n, r, i, o) { void 0 === o && (o = 0), e.unshift(n[i]), r[i] && r[i] !== i && o <= 100 && t(e, n, r, r[i], o + 1); }, b = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = r.x - t.x, s = r.y - t.y, c = n.x - e.x, u = n.y - e.y, h = r.x - e.x, l = r.y - e.y; return ( (i * s - o * a) * (c * l - u * h) <= 0 && (i * u - o * c) * (a * l - s * h) <= 0 ); }, x = function (t, e, n) { if (n.width || n.height) { var r = p(n), i = r[0], o = r[1], a = r[2], s = r[3]; return ( b(t, e, i, o) || b(t, e, i, s) || b(t, e, o, a) || b(t, e, a, s) ); } return !1; }, S = function (t, e, n, r) { var i = []; return ( t.forEach(function (t) { if (t !== e && (t.x === e.x || t.y === e.y)) { if (x(t, e, n) || x(t, e, r)) return; i.push(t); } }), u(i) ); }, w = function (t, e) { var n = [], r = t[0]; return ( n.push("M".concat(r.x, " ").concat(r.y)), t.forEach(function (r, i) { var o = t[i + 1], a = t[i + 2]; if (o && a) if ( (function (t, e, n) { return !( (t.x === e.x && e.x === n.x) || (t.y === e.y && e.y === n.y) ); })(r, o, a) ) { var s = (function (t, e, n, r) { var i = v(t, e), o = v(n, e); return ( i < r && (r = i), o < r && (r = o), [ { x: e.x - (r / i) * (e.x - t.x), y: e.y - (r / i) * (e.y - t.y), }, { x: e.x - (r / o) * (e.x - n.x), y: e.y - (r / o) * (e.y - n.y), }, ] ); })(r, o, a, e), c = s[0], u = s[1]; n.push("L".concat(c.x, " ").concat(c.y)), n.push( "Q" .concat(o.x, " ") .concat(o.y, " ") .concat(u.x, " ") .concat(u.y), ), n.push("L".concat(u.x, " ").concat(u.y)); } else n.push("L".concat(o.x, " ").concat(o.y)); else o && n.push("L".concat(o.x, " ").concat(o.y)); }), n.join("") ); }, O = function (t, e, n, r, i) { var o, a; if (n && n.getType()) if ("combo" === n.getType()) { ((o = n.getKeyShape().getCanvasBBox() || c(t)).centerX = (o.minX + o.maxX) / 2), (o.centerY = (o.minY + o.maxY) / 2); } else o = n.getBBox(); else o = c(t); if (r && r.getType()) if ("combo" === r.getType()) { var s = r.getKeyShape().getBBox(); if (s) { var b = r.getModel(), x = b.x, w = b.y; ((a = { x: x, y: w, width: s.width, height: s.height, minX: s.minX + x, maxX: s.maxX + x, minY: s.minY + w, maxY: s.maxY + w, }).centerX = (a.minX + a.maxX) / 2), (a.centerY = (a.minY + a.maxY) / 2); } else a = c(e); } else a = r && r.getBBox(); else a = c(e); var O = l(o, i), M = l(a, i), k = f(O, t, e), j = f(M, e, t), C = (function (t) { void 0 === t && (t = []); var e = [], n = []; t.forEach(function (t) { e.push(t.x), n.push(t.y); }); var r = Math.min.apply(Math, e), i = Math.max.apply(Math, e), o = Math.min.apply(Math, n), a = Math.max.apply(Math, n); return { centerX: (r + i) / 2, centerY: (o + a) / 2, maxX: i, maxY: a, minX: r, minY: o, height: a - o, width: i - r, }; })([k, j]), E = d(O, C), P = d(M, C), A = []; A = A.concat(p(E)).concat(p(P)); var I = { x: (t.x + e.x) / 2, y: (t.y + e.y) / 2 }; [C, E, P].forEach(function (t) { A = A.concat( (function (t, e) { return (function (t, e) { return e < t.minX || e > t.maxX ? [] : [ { x: e, y: t.minY }, { x: e, y: t.maxY }, ]; })(t, e.x).concat( (function (t, e) { return e < t.minY || e > t.maxY ? [] : [ { x: t.minX, y: e }, { x: t.maxX, y: e }, ]; })(t, e.y), ); })(t, I).filter(function (t) { return g(t, O) && g(t, M); }), ); }), [ { x: k.x, y: j.y }, { x: j.x, y: k.y }, ].forEach(function (t) { g(t, O) && g(t, M) && A.push(t); }), A.unshift(k), A.push(j); var T = (function (t, e, n, r, i, o, a) { var s = [], c = [e], u = {}, h = {}, l = {}; (h[e.id] = 0), (l[e.id] = y(e, n, e)); var f, d, p, g, b, x = {}; for ( t.forEach(function (t) { x[t.id] = t; }); c.length; ) { if ( ((f = void 0), (d = 1 / 0), c.forEach(function (t) { l[t.id] <= d && ((d = l[t.id]), (f = t)); }), f === n) ) { var w = []; return m(w, x, u, n.id), w; } (g = f), (b = void 0), (b = (p = c).indexOf(g)) > -1 && p.splice(b, 1), s.push(f), S(t, f, r, i).forEach(function (t) { if (-1 === s.indexOf(t)) { -1 === c.indexOf(t) && c.push(t); var r = l[f.id] + v(f, t); (h[t.id] && r >= h[t.id]) || ((u[t.id] = f.id), (h[t.id] = r), (l[t.id] = h[t.id] + y(t, n, e, o, a))); } }); } return [e, n]; })((A = u(A)), k, j, o, a, t, e); return T.unshift(t), T.push(e), h(T); }, M = { offset: 20, maxAllowedDirectionChange: Math.PI / 2, maximumLoops: 2e3, gridSize: 10, directions: [ { stepX: 1, stepY: 0 }, { stepX: -1, stepY: 0 }, { stepX: 0, stepY: 1 }, { stepX: 0, stepY: -1 }, ], get penalties() { return { 0: 0, 45: this.gridSize / 2, 90: this.gridSize / 2 }; }, distFunc: function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, fallbackRoute: function (t, e, n, r, i) { return h(O(t, e, n, r, i.offset)); }, }, k = (Math.PI, function (t, e) { var n = Math.round(Math.abs(t / e)); return n < 0 ? 0 : (t < 0 ? -1 : 1) * n; }), j = function (t, e) { var n = e.x - t.x, r = e.y - t.y; return n || r ? Math.atan2(r, n) : 0; }, C = function (t, e) { var n = Math.abs(t - e); return n > Math.PI ? 2 * Math.PI - n : n; }, E = function (t, e, n) { for (var r = 1 / 0, i = 0, o = e.length; i < o; i++) { var a = n(t, e[i]); a < r && (r = a); } return r; }, P = function (t, e, n, r, i) { var a = []; if (!n) return [t]; var s = i.directions, c = i.offset, u = n.getBBox(), h = e.x > u.minX && e.x < u.maxX && e.y > u.minY && e.y < u.maxY, d = l(u, c); for (var p in d) d[p] = k(d[p], i.gridSize); if (h) { for (var g = 0, v = s; g < v.length; g++) { var y = v[g], m = [ [ { x: d.minX, y: d.minY }, { x: d.maxX, y: d.minY }, ], [ { x: d.minX, y: d.minY }, { x: d.minX, y: d.maxY }, ], [ { x: d.maxX, y: d.minY }, { x: d.maxX, y: d.maxY }, ], [ { x: d.minX, y: d.maxY }, { x: d.maxX, y: d.maxY }, ], ]; for (p = 0; p < 4; p++) { var b = m[p], S = o.h.getLineIntersect( t, { x: t.x + y.stepX * d.width, y: t.y + y.stepY * d.height }, b[0], b[1], ); S && !x(t, S, u) && ((S.id = "".concat(S.x, "|||").concat(S.y)), a.push(S)); } } return a; } var w = f(d, t, r); return (w.id = "".concat(w.x, "|||").concat(w.y)), [w]; }, A = function (t, e, n, r) { var i = j(t, e); if (!n[t.id]) { var o = j(r, t); return C(o, i); } var a = j({ x: n[t.id].x, y: n[t.id].y }, t); return C(a, i); }, I = function (t, e, n, r, i, o, a) { var s = [r], c = t.id, u = t.x, h = t.y, l = { x: u, y: h, id: c }; for ( A(l, o, e, n) && s.unshift({ x: o.x === r.x ? r.x : l.x * a, y: o.y === r.y ? r.y : l.y * a, }); e[c] && e[c].id !== c; ) { var f = { x: u, y: h, id: c }, d = e[c].id, p = e[c].x, g = e[c].y, v = { x: p, y: g, id: d }; A(v, f, e, n) && s.unshift({ x: v.x === f.x ? s[0].x : v.x * a, y: v.y === f.y ? s[0].y : v.y * a, }), (c = d), (u = p), (h = g); } var y = u, m = h; return ( (s[0].x = y === n.x ? i.x : s[0].x), (s[0].y = m === n.y ? i.y : s[0].y), s.unshift(i), s ); }, T = function (t, e, n, r, i) { if (isNaN(t.x) || isNaN(e.x)) return []; var o = Object(a.deepMix)(M, i); o.obstacles = o.obstacles || []; var s = o.gridSize, c = (function (t, e, n) { var r = {}; return ( t.forEach(function (t) { if (t) for ( var i = l(t.getBBox(), n), o = k(i.minX, e); o <= k(i.maxX, e); o += 1 ) for (var a = k(i.minY, e); a <= k(i.maxY, e); a += 1) r["".concat(o, "|||").concat(a)] = !0; }), r ); })(o.obstacles.concat([n, r]), s, o.offset), u = { x: k(t.x, s), y: k(t.y, s) }, h = { x: k(e.x, s), y: k(e.y, s) }; (t.id = "".concat(u.x, "|||").concat(u.y)), (e.id = "".concat(h.x, "|||").concat(h.y)); var f = P(u, t, n, h, o), d = P(h, e, r, u, o); f.forEach(function (t) { delete c[t.id]; }), d.forEach(function (t) { delete c[t.id]; }); for ( var p = {}, g = {}, v = {}, y = {}, m = {}, b = 0; b < f.length; b++ ) { var x = f[b]; (p[x.id] = x), (y[x.id] = 0), (m[x.id] = E(x, d, o.distFunc)); } for ( var S, w, O, j, C, T, N, B = o.maximumLoops, L = o.penalties; Object.keys(p).length > 0 && B > 0 && ((S = void 0), (w = 1 / 0), Object.keys(p).forEach(function (t) { var e = p[t].id; m[e] <= w && ((w = m[e]), (S = p[e])); }), S); ) { if ( d.findIndex(function (t) { return t.x === S.x && t.y === S.y; }) > -1 ) return I(S, v, u, e, t, h, s); delete p[S.id], (g[S.id] = !0); for (b = 0; b < o.directions.length; b++) (O = o.directions[b]), g[ (j = { x: S.x + O.stepX, y: S.y + O.stepY, id: "" .concat(Math.round(S.x) + O.stepX, "|||") .concat(Math.round(S.y) + O.stepY), }).id ] || (N = A(S, j, v, u)) > o.maxAllowedDirectionChange || c[j.id] || (p[j.id] || (p[j.id] = j), (C = o.distFunc(S, j) + (isNaN(L[N]) ? s : L[N])), (T = y[S.id] + C), (y[j.id] && T >= y[j.id]) || ((v[j.id] = S), (y[j.id] = T), (m[j.id] = T + E(j, d, o.distFunc)))); B -= 1; } return o.fallbackRoute(t, e, n, r, o); }; Object(o.k)( "polyline", { options: { color: o.e.defaultEdge.color, size: o.e.defaultEdge.size, style: { radius: 0, offset: 15, x: 0, y: 0, stroke: o.e.defaultEdge.style.stroke, lineAppendWidth: o.e.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: o.e.edgeLabel.style.fill, fontSize: o.e.edgeLabel.style.fontSize, }, }, routeCfg: { obstacles: [], maxAllowedDirectionChange: Math.PI, maximumLoops: 500, gridSize: 10, }, stateStyles: r({}, o.e.edgeStateStyles), }, shapeType: "polyline", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( 0 === n.radius && delete n.radius, e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(a.mix)({}, e, n, t.style); (t = this.getPathPoints(t)), (this.radius = r.radius), (this.offset = r.offset); var i = t.startPoint, s = t.endPoint, c = this.getControlPoints(t), u = [i]; c && (u = u.concat(c)), u.push(s); var h = t.sourceNode, l = t.targetNode, f = r.radius, d = this.options.routeCfg, p = Object(a.mix)({}, d, t.routeCfg); p.offset = r.offset; var g = this.getPath(u, h, l, f, p); return ( ((Object(a.isArray)(g) && g.length <= 1) || (Object(a.isString)(g) && -1 === g.indexOf("L"))) && (g = "M0 0, L0 0"), (isNaN(i.x) || isNaN(i.y) || isNaN(s.x) || isNaN(s.y)) && (g = "M0 0, L0 0"), Object(a.mix)({}, o.e.defaultEdge.style, r, { lineWidth: t.size, path: g, }) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(); if (e.isVisible()) { var r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, s = (t = this.getPathPoints(t)).startPoint, c = t.endPoint, u = this.getControlPoints(t), h = [s]; u && (h = h.concat(u)), h.push(c); var l = i.attr(), f = Object(a.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = f.radius, v = this.options.routeCfg, y = Object(a.mix)({}, v, t.routeCfg); y.offset = f.offset; var m = this.getPath(h, d, p, g, y); ((Object(a.isArray)(m) && m.length <= 1) || (Object(a.isString)(m) && -1 === m.indexOf("L"))) && (m = "M0 0, L0 0"), (isNaN(s.x) || isNaN(s.y) || isNaN(c.x) || isNaN(c.y)) && (m = "M0 0, L0 0"), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var b = Object(a.mix)( r, i.attr(), { lineWidth: o, path: m }, t.style, ); i && i.attr(b); } }, getPath: function (t, e, n, r, i) { var s = i.offset, c = i.simple; if (!s || t.length > 2) { if (r) return w(t, r); var u = []; return ( Object(a.each)(t, function (t, e) { 0 === e ? u.push(["M", t.x, t.y]) : u.push(["L", t.x, t.y]); }), u ); } var h = c ? O(t[t.length - 1], t[0], n, e, s) : T(t[0], t[t.length - 1], e, n, i); return h && h.length ? r ? w(h, r) : o.h.pointsToPolygon(h) : "M0 0, L0 0"; }, }, "single-edge", ); }, 424: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(2), a = n(41), s = a.a.cloneEvent, c = a.a.isNaN, u = Math.abs, h = { getDefaultCfg: function () { return { direction: "both", enableOptimize: !1, scalableRange: 0, allowDragOnItem: !1, }; }, getEvents: function () { return { dragstart: "onDragStart", drag: "onDragMove", dragend: "onDragEnd", }; }, updateViewport: function (t) { var e = this.origin, n = +t.clientX, r = +t.clientY; if (!c(n) && !c(r)) { var i = n - e.x, o = r - e.y; "x" === this.get("direction") ? (o = 0) : "y" === this.get("direction") && (i = 0), (this.origin = { x: n, y: r }); var a = this.graph.get("width"), s = this.graph.get("height"), u = this.graph.get("canvas").getCanvasBBox(); ((u.minX <= a + this.scalableRange && u.minX + i > a + this.scalableRange) || (u.maxX + this.scalableRange >= 0 && u.maxX + this.scalableRange + i < 0)) && (i = 0), ((u.minY <= s + this.scalableRange && u.minY + o > s + this.scalableRange) || (u.maxY + this.scalableRange >= 0 && u.maxY + this.scalableRange + o < 0)) && (o = 0), this.graph.translate(i, o); } }, onDragStart: function (t) { t.originalEvent; if (this.shouldBegin.call(this, t)) { var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ( (this.allowDragOnItem || n) && ((this.origin = { x: t.clientX, y: t.clientY }), (this.dragging = !1), this.enableOptimize) ) { for ( var r = this.graph, i = r.getEdges(), o = 0, a = i.length; o < a; o++ ) { var s = i[o].get("group").get("children"); s && s.forEach(function (t) { t.set( "ori-visibility", t.get("ori-visibility") || t.get("visible"), ), t.hide(); }); } for (var c = r.getNodes(), u = 0, h = c.length; u < h; u++) for ( var l = 0, f = c[u].getContainer().get("children"); l < f.length; l++ ) { var d = f[l]; d.get("isKeyShape") || (d.set( "ori-visibility", d.get("ori-visibility") || d.get("visible"), ), d.hide()); } } } }, onDragMove: function (t) { this.graph; var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ((this.allowDragOnItem || n) && ((t = s(t)), this.origin)) { if (!this.dragging) { if ( u(this.origin.x - t.clientX) + u(this.origin.y - t.clientY) < 10 ) return; this.shouldBegin.call(this, t) && ((t.type = "dragstart"), (this.dragging = !0)); } this.shouldUpdate.call(this, t) && this.updateViewport(t); } }, onDragEnd: function (t) { var e = this.graph; if (this.enableOptimize) { for (var n = e.getEdges(), r = 0, i = n.length; r < i; r++) { var o = n[r].get("group").get("children"); o && o.forEach(function (t) { t.get("ori-visibility") && t.show(); }); } for (var a = e.getNodes(), c = 0, u = a.length; c < u; c++) for ( var h = 0, l = a[c].getContainer().get("children"); h < l.length; h++ ) { var f = l[h]; if (!f.get("isKeyShape")) f.get("ori-visibility") && f.show(); } } this.dragging ? ((t = s(t)), this.shouldEnd.call(this, t) && this.updateViewport(t), (t.type = "dragend"), this.endDrag()) : (this.origin = null); }, endDrag: function () { (this.origin = null), (this.dragging = !1), (this.dragbegin = !1); }, }, l = n(22), f = { getDefaultCfg: function () { return { updateEdge: !0, delegateStyle: {}, enableDelegate: !1, onlyChangeComboSize: !1, comboActiveState: "", selectedState: "selected", }; }, getEvents: function () { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", "combo:drop": "onDropCombo", "node:drop": "onDropNode", "canvas:drop": "onDropCanvas", }; }, validationCombo: function (t) { return ( !(!this.origin || !t || t.destroyed) && "combo" === t.getType() ); }, onDragStart: function (t) { var e = this; if (this.shouldBegin.call(this, t)) { var n = t.item; if (n && !n.destroyed && !n.hasLocked()) { var r = t.target; if (r) if (r.get("isAnchorPoint")) return; var o = this.graph; (this.targets = []), (this.targetCombo = null); var a = o.findAllByState("node", this.selectedState), s = n.get("id"); 0 === a.filter(function (t) { var e = t.get("id"); return s === e; }).length ? this.targets.push(n) : a.length > 1 ? a.forEach(function (t) { t.hasLocked() || e.targets.push(t); }) : this.targets.push(n); var c = []; this.targets.forEach(function (t) { c.push(Object(i.clone)(t.getModel())); }), this.set("beforeDragNodes", c), (this.origin = { x: t.x, y: t.y }), (this.point = {}), (this.originPoint = {}); } } }, onDrag: function (t) { var e = this; this.origin && this.shouldUpdate(this, t) && (this.get("enableDelegate") ? this.updateDelegate(t) : this.targets.map(function (n) { e.update(n, t); })); }, onDragEnd: function (t) { if (this.origin && this.shouldEnd.call(this, t)) { var e = t.item; if (e) e.getContainer().set("capture", !0); this.delegateRect && (this.delegateRect.remove(), (this.delegateRect = null)), this.updatePositions(t); var n = this.graph; if (n.get("enabledStack")) { var r = { before: { nodes: this.get("beforeDragNodes"), edges: [], combos: [], }, after: { nodes: [], edges: [], combos: [] }, }; this.targets.forEach(function (t) { r.after.nodes.push(t.getModel()); }), n.pushStack("update", Object(i.clone)(r)); } n.emit("dragnodeend", { items: this.targets, targetItem: null }), (this.point = {}), (this.origin = null), (this.originPoint = {}), (this.targets.length = 0), (this.targetCombo = null); } }, onDropCombo: function (t) { var e = t.item; if (this.validationCombo(e)) { this.updatePositions(t); var n = this.graph; if ( (this.comboActiveState && n.setItemState(e, this.comboActiveState, !1), (this.targetCombo = e), this.onlyChangeComboSize) ) n.updateCombos(); else { var r = e.getModel(); this.targets.map(function (t) { t.getModel().comboId !== r.id && n.updateComboTree(t, r.id); }), n.updateCombo(e); } n.emit("dragnodeend", { items: this.targets, targetItem: this.targetCombo, }); } }, onDropCanvas: function (t) { var e = this.graph; this.targets && 0 !== this.targets.length && (this.updatePositions(t), this.onlyChangeComboSize ? e.updateCombos() : this.targets.map(function (t) { t.getModel().comboId && e.updateComboTree(t); })); }, onDropNode: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.graph, r = e.getModel().comboId; if (r) { var i = n.findById(r); this.comboActiveState && n.setItemState(i, this.comboActiveState, !1), this.targets.map(function (t) { var e = t.getModel(); r !== e.comboId && n.updateComboTree(t, r); }), n.updateCombo(i); } else this.targets.map(function (t) { t.getModel().comboId && n.updateComboTree(t); }); n.emit("dragnodeend", { items: this.targets, targetItem: e }); } }, onDragEnter: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !0); } }, onDragLeave: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !1); } }, updatePositions: function (t) { var e = this; this.targets && 0 !== this.targets.length && this.get("enableDelegate") && this.targets.map(function (n) { return e.update(n, t); }); }, update: function (t, e) { var n = this.origin, r = t.get("model"), i = t.get("id"); this.point[i] || (this.point[i] = { x: r.x || 0, y: r.y || 0 }); var o = { x: e.x - n.x + this.point[i].x, y: e.y - n.y + this.point[i].y, }; this.get("updateEdge") ? this.graph.updateItem(t, o, !1) : t.updatePosition(o); }, updateDelegate: function (t) { this.graph; if (this.delegateRect) { var e = t.x - this.origin.x + this.originPoint.minX, n = t.y - this.origin.y + this.originPoint.minY; this.delegateRect.attr({ x: e, y: n }); } else { var o = this.graph.get("group"), a = Object(i.deepMix)( {}, l.a.delegateStyle, this.delegateStyle, ), s = this.calculationGroupPosition(t), c = s.x, u = s.y, h = s.width, f = s.height, d = s.minX, p = s.minY; (this.originPoint = { x: c, y: u, width: h, height: f, minX: d, minY: p, }), (this.delegateRect = o.addShape("rect", { attrs: Object(r.a)({ width: h, height: f, x: c, y: u }, a), name: "rect-delegate-shape", })); } }, calculationGroupPosition: function (t) { var e = this.graph.findAllByState("node", this.selectedState); 0 === e.length && e.push(t.item); for ( var n = 1 / 0, r = -1 / 0, i = 1 / 0, o = -1 / 0, a = 0; a < e.length; a++ ) { var s = e[a].getBBox(), c = s.minX, u = s.minY, h = s.maxX, l = s.maxY; c < n && (n = c), u < i && (i = u), h > r && (r = h), l > o && (o = l); } return { x: Math.floor(n), y: Math.floor(i), width: Math.ceil(r) - Math.floor(n), height: Math.ceil(o) - Math.floor(i), minX: n, minY: i, }; }, }, d = { getDefaultCfg: function () { return { multiple: !0, selectedState: "selected" }; }, getEvents: function () { return { "node:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onCanvasClick", }; }, onClick: function (t) { var e = this, n = t.item; if (n && !n.destroyed) { var r = n.getType(), o = e.graph, a = e.multiple, s = e.shouldUpdate; if (e.shouldBegin.call(e, t)) { if (!a) { var c = o.findAllByState(r, e.selectedState); Object(i.each)(c, function (t) { t !== n && o.setItemState(t, e.selectedState, !1); }); } if (n.hasState(e.selectedState)) { s.call(e, t) && o.setItemState(n, e.selectedState, !1); var u = o.findAllByState("node", e.selectedState), h = o.findAllByState("combo", e.selectedState); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !1, }); } else { s.call(e, t) && o.setItemState(n, e.selectedState, !0); (u = o.findAllByState("node", e.selectedState)), (h = o.findAllByState("combo", e.selectedState)); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !0, }); } } } }, onCanvasClick: function () { var t = this, e = this.graph, n = e.findAllByState("node", this.selectedState); Object(i.each)(n, function (n) { e.setItemState(n, t.selectedState, !1); }); var r = e.findAllByState("combo", this.selectedState); Object(i.each)(r, function (n) { e.setItemState(n, t.selectedState, !1); }), e.emit("nodeselectchange", { selectedItems: { nodes: [], edges: [], combos: [] }, select: !1, }); }, }, p = { firstScale: null, getDefaultCfg: function () { return { originScale: 1, sensitivity: 2, minZoom: void 0, maxZoom: void 0, enableOptimize: !1, optimizeZoom: 0.1, fixSelectedItems: { fixAll: !1, fixLineWidth: !1, fixLabel: !1, fixState: "selected", }, }; }, getEvents: function () { var t = this.fixSelectedItems; return ( t.fixState || (t.fixState = "selected"), t.fixAll && ((t.fixLineWidth = !0), (t.fixLabel = !0)), { pinchstart: "onPinch", pinchmove: "onPinch" } ); }, onPinch: function (t) { t.preventDefault && t.preventDefault(), t.originalEvent.preventDefault && t.originalEvent.preventDefault(); var e = t.originalEvent.pointers; if (!(e.length < 2)) { "pinchstart" === t.type && (this.firstScale = this.graph.getZoom()); var n = t.originalEvent.scale || t.originalEvent.srcEvent.extra.scale, r = this.firstScale * n; this.currentScale = r; var i = this.get("minZoom") || this.graph.get("minZoom"); if ( !( r > (this.get("maxZoom") || this.graph.get("maxZoom")) || r < i ) ) { var o = this.graph.get("canvas"), a = e[0].clientX, s = e[0].clientY, c = e[1].clientX, u = e[1].clientY, h = o.getPointByClient((a + c) / 2, (s + u) / 2); this.graph.zoomTo(r, { x: h.x, y: h.y }); } } }, }, g = ["tap", "dbltap"], v = { getDefaultCfg: function () { return { trigger: "tap", onChange: function () {} }; }, getEvents: function () { var t, e; return ( g.includes(this.trigger) ? (e = this.trigger) : ((e = "tap"), console.warn( "Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["node:" + e] = "onNodeTap"), (t.touchstart = "onNodeTap"), t ); }, onNodeTap: function (t) { var e = t.item, n = this.graph.findDataById(e.get("id")); if (n) { var r = n.children; if (r && 0 !== r.length) { var i = !n.collapsed; if ( this.shouldBegin(t, i) && ((n.collapsed = i), (e.getModel().collapsed = i), this.graph.emit("itemcollapsed", { item: t.item, collapsed: i, }), this.shouldUpdate(t, i)) ) { try { this.onChange(e, i); } catch (t) { console.warn(t); } this.graph.layout(); } } } }, }, y = a.a.calculationItemsBBox, m = function (t, e) { if (!1 !== e(t) && t) { var n = t.get("combos"); if (0 === n.length) return !1; Object(i.each)(n, function (t) { m(t, e); }); } }, b = ["click", "dblclick"], x = ["tap", "drag"], S = ["shift", "ctrl", "control", "alt", "meta", void 0], w = { bind: function (t) { "drag-canvas" === this.type && t.get("canvas").set("draggable", !0); var e = this.events; (this.graph = t), Object(i.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; "drag-canvas" === this.type && t.get("canvas").set("draggable", !1), (this.graph = null), Object(i.each)(e, function (e, n) { t.off(n, e); }); }, }, O = { "drag-canvas": h, "zoom-canvas": p, "drag-node": f, "activate-relations": { getDefaultCfg: function () { return { activeState: "active", inactiveState: "inactive", resetSelected: !1, shouldUpdate: function () { return !0; }, }; }, getEvents: function () { return { "node:tap": "setAllItemStates", "canvas:tap": "clearAllItemStates", }; }, setAllItemStates: function (t) { var e = t.item, n = this.graph; if ( ((this.item = e), this.shouldUpdate(t.item, { event: t, action: "activate" })) ) { for ( var r = this.activeState, i = this.inactiveState, o = n.getNodes(), a = n.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u], l = h.hasState("selected"); this.resetSelected && l && n.setItemState(h, "selected", !1), n.setItemState(h, r, !1), i && n.setItemState(h, i, !0); } for (u = 0; u < c; u++) { var f = a[u]; n.setItemState(f, r, !1), i && n.setItemState(f, i, !0); } i && n.setItemState(e, i, !1), n.setItemState(e, r, !0); var d = e.getEdges(), p = d.length; for (u = 0; u < p; u++) { var g = void 0; (g = (f = d[u]).getSource() === e ? f.getTarget() : f.getSource()), i && n.setItemState(g, i, !1), n.setItemState(g, r, !0), n.setItemState(f, i, !1), n.setItemState(f, r, !0), f.toFront(); } n.emit("afteractivaterelations", { item: t.item, action: "activate", }); } }, clearActiveState: function (t) { var e = this.get("graph"); if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { var n = this.activeState, r = this.inactiveState, i = e.get("autoPaint"); e.setAutoPaint(!1); for ( var o = e.getNodes(), a = e.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u]; e.clearItemStates(h, [n, r]); } for (u = 0; u < c; u++) { var l = a[u]; e.clearItemStates(l, [n, r, "deactivate"]); } e.paint(), e.setAutoPaint(i), e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, clearAllItemStates: function (t) { var e = this.graph; if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { for ( var n = this.activeState, r = this.inactiveState, i = e.getNodes(), o = e.getEdges(), a = i.length, s = o.length, c = 0; c < a; c++ ) { var u = i[c]; e.clearItemStates(u, [n, r]); } for (c = 0; c < s; c++) { var h = o[c]; e.clearItemStates(h, [n, r, "deactivate"]); } e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, }, "click-select": d, "collapse-expand": v, "drag-combo": { getDefaultCfg: function () { return { enableDelegate: !1, delegateStyle: {}, onlyChangeComboSize: !1, activeState: "", selectedState: "selected", }; }, getEvents: function () { return { "combo:dragstart": "onDragStart", "combo:drag": "onDrag", "combo:dragend": "onDragEnd", "combo:drop": "onDrop", "node:drop": "onNodeDrop", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", }; }, validationCombo: function (t) { var e = t.item; return ( !(!e || e.destroyed) && !!this.shouldUpdate(this, t) && "combo" === e.getType() ); }, onDragStart: function (t) { var e = this, n = this.graph, r = t.item; if (this.validationCombo(t)) { this.targets = []; var i = n.findAllByState("combo", this.selectedState), o = r.get("id"); 0 === i.filter(function (t) { var e = t.get("id"); return o === e; }).length ? this.targets.push(r) : (this.targets = i), this.activeState && this.targets.map(function (t) { var r = t.getModel(); if (r.parentId) { var i = n.findById(r.parentId); i && n.setItemState(i, e.activeState, !0); } }), (this.point = {}), (this.originPoint = {}), (this.origin = { x: t.x, y: t.y }), (this.currentItemChildCombos = []), m(r, function (t) { if (t.destroyed) return !1; var n = t.getModel(); return e.currentItemChildCombos.push(n.id), !0; }); } }, onDrag: function (t) { var e = this; if (this.origin && this.validationCombo(t)) if (this.enableDelegate) this.updateDelegate(t); else { if (this.activeState) { var n = this.graph, r = t.item, o = r.getModel(), a = n.getCombos(), s = r.getBBox(), c = s.centerX, u = s.centerY, h = s.width; a.filter(function (t) { var n = t.getModel(); return ( o.parentId, n.id !== o.id && !e.currentItemChildCombos.includes(n.id) ); }).map(function (t) { var r = t.getBBox(), i = r.centerX, o = r.centerY, a = r.width, s = c - i, l = u - o, f = 2 * Math.sqrt(s * s + l * l); h + a - f > 0.8 * h ? n.setItemState(t, e.activeState, !0) : n.setItemState(t, e.activeState, !1); }); } Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); } }, updatePositions: function (t) { var e = this; this.enableDelegate && Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); }, onDrop: function (t) { var e = this, n = t.item; if (n && this.targets && !n.destroyed) { this.updatePositions(t); var r = this.graph, i = n.getModel(); this.targets.map(function (t) { t.getModel().parentId !== i.id ? (e.activeState && r.setItemState(n, e.activeState, !1), e.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t, i.id)) : r.updateCombo(n); }), this.end(n, t), (this.endComparison = !0); } }, onNodeDrop: function (t) { var e = this; if (this.targets && 0 !== this.targets.length) { this.updatePositions(t); var n, r = this.graph, i = t.item.getModel().comboId; if (i) { if (this.activeState) { var o = r.findById(i); r.setItemState(o, this.activeState, !1); } this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : i !== t.getID() && ((n = r.findById(i)), i !== t.getModel().parentId && r.updateComboTree(t, i)); }); } else this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : t.getModel().comboId && r.updateComboTree(t); }); (this.endComparison = !0), this.end(n, t); } }, onDragEnter: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !0); } }, onDragLeave: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !1); } }, onDragEnd: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.getParentCombo(e.getModel().parentId), r = this.graph; n && this.activeState && r.setItemState(n, this.activeState, !1), this.end(void 0, t); } }, end: function (t, e) { var n = this; if (this.origin) { var r = this.graph; if (this.delegateShape) r.get("delegateGroup").clear(), (this.delegateShape = null); t && this.activeState && r.setItemState(t, this.activeState, !1), t || this.targets.map(function (t) { n.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t); }), (this.point = []), (this.origin = null), (this.originPoint = null), (this.targets.length = 0); } }, traverse: function (t, e) { var n = this; if (!1 !== e(t) && t) { var r = t.get("combos"); Object(i.each)(r, function (t) { n.traverse(t, e); }); var o = t.get("nodes"); Object(i.each)(o, function (t) { n.traverse(t, e); }); } }, updateCombo: function (t, e) { var n = this; this.traverse(t, function (t) { return !t.destroyed && (n.updateSignleItem(t, e), !0); }); }, updateSignleItem: function (t, e) { var n = this.origin, r = this.graph, i = t.getModel(), o = t.get("id"); this.point[o] || (this.point[o] = { x: i.x, y: i.y }); var a = e.x - n.x + this.point[o].x, s = e.y - n.y + this.point[o].y; r.updateItem(t, { x: a, y: s }); }, getParentCombo: function (t) { var e = this.graph; if (t) { var n = e.findById(t); if (n) return n; } }, updateDelegate: function (t) { var e = this.graph; if (this.delegateShape) { var n = t.x - this.origin.x + this.originPoint.minX, i = t.y - this.origin.y + this.originPoint.minY; this.delegateShape.attr({ x: n, y: i }); } else { var o = e.get("delegateGroup"), a = null, s = (a = this.targets.length > 1 ? y(this.targets) : this.targets[0].getBBox()).x, c = a.y, u = a.width, h = a.height, f = a.minX, d = a.minY; this.originPoint = { x: s, y: c, width: u, height: h, minX: f, minY: d, }; var p = Object(r.a)( Object(r.a)({}, l.a.delegateStyle), this.delegateStyle, ); this.delegateShape = o.addShape("rect", { attrs: Object(r.a)( { width: a.width, height: a.height, x: a.x, y: a.y }, p, ), name: "combo-delegate-shape", }); } }, }, "collapse-expand-combo": { getDefaultCfg: function () { return { trigger: "dblclick", relayout: !0 }; }, getEvents: function () { var t, e; return ( b.includes(this.trigger) ? (e = this.trigger) : ((e = "dblclick"), console.warn( "Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["combo:" + e] = "onComboClick"), t ); }, onComboClick: function (t) { var e = t.item, n = this.graph, r = this.relayout; if (e && !e.destroyed && "combo" === e.getType()) { var i = e.getModel().id; i && (n.collapseExpandCombo(i), r && n.get("layout") ? n.layout() : n.refreshPositions()); } }, }, "create-edge": { getDefaultCfg: function () { return { trigger: "tap", key: void 0, edgeConfig: {} }; }, getEvents: function () { var t; return ( x.indexOf(this.trigger.toLowerCase()) > -1 || ((this.trigger = "tap"), console.warn( "Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'", )), this.key && -1 === S.indexOf(this.key.toLowerCase()) && ((this.trigger = void 0), console.warn( "Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined", )), "drag" === this.trigger ? (t = { "node:dragstart": "onClick", "combo:dragstart": "onClick", drag: "updateEndPoint", "node:drop": "onClick", "combo:drop": "onClick", dragend: "onDragEnd", }) : "click" === this.trigger && (t = { "node:tap": "onClick", mousemove: "updateEndPoint", "edge:tap": "cancelCreating", "canvas:tap": "cancelCreating", "combo:tap": "onClick", }), this.key && ((t.keydown = "onKeyDown"), (t.keyup = "onKeyUp")), t ); }, onDragEnd: function (t) { if (!this.key || this.keydown) { var e = t.item; (e && e.getID() !== this.source && "node" === e.getType()) || this.cancelCreating({ item: this.edge, x: t.x, y: t.y }); } }, onClick: function (t) { if (!this.key || this.keydown) { var e = t.item, n = this.graph, i = e.getModel(); if (this.addingEdge && this.edge) { if (!this.shouldEnd.call(this, t)) return; var o = { target: i.id }; this.source === i.id && (o.type = "loop"), n.emit("beforecreateedge", {}), n.updateItem(this.edge, o), n.emit("aftercreateedge", { edge: this.edge }), this.edge.getKeyShape().set("capture", !0), (this.edge = null), (this.addingEdge = !1); } else { if (!this.shouldBegin.call(this, t)) return; (this.edge = n.addItem( "edge", Object(r.a)( { source: i.id, target: i.id }, this.edgeConfig, ), !1, )), (this.source = i.id), (this.addingEdge = !0), this.edge.getKeyShape().set("capture", !1); } } }, updateEndPoint: function (t) { if (!this.key || this.keydown) { var e = { x: t.x, y: t.y }; this.graph.findById(this.source) ? this.addingEdge && this.edge && this.graph.updateItem(this.edge, { target: e }, !1) : (this.addingEdge = !1); } }, cancelCreating: function (t) { if (!this.key || this.keydown) { var e = this.graph, n = t.item; if ( this.addingEdge && t.target && t.target.isCanvas && t.target.isCanvas() ) return ( e.removeItem(this.edge, !1), (this.edge = null), void (this.addingEdge = !1) ); if (this.addingEdge && this.edge === n) { var r = !0; if (!e.get("groupByTypes")) for ( var i = t.x, o = t.y, a = e.getNodes(), s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = u.getModel(), l = u.getBBox(); if ( i <= l.maxX && i >= l.minX && o <= l.maxY && o >= l.minY ) { if ( !this.shouldEnd.call(this, { x: t.x, y: t.y, canvasX: t.canvasX, canvasY: t.canvasY, clientX: t.clientX, clientY: t.clientY, item: u, }) ) return; e.emit("beforecreateedge", {}), e.updateItem(this.edge, { target: h.id }), e.emit("aftercreateedge", { edge: this.edge }), (r = !1); break; } } r && e.removeItem(this.edge, !1), (this.edge = null), (this.addingEdge = !1); } } }, onKeyDown: function (t) { var e = t.key; e && (e.toLowerCase() === this.key.toLowerCase() ? (this.keydown = !0) : (this.keydown = !1)); }, onKeyUp: function () { this.addingEdge && this.edge && (this.graph.removeItem(this.edge, !1), (this.addingEdge = !1), (this.edge = null)), (this.keydown = !1); }, }, }; Object(i.each)(O, function (t, e) { Object(o.i)(e, Object(r.a)(Object(r.a)({}, t), w)); }); }, 46: function (t, e, n) { "use strict"; n.d(e, "b", function () { return o; }), n.d(e, "c", function () { return a; }), n.d(e, "a", function () { return s; }); var r = n(6), i = n(88); function o(t, e, n) { var i = 1; return ( Object(r.h)(t) && (i = t.split("\n").length), i > 1 ? e * i + (function (t, e) { return e ? e - t : 0.14 * t; })(e, n) * (i - 1) : e ); } function a(t, e) { var n = Object(i.a)(), o = 0; if (Object(r.e)(t) || "" === t) return o; if ((n.save(), (n.font = e), Object(r.h)(t) && t.includes("\n"))) { var a = t.split("\n"); Object(r.a)(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; } function s(t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); } }, 5: function (t, e, n) { "use strict"; n.d(e, "a", function () { return r; }), n.d(e, "b", function () { return _; }), n.d(e, "c", function () { return R; }); var r = {}; n.r(r), n.d(r, "create", function () { return o; }), n.d(r, "fromMat4", function () { return a; }), n.d(r, "clone", function () { return s; }), n.d(r, "copy", function () { return c; }), n.d(r, "fromValues", function () { return u; }), n.d(r, "set", function () { return h; }), n.d(r, "identity", function () { return l; }), n.d(r, "transpose", function () { return f; }), n.d(r, "invert", function () { return d; }), n.d(r, "adjoint", function () { return p; }), n.d(r, "determinant", function () { return g; }), n.d(r, "multiply", function () { return v; }), n.d(r, "translate", function () { return y; }), n.d(r, "rotate", function () { return m; }), n.d(r, "scale", function () { return b; }), n.d(r, "fromTranslation", function () { return x; }), n.d(r, "fromRotation", function () { return S; }), n.d(r, "fromScaling", function () { return w; }), n.d(r, "fromMat2d", function () { return O; }), n.d(r, "fromQuat", function () { return M; }), n.d(r, "normalFromMat4", function () { return k; }), n.d(r, "projection", function () { return j; }), n.d(r, "str", function () { return C; }), n.d(r, "frob", function () { return E; }), n.d(r, "add", function () { return P; }), n.d(r, "subtract", function () { return A; }), n.d(r, "multiplyScalar", function () { return I; }), n.d(r, "multiplyScalarAndAdd", function () { return T; }), n.d(r, "exactEquals", function () { return N; }), n.d(r, "equals", function () { return B; }), n.d(r, "mul", function () { return L; }), n.d(r, "sub", function () { return D; }); var i = n(7); function o() { var t = new i.a(9); return ( i.a != Float32Array && ((t[1] = 0), (t[2] = 0), (t[3] = 0), (t[5] = 0), (t[6] = 0), (t[7] = 0)), (t[0] = 1), (t[4] = 1), (t[8] = 1), t ); } function a(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[4]), (t[4] = e[5]), (t[5] = e[6]), (t[6] = e[8]), (t[7] = e[9]), (t[8] = e[10]), t ); } function s(t) { var e = new i.a(9); return ( (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), e ); } function c(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function u(t, e, n, r, o, a, s, c, u) { var h = new i.a(9); return ( (h[0] = t), (h[1] = e), (h[2] = n), (h[3] = r), (h[4] = o), (h[5] = a), (h[6] = s), (h[7] = c), (h[8] = u), h ); } function h(t, e, n, r, i, o, a, s, c, u) { return ( (t[0] = e), (t[1] = n), (t[2] = r), (t[3] = i), (t[4] = o), (t[5] = a), (t[6] = s), (t[7] = c), (t[8] = u), t ); } function l(t) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function f(t, e) { if (t === e) { var n = e[1], r = e[2], i = e[5]; (t[1] = e[3]), (t[2] = e[6]), (t[3] = n), (t[5] = e[7]), (t[6] = r), (t[7] = i); } else (t[0] = e[0]), (t[1] = e[3]), (t[2] = e[6]), (t[3] = e[1]), (t[4] = e[4]), (t[5] = e[7]), (t[6] = e[2]), (t[7] = e[5]), (t[8] = e[8]); return t; } function d(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (t[0] = l * p), (t[1] = (-h * r + i * u) * p), (t[2] = (s * r - i * a) * p), (t[3] = f * p), (t[4] = (h * n - i * c) * p), (t[5] = (-s * n + i * o) * p), (t[6] = d * p), (t[7] = (-u * n + r * c) * p), (t[8] = (a * n - r * o) * p), t) : null; } function p(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8]; return ( (t[0] = a * h - s * u), (t[1] = i * u - r * h), (t[2] = r * s - i * a), (t[3] = s * c - o * h), (t[4] = n * h - i * c), (t[5] = i * o - n * s), (t[6] = o * u - a * c), (t[7] = r * c - n * u), (t[8] = n * a - r * o), t ); } function g(t) { var e = t[0], n = t[1], r = t[2], i = t[3], o = t[4], a = t[5], s = t[6], c = t[7], u = t[8]; return e * (u * o - a * c) + n * (-u * i + a * s) + r * (c * i - o * s); } function v(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1], p = n[2], g = n[3], v = n[4], y = n[5], m = n[6], b = n[7], x = n[8]; return ( (t[0] = f * r + d * a + p * u), (t[1] = f * i + d * s + p * h), (t[2] = f * o + d * c + p * l), (t[3] = g * r + v * a + y * u), (t[4] = g * i + v * s + y * h), (t[5] = g * o + v * c + y * l), (t[6] = m * r + b * a + x * u), (t[7] = m * i + b * s + x * h), (t[8] = m * o + b * c + x * l), t ); } function y(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1]; return ( (t[0] = r), (t[1] = i), (t[2] = o), (t[3] = a), (t[4] = s), (t[5] = c), (t[6] = f * r + d * a + u), (t[7] = f * i + d * s + h), (t[8] = f * o + d * c + l), t ); } function m(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = Math.sin(n), d = Math.cos(n); return ( (t[0] = d * r + f * a), (t[1] = d * i + f * s), (t[2] = d * o + f * c), (t[3] = d * a - f * r), (t[4] = d * s - f * i), (t[5] = d * c - f * o), (t[6] = u), (t[7] = h), (t[8] = l), t ); } function b(t, e, n) { var r = n[0], i = n[1]; return ( (t[0] = r * e[0]), (t[1] = r * e[1]), (t[2] = r * e[2]), (t[3] = i * e[3]), (t[4] = i * e[4]), (t[5] = i * e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function x(t, e) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = e[0]), (t[7] = e[1]), (t[8] = 1), t ); } function S(t, e) { var n = Math.sin(e), r = Math.cos(e); return ( (t[0] = r), (t[1] = n), (t[2] = 0), (t[3] = -n), (t[4] = r), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function w(t, e) { return ( (t[0] = e[0]), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = e[1]), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function O(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = 0), (t[3] = e[2]), (t[4] = e[3]), (t[5] = 0), (t[6] = e[4]), (t[7] = e[5]), (t[8] = 1), t ); } function M(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = n + n, s = r + r, c = i + i, u = n * a, h = r * a, l = r * s, f = i * a, d = i * s, p = i * c, g = o * a, v = o * s, y = o * c; return ( (t[0] = 1 - l - p), (t[3] = h - y), (t[6] = f + v), (t[1] = h + y), (t[4] = 1 - u - p), (t[7] = d - g), (t[2] = f - v), (t[5] = d + g), (t[8] = 1 - u - l), t ); } function k(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = e[9], f = e[10], d = e[11], p = e[12], g = e[13], v = e[14], y = e[15], m = n * s - r * a, b = n * c - i * a, x = n * u - o * a, S = r * c - i * s, w = r * u - o * s, O = i * u - o * c, M = h * g - l * p, k = h * v - f * p, j = h * y - d * p, C = l * v - f * g, E = l * y - d * g, P = f * y - d * v, A = m * P - b * E + x * C + S * j - w * k + O * M; return A ? ((A = 1 / A), (t[0] = (s * P - c * E + u * C) * A), (t[1] = (c * j - a * P - u * k) * A), (t[2] = (a * E - s * j + u * M) * A), (t[3] = (i * E - r * P - o * C) * A), (t[4] = (n * P - i * j + o * k) * A), (t[5] = (r * j - n * E - o * M) * A), (t[6] = (g * O - v * w + y * S) * A), (t[7] = (v * x - p * O - y * b) * A), (t[8] = (p * w - g * x + y * m) * A), t) : null; } function j(t, e, n) { return ( (t[0] = 2 / e), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = -2 / n), (t[5] = 0), (t[6] = -1), (t[7] = 1), (t[8] = 1), t ); } function C(t) { return ( "mat3(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ", " + t[4] + ", " + t[5] + ", " + t[6] + ", " + t[7] + ", " + t[8] + ")" ); } function E(t) { return Math.hypot(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8]); } function P(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), (t[3] = e[3] + n[3]), (t[4] = e[4] + n[4]), (t[5] = e[5] + n[5]), (t[6] = e[6] + n[6]), (t[7] = e[7] + n[7]), (t[8] = e[8] + n[8]), t ); } function A(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), (t[3] = e[3] - n[3]), (t[4] = e[4] - n[4]), (t[5] = e[5] - n[5]), (t[6] = e[6] - n[6]), (t[7] = e[7] - n[7]), (t[8] = e[8] - n[8]), t ); } function I(t, e, n) { return ( (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), (t[3] = e[3] * n), (t[4] = e[4] * n), (t[5] = e[5] * n), (t[6] = e[6] * n), (t[7] = e[7] * n), (t[8] = e[8] * n), t ); } function T(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), (t[3] = e[3] + n[3] * r), (t[4] = e[4] + n[4] * r), (t[5] = e[5] + n[5] * r), (t[6] = e[6] + n[6] * r), (t[7] = e[7] + n[7] * r), (t[8] = e[8] + n[8] * r), t ); } function N(t, e) { return ( t[0] === e[0] && t[1] === e[1] && t[2] === e[2] && t[3] === e[3] && t[4] === e[4] && t[5] === e[5] && t[6] === e[6] && t[7] === e[7] && t[8] === e[8] ); } function B(t, e) { var n = t[0], r = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( Math.abs(n - f) <= i.b * Math.max(1, Math.abs(n), Math.abs(f)) && Math.abs(r - d) <= i.b * Math.max(1, Math.abs(r), Math.abs(d)) && Math.abs(o - p) <= i.b * Math.max(1, Math.abs(o), Math.abs(p)) && Math.abs(a - g) <= i.b * Math.max(1, Math.abs(a), Math.abs(g)) && Math.abs(s - v) <= i.b * Math.max(1, Math.abs(s), Math.abs(v)) && Math.abs(c - y) <= i.b * Math.max(1, Math.abs(c), Math.abs(y)) && Math.abs(u - m) <= i.b * Math.max(1, Math.abs(u), Math.abs(m)) && Math.abs(h - b) <= i.b * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(l - x) <= i.b * Math.max(1, Math.abs(l), Math.abs(x)) ); } var L = v, D = A, _ = n(53), R = n(85); }, 52: function (t, e, n) { "use strict"; var r = n(1), i = n(8), o = n(31), a = n(12), s = n(0), c = n(3), u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.onCanvasChange = function (t) { Object(a.h)(this, t); }), (e.prototype.getShapeBase = function () { return o; }), (e.prototype.getGroupBase = function () { return e; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), Object(a.a)(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.cacheCanvasBBox = function () { var t = this.cfg.children, e = [], n = []; Object(s.each)(t, function (t) { var r = t.cfg.cacheCanvasBBox; r && t.cfg.isInView && (e.push(r.minX, r.maxX), n.push(r.minY, r.maxY)); }); var r = null; if (e.length) { var i = Math.min.apply(null, e), o = Math.max.apply(null, e), a = Math.min.apply(null, n), u = Math.max.apply(null, n); r = { minX: i, minY: a, x: i, y: a, maxX: o, maxY: u, width: o - i, height: u - a, }; var h = this.cfg.canvas; if (h) { var l = h.getViewRange(); this.set("isInView", Object(c.e)(r, l)); } } else this.set("isInView", !1); this.set("cacheCanvasBBox", r); }), (e.prototype.draw = function (t, e) { var n = this.cfg.children, r = !e || this.cfg.refresh; n.length && r && (t.save(), Object(a.a)(t, this), this._applyClip(t, this.getClip()), Object(a.d)(t, n, e), t.restore(), this.cacheCanvasBBox()), (this.cfg.refresh = null), this.set("hasChanged", !1); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("hasChanged", !1); }), e ); })(i.AbstractGroup); e.a = u; }, 53: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "fromValues", function () { return a; }), n.d(e, "copy", function () { return s; }), n.d(e, "set", function () { return c; }), n.d(e, "add", function () { return u; }), n.d(e, "subtract", function () { return h; }), n.d(e, "multiply", function () { return l; }), n.d(e, "divide", function () { return f; }), n.d(e, "ceil", function () { return d; }), n.d(e, "floor", function () { return p; }), n.d(e, "min", function () { return g; }), n.d(e, "max", function () { return v; }), n.d(e, "round", function () { return y; }), n.d(e, "scale", function () { return m; }), n.d(e, "scaleAndAdd", function () { return b; }), n.d(e, "distance", function () { return x; }), n.d(e, "squaredDistance", function () { return S; }), n.d(e, "length", function () { return w; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return j; }), n.d(e, "dot", function () { return C; }), n.d(e, "cross", function () { return E; }), n.d(e, "lerp", function () { return P; }), n.d(e, "random", function () { return A; }), n.d(e, "transformMat2", function () { return I; }), n.d(e, "transformMat2d", function () { return T; }), n.d(e, "transformMat3", function () { return N; }), n.d(e, "transformMat4", function () { return B; }), n.d(e, "rotate", function () { return L; }), n.d(e, "angle", function () { return D; }), n.d(e, "zero", function () { return _; }), n.d(e, "str", function () { return R; }), n.d(e, "exactEquals", function () { return F; }), n.d(e, "equals", function () { return Y; }), n.d(e, "len", function () { return z; }), n.d(e, "sub", function () { return W; }), n.d(e, "mul", function () { return q; }), n.d(e, "div", function () { return V; }), n.d(e, "dist", function () { return G; }), n.d(e, "sqrDist", function () { return H; }), n.d(e, "sqrLen", function () { return U; }), n.d(e, "forEach", function () { return Z; }); var r = n(7); function i() { var t = new r.a(2); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0)), t; } function o(t) { var e = new r.a(2); return (e[0] = t[0]), (e[1] = t[1]), e; } function a(t, e) { var n = new r.a(2); return (n[0] = t), (n[1] = e), n; } function s(t, e) { return (t[0] = e[0]), (t[1] = e[1]), t; } function c(t, e, n) { return (t[0] = e), (t[1] = n), t; } function u(t, e, n) { return (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), t; } function h(t, e, n) { return (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), t; } function l(t, e, n) { return (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), t; } function f(t, e, n) { return (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), t; } function d(t, e) { return (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), t; } function p(t, e) { return (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), t; } function g(t, e, n) { return (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), t; } function v(t, e, n) { return (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), t; } function y(t, e) { return (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), t; } function m(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), t; } function b(t, e, n, r) { return (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), t; } function x(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return Math.hypot(n, r); } function S(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return n * n + r * r; } function w(t) { var e = t[0], n = t[1]; return Math.hypot(e, n); } function O(t) { var e = t[0], n = t[1]; return e * e + n * n; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), t; } function j(t, e) { var n = e[0], r = e[1], i = n * n + r * r; return ( i > 0 && (i = 1 / Math.sqrt(i)), (t[0] = e[0] * i), (t[1] = e[1] * i), t ); } function C(t, e) { return t[0] * e[0] + t[1] * e[1]; } function E(t, e, n) { var r = e[0] * n[1] - e[1] * n[0]; return (t[0] = t[1] = 0), (t[2] = r), t; } function P(t, e, n, r) { var i = e[0], o = e[1]; return (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), t; } function A(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI; return (t[0] = Math.cos(n) * e), (t[1] = Math.sin(n) * e), t; } function I(t, e, n) { var r = e[0], i = e[1]; return (t[0] = n[0] * r + n[2] * i), (t[1] = n[1] * r + n[3] * i), t; } function T(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[2] * i + n[4]), (t[1] = n[1] * r + n[3] * i + n[5]), t ); } function N(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[3] * i + n[6]), (t[1] = n[1] * r + n[4] * i + n[7]), t ); } function B(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[4] * i + n[12]), (t[1] = n[1] * r + n[5] * i + n[13]), t ); } function L(t, e, n, r) { var i = e[0] - n[0], o = e[1] - n[1], a = Math.sin(r), s = Math.cos(r); return (t[0] = i * s - o * a + n[0]), (t[1] = i * a + o * s + n[1]), t; } function D(t, e) { var n = t[0], r = t[1], i = e[0], o = e[1], a = Math.sqrt(n * n + r * r) * Math.sqrt(i * i + o * o), s = a && (n * i + r * o) / a; return Math.acos(Math.min(Math.max(s, -1), 1)); } function _(t) { return (t[0] = 0), (t[1] = 0), t; } function R(t) { return "vec2(" + t[0] + ", " + t[1] + ")"; } function F(t, e) { return t[0] === e[0] && t[1] === e[1]; } function Y(t, e) { var n = t[0], i = t[1], o = e[0], a = e[1]; return ( Math.abs(n - o) <= r.b * Math.max(1, Math.abs(n), Math.abs(o)) && Math.abs(i - a) <= r.b * Math.max(1, Math.abs(i), Math.abs(a)) ); } var X, z = w, W = h, q = l, V = f, G = x, H = S, U = O, Z = ((X = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 2), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (X[0] = t[a]), (X[1] = t[a + 1]), i(X, X, o), (t[a] = X[0]), (t[a + 1] = X[1]); return t; }); }, 54: function (t, e, n) { "use strict"; var r, i, o, a; function s(t) { r || ((r = document.createElement("table")), (i = document.createElement("tr")), (o = /^\s*<(\w+|!)[^>]*>/), (a = { tr: document.createElement("tbody"), tbody: r, thead: r, tfoot: r, td: i, th: i, "*": document.createElement("div"), })); var e = o.test(t) && RegExp.$1; (e && e in a) || (e = "*"); var n = a[e]; (t = "string" == typeof t ? t.replace(/(^\s*)|(\s*$)/g, "") : t), (n.innerHTML = "" + t); var s = n.childNodes[0]; return s && n.contains(s) && n.removeChild(s), s; } function c(t, e) { if (t) for (var n in e) e.hasOwnProperty(n) && (t.style[n] = e[n]); return t; } n.d(e, "a", function () { return s; }), n.d(e, "b", function () { return c; }); }, 55: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(209), a = n(213), s = [].slice, c = ["keyword", "gray", "hex"], u = {}; Object.keys(a).forEach(function (t) { u[s.call(a[t].labels).sort().join("")] = t; }); var h = {}; function l(t, e) { if (!(this instanceof l)) return new l(t, e); if ((e && e in c && (e = null), e && !(e in a))) throw new Error("Unknown model: " + e); var n, r, i, f, d, p, g, y, m; if (null == t) (this.model = "rgb"), (this.color = [0, 0, 0]), (this.valpha = 1); else if (t instanceof l) (this.model = t.model), (this.color = t.color.slice()), (this.valpha = t.valpha); else if ("string" == typeof t) { if (null === (r = o.get(t))) throw new Error("Unable to parse color from string: " + t); (this.model = r.model), (m = a[this.model].channels), (this.color = r.value.slice(0, m)), (this.valpha = "number" == typeof r.value[m] ? r.value[m] : 1); } else if (t.length) (this.model = e || "rgb"), (m = a[this.model].channels), (i = s.call(t, 0, m)), (this.color = v(i, m)), (this.valpha = "number" == typeof t[m] ? t[m] : 1); else if ("number" == typeof t) (t &= 16777215), (this.model = "rgb"), (this.color = [(t >> 16) & 255, (t >> 8) & 255, 255 & t]), (this.valpha = 1); else { if ( ((this.valpha = 1), (f = Object.keys(t)), "alpha" in t && (f.splice(f.indexOf("alpha"), 1), (this.valpha = "number" == typeof t.alpha ? t.alpha : 0)), !((d = f.sort().join("")) in u)) ) throw new Error( "Unable to parse color from object: " + JSON.stringify(t), ); for ( this.model = u[d], p = a[this.model].labels, g = [], n = 0; n < p.length; n++ ) g.push(t[p[n]]); this.color = v(g); } if (h[this.model]) for (m = a[this.model].channels, n = 0; n < m; n++) (y = h[this.model][n]) && (this.color[n] = y(this.color[n])); (this.valpha = Math.max(0, Math.min(1, this.valpha))), Object.freeze && Object.freeze(this); } function f(t) { return function (e) { return (function (t, e) { return Number(t.toFixed(e)); })(e, t); }; } function d(t, e, n) { return ( (t = Array.isArray(t) ? t : [t]).forEach(function (t) { (h[t] || (h[t] = []))[e] = n; }), (t = t[0]), function (r) { var i; return arguments.length ? (n && (r = n(r)), ((i = this[t]()).color[e] = r), i) : ((i = this[t]().color[e]), n && (i = n(i)), i); } ); } function p(t) { return function (e) { return Math.max(0, Math.min(t, e)); }; } function g(t) { return Array.isArray(t) ? t : [t]; } function v(t, e) { var n; for (n = 0; n < e; n++) "number" != typeof t[n] && (t[n] = 0); return t; } (l.prototype = { toString: function () { return this.string(); }, toJSON: function () { return this[this.model](); }, string: function (t) { var e = this.model in o.to ? this : this.rgb(), n = 1 === (e = e.round("number" == typeof t ? t : 1)).valpha ? e.color : e.color.concat(this.valpha); return o.to[e.model](n); }, percentString: function (t) { var e = this.rgb().round("number" == typeof t ? t : 1), n = 1 === e.valpha ? e.color : e.color.concat(this.valpha); return o.to.rgb.percent(n); }, array: function () { return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha); }, object: function () { var t, e = {}, n = a[this.model].channels, r = a[this.model].labels; for (t = 0; t < n; t++) e[r[t]] = this.color[t]; return 1 !== this.valpha && (e.alpha = this.valpha), e; }, unitArray: function () { var t = this.rgb().color; return ( (t[0] /= 255), (t[1] /= 255), (t[2] /= 255), 1 !== this.valpha && t.push(this.valpha), t ); }, unitObject: function () { var t = this.rgb().object(); return ( (t.r /= 255), (t.g /= 255), (t.b /= 255), 1 !== this.valpha && (t.alpha = this.valpha), t ); }, round: function (t) { return ( (t = Math.max(t || 0, 0)), new l(this.color.map(f(t)).concat(this.valpha), this.model) ); }, alpha: function (t) { return arguments.length ? new l(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha; }, red: d("rgb", 0, p(255)), green: d("rgb", 1, p(255)), blue: d("rgb", 2, p(255)), hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function (t) { return ((t % 360) + 360) % 360; }), saturationl: d("hsl", 1, p(100)), lightness: d("hsl", 2, p(100)), saturationv: d("hsv", 1, p(100)), value: d("hsv", 2, p(100)), chroma: d("hcg", 1, p(100)), gray: d("hcg", 2, p(100)), white: d("hwb", 1, p(100)), wblack: d("hwb", 2, p(100)), cyan: d("cmyk", 0, p(100)), magenta: d("cmyk", 1, p(100)), yellow: d("cmyk", 2, p(100)), black: d("cmyk", 3, p(100)), x: d("xyz", 0, p(100)), y: d("xyz", 1, p(100)), z: d("xyz", 2, p(100)), l: d("lab", 0, p(100)), a: d("lab", 1), b: d("lab", 2), keyword: function (t) { return arguments.length ? new l(t) : a[this.model].keyword(this.color); }, hex: function (t) { return arguments.length ? new l(t) : o.to.hex(this.rgb().round().color); }, rgbNumber: function () { var t = this.rgb().color; return ((255 & t[0]) << 16) | ((255 & t[1]) << 8) | (255 & t[2]); }, luminosity: function () { var t, e, n = this.rgb().color, r = []; for (t = 0; t < n.length; t++) (e = n[t] / 255), (r[t] = e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)); return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2]; }, contrast: function (t) { var e = this.luminosity(), n = t.luminosity(); return e > n ? (e + 0.05) / (n + 0.05) : (n + 0.05) / (e + 0.05); }, level: function (t) { var e = this.contrast(t); return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : ""; }, isDark: function () { var t = this.rgb().color; return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128; }, isLight: function () { return !this.isDark(); }, negate: function () { var t, e = this.rgb(); for (t = 0; t < 3; t++) e.color[t] = 255 - e.color[t]; return e; }, lighten: function (t) { var e = this.hsl(); return (e.color[2] += e.color[2] * t), e; }, darken: function (t) { var e = this.hsl(); return (e.color[2] -= e.color[2] * t), e; }, saturate: function (t) { var e = this.hsl(); return (e.color[1] += e.color[1] * t), e; }, desaturate: function (t) { var e = this.hsl(); return (e.color[1] -= e.color[1] * t), e; }, whiten: function (t) { var e = this.hwb(); return (e.color[1] += e.color[1] * t), e; }, blacken: function (t) { var e = this.hwb(); return (e.color[2] += e.color[2] * t), e; }, grayscale: function () { var t = this.rgb().color, e = 0.3 * t[0] + 0.59 * t[1] + 0.11 * t[2]; return l.rgb(e, e, e); }, fade: function (t) { return this.alpha(this.valpha - this.valpha * t); }, opaquer: function (t) { return this.alpha(this.valpha + this.valpha * t); }, rotate: function (t) { var e = this.hsl(), n = e.color[0]; return ( (n = (n = (n + t) % 360) < 0 ? 360 + n : n), (e.color[0] = n), e ); }, mix: function (t, e) { if (!t || !t.rgb) throw new Error( 'Argument to "mix" was not a Color instance, but rather an instance of ' + i(t), ); var n = t.rgb(), r = this.rgb(), o = void 0 === e ? 0.5 : e, a = 2 * o - 1, s = n.alpha() - r.alpha(), c = ((a * s == -1 ? a : (a + s) / (1 + a * s)) + 1) / 2, u = 1 - c; return l.rgb( c * n.red() + u * r.red(), c * n.green() + u * r.green(), c * n.blue() + u * r.blue(), n.alpha() * o + r.alpha() * (1 - o), ); }, }), Object.keys(a).forEach(function (t) { if (-1 === c.indexOf(t)) { var e = a[t].channels; (l.prototype[t] = function () { if (this.model === t) return new l(this); if (arguments.length) return new l(arguments, t); var n = "number" == typeof arguments[e] ? e : this.valpha; return new l(g(a[this.model][t].raw(this.color)).concat(n), t); }), (l[t] = function (n) { return ( "number" == typeof n && (n = v(s.call(arguments), e)), new l(n, t) ); }); } }), (t.exports = l); }, 6: function (t, e, n) { "use strict"; n.d(e, "j", function () { return i; }), n.d(e, "c", function () { return o; }), n.d(e, "g", function () { return a; }), n.d(e, "b", function () { return s; }); var r = n(0); function i(t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); } n.d(e, "e", function () { return r.isNil; }), n.d(e, "d", function () { return r.isFunction; }), n.d(e, "h", function () { return r.isString; }), n.d(e, "f", function () { return r.isObject; }), n.d(e, "i", function () { return r.mix; }), n.d(e, "a", function () { return r.each; }), n.d(e, "k", function () { return r.upperFirst; }); var o = "undefined" != typeof window && void 0 !== window.document; function a(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } function s(t) { return t.cfg.visible && t.cfg.capture; } }, 62: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.getLayoutByName = e.unRegisterLayout = e.registerLayout = void 0); var o = n(66), a = n(216), s = new Map(); e.registerLayout = function (t, e) { var n; s.get(t) && console.warn( "The layout with the name " + t + " exists already, it will be overridden", ), a.isObject(e) ? ((n = (function (t) { function n(n) { var r = t.call(this) || this, i = r, o = {}, a = i.getDefaultCfg(); return ( Object.assign(o, a, e, n), Object.keys(o).forEach(function (t) { var e = o[t]; i[t] = e; }), r ); } return i(n, t), n; })(o.Base)), s.set(t, n)) : s.set(t, e); }; e.unRegisterLayout = function (t) { s.has(t) && s.delete(t); }; e.getLayoutByName = function (t) { return s.has(t) ? s.get(t) : null; }; }, 63: function (t, e, n) { "use strict"; n.d(e, "a", function () { return s; }); var r = n(3); function i(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function o(t, e) { return i(t) * i(e) ? (t[0] * e[0] + t[1] * e[1]) / (i(t) * i(e)) : 1; } function a(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(o(t, e)); } function s(t, e) { var n = e[1], i = e[2], s = Object(r.m)(Object(r.n)(e[3]), 2 * Math.PI), c = e[4], u = e[5], h = t[0], l = t[1], f = e[6], d = e[7], p = (Math.cos(s) * (h - f)) / 2 + (Math.sin(s) * (l - d)) / 2, g = (-1 * Math.sin(s) * (h - f)) / 2 + (Math.cos(s) * (l - d)) / 2, v = (p * p) / (n * n) + (g * g) / (i * i); v > 1 && ((n *= Math.sqrt(v)), (i *= Math.sqrt(v))); var y = n * n * (g * g) + i * i * (p * p), m = y ? Math.sqrt((n * n * (i * i) - y) / y) : 1; c === u && (m *= -1), isNaN(m) && (m = 0); var b = i ? (m * n * g) / i : 0, x = n ? (m * -i * p) / n : 0, S = (h + f) / 2 + Math.cos(s) * b - Math.sin(s) * x, w = (l + d) / 2 + Math.sin(s) * b + Math.cos(s) * x, O = [(p - b) / n, (g - x) / i], M = [(-1 * p - b) / n, (-1 * g - x) / i], k = a([1, 0], O), j = a(O, M); return ( o(O, M) <= -1 && (j = Math.PI), o(O, M) >= 1 && (j = 0), 0 === u && j > 0 && (j -= 2 * Math.PI), 1 === u && j < 0 && (j += 2 * Math.PI), { cx: S, cy: w, rx: Object(r.j)(t, [f, d]) ? 0 : n, ry: Object(r.j)(t, [f, d]) ? 0 : i, startAngle: k, endAngle: k + j, xRotation: s, arcFlag: c, sweepFlag: u, } ); } }, 64: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var o = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.center = [0, 0]), (n.width = 300), (n.height = 300), (n.nodes = []), (n.edges = []), (n.onLayoutEnd = function () {}), n.updateCfg(e), n ); } return ( i(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, n = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + n[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + n[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(n(66).Base); e.RandomLayout = o; }, 65: function (t, e, n) { "use strict"; n(31), n(8); var r = n(184); n.d(e, "Canvas", function () { return r.a; }); n(52), n(63); }, 66: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function () {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, 7: function (t, e, n) { "use strict"; n.d(e, "b", function () { return r; }), n.d(e, "a", function () { return i; }), n.d(e, "c", function () { return o; }); var r = 1e-6, i = "undefined" != typeof Float32Array ? Float32Array : Array, o = Math.random; Math.PI; Math.hypot || (Math.hypot = function () { for (var t = 0, e = arguments.length; e--; ) t += arguments[e] * arguments[e]; return Math.sqrt(t); }); }, 8: function (t, e, n) { "use strict"; var r = n(34); n.d(e, "PathUtil", function () { return r; }); n(122), n(123); var i = n(86); n.d(e, "Event", function () { return i.a; }); n(87); var o = n(183); n.d(e, "AbstractCanvas", function () { return o.a; }); var a = n(124); n.d(e, "AbstractGroup", function () { return a.a; }); var s = n(125); n.d(e, "AbstractShape", function () { return s.a; }); var c = n(118); n.d(e, "getBBoxMethod", function () { return c.a; }), n.d(e, "registerBBox", function () { return c.b; }); var u = n(46); n.d(e, "getTextHeight", function () { return u.b; }), n.d(e, "assembleFont", function () { return u.a; }); var h = n(6); n.d(e, "isAllowCapture", function () { return h.b; }); var l = n(25); n.d(e, "multiplyVec2", function () { return l.c; }), n.d(e, "invert", function () { return l.a; }); n(88), n(90); }, 85: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "length", function () { return a; }), n.d(e, "fromValues", function () { return s; }), n.d(e, "copy", function () { return c; }), n.d(e, "set", function () { return u; }), n.d(e, "add", function () { return h; }), n.d(e, "subtract", function () { return l; }), n.d(e, "multiply", function () { return f; }), n.d(e, "divide", function () { return d; }), n.d(e, "ceil", function () { return p; }), n.d(e, "floor", function () { return g; }), n.d(e, "min", function () { return v; }), n.d(e, "max", function () { return y; }), n.d(e, "round", function () { return m; }), n.d(e, "scale", function () { return b; }), n.d(e, "scaleAndAdd", function () { return x; }), n.d(e, "distance", function () { return S; }), n.d(e, "squaredDistance", function () { return w; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return j; }), n.d(e, "dot", function () { return C; }), n.d(e, "cross", function () { return E; }), n.d(e, "lerp", function () { return P; }), n.d(e, "hermite", function () { return A; }), n.d(e, "bezier", function () { return I; }), n.d(e, "random", function () { return T; }), n.d(e, "transformMat4", function () { return N; }), n.d(e, "transformMat3", function () { return B; }), n.d(e, "transformQuat", function () { return L; }), n.d(e, "rotateX", function () { return D; }), n.d(e, "rotateY", function () { return _; }), n.d(e, "rotateZ", function () { return R; }), n.d(e, "angle", function () { return F; }), n.d(e, "zero", function () { return Y; }), n.d(e, "str", function () { return X; }), n.d(e, "exactEquals", function () { return z; }), n.d(e, "equals", function () { return W; }), n.d(e, "sub", function () { return V; }), n.d(e, "mul", function () { return G; }), n.d(e, "div", function () { return H; }), n.d(e, "dist", function () { return U; }), n.d(e, "sqrDist", function () { return Z; }), n.d(e, "len", function () { return K; }), n.d(e, "sqrLen", function () { return $; }), n.d(e, "forEach", function () { return Q; }); var r = n(7); function i() { var t = new r.a(3); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0), (t[2] = 0)), t; } function o(t) { var e = new r.a(3); return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), e; } function a(t) { var e = t[0], n = t[1], r = t[2]; return Math.hypot(e, n, r); } function s(t, e, n) { var i = new r.a(3); return (i[0] = t), (i[1] = e), (i[2] = n), i; } function c(t, e) { return (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), t; } function u(t, e, n, r) { return (t[0] = e), (t[1] = n), (t[2] = r), t; } function h(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), t ); } function l(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), t ); } function f(t, e, n) { return ( (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), (t[2] = e[2] * n[2]), t ); } function d(t, e, n) { return ( (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), (t[2] = e[2] / n[2]), t ); } function p(t, e) { return ( (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), (t[2] = Math.ceil(e[2])), t ); } function g(t, e) { return ( (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), (t[2] = Math.floor(e[2])), t ); } function v(t, e, n) { return ( (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), (t[2] = Math.min(e[2], n[2])), t ); } function y(t, e, n) { return ( (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), (t[2] = Math.max(e[2], n[2])), t ); } function m(t, e) { return ( (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), (t[2] = Math.round(e[2])), t ); } function b(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), t; } function x(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), t ); } function S(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return Math.hypot(n, r, i); } function w(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return n * n + r * r + i * i; } function O(t) { var e = t[0], n = t[1], r = t[2]; return e * e + n * n + r * r; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), (t[2] = -e[2]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), (t[2] = 1 / e[2]), t; } function j(t, e) { var n = e[0], r = e[1], i = e[2], o = n * n + r * r + i * i; return ( o > 0 && (o = 1 / Math.sqrt(o)), (t[0] = e[0] * o), (t[1] = e[1] * o), (t[2] = e[2] * o), t ); } function C(t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2]; } function E(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[0], s = n[1], c = n[2]; return ( (t[0] = i * c - o * s), (t[1] = o * a - r * c), (t[2] = r * s - i * a), t ); } function P(t, e, n, r) { var i = e[0], o = e[1], a = e[2]; return ( (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), (t[2] = a + r * (n[2] - a)), t ); } function A(t, e, n, r, i, o) { var a = o * o, s = a * (2 * o - 3) + 1, c = a * (o - 2) + o, u = a * (o - 1), h = a * (3 - 2 * o); return ( (t[0] = e[0] * s + n[0] * c + r[0] * u + i[0] * h), (t[1] = e[1] * s + n[1] * c + r[1] * u + i[1] * h), (t[2] = e[2] * s + n[2] * c + r[2] * u + i[2] * h), t ); } function I(t, e, n, r, i, o) { var a = 1 - o, s = a * a, c = o * o, u = s * a, h = 3 * o * s, l = 3 * c * a, f = c * o; return ( (t[0] = e[0] * u + n[0] * h + r[0] * l + i[0] * f), (t[1] = e[1] * u + n[1] * h + r[1] * l + i[1] * f), (t[2] = e[2] * u + n[2] * h + r[2] * l + i[2] * f), t ); } function T(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI, i = 2 * r.c() - 1, o = Math.sqrt(1 - i * i) * e; return ( (t[0] = Math.cos(n) * o), (t[1] = Math.sin(n) * o), (t[2] = i * e), t ); } function N(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[3] * r + n[7] * i + n[11] * o + n[15]; return ( (a = a || 1), (t[0] = (n[0] * r + n[4] * i + n[8] * o + n[12]) / a), (t[1] = (n[1] * r + n[5] * i + n[9] * o + n[13]) / a), (t[2] = (n[2] * r + n[6] * i + n[10] * o + n[14]) / a), t ); } function B(t, e, n) { var r = e[0], i = e[1], o = e[2]; return ( (t[0] = r * n[0] + i * n[3] + o * n[6]), (t[1] = r * n[1] + i * n[4] + o * n[7]), (t[2] = r * n[2] + i * n[5] + o * n[8]), t ); } function L(t, e, n) { var r = n[0], i = n[1], o = n[2], a = n[3], s = e[0], c = e[1], u = e[2], h = i * u - o * c, l = o * s - r * u, f = r * c - i * s, d = i * f - o * l, p = o * h - r * f, g = r * l - i * h, v = 2 * a; return ( (h *= v), (l *= v), (f *= v), (d *= 2), (p *= 2), (g *= 2), (t[0] = s + h + d), (t[1] = c + l + p), (t[2] = u + f + g), t ); } function D(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0]), (o[1] = i[1] * Math.cos(r) - i[2] * Math.sin(r)), (o[2] = i[1] * Math.sin(r) + i[2] * Math.cos(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function _(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[2] * Math.sin(r) + i[0] * Math.cos(r)), (o[1] = i[1]), (o[2] = i[2] * Math.cos(r) - i[0] * Math.sin(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function R(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0] * Math.cos(r) - i[1] * Math.sin(r)), (o[1] = i[0] * Math.sin(r) + i[1] * Math.cos(r)), (o[2] = i[2]), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function F(t, e) { var n = t[0], r = t[1], i = t[2], o = e[0], a = e[1], s = e[2], c = Math.sqrt(n * n + r * r + i * i) * Math.sqrt(o * o + a * a + s * s), u = c && C(t, e) / c; return Math.acos(Math.min(Math.max(u, -1), 1)); } function Y(t) { return (t[0] = 0), (t[1] = 0), (t[2] = 0), t; } function X(t) { return "vec3(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; } function z(t, e) { return t[0] === e[0] && t[1] === e[1] && t[2] === e[2]; } function W(t, e) { var n = t[0], i = t[1], o = t[2], a = e[0], s = e[1], c = e[2]; return ( Math.abs(n - a) <= r.b * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(i - s) <= r.b * Math.max(1, Math.abs(i), Math.abs(s)) && Math.abs(o - c) <= r.b * Math.max(1, Math.abs(o), Math.abs(c)) ); } var q, V = l, G = f, H = d, U = S, Z = w, K = a, $ = O, Q = ((q = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 3), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (q[0] = t[a]), (q[1] = t[a + 1]), (q[2] = t[a + 2]), i(q, q, o), (t[a] = q[0]), (t[a + 1] = q[1]), (t[a + 2] = q[2]); return t; }); }, 86: function (t, e, n) { "use strict"; var r = (function () { function t(t, e) { (this.bubbles = !0), (this.target = null), (this.currentTarget = null), (this.delegateTarget = null), (this.delegateObject = null), (this.defaultPrevented = !1), (this.propagationStopped = !1), (this.shape = null), (this.fromShape = null), (this.toShape = null), (this.propagationPath = []), (this.type = t), (this.name = t), (this.originalEvent = e), (this.timeStamp = e.timeStamp); } return ( (t.prototype.preventDefault = function () { (this.defaultPrevented = !0), this.originalEvent.preventDefault && this.originalEvent.preventDefault(); }), (t.prototype.stopPropagation = function () { this.propagationStopped = !0; }), (t.prototype.toString = function () { return "[Event (type=" + this.type + ")]"; }), (t.prototype.save = function () {}), (t.prototype.restore = function () {}), t ); })(); e.a = r; }, 87: function (t, e, n) { "use strict"; var r = n(1), i = n(91), o = n(6), a = (function (t) { function e(e) { var n = t.call(this) || this; n.destroyed = !1; var r = n.getDefaultCfg(); return (n.cfg = Object(o.i)(r, e)), n; } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.set = function (t, e) { this.cfg[t] = e; }), (e.prototype.destroy = function () { (this.cfg = { destroyed: !0 }), this.off(), (this.destroyed = !0); }), e ); })(i.a); e.a = a; }, 88: function (t, e, n) { "use strict"; n.d(e, "a", function () { return i; }); var r = null; function i() { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; } }, 89: function (t, e, n) { "use strict"; n.d(e, "b", function () { return c; }); var r = n(1), i = n(11), o = n(3); function a(t) { return ( t instanceof HTMLElement && Object(o.k)(t.nodeName) && "CANVAS" === t.nodeName.toUpperCase() ); } var s = null; function c(t) { s = t; } var u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(r.a)(Object(r.a)({}, e), { x: 0, y: 0, width: 0, height: 0, }); }), (e.prototype.initAttrs = function (t) { this._setImage(t.img); }), (e.prototype.isStroke = function () { return !1; }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._afterLoading = function () { if (!0 === this.get("toDraw")) { var t = this.get("canvas"); t ? t.draw() : this.createPath(this.get("context")); } }), (e.prototype._setImage = function (t) { var e = this, n = this.attrs; if ( !(null == s ? void 0 : s.isMini()) || (null == s ? void 0 : s.isMiniNative()) ) if (Object(o.k)(t)) { var r = null; ((r = (null == s ? void 0 : s.isMiniNative()) ? null == s ? void 0 : s.get("container").createImage() : new Image()).onload = function () { if (e.destroyed) return !1; e.attr("img", r), e.set("loading", !1), e._afterLoading(); var t = e.get("callback"); t && t.call(e); }), (r.crossOrigin = "Anonymous"), (r.src = t), this.set("loading", !0); } else (null == s ? void 0 : s.isMiniNative()) || t instanceof Image ? (n.width || (n.width = t.width), n.height || (n.height = t.height)) : a(t) && (n.width || (n.width = Number(t.getAttribute("width"))), n.height || (n.height, Number(t.getAttribute("height")))); else this.attr("img", t); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "img" === e && this._setImage(n); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.img, r = e.x, i = e.y, c = e.width, u = e.height, h = e.sx, l = e.sy, f = e.swidth, d = e.sheight; if (this.get("loading")) return this.set("toDraw", !0), void this.set("context", t); (null == s ? void 0 : s.isMini()) ? t.drawImage(n, r, i, c, u) : (n instanceof Image || a(n)) && (Object(o.h)(h) || Object(o.h)(l) || Object(o.h)(f) || Object(o.h)(d) ? t.drawImage(n, r, i, c, u) : t.drawImage(n, h, l, f, d, r, i, c, u)); }), e ); })(i.a); e.a = u; }, 9: function (t, e, n) { "use strict"; n.d(e, "e", function () { return y; }), n.d(e, "b", function () { return O; }), n.d(e, "a", function () { return A; }), n.d(e, "c", function () { return l; }), n.d(e, "d", function () { return D; }), n.d(e, "f", function () { return r; }); var r = {}; n.r(r), n.d(r, "distance", function () { return o; }), n.d(r, "isNumberEqual", function () { return a; }), n.d(r, "getBBoxByArray", function () { return s; }), n.d(r, "getBBoxRange", function () { return c; }), n.d(r, "piMod", function () { return u; }); var i = n(0); function o(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function a(t, e) { return Math.abs(t - e) < 0.001; } function s(t, e) { var n = Object(i.min)(t), r = Object(i.min)(e); return { x: n, y: r, width: Object(i.max)(t) - n, height: Object(i.max)(e) - r, }; } function c(t, e, n, r) { return { minX: Object(i.min)([t, n]), maxX: Object(i.max)([t, n]), minY: Object(i.min)([e, r]), maxY: Object(i.max)([e, r]), }; } function u(t) { return (t + 2 * Math.PI) % (2 * Math.PI); } var h = n(53), l = { box: function (t, e, n, r) { return s([t, n], [e, r]); }, length: function (t, e, n, r) { return o(t, e, n, r); }, pointAt: function (t, e, n, r, i) { return { x: (1 - i) * t + i * n, y: (1 - i) * e + i * r }; }, pointDistance: function (t, e, n, r, i, a) { var s = (n - t) * (i - t) + (r - e) * (a - e); return s < 0 ? o(t, e, i, a) : s > (n - t) * (n - t) + (r - e) * (r - e) ? o(n, r, i, a) : this.pointToLine(t, e, n, r, i, a); }, pointToLine: function (t, e, n, r, i, o) { var a = [n - t, r - e]; if (h.exactEquals(a, [0, 0])) return Math.sqrt((i - t) * (i - t) + (o - e) * (o - e)); var s = [-a[1], a[0]]; h.normalize(s, s); var c = [i - t, o - e]; return Math.abs(h.dot(c, s)); }, tangentAngle: function (t, e, n, r) { return Math.atan2(r - e, n - t); }, }; function f(t, e, n, r, i, a) { var s, c = 1 / 0, u = [n, r], h = 20; a && a > 200 && (h = a / 10); for (var l = 1 / h, f = l / 10, d = 0; d <= h; d++) { var p = d * l, g = [i.apply(null, t.concat([p])), i.apply(null, e.concat([p]))]; (b = o(u[0], u[1], g[0], g[1])) < c && ((s = p), (c = b)); } if (0 === s) return { x: t[0], y: e[0] }; if (1 === s) { var v = t.length; return { x: t[v - 1], y: e[v - 1] }; } c = 1 / 0; for (d = 0; d < 32 && !(f < 1e-4); d++) { var y = s - f, m = s + f, b = ((g = [ i.apply(null, t.concat([y])), i.apply(null, e.concat([y])), ]), o(u[0], u[1], g[0], g[1])); if (y >= 0 && b < c) (s = y), (c = b); else { var x = [ i.apply(null, t.concat([m])), i.apply(null, e.concat([m])), ], S = o(u[0], u[1], x[0], x[1]); m <= 1 && S < c ? ((s = m), (c = S)) : (f *= 0.5); } } return { x: i.apply(null, t.concat([s])), y: i.apply(null, e.concat([s])), }; } function d(t, e, n, r) { var i = 1 - r; return i * i * t + 2 * r * i * e + r * r * n; } function p(t, e, n) { var r = t + n - 2 * e; if (a(r, 0)) return [0.5]; var i = (t - e) / r; return i <= 1 && i >= 0 ? [i] : []; } function g(t, e, n, r) { return 2 * (1 - r) * (e - t) + 2 * r * (n - e); } function v(t, e, n, r, i, o, a) { var s = d(t, n, i, a), c = d(e, r, o, a), u = l.pointAt(t, e, n, r, a), h = l.pointAt(n, r, i, o, a); return [ [t, e, u.x, u.y, s, c], [s, c, h.x, h.y, i, o], ]; } var y = { box: function (t, e, n, r, i, o) { var a = p(t, n, i)[0], c = p(e, r, o)[0], u = [t, i], h = [e, o]; return ( void 0 !== a && u.push(d(t, n, i, a)), void 0 !== c && h.push(d(e, r, o, c)), s(u, h) ); }, length: function (t, e, n, r, i, a) { return (function t(e, n, r, i, a, s, c) { if (0 === c) return (o(e, n, r, i) + o(r, i, a, s) + o(e, n, a, s)) / 2; var u = v(e, n, r, i, a, s, 0.5), h = u[0], l = u[1]; return ( h.push(c - 1), l.push(c - 1), t.apply(null, h) + t.apply(null, l) ); })(t, e, n, r, i, a, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s) { return f([t, n, i], [e, r, o], a, s, d); }, pointDistance: function (t, e, n, r, i, a, s, c) { var u = this.nearestPoint(t, e, n, r, i, a, s, c); return o(u.x, u.y, s, c); }, interpolationAt: d, pointAt: function (t, e, n, r, i, o, a) { return { x: d(t, n, i, a), y: d(e, r, o, a) }; }, divide: function (t, e, n, r, i, o, a) { return v(t, e, n, r, i, o, a); }, tangentAngle: function (t, e, n, r, i, o, a) { var s = g(t, n, i, a), c = g(e, r, o, a); return u(Math.atan2(c, s)); }, }; function m(t, e, n, r, i) { var o = 1 - i; return ( o * o * o * t + 3 * e * i * o * o + 3 * n * i * i * o + r * i * i * i ); } function b(t, e, n, r, i) { var o = 1 - i; return 3 * (o * o * (e - t) + 2 * o * i * (n - e) + i * i * (r - n)); } function x(t, e, n, r) { var i, o, s, c = -3 * t + 9 * e - 9 * n + 3 * r, u = 6 * t - 12 * e + 6 * n, h = 3 * e - 3 * t, l = []; if (a(c, 0)) a(u, 0) || ((i = -h / u) >= 0 && i <= 1 && l.push(i)); else { var f = u * u - 4 * c * h; a(f, 0) ? l.push(-u / (2 * c)) : f > 0 && ((o = (-u - (s = Math.sqrt(f))) / (2 * c)), (i = (-u + s) / (2 * c)) >= 0 && i <= 1 && l.push(i), o >= 0 && o <= 1 && l.push(o)); } return l; } function S(t, e, n, r, i, o, a, s, c) { var u = m(t, n, i, a, c), h = m(e, r, o, s, c), f = l.pointAt(t, e, n, r, c), d = l.pointAt(n, r, i, o, c), p = l.pointAt(i, o, a, s, c), g = l.pointAt(f.x, f.y, d.x, d.y, c), v = l.pointAt(d.x, d.y, p.x, p.y, c); return [ [t, e, f.x, f.y, g.x, g.y, u, h], [u, h, v.x, v.y, p.x, p.y, a, s], ]; } function w(t, e, n, r, i, a, s, c, u) { if (0 === u) return (function (t, e) { for (var n = 0, r = t.length, i = 0; i < r; i++) { n += o(t[i], e[i], t[(i + 1) % r], e[(i + 1) % r]); } return n / 2; })([t, n, i, s], [e, r, a, c]); var h = S(t, e, n, r, i, a, s, c, 0.5), l = h[0], f = h[1]; return ( l.push(u - 1), f.push(u - 1), w.apply(null, l) + w.apply(null, f) ); } var O = { extrema: x, box: function (t, e, n, r, i, o, a, c) { for ( var u = [t, a], h = [e, c], l = x(t, n, i, a), f = x(e, r, o, c), d = 0; d < l.length; d++ ) u.push(m(t, n, i, a, l[d])); for (d = 0; d < f.length; d++) h.push(m(e, r, o, c, f[d])); return s(u, h); }, length: function (t, e, n, r, i, o, a, s) { return w(t, e, n, r, i, o, a, s, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s, c, u, h) { return f([t, n, i, a], [e, r, o, s], c, u, m, h); }, pointDistance: function (t, e, n, r, i, a, s, c, u, h, l) { var f = this.nearestPoint(t, e, n, r, i, a, s, c, u, h, l); return o(f.x, f.y, u, h); }, interpolationAt: m, pointAt: function (t, e, n, r, i, o, a, s, c) { return { x: m(t, n, i, a, c), y: m(e, r, o, s, c) }; }, divide: function (t, e, n, r, i, o, a, s, c) { return S(t, e, n, r, i, o, a, s, c); }, tangentAngle: function (t, e, n, r, i, o, a, s, c) { var h = b(t, n, i, a, c), l = b(e, r, o, s, c); return u(Math.atan2(l, h)); }, }; function M(t, e) { var n = Math.abs(t); return e > 0 ? n : -1 * n; } var k = function (t, e, n, r, i, o) { var a = n, s = r; if (0 === a || 0 === s) return { x: t, y: e }; for ( var c, u, h = i - t, l = o - e, f = Math.abs(h), d = Math.abs(l), p = a * a, g = s * s, v = Math.PI / 4, y = 0; y < 4; y++ ) { (c = a * Math.cos(v)), (u = s * Math.sin(v)); var m = ((p - g) * Math.pow(Math.cos(v), 3)) / a, b = ((g - p) * Math.pow(Math.sin(v), 3)) / s, x = c - m, S = u - b, w = f - m, O = d - b, k = Math.hypot(S, x), j = Math.hypot(O, w); (v += (k * Math.asin((x * O - S * w) / (k * j))) / Math.sqrt(p + g - c * c - u * u)), (v = Math.min(Math.PI / 2, Math.max(0, v))); } return { x: t + M(c, h), y: e + M(u, l) }; }; function j(t, e, n, r, i, o) { return ( n * Math.cos(i) * Math.cos(o) - r * Math.sin(i) * Math.sin(o) + t ); } function C(t, e, n, r, i, o) { return ( n * Math.sin(i) * Math.cos(o) + r * Math.cos(i) * Math.sin(o) + e ); } function E(t, e, n) { return { x: t * Math.cos(n), y: e * Math.sin(n) }; } function P(t, e, n) { var r = Math.cos(n), i = Math.sin(n); return [t * r - e * i, t * i + e * r]; } var A = { box: function (t, e, n, r, i, o, a) { for ( var s = (function (t, e, n) { return Math.atan((-e / t) * Math.tan(n)); })(n, r, i), c = 1 / 0, u = -1 / 0, h = [o, a], l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI ) { var f = s + l; o < a ? o < f && f < a && h.push(f) : a < f && f < o && h.push(f); } for (l = 0; l < h.length; l++) { var d = j(t, 0, n, r, i, h[l]); d < c && (c = d), d > u && (u = d); } var p = (function (t, e, n) { return Math.atan(e / (t * Math.tan(n))); })(n, r, i), g = 1 / 0, v = -1 / 0, y = [o, a]; for (l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI) { var m = p + l; o < a ? o < m && m < a && y.push(m) : a < m && m < o && y.push(m); } for (l = 0; l < y.length; l++) { var b = C(0, e, n, r, i, y[l]); b < g && (g = b), b > v && (v = b); } return { x: c, y: g, width: u - c, height: v - g }; }, length: function (t, e, n, r, i, o, a) {}, nearestPoint: function (t, e, n, r, i, o, a, s, c) { var u = P(s - t, c - e, -i), h = u[0], l = u[1], f = k(0, 0, n, r, h, l), d = (function (t, e, n, r) { return (Math.atan2(r * t, n * e) + 2 * Math.PI) % (2 * Math.PI); })(n, r, f.x, f.y); d < o ? (f = E(n, r, o)) : d > a && (f = E(n, r, a)); var p = P(f.x, f.y, i); return { x: p[0] + t, y: p[1] + e }; }, pointDistance: function (t, e, n, r, i, a, s, c, u) { var h = this.nearestPoint(t, e, n, r, c, u); return o(h.x, h.y, c, u); }, pointAt: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o; return { x: j(t, 0, n, r, i, c), y: C(0, e, n, r, i, c) }; }, tangentAngle: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o, h = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.cos(i) * Math.sin(s) - r * Math.sin(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c), l = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.sin(i) * Math.sin(s) + r * Math.cos(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c); return u(Math.atan2(l, h)); }, }; function I(t) { for (var e = 0, n = [], r = 0; r < t.length - 1; r++) { var i = t[r], a = t[r + 1], s = o(i[0], i[1], a[0], a[1]), c = { from: i, to: a, length: s }; n.push(c), (e += s); } return { segments: n, totalLength: e }; } function T(t) { if (t.length < 2) return 0; for (var e = 0, n = 0; n < t.length - 1; n++) { var r = t[n], i = t[n + 1]; e += o(r[0], r[1], i[0], i[1]); } return e; } function N(t, e) { if (e > 1 || e < 0 || t.length < 2) return null; var n = I(t), r = n.segments, i = n.totalLength; if (0 === i) return { x: t[0][0], y: t[0][1] }; for (var o = 0, a = null, s = 0; s < r.length; s++) { var c = r[s], u = c.from, h = c.to, f = c.length / i; if (e >= o && e <= o + f) { var d = (e - o) / f; a = l.pointAt(u[0], u[1], h[0], h[1], d); break; } o += f; } return a; } function B(t, e) { if (e > 1 || e < 0 || t.length < 2) return 0; for ( var n = I(t), r = n.segments, i = n.totalLength, o = 0, a = 0, s = 0; s < r.length; s++ ) { var c = r[s], u = c.from, h = c.to, l = c.length / i; if (e >= o && e <= o + l) { a = Math.atan2(h[1] - u[1], h[0] - u[0]); break; } o += l; } return a; } function L(t, e, n) { for (var r = 1 / 0, i = 0; i < t.length - 1; i++) { var o = t[i], a = t[i + 1], s = l.pointDistance(o[0], o[1], a[0], a[1], e, n); s < r && (r = s); } return r; } var D = { box: function (t) { for (var e = [], n = [], r = 0; r < t.length; r++) { var i = t[r]; e.push(i[0]), n.push(i[1]); } return s(e, n); }, length: function (t) { return T(t); }, pointAt: function (t, e) { return N(t, e); }, pointDistance: function (t, e, n) { return L(t, e, n); }, tangentAngle: function (t, e) { return B(t, e); }, }; }, 90: function (t, e, n) { "use strict"; n.d(e, "a", function () { return R; }); var r = {}; function i(t) { return +t; } function o(t) { return t * t; } function a(t) { return t * (2 - t); } function s(t) { return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; } function c(t) { return t * t * t; } function u(t) { return --t * t * t + 1; } function h(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } n.r(r), n.d(r, "easeLinear", function () { return i; }), n.d(r, "easeQuad", function () { return s; }), n.d(r, "easeQuadIn", function () { return o; }), n.d(r, "easeQuadOut", function () { return a; }), n.d(r, "easeQuadInOut", function () { return s; }), n.d(r, "easeCubic", function () { return h; }), n.d(r, "easeCubicIn", function () { return c; }), n.d(r, "easeCubicOut", function () { return u; }), n.d(r, "easeCubicInOut", function () { return h; }), n.d(r, "easePoly", function () { return d; }), n.d(r, "easePolyIn", function () { return l; }), n.d(r, "easePolyOut", function () { return f; }), n.d(r, "easePolyInOut", function () { return d; }), n.d(r, "easeSin", function () { return m; }), n.d(r, "easeSinIn", function () { return v; }), n.d(r, "easeSinOut", function () { return y; }), n.d(r, "easeSinInOut", function () { return m; }), n.d(r, "easeExp", function () { return w; }), n.d(r, "easeExpIn", function () { return x; }), n.d(r, "easeExpOut", function () { return S; }), n.d(r, "easeExpInOut", function () { return w; }), n.d(r, "easeCircle", function () { return k; }), n.d(r, "easeCircleIn", function () { return O; }), n.d(r, "easeCircleOut", function () { return M; }), n.d(r, "easeCircleInOut", function () { return k; }), n.d(r, "easeBounce", function () { return E; }), n.d(r, "easeBounceIn", function () { return C; }), n.d(r, "easeBounceOut", function () { return E; }), n.d(r, "easeBounceInOut", function () { return P; }), n.d(r, "easeBack", function () { return T; }), n.d(r, "easeBackIn", function () { return A; }), n.d(r, "easeBackOut", function () { return I; }), n.d(r, "easeBackInOut", function () { return T; }), n.d(r, "easeElastic", function () { return L; }), n.d(r, "easeElasticIn", function () { return B; }), n.d(r, "easeElasticOut", function () { return L; }), n.d(r, "easeElasticInOut", function () { return D; }); var l = (function t(e) { function n(t) { return Math.pow(t, e); } return (e = +e), (n.exponent = t), n; })(3), f = (function t(e) { function n(t) { return 1 - Math.pow(1 - t, e); } return (e = +e), (n.exponent = t), n; })(3), d = (function t(e) { function n(t) { return ( ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2 ); } return (e = +e), (n.exponent = t), n; })(3), p = Math.PI, g = p / 2; function v(t) { return 1 == +t ? 1 : 1 - Math.cos(t * g); } function y(t) { return Math.sin(t * g); } function m(t) { return (1 - Math.cos(p * t)) / 2; } function b(t) { return 1.0009775171065494 * (Math.pow(2, -10 * t) - 0.0009765625); } function x(t) { return b(1 - +t); } function S(t) { return 1 - b(t); } function w(t) { return ((t *= 2) <= 1 ? b(1 - t) : 2 - b(t - 1)) / 2; } function O(t) { return 1 - Math.sqrt(1 - t * t); } function M(t) { return Math.sqrt(1 - --t * t); } function k(t) { return ( ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2 ); } var j = 7.5625; function C(t) { return 1 - E(1 - t); } function E(t) { return (t = +t) < 4 / 11 ? j * t * t : t < 8 / 11 ? j * (t -= 6 / 11) * t + 3 / 4 : t < 10 / 11 ? j * (t -= 9 / 11) * t + 15 / 16 : j * (t -= 21 / 22) * t + 63 / 64; } function P(t) { return ((t *= 2) <= 1 ? 1 - E(1 - t) : E(t - 1) + 1) / 2; } var A = (function t(e) { function n(t) { return (t = +t) * t * (e * (t - 1) + t); } return (e = +e), (n.overshoot = t), n; })(1.70158), I = (function t(e) { function n(t) { return --t * t * ((t + 1) * e + t) + 1; } return (e = +e), (n.overshoot = t), n; })(1.70158), T = (function t(e) { function n(t) { return ( ((t *= 2) < 1 ? t * t * ((e + 1) * t - e) : (t -= 2) * t * ((e + 1) * t + e) + 2) / 2 ); } return (e = +e), (n.overshoot = t), n; })(1.70158), N = 2 * Math.PI, B = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return e * b(-(--t)) * Math.sin((r - t) / n); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), L = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return 1 - e * b((t = +t)) * Math.sin((t + r) / n); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), D = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return ( ((t = 2 * t - 1) < 0 ? e * b(-t) * Math.sin((r - t) / n) : 2 - e * b(t) * Math.sin((r + t) / n)) / 2 ); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), _ = {}; function R(t) { return _[t.toLowerCase()] || r[t]; } }, 91: function (t, e, n) { "use strict"; var r = (function () { function t() { this._events = {}; } return ( (t.prototype.on = function (t, e, n) { return ( this._events[t] || (this._events[t] = []), this._events[t].push({ callback: e, once: !!n }), this ); }), (t.prototype.once = function (t, e) { return this.on(t, e, !0); }), (t.prototype.emit = function (t) { for (var e = this, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = this._events[t] || [], o = this._events["*"] || [], a = function (r) { for (var i = r.length, o = 0; o < i; o++) if (r[o]) { var a = r[o], s = a.callback; a.once && (r.splice(o, 1), 0 === r.length && delete e._events[t], i--, o--), s.apply(e, n); } }; a(i), a(o); }), (t.prototype.off = function (t, e) { if (t) if (e) { for ( var n = this._events[t] || [], r = n.length, i = 0; i < r; i++ ) n[i].callback === e && (n.splice(i, 1), r--, i--); 0 === n.length && delete this._events[t]; } else delete this._events[t]; else this._events = {}; return this; }), (t.prototype.getEvents = function () { return this._events; }), t ); })(); e.a = r; }, 92: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(93), a = n(6), s = {}; var c = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.isCanvas = function () { return !1; }), (e.prototype.getBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], c = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( c.length > 0 ? (Object(a.a)(c, function (t) { var e = t.getBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.min)(o)), (e = Object(i.max)(o)), (n = Object(i.min)(s)), (r = Object(i.max)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getCanvasBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], c = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( c.length > 0 ? (Object(a.a)(c, function (t) { var e = t.getCanvasBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.min)(o)), (e = Object(i.max)(o)), (n = Object(i.min)(s)), (r = Object(i.max)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.children = []), e; }), (e.prototype.onAttrChange = function (e, n, r) { if ( (t.prototype.onAttrChange.call(this, e, n, r), "matrix" === e) ) { var i = this.getTotalMatrix(); this._applyChildrenMarix(i); } }), (e.prototype.applyMatrix = function (e) { var n = this.getTotalMatrix(); t.prototype.applyMatrix.call(this, e); var r = this.getTotalMatrix(); r !== n && this._applyChildrenMarix(r); }), (e.prototype._applyChildrenMarix = function (t) { var e = this.getChildren(); Object(a.a)(e, function (e) { e.applyMatrix(t); }); }), (e.prototype.addShape = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = t[0], r = t[1]; Object(a.f)(n) ? (r = n) : (r.type = n); var i = s[r.type]; i || ((i = Object(a.k)(r.type)), (s[r.type] = i)); var o = this.getShapeBase(), c = new o[i](r); return this.add(c), c; }), (e.prototype.addGroup = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n, r = t[0], i = t[1]; if (Object(a.d)(r)) n = new r(i || { parent: this }); else { var o = r || {}, s = this.getGroupBase(); n = new s(o); } return this.add(n), n; }), (e.prototype.getCanvas = function () { return this.isCanvas() ? this : this.get("canvas"); }), (e.prototype.getShape = function (t, e, n) { if (!Object(a.b)(this)) return null; var r, i = this.getChildren(); if (this.isCanvas()) r = this._findShape(i, t, e, n); else { var o = [t, e, 1]; (o = this.invertFromMatrix(o)), this.isClipped(o[0], o[1]) || (r = this._findShape(i, o[0], o[1], n)); } return r; }), (e.prototype._findShape = function (t, e, n, r) { for (var i = null, o = t.length - 1; o >= 0; o--) { var s = t[o]; if ( (Object(a.b)(s) && (s.isGroup() ? (i = s.getShape(e, n, r)) : s.isHit(e, n) && (i = s)), i) ) break; } return i; }), (e.prototype.add = function (t) { var e = this.getCanvas(), n = this.getChildren(), r = this.get("timeline"), i = t.getParent(); i && (function (t, e, n) { void 0 === n && (n = !0), n ? e.destroy() : (e.set("parent", null), e.set("canvas", null)), Object(a.j)(t.getChildren(), e); })(i, t, !1), t.set("parent", this), e && (function t(e, n) { if ((e.set("canvas", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, e), r && (function t(e, n) { if ((e.set("timeline", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, r), n.push(t), t.onCanvasChange("add"), this._applyElementMatrix(t); }), (e.prototype._applyElementMatrix = function (t) { var e = this.getTotalMatrix(); e && t.applyMatrix(e); }), (e.prototype.getChildren = function () { return this.get("children"); }), (e.prototype.sort = function () { var t, e = this.getChildren(); Object(a.a)(e, function (t, e) { return (t._INDEX = e), t; }), e.sort( ((t = function (t, e) { return t.get("zIndex") - e.get("zIndex"); }), function (e, n) { var r = t(e, n); return 0 === r ? e._INDEX - n._INDEX : r; }), ), this.onCanvasChange("sort"); }), (e.prototype.clear = function () { if ((this.set("clearing", !0), !this.destroyed)) { for (var t = this.getChildren(), e = t.length - 1; e >= 0; e--) t[e].destroy(); this.set("children", []), this.onCanvasChange("clear"), this.set("clearing", !1); } }), (e.prototype.destroy = function () { this.get("destroyed") || (this.clear(), t.prototype.destroy.call(this)); }), (e.prototype.getFirst = function () { return this.getChildByIndex(0); }), (e.prototype.getLast = function () { var t = this.getChildren(); return this.getChildByIndex(t.length - 1); }), (e.prototype.getChildByIndex = function (t) { return this.getChildren()[t]; }), (e.prototype.getCount = function () { return this.getChildren().length; }), (e.prototype.contain = function (t) { return this.getChildren().indexOf(t) > -1; }), (e.prototype.removeChild = function (t, e) { void 0 === e && (e = !0), this.contain(t) && t.remove(e); }), (e.prototype.findAll = function (t) { var e = [], n = this.getChildren(); return ( Object(a.a)(n, function (n) { t(n) && e.push(n), n.isGroup() && (e = e.concat(n.findAll(t))); }), e ); }), (e.prototype.find = function (t) { var e = null, n = this.getChildren(); return ( Object(a.a)(n, function (n) { if ((t(n) ? (e = n) : n.isGroup() && (e = n.find(t)), e)) return !1; }), e ); }), (e.prototype.findById = function (t) { return this.find(function (e) { return e.get("id") === t; }); }), (e.prototype.findByClassName = function (t) { return this.find(function (e) { return e.get("className") === t; }); }), (e.prototype.findAllByName = function (t) { return this.findAll(function (e) { return e.get("name") === t; }); }), e ); })(o.a); e.a = c; }, 93: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(4), a = n(6), s = n(25), c = n(87), u = o.a.transform, h = ["zIndex", "capture", "visible", "type"], l = ["repeat"]; function f(t, e) { var n = {}, r = e.attrs; for (var i in t) n[i] = r[i]; return n; } function d(t, e) { var n = {}, r = e.attr(); return ( Object(i.each)(t, function (t, e) { -1 !== l.indexOf(e) || Object(i.isEqual)(r[e], t) || (n[e] = t); }), n ); } function p(t, e) { if (e.onFrame) return t; var n = e.startTime, r = e.delay, o = e.duration, a = Object.prototype.hasOwnProperty; return ( Object(i.each)(t, function (t) { n + r < t.startTime + t.delay + t.duration && o > t.delay && Object(i.each)(e.toAttrs, function (e, n) { a.call(t.toAttrs, n) && (delete t.toAttrs[n], delete t.fromAttrs[n]); }); }), t ); } var g = (function (t) { function e(e) { var n = t.call(this, e) || this; n.attrs = {}; var r = n.getDefaultAttrs(); return ( Object(i.mix)(r, e.attrs), (n.attrs = r), n.initAttrs(r), n.initAnimate(), n ); } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return { visible: !0, capture: !0, zIndex: 0 }; }), (e.prototype.getDefaultAttrs = function () { return { matrix: this.getDefaultMatrix(), opacity: 1 }; }), (e.prototype.onCanvasChange = function (t) {}), (e.prototype.initAttrs = function (t) {}), (e.prototype.initAnimate = function () { this.set("animable", !0), this.set("animating", !1); }), (e.prototype.isGroup = function () { return !1; }), (e.prototype.getParent = function () { return this.get("parent"); }), (e.prototype.getCanvas = function () { return this.get("canvas"); }), (e.prototype.attr = function () { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; var r = e[0], o = e[1]; if (!r) return this.attrs; if (Object(i.isObject)(r)) { for (var a in r) this.setAttr(a, r[a]); return this.afterAttrsChange(r), this; } return 2 === e.length ? (this.setAttr(r, o), this.afterAttrsChange((((t = {})[r] = o), t)), this) : this.attrs[r]; }), (e.prototype.isClipped = function (t, e) { var n = this.getClip(); return n && !n.isHit(t, e); }), (e.prototype.setAttr = function (t, e) { var n = this.attrs[t]; n !== e && ((this.attrs[t] = e), this.onAttrChange(t, e, n)); }), (e.prototype.onAttrChange = function (t, e, n) { "matrix" === t && this.set("totalMatrix", null); }), (e.prototype.afterAttrsChange = function (t) { if (this.cfg.isClipShape) { var e = this.cfg.applyTo; e && e.onCanvasChange("clip"); } else this.onCanvasChange("attr"); }), (e.prototype.show = function () { return this.set("visible", !0), this.onCanvasChange("show"), this; }), (e.prototype.hide = function () { return this.set("visible", !1), this.onCanvasChange("hide"), this; }), (e.prototype.setZIndex = function (t) { this.set("zIndex", t); var e = this.getParent(); return e && e.sort(), this; }), (e.prototype.toFront = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.push(this), this.onCanvasChange("zIndex"); } }), (e.prototype.toBack = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.unshift(this), this.onCanvasChange("zIndex"); } }), (e.prototype.remove = function (t) { void 0 === t && (t = !0); var e = this.getParent(); e ? (Object(a.j)(e.getChildren(), this), e.get("clearing") || this.onCanvasChange("remove")) : this.onCanvasChange("remove"), t && this.destroy(); }), (e.prototype.resetMatrix = function () { this.attr("matrix", this.getDefaultMatrix()), this.onCanvasChange("matrix"); }), (e.prototype.getMatrix = function () { return this.attr("matrix"); }), (e.prototype.setMatrix = function (t) { this.attr("matrix", t), this.onCanvasChange("matrix"); }), (e.prototype.getTotalMatrix = function () { var t = this.cfg.totalMatrix; if (!t) { var e = this.attr("matrix"), n = this.cfg.parentMatrix; (t = n && e ? Object(s.b)(n, e) : e || n), this.set("totalMatrix", t); } return t; }), (e.prototype.applyMatrix = function (t) { var e = this.attr("matrix"), n = null; (n = t && e ? Object(s.b)(t, e) : e || t), this.set("totalMatrix", n), this.set("parentMatrix", t); }), (e.prototype.getDefaultMatrix = function () { return null; }), (e.prototype.applyToMatrix = function (t) { var e = this.attr("matrix"); return e ? Object(s.c)(e, t) : t; }), (e.prototype.invertFromMatrix = function (t) { var e = this.attr("matrix"); if (e) { var n = Object(s.a)(e); if (n) return Object(s.c)(n, t); } return t; }), (e.prototype.setClip = function (t) { var e = this.getCanvas(), n = null; if (t) { var r = this.getShapeBase()[Object(i.upperFirst)(t.type)]; r && (n = new r({ type: t.type, isClipShape: !0, applyTo: this, attrs: t.attrs, canvas: e, })); } return this.set("clipShape", n), this.onCanvasChange("clip"), n; }), (e.prototype.getClip = function () { var t = this.cfg.clipShape; return t || null; }), (e.prototype.clone = function () { var t = this, e = this.attrs, n = {}; Object(i.each)(e, function (t, r) { Object(i.isArray)(e[r]) ? (n[r] = (function (t) { for (var e = [], n = 0; n < t.length; n++) Object(i.isArray)(t[n]) ? e.push([].concat(t[n])) : e.push(t[n]); return e; })(e[r])) : (n[r] = e[r]); }); var r = new (0, this.constructor)({ attrs: n }); return ( Object(i.each)(h, function (e) { r.set(e, t.get(e)); }), r ); }), (e.prototype.destroy = function () { this.destroyed || ((this.attrs = {}), t.prototype.destroy.call(this)); }), (e.prototype.isAnimatePaused = function () { return this.get("_pause").isPaused; }), (e.prototype.animate = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this.get("timeline") || this.get("canvas")) { this.set("animating", !0); var n = this.get("timeline"); n || ((n = this.get("canvas").get("timeline")), this.set("timeline", n)); var r = this.get("animations") || []; n.timer || n.initTimer(); var o, a, s, c, u, h = t[0], l = t[1], g = t[2], v = void 0 === g ? "easeLinear" : g, y = t[3], m = void 0 === y ? i.noop : y, b = t[4], x = void 0 === b ? 0 : b; Object(i.isFunction)(h) ? ((o = h), (h = {})) : Object(i.isObject)(h) && h.onFrame && ((o = h.onFrame), (a = h.repeat)), Object(i.isObject)(l) ? ((l = (u = l).duration), (v = u.easing || "easeLinear"), (x = u.delay || 0), (a = u.repeat || a || !1), (m = u.callback || i.noop), (s = u.pauseCallback || i.noop), (c = u.resumeCallback || i.noop)) : (Object(i.isNumber)(m) && ((x = m), (m = null)), Object(i.isFunction)(v) ? ((m = v), (v = "easeLinear")) : (v = v || "easeLinear")); var S = d(h, this), w = { fromAttrs: f(S, this), toAttrs: S, duration: l, easing: v, repeat: a, callback: m, pauseCallback: s, resumeCallback: c, delay: x, startTime: n.getTime(), id: Object(i.uniqueId)(), onFrame: o, pathFormatted: !1, }; r.length > 0 ? (r = p(r, w)) : n.addAnimator(this), r.push(w), this.set("animations", r), this.set("_pause", { isPaused: !1 }); } }), (e.prototype.stopAnimate = function (t) { var e = this; void 0 === t && (t = !0); var n = this.get("animations"); Object(i.each)(n, function (n) { t && (n.onFrame ? e.attr(n.onFrame(1)) : e.attr(n.toAttrs)), n.callback && n.callback(); }), this.set("animating", !1), this.set("animations", []); }), (e.prototype.pauseAnimate = function () { var t = this.get("timeline"), e = this.get("animations"), n = t.getTime(); return ( Object(i.each)(e, function (t) { (t._paused = !0), (t._pauseTime = n), t.pauseCallback && t.pauseCallback(); }), this.set("_pause", { isPaused: !0, pauseTime: n }), this ); }), (e.prototype.resumeAnimate = function () { var t = this.get("timeline").getTime(), e = this.get("animations"), n = this.get("_pause").pauseTime; return ( Object(i.each)(e, function (e) { (e.startTime = e.startTime + (t - n)), (e._paused = !1), (e._pauseTime = null), e.resumeCallback && e.resumeCallback(); }), this.set("_pause", { isPaused: !1 }), this.set("animations", e), this ); }), (e.prototype.emitDelegation = function (t, e) { var n, r = this, o = e.propagationPath; this.getEvents(); "mouseenter" === t ? (n = e.fromShape) : "mouseleave" === t && (n = e.toShape); for ( var s = function (t) { var s = o[t], u = s.get("name"); if (u) { if ( (s.isGroup() || (s.isCanvas && s.isCanvas())) && n && Object(a.g)(s, n) ) return "break"; Object(i.isArray)(u) ? Object(i.each)(u, function (t) { r.emitDelegateEvent(s, t, e); }) : c.emitDelegateEvent(s, u, e); } }, c = this, u = 0; u < o.length; u++ ) { if ("break" === s(u)) break; } }), (e.prototype.emitDelegateEvent = function (t, e, n) { var r = this.getEvents(), i = e + ":" + n.type; (r[i] || r["*"]) && ((n.name = i), (n.currentTarget = t), (n.delegateTarget = this), (n.delegateObject = t.get("delegateObject")), this.emit(i, n)); }), (e.prototype.translate = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0); var n = this.getMatrix(), r = u(n, [["t", t, e]]); return this.setMatrix(r), this; }), (e.prototype.move = function (t, e) { var n = this.attr("x") || 0, r = this.attr("y") || 0; return this.translate(t - n, e - r), this; }), (e.prototype.moveTo = function (t, e) { return this.move(t, e); }), (e.prototype.scale = function (t, e) { var n = this.getMatrix(), r = u(n, [["s", t, e || t]]); return this.setMatrix(r), this; }), (e.prototype.rotate = function (t) { var e = this.getMatrix(), n = u(e, [["r", t]]); return this.setMatrix(n), this; }), (e.prototype.rotateAtStart = function (t) { var e = this.attr(), n = e.x, r = e.y, i = this.getMatrix(), o = u(i, [ ["t", -n, -r], ["r", t], ["t", n, r], ]); return this.setMatrix(o), this; }), (e.prototype.rotateAtPoint = function (t, e, n) { var r = this.getMatrix(), i = u(r, [ ["t", -t, -e], ["r", n], ["t", t, e], ]); return this.setMatrix(i), this; }), e ); })(c.a); e.a = g; }, 94: function (t, e, n) { "use strict"; n.d(e, "b", function () { return u; }), n.d(e, "a", function () { return h; }); var r = n(3), i = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i, o = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i, a = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i, s = /[\d.]+:(#[^\s]+|[^\)]+\))/gi; function c(t, e) { var n = t.match(s); Object(r.b)(n, function (t) { var n = t.split(":"); e.addColorStop(n[0], n[1]); }); } function u(t, e, n) { if (Object(r.k)(n)) { if ("(" === n[1] || "(" === n[2]) { if ("l" === n[0]) return (function (t, e, n) { var r, o, a = i.exec(n), s = (parseFloat(a[1]) % 360) * (Math.PI / 180), u = a[2], h = e.getBBox(); s >= 0 && s < 0.5 * Math.PI ? ((r = { x: h.minX, y: h.minY }), (o = { x: h.maxX, y: h.maxY })) : 0.5 * Math.PI <= s && s < Math.PI ? ((r = { x: h.maxX, y: h.minY }), (o = { x: h.minX, y: h.maxY })) : Math.PI <= s && s < 1.5 * Math.PI ? ((r = { x: h.maxX, y: h.maxY }), (o = { x: h.minX, y: h.minY })) : ((r = { x: h.minX, y: h.maxY }), (o = { x: h.maxX, y: h.minY })); var l = Math.tan(s), f = l * l, d = (o.x - r.x + l * (o.y - r.y)) / (f + 1) + r.x, p = (l * (o.x - r.x + l * (o.y - r.y))) / (f + 1) + r.y, g = t.createLinearGradient(r.x, r.y, d, p); return c(u, g), g; })(t, e, n); if ("r" === n[0]) return (function (t, e, n) { var r = o.exec(n), i = parseFloat(r[1]), a = parseFloat(r[2]), u = parseFloat(r[3]), h = r[4]; if (0 === u) { var l = h.match(s); return l[l.length - 1].split(":")[1]; } var f = e.getBBox(), d = f.maxX - f.minX, p = f.maxY - f.minY, g = Math.sqrt(d * d + p * p) / 2, v = t.createRadialGradient( f.minX + d * i, f.minY + p * a, 0, f.minX + d / 2, f.minY + p / 2, u * g, ); return c(h, v), v; })(t, e, n); if ("p" === n[0]) return (function (t, e, n) { if (e.get("patternSource") && e.get("patternSource") === n) return e.get("pattern"); var r, i, o = a.exec(n), s = o[1], c = o[2]; function u() { (r = t.createPattern(i, s)), e.set("pattern", r), e.set("patternSource", n); } switch (s) { case "a": s = "repeat"; break; case "x": s = "repeat-x"; break; case "y": s = "repeat-y"; break; case "n": s = "no-repeat"; break; default: s = "no-repeat"; } return ( (i = new Image()), c.match(/^data:/i) || (i.crossOrigin = "Anonymous"), (i.src = c), i.complete ? u() : ((i.onload = u), (i.src = i.src)), r ); })(t, e, n); } return n; } } function h(t) { var e = 0, n = 0, i = 0, o = 0; return ( Object(r.f)(t) ? 1 === t.length ? (e = n = i = o = t[0]) : 2 === t.length ? ((e = i = t[0]), (n = o = t[1])) : 3 === t.length ? ((e = t[0]), (n = o = t[1]), (i = t[2])) : ((e = t[0]), (n = t[1]), (i = t[2]), (o = t[3])) : (e = n = i = o = t), [e, n, i, o] ); } }, 95: function (t, e, n) { "use strict"; n.r(e), n.d(e, "mixColor", function () { return B; }), n.d(e, "getColorsWithSubjectColor", function () { return L; }), n.d(e, "getColorSetsBySubjectColors", function () { return D; }); var r = n(55), i = n.n(r); function o(t, e) { (function (t) { return ( "string" == typeof t && -1 !== t.indexOf(".") && 1 === parseFloat(t) ); })(t) && (t = "100%"); var n = (function (t) { return "string" == typeof t && -1 !== t.indexOf("%"); })(t); return ( (t = 360 === e ? t : Math.min(e, Math.max(0, parseFloat(t)))), n && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (t = 360 === e ? (t < 0 ? (t % e) + e : t % e) / parseFloat(String(e)) : (t % e) / parseFloat(String(e))) ); } function a(t) { return Math.min(1, Math.max(0, t)); } function s(t) { return (t = parseFloat(t)), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function c(t) { return t <= 1 ? "".concat(100 * Number(t), "%") : t; } function u(t) { return 1 === t.length ? "0" + t : String(t); } function h(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = 0, c = (r + i) / 2; if (r === i) (s = 0), (a = 0); else { var u = r - i; switch (((s = c > 0.5 ? u / (2 - r - i) : u / (r + i)), r)) { case t: a = (e - n) / u + (e < n ? 6 : 0); break; case e: a = (n - t) / u + 2; break; case n: a = (t - e) / u + 4; } a /= 6; } return { h: a, s: s, l: c }; } function l(t, e, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + 6 * n * (e - t) : n < 0.5 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t ); } function f(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = r, c = r - i, u = 0 === r ? 0 : c / r; if (r === i) a = 0; else { switch (r) { case t: a = (e - n) / c + (e < n ? 6 : 0); break; case e: a = (n - t) / c + 2; break; case n: a = (t - e) / c + 4; } a /= 6; } return { h: a, s: u, v: s }; } function d(t, e, n, r) { var i = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), ]; return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join(""); } function p(t) { return Math.round(255 * parseFloat(t)).toString(16); } function g(t) { return v(t) / 255; } function v(t) { return parseInt(t, 16); } var y = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32", }; function m(t) { return (m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function b(t) { var e, n, r, i = { r: 0, g: 0, b: 0 }, a = 1, u = null, h = null, f = null, d = !1, p = !1; return ( "string" == typeof t && (t = (function (t) { if (0 === (t = t.trim().toLowerCase()).length) return !1; var e = !1; if (y[t]) (t = y[t]), (e = !0); else if ("transparent" === t) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var n = O.rgb.exec(t); if (n) return { r: n[1], g: n[2], b: n[3] }; if ((n = O.rgba.exec(t))) return { r: n[1], g: n[2], b: n[3], a: n[4] }; if ((n = O.hsl.exec(t))) return { h: n[1], s: n[2], l: n[3] }; if ((n = O.hsla.exec(t))) return { h: n[1], s: n[2], l: n[3], a: n[4] }; if ((n = O.hsv.exec(t))) return { h: n[1], s: n[2], v: n[3] }; if ((n = O.hsva.exec(t))) return { h: n[1], s: n[2], v: n[3], a: n[4] }; if ((n = O.hex8.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), a: g(n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex6.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), format: e ? "name" : "hex", }; if ((n = O.hex4.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), a: g(n[4] + n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex3.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), format: e ? "name" : "hex", }; return !1; })(t)), "object" === m(t) && (M(t.r) && M(t.g) && M(t.b) ? ((e = t.r), (n = t.g), (r = t.b), (i = { r: 255 * o(e, 255), g: 255 * o(n, 255), b: 255 * o(r, 255), }), (d = !0), (p = "%" === String(t.r).substr(-1) ? "prgb" : "rgb")) : M(t.h) && M(t.s) && M(t.v) ? ((u = c(t.s)), (h = c(t.v)), (i = (function (t, e, n) { (t = 6 * o(t, 360)), (e = o(e, 100)), (n = o(n, 100)); var r = Math.floor(t), i = t - r, a = n * (1 - e), s = n * (1 - i * e), c = n * (1 - (1 - i) * e), u = r % 6; return { r: 255 * [n, s, a, a, c, n][u], g: 255 * [c, n, n, s, a, a][u], b: 255 * [a, a, c, n, n, s][u], }; })(t.h, u, h)), (d = !0), (p = "hsv")) : M(t.h) && M(t.s) && M(t.l) && ((u = c(t.s)), (f = c(t.l)), (i = (function (t, e, n) { var r, i, a; if ( ((t = o(t, 360)), (e = o(e, 100)), (n = o(n, 100)), 0 === e) ) (i = n), (a = n), (r = n); else { var s = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - s; (r = l(c, s, t + 1 / 3)), (i = l(c, s, t)), (a = l(c, s, t - 1 / 3)); } return { r: 255 * r, g: 255 * i, b: 255 * a }; })(t.h, u, f)), (d = !0), (p = "hsl")), Object.prototype.hasOwnProperty.call(t, "a") && (a = t.a)), (a = s(a)), { ok: d, format: t.format || p, r: Math.min(255, Math.max(i.r, 0)), g: Math.min(255, Math.max(i.g, 0)), b: Math.min(255, Math.max(i.b, 0)), a: a, } ); } var x = "(?:" .concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:") .concat("[-\\+]?\\d+%?", ")"), S = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), w = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), O = { CSS_UNIT: new RegExp(x), rgb: new RegExp("rgb" + S), rgba: new RegExp("rgba" + w), hsl: new RegExp("hsl" + S), hsla: new RegExp("hsla" + w), hsv: new RegExp("hsv" + S), hsva: new RegExp("hsva" + w), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, }; function M(t) { return Boolean(O.CSS_UNIT.exec(String(t))); } var k = (function () { function t(e, n) { var r; if ( (void 0 === e && (e = ""), void 0 === n && (n = {}), e instanceof t) ) return e; "number" == typeof e && (e = (function (t) { return { r: t >> 16, g: (65280 & t) >> 8, b: 255 & t }; })(e)), (this.originalInput = e); var i = b(e); (this.originalInput = e), (this.r = i.r), (this.g = i.g), (this.b = i.b), (this.a = i.a), (this.roundA = Math.round(100 * this.a) / 100), (this.format = null !== (r = n.format) && void 0 !== r ? r : i.format), (this.gradientType = n.gradientType), this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), (this.isValid = i.ok); } return ( (t.prototype.isDark = function () { return this.getBrightness() < 128; }), (t.prototype.isLight = function () { return !this.isDark(); }), (t.prototype.getBrightness = function () { var t = this.toRgb(); return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3; }), (t.prototype.getLuminance = function () { var t = this.toRgb(), e = t.r / 255, n = t.g / 255, r = t.b / 255; return ( 0.2126 * (e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)) + 0.7152 * (n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4)) + 0.0722 * (r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)) ); }), (t.prototype.getAlpha = function () { return this.a; }), (t.prototype.setAlpha = function (t) { return ( (this.a = s(t)), (this.roundA = Math.round(100 * this.a) / 100), this ); }), (t.prototype.isMonochrome = function () { return 0 === this.toHsl().s; }), (t.prototype.toHsv = function () { var t = f(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, v: t.v, a: this.a }; }), (t.prototype.toHsvString = function () { var t = f(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.v); return 1 === this.a ? "hsv(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsva(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHsl = function () { var t = h(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, l: t.l, a: this.a }; }), (t.prototype.toHslString = function () { var t = h(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.l); return 1 === this.a ? "hsl(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsla(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHex = function (t) { return void 0 === t && (t = !1), d(this.r, this.g, this.b, t); }), (t.prototype.toHexString = function (t) { return void 0 === t && (t = !1), "#" + this.toHex(t); }), (t.prototype.toHex8 = function (t) { return ( void 0 === t && (t = !1), (function (t, e, n, r, i) { var o = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), u(p(r)), ]; return i && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join(""); })(this.r, this.g, this.b, this.a, t) ); }), (t.prototype.toHex8String = function (t) { return void 0 === t && (t = !1), "#" + this.toHex8(t); }), (t.prototype.toRgb = function () { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a, }; }), (t.prototype.toRgbString = function () { var t = Math.round(this.r), e = Math.round(this.g), n = Math.round(this.b); return 1 === this.a ? "rgb(".concat(t, ", ").concat(e, ", ").concat(n, ")") : "rgba(" .concat(t, ", ") .concat(e, ", ") .concat(n, ", ") .concat(this.roundA, ")"); }), (t.prototype.toPercentageRgb = function () { var t = function (t) { return "".concat(Math.round(100 * o(t, 255)), "%"); }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a }; }), (t.prototype.toPercentageRgbString = function () { var t = function (t) { return Math.round(100 * o(t, 255)); }; return 1 === this.a ? "rgb(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%)") : "rgba(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%, ") .concat(this.roundA, ")"); }), (t.prototype.toName = function () { if (0 === this.a) return "transparent"; if (this.a < 1) return !1; for ( var t = "#" + d(this.r, this.g, this.b, !1), e = 0, n = Object.entries(y); e < n.length; e++ ) { var r = n[e], i = r[0]; if (t === r[1]) return i; } return !1; }), (t.prototype.toString = function (t) { var e = Boolean(t); t = null != t ? t : this.format; var n = !1, r = this.a < 1 && this.a >= 0; return e || !r || (!t.startsWith("hex") && "name" !== t) ? ("rgb" === t && (n = this.toRgbString()), "prgb" === t && (n = this.toPercentageRgbString()), ("hex" !== t && "hex6" !== t) || (n = this.toHexString()), "hex3" === t && (n = this.toHexString(!0)), "hex4" === t && (n = this.toHex8String(!0)), "hex8" === t && (n = this.toHex8String()), "name" === t && (n = this.toName()), "hsl" === t && (n = this.toHslString()), "hsv" === t && (n = this.toHsvString()), n || this.toHexString()) : "name" === t && 0 === this.a ? this.toName() : this.toRgbString(); }), (t.prototype.toNumber = function () { return ( (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b) ); }), (t.prototype.clone = function () { return new t(this.toString()); }), (t.prototype.lighten = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l += e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.brighten = function (e) { void 0 === e && (e = 10); var n = this.toRgb(); return ( (n.r = Math.max( 0, Math.min(255, n.r - Math.round((-e / 100) * 255)), )), (n.g = Math.max( 0, Math.min(255, n.g - Math.round((-e / 100) * 255)), )), (n.b = Math.max( 0, Math.min(255, n.b - Math.round((-e / 100) * 255)), )), new t(n) ); }), (t.prototype.darken = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l -= e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.tint = function (t) { return void 0 === t && (t = 10), this.mix("white", t); }), (t.prototype.shade = function (t) { return void 0 === t && (t = 10), this.mix("black", t); }), (t.prototype.desaturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s -= e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.saturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s += e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.greyscale = function () { return this.desaturate(100); }), (t.prototype.spin = function (e) { var n = this.toHsl(), r = (n.h + e) % 360; return (n.h = r < 0 ? 360 + r : r), new t(n); }), (t.prototype.mix = function (e, n) { void 0 === n && (n = 50); var r = this.toRgb(), i = new t(e).toRgb(), o = n / 100; return new t({ r: (i.r - r.r) * o + r.r, g: (i.g - r.g) * o + r.g, b: (i.b - r.b) * o + r.b, a: (i.a - r.a) * o + r.a, }); }), (t.prototype.analogous = function (e, n) { void 0 === e && (e = 6), void 0 === n && (n = 30); var r = this.toHsl(), i = 360 / n, o = [this]; for (r.h = (r.h - ((i * e) >> 1) + 720) % 360; --e; ) (r.h = (r.h + i) % 360), o.push(new t(r)); return o; }), (t.prototype.complement = function () { var e = this.toHsl(); return (e.h = (e.h + 180) % 360), new t(e); }), (t.prototype.monochromatic = function (e) { void 0 === e && (e = 6); for ( var n = this.toHsv(), r = n.h, i = n.s, o = n.v, a = [], s = 1 / e; e--; ) a.push(new t({ h: r, s: i, v: o })), (o = (o + s) % 1); return a; }), (t.prototype.splitcomplement = function () { var e = this.toHsl(), n = e.h; return [ this, new t({ h: (n + 72) % 360, s: e.s, l: e.l }), new t({ h: (n + 216) % 360, s: e.s, l: e.l }), ]; }), (t.prototype.onBackground = function (e) { var n = this.toRgb(), r = new t(e).toRgb(); return new t({ r: r.r + (n.r - r.r) * n.a, g: r.g + (n.g - r.g) * n.a, b: r.b + (n.b - r.b) * n.a, }); }), (t.prototype.triad = function () { return this.polyad(3); }), (t.prototype.tetrad = function () { return this.polyad(4); }), (t.prototype.polyad = function (e) { for ( var n = this.toHsl(), r = n.h, i = [this], o = 360 / e, a = 1; a < e; a++ ) i.push(new t({ h: (r + a * o) % 360, s: n.s, l: n.l })); return i; }), (t.prototype.equals = function (e) { return this.toRgbString() === new t(e).toRgbString(); }), t ); })(); var j = [ { index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }, ]; function C(t, e, n) { var r; return ( (r = Math.round(t.h) >= 60 && Math.round(t.h) <= 240 ? n ? Math.round(t.h) - 2 * e : Math.round(t.h) + 2 * e : n ? Math.round(t.h) + 2 * e : Math.round(t.h) - 2 * e) < 0 ? (r += 360) : r >= 360 && (r -= 360), r ); } function E(t, e, n) { return 0 === t.h && 0 === t.s ? t.s : ((r = n ? t.s - 0.16 * e : 4 === e ? t.s + 0.16 : t.s + 0.05 * e) > 1 && (r = 1), n && 5 === e && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Number(r.toFixed(2))); var r; } function P(t, e, n) { var r; return ( (r = n ? t.v + 0.05 * e : t.v - 0.15 * e) > 1 && (r = 1), Number(r.toFixed(2)) ); } function A(t) { for ( var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = [], r = new k(t), i = 5; i > 0; i -= 1 ) { var o = r.toHsv(), a = new k({ h: C(o, i, !0), s: E(o, i, !0), v: P(o, i, !0), }).toHexString(); n.push(a); } n.push(r.toHexString()); for (var s = 1; s <= 4; s += 1) { var c = r.toHsv(), u = new k({ h: C(c, s), s: E(c, s), v: P(c, s) }).toHexString(); n.push(u); } return "dark" === e.theme ? j.map(function (t) { var r = t.index, i = t.opacity; return new k(e.backgroundColor || "#141414") .mix(n[r], 100 * i) .toHexString(); }) : n; } var I = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1890FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666", }, T = {}, N = {}; Object.keys(I).forEach(function (t) { (T[t] = A(I[t])), (T[t].primary = T[t][5]), (N[t] = A(I[t], { theme: "dark", backgroundColor: "#141414" })), (N[t].primary = N[t][5]); }); T.red, T.volcano, T.gold, T.orange, T.yellow, T.lime, T.green, T.cyan, T.blue, T.geekblue, T.purple, T.magenta, T.grey; var B = function (t, e, n) { var r = i()(t), o = i()(e); return i()([ (1 - n) * r.red() + n * o.red(), (1 - n) * r.green() + n * o.green(), (1 - n) * r.blue() + n * o.blue(), ]).rgb(); }, L = function (t, e, n, r) { return ( void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"), "default" === n ? (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "rgb(150, 150, 150)"); var r = B(e, t, 0.05).rgb().toString(), o = B(e, t, 0.1).rgb().toString(), a = B(e, t, 0.2).rgb().toString(), s = B(e, t, 0.4).rgb().toString(), c = B(e, n, 0.02).rgb().toString(), u = B(e, n, 0.05).rgb().toString(), h = B(e, n, 0.1).rgb().toString(), l = B(e, n, 0.2).rgb().toString(), f = B(e, n, 0.3).rgb().toString(), d = A(t, { theme: "default", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: t, mainFill: o, activeStroke: t, activeFill: r, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: e, highlightStroke: v, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: f, edgeActiveStroke: t, edgeInactiveStroke: l, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: f, comboMainFill: c, comboActiveStroke: t, comboActiveFill: r, comboInactiveStroke: f, comboInactiveFill: c, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: c, comboDisableStroke: l, comboDisableFill: u, } ); })(t, e, "rgb(150, 150, 150)") : (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "#777"); var r = B(e, t, 0.2).rgb().toString(), o = B(e, t, 0.3).rgb().toString(), a = B(e, t, 0.6).rgb().toString(), s = B(e, t, 0.8).rgb().toString(), c = B(e, n, 0.2).rgb().toString(), u = B(e, n, 0.25).rgb().toString(), h = B(e, n, 0.3).rgb().toString(), l = B(e, n, 0.4).rgb().toString(), f = B(e, n, 0.5).rgb().toString(), d = A(t, { theme: "dark", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: s, mainFill: r, activeStroke: t, activeFill: o, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: r, highlightStroke: t, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: n, edgeActiveStroke: t, edgeInactiveStroke: n, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: l, comboMainFill: u, comboActiveStroke: t, comboActiveFill: c, comboInactiveStroke: l, comboInactiveFill: u, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: u, comboDisableStroke: l, comboDisableFill: c, } ); })(t, e, "#777") ); }, D = function (t, e, n, r) { void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"); var i = []; return ( t.forEach(function (t) { i.push(L(t, e, n, r)); }), i ); }; }, 96: function (t, e, n) { "use strict"; n.d(e, "b", function () { return v; }); var r = n(1), i = n(65), o = n(5); var a = n(0), s = n(2), c = n(22), u = s.h.cloneEvent, h = s.h.isViewportChanged, l = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.extendEvents = []), (n.dragging = !1), (n.preItem = null), (n.graph = e), (n.destroyed = !1), n ); } return ( Object(r.c)(e, t), (e.prototype.initEvents = function () { var t = this.graph, e = (this.extendEvents, t.get("canvas")); (this.canvasHandler = Object(a.wrapBehavior)( this, "onCanvasEvents", )), e.off("*").on("*", this.canvasHandler); }), (e.getItemRoot = function (t) { for (; t && !t.get("item"); ) t = t.get("parent"); return t; }), (e.prototype.onCanvasEvents = function (t) { var n = this.graph, r = n.get("canvas"), i = t.target, o = t.type; (t.canvasX = t.x), (t.canvasY = t.y); var a = { x: t.canvasX, y: t.canvasY }, s = n.get("group").getMatrix(); if ( (s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), h(s) && (a = n.getPointByClient(t.clientX, t.clientY)), (t.x = a.x), (t.y = a.y), (t.currentTarget = n), i === r) ) return ( "panmove" === o && this.handleTouchMove(t, "canvas"), (t.target = r), (t.item = null), n.emit(o, t), void n.emit("canvas:" + o, t) ); var c = e.getItemRoot(i); if (c) { var u = c.get("item"); if (!u.destroyed) { var l = u.getType(); if ( ((t.target = i), (t.item = u), t.canvasX === t.x && t.canvasY === t.y) ) { var f = n.getCanvasByPoint(t.x, t.y); (t.canvasX = f.x), (t.canvasY = f.y); } n.emit(o, t), t.name && !t.name.includes(":") ? n.emit(l + ":" + o, t) : n.emit(t.name, t), "dragstart" === o && (this.dragging = !0), "dragend" === o && (this.dragging = !1), "panmove" === o && this.handleTouchMove(t, l); } } else n.emit(o, t); }), (e.prototype.onExtendEvents = function (t) { this.graph.emit(t.type, t); }), (e.prototype.emitCustomEvent = function (t, e, n) { (n.type = e), this.graph.emit(t + ":" + e, n); }), (e.prototype.destroy = function () { var t = this.graph, e = this.canvasHandler, n = this.extendEvents; t.get("canvas").off("*", e), Object(a.each)(n, function (t) { t.remove(); }), (this.dragging = !1), (this.preItem = null), (this.extendEvents.length = 0), (this.canvasHandler = null), (this.destroyed = !0); }), (e.prototype.handleTouchMove = function (t, e) { var n = this.graph, r = this.preItem, i = n.get("canvas"), o = t.target === i ? null : t.item; (t = u(t)), r && r !== o && !r.destroyed && ((t.item = r), this.emitCustomEvent(r.getType(), "touchleave", t), this.dragging && this.emitCustomEvent(r.getType(), "dragleave", t)), o && r !== o && ((t.item = o), this.emitCustomEvent(e, "touchenter", t), this.dragging && this.emitCustomEvent(e, "dragenter", t)), (this.preItem = o); }), e ); })(s.a), f = n(33), d = ["force", "grid", "circular"], p = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.graph = e), (n.layoutCfg = e.get("layout") || {}), (n.layoutType = n.getLayoutType()), n ); } return ( Object(r.c)(e, t), (e.prototype.updateLayoutCfg = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = Object(a.mix)({}, this.layoutCfg, t); if (((this.layoutCfg = i), null == r ? void 0 : r.length)) { (this.data = this.setDataFromGraph()), n.emit("beforelayout"); var o = Promise.resolve(); 1 === r.length ? (o = o.then(function () { return e.updateLayoutMethod(r[0], i); })) : null == r || r.forEach(function (t, n) { var r = i.pipes[n]; o = o.then(function () { return e.updateLayoutMethod(t, r); }); }), (this.data = this.setDataFromGraph()), o .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("layout failed", t); }); } else this.layout(); }), (e.prototype.layout = function (t) { var e = this, n = this.graph; this.data = this.setDataFromGraph(); var i = this.data, o = i.nodes, a = i.hiddenNodes; if (!o) return !1; var s = n.get("width"), c = n.get("height"), u = {}; Object.assign( u, { width: s, height: c, center: [s / 2, c / 2] }, this.layoutCfg, ), (this.layoutCfg = u), this.destoryLayoutMethods(), n.emit("beforelayout"), this.initPositions(u.center, o), this.initPositions(u.center, a); var h = u.onLayoutEnd, l = u.layoutEndFormatted, f = u.adjust; l || ((u.layoutEndFormatted = !0), (u.onAllLayoutEnd = function () { return Object(r.b)(e, void 0, void 0, function () { return Object(r.d)(this, function (t) { switch (t.label) { case 0: return ( h && h(), this.refreshLayout(), f && u.pipes ? [4, this.adjustPipesBox(this.data, f)] : [3, 2] ); case 1: t.sent(), this.refreshLayout(), (t.label = 2); case 2: return n.emit("afterlayout"), [2]; } }); }); })); var d = Promise.resolve(); return ( u.type ? (d = d.then(function () { return e.execLayoutMethod(u, 0); })) : u.pipes && u.pipes.forEach(function (t, n) { d = d.then(function () { return e.execLayoutMethod(t, n); }); }), d .then(function () { u.onAllLayoutEnd && u.onAllLayoutEnd(), t && t(); }) .catch(function (t) { console.warn("graph layout failed,", t); }), !1 ); }), (e.prototype.execLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = t.type; if ( ((t.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), "force" === a || "g6force" === a || "gForce" === a) ) { var s = t.onTick, c = function () { s && s(), o.refreshPositions(); }; t.tick = c; } else "comboForce" === t.type && (t.comboTrees = o.get("comboTrees")); var u; try { u = new f.a(t); } catch (t) { console.warn( "The layout method: '" + a + "' does not exist! Please specify it first.", ), i(); } if (u.enableTick) { var h = t.onTick; c = function () { h && h(), o.refreshPositions(); }; u.tick = c; } var l = n.filterLayoutData(n.data, t); !(function (t, e) { var n; if ( !(null === (n = null == t ? void 0 : t.nodes) || void 0 === n ? void 0 : n.length) ) return; t.nodes.forEach(function (t) { t.layoutOrder = e; }); })(l, e), u.init(l), o.emit("beforesublayout", { type: a }), u.execute(), u.isCustomLayout && t.onLayoutEnd && t.onLayoutEnd(), n.layoutMethods.push(u); }); }), (e.prototype.updateLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }; var s = n.filterLayoutData(n.data, e); t.init(s), t.updateCfg(e), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (e.prototype.adjustPipesBox = function (t, e) { var n = this; return new Promise(function (r) { var i = t.nodes; (null == i ? void 0 : i.length) || r(), d.includes(e) || (console.warn( "The adjust type " + e + " is not supported yet, please assign it with 'force', 'grid', or 'circular'.", ), r()); var o = { center: n.layoutCfg.center, nodeSize: function (t) { return Math.max(t.height, t.width); }, preventOverlap: !0, onLayoutEnd: function () {}, }, s = n.getLayoutBBox(i), c = s.groupNodes, u = s.layoutNodes, h = Object(a.clone)(u); (o.onLayoutEnd = function () { null == u || u.forEach(function (t, e) { var n, r, i, o = t.x - (null === (n = h[e]) || void 0 === n ? void 0 : n.x), a = t.y - (null === (r = h[e]) || void 0 === r ? void 0 : r.y); null === (i = c[e]) || void 0 === i || i.forEach(function (t) { (t.x += o), (t.y += a); }); }), r(); }), new f.a(o).layout({ nodes: u }); }); }), (e.prototype.destroy = function () { this.destoryLayoutMethods(), (this.destroyed = !0), this.graph.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0), (this.graph = null); }), e ); })(s.c); var g = n(54), v = function (t, e, n) { return ( n[t] && console.warn( "The graph with the name " + t + " exists already, it will be overridden", ), (n[t] = e(n)), n ); }, y = (function (t) { function e(e) { var n = t.call(this, e) || this; n.get("renderer").startsWith("mini") && n.set("context", e.context), t.prototype.init.call(n); var r = n.get("defaultNode"); return ( r || n.set("defaultNode", { type: "circle" }), r.type || ((r.type = "circle"), n.set("defaultNode", r)), (n.destroyed = !1), n ); } return ( Object(r.c)(e, t), (e.prototype.init = function () {}), (e.prototype.emitEvent = function (t) { var e = this.get("canvas"); (t.type = t.type.toLowerCase()), e.registerEventCallback(t); }), (e.prototype.initLayoutController = function () { var t = new p(this); this.set({ layoutController: t }); }), (e.prototype.initEventController = function () { var t = new l(this); if ( (this.set({ eventController: t }), !this.get("renderer").startsWith("mini")) ) { var e = this.get("canvas"), n = e.get("el"); "touchstart touchmove touchend touchcancel" .split(" ") .forEach(function (t) { n.addEventListener(t, e.registerEventCallback.bind(e), !1); }); } }), (e.prototype.initCanvas = function () { var t = this.get("container"); null !== t && "string" == typeof t && ((t = document.getElementById(t)), this.set("container", t)); var e = this.get("renderer"); if (!t && !e.startsWith("mini")) throw new Error("invalid container"); var n = this.get("width"), r = this.get("height"), o = { container: t, context: this.get("context"), width: n, height: r, renderer: e, fitView: this.get("fitView"), }, a = this.get("pixelRatio"); a && (o.pixelRatio = a); var s = new i.Canvas(o); this.set("canvas", s); }), (e.prototype.initPlugins = function () { var t = this; Object(a.each)(t.get("plugins"), function (e) { !e.destroyed && e.initPlugin && e.initPlugin(t); }); }), (e.prototype.toDataURL = function (t, e) { var n = this.get("canvas"), r = n.getRenderer(), i = n.get("el"); t || (t = "image/png"); var o = ""; if ("svg" === r) { var a = i.cloneNode(!0), s = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), c = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", s, ); c.replaceChild(a, c.documentElement); var u = new XMLSerializer().serializeToString(c); o = "data:image/svg+xml;charset=utf8," + encodeURIComponent(u); } else { var h = void 0, l = i.getContext("2d"), f = this.get("width"), d = this.get("height"), p = void 0; if (e) { var g = "undefined" != typeof window ? window.devicePixelRatio : 1; (h = l.getImageData(0, 0, f * g, d * g)), (p = l.globalCompositeOperation), (l.globalCompositeOperation = "destination-over"), (l.fillStyle = e), l.fillRect(0, 0, f, d); } (o = i.toDataURL(t)), e && (l.clearRect(0, 0, f, d), l.putImageData(h, 0, 0), (l.globalCompositeOperation = p)); } return o; }), (e.prototype.toFullDataURL = function (t, e, n) { var r = this.get("group").getCanvasBBox(), s = r.height, c = r.width, u = this.get("renderer"), h = Object(g.a)('
'), l = n ? n.backgroundColor : void 0, f = n ? n.padding : void 0; f ? Object(a.isNumber)(f) && (f = [f, f, f, f]) : (f = [0, 0, 0, 0]); var d = s + f[0] + f[2], p = c + f[1] + f[3], v = { container: h, height: d, width: p, quickHit: !0 }, y = new i.Canvas(v), m = this.get("group").clone(), b = Object(a.clone)(m.getMatrix()); b || (b = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var x = (r.maxX + r.minX) / 2, S = (r.maxY + r.minY) / 2; o.a.translate(b, b, [-x, -S]), o.a.translate(b, b, [c / 2 + f[3], s / 2 + f[0]]), m.resetMatrix(), m.setMatrix(b), y.add(m); var w = y.get("el"), O = ""; e || (e = "image/png"), setTimeout(function () { if ("svg" === u) { var n = w.cloneNode(!0), r = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), i = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", r, ); i.replaceChild(n, i.documentElement); var o = new XMLSerializer().serializeToString(i); O = "data:image/svg+xml;charset=utf8," + encodeURIComponent(o); } else { var a = void 0, s = w.getContext("2d"), c = void 0; if (l) { var h = "undefined" != typeof window ? window.devicePixelRatio : 1; (a = s.getImageData(0, 0, p * h, d * h)), (c = s.globalCompositeOperation), (s.globalCompositeOperation = "destination-over"), (s.fillStyle = l), s.fillRect(0, 0, p, d); } (O = w.toDataURL(e)), l && (s.clearRect(0, 0, p, d), s.putImageData(a, 0, 0), (s.globalCompositeOperation = c)); } t && t(O); }, 16); }), (e.prototype.downloadFullImage = function (t, e, n) { var r = this, s = this.get("group").getCanvasBBox(), c = s.height, u = s.width, h = this.get("renderer"), l = Object(g.a)(''), f = n ? n.backgroundColor : void 0, d = n ? n.padding : void 0; d ? Object(a.isNumber)(d) && (d = [d, d, d, d]) : (d = [0, 0, 0, 0]); var p = c + d[0] + d[2], v = u + d[1] + d[3], y = { container: l, height: p, width: v }, m = new i.Canvas(y), b = this.get("group").clone(), x = Object(a.clone)(b.getMatrix()); x || (x = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var S = (s.maxX + s.minX) / 2, w = (s.maxY + s.minY) / 2; o.a.translate(x, x, [-S, -w]), o.a.translate(x, x, [u / 2 + d[3], c / 2 + d[0]]), b.resetMatrix(), b.setMatrix(x), m.add(b); var O = m.get("el"); e || (e = "image/png"), setTimeout(function () { var n = ""; if ("svg" === h) { var i = O.cloneNode(!0), o = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), a = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", o, ); a.replaceChild(i, a.documentElement); var s = new XMLSerializer().serializeToString(a); n = "data:image/svg+xml;charset=utf8," + encodeURIComponent(s); } else { var c = void 0, u = O.getContext("2d"), l = void 0; if (f) { var d = "undefined" != typeof window ? window.devicePixelRatio : 1; (c = u.getImageData(0, 0, v * d, p * d)), (l = u.globalCompositeOperation), (u.globalCompositeOperation = "destination-over"), (u.fillStyle = f), u.fillRect(0, 0, v, p); } (n = O.toDataURL(e)), f && (u.clearRect(0, 0, v, p), u.putImageData(c, 0, 0), (u.globalCompositeOperation = l)); } var g = document.createElement("a"), y = (t || "graph") + ("svg" === h ? ".svg" : "." + e.split("/")[1]); r.dataURLToImage(n, h, g, y); var m = document.createEvent("MouseEvents"); m.initEvent("click", !1, !1), g.dispatchEvent(m); }, 16); }), (e.prototype.downloadImage = function (t, e, n) { var r = this, i = this; i.isAnimating() && i.stopAnimate(); var o = i.get("canvas").getRenderer(); e || (e = "image/png"); var a = (t || "graph") + ("svg" === o ? ".svg" : e.split("/")[1]), s = document.createElement("a"); setTimeout(function () { var t = i.toDataURL(e, n); r.dataURLToImage(t, o, s, a); var c = document.createEvent("MouseEvents"); c.initEvent("click", !1, !1), s.dispatchEvent(c); }, 16); }), (e.prototype.dataURLToImage = function (t, e, n, r) { if ("undefined" != typeof window) if (window.Blob && window.URL && "svg" !== e) { var i = t.split(","), o = ""; if (i && i.length > 0) { var a = i[0].match(/:(.*?);/); a && a.length >= 2 && (o = a[1]); } for ( var s = atob(i[1]), c = s.length, u = new Uint8Array(c); c--; ) u[c] = s.charCodeAt(c); var h = new Blob([u], { type: o }); window.navigator.msSaveBlob ? window.navigator.msSaveBlob(h, r) : n.addEventListener("click", function () { (n.download = r), (n.href = window.URL.createObjectURL(h)); }); } else n.addEventListener("click", function () { (n.download = r), (n.href = t); }); }), (e.prototype.addPlugin = function (t) { t.destroyed || (this.get("plugins").push(t), t.initPlugin(this)); }), (e.prototype.removePlugin = function (t) { var e = this.get("plugins"), n = e.indexOf(t); n >= 0 && (t.destroyPlugin(), e.splice(n, 1)); }), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.isBrowser = function () { return "canvas" === this.get("renderer"); }), (e.prototype.setImageWaterMarker = function (t, e, n) { var r = this, i = Object(a.deepMix)({}, c.a.imageWaterMarkerConfig, e), o = i.width, s = i.height, u = i.image, h = u.rotate, l = (u.x, u.y, u.width), f = u.height; if ((this.isMini() && this.isMiniNative(), this.isMiniNative())) { (n.width = o || this.get("width")), (n.height = s || this.get("height")); var d = n.getContext("2d"), p = (0, this.get("extra").createImage)(); (p.crossOrigin = "anonymous"), (p.src = t), (p.onload = function () { if (!r.destroyed) { var t = l / p.width, e = f / p.height; d.rotate((-h * Math.PI) / 180); var i = d.createPattern(p, "repeat"); (d.fillStyle = i), d.scale(t, e), d.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ), r .get("waterGroup") .addShape("image", { attrs: { img: n } }); } }); } if (this.isBrowser()) { var g = document.createElement("canvas"); (g.width = o || this.get("width")), (g.height = s || this.get("height")); var v = g.getContext("2d"), y = new Image(); (y.crossOrigin = "anonymous"), (y.src = t), (y.onload = function () { if (!r.destroyed) { var t = l / y.width, e = f / y.height; v.rotate((-h * Math.PI) / 180); var n = v.createPattern(y, "repeat"); (v.fillStyle = n), v.scale(t, e), v.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ); var i = g.toDataURL(); r.get("waterGroup").addShape("image", { attrs: { img: i }, }); } }); } }), (e.prototype.setTextWaterMarker = function (t, e) { var n = this.get("container"); Object(a.isString)(n) && (n = document.getElementById(n)), n.style.position || (n.style.position = "relative"); var r = this.get("graphWaterMarker"), o = Object(a.deepMix)({}, c.a.textWaterMarkerConfig, e), s = o.width, u = o.height, h = o.compatible, l = o.text; if (!r) { var f = { container: n, width: s, height: u, capture: !1 }, d = this.get("pixelRatio"); d && (f.pixelRatio = d), (r = new i.Canvas(f)), this.set("graphWaterMarker", r); } r.get("el").style.display = "none"; var p = r.get("context"), g = l.rotate, v = l.fill, y = l.fontFamily, m = l.fontSize, b = l.baseline, x = l.x, S = l.y, w = l.lineHeight; p.rotate((-g * Math.PI) / 180), (p.font = m + "px " + y), (p.fillStyle = v), (p.textBaseline = b); for (var O = t.length - 1; O >= 0; O--) p.fillText(t[O], x, S + O * w); if ((p.rotate((g * Math.PI) / 180), h)) n.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;"; else { var M = document.querySelector(".g6-graph-watermarker"); M || ((M = document.createElement("div")).className = "g6-graph-watermarker"), (M.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"), n.appendChild(M); } }), (e.prototype.destroy = function () { var e; Object(a.each)(this.get("plugins"), function (t) { t.destroyPlugin(); }); var n = this.get("tooltips"); if (n) for (var r = 0; r < n.length; r++) { var i = n[r]; if (i) { var o = i.parentElement; o && o.removeChild(i); } } this.get("eventController").destroy(), null === (e = this.get("layoutController")) || void 0 === e || e.destroy(), this.get("graphWaterMarker") && this.get("graphWaterMarker").destroy(), "undefined" != typeof document && document.querySelector && document.querySelector(".g6-graph-watermarker") && document.querySelector(".g6-graph-watermarker").remove(), t.prototype.destroy.call(this); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = t.addGroup({ id: "root", className: c.a.rootContainerClassName, }), n = t.addGroup({ id: "water", className: c.a.waterContainerClassName, }); if (this.get("groupByTypes")) { var r = e.addGroup({ id: "edge", className: c.a.edgeContainerClassName, }), i = e.addGroup({ id: "node", className: c.a.nodeContainerClassName, }), o = e.addGroup({ id: "combo", className: c.a.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = t.addGroup({ id: "uiGroup", className: c.a.uiContainerClassName, }), s = e.addGroup({ id: "delegate", className: c.a.delegateContainerClassName, }); this.set({ delegateGroup: s }), this.set("group", e), this.set("uiGroup", a), this.set("waterGroup", n); }), e ); })(s.b); e.a = y; }, 97: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } Object.defineProperty(e, "__esModule", { value: !0 }), (e.clearAnimationFrame = function (t) { return o.clearAnimationFrame ? o.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); }), (e.requestAnimationFrame = function (t) { return o.requestAnimationFrame ? o.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); }), (e.setExtraFunction = function (t) { void 0 === t && (t = {}), (t = t); }); var o = {}; }, 98: function (t, e) { function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : n(window)) && (r = window); } t.exports = r; }, 99: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Layouts = e.Layout = void 0); var r = n(62), i = (function () { function t(t) { var e = r.getLayoutByName(t.type); this.layoutInstance = new e(t); } return ( (t.prototype.layout = function (t) { return this.layoutInstance.layout(t); }), (t.prototype.updateCfg = function (t) { this.layoutInstance.updateCfg(t); }), (t.prototype.init = function (t) { this.layoutInstance.init(t); }), (t.prototype.execute = function () { this.layoutInstance.execute(); }), (t.prototype.getDefaultCfg = function () { return this.layoutInstance.getDefaultCfg(); }), (t.prototype.destroy = function () { return this.layoutInstance.destroy(); }), t ); })(); (e.Layout = i), (e.Layouts = new Proxy( {}, { get: function (t, e) { return r.getLayoutByName(e); }, set: function (t, e, n) { return r.registerLayout(e, n), !0; }, }, )); }, }).default; }); //# sourceMappingURL=index.js.map ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/data.js ================================================ export default { nodes: [ { id: "a", x: 200, y: 100, style: { fill: "#5B8FF9", stroke: null }, }, { id: "b", x: 100, y: 200, style: { fill: "#5AD8A6", stroke: null }, }, { id: "c", x: 300, y: 200, style: { fill: "#5D7092", stroke: null }, }, ], edges: [ { id: "a2b", source: "a", target: "b", }, { id: "a2c", source: "a", target: "c", }, ], }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * changePosition#default */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, animate: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setInterval(() => { data.nodes.forEach((node) => { node.x += Math.random() * 50 - 25; node.y += Math.random() * 50 - 25; }); this.graph.changeData(data); }, 600); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/index.json ================================================ { "navigationBarTitleText": "节点移动动画", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/change-position-default/index.wxss ================================================ /* packageAnimationAnimation/change-position-default/index.wxss */ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/custom-animate-position/index.js ================================================ import F6 from "@antv/f6-wx"; /** * customAnimate#position */ const r = 50; const radius = Math.PI; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, animate: true, animateCfg: { duration: 1000, onFrame(node, ratio, toAttrs, fromAttrs) { const current = radius * ratio; let { x } = fromAttrs; let { y } = fromAttrs; if (fromAttrs.x > toAttrs.x) { x = x - r + r * Math.cos(current); y += r * Math.sin(current); } else { x = x + r - r * Math.cos(current); y -= r * Math.sin(current); } return { x, y }; }, }, }); // 加入两个节点 const node1 = this.graph.addItem("node", { id: "node1", x: 100, y: 100, type: "circle", style: { fill: "#5B8FF9", lineWidth: 0 }, }); const node2 = this.graph.addItem("node", { id: "node2", x: 200, y: 100, type: "circle", style: { fill: "#5AD8A6", lineWidth: 0 }, }); // 循环动画 let count = 0; setInterval(() => { if (count % 2 === 0) { node1.get("model").x = 200; node2.get("model").x = 100; } else { node1.get("model").x = 100; node2.get("model").x = 200; } count++; this.graph.refresh(); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/custom-animate-position/index.json ================================================ { "navigationBarTitleText": "自定义动画", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/custom-animate-position/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/custom-animate-position/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-edge/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-edge/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * edge#edge */ const lineDash = [4, 2, 1, 2]; F6.registerEdge( "line-dash", { afterDraw(cfg, group) { // get the first shape in the group, it is the edge's path here= const shape = group.get("children")[0]; let index = 0; // Define the animation shape.animate( () => { index++; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // returns the modified configurations here, lineDash and lineDashOffset here return res; }, { repeat: true, // whether executes the animation repeatly duration: 3000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "line-dash", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-edge/index.json ================================================ { "navigationBarTitleText": "虚线运动", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-edge/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-edge/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-line-growth/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-line-growth/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * edge#lineGrowth */ F6.registerEdge( "line-growth", { afterDraw(_, group) { const shape = group.get("children")[0]; const length = shape.getTotalLength(); console.log(_); shape.animate( (ratio) => { // the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations const startLen = ratio * length; // Calculate the lineDash const cfg = { lineDash: [startLen, length - startLen], }; return cfg; }, { repeat: true, // Whether executes the animation repeatly duration: 2000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "line-growth", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-line-growth/index.json ================================================ { "navigationBarTitleText": "无到有的边", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-line-growth/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/edge-line-growth/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/node-node/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, type: "circle-animate", size: 20, label: "Scale Animation", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, type: "background-animate", color: "#40a9ff", size: 20, label: "Background Animation", labelCfg: { position: "left", offset: 10, }, }, { id: "node3", x: 400, y: 100, size: [40, 40], type: "inner-animate", img: "data:image/webp;base64,UklGRq4FAABXRUJQVlA4IKIFAABwHwCdASo8ADwAPiEMhEGhhv6rQAYAgS2NHsdCq/4D8AOoA64OEUAj/XPxVwyvRGvyO/gGxN/t3oK/1X6zesX3L/p/RP/2HCgKAB9AGeAbCB+AGwAbQBtA/8c/m/4PYHTonm+SzRH6B9sv2i/rOZC+G/ln9l/ML/GdoD7APcA/TD+09QDzAfrX+vHYM9AD+Uf0zrAPQA/bH0vv2t+CH9qf2R+A39e6X098/I7IAcLcs8Gjmc/9T7gPbX9H+wJ+rPVV9En9ZmBI5oUiYhkYHIVjRr9hzCTPcV5Rs/wjjIHkxPgtr/3ALZSuUm146HHwqQVA23hnnqH/4aJ/k4v4hU6RBZ0AAAD+//8ARPyL9yWIlAbWBAD0oKSqlYWreuRa3Oj02u+TvSQS8iwMYewUYTWLDNp9wOlFJaWnqE+za35UwUXuDAT6T0I4fwY+u+qrRVhl+S1ir4X7BQiNswug5AX+MjQcXEeUwfSIEUT+DFPCr+BUiwTbFxLni7fv61vRbmXoauLz4tiqOFTzEGP8tNXP5+H7mZVGfNjIxapT3FGUtqBdp/SD5cTOYOkn2fawkpqpCSqf2+CfiGWtIF673fEzlk/hIbWDhQ81C/ddxLn609d/5efckbdZ8HZbhhVmM82/Uat7CFmw1SH5xCxRxEEhjpf1EP1Xn5q9VZfm1+OFTab/MN67Xha8K//5oVBlMgZALE653X0fas/+2xMqiyCu5Wa7PHsCwbBwqROfNmzi4LPOTjkFPHVKDD1Nfj4/sul6cANdF68rf2jszlyZsUUoLTP7H3swSroc3ssNXSRVAcYd7+iBZpfoAYWvKgnr+Hv62fHZX5ZbjYbYzVjq6fsXkubto858NuUx4+ILb5y7dP6W3/IYVeUSF0yZseKIZhOMs9BBf5uB2Y3Ott//+1OG7hYINzcqigrzWAOJbSmVw3G0ULywkobx+rvfk8VmZFzQGgP/+4T74mp/vsZyM1NLguiTO2gNO05tcpXwveq5mrcweXrJ/bRZDmU2KBrnXhkXq+735c+UHTFq4h4jMOPm5shKioB6XaqhUf3DJlMg8937g/SKjrgD0H5sNm0/k4FfilBbcrsjc3dd6cwEYJo3CNhe3SpNJ2geNXyV4/hq/BZXZ1kiVknjmf5cUx7Tv/9Sb+fQ/DgAsRNSz1wiVodiLjP7aVrkxbWx5gJ8U/j0o1Ipm/nyDZRPrQXmbPAcy1eDDejxTDBKe42ElHpC2QlFdhOedsp4i9QVjt8EqWGy1YzPaGqZhCVg/LWt8/+4BmiCzNGtpR21MGJf4kI/n/1sbe36e1QBCBAx4EVfTM82ZM2lh0P189e7eY0A3NzXWVrUek8SEn+DYYCQeEaC5hDHGreFHT1baY6KyrFx3G9oMm3fLrCqmNjFRnZa3LB/5m8FgCpq9B/1OCLRE5GzVTZnVzj/4V38PgCIpX16Kznijf01+MkDeS9oCF2hEXQ9tr+mPLrjGy4Cg5fyLgyCj1fUq33nMf79Svli2h83m3gqkoxJcXvBetFQP8V/gRjBNGmFXK5TfwLhbolWEjDqUGK3n+hxzQLif9zreYO88EIRTUNbzE1/Sn7rBEtjB0uawNje5OubWsB62SOlMZoZpxrDbMb4UvQrODPhSafmhcYe9zm/dHxssMfUthhDKjyMhoRhngPjbzfGXmIV2Omgrn/zbefK/PawUGSH6x4Qk4HCN4/X8S+XCf51JJtOQeHST/yfwg69uMkE07SONnhGUrL6j5oQn6JI+zkaH/H/P/Ti/pfOTfAWxQNiMvWX08mqbuUweFSQ/G5YUP/uCvZAXutf1+Nhl2jj/n4/fPOihPjwvfFnnjOaQvs9PSpF33d+396LASZ3IID/4UP4pf9eOMXw82ccoUUUHX6MfBWyBDvARCrdPmerUwKwW+lBIAe1dsAAAA==", label: "Image Rotate", labelCfg: { position: "right", }, }, { id: "node4", x: 300, y: 300, type: "rect", label: "No Animation", labelCfg: { position: "bottom", }, }, ], edges: [ { source: "node1", target: "node2", }, { source: "node3", target: "node2", }, { source: "node2", target: "node4", }, ], }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/node-node/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * node#node */ const { Util } = F6; // // Scale Animation F6.registerNode( "circle-animate", { afterDraw(cfg, group) { const shape = group.get("children")[0]; shape.animate( (ratio) => { const diff = ratio <= 0.5 ? ratio * 10 : (1 - ratio) * 10; return { r: cfg.size / 2 + diff, }; }, { repeat: true, duration: 3000, easing: "easeCubic", }, ); }, }, "circle", ); // Background Animation F6.registerNode( "background-animate", { afterDraw(cfg, group) { const r = cfg.size / 2; const back1 = group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back1-shape", }); const back2 = group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back2-shape", }); const back3 = group.addShape("circle", { zIndex: -1, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back3-shape", }); group.sort(); // Sort according to the zIndex back1.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 0, repeat: true, // repeat }, ); // no delay back2.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 1000, repeat: true, // repeat }, ); // 1s delay back3.animate( { // Magnifying and disappearing r: r + 10, opacity: 0.1, }, { duration: 3000, easing: "easeCubic", delay: 2000, repeat: true, // repeat }, ); // 3s delay }, }, "circle", ); // // Image animation F6.registerNode( "inner-animate", { afterDraw(cfg, group) { const { size } = cfg; const width = size[0] - 12; const height = size[1] - 12; const image = group.addShape("image", { attrs: { x: -width / 2, y: -height / 2, width, height, img: cfg.img, }, name: "image-shape", }); image.animate( (ratio) => { const toMatrix = Util.transform( [1, 0, 0, 0, 1, 0, 0, 0, 1], [["r", ratio * Math.PI * 2]], ); return { matrix: toMatrix, }; }, { repeat: true, duration: 3000, easing: "easeCubic", }, ); }, }, "rect", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { lineWidth: 1, stroke: "#b5b5b5", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/node-node/index.json ================================================ { "navigationBarTitleText": "节点动画", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/node-node/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/node-node/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/point-in-line/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "Node 1", labelCfg: { position: "top", }, }, { id: "node2", x: 300, y: 200, color: "#40a9ff", label: "Node 2", labelCfg: { position: "left", offset: 10, }, }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/point-in-line/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * point-in-line */ F6.registerEdge( "circle-running", { afterDraw(cfg, group) { // get the first shape in the group, it is the edge's path here= const shape = group.get("children")[0]; // the start position of the edge's path const startPoint = shape.getPoint(0); // add red circle shape const circle = group.addShape("circle", { attrs: { x: startPoint.x, y: startPoint.y, fill: "#1890ff", r: 3, }, name: "circle-shape", }); // animation for the red circle circle.animate( (ratio) => { // the operations in each frame. Ratio ranges from 0 to 1 indicating the prograss of the animation. Returns the modified configurations // get the position on the edge according to the ratio const tmpPoint = shape.getPoint(ratio); // returns the modified configurations here, x and y here return { x: tmpPoint.x, y: tmpPoint.y, }; }, { repeat: true, // Whether executes the animation repeatly duration: 3000, // the duration for executing once }, ); }, }, "cubic", // extend the built-in edge 'cubic' ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultEdge: { type: "circle-running", style: { lineWidth: 2, stroke: "#bae7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/point-in-line/index.json ================================================ { "navigationBarTitleText": "圆点沿边运动", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/point-in-line/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/point-in-line/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/state-change-hover/data.js ================================================ const nodes = []; const edges = []; // Center node const centerNode = { id: "center", x: 500, y: 300, type: "center-node", size: 20, }; nodes.push(centerNode); // Add 4 nodes on the left for (let i = 0; i < 4; i++) { const id = `left${i}`; nodes.push({ id, x: 250, y: (i + 1) * 100 + 50, type: "leaf-node", }); edges.push({ source: id, target: "center", type: "can-running" }); } // Add 6 nodes on the right for (let i = 0; i < 6; i++) { const id = `right${i}`; nodes.push({ id, x: 750, y: i * 100 + 50, type: "leaf-node", }); edges.push({ source: "center", target: id, type: "can-running" }); } export { nodes, edges }; ================================================ FILE: packages/examples-wx/package-animation/pages/animation/state-change-hover/index.js ================================================ import F6 from "@antv/f6-wx"; import { nodes, edges } from "./data"; /** * state-change-hover */ F6.registerNode( "leaf-node", { afterDraw(cfg, group) { group.addShape("circle", { attrs: { x: 0, y: 0, r: 5, fill: cfg.color || "#5B8FF9", }, name: "circle-shape", }); }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "circle", ); F6.registerNode( "center-node", { afterDraw(cfg, group) { const r = cfg.size / 2; group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r: r + 10, fill: "gray", opacity: 0.4, }, name: "circle-shape1", }); group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r: r + 20, fill: "gray", opacity: 0.2, }, name: "circle-shape2", }); group.sort(); }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "circle", ); // lineDash array const lineDash = [4, 2, 1, 2]; F6.registerEdge( "can-running", { setState(name, value, item) { const shape = item.get("keyShape"); if (name === "running") { if (value) { let index = 0; shape.animate( () => { index += 1; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // return the params for this frame return res; }, { repeat: true, duration: 3000, }, ); } else { shape.stopAnimate(); shape.attr("lineDash", null); } } }, }, "cubic-horizontal", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); this.graph.data({ nodes, edges }); this.graph.render(); this.graph.fitView(); let toggle = true; // set hover state this.graph.on("node:tap", (ev) => { const node = ev.item; const edges_ = node.getEdges(); edges_.forEach((edge) => { this.graph.setItemState(edge, "running", toggle); }); toggle = !toggle; }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-animation/pages/animation/state-change-hover/index.json ================================================ { "navigationBarTitleText": "状态与动画", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-animation/pages/animation/state-change-hover/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-animation/pages/animation/state-change-hover/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/arc/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 250, }, ], edges: [ // Built-in arc edges { id: "edge0", source: "0", target: "1", label: "curveOffset = 20", curveOffset: 20, }, { id: "edge1", source: "0", target: "1", label: "curveOffset = 50", // the bending degree curveOffset: 50, }, { id: "edge2", source: "0", target: "1", label: "curveOffset = -50", // the bending degree curveOffset: -50, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/arc/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * arc */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { // 支持的 behavior default: ["drag-node"], }, defaultEdge: { type: "arc", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, labelCfg: { autoRotate: true, refY: -10, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/arc/index.json ================================================ { "navigationBarTitleText": "弧线", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/arc/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/arc/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/area-chart/data.js ================================================ export default { nodes: [ { id: "nodeD", x: 150, y: 150, label: "Area1", type: "area", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5ad8a6" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#ff99c3" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#6dc8ec" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#269a99" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, { id: "nodeD2", x: 500, y: 150, label: "Area2", type: "area", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeD", target: "nodeD2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/area-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * area-chart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerNode("area", { draw(cfg, group) { const baseR = 30; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 6; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#bae7ff", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5)) / 360; const tempIncValues = [baseR, baseR, baseR, baseR, baseR]; const allRs = []; cfg.details.forEach((cat) => { const oneRs = []; cat.values.forEach((v, i) => { const R = tempIncValues[i] + v * 0.4; oneRs.push(R); tempIncValues[i] = R; }); allRs.push(oneRs); }); const strokeColors = [ "rgba(91, 143, 249,1)", "rgba(90, 216, 166,1)", "rgba(246, 189, 22,1)", "rgba(232, 104, 74,1)", "rgba(255, 157, 77,1)", ]; const fillColors = [ "rgba(91, 143, 249,0.5)", "rgba(90, 216, 166,0.5)", "rgba(246, 189, 22,0.5)", "rgba(232, 104, 74,0.5)", "rgba(255, 157, 77,0.5)", ]; allRs.reverse().forEach((Rs, index) => { let curAngle = 0; const poss = []; Rs.forEach((r) => { const xPos = r * Math.cos(curAngle); const yPos = r * Math.sin(curAngle); curAngle += everyIncAngle; poss.push([xPos, yPos]); }); const Ls = poss.map((p, i) => { if (i === 0) { return ["M", ...p]; } return ["L", ...p]; }); group.addShape("path", { attrs: { path: [ ...Ls, ["Z"], // close the path ], stroke: strokeColors[index], fill: fillColors[index], }, name: "path-shape1", }); }); let nowAngle2 = 0; const everyIncAngleCat = (2 * Math.PI * (360 / 5)) / 360; for (let i = 0; i < 5; i++) { const r = 30 + 60; const xPos = r * Math.cos(nowAngle2); const yPos = r * Math.sin(nowAngle2); group.addShape("path", { attrs: { path: [ ["M", 0, 0], ["L", xPos, yPos], ], lineDash: [4, 4], stroke: "darkgray", }, name: "path-shape2", }); nowAngle2 += everyIncAngleCat; } // add a circle with the same filling color with background group.addShape("circle", { // attrs: style attrs: { x: 0, // 居中 y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { // attrs: style attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/area-chart/index.json ================================================ { "navigationBarTitleText": "面积图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/area-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/area-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/bar-chart/data.js ================================================ export default { nodes: [ { id: "nodeA", x: 150, y: 150, label: "Bar1", type: "circleBar", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeA2", x: 500, y: 150, label: "Bar2", type: "circleBar", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeA", target: "nodeA2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/bar-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * bar-chart:使用G自定义的南丁格尔图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); const getPath = (cx, cy, rs, re, startAngle, endAngle, clockwise) => { const flag1 = clockwise ? 1 : 0; const flag2 = clockwise ? 0 : 1; return [ ["M", Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy], ["L", Math.cos(startAngle) * re + cx, Math.sin(startAngle) * re + cy], [ "A", re, re, 0, 0, flag1, Math.cos(endAngle) * re + cx, Math.sin(endAngle) * re + cy, ], ["L", Math.cos(endAngle) * rs + cx, Math.sin(endAngle) * rs + cy], [ "A", rs, rs, 0, 0, flag2, Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy, ], ["Z"], ]; }; F6.registerNode("circleBar", { draw(cfg, group) { /* G: Fan x: the circle center of the fan y: the circle center of the fan rs: inner radius re: outer radius startAngle: start angle endAngle: end angle clockwise: render clockwisely if it is true */ const baseR = 30; let nowAngle = 0; const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { cat.values.forEach((item) => { const re = item + baseR; const path0 = getPath( 0, 0, baseR, item + baseR, nowAngle, (nowAngle += everyIncAngle), false, ); const fan = group.addShape("path", { attrs: { path: path0, stroke: "darkgray", fill: cat.color, }, name: "path-shape", }); // behavior animation fan.on("mouseenter", () => { fan.animate( { re: re + 8, }, { repeat: false, duration: 300, }, ); }); fan.on("mouseleave", () => { fan.animate( { re, }, { repeat: false, duration: 300, }, ); }); // set the name fan.set("name", "littleCircle"); }); }); group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/bar-chart/index.json ================================================ { "navigationBarTitleText": "南丁格尔图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/bar-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/bar-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/built-in-arrows/data.js ================================================ import F6 from "@antv/f6-wx"; // 需要用到箭头 const data = { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 50, }, { id: "2", x: 150, y: 100, }, { id: "3", x: 350, y: 100, }, { id: "4", x: 150, y: 150, }, { id: "5", x: 350, y: 150, }, { id: "6", x: 150, y: 200, }, { id: "7", x: 350, y: 200, }, { id: "8", x: 150, y: 250, }, { id: "9", x: 350, y: 250, }, { id: "10", x: 150, y: 300, }, { id: "11", x: 350, y: 300, }, { id: "12", x: 150, y: 350, }, { id: "13", x: 350, y: 350, }, { id: "14", x: 150, y: 400, }, { id: "15", x: 350, y: 400, }, ], edges: [ { id: "edge0", source: "0", target: "1", label: "default arrow", style: { endArrow: true, }, }, { id: "edge1", source: "2", target: "3", label: "triangle arrow", style: { endArrow: { path: F6.Arrow.triangle(), }, }, }, { id: "edge2", source: "4", target: "5", label: "vee arrow", style: { endArrow: { path: F6.Arrow.vee(), }, }, }, { id: "edge3", source: "6", target: "7", label: "circle arrow", style: { endArrow: { path: F6.Arrow.circle(5, 3), d: 3, }, }, }, { id: "edge4", source: "8", target: "9", label: "diamond arrow", style: { endArrow: { path: F6.Arrow.diamond(10, 10, 3), d: 3, }, }, }, { id: "edge5", source: "10", target: "11", label: "rect arrow", style: { endArrow: { path: F6.Arrow.rect(10, 10, 3), d: 3, }, }, }, { id: "edge6", source: "12", target: "13", label: "rect arrow 2", style: { endArrow: { path: F6.Arrow.rect(10, 2, 5), d: 5, }, }, }, { id: "edge7", source: "14", target: "15", label: "triangleRect arrow", style: { endArrow: { path: F6.Arrow.triangleRect(10, 10, 10, 2, 4), }, }, }, ], }; data.edges.forEach((edge) => { edge.style.stroke = "#F6BD16"; console.log(edge.style.endArrow); if (edge.id !== "edge0") edge.style.endArrow.fill = "#F6BD16"; }); export default data; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/built-in-arrows/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * built in arrows */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { size: 15, style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, modes: { // behaviors default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/built-in-arrows/index.json ================================================ { "navigationBarTitleText": "默认内置箭头", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/built-in-arrows/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/built-in-arrows/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-circle/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 200, comboId: "combo1" }, { id: "node2", x: 300, y: 200, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-circle/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * c-circle */ // The symbols for the marker inside the combo const collapseIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const expandIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; F6.registerCombo( "c-circle", { drawShape: function draw(cfg, group) { const self = this; // Get the shape style, where the style.r corresponds to the R in the Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); // Add a circle shape as keyShape which is the same as the extended 'circle' type Combo const circle = group.addShape("circle", { attrs: { ...style, x: 0, y: 0, r: style.r, }, draggable: true, name: "combo-keyShape", }); // Add the marker on the bottom group.addShape("marker", { attrs: { ...style, fill: "#fff", opacity: 1, x: 0, y: style.r, r: 10, symbol: collapseIcon, }, draggable: true, name: "combo-marker-shape", }); return circle; }, // Define the updating logic for the marker afterUpdate: function afterUpdate(cfg, combo) { const self = this; // Get the shape style, where the style.r corresponds to the R in the Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); const group = combo.get("group"); // Find the marker shape in the graphics group of the Combo const marker = group.find( (ele) => ele.get("name") === "combo-marker-shape", ); // Update the marker shape marker.attr({ x: 0, y: style.r, // The property 'collapsed' in the combo data represents the collapsing state of the Combo // Update the symbol according to 'collapsed' symbol: cfg.collapsed ? expandIcon : collapseIcon, }); }, }, "circle", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, // Configure the combos globally defaultCombo: { // The type of the combos. You can also assign type in the data of combos type: "c-circle", labelCfg: { refY: 2, }, // ... Other global configurations for combos }, modes: { default: ["drag-combo", "drag-node", "drag-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // collapse/expand when click the marker this.graph.on("combo:tap", (e) => { if (e.target.get("name") === "combo-marker-shape") { // graph.collapseExpandCombo(e.item.getModel().id); this.graph.collapseExpandCombo(e.item); if (this.graph.get("layout")) this.graph.layout(); else this.graph.refreshPositions(); } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-circle/index.json ================================================ { "navigationBarTitleText": "带有Marker的圆", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-circle/index.wxml ================================================ Click the bottom marker to collapse/expand the combo. ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-circle/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-rect/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 200, comboId: "combo1" }, { id: "node2", x: 300, y: 200, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-rect/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * c-rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); // The symbols for the marker inside the combo const collapseIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const expandIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; F6.registerCombo( "c-rect", { drawShape: function drawShape(cfg, group) { const self = this; // Get the padding from the configuration cfg.padding = cfg.padding || [50, 20, 20, 20]; // Get the shape's style, where the style.width and style.height correspond to the width and height in the figure of Illustration of Built-in Rect Combo const style = self.getShapeStyle(cfg); // Add a rect shape as the keyShape which is the same as the extended rect Combo const rect = group.addShape("rect", { attrs: { ...style, x: -style.width / 2 - (cfg.padding[3] - cfg.padding[1]) / 2, y: -style.height / 2 - (cfg.padding[0] - cfg.padding[2]) / 2, width: style.width, height: style.height, }, draggable: true, name: "combo-keyShape", }); // Add the circle on the right group.addShape("marker", { attrs: { ...style, fill: "#fff", opacity: 1, // cfg.style.width and cfg.style.heigth correspond to the innerWidth and innerHeight in the figure of Illustration of Built-in Rect Combo x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, r: 10, symbol: collapseIcon, }, draggable: true, name: "combo-marker-shape", }); return rect; }, // Define the updating logic of the right circle afterUpdate: function afterUpdate(cfg, combo) { const group = combo.get("group"); // Find the circle shape in the graphics group of the Combo by name const marker = group.find( (ele) => ele.get("name") === "combo-marker-shape", ); // Update the position of the right circle marker.attr({ // cfg.style.width and cfg.style.heigth correspond to the innerWidth and innerHeight in the figure of Illustration of Built-in Rect Combo x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, // The property 'collapsed' in the combo data represents the collapsing state of the Combo // Update the symbol according to 'collapsed' symbol: cfg.collapsed ? expandIcon : collapseIcon, }); }, }, "rect", ); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, // Configure the combos globally defaultCombo: { // The type of the combos. You can also assign type in the data of combos type: "c-rect", // ... Other global configurations for combos }, modes: { default: ["drag-combo", "drag-node", "drag-canvas"], }, }); // collapse/expand when click the marker this.graph.on("combo:tap", (e) => { if (e.target.get("name") === "combo-marker-shape") { // graph.collapseExpandCombo(e.item.getModel().id); this.graph.collapseExpandCombo(e.item); if (this.graph.get("layout")) this.graph.layout(); else this.graph.refreshPositions(); } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-rect/index.json ================================================ { "navigationBarTitleText": "带有Marker的矩形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-rect/index.wxml ================================================ Click the bottom marker to collapse/expand the combo. ================================================ FILE: packages/examples-wx/package-elements/pages/elements/c-rect/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card/data.js ================================================ export default { nodes: [ { name: "cardNodeApp", ip: "127.0.0.1", nodeError: true, dataType: "root", keyInfo: "this is a card node info", x: 100, y: 50, }, { name: "cardNodeApp", ip: "127.0.0.1", nodeError: false, dataType: "subRoot", keyInfo: "this is sub root", x: 100, y: 150, }, { name: "cardNodeApp", ip: "127.0.0.1", nodeError: false, dataType: "subRoot", keyInfo: "this is sub root", x: 100, y: 250, children: [ { name: "sub", }, ], }, ], edges: [], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * card */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const ERROR_COLOR = "#F5222D"; const getNodeConfig = (node) => { if (node.nodeError) { return { basicColor: ERROR_COLOR, fontColor: "#FFF", borderColor: ERROR_COLOR, bgColor: "#E66A6C", }; } let config = { basicColor: "#5B8FF9", fontColor: "#5B8FF9", borderColor: "#5B8FF9", bgColor: "#C6E5FF", }; switch (node.type) { case "root": { config = { basicColor: "#E3E6E8", fontColor: "rgba(0,0,0,0.85)", borderColor: "#E3E6E8", bgColor: "#5b8ff9", }; break; } default: break; } return config; }; const COLLAPSE_ICON = function COLLAPSE_ICON(x, y, r) { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const EXPAND_ICON = function EXPAND_ICON(x, y, r) { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; const nodeBasicMethod = { createNodeBox: (group, config, w, h, isRoot) => { /* 最外面的大矩形 */ const container = group.addShape("rect", { attrs: { x: 0, y: 0, width: w, heigh: h, }, name: "big-rect-shape", }); if (!isRoot) { /* 左边的小圆点 */ group.addShape("circle", { attrs: { x: 3, y: h / 2, r: 6, fill: config.basicColor, }, name: "left-dot-shape", }); } /* 矩形 */ group.addShape("rect", { attrs: { x: 3, y: 0, width: w - 19, height: h, fill: config.bgColor, stroke: config.borderColor, radius: 2, cursor: "pointer", }, name: "rect-shape", }); /* 左边的粗线 */ group.addShape("rect", { attrs: { x: 3, y: 0, width: 3, height: h, fill: config.basicColor, radius: 1.5, }, name: "left-border-shape", }); return container; }, /* 生成树上的 marker */ createNodeMarker: (group, collapsed, x, y) => { group.addShape("circle", { attrs: { x, y, r: 13, fill: "rgba(47, 84, 235, 0.05)", opacity: 0, zIndex: -2, }, name: "collapse-icon-bg", }); group.addShape("marker", { attrs: { x, y, r: 7, symbol: collapsed ? EXPAND_ICON : COLLAPSE_ICON, stroke: "rgba(0,0,0,0.25)", fill: "rgba(0,0,0,0)", lineWidth: 1, cursor: "pointer", }, name: "collapse-icon", }); }, afterDraw: (cfg, group) => { /* 操作 marker 的背景色显示隐藏 */ const icon = group.find( (element) => element.get("name") === "collapse-icon", ); if (icon) { const bg = group.find( (element) => element.get("name") === "collapse-icon-bg", ); icon.on("mouseenter", () => { bg.attr("opacity", 1); this.graph.get("canvas").draw(); }); icon.on("mouseleave", () => { bg.attr("opacity", 0); this.graph.get("canvas").draw(); }); } /* ip 显示 */ const ipBox = group.find((element) => element.get("name") === "ip-box"); if (ipBox) { /* ip 复制的几个元素 */ const ipLine = group.find( (element) => element.get("name") === "ip-cp-line", ); const ipBG = group.find( (element) => element.get("name") === "ip-cp-bg", ); const ipIcon = group.find( (element) => element.get("name") === "ip-cp-icon", ); const ipCPBox = group.find( (element) => element.get("name") === "ip-cp-box", ); const onMouseEnter = () => { ipLine.attr("opacity", 1); ipBG.attr("opacity", 1); ipIcon.attr("opacity", 1); this.graph.get("canvas").draw(); }; const onMouseLeave = () => { ipLine.attr("opacity", 0); ipBG.attr("opacity", 0); ipIcon.attr("opacity", 0); this.graph.get("canvas").draw(); }; ipBox.on("mouseenter", () => { onMouseEnter(); }); ipBox.on("mouseleave", () => { onMouseLeave(); }); ipCPBox.on("mouseenter", () => { onMouseEnter(); }); ipCPBox.on("mouseleave", () => { onMouseLeave(); }); ipCPBox.on("click", () => {}); } }, setState: (name, value, item) => { const hasOpacityClass = [ "ip-cp-line", "ip-cp-bg", "ip-cp-icon", "ip-cp-box", "ip-box", "collapse-icon-bg", ]; const group = item.getContainer(); const childrens = group.get("children"); this.graph.setAutoPaint(false); if (name === "emptiness") { if (value) { childrens.forEach((shape) => { if (hasOpacityClass.indexOf(shape.get("name")) > -1) { return; } shape.attr("opacity", 0.4); }); } else { childrens.forEach((shape) => { if (hasOpacityClass.indexOf(shape.get("name")) > -1) { return; } shape.attr("opacity", 1); }); } } this.graph.setAutoPaint(true); }, }; F6.registerNode("card-node", { draw: (cfg, group) => { const config = getNodeConfig(cfg); const isRoot = cfg.dataType === "root"; const { nodeError } = cfg; /* the biggest rect */ const container = nodeBasicMethod.createNodeBox( group, config, 243, 64, isRoot, ); if (cfg.dataType !== "root") { /* the type text */ group.addShape("text", { attrs: { text: cfg.dataType, x: 3, y: -10, fontSize: 12, textAlign: "left", textBaseline: "middle", fill: "rgba(0,0,0,0.65)", }, name: "type-text-shape", }); } if (cfg.ip) { /* ip start */ /* ipBox */ const ipRect = group.addShape("rect", { attrs: { fill: nodeError ? null : "#FFF", stroke: nodeError ? "rgba(255,255,255,0.65)" : null, radius: 2, cursor: "pointer", }, name: "ip-container-shape", }); /* ip */ const ipText = group.addShape("text", { attrs: { text: cfg.ip, x: 0, y: 19, fontSize: 12, textAlign: "left", textBaseline: "middle", fill: nodeError ? "rgba(255,255,255,0.85)" : "rgba(0,0,0,0.65)", cursor: "pointer", }, name: "ip-text-shape", }); const ipBBox = ipText.getBBox(); /* the distance from the IP to the right is 12px */ ipText.attr({ x: 224 - 12 - ipBBox.width, }); /* ipBox */ ipRect.attr({ x: 224 - 12 - ipBBox.width - 4, y: ipBBox.minY - 5, width: ipBBox.width + 8, height: ipBBox.height + 10, }); /* a transparent shape on the IP for click listener */ group.addShape("rect", { attrs: { stroke: "", cursor: "pointer", x: 224 - 12 - ipBBox.width - 4, y: ipBBox.minY - 5, width: ipBBox.width + 8, height: ipBBox.height + 10, fill: "#fff", opacity: 0, }, name: "ip-box", }); /* copyIpLine */ group.addShape("rect", { attrs: { x: 194, y: 7, width: 1, height: 24, fill: "#E3E6E8", opacity: 0, }, name: "ip-cp-line", }); /* copyIpBG */ group.addShape("rect", { attrs: { x: 195, y: 8, width: 22, height: 22, fill: "#FFF", cursor: "pointer", opacity: 0, }, name: "ip-cp-bg", }); /* copyIpIcon */ group.addShape("image", { attrs: { x: 200, y: 13, height: 12, width: 10, img: "https://os.alipayobjects.com/rmsportal/DFhnQEhHyPjSGYW.png", cursor: "pointer", opacity: 0, }, name: "ip-cp-icon", }); /* a transparent rect on the icon area for click listener */ group.addShape("rect", { attrs: { x: 195, y: 8, width: 22, height: 22, fill: "#FFF", cursor: "pointer", opacity: 0, }, name: "ip-cp-box", tooltip: "Copy the IP", }); /* ip end */ } /* name */ group.addShape("text", { attrs: { text: cfg.name, x: 19, y: 19, fontSize: 14, fontWeight: 700, textAlign: "left", textBaseline: "middle", fill: config.fontColor, cursor: "pointer", }, name: "name-text-shape", }); /* the description text */ group.addShape("text", { attrs: { text: cfg.keyInfo, x: 19, y: 45, fontSize: 14, textAlign: "left", textBaseline: "middle", fill: config.fontColor, cursor: "pointer", }, name: "bottom-text-shape", }); if (nodeError) { group.addShape("text", { attrs: { x: 191, y: 62, text: "⚠️", fill: "#000", fontSize: 18, }, name: "error-text-shape", }); } const hasChildren = cfg.children && cfg.children.length > 0; if (hasChildren) { nodeBasicMethod.createNodeMarker(group, cfg.collapsed, 236, 32); } return container; }, afterDraw: nodeBasicMethod.afterDraw, setState: nodeBasicMethod.setState, }); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-node"], }, defaultNode: { type: "card-node", }, extra: { createImage: this.canvas && this.canvas.createImage, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card/index.json ================================================ { "navigationBarTitleText": "卡片", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card-node/data.js ================================================ export default { nodes: [ { title: "node1", error: true, nodeType: "a", id: "node1", nodeLevel: 2, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], x: 100, y: 100, }, { title: "node2", error: false, nodeType: "b", id: "node2", nodeLevel: 0, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], x: 100, y: 200, }, { title: "node3", error: false, nodeType: "a", id: "node3", nodeLevel: 3, panels: [ { title: "成功率", value: "11%" }, { title: "耗时", value: "111" }, { title: "错误数", value: "111" }, ], collapse: true, x: 100, y: 300, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card-node/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * card-node */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const ICON_MAP = { a: "https://gw.alipayobjects.com/mdn/rms_8fd2eb/afts/img/A*0HC-SawWYUoAAAAAAAAAAABkARQnAQ", b: "https://gw.alipayobjects.com/mdn/rms_8fd2eb/afts/img/A*sxK0RJ1UhNkAAAAAAAAAAABkARQnAQ", }; F6.registerNode( "card-node", { drawShape: function drawShape(cfg, group) { const color = cfg.error ? "#F4664A" : "#30BF78"; const r = 2; const shape = group.addShape("rect", { attrs: { x: 0, y: 0, width: 200, height: 60, stroke: color, radius: r, }, name: "main-box", draggable: true, }); group.addShape("rect", { attrs: { x: 0, y: 0, width: 200, height: 20, fill: color, radius: [r, r, 0, 0], }, name: "title-box", draggable: true, }); // left icon group.addShape("image", { attrs: { x: 4, y: 2, height: 16, width: 16, cursor: "pointer", img: ICON_MAP[cfg.nodeType || "app"], }, name: "node-icon", }); // title text group.addShape("text", { attrs: { textBaseline: "top", y: 2, x: 24, lineHeight: 20, text: cfg.title, fill: "#fff", }, name: "title", }); if (cfg.nodeLevel > 0) { group.addShape("marker", { attrs: { x: 184, y: 30, r: 6, cursor: "pointer", symbol: cfg.collapse ? F6.Marker.expand : F6.Marker.collapse, stroke: "#666", lineWidth: 1, }, name: "collapse-icon", }); } // The content list cfg.panels.forEach((item, index) => { // name text group.addShape("text", { attrs: { textBaseline: "top", y: 25, x: 24 + index * 60, lineHeight: 20, text: item.title, fill: "rgba(0,0,0, 0.4)", }, name: `index-title-${index}`, }); // value text group.addShape("text", { attrs: { textBaseline: "top", y: 42, x: 24 + index * 60, lineHeight: 20, text: item.value, fill: "#595959", }, name: `index-title-${index}`, }); }); return shape; }, }, "single-node", ); // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "card-node", }, extra: { createImage: this.canvas && this.canvas.createImage, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card-node/index.json ================================================ { "navigationBarTitleText": "卡片2", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card-node/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/card-node/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle/data.js ================================================ export default { nodes: [ { id: "circle", label: "Circle", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * circle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { /* node type */ type: "circle", /* node size */ size: [60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle/index.json ================================================ { "navigationBarTitleText": "圆形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle-with-combo/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 150, comboId: "combo", }, { id: "node2", x: 350, y: 150, comboId: "combo", }, ], combos: [ { id: "combo", label: "Combo", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle-with-combo/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * circle-with-combo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", ], }, defaultCombo: { type: "circle", /* style for the keyShape */ // style: { // lineWidth: 1, // }, labelCfg: { /* label's offset to the keyShape */ // refY: 10, /* label's position, options: center, top, bottom, left, right */ position: "top", /* label's style */ // style: { // fontSize: 18, // }, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ /* you can extend it or override it as you want */ // comboStateStyles: { // active: { // fill: '#f00', // opacity: 0.5 // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle-with-combo/index.json ================================================ { "navigationBarTitleText": "圆形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle-with-combo/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/circle-with-combo/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic1/data.js ================================================ export default { nodes: [ { id: "node0", x: 200, y: 10, size: 20, }, { id: "node1", x: 200, y: 50, label: "1222", type: "my-rect", }, { id: "node2", x: 150, y: 150, type: "my-rect", }, { id: "node3", x: 250, y: 150, type: "my-rect", }, { id: "node4", x: 200, y: 250, type: "my-rect", }, ], edges: [ { source: "node0", target: "node1", }, { source: "node1", target: "node2", }, { source: "node1", target: "node3", }, { source: "node2", target: "node4", }, { source: "node3", target: "node4", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic1/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * cubic1 */ F6.registerNode( "my-rect", { getAnchorPoints: function getAnchorPoints() { return [ [0.5, 0], [0.5, 1], ]; }, }, "rect", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "cubic-vertical", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic1/index.json ================================================ { "navigationBarTitleText": "三次贝塞尔曲线-垂直", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic1/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic1/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic2/data.js ================================================ export default { nodes: [ { id: "node5", x: 150, y: 200, label: "5", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node6", x: 300, y: 150, label: "6", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node7", x: 300, y: 250, label: "7", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node5", target: "node6", type: "cubic-horizontal", }, { source: "node5", target: "node7", type: "cubic-horizontal", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic2/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * cubic2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "cubic-horizontal", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic2/index.json ================================================ { "navigationBarTitleText": "三次贝塞尔曲线-水平", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic2/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/cubic2/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-arrows/data.js ================================================ const data = { nodes: [ { id: "0", x: 150, y: 50, }, { id: "1", x: 350, y: 50, }, { id: "2", x: 150, y: 100, }, { id: "3", x: 350, y: 100, }, ], edges: [ { id: "edge0", source: "0", target: "1", label: "custom arrow 1", style: { endArrow: { path: "M 3,-5 L 3,5 L 15,10 L 15,-10 Z", }, }, }, { id: "edge1", source: "2", target: "3", label: "custom arrow 2", style: { endArrow: { path: "M0,0 L10,4 L14,14 L18,4 L28,0 L18,-4 L14,-14 L10,-4 Z", }, }, }, ], }; data.edges.forEach((edge) => { edge.style.stroke = "#F6BD16"; console.log(edge.style.endArrow); edge.style.endArrow.fill = "#F6BD16"; }); export default data; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-arrows/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * custom Arrows */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { size: 15, style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, modes: { // behaviors default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-arrows/index.json ================================================ { "navigationBarTitleText": "自定义箭头", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-arrows/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-arrows/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline/data.js ================================================ export default { nodes: [ { id: "7", x: 150, y: 100, size: 40, anchorPoints: [ [1, 0.5], [1, 0], ], }, { id: "8", x: 300, y: 200, size: 40, anchorPoints: [ [0, 0.5], [0, 1], ], }, ], edges: [ { source: "7", target: "8", sourceAnchor: 0, targetAnchor: 0, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * custom-polyline */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); // 注册边 F6.registerEdge( "line-arrow", { getPath(points) { const startPoint = points[0]; const endPoint = points[1]; return [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, endPoint.y], ["L", endPoint.x, endPoint.y], ]; }, getShapeStyle(cfg) { const { startPoint } = cfg; const { endPoint } = cfg; const controlPoints = this.getControlPoints(cfg); let points = [startPoint]; // the start point // the control points if (controlPoints) { points = points.concat(controlPoints); } // the end point points.push(endPoint); const path = this.getPath(points); const style = Object.assign( {}, F6.Global.defaultEdge.style, { stroke: "#BBB", lineWidth: 1, path, }, cfg.style, ); return style; }, }, "line", ); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultNode: { type: "circle", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, linkPoints: { left: true, right: true, fill: "#fff", stroke: "#1890FF", size: 3, }, }, defaultEdge: { type: "line-arrow", style: { stroke: "#F6BD16", startArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, endArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline/index.json ================================================ { "navigationBarTitleText": "自定义折线", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline2/data.js ================================================ export default { nodes: [ { id: "7", x: 150, y: 100, size: 40, anchorPoints: [ [1, 0.5], [1, 0], ], }, { id: "8", x: 300, y: 200, size: 40, anchorPoints: [ [0, 0.5], [0, 1], ], }, ], edges: [ { source: "7", target: "8", sourceAnchor: 0, targetAnchor: 0, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline2/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * custom-polyline2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerEdge("line-arrow", { options: { style: { stroke: "#ccc", }, }, draw: function draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const stroke = (cfg.style && cfg.style.stroke) || this.options.style.stroke; const startArrow = (cfg.style && cfg.style.startArrow) || undefined; const endArrow = (cfg.style && cfg.style.endArrow) || undefined; const keyShape = group.addShape("path", { attrs: { path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, endPoint.y], ["L", endPoint.x, endPoint.y], ], stroke, lineWidth: 1, startArrow, endArrow, }, className: "edge-shape", name: "edge-shape", }); return keyShape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultNode: { type: "circle", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, linkPoints: { left: true, right: true, fill: "#fff", stroke: "#1890FF", size: 3, }, }, defaultEdge: { type: "line-arrow", style: { stroke: "#F6BD16", startArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, endArrow: { path: "M 0,0 L 12,6 L 9,0 L 12,-6 Z", fill: "#F6BD16", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline2/index.json ================================================ { "navigationBarTitleText": "自定义折线2", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline2/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/custom-polyline2/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/diamond/data.js ================================================ export default { nodes: [ { id: "diamond", label: "Diamond", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/diamond/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * diamond */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { /* node type */ type: "diamond", /* node size */ size: [80, 60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/diamond/index.json ================================================ { "navigationBarTitleText": "模态菱形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/diamond/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/diamond/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/donut/data.js ================================================ export default { nodes: [ { id: "donut", label: "Donut", x: 250, y: 150, // the attributes for drawing donut donutAttrs: { prop1: 10, prop2: 20, prop3: 25, }, // the color map for drawing donut donutColorMap: { prop1: "#8eaade", prop2: "#5c7cb8", prop3: "#1e3f7d", }, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/donut/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * donut */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, fitViewPadding: 60, extra: { createImage: this.canvas && this.canvas.createImage, }, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { /* node type, the priority is lower than the type in the node data */ type: "donut", /* node size */ size: 60, /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ // linkPoints: { // top: true, // right: true, // bottom: true, // left: true, // /* linkPoints' size, 8 by default */ // // size: 5, // /* linkPoints' style */ // // fill: '#ccc', // // stroke: '#333', // // lineWidth: 2, // }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/donut/index.json ================================================ { "navigationBarTitleText": "甜甜圈", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/donut/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/donut/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-bg/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 250, y: 200, label: "node2", }, { id: "node3", x: 100, y: 350, label: "node3", }, ], edges: [ { source: "node1", target: "node2", label: "edge 1", }, { source: "node2", target: "node3", label: "edge 2", }, { source: "node3", target: "node1", label: "edge 3", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-bg/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * edge-bg */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "circle", labelCfg: { position: "bottom", }, }, defaultEdge: { labelCfg: { autoRotate: true, style: { fill: "#1890ff", fontSize: 14, background: { fill: "#ffffff", stroke: "#9EC9FF", padding: [2, 2, 2, 2], radius: 2, }, }, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-bg/index.json ================================================ { "navigationBarTitleText": "边上文本背景", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-bg/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-bg/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-mul-label/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, label: "node1", }, { id: "node2", x: 300, y: 100, label: "node2", }, ], edges: [ { source: "node1", target: "node2", // The left and right labels label: ["hello", "world"], }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-mul-label/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * 多标签边 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerEdge("multipleLabelsEdge", { options: { style: { stroke: "#000", }, }, labelAutoRotate: true, draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const stroke = (cfg.style && cfg.style.stroke) || this.options.style.stroke; const shape = group.addShape("path", { attrs: { stroke, path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x, endPoint.y], ], }, name: "path-shape", }); if (cfg.label && cfg.label.length) { // the left label group.addShape("text", { attrs: { text: cfg.label[0], fill: "#595959", textAlign: "start", textBaseline: "middle", x: startPoint.x, y: startPoint.y - 10, }, name: "left-text-shape", }); if (cfg.label.length > 1) { // the right label group.addShape("text", { attrs: { text: cfg.label[1], fill: "#595959", textAlign: "end", textBaseline: "middle", x: endPoint.x, y: endPoint.y - 10, }, name: "right-text-shape", }); } } // return the keyShape return shape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: [ { type: "drag-node", delegate: false, }, "drag-canvas", { type: "zoom-canvas", sensitivity: 0.5, }, ], }, defaultNode: { type: "circle", size: [50], linkPoints: { left: true, right: true, }, }, defaultEdge: { type: "multipleLabelsEdge", style: { stroke: "#F6BD16", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-mul-label/index.json ================================================ { "navigationBarTitleText": "多标签边", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-mul-label/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/edge-mul-label/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/ellipse/data.js ================================================ export default { nodes: [ { id: "ellipse", label: "Ellipse", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/ellipse/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * ellipse */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, extra: { createImage: this.canvas && this.canvas.createImage, }, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "ellipse", size: [80, 50], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/ellipse/index.json ================================================ { "navigationBarTitleText": "椭圆", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/ellipse/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/ellipse/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/extra-shape/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 100, }, { id: "node2", x: 300, y: 100, }, { id: "node3", x: 300, y: 200, }, ], edges: [ { source: "node1", target: "node2", midPointColor: "#f00", quatileColor: "#f00", }, { source: "node1", target: "node3", midPointColor: "#0f0", quatileColor: "#0f0", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/extra-shape/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * extraShapes */ // 注册边 F6.registerEdge( "extra-shape-edge", { afterDraw(cfg, group) { // get the first shape in the graphics group of this edge, it is the path of the edge here // 获取图形组中的第一个图形,在这里就是边的路径图形 const shape = group.get("children")[0]; // get the coordinate of the mid point on the path // 获取路径图形的中点坐标 const midPoint = shape.getPoint(0.5); const rectColor = cfg.midPointColor || "#333"; // add a rect on the mid point of the path. note that the origin of a rect shape is on its lefttop // 在中点增加一个矩形,注意矩形的原点在其左上角 group.addShape("rect", { attrs: { width: 10, height: 10, fill: rectColor || "#333", // x and y should be minus width / 2 and height / 2 respectively to translate the center of the rect to the midPoint // x 和 y 分别减去 width / 2 与 height / 2,使矩形中心在 midPoint 上 x: midPoint.x - 5, y: midPoint.y - 5, }, }); // get the coordinate of the quatile on the path // 获取路径上的四分位点坐标 const quatile = shape.getPoint(0.25); const quatileColor = cfg.quatileColor || "#333"; // add a circle on the quatile of the path // 在四分位点上放置一个圆形 group.addShape("circle", { attrs: { r: 5, fill: quatileColor || "#333", x: quatile.x, y: quatile.y, }, }); }, update: undefined, }, "cubic", ); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // behavior default: ["drag-node", "drag-canvas"], }, defaultEdge: { type: "extra-shape-edge", style: { stroke: "#F6BD16", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/extra-shape/index.json ================================================ { "navigationBarTitleText": "添加额外图形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/extra-shape/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/extra-shape/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/image/data.js ================================================ export default { nodes: [ { id: "image", img: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/image/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * image */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { type: "image", size: [260, 80], clipCfg: { show: false, // Clip type options: circle, ellipse, rect, path type: "circle", // circle r: 30, // clip style style: { lineWidth: 1, }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/image/index.json ================================================ { "navigationBarTitleText": "图片", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/image/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/image/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len/data.js ================================================ import F6 from "@antv/f6-wx"; const globalFontSize = 12; const fittingString = (str, maxWidth, fontSize) => { const ellipsis = "..."; const ellipsisLength = F6.Util.getTextSize(ellipsis, fontSize)[0]; let currentWidth = 0; let res = str; const pattern = new RegExp("[\u4E00-\u9FA5]+"); // distinguish the Chinese charactors and letters str.split("").forEach((letter, i) => { if (currentWidth > maxWidth - ellipsisLength) return; if (pattern.test(letter)) { // Chinese charactors currentWidth += fontSize; } else { // get the width of single letter according to the fontSize currentWidth += F6.Util.getLetterWidth(letter, fontSize); } if (currentWidth > maxWidth - ellipsisLength) { res = `${str.substr(0, i)}${ellipsis}`; } }); return res; }; const data = { nodes: [ { x: 100, y: 100, size: 40, label: "This label is too long to be displayed", id: "node1", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { x: 300, y: 100, size: 80, label: "This label is also too long to be displayed", id: "node2", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node1", target: "node2", label: "This label is too long to be displayed", labelCfg: { refY: 20, style: { fontSize: globalFontSize, }, }, style: { endArrow: true, }, }, ], }; // Modify the label in the data data.nodes.forEach((node) => { node.label = fittingString(node.label, node.size, globalFontSize); }); data.edges.forEach((edge) => { edge.label = fittingString(edge.label, 120, globalFontSize); }); export default data; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * label-len */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, labelCfg: { style: { fontSize: 12, }, }, }, defaultEdge: { color: "#F6BD16", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len/index.json ================================================ { "navigationBarTitleText": "文本超长", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len1/data.js ================================================ import F6 from "@antv/f6-wx"; const fittingString = (str, maxWidth, fontSize) => { let currentWidth = 0; let res = str; const pattern = new RegExp("[\u4E00-\u9FA5]+"); // distinguish the Chinese charactors and letters str.split("").forEach((letter, i) => { if (currentWidth > maxWidth) return; if (pattern.test(letter)) { // Chinese charactors currentWidth += fontSize; } else { // get the width of single letter according to the fontSize currentWidth += F6.Util.getLetterWidth(letter, fontSize); } if (currentWidth > maxWidth) { res = `${str.substr(0, i)}\n${str.substr(i)}`; } }); return res; }; const globalFontSize = 12; const data = { nodes: [ { x: 100, y: 100, label: fittingString( "Break the line if it is too long", 80, globalFontSize, ), id: "node1", labelCfg: { position: "bottom", }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { x: 300, y: 100, label: fittingString( "Break the line if it is too long", 80, globalFontSize, ), id: "node2", labelCfg: { position: "bottom", }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { source: "node1", target: "node2", label: fittingString( "Break the line if it is too long", 100, globalFontSize, ), labelCfg: { refY: 20, }, style: { endArrow: true, }, }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len1/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * label-len1 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { color: "#F6BD16", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len1/index.json ================================================ { "navigationBarTitleText": "使用换行符处理", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len1/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/label-len1/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/line-chart/data.js ================================================ export default { nodes: [ { id: "nodeB", x: 150, y: 150, label: "Line1", type: "circleLine", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeB2", x: 500, y: 150, label: "Line2", type: "circleLine", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 50, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [50, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 50, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeB", target: "nodeB2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/line-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * line-chart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerNode("circleLine", { draw(cfg, group) { const baseR = 30; let nowAngle = 0; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 5; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#bae7ff", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { // 计算一系列点的位置 const postions = []; cat.values.forEach((item, index) => { const r = baseR + item; const xPos = r * Math.cos(nowAngle); const yPos = r * Math.sin(nowAngle); nowAngle += everyIncAngle; postions.push([xPos, yPos]); if (index === 4) { const r_ = baseR + item; const xPos_ = r_ * Math.cos(nowAngle); const yPos_ = r_ * Math.sin(nowAngle); postions.push([xPos_, yPos_]); } }); const pathArrayL = postions.map((item) => ["L", ...item]); // add the connecting line group.addShape("path", { attrs: { path: [ ["M", 0, 0], // the top vertex ...pathArrayL, ["Z"], // close the path ], stroke: cat.color, }, name: "path-shape", }); postions.forEach((pos, index) => { if (index !== 5) { const littleCircle = group.addShape("circle", { // attrs: style attrs: { x: pos[0], y: pos[1], r: 2, fill: "black", stroke: cat.color, cursor: "pointer", }, name: "circle-shape", }); // 加上交互动画 littleCircle.on("mouseenter", () => { littleCircle.animate( { r: 5, }, { repeat: false, duration: 200, }, ); }); littleCircle.on("mouseleave", () => { littleCircle.animate( { r: 2, }, { repeat: false, duration: 200, }, ); }); // set the name littleCircle.set("name", "littleCircle"); } }); }); // add a circle with the same color with the background color group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, // 居中 y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/line-chart/index.json ================================================ { "navigationBarTitleText": "折线图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/line-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/line-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/list/data.js ================================================ export default { nodes: [ { id: "shape2", x: 0, y: 0, type: "expandNode", name: "网站引流", values: [ { key: "曝光率", value: "19.09", }, { key: "流入UV", value: "910", }, { key: "点击率", value: "90", }, { key: "占比", value: "90", }, ], properties: [ { name: "搜索", value1: "102", value2: "102", value3: "102", value4: "102", }, { name: "扫一扫", value1: "102", value2: "102", value3: "102", value4: "102", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/list/index.js ================================================ import F6 from "@antv/f6-wx"; import data_ from "./data"; /** * list:列表 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerNode("expandNode", { draw: function draw(cfg, group) { const mainGroup = group.addGroup({ id: "main-group", }); const keyShape = mainGroup.addShape("rect", { attrs: { x: 0, y: 0, width: 100 + 60 * cfg.values.length, height: 50, fill: "#C6E5FF", }, name: "key-rect-shape", }); // name text mainGroup.addShape("text", { attrs: { text: cfg.name, fill: "#000", width: 130, x: 10, y: 32, }, name: "name-text-shape", }); const subGroup = group.addGroup({ id: "sub-group", }); cfg.values.forEach((data, index) => { subGroup.addShape("rect", { attrs: { x: 110 + index * 60, y: 0, width: 50, height: 50, }, name: "rect-shape", }); subGroup.addShape("text", { attrs: { text: data.key, fill: "#000", x: 130 + index * 60, y: 20, fontSize: 10, textBaseline: "middle", className: "sub-group-text", }, name: "sub-text-shape1", }); subGroup.addShape("text", { attrs: { text: data.value, fill: "#000", x: 130 + index * 60, y: 30, fontSize: 10, textBaseline: "middle", textAlign: "left", className: "sub-group-text", }, name: "name-text-shape2", }); }); const listGroup = group.addGroup({ id: "detail-list-group", }); listGroup.addShape("rect", { attrs: { width: 100 + 60 * cfg.values.length - 70, height: 30 * cfg.properties.length + 20, fill: "#fff", x: 70, y: 30, }, name: "list-rect-shape1", }); const rectWidth = 100 + 60 * cfg.values.length - 80; cfg.properties.forEach((property, index) => { listGroup.addShape("rect", { attrs: { width: rectWidth, height: 30, fill: "#9EC9FF", x: 80, y: 40 * index + 40, }, name: "list-rect-shape2", }); let count = 0; for (const p in property) { // 每个rect中添加5个文本 listGroup.addShape("text", { attrs: { text: property[p], fill: "#000", x: 85 + count * (rectWidth / cfg.values.length) - count * 10, y: 40 * index + 40 + 15, fontSize: 10, textBaseline: "middle", textAlign: "left", }, name: "text-shape", }); count++; } }); listGroup.hide(); return keyShape; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, modes: { default: ["drag-canvas"], }, }); this.graph.on("node:tap", function (evt) { const { target } = evt; const parentGroup = target.get("parent").get("parent"); const detailGroup = parentGroup.findById("detail-list-group"); // 将sub-group中的内容网上移动一段距离 const subGroup = parentGroup.findById("sub-group"); const keyTexts = subGroup.findAll((item) => { return item.attr("className") === "sub-group-text"; }); const isVisible = detailGroup.get("visible"); if (isVisible) { detailGroup.hide(); keyTexts.forEach((text) => { const top = text.attr("y"); text.attr("y", top + 10); }); } else { keyTexts.forEach((text) => { const top = text.attr("y"); text.attr("y", top - 10); }); detailGroup.show(); } this.graph.paint(); }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/list/index.json ================================================ { "navigationBarTitleText": "列表", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/list/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/list/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/loop/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 150, }, { id: "1", x: 350, y: 150, }, ], edges: [ // 内置 loop { source: "0", target: "0", }, { source: "1", target: "1", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/loop/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * loop */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { // 支持的 behavior default: ["drag-node"], }, defaultEdge: { type: "loop", /* you can configure the global edge style as following lines */ style: { // stroke: '#F6BD16', endArrow: { path: "M 0,0 L 20,10 L 20,-10 Z", fill: "#eee", }, }, // 更多关于 loop 的配置请参考http://antv.alipay.com/zh/docs/manual/middle/elements/edges/loop/#%E8%87%AA%E7%8E%AF%E7%89%B9%E6%AE%8A%E9%85%8D%E7%BD%AE-loopcfg loopCfg: { position: "top", }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/loop/index.json ================================================ { "navigationBarTitleText": "自环边", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/loop/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/loop/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/mode-rect/data.js ================================================ export default { nodes: [ { id: "rect1", label: "rect1", description: "description, hidden when undefined", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/mode-rect/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * mode-rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, extra: { createImage: this.canvas && this.canvas.createImage, }, fitCenter: true, defaultNode: { type: "modelRect", size: [270, 80], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: 1, fillOpacity: 1, }, // label configurations labelCfg: { style: { fill: "#595959", fontSize: 14, }, offset: 30, }, // left rect preRect: { show: true, width: 4, fill: "#40a9ff", radius: 2, }, // configurations for the four linkpoints linkPoints: { top: false, right: false, bottom: false, left: false, // the size of the linkpoints' circle size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, // configurations for the icon logoIcon: { // whether to show the icon show: false, x: 0, y: 0, // the image url for the icon, string type img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, // adjust the offset along x-axis for the icon offset: 0, }, // configurations for state icon stateIcon: { // whether to show the icon show: false, x: 0, y: 0, // the image url for the icon, string type img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, // adjust hte offset along x-axis for the icon offset: -5, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { hover: { lineWidth: 2, stroke: "#1890ff", fill: "#e6f7ff", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "hover", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "hover", false); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/mode-rect/index.json ================================================ { "navigationBarTitleText": "模态矩形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/mode-rect/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/mode-rect/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/multi-edges/data.js ================================================ const data = { nodes: [ { id: "node1", x: 50, y: 350, label: "A", }, { id: "node2", x: 250, y: 150, label: "B", }, { id: "node3", x: 450, y: 350, label: "C", }, ], edges: [], }; for (let i = 0; i < 10; i++) { data.edges.push({ source: "node1", target: "node2", label: `${i}th edge of A-B`, }); } for (let i = 0; i < 5; i++) { data.edges.push({ source: "node2", target: "node3", label: `${i}th edge of B-C`, }); } export default data; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/multi-edges/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * multi-edges */ F6.Util.processParallelEdges(data.edges); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // the edges are linked to the center of source and target ndoes linkCenter: true, defaultNode: { type: "circle", size: [40], color: "#5B8FF9", style: { fill: "#9EC9FF", lineWidth: 3, }, labelCfg: { style: { fill: "#000", fontSize: 14, }, }, }, defaultEdge: { type: "quadratic", labelCfg: { autoRotate: true, }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/multi-edges/index.json ================================================ { "navigationBarTitleText": "两节点间存在多条边", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/multi-edges/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/multi-edges/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/node-bg/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 250, y: 200, label: "node2", }, { id: "node3", x: 100, y: 350, label: "node3", }, ], edges: [ { source: "node1", target: "node2", label: "edge 1", }, { source: "node2", target: "node3", label: "edge 2", }, { source: "node3", target: "node1", label: "edge 3", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/node-bg/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * node-bg */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, defaultNode: { type: "circle", labelCfg: { style: { fill: "#1890ff", fontSize: 14, background: { fill: "#ffffff", stroke: "#9EC9FF", padding: [2, 2, 2, 2], radius: 2, }, }, position: "bottom", }, }, modes: { default: ["drag-canvas", "drag-node"], }, nodeStateStyles: { // style configurations for hover state hover: { fillOpacity: 0.8, }, // style configurations for selected state selected: { lineWidth: 5, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/node-bg/index.json ================================================ { "navigationBarTitleText": "节点文本背景", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/node-bg/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/node-bg/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/pie-chart/data.js ================================================ export default { nodes: [ { id: "pie1", size: 80, inDegree: 80, degree: 360, x: 150, y: 150, }, { id: "pie2", size: 80, inDegree: 280, degree: 360, x: 350, y: 150, }, ], edges: [ { source: "pie1", target: "pie2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/pie-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * pie-chart:使用G自定义的饼图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); const lightBlue = "#5b8ff9"; const lightOrange = "#5ad8a6"; // register a pie chart node F6.registerNode("pie-node", { draw: (cfg, group) => { const radius = cfg.size / 2; // node radius const inPercentage = cfg.inDegree / cfg.degree; // the ratio of indegree to outdegree const inAngle = inPercentage * Math.PI * 2; // the anble for the indegree fan const inArcEnd = [ radius * Math.cos(inAngle), -radius * Math.sin(inAngle), ]; // the end position for the in-degree fan let isInBigArc = 0; let isOutBigArc = 1; if (inAngle > Math.PI) { isInBigArc = 1; isOutBigArc = 0; } // fan shape for the in degree const fanIn = group.addShape("path", { attrs: { path: [ ["M", radius, 0], ["A", radius, radius, 0, isInBigArc, 0, inArcEnd[0], inArcEnd[1]], ["L", 0, 0], ["Z"], ], lineWidth: 0, fill: lightOrange, }, name: "in-fan-shape", }); // draw the fan shape group.addShape("path", { attrs: { path: [ ["M", inArcEnd[0], inArcEnd[1]], ["A", radius, radius, 0, isOutBigArc, 0, radius, 0], ["L", 0, 0], ["Z"], ], lineWidth: 0, fill: lightBlue, }, name: "out-fan-shape", }); // 返回 keyshape return fanIn; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, defaultNode: { type: "pie-node", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/pie-chart/index.json ================================================ { "navigationBarTitleText": "饼图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/pie-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/pie-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/point-chart/data.js ================================================ export default { nodes: [ { id: "nodeC", x: 150, y: 150, label: "Point2", type: "justPoints", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeC2", x: 500, y: 150, label: "Point2", type: "justPoints", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 50, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [50, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 50, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeC", target: "nodeC2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/point-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * point-chart:使用G自定义的点线图节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerNode("justPoints", { draw(cfg, group) { const baseR = 30; let nowAngle = 0; // Ref line let refR = baseR; const refInc = 10; for (let i = 0; i < 5; i++) { group.addShape("circle", { attrs: { x: 0, y: 0, r: (refR += refInc), stroke: "#5ad8a6", lineDash: [4, 4], }, name: "circle-shape", }); } const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; nowAngle += everyIncAngle / 2; cfg.details.forEach((cat) => { // Calculate the positions for vertexes const postions = []; cat.values.forEach((item, index) => { const r = baseR + item; const xPos = r * Math.cos(nowAngle); const yPos = r * Math.sin(nowAngle); nowAngle += everyIncAngle; postions.push([xPos, yPos]); if (index === 4) { const r_ = baseR + item; const xPos_ = r_ * Math.cos(nowAngle); const yPos_ = r_ * Math.sin(nowAngle); postions.push([xPos_, yPos_]); } }); // add marks postions.forEach((pos, index) => { if (index !== 5) { group.addShape("circle", { attrs: { x: pos[0], y: pos[1], r: 3, lineWidth: 2, stroke: cat.color, }, name: "circle-marker-shape", }); } }); }); let nowAngle2 = 0; const everyIncAngleCat = (2 * Math.PI * (360 / 5)) / 360; for (let i = 0; i < 5; i++) { const r = 30 + 50; const xPos = r * Math.cos(nowAngle2); const yPos = r * Math.sin(nowAngle2); group.addShape("path", { attrs: { path: [ ["M", 0, 0], ["L", xPos, yPos], ], lineDash: [4, 4], stroke: "#5ad8a6", }, name: "path-shape", }); nowAngle2 += everyIncAngleCat; } // add a circle with the same color with the background color group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "#fff", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/point-chart/index.json ================================================ { "navigationBarTitleText": "点线图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/point-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/point-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline1/data.js ================================================ export default { nodes: [ { id: "0", x: 150, y: 100, }, { id: "1", x: 350, y: 300, }, ], edges: [ // Built-in polyline { source: "0", target: "1", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline1/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * polyline1 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "polyline", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline1/index.json ================================================ { "navigationBarTitleText": "折线1", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline1/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline1/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline2/data.js ================================================ export default { nodes: [ { id: "2", x: 150, y: 150, }, { id: "3", x: 350, y: 250, }, ], edges: [ { source: "2", target: "3", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline2/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * polyline2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas"], }, defaultEdge: { type: "polyline", /* configure the bending radius and min distance to the end nodes */ style: { radius: 10, offset: 30, endArrow: true, /* and other styles */ // stroke: '#F6BD16', }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline2/index.json ================================================ { "navigationBarTitleText": "折线2", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline2/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline2/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline3/data.js ================================================ export default { nodes: [ { id: "4", x: 150, y: 100, }, { id: "5", x: 350, y: 250, }, ], edges: [ { source: "4", target: "5", // assign the control points to control the bending positions controlPoints: [ { x: 260, y: 80, }, { x: 320, y: 50, }, { x: 390, y: 110, }, { x: 420, y: 110, }, { x: 420, y: 140, }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline3/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * polyline3 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, linkCenter: true, modes: { // behavior default: ["drag-node"], }, defaultEdge: { type: "polyline", /* you can configure the global edge style as following lines */ // style: { // stroke: '#F6BD16', // }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // edgeStateStyles: { // // edge style of active state // active: { // opacity: 0.5, // stroke: '#f00' // }, // // edge style of selected state // selected: { // stroke: '#ff0' // lineWidth: 3, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline3/index.json ================================================ { "navigationBarTitleText": "折线3", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline3/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/polyline3/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect/data.js ================================================ export default { nodes: [ { id: "rect", label: "rect", x: 250, y: 150, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, extra: { createImage: this.canvas && this.canvas.createImage, }, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, defaultNode: { type: "rect", size: [80, 50], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "center", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect/index.json ================================================ { "navigationBarTitleText": "矩形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect-with-combo/data.js ================================================ export default { nodes: [ { id: "node1", x: 250, y: 150, comboId: "combo", }, { id: "node2", x: 350, y: 150, comboId: "combo", }, ], combos: [ { id: "combo", label: "Combo", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect-with-combo/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * rect-with-combo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // translate the graph to align the canvas's center, support by v3.5.1 fitCenter: true, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", ], }, defaultCombo: { type: "rect", size: [50, 50], /* style for the keyShape */ // style: { // lineWidth: 1, // }, labelCfg: { /* label's offset to the keyShape */ // refY: 10, /* label's position, options: center, top, bottom, left, right */ position: "top", /* label's style */ // style: { // fontSize: 18, // }, }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ /* you can extend it or override it as you want */ // comboStateStyles: { // active: { // fill: '#f00', // opacity: 0.5 // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("edge:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("edge:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("edge:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getEdges().forEach((edge) => { this.graph.clearItemStates(edge); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect-with-combo/index.json ================================================ { "navigationBarTitleText": "矩形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect-with-combo/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/rect-with-combo/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/stack-chart/data.js ================================================ export default { nodes: [ { id: "nodeF", x: 150, y: 150, label: "StackedBar1", type: "stacked-bar-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [20, 30, 40, 30, 30], color: "#5B8FF9" }, { cat: "dal", values: [40, 30, 20, 30, 50], color: "#5AD8A6" }, { cat: "uv", values: [40, 30, 30, 40, 40], color: "#5D7092" }, { cat: "sal", values: [20, 30, 50, 20, 20], color: "#F6BD16" }, { cat: "cal", values: [10, 10, 20, 20, 20], color: "#E8684A" }, ], centerColor: "#5b8ff9", }, { id: "nodeF2", x: 500, y: 150, label: "StackedBar2", type: "stacked-bar-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], details: [ { cat: "pv", values: [10, 10, 80, 20, 10], color: "#5ad8a6" }, { cat: "dal", values: [20, 30, 10, 50, 40], color: "#ff99c3" }, { cat: "uv", values: [10, 50, 30, 20, 30], color: "#6dc8ec" }, { cat: "sal", values: [70, 30, 20, 20, 20], color: "#269a99" }, { cat: "cal", values: [50, 10, 20, 70, 30], color: "#9270CA" }, ], centerColor: "#5b8ff9", }, ], edges: [ { source: "nodeF", target: "nodeF2", }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/stack-chart/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * stack-chart */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); const getPath = (cx, cy, rs, re, startAngle, endAngle, clockwise) => { const flag1 = clockwise ? 1 : 0; const flag2 = clockwise ? 0 : 1; return [ ["M", Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy], ["L", Math.cos(startAngle) * re + cx, Math.sin(startAngle) * re + cy], [ "A", re, re, 0, 0, flag1, Math.cos(endAngle) * re + cx, Math.sin(endAngle) * re + cy, ], ["L", Math.cos(endAngle) * rs + cx, Math.sin(endAngle) * rs + cy], [ "A", rs, rs, 0, 0, flag2, Math.cos(startAngle) * rs + cx, Math.sin(startAngle) * rs + cy, ], ["Z"], ]; }; // Custom stacked bar chart node F6.registerNode("stacked-bar-node", { draw(cfg, group) { /* G: Fan x: the circle center of the fan y: the circle center of the fan rs: inner radius re: outer radius startAngle: start angle endAngle: end angle clockwise: render clockwisely if it is true */ const baseR = 30; let nowAngle = 0; const everyIncAngle = (2 * Math.PI * (360 / 5 / 5)) / 360; cfg.details.forEach((cat) => { cat.values.forEach((item) => { const baseNbr = Math.ceil(item / 10); const baseIncR = 7; let nowStartR = baseR; const last = item % 10; const endAngle = nowAngle + everyIncAngle; for (let i = 0; i < baseNbr; i++) { const path0 = getPath( 0, 0, nowStartR, nowStartR + baseIncR, nowAngle, endAngle, false, ); group.addShape("path", { attrs: { path: path0, stroke: "darkgray", fill: cat.color, }, name: "path-shape1", }); nowStartR = nowStartR + baseIncR + 2; if (i === baseNbr - 1 && last !== 0) { const path1 = getPath( 0, 0, nowStartR, nowStartR + (baseIncR * last) / 10, nowAngle, endAngle, false, ); group.addShape("path", { attrs: { path: path1, stroke: "darkgray", fill: cat.color, }, name: "path-shape2", }); } } nowAngle = endAngle; }); }); group.addShape("circle", { attrs: { x: 0, y: 0, r: baseR, fill: cfg.centerColor, stroke: "darkgray", }, name: "circle-shape", }); if (cfg.label) { group.addShape("text", { attrs: { x: 0, y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "white", fontStyle: "bold", }, name: "text-shape", }); } return group; }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/stack-chart/index.json ================================================ { "navigationBarTitleText": "堆叠图节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/stack-chart/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/stack-chart/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/star/data.js ================================================ export default { nodes: [ { id: "star", label: "Star", x: 250, y: 200, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/star/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * star */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { /* node type */ type: "star", /* node size */ size: [60, 60], /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/star/index.json ================================================ { "navigationBarTitleText": "五角星", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/star/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/star/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/triangle/data.js ================================================ export default { nodes: [ { id: "circle", label: "Triangle", x: 250, y: 200, }, ], }; ================================================ FILE: packages/examples-wx/package-elements/pages/elements/triangle/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * triangle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, fitCenter: true, modes: { default: ["drag-canvas", "drag-node"], }, extra: { createImage: this.canvas && this.canvas.createImage, }, defaultNode: { /* node type */ type: "triangle", /* node size */ size: [40], direction: "up", /* style for the keyShape */ // style: { // fill: '#9EC9FF', // stroke: '#5B8FF9', // lineWidth: 3, // }, labelCfg: { /* label's position, options: center, top, bottom, left, right */ position: "bottom", /* label's offset to the keyShape, 4 by default */ // offset: 12, /* label's style */ // style: { // fontSize: 20, // fill: '#ccc', // fontWeight: 500 // } }, /* configurations for four linkpoints */ linkPoints: { top: true, right: true, bottom: true, left: true, /* linkPoints' size, 8 by default */ // size: 5, /* linkPoints' style */ // fill: '#ccc', // stroke: '#333', // lineWidth: 2, }, /* icon configuration */ icon: { /* whether show the icon, false by default */ show: false, /* icon's img address, string type */ // img: 'https://gw.alipayobjects.com/zos/basement_prod/012bcf4f-423b-4922-8c24-32a89f8c41ce.svg', /* icon's size, 20 * 20 by default: */ // width: 40, // height: 40 }, }, /* styles for different states, there are built-in styles for states: active, inactive, selected, highlight, disable */ // nodeStateStyles: { // // node style of active state // active: { // fillOpacity: 0.8, // }, // // node style of selected state // selected: { // lineWidth: 5, // }, // }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-elements/pages/elements/triangle/index.json ================================================ { "navigationBarTitleText": "三角形", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-elements/pages/elements/triangle/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-elements/pages/elements/triangle/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-FA2/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-FA2/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import forceAtlas2 from "@antv/f6-wx/extends/layout/forceAtlas2Layout"; /** * 基本 Force Atlas 2 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("forceAtlas2", forceAtlas2); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "forceAtlas2", preventOverlap: true, kr: 10, center: [250, 250], }, defaultNode: { size: 20, }, }); data.nodes.forEach((node) => { node.x = Math.random() * 1; }); this.graph.on("afterlayout", () => { this.graph.fitView(); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-FA2/index.json ================================================ { "navigationBarTitleText": "力导向布局2", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-FA2/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-FA2/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-MDS/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-MDS/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import mds from "@antv/f6-wx/extends/layout/mdsLayout"; /** * basic-MDS */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-node"], }, layout: { type: "mds", linkDistance: 100, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-MDS/index.json ================================================ { "navigationBarTitleText": "基本降维布局图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-MDS/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-MDS/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-arc-diagram/data.js ================================================ export default { nodes: [ { id: "0", name: "analytics.cluster", cluster: "analytics", value: 21, }, { id: "1", name: "analytics.graph", cluster: "analytics", value: 34, }, { id: "2", name: "analytics.optimization", cluster: "analytics", value: 8, }, { id: "3", name: "animate", cluster: "animate", value: 40, }, { id: "4", name: "animate.interpolate", cluster: "animate", value: 18, }, { id: "5", name: "data.converters", cluster: "data", value: 25, }, { id: "6", name: "data", cluster: "data", value: 10, }, { id: "7", name: "display", cluster: "display", value: 4, }, { id: "8", name: "flex", cluster: "flex", value: 6, }, { id: "9", name: "physics", cluster: "physics", value: 22, }, { id: "10", name: "query", cluster: "query", value: 67, }, { id: "11", name: "query.methods", cluster: "query", value: 71, }, { id: "12", name: "scale", cluster: "scale", value: 33, }, { id: "13", name: "util", cluster: "util", value: 23, }, { id: "14", name: "util.heap", cluster: "util", value: 2, }, { id: "15", cluster: "util", name: "util.math", value: 2, }, { id: "16", name: "util.palette", cluster: "util", value: 5, }, { id: "17", name: "vis.axis", cluster: "vis", value: 24, }, { id: "18", name: "vis.controls", cluster: "vis", value: 28, }, { id: "19", name: "vis.data", cluster: "vis", value: 70, }, { id: "20", name: "vis.data.render", cluster: "vis", value: 11, }, { id: "21", name: "vis.events", cluster: "vis", value: 8, }, { id: "22", name: "vis.legend", cluster: "vis", value: 27, }, { id: "23", name: "vis.operator.distortion", cluster: "vis", value: 9, }, { id: "24", name: "vis.operator.encoder", cluster: "vis", value: 30, }, { id: "25", name: "vis.operator.filter", cluster: "vis", value: 17, }, { id: "26", name: "vis.operator", cluster: "vis", value: 27, }, { id: "27", name: "vis.operator.label", cluster: "vis", value: 18, }, { id: "28", name: "vis.operator.layout", cluster: "vis", value: 91, }, { id: "29", name: "vis", cluster: "vis", value: 13, }, ], edges: [ { source: "10", target: "10", sourceWeight: 61, targetWeight: 61, }, { source: "11", target: "11", sourceWeight: 39, targetWeight: 39, }, { source: "3", target: "3", sourceWeight: 30, targetWeight: 30, }, { source: "19", target: "19", sourceWeight: 26, targetWeight: 26, }, { source: "13", target: "13", sourceWeight: 23, targetWeight: 23, }, { source: "9", target: "9", sourceWeight: 22, targetWeight: 22, }, { source: "12", target: "12", sourceWeight: 19, targetWeight: 19, }, { source: "28", target: "19", sourceWeight: 34, targetWeight: 0, }, { source: "4", target: "4", sourceWeight: 16, targetWeight: 16, }, { source: "11", target: "10", sourceWeight: 32, targetWeight: 0, }, { source: "28", target: "28", sourceWeight: 14, targetWeight: 14, }, { source: "18", target: "18", sourceWeight: 12, targetWeight: 12, }, { source: "26", target: "26", sourceWeight: 11, targetWeight: 11, }, { source: "28", target: "13", sourceWeight: 20, targetWeight: 0, }, { source: "5", target: "6", sourceWeight: 17, targetWeight: 2, }, { source: "19", target: "13", sourceWeight: 17, targetWeight: 0, }, { source: "17", target: "17", sourceWeight: 7, targetWeight: 7, }, { source: "6", target: "6", sourceWeight: 7, targetWeight: 7, }, { source: "12", target: "13", sourceWeight: 14, targetWeight: 0, }, { source: "1", target: "19", sourceWeight: 14, targetWeight: 0, }, { source: "5", target: "5", sourceWeight: 7, targetWeight: 7, }, { source: "21", target: "19", sourceWeight: 6, targetWeight: 4, }, { source: "25", target: "19", sourceWeight: 10, targetWeight: 0, }, { source: "0", target: "0", sourceWeight: 5, targetWeight: 5, }, { source: "3", target: "13", sourceWeight: 9, targetWeight: 0, }, { source: "20", target: "19", sourceWeight: 5, targetWeight: 4, }, { source: "19", target: "12", sourceWeight: 9, targetWeight: 0, }, { source: "0", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "24", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "22", target: "22", sourceWeight: 4, targetWeight: 4, }, { source: "24", target: "24", sourceWeight: 4, targetWeight: 4, }, { source: "26", target: "3", sourceWeight: 7, targetWeight: 0, }, { source: "24", target: "16", sourceWeight: 7, targetWeight: 0, }, { source: "16", target: "16", sourceWeight: 3, targetWeight: 3, }, { source: "10", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "7", target: "7", sourceWeight: 3, targetWeight: 3, }, { source: "22", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "20", target: "20", sourceWeight: 3, targetWeight: 3, }, { source: "1", target: "26", sourceWeight: 6, targetWeight: 0, }, { source: "27", target: "19", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "12", sourceWeight: 6, targetWeight: 0, }, { source: "22", target: "7", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "3", sourceWeight: 6, targetWeight: 0, }, { source: "17", target: "7", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "27", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "3", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "29", sourceWeight: 3, targetWeight: 2, }, { source: "22", target: "16", sourceWeight: 5, targetWeight: 0, }, { source: "18", target: "21", sourceWeight: 4, targetWeight: 0, }, { source: "22", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "23", target: "23", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "29", sourceWeight: 2, targetWeight: 2, }, { source: "28", target: "17", sourceWeight: 4, targetWeight: 0, }, { source: "15", target: "15", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "27", target: "27", sourceWeight: 2, targetWeight: 2, }, { source: "14", target: "14", sourceWeight: 2, targetWeight: 2, }, { source: "18", target: "29", sourceWeight: 3, targetWeight: 1, }, { source: "25", target: "26", sourceWeight: 3, targetWeight: 0, }, { source: "28", target: "9", sourceWeight: 3, targetWeight: 0, }, { source: "27", target: "7", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "12", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "18", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "20", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "19", target: "6", sourceWeight: 3, targetWeight: 0, }, { source: "29", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "25", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "28", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "24", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "16", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "21", sourceWeight: 2, targetWeight: 0, }, { source: "21", target: "21", sourceWeight: 1, targetWeight: 1, }, { source: "29", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "4", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "8", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "2", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "1", sourceWeight: 1, targetWeight: 1, }, { source: "23", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "23", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "0", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "21", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "3", target: "4", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "26", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "17", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "5", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "12", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "20", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "21", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "6", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "1", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "6", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "25", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "7", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "0", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "19", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "29", sourceWeight: 1, targetWeight: 0, }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-arc-diagram/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import mds from "@antv/f6-wx/extends/layout/mdsLayout"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 定义颜色 const colors = [ "rgb(91, 143, 249)", "rgb(90, 216, 166)", "rgb(93, 112, 146)", "rgb(246, 189, 22)", "rgb(232, 104, 74)", "rgb(109, 200, 236)", "rgb(146, 112, 202)", "rgb(255, 157, 77)", "rgb(38, 154, 153)", "rgb(227, 137, 163)", ]; // 后面会用到的函数 function scaleNodeProp(nodes, propName, refPropName, dataRange, outRange) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; nodes.forEach((n) => { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; }); } // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = `source: ${model.sourceName}
target: ${model.targetName}`; return text; }, }, ], }, defaultNode: { style: { opacity: 0.8, lineWidth: 1, stroke: "#999", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { opacity: 0.6, lineAppendWidth: 3, }, }, }); // 订阅事件 this.graph.on("edge:mouseenter", function (e) { const edge = e.item; this.graph.setItemState(edge, "hover", true); }); this.graph.on("edge:mouseleave", function (e) { const edge = e.item; this.graph.setItemState(edge, "hover", false); }); // 处理数据 const { edges } = data; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; const n = nodes.length; const horiPadding = 10; const begin = [horiPadding, height * 0.7]; const end = [width - horiPadding, height * 0.7]; const xLength = end[0] - begin[0]; const yLength = end[1] - begin[1]; const xSep = xLength / n; const ySep = yLength / n; nodes.forEach((node, i) => { node.x = begin[0] + i * xSep; node.y = begin[1] + i * ySep; nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const id = clusterMap.get(node.cluster); if (node.style) { node.style.fill = colors[id % colors.length]; } else { node.style = { fill: colors[id % colors.length], }; } // label node.label = node.name; node.labelCfg = { position: "bottom", offset: 5, style: { rotate: Math.PI / 2, textAlign: "start", }, }; }); edges.forEach((edge) => { edge.type = "arc"; const source = nodeMap.get(edge.source); const target = nodeMap.get(edge.target); const endsSepStep = (target.x - source.x) / xSep; const sign = endsSepStep < 0 ? -1 : 1; const curveOffset = sign * 10 * Math.ceil(Math.abs(endsSepStep)); edge.curveOffset = curveOffset; edge.color = source.style.fill; edge.sourceName = source.name; edge.targetName = target.name; }); // map the value to node size let maxValue = -9999; let minValue = 9999; nodes.forEach((k) => { if (maxValue < k.value) maxValue = k.value; if (minValue > k.value) minValue = k.value; }); const sizeRange = [3, 25]; const sizeDataRange = [minValue, maxValue]; scaleNodeProp(nodes, "size", "value", sizeDataRange, sizeRange); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-arc-diagram/index.json ================================================ { "navigationBarTitleText": "基本弧线图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-arc-diagram/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-arc-diagram/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-circular/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; /** * basicCircular布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-circular/index.json ================================================ { "navigationBarTitleText": "基本环形布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-circular/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-circular/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-combo-force/data.js ================================================ export default () => ({ nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-combo-force/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import comboforce from "@antv/f6-wx/extends/layout/comboForceLayout"; /** * basic-combo-force */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("comboforce", comboforce); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, minZoom: 0.00000001, layout: { type: "comboforce", nodeSpacing: (d) => { if (d.id == "0") return 100; return 10; }, }, defaultNode: { size: 15, color: "#5B8FF9", style: { lineWidth: 2, fill: "#C6E5FF", }, }, defaultEdge: { size: 2, color: "#e2e2e2", }, modes: { default: ["drag-combo", "drag-node", "drag-canvas", "zoom-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-combo-force/index.json ================================================ { "navigationBarTitleText": "Combo力导向布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-combo-force/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-combo-force/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-concentric/data.js ================================================ export default { nodes: [ { id: "HIRA", altered: 0, rank: 148, cited: 53, uniprotdesc: "Cooperates with ASF1A to promote replication-independentchromatin assembly. Required for the periodic repression ofhistone gene transcription during the cell cycle. Required for theformation of senescence-associated heterochromatin foci (SAHF) andefficient senescence-associated cell cycle exit.", isseed: false, uniprot: "P54198", isvalid: true, importance: 3, ox: 539.5, oy: 641.7372431003224, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SERPINE1", altered: 0, rank: 5, cited: 7063, uniprotdesc: "Serine protease inhibitor. This inhibitor acts as 'bait'for tissue plasminogen activator, urokinase, protein C andmatriptase-3/TMPRSS7. Its rapid interaction with PLAT may functionas a major control point in the regulation of fibrinolysis.", isseed: false, uniprot: "P05121", isvalid: true, importance: 3, ox: 670.4301869950953, oy: 229.70989985711336, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FAS", altered: 0, rank: 38, cited: 1011, uniprotdesc: "Receptor for TNFSF6/FASLG. The adapter molecule FADDrecruits caspase-8 to the activated receptor. The resulting death-inducing signaling complex (DISC) performs caspase-8 proteolyticactivation which initiates the subsequent cascade of caspases(aspartate-specific cysteine proteases) mediating apoptosis. FAS-mediated apoptosis may have a role in the induction of peripheraltolerance, in the antigen-stimulated suicide of mature T-cells, orboth. The secreted isoforms 2 to 6 block apoptosis (in vitro).", isseed: false, uniprot: "P25445", isvalid: true, importance: 3, ox: 771.3915110914829, oy: 613.8066148172879, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "H1F0", altered: 0, rank: 179, cited: 8, uniprotdesc: "Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structures. The H1F0 histonesare found in cells that are in terminal stages of differentiationor that have low rates of cell division.", isseed: false, uniprot: "P07305", isvalid: true, importance: 3, ox: 396.564243092928, oy: 545.1295331255458, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2", altered: 0, rank: 42, cited: 859, uniprotdesc: "Serine/threonine-protein kinase which is required forcheckpoint-mediated cell cycle arrest, activation of DNA repairand apoptosis in response to the presence of DNA double-strandbreaks. May also negatively regulate cell cycle progression duringunperturbed cell cycles. Following activation, phosphorylatesnumerous effectors preferentially at the consensus sequence [L-X-R-X-X-S/T]. Regulates cell cycle checkpoint arrest throughphosphorylation of CDC25A, CDC25B and CDC25C, inhibiting theiractivity. Inhibition of CDC25 phosphatase activity leads toincreased inhibitory tyrosine phosphorylation of CDK-cyclincomplexes and blocks cell cycle progression. May alsophosphorylate NEK6 which is involved in G2/M cell cycle arrest.Regulates DNA repair through phosphorylation of BRCA2, enhancingthe association of RAD51 with chromatin which promotes DNA repairby homologous recombination. Also stimulates the transcription ofgenes involved in DNA repair (including BRCA2) through thephosphorylation and activation of the transcription factor FOXM1.Regulates apoptosis through the phosphorylation of p53/TP53, MDM4and PML. Phosphorylation of p53/TP53 at 'Ser-20' by CHEK2 mayalleviate inhibition by MDM2, leading to accumulation of activep53/TP53. Phosphorylation of MDM4 may also reduce degradation ofp53/TP53. Also controls the transcription of pro-apoptotic genesthrough phosphorylation of the transcription factor E2F1. Tumorsuppressor, it may also have a DNA damage-independent function inmitotic spindle assembly by phosphorylating BRCA1. Its absence maybe a cause of the chromosomal instability observed in some cancercells. ", isseed: false, uniprot: "O96017", isvalid: true, importance: 3, ox: 665.61605725324, oy: 327.88536532731405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "COL18A1", altered: 0, rank: 157, cited: 30, uniprotdesc: "COLA18A probably plays a major role in determining theretinal structure as well as in the closure of the neural tube.Endostatin potently inhibits endothelial cellproliferation and angiogenesis. May inhibit angiogenesis bybinding to the heparan sulfate proteoglycans involved in growthfactor signaling.", isseed: false, uniprot: "P39060", isvalid: true, importance: 3, ox: 315.495548442639, oy: 356.3503242429216, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP", altered: 0, rank: 24, cited: 2442, uniprotdesc: "Acetylates histones, giving a specific tag fortranscriptional activation. Also acetylates non-histone proteins,like NCOA3 and FOXO1. Binds specifically to phosphorylated CREBand enhances its transcriptional activity toward cAMP-responsivegenes. Acts as a coactivator of ALX1 in the presence of EP300.Acts as a circadian transcriptional coactivator which enhances theactivity of the circadian transcriptional activators: NPAS2-ARNTL/BMAL1 and CLOCK-ARNTL/BMAL1 heterodimers.", isseed: false, uniprot: "Q92793", isvalid: true, importance: 3, ox: 468.2392322240752, oy: 311.08612174318614, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FDXR", altered: 0, rank: 147, cited: 54, uniprotdesc: "Serves as the first electron transfer protein in all themitochondrial P450 systems. Including cholesterol side chaincleavage in all steroidogenic tissues, steroid 11-betahydroxylation in the adrenal cortex, 25-OH-vitamin D3-24hydroxylation in the kidney, and sterol C-27 hydroxylation in theliver.", isseed: false, uniprot: "P22570", isvalid: true, importance: 3, ox: 614.0116881932149, oy: 209.57981996234878, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SMYD2", altered: 0, rank: 175, cited: 12, uniprotdesc: "Protein-lysine N-methyltransferase that methylates bothhistones and non-histone proteins, including p53/TP53 and RB1.Specifically methylates histone H3 'Lys-4' (H3K4me) anddimethylates histone H3 'Lys-36' (H3K36me2). Shows even highermethyltransferase activity on p53/TP53. Monomethylates 'Lys-370'of p53/TP53, leading to decreased DNA-binding activity andsubsequent transcriptional regulation activity of p53/TP53.Monomethylates RB1 at 'Lys-860'. ", isseed: false, uniprot: "Q9NRG4", isvalid: true, importance: 3, ox: 799.3458853307084, oy: 560.8271840491047, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR", altered: 0, rank: 52, cited: 628, uniprotdesc: "Serine/threonine protein kinase which activatescheckpoint signaling upon genotoxic stresses such as ionizingradiation (IR), ultraviolet light (UV), or DNA replicationstalling, thereby acting as a DNA damage sensor. Recognizes thesubstrate consensus sequence [ST]-Q. Phosphorylates BRCA1, CHEK1,MCM2, RAD17, RPA2, SMC1 and p53/TP53, which collectively inhibitDNA replication and mitosis and promote DNA repair, recombinationand apoptosis. Phosphorylates 'Ser-139' of histone variantH2AX/H2AFX at sites of DNA damage, thereby regulating DNA damageresponse mechanism. Required for FANCD2 ubiquitination. Criticalfor maintenance of fragile site stability and efficient regulationof centrosome duplication. ", isseed: false, uniprot: "Q13535", isvalid: true, importance: 3, ox: 696.7065384003552, oy: 570.6754072575451, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HGF", altered: 0, rank: 4, cited: 7554, uniprotdesc: "Potent mitogen for mature parenchymal hepatocyte cells,seems to be a hepatotrophic factor, and acts as a growth factorfor a broad spectrum of tissues and cell types. Activating ligandfor the receptor tyrosine kinase MET by binding to it andpromoting its dimerization. ", isseed: false, uniprot: "P14210", isvalid: true, importance: 3, ox: 732.163947642761, oy: 659.0776363377252, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM", altered: 0, rank: 25, cited: 2298, uniprotdesc: "Serine/threonine protein kinase which activatescheckpoint signaling upon double strand breaks (DSBs), apoptosisand genotoxic stresses such as ionizing ultraviolet A light (UVA),thereby acting as a DNA damage sensor. Recognizes the substrateconsensus sequence [ST]-Q. Phosphorylates 'Ser-139' of histonevariant H2AX/H2AFX at double strand breaks (DSBs), therebyregulating DNA damage response mechanism. Also plays a role inpre-B cell allelic exclusion, a process leading to expression of asingle immunoglobulin heavy chain allele to enforce clonality andmonospecific recognition by the B-cell antigen receptor (BCR)expressed on individual B-lymphocytes. After the introduction ofDNA breaks by the RAG complex on one immunoglobulin allele, actsby mediating a repositioning of the second allele topericentromeric heterochromatin, preventing accessibility to theRAG complex and recombination of the second allele. Also involvedin signal transduction and cell cycle control. May function as atumor suppressor. Necessary for activation of ABL1 and SAPK.Phosphorylates DYRK2, CHEK2, p53/TP53, FANCD2, NFKBIA, BRCA1,CTIP, nibrin (NBN), TERF1, RAD9 and DCLRE1C. May play a role invesicle and/or protein transport. Could play a role in T-celldevelopment, gonad and neurological function. Plays a role inreplication-dependent histone mRNA degradation. Binds DNA ends.Phosphorylation of DYRK2 in nucleus in response to genotoxicstress prevents its MDM2-mediated ubiquitination and subsequentproteasome degradation. Phosphorylates ATF2 which stimulates itsfunction in DNA damage response. ", isseed: false, uniprot: "Q13315", isvalid: true, importance: 3, ox: 723.6214512404813, oy: 517.2928623066505, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP63", altered: 0, rank: 37, cited: 1171, uniprotdesc: "Acts as a sequence specific DNA binding transcriptionalactivator or repressor. The isoforms contain a varying set oftransactivation and auto-regulating transactivation inhibitingdomains thus showing an isoform specific activity. Isoform 2activates RIPK4 transcription. May be required in conjunction withTP73/p73 for initiation of p53/TP53 dependent apoptosis inresponse to genotoxic insults and the presence of activatedoncogenes. Involved in Notch signaling by probably inducing JAG1and JAG2. Plays a role in the regulation of epithelialmorphogenesis. The ratio of DeltaN-type and TA*-type isoforms maygovern the maintenance of epithelial stem cell compartments andregulate the initiation of epithelial stratification from theundifferentiated embryonal ectoderm. Required for limb formationfrom the apical ectodermal ridge. Activates transcription of thep21 promoter. ", isseed: false, uniprot: "Q9H3D4", isvalid: true, importance: 3, ox: 554.5, oy: 495.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GPX1", altered: 0, rank: 13, cited: 3644, uniprotdesc: "Protects the hemoglobin in erythrocytes from oxidativebreakdown.", isseed: false, uniprot: "P07203", isvalid: true, importance: 3, ox: 412.4474306913114, oy: 244.4618875964815, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TRIAP1", altered: 0, rank: 183, cited: 7, uniprotdesc: "Involved in the modulation of the mitochondrialapoptotic pathway by ensuring the accumulation of cardiolipin (CL)in mitochondrial membranes. In vitro, the TRIAP1:PRELID1 complexmediates the transfer of phosphatidic acid (PA) between liposomesand probably functions as a PA transporter across themitochondrion intermembrane space to provide PA for CL synthesisin the inner membrane. Mediates cell survival by inhibitingactivation of caspase-9 which prevents induction of apoptosis.", isseed: false, uniprot: "O43715", isvalid: true, importance: 3, ox: 554.5, oy: 202.751489857487, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1E", altered: 0, rank: 167, cited: 19, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P10412", isvalid: true, importance: 3, ox: 509.931522689569, oy: 636.667218490667, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1D", altered: 0, rank: 184, cited: 6, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16402", isvalid: true, importance: 3, ox: 385.3785487595187, oy: 517.2928623066505, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1C", altered: 0, rank: 174, cited: 13, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16403", isvalid: true, importance: 3, ox: 379.058170659647, oy: 487.9662051382201, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1B", altered: 0, rank: 96, cited: 209, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "P16401", isvalid: true, importance: 3, ox: 381.59546915616875, oy: 428.2362230943135, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIST1H1A", altered: 0, rank: 173, cited: 13, uniprotdesc: "Histone H1 protein binds to linker DNA betweennucleosomes forming the macromolecular structure known as thechromatin fiber. Histones H1 are necessary for the condensation ofnucleosome chains into higher-order structured fibers. Acts alsoas a regulator of individual gene transcription through chromatinremodeling, nucleosome spacing and DNA methylation (Bysimilarity). ", isseed: false, uniprot: "Q02539", isvalid: true, importance: 3, ox: 443.3839427467599, oy: 327.88536532731405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53", altered: 0, rank: 0, cited: 24824, uniprotdesc: "Acts as a tumor suppressor in many tumor types; inducesgrowth arrest or apoptosis depending on the physiologicalcircumstances and cell type. Involved in cell cycle regulation asa trans-activator that acts to negatively regulate cell divisionby controlling a set of genes required for this process. One ofthe activated genes is an inhibitor of cyclin-dependent kinases.Apoptosis induction seems to be mediated either by stimulation ofBAX and FAS antigen expression, or by repression of Bcl-2expression. In cooperation with mitochondrial PPIF is involved inactivating oxidative stress-induced necrosis; the function islargely independent of transcription. Induces the transcription oflong intergenic non-coding RNA p21 (lincRNA-p21) and lincRNA-Mkln1. LincRNA-p21 participates in TP53-dependent transcriptionalrepression leading to apoptosis and seem to have to effect oncell-cycle regulation. Implicated in Notch signaling cross-over.Prevents CDK7 kinase activity when associated to CAK complex inresponse to DNA damage, thus stopping cell cycle progression.Isoform 2 enhances the transactivation activity of isoform 1 fromsome but not all TP53-inducible promoters. Isoform 4 suppressestransactivation activity and impairs growth suppression mediatedby isoform 1. Isoform 7 inhibits isoform 1-mediated apoptosis.", isseed: true, uniprot: "P04637", isvalid: true, importance: 4, ox: 554.5, oy: 465.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GADD45A", altered: 0, rank: 98, cited: 198, uniprotdesc: "In T-cells, functions as a regulator of p38 MAPKs byinhibiting p88 phosphorylation and activity (By similarity). Mightaffect PCNA interaction with some CDK (cell division proteinkinase) complexes; stimulates DNA excision repair in vitro andinhibits entry of cells into S phase. ", isseed: false, uniprot: "P24522", isvalid: true, importance: 3, ox: 554.5, oy: 375.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML", altered: 0, rank: 35, cited: 1300, uniprotdesc: "Functions via its association with PML-nuclear bodies(PML-NBs) in a wide range of important cellular processes,including tumor suppression, transcriptional regulation,apoptosis, senescence, DNA damage response, and viral defensemechanisms. Acts as the scaffold of PML-NBs allowing otherproteins to shuttle in and out, a process which is regulated bySUMO-mediated modifications and interactions. Isoform PML-4 has amultifaceted role in the regulation of apoptosis and growthsuppression: activates RB1 and inhibits AKT1 via interactions withPP1 and PP2A phosphatases respectively, negatively affects thePI3K pathway by inhibiting MTOR and activating PTEN, andpositively regulates p53/TP53 by acting at different levels (bypromoting its acetylation and phosphorylation and by inhibitingits MDM2-dependent degradation). Isoform PML-4 also: acts as atranscriptional repressor of TBX2 during cellular senescence andthe repression is dependent on a functional RBL2/E2F4 repressorcomplex, regulates double-strand break repair in gamma-irradiation-induced DNA damage responses via its interaction withWRN, acts as a negative regulator of telomerase by interactingwith TERT, and regulates PER2 nuclear localization and circadianfunction. Isoform PML-6 inhibits specifically the activity of thetetrameric form of PKM. The nuclear isoforms (isoform PML-1,isoform PML-2, isoform PML-3, isoform PML-4 and isoform PML-5) inconcert with SATB1 are involved in local chromatin-loop remodelingand gene expression regulation at the MHC-I locus. Isoform PML-2is required for efficient IFN-gamma induced MHC II genetranscription via regulation of CIITA. Cytoplasmic PML is involvedin the regulation of the TGF-beta signaling pathway. PML alsoregulates transcription activity of ELF4 and can act as animportant mediator for TNF-alpha- and IFN-alpha-mediatedinhibition of endothelial cell network formation and migration.Exhibits antiviral activity against both DNA and RNAviruses. The antiviral activity can involve one or severalisoform(s) and can be enhanced by the permanent PML-NB-associatedprotein DAXX or by the recruitment of p53/TP53 within thesestructures. Isoform PML-4 restricts varicella zoster virus (VZV)via sequestration of virion capsids in PML-NBs thereby preventingtheir nuclear egress and inhibiting formation of infectious virusparticles. The sumoylated isoform PML-4 restricts rabies virus byinhibiting viral mRNA and protein synthesis. The cytoplasmicisoform PML-14 can restrict herpes simplex virus-1 (HHV-1)replication by sequestering the viral E3 ubiquitin-protein ligaseICP0 in the cytoplasm. Isoform PML-6 shows restriction activitytowards human cytomegalovirus (HCMV) and influenza A virus strainsPR8(H1N1) and ST364(H3N2). Sumoylated isoform PML-4 and isoformPML-12 show antiviral activity against encephalomyocarditis virus(EMCV) by promoting nuclear sequestration of viral polymerase(P3D-POL) within PML NBs. Isoform PML-3 exhibits antiviralactivity against poliovirus by inducing apoptosis in infectedcells through the recruitment and the activation of p53/TP53 inthe PML-NBs. Isoform PML-3 represses human foamy virus (HFV)transcription by complexing the HFV transactivator, bel1/tas,preventing its binding to viral DNA. PML may positively regulateinfectious hepatitis C viral (HCV) production and isoform PML-2may enhance adenovirus transcription.", isseed: false, uniprot: "P29590", isvalid: true, importance: 3, ox: 554.5, oy: 555.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1", altered: 0, rank: 36, cited: 1235, uniprotdesc: "Ubiquitin-like protein that can be covalently attachedto proteins as a monomer or a lysine-linked polymer. Covalentattachment via an isopeptide bond to its substrates requires prioractivation by the E1 complex SAE1-SAE2 and linkage to the E2enzyme UBE2I, and can be promoted by E3 ligases such as PIAS1-4,RANBP2 or CBX4. This post-translational modification on lysineresidues of proteins plays a crucial role in a number of cellularprocesses such as nuclear transport, DNA replication and repair,mitosis and signal transduction. Involved for instance intargeting RANGAP1 to the nuclear pore complex protein RANBP2.Polymeric SUMO1 chains are also susceptible to polyubiquitinationwhich functions as a signal for proteasomal degradation ofmodified proteins. May also regulate a network of genes involvedin palate development. ", isseed: false, uniprot: "P63165", isvalid: true, importance: 3, ox: 554.5, oy: 288.62556472004735, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA", altered: 0, rank: 146, cited: 55, uniprotdesc: "PP2A is the major phosphatase for microtubule-associatedproteins (MAPs). PP2A can modulate the activity of phosphorylase Bkinase casein kinase 2, mitogen-stimulated S6 kinase, and MAP-2kinase. Cooperates with SGOL2 to protect centromeric cohesin fromseparase-mediated cleavage in oocytes specifically during meiosisI (By similarity). Can dephosphorylate SV40 large T antigen andp53/TP53. Activates RAF1 by dephosphorylating it at 'Ser-259'.", isseed: false, uniprot: "P67775", isvalid: true, importance: 3, ox: 727.4045308438311, oy: 428.2362230943131, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB", altered: 0, rank: 185, cited: 6, uniprotdesc: "PP2A can modulate the activity of phosphorylase B kinasecasein kinase 2, mitogen-stimulated S6 kinase, and MAP-2 kinase.", isseed: false, uniprot: "P62714", isvalid: true, importance: 3, ox: 584.3919246562758, oy: 291.16974245431265, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1", altered: 0, rank: 78, cited: 330, uniprotdesc: "Catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Regulates lipid synthesis byphosphorylating and inactivating lipid metabolic enzymes such asACACA, ACACB, GYS1, HMGCR and LIPE; regulates fatty acid andcholesterol synthesis by phosphorylating acetyl-CoA carboxylase(ACACA and ACACB) and hormone-sensitive lipase (LIPE) enzymes,respectively. Regulates insulin-signaling and glycolysis byphosphorylating IRS1, PFKFB2 and PFKFB3. AMPK stimulates glucoseuptake in muscle by increasing the translocation of the glucosetransporter SLC2A4/GLUT4 to the plasma membrane, possibly bymediating phosphorylation of TBC1D4/AS160. Regulates transcriptionand chromatin structure by phosphorylating transcriptionregulators involved in energy metabolism such as CRTC2/TORC2,FOXO3, histone H2B, HDAC5, MEF2C, MLXIPL/ChREBP, EP300, HNF4A,p53/TP53, SREBF1, SREBF2 and PPARGC1A. Acts as a key regulator ofglucose homeostasis in liver by phosphorylating CRTC2/TORC2,leading to CRTC2/TORC2 sequestration in the cytoplasm. In responseto stress, phosphorylates 'Ser-36' of histone H2B (H2BS36ph),leading to promote transcription. Acts as a key regulator of cellgrowth and proliferation by phosphorylating TSC2, RPTOR andATG1/ULK1: in response to nutrient limitation, negativelyregulates the mTORC1 complex by phosphorylating RPTOR component ofthe mTORC1 complex and by phosphorylating and activating TSC2. Inresponse to nutrient limitation, promotes autophagy byphosphorylating and activating ATG1/ULK1. AMPK also acts as aregulator of circadian rhythm by mediating phosphorylation ofCRY1, leading to destabilize it. May regulate the Wnt signalingpathway by phosphorylating CTNNB1, leading to stabilize it. Alsohas tau-protein kinase activity: in response to amyloid beta A4protein (APP) exposure, activated by CAMKK2, leading tophosphorylation of MAPT/TAU; however the relevance of such dataremains unclear in vivo. Also phosphorylates CFTR, EEF2K, KLC1,NOS3 and SLC12A1. ", isseed: false, uniprot: "Q13131", isvalid: true, importance: 3, ox: 731.2150654362375, oy: 457.9932361520795, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2", altered: 0, rank: 29, cited: 2074, uniprotdesc: "Catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Regulates lipid synthesis byphosphorylating and inactivating lipid metabolic enzymes such asACACA, ACACB, GYS1, HMGCR and LIPE; regulates fatty acid andcholesterol synthesis by phosphorylating acetyl-CoA carboxylase(ACACA and ACACB) and hormone-sensitive lipase (LIPE) enzymes,respectively. Regulates insulin-signaling and glycolysis byphosphorylating IRS1, PFKFB2 and PFKFB3. AMPK stimulates glucoseuptake in muscle by increasing the translocation of the glucosetransporter SLC2A4/GLUT4 to the plasma membrane, possibly bymediating phosphorylation of TBC1D4/AS160. Regulates transcriptionand chromatin structure by phosphorylating transcriptionregulators involved in energy metabolism such as CRTC2/TORC2,FOXO3, histone H2B, HDAC5, MEF2C, MLXIPL/ChREBP, EP300, HNF4A,p53/TP53, SREBF1, SREBF2 and PPARGC1A. Acts as a key regulator ofglucose homeostasis in liver by phosphorylating CRTC2/TORC2,leading to CRTC2/TORC2 sequestration in the cytoplasm. In responseto stress, phosphorylates 'Ser-36' of histone H2B (H2BS36ph),leading to promote transcription. Acts as a key regulator of cellgrowth and proliferation by phosphorylating TSC2, RPTOR andATG1/ULK1: in response to nutrient limitation, negativelyregulates the mTORC1 complex by phosphorylating RPTOR component ofthe mTORC1 complex and by phosphorylating and activating TSC2. Inresponse to nutrient limitation, promotes autophagy byphosphorylating and activating ATG1/ULK1. AMPK also acts as aregulator of circadian rhythm by mediating phosphorylation ofCRY1, leading to destabilize it. May regulate the Wnt signalingpathway by phosphorylating CTNNB1, leading to stabilize it. Alsophosphorylates CFTR, EEF2K, KLC1, NOS3 and SLC12A1.", isseed: false, uniprot: "P54646", isvalid: true, importance: 3, ox: 613.4239130642807, oy: 298.7290842958664, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11", altered: 0, rank: 127, cited: 81, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK11 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors. Accordingly, p38 MAPKsphosphorylate a broad range of proteins and it has been estimatedthat they may have approximately 200 to 300 substrates each.MAPK11 functions are mostly redundant with those of MAPK14. Someof the targets are downstream kinases which are activated throughphosphorylation and further phosphorylate additional targets.RPS6KA5/MSK1 and RPS6KA4/MSK2 can directly phosphorylate andactivate transcription factors such as CREB1, ATF1, the NF-kappa-Bisoform RELA/NFKB3, STAT1 and STAT3, but can also phosphorylatehistone H3 and the nucleosomal protein HMGN1. RPS6KA5/MSK1 andRPS6KA4/MSK2 play important roles in the rapid induction ofimmediate-early genes in response to stress or mitogenic stimuli,either by inducing chromatin remodeling or by recruiting thetranscription machinery. On the other hand, two other kinasetargets, MAPKAPK2/MK2 and MAPKAPK3/MK3, participate in the controlof gene expression mostly at the post-transcriptional level, byphosphorylating ZFP36 (tristetraprolin) and ELAVL1, and byregulating EEF2K, which is important for the elongation of mRNAduring translation. MKNK1/MNK1 and MKNK2/MNK2, two other kinasesactivated by p38 MAPKs, regulate protein synthesis byphosphorylating the initiation factor EIF4E2. In the cytoplasm,the p38 MAPK pathway is an important regulator of proteinturnover. For example, CFLAR is an inhibitor of TNF-inducedapoptosis whose proteasome-mediated degradation is regulated byp38 MAPK phosphorylation. Ectodomain shedding of transmembraneproteins is regulated by p38 MAPKs as well. In response toinflammatory stimuli, p38 MAPKs phosphorylate the membrane-associated metalloprotease ADAM17. Such phosphorylation isrequired for ADAM17-mediated ectodomain shedding of TGF-alphafamily ligands, which results in the activation of EGFR signalingand cell proliferation. Additional examples of p38 MAPK substratesare the FGFR1. FGFR1 can be translocated from the extracellularspace into the cytosol and nucleus of target cells, and regulatesprocesses such as rRNA synthesis and cell growth. FGFR1translocation requires p38 MAPK activation. In the nucleus, manytranscription factors are phosphorylated and activated by p38MAPKs in response to different stimuli. Classical examples includeATF1, ATF2, ATF6, ELK1, PTPRH, DDIT3, TP53/p53 and MEF2C andMEF2A. The p38 MAPKs are emerging as important modulators of geneexpression by regulating chromatin modifiers and remodelers. Thepromoters of several genes involved in the inflammatory response,such as IL6, IL8 and IL12B, display a p38 MAPK-dependentenrichment of histone H3 phosphorylation on 'Ser-10' (H3S10ph) inLPS-stimulated myeloid cells. This phosphorylation enhances theaccessibility of the cryptic NF-kappa-B-binding sites markingpromoters for increased NF-kappa-B recruitment.", isseed: false, uniprot: "Q15759", isvalid: true, importance: 3, ox: 640.7607677759248, oy: 311.0861217431862, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP73", altered: 0, rank: 116, cited: 124, uniprotdesc: "Participates in the apoptotic response to DNA damage.Isoforms containing the transactivation domain are pro-apoptotic,isoforms lacking the domain are anti-apoptotic and block thefunction of p53 and transactivating p73 isoforms. May be a tumorsuppressor protein. ", isseed: false, uniprot: "O15350", isvalid: true, importance: 3, ox: 554.5, oy: 435.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CCNB1", altered: 0, rank: 62, cited: 491, uniprotdesc: "Essential for the control of the cell cycle at the G2/M(mitosis) transition. ", isseed: false, uniprot: "P14635", isvalid: true, importance: 3, ox: 455.45477593090067, oy: 612.0421763339963, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12", altered: 0, rank: 131, cited: 79, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK12 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors such as ELK1 and ATF2.Accordingly, p38 MAPKs phosphorylate a broad range of proteins andit has been estimated that they may have approximately 200 to 300substrates each. Some of the targets are downstream kinases suchas MAPKAPK2, which are activated through phosphorylation andfurther phosphorylate additional targets. Plays a role in myoblastdifferentiation and also in the down-regulation of cyclin D1 inresponse to hypoxia in adrenal cells suggesting MAPK12 may inhibitcell proliferation while promoting differentiation. PhosphorylatesDLG1. Following osmotic shock, MAPK12 in the cell nucleusincreases its association with nuclear DLG1, thereby causingdissociation of DLG1-SFPQ complexes. This function is independentof its catalytic activity and could affect mRNA processing and/orgene transcription to aid cell adaptation to osmolarity changes inthe environment. Regulates UV-induced checkpoint signaling andrepair of UV-induced DNA damage and G2 arrest after gamma-radiation exposure. MAPK12 is involved in the regulation of SLC2A1expression and basal glucose uptake in L6 myotubes; and negativelyregulates SLC2A4 expression and contraction-mediated glucoseuptake in adult skeletal muscle. C-Jun (JUN) phosphorylation isstimulated by MAPK14 and inhibited by MAPK12, leading to adistinct AP-1 regulation. MAPK12 is required for the normalkinetochore localization of PLK1, prevents chromosomal instabilityand supports mitotic cell viability. MAPK12-signaling is alsopositively regulating the expansion of transient amplifyingmyogenic precursor cells during muscle growth and regeneration.", isseed: false, uniprot: "P53778", isvalid: true, importance: 3, ox: 569.5000000000001, oy: 641.7372431003224, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13", altered: 0, rank: 126, cited: 88, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK13 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors such as ELK1 and ATF2.Accordingly, p38 MAPKs phosphorylate a broad range of proteins andit has been estimated that they may have approximately 200 to 300substrates each. MAPK13 is one of the less studied p38 MAPKisoforms. Some of the targets are downstream kinases such asMAPKAPK2, which are activated through phosphorylation and furtherphosphorylate additional targets. Plays a role in the regulationof protein translation by phosphorylating and inactivating EEF2K.Involved in cytoskeletal remodeling through phosphorylation ofMAPT and STMN1. Mediates UV irradiation induced up-regulation ofthe gene expression of CXCL14. Plays an important role in theregulation of epidermal keratinocyte differentiation, apoptosisand skin tumor development. Phosphorylates the transcriptionalactivator MYB in response to stress which leads to rapid MYBdegradation via a proteasome-dependent pathway. MAPK13 alsophosphorylates and down-regulates PRKD1 during regulation ofinsulin secretion in pancreatic beta cells.", isseed: false, uniprot: "O15264", isvalid: true, importance: 3, ox: 687.2747400718758, oy: 348.6435313966404, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14", altered: 0, rank: 23, cited: 2528, uniprotdesc: "Serine/threonine kinase which acts as an essentialcomponent of the MAP kinase signal transduction pathway. MAPK14 isone of the four p38 MAPKs which play an important role in thecascades of cellular responses evoked by extracellular stimulisuch as proinflammatory cytokines or physical stress leading todirect activation of transcription factors. Accordingly, p38 MAPKsphosphorylate a broad range of proteins and it has been estimatedthat they may have approximately 200 to 300 substrates each. Someof the targets are downstream kinases which are activated throughphosphorylation and further phosphorylate additional targets.RPS6KA5/MSK1 and RPS6KA4/MSK2 can directly phosphorylate andactivate transcription factors such as CREB1, ATF1, the NF-kappa-Bisoform RELA/NFKB3, STAT1 and STAT3, but can also phosphorylatehistone H3 and the nucleosomal protein HMGN1. RPS6KA5/MSK1 andRPS6KA4/MSK2 play important roles in the rapid induction ofimmediate-early genes in response to stress or mitogenic stimuli,either by inducing chromatin remodeling or by recruiting thetranscription machinery. On the other hand, two other kinasetargets, MAPKAPK2/MK2 and MAPKAPK3/MK3, participate in the controlof gene expression mostly at the post-transcriptional level, byphosphorylating ZFP36 (tristetraprolin) and ELAVL1, and byregulating EEF2K, which is important for the elongation of mRNAduring translation. MKNK1/MNK1 and MKNK2/MNK2, two other kinasesactivated by p38 MAPKs, regulate protein synthesis byphosphorylating the initiation factor EIF4E2. MAPK14 interactsalso with casein kinase II, leading to its activation throughautophosphorylation and further phosphorylation of TP53/p53. Inthe cytoplasm, the p38 MAPK pathway is an important regulator ofprotein turnover. For example, CFLAR is an inhibitor of TNF-induced apoptosis whose proteasome-mediated degradation isregulated by p38 MAPK phosphorylation. In a similar way, MAPK14phosphorylates the ubiquitin ligase SIAH2, regulating its activitytowards EGLN3. MAPK14 may also inhibit the lysosomal degradationpathway of autophagy by interfering with the intracellulartrafficking of the transmembrane protein ATG9. Another function ofMAPK14 is to regulate the endocytosis of membrane receptors bydifferent mechanisms that impinge on the small GTPase RAB5A. Inaddition, clathrin-mediated EGFR internalization induced byinflammatory cytokines and UV irradiation depends on MAPK14-mediated phosphorylation of EGFR itself as well as of RAB5Aeffectors. Ectodomain shedding of transmembrane proteins isregulated by p38 MAPKs as well. In response to inflammatorystimuli, p38 MAPKs phosphorylate the membrane-associatedmetalloprotease ADAM17. Such phosphorylation is required forADAM17-mediated ectodomain shedding of TGF-alpha family ligands,which results in the activation of EGFR signaling and cellproliferation. Another p38 MAPK substrate is FGFR1. FGFR1 can betranslocated from the extracellular space into the cytosol andnucleus of target cells, and regulates processes such as rRNAsynthesis and cell growth. FGFR1 translocation requires p38 MAPKactivation. In the nucleus, many transcription factors arephosphorylated and activated by p38 MAPKs in response to differentstimuli. Classical examples include ATF1, ATF2, ATF6, ELK1, PTPRH,DDIT3, TP53/p53 and MEF2C and MEF2A. The p38 MAPKs are emerging asimportant modulators of gene expression by regulating chromatinmodifiers and remodelers. The promoters of several genes involvedin the inflammatory response, such as IL6, IL8 and IL12B, displaya p38 MAPK-dependent enrichment of histone H3 phosphorylation on'Ser-10' (H3S10ph) in LPS-stimulated myeloid cells. Thisphosphorylation enhances the accessibility of the cryptic NF-kappa-B-binding sites marking promoters for increased NF-kappa-Brecruitment. Phosphorylates CDC25B and CDC25C which is requiredfor binding to 14-3-3 proteins and leads to initiation of a G2delay after ultraviolet radiation. Phosphorylates TIAR followingDNA damage, releasing TIAR from GADD45A mRNA and preventing mRNAdegradation. The p38 MAPKs may also have kinase-independent roles,which are thought to be due to the binding to targets in theabsence of phosphorylation. Protein O-Glc-N-acylation catalyzed bythe OGT is regulated by MAPK14, and, although OGT does not seem tobe phosphorylated by MAPK14, their interaction increases uponMAPK14 activation induced by glucose deprivation. This interactionmay regulate OGT activity by recruiting it to specific targetssuch as neurofilament H, stimulating its O-Glc-N-acylation.Required in mid-fetal development for the growth of embryo-derivedblood vessels in the labyrinth layer of the placenta. Also playsan essential role in developmental and stress-inducederythropoiesis, through regulation of EPO gene expression. IsoformMXI2 activation is stimulated by mitogens and oxidative stress andonly poorly phosphorylates ELK1 and ATF2. Isoform EXIP may play arole in the early onset of apoptosis. Phosphorylates S100A9 at'Thr-113'. ", isseed: false, uniprot: "Q16539", isvalid: true, importance: 3, ox: 705.1137353610045, oy: 372.7634453076487, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2", altered: 0, rank: 189, cited: 4, uniprotdesc: "Non-catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Beta non-catalytic subunit acts as ascaffold on which the AMPK complex assembles, via its C-terminusthat bridges alpha (PRKAA1 or PRKAA2) and gamma subunits (PRKAG1,PRKAG2 or PRKAG3).", isseed: false, uniprot: "O43741", isvalid: true, importance: 3, ox: 718.6198477055347, oy: 399.5512210521357, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1", altered: 0, rank: 73, cited: 368, uniprotdesc: "Non-catalytic subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Beta non-catalytic subunit acts as ascaffold on which the AMPK complex assembles, via its C-terminusthat bridges alpha (PRKAA1 or PRKAA2) and gamma subunits (PRKAG1,PRKAG2 or PRKAG3).", isseed: false, uniprot: "Q9Y478", isvalid: true, importance: 3, ox: 476.5577136594006, oy: 420.49999999999994, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300", altered: 0, rank: 19, cited: 2835, uniprotdesc: "Functions as histone acetyltransferase and regulatestranscription via chromatin remodeling. Acetylates all four corehistones in nucleosomes. Histone acetylation gives an epigenetictag for transcriptional activation. Mediates cAMP-gene regulationby binding specifically to phosphorylated CREB protein. Mediatesacetylation of histone H3 at 'Lys-122' (H3K122ac), a modificationthat localizes at the surface of the histone octamer andstimulates transcription, possibly by promoting nucleosomeinstability. Mediates acetylation of histone H3 at 'Lys-27'(H3K27ac). Also functions as acetyltransferase for nonhistonetargets. Acetylates 'Lys-131' of ALX1 and acts as its coactivatorin the presence of CREBBP. Acetylates SIRT2 and is proposed toindirectly increase the transcriptional activity of TP53 throughacetylation and subsequent attenuation of SIRT2 deacetylasefunction. Acetylates HDAC1 leading to its inactivation andmodulation of transcription. Acts as a TFAP2A-mediatedtranscriptional coactivator in presence of CITED2. Plays a role asa coactivator of NEUROD1-dependent transcription of the secretinand p21 genes and controls terminal differentiation of cells inthe intestinal epithelium. Promotes cardiac myocyte enlargement.Can also mediate transcriptional repression. Binds to and may beinvolved in the transforming capacity of the adenovirus E1Aprotein. In case of HIV-1 infection, it is recruited by the viralprotein Tat. Regulates Tat's transactivating activity and may helpinducing chromatin remodeling of proviral genes. Acetylates FOXO1and enhances its transcriptional activity. Acetylates BCL6 wichdisrupts its ability to recruit histone deacetylases and hindersits transcriptional repressor activity. Participates in CLOCK orNPAS2-regulated rhythmic gene transcription; exhibits a circadianassociation with CLOCK or NPAS2, correlating with increase inPER1/2 mRNA and histone H3 acetylation on the PER1/2 promoter.Acetylates MTA1 at 'Lys-626' which is essential for itstranscriptional coactivator activity (PubMed:10733570,PubMed:11430825, PubMed:11701890, PubMed:12402037,PubMed:12586840, PubMed:12929931, PubMed:14645221,PubMed:15186775, PubMed:15890677, PubMed:16617102,PubMed:16762839, PubMed:18722353, PubMed:18995842,PubMed:23415232, PubMed:23911289, PubMed:23934153,PubMed:8945521). Acetylates XBP1 isoform 2; acetylation increasesprotein stability of XBP1 isoform 2 and enhances itstranscriptional activity (By similarity).", isseed: false, uniprot: "Q09472", isvalid: true, importance: 3, ox: 476.5577136594005, oy: 510.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1", altered: 0, rank: 125, cited: 89, uniprotdesc: "Associated to surface IgM-receptor; may be involved insignal transduction. Involved in regulation of the catalyticactivity of the phosphatases PP2A, PP4 and PP6 by protecting theirpartially folded catalytic subunits from degradativepolyubiquitination until they associate with regulatory subunits.", isseed: false, uniprot: "P78318", isvalid: true, importance: 3, ox: 729.941829340353, oy: 487.96620513822, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11", altered: 0, rank: 188, cited: 5, uniprotdesc: "Substrate recognition component of a SCF (SKP1-CUL1-F-box protein) E3 ubiquitin-protein ligase complex which mediatesthe ubiquitination and subsequent proteasomal degradation oftarget proteins, such as DTL/CDT2, BCL6 and PRDM1/BLIMP1. TheSCF(FBXO11) complex mediates ubiquitination and degradation ofBCL6, thereby playing a role in the germinal center B-cellsterminal differentiation toward memory B-cells and plasma cells.The SCF(FBXO11) complex also mediates ubiquitination anddegradation of DTL, an important step for the regulation of TGF-beta signaling, cell migration and the timing of the cell-cycleprogression and exit. Binds to and neddylates phosphorylatedp53/TP53, inhibiting its transcriptional activity. SCF(FBXO11)does not seem to direct ubiquitination of p53/TP53.", isseed: false, uniprot: "Q86XK2", isvalid: true, importance: 3, ox: 481.64519932573637, oy: 626.6730246484053, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1", altered: 0, rank: 54, cited: 617, uniprotdesc: "DNA binding proteins that associates with chromatin andhas the ability to bend DNA. Binds preferentially single-strandedDNA. Involved in V(D)J recombination by acting as a cofactor ofthe RAG complex. Acts by stimulating cleavage and RAG proteinbinding at the 23 bp spacer of conserved recombination signalsequences (RSS). Heparin-binding protein that has a role in theextension of neurite-type cytoplasmic processes in developingcells (By similarity). ", isseed: false, uniprot: "P09429", isvalid: true, importance: 3, ox: 712.435756907072, oy: 545.1295331255459, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NEDD8", altered: 0, rank: 205, cited: 236, uniprotdesc: "Ubiquitin-like protein which plays an important role incell cycle control and embryogenesis. Covalent attachment to itssubstrates requires prior activation by the E1 complex UBE1C-APPBP1 and linkage to the E2 enzyme UBE2M. Attachment of NEDD8 tocullins activates their associated E3 ubiquitin ligase activity,and thus promotes polyubiquitination and proteasomal degradationof cyclins and other regulatory proteins.", isseed: false, uniprot: "Q15843", isvalid: true, importance: 2, ox: 432.1137033013474, oy: 593.195576415127, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ASF1A", altered: 0, rank: 161, cited: 27, uniprotdesc: "Histone chaperone that facilitates histone depositionand histone exchange and removal during nucleosome assembly anddisassembly. Cooperates with chromatin assembly factor 1 (CAF-1)to promote replication-dependent chromatin assembly and with HIRAto promote replication-independent chromatin assembly. Requiredfor the formation of senescence-associated heterochromatin foci(SAHF) and efficient senescence-associated cell cycle exit.", isseed: false, uniprot: "Q9Y294", isvalid: true, importance: 3, ox: 412.29346159964496, oy: 570.6754072575452, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT8", altered: 0, rank: 199, cited: 0, uniprotdesc: "Histone acetyltransferase which may be involved intranscriptional activation. May influence the function of ATM. Aspart of the MSL complex it is involved in acetylation ofnucleosomal histone H4 producing specifically H4K16ac. As part ofthe NSL complex it may be involved in acetylation of nucleosomalhistone H4 on several lysine residues. That activity is lessspecific than the one of the MSL complex. Can also acetylateTP53/p53 at 'Lys-120'. ", isseed: false, uniprot: "Q9H7Z6", isvalid: true, importance: 3, ox: 452.21985952208775, oy: 707.5238675129558, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT", altered: 0, rank: 43, cited: 858, uniprotdesc: "May play a role in microtubule-mediated transport orvesicle function.", isseed: false, uniprot: "P42858", isvalid: true, importance: 3, ox: 632.4422863405995, oy: 510.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN", altered: 0, rank: 53, cited: 621, uniprotdesc: "Multifunctional enzyme that has both magnesium and ATP-dependent DNA-helicase activity and 3'->5' exonuclease activitytowards double-stranded DNA with a 5'-overhang. Has no nucleaseactivity towards single-stranded DNA or blunt-ended double-stranded DNA. Binds preferentially to DNA substrates containingalternate secondary structures, such as replication forks andHolliday junctions. May play an important role in the dissociationof joint DNA molecules that can arise as products of homologousrecombination, at stalled replication forks or during DNA repair.Alleviates stalling of DNA polymerases at the site of DNA lesions.Important for genomic integrity. Plays a role in the formation ofDNA replication focal centers; stably associates with focielements generating binding sites for RP-A (By similarity). Playsa role in double-strand break repair after gamma-irradiation.", isseed: false, uniprot: "Q14191", isvalid: true, importance: 3, ox: 676.8862966986526, oy: 593.1955764151269, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDKN1A", altered: 0, rank: 9, cited: 4784, uniprotdesc: "May be the important intermediate by which p53/TP53mediates its role as an inhibitor of cellular proliferation inresponse to DNA damage. Binds to and inhibits cyclin-dependentkinase activity, preventing phosphorylation of critical cyclin-dependent kinase substrates and blocking cell cycle progression.Functions in the nuclear localization and assembly of cyclin D-CDK4 complex and promotes its kinase activity towards RB1. Athigher stoichiometric ratios, inhibits the kinase activity of thecyclin D-CDK4 complex. ", isseed: false, uniprot: "P38936", isvalid: true, importance: 3, ox: 653.5452240690994, oy: 612.0421763339962, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PLK3", altered: 0, rank: 115, cited: 130, uniprotdesc: "Serine/threonine-protein kinase involved in cell cycleregulation, response to stress and Golgi disassembly. Polo-likekinases act by binding and phosphorylating proteins are thatalready phosphorylated on a specific motif recognized by the POLObox domains. Phosphorylates ATF2, BCL2L1, CDC25A, CDC25C, CHEK2,HIF1A, JUN, p53/TP53, p73/TP73, PTEN, TOP2A and VRK1. Involved incell cycle regulation: required for entry into S phase andcytokinesis. Phosphorylates BCL2L1, leading to regulate the G2checkpoint and progression to cytokinesis during mitosis. Plays akey role in response to stress: rapidly activated upon stressstimulation, such as ionizing radiation, reactive oxygen species(ROS), hyperosmotic stress, UV irradiation and hypoxia. Involvedin DNA damage response and G1/S transition checkpoint byphosphorylating CDC25A, p53/TP53 and p73/TP73. Phosphorylatesp53/TP53 in response to reactive oxygen species (ROS), therebypromoting p53/TP53-mediated apoptosis. Phosphorylates CHEK2 inresponse to DNA damage, promoting the G2/M transition checkpoint.Phosphorylates the transcription factor p73/TP73 in response toDNA damage, leading to inhibit p73/TP73-mediated transcriptionalactivation and pro-apoptotic functions. Phosphorylates HIF1A andJUN is response to hypoxia. Phosphorylates ATF2 followinghyperosmotic stress in corneal epithelium. Also involved in Golgidisassembly during the cell cycle: part of a MEK1/MAP2K1-dependentpathway that induces Golgi fragmentation during mitosis bymediating phosphorylation of VRK1. May participate in endomitoticcell cycle, a form of mitosis in which both karyokinesis andcytokinesis are interrupted and is a hallmark of megakaryocytedifferentiation, via its interaction with CIB1.", isseed: false, uniprot: "Q9H4B4", isvalid: true, importance: 3, ox: 377.7849345637625, oy: 457.9932361520796, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DYRK1A", altered: 0, rank: 128, cited: 81, uniprotdesc: "May play a role in a signaling pathway regulatingnuclear functions of cell proliferation. Modulates alternativesplicing by phosphorylating the splice factor SRSF6 (Bysimilarity). Phosphorylates serine, threonine and tyrosineresidues in its sequence and in exogenous substrates such as CRY2,FOXO1, SRSF6 and SIRT1. Exhibits a sugstrate preference forproline at position P+1 and arginine at position P-3.", isseed: false, uniprot: "Q13627", isvalid: true, importance: 3, ox: 584.451073117784, oy: 204.46415418337006, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1", altered: 0, rank: 177, cited: 11, uniprotdesc: "AMP/ATP-binding subunit of AMP-activated protein kinase(AMPK), an energy sensor protein kinase that plays a key role inregulating cellular energy metabolism. In response to reduction ofintracellular ATP levels, AMPK activates energy-producing pathwaysand inhibits energy-consuming processes: inhibits protein,carbohydrate and lipid biosynthesis, as well as cell growth andproliferation. AMPK acts via direct phosphorylation of metabolicenzymes, and by longer-term effects via phosphorylation oftranscription regulators. Also acts as a regulator of cellularpolarity by remodeling the actin cytoskeleton; probably byindirectly activating myosin. Gamma non-catalytic subunit mediatesbinding to AMP, ADP and ATP, leading to activate or inhibit AMPK:AMP-binding results in allosteric activation of alpha catalyticsubunit (PRKAA1 or PRKAA2) both by inducing phosphorylation andpreventing dephosphorylation of catalytic subunits. ADP alsostimulates phosphorylation, without stimulating alreadyphosphorylated catalytic subunit. ATP promotes dephosphorylationof catalytic subunit, rendering the AMPK enzyme inactive.", isseed: false, uniprot: "P54619", isvalid: true, importance: 3, ox: 627.3548006742639, oy: 626.6730246484052, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP6", altered: 0, rank: 104, cited: 161, uniprotdesc: "Involved in the activation cascade of caspasesresponsible for apoptosis execution. Cleaves poly(ADP-ribose)polymerase in vitro, as well as lamins. Overexpression promotesprogrammed cell death.", isseed: false, uniprot: "P55212", isvalid: true, importance: 3, ox: 642.7964774016498, oy: 218.03179666759164, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAX", altered: 0, rank: 158, cited: 28, uniprotdesc: "Transcription regulator. Forms a sequence-specific DNA-binding protein complex with MYC or MAD which recognizes the coresequence 5'-CAC[GA]TG-3'. The MYC:MAX complex is a transcriptionalactivator, whereas the MAD:MAX complex is a repressor. May represstranscription via the recruitment of a chromatin remodelingcomplex containing H3 'Lys-9' histone methyltransferase activity.", isseed: false, uniprot: "P61244", isvalid: true, importance: 3, ox: 524.5489268822162, oy: 204.46415418337, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FOS", altered: 0, rank: 61, cited: 496, uniprotdesc: "Nuclear phosphoprotein which forms a tight but non-covalently linked complex with the JUN/AP-1 transcription factor.In the heterodimer, FOS and JUN/AP-1 basic regions each seems tointeract with symmetrical DNA half sites. On TGF-beta activation,forms a multimeric SMAD3/SMAD4/JUN/FOS complex at the AP1/SMAD-binding site to regulate TGF-beta-mediated signaling. Has acritical function in regulating the development of cells destinedto form and maintain the skeleton. It is thought to have animportant role in signal transduction, cell proliferation anddifferentiation. In growing cells, activates phospholipidsynthesis, possibly by activating CDS1 and PI4K2A. This activityrequires Tyr-dephosphorylation and association with theendoplasmic reticulum. ", isseed: false, uniprot: "P01100", isvalid: true, importance: 3, ox: 696.5525693086885, oy: 244.46188759648143, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53I3", altered: 0, rank: 152, cited: 39, uniprotdesc: "May be involved in the generation of reactive oxygenspecies (ROS). Has low NADPH-dependent beta-naphthoquinonereductase activity, with a preference for 1,2-beta-naphthoquinoneover 1,4-beta-naphthoquinone. Has low NADPH-dependent diaminereductase activity (in vitro). ", isseed: false, uniprot: "Q53FA7", isvalid: true, importance: 3, ox: 720.823079139937, oy: 262.0954451652557, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT1", altered: 0, rank: 206, cited: 189, uniprotdesc: "Arginine methyltransferase that methylates (mono andasymmetric dimethylation) the guanidino nitrogens of arginylresidues present in proteins such as ESR1, histone H2, H3 and H4,PIAS1, HNRNPA1, HNRNPD, NFATC2IP, SUPT5H, TAF15 and EWS.Constitutes the main enzyme that mediates monomethylation andasymmetric dimethylation of histone H4 'Arg-4' (H4R3me1 andH4R3me2a, respectively), a specific tag for epigenetictranscriptional activation. Together with dimethylated PIAS1,represses STAT1 transcriptional activity, in the late phase ofinterferon gamma (IFN-gamma) signaling. May be involved in theregulation of TAF15 transcriptional activity, act as an activatorof estrogen receptor (ER)-mediated transactivation, play a keyrole in neurite outgrowth and act as a negative regulator ofmegakaryocytic differentiation, by modulating p38 MAPK pathway.Methylates FOXO1 and retains it in the nucleus increasing itstranscriptional activity. ", isseed: false, uniprot: "Q99873", isvalid: true, importance: 2, ox: 742.9253132762292, oy: 282.3806921734763, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PCBP4", altered: 0, rank: 165, cited: 20, uniprotdesc: "Single-stranded nucleic acid binding protein that bindspreferentially to oligo dC. ", isseed: false, uniprot: "P57723", isvalid: true, importance: 3, ox: 762.5711352945876, oy: 305.05317940410396, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT5", altered: 0, rank: 118, cited: 111, uniprotdesc: "Arginine methyltransferase that can both catalyze theformation of omega-N monomethylarginine (MMA) and symmetricaldimethylarginine (sDMA), with a preference for the formation ofMMA. Specifically mediates the symmetrical dimethylation ofarginine residues in the small nuclear ribonucleoproteins Sm D1(SNRPD1) and Sm D3 (SNRPD3); such methylation being required forthe assembly and biogenesis of snRNP core particles. MethylatesSUPT5H. Mono- and dimethylates arginine residues of myelin basicprotein (MBP) in vitro. Plays a role in the assembly of snRNP coreparticles. May play a role in cytokine-activated transductionpathways. Negatively regulates cyclin E1 promoter activity andcellular proliferation. May regulate the SUPT5H transcriptionalelongation properties. May be part of a pathway that is connectedto a chloride current, possibly through cytoskeletalrearrangement. Methylates histone H2A and H4 'Arg-3' during germcell development. Methylates histone H3 'Arg-8', which may represstranscription. Methylates the Piwi proteins (PIWIL1, PIWIL2 andPIWIL4), methylation of Piwi proteins being required for theinteraction with Tudor domain-containing proteins and subsequentlocalization to the meiotic nuage. Methylates RPS10. AttenuatesEGF signaling through the MAPK1/MAPK3 pathway acting at 2 levels.First, monomethylates EGFR; this enhances EGFR 'Tyr-1197'phosphorylation and PTPN6 recruitment, eventually leading toreduced SOS1 phosphorylation. Second, methylates RAF1 and probablyBRAF, hence destabilizing these 2 signaling proteins and reducingtheir catalytic activity. Required for induction of E-selectin andVCAM-1, on the endothelial cells surface at sites of inflammation.Methylates HOXA9. Methylates and regulates SRGAP2 which isinvolved in cell migration and differentiation. Acts as atranscriptional corepressor in CRY1-mediated repression of thecore circadian component PER1 by regulating the H4R3 dimethylationat the PER1 promoter. ", isseed: false, uniprot: "O14744", isvalid: true, importance: 3, ox: 779.5044318605908, oy: 329.8173363129873, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "E4F1", altered: 0, rank: 150, cited: 47, uniprotdesc: "May function as a transcriptional repressor. May alsofunction as a ubiquitin ligase mediating ubiquitination ofchromatin-associated TP53. Functions in cell survival andproliferation through control of the cell cycle. Functions in thep53 and pRB tumor suppressor pathways and regulates the cyclinCCNA2 transcription.Identified as a cellular target of the adenoviraloncoprotein E1A, it is required for both transcriptionalactivation and repression of viral genes.", isseed: false, uniprot: "Q66K89", isvalid: true, importance: 3, ox: 793.504451557361, oy: 356.35032424292166, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP1", altered: 0, rank: 64, cited: 473, uniprotdesc: "Thiol protease that cleaves IL-1 beta between an Asp andan Ala, releasing the mature cytokine which is involved in avariety of inflammatory processes. Important for defense againstpathogens. Cleaves and activates sterol regulatory element bindingproteins (SREBPs). Can also promote apoptosis.", isseed: false, uniprot: "P29466", isvalid: true, importance: 3, ox: 804.3886827178802, oy: 384.3062451192652, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCA", altered: 0, rank: 84, cited: 275, uniprotdesc: "Calcium-activated, phospholipid- and diacylglycerol(DAG)-dependent serine/threonine-protein kinase that is involvedin positive and negative regulation of cell proliferation,apoptosis, differentiation, migration and adhesion, tumorigenesis,cardiac hypertrophy, angiogenesis, platelet function andinflammation, by directly phosphorylating targets such as RAF1,BCL2, CSPG4, TNNT2/CTNT, or activating signaling cascade involvingMAPK1/3 (ERK1/2) and RAP1GAP. Involved in cell proliferation andcell growth arrest by positive and negative regulation of the cellcycle. Can promote cell growth by phosphorylating and activatingRAF1, which mediates the activation of the MAPK/ERK signalingcascade, and/or by up-regulating CDKN1A, which facilitates activecyclin-dependent kinase (CDK) complex formation in glioma cells.In intestinal cells stimulated by the phorbol ester PMA, cantrigger a cell cycle arrest program which is associated with theaccumulation of the hyper-phosphorylated growth-suppressive formof RB1 and induction of the CDK inhibitors CDKN1A and CDKN1B.Exhibits anti-apoptotic function in glioma cells and protects themfrom apoptosis by suppressing the p53/TP53-mediated activation ofIGFBP3, and in leukemia cells mediates anti-apoptotic action byphosphorylating BCL2. During macrophage differentiation induced bymacrophage colony-stimulating factor (CSF1), is translocated tothe nucleus and is associated with macrophage development. Afterwounding, translocates from focal contacts to lamellipodia andparticipates in the modulation of desmosomal adhesion. Plays arole in cell motility by phosphorylating CSPG4, which inducesassociation of CSPG4 with extensive lamellipodia at the cellperiphery and polarization of the cell accompanied by increases incell motility. Is highly expressed in a number of cancer cellswhere it can act as a tumor promoter and is implicated inmalignant phenotypes of several tumors such as gliomas and breastcancers. Negatively regulates myocardial contractility andpositively regulates angiogenesis, platelet aggregation andthrombus formation in arteries. Mediates hypertrophic growth ofneonatal cardiomyocytes, in part through a MAPK1/3 (ERK1/2)-dependent signaling pathway, and upon PMA treatment, is requiredto induce cardiomyocyte hypertrophy up to heart failure and death,by increasing protein synthesis, protein-DNA ratio and cellsurface area. Regulates cardiomyocyte function by phosphorylatingcardiac troponin T (TNNT2/CTNT), which induces significantreduction in actomyosin ATPase activity, myofilament calciumsensitivity and myocardial contractility. In angiogenesis, isrequired for full endothelial cell migration, adhesion tovitronectin (VTN), and vascular endothelial growth factor A(VEGFA)-dependent regulation of kinase activation and vasculartube formation. Involved in the stabilization of VEGFA mRNA atpost-transcriptional level and mediates VEGFA-induced cellproliferation. In the regulation of calcium-induced plateletaggregation, mediates signals from the CD36/GP4 receptor forgranule release, and activates the integrin heterodimer ITGA2B-ITGB3 through the RAP1GAP pathway for adhesion. During response tolipopolysaccharides (LPS), may regulate selective LPS-inducedmacrophage functions involved in host defense and inflammation.But in some inflammatory responses, may negatively regulate NF-kappa-B-induced genes, through IL1A-dependent induction of NF-kappa-B inhibitor alpha (NFKBIA/IKBA). Upon stimulation with 12-O-tetradecanoylphorbol-13-acetate (TPA), phosphorylates EIF4G1,which modulates EIF4G1 binding to MKNK1 and may be involved in theregulation of EIF4E phosphorylation. Phosphorylates KIT, leadingto inhibition of KIT activity. Phosphorylates ATF2 which promotescooperation between ATF2 and JUN, activating transcription.", isseed: false, uniprot: "P17252", isvalid: true, importance: 3, ox: 812.0152327436849, oy: 413.32065076032404, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK1", altered: 0, rank: 27, cited: 2149, uniprotdesc: "Plays a key role in the control of the eukaryotic cellcycle by modulating the centrosome cycle as well as mitotic onset;promotes G2-M transition, and regulates G1 progress and G1-Stransition via association with multiple interphase cyclins.Required in higher cells for entry into S-phase and mitosis.Phosphorylates PARVA/actopaxin, APC, AMPH, APC, BARD1, Bcl-xL/BCL2L1, BRCA2, CALD1, CASP8, CDC7, CDC20, CDC25A, CDC25C,CC2D1A, CSNK2 proteins/CKII, FZR1/CDH1, CDK7, CEBPB, CHAMP1,DMD/dystrophin, EEF1 proteins/EF-1, EZH2, KIF11/EG5, EGFR, FANCG,FOS, GFAP, GOLGA2/GM130, GRASP1, UBE2A/hHR6A, HIST1H1proteins/histone H1, HMGA1, HIVEP3/KRC, LMNA, LMNB, LMNC, LBR,LATS1, MAP1B, MAP4, MARCKS, MCM2, MCM4, MKLP1, MYB, NEFH, NFIC,NPC/nuclear pore complex, PITPNM1/NIR2, NPM1, NCL, NUCKS1,NPM1/numatrin, ORC1, PRKAR2A, EEF1E1/p18, EIF3F/p47, p53/TP53,NONO/p54NRB, PAPOLA, PLEC/plectin, RB1, UL40/R2, RAB4A, RAP1GAP,RCC1, RPS6KB1/S6K1, KHDRBS1/SAM68, ESPL1, SKI, BIRC5/survivin,STIP1, TEX14, beta-tubulins, MAPT/TAU, NEDD1, VIM/vimentin, TK1,FOXO1, RUNX1/AML1, SIRT2 and RUNX2. CDK1/CDC2-cyclin-B controlspronuclear union in interphase fertilized eggs. Essential forearly stages of embryonic development. During G2 and earlymitosis, CDC25A/B/C-mediated dephosphorylation activatesCDK1/cyclin complexes which phosphorylate several substrates thattrigger at least centrosome separation, Golgi dynamics, nuclearenvelope breakdown and chromosome condensation. Once chromosomesare condensed and aligned at the metaphase plate, CDK1 activity isswitched off by WEE1- and PKMYT1-mediated phosphorylation to allowsister chromatid separation, chromosome decondensation,reformation of the nuclear envelope and cytokinesis. Inactivatedby PKR/EIF2AK2- and WEE1-mediated phosphorylation upon DNA damageto stop cell cycle and genome replication at the G2 checkpointthus facilitating DNA repair. Reactivated after successful DNArepair through WIP1-dependent signaling leading to CDC25A/B/C-mediated dephosphorylation and restoring cell cycle progression.In proliferating cells, CDK1-mediated FOXO1 phosphorylation at theG2-M phase represses FOXO1 interaction with 14-3-3 proteins andthereby promotes FOXO1 nuclear accumulation and transcriptionfactor activity, leading to cell death of postmitotic neurons. Thephosphorylation of beta-tubulins regulates microtubule dynamicsduring mitosis. NEDD1 phosphorylation promotes PLK1-mediated NEDD1phosphorylation and subsequent targeting of the gamma-tubulin ringcomplex (gTuRC) to the centrosome, an important step for spindleformation. In addition, CC2D1A phosphorylation regulates CC2D1Aspindle pole localization and association with SCC1/RAD21 andcentriole cohesion during mitosis. The phosphorylation of Bcl-xL/BCL2L1 after prolongated G2 arrest upon DNA damage triggersapoptosis. In contrast, CASP8 phosphorylation during mitosisprevents its activation by proteolysis and subsequent apoptosis.This phosphorylation occurs in cancer cell lines, as well as inprimary breast tissues and lymphocytes. EZH2 phosphorylationpromotes H3K27me3 maintenance and epigenetic gene silencing. CALD1phosphorylation promotes Schwann cell migration during peripheralnerve regeneration. ", isseed: false, uniprot: "P06493", isvalid: true, importance: 3, ox: 816.2846778918833, oy: 443.01529401675197, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK9", altered: 0, rank: 66, cited: 448, uniprotdesc: "Protein kinase involved in the regulation oftranscription. Member of the cyclin-dependent kinase pair(CDK9/cyclin-T) complex, also called positive transcriptionelongation factor b (P-TEFb), which facilitates the transitionfrom abortive to productive elongation by phosphorylating the CTD(C-terminal domain) of the large subunit of RNA polymerase II(RNAP II) POLR2A, SUPT5H and RDBP. This complex is inactive whenin the 7SK snRNP complex form. Phosphorylates EP300, MYOD1,RPB1/POLR2A and AR, and the negative elongation factors DSIF andNELF. Regulates cytokine inducible transcription networks byfacilitating promoter recognition of target transcription factors(e.g. TNF-inducible RELA/p65 activation and IL-6-inducible STAT3signaling). Promotes RNA synthesis in genetic programs for cellgrowth, differentiation and viral pathogenesis. P-TEFb is alsoinvolved in cotranscriptional histone modification, mRNAprocessing and mRNA export. Modulates a complex network ofchromatin modifications including histone H2B monoubiquitination(H2Bub1), H3 lysine 4 trimethylation (H3K4me3) and H3K36me3;integrates phosphorylation during transcription with chromatinmodifications to control co-transcriptional histone mRNAprocessing. The CDK9/cyclin-K complex has also a kinase activitytowards CTD of RNAP II and can substitute for CDK9/cyclin-T P-TEFbin vitro. Replication stress response protein; the CDK9/cyclin-Kcomplex is required for genome integrity maintenance, by promotingcell cycle recovery from replication arrest and limiting single-stranded DNA amount in response to replication stress, thusreducing the breakdown of stalled replication forks and avoidingDNA damage. In addition, probable function in DNA repair ofisoform 2 via interaction with KU70/XRCC6. Promotes cardiacmyocyte enlargement. RPB1/POLR2A phosphorylation on 'Ser-2' in CTDactivates transcription. AR phosphorylation modulates ARtranscription factor promoter selectivity and cell growth. DSIFand NELF phosphorylation promotes transcription by inhibitingtheir negative effect. The phosphorylation of MYOD1 enhances itstranscriptional activity and thus promotes muscle differentiation.", isseed: false, uniprot: "P50750", isvalid: true, importance: 3, ox: 817.1413594156943, oy: 473.0030598015976, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RB1", altered: 0, rank: 15, cited: 3201, uniprotdesc: "Key regulator of entry into cell division that acts as atumor suppressor. Promotes G0-G1 transition when phosphorylated byCDK3/cyclin-C. Acts as a transcription repressor of E2F1 targetgenes. The underphosphorylated, active form of RB1 interacts withE2F1 and represses its transcription activity, leading to cellcycle arrest. Directly involved in heterochromatin formation bymaintaining overall chromatin structure and, in particular, thatof constitutive heterochromatin by stabilizing histonemethylation. Recruits and targets histone methyltransferasesSUV39H1, SUV420H1 and SUV420H2, leading to epigenetictranscriptional repression. Controls histone H4 'Lys-20'trimethylation. Inhibits the intrinsic kinase activity of TAF1.Mediates transcriptional repression by SMARCA4/BRG1 by recruitinga histone deacetylase (HDAC) complex to the c-FOS promoter. Inresting neurons, transcription of the c-FOS promoter is inhibitedby BRG1-dependent recruitment of a phospho-RB1-HDAC1 repressorcomplex. Upon calcium influx, RB1 is dephosphorylated bycalcineurin, which leads to release of the repressor complex (Bysimilarity). In case of viral infections, interactions with SV40large T antigen, HPV E7 protein or adenovirus E1A protein inducethe disassembly of RB1-E2F1 complex thereby disrupting RB1'sactivity. ", isseed: false, uniprot: "P06400", isvalid: true, importance: 3, ox: 814.574109161329, oy: 502.89301172747827, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK7", altered: 0, rank: 72, cited: 372, uniprotdesc: "Serine/threonine kinase involved in cell cycle controland in RNA polymerase II-mediated RNA transcription. Cyclin-dependent kinases (CDKs) are activated by the binding to a cyclinand mediate the progression through the cell cycle. Each differentcomplex controls a specific transition between 2 subsequent phasesin the cell cycle. Required for both activation and complexformation of CDK1/cyclin-B during G2-M transition, and foractivation of CDK2/cyclins during G1-S transition (but not complexformation). CDK7 is the catalytic subunit of the CDK-activatingkinase (CAK) complex. Phosphorylates SPT5/SUPT5H, SF1/NR5A1,POLR2A, p53/TP53, CDK1, CDK2, CDK4, CDK6 and CDK11B/CDK11. CAKactivates the cyclin-associated kinases CDK1, CDK2, CDK4 and CDK6by threonine phosphorylation, thus regulating cell cycleprogression. CAK complexed to the core-TFIIH basal transcriptionfactor activates RNA polymerase II by serine phosphorylation ofthe repetitive C-terminal domain (CTD) of its large subunit(POLR2A), allowing its escape from the promoter and elongation ofthe transcripts. Phosphorylation of POLR2A in complex with DNApromotes transcription initiation by triggering dissociation fromDNA. Its expression and activity are constant throughout the cellcycle. Upon DNA damage, triggers p53/TP53 activation byphosphorylation, but is inactivated in turn by p53/TP53; thisfeedback loop may lead to an arrest of the cell cycle and of thetranscription, helping in cell recovery, or to apoptosis. Requiredfor DNA-bound peptides-mediated transcription and cellular growthinhibition. ", isseed: false, uniprot: "P50613", isvalid: true, importance: 3, ox: 808.6163951619568, oy: 532.2954885602501, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGA2", altered: 0, rank: 82, cited: 280, uniprotdesc: "Functions as a transcriptional regulator. Functions incell cycle regulation through CCNA2. Plays an important role inchromosome condensation during the meiotic G2/M transition ofspermatocytes. ", isseed: false, uniprot: "P52926", isvalid: true, importance: 3, ox: 390.3801522944653, oy: 399.55122105213593, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK3", altered: 0, rank: 112, cited: 146, uniprotdesc: "Serine/threonine kinase which is involved in theregulation of apoptosis, autophagy, transcription, translation andactin cytoskeleton reorganization. Involved in the regulation ofsmooth muscle contraction. Regulates both type I (caspase-dependent) apoptotic and type II (caspase-independent) autophagiccell deaths signal, depending on the cellular setting. Involved inregulation of starvation-induced autophagy. Regulates myosinphosphorylation in both smooth muscle and non-muscle cells. Insmooth muscle, regulates myosin either directly by phosphorylatingMYL12B and MYL9 or through inhibition of smooth muscle myosinphosphatase (SMPP1M) via phosphorylation of PPP1R12A; theinhibition of SMPP1M functions to enhance muscle responsiveness toCa(2+) and promote a contractile state. Phosphorylates MYL12B innon-muscle cells leading to reorganization of actin cytoskeleton.Isoform 2 can phosphorylate myosin, PPP1R12A and MYL12B.Overexpression leads to condensation of actin stress fibers intothick bundles. Involved in actin filament focal adhesion dynamics.The function in both reorganization of actin cytoskeleton andfocal adhesion dissolution is modulated by RhoD. Positivelyregulates canonical Wnt/beta-catenin signaling through interactionwith NLK and TCF7L2. Phosphorylates RPL13A on 'Ser-77' uponinterferon-gamma activation which is causing RPL13A release fromthe ribosome, RPL13A association with the GAIT complex and itssubsequent involvement in transcript-selective translationinhibition. Enhances transcription from AR-responsive promoters ina hormone- and kinase-dependent manner. Involved in regulation ofcell cycle progression and cell proliferation. May be a tumorsuppressor. ", isseed: false, uniprot: "O43293", isvalid: true, importance: 3, ox: 786.8834349406518, oy: 588.1161439097402, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGA1", altered: 0, rank: 111, cited: 147, uniprotdesc: "HMG-I/Y bind preferentially to the minor groove of A+Trich regions in double-stranded DNA. It is suggested that theseproteins could function in nucleosome phasing and in the 3'-endprocessing of mRNA transcripts. They are also involved in thetranscription regulation of genes containing, or in closeproximity to A+T-rich regions.", isseed: false, uniprot: "P17096", isvalid: true, importance: 3, ox: 403.8862646389955, oy: 372.7634453076488, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCD", altered: 0, rank: 122, cited: 90, uniprotdesc: "Calcium-independent, phospholipid- and diacylglycerol(DAG)-dependent serine/threonine-protein kinase that playscontrasting roles in cell death and cell survival by functioningas a pro-apoptotic protein during DNA damage-induced apoptosis,but acting as an anti-apoptotic protein during cytokine receptor-initiated cell death, is involved in tumor suppression as well assurvival of several cancers, is required for oxygen radicalproduction by NADPH oxidase and acts as positive or negativeregulator in platelet functional responses. Negatively regulates Bcell proliferation and also has an important function in self-antigen induced B cell tolerance induction. Upon DNA damage,activates the promoter of the death-promoting transcription factorBCLAF1/Btf to trigger BCLAF1-mediated p53/TP53 gene transcriptionand apoptosis. In response to oxidative stress, interact with andactivate CHUK/IKKA in the nucleus, causing the phosphorylation ofp53/TP53. In the case of ER stress or DNA damage-inducedapoptosis, can form a complex with the tyrosine-protein kinaseABL1 which trigger apoptosis independently of p53/TP53. In cytosolcan trigger apoptosis by activating MAPK11 or MAPK14, inhibitingAKT1 and decreasing the level of X-linked inhibitor of apoptosisprotein (XIAP), whereas in nucleus induces apoptosis via theactivation of MAPK8 or MAPK9. Upon ionizing radiation treatment,is required for the activation of the apoptosis regulators BAX andBAK, which trigger the mitochondrial cell death pathway. Canphosphorylate MCL1 and target it for degradation which issufficient to trigger for BAX activation and apoptosis. Isrequired for the control of cell cycle progression both at G1/Sand G2/M phases. Mediates phorbol 12-myristate 13-acetate (PMA)-induced inhibition of cell cycle progression at G1/S phase by up-regulating the CDK inhibitor CDKN1A/p21 and inhibiting the cyclinCCNA2 promoter activity. In response to UV irradiation canphosphorylate CDK1, which is important for the G2/M DNA damagecheckpoint activation. Can protect glioma cells from the apoptosisinduced by TNFSF10/TRAIL, probably by inducing increasedphosphorylation and subsequent activation of AKT1. Is highlyexpressed in a number of cancer cells and promotes cell survivaland resistance against chemotherapeutic drugs by inducing cyclinD1 (CCND1) and hyperphosphorylation of RB1, and via several pro-survival pathways, including NF-kappa-B, AKT1 and MAPK1/3(ERK1/2). Can also act as tumor suppressor upon mitogenicstimulation with PMA or TPA. In N-formyl-methionyl-leucyl-phenylalanine (fMLP)-treated cells, is required for NCF1 (p47-phox) phosphorylation and activation of NADPH oxidase activity,and regulates TNF-elicited superoxide anion production inneutrophils, by direct phosphorylation and activation of NCF1 orindirectly through MAPK1/3 (ERK1/2) signaling pathways. May alsoplay a role in the regulation of NADPH oxidase activity ineosinophil after stimulation with IL5, leukotriene B4 or PMA. Incollagen-induced platelet aggregation, acts a negative regulatorof filopodia formation and actin polymerization by interactingwith and negatively regulating VASP phosphorylation. Downstream ofPAR1, PAR4 and CD36/GP4 receptors, regulates differentiallyplatelet dense granule secretion; acts as a positive regulator inPAR-mediated granule secretion, whereas it negatively regulatesCD36/GP4-mediated granule release. Phosphorylates MUC1 in the C-terminal and regulates the interaction between MUC1 and beta-catenin. The catalytic subunit phosphorylates 14-3-3 proteins(YWHAB, YWHAZ and YWHAH) in a sphingosine-dependent fashion (Bysimilarity). ", isseed: false, uniprot: "Q05655", isvalid: true, importance: 3, ox: 753.0720747024197, oy: 637.5636821949563, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "UBN1", altered: 0, rank: 180, cited: 8, uniprotdesc: "Acts as a novel regulator of senescence. Involved in theformation of senescence-associated heterochromatin foci (SAHF),which represses expression of proliferation-promoting genes. Bindsto proliferation-promoting genes. May be required for replication-independent chromatin assembly. ", isseed: false, uniprot: "Q9NPG3", isvalid: true, importance: 3, ox: 421.7252599281241, oy: 348.6435313966405, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK5", altered: 0, rank: 44, cited: 837, uniprotdesc: "Proline-directed serine/threonine-protein kinaseessential for neuronal cell cycle arrest and differentiation andmay be involved in apoptotic cell death in neuronal diseases bytriggering abortive cell cycle re-entry. Interacts with D1 and D3-type G1 cyclins. Phosphorylates SRC, NOS3, VIM/vimentin,p35/CDK5R1, MEF2A, SIPA1L1, SH3GLB1, PXN, PAK1, MCAM/MUC18, SEPT5,SYN1, DNM1, AMPH, SYNJ1, CDK16, RAC1, RHOA, CDC42, TONEBP/NFAT5,MAPT/TAU, MAP1B, histone H1, p53/TP53, HDAC1, APEX1, PTK2/FAK1,huntingtin/HTT, ATM, MAP2, NEFH and NEFM. Regulates severalneuronal development and physiological processes includingneuronal survival, migration and differentiation, axonal andneurite growth, synaptogenesis, oligodendrocyte differentiation,synaptic plasticity and neurotransmission, by phosphorylating keyproteins. Activated by interaction with CDK5R1 (p35) and CDK5R2(p39), especially in post-mitotic neurons, and promotes CDK5R1(p35) expression in an autostimulation loop. Phosphorylates manydownstream substrates such as Rho and Ras family small GTPases(e.g. PAK1, RAC1, RHOA, CDC42) or microtubule-binding proteins(e.g. MAPT/TAU, MAP2, MAP1B), and modulates actin dynamics toregulate neurite growth and/or spine morphogenesis. Phosphorylatesalso exocytosis associated proteins such as MCAM/MUC18, SEPT5,SYN1, and CDK16/PCTAIRE1 as well as endocytosis associatedproteins such as DNM1, AMPH and SYNJ1 at synaptic terminals. Inthe mature central nervous system (CNS), regulatesneurotransmitter movements by phosphorylating substratesassociated with neurotransmitter release and synapse plasticity;synaptic vesicle exocytosis, vesicles fusion with the presynapticmembrane, and endocytosis. Promotes cell survival by activatinganti-apoptotic proteins BCL2 and STAT3, and negatively regulatingof JNK3/MAPK10 activity. Phosphorylation of p53/TP53 in responseto genotoxic and oxidative stresses enhances its stabilization bypreventing ubiquitin ligase-mediated proteasomal degradation, andinduces transactivation of p53/TP53 target genes, thus regulatingapoptosis. Phosphorylation of p35/CDK5R1 enhances itsstabilization by preventing calpain-mediated proteolysis producingp25/CDK5R1 and avoiding ubiquitin ligase-mediated proteasomaldegradation. During aberrant cell-cycle activity and DNA damage,p25/CDK5 activity elicits cell-cycle activity and double-strandDNA breaks that precedes neuronal death by deregulating HDAC1. DNAdamage triggered phosphorylation of huntingtin/HTT in nuclei ofneurons protects neurons against polyglutamine expansion as wellas DNA damage mediated toxicity. Phosphorylation of PXN reducesits interaction with PTK2/FAK1 in matrix-cell focal adhesions(MCFA) during oligodendrocytes (OLs) differentiation. Negativeregulator of Wnt/beta-catenin signaling pathway. Activator of theGAIT (IFN-gamma-activated inhibitor of translation) pathway, whichsuppresses expression of a post-transcriptional regulon ofproinflammatory genes in myeloid cells; phosphorylates the linkerdomain of glutamyl-prolyl tRNA synthetase (EPRS) in a IFN-gamma-dependent manner, the initial event in assembly of the GAITcomplex. Phosphorylation of SH3GLB1 is required for autophagyinduction in starved neurons. Phosphorylation of TONEBP/NFAT5 inresponse to osmotic stress mediates its rapid nuclearlocalization. MEF2 is inactivated by phosphorylation in nucleus inresponse to neurotoxin, thus leading to neuronal apoptosis. APEX1AP-endodeoxyribonuclease is repressed by phosphorylation,resulting in accumulation of DNA damage and contributing toneuronal death. NOS3 phosphorylation down regulates NOS3-derivednitrite (NO) levels. SRC phosphorylation mediates its ubiquitin-dependent degradation and thus leads to cytoskeletalreorganization. May regulate endothelial cell migration andangiogenesis via the modulation of lamellipodia formation.Involved in dendritic spine morphogenesis by mediating the EFNA1-EPHA4 signaling. The complex p35/CDK5 participates in theregulation of the circadian clock by modulating the function ofCLOCK protein: phosphorylates CLOCK at 'Thr-451' and 'Thr-461' andregulates the transcriptional activity of the CLOCK-ARNTL/BMAL1heterodimer in association with altered stability and subcellulardistribution. ", isseed: false, uniprot: "Q00535", isvalid: true, importance: 3, ox: 708.9396993235885, oy: 678.0680099519911, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK2", altered: 0, rank: 34, cited: 1469, uniprotdesc: "Serine/threonine-protein kinase involved in the controlof the cell cycle; essential for meiosis, but dispensable formitosis. Phosphorylates CTNNB1, USP37, p53/TP53, NPM1, CDK7, RB1,BRCA2, MYC, NPAT, EZH2. Interacts with cyclins A, B1, B3, D, or E.Triggers duplication of centrosomes and DNA. Acts at the G1-Stransition to promote the E2F transcriptional program and theinitiation of DNA synthesis, and modulates G2 progression;controls the timing of entry into mitosis/meiosis by controllingthe subsequent activation of cyclin B/CDK1 by phosphorylation, andcoordinates the activation of cyclin B/CDK1 at the centrosome andin the nucleus. Crucial role in orchestrating a fine balancebetween cellular proliferation, cell death, and DNA repair inhuman embryonic stem cells (hESCs). Activity of CDK2 is maximalduring S phase and G2; activated by interaction with cyclin Eduring the early stages of DNA synthesis to permit G1-Stransition, and subsequently activated by cyclin A2 (cyclin A1 ingerm cells) during the late stages of DNA replication to drive thetransition from S phase to mitosis, the G2 phase. EZH2phosphorylation promotes H3K27me3 maintenance and epigenetic genesilencing. Phosphorylates CABLES1 (By similarity). Cyclin E/CDK2prevents oxidative stress-mediated Ras-induced senescence byphosphorylating MYC. Involved in G1-S phase DNA damage checkpointthat prevents cells with damaged DNA from initiating mitosis;regulates homologous recombination-dependent repair byphosphorylating BRCA2, this phosphorylation is low in S phase whenrecombination is active, but increases as cells progress towardsmitosis. In response to DNA damage, double-strand break repair byhomologous recombination a reduction of CDK2-mediated BRCA2phosphorylation. Phosphorylation of RB1 disturbs its interactionwith E2F1. NPM1 phosphorylation by cyclin E/CDK2 promotes itsdissociates from unduplicated centrosomes, thus initiatingcentrosome duplication. Cyclin E/CDK2-mediated phosphorylation ofNPAT at G1-S transition and until prophase stimulates the NPAT-mediated activation of histone gene transcription during S phase.Required for vitamin D-mediated growth inhibition by being itselfinactivated. Involved in the nitric oxide- (NO) mediated signalingin a nitrosylation/activation-dependent manner. USP37 is activatedby phosphorylation and thus triggers G1-S transition. CTNNB1phosphorylation regulates insulin internalization. ", isseed: false, uniprot: "P24941", isvalid: true, importance: 3, ox: 683.702093338653, oy: 694.2872344756593, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK1", altered: 0, rank: 49, cited: 691, uniprotdesc: "Calcium/calmodulin-dependent serine/threonine kinaseinvolved in multiple cellular signaling pathways that trigger cellsurvival, apoptosis, and autophagy. Regulates both type Iapoptotic and type II autophagic cell deaths signal, depending onthe cellular setting. The former is caspase-dependent, while thelatter is caspase-independent and is characterized by theaccumulation of autophagic vesicles. Phosphorylates PIN1 resultingin inhibition of its catalytic activity, nuclear localization, andcellular function. Phosphorylates TPM1, enhancing stress fiberformation in endothelial cells. Phosphorylates STX1A andsignificantly decreases its binding to STXBP1. PhosphorylatesPRKD1 and regulates JNK signaling by binding and activating PRKD1under oxidative stress. Phosphorylates BECN1, reducing itsinteraction with BCL2 and BCL2L1 and promoting the induction ofautophagy. Phosphorylates TSC2, disrupting the TSC1-TSC2 complexand stimulating mTORC1 activity in a growth factor-dependentpathway. Phosphorylates RPS6, MYL9 and DAPK3. Acts as a signalingamplifier of NMDA receptors at extrasynaptic sites for mediatingbrain damage in stroke. Cerebral ischemia recruits DAPK1 into theNMDA receptor complex and it phosphorylates GRINB at Ser-1303inducing injurious Ca(2+) influx through NMDA receptor channels,resulting in an irreversible neuronal death. Required togetherwith DAPK3 for phosphorylation of RPL13A upon interferon-gammaactivation which is causing RPL13A involvement in transcript-selective translation inhibition.Isoform 2 cannot induce apoptosis but can inducemembrane blebbing.", isseed: false, uniprot: "P53355", isvalid: true, importance: 3, ox: 656.7801404779123, oy: 707.5238675129558, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RFWD2", altered: 0, rank: 143, cited: 60, uniprotdesc: "E3 ubiquitin-protein ligase that mediates ubiquitinationand subsequent proteasomal degradation of target proteins. E3ubiquitin ligases accept ubiquitin from an E2 ubiquitin-conjugating enzyme in the form of a thioester and then directlytransfers the ubiquitin to targeted substrates. Involved in JUNubiquitination and degradation. Directly involved in p53 (TP53)ubiquitination and degradation, thereby abolishing p53-dependenttranscription and apoptosis. Ubiquitinates p53 independently ofMDM2 or RCHY1. Probably mediates E3 ubiquitin ligase activity byfunctioning as the essential RING domain subunit of larger E3complexes. In contrast, it does not constitute the catalytic RINGsubunit in the DCX DET1-COP1 complex that negatively regulatesJUN, the ubiquitin ligase activity being mediated by RBX1.Involved in 14-3-3 protein sigma/SFN ubiquitination andproteasomal degradation, leading to AKT activation and promotionof cell survival. Ubiquitinates MTA1 leading to its proteasomaldegradation. ", isseed: false, uniprot: "Q8NHY2", isvalid: true, importance: 3, ox: 628.5248095687266, oy: 717.6053493094187, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPM1J", altered: 0, rank: 191, cited: 3, uniprotdesc: "", isseed: false, uniprot: "Q5JR12", isvalid: true, importance: 3, ox: 599.3044520604564, oy: 724.4002523321917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "BTG2", altered: 0, rank: 97, cited: 205, uniprotdesc: "Anti-proliferative protein; the function is mediated byassociation with deadenylase subunits of the CCR4-NOT complex.Activates mRNA deadenylation in a CNOT6 and CNOT7-dependentmanner. In vitro can inhibit deadenylase activity of CNOT7 andCNOT8. Involved in cell cycle regulation. Could be involved in thegrowth arrest and differentiation of the neuronal precursors (Bysimilarity). Modulates transcription regulation mediated by ESR1.Involved in mitochondrial depolarization and neurite outgrowth.", isseed: false, uniprot: "P78543", isvalid: true, importance: 3, ox: 569.5000000000001, oy: 727.8199946289078, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CD82", altered: 0, rank: 69, cited: 417, uniprotdesc: "Associates with CD4 or CD8 and delivers costimulatorysignals for the TCR/CD3 pathway.", isseed: false, uniprot: "P27701", isvalid: true, importance: 3, ox: 539.5, oy: 727.8199946289078, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIPK2", altered: 0, rank: 70, cited: 405, uniprotdesc: "Serine/threonine-protein kinase involved intranscription regulation, p53/TP53-mediated cellular apoptosis andregulation of the cell cycle. Acts as a corepressor of severaltranscription factors, including SMAD1 and POU4F1/Brn3a andprobably NK homeodomain transcription factors. PhosphorylatesPDX1, ATF1, PML, p53/TP53, CREB1, CTBP1, CBX4, RUNX1, EP300,CTNNB1, HMGA1 and ZBTB4. Inhibits cell growth and promotesapoptosis through the activation of p53/TP53 both at thetranscription level and at the protein level (by phosphorylationand indirect acetylation). The phosphorylation of p53/TP53 may bemediated by a p53/TP53-HIPK2-AXIN1 complex. Involved in theresponse to hypoxia by acting as a transcriptional co-suppressorof HIF1A. Mediates transcriptional activation of TP73. In responseto TGFB, cooperates with DAXX to activate JNK. Negative regulatorthrough phosphorylation and subsequent proteasomal degradation ofCTNNB1 and the antiapoptotic factor CTBP1. In the Wnt/beta-cateninsignaling pathway acts as an intermediate kinase betweenMAP3K7/TAK1 and NLK to promote the proteasomal degradation of MYB.Phosphorylates CBX4 upon DNA damage and promotes its E3 SUMO-protein ligase activity. Activates CREB1 and ATF1 transcriptionfactors by phosphorylation in response to genotoxic stress. Inresponse to DNA damage, stabilizes PML by phosphorylation. PML,HIPK2 and FBXO3 may act synergically to activate p53/TP53-dependent transactivation. Promotes angiogenesis, and is involvedin erythroid differentiation, especially during fetal livererythropoiesis. Phosphorylation of RUNX1 and EP300 stimulatesEP300 transcription regulation activity. Triggers ZBTB4 proteindegradation in response to DNA damage. Modulates HMGA1 DNA-bindingaffinity. In response to high glucose, triggers phosphorylation-mediated subnuclear localization shifting of PDX1. Involved in theregulation of eye size, lens formation and retinal laminationduring late embryogenesis. ", isseed: false, uniprot: "Q9H2X6", isvalid: true, importance: 3, ox: 509.69554793954376, oy: 724.4002523321917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DDB2", altered: 0, rank: 102, cited: 168, uniprotdesc: "Required for DNA repair. Binds to DDB1 to form the UV-damaged DNA-binding protein complex (the UV-DDB complex). The UV-DDB complex may recognize UV-induced DNA damage and recruitproteins of the nucleotide excision repair pathway (the NERpathway) to initiate DNA repair. The UV-DDB complex preferentiallybinds to cyclobutane pyrimidine dimers (CPD), 6-4 photoproducts(6-4 PP), apurinic sites and short mismatches. Also appears tofunction as the substrate recognition module for the DCX (DDB1-CUL4-X-box) E3 ubiquitin-protein ligase complex DDB1-CUL4-ROC1(also known as CUL4-DDB-ROC1 and CUL4-DDB-RBX1). The DDB1-CUL4-ROC1 complex may ubiquitinate histone H2A, histone H3 and histoneH4 at sites of UV-induced DNA damage. The ubiquitination ofhistones may facilitate their removal from the nucleosome andpromote subsequent DNA repair. The DDB1-CUL4-ROC1 complex alsoubiquitinates XPC, which may enhance DNA-binding by XPC andpromote NER. Isoform D1 and isoform D2 inhibit UV-damaged DNArepair. ", isseed: false, uniprot: "Q92466", isvalid: true, importance: 3, ox: 480.47519043127363, oy: 717.6053493094188, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2", altered: 0, rank: 7, cited: 5024, uniprotdesc: "E3 ubiquitin-protein ligase that mediates ubiquitinationof p53/TP53, leading to its degradation by the proteasome.Inhibits p53/TP53- and p73/TP73-mediated cell cycle arrest andapoptosis by binding its transcriptional activation domain. Alsoacts as a ubiquitin ligase E3 toward itself and ARRB1. Permits thenuclear export of p53/TP53. Promotes proteasome-dependentubiquitin-independent degradation of retinoblastoma RB1 protein.Inhibits DAXX-mediated apoptosis by inducing its ubiquitinationand degradation. Component of the TRIM28/KAP1-MDM2-p53/TP53complex involved in stabilizing p53/TP53. Also component of theTRIM28/KAP1-ERBB4-MDM2 complex which links growth factor and DNAdamage response pathways. Mediates ubiquitination and subsequentproteasome degradation of DYRK2 in nucleus. Ubiquitinates IGF1Rand SNAI1 and promotes them to proteasomal degradation.", isseed: false, uniprot: "Q00987", isvalid: true, importance: 3, ox: 599.0684773104314, oy: 636.667218490667, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CTSD", altered: 0, rank: 85, cited: 273, uniprotdesc: "Acid protease active in intracellular protein breakdown.Involved in the pathogenesis of several diseases such as breastcancer and possibly Alzheimer disease.", isseed: false, uniprot: "P07339", isvalid: true, importance: 3, ox: 425.2979066613468, oy: 694.287234475659, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NGFR", altered: 0, rank: 80, cited: 313, uniprotdesc: "Plays a role in the regulation of the translocation ofGLUT4 to the cell surface in adipocytes and skeletal muscle cellsin response to insulin, probably by regulating RAB31 activity, andthereby contributes to the regulation of insulin-dependent glucoseuptake (By similarity). Low affinity receptor which can bind toNGF, BDNF, NT-3, and NT-4. Can mediate cell survival as well ascell death of neural cells. Necessary for the circadianoscillation of the clock genes ARNTL/BMAL1, PER1, PER2 and NR1D1in the suprachiasmatic nucleus (SCN) of the brain and in liver andof the genes involved in glucose and lipid metabolism in theliver. ", isseed: false, uniprot: "P08138", isvalid: true, importance: 3, ox: 400.06030067641166, oy: 678.0680099519913, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CARM1", altered: 0, rank: 207, cited: 152, uniprotdesc: "Methylates (mono- and asymmetric dimethylation) theguanidino nitrogens of arginyl residues in several proteinsinvolved in DNA packaging, transcription regulation, pre-mRNAsplicing, and mRNA stability. Recruited to promoters upon geneactivation together with histone acetyltransferases fromEP300/P300 and p160 families, methylates histone H3 at 'Arg-17'(H3R17me), forming mainly asymmetric dimethylarginine (H3R17me2a),leading to activate transcription via chromatin remodeling. Duringnuclear hormone receptor activation and TCF7L2/TCF4 activation,acts synergically with EP300/P300 and either one of the p160histone acetyltransferases NCOA1/SRC1, NCOA2/GRIP1 and NCOA3/ACTRor CTNNB1/beta-catenin to activate transcription. During myogenictranscriptional activation, acts together with NCOA3/ACTR as acoactivator for MEF2C. During monocyte inflammatory stimulation,acts together with EP300/P300 as a coactivator for NF-kappa-B.Acts as coactivator for PPARG, promotes adipocyte differentiationand the accumulation of brown fat tissue. Plays a role in theregulation of pre-mRNA alternative splicing by methylation ofsplicing factors. Also seems to be involved in p53/TP53transcriptional activation. Methylates EP300/P300, both at 'Arg-2142', which may loosen its interaction with NCOA2/GRIP1, and at'Arg-580' and 'Arg-604' in the KIX domain, which impairs itsinteraction with CREB and inhibits CREB-dependent transcriptionalactivation. Also methylates arginine residues in RNA-bindingproteins PABPC1, ELAVL1 and ELAV4, which may affect their mRNA-stabilizing properties and the half-life of their target mRNAs.", isseed: false, uniprot: "Q86X55", isvalid: true, importance: 2, ox: 376.83605235723905, oy: 659.0776363377252, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TYRP1", altered: 0, rank: 87, cited: 265, uniprotdesc: "Oxidation of 5,6-dihydroxyindole-2-carboxylic acid(DHICA) into indole-5,6-quinone-2-carboxylic acid. May regulate orinfluence the type of melanin synthesized.", isseed: false, uniprot: "P17643", isvalid: true, importance: 3, ox: 355.92792529758043, oy: 637.5636821949564, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKDC", altered: 0, rank: 74, cited: 363, uniprotdesc: "Serine/threonine-protein kinase that acts as a molecularsensor for DNA damage. Involved in DNA non-homologous end joining(NHEJ) required for double-strand break (DSB) repair and V(D)Jrecombination. Must be bound to DNA to express its catalyticproperties. Promotes processing of hairpin DNA structures in V(D)Jrecombination by activation of the hairpin endonuclease artemis(DCLRE1C). The assembly of the DNA-PK complex at DNA ends is alsorequired for the NHEJ ligation step. Required to protect and alignbroken ends of DNA. May also act as a scaffold protein to aid thelocalization of DNA repair proteins to the site of damage. Foundat the ends of chromosomes, suggesting a further role in themaintenance of telomeric stability and the prevention ofchromosomal end fusion. Also involved in modulation oftranscription. Recognizes the substrate consensus sequence [ST]-Q.Phosphorylates 'Ser-139' of histone variant H2AX/H2AFX, therebyregulating DNA damage response mechanism. Phosphorylates DCLRE1C,c-Abl/ABL1, histone H1, HSPCA, c-jun/JUN, p53/TP53, PARP1, POU2F1,DHX9, SRF, XRCC1, XRCC1, XRCC4, XRCC5, XRCC6, WRN, MYC and RFA2.Can phosphorylate C1D not only in the presence of linear DNA butalso in the presence of supercoiled DNA. Ability to phosphorylatep53/TP53 in the presence of supercoiled DNA is dependent on C1D.Contributes to the determination of the circadian period length byantagonizing phosphorylation of CRY1 'Ser-588' and increasing CRY1protein stability, most likely through an indirect machanism.Interacts with CRY1 and CRY2; negatively regulates CRY1phosphorylation. ", isseed: false, uniprot: "P78527", isvalid: true, importance: 3, ox: 337.6084889085172, oy: 613.806614817288, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIC1", altered: 0, rank: 99, cited: 185, uniprotdesc: "Transcriptional repressor. Recognizes and binds to theconsensus sequence '5-[CG]NG[CG]GGGCA[CA]CC-3'. May act as a tumorsuppressor. May be involved in development of head, face, limbsand ventral body wall. Involved in down-regulation of SIRT1 andthereby is involved in regulation of p53/TP53-dependent apoptoticDNA-damage responses. The specific target gene promoterassociation seems to be depend on corepressors, such as CTBP1 orCTBP2 and MTA1. The regulation of SIRT1 transcription in responseto nutrient deprivation seems to involve CTBP1. In cooperationwith MTA1 (indicative for an association with the NuRD complex)represses transcription from CCND1/cyclin-D1 and CDKN1C/p57Kip2specifically in quiescent cells. Involved in regulation of the Wntsignaling pathway probably by association with TCF7L2 andpreventing TCF7L2 and CTNNB1 association with promoters of TCF-responsive genes. Seems to repress transcription from E2F1 andATOH1 which involves ARID1A, indicative for the participation of adistinct SWI/SNF-type chromatin-remodeling complex. Probablyrepresses transcription from ACKR3, FGFBP1 and EFNA1.", isseed: false, uniprot: "Q14526", isvalid: true, importance: 3, ox: 322.1165650593482, oy: 588.1161439097402, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TAP1", altered: 0, rank: 63, cited: 474, uniprotdesc: "Involved in the transport of antigens from the cytoplasmto the endoplasmic reticulum for association with MHC class Imolecules. Also acts as a molecular scaffold for the final stageof MHC class I folding, namely the binding of peptide. Nascent MHCclass I molecules associate with TAP via tapasin. Inhibited by thecovalent attachment of herpes simplex virus ICP47 protein, whichblocks the peptide-binding site of TAP. Inhibited by humancytomegalovirus US6 glycoprotein, which binds to the lumenal sideof the TAP complex and inhibits peptide translocation byspecifically blocking ATP-binding to TAP1 and prevents theconformational rearrangement of TAP induced by peptide binding.Inhibited by human adenovirus E3-19K glycoprotein, which binds theTAP complex and acts as a tapasin inhibitor, preventing MHC classI/TAP association. Expression of TAP1 is down-regulated by humanEpstein-Barr virus vIL-10 protein, thereby affecting the transportof peptides into the endoplasmic reticulum and subsequent peptideloading by MHC class I molecules.", isseed: false, uniprot: "Q03518", isvalid: true, importance: 3, ox: 309.6541146692916, oy: 560.8271840491045, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PYCARD", altered: 0, rank: 89, cited: 244, uniprotdesc: "Functions as key mediator in apoptosis and inflammation.Promotes caspase-mediated apoptosis involving predominantlycaspase-8 and also caspase-9 in a probable cell type-specificmanner. Involved in activation of the mitochondrial apoptoticpathway, promotes caspase-8-dependent proteolytic maturation ofBID independently of FADD in certain cell types and also mediatesmitochondrial translocation of BAX and activates BAX-dependentapoptosis coupled to activation of caspase-9, -2 and -3. Involvedin macrophage pyroptosis, a caspase-1-dependent inflammatory formof cell death and is the major constituent of the ASC pyroptosomewhich forms upon potassium depletion and rapidly recruits andactivates caspase-1. In innate immune response believed to act asan integral adapter in the assembly of the inflammasome whichactivates caspase-1 leading to processing and secretion ofproinflammatory cytokines. The function as activating adapter indifferent types of inflammasomes is mediated by the DAPIN and CARDdomains and their homotypic interactions. Required for recruitmentof caspase-1 to inflammasomes containing certain patternrecognition receptors, such as NLRP2, NLRP3, AIM2 and probablyIFI16. In the NLRP1 and NLRC4 inflammasomes seems not be requiredbut facilitates the processing of procaspase-1. In cooperationwith NOD2 involved in an inflammasome activated by bacterialmuramyl dipeptide leading to caspase-1 activation. May be involvedin DDX58-triggered proinflammatory responses and inflammasomeactivation. Isoform 2 may have a regulating effect on the functionas inflammasome adapter. Isoform 3 seems to inhibit inflammasome-mediated maturation of interleukin-1 beta. In collaboration withAIM2 which detects cytosolic double-stranded DNA may also beinvolved in a caspase-1-independent cell death that involvescaspase-8. In adaptive immunity may be involved in maturation ofdendritic cells to stimulate T-cell immunity and in cytoskeletalrearrangements coupled to chemotaxis and antigen uptake may beinvolved in post-transcriptional regulation of the guaninenucleotide exchange factor DOCK2; the latter function is proposedto involve the nuclear form. Also involved in transcriptionalactivation of cytokines and chemokines independent of theinflammasome; this function may involve AP-1, NF-kappa-B, MAPK andcaspase-8 signaling pathways. For regulation of NF-kappa-Bactivating and inhibiting functions have been reported. ModulatesNF-kappa-B induction at the level of the IKK complex by inhibitingkinase activity of CHUK and IKBK. Proposed to compete with RIPK2for association with CASP1 thereby down-regulating CASP1-mediatedRIPK2-dependent NF-kappa-B activation and activating interleukin-1beta processing. ", isseed: false, uniprot: "Q9ULZ3", isvalid: true, importance: 3, ox: 300.38360483804325, oy: 532.2954885602502, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "APC", altered: 0, rank: 22, cited: 2683, uniprotdesc: "Tumor suppressor. Promotes rapid degradation of CTNNB1and participates in Wnt signaling as a negative regulator. APCactivity is correlated with its phosphorylation state. Activatesthe GEF activity of SPATA13 and ARHGEF4. Plays a role inhepatocyte growth factor (HGF)-induced cell migration. Requiredfor MMP9 up-regulation via the JNK signaling pathway in colorectaltumor cells. Acts as a mediator of ERBB2-dependent stabilizationof microtubules at the cell cortex. It is required for thelocalization of MACF1 to the cell membrane and this localizationof MACF1 is critical for its function in microtubulestabilization. ", isseed: false, uniprot: "P25054", isvalid: true, importance: 3, ox: 294.42589083867097, oy: 502.89301172747867, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "RNF144B", altered: 0, rank: 190, cited: 4, uniprotdesc: "E3 ubiquitin-protein ligase which accepts ubiquitin fromE2 ubiquitin-conjugating enzymes UBE2L3 and UBE2L6 in the form ofa thioester and then directly transfers the ubiquitin to targetedsubstrates such as LCMT2, thereby promoting their degradation.Induces apoptosis via a p53/TP53-dependent but caspase-independentmechanism. However, its overexpression also produces a decrease ofthe ubiquitin-dependent stability of BAX, a pro-apoptotic protein,ultimately leading to protection of cell death; But, it is not ananti-apoptotic protein per se. ", isseed: false, uniprot: "Q7Z419", isvalid: true, importance: 3, ox: 291.8586405843057, oy: 473.0030598015978, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT2B", altered: 0, rank: 55, cited: 609, uniprotdesc: null, isseed: false, uniprot: null, isvalid: true, importance: 3, ox: 292.7153221081166, oy: 443.0152940167519, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MSH2", altered: 0, rank: 21, cited: 2696, uniprotdesc: "Component of the post-replicative DNA mismatch repairsystem (MMR). Forms two different heterodimers: MutS alpha (MSH2-MSH6 heterodimer) and MutS beta (MSH2-MSH3 heterodimer) whichbinds to DNA mismatches thereby initiating DNA repair. When bound,heterodimers bend the DNA helix and shields approximately 20 basepairs. MutS alpha recognizes single base mismatches anddinucleotide insertion-deletion loops (IDL) in the DNA. MutS betarecognizes larger insertion-deletion loops up to 13 nucleotideslong. After mismatch binding, MutS alpha or beta forms a ternarycomplex with the MutL alpha heterodimer, which is thought to beresponsible for directing the downstream MMR events, includingstrand discrimination, excision, and resynthesis. ATP binding andhydrolysis play a pivotal role in mismatch repair functions. TheATPase activity associated with MutS alpha regulates bindingsimilar to a molecular switch: mismatched DNA provokes ADP-->ATPexchange, resulting in a discernible conformational transitionthat converts MutS alpha into a sliding clamp capable ofhydrolysis-independent diffusion along the DNA backbone. Thistransition is crucial for mismatch repair. MutS alpha may alsoplay a role in DNA homologous recombination repair. In melanocytesmay modulate both UV-B-induced cell cycle regulation andapoptosis. ", isseed: false, uniprot: "P43246", isvalid: true, importance: 3, ox: 296.9847672563152, oy: 413.32065076032376, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP1R13L", altered: 0, rank: 140, cited: 63, uniprotdesc: "Regulator that plays a central role in regulation ofapoptosis and transcription via its interaction with NF-kappa-Band p53/TP53 proteins. Blocks transcription of HIV-1 virus byinhibiting the action of both NF-kappa-B and SP1. Also inhibitsp53/TP53 function, possibly by preventing the association betweenp53/TP53 and ASPP1 or ASPP2, and therefore suppressing thesubsequent activation of apoptosis. ", isseed: false, uniprot: "Q8WUF5", isvalid: true, importance: 3, ox: 304.6113172821198, oy: 384.3062451192653, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1", altered: 0, rank: 46, cited: 799, uniprotdesc: "NAD-dependent protein deacetylase that linkstranscriptional regulation directly to intracellular energeticsand participates in the coordination of several separated cellularfunctions such as cell cycle, response to DNA damage, metobolism,apoptosis and autophagy. Can modulate chromatin function throughdeacetylation of histones and can promote alterations in themethylation of histones and DNA, leading to transcriptionalrepression. Deacetylates a broad range of transcription factorsand coregulators, thereby regulating target gene expressionpositively and negatively. Serves as a sensor of the cytosolicratio of NAD(+)/NADH which is altered by glucose deprivation andmetabolic changes associated with caloric restriction. Isessential in skeletal muscle cell differentiation and in responseto low nutrients mediates the inhibitory effect on skeletalmyoblast differentiation which also involves 5'-AMP-activatedprotein kinase (AMPK) and nicotinamide phosphoribosyltransferase(NAMPT). Component of the eNoSC (energy-dependent nucleolarsilencing) complex, a complex that mediates silencing of rDNA inresponse to intracellular energy status and acts by recruitinghistone-modifying enzymes. The eNoSC complex is able to sense theenergy status of cell: upon glucose starvation, elevation ofNAD(+)/NADP(+) ratio activates SIRT1, leading to histone H3deacetylation followed by dimethylation of H3 at 'Lys-9' (H3K9me2)by SUV39H1 and the formation of silent chromatin in the rDNAlocus. Deacetylates 'Lys-266' of SUV39H1, leading to itsactivation. Inhibits skeletal muscle differentiation bydeacetylating PCAF and MYOD1. Deacetylates H2A and 'Lys-26' ofHIST1H1E. Deacetylates 'Lys-16' of histone H4 (in vitro). Involvedin NR0B2/SHP corepression function through chromatin remodeling:Recruited to LRH1 target gene promoters by NR0B2/SHP therebystimulating histone H3 and H4 deacetylation leading totranscriptional repression. Proposed to contribute to genomicintegrity via positive regulation of telomere length; however,reports on localization to pericentromeric heterochromatin areconflicting. Proposed to play a role in constitutiveheterochromatin (CH) formation and/or maintenance throughregulation of the available pool of nuclear SUV39H1. Uponoxidative/metabolic stress decreases SUV39H1 degradation byinhibiting SUV39H1 polyubiquitination by MDM2. This increase inSUV39H1 levels enhances SUV39H1 turnover in CH, which in turnseems to accelerate renewal of the heterochromatin whichcorrelates with greater genomic integrity during stress response.Deacetylates 'Lys-382' of p53/TP53 and impairs its ability toinduce transcription-dependent proapoptotic program and modulatecell senescence. Deacetylates TAF1B and thereby represses rDNAtranscription by the RNA polymerase I. Deacetylates MYC, promotesthe association of MYC with MAX and decreases MYC stabilityleading to compromised transformational capability. DeacetylatesFOXO3 in response to oxidative stress thereby increasing itsability to induce cell cycle arrest and resistance to oxidativestress but inhibiting FOXO3-mediated induction of apoptosistranscriptional activity; also leading to FOXO3 ubiquitination andprotesomal degradation. Appears to have a similar effect onMLLT7/FOXO4 in regulation of transcriptional activity andapoptosis. Deacetylates DNMT1; thereby impairs DNMT1methyltransferase-independent transcription repressor activity,modulates DNMT1 cell cycle regulatory function and DNMT1-mediatedgene silencing. Deacetylates RELA/NF-kappa-B p65 therebyinhibiting its transactivating potential and augments apoptosis inresponse to TNF-alpha. Deacetylates HIF1A, KAT5/TIP60, RB1 andHIC1. Deacetylates FOXO1 resulting in its nuclear retention andenhancement of its transcriptional activity leading to increasedgluconeogenesis in liver. Inhibits E2F1 transcriptional activityand apoptotic function, possibly by deacetylation. Involved inHES1- and HEY2-mediated transcriptional repression. In cooperationwith MYCN seems to be involved in transcriptional repression ofDUSP6/MAPK3 leading to MYCN stabilization by phosphorylation at'Ser-62'. Deacetylates MEF2D. Required for antagonist-mediatedtranscription suppression of AR-dependent genes which may belinked to local deacetylation of histone H3. Represses HNF1A-mediated transcription. Required for the repression of ESRRG byCREBZF. Modulates AP-1 transcription factor activity. DeacetylatesNR1H3 AND NR1H2 and deacetylation of NR1H3 at 'Lys-434' positivelyregulates transcription of NR1H3:RXR target genes, promotes NR1H3proteosomal degradation and results in cholesterol efflux; apromoter clearing mechanism after reach round of transcription isproposed. Involved in lipid metabolism. Implicated in regulationof adipogenesis and fat mobilization in white adipocytes byrepression of PPARG which probably involves association with NCOR1and SMRT/NCOR2. Deacetylates ACSS2 leading to its activation, andHMGCS1. Involved in liver and muscle metabolism. Throughdeacteylation and activation of PPARGC1A is required to activatefatty acid oxidation in skeletel muscle under low-glucoseconditions and is involved in glucose homeostasis. Involved inregulation of PPARA and fatty acid beta-oxidation in liver.Involved in positive regulation of insulin secretion in pancreaticbeta cells in response to glucose; the function seems to implytranscriptional repression of UCP2. Proposed to deacetylate IRS2thereby facilitating its insulin-induced tyrosine phosphorylation.Deacetylates SREBF1 isoform SREBP-1C thereby decreasing itsstability and transactivation in lipogenic gene expression.Involved in DNA damage response by repressing genes which areinvolved in DNA repair, such as XPC and TP73, deacetylatingXRCC6/Ku70, and faciliting recruitment of additional factors tosites of damaged DNA, such as SIRT1-deacetylated NBN can recruitATM to initiate DNA repair and SIRT1-deacetylated XPA interactswith RPA2. Also involved in DNA repair of DNA double-strand breaksby homologous recombination and specifically single-strandannealing independently of XRCC6/Ku70 and NBN. Transcriptionalsuppression of XPC probably involves an E2F4:RBL2 suppressorcomplex and protein kinase B (AKT) signaling. Transcriptionalsuppression of TP73 probably involves E2F4 and PCAF. DeacetylatesWRN thereby regulating its helicase and exonuclease activities andregulates WRN nuclear translocation in response to DNA damage.Deacetylates APEX1 at 'Lys-6' and 'Lys-7' and stimulates cellularAP endonuclease activity by promoting the association of APEX1 toXRCC1. Increases p53/TP53-mediated transcription-independentapoptosis by blocking nuclear translocation of cytoplasmicp53/TP53 and probably redirecting it to mitochondria. DeacetylatesXRCC6/Ku70 at 'Lys-539' and 'Lys-542' causing it to sequester BAXaway from mitochondria thereby inhibiting stress-inducedapoptosis. Is involved in autophagy, presumably by deacetylatingATG5, ATG7 and MAP1LC3B/ATG8. Deacetylates AKT1 which leads toenhanced binding of AKT1 and PDK1 to PIP3 and promotes theiractivation. Proposed to play role in regulation of STK11/LBK1-dependent AMPK signaling pathways implicated in cellularsenescence which seems to involve the regulation of theacetylation status of STK11/LBK1. Can deacetylate STK11/LBK1 andthereby increase its activity, cytoplasmic localization andassociation with STRAD; however, the relevance of such activity innormal cells is unclear. In endothelial cells is shown to inhibitSTK11/LBK1 activity and to promote its degradation. DeacetylatesSMAD7 at 'Lys-64' and 'Lys-70' thereby promoting its degradation.Deacetylates CIITA and augments its MHC class II transactivationand contributes to its stability. Deacteylates MECOM/EVI1. Isoform2 is shown to deacetylate 'Lys-382' of p53/TP53, however withlower activity than isoform 1. In combination, the two isoformsexert an additive effect. Isoform 2 regulates p53/TP53 expressionand cellular stress response and is in turn repressed by p53/TP53presenting a SIRT1 isoform-dependent auto-regulatory loop. In caseof HIV-1 infection, interacts with and deacetylates the viral Tatprotein. The viral Tat protein inhibits SIRT1 deacetylationactivity toward RELA/NF-kappa-B p65, thereby potentiates itstranscriptional activity and SIRT1 is proposed to contribute to T-cell hyperactivation during infection. Deacetylates PML at 'Lys-487' and this deacetylation promotes PML control of PER2 nuclearlocalization. During the neurogenic transition, repress selectiveNOTCH1-target genes through histone deacetylation in a BCL6-dependent manner and leading to neuronal differentiation.Regulates the circadian expression of several core clock genes,including ARNTL/BMAL1, RORC, PER2 and CRY1 and plays a criticalrole in maintaining a controlled rhythmicity in histoneacetylation, thereby contributing to circadian chromatinremodeling. Deacetylates ARNTL/BMAL1 and histones at the circadiangene promoters in order to facilitate repression by inhibitorycomponents of the circadian oscillator. Deacetylates PER2,facilitating its ubiquitination and degradation by the proteosome.Protects cardiomyocytes against palmitate-induced apoptosis(PubMed:11672523, PubMed:12006491, PubMed:14976264,PubMed:14980222, PubMed:15126506, PubMed:15152190,PubMed:15205477, PubMed:15469825, PubMed:15692560,PubMed:16079181, PubMed:16166628, PubMed:16892051,PubMed:16998810, PubMed:17283066, PubMed:17334224,PubMed:17505061, PubMed:17612497, PubMed:17620057,PubMed:17936707, PubMed:18203716, PubMed:18296641,PubMed:18662546, PubMed:18687677, PubMed:19188449,PubMed:19220062, PubMed:19364925, PubMed:19690166,PubMed:19934257, PubMed:20097625, PubMed:20100829,PubMed:20203304, PubMed:20375098, PubMed:20620956,PubMed:20670893, PubMed:20817729, PubMed:20975832,PubMed:21149730, PubMed:21245319, PubMed:21471201,PubMed:21504832, PubMed:21555002, PubMed:21698133,PubMed:21701047, PubMed:21775285, PubMed:21807113,PubMed:21841822, PubMed:21890893, PubMed:21909281,PubMed:21947282, PubMed:22274616). Deacetylates XBP1 isoform 2;deacetylation decreases protein stability of XBP1 isoform 2 andinhibits its transcriptional activity (By similarity).", isseed: false, uniprot: "Q96EB6", isvalid: true, importance: 3, ox: 632.4422863405995, oy: 420.5, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CASP10", altered: 0, rank: 100, cited: 181, uniprotdesc: "Involved in the activation cascade of caspasesresponsible for apoptosis execution. Recruited to both Fas- andTNFR-1 receptors in a FADD dependent manner. May participate inthe granzyme B apoptotic pathways. Cleaves and activates caspase-3, -4, -6, -7, -8, and -9. Hydrolyzes the small- moleculesubstrates, Tyr-Val-Ala-Asp-|-AMC and Asp-Glu-Val-Asp-|-AMC.", isseed: false, uniprot: "Q92851", isvalid: true, importance: 3, ox: 329.4955681394091, oy: 329.81733631298744, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SP1", altered: 0, rank: 204, cited: 351, uniprotdesc: "Transcription factor that can activate or represstranscription in response to physiological and pathologicalstimuli. Binds with high affinity to GC-rich motifs and regulatesthe expression of a large number of genes involved in a variety ofprocesses such as cell growth, apoptosis, differentiation andimmune responses. Highly regulated by post-translationalmodifications (phosphorylations, sumoylation, proteolyticcleavage, glycosylation and acetylation). Binds also the PDGFR-alpha G-box promoter. May have a role in modulating the cellularresponse to DNA damage. Implicated in chromatin remodeling. Playsa role in the recruitment of SMARCA4/BRG1 on the c-FOS promoter.Plays an essential role in the regulation of FE65 gene expression.In complex with ATF7IP, maintains telomerase activity in cancercells by inducing TERT and TERC gene expression. Isoform 3 is astronger activator of transcription than isoform 1. Positivelyregulates the transcription of the core clock componentARNTL/BMAL1. ", isseed: false, uniprot: "P08047", isvalid: true, importance: 2, ox: 346.42886470541225, oy: 305.05317940410407, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IRF5", altered: 0, rank: 101, cited: 180, uniprotdesc: "Transcription factor involved in the induction ofinterferons IFNA and INFB and inflammatory cytokines upon virusinfection. Activated by TLR7 or TLR8 signaling.", isseed: false, uniprot: "Q13568", isvalid: true, importance: 3, ox: 366.0746867237709, oy: 282.3806921734762, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "BAX", altered: 0, rank: 51, cited: 635, uniprotdesc: "Accelerates programmed cell death by binding to, andantagonizing the apoptosis repressor BCL2 or its adenovirushomolog E1B 19k protein. Under stress conditions, undergoes aconformation change that causes translocation to the mitochondrionmembrane, leading to the release of cytochrome c that thentriggers apoptosis. Promotes activation of CASP3, and therebyapoptosis. ", isseed: false, uniprot: "Q07812", isvalid: true, importance: 3, ox: 495.57608693571933, oy: 298.7290842958664, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CABIN1", altered: 0, rank: 132, cited: 77, uniprotdesc: "May be required for replication-independent chromatinassembly. May serve as a negative regulator of T-cell receptor(TCR) signaling via inhibition of calcineurin. Inhibition ofactivated calcineurin is dependent on both PKC and calciumsignals. Acts as a negative regulator of p53/TP53 by keeping p53in an inactive state on chromatin at promoters of a subset of it'starget genes. ", isseed: false, uniprot: "Q9Y6J0", isvalid: true, importance: 3, ox: 524.6080753437241, oy: 291.16974245431265, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD7", altered: 0, rank: 156, cited: 32, uniprotdesc: "Histone methyltransferase that specificallymonomethylates 'Lys-4' of histone H3. H3 'Lys-4' methylationrepresents a specific tag for epigenetic transcriptionalactivation. Plays a central role in the transcriptional activationof genes such as collagenase or insulin. Recruited by IPF1/PDX-1to the insulin promoter, leading to activate transcription. Hasalso methyltransferase activity toward non-histone proteins suchas p53/TP53, TAF10, and possibly TAF7 by recognizing and bindingthe [KR]-[STA]-K in substrate proteins. Monomethylates 'Lys-189'of TAF10, leading to increase the affinity of TAF10 for RNApolymerase II. Monomethylates 'Lys-372' of p53/TP53, stabilizingp53/TP53 and increasing p53/TP53-mediated transcriptionalactivation. ", isseed: false, uniprot: "Q8WTS6", isvalid: true, importance: 3, ox: 438.5698130049044, oy: 229.70989985711353, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD8", altered: 0, rank: 164, cited: 22, uniprotdesc: "Protein-lysine N-methyltransferase that monomethylatesboth histones and non-histone proteins. Specificallymonomethylates 'Lys-20' of histone H4 (H4K20me1). H4K20me1 isenriched during mitosis and represents a specific tag forepigenetic transcriptional repression. Mainly functions ineuchromatin regions, thereby playing a central role in thesilencing of euchromatic genes. Required for cell proliferation,probably by contributing to the maintenance of proper higher-orderstructure of DNA during mitosis. Involved in chromosomecondensation and proper cytokinesis. Nucleosomes are preferred assubstrate compared to free histones. Mediates monomethylation ofp53/TP53 at 'Lys-382', leading to repress p53/TP53-target genes.Plays a negative role in TGF-beta response regulation and apositive role in cell migration. ", isseed: false, uniprot: "Q9NQR1", isvalid: true, importance: 3, ox: 466.2035225983501, oy: 218.0317966675917, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "APAF1", altered: 0, rank: 83, cited: 278, uniprotdesc: "Oligomeric Apaf-1 mediates the cytochrome c-dependentautocatalytic activation of pro-caspase-9 (Apaf-3), leading to theactivation of caspase-3 and apoptosis. This activation requiresATP. Isoform 6 is less effective in inducing apoptosis.", isseed: false, uniprot: "O14727", isvalid: true, importance: 3, ox: 494.98831180678513, oy: 209.57981996234875, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "GDF15", altered: 0, rank: 91, cited: 232, uniprotdesc: "", isseed: false, uniprot: "Q99988", isvalid: true, importance: 3, ox: 388.1769208600632, oy: 262.09544516525557, group: "nodes", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, ], edges: [ { id: "TP53-controls-state-change-of-H1F0", source: "TP53", cited: 0, target: "H1F0", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-IRF5", source: "TP53", cited: 0, target: "IRF5", pubmed: ["11973653"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT8-controls-state-change-of-TP53", source: "KAT8", cited: 0, target: "TP53", pubmed: ["17189187", "17534149"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11-controls-state-change-of-TP53", source: "FBXO11", cited: 4, target: "TP53", pubmed: ["17098746"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP53", source: "ATR", cited: 24, target: "TP53", pubmed: [ "10202145", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11042698", "11096068", "11121242", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15665826", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19934315", "19962312", "20005840", "20024960", "20026654", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20696760", "20711232", "20931131", "20935676", "20962272", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9363941", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FBXO11-controls-state-change-of-NEDD8", source: "FBXO11", cited: 1, target: "NEDD8", pubmed: ["17098746"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP53", source: "ATM", cited: 237, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9733514", "9733515", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SMYD2-controls-state-change-of-TP53", source: "SMYD2", cited: 6, target: "TP53", pubmed: ["17108971"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "NGFR-controls-state-change-of-TP53", source: "NGFR", cited: 0, target: "TP53", pubmed: ["15668238"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAX-controls-expression-of-TP53", source: "MAX", cited: 0, target: "TP53", pubmed: ["8494784"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PRKAB1", source: "TP53", cited: 5, target: "PRKAB1", pubmed: ["16140933", "17409411"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2-controls-state-change-of-TP53", source: "MDM2", cited: 2748, target: "TP53", pubmed: [ "10734067", "11127820", "11340074", "11713287", "14654783", "14671306", "14702041", "15210108", "15242646", "16107876", "9153395", "9153396", "9450543", ], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD8-controls-state-change-of-TP53", source: "SETD8", cited: 8, target: "TP53", pubmed: ["17707234"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SETD7-controls-state-change-of-TP53", source: "SETD7", cited: 8, target: "TP53", pubmed: ["15525938", "17646389"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TYRP1", source: "TP53", cited: 0, target: "TYRP1", pubmed: ["10640990"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP63", source: "ATR", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCA-controls-state-change-of-TP53", source: "PRKCA", cited: 12, target: "TP53", pubmed: [ "10706102", "10733583", "11007451", "11423984", "11585729", "12080066", "14640983", "14744935", "15659650", "16227590", "17898864", "18812399", "19819244", "19933256", "9254608", "9315650", "9571186", "9620776", "9739174", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP63", source: "ATM", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP73", source: "CHEK2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-DDB2", source: "TP53", cited: 23, target: "DDB2", pubmed: ["11971958"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKCD-controls-state-change-of-TP53", source: "PRKCD", cited: 0, target: "TP53", pubmed: [ "10581258", "11030628", "11101524", "11300786", "11495913", "11740489", "11780126", "11875057", "12021785", "12093737", "12397361", "12427754", "12676607", "12860987", "12902982", "12907596", "14749479", "15322239", "15381073", "15471885", "15489221", "15526030", "15619621", "15657359", "15706352", "15750624", "15843377", "15870257", "15897882", "16219768", "16247456", "16377624", "16601678", "16717128", "16738336", "16793543", "17105820", "17107963", "17210684", "17332358", "17349958", "17349959", "17380123", "17567906", "17591690", "17891183", "17906639", "18056705", "18160537", "18216278", "18536714", "18560558", "18769132", "19465479", "19819244", "19828042", "19857493", "19861417", "19882354", "19965871", "20018442", "20024960", "20123963", "20171273", "20363803", "20514025", "20610713", "20673369", "20696760", "20811699", "20935676", "20962272", "21057547", "21383696", "21394211", "21642861", "21660965", "21765463", "21765464", "22011578", "22797063", "22878263", "23149944", "24145406", "24196445", "24379358", "24899407", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP63", source: "TP53", cited: 257, target: "TP63", pubmed: ["14576823"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PML", source: "TP53", cited: 102, target: "PML", pubmed: ["14992722"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATM-controls-state-change-of-TP73", source: "ATM", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP63", source: "WRN", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "ATR-controls-state-change-of-TP73", source: "ATR", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PCBP4", source: "TP53", cited: 0, target: "PCBP4", pubmed: ["10891498"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GADD45A", source: "TP53", cited: 45, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKDC-controls-state-change-of-TP53", source: "PRKDC", cited: 10, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10930428", "10958792", "11030628", "11042698", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11883897", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19345189", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21386980", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22496350", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GDF15", source: "TP53", cited: 18, target: "GDF15", pubmed: ["10618379"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP73", source: "WRN", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-SERPINE1", source: "TP53", cited: 35, target: "SERPINE1", pubmed: ["7479001"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PPM1J", source: "TP53", cited: 0, target: "PPM1J", pubmed: ["16260627"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP63", source: "HTT", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP1", source: "TP53", cited: 6, target: "CASP1", pubmed: ["11278253"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP63", source: "MAPK14", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP73", source: "HMGB1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP6", source: "TP53", cited: 13, target: "CASP6", pubmed: ["12089322"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP63", source: "MAPK13", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP53", source: "HTT", cited: 9, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP63", source: "MAPK12", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP63", source: "MAPK11", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-expression-of-CDKN1A", source: "SIRT1", cited: 0, target: "CDKN1A", pubmed: [], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP53", source: "PML", cited: 101, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP-controls-state-change-of-TP53", source: "CREBBP", cited: 72, target: "TP53", pubmed: ["18485870"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TAP1", source: "TP53", cited: 6, target: "TAP1", pubmed: ["10618714", "12857899"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP53", source: "MAPK13", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP53", source: "MAPK12", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP53", source: "MAPK14", cited: 65, target: "TP53", pubmed: [ "10202145", "10212189", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10747897", "10958792", "11030628", "11078726", "11096068", "11101524", "11121242", "11244509", "11258706", "11283254", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15657359", "15665826", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16552184", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17210684", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17942552", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20018442", "20024960", "20026654", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9372954", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP53", source: "MAPK11", cited: 0, target: "TP53", pubmed: ["10212189", "10747897", "17254968"], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-BAX", source: "TP53", cited: 95, target: "BAX", pubmed: ["14963330"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP63", source: "HMGB1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP73", source: "TP53", cited: 42, target: "TP73", pubmed: ["11314010"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP63", source: "PML", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP73", source: "PPP2CA", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP73", source: "PPP2CB", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "FOS-controls-expression-of-TP53", source: "FOS", cited: 12, target: "TP53", pubmed: ["10072388", "11136975"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CREBBP-controls-expression-of-GADD45A", source: "CREBBP", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CDKN1A", source: "TP53", cited: 1480, target: "CDKN1A", pubmed: [ "11080152", "15655109", "17110336", "17409421", "17707234", "17719541", "17938176", "18250150", "18485870", "19011621", "7796420", "8242752", ], isdirected: true, type: "controls-expression-of", datasource: ["Reactome", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PML-controls-state-change-of-TP73", source: "PML", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HMGB1-controls-state-change-of-TP53", source: "HMGB1", cited: 21, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP73", source: "IGBP1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HIPK2-controls-state-change-of-TP53", source: "HIPK2", cited: 98, target: "TP53", pubmed: [ "10581258", "11030628", "11101524", "11300786", "11495913", "11740489", "11780126", "11875057", "12021785", "12093737", "12397361", "12427754", "12676607", "12860987", "12902982", "12907596", "14749479", "15322239", "15381073", "15471885", "15489221", "15526030", "15619621", "15657359", "15706352", "15750624", "15843377", "15870257", "15897882", "16219768", "16247456", "16377624", "16601678", "16717128", "16738336", "16793543", "17105820", "17107963", "17210684", "17332358", "17349958", "17349959", "17380123", "17567906", "17591690", "17891183", "17906639", "18056705", "18160537", "18216278", "18536714", "18560558", "18769132", "19465479", "19819244", "19828042", "19857493", "19861417", "19882354", "19965871", "20018442", "20024960", "20123963", "20171273", "20363803", "20514025", "20610713", "20673369", "20696760", "20811699", "20935676", "20962272", "21057547", "21383696", "21394211", "21642861", "21660965", "21765463", "21765464", "22011578", "22797063", "22878263", "23149944", "24145406", "24196445", "24379358", "24899407", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RNF144B", source: "TP53", cited: 0, target: "RNF144B", pubmed: ["12853982"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HIC1", source: "TP53", cited: 22, target: "HIC1", pubmed: ["16301995"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIRA", source: "TP53", cited: 1, target: "HIRA", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK14-controls-state-change-of-TP73", source: "MAPK14", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-UBN1", source: "TP53", cited: 0, target: "UBN1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RB1", source: "TP53", cited: 262, target: "RB1", pubmed: ["8119988"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK11-controls-state-change-of-TP73", source: "MAPK11", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HMGA2", source: "TP53", cited: 5, target: "HMGA2", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HMGA1", source: "TP53", cited: 5, target: "HMGA1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK13-controls-state-change-of-TP73", source: "MAPK13", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MAPK12-controls-state-change-of-TP73", source: "MAPK12", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP63", source: "IGBP1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TP53I3", source: "TP53", cited: 28, target: "TP53I3", pubmed: ["11684014", "11919562", "17719542", "18485870"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DYRK1A-controls-state-change-of-TP53", source: "DYRK1A", cited: 1, target: "TP53", pubmed: [ "10202145", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11121242", "11244509", "11258706", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11583595", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12860987", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15665826", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18604166", "18614045", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19934315", "19962312", "20005840", "20024960", "20026654", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20696760", "20711232", "20931131", "20935676", "20962272", "21317932", "21383696", "21394211", "21423215", "21441950", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9363941", "9733515", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP73", source: "SUMO1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP63", source: "PRKAG1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP73", source: "SIRT1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP63", source: "PPP2CB", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP53", source: "CHEK2", cited: 73, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11042698", "11096068", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11585729", "11706017", "11707453", "11709713", "11711532", "11850826", "11861384", "11865061", "11875057", "11883897", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12151394", "12324477", "12384533", "12393500", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14640983", "14665630", "14712210", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15533933", "15542844", "15580310", "15619621", "15629715", "15659650", "15665826", "15671037", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16774943", "16783362", "16790523", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17108107", "17121812", "17135248", "17234789", "17245430", "17254968", "17283137", "17297446", "17297454", "17332358", "17339337", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17898864", "17936559", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18097051", "18159951", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18812399", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19477925", "19819244", "19828454", "19861417", "19882354", "19907922", "19933256", "19934315", "19962312", "20005840", "20009884", "20024960", "20026654", "20041275", "20080565", "20123963", "20353948", "20372057", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20931131", "20935676", "20962272", "21148320", "21317932", "21383696", "21386980", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22975381", "23148227", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24657168", "24711418", "24820418", "24958101", "25202122", "8327466", "9254608", "9315650", "9363941", "9571186", "9620776", "9733515", "9739174", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP63", source: "PPP2CA", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK7-controls-state-change-of-TP53", source: "CDK7", cited: 7, target: "TP53", pubmed: [ "10202145", "10348343", "10581258", "10656682", "10656795", "10706102", "10733583", "10747897", "11007451", "11101524", "11239457", "11300786", "11423984", "11495913", "11526498", "11583595", "11585729", "11707453", "11709713", "11850826", "11875057", "12021785", "12080066", "12091386", "12393879", "12397361", "12397362", "12427754", "12519780", "12676607", "12776195", "12860987", "12959929", "1406679", "14640983", "14665630", "14744935", "14968111", "15064747", "15155458", "15322239", "15471885", "15489221", "15619621", "15659650", "15792956", "15843377", "16083285", "16227590", "16319070", "16436515", "16552184", "16632641", "16651424", "16717128", "16818520", "17105820", "17108107", "17237827", "17591690", "17891183", "17898864", "17906639", "17942552", "17975552", "18490454", "18523266", "18718914", "18765533", "18769132", "18778462", "18812399", "19251701", "19369195", "19413330", "19819244", "19861417", "19882354", "19933256", "20009884", "20024960", "20123963", "20562916", "20663147", "20686112", "20962272", "21317932", "21383696", "21423215", "21455220", "21460857", "21832239", "22011578", "22112863", "22975381", "23312004", "23603988", "23871434", "24194938", "24657168", "8327466", "9254608", "9315650", "9372954", "9467949", "9571186", "9620776", "9739174", "9744860", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK9-controls-state-change-of-TP53", source: "CDK9", cited: 19, target: "TP53", pubmed: [ "10202145", "10348343", "10581258", "10644693", "10656682", "10656795", "10706102", "10733583", "10747897", "11078726", "11101524", "11239457", "11300786", "11423984", "11495913", "11526498", "11583595", "11687964", "11707453", "11709713", "11850826", "11875057", "12021785", "12091386", "12393879", "12397361", "12397362", "12427754", "12519780", "12676607", "12776195", "12860987", "12959929", "1406679", "14640983", "14665630", "14702041", "14744935", "14968111", "15064747", "15155458", "15302935", "15322239", "15471885", "15489221", "15619621", "15792956", "15843377", "16037820", "16083285", "16227590", "16319070", "16436515", "16552184", "16632641", "16651424", "16674116", "16717128", "16784539", "16818520", "17105820", "17108107", "17237827", "17287340", "17591690", "17891183", "17906639", "17942552", "17975552", "18490454", "18521083", "18523266", "18718914", "18765533", "18769132", "18778462", "18847512", "19251701", "19369195", "19413330", "19574224", "19664995", "19819244", "19861417", "19882354", "20009884", "20024960", "20123963", "20363803", "20562916", "20661218", "20663147", "20686112", "20808790", "20815410", "20962272", "21317932", "21383696", "21423215", "21455220", "21460857", "21659604", "21832239", "21983960", "22011578", "22112863", "22496350", "22547687", "22975381", "23201157", "23312004", "23603988", "23871434", "24194938", "24657168", "25159151", "7596441", "8327466", "9254608", "9315650", "9372954", "9467949", "9739174", "9744860", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK2-controls-state-change-of-TP53", source: "CDK2", cited: 26, target: "TP53", pubmed: [ "10581258", "10644693", "10656795", "11078726", "11283254", "11300786", "11687964", "11875057", "12021785", "12397361", "12397362", "12860987", "1406679", "14640983", "14702041", "14744935", "15302935", "15619621", "16037820", "16227590", "16552184", "16674116", "16784539", "17287340", "17906639", "17942552", "18521083", "18769132", "18847512", "19413330", "19574224", "19664995", "20363803", "20562916", "20661218", "20686112", "20808790", "20815410", "21659604", "21983960", "22011578", "22496350", "22547687", "23201157", "23312004", "25159151", "7596441", "8327466", "9254608", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK5-controls-state-change-of-TP53", source: "CDK5", cited: 23, target: "TP53", pubmed: [ "10202145", "10570149", "10581258", "10606744", "10608806", "10611322", "10656682", "10656795", "10673500", "10673501", "10706102", "10710310", "10713094", "10723129", "10733583", "10734067", "10744722", "10958792", "11030628", "11096068", "11101524", "11121242", "11175334", "11244509", "11258706", "11300786", "11313957", "11314044", "11397945", "11423984", "11447225", "11495913", "11526498", "11546806", "11551930", "11583595", "11706017", "11707453", "11709713", "11711532", "11740489", "11780126", "11850826", "11861384", "11865061", "11875057", "11896572", "11896587", "12021785", "12049739", "12071847", "12080066", "12082529", "12091386", "12093737", "12151394", "12324477", "12384533", "12393500", "12397361", "12397362", "12427754", "12511424", "12518062", "12519769", "12519780", "12531896", "12588868", "12606585", "12637545", "12676607", "12702572", "12756247", "12771937", "12776195", "12810724", "12860987", "12861053", "12890678", "12902982", "12907596", "12939400", "12955074", "12959929", "12969974", "1406679", "14517211", "14527925", "14612532", "14665630", "14712210", "14749479", "14871840", "14871926", "14968111", "15048074", "15064747", "15077171", "15078887", "15082766", "15140942", "15155458", "15159397", "15178764", "15181149", "15226429", "15254178", "15258567", "15269203", "15310764", "15322239", "15355354", "15361830", "15381073", "15456784", "15471885", "15489221", "15489892", "15526030", "15533933", "15542844", "15580310", "15619621", "15629715", "15657359", "15665826", "15671037", "15706352", "15750624", "15758953", "15775976", "15782130", "15792956", "15794754", "15843377", "15866171", "15870257", "15897882", "15963507", "16219768", "16223874", "16247456", "16288207", "16293623", "16377624", "16397295", "16436515", "16478990", "16489034", "16501611", "16552184", "16601678", "16632641", "16636671", "16648554", "16651424", "16714289", "16717128", "16731759", "16738336", "16774943", "16783362", "16790523", "16793543", "16818505", "16818520", "16891474", "16916644", "16949371", "17045821", "17105820", "17107963", "17108107", "17121812", "17135248", "17210684", "17234789", "17245430", "17283137", "17297446", "17297454", "17332358", "17339337", "17349958", "17349959", "17353187", "17363488", "17371838", "17380123", "17456577", "17486112", "17535811", "17553757", "17567906", "17591690", "17596534", "17609585", "17616578", "17668048", "17684018", "17698850", "17712528", "17855337", "17891183", "17906639", "17936559", "17942552", "17967874", "17975552", "17976513", "17977830", "18032786", "18045533", "18056442", "18056705", "18097051", "18159951", "18160537", "18216278", "18246126", "18272544", "18289945", "18332866", "18339864", "18345031", "18381438", "18406507", "18431490", "18449195", "18490454", "18536714", "18560558", "18593910", "18604166", "18614045", "18669630", "18715874", "18718914", "18765533", "18769132", "18778462", "18785202", "18794113", "18818083", "18847491", "18985806", "18995830", "19085961", "19203586", "19251701", "19266268", "19303885", "19465479", "19477925", "19819244", "19828042", "19828454", "19857493", "19861417", "19882354", "19907922", "19934315", "19962312", "19965871", "20005840", "20009884", "20018442", "20024960", "20026654", "20041275", "20080565", "20123963", "20171273", "20353948", "20363803", "20372057", "20514025", "20562916", "20599567", "20610713", "20637859", "20661218", "20663147", "20673369", "20696760", "20711232", "20811699", "20931131", "20935676", "20962272", "21057547", "21148320", "21317932", "21383696", "21394211", "21423215", "21441950", "21454683", "21465263", "21532626", "21642861", "21660965", "21757780", "21765463", "21765464", "21832239", "22002314", "22011578", "22030623", "22037398", "22055193", "22099307", "22112863", "22179839", "22285752", "22728651", "22797063", "22815859", "22878263", "22975381", "23148227", "23149944", "23150668", "23184057", "23678107", "23798621", "23871434", "23890999", "23982736", "24038750", "24145406", "24196445", "24379358", "24657168", "24711418", "24820418", "24899407", "24958101", "25202122", "8327466", "9363941", "9372954", "9733515", "9744860", "9843217", "9925639", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "IGBP1-controls-state-change-of-TP53", source: "IGBP1", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-BAX", source: "TP53", cited: 95, target: "BAX", pubmed: [ "10518217", "11080152", "11278953", "11684014", "11850816", "15598651", "17145718", "17189187", ], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CCNB1", source: "TP53", cited: 23, target: "CCNB1", pubmed: ["15710382"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP63", source: "SIRT1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP73", source: "PRKAG1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-MDM2", source: "TP53", cited: 2784, target: "MDM2", pubmed: ["12138177", "17409421", "7651818", "8319905"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CB-controls-state-change-of-TP53", source: "PPP2CB", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP2CA-controls-state-change-of-TP53", source: "PPP2CA", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CHEK2-controls-state-change-of-TP63", source: "CHEK2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CD82", source: "TP53", cited: 44, target: "CD82", pubmed: ["9736732"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-FDXR", source: "TP53", cited: 0, target: "FDXR", pubmed: ["12370809", "17409421"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HTT", source: "TP53", cited: 9, target: "HTT", pubmed: ["16278683"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CTSD", source: "TP53", cited: 0, target: "CTSD", pubmed: ["9619826"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SIRT1-controls-state-change-of-TP53", source: "SIRT1", cited: 50, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-CASP10", source: "TP53", cited: 0, target: "CASP10", pubmed: ["14688482"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-APAF1", source: "TP53", cited: 26, target: "APAF1", pubmed: ["11559530"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-HGF", source: "TP53", cited: 1, target: "HGF", pubmed: ["9023107"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT5-controls-state-change-of-TP53", source: "PRMT5", cited: 0, target: "TP53", pubmed: ["19011621"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-APC", source: "TP53", cited: 166, target: "APC", pubmed: ["11279192"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-BTG2", source: "TP53", cited: 14, target: "BTG2", pubmed: ["11814693"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRMT1-controls-expression-of-GADD45A", source: "PRMT1", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-ASF1A", source: "TP53", cited: 1, target: "ASF1A", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-FAS", source: "TP53", cited: 114, target: "FAS", pubmed: ["9841917"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "HTT-controls-state-change-of-TP73", source: "HTT", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAG1-controls-state-change-of-TP53", source: "PRKAG1", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-TRIAP1", source: "TP53", cited: 2, target: "TRIAP1", pubmed: ["15735003"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-RFWD2", source: "TP53", cited: 11, target: "RFWD2", pubmed: ["15103385"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP63", source: "EP300", cited: 2, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-COL18A1", source: "TP53", cited: 1, target: "COL18A1", pubmed: ["15958553"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-expression-of-GADD45A", source: "EP300", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP73", source: "PRKAB2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP53", source: "EP300", cited: 117, target: "TP53", pubmed: ["18485870"], isdirected: true, type: "controls-state-change-of", datasource: ["pid", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP73", source: "PRKAB1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1B", source: "TP53", cited: 2, target: "HIST1H1B", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "EP300-controls-state-change-of-TP73", source: "EP300", cited: 1, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1C", source: "TP53", cited: 4, target: "HIST1H1C", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1A", source: "TP53", cited: 0, target: "HIST1H1A", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CARM1-controls-expression-of-GADD45A", source: "CARM1", cited: 0, target: "GADD45A", pubmed: ["15186775", "18250150"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1D", source: "TP53", cited: 0, target: "HIST1H1D", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-HIST1H1E", source: "TP53", cited: 0, target: "HIST1H1E", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "WRN-controls-state-change-of-TP53", source: "WRN", cited: 46, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-MSH2", source: "TP53", cited: 109, target: "MSH2", pubmed: ["10984493", "11350971"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "KAT2B-controls-state-change-of-TP53", source: "KAT2B", cited: 34, target: "TP53", pubmed: ["17110336", "9744860", "9891054"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PYCARD", source: "TP53", cited: 13, target: "PYCARD", pubmed: ["14730312"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP53", source: "PRKAA2", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SP1-controls-expression-of-CCNB1", source: "SP1", cited: 1, target: "CCNB1", pubmed: ["15710382"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP53", source: "PRKAA1", cited: 1, target: "TP53", pubmed: [ "10202145", "10570149", "10606744", "10656795", "10673500", "10673501", "10706102", "10710310", "10733583", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11883897", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15355354", "15471885", "15489221", "15542844", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18246126", "18593910", "18669630", "18718914", "18778462", "18794113", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21386980", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-GPX1", source: "TP53", cited: 10, target: "GPX1", pubmed: ["16140933"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-state-change-of-CABIN1", source: "TP53", cited: 6, target: "CABIN1", pubmed: [ "15621527", "15655109", "16901784", "17158953", "17242198", "17242207", "23964094", ], isdirected: true, type: "controls-state-change-of", datasource: ["Reactome"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "MDM2-controls-state-change-of-NEDD8", source: "MDM2", cited: 10, target: "NEDD8", pubmed: ["15242646"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PLK3-controls-state-change-of-TP53", source: "PLK3", cited: 16, target: "TP53", pubmed: [ "10202145", "10570149", "10656795", "10673500", "10673501", "10706102", "10710310", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15471885", "15489221", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18593910", "18669630", "18718914", "18778462", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite", "pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP53", source: "PRKAB1", cited: 5, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP53", source: "SUMO1", cited: 39, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP63", source: "PRKAA1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PPP1R13L-controls-state-change-of-TP53", source: "PPP1R13L", cited: 13, target: "TP53", pubmed: [ "10581258", "11740489", "11780126", "16377624", "17349958", "17906639", ], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "TP53-controls-expression-of-PLK3", source: "TP53", cited: 16, target: "PLK3", pubmed: ["16140933"], isdirected: true, type: "controls-expression-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP63", source: "PRKAA2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP53", source: "PRKAB2", cited: 0, target: "TP53", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK1-controls-state-change-of-TP53", source: "DAPK1", cited: 6, target: "TP53", pubmed: [ "10202145", "10570149", "10606744", "10656795", "10673500", "10673501", "10706102", "10710310", "10733583", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11883897", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15355354", "15471885", "15489221", "15542844", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18246126", "18593910", "18669630", "18718914", "18778462", "18794113", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20847049", "20851891", "20959462", "20962272", "21148320", "21383696", "21386980", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "CDK1-controls-state-change-of-TP53", source: "CDK1", cited: 47, target: "TP53", pubmed: [ "10644693", "10656795", "11078726", "11300786", "11687964", "11875057", "12021785", "12397361", "12397362", "12860987", "1406679", "14640983", "14702041", "14744935", "15302935", "15619621", "16037820", "16227590", "16552184", "16674116", "16784539", "17287340", "17906639", "17942552", "18521083", "18769132", "18847512", "19413330", "19574224", "19664995", "20363803", "20562916", "20661218", "20686112", "20808790", "20815410", "21659604", "21983960", "22011578", "22496350", "22547687", "23201157", "23312004", "25159151", "7596441", "8327466", "9254608", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "DAPK3-controls-state-change-of-TP53", source: "DAPK3", cited: 0, target: "TP53", pubmed: [ "10202145", "10570149", "10656795", "10673500", "10673501", "10706102", "10710310", "10734067", "11030628", "11175334", "11244509", "11258706", "11397945", "11423984", "11447225", "11495913", "11526498", "11551930", "11583595", "11707453", "11850826", "11861384", "11875057", "11896572", "11896587", "12091386", "12384533", "12427754", "12531896", "12676607", "12756247", "12810724", "12860987", "12861053", "12902982", "12955074", "12959929", "12969974", "14517211", "14527925", "14612532", "14665630", "15064747", "15140942", "15254178", "15269203", "15322239", "15471885", "15489221", "15629715", "15671037", "15750624", "15843377", "15963507", "16377624", "16651424", "16731759", "16774943", "16818520", "17105820", "17121812", "17135248", "17245430", "17339337", "17353187", "17363488", "17698850", "17967874", "17977830", "18159951", "18593910", "18669630", "18718914", "18778462", "19819244", "19861417", "19882354", "20009884", "20024960", "20041275", "20562916", "20673369", "20696760", "20962272", "21148320", "21383696", "21454683", "21832239", "22030623", "22112863", "22285752", "22728651", "22797063", "22815859", "23798621", "23871434", "24657168", "8327466", ], isdirected: true, type: "controls-state-change-of", datasource: ["PhosphoSite"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB1-controls-state-change-of-TP63", source: "PRKAB1", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "SUMO1-controls-state-change-of-TP63", source: "SUMO1", cited: 1, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA1-controls-state-change-of-TP73", source: "PRKAA1", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "E4F1-controls-state-change-of-TP53", source: "E4F1", cited: 12, target: "TP53", pubmed: ["17110336", "9288740"], isdirected: true, type: "controls-state-change-of", datasource: ["pid"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAA2-controls-state-change-of-TP73", source: "PRKAA2", cited: 0, target: "TP73", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, { id: "PRKAB2-controls-state-change-of-TP63", source: "PRKAB2", cited: 0, target: "TP63", pubmed: [], isdirected: true, type: "controls-state-change-of", datasource: ["PANTHER"], group: "edges", removed: false, selected: false, selectable: true, locked: false, grabbable: true, classes: "", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-concentric/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import concentric from "@antv/f6-wx/extends/layout/concentricLayout"; /** * basic-concentric */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("concentric", concentric); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "concentric", maxLevelDiff: 0.5, sortBy: "degree", }, animate: true, defaultNode: { size: 5, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-concentric/index.json ================================================ { "navigationBarTitleText": "基本同心圆布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-concentric/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-concentric/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-dagre/data.js ================================================ export default { nodes: [ { id: "1", dataType: "alps", name: "alps_file1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "2", dataType: "alps", name: "alps_file2", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "3", dataType: "alps", name: "alps_file3", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "4", dataType: "sql", name: "sql_file1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "5", dataType: "sql", name: "sql_file2", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "6", dataType: "feature_etl", name: "feature_etl_1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "7", dataType: "feature_etl", name: "feature_etl_1", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, { id: "8", dataType: "feature_extractor", name: "feature_extractor", conf: [ { label: "conf", value: "pai_graph.conf", }, { label: "dot", value: "pai_graph.dot", }, { label: "init", value: "init.rc", }, ], }, ], edges: [ { source: "1", target: "2", }, { source: "1", target: "3", }, { source: "2", target: "4", }, { source: "3", target: "4", }, { source: "4", target: "5", }, { source: "5", target: "6", }, { source: "6", target: "7", }, { source: "6", target: "8", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-dagre/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * Dagre流程图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); F6.registerNode( "sql", { drawShape(cfg, group) { const rect = group.addShape("rect", { attrs: { x: -75, y: -25, width: 150, height: 50, radius: 10, stroke: "#5B8FF9", fill: "#C6E5FF", lineWidth: 3, }, name: "rect-shape", }); if (cfg.name) { group.addShape("text", { attrs: { text: cfg.name, x: 0, y: 0, fill: "#00287E", fontSize: 14, textAlign: "center", textBaseline: "middle", fontWeight: "bold", }, name: "text-shape", }); } return rect; }, }, "single-node", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, layout: { type: "dagre", nodesepFunc: (d) => { if (d.id === "3") { return 500; } return 50; }, ranksep: 70, controlPoints: true, }, defaultNode: { type: "sql", }, defaultEdge: { type: "polyline", style: { radius: 20, offset: 45, endArrow: true, lineWidth: 2, stroke: "#C2C8D5", }, }, nodeStateStyles: { selected: { stroke: "#d9d9d9", fill: "#5394ef", }, }, modes: { default: [ "drag-canvas", "zoom-canvas", "click-select", { type: "tooltip", formatText(model) { const cfg = model.conf; const text = []; cfg.forEach((row) => { text.push(`${row.label}:${row.value}
`); }); return text.join("\n"); }, offset: 30, }, ], }, fitView: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-dagre/index.json ================================================ { "navigationBarTitleText": "流程图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-dagre/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-dagre/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 基本力导向布局及节点拖拽 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", }, defaultNode: { size: 15, }, }); // 注册数据 this.graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); // 更新位置用的函数 function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 监听事件 this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { const forceLayout = this.graph.get("layoutController").layoutMethods[0]; forceLayout.execute(); refreshDragedNodePosition(e); }); this.graph.on("node:dragend", (e) => { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed/index.json ================================================ { "navigationBarTitleText": "基本力导向布局及节点拖拽", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 固定被拖拽节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, nodeSize: 20, }, modes: { default: ["drag-node"], }, defaultNode: { size: 20, }, }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } this.graph.on("node:dragstart", (e) => { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", (e) => { refreshDragedNodePosition(e); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/index.json ================================================ { "navigationBarTitleText": "固定被拖拽节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-grid/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-grid/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import grid from "@antv/f6-wx/extends/layout/gridLayout"; /** * basicGrid布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("grid", grid); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "grid", begin: [20, 20], width: width - 20, height: height - 20, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-grid/index.json ================================================ { "navigationBarTitleText": "基本网格布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-grid/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-grid/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-radial/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-radial/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * basic-radial */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-radial/index.json ================================================ { "navigationBarTitleText": "基本辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-radial/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/basic-radial/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-arc-diagram/data.js ================================================ export default { nodes: [ { id: "0", name: "analytics.cluster", cluster: "analytics", value: 21, }, { id: "1", name: "analytics.graph", cluster: "analytics", value: 34, }, { id: "2", name: "analytics.optimization", cluster: "analytics", value: 8, }, { id: "3", name: "animate", cluster: "animate", value: 40, }, { id: "4", name: "animate.interpolate", cluster: "animate", value: 18, }, { id: "5", name: "data.converters", cluster: "data", value: 25, }, { id: "6", name: "data", cluster: "data", value: 10, }, { id: "7", name: "display", cluster: "display", value: 4, }, { id: "8", name: "flex", cluster: "flex", value: 6, }, { id: "9", name: "physics", cluster: "physics", value: 22, }, { id: "10", name: "query", cluster: "query", value: 67, }, { id: "11", name: "query.methods", cluster: "query", value: 71, }, { id: "12", name: "scale", cluster: "scale", value: 33, }, { id: "13", name: "util", cluster: "util", value: 23, }, { id: "14", name: "util.heap", cluster: "util", value: 2, }, { id: "15", cluster: "util", name: "util.math", value: 2, }, { id: "16", name: "util.palette", cluster: "util", value: 5, }, { id: "17", name: "vis.axis", cluster: "vis", value: 24, }, { id: "18", name: "vis.controls", cluster: "vis", value: 28, }, { id: "19", name: "vis.data", cluster: "vis", value: 70, }, { id: "20", name: "vis.data.render", cluster: "vis", value: 11, }, { id: "21", name: "vis.events", cluster: "vis", value: 8, }, { id: "22", name: "vis.legend", cluster: "vis", value: 27, }, { id: "23", name: "vis.operator.distortion", cluster: "vis", value: 9, }, { id: "24", name: "vis.operator.encoder", cluster: "vis", value: 30, }, { id: "25", name: "vis.operator.filter", cluster: "vis", value: 17, }, { id: "26", name: "vis.operator", cluster: "vis", value: 27, }, { id: "27", name: "vis.operator.label", cluster: "vis", value: 18, }, { id: "28", name: "vis.operator.layout", cluster: "vis", value: 91, }, { id: "29", name: "vis", cluster: "vis", value: 13, }, ], edges: [ { source: "10", target: "10", sourceWeight: 61, targetWeight: 61, }, { source: "11", target: "11", sourceWeight: 39, targetWeight: 39, }, { source: "3", target: "3", sourceWeight: 30, targetWeight: 30, }, { source: "19", target: "19", sourceWeight: 26, targetWeight: 26, }, { source: "13", target: "13", sourceWeight: 23, targetWeight: 23, }, { source: "9", target: "9", sourceWeight: 22, targetWeight: 22, }, { source: "12", target: "12", sourceWeight: 19, targetWeight: 19, }, { source: "28", target: "19", sourceWeight: 34, targetWeight: 0, }, { source: "4", target: "4", sourceWeight: 16, targetWeight: 16, }, { source: "11", target: "10", sourceWeight: 32, targetWeight: 0, }, { source: "28", target: "28", sourceWeight: 14, targetWeight: 14, }, { source: "18", target: "18", sourceWeight: 12, targetWeight: 12, }, { source: "26", target: "26", sourceWeight: 11, targetWeight: 11, }, { source: "28", target: "13", sourceWeight: 20, targetWeight: 0, }, { source: "5", target: "6", sourceWeight: 17, targetWeight: 2, }, { source: "19", target: "13", sourceWeight: 17, targetWeight: 0, }, { source: "17", target: "17", sourceWeight: 7, targetWeight: 7, }, { source: "6", target: "6", sourceWeight: 7, targetWeight: 7, }, { source: "12", target: "13", sourceWeight: 14, targetWeight: 0, }, { source: "1", target: "19", sourceWeight: 14, targetWeight: 0, }, { source: "5", target: "5", sourceWeight: 7, targetWeight: 7, }, { source: "21", target: "19", sourceWeight: 6, targetWeight: 4, }, { source: "25", target: "19", sourceWeight: 10, targetWeight: 0, }, { source: "0", target: "0", sourceWeight: 5, targetWeight: 5, }, { source: "3", target: "13", sourceWeight: 9, targetWeight: 0, }, { source: "20", target: "19", sourceWeight: 5, targetWeight: 4, }, { source: "19", target: "12", sourceWeight: 9, targetWeight: 0, }, { source: "0", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "24", target: "19", sourceWeight: 8, targetWeight: 0, }, { source: "22", target: "22", sourceWeight: 4, targetWeight: 4, }, { source: "24", target: "24", sourceWeight: 4, targetWeight: 4, }, { source: "26", target: "3", sourceWeight: 7, targetWeight: 0, }, { source: "24", target: "16", sourceWeight: 7, targetWeight: 0, }, { source: "16", target: "16", sourceWeight: 3, targetWeight: 3, }, { source: "10", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "7", target: "7", sourceWeight: 3, targetWeight: 3, }, { source: "22", target: "13", sourceWeight: 6, targetWeight: 0, }, { source: "20", target: "20", sourceWeight: 3, targetWeight: 3, }, { source: "1", target: "26", sourceWeight: 6, targetWeight: 0, }, { source: "27", target: "19", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "12", sourceWeight: 6, targetWeight: 0, }, { source: "22", target: "7", sourceWeight: 6, targetWeight: 0, }, { source: "28", target: "3", sourceWeight: 6, targetWeight: 0, }, { source: "17", target: "7", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "27", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "13", sourceWeight: 5, targetWeight: 0, }, { source: "1", target: "3", sourceWeight: 5, targetWeight: 0, }, { source: "26", target: "29", sourceWeight: 3, targetWeight: 2, }, { source: "22", target: "16", sourceWeight: 5, targetWeight: 0, }, { source: "18", target: "21", sourceWeight: 4, targetWeight: 0, }, { source: "22", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "23", target: "23", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "29", sourceWeight: 2, targetWeight: 2, }, { source: "28", target: "17", sourceWeight: 4, targetWeight: 0, }, { source: "15", target: "15", sourceWeight: 2, targetWeight: 2, }, { source: "17", target: "12", sourceWeight: 4, targetWeight: 0, }, { source: "27", target: "27", sourceWeight: 2, targetWeight: 2, }, { source: "14", target: "14", sourceWeight: 2, targetWeight: 2, }, { source: "18", target: "29", sourceWeight: 3, targetWeight: 1, }, { source: "25", target: "26", sourceWeight: 3, targetWeight: 0, }, { source: "28", target: "9", sourceWeight: 3, targetWeight: 0, }, { source: "27", target: "7", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "12", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "18", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "20", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "13", sourceWeight: 3, targetWeight: 0, }, { source: "19", target: "6", sourceWeight: 3, targetWeight: 0, }, { source: "29", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "25", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "24", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "17", target: "3", sourceWeight: 3, targetWeight: 0, }, { source: "0", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "28", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "24", target: "26", sourceWeight: 2, targetWeight: 0, }, { source: "16", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "21", sourceWeight: 2, targetWeight: 0, }, { source: "21", target: "21", sourceWeight: 1, targetWeight: 1, }, { source: "29", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "14", sourceWeight: 2, targetWeight: 0, }, { source: "4", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "15", sourceWeight: 2, targetWeight: 0, }, { source: "8", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "2", target: "13", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "1", target: "1", sourceWeight: 1, targetWeight: 1, }, { source: "23", target: "17", sourceWeight: 2, targetWeight: 0, }, { source: "23", target: "19", sourceWeight: 2, targetWeight: 0, }, { source: "0", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "18", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "19", target: "3", sourceWeight: 2, targetWeight: 0, }, { source: "29", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "21", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "3", target: "4", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "22", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "26", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "17", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "5", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "12", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "20", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "21", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "6", sourceWeight: 1, targetWeight: 0, }, { source: "2", target: "3", sourceWeight: 1, targetWeight: 0, }, { source: "1", target: "29", sourceWeight: 1, targetWeight: 0, }, { source: "23", target: "28", sourceWeight: 1, targetWeight: 0, }, { source: "6", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "25", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "7", target: "13", sourceWeight: 1, targetWeight: 0, }, { source: "27", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "18", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "0", target: "26", sourceWeight: 1, targetWeight: 0, }, { source: "19", target: "7", sourceWeight: 1, targetWeight: 0, }, { source: "8", target: "19", sourceWeight: 1, targetWeight: 0, }, { source: "28", target: "29", sourceWeight: 1, targetWeight: 0, }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-arc-diagram/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import mds from "@antv/f6-wx/extends/layout/mdsLayout"; /** * 环形弧线图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const colors = [ "rgb(91, 143, 249)", "rgb(90, 216, 166)", "rgb(93, 112, 146)", "rgb(246, 189, 22)", "rgb(232, 104, 74)", "rgb(109, 200, 236)", "rgb(146, 112, 202)", "rgb(255, 157, 77)", "rgb(38, 154, 153)", "rgb(227, 137, 163)", ]; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = `source: ${model.sourceName}
target: ${model.targetName}`; return text; }, }, ], }, defaultNode: { style: { opacity: 0.8, lineWidth: 1, stroke: "#999", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { opacity: 0.6, lineAppendWidth: 3, }, }, }); // 订阅 this.graph.on("edge:mouseenter", function (e) { const edge = e.item; this.graph.setItemState(edge, "hover", true); }); this.graph.on("edge:mouseleave", function (e) { const edge = e.item; this.graph.setItemState(edge, "hover", false); }); // 处理数据 function scaleNodeProp(nodes, propName, refPropName, dataRange, outRange) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; nodes.forEach((n) => { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; }); } const origin = [width / 2, height / 2]; const radius = width < height ? width / 3 : height / 3; const { edges } = data; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; const n = nodes.length; const angleSep = (Math.PI * 2) / n; nodes.forEach((node, i) => { const angle = i * angleSep; node.x = radius * Math.cos(angle) + origin[0]; node.y = radius * Math.sin(angle) + origin[1]; node.angle = angle; nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const id = clusterMap.get(node.cluster); if (node.style) { node.style.fill = colors[id % colors.length]; } else { node.style = { fill: colors[id % colors.length], }; } // label node.label = node.name; node.labelCfg = { position: "center", style: { rotate: angle, rotateCenter: "lefttop", textAlign: "start", }, }; }); edges.forEach((edge) => { edge.type = "quadratic"; const source = nodeMap.get(edge.source); const target = nodeMap.get(edge.target); edge.controlPoints = [ { x: origin[0], y: origin[1], }, ]; edge.color = source.style.fill; edge.sourceName = source.name; edge.targetName = target.name; }); // map the value to node size let maxValue = -9999; let minValue = 9999; nodes.forEach((k) => { if (maxValue < k.value) maxValue = k.value; if (minValue > k.value) minValue = k.value; }); const sizeRange = [3, 30]; const sizeDataRange = [minValue, maxValue]; scaleNodeProp(nodes, "size", "value", sizeDataRange, sizeRange); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-arc-diagram/index.json ================================================ { "navigationBarTitleText": "环形弧线图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-arc-diagram/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-arc-diagram/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-configuration-translate/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; /** * Circular布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, discription: "Circular layout with radius: take full use of the canvas, ordering: topology", }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); setInterval(() => { layoutConfigTranslation(); }, 11500); function layoutConfigTranslation() { setTimeout(() => { me.setData({ discription: "Circular layout, radius = 200, divisions = 5, ordering: degree", }); me.graph.updateLayout({ radius: 200, startAngle: Math.PI / 4, endAngle: Math.PI, divisions: 5, ordering: "degree", }); }, 1000); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 200, divisions = 3, ordering: degree", }); me.graph.updateLayout({ startAngle: Math.PI / 4, endAngle: Math.PI, divisions: 3, }); }, 2500); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 200, divisions = 8, ordering: degree", }); me.graph.updateLayout({ radius: 200, startAngle: 0, endAngle: Math.PI / 2, divisions: 8, }); }, 4000); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 10~300(spiral), endAngle: PI, divisions = 1, ordering: degree", }); me.graph.updateLayout({ radius: null, startRadius: 10, endRadius: 300, divisions: 1, startAngle: 0, endAngle: Math.PI, }); }, 5500); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 10~300(spiral),endAngle: 2 * PI, divisions= 1, ordering: degree", }); me.graph.updateLayout({ endAngle: 2 * Math.PI, }); }, 7000); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 200, ordering: degree", }); me.graph.updateLayout({ radius: 200, }); }, 8500); setTimeout(() => { me.setData({ discription: "Circular layout, radius = 200, ordering: topology", }); me.graph.updateLayout({ radius: 200, ordering: "topology", }); }, 10000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-configuration-translate/index.json ================================================ { "navigationBarTitleText": "参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-configuration-translate/index.wxml ================================================ {{discription}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/circular-configuration-translate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/cluster-grid/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", cluster: "0", }, { id: "1", label: "1", cluster: "0", }, { id: "2", label: "2", cluster: "0", }, { id: "3", label: "3", cluster: "0", }, { id: "4", label: "4", cluster: "0", }, { id: "5", label: "5", cluster: "3", }, { id: "6", label: "6", cluster: "0", }, { id: "7", label: "7", cluster: "0", }, { id: "8", label: "8", cluster: "0", }, { id: "9", label: "9", cluster: "3", }, { id: "10", label: "10", cluster: "3", }, { id: "11", label: "11", cluster: "2", }, { id: "12", label: "12", cluster: "2", }, { id: "13", label: "13", cluster: "4", }, { id: "14", label: "14", cluster: "2", }, { id: "15", label: "15", cluster: "2", }, { id: "16", label: "16", cluster: "2", }, { id: "17", label: "17", cluster: "1", }, { id: "18", label: "18", cluster: "4", }, { id: "19", label: "19", cluster: "4", }, { id: "20", label: "20", cluster: "4", }, { id: "21", label: "21", cluster: "0", }, { id: "22", label: "22", cluster: "2", }, { id: "23", label: "23", cluster: "2", }, { id: "24", label: "24", cluster: "2", }, { id: "25", label: "25", cluster: "3", }, { id: "26", label: "26", cluster: "4", }, { id: "27", label: "27", cluster: "4", }, { id: "28", label: "28", cluster: "1", }, { id: "29", label: "29", cluster: "1", }, { id: "30", label: "30", cluster: "4", }, { id: "31", label: "31", cluster: "4", }, { id: "32", label: "32", cluster: "1", }, { id: "33", label: "33", cluster: "2", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach((node) => { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) node.style = {}; node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); export default data; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/cluster-grid/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import grid from "@antv/f6-wx/extends/layout/gridLayout"; /** * 指定排序方式的网格布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("grid", grid); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, layout: { type: "grid", begin: [20, 20], width: width - 20, height: height - 20, sortBy: "cluster", }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/cluster-grid/index.json ================================================ { "navigationBarTitleText": "指定排序方式的网格布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/cluster-grid/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/cluster-grid/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/custom-bi-graph/data.js ================================================ export default { nodes: [ { id: "0", label: "A", cluster: "part1", }, { id: "1", label: "B", cluster: "part1", }, { id: "2", label: "C", cluster: "part1", }, { id: "3", label: "D", cluster: "part1", }, { id: "4", label: "E", cluster: "part1", }, { id: "5", label: "F", cluster: "part1", }, { id: "6", label: "a", cluster: "part2", }, { id: "7", label: "b", cluster: "part2", }, { id: "8", label: "c", cluster: "part2", }, { id: "9", label: "d", cluster: "part2", }, ], edges: [ { source: "0", target: "6", }, { source: "0", target: "7", }, { source: "0", target: "9", }, { source: "1", target: "6", }, { source: "1", target: "9", }, { source: "1", target: "7", }, { source: "2", target: "8", }, { source: "2", target: "9", }, { source: "2", target: "6", }, { source: "3", target: "8", }, { source: "4", target: "6", }, { source: "4", target: "7", }, { source: "5", target: "9", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/custom-bi-graph/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * custom-bi-graph */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("bigraphLayout", { execute() { const self = this; const center = self.center || [0, 0]; const biSep = self.biSep || 100; const nodeSep = self.nodeSep || 20; const nodeSize = self.nodeSize || 20; const direction = self.direction || "horizontal"; let part1Pos = 0; let part2Pos = 0; if (direction === "horizontal") { part1Pos = center[0] - biSep / 2; part2Pos = center[0] + biSep / 2; } const { nodes, edges } = self; const part1Nodes = []; const part2Nodes = []; const part1NodeMap = new Map(); const part2NodeMap = new Map(); // separate the nodes and init the positions nodes.forEach((node, i) => { if (node.cluster === "part1") { part1Nodes.push(node); part1NodeMap.set(node.id, i); } else { part2Nodes.push(node); part2NodeMap.set(node.id, i); } }); // order the part1 node part1Nodes.forEach((p1n) => { let index = 0; let adjCount = 0; edges.forEach((edge) => { const sourceId = edge.source; const targetId = edge.target; if (sourceId === p1n.id) { index += part2NodeMap.get(targetId); adjCount += 1; } else if (targetId === p1n.id) { index += part2NodeMap.get(sourceId); adjCount += 1; } }); index /= adjCount; p1n.index = index; }); part1Nodes.sort((a, b) => { return a.index - b.index; }); part2Nodes.forEach((p2n) => { let index = 0; let adjCount = 0; edges.forEach((edge) => { const sourceId = edge.source; const targetId = edge.target; if (sourceId === p2n.id) { index += part1NodeMap.get(targetId); adjCount += 1; } else if (targetId === p2n.id) { index += part1NodeMap.get(sourceId); adjCount += 1; } }); index /= adjCount; p2n.index = index; }); part2Nodes.sort((a, b) => { return a.index - b.index; }); // place the nodes const hLength = part1Nodes.length > part2Nodes.length ? part1Nodes.length : part2Nodes.length; const height = hLength * (nodeSep + nodeSize); let begin = center[1] - height / 2; if (direction === "vertical") { begin = center[0] - height / 2; } part1Nodes.forEach((p1n, i) => { if (direction === "horizontal") { p1n.x = part1Pos; p1n.y = begin + i * (nodeSep + nodeSize); } else { p1n.x = begin + i * (nodeSep + nodeSize); p1n.y = part1Pos; } }); part2Nodes.forEach((p2n, i) => { if (direction === "horizontal") { p2n.x = part2Pos; p2n.y = begin + i * (nodeSep + nodeSize); } else { p2n.x = begin + i * (nodeSep + nodeSize); p2n.y = part2Pos; } }); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "bigraphLayout", biSep: 300, nodeSep: 20, nodeSize: 20, }, animate: true, defaultNode: { size: 20, style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, color: "#e2e2e2", }, modes: { default: ["drag-canvas"], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/custom-bi-graph/index.json ================================================ { "navigationBarTitleText": "自定义二分图布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/custom-bi-graph/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/custom-bi-graph/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * 自左向右的Dagre */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", rankdir: "LR", align: "DL", nodesepFunc: () => 1, ranksepFunc: () => 1, }, defaultNode: { size: [30, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre/index.json ================================================ { "navigationBarTitleText": "自左向右的流程图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-UL/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "1", target: "4", }, { source: "0", target: "3", }, { source: "3", target: "4", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "7", }, { source: "5", target: "8", }, { source: "8", target: "9", }, { source: "2", target: "9", }, { source: "3", target: "9", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-UL/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * 自左向右的Dagre上对齐 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", rankdir: "LR", align: "UL", controlPoints: true, nodesepFunc: () => 1, ranksepFunc: () => 1, }, defaultNode: { size: [30, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { type: "polyline", size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, radius: 20, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-UL/index.json ================================================ { "navigationBarTitleText": "自左向右的流程图对齐", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-UL/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-UL/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-combo/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", comboId: "A", }, { id: "5", label: "5", comboId: "B", }, { id: "6", label: "6", comboId: "A", }, { id: "7", label: "7", comboId: "C", }, { id: "8", label: "8", comboId: "C", }, { id: "9", label: "9", comboId: "A", }, { id: "10", label: "10", comboId: "B", }, { id: "11", label: "11", comboId: "B", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "1", target: "4", }, { source: "0", target: "3", }, { source: "3", target: "4", }, { source: "2", target: "5", }, { source: "1", target: "6", }, { source: "1", target: "7", }, { source: "3", target: "8", }, { source: "3", target: "9", }, { source: "5", target: "10", }, { source: "5", target: "11", }, ], combos: [ { id: "A", label: "combo A", style: { fill: "#C4E3B2", stroke: "#C4E3B2", }, }, { id: "B", label: "combo B", style: { stroke: "#99C0ED", fill: "#99C0ED", }, }, { id: "C", label: "combo C", style: { stroke: "#eee", fill: "#eee", }, }, ], }; data.nodes.forEach((node) => { switch (node.ComboId) { case "A": node.style = { fill: "#C4E3B2", stroke: "#aaa", }; break; case "B": node.style = { fill: "#99C0ED", stroke: "#aaa", }; break; case "C": node.style = { fill: "#eee", stroke: "#aaa", }; break; default: node.style = { fill: "#FDE1CE", stroke: "#aaa", }; break; } }); export default data; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-combo/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * dagre-combo */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, sortByCombo: false, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, description: "Enable sortByCombo", }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, handleClickButton() { console.log("click", this.sortByCombo); this.sortByCombo = !this.sortByCombo; this.setData({ description: this.sortByCombo ? "Disable sortByCombo" : "Enable sortByCombo", }); const { sortByCombo } = this; this.graph.updateLayout({ sortByCombo, }); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, animate: true, groupByTypes: false, modes: { default: [ "drag-combo", "drag-node", "drag-canvas", { type: "collapse-expand-combo", relayout: false, }, ], }, layout: { type: "dagre", sortByCombo: false, ranksep: 10, nodesep: 10, }, defaultNode: { size: [60, 30], type: "rect", anchorPoints: [ [0.5, 0], [0.5, 1], ], }, defaultEdge: { type: "line", }, defaultCombo: { type: "rect", style: { fillOpacity: 0.1, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-combo/index.json ================================================ { "navigationBarTitleText": "带有Combo的流程图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-combo/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-combo/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-configuration-translate/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * Dagre布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, description: "", }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", nodeSize: [40, 20], nodesep: 1, ranksep: 1, }, animate: true, defaultNode: { size: [40, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); function layoutConfigTranslation() { setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 1, layout direction: Top->Bottom, alignment of nodes: DL", }); me.graph.updateLayout({ ranksep: 10, }); }, 1000); setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: DL", }); me.graph.updateLayout({ nodesep: 5, }); }, 2500); setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UL", }); me.graph.updateLayout({ align: "UL", }); }, 4000); setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UR", }); me.graph.updateLayout({ align: "UR", }); }, 5500); setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", }); me.graph.updateLayout({ rankdir: "LR", align: "DL", }); }, 7000); setTimeout(() => { me.setData({ description: "Dagre layout, rank seperation: 30, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", }); me.graph.updateLayout({ ranksep: 30, }); }, 8500); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-configuration-translate/index.json ================================================ { "navigationBarTitleText": "布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-configuration-translate/index.wxml ================================================ {{description}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/dagre-configuration-translate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/data-change/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const data2 = { nodes: [ { id: "b0", label: "0", }, { id: "b1", label: "1", }, { id: "b2", label: "2", }, { id: "b3", label: "3", }, { id: "b4", label: "4", }, { id: "b5", label: "5", }, ], edges: [ { id: "be1", source: "b0", target: "b1", }, { id: "be2", source: "b0", target: "b2", }, { id: "be3", source: "b0", target: "b3", }, { id: "be4", source: "b0", target: "b4", }, { id: "be5", source: "b0", target: "b5", }, ], }; export { data, data2 }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/data-change/index.js ================================================ import F6 from "@antv/f6-wx"; import { data, data2 } from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * layoutTranslate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "force", }, // animate: true, defaultNode: { size: 20, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 切换数据 setTimeout(() => { this.graph.changeData(data2); }, 2500); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/data-change/index.json ================================================ { "navigationBarTitleText": "数据动态切换", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/data-change/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/data-change/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/degree-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/degree-circular/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; /** * 按照节点度数排序的Circular */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", ordering: "degree", }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/degree-circular/index.json ================================================ { "navigationBarTitleText": "按节点度数排序", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/degree-circular/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/degree-circular/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/division-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/division-circular/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; /** * 分割环形布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", divisions: 5, radius: 200, startAngle: Math.PI / 4, endAngle: Math.PI, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/division-circular/index.json ================================================ { "navigationBarTitleText": "分割环形布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/division-circular/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/division-circular/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-bubbles/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", value: 10, cluster: "a", description: "this is node 0, \nand the value of it is 10", }, { id: "1", label: "1", value: 20, cluster: "b", description: "this is node 1, \nand the value of it is 20", }, { id: "2", label: "2", value: 5, cluster: "a", description: "this is node 2, \nand the value of it is 5", }, { id: "3", label: "3", value: 10, cluster: "a", description: "this is node 3, \nand the value of it is 10", }, { id: "4", label: "4", value: 12, cluster: "c", subCluster: "sb", description: "this is node 4, \nand the value of it is 12", }, { id: "5", label: "5", value: 18, cluster: "c", subCluster: "sa", description: "this is node 5, \nand the value of it is 18", }, { id: "6", label: "6", value: 3, cluster: "c", subCluster: "sa", description: "this is node 6, \nand the value of it is 3", }, { id: "7", label: "7", value: 7, cluster: "b", subCluster: "sa", description: "this is node 7, \nand the value of it is 7", }, { id: "8", label: "8", value: 21, cluster: "d", subCluster: "sb", description: "this is node 8, \nand the value of it is 21", }, { id: "9", label: "9", value: 9, cluster: "d", subCluster: "sb", description: "this is node 9, \nand the value of it is 9", }, ], edges: [], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-bubbles/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 力导向气泡图 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", nodeStrength: 30, collideStrength: 0.7, alphaDecay: 0.01, preventOverlap: true, }, modes: { default: ["drag-node"], }, defaultNode: { size: [10, 10], }, }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true, }); } else { obj[key] = value; } return obj; } const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const nodeMap = new Map(); const clusterMap = new Map(); let clusterId = 0; nodes.forEach((node) => { nodeMap.set(node.id, node); // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) node.style = {}; node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; node.x = width / 2 + 200 * (Math.random() - 0.5); node.y = height / 2 + 200 * (Math.random() - 0.5); }); // map the value to node size let maxNodeValue = -9999; let minNodeValue = 9999; nodes.forEach((n) => { if (maxNodeValue < n.value) maxNodeValue = n.value; if (minNodeValue > n.value) minNodeValue = n.value; }); const nodeSizeRange = [10, 30]; const nodeSizeDataRange = [minNodeValue, maxNodeValue]; scaleNodeProp(nodes, "size", "value", nodeSizeDataRange, nodeSizeRange); nodes.forEach((node) => { node.oriSize = node.size; node.oriLabel = node.label; }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 监听 this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", (e) => { refreshDragedNodePosition(e); }); this.graph.on("node:dragend", (e) => { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.on("node:click", function (e) { const node = e.item; const states = node.getStates(); let clicked = false; const model = node.getModel(); let size = 200; let labelText = `NODE: ${model.id}\n${model.description}`; states.forEach((state) => { if (state === "click") { clicked = true; size = model.oriSize; labelText = model.oriLabel; } }); this.graph.setItemState(node, "click", !clicked); this.graph.updateItem(node, { size, label: labelText, }); this.graph.layout(); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); function scaleNodeProp( elements, propName, refPropName, dataRange, outRange, ) { const outLength = outRange[1] - outRange[0]; const dataLength = dataRange[1] - dataRange[0]; elements.forEach((n) => { if (propName.split(".")[0] === "style") { if (n.style) { n.style[propName.split(".")[1]] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; } else { n.style = _defineProperty( {}, propName.split(".")[1], ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0], ); } } else { n[propName] = ((n[refPropName] - dataRange[0]) * outLength) / dataLength + outRange[0]; } }); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-bubbles/index.json ================================================ { "navigationBarTitleText": "力导向气泡图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-bubbles/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-bubbles/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-constrained-in-rect/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-constrained-in-rect/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 约束在范围内布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); const { nodes } = data; // 包裹范围的参数 const constrainBox = { x: 60, y: 50, width: 500, height: 150 }; const onTick = () => { let minx = 99999999; let maxx = -99999999; let miny = 99999999; let maxy = -99999999; let maxsize = -9999999; nodes.forEach((node) => { if (minx > node.x) { minx = node.x; } if (maxx < node.x) { maxx = node.x; } if (miny > node.y) { miny = node.y; } if (maxy < node.y) { maxy = node.y; } if (maxsize < node.size) { maxsize = node.size; } }); const scalex = (constrainBox.width - maxsize) / (maxx - minx); const scaley = (constrainBox.height - maxsize) / (maxy - miny); nodes.forEach((node) => { node.x = (node.x - minx) * scalex + constrainBox.x; node.y = (node.y - miny) * scaley + constrainBox.y; }); }; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", onTick, }, defaultNode: { size: 15, }, }); this.graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-constrained-in-rect/index.json ================================================ { "navigationBarTitleText": "约束在范围内布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-constrained-in-rect/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-constrained-in-rect/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-configuration-translate/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-configuration-translate/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 力导向布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, desc: "", }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "force", linkDistance: 50, center: [width / 2, height / 2], }, animate: true, defaultNode: { size: 20, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); const my = this; setInterval(() => { layoutConfigTranslation(); }, 5000); function layoutConfigTranslation() { setTimeout(() => { my.setData({ desc: "Force layout, linkDistance = 100, preventOverlap: true", }); my.graph.updateLayout({ linkDistance: 100, preventOverlap: true, nodeSize: 20, }); }, 2500); setTimeout(() => { my.setData({ desc: "Force layout, linkDistance = 50, preventOverlap: false", }); my.graph.updateLayout({ linkDistance: 50, preventOverlap: false, }); }, 5000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-configuration-translate/index.json ================================================ { "navigationBarTitleText": "力导向布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-configuration-translate/index.wxml ================================================ {{desc}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-configuration-translate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-force-clustering/data.js ================================================ export default () => ({ nodes: [ { id: "4", sim_name: "AFG", name: "Afghanistan", region: "South Asia", resource: "Cereals", year: 2012, value: 57.847, weight: 73.355, }, { id: "8", sim_name: "ALB", name: "Albania", region: "Europe", resource: "Cereals", year: 2012, value: 556.3332546, weight: 1214.363, }, { id: "10", sim_name: "ATA", name: "Antarctica", region: "Other", resource: "Cereals", year: 2012, value: 2829.367, weight: 11113.564, }, { id: "12", sim_name: "DZA", name: "Algeria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 105217.8151, weight: 146857.7593, }, { id: "16", sim_name: "ASM", name: "American Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 97.623, weight: 982.085, }, { id: "20", sim_name: "AND", name: "Andorra", region: "Europe", resource: "Cereals", year: 2012, value: 787.166, weight: 1240.056, }, { id: "24", sim_name: "AGO", name: "Angola", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0.366, weight: 0.211, }, { id: "28", sim_name: "ATG", name: "Antigua and Barbuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 30831.87949, weight: 72065.168, }, { id: "31", sim_name: "AZE", name: "Azerbaijan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 46917.41553, weight: 45114.87169, }, { id: "32", sim_name: "ARG", name: "Argentina", region: "South America", resource: "Cereals", year: 2012, value: 11347322.78, weight: 38200326.47, }, { id: "36", sim_name: "AUS", name: "Australia", region: "Oceania", resource: "Cereals", year: 2012, value: 10983308.38, weight: 32933532.17, }, { id: "40", sim_name: "AUT", name: "Austria", region: "Europe", resource: "Cereals", year: 2012, value: 714932.2545, weight: 1683224.24, }, { id: "44", sim_name: "BHS", name: "Bahamas", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 427.395, weight: 969.33, }, { id: "48", sim_name: "BHR", name: "Bahrain", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 22229.96717, weight: 53856.78001, }, { id: "50", sim_name: "BGD", name: "Bangladesh", region: "South Asia", resource: "Cereals", year: 2012, value: 22330.75971, weight: 86944.1853, }, { id: "51", sim_name: "ARM", name: "Armenia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 206.6709842, weight: 223.5014745, }, { id: "52", sim_name: "BRB", name: "Barbados", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4790.290139, weight: 7428.399008, }, { id: "56", sim_name: "BEL", name: "Belgium", region: "Europe", resource: "Cereals", year: 2012, value: 1896499.584, weight: 3625004.302, }, { id: "60", sim_name: "BMU", name: "Bermuda", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 100.264, weight: 250, }, { id: "64", sim_name: "BTN", name: "Bhutan", region: "South Asia", resource: "Cereals", year: 2012, value: 1100.663269, weight: 3990.493739, }, { id: "68", sim_name: "BOL", name: "Bolivia", region: "South America", resource: "Cereals", year: 2012, value: 107152.4673, weight: 117438.7654, }, { id: "70", sim_name: "BIH", name: "Bosnia Herzegovina", region: "Europe", resource: "Cereals", year: 2012, value: 10652.90002, weight: 25582.17925, }, { id: "72", sim_name: "BWA", name: "Botswana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 7635.744989, weight: 24790.60442, }, { id: "76", sim_name: "BRA", name: "Brazil", region: "South America", resource: "Cereals", year: 2012, value: 7114534.381, weight: 22441162.41, }, { id: "84", sim_name: "BLZ", name: "Belize", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 28037.35873, weight: 77441.91463, }, { id: "90", sim_name: "SLB", name: "Solomon Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "92", sim_name: "VGB", name: "British Virgin Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 15328.77, weight: 51127.16, }, { id: "96", sim_name: "BRN", name: "Brunei Darussalam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 46.438, weight: 35.416, }, { id: "100", sim_name: "BGR", name: "Bulgaria", region: "Europe", resource: "Cereals", year: 2012, value: 1258892.481, weight: 4147538.49, }, { id: "104", sim_name: "MMR", name: "Myanmar", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 599204.3703, weight: 1218435.323, }, { id: "108", sim_name: "BDI", name: "Burundi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 523.644, weight: 2841.873, }, { id: "112", sim_name: "BLR", name: "Belarus", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 52538.61827, weight: 137692.36, }, { id: "116", sim_name: "KHM", name: "Cambodia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 167651.1526, weight: 265914.0128, }, { id: "120", sim_name: "CMR", name: "Cameroon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1263.861619, weight: 2235.140891, }, { id: "124", sim_name: "CAN", name: "Canada", region: "North America", resource: "Cereals", year: 2012, value: 8982050.268, weight: 24667183.74, }, { id: "132", sim_name: "CPV", name: "Cabo Verde", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2344.96, weight: 4095.993, }, { id: "140", sim_name: "CAF", name: "Central African Rep.", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "144", sim_name: "LKA", name: "Sri Lanka", region: "South Asia", resource: "Cereals", year: 2012, value: 181369.2559, weight: 489552.3718, }, { id: "152", sim_name: "CHL", name: "Chile", region: "South America", resource: "Cereals", year: 2012, value: 412283.3672, weight: 270900.3596, }, { id: "156", sim_name: "CHN", name: "China", region: "East Asia", resource: "Cereals", year: 2012, value: 1490564.833, weight: 2304819.508, }, { id: "170", sim_name: "COL", name: "Colombia", region: "South America", resource: "Cereals", year: 2012, value: 46615.80539, weight: 52684.28073, }, { id: "188", sim_name: "CRI", name: "Costa Rica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 17710.68444, weight: 28937.25094, }, { id: "191", sim_name: "HRV", name: "Croatia", region: "Europe", resource: "Cereals", year: 2012, value: 192245.2115, weight: 580710.257, }, { id: "192", sim_name: "CUB", name: "Cuba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 793.321, weight: 1620.825, }, { id: "196", sim_name: "CYP", name: "Cyprus", region: "Europe", resource: "Cereals", year: 2012, value: 47981.18874, weight: 126474.07, }, { id: "203", sim_name: "CZE", name: "Czech Rep.", region: "Europe", resource: "Cereals", year: 2012, value: 922618.0722, weight: 3054247.331, }, { id: "204", sim_name: "BEN", name: "Benin", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12987.78421, weight: 55672.72433, }, { id: "208", sim_name: "DNK", name: "Denmark", region: "Europe", resource: "Cereals", year: 2012, value: 701199.8922, weight: 1992757.212, }, { id: "212", sim_name: "DMA", name: "Dominica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1.351, weight: 0.692, }, { id: "214", sim_name: "DOM", name: "Dominican Rep.", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 105510.1813, weight: 210275.29, }, { id: "218", sim_name: "ECU", name: "Ecuador", region: "South America", resource: "Cereals", year: 2012, value: 30957.4275, weight: 49399.64362, }, { id: "222", sim_name: "SLV", name: "El Salvador", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 77105.01061, weight: 129245.0661, }, { id: "231", sim_name: "ETH", name: "Ethiopia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44330.31405, weight: 29794.00055, }, { id: "233", sim_name: "EST", name: "Estonia", region: "Europe", resource: "Cereals", year: 2012, value: 150772.6292, weight: 458854.905, }, { id: "234", sim_name: "FRO", name: "Faeroe Isds", region: "Europe", resource: "Cereals", year: 2012, value: 18.298, weight: 44.726, }, { id: "242", sim_name: "FJI", name: "Fiji", region: "Oceania", resource: "Cereals", year: 2012, value: 15966.92145, weight: 24119.72685, }, { id: "246", sim_name: "FIN", name: "Finland", region: "Europe", resource: "Cereals", year: 2012, value: 266364.4975, weight: 753973.3063, }, { id: "251", sim_name: "FRA", name: "France", region: "Europe", resource: "Cereals", year: 2012, value: 11027310.62, weight: 31368277.85, }, { id: "262", sim_name: "DJI", name: "Djibouti", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 1936.537, weight: 2932.238, }, { id: "266", sim_name: "GAB", name: "Gabon", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2624.516, weight: 10407.907, }, { id: "268", sim_name: "GEO", name: "Georgia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 48754.57507, weight: 158741.3575, }, { id: "270", sim_name: "GMB", name: "Gambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 38.193, weight: 24.45, }, { id: "275", sim_name: "PSE", name: "State of Palestine", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16057.14949, weight: 13745.84557, }, { id: "276", sim_name: "DEU", name: "Germany", region: "Europe", resource: "Cereals", year: 2012, value: 4635549.458, weight: 12647922.94, }, { id: "288", sim_name: "GHA", name: "Ghana", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 8210.66114, weight: 28560.44817, }, { id: "292", sim_name: "GIB", name: "Gibraltar", region: "Europe", resource: "Cereals", year: 2012, value: 728.465, weight: 809.623, }, { id: "296", sim_name: "KIR", name: "Kiribati", region: "Oceania", resource: "Cereals", year: 2012, value: 23.052, weight: 18.562, }, { id: "300", sim_name: "GRC", name: "Greece", region: "Europe", resource: "Cereals", year: 2012, value: 263693.016, weight: 644312.8604, }, { id: "304", sim_name: "GRL", name: "Greenland", region: "North America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "308", sim_name: "GRD", name: "Grenada", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 4657.914, weight: 9335.526, }, { id: "316", sim_name: "GUM", name: "Guam", region: "Oceania", resource: "Cereals", year: 2012, value: 527.033, weight: 982.642, }, { id: "320", sim_name: "GTM", name: "Guatemala", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 20968.96314, weight: 22893.23335, }, { id: "324", sim_name: "GIN", name: "Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 2636.849, weight: 7422.12, }, { id: "328", sim_name: "GUY", name: "Guyana", region: "South America", resource: "Cereals", year: 2012, value: 334196.3131, weight: 520437.64, }, { id: "332", sim_name: "HTI", name: "Haiti", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5.134, weight: 16.128, }, { id: "340", sim_name: "HND", name: "Honduras", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 22936.79385, weight: 43129.60369, }, { id: "348", sim_name: "HUN", name: "Hungary", region: "Europe", resource: "Cereals", year: 2012, value: 2015665.793, weight: 6379394.988, }, { id: "352", sim_name: "ISL", name: "Iceland", region: "Europe", resource: "Cereals", year: 2012, value: 891.513, weight: 2118.828, }, { id: "360", sim_name: "IDN", name: "Indonesia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 175738.8156, weight: 544860.3789, }, { id: "364", sim_name: "IRN", name: "Iran", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 7978.124, weight: 20473.686, }, { id: "368", sim_name: "IRQ", name: "Iraq", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 253.845, weight: 246.151, }, { id: "372", sim_name: "IRL", name: "Ireland", region: "Europe", resource: "Cereals", year: 2012, value: 166058.1767, weight: 476236.2048, }, { id: "376", sim_name: "ISR", name: "Israel", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 197912.4336, weight: 431193.8203, }, { id: "381", sim_name: "ITA", name: "Italy", region: "Europe", resource: "Cereals", year: 2012, value: 1288077.184, weight: 1887032.489, }, { id: "384", sim_name: "CIV", name: "Cote d'Ivoire", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 77750.0467, weight: 254222.8878, }, { id: "388", sim_name: "JAM", name: "Jamaica", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 6751.46461, weight: 12484.22296, }, { id: "392", sim_name: "JPN", name: "Japan", region: "East Asia", resource: "Cereals", year: 2012, value: 189561.3237, weight: 359553.4615, }, { id: "398", sim_name: "KAZ", name: "Kazakhstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2535465.094, weight: 10562777.14, }, { id: "400", sim_name: "JOR", name: "Jordan", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 2022.699859, weight: 1810.995193, }, { id: "404", sim_name: "KEN", name: "Kenya", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31813.863, weight: 84144.582, }, { id: "414", sim_name: "KWT", name: "Kuwait", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 28509.72, weight: 41425.612, }, { id: "417", sim_name: "KGZ", name: "Kyrgyzstan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 344.2343218, weight: 452.0188439, }, { id: "418", sim_name: "LAO", name: "Lao PDR", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 58500.6357, weight: 212304.4463, }, { id: "422", sim_name: "LBN", name: "Lebanon", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 16263.18003, weight: 38974.77174, }, { id: "426", sim_name: "LSO", name: "Lesotho", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 19865.12276, weight: 54350.43934, }, { id: "428", sim_name: "LVA", name: "Latvia", region: "Europe", resource: "Cereals", year: 2012, value: 516410.4254, weight: 1643243.015, }, { id: "430", sim_name: "LBR", name: "Liberia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 12.35, weight: 53.471, }, { id: "434", sim_name: "LBY", name: "Libya", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 634.239, weight: 2102.142, }, { id: "440", sim_name: "LTU", name: "Lithuania", region: "Europe", resource: "Cereals", year: 2012, value: 871039.5602, weight: 2446114.811, }, { id: "442", sim_name: "LUX", name: "Luxembourg", region: "Europe", resource: "Cereals", year: 2012, value: 68969.99793, weight: 178380.981, }, { id: "450", sim_name: "MDG", name: "Madagascar", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 950.8530206, weight: 3780.89311, }, { id: "454", sim_name: "MWI", name: "Malawi", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 11553.98159, weight: 41269.33681, }, { id: "458", sim_name: "MYS", name: "Malaysia", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 99255.71471, weight: 142965.3262, }, { id: "462", sim_name: "MDV", name: "Maldives", region: "South Asia", resource: "Cereals", year: 2012, value: 12.448, weight: 14.6, }, { id: "466", sim_name: "MLI", name: "Mali", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3143.270747, weight: 11121.96188, }, { id: "470", sim_name: "MLT", name: "Malta", region: "Europe", resource: "Cereals", year: 2012, value: 35991.55686, weight: 94799.54871, }, { id: "478", sim_name: "MRT", name: "Mauritania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 292.538, weight: 627.637, }, { id: "480", sim_name: "MUS", name: "Mauritius", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 17602.67917, weight: 36755.35938, }, { id: "484", sim_name: "MEX", name: "Mexico", region: "North America", resource: "Cereals", year: 2012, value: 571803.2432, weight: 1234860.795, }, { id: "496", sim_name: "MNG", name: "Mongolia", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1328.368, weight: 10672.694, }, { id: "498", sim_name: "MDA", name: "Moldova", region: "Europe", resource: "Cereals", year: 2012, value: 59072.0085, weight: 188178.1824, }, { id: "499", sim_name: "MNE", name: "Montenegro", region: "Europe", resource: "Cereals", year: 2012, value: 2444.455322, weight: 6125.451, }, { id: "504", sim_name: "MAR", name: "Morocco", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 86884.06321, weight: 161631.8094, }, { id: "508", sim_name: "MOZ", name: "Mozambique", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 68388.81722, weight: 146520.864, }, { id: "512", sim_name: "OMN", name: "Oman", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 55530.66234, weight: 88434.23327, }, { id: "516", sim_name: "NAM", name: "Namibia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 5168.27047, weight: 7877.053106, }, { id: "524", sim_name: "NPL", name: "Nepal", region: "South Asia", resource: "Cereals", year: 2012, value: 4032.41279, weight: 17770.75769, }, { id: "528", sim_name: "NLD", name: "Netherlands", region: "Europe", resource: "Cereals", year: 2012, value: 1424347.018, weight: 3125730.04, }, { id: "531", sim_name: "CUW", name: "Curacao", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 535.691, weight: 2358.613, }, { id: "533", sim_name: "ABW", name: "Aruba", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 178879.593, weight: 560431.967, }, { id: "540", sim_name: "NCL", name: "New Caledonia", region: "Oceania", resource: "Cereals", year: 2012, value: 205.777282, weight: 363.439991, }, { id: "548", sim_name: "VUT", name: "Vanuatu", region: "Oceania", resource: "Cereals", year: 2012, value: 160.463, weight: 440.332, }, { id: "554", sim_name: "NZL", name: "New Zealand", region: "Oceania", resource: "Cereals", year: 2012, value: 33994.85867, weight: 35177.57975, }, { id: "558", sim_name: "NIC", name: "Nicaragua", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 41294.65615, weight: 85186.87824, }, { id: "562", sim_name: "NER", name: "Niger", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 31152.35763, weight: 44518.07202, }, { id: "566", sim_name: "NGA", name: "Nigeria", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 323839.5301, weight: 192057.843, }, { id: "579", sim_name: "NOR", name: "Norway", region: "Europe", resource: "Cereals", year: 2012, value: 2382.344541, weight: 2488.51136, }, { id: "580", sim_name: "MNP", name: "N. Mariana Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 1.144, weight: 1.864, }, { id: "581", sim_name: "UMI", name: "United States Minor Outlying Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 23.008, weight: 21, }, { id: "585", sim_name: "PLW", name: "Palau", region: "Oceania", resource: "Cereals", year: 2012, value: 2.151, weight: 0.22, }, { id: "586", sim_name: "PAK", name: "Pakistan", region: "South Asia", resource: "Cereals", year: 2012, value: 2412673.261, weight: 4864111.072, }, { id: "591", sim_name: "PAN", name: "Panama", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 10056.54107, weight: 26993.1125, }, { id: "598", sim_name: "PNG", name: "Papua New Guinea", region: "Oceania", resource: "Cereals", year: 2012, value: 319.374, weight: 2210.48, }, { id: "600", sim_name: "PRY", name: "Paraguay", region: "South America", resource: "Cereals", year: 2012, value: 1009228.641, weight: 3862696.891, }, { id: "604", sim_name: "PER", name: "Peru", region: "South America", resource: "Cereals", year: 2012, value: 91326.10676, weight: 128637.0767, }, { id: "608", sim_name: "PHL", name: "Philippines", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 12041.64316, weight: 16205.94695, }, { id: "616", sim_name: "POL", name: "Poland", region: "Europe", resource: "Cereals", year: 2012, value: 1028089.751, weight: 3186360.963, }, { id: "620", sim_name: "PRT", name: "Portugal", region: "Europe", resource: "Cereals", year: 2012, value: 92543.15766, weight: 192795.3179, }, { id: "624", sim_name: "GNB", name: "Guinea-Bissau", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37.268, weight: 135, }, { id: "626", sim_name: "TLS", name: "Timor-Leste", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 18.551, weight: 10.883, }, { id: "634", sim_name: "QAT", name: "Qatar", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 6936.324, weight: 11122.252, }, { id: "642", sim_name: "ROU", name: "Romania", region: "Europe", resource: "Cereals", year: 2012, value: 1778677.092, weight: 5301402.18, }, { id: "643", sim_name: "RUS", name: "Russian Federation", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 7440900.086, weight: 23852343.49, }, { id: "646", sim_name: "RWA", name: "Rwanda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 37520.31393, weight: 73367.60768, }, { id: "659", sim_name: "KNA", name: "Saint Kitts and Nevis", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0.062, weight: 0.009, }, { id: "662", sim_name: "LCA", name: "Saint Lucia", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "670", sim_name: "VCT", name: "Saint Vincent and the Grenadines", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 16002.19104, weight: 17977.52343, }, { id: "674", sim_name: "SMR", name: "San Marino", region: "Europe", resource: "Cereals", year: 2012, value: 0, weight: 0, }, { id: "682", sim_name: "SAU", name: "Saudi Arabia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 92568.76043, weight: 56036.2484, }, { id: "686", sim_name: "SEN", name: "Senegal", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 44740.28095, weight: 98109.85876, }, { id: "688", sim_name: "SRB", name: "Serbia", region: "Europe", resource: "Cereals", year: 2012, value: 907006.831, weight: 3003936.426, }, { id: "690", sim_name: "SYC", name: "Seychelles", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 387.548, weight: 246.84, }, { id: "694", sim_name: "SLE", name: "Sierra Leone", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 147.544, weight: 705.466, }, { id: "699", sim_name: "IND", name: "India", region: "South Asia", resource: "Cereals", year: 2012, value: 9062980.928, weight: 19031680.14, }, { id: "702", sim_name: "SGP", name: "Singapore", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 193120.3466, weight: 470488.3668, }, { id: "703", sim_name: "SVK", name: "Slovakia", region: "Europe", resource: "Cereals", year: 2012, value: 580789.4685, weight: 1589777.797, }, { id: "704", sim_name: "VNM", name: "Vietnam", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 3558044.517, weight: 7381230.275, }, { id: "705", sim_name: "SVN", name: "Slovenia", region: "Europe", resource: "Cereals", year: 2012, value: 75282.28683, weight: 227283.1873, }, { id: "706", sim_name: "SOM", name: "Somalia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 240.399, weight: 1055, }, { id: "710", sim_name: "ZAF", name: "South Africa", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 938907.5758, weight: 2190384.881, }, { id: "716", sim_name: "ZWE", name: "Zimbabwe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6067.581387, weight: 21394.92603, }, { id: "724", sim_name: "ESP", name: "Spain", region: "Europe", resource: "Cereals", year: 2012, value: 906018.1944, weight: 1602797.031, }, { id: "729", sim_name: "SDN", name: "Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 18327.14063, weight: 66310.50556, }, { id: "740", sim_name: "SUR", name: "Suriname", region: "South America", resource: "Cereals", year: 2012, value: 73211.6794, weight: 83933.84802, }, { id: "748", sim_name: "SWZ", name: "Swaziland", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 6674.46, weight: 16386.136, }, { id: "752", sim_name: "SWE", name: "Sweden", region: "Europe", resource: "Cereals", year: 2012, value: 439154.313, weight: 1207272.863, }, { id: "757", sim_name: "CHE", name: "Switzerland", region: "Europe", resource: "Cereals", year: 2012, value: 492516.8323, weight: 1581172.074, }, { id: "760", sim_name: "SYR", name: "Syria", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 4169.742, weight: 7890.447, }, { id: "762", sim_name: "TJK", name: "Tajikistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 300.162, weight: 712.396, }, { id: "764", sim_name: "THA", name: "Thailand", region: "Southeast Asia", resource: "Cereals", year: 2012, value: 5003324.321, weight: 6926962.31, }, { id: "768", sim_name: "TGO", name: "Togo", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 16809.12488, weight: 43975.34784, }, { id: "772", sim_name: "TKL", name: "Tokelau", region: "Oceania", resource: "Cereals", year: 2012, value: 1012.213, weight: 1926.401, }, { id: "776", sim_name: "TON", name: "Tonga", region: "Oceania", resource: "Cereals", year: 2012, value: 0.18, weight: 0.011, }, { id: "780", sim_name: "TTO", name: "Trinidad and Tobago", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 5731.199288, weight: 9463.821332, }, { id: "784", sim_name: "ARE", name: "United Arab Emirates", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 442646.1236, weight: 684603.6345, }, { id: "788", sim_name: "TUN", name: "Tunisia", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 202627.2087, weight: 121296.0689, }, { id: "792", sim_name: "TUR", name: "Turkey", region: "Europe", resource: "Cereals", year: 2012, value: 1205009.52, weight: 2692733.392, }, { id: "795", sim_name: "TKM", name: "Turkmenistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 1020.566, weight: 3442.938, }, { id: "796", sim_name: "TCA", name: "Turks and Caicos Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2012, value: 1029.474, weight: 2224.885, }, { id: "800", sim_name: "UGA", name: "Uganda", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 153220.9856, weight: 467968.0664, }, { id: "804", sim_name: "UKR", name: "Ukraine", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 8444175.988, weight: 29508635.03, }, { id: "818", sim_name: "EGY", name: "Egypt", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 178849.3005, weight: 310332.3386, }, { id: "826", sim_name: "GBR", name: "United Kingdom", region: "Europe", resource: "Cereals", year: 2012, value: 1224264.681, weight: 3079070.328, }, { id: "834", sim_name: "TZA", name: "Tanzania", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 152688.2977, weight: 493774.3125, }, { id: "838", sim_name: "", name: "Free Zones", region: "Other", resource: "Cereals", year: 2012, value: 1488.719, weight: 4904.648, }, { id: "842", sim_name: "USA", name: "United States", region: "North America", resource: "Cereals", year: 2012, value: 23694720.38, weight: 66623810.06, }, { id: "854", sim_name: "BFA", name: "Burkina Faso", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 3861.072093, weight: 17132.42303, }, { id: "858", sim_name: "URY", name: "Uruguay", region: "South America", resource: "Cereals", year: 2012, value: 1550881.026, weight: 4155101.445, }, { id: "860", sim_name: "UZB", name: "Uzbekistan", region: "Central and Northern Asia", resource: "Cereals", year: 2012, value: 2094.579, weight: 7229.088, }, { id: "862", sim_name: "VEN", name: "Venezuela", region: "South America", resource: "Cereals", year: 2012, value: 73.53, weight: 91.675, }, { id: "882", sim_name: "WSM", name: "Samoa", region: "Oceania", resource: "Cereals", year: 2012, value: 1.603, weight: 6.415, }, { id: "887", sim_name: "YEM", name: "Yemen", region: "Middle East and North Africa", resource: "Cereals", year: 2012, value: 48184.79726, weight: 245917.1867, }, { id: "894", sim_name: "ZMB", name: "Zambia", region: "Sub-Saharan Africa", resource: "Cereals", year: 2012, value: 470664.7641, weight: 863829.2506, }, { id: "86", sim_name: "IOT", name: "British Indian Ocean Territory", region: "Oceania", resource: "Cereals", year: 2013, value: 36.802, weight: 21.33, }, { id: "136", sim_name: "CYM", name: "Cayman Isds", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "148", sim_name: "TCD", name: "Chad", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 24.335, weight: 103.232, }, { id: "166", sim_name: "CCK", name: "Cocos Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 2.417, weight: 2, }, { id: "174", sim_name: "COM", name: "Comoros", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 19, weight: 21, }, { id: "226", sim_name: "GNQ", name: "Equatorial Guinea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "232", sim_name: "ERI", name: "Eritrea", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "238", sim_name: "FLK", name: "Falkland Isds (Malvinas)", region: "South America", resource: "Cereals", year: 2013, value: 177.295, weight: 47.1, }, { id: "258", sim_name: "PYF", name: "French Polynesia", region: "Oceania", resource: "Cereals", year: 2013, value: 1.65, weight: 0.6, }, { id: "534", sim_name: "SXM", name: "Sint Maarten (Dutch part)", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "584", sim_name: "MHL", name: "Marshall Isds", region: "Oceania", resource: "Cereals", year: 2013, value: 47.581, weight: 26.942, }, { id: "612", sim_name: "PCN", name: "Pitcairn", region: "Oceania", resource: "Cereals", year: 2013, value: 95.892, weight: 265, }, { id: "728", sim_name: "SSD", name: "South Sudan", region: "Sub-Saharan Africa", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "798", sim_name: "TUV", name: "Tuvalu", region: "Oceania", resource: "Cereals", year: 2013, value: 0, weight: 0, }, { id: "184", sim_name: "COK", name: "Cook Isds", region: "Oceania", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "654", sim_name: "SHN", name: "Saint Helena", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "660", sim_name: "AIA", name: "Anguilla", region: "Caribbean and Central America", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "678", sim_name: "STP", name: "Sao Tome and Principe", region: "Sub-Saharan Africa", resource: "Cereals", year: 2014, value: 198.633, weight: 350, }, { id: "837", sim_name: "", name: "Bunkers", region: "Other", resource: "Cereals", year: 2014, value: 0, weight: 0, }, { id: "732", sim_name: "ESH", name: "Western Sahara", region: "Middle East and North Africa", resource: "Cereals", year: 2015, value: 0, weight: 0, }, { id: "666", sim_name: "SPM", name: "Saint Pierre and Miquelon", region: "North America", resource: "Cereals", year: 2016, value: 0, weight: 0, }, { id: "162", sim_name: "CXR", name: "Christmas Isds", region: "Oceania", resource: "Cereals", year: 2012, value: 131.818, weight: 99.95, }, { id: "336", sim_name: "VAT", name: "Holy See", region: "Europe", resource: "Cereals", year: 2012, value: 24.492, weight: 42.805, }, { id: "520", sim_name: "NRU", name: "Nauru", region: "Oceania", resource: "Cereals", year: 2012, value: 496.386, weight: 457.721, }, { id: "535", sim_name: "BES", name: "Bonaire", region: "Caribbean and Central America", resource: "Cereals", year: 2013, value: 326.45, weight: 551.554, }, ], edges: [ { eid: "e9639", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "7.992", weight: "20", embodiedLand: "", embodiedWater: "", }, { eid: "e9640", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "291.645", weight: "223.789", embodiedLand: "", embodiedWater: "", }, { eid: "e9641", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "406.568", weight: "326.18", embodiedLand: "", embodiedWater: "", }, { eid: "e9642", source: "710", sourceSimName: "ZAF", sourceRegion: "South Africa", sourceName: "Sub-Saharan Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9670", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "249.898", weight: "235.45", embodiedLand: "59.656", embodiedWater: "250.99", }, { eid: "e9671", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.003", weight: "0.012", embodiedLand: "", embodiedWater: "", }, { eid: "e9672", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "49.652", weight: "10", embodiedLand: "15.749", embodiedWater: "1.39", }, { eid: "e9673", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "0.082", weight: "0.1", embodiedLand: "", embodiedWater: "0.054", }, { eid: "e9674", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "646", targetSimName: "RWA", targetName: "Rwanda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "262.679", weight: "424.094", embodiedLand: "", embodiedWater: "", }, { eid: "e9675", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.017", weight: "0.003", embodiedLand: "", embodiedWater: "", }, { eid: "e9676", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Maize", year: "2015", value: "0.006", weight: "0.015", embodiedLand: "", embodiedWater: "0.002", }, { eid: "e9677", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.583", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e9678", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.8", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e9679", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "392", targetSimName: "JPN", targetName: "Japan", targetRegion: "East Asia", resource: "Other cereals", year: "2016", value: "0.05", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9680", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Sorghum", year: "2016", value: "108.245803", weight: "74.0433696", embodiedLand: "", embodiedWater: "", }, { eid: "e9681", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.073", weight: "0.034", embodiedLand: "", embodiedWater: "", }, { eid: "e9682", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "699", targetSimName: "IND", targetName: "India", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.04989606", weight: "0.08321444", embodiedLand: "", embodiedWater: "", }, { eid: "e9683", source: "716", sourceSimName: "ZWE", sourceRegion: "Zimbabwe", sourceName: "Sub-Saharan Africa", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "0.01", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9847", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "174", targetSimName: "COM", targetName: "Comoros", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "19.162", weight: "49.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9848", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "266", targetSimName: "GAB", targetName: "Gabon", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.104", weight: "0.84", embodiedLand: "", embodiedWater: "", }, { eid: "e9849", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "71.418", weight: "180", embodiedLand: "", embodiedWater: "", }, { eid: "e9850", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "90", targetSimName: "SLB", targetName: "Solomon Isds", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "31.3543178", weight: "71.6911179", embodiedLand: "", embodiedWater: "", }, { eid: "e9851", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Rice", year: "2016", value: "0.221", weight: "0.275", embodiedLand: "", embodiedWater: "", }, { eid: "e9852", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "296", targetSimName: "KIR", targetName: "Kiribati", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.098", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e9853", source: "724", sourceSimName: "ESP", sourceRegion: "Spain", sourceName: "Europe", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.199", weight: "0.036", embodiedLand: "", embodiedWater: "", }, { eid: "e9856", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9857", source: "728", sourceSimName: "SSD", sourceRegion: "South Sudan", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9889", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.333", weight: "0.31", embodiedLand: "0.02", embodiedWater: "11.447", }, { eid: "e9890", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Sorghum", year: "2015", value: "43.181", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9891", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Sorghum", year: "2015", value: "20.076", weight: "40", embodiedLand: "69.334", embodiedWater: "202.56", }, { eid: "e9892", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "434", targetSimName: "LBY", targetName: "Libya", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "1.5", weight: "5", embodiedLand: "5.013", embodiedWater: "44.535", }, { eid: "e9893", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "0.13", weight: "0.15", embodiedLand: "", embodiedWater: "", }, { eid: "e9894", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9895", source: "729", sourceSimName: "SDN", sourceRegion: "Sudan", sourceName: "Sub-Saharan Africa", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.091", weight: "0.333", embodiedLand: "", embodiedWater: "", }, { eid: "e9896", source: "732", sourceSimName: "ESH", sourceRegion: "Western Sahara", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e9934", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "170", targetSimName: "COL", targetName: "Colombia", targetRegion: "South America", resource: "Other cereals", year: "2015", value: "48.174", weight: "340.23", embodiedLand: "96.561", embodiedWater: "", }, { eid: "e9935", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "0.073", weight: "0.002", embodiedLand: "", embodiedWater: "", }, { eid: "e9936", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "579", targetSimName: "NOR", targetName: "Norway", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.141", weight: "0.09", embodiedLand: "0.034", embodiedWater: "0.65", }, { eid: "e9937", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "757", targetSimName: "CHE", targetName: "Switzerland", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.181", weight: "0.15", embodiedLand: "0.054", embodiedWater: "1.152", }, { eid: "e9938", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "10.08", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9939", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "288", targetSimName: "GHA", targetName: "Ghana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "59.563", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9940", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2016", value: "486", weight: "1800", embodiedLand: "", embodiedWater: "", }, { eid: "e9941", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "340", targetSimName: "HND", targetName: "Honduras", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2016", value: "0.02", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e9942", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2016", value: "2459.276", weight: "7800", embodiedLand: "", embodiedWater: "", }, { eid: "e9943", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.296", weight: "45.9", embodiedLand: "", embodiedWater: "", }, { eid: "e9944", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "688", targetSimName: "SRB", targetName: "Serbia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "86.553", weight: "168", embodiedLand: "", embodiedWater: "", }, { eid: "e9945", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "705", targetSimName: "SVN", targetName: "Slovenia", targetRegion: "Europe", resource: "Rice", year: "2016", value: "126", weight: "240", embodiedLand: "", embodiedWater: "", }, { eid: "e9946", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "25.625", weight: "125", embodiedLand: "", embodiedWater: "", }, { eid: "e9947", source: "740", sourceSimName: "SUR", sourceRegion: "Suriname", sourceName: "South America", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "10.8", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e9960", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "5.105", weight: "26", embodiedLand: "14.55", embodiedWater: "11.804", }, { eid: "e9961", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Rice", year: "2015", value: "5.963", weight: "1.128", embodiedLand: "", embodiedWater: "", }, { eid: "e9962", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "634", targetSimName: "QAT", targetName: "Qatar", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2015", value: "0.042", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e9963", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.022", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e9964", source: "748", sourceSimName: "SWZ", sourceRegion: "Swaziland", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "136.368", weight: "352.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10072", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "321.247599", weight: "594.892627", embodiedLand: "157.689777", embodiedWater: "218.325999", }, { eid: "e10073", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "258", targetSimName: "PYF", targetName: "French Polynesia", targetRegion: "Oceania", resource: "Wheat", year: "2015", value: "2.166", weight: "0.461", embodiedLand: "", embodiedWater: "", }, { eid: "e10074", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2015", value: "7.097", weight: "6.153", embodiedLand: "", embodiedWater: "", }, { eid: "e10075", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.949", weight: "1", embodiedLand: "1.187", embodiedWater: "5.89", }, { eid: "e10076", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "293.17", weight: "713", embodiedLand: "176.112", embodiedWater: "7.843", }, { eid: "e10077", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "0.593", weight: "0.373", embodiedLand: "", embodiedWater: "", }, { eid: "e10078", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "1.542", weight: "7.661", embodiedLand: "2.193", embodiedWater: "28.537", }, { eid: "e10079", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Barley", year: "2015", value: "7903.00956", weight: "26948.6797", embodiedLand: "6860.2467", embodiedWater: "1077.94733", }, { eid: "e10080", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Other cereals", year: "2016", value: "0.537", weight: "0.06", embodiedLand: "", embodiedWater: "", }, { eid: "e10081", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10082", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "262", targetSimName: "DJI", targetName: "Djibouti", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "2650.321", weight: "12000", embodiedLand: "", embodiedWater: "", }, { eid: "e10083", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "328", targetSimName: "GUY", targetName: "Guyana", targetRegion: "South America", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10084", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2016", value: "4.659", weight: "2.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10085", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "800", targetSimName: "UGA", targetName: "Uganda", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "525.239248", weight: "1150.87085", embodiedLand: "", embodiedWater: "", }, { eid: "e10086", source: "752", sourceSimName: "SWE", sourceRegion: "Sweden", sourceName: "Europe", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "776.713", weight: "2078", embodiedLand: "", embodiedWater: "", }, { eid: "e10198", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.002", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10199", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "222", targetSimName: "SLV", targetName: "El Salvador", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "0.236", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10200", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "320", targetSimName: "GTM", targetName: "Guatemala", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10201", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.103", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e10202", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "897.592", weight: "1303.4", embodiedLand: "445.321", embodiedWater: "21745.926", }, { eid: "e10203", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "0.006", weight: "0.004", embodiedLand: "0.005", embodiedWater: "", }, { eid: "e10204", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.011", weight: "0.011", embodiedLand: "", embodiedWater: "0.152", }, { eid: "e10205", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "834", targetSimName: "TZA", targetName: "Tanzania", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4511.886", weight: "18900", embodiedLand: "3534.409", embodiedWater: "62181", }, { eid: "e10206", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "51", targetSimName: "ARM", targetName: "Armenia", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10207", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "70.534", weight: "150.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10208", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Other cereals", year: "2016", value: "6.519", weight: "6.42", embodiedLand: "", embodiedWater: "", }, { eid: "e10209", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "480", targetSimName: "MUS", targetName: "Mauritius", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.173", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10210", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.001", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10211", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.005", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10212", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "662", targetSimName: "LCA", targetName: "Saint Lucia", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.429", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10213", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "389.737", weight: "477.087", embodiedLand: "", embodiedWater: "", }, { eid: "e10214", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "788", targetSimName: "TUN", targetName: "Tunisia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2016", value: "0.041", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10215", source: "757", sourceSimName: "CHE", sourceRegion: "Switzerland", sourceName: "Europe", target: "858", targetSimName: "URY", targetName: "Uruguay", targetRegion: "South America", resource: "Maize", year: "2016", value: "0.1431594", weight: "0.04", embodiedLand: "", embodiedWater: "", }, { eid: "e10245", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "0.064", weight: "0.107", embodiedLand: "", embodiedWater: "", }, { eid: "e10246", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "108", targetSimName: "BDI", targetName: "Burundi", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.032", weight: "0.21", embodiedLand: "0.001", embodiedWater: "0.014", }, { eid: "e10247", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "120", targetSimName: "CMR", targetName: "Cameroon", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.084", weight: "0.02", embodiedLand: "", embodiedWater: "", }, { eid: "e10248", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "8862.493", weight: "24861.286", embodiedLand: "1247.997", embodiedWater: "1864.596", }, { eid: "e10250", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "1.791", weight: "1.44", embodiedLand: "", embodiedWater: "", }, { eid: "e10251", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10252", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2015", value: "0.045", weight: "0.032", embodiedLand: "", embodiedWater: "", }, { eid: "e10253", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.034", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e10254", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "508", targetSimName: "MOZ", targetName: "Mozambique", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10255", source: "760", sourceSimName: "SYR", sourceRegion: "Syria", sourceName: "Middle East and North Africa", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2016", value: "2.895", weight: "1.225", embodiedLand: "", embodiedWater: "", }, { eid: "e10264", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "89.465", weight: "296.215", embodiedLand: "159.202", embodiedWater: "74.646", }, { eid: "e10265", source: "762", sourceSimName: "TJK", sourceRegion: "Tajikistan", sourceName: "Central and Northern Asia", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2016", value: "0.061", weight: "0.047", embodiedLand: "", embodiedWater: "", }, { eid: "e10461", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "212", targetSimName: "DMA", targetName: "Dominica", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "9.736", weight: "25.006", embodiedLand: "10.644", embodiedWater: "105.225", }, { eid: "e10462", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "234", targetSimName: "FRO", targetName: "Faeroe Isds", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.136", weight: "0.315", embodiedLand: "0.178", embodiedWater: "2.462", }, { eid: "e10464", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Rice", year: "2015", value: "0.015", weight: "0.01", embodiedLand: "0.004", embodiedWater: "0.091", }, { eid: "e10465", source: "764", sourceSimName: "THA", sourceRegion: "Thailand", sourceName: "Southeast Asia", target: "84", targetSimName: "BLZ", targetName: "Belize", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "17.484", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e10495", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "156", targetSimName: "CHN", targetName: "China", targetRegion: "East Asia", resource: "Other cereals", year: "2015", value: "3.112", weight: "7", embodiedLand: "", embodiedWater: "", }, { eid: "e10496", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "0.283", weight: "0.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10497", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Other cereals", year: "2015", value: "5", weight: "18.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10498", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "2.60547527", weight: "2.45939658", embodiedLand: "", embodiedWater: "", }, { eid: "e10499", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "620", targetSimName: "PRT", targetName: "Portugal", targetRegion: "Europe", resource: "Maize", year: "2015", value: "17.2519049", weight: "115.598246", embodiedLand: "99.7718139", embodiedWater: "58.6084014", }, { eid: "e10500", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.119", weight: "0.026", embodiedLand: "", embodiedWater: "0.00827273", }, { eid: "e10501", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.19", weight: "0.068", embodiedLand: "", embodiedWater: "", }, { eid: "e10502", source: "768", sourceSimName: "TGO", sourceRegion: "Togo", sourceName: "Sub-Saharan Africa", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Rice", year: "2016", value: "0.981", weight: "1.027", embodiedLand: "", embodiedWater: "", }, { eid: "e10509", source: "772", sourceSimName: "TKL", sourceRegion: "Tokelau", sourceName: "Oceania", target: "52", targetSimName: "BRB", targetName: "Barbados", targetRegion: "Caribbean and Central America", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10517", source: "776", sourceSimName: "TON", sourceRegion: "Tonga", sourceName: "Oceania", target: "242", targetSimName: "FJI", targetName: "Fiji", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "0.113", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10554", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "44", targetSimName: "BHS", targetName: "Bahamas", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10555", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10556", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10557", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10558", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "208", targetSimName: "DNK", targetName: "Denmark", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10559", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "300", targetSimName: "GRC", targetName: "Greece", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10560", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Rice", year: "2015", value: "0.184", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e10561", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10562", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "470", targetSimName: "MLT", targetName: "Malta", targetRegion: "Europe", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10563", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10564", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "584", targetSimName: "MHL", targetName: "Marshall Isds", targetRegion: "Oceania", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10565", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "591", targetSimName: "PAN", targetName: "Panama", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10566", source: "780", sourceSimName: "TTO", sourceRegion: "Trinidad and Tobago", sourceName: "Caribbean and Central America", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "0.075", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10703", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "148", targetSimName: "TCD", targetName: "Chad", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10704", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Other cereals", year: "2015", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e10705", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "192", targetSimName: "CUB", targetName: "Cuba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10706", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "32", targetSimName: "ARG", targetName: "Argentina", targetRegion: "South America", resource: "Maize", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10707", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Rice", year: "2016", value: "6.831", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e10708", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.074", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e10709", source: "784", sourceSimName: "ARE", sourceRegion: "United Arab Emirates", sourceName: "Middle East and North Africa", target: "352", targetSimName: "ISL", targetName: "Iceland", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.154", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e10778", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "40", targetSimName: "AUT", targetName: "Austria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "7.737", weight: "1.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10779", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "70", targetSimName: "BIH", targetName: "Bosnia Herzegovina", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "1.415", weight: "1.5", embodiedLand: "", embodiedWater: "", }, { eid: "e10780", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "152", targetSimName: "CHL", targetName: "Chile", targetRegion: "South America", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10781", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "196", targetSimName: "CYP", targetName: "Cyprus", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "8.223", weight: "9.6", embodiedLand: "", embodiedWater: "", }, { eid: "e10782", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "275", targetSimName: "PSE", targetName: "State of Palestine", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "4.469", weight: "2.876", embodiedLand: "", embodiedWater: "", }, { eid: "e10783", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "348", targetSimName: "HUN", targetName: "Hungary", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "10.389", weight: "16.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10784", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "368", targetSimName: "IRQ", targetName: "Iraq", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "30.163", weight: "19.327", embodiedLand: "4.211", embodiedWater: "62.813", }, { eid: "e10785", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "17.492", weight: "4", embodiedLand: "", embodiedWater: "", }, { eid: "e10786", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "512", targetSimName: "OMN", targetName: "Oman", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "6.28513636", weight: "4.23263329", embodiedLand: "", embodiedWater: "", }, { eid: "e10787", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.026", weight: "0.006", embodiedLand: "", embodiedWater: "", }, { eid: "e10788", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "704", targetSimName: "VNM", targetName: "Vietnam", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "1.276", weight: "0.72", embodiedLand: "", embodiedWater: "", }, { eid: "e10789", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "729", targetSimName: "SDN", targetName: "Sudan", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "46.053", weight: "107.5", embodiedLand: "2.563", embodiedWater: "48.805", }, { eid: "e10790", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "13.516", weight: "20.004", embodiedLand: "", embodiedWater: "", }, { eid: "e10791", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "0.274", weight: "0.13", embodiedLand: "", embodiedWater: "", }, { eid: "e10792", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "401.922618", weight: "985.504812", embodiedLand: "", embodiedWater: "", }, { eid: "e10793", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Other cereals", year: "2016", value: "0.042", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e10794", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "33.233", weight: "41.7", embodiedLand: "", embodiedWater: "", }, { eid: "e10795", source: "788", sourceSimName: "TUN", sourceRegion: "Tunisia", sourceName: "Middle East and North Africa", target: "760", targetSimName: "SYR", targetName: "Syria", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2016", value: "388.489", weight: "300", embodiedLand: "", embodiedWater: "", }, { eid: "e10976", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "16", targetSimName: "ASM", targetName: "American Samoa", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e10977", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "388", targetSimName: "JAM", targetName: "Jamaica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "14.0119386", weight: "26.25", embodiedLand: "", embodiedWater: "", }, { eid: "e10978", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "55.708", weight: "233.1", embodiedLand: "", embodiedWater: "", }, { eid: "e10979", source: "792", sourceSimName: "TUR", sourceRegion: "Turkey", sourceName: "Europe", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Other cereals", year: "2016", value: "1.198", weight: "0.714", embodiedLand: "", embodiedWater: "", }, { eid: "e10990", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "372.658", weight: "1562.052", embodiedLand: "", embodiedWater: "", }, { eid: "e10991", source: "795", sourceSimName: "TKM", sourceRegion: "Turkmenistan", sourceName: "Central and Northern Asia", target: "124", targetSimName: "CAN", targetName: "Canada", targetRegion: "North America", resource: "Other cereals", year: "2016", value: "2.407", weight: "2.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11003", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "616", targetSimName: "POL", targetName: "Poland", targetRegion: "Europe", resource: "Barley", year: "2015", value: "8.403", weight: "24.42", embodiedLand: "", embodiedWater: "", }, { eid: "e11004", source: "796", sourceSimName: "TCA", sourceRegion: "Turks and Caicos Isds", sourceName: "Caribbean and Central America", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2016", value: "8.714", weight: "21.576", embodiedLand: "", embodiedWater: "", }, { eid: "e11049", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "140", targetSimName: "CAF", targetName: "Central African Rep.", targetRegion: "Sub-Saharan Africa", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11050", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "376", targetSimName: "ISR", targetName: "Israel", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "1.754", weight: "16", embodiedLand: "4.518", embodiedWater: "69.808", }, { eid: "e11051", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "8.335", weight: "22.5", embodiedLand: "10.227", embodiedWater: "9.923", }, { eid: "e11052", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "61.018", weight: "200", embodiedLand: "", embodiedWater: "", }, { eid: "e11053", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "372", targetSimName: "IRL", targetName: "Ireland", targetRegion: "Europe", resource: "Sorghum", year: "2016", value: "0.263", weight: "0.139", embodiedLand: "", embodiedWater: "", }, { eid: "e11054", source: "800", sourceSimName: "UGA", sourceRegion: "Uganda", sourceName: "Sub-Saharan Africa", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.216", weight: "0.086", embodiedLand: "", embodiedWater: "", }, { eid: "e11209", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Maize", year: "2015", value: "24.476", weight: "20.587", embodiedLand: "11.055", embodiedWater: "57.644", }, { eid: "e11210", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "184", targetSimName: "COK", targetName: "Cook Isds", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "0.043", weight: "0.018", embodiedLand: "", embodiedWater: "", }, { eid: "e11211", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "384", targetSimName: "CIV", targetName: "Cote d'Ivoire", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "2451.982731", weight: "16689", embodiedLand: "2800.015", embodiedWater: "84513.096", }, { eid: "e11212", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "462", targetSimName: "MDV", targetName: "Maldives", targetRegion: "South Asia", resource: "Oats", year: "2015", value: "0.03", weight: "0.015", embodiedLand: "", embodiedWater: "", }, { eid: "e11213", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "516", targetSimName: "NAM", targetName: "Namibia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "4890.88387", weight: "20013.8008", embodiedLand: "5001.53453", embodiedWater: "32702.5506", }, { eid: "e11214", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "894", targetSimName: "ZMB", targetName: "Zambia", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "7378.521", weight: "27210.945", embodiedLand: "", embodiedWater: "", }, { eid: "e11215", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.185", weight: "0.056", embodiedLand: "", embodiedWater: "", }, { eid: "e11216", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "72", targetSimName: "BWA", targetName: "Botswana", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "1486.932", weight: "4224", embodiedLand: "", embodiedWater: "", }, { eid: "e11217", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "6.555", weight: "22", embodiedLand: "", embodiedWater: "", }, { eid: "e11218", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "442", targetSimName: "LUX", targetName: "Luxembourg", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.25906197", weight: "0.045", embodiedLand: "", embodiedWater: "", }, { eid: "e11219", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "524", targetSimName: "NPL", targetName: "Nepal", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "1683.6727", weight: "6988.48925", embodiedLand: "", embodiedWater: "", }, { eid: "e11220", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "548", targetSimName: "VUT", targetName: "Vanuatu", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11221", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Buckwheat", year: "2016", value: "0.01", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11222", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "728", targetSimName: "SSD", targetName: "South Sudan", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "40.801", weight: "190.825", embodiedLand: "", embodiedWater: "", }, { eid: "e11223", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2016", value: "1725.40859", weight: "3353.20792", embodiedLand: "", embodiedWater: "", }, { eid: "e11224", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "862", targetSimName: "VEN", targetName: "Venezuela", targetRegion: "South America", resource: "Wheat", year: "2016", value: "29.675", weight: "111.862", embodiedLand: "", embodiedWater: "", }, { eid: "e11225", source: "804", sourceSimName: "UKR", sourceRegion: "Ukraine", sourceName: "Central and Northern Asia", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Wheat", year: "2016", value: "4.584", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11336", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Other cereals", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11337", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "484", targetSimName: "MEX", targetName: "Mexico", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.099", weight: "0.028", embodiedLand: "", embodiedWater: "", }, { eid: "e11338", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "498", targetSimName: "MDA", targetName: "Moldova", targetRegion: "Europe", resource: "Rice", year: "2015", value: "20.243", weight: "46.01", embodiedLand: "10.002", embodiedWater: "579.542", }, { eid: "e11339", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "608", targetSimName: "PHL", targetName: "Philippines", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "97.433", weight: "247.995", embodiedLand: "119.179", embodiedWater: "1537.817", }, { eid: "e11340", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "768", targetSimName: "TGO", targetName: "Togo", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "41.094", weight: "88.32", embodiedLand: "", embodiedWater: "", }, { eid: "e11341", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "60", targetSimName: "BMU", targetName: "Bermuda", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "0.466", weight: "0.125", embodiedLand: "", embodiedWater: "", }, { eid: "e11342", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "116", targetSimName: "KHM", targetName: "Cambodia", targetRegion: "Southeast Asia", resource: "Other cereals", year: "2016", value: "2.135", weight: "4.095", embodiedLand: "", embodiedWater: "", }, { eid: "e11343", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "132", targetSimName: "CPV", targetName: "Cabo Verde", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2016", value: "0.369", weight: "0.63", embodiedLand: "", embodiedWater: "", }, { eid: "e11344", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Wheat", year: "2016", value: "140.284", weight: "337.113", embodiedLand: "", embodiedWater: "", }, { eid: "e11345", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "188", targetSimName: "CRI", targetName: "Costa Rica", targetRegion: "Caribbean and Central America", resource: "Wheat", year: "2016", value: "3.159", weight: "0.854", embodiedLand: "", embodiedWater: "", }, { eid: "e11346", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "360", targetSimName: "IDN", targetName: "Indonesia", targetRegion: "Southeast Asia", resource: "Maize", year: "2016", value: "114.727", weight: "85.648", embodiedLand: "", embodiedWater: "", }, { eid: "e11347", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "364", targetSimName: "IRN", targetName: "Iran", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "23.162", weight: "30.81", embodiedLand: "", embodiedWater: "", }, { eid: "e11348", source: "818", sourceSimName: "EGY", sourceRegion: "Egypt", sourceName: "Middle East and North Africa", target: "398", targetSimName: "KAZ", targetName: "Kazakhstan", targetRegion: "Central and Northern Asia", resource: "Wheat", year: "2016", value: "2.07", weight: "0.23", embodiedLand: "", embodiedWater: "", }, { eid: "e11522", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "466", targetSimName: "MLI", targetName: "Mali", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "125.184", weight: "45.6", embodiedLand: "9.628", embodiedWater: "", }, { eid: "e11523", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "558", targetSimName: "NIC", targetName: "Nicaragua", targetRegion: "Caribbean and Central America", resource: "Rye", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11524", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "706", targetSimName: "SOM", targetName: "Somalia", targetRegion: "Sub-Saharan Africa", resource: "Barley", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11525", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "837", targetSimName: "", targetName: "Bunkers", targetRegion: "Other", resource: "Maize", year: "2015", value: "2.981", weight: "0.98", embodiedLand: "", embodiedWater: "", }, { eid: "e11526", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "854", targetSimName: "BFA", targetName: "Burkina Faso", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "3.556", weight: "3.554", embodiedLand: "0.914", embodiedWater: "", }, { eid: "e11527", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "882", targetSimName: "WSM", targetName: "Samoa", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "3.147", weight: "0.138", embodiedLand: "", embodiedWater: "", }, { eid: "e11528", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "214", targetSimName: "DOM", targetName: "Dominican Rep.", targetRegion: "Caribbean and Central America", resource: "Barley", year: "2016", value: "0.13", weight: "0.241", embodiedLand: "", embodiedWater: "", }, { eid: "e11529", source: "826", sourceSimName: "GBR", sourceRegion: "United Kingdom", sourceName: "Europe", target: "585", targetSimName: "PLW", targetName: "Palau", targetRegion: "Oceania", resource: "Maize", year: "2016", value: "0.015", weight: "0.005", embodiedLand: "", embodiedWater: "", }, { eid: "e11580", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "36", targetSimName: "AUS", targetName: "Australia", targetRegion: "Oceania", resource: "Other cereals", year: "2015", value: "2.405", weight: "23.6", embodiedLand: "54.414", embodiedWater: "", }, { eid: "e11581", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "203", targetSimName: "CZE", targetName: "Czech Rep.", targetRegion: "Europe", resource: "Maize", year: "2015", value: "113.617", weight: "655.96", embodiedLand: "650.261", embodiedWater: "1034.449", }, { eid: "e11582", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "400", targetSimName: "JOR", targetName: "Jordan", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "4.097", weight: "40", embodiedLand: "27.575", embodiedWater: "", }, { eid: "e11583", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "566", targetSimName: "NGA", targetName: "Nigeria", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.054", weight: "0.05", embodiedLand: "0.004", embodiedWater: "0.463", }, { eid: "e11584", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "682", targetSimName: "SAU", targetName: "Saudi Arabia", targetRegion: "Middle East and North Africa", resource: "Wheat", year: "2015", value: "19.152", weight: "40.012", embodiedLand: "", embodiedWater: "", }, { eid: "e11585", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11586", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "887", targetSimName: "YEM", targetName: "Yemen", targetRegion: "Middle East and North Africa", resource: "Maize", year: "2015", value: "2.563", weight: "14.38", embodiedLand: "9.575", embodiedWater: "9.707", }, { eid: "e11587", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "56", targetSimName: "BEL", targetName: "Belgium", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.496", weight: "0.051", embodiedLand: "", embodiedWater: "", }, { eid: "e11588", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2016", value: "44.863", weight: "500", embodiedLand: "", embodiedWater: "", }, { eid: "e11589", source: "834", sourceSimName: "TZA", sourceRegion: "Tanzania", sourceName: "Sub-Saharan Africa", target: "251", targetSimName: "FRA", targetName: "France", targetRegion: "Europe", resource: "Barley", year: "2016", value: "4.13198458", weight: "5.40716181", embodiedLand: "", embodiedWater: "", }, { eid: "e11591", source: "837", sourceSimName: "", sourceRegion: "Bunkers", sourceName: "Other", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11597", source: "838", sourceSimName: "", sourceRegion: "Free Zones", sourceName: "Other", target: "76", targetSimName: "BRA", targetName: "Brazil", targetRegion: "South America", resource: "Maize", year: "2016", value: "6.009", weight: "0.2", embodiedLand: "", embodiedWater: "", }, { eid: "e11798", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "654", targetSimName: "SHN", targetName: "Saint Helena", targetRegion: "Sub-Saharan Africa", resource: "Oats", year: "2015", value: "6.137", weight: "1.878", embodiedLand: "0.36", embodiedWater: "", }, { eid: "e11799", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "678", targetSimName: "STP", targetName: "Sao Tome and Principe", targetRegion: "Sub-Saharan Africa", resource: "Millet", year: "2015", value: "9.639", weight: "19.875", embodiedLand: "11.311", embodiedWater: "1.848", }, { eid: "e11800", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "748", targetSimName: "SWZ", targetName: "Swaziland", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "14.64", weight: "20.752", embodiedLand: "2.723", embodiedWater: "10.999", }, { eid: "e11801", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "860", targetSimName: "UZB", targetName: "Uzbekistan", targetRegion: "Central and Northern Asia", resource: "Maize", year: "2015", value: "72.797", weight: "82.805", embodiedLand: "8.475", embodiedWater: "106.818", }, { eid: "e11802", source: "842", sourceSimName: "USA", sourceRegion: "United States", sourceName: "North America", target: "426", targetSimName: "LSO", targetName: "Lesotho", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "752.606", weight: "2216.03", embodiedLand: "", embodiedWater: "", }, { eid: "e11824", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "100", targetSimName: "BGR", targetName: "Bulgaria", targetRegion: "Europe", resource: "Wheat", year: "2015", value: "19.785", weight: "69", embodiedLand: "0.615", embodiedWater: "8.901", }, { eid: "e11825", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "381", targetSimName: "ITA", targetName: "Italy", targetRegion: "Europe", resource: "Other cereals", year: "2015", value: "43.6395248", weight: "25.096", embodiedLand: "", embodiedWater: "", }, { eid: "e11826", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "430", targetSimName: "LBR", targetName: "Liberia", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "429.663", weight: "250", embodiedLand: "111.522", embodiedWater: "2267.75", }, { eid: "e11827", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2015", value: "0.004", weight: "0.022", embodiedLand: "", embodiedWater: "", }, { eid: "e11828", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "694", targetSimName: "SLE", targetName: "Sierra Leone", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2015", value: "109.987", weight: "30", embodiedLand: "16.331", embodiedWater: "27.69", }, { eid: "e11829", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "826", targetSimName: "GBR", targetName: "United Kingdom", targetRegion: "Europe", resource: "Rice", year: "2015", value: "3.487", weight: "2.5", embodiedLand: "1.554", embodiedWater: "30.817", }, { eid: "e11830", source: "854", sourceSimName: "BFA", sourceRegion: "Burkina Faso", sourceName: "Sub-Saharan Africa", target: "231", targetSimName: "ETH", targetName: "Ethiopia", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "0.02", weight: "0.025", embodiedLand: "", embodiedWater: "", }, { eid: "e11951", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "50", targetSimName: "BGD", targetName: "Bangladesh", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "18298.88", weight: "67086.608", embodiedLand: "", embodiedWater: "", }, { eid: "e11952", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "450", targetSimName: "MDG", targetName: "Madagascar", targetRegion: "Sub-Saharan Africa", resource: "Wheat", year: "2015", value: "12.537", weight: "27.011", embodiedLand: "11.171", embodiedWater: "16.396", }, { eid: "e11953", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "764", targetSimName: "THA", targetName: "Thailand", targetRegion: "Southeast Asia", resource: "Wheat", year: "2015", value: "24935.4179", weight: "104332.188", embodiedLand: "47360.4095", embodiedWater: "68441.9161", }, { eid: "e11954", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "104", targetSimName: "MMR", targetName: "Myanmar", targetRegion: "Southeast Asia", resource: "Wheat", year: "2016", value: "96.16", weight: "524.11", embodiedLand: "", embodiedWater: "", }, { eid: "e11955", source: "858", sourceSimName: "URY", sourceRegion: "Uruguay", sourceName: "South America", target: "533", targetSimName: "ABW", targetName: "Aruba", targetRegion: "Caribbean and Central America", resource: "Rice", year: "2016", value: "13.297", weight: "24", embodiedLand: "", embodiedWater: "", }, { eid: "e11967", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "4", targetSimName: "AFG", targetName: "Afghanistan", targetRegion: "South Asia", resource: "Wheat", year: "2015", value: "24401.666", weight: "75279.56", embodiedLand: "28122.882", embodiedWater: "36209.468", }, { eid: "e11968", source: "860", sourceSimName: "UZB", sourceRegion: "Uzbekistan", sourceName: "Central and Northern Asia", target: "246", targetSimName: "FIN", targetName: "Finland", targetRegion: "Europe", resource: "Barley", year: "2016", value: "", weight: "", embodiedLand: "", embodiedWater: "", }, { eid: "e11996", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "458", targetSimName: "MYS", targetName: "Malaysia", targetRegion: "Southeast Asia", resource: "Maize", year: "2015", value: "174.23", weight: "454.5", embodiedLand: "", embodiedWater: "", }, { eid: "e11997", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "690", targetSimName: "SYC", targetName: "Seychelles", targetRegion: "Sub-Saharan Africa", resource: "Rice", year: "2015", value: "0.11", weight: "0.01", embodiedLand: "", embodiedWater: "", }, { eid: "e11998", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "724", targetSimName: "ESP", targetName: "Spain", targetRegion: "Europe", resource: "Maize", year: "2015", value: "6.294", weight: "4.58", embodiedLand: "1.249", embodiedWater: "1.53", }, { eid: "e11999", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "780", targetSimName: "TTO", targetName: "Trinidad and Tobago", targetRegion: "Caribbean and Central America", resource: "Oats", year: "2015", value: "0.025", weight: "0.008", embodiedLand: "", embodiedWater: "", }, { eid: "e12000", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Rice", year: "2015", value: "11.889", weight: "21.609", embodiedLand: "5.737", embodiedWater: "157.097", }, { eid: "e12001", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "144", targetSimName: "LKA", targetName: "Sri Lanka", targetRegion: "South Asia", resource: "Rice", year: "2016", value: "1.367", weight: "1.583", embodiedLand: "", embodiedWater: "", }, { eid: "e12002", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "499", targetSimName: "MNE", targetName: "Montenegro", targetRegion: "Europe", resource: "Rice", year: "2016", value: "0.467", weight: "0.75", embodiedLand: "", embodiedWater: "", }, { eid: "e12003", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "752", targetSimName: "SWE", targetName: "Sweden", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.117", weight: "0.116", embodiedLand: "", embodiedWater: "", }, { eid: "e12004", source: "862", sourceSimName: "VEN", sourceRegion: "Venezuela", sourceName: "South America", target: "784", targetSimName: "ARE", targetName: "United Arab Emirates", targetRegion: "Middle East and North Africa", resource: "Rice", year: "2016", value: "22.327", weight: "24.749", embodiedLand: "", embodiedWater: "", }, { eid: "e12012", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "554", targetSimName: "NZL", targetName: "New Zealand", targetRegion: "Oceania", resource: "Maize", year: "2015", value: "0.455", weight: "0.05", embodiedLand: "", embodiedWater: "", }, { eid: "e12013", source: "882", sourceSimName: "WSM", sourceRegion: "Samoa", sourceName: "Oceania", target: "842", targetSimName: "USA", targetName: "United States", targetRegion: "North America", resource: "Wheat", year: "2015", value: "0.001", weight: "0.004", embodiedLand: "", embodiedWater: "", }, { eid: "e12043", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "792", targetSimName: "TUR", targetName: "Turkey", targetRegion: "Europe", resource: "Maize", year: "2015", value: "30.578", weight: "66", embodiedLand: "38.092", embodiedWater: "4450.248", }, { eid: "e12044", source: "887", sourceSimName: "YEM", sourceRegion: "Yemen", sourceName: "Middle East and North Africa", target: "528", targetSimName: "NLD", targetName: "Netherlands", targetRegion: "Europe", resource: "Maize", year: "2016", value: "0.003", weight: "0.001", embodiedLand: "", embodiedWater: "", }, { eid: "e12093", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "586", targetSimName: "PAK", targetName: "Pakistan", targetRegion: "South Asia", resource: "Maize", year: "2016", value: "0.102", weight: "1", embodiedLand: "", embodiedWater: "", }, { eid: "e12094", source: "894", sourceSimName: "ZMB", sourceRegion: "Zambia", sourceName: "Sub-Saharan Africa", target: "686", targetSimName: "SEN", targetName: "Senegal", targetRegion: "Sub-Saharan Africa", resource: "Maize", year: "2016", value: "82.825", weight: "18.152", embodiedLand: "", embodiedWater: "", }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-force-clustering/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 力导向布局聚类 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", clustering: true, clusterNodeStrength: -5, clusterEdgeDistance: 200, clusterNodeSize: 20, clusterFociStrength: 1.2, nodeSpacing: 5, preventOverlap: true, }, defaultNode: { size: 15, }, modes: { default: ["zoom-canvas", "drag-canvas", "drag-node"], }, }); const colorMap = { 2012: "#BDD2FD", 2013: "#BDEFDB", 2014: "#F6C3B7", 2015: "#FFD8B8", 2016: "#D3C6EA", }; this.graph.data(data); data.nodes.forEach((i) => { i.cluster = i.year; i.style = Object.assign(i.style || {}, { fill: colorMap[i.year], }); }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-force-clustering/index.json ================================================ { "navigationBarTitleText": "力导向布局聚类", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-force-clustering/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-force-clustering/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-functional-params/data.js ================================================ export default () => ({ nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, { id: "node4", size: 30, isLeaf: true }, { id: "node5", size: 30, isLeaf: true }, { id: "node6", size: 15, isLeaf: true }, { id: "node7", size: 15, isLeaf: true }, { id: "node8", size: 15, isLeaf: true }, { id: "node9", size: 15, isLeaf: true }, { id: "node10", size: 15, isLeaf: true }, { id: "node11", size: 15, isLeaf: true }, { id: "node12", size: 15, isLeaf: true }, { id: "node13", size: 15, isLeaf: true }, { id: "node14", size: 15, isLeaf: true }, { id: "node15", size: 15, isLeaf: true }, { id: "node16", size: 15, isLeaf: true }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node0", target: "node4" }, { source: "node0", target: "node5" }, { source: "node1", target: "node6" }, { source: "node1", target: "node7" }, { source: "node2", target: "node8" }, { source: "node2", target: "node9" }, { source: "node2", target: "node10" }, { source: "node2", target: "node11" }, { source: "node2", target: "node12" }, { source: "node2", target: "node13" }, { source: "node3", target: "node14" }, { source: "node3", target: "node15" }, { source: "node3", target: "node16" }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-functional-params/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 定制不同节点的参数 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, linkDistance: (d) => { if (d.source.id === "node0") { return 100; } return 30; }, nodeStrength: (d) => { if (d.isLeaf) { return -50; } return -10; }, edgeStrength: (d) => { if ( d.source.id === "node1" || d.source.id === "node2" || d.source.id === "node3" ) { return 0.7; } return 0.1; }, }, defaultNode: { color: "#5B8FF9", }, modes: { default: ["drag-canvas"], }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", (e) => { refreshDragedNodePosition(e); }); this.graph.on("node:dragend", (e) => { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-functional-params/index.json ================================================ { "navigationBarTitleText": "定制不同节点的参数", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-functional-params/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-functional-params/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-prevent-overlap/data.js ================================================ export default () => ({ nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-prevent-overlap/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * 力导向布局防止节点重叠 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "force", preventOverlap: true, }, modes: { default: ["drag-canvas"], }, }); function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } const { nodes } = data; // randomize the node size nodes.forEach((node) => { node.size = Math.random() * 30 + 5; }); this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.on("node:dragstart", function (e) { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", function (e) { const forceLayout = this.graph.get("layoutController").layoutMethods[0]; forceLayout.execute(); refreshDragedNodePosition(e); }); this.graph.on("node:dragend", (e) => { e.item.get("model").fx = null; e.item.get("model").fy = null; }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-prevent-overlap/index.json ================================================ { "navigationBarTitleText": "力导向布局防止节点重叠", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-prevent-overlap/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/force-directed-prevent-overlap/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman/data.js ================================================ export default () => ({ nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import fruchtermanLayout from "@antv/f6-wx/extends/layout/fruchtermanLayout"; /** * fruchterman */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 5, speed: 5, // for rendering after each iteration tick: () => { this.graph.refreshPositions(); }, }, animate: true, defaultNode: { size: 30, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman/index.json ================================================ { "navigationBarTitleText": "基本Fruchterman", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-clustering/data.js ================================================ function getData() { const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach((node) => { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) { node.style = {}; } node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); return data; } export default getData; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-clustering/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import fruchtermanLayout from "@antv/f6-wx/extends/layout/fruchtermanLayout"; /** * fruchterman 聚类布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 10, speed: 5, clustering: true, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-clustering/index.json ================================================ { "navigationBarTitleText": "Fruchterman聚类", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-clustering/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-clustering/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-configuration-translate/data.js ================================================ function getData() { const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = [ "#BDD2FD", "#BDEFDB", "#C2C8D5", "#FBE5A2", "#F6C3B7", "#B6E3F5", "#D3C6EA", "#FFD8B8", "#AAD8D8", "#FFD6E7", ]; const strokes = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#E8684A", "#6DC8EC", "#9270CA", "#FF9D4D", "#269A99", "#FF99C3", ]; const { nodes } = data; const clusterMap = new Map(); let clusterId = 0; nodes.forEach((node) => { // cluster if (node.cluster && clusterMap.get(node.cluster) === undefined) { clusterMap.set(node.cluster, clusterId); clusterId++; } const cid = clusterMap.get(node.cluster); if (!node.style) { node.style = {}; } node.style.fill = colors[cid % colors.length]; node.style.stroke = strokes[cid % strokes.length]; }); return data; } export default getData; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-configuration-translate/index.js ================================================ import F6 from "@antv/f6-wx"; import getData from "./data"; import fruchtermanLayout from "@antv/f6-wx/extends/layout/fruchtermanLayout"; /** * fruchterman 布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, description: "Fructherman layout, gravity = 1", }, onLoad() { // 注册布局 F6.registerLayout("fruchterman", fruchtermanLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = getData(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 1, speed: 5, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { size: 1, style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); function layoutConfigTranslation() { setTimeout(() => { me.setData({ description: "Fructherman layout, gravity = 5", }); me.graph.updateLayout({ gravity: 5, }); }, 1000); setTimeout(() => { me.setData({ description: "Fructherman layout, gravity = 10, layout by cluster", }); me.graph.updateLayout({ gravity: 10, clustering: true, }); }, 2500); setTimeout(() => { me.setData({ description: "Fructherman layout, gravity = 20, layout by cluster", }); me.graph.updateLayout({ gravity: 20, }); }, 4000); setTimeout(() => { me.setData({ description: "Fructherman layout, gravity = 50, layout by cluster", }); me.graph.updateLayout({ gravity: 50, }); }, 5500); setTimeout(() => { me.setData({ description: "Fructherman layout, gravity = 80, layout by cluster", }); me.graph.updateLayout({ gravity: 80, }); }, 7000); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-configuration-translate/index.json ================================================ { "navigationBarTitleText": "参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-configuration-translate/index.wxml ================================================ {{description}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/fruchterman-configuration-translate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/interact-radial/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const data2_m = { nodes: [ { id: "2", label: "2", }, { id: "1001", label: "1001", }, { id: "1002", label: "1002", }, { id: "1003", label: "1003", }, { id: "1004", label: "1004", }, { id: "1005", label: "1005", }, { id: "1006", label: "1006", }, { id: "1007", label: "1007", }, { id: "1008", label: "1008", }, { id: "1009", label: "1009", }, { id: "1010", label: "1010", }, { id: "1011", label: "1011", }, { id: "1012", label: "1012", }, { id: "1013", label: "1013", }, { id: "1014", label: "1014", }, { id: "1015", label: "1015", }, { id: "1016", label: "1016", }, { id: "1017", label: "1017", }, { id: "1018", label: "1018", }, { id: "1019", label: "1019", }, { id: "1020", label: "1020", }, { id: "5", label: "5", }, { id: "41", label: "41", }, ], edges: [ { source: "2", target: "1001", }, { source: "2", target: "1002", }, { source: "2", target: "1003", }, { source: "2", target: "1004", }, { source: "2", target: "1005", }, { source: "1001", target: "1006", }, { source: "1001", target: "1007", }, { source: "1001", target: "1008", }, { source: "1001", target: "1009", }, { source: "1001", target: "1010", }, { source: "1002", target: "1006", }, { source: "1002", target: "1007", }, { source: "1002", target: "1008", }, { source: "1002", target: "1009", }, { source: "1002", target: "1010", }, { source: "1003", target: "1006", }, { source: "1003", target: "1007", }, { source: "1003", target: "1008", }, { source: "1003", target: "1009", }, { source: "1003", target: "1010", }, { source: "1010", target: "1011", }, { source: "1010", target: "1012", }, { source: "1010", target: "1013", }, { source: "1010", target: "1014", }, { source: "1010", target: "1015", }, { source: "1010", target: "1016", }, { source: "1010", target: "1017", }, { source: "1008", target: "1014", }, { source: "1008", target: "1015", }, { source: "1008", target: "1016", }, { source: "1008", target: "1017", }, { source: "1017", target: "1018", }, { source: "1017", target: "1019", }, { source: "1016", target: "1020", }, { source: "1016", target: "1020", }, { source: "5", target: "1020", }, { source: "41", target: "1020", }, { source: "5", target: "1009", }, { source: "41", target: "1009", }, ], }; export { data, data2_m }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/interact-radial/index.js ================================================ import F6 from "@antv/f6-wx"; import { data, data2_m } from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * 交互扩展节点的辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, mainUnitRadius: 80, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const focusNode = data.nodes[22]; focusNode.style = { stroke: "#00419F", fill: "#729FFC", lineWidth: 2, }; data.nodes[2].style = { stroke: "#00419F", fill: "#729FFC", lineWidth: 2, }; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "radial", maxIteration: 200, focusNode, unitRadius: this.mainUnitRadius, linkDistance: 100, preventOverlap: true, nodeSize: 20, }, animate: true, modes: { default: ["drag-node", "click-select", "click-add-node", "drag-canvas"], }, defaultNode: { size: 20, }, }); this.graph.on("node:tap", (ev) => { const itemModel = ev.item.getModel(); const nodes = this.graph.getNodes(); const edges = this.graph.getEdges(); let newData; if (itemModel.id === "2") newData = data2_m; else return; const newNodeModels = newData.nodes; const newEdgeModels = []; // deduplication the items in newEdgeModels newData.edges.forEach((e) => { let exist = false; newEdgeModels.forEach((ne) => { if (ne.source === e.source && ne.target === e.target) exist = true; }); if (!exist) { newEdgeModels.push(e); } }); // for graph.changeData() const allNodeModels = []; const allEdgeModels = []; // add new nodes to graph const nodeMap = new Map(); nodes.forEach((n) => { const nModel = n.getModel(); nodeMap.set(nModel.id, n); }); newNodeModels.forEach((nodeModel) => { if (nodeMap.get(nodeModel.id) === undefined) { // set the initial positions of the new nodes to the focus(clicked) node nodeModel.x = itemModel.x; nodeModel.y = itemModel.y; this.graph.addItem("node", nodeModel); } }); // add new edges to graph const edgeMap = new Map(); edges.forEach((e, i) => { const eModel = e.getModel(); edgeMap.set(`${eModel.source},${eModel.target}`, i); }); const oldEdgeNum = edges.length; newEdgeModels.forEach(function (em, i) { const exist = edgeMap.get(`${em.source},${em.target}`); if (exist === undefined) { this.graph.addItem("edge", em); edgeMap.set(`${em.source},${em.target}`, oldEdgeNum + i); } }); edges.forEach((e) => { allEdgeModels.push(e.getModel()); }); nodes.forEach((n) => { allNodeModels.push(n.getModel()); }); // the max degree about foces(clicked) node in the newly added data const maxDegree = 4; // the max degree about foces(clicked) node in the original data const oMaxDegree = 3; const unitRadius = 40; // re-place the clicked node far away the exisiting items // along the radius from center node to it const vx = itemModel.x - focusNode.x; const vy = itemModel.y - focusNode.y; const vlength = Math.sqrt(vx * vx + vy * vy); const ideallength = unitRadius * maxDegree + this.mainUnitRadius * oMaxDegree; itemModel.x = (ideallength * vx) / vlength + focusNode.x; itemModel.y = (ideallength * vy) / vlength + focusNode.y; const Radial = F6.layout.radial; const subRadialLayout = new Radial({ center: [itemModel.x, itemModel.y], maxIteration: 200, focusNode: "2", unitRadius, linkDistance: 180, preventOverlap: true, }); subRadialLayout.init({ nodes: newNodeModels, edges: newEdgeModels, }); subRadialLayout.execute(); this.graph.positionsAnimate(); this.graph.data({ nodes: allNodeModels, edges: allEdgeModels, }); }); this.graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/interact-radial/index.json ================================================ { "navigationBarTitleText": "交互扩展节点的辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/interact-radial/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/interact-radial/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layout-timing/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layout-timing/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * layout-timing */ let currentPage = null; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, message: "", }, onLoad() { F6.registerLayout("force", force); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); // 获取文本框 this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); currentPage = this; }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, layout: { type: "force", preventOverlap: true, nodeSize: 20, }, modes: { default: ["drag-node"], }, }); // 监听 this.graph.on("beforelayout", () => { currentPage.setData({ message: "Doing force-directed layout... the text will be changed after the layout being done.", }); }); this.graph.on("afterlayout", () => { currentPage.setData({ message: "Done!", }); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layout-timing/index.json ================================================ { "navigationBarTitleText": "布局时机监听", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layout-timing/index.wxml ================================================ {{message}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layout-timing/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layoutTranslate/data.js ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layoutTranslate/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; import grid from "@antv/f6-wx/extends/layout/gridLayout"; import force from "@antv/f6-wx/extends/layout/forceLayout"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; import concentric from "@antv/f6-wx/extends/layout/concentricLayout"; import mds from "@antv/f6-wx/extends/layout/mdsLayout"; /** * layoutTranslate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); F6.registerLayout("grid", grid); F6.registerLayout("force", force); F6.registerLayout("radial", radial); F6.registerLayout("concentric", concentric); F6.registerLayout("mds", mds); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "circular", // TODO:random }, modes: { default: ["drag-node"], }, animate: true, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setTimeout(() => { this.graph.updateLayout({ type: "circular", radius: 200, }); }, 3000); setTimeout(() => { this.graph.updateLayout({ type: "grid", }); }, 6000); setTimeout(() => { this.graph.updateLayout({ type: "force", preventOverlap: true, nodeSize: 20, }); }, 9000); setTimeout(() => { this.graph.updateLayout({ type: "radial", preventOverlap: true, nodeSize: 15, }); }, 12000); setTimeout(() => { this.graph.updateLayout({ type: "concentric", minNodeSpacing: 30, }); }, 15000); setTimeout(() => { this.graph.updateLayout({ type: "mds", linkDistance: 100, }); }, 18000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layoutTranslate/index.json ================================================ { "navigationBarTitleText": "布局切换", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layoutTranslate/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/layoutTranslate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-radial/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const { nodes } = data; nodes.forEach((node) => { node.size = Math.random() * 20 + 10; }); export default data; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-radial/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * 防止节点重叠的严格辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, preventOverlap: true, maxPreventOverlapIteration: 100, }, animate: true, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-radial/index.json ================================================ { "navigationBarTitleText": "防止节点重叠的严格辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-radial/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-radial/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * 防止节点重叠的非严格辐射布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 70, preventOverlap: true, strictRadial: false, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/index.json ================================================ { "navigationBarTitleText": "防止节点重叠的非严格辐射布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/radial-configuration-translate/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/radial-configuration-translate/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * Radial布局参数动态变化 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: false", }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 50, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); const me = this; this.graph.data(data); this.graph.render(); this.graph.fitView(); layoutConfigTranslation(); setInterval(() => { layoutConfigTranslation(); }, 7000); function layoutConfigTranslation() { setTimeout(() => { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: true", }); me.graph.updateLayout({ preventOverlap: true, nodeSize: 20, }); }, 1000); setTimeout(() => { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ unitRadius: 80, }); }, 2500); setTimeout(() => { me.setData({ description: "Radial layout, focusNode = = 10, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ focusNode: "10", }); }, 4000); setTimeout(() => { me.setData({ description: "Radial layout, focusNode = = 20, unitRadius = 80, preventOverlap: true", }); me.graph.updateLayout({ focusNode: "20", }); }, 5500); setTimeout(() => { me.setData({ description: "Radial layout, focusNode = = 0, unitRadius = 50, preventOverlap: false", }); me.graph.updateLayout({ focusNode: "0", preventOverlap: false, unitRadius: 50, }); }, 5500); } }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/radial-configuration-translate/index.json ================================================ { "navigationBarTitleText": "布局参数动态变化", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/radial-configuration-translate/index.wxml ================================================ {{description}} ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/radial-configuration-translate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sort-radial/data.js ================================================ const data = { nodes: [ { id: "0", sortAttr: 0, sortAttr2: "a", }, { id: "1", sortAttr: 0, sortAttr2: "a", }, { id: "2", sortAttr: 0, sortAttr2: "a", }, { id: "3", sortAttr: 0, sortAttr2: "a", }, { id: "4", sortAttr: 2, sortAttr2: "c", }, { id: "5", sortAttr: 0, sortAttr2: "a", }, { id: "6", sortAttr: 1, sortAttr2: "b", }, { id: "7", sortAttr: 1, sortAttr2: "b", }, { id: "8", sortAttr: 2, sortAttr2: "c", }, { id: "9", sortAttr: 3, sortAttr2: "d", }, { id: "10", sortAttr: 3, sortAttr2: "d", }, { id: "11", sortAttr: 1, sortAttr2: "b", }, { id: "12", sortAttr: 2, sortAttr2: "c", }, { id: "13", sortAttr: 1, sortAttr2: "b", }, { id: "14", sortAttr: 3, sortAttr2: "d", }, { id: "15", sortAttr: 3, sortAttr2: "d", }, { id: "16", sortAttr: 1, sortAttr2: "b", }, { id: "17", sortAttr: 2, sortAttr2: "c", }, { id: "18", sortAttr: 2, sortAttr2: "c", }, { id: "19", sortAttr: 1, sortAttr2: "b", }, { id: "20", sortAttr: 1, sortAttr2: "b", }, { id: "21", sortAttr: 3, sortAttr2: "d", }, { id: "22", sortAttr: 3, sortAttr2: "d", }, { id: "23", sortAttr: 3, sortAttr2: "d", }, { id: "24", sortAttr: 0, sortAttr2: "a", }, { id: "25", sortAttr: 0, sortAttr2: "a", }, { id: "26", sortAttr: 1, sortAttr2: "b", }, { id: "27", sortAttr: 1, sortAttr2: "b", }, { id: "28", sortAttr: 3, sortAttr2: "d", }, { id: "29", sortAttr: 2, sortAttr2: "c", }, { id: "30", sortAttr: 2, sortAttr2: "c", }, { id: "31", sortAttr: 1, sortAttr2: "b", }, { id: "32", sortAttr: 1, sortAttr2: "b", }, { id: "33", sortAttr: 0, sortAttr2: "a", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; const colors = ["steelblue", "green", "pink", "grey"]; const colorsObj = { a: "steelblue", b: "green", c: "pink", d: "grey" }; data.nodes.forEach((node) => { node.size = 20; node.style = { lineWidth: 4, fill: "#fff", stroke: colors[node.sortAttr2] || colorsObj[node.sortAttr2], }; }); export default data; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sort-radial/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import radial from "@antv/f6-wx/extends/layout/radialLayout"; /** * 同层节点按照指定字段聚类 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("radial", radial); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 30, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", unitRadius: 70, maxIteration: 1000, linkDistance: 10, preventOverlap: true, nodeSize: 30, sortBy: "sortAttr2", sortStrength: 50, }, animate: true, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sort-radial/index.json ================================================ { "navigationBarTitleText": "同层节点按照指定字段聚类", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sort-radial/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sort-radial/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/spiral-circular/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/spiral-circular/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import circular from "@antv/f6-wx/extends/layout/circularLayout"; /** * 螺旋线布局 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册布局 F6.registerLayout("circular", circular); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "circular", startRadius: 10, endRadius: 300, }, animate: true, defaultNode: { size: 20, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/spiral-circular/index.json ================================================ { "navigationBarTitleText": "螺旋线布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/spiral-circular/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/spiral-circular/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/subgraph-layout/data.js ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/subgraph-layout/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import Force from "@antv/f6-wx/extends/layout/forceLayout"; /** * subgraph-layout */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const { nodes } = data; nodes.forEach((node, i) => { if (i <= 16 && i !== 12) { if (!node.style) { node.style = { fill: "#F6C3B7", stroke: "#E8684A", }; } else { node.style.fill = "lightsteelblue"; } } }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, modes: { default: ["drag-node"], }, defaultNode: { size: 20, style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, color: "#e2e2e2", }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); setTimeout(() => { // const { nodes } = data; const { edges } = data; const newNodes = []; const newEdges = []; const newNodeMap = new Map(); // fix the nodes[0] nodes[0].fx = nodes[0].x; nodes[0].fy = nodes[0].y; // add the nodes which should be re-layout nodes.forEach((node, i) => { if (i <= 16 && i !== 12) { newNodes.push(node); newNodeMap.set(node.id, i); } }); // add related edges edges.forEach((edge) => { const sourceId = edge.source; const targetId = edge.target; if ( newNodeMap.get(sourceId) !== undefined && newNodeMap.get(targetId) !== undefined ) { newEdges.push(edge); } }); // TODO:1、这里不知道怎么改,2、force的开头F要大写 const subForceLayout = new Force({ center: [nodes[0].x, nodes[0].y], linkDistance: 70, preventOverlap: true, nodeSize: 20, tick: () => { // the tick function to show the animation of layout process this.graph.refreshPositions(); }, }); subForceLayout.init({ nodes: newNodes, edges: newEdges, }); subForceLayout.execute(); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/subgraph-layout/index.json ================================================ { "navigationBarTitleText": "子图布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/subgraph-layout/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/subgraph-layout/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sublayout-pipes/data.js ================================================ const data = { nodes: [], edges: [] }; for (let i = 0; i < 32; i++) { data.nodes.push({ id: `${i}`, label: i < 17 ? `employee-${i}` : `company-${i - 17}`, dataType: i < 17 ? "employee" : "company", style: i < 17 ? { stroke: "#5D7092", fill: "#5D7092", fillOpacity: 0.5 } : { stroke: "#5B8FF9", fill: "#5B8FF9", fillOpacity: 0.5 }, }); } data.edges = [ { source: "0", target: "1" }, { source: "0", target: "2" }, { source: "0", target: "3" }, { source: "0", target: "4" }, { source: "0", target: "5" }, { source: "0", target: "6" }, { source: "1", target: "2" }, { source: "1", target: "3" }, { source: "1", target: "4" }, { source: "1", target: "5" }, { source: "1", target: "6" }, { source: "2", target: "3" }, { source: "2", target: "4" }, { source: "2", target: "5" }, { source: "2", target: "6" }, { source: "7", target: "8" }, { source: "8", target: "9" }, { source: "9", target: "10" }, { source: "11", target: "12" }, { source: "12", target: "13" }, { source: "13", target: "14" }, { source: "14", target: "15" }, { source: "15", target: "16" }, { source: "11", target: "14" }, { source: "31", target: "11" }, { source: "24", target: "4" }, { source: "23", target: "7" }, ]; const legendData = { nodes: [ { id: "employee", label: "employee", style: { stroke: "#5D7092", fill: "#5D7092" }, }, { id: "company", label: "company", style: { stroke: "#5B8FF9", fill: "#5B8FF9" }, }, ], edges: [], }; export { data, legendData }; ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sublayout-pipes/index.js ================================================ import F6 from "@antv/f6-wx"; import { Legend } from "@antv/f6-plugin/f6Plugin"; import { data, legendData } from "./data"; /** * sublayout-pipes */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 新建F6.legend实例 const legend = new Legend({ data: legendData, align: "center", layout: "horizontal", // vertical position: "bottom-left", vertiSep: 12, horiSep: 24, offsetY: -24, padding: [4, 16, 8, 16], containerStyle: { fill: "#ccc", lineWidth: 1, }, title: "Legend", titleConfig: { position: "left", offsetX: 0, offsetY: 12, }, filter: { enable: true, multiple: true, trigger: "click", graphActiveState: "activeByLegend", graphInactiveState: "inactiveByLegend", filterFunctions: { a: (d) => { if (d.cluster === "a") return true; return false; }, b: (d) => { if (d.cluster === "b") return true; return false; }, c: (d) => { if (d.cluster === "c") return true; return false; }, d: (d) => { if (d.cluster === "d") return true; return false; }, }, }, }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 40, modes: { default: ["drag-canvas", "drag-node"], }, plugins: [legend], animate: true, nodeStateStyles: { activeByLegend: { lineWidth: 5, strokeOpacity: 0.5, stroke: "#f00", }, inactiveByLegend: { opacity: 0.5, }, }, layout: { pipes: [ { type: "circular", nodesFilter: (node) => +node.id <= 6, center: [(width / 5) * 4 - 30, height / 2], radius: width / 10, }, { type: "circular", nodesFilter: (node) => +node.id >= 7 && +node.id <= 10, center: [width / 20 + 30, (height / 3) * 2], radius: width / 20, }, { type: "circular", nodesFilter: (node) => +node.id >= 11 && +node.id <= 16, center: [width / 20 + 30, height / 3], radius: width / 20, }, { type: "grid", nodesFilter: (node) => +node.id > 16, begin: [width / 10 + 50, 20], width: (width / 5) * 3 - 100, height: height - 40, }, ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sublayout-pipes/index.json ================================================ { "navigationBarTitleText": "流水线子图布局", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sublayout-pipes/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-general-graph/pages/general-graph/sublayout-pipes/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/activate-relations/data.js ================================================ export default { nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/activate-relations/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * activate-relations:内置的高亮节点 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // const tooltip = new F6.Tooltip({ // offsetX: 10, // offsetY: 10, // fixToNode: [1, 0.5], // // the types of items that allow the tooltip show up // // 允许出现 tooltip 的 item 类型 // itemTypes: ['node', 'edge'], // // custom the tooltip's content // // 自定义 tooltip 内容 // getContent: (e) => { // const outDiv = document.createElement('div'); // outDiv.style.width = 'fit-content'; // outDiv.style.height = 'fit-content'; // const model = e.item.getModel(); // if (e.item.getType() === 'node') { // outDiv.innerHTML = `${model.name}`; // } else { // const source = e.item.getSource(); // const target = e.item.getTarget(); // outDiv.innerHTML = `来源:${source.getModel().name}
去向:${target.getModel().name}`; // } // return outDiv; // }, // }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, layout: { type: "force", edgeStrength: 0.7, }, // plugins: [tooltip], modes: { default: ["drag-canvas", "activate-relations"], }, defaultNode: { size: [10, 10], /* style for the keyShape */ // style: { // lineWidth: 2, // fill: '#DEE9FF', // stroke: '#5B8FF9', // }, }, defaultEdge: { /* style for the keyShape */ style: { stroke: "#aaa", lineAppendWidth: 2, opacity: 0.3, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/activate-relations/index.json ================================================ { "navigationBarTitleText": "内置的高亮节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/activate-relations/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/activate-relations/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/add-child/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/add-child/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * addChild */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, modes: { default: ["collapse-expand", "drag-canvas"], }, fitView: true, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 50; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node((node) => { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.edge(() => { return { type: "cubic-horizontal", color: "#A3B1BF", }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); let count = 0; this.graph.on("node:tap", function (evt) { const { item } = evt; const nodeId = item.get("id"); const model = item.getModel(); const { children } = model; if (!children || children.length === 0) { const childData = { id: `child-data-${count}`, type: "rect", children: [ { id: `x-${count}`, }, { id: `y-${count}`, }, ], }; this.graph.addChild(childData, nodeId); count++; } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/add-child/index.json ================================================ { "navigationBarTitleText": "使用addChild", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/add-child/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/add-child/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/canvas-two-fingers/data.js ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/canvas-two-fingers/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * canvas-two-fingers */ // 注册行为 // F6.registerBehavior('double-finger-drag-canvas', { // getEvents: function getEvents() { // return { // wheel: 'onWheel', // }; // }, // onWheel: function onWheel(ev) { // if (ev.ctrlKey) { // const canvas = graph.get('canvas'); // const point = canvas.getPointByClient(ev.clientX, ev.clientY); // let ratio = this.graph.getZoom(); // if (ev.wheelDelta > 0) { // ratio = ratio + ratio * 0.05; // } else { // ratio = ratio - ratio * 0.05; // } // this.graph.zoomTo(ratio, { // x: point.x, // y: point.y, // }); // } else { // const x = ev.deltaX || ev.movementX; // let y = ev.deltaY || ev.movementY; // this.graph.translate(-x, -y); // } // ev.preventDefault(); // }, // }); Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, currentMode: "请选择模式", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio, currentMode } = this.data; console.log(currentMode, "111"); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: ["double-finger-drag-canvas"], }, layout: { type: "force", }, }); this.graph.get("canvas").set("localRefresh", false); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/canvas-two-fingers/index.json ================================================ { "navigationBarTitleText": "两指平移画布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/canvas-two-fingers/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/canvas-two-fingers/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-data/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-data/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * changeData */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, modes: { default: ["collapse-expand", "drag-canvas"], }, fitView: true, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 50; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node((node) => { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); let i = 0; this.graph.edge(() => { i++; return { type: "cubic-horizontal", color: "#A3B1BF", label: i, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); let count = 0; this.graph.on("node:tap", function (evt) { const { item } = evt; const nodeId = item.get("id"); const model = item.getModel(); const { children } = model; if (!children || children.length === 0) { const childData = [ { id: `child-data-${count}`, type: "rect", children: [ { id: `x-${count}`, }, { id: `y-${count}`, }, ], }, { id: `child-data1-${count}`, children: [ { id: `x1-${count}`, }, { id: `y1-${count}`, }, ], }, ]; const parentData = this.graph.findDataById(nodeId); if (!parentData.children) { parentData.children = []; } // 如果childData是一个数组,则直接赋值给parentData.children // 如果是一个对象,则使用parentData.children.push(obj) parentData.children = childData; this.graph.changeData(); count++; } }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-data/index.json ================================================ { "navigationBarTitleText": "使用changeData", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-data/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-data/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-members/data.js ================================================ export default { nodes: [ { id: "1", label: "公司1", group: 1, }, { id: "2", label: "公司2", group: 1, }, { id: "3", label: "公司3", group: 1, }, { id: "4", label: "公司4", group: 1, }, { id: "5", label: "公司5", group: 2, }, { id: "6", label: "公司6", group: 2, }, { id: "7", label: "公司7", group: 2, }, { id: "8", label: "公司8", group: 2, }, { id: "9", label: "公司9", group: 2, }, ], edges: [ { source: "1", target: "1", type: "loop", }, { source: "2", target: "2", type: "loop", }, { source: "1", target: "2", data: { type: "A", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "3", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "2", target: "5", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, { source: "5", target: "6", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "3", target: "4", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, { source: "4", target: "7", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "8", data: { type: "B", amount: "100,000 元", date: "2019-08-03", }, }, { source: "1", target: "9", data: { type: "C", amount: "100,000 元", date: "2019-08-03", }, }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-members/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import grid from "@antv/f6-wx/extends/layout/gridLayout"; /** * change-members:修改包裹内部成员 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, discription: "Wait for the layout to complete...", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerLayout("grid", grid); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, layout: { type: "grid", }, }); const hull1 = this.graph.createHull({ id: "hull1", type: "smooth-convex", padding: 15, members: this.graph .getNodes() .filter((node) => node.getModel().group === 1), }); const hull2 = this.graph.createHull({ id: "hull2", members: this.graph .getNodes() .filter((node) => node.getModel().group === 2), padding: 15, type: "bubble", style: { fill: "pink", stroke: "red", }, update: "drag", }); this.graph.on("canvas:contextmenu", (ev) => { ev.preventDefault(); ev.stopPropagation(); const item = this.graph.addItem("node", { x: ev.x, y: ev.y, id: Math.random(), group: 2, }); hull2.addMember(item); }); this.graph.on("afterupdateitem", (e) => { if ( hull1.members.indexOf(e.item) > -1 || hull1.nonMembers.indexOf(e.item) > -1 ) { hull1.updateData(hull1.members); } }); this.graph.on("node:dragend", (e) => { const { item } = e; const memberIdx = hull2.members.indexOf(item); if (memberIdx > -1) { // 如果移出原hull范围,则去掉 if (!hull2.contain(item)) { hull2.removeMember(item); } else { hull2.updateData(hull2.members); } } else if (hull2.contain(item)) hull2.addMember(item); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-members/index.json ================================================ { "navigationBarTitleText": "修改包裹内部成员", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-members/index.wxml ================================================ {{discription}} ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/change-members/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/collapse-slibing/data.js ================================================ export default { isRoot: true, id: "Root", cluster: "c0", children: [ { id: "SubTreeNode1", cluster: "c0", raw: {}, children: [ { id: "SubTreeNode1.1", cluster: "c1", }, { id: "SubTreeNode1.2", cluster: "c1", children: [ { id: "SubTreeNode1.2.1", cluster: "c0", }, { id: "SubTreeNode1.2.2", cluster: "c0", }, { id: "SubTreeNode1.2.3", cluster: "c1", }, ], }, ], }, { id: "SubTreeNode2", cluster: "c0", children: [ { id: "SubTreeNode2.1", cluster: "c2", }, ], }, { id: "SubTreeNode3", cluster: "c0", children: [ { id: "SubTreeNode3.1", cluster: "c2", }, { id: "SubTreeNode3.2", cluster: "c2", }, { id: "SubTreeNode3.3", cluster: "c2", }, ], }, { id: "SubTreeNode4", cluster: "c1", }, { id: "SubTreeNode5", cluster: "c1", }, { id: "SubTreeNode6", cluster: "c1", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/collapse-slibing/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data.js"; /** * drag-subtree:拖拽子树改变结构 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, discription: "Click a node to collapse the siblings with same cluster, and click again to expand", }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // custom the collapse-sibling behavior F6.registerBehavior("collapse-slibing", { getEvents() { return { "node:click": "onClick", }; }, onClick(evt) { const { item } = evt; const model = item.getModel(); const { cluster } = model; const parentData = item.get("parent").getModel(); const me = this; if (model.collapsedSiblings) { this.graph.removeChild(model.id); setTimeout(() => { const { children } = parentData; for (let i = model.collapsedSiblings.length - 1; i >= 0; i--) { const add = model.collapsedSiblings[i]; children.splice(add.idx, 0, add); } delete model.collapsedSiblings; me.graph.updateChildren(children, parentData.id); }, 550); return; } const siblingData = parentData.children; if (siblingData.length <= 1) return; let count = 0; const aggregateNode = { id: `aggregate-node-${model.id}`, children: [], cluster, collapsedSiblings: [], }; let modelIdx = siblingData.length - 1; for (let i = siblingData.length - 1; i >= 0; i--) { const sibling = siblingData[i]; if (sibling.id === model.id) { const remove = siblingData[i]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); } else if (sibling.cluster === cluster && sibling.id !== model.id) { count++; aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); const remove = siblingData.splice(i, 1)[0]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); } } if (!count) return; aggregateNode.label = count + 1; aggregateNode.size = 16 + (count + 1) * 4; this.graph.removeChild(model.id); siblingData.splice(modelIdx, 0, aggregateNode); setTimeout(() => { me.graph.updateChildren(siblingData, parentData.id); }, 550); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const colors = ["#5F95FF", "#61DDAA", "#65789B"]; const colorSets = F6.Util.getColorSetsBySubjectColors( colors, "#fff", "default", "#777", ); // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["collapse-slibing", "drag-canvas"], }, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 50; }, }, defaultEdge: { type: "cubic-horizontal", color: "#A3B1BF", }, }); this.graph.node((node) => { const colorSet = colorSets[+node.cluster.replace("c", "")]; return { size: node.size || 16, style: { fill: colorSet.mainFill || "#DEE9FF", stroke: colorSet.mainStroke || "#5B8FF9", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/collapse-slibing/index.json ================================================ { "navigationBarTitleText": "合并同类兄弟节点", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/collapse-slibing/index.wxml ================================================ {{discription}} ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/collapse-slibing/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-circle/data.js ================================================ export default { nodes: [ { id: "node1", x: 350, y: 200, comboId: "combo1" }, { id: "node2", x: 350, y: 250, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], edges: [ { source: "node1", target: "node2" }, { source: "node1", target: "node3" }, { source: "combo1", target: "node3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3", collapsed: true }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-circle/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * combo-circle */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, defaultCombo: { type: "circle", style: { lineWidth: 1, }, labelCfg: { refY: 15, position: "bottom", }, }, comboStateStyles: { dragenter: { lineWidth: 4, stroke: "#FE9797", }, }, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", "click-select", ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("combo:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("node:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("combo:dragenter", (e) => { this.graph.setItemState(e.item, "dragenter", true); }); this.graph.on("combo:dragleave", (e) => { this.graph.setItemState(e.item, "dragenter", false); }); this.graph.on("combo:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("combo:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-circle/index.json ================================================ { "navigationBarTitleText": "圆形组合", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-circle/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-circle/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-rect/data.js ================================================ export default { nodes: [ { id: "node1", x: 350, y: 200, comboId: "combo1" }, { id: "node2", x: 350, y: 250, comboId: "combo1" }, { id: "node3", x: 100, y: 200, comboId: "combo3" }, ], edges: [ { source: "node1", target: "node2" }, { source: "node1", target: "node3" }, { source: "combo1", target: "node3" }, ], combos: [ { id: "combo1", label: "Combo 1", parentId: "combo2" }, { id: "combo2", label: "Combo 2" }, { id: "combo3", label: "Combo 3" }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-rect/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * combo-rect */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // Set groupByTypes to false to get rendering result with reasonable visual zIndex for combos groupByTypes: false, defaultCombo: { type: "rect", size: [40, 10], // The minimum size of the Combo padding: [30, 20, 10, 20], style: { lineWidth: 1, }, labelCfg: { refY: 10, refX: 20, position: "bottom", }, }, comboStateStyles: { dragenter: { lineWidth: 4, stroke: "#FE9797", }, }, modes: { default: [ "drag-canvas", "drag-node", "drag-combo", "collapse-expand-combo", "click-select", ], }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 监听 this.graph.on("combo:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("node:dragend", () => { this.graph.getCombos().forEach((combo) => { this.graph.setItemState(combo, "dragenter", false); }); }); this.graph.on("combo:dragenter", (e) => { this.graph.setItemState(e.item, "dragenter", true); }); this.graph.on("combo:dragleave", (e) => { this.graph.setItemState(e.item, "dragenter", false); }); this.graph.on("combo:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("combo:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-rect/index.json ================================================ { "navigationBarTitleText": "矩形组合", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-rect/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/combo-rect/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/drag-subtree/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/drag-subtree/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data.js"; /** * drag-subtree:拖拽子树改变结构 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, discription: "Move a subtree to a new parent by dragging the root node of the subtree.", }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ "drag-canvas", "zoom-canvas", { type: "drag-node", enableDelegate: true, }, ], }, defaultNode: { size: [26, 26], anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, nodeStateStyles: { closest: { fill: "#f00", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node((node) => { return { label: node.id, labelCfg: { offset: 10, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); let minDisNode; this.graph.on("node:dragstart", () => { minDisNode = undefined; }); this.graph.on("node:drag", (e) => { minDisNode = undefined; const { item } = e; const model = item.getModel(); const nodes = this.graph.getNodes(); let minDis = Infinity; nodes.forEach((inode) => { this.graph.setItemState(inode, "closest", false); const node = inode.getModel(); if (node.id === model.id) return; const dis = (node.x - e.x) * (node.x - e.x) + (node.y - e.y) * (node.y - e.y); if (dis < minDis) { minDis = dis; minDisNode = inode; } }); console.log("minDis", minDis, minDisNode); if (minDis < 2000) this.graph.setItemState(minDisNode, "closest", true); else minDisNode = undefined; }); this.graph.on("node:dragend", (e) => { if (!minDisNode) { this.setData({ discription: "Failed. No node close to the dragged node.", }); return; } const { item } = e; const id = item.getID(); const data = this.graph.findDataById(id); // if the minDisNode is a descent of the dragged node, return let isDescent = false; const minDisNodeId = minDisNode.getID(); console.log("dragend", minDisNodeId, isDescent, data, id); F6.Util.traverseTree(data, (d) => { if (d.id === minDisNodeId) isDescent = true; }); if (isDescent) { this.setData({ discription: "Failed. The target node is a descendant of the dragged node.", }); return; } this.graph.removeChild(id); const me = this; setTimeout(() => { const newParentData = this.graph.findDataById(minDisNodeId); let newChildren = newParentData.children; if (newChildren) newChildren.push(data); else newChildren = [data]; me.graph.updateChildren(newChildren, minDisNodeId); me.setData({ discription: "Success.", }); }, 600); }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/drag-subtree/index.json ================================================ { "navigationBarTitleText": "拖拽子树改变结构", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/drag-subtree/index.wxml ================================================ {{discription}} ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/drag-subtree/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/fix-item/data.js ================================================ export default { nodes: [ { id: "node0", size: 50, label: "0", x: 326, y: 268 }, { id: "node1", size: 30, label: "1", x: 280, y: 384 }, { id: "node2", size: 30, label: "2", x: 234, y: 167 }, { id: "node3", size: 30, label: "3", x: 391, y: 368 }, { id: "node4", size: 30, label: "4", x: 444, y: 209 }, { id: "node5", size: 30, label: "5", x: 378, y: 157 }, { id: "node6", size: 15, label: "6", x: 229, y: 400 }, { id: "node7", size: 15, label: "7", x: 281, y: 440 }, { id: "node8", size: 15, label: "8", x: 188, y: 119 }, { id: "node9", size: 15, label: "9", x: 287, y: 157 }, { id: "node10", size: 15, label: "10", x: 185, y: 200 }, { id: "node11", size: 15, label: "11", x: 238, y: 110 }, { id: "node12", size: 15, label: "12", x: 239, y: 221 }, { id: "node13", size: 15, label: "13", x: 176, y: 160 }, { id: "node14", size: 15, label: "14", x: 389, y: 423 }, { id: "node15", size: 15, label: "15", x: 441, y: 341 }, { id: "node16", size: 15, label: "16", x: 442, y: 398 }, ], edges: [ { source: "node0", target: "node1", label: "0-1" }, { source: "node0", target: "node2", label: "0-2" }, { source: "node0", target: "node3", label: "0-3" }, { source: "node0", target: "node4", label: "0-4" }, { source: "node0", target: "node5", label: "0-5" }, { source: "node1", target: "node6", label: "1-6" }, { source: "node1", target: "node7", label: "1-7" }, { source: "node2", target: "node8", label: "2-8" }, { source: "node2", target: "node9", label: "2-9" }, { source: "node2", target: "node10", label: "2-10" }, { source: "node2", target: "node11", label: "2-11" }, { source: "node2", target: "node12", label: "2-12" }, { source: "node2", target: "node13", label: "2-13" }, { source: "node3", target: "node14", label: "3-14" }, { source: "node3", target: "node15", label: "3-15" }, { source: "node3", target: "node16", label: "3-16" }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/fix-item/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * fix-item:缩放画布时固定元素 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, fixSelectedItems: { fixAll: true, fixLabel: false, fixLineWidth: false, fixState: "yourStateName", // 'selected' by default }, }, tapButton(event) { console.log(event); const { mode } = event.target.dataset; console.log(mode); this.graph.setMode(mode); // 添加模式 switch (mode) { case "all": this.setData({ fixSelectedItems: { fixAll: true, fixLabel: false, fixLineWidth: false, fixState: "yourStateName", }, }); break; case "font": this.setData({ fixSelectedItems: { fixAll: false, fixLabel: true, fixLineWidth: false, fixState: "yourStateName", }, }); break; case "lineWidth": this.setData({ fixSelectedItems: { fixAll: false, fixLabel: false, fixLineWidth: true, fixState: "yourStateName", }, }); break; } }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio, fixSelectedItems } = this.data; console.log("update", fixSelectedItems); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ "drag-canvas", "drag-node", { type: "zoom-canvas", fixSelectedItems, }, ], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, edgeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, }); // 监听 this.graph.on("node:tap", (e) => { this.graph.setItemState(e.item, "yourStateName", true); }); this.graph.on("edge:tap", (e) => { this.graph.setItemState(e.item, "yourStateName", true); }); this.graph.on("canvas:tap", () => { this.graph.findAllByState("node", "yourStateName").forEach((node) => { this.graph.setItemState(node, "yourStateName", false); }); this.graph.findAllByState("edge", "yourStateName").forEach((edge) => { this.graph.setItemState(edge, "yourStateName", false); }); }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/fix-item/index.json ================================================ { "navigationBarTitleText": "缩放画布时固定元素", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/fix-item/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/fix-item/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .choice-button { color: #06ae56; margin-bottom: 5px; background-color: #f2f2f2; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hide-item/data.js ================================================ export default { nodes: [ { id: "node0", size: 50, label: "0", x: 326, y: 268 }, { id: "node1", size: 30, label: "1", x: 280, y: 384 }, { id: "node2", size: 30, label: "2", x: 234, y: 167 }, { id: "node3", size: 30, label: "3", x: 391, y: 368 }, { id: "node4", size: 30, label: "4", x: 444, y: 209 }, { id: "node5", size: 30, label: "5", x: 378, y: 157 }, { id: "node6", size: 15, label: "6", x: 229, y: 400 }, { id: "node7", size: 15, label: "7", x: 281, y: 440 }, { id: "node8", size: 15, label: "8", x: 188, y: 119 }, { id: "node9", size: 15, label: "9", x: 287, y: 157 }, { id: "node10", size: 15, label: "10", x: 185, y: 200 }, { id: "node11", size: 15, label: "11", x: 238, y: 110 }, { id: "node12", size: 15, label: "12", x: 239, y: 221 }, { id: "node13", size: 15, label: "13", x: 176, y: 160 }, { id: "node14", size: 15, label: "14", x: 389, y: 423 }, { id: "node15", size: 15, label: "15", x: 441, y: 341 }, { id: "node16", size: 15, label: "16", x: 442, y: 398 }, ], edges: [ { source: "node0", target: "node1", label: "0-1" }, { source: "node0", target: "node2", label: "0-2" }, { source: "node0", target: "node3", label: "0-3" }, { source: "node0", target: "node4", label: "0-4" }, { source: "node0", target: "node5", label: "0-5" }, { source: "node1", target: "node6", label: "1-6" }, { source: "node1", target: "node7", label: "1-7" }, { source: "node2", target: "node8", label: "2-8" }, { source: "node2", target: "node9", label: "2-9" }, { source: "node2", target: "node10", label: "2-10" }, { source: "node2", target: "node11", label: "2-11" }, { source: "node2", target: "node12", label: "2-12" }, { source: "node2", target: "node13", label: "2-13" }, { source: "node3", target: "node14", label: "3-14" }, { source: "node3", target: "node15", label: "3-15" }, { source: "node3", target: "node16", label: "3-16" }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hide-item/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * hide-item */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ "drag-node", { type: "drag-canvas", enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape }, { type: "zoom-canvas", enableOptimize: true, // enable the optimize to hide the shapes beside nodes' keyShape }, ], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, edgeStateStyles: { yourStateName: { stroke: "#f00", lineWidth: 3, }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hide-item/index.json ================================================ { "navigationBarTitleText": "拖拽画布时候隐藏", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hide-item/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hide-item/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/highlight-dark/data.js ================================================ export default { nodes: [ { id: "0", comboId: "a", }, { id: "1", comboId: "a", }, { id: "2", comboId: "a", }, { id: "3", comboId: "a", }, { id: "4", comboId: "a", }, { id: "5", comboId: "a", }, { id: "6", comboId: "a", }, { id: "7", comboId: "a", }, { id: "8", comboId: "a", }, { id: "9", comboId: "a", }, { id: "10", comboId: "a", }, { id: "11", comboId: "a", }, { id: "12", comboId: "a", }, { id: "13", comboId: "a", }, { id: "14", comboId: "a", }, { id: "15", comboId: "a", }, { id: "16", comboId: "b", }, { id: "17", comboId: "b", }, { id: "18", comboId: "b", }, { id: "19", comboId: "b", }, { id: "20", }, { id: "21", }, { id: "22", }, { id: "23", comboId: "c", }, { id: "24", comboId: "a", }, { id: "25", }, { id: "26", }, { id: "27", comboId: "c", }, { id: "28", comboId: "c", }, { id: "29", comboId: "c", }, { id: "30", comboId: "c", }, { id: "31", comboId: "c", }, { id: "32", comboId: "d", }, { id: "33", comboId: "d", }, ], edges: [ { source: "a", target: "b", label: "Combo A - Combo B", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "red", }, }, { source: "a", target: "33", label: "Combo-Node", size: 3, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, fontSize: 20, }, }, style: { stroke: "blue", }, }, { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], combos: [ { id: "a", label: "Combo A", }, { id: "b", label: "Combo B", }, { id: "c", label: "Combo D", }, { id: "d", label: "Combo D", parentId: "b", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/highlight-dark/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * highlight-dark:自定义高亮 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // const tooltip = new F6.Tooltip({ // offsetX: 10, // offsetY: 10, // fixToNode: [1, 0.5], // // the types of items that allow the tooltip show up // // 允许出现 tooltip 的 item 类型 // itemTypes: ['node', 'edge'], // // custom the tooltip's content // // 自定义 tooltip 内容 // getContent: (e) => { // const outDiv = document.createElement('div'); // outDiv.style.width = 'fit-content'; // outDiv.style.height = 'fit-content'; // const model = e.item.getModel(); // if (e.item.getType() === 'node') { // outDiv.innerHTML = `${model.name}`; // } else { // const source = e.item.getSource(); // const target = e.item.getTarget(); // outDiv.innerHTML = `来源:${source.getModel().name}
去向:${target.getModel().name}`; // } // return outDiv; // }, // }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, // plugins: [tooltip], layout: { type: "force", edgeStrength: 0.7, }, modes: { default: ["drag-canvas"], }, defaultNode: { size: [10, 10], style: { lineWidth: 2, fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { size: 1, style: { stroke: "#e2e2e2", lineAppendWidth: 2, }, }, nodeStateStyles: { highlight: { opacity: 1, }, dark: { opacity: 0.2, }, }, edgeStateStyles: { highlight: { stroke: "#999", }, }, }); // 监听 function clearAllStats() { this.graph.setAutoPaint(false); this.graph.getNodes().forEach(function (node) { this.graph.clearItemStates(node); }); this.graph.getEdges().forEach(function (edge) { this.graph.clearItemStates(edge); }); this.graph.paint(); this.graph.setAutoPaint(true); } this.graph.on("node:mouseenter", function (e) { const { item } = e; this.graph.setAutoPaint(false); this.graph.getNodes().forEach(function (node) { this.graph.clearItemStates(node); this.graph.setItemState(node, "dark", true); }); this.graph.setItemState(item, "dark", false); this.graph.setItemState(item, "highlight", true); this.graph.getEdges().forEach(function (edge) { if (edge.getSource() === item) { this.graph.setItemState(edge.getTarget(), "dark", false); this.graph.setItemState(edge.getTarget(), "highlight", true); this.graph.setItemState(edge, "highlight", true); edge.toFront(); } else if (edge.getTarget() === item) { this.graph.setItemState(edge.getSource(), "dark", false); this.graph.setItemState(edge.getSource(), "highlight", true); this.graph.setItemState(edge, "highlight", true); edge.toFront(); } else { this.graph.setItemState(edge, "highlight", false); } }); this.graph.paint(); this.graph.setAutoPaint(true); }); this.graph.on("node:mouseleave", clearAllStats); this.graph.on("canvas:tap", clearAllStats); this.graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/highlight-dark/index.json ================================================ { "navigationBarTitleText": "自定义高亮", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/highlight-dark/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/highlight-dark/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hull/data.js ================================================ export default { nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, { id: "node4", size: 30, isLeaf: true }, { id: "node5", size: 30, isLeaf: true }, { id: "node6", size: 15, isLeaf: true }, { id: "node7", size: 15, isLeaf: true }, { id: "node8", size: 15, isLeaf: true }, { id: "node9", size: 15, isLeaf: true }, { id: "node10", size: 15, isLeaf: true }, { id: "node11", size: 15, isLeaf: true }, { id: "node12", size: 15, isLeaf: true }, { id: "node13", size: 15, isLeaf: true }, { id: "node14", size: 15, isLeaf: true }, { id: "node15", size: 15, isLeaf: true }, { id: "node16", size: 15, isLeaf: true }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node0", target: "node4" }, { source: "node0", target: "node5" }, { source: "node1", target: "node6" }, { source: "node1", target: "node7" }, { source: "node2", target: "node8" }, { source: "node2", target: "node9" }, { source: "node2", target: "node10" }, { source: "node2", target: "node11" }, { source: "node2", target: "node12" }, { source: "node2", target: "node13" }, { source: "node3", target: "node14" }, { source: "node3", target: "node15" }, { source: "node3", target: "node16" }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hull/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import force from "@antv/f6-wx/extends/layout/forceLayout"; /** * hull:用轮廓包裹节点集合 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, discription: "Wait for the layout to complete...", }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerLayout("force", force); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const { nodes } = data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 50, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node", "lasso-select"], }, layout: { type: "force", preventOverlap: true, linkDistance: (d) => { if (d.source.id === "node0") { return 300; } return 60; }, nodeStrength: (d) => { if (d.isLeaf) { return -50; } return -10; }, edgeStrength: (d) => { if ( d.source.id === "node1" || d.source.id === "node2" || d.source.id === "node3" ) { return 0.7; } return 0.1; }, }, }); this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); const centerNodes = this.graph .getNodes() .filter((node) => !node.getModel().isLeaf); this.graph.on("afterlayout", () => { this.setData({ discription: "", }); const hull1 = this.graph.createHull({ id: "centerNode-hull", type: "bubble", members: centerNodes, padding: 10, }); const hull2 = this.graph.createHull({ id: "leafNode-hull1", members: ["node6", "node7"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); const hull3 = this.graph.createHull({ id: "leafNode-hull2", members: ["node8", "node9", "node10", "node11", "node12", "node13"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); this.graph.on("afterupdateitem", () => { hull1.updateData(hull1.members); hull2.updateData(hull2.members); hull3.updateData(hull3.members); }); }); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hull/index.json ================================================ { "navigationBarTitleText": "用轮廓包裹节点集合", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hull/index.wxml ================================================ {{discription}} ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/hull/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 200, y: 150, label: "node2", }, { id: "node3", x: 100, y: 150, label: "node3", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node3", }, { source: "node3", target: "node1", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * move */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); function handleNodeClick(event) { const { item } = event; // animately move the graph to focus on the item. // the second parameter controlls whether move with animation, the third parameter is the animate configuration this.graph.focusItem(item); } // listen to the node click event this.graph.on("node:tap", handleNodeClick); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move/index.json ================================================ { "navigationBarTitleText": "点击节点移动", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move-animate/data.js ================================================ export default { nodes: [ { id: "node1", x: 150, y: 50, label: "node1", }, { id: "node2", x: 200, y: 150, label: "node2", }, { id: "node3", x: 100, y: 150, label: "node3", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node3", }, { source: "node3", target: "node1", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move-animate/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * move-animate */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", }, }, // The global configuration for graph animation also takes effect on the focusItem // animate: true, // animateCfg: { // easing: 'easeCubic', // duration: 500 // } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); function handleNodeClick(event) { const { item } = event; // animately move the graph to focus on the item. // the second parameter controlls whether move with animation, the third parameter is the animate configuration this.graph.focusItem(item, true, { easing: "easeCubic", duration: 500, }); } // listen to the node click event this.graph.on("node:tap", handleNodeClick); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move-animate/index.json ================================================ { "navigationBarTitleText": "点击节点动画", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move-animate/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/move-animate/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/partial-node/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 150, label: "node1", size: 100, type: "customNode", }, { id: "node2", x: 300, y: 150, label: "node2", size: 100, type: "customNode", }, ], edges: [ { source: "node1", target: "node2", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/partial-node/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * partial-node */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义节点 F6.registerNode( "customNode", { // 绘制节点 drawShape: function drawShape(cfg, group) { const { shapeType } = this; const style = Object.assign({}, this.getShapeStyle(cfg), { x: 0, y: 0, r: 50, }); const shape = group.addShape(shapeType, { attrs: style, name: "key-shape", }); // 绘制节点里面的小圆。点击这个小圆会显示tooltip group.addShape("circle", { attrs: { x: 0, y: -30, r: 10, fill: "#096dd9", cursor: "pointer", }, name: "circle-shape", }); return shape; }, }, "circle", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ { type: "drag-node", delegate: false, }, ], }, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, labelCfg: { style: { fontSize: 12, }, }, }, defaultEdge: { style: { stroke: "#e2e2e2", }, }, nodeStateStyles: { selected: { stroke: "red", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); // 节点上的点击事件 this.graph.on("node:tap", (event) => { const { item } = event; this.graph.setItemState(item, "selected", true); }); this.graph.on("circle-shape:tap", (evt) => { const { item } = evt; this.graph.updateItem(item, { label: "点击了局部", labelCfg: { style: { fill: "#003a8c", fontSize: 16, }, }, }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/partial-node/index.json ================================================ { "navigationBarTitleText": "响应节点中部分区域", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/partial-node/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/partial-node/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/set-mode/data.js ================================================ export default { nodes: [ { id: "node1", x: 100, y: 200, }, { id: "node2", x: 300, y: 200, }, { id: "node3", x: 300, y: 300, }, ], edges: [ { id: "edge1", target: "node2", source: "node1", }, ], }; ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/set-mode/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; /** * setMode */ // const modeNum = 0; // 用来标记选择的模式 // const modeList = ['默认模式', '添加节点模式', '添加边模式']; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, currentMode: "请选择模式", showDialog: false, groups: [ { text: "示例菜单", value: 1 }, { text: "示例菜单", value: 2 }, { text: "负向菜单", type: "warn", value: 3 }, ], }, tapButton(event) { console.log(event); const { mode } = event.target.dataset; console.log(mode); this.graph.setMode(mode); }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); // 注册自定义节点 let addedCount = 0; // Register a custom behavior: add a node when user click the blank part of canvas F6.registerBehavior("click-add-node", { // Set the events and the corresponding responsing function for this behavior getEvents() { // The event is canvas:click, the responsing function is onClick return { "canvas:click": "onClick", }; }, // Click event onClick(ev) { const self = this; const { graph } = self; // Add a new node graph.addItem("node", { x: ev.canvasX, y: ev.canvasY, id: `node-${addedCount}`, // Generate the unique id }); addedCount++; }, }); // Register a custom behavior: click two end nodes to add an edge F6.registerBehavior("click-add-edge", { // Set the events and the corresponding responsing function for this behavior getEvents() { return { "node:click": "onClick", // The event is canvas:click, the responsing function is onClick mousemove: "onMousemove", // The event is mousemove, the responsing function is onMousemove "edge:click": "onEdgeClick", // The event is edge:click, the responsing function is onEdgeClick }; }, // The responsing function for node:click defined in getEvents onClick(ev) { const self = this; const node = ev.item; const { graph } = self; // The position where the mouse clicks // const point = { x: ev.x, y: ev.y }; const model = node.getModel(); if (self.addingEdge && self.edge) { graph.updateItem(self.edge, { target: model.id, }); self.edge = null; self.addingEdge = false; } else { // Add anew edge, the end node is the current node user clicks self.edge = graph.addItem("edge", { source: model.id, target: model.id, }); self.addingEdge = true; } }, // The responsing function for mousemove defined in getEvents onMousemove(ev) { const self = this; // The current position the mouse clicks const point = { x: ev.x, y: ev.y }; if (self.addingEdge && self.edge) { // Update the end node to the current node the mouse clicks self.graph.updateItem(self.edge, { target: point, }); } }, // The responsing function for edge:click defined in getEvents onEdgeClick(ev) { const self = this; const currentEdge = ev.item; if (self.addingEdge && self.edge === currentEdge) { self.graph.removeItem(self.edge); self.edge = null; self.addingEdge = false; } }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, // The sets of behavior modes modes: { // Defualt mode default: ["drag-node", "click-select"], // Adding node mode addNode: ["click-add-node", "click-select"], // Adding edge mode addEdge: ["click-add-edge", "click-select"], }, // The node styles in different states nodeStateStyles: { // The node styles in selected state selected: { stroke: "#666", lineWidth: 2, fill: "steelblue", }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/set-mode/index.json ================================================ { "navigationBarTitleText": "设置交互模式", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/set-mode/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-interactive/pages/interactive/set-mode/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .choice-button { color: #06ae56; margin-bottom: 5px; background-color: #f2f2f2; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/bundling/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/bundling/index.js ================================================ import data from "./data"; import F6 from "@antv/f6-wx"; import CircularLayout from "@antv/f6-wx/extends/layout/circularLayout"; import { Bundling } from "@antv/f6-plugin/f6Plugin"; F6.registerLayout("circular", CircularLayout); /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const edgeBundling = new Bundling({ bundleThreshold: 0.1, }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, fitView: true, modes: { default: ["zoom-canvas", "drag-canvas"], }, layout: { type: "circular", center: [width / 2, height / 2], radius: height / 2.5, ordering: null, }, plugins: [edgeBundling], defaultNode: { size: [20, 20], color: "steelblue", }, defaultEdge: { size: 1, color: "#999", }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); setTimeout(() => { edgeBundling.bundling(data); }, 1000); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/bundling/index.json ================================================ { "navigationBarTitleText": "边绑定", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/bundling/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/bundling/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/edge-filter/data.js ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, { id: "Gribier", x: 437.51920169330805, y: 160.14388411785757, }, { id: "Jondrette", x: 510.1406569699257, y: 327.7456828911454, }, { id: "Mme.Burgon", x: 466.0856874797108, y: 368.0210264990602, }, { id: "Gavroche", x: 393.6973181801981, y: 380.40382743216634, }, { id: "Gillenormand", x: 338.1148595335302, y: 286.4434006942807, }, { id: "Magnon", x: 277.12320020410266, y: 317.4384382481713, }, { id: "Mlle.Gillenormand", x: 257.52167498720337, y: 306.4604520400414, }, { id: "Mme.Pontmercy", x: 307.71325168392366, y: 318.0074114921048, }, { id: "Mlle.Vaubois", x: 197.63137784390082, y: 325.2999365859076, }, { id: "Lt.Gillenormand", x: 294.4105849543593, y: 296.53686533697186, }, { id: "Marius", x: 336.3436812430268, y: 350.8376519695578, }, { id: "BaronessT", x: 390.6807729530675, y: 322.9175698803163, }, { id: "Mabeuf", x: 366.77554563642803, y: 445.26666512175433, }, { id: "Enjolras", x: 376.9421415192702, y: 371.1750781444891, }, { id: "Combeferre", x: 397.0516872015465, y: 416.38478793328625, }, { id: "Prouvaire", x: 309.0241345496318, y: 426.44215271462605, }, { id: "Feuilly", x: 314.71137563489117, y: 456.80172690673896, }, { id: "Courfeyrac", x: 332.8405296045364, y: 435.8881866127797, }, { id: "Bahorel", x: 343.1268360879219, y: 466.9404473411801, }, { id: "Bossuet", x: 305.84814130923144, y: 382.89355947309724, }, { id: "Joly", x: 371.447442010866, y: 415.99688422022257, }, { id: "Grantaire", x: 370.72651876919826, y: 466.96671298340794, }, { id: "MotherPlutarch", x: 424.04457501182867, y: 461.9373924104361, }, { id: "Gueulemer", x: 344.1315821958891, y: 323.7890765583486, }, { id: "Babet", x: 367.3969014122835, y: 319.2359576043117, }, { id: "Claquesous", x: 303.23885194199465, y: 347.8041412708572, }, { id: "Montparnasse", x: 322.6528688110919, y: 330.01757397802925, }, { id: "Toussaint", x: 306.6921797724685, y: 277.05255454452566, }, { id: "Child1", x: 361.1652068827243, y: 387.9769951347244, }, { id: "Child2", x: 415.98942162128606, y: 432.37341762016945, }, { id: "Brujon", x: 330.44198511493056, y: 394.6025799878689, }, { id: "Mme.Hucheloup", x: 394.43875881505835, y: 450.4056149101193, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/edge-filter/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import { EdgeFilterLens } from "@antv/f6-plugin/f6Plugin"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; data.edges.forEach((edge) => { edge.color = "#aaa"; edge.size = 2; edge.style = { opacity: 0.7, }; edge.label = "a"; }); const filterConfigs = { trigger: "drag", showLabel: "edge", r: 60, }; const filterLens = new EdgeFilterLens(filterConfigs); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, pixelRatio, width, height, fitView: true, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [filterLens], defaultEdge: { labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 2, }, }, }, defaultNode: { size: 15, color: "#5B8FF9", style: { lineWidth: 2, fill: "#C6E5FF", }, }, }); this.graph.data(data); this.graph.render(); this.graph.getEdges().forEach((edge) => { edge .getContainer() .getChildren() .forEach((shape) => { if (shape.get("type") === "text") shape.set("visible", false); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/edge-filter/index.json ================================================ { "navigationBarTitleText": "边过滤", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/edge-filter/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/edge-filter/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/fish-eye/data.js ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/fish-eye/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import { Fisheye } from "@antv/f6-plugin/f6Plugin"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const fisheye = new Fisheye({ r: 200, trigger: "drag", }); const colors = [ "#8FE9FF", "#87EAEF", "#FFC9E3", "#A7C2FF", "#FFA1E3", "#FFE269", "#BFCFEE", "#FFA0C5", "#D5FF86", ]; data.nodes.forEach((node) => { node.label = node.id; node.size = Math.random() * 30 + 10; node.style = { fill: colors[Math.floor(Math.random() * 9)], lineWidth: 0, }; }); this.graph = new F6.Graph({ renderer: this.renderer, container: this.canvas, context: this.ctx, pixelRatio, width, height, fitView: true, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [fisheye], }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/fish-eye/index.json ================================================ { "navigationBarTitleText": "鱼眼组件", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/fish-eye/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/fish-eye/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/legend/data.js ================================================ const data = { nodes: [ { id: "person A", label: "person A", // the attributes for drawing donut donutAttrs: { income: 10, outcome: 20, unknown: 25, }, }, { id: "person B", label: "person B", donutAttrs: { income: 20, outcome: 10, unknown: 5, }, }, { id: "person C", label: "person C", donutAttrs: { income: 200, outcome: 20, unknown: 25, }, }, { id: "person D", label: "person D", donutAttrs: { income: 50, outcome: 10, unknown: 15, }, }, { id: "person E", label: "person E", donutAttrs: { income: 80, outcome: 40, unknown: 45, }, }, { id: "person F", label: "person F", donutAttrs: { income: 90, outcome: 110, unknown: 15, }, }, ], edges: [ { source: "person C", target: "person F", size: 10 }, { source: "person B", target: "person A", size: 5 }, { source: "person D", target: "person E", size: 20 }, { source: "person D", target: "person C", size: 5 }, { source: "person B", target: "person C", size: 10 }, { source: "person A", target: "person C", size: 5 }, ], }; data.edges.forEach((edge) => { edge.label = `Transfer $${edge.size}`; }); const colors = { income: "#61DDAA", outcome: "#F08BB4", unknown: "#65789B", }; data.nodes.forEach((node) => { node.donutColorMap = colors; node.size = 0; Object.keys(node.donutAttrs).forEach((key) => { node.size += node.donutAttrs[key]; }); node.size = Math.sqrt(node.size) * 5; }); const legendData = { nodes: [ { id: "income", label: "Income", order: 0, style: { fill: "#61DDAA", }, }, { id: "outcome", label: "Outcome", order: 2, style: { fill: "#F08BB4", }, }, { id: "unknown", label: "Unknown", order: 2, style: { fill: "#65789B", }, }, ], }; export { data, legendData }; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/legend/index.js ================================================ import F6 from "@antv/f6-wx"; import { data, legendData } from "./data"; import { Legend } from "@antv/f6-plugin/f6Plugin"; import radialLayout from "@antv/f6-wx/extends/layout/radialLayout"; F6.registerLayout("radial", radialLayout); /** * donut-transfer */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const legend = new Legend({ width: 300, height: 80, offsetY: 0, offsetX: 0, data: legendData, align: "center", layout: "horizontal", // vertical position: "top-left", padding: 10, margin: 0, containerStyle: { fill: "#ccc", lineWidth: 1, }, }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: false, plugins: [legend], // 这里的plugin不知道能不能用 modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", focusNode: "li", linkDistance: 200, unitRadius: 200, }, defaultEdge: { style: { endArrow: true, }, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, }, }, }, defaultNode: { type: "donut", style: { lineWidth: 0, }, labelCfg: { position: "bottom", }, }, }); this.graph.data(data); this.graph.render(); this.graph.get("canvas").set("localRefresh", false); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/legend/index.json ================================================ { "navigationBarTitleText": "图例", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/legend/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/legend/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/menu/data.js ================================================ const data = { nodes: [ { id: "node1", label: "node1", x: 200, y: 100, type: "rect", }, { id: "node2", label: "node2", x: 250, y: 250, type: "rect", }, { id: "node3", label: "node3", x: 350, y: 100, type: "rect", }, ], edges: [ { source: "node1", target: "node2", label: "Test Label", }, { source: "node1", target: "node3", label: "Test Label 2", }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/menu/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import { Menu } from "@antv/f6-plugin/f6Plugin"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const contextMenu = new Menu({ getContent(evt) { let header; if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) { header = "Canvas ContextMenu"; } else if (evt.item) { const itemType = evt.item.getType(); header = `${itemType.toUpperCase()} ContextMenu`; } return `
${header}
div 1
div 2
`; }, getCss: () => { return ` .container { opacity: 0.9; width: 150; padding: 10 8; border: 1 solid #e2e2e2; } .header { padding-bottom: 10; font-weight: bold; } .li { padding-bottom: 10; } `; }, handleMenuClick: (target) => { wx.showToast({ title: `点击了: ${target.title}`, }); }, // offsetX and offsetY include the padding of the parent container // 需要加上父级容器的 padding-left 16 与自身偏移量 10 offsetX: 0, // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10 offsetY: 0, // the types of items that allow the menu show up // 在哪些类型的元素上响应 itemTypes: ["node", "edge", "canvas"], }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, fitView: true, plugins: [contextMenu], defaultNode: { size: [80, 40], type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", lineAppendWidth: 3, // Enlarge the range the edge to be hitted }, labelCfg: { autoRotate: true, style: { // A white stroke with width 5 helps show the label more clearly avoiding the interference of the overlapped edge stroke: "white", lineWidth: 5, }, }, }, modes: { default: ["drag-node"], }, }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/menu/index.json ================================================ { "navigationBarTitleText": "上下文菜单", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/menu/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/menu/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/mini-map/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/mini-map/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import { MiniMap } from "@antv/f6-plugin/f6Plugin"; Page({ data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const sys = wx.getSystemInfoSync(); const { windowWidth, windowHeight, pixelRatio } = sys; this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; console.log(ctx, canvas, renderer); const miniMap = new MiniMap({ className: "custom-container", viewportClassName: "custom-viewport", getCss: () => { return ` .custom-container { top: 0; background: #eee; border: 1 solid #333; } .custom-viewport { border:1 solid blue; } `; }, }); const { width, height, pixelRatio } = this.data; console.log("------->", ctx, canvas, renderer); this.graph = new F6.Graph({ container: canvas, context: ctx, renderer, width, height, pixelRatio, linkCenter: true, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [miniMap], }); this.graph.data(data); this.graph.render(); // 目前在使用plugin时,需要关闭局部刷新 this.graph.get("canvas").set("localRefresh", false); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/mini-map/index.json ================================================ { "defaultTitle": "navigationBarTitleText", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/mini-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/mini-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/snap-line/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/snap-line/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import { SnapLine } from "@antv/f6-plugin/f6Plugin"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const snapLine = new SnapLine(); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, container: this.canvas, pixelRatio, width, height, linkCenter: true, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [snapLine], }); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/snap-line/index.json ================================================ { "navigationBarTitleText": "对齐线", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/snap-line/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/snap-line/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/time-bar/index.js ================================================ import F6 from "@antv/f6-wx"; import { TimeBar } from "@antv/f6-plugin/f6Plugin"; /** * basic-arc-diagram */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const data = { nodes: [], edges: [], }; for (let i = 0; i < 50; i++) { const id = `node-${i}`; data.nodes.push({ id, date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); data.edges.push({ source: `node-${Math.round(Math.random() * 90)}`, target: `node-${Math.round(Math.random() * 90)}`, }); } const timeBarData = []; for (let i = 0; i < 50; i++) { timeBarData.push({ date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); } const timebar = new TimeBar({ x: 0, y: 0, width, padding: 0, type: "simple", data: timeBarData, }); this.graph = new F6.Graph({ renderer: this.renderer, context: this.ctx, width, height, pixelRatio, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, animate: false, defaultNode: { size: 30, }, plugins: [timebar], }); this.graph.get("canvas").set("localRefresh", false); this.graph.data(data); this.graph.render(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/time-bar/index.json ================================================ { "navigationBarTitleText": "时间轴", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/time-bar/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/time-bar/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/tool-tip/data.js ================================================ export default { id: "g1", name: "Name1", count: 123456, label: "538.90", currency: "Yuan", rate: 1.0, status: "B", variableName: "V1", variableValue: 0.341, variableUp: false, children: [ { id: "g12", name: "Deal with LONG label LONG label LONG label LONG label", count: 123456, label: "338.00", rate: 0.627, status: "R", currency: "Yuan", variableName: "V2", variableValue: 0.179, variableUp: true, children: [ { id: "g121", name: "Name3", collapsed: true, count: 123456, label: "138.00", rate: 0.123, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.27, variableUp: true, children: [ { id: "g1211", name: "Name4", count: 123456, label: "138.00", rate: 1.0, status: "B", currency: "Yuan", variableName: "V1", variableValue: 0.164, variableUp: false, children: [], }, ], }, { id: "g122", name: "Name5", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.259, variableUp: true, children: [ { id: "g1221", name: "Name6", count: 123456, label: "40.00", rate: 0.4, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.135, variableUp: true, children: [ { id: "g12211", name: "Name6-1", count: 123456, label: "40.00", rate: 1.0, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.181, variableUp: true, children: [], }, ], }, { id: "g1222", name: "Name7", count: 123456, label: "60.00", rate: 0.6, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.239, variableUp: false, children: [], }, ], }, { id: "g123", name: "Name8", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [ { id: "g1231", name: "Name8-1", count: 123456, label: "100.00", rate: 1.0, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [], }, ], }, ], }, { id: "g13", name: "Name9", count: 123456, label: "100.90", rate: 0.187, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.221, variableUp: true, children: [ { id: "g131", name: "Name10", count: 123456, label: "33.90", rate: 0.336, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.12, variableUp: true, children: [], }, { id: "g132", name: "Name11", count: 123456, label: "67.00", rate: 0.664, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.241, variableUp: false, children: [], }, ], }, { id: "g14", name: "Name12", count: 123456, label: "100.00", rate: 0.186, status: "G", currency: "Yuan", variableName: "V2", variableValue: 0.531, variableUp: true, children: [], }, ], }; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/tool-tip/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import mockData from "./data"; import { Tooltip } from "@antv/f6-plugin/f6Plugin"; /** * decision-tree */ const colors = { B: "#5B8FF9", R: "#F46649", Y: "#EEBC20", G: "#5BD8A6", DI: "#A7A7A7", }; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 默认配置 const defaultConfig = { width, height, modes: { default: ["zoom-canvas", "drag-canvas"], }, fitView: true, animate: true, defaultNode: { type: "flow-rect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#CED4D9", }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 300, getHeight: () => { return 60; }, }, }; // 组件props const props = { data: mockData, config: { padding: [20, 50], defaultLevel: 3, defaultZoom: 0.8, modes: { default: ["zoom-canvas", "drag-canvas"] }, }, }; // 自定义节点、边 const registerFn = () => { /** * 自定义节点 */ F6.registerNode( "flow-rect", { shapeType: "flow-rect", draw(cfg, group) { const { name = "", variableName, variableValue, variableUp, label, collapsed, currency, status, // rate, } = cfg; const grey = "#CED4D9"; // 逻辑不应该在这里判断 const rectConfig = { width: 202, height: 60, lineWidth: 1, fontSize: 12, fill: "#fff", radius: 4, stroke: grey, opacity: 1, }; const nodeOrigin = { x: -rectConfig.width / 2, y: -rectConfig.height / 2, }; const textConfig = { textAlign: "left", textBaseline: "bottom", }; const rect = group.addShape("rect", { attrs: { x: nodeOrigin.x, y: nodeOrigin.y, ...rectConfig, }, }); const rectBBox = rect.getBBox(); // label title group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: 20 + nodeOrigin.y, text: name.length > 28 ? `${name.substr(0, 28)}...` : name, fontSize: 12, opacity: 0.85, fill: "#000", cursor: "pointer", }, name: "name-shape", }); // price const price = group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: rectBBox.maxY - 12, text: label, fontSize: 16, fill: "#000", opacity: 0.85, }, }); // label currency group.addShape("text", { attrs: { ...textConfig, x: price.getBBox().maxX + 5, y: rectBBox.maxY - 12, text: currency, fontSize: 12, fill: "#000", opacity: 0.75, }, }); // percentage const percentText = group.addShape("text", { attrs: { ...textConfig, x: rectBBox.maxX - 8, y: rectBBox.maxY - 12, text: `${((variableValue || 0) * 100).toFixed(2)}%`, fontSize: 12, textAlign: "right", fill: colors[status], }, }); // percentage triangle const symbol = variableUp ? "triangle" : "triangle-down"; const triangle = group.addShape("marker", { attrs: { ...textConfig, x: percentText.getBBox().minX - 10, y: rectBBox.maxY - 12 - 6, symbol, r: 6, fill: colors[status], }, }); // variable name group.addShape("text", { attrs: { ...textConfig, x: triangle.getBBox().minX - 4, y: rectBBox.maxY - 12, text: variableName, fontSize: 12, textAlign: "right", fill: "#000", opacity: 0.45, }, }); // bottom line background // const bottomBackRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rectConfig.width, // height: 4, // radius: [0, 0, rectConfig.radius, rectConfig.radius], // fill: '#E0DFE3', // }, // }); // bottom percent // const bottomRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rate * rectBBox.width, // height: 4, // radius: [0, 0, 0, rectConfig.radius], // fill: colors[status], // }, // }); // collapse rect if (cfg.children && cfg.children.length) { group.addShape("rect", { attrs: { x: rectConfig.width / 2 - 8, y: -8, width: 16, height: 16, stroke: "rgba(0, 0, 0, 0.25)", cursor: "pointer", fill: "#fff", }, name: "collapse-back", modelId: cfg.id, }); // collpase text group.addShape("text", { attrs: { x: rectConfig.width / 2, y: -1, textAlign: "center", textBaseline: "middle", text: collapsed ? "+" : "-", fontSize: 16, cursor: "pointer", fill: "rgba(0, 0, 0, 0.25)", }, name: "collapse-text", modelId: cfg.id, }); } this.drawLinkPoints(cfg, group); return rect; }, update(cfg, item) { const group = item.getContainer(); this.updateLinkPoints(cfg, group); }, setState(name, value, item) { if (name === "collapse") { const group = item.getContainer(); const collapseText = group.find( (e) => e.get("name") === "collapse-text", ); if (collapseText) { if (!value) { collapseText.attr({ text: "-", }); } else { collapseText.attr({ text: "+", }); } } } }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "rect", ); F6.registerEdge( "flow-cubic", { getControlPoints(cfg) { let { controlPoints } = cfg; // 指定controlPoints if (!controlPoints || !controlPoints.length) { const { startPoint, endPoint, sourceNode, targetNode } = cfg; const { x: startX, y: startY, coefficientX, coefficientY, } = sourceNode ? sourceNode.getModel() : startPoint; const { x: endX, y: endY } = targetNode ? targetNode.getModel() : endPoint; let curveStart = (endX - startX) * coefficientX; let curveEnd = (endY - startY) * coefficientY; curveStart = curveStart > 40 ? 40 : curveStart; curveEnd = curveEnd < -30 ? curveEnd : -30; controlPoints = [ { x: startPoint.x + curveStart, y: startPoint.y }, { x: endPoint.x + curveEnd, y: endPoint.y }, ]; } return controlPoints; }, getPath(points) { const path = []; path.push(["M", points[0].x, points[0].y]); path.push([ "C", points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y, ]); return path; }, }, "single-line", ); }; registerFn(); const { config } = props; const tooltip = new Tooltip({ trigger: "press", // TODO: _f2.default.Tooltip is not a constructor // offsetX and offsetY include the padding of the parent container // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { // outDiv.style.padding = '0px 0px 20px 0px'; return `
Custom Content
Type: ${e.item.getType()}
Label: ${ e.item.getModel().label || e.item.getModel().id }
`; }, getCss: () => ` .f6-tooltip-container { position: absolute; width: 150; border: 1 solid #e2e2e2; border-radius: 4; font-size: 12; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10 8; } .f6-tooltip-container div{ height: 20; } .tooltip-type { padding: 0; margin: 0; } .tooltip-id { color: #531dab; } `, shouldBegin: (e) => { if (e.target.get("name") === "name-shape") return true; return true; }, }); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, ...defaultConfig, ...config, plugins: [tooltip], extra: { createImage: this.canvas && this.canvas.createImage, requestAnimationFrame: this.canvas.requestAnimationFrame, cancelAnimationFrame: this.canvas.cancelAnimationFrame, }, }); this.graph.data(mockData); this.graph.render(); this.graph.fitView(); this.graph.zoom(config.defaultZoom || 1); const handleCollapse = (e) => { const { target } = e; const id = target.get("modelId"); const item = this.graph.findById(id); const nodeModel = item.getModel(); nodeModel.collapsed = !nodeModel.collapsed; this.graph.layout(); this.graph.setItemState(item, "collapse", nodeModel.collapsed); }; this.graph.on("collapse-text:tap", (e) => { handleCollapse(e); }); this.graph.on("collapse-back:tap", (e) => { handleCollapse(e); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/tool-tip/index.json ================================================ { "navigationBarTitleText": "提示框", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/tool-tip/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/tool-tip/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/zoom-slider/data.js ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/zoom-slider/index.js ================================================ import { ZoomSlider } from "@antv/f6-plugin/f6Plugin"; import data from "./data"; import F6 from "@antv/f6-wx"; Page({ data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; const zoomSlider = new ZoomSlider(); const { width, height, pixelRatio } = this.data; this.graph = new F6.Graph({ container: canvas, context: ctx, width, height, pixelRatio, fitView: "center", linkCenter: true, renderer, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [zoomSlider], }); this.graph.data(data); this.graph.render(); // 目前在使用plugin时,需要关闭局部刷新 this.graph.get("canvas").set("localRefresh", false); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/zoom-slider/index.json ================================================ { "navigationBarTitleText": "ZoomSlider", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/zoom-slider/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-plugin/pages/plugin/zoom-slider/index.wxss ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/custom-flow/data.js ================================================ export default { nodes: [ { id: "1", label: "Company1", }, { id: "2", label: "Company2", }, { id: "3", label: "Company3", }, { id: "4", label: "Company4", }, { id: "5", label: "Company5", }, { id: "6", label: "Company6", }, { id: "7", label: "Company7", }, { id: "8", label: "Company8", }, { id: "9", label: "Company9", }, ], edges: [ { source: "1", target: "2", data: { type: "A", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "3", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "2", target: "5", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "5", target: "6", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "3", target: "4", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "4", target: "7", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "8", data: { type: "B", amount: "100,000 Yuan", date: "2019-08-03", }, }, { source: "1", target: "9", data: { type: "C", amount: "100,000 Yuan", date: "2019-08-03", }, }, ], }; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/custom-flow/index.js ================================================ import F6 from "@antv/f6-wx"; import data from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * custom-flow */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); const colorMap = { A: "#72CC4A", B: "#1A91FF", C: "#FFAA15", }; F6.registerNode( "round-rect", { drawShape: function drawShape(cfg, group) { const { width } = cfg.style; const { stroke } = cfg.style; const rect = group.addShape("rect", { attrs: { x: -width / 2, y: -15, width, height: 30, radius: 15, stroke, lineWidth: 1.2, fillOpacity: 1, }, name: "rect-shape", }); group.addShape("circle", { attrs: { x: -width / 2, y: 0, r: 3, fill: stroke, }, name: "circle-shape", }); group.addShape("circle", { attrs: { x: width / 2, y: 0, r: 3, fill: stroke, }, name: "circle-shape2", }); return rect; }, getAnchorPoints: function getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, update: function update(cfg, item) { const group = item.getContainer(); const children = group.get("children"); const node = children[0]; const circleLeft = children[1]; const circleRight = children[2]; const { stroke } = cfg.style; if (stroke) { node.attr("stroke", stroke); circleLeft.attr("fill", stroke); circleRight.attr("fill", stroke); } }, }, "single-node", ); F6.registerEdge("fund-polyline", { itemType: "edge", draw: function draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const { stroke } = cfg.style; const Ydiff = endPoint.y - startPoint.y; const slope = Ydiff !== 0 ? Math.min(500 / Math.abs(Ydiff), 20) : 0; const cpOffset = slope > 15 ? 0 : 16; const offset = Ydiff < 0 ? cpOffset : -cpOffset; const line1EndPoint = { x: startPoint.x + slope, y: endPoint.y + offset, }; const line2StartPoint = { x: line1EndPoint.x + cpOffset, y: endPoint.y, }; // 控制点坐标 const controlPoint = { x: ((line1EndPoint.x - startPoint.x) * (endPoint.y - startPoint.y)) / (line1EndPoint.y - startPoint.y) + startPoint.x, y: endPoint.y, }; let path = [ ["M", startPoint.x, startPoint.y], ["L", line1EndPoint.x, line1EndPoint.y], [ "Q", controlPoint.x, controlPoint.y, line2StartPoint.x, line2StartPoint.y, ], ["L", endPoint.x, endPoint.y], ]; if (Math.abs(Ydiff) <= 5) { path = [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x, endPoint.y], ]; } const endArrow = cfg.style && cfg.style.endArrow ? cfg.style.endArrow : false; endArrow && (endArrow.fill = stroke); const line = group.addShape("path", { attrs: { path, stroke: colorMap[cfg.data && cfg.data.type], lineWidth: 1.2, endArrow, }, name: "path-shape", }); const labelLeftOffset = 0; const labelTopOffset = 8; // amount const amount = group.addShape("text", { attrs: { text: cfg.data && cfg.data.amount, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y - labelTopOffset - 2, fontSize: 14, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-amount", }); // type group.addShape("text", { attrs: { text: cfg.data && cfg.data.type, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y - labelTopOffset - amount.getBBox().height - 2, fontSize: 10, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-type", }); // date group.addShape("text", { attrs: { text: cfg.data && cfg.data.date, x: line2StartPoint.x + labelLeftOffset, y: endPoint.y + labelTopOffset + 4, fontSize: 12, fontWeight: 300, textAlign: "left", textBaseline: "middle", fill: "#000000D9", }, name: "text-shape-date", }); return line; }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, layout: { type: "dagre", rankdir: "LR", nodesep: 30, ranksep: 100, }, modes: { default: ["drag-canvas"], }, defaultNode: { type: "round-rect", labelCfg: { style: { fill: "#000000A6", fontSize: 10, }, }, style: { stroke: "#72CC4A", width: 150, }, }, defaultEdge: { type: "fund-polyline", }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); const edges = this.graph.getEdges(); edges.forEach((edge) => { const line = edge.getKeyShape(); const stroke = line.attr("stroke"); const targetNode = edge.getTarget(); targetNode.update({ style: { stroke, }, }); }); this.graph.paint(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/custom-flow/index.json ================================================ { "navigationBarTitleText": "自定义流向图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/custom-flow/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/custom-flow/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/decision-tree/data.js ================================================ export default { id: "g1", name: "Name1", count: 123456, label: "538.90", currency: "Yuan", rate: 1.0, status: "B", variableName: "V1", variableValue: 0.341, variableUp: false, children: [ { id: "g12", name: "Deal with LONG label LONG label LONG label LONG label", count: 123456, label: "338.00", rate: 0.627, status: "R", currency: "Yuan", variableName: "V2", variableValue: 0.179, variableUp: true, children: [ { id: "g121", name: "Name3", collapsed: true, count: 123456, label: "138.00", rate: 0.123, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.27, variableUp: true, children: [ { id: "g1211", name: "Name4", count: 123456, label: "138.00", rate: 1.0, status: "B", currency: "Yuan", variableName: "V1", variableValue: 0.164, variableUp: false, children: [], }, ], }, { id: "g122", name: "Name5", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.259, variableUp: true, children: [ { id: "g1221", name: "Name6", count: 123456, label: "40.00", rate: 0.4, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.135, variableUp: true, children: [ { id: "g12211", name: "Name6-1", count: 123456, label: "40.00", rate: 1.0, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.181, variableUp: true, children: [], }, ], }, { id: "g1222", name: "Name7", count: 123456, label: "60.00", rate: 0.6, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.239, variableUp: false, children: [], }, ], }, { id: "g123", name: "Name8", collapsed: true, count: 123456, label: "100.00", rate: 0.296, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [ { id: "g1231", name: "Name8-1", count: 123456, label: "100.00", rate: 1.0, status: "DI", currency: "Yuan", variableName: "V2", variableValue: 0.131, variableUp: false, children: [], }, ], }, ], }, { id: "g13", name: "Name9", count: 123456, label: "100.90", rate: 0.187, status: "B", currency: "Yuan", variableName: "V2", variableValue: 0.221, variableUp: true, children: [ { id: "g131", name: "Name10", count: 123456, label: "33.90", rate: 0.336, status: "R", currency: "Yuan", variableName: "V1", variableValue: 0.12, variableUp: true, children: [], }, { id: "g132", name: "Name11", count: 123456, label: "67.00", rate: 0.664, status: "G", currency: "Yuan", variableName: "V1", variableValue: 0.241, variableUp: false, children: [], }, ], }, { id: "g14", name: "Name12", count: 123456, label: "100.00", rate: 0.186, status: "G", currency: "Yuan", variableName: "V2", variableValue: 0.531, variableUp: true, children: [], }, ], }; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/decision-tree/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import { Tooltip } from "@antv/f6-plugin/f6Plugin"; import mockData from "./data"; /** * decision-tree */ const colors = { B: "#5B8FF9", R: "#F46649", Y: "#EEBC20", G: "#5BD8A6", DI: "#A7A7A7", }; Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 默认配置 const defaultConfig = { width, height, modes: { default: ["zoom-canvas", "drag-canvas"], }, fitView: true, animate: true, defaultNode: { type: "flow-rect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#CED4D9", }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 300, getHeight: () => { return 60; }, }, }; // 组件props const props = { data: mockData, config: { padding: [20, 50], defaultLevel: 3, defaultZoom: 0.8, modes: { default: ["zoom-canvas", "drag-canvas"] }, }, }; // 自定义节点、边 const registerFn = () => { /** * 自定义节点 */ F6.registerNode( "flow-rect", { shapeType: "flow-rect", draw(cfg, group) { const { name = "", variableName, variableValue, variableUp, label, collapsed, currency, status, // rate, } = cfg; const grey = "#CED4D9"; // 逻辑不应该在这里判断 const rectConfig = { width: 202, height: 60, lineWidth: 1, fontSize: 12, fill: "#fff", radius: 4, stroke: grey, opacity: 1, }; const nodeOrigin = { x: -rectConfig.width / 2, y: -rectConfig.height / 2, }; const textConfig = { textAlign: "left", textBaseline: "bottom", }; const rect = group.addShape("rect", { attrs: { x: nodeOrigin.x, y: nodeOrigin.y, ...rectConfig, }, }); const rectBBox = rect.getBBox(); // label title group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: 20 + nodeOrigin.y, text: name.length > 28 ? `${name.substr(0, 28)}...` : name, fontSize: 12, opacity: 0.85, fill: "#000", cursor: "pointer", }, name: "name-shape", }); // price const price = group.addShape("text", { attrs: { ...textConfig, x: 12 + nodeOrigin.x, y: rectBBox.maxY - 12, text: label, fontSize: 16, fill: "#000", opacity: 0.85, }, }); // label currency group.addShape("text", { attrs: { ...textConfig, x: price.getBBox().maxX + 5, y: rectBBox.maxY - 12, text: currency, fontSize: 12, fill: "#000", opacity: 0.75, }, }); // percentage const percentText = group.addShape("text", { attrs: { ...textConfig, x: rectBBox.maxX - 8, y: rectBBox.maxY - 12, text: `${((variableValue || 0) * 100).toFixed(2)}%`, fontSize: 12, textAlign: "right", fill: colors[status], }, }); // percentage triangle const symbol = variableUp ? "triangle" : "triangle-down"; const triangle = group.addShape("marker", { attrs: { ...textConfig, x: percentText.getBBox().minX - 10, y: rectBBox.maxY - 12 - 6, symbol, r: 6, fill: colors[status], }, }); // variable name group.addShape("text", { attrs: { ...textConfig, x: triangle.getBBox().minX - 4, y: rectBBox.maxY - 12, text: variableName, fontSize: 12, textAlign: "right", fill: "#000", opacity: 0.45, }, }); // bottom line background // const bottomBackRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rectConfig.width, // height: 4, // radius: [0, 0, rectConfig.radius, rectConfig.radius], // fill: '#E0DFE3', // }, // }); // bottom percent // const bottomRect = group.addShape('rect', { // attrs: { // x: nodeOrigin.x, // y: rectBBox.maxY - 4, // width: rate * rectBBox.width, // height: 4, // radius: [0, 0, 0, rectConfig.radius], // fill: colors[status], // }, // }); // collapse rect if (cfg.children && cfg.children.length) { group.addShape("rect", { attrs: { x: rectConfig.width / 2 - 8, y: -8, width: 16, height: 16, stroke: "rgba(0, 0, 0, 0.25)", cursor: "pointer", fill: "#fff", }, name: "collapse-back", modelId: cfg.id, }); // collpase text group.addShape("text", { attrs: { x: rectConfig.width / 2, y: -1, textAlign: "center", textBaseline: "middle", text: collapsed ? "+" : "-", fontSize: 16, cursor: "pointer", fill: "rgba(0, 0, 0, 0.25)", }, name: "collapse-text", modelId: cfg.id, }); } this.drawLinkPoints(cfg, group); return rect; }, update(cfg, item) { const group = item.getContainer(); this.updateLinkPoints(cfg, group); }, setState(name, value, item) { if (name === "collapse") { const group = item.getContainer(); const collapseText = group.find( (e) => e.get("name") === "collapse-text", ); if (collapseText) { if (!value) { collapseText.attr({ text: "-", }); } else { collapseText.attr({ text: "+", }); } } } }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "rect", ); F6.registerEdge( "flow-cubic", { getControlPoints(cfg) { let { controlPoints } = cfg; // 指定controlPoints if (!controlPoints || !controlPoints.length) { const { startPoint, endPoint, sourceNode, targetNode } = cfg; const { x: startX, y: startY, coefficientX, coefficientY, } = sourceNode ? sourceNode.getModel() : startPoint; const { x: endX, y: endY } = targetNode ? targetNode.getModel() : endPoint; let curveStart = (endX - startX) * coefficientX; let curveEnd = (endY - startY) * coefficientY; curveStart = curveStart > 40 ? 40 : curveStart; curveEnd = curveEnd < -30 ? curveEnd : -30; controlPoints = [ { x: startPoint.x + curveStart, y: startPoint.y }, { x: endPoint.x + curveEnd, y: endPoint.y }, ]; } return controlPoints; }, getPath(points) { const path = []; path.push(["M", points[0].x, points[0].y]); path.push([ "C", points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y, ]); return path; }, }, "single-line", ); }; registerFn(); const { onInit, config } = props; console.log(onInit); const tooltip = new Tooltip({ trigger: "press", // TODO: _f2.default.Tooltip is not a constructor // offsetX and offsetY include the padding of the parent container // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { // outDiv.style.padding = '0px 0px 20px 0px'; return `
Custom Content
Type: ${e.item.getType()}
Label: ${e.item.getModel().label || e.item.getModel().id}
`; }, getCss: () => { return ` #tootip-content{ width: 150; padding: 10; } #tootip-content div{ height: 20; } `; }, shouldBegin: (e) => { if (e.target.get("name") === "name-shape") return true; return true; }, }); // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, extra: { createImage: this.canvas && this.canvas.createImage, }, ...defaultConfig, ...config, plugins: [tooltip], }); this.graph.data(mockData); this.graph.render(); this.graph.fitView(); this.graph.zoom(config.defaultZoom || 1); const handleCollapse = (e) => { const { target } = e; const id = target.get("modelId"); const item = this.graph.findById(id); const nodeModel = item.getModel(); nodeModel.collapsed = !nodeModel.collapsed; this.graph.layout(); this.graph.setItemState(item, "collapse", nodeModel.collapsed); }; this.graph.on("collapse-text:tap", (e) => { handleCollapse(e); }); this.graph.on("collapse-back:tap", (e) => { handleCollapse(e); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/decision-tree/index.json ================================================ { "navigationBarTitleText": "决策树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/decision-tree/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/decision-tree/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/data.js ================================================ const data = { nodes: [ { id: "person A", label: "person A", // the attributes for drawing donut donutAttrs: { income: 10, outcome: 20, unknown: 25, }, }, { id: "person B", label: "person B", donutAttrs: { income: 20, outcome: 10, unknown: 5, }, }, { id: "person C", label: "person C", donutAttrs: { income: 200, outcome: 20, unknown: 25, }, }, { id: "person D", label: "person D", donutAttrs: { income: 50, outcome: 10, unknown: 15, }, }, { id: "person E", label: "person E", donutAttrs: { income: 80, outcome: 40, unknown: 45, }, }, { id: "person F", label: "person F", donutAttrs: { income: 90, outcome: 110, unknown: 15, }, }, ], edges: [ { source: "person C", target: "person F", size: 10 }, { source: "person B", target: "person A", size: 5 }, { source: "person D", target: "person E", size: 20 }, { source: "person D", target: "person C", size: 5 }, { source: "person B", target: "person C", size: 10 }, { source: "person A", target: "person C", size: 5 }, ], }; data.edges.forEach((edge) => { edge.label = `Transfer $${edge.size}`; }); const colors = { income: "#61DDAA", outcome: "#F08BB4", unknown: "#65789B", }; data.nodes.forEach((node) => { node.donutColorMap = colors; node.size = 0; Object.keys(node.donutAttrs).forEach((key) => { node.size += node.donutAttrs[key]; }); node.size = Math.sqrt(node.size) * 5; }); const legendData = { nodes: [ { id: "income", label: "Income", order: 0, style: { fill: "#61DDAA", }, }, { id: "outcome", label: "Outcome", order: 2, style: { fill: "#F08BB4", }, }, { id: "unknown", label: "Unknown", order: 2, style: { fill: "#65789B", }, }, ], }; export { data, legendData }; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/index.acss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0,0,0,0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/index.js ================================================ import F6 from "@antv/f6-wx"; import { Legend } from "@antv/f6-plugin/f6Plugin"; import { data, legendData } from "./data"; /** * donut-transfer */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const legend = new Legend({ data: legendData, align: "center", layout: "horizontal", // vertical position: "bottom-left", vertiSep: 12, horiSep: 24, offsetY: -24, padding: [4, 16, 8, 16], containerStyle: { fill: "#ccc", lineWidth: 1, }, title: " ", titleConfig: { offsetY: -8, }, }); // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitCenter: true, plugins: [legend], // 这里的plugin不知道能不能用 modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "radial", focusNode: "li", linkDistance: 200, unitRadius: 200, }, defaultEdge: { style: { endArrow: true, }, labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 5, }, }, }, defaultNode: { type: "donut", style: { lineWidth: 0, }, labelCfg: { position: "bottom", }, }, }); this.graph.data(data); this.graph.render(); // this.graph.fitView(); this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "active", false); }); this.graph.on("node:tap", (evt) => { const { item } = evt; this.graph.setItemState(item, "selected", true); }); this.graph.on("canvas:tap", () => { this.graph.getNodes().forEach((node) => { this.graph.clearItemStates(node); }); }); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/index.json ================================================ { "navigationBarTitleText": "甜甜圈转账图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/donut-transfer/index.wxss ================================================ /* packageSceneCaseSceneCase/donut-transfer/index.wxss */ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/knowledge-tree-graph/data.js ================================================ export default { id: "200000004", tooltip: "Thing", label: "事物", description: null, descriptionZh: null, depth: 3, subTypeCount: 9, status: 0, children: [ { id: "500000061", tooltip: "Person", label: "自然人", description: null, descriptionZh: null, depth: 1, subTypeCount: 1, status: 0, children: [ { id: "707000085", tooltip: "FilmPerson", label: "电影人", description: null, descriptionZh: null, depth: 5, subTypeCount: 3, status: 1, children: [ { id: "707000090", tooltip: "FilmDirector", label: "电影导演", description: null, descriptionZh: null, depth: 0, subTypeCount: 0, status: 1, children: [], }, { id: "707000091", tooltip: "FilmWriter", label: "电影编剧", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "707000092", tooltip: "FilmStar", label: "电影主演", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, ], }, { id: "707000086", tooltip: "MusicPerson", label: "音乐人", description: null, descriptionZh: null, depth: 17, subTypeCount: 2, status: 1, children: [], }, ], }, { id: "200000005", tooltip: "Music", label: "音乐", description: null, descriptionZh: null, depth: 3, subTypeCount: 2, status: 1, children: [], }, { id: "707000128", tooltip: "Film", label: "电影", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [ { id: "7070032328", tooltip: "Comedy", label: "喜剧", description: null, descriptionZh: null, depth: 4, operation: "C", subTypeCount: 0, status: 1, children: [], }, ], }, { id: "707000095", tooltip: "FilmGenre", label: "电影类别", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "702000021", tooltip: "Organization", label: "机构", description: null, descriptionZh: null, depth: 47, subTypeCount: 1, status: 0, children: [ { id: "500000063", tooltip: "Company", label: "公司", description: null, descriptionZh: null, depth: 4, subTypeCount: 2, status: 1, children: [ { id: "707000093", tooltip: "FilmCompany", label: "电影公司", description: null, descriptionZh: null, depth: 4, subTypeCount: 0, status: 1, children: [], }, { id: "707000094", tooltip: "MusicCompany", label: "音乐公司", description: null, descriptionZh: null, depth: 2, subTypeCount: 0, status: 1, children: [], }, ], }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/knowledge-tree-graph/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 知识图谱树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); const minWidth = 60; // TODO:这里需要定义两次,因为onLoad()里面传不到,updateChart()里面,如果定义在Page外面是不是就是全局的 const BaseConfig = { nameFontSize: 12, childCountWidth: 22, countMarginLeft: 0, itemPadding: 16, nameMarginLeft: 4, rootPadding: 18, }; F6.registerNode("treeNode", { draw: (cfg, group) => { const { label, collapsed, selected, children, depth } = cfg; const rootNode = depth === 0; const hasChildren = children && children.length !== 0; const { childCountWidth, countMarginLeft, itemPadding, nameMarginLeft, rootPadding, } = BaseConfig; let width = 0; const height = 28; const x = 0; const y = -height / 2; // 名称文本 const text = group.addShape("text", { attrs: { text: label, x: x * 2, y, textAlign: "left", textBaseline: "top", fontFamily: "PingFangSC-Regular", }, cursor: "pointer", name: "name-text-shape", }); const textWidth = text.getBBox().width; width = textWidth + itemPadding + nameMarginLeft; width = width < minWidth ? minWidth : width; if (!rootNode && hasChildren) { width += countMarginLeft; width += childCountWidth; } const keyShapeAttrs = { x, y, width, height, radius: 4, }; // keyShape根节点选中样式 if (rootNode && selected) { keyShapeAttrs.fill = "#e8f7ff"; keyShapeAttrs.stroke = "#e8f7ff"; } const keyShape = group.addShape("rect", { attrs: keyShapeAttrs, name: "root-key-shape-rect-shape", }); if (!rootNode) { // 底部横线 group.addShape("path", { attrs: { path: [ ["M", x - 1, 0], ["L", width, 0], ], stroke: "#AAB7C4", lineWidth: 1, }, name: "node-path-shape", }); } const mainX = x - 10; const mainY = -height + 15; if (rootNode) { group.addShape("rect", { attrs: { x: mainX, y: mainY, width: width + 12, height, radius: 14, fill: "#e8f7ff", cursor: "pointer", }, name: "main-shape", }); } let nameColor = "rgba(0, 0, 0, .65)"; if (selected) { nameColor = "#40A8FF"; } // 名称 if (rootNode) { group.addShape("text", { attrs: { text: label, x: mainX + rootPadding, y: 1, textAlign: "left", textBaseline: "middle", fill: nameColor, fontSize: 12, fontFamily: "PingFangSC-Regular", cursor: "pointer", }, name: "root-text-shape", }); } else { group.addShape("text", { attrs: { text: label, x: selected ? mainX + 6 + nameMarginLeft : mainX + 6, y: y - 5, textAlign: "start", textBaseline: "top", fill: nameColor, fontSize: 12, fontFamily: "PingFangSC-Regular", cursor: "pointer", }, name: "not-root-text-shape", }); } // 子类数量 if (hasChildren && !rootNode) { const childCountHeight = 12; const childCountX = width - childCountWidth; const childCountY = -childCountHeight / 2; group.addShape("rect", { attrs: { width: childCountWidth, height: 12, stroke: collapsed ? "#1890ff" : "#5CDBD3", fill: collapsed ? "#fff" : "#E6FFFB", x: childCountX, y: childCountY, radius: 6, cursor: "pointer", }, name: "child-count-rect-shape", }); group.addShape("text", { attrs: { text: `${children.length}`, fill: "rgba(0, 0, 0, .65)", x: childCountX + childCountWidth / 2, y: childCountY + 12, fontSize: 10, width: childCountWidth, textAlign: "center", cursor: "pointer", }, name: "child-count-text-shape", }); } return keyShape; }, }); F6.registerEdge("smooth", { draw(cfg, group) { const { startPoint, endPoint } = cfg; const hgap = Math.abs(endPoint.x - startPoint.x); const path = [ ["M", startPoint.x, startPoint.y], [ "C", startPoint.x + hgap / 4, startPoint.y, endPoint.x - hgap / 2, endPoint.y, endPoint.x, endPoint.y, ], ]; const shape = group.addShape("path", { attrs: { stroke: "#AAB7C4", path, }, name: "smooth-path-shape", }); return shape; }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const BaseConfig = { nameFontSize: 12, childCountWidth: 22, countMarginLeft: 0, itemPadding: 16, nameMarginLeft: 4, rootPadding: 18, }; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: 60, modes: { default: [ { type: "collapse-expand", }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { type: "treeNode", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "smooth", }, layout: { type: "compactBox", // TODO:为什么这里找不到 direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth(d) { const labelWidth = F6.Util.getTextSize( d.label, BaseConfig.nameFontSize, )[0]; const width_ = BaseConfig.itemPadding + BaseConfig.nameMarginLeft + labelWidth + BaseConfig.rootPadding + BaseConfig.childCountWidth; return width_; }, getVGap: function getVGap() { return 15; }, getHGap: function getHGap() { return 30; }, }, }); // 注册数据 this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/knowledge-tree-graph/index.json ================================================ { "navigationBarTitleText": "知识图谱树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/knowledge-tree-graph/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/knowledge-tree-graph/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/metro-lines/data.js ================================================ const data = { nodes: [ { id: "0", x: 12955418.07889617, y: 4858516.455509626, class: "地铁二号线", name: "地铁二号线 0", }, { id: "1", x: 12955418.07889617, y: 4858516.455509626, class: "地铁二号线", name: "地铁二号线 1", }, { id: "2", x: 12960805.702543395, y: 4843623.153783939, class: "地铁五号线", name: "地铁五号线 0", }, { id: "3", x: 12957909.41496727, y: 4878612.7284845, class: "地铁五号线", name: "地铁五号线 1", }, { id: "4", x: 12924431.591067636, y: 4826881.565994551, class: "地铁房山线", name: "地铁房山线 0", }, { id: "5", x: 12946675.914777644, y: 4839000.571326079, class: "地铁房山线", name: "地铁房山线 1", }, { id: "6", x: 12960805.702543395, y: 4843623.153783939, class: "地铁亦庄线", name: "地铁亦庄线 0", }, { id: "7", x: 12980513.522539986, y: 4840611.685434834, class: "地铁亦庄线", name: "地铁亦庄线 1", }, { id: "8", x: 12970460.425604625, y: 4852660.505494347, class: "地铁一号线", name: "地铁一号线 0", }, { id: "9", x: 12932857.683691781, y: 4855262.558461167, class: "地铁一号线", name: "地铁一号线 1", }, { id: "10", x: 12954336.341521818, y: 4841957.844498525, class: "地铁大兴线", name: "地铁大兴线 0", }, { id: "11", x: 12948661.393356105, y: 4818156.255552412, class: "地铁大兴线", name: "地铁大兴线 1", }, { id: "12", x: 12954336.341521818, y: 4841957.844498525, class: "地铁四号线", name: "地铁四号线 0", }, { id: "13", x: 12943094.565471629, y: 4868005.960957178, class: "地铁四号线", name: "地铁四号线 1", }, { id: "14", x: 12943697.439571828, y: 4856096.365355702, class: "地铁六号线", name: "地铁六号线 0", }, { id: "15", x: 12982538.96049167, y: 4855210.774849254, class: "地铁六号线", name: "地铁六号线 1", }, { id: "16", x: 12946675.914777644, y: 4839000.571326079, class: "地铁九号线", name: "地铁九号线 0", }, { id: "17", x: 12949261.040454354, y: 4857656.700765552, class: "地铁九号线", name: "地铁九号线 1", }, { id: "18", x: 12956918.23852815, y: 4858529.6221339535, class: "地铁八号线", name: "地铁八号线 0", }, { id: "19", x: 12957923.222643975, y: 4856285.931514598, class: "地铁八号线", name: "地铁八号线 1", }, { id: "20", x: 12947165.66572366, y: 4873622.718414709, class: "地铁昌平线", name: "地铁昌平线 0", }, { id: "21", x: 12945101.617382836, y: 4896059.0154147735, class: "地铁昌平线", name: "地铁昌平线 1", }, { id: "22", x: 12970460.425604625, y: 4852660.505494347, class: "地铁八通线", name: "地铁八通线 0", }, { id: "23", x: 12989768.23411335, y: 4847232.117513346, class: "地铁八通线", name: "地铁八通线 1", }, { id: "24", x: 12961385.775293019, y: 4857425.3359782435, class: "城铁十三号线", name: "城铁十三号线 0", }, { id: "25", x: 12952415.003097966, y: 4857385.42314959, class: "城铁十三号线", name: "城铁十三号线 1", }, { id: "26", x: 12964405.448829094, y: 4849043.663728292, class: "地铁十号线", name: "地铁十号线 0", }, { id: "27", x: 12945523.914777555, y: 4862157.070927259, class: "地铁十号线", name: "地铁十号线 1", }, { id: "28", x: 12937182.6004098, y: 4846484.783681809, class: "地铁十四号线", name: "地铁十四号线 0", }, { id: "29", x: 12946851.421569752, y: 4846551.5626413245, class: "地铁十四号线", name: "地铁十四号线 1", }, { id: "30", x: 12975248.324027628, y: 4879080.29109743, class: "地铁十五号线", name: "地铁十五号线 0", }, { id: "31", x: 12962862.26847603, y: 4865214.088371204, class: "地铁十五号线", name: "地铁十五号线 1", }, { id: "32", x: 12981143.037271895, y: 4871509.161726701, class: "机场轻轨线", name: "机场轻轨线 0", }, { id: "33", x: 12961347.967621036, y: 4857396.841326526, class: "机场轻轨线", name: "机场轻轨线 1", }, ], edges: [ { id: "0", source: "0", target: "1", class: "地铁二号线", name: "地铁二号线 0", controlPoints: [ { x: 12956158.028659772, y: 4858523.099945488, }, { x: 12956181.882943347, y: 4858523.313643505, }, { x: 12956333.569265882, y: 4858524.675979247, }, { x: 12956722.101097316, y: 4858528.426228019, }, { x: 12956892.09019568, y: 4858529.577087689, }, { x: 12957092.031747662, y: 4858532.537231651, }, { x: 12957285.500773665, y: 4858534.624581567, }, { x: 12958025.324180173, y: 4858542.359953267, }, { x: 12958025.324180173, y: 4858542.359953267, }, { x: 12958040.386887064, y: 4858542.398858417, }, { x: 12958051.381729262, y: 4858542.39594296, }, { x: 12958077.436647858, y: 4858542.626090849, }, { x: 12958156.437099922, y: 4858543.794072316, }, { x: 12958189.185511772, y: 4858543.944439034, }, { x: 12958309.191310784, y: 4858545.279485739, }, { x: 12958458.470410347, y: 4858547.406977885, }, { x: 12958499.690753505, y: 4858547.988957175, }, { x: 12958505.143835366, y: 4858548.099568159, }, { x: 12958552.455966821, y: 4858548.335831382, }, { x: 12958768.467696369, y: 4858549.399143227, }, { x: 12958859.902949648, y: 4858552.977807331, }, { x: 12958924.391812265, y: 4858556.413893195, }, { x: 12958993.172822965, y: 4858558.959445135, }, { x: 12959013.547905065, y: 4858559.7809649445, }, { x: 12959327.7774419, y: 4858574.063556792, }, { x: 12959423.21800485, y: 4858577.691630111, }, { x: 12959426.045447897, y: 4858577.797144458, }, { x: 12959659.119375631, y: 4858587.989742429, }, { x: 12959737.865294052, y: 4858591.668097373, }, { x: 12959846.282077461, y: 4858596.613007342, }, { x: 12959955.561247244, y: 4858601.256188295, }, { x: 12960095.413179535, y: 4858607.094133126, }, { x: 12960179.06451476, y: 4858611.470739427, }, { x: 12960222.914558794, y: 4858613.727307291, }, { x: 12960421.743963502, y: 4858622.407685848, }, { x: 12960445.476249201, y: 4858623.093869879, }, { x: 12960629.592854993, y: 4858630.086065551, }, { x: 12960751.203872466, y: 4858635.467581922, }, { x: 12960848.858819682, y: 4858639.927849644, }, { x: 12960917.431335308, y: 4858642.696504292, }, { x: 12960954.897539183, y: 4858643.0533597935, }, { x: 12960982.959798397, y: 4858642.704017011, }, { x: 12961014.781746428, y: 4858640.30966017, }, { x: 12961051.662476636, y: 4858634.414079347, }, { x: 12961083.478422668, y: 4858626.929183689, }, { x: 12961111.532563318, y: 4858617.271161616, }, { x: 12961140.594020512, y: 4858604.699543408, }, { x: 12961160.7368578, y: 4858593.842589348, }, { x: 12961181.649884878, y: 4858581.485318099, }, { x: 12961198.850660494, y: 4858569.376089524, }, { x: 12961224.140661275, y: 4858547.942074989, }, { x: 12961236.424254648, y: 4858536.280756947, }, { x: 12961250.296104662, y: 4858521.997990917, }, { x: 12961263.585987432, y: 4858506.114455221, }, { x: 12961276.44120637, y: 4858488.344153348, }, { x: 12961286.408321457, y: 4858473.632750297, }, { x: 12961294.63870108, y: 4858460.527513578, }, { x: 12961303.735586522, y: 4858443.4908795785, }, { x: 12961311.961795231, y: 4858426.312269373, }, { x: 12961324.544825437, y: 4858394.384768109, }, { x: 12961332.599563174, y: 4858367.639883998, }, { x: 12961338.437462995, y: 4858349.099767153, }, { x: 12961341.2480161, y: 4858329.523211644, }, { x: 12961344.471828079, y: 4858307.641213481, }, { x: 12961347.327668607, y: 4858271.276643974, }, { x: 12961347.988308016, y: 4858252.824580443, }, { x: 12961348.859027859, y: 4858200.010594391, }, { x: 12961348.859027859, y: 4858200.0103943935, }, { x: 12961347.38216376, y: 4858144.4708304275, }, { x: 12961343.338631237, y: 4857930.979484696, }, { x: 12961343.002661625, y: 4857896.233210593, }, { x: 12961340.747563919, y: 4857737.363889014, }, { x: 12961338.592553958, y: 4857671.84297017, }, { x: 12961341.18922736, y: 4857596.35911637, }, { x: 12961344.975191534, y: 4857477.302133615, }, { x: 12961347.967621036, y: 4857396.841326526, }, { x: 12961350.020733643, y: 4857318.561403474, }, { x: 12961355.68061802, y: 4857153.852373557, }, { x: 12961355.680618014, y: 4857153.852273558, }, { x: 12961359.731217345, y: 4857006.275839691, }, { x: 12961359.731017353, y: 4857006.131939777, }, { x: 12961360.845305737, y: 4856963.669545529, }, { x: 12961366.890092889, y: 4856784.230691269, }, { x: 12961368.58851819, y: 4856746.131025358, }, { x: 12961372.266035046, y: 4856660.336259479, }, { x: 12961372.829975668, y: 4856646.230202675, }, { x: 12961378.034419877, y: 4856495.295969707, }, { x: 12961382.403443811, y: 4856377.660000789, }, { x: 12961384.942063117, y: 4856311.497820034, }, { x: 12961386.465992313, y: 4856243.30465021, }, { x: 12961390.674716666, y: 4856107.682763318, }, { x: 12961394.329897156, y: 4855999.369524935, }, { x: 12961394.516375585, y: 4855993.8847022, }, { x: 12961417.584882293, y: 4855310.507392769, }, { x: 12961417.694868386, y: 4855307.2384764915, }, { x: 12961425.988003194, y: 4855061.622208351, }, { x: 12961440.215299333, y: 4854643.566032893, }, { x: 12961461.215758536, y: 4854015.5516425, }, { x: 12961471.471998505, y: 4853691.795660701, }, { x: 12961471.611776885, y: 4853686.561937957, }, { x: 12961474.998051625, y: 4853601.811384682, }, { x: 12961478.809553925, y: 4853507.031446198, }, { x: 12961480.521483717, y: 4853483.915660419, }, { x: 12961481.521725276, y: 4853474.174593727, }, { x: 12961482.954997385, y: 4853459.926853736, }, { x: 12961485.39370743, y: 4853441.314944552, }, { x: 12961494.966948297, y: 4853364.78470371, }, { x: 12961499.936921315, y: 4853336.948636642, }, { x: 12961547.758241706, y: 4853069.064103569, }, { x: 12961553.642808063, y: 4853027.336298535, }, { x: 12961555.648717735, y: 4853011.198681677, }, { x: 12961558.402478581, y: 4852968.599887655, }, { x: 12961561.595948681, y: 4852886.1285595605, }, { x: 12961562.434182541, y: 4852851.8992535565, }, { x: 12961567.092653673, y: 4852663.388779601, }, { x: 12961567.151841797, y: 4852661.004664356, }, { x: 12961571.615182877, y: 4852499.601380691, }, { x: 12961570.762650162, y: 4852327.846076672, }, { x: 12961554.898502, y: 4852258.290511526, }, { x: 12961533.80510204, y: 4852226.950476327, }, { x: 12961502.181787156, y: 4852194.501877436, }, { x: 12961463.801001186, y: 4852175.682708853, }, { x: 12961419.411661869, y: 4852168.225375068, }, { x: 12961360.726703899, y: 4852159.287636606, }, { x: 12961305.806766747, y: 4852155.632147181, }, { x: 12961091.327734, y: 4852150.8841911405, }, { x: 12961044.05355995, y: 4852148.93802986, }, { x: 12960991.078574985, y: 4852148.12380065, }, { x: 12960926.683247, y: 4852147.134333183, }, { x: 12960858.046176687, y: 4852148.206427826, }, { x: 12960832.258540388, y: 4852148.44774515, }, { x: 12960823.161300883, y: 4852148.574651271, }, { x: 12960804.266769528, y: 4852149.284002013, }, { x: 12960648.459496386, y: 4852144.033337599, }, { x: 12960623.783721833, y: 4852142.918236917, }, { x: 12960610.08653878, y: 4852142.2999238875, }, { x: 12960436.33035975, y: 4852141.569412107, }, { x: 12960425.323876735, y: 4852141.588789343, }, { x: 12960418.062649192, y: 4852140.894469294, }, { x: 12960397.685451128, y: 4852136.929909052, }, { x: 12960381.523315413, y: 4852132.778561514, }, { x: 12960359.877821121, y: 4852123.64158053, }, { x: 12960334.346658466, y: 4852109.556173046, }, { x: 12960318.030734146, y: 4852101.525721443, }, { x: 12960299.754816394, y: 4852089.551346909, }, { x: 12960273.273841146, y: 4852069.355692289, }, { x: 12960250.771053055, y: 4852047.738776747, }, { x: 12960236.237871027, y: 4852032.227379977, }, { x: 12960225.220958065, y: 4852021.18490097, }, { x: 12960202.953132067, y: 4851998.62513292, }, { x: 12960134.803431373, y: 4851930.302729313, }, { x: 12960131.415559309, y: 4851926.836000303, }, { x: 12960033.302394766, y: 4851823.178699325, }, { x: 12959943.550656857, y: 4851717.754021466, }, { x: 12959908.855465326, y: 4851685.719289181, }, { x: 12959858.337924149, y: 4851648.509466072, }, { x: 12959827.947234219, y: 4851635.216304059, }, { x: 12959793.596422547, y: 4851620.193270011, }, { x: 12959764.33089034, y: 4851609.816513307, }, { x: 12959751.845001617, y: 4851605.540422947, }, { x: 12959710.096488312, y: 4851595.58055257, }, { x: 12959644.793413645, y: 4851583.581423427, }, { x: 12959487.546643838, y: 4851579.1003289465, }, { x: 12959322.352977112, y: 4851573.1751883635, }, { x: 12959215.355539855, y: 4851567.487059426, }, { x: 12958906.741867626, y: 4851555.576738978, }, { x: 12958503.588496968, y: 4851536.078897831, }, { x: 12958347.549098158, y: 4851535.177370091, }, { x: 12958020.7967457, y: 4851519.547451833, }, { x: 12958020.774536882, y: 4851519.546442713, }, { x: 12957918.246551817, y: 4851517.112404003, }, { x: 12957847.278726801, y: 4851508.301972056, }, { x: 12957786.075293908, y: 4851497.8561179675, }, { x: 12957620.930185705, y: 4851464.46553163, }, { x: 12957553.206441535, y: 4851451.069831951, }, { x: 12957184.967742233, y: 4851438.277567215, }, { x: 12957151.372959128, y: 4851442.83206844, }, { x: 12956984.39334164, y: 4851457.2499878295, }, { x: 12956887.683125133, y: 4851467.99801078, }, { x: 12956842.417678, y: 4851471.246557499, }, { x: 12956795.847498052, y: 4851471.877345327, }, { x: 12956726.805401612, y: 4851470.21078116, }, { x: 12956719.005096909, y: 4851470.206809098, }, { x: 12956690.032717621, y: 4851466.331142748, }, { x: 12956671.745146377, y: 4851465.288835637, }, { x: 12956647.92701909, y: 4851464.086883708, }, { x: 12956432.678734198, y: 4851457.009062028, }, { x: 12956305.238743283, y: 4851452.754473514, }, { x: 12956260.077742493, y: 4851451.052139781, }, { x: 12956108.520973446, y: 4851442.943084553, }, { x: 12955979.955562841, y: 4851437.82970239, }, { x: 12955830.878658453, y: 4851433.243655892, }, { x: 12955632.99933834, y: 4851425.357106182, }, { x: 12955594.773108216, y: 4851423.831054184, }, { x: 12955514.958767148, y: 4851420.40654864, }, { x: 12955415.916358192, y: 4851415.173754157, }, { x: 12955412.341824232, y: 4851415.068560076, }, { x: 12955220.500590362, y: 4851409.551334249, }, { x: 12955177.214926412, y: 4851406.5893032905, }, { x: 12955161.53826209, y: 4851406.056397046, }, { x: 12955016.683409026, y: 4851400.736845952, }, { x: 12954738.676569056, y: 4851389.629311211, }, { x: 12954418.456831554, y: 4851372.282889688, }, { x: 12954112.367106372, y: 4851361.821497771, }, { x: 12954112.366906373, y: 4851361.821497775, }, { x: 12954095.960447045, y: 4851361.608137167, }, { x: 12954011.183086088, y: 4851358.621103881, }, { x: 12953877.563076375, y: 4851352.740857408, }, { x: 12953853.85732765, y: 4851351.967020577, }, { x: 12953803.748811886, y: 4851349.749490414, }, { x: 12953512.054691948, y: 4851336.624567439, }, { x: 12953304.439376486, y: 4851326.941645583, }, { x: 12953215.990118599, y: 4851343.405356978, }, { x: 12953186.516178105, y: 4851352.304914633, }, { x: 12953160.820809599, y: 4851360.075985219, }, { x: 12953135.6284275, y: 4851368.607839927, }, { x: 12953110.773697035, y: 4851379.448142389, }, { x: 12953078.728780996, y: 4851396.784940073, }, { x: 12953055.671146156, y: 4851410.242045931, }, { x: 12953025.125081131, y: 4851430.283492892, }, { x: 12953002.867918571, y: 4851441.908865417, }, { x: 12952970.9803234, y: 4851464.194335162, }, { x: 12952948.54425685, y: 4851486.7574834535, }, { x: 12952924.669249073, y: 4851516.663157407, }, { x: 12952893.865250975, y: 4851558.425931095, }, { x: 12952868.114842031, y: 4851601.291024181, }, { x: 12952849.72221334, y: 4851633.9557742765, }, { x: 12952840.178024879, y: 4851649.33032892, }, { x: 12952831.61507648, y: 4851664.098507009, }, { x: 12952820.749844346, y: 4851683.626532975, }, { x: 12952808.35960638, y: 4851712.713968235, }, { x: 12952805.20735029, y: 4851721.38335488, }, { x: 12952799.79260895, y: 4851738.36548495, }, { x: 12952789.190178515, y: 4851772.8758911565, }, { x: 12952788.761437649, y: 4851774.851755323, }, { x: 12952777.120529784, y: 4851828.491181396, }, { x: 12952769.442166151, y: 4851865.129402015, }, { x: 12952767.325349899, y: 4851875.233108534, }, { x: 12952767.225566436, y: 4851887.288016115, }, { x: 12952766.931015346, y: 4851923.099737246, }, { x: 12952761.952007528, y: 4852049.700375895, }, { x: 12952753.300309705, y: 4852305.149185844, }, { x: 12952748.81253644, y: 4852466.605133841, }, { x: 12952741.572670683, y: 4852644.392438163, }, { x: 12952738.74974852, y: 4852719.016327442, }, { x: 12952741.79628366, y: 4852826.032311127, }, { x: 12952754.022033157, y: 4852951.122076449, }, { x: 12952755.67102211, y: 4852968.493352729, }, { x: 12952758.734429048, y: 4853002.058635834, }, { x: 12952761.031034866, y: 4853033.715526356, }, { x: 12952761.5816642, y: 4853041.308351835, }, { x: 12952765.105510674, y: 4853089.883771956, }, { x: 12952768.26850136, y: 4853131.897335772, }, { x: 12952769.995078206, y: 4853158.94429872, }, { x: 12952770.288851582, y: 4853209.010686412, }, { x: 12952769.71843731, y: 4853247.566692912, }, { x: 12952767.145004591, y: 4853346.541922129, }, { x: 12952765.253378324, y: 4853436.619436339, }, { x: 12952765.214083849, y: 4853437.930242571, }, { x: 12952764.052342676, y: 4853458.187819974, }, { x: 12952760.168979194, y: 4853554.878914973, }, { x: 12952757.95248891, y: 4853628.164651818, }, { x: 12952754.901710529, y: 4853716.499504081, }, { x: 12952752.129394304, y: 4853804.555406498, }, { x: 12952749.6335356, y: 4853872.268162026, }, { x: 12952743.72513416, y: 4854014.227085098, }, { x: 12952741.487142773, y: 4854096.795681505, }, { x: 12952740.271323254, y: 4854189.877021544, }, { x: 12952735.244090632, y: 4854295.470985418, }, { x: 12952732.246698955, y: 4854403.93734809, }, { x: 12952731.594985832, y: 4854421.351329048, }, { x: 12952728.21683085, y: 4854497.1336529, }, { x: 12952727.968463881, y: 4854504.109582829, }, { x: 12952726.933201442, y: 4854533.194906944, }, { x: 12952726.57184963, y: 4854544.113349503, }, { x: 12952721.050076714, y: 4854688.295102883, }, { x: 12952720.966294285, y: 4854713.652392979, }, { x: 12952718.064468559, y: 4854769.647643217, }, { x: 12952715.044363484, y: 4854852.440379618, }, { x: 12952709.221122695, y: 4855060.2259299345, }, { x: 12952706.836731823, y: 4855138.965809699, }, { x: 12952705.041061016, y: 4855185.826583675, }, { x: 12952701.912666142, y: 4855297.303072879, }, { x: 12952701.774883661, y: 4855301.000993471, }, { x: 12952698.542893687, y: 4855388.379772971, }, { x: 12952694.722481314, y: 4855513.192139022, }, { x: 12952694.351429062, y: 4855527.489094137, }, { x: 12952693.024699595, y: 4855578.268289678, }, { x: 12952691.583080197, y: 4855615.825893778, }, { x: 12952690.241251186, y: 4855663.662486527, }, { x: 12952689.665623294, y: 4855679.603567254, }, { x: 12952688.776130756, y: 4855688.786687114, }, { x: 12952687.754061554, y: 4855729.323832838, }, { x: 12952686.019483153, y: 4855798.026277147, }, { x: 12952677.323277667, y: 4856106.12994655, }, { x: 12952676.787444718, y: 4856125.15381618, }, { x: 12952664.53774193, y: 4856474.271753169, }, { x: 12952649.541640174, y: 4856902.04310439, }, { x: 12952649.394057715, y: 4856906.40602088, }, { x: 12952635.915840019, y: 4857296.152572144, }, { x: 12952629.098613512, y: 4857468.8577486845, }, { x: 12952638.14364149, y: 4857509.197665979, }, { x: 12952650.97963757, y: 4857566.931901507, }, { x: 12952656.040774604, y: 4857583.179374015, }, { x: 12952668.497268757, y: 4857619.1841071565, }, { x: 12952685.776569141, y: 4857653.8455795515, }, { x: 12952706.290524684, y: 4857693.299857913, }, { x: 12952720.33970559, y: 4857717.258845025, }, { x: 12952728.768056454, y: 4857729.804878156, }, { x: 12952742.39713164, y: 4857747.850560737, }, { x: 12952755.039200235, y: 4857761.81094819, }, { x: 12952769.509095559, y: 4857774.792433353, }, { x: 12952782.996884435, y: 4857785.801023545, }, { x: 12952788.77239826, y: 4857789.984151489, }, { x: 12952798.589047497, y: 4857797.094653569, }, { x: 12952808.39067999, y: 4857802.308737876, }, { x: 12952837.452516967, y: 4857817.2604270065, }, { x: 12952881.01716795, y: 4857832.991883696, }, { x: 12952938.897575248, y: 4857852.0831211675, }, { x: 12952998.780647367, y: 4857874.054135021, }, { x: 12953258.491335763, y: 4857983.238622202, }, { x: 12953413.859664995, y: 4858039.332894681, }, { x: 12953461.589598283, y: 4858056.89652088, }, { x: 12953597.722309152, y: 4858106.241247336, }, { x: 12953667.79405445, y: 4858131.433108243, }, { x: 12953748.275540665, y: 4858167.149194927, }, { x: 12953812.476893716, y: 4858200.790776387, }, { x: 12954043.962199515, y: 4858326.647837333, }, { x: 12954069.141445398, y: 4858340.297104379, }, { x: 12954072.957342735, y: 4858342.340504059, }, { x: 12954114.16432913, y: 4858364.427001315, }, { x: 12954137.618859049, y: 4858375.535725627, }, { x: 12954295.058541333, y: 4858440.811649338, }, { x: 12954302.457537467, y: 4858443.441923854, }, { x: 12954310.15020407, y: 4858445.926167106, }, { x: 12954332.638227137, y: 4858452.508316665, }, { x: 12954353.823772585, y: 4858458.21648571, }, { x: 12954389.227238271, y: 4858467.144308251, }, { x: 12954466.181852238, y: 4858479.982544497, }, { x: 12954466.70470393, y: 4858480.069293314, }, { x: 12954681.711705219, y: 4858497.4227523925, }, { x: 12954881.814571371, y: 4858508.773537354, }, { x: 12954977.646000914, y: 4858510.359249282, }, { x: 12955052.400974875, y: 4858511.444873559, }, { x: 12955252.256507836, y: 4858514.336868981, }, { x: 12955253.967495963, y: 4858514.361726689, }, { x: 12955289.19954713, y: 4858514.5128645515, }, { x: 12955354.90360536, y: 4858516.033826125, }, { x: 12955355.483066956, y: 4858516.047198033, }, ], }, { id: "1", source: "2", target: "3", class: "地铁五号线", name: "地铁五号线 0", controlPoints: [ { x: 12960720.74502968, y: 4843624.831892422, }, { x: 12960633.531054523, y: 4843628.020999428, }, { x: 12960615.721414793, y: 4843628.698697272, }, { x: 12960529.018550536, y: 4843631.993865521, }, { x: 12960395.923003213, y: 4843634.498433887, }, { x: 12960303.4487313, y: 4843658.086022387, }, { x: 12960247.83253429, y: 4843698.236051296, }, { x: 12960198.244516307, y: 4843756.513927734, }, { x: 12960152.936239943, y: 4843826.831983379, }, { x: 12960093.80567492, y: 4844050.470482044, }, { x: 12960074.685721893, y: 4844241.260554531, }, { x: 12960067.43941915, y: 4844443.961097181, }, { x: 12960064.463686703, y: 4844812.802009133, }, { x: 12960051.958804457, y: 4845167.465485617, }, { x: 12960045.686471423, y: 4845319.993679029, }, { x: 12960040.290314263, y: 4845427.501735388, }, { x: 12960000.078505961, y: 4846409.670004274, }, { x: 12959967.360368509, y: 4847353.92871215, }, { x: 12959903.599435318, y: 4849086.018465949, }, { x: 12959897.308980407, y: 4849189.719214646, }, { x: 12959894.110421222, y: 4849203.583410498, }, { x: 12959890.4317169, y: 4849219.531068828, }, { x: 12959886.89822709, y: 4849232.656139195, }, { x: 12959877.73105254, y: 4849260.436420323, }, { x: 12959865.561524102, y: 4849290.043697017, }, { x: 12959837.38401807, y: 4849362.616048384, }, { x: 12959808.903257467, y: 4849435.004427626, }, { x: 12959779.115515891, y: 4849512.45632027, }, { x: 12959744.160038425, y: 4849599.294323696, }, { x: 12959725.117032269, y: 4849657.80245415, }, { x: 12959719.313276159, y: 4849682.1804609, }, { x: 12959715.446228703, y: 4849703.304149181, }, { x: 12959711.903727653, y: 4849724.430177948, }, { x: 12959709.011729391, y: 4849753.676989364, }, { x: 12959707.415947258, y: 4849783.8967948, }, { x: 12959706.932266207, y: 4849809.126489505, }, { x: 12959706.941864654, y: 4849836.458652587, }, { x: 12959706.941864647, y: 4849836.458852586, }, { x: 12959706.73825638, y: 4849843.058438657, }, { x: 12959701.188848983, y: 4850022.751749156, }, { x: 12959698.75643586, y: 4850092.048955763, }, { x: 12959696.677162938, y: 4850153.857703244, }, { x: 12959695.78056296, y: 4850188.632551699, }, { x: 12959694.918345, y: 4850201.721921542, }, { x: 12959692.002134146, y: 4850243.844071576, }, { x: 12959688.713196509, y: 4850307.368296433, }, { x: 12959688.399038235, y: 4850412.527108991, }, { x: 12959688.405735636, y: 4850420.937318844, }, { x: 12959688.343863737, y: 4850445.110083258, }, { x: 12959686.127736844, y: 4850539.017117742, }, { x: 12959683.968880652, y: 4850587.739754507, }, { x: 12959680.875828847, y: 4850658.134830053, }, { x: 12959679.529814905, y: 4850705.839287117, }, { x: 12959676.829087818, y: 4850793.495084584, }, { x: 12959675.815426968, y: 4850823.398964908, }, { x: 12959675.182101322, y: 4850846.066167584, }, { x: 12959674.637837825, y: 4850881.825140678, }, { x: 12959674.600854788, y: 4850900.231972202, }, { x: 12959672.17730142, y: 4850971.880703524, }, { x: 12959670.889156122, y: 4851002.727395804, }, { x: 12959670.698638307, y: 4851010.549985337, }, { x: 12959668.117749112, y: 4851106.755282467, }, { x: 12959665.56854209, y: 4851184.430341829, }, { x: 12959663.290916206, y: 4851257.106068522, }, { x: 12959662.369610716, y: 4851304.277585146, }, { x: 12959661.413917739, y: 4851326.766808909, }, { x: 12959657.931598857, y: 4851433.829044472, }, { x: 12959658.028261015, y: 4851474.80850299, }, { x: 12959657.267483199, y: 4851488.965234568, }, { x: 12959651.951822918, y: 4851544.541841047, }, { x: 12959644.793413645, y: 4851583.581423427, }, { x: 12959595.684288755, y: 4852619.8846618915, }, { x: 12959574.465131808, y: 4853929.7776421, }, { x: 12959536.880014552, y: 4854963.031257658, }, { x: 12959497.404227743, y: 4856298.871464132, }, { x: 12959482.020338908, y: 4856720.60653976, }, { x: 12959481.210910158, y: 4856745.719910398, }, { x: 12959480.218744718, y: 4856801.67083334, }, { x: 12959480.657100372, y: 4856811.732979886, }, { x: 12959473.537570594, y: 4857026.976625398, }, { x: 12959472.67316361, y: 4857117.529377648, }, { x: 12959471.826244202, y: 4857148.4116494795, }, { x: 12959471.914116398, y: 4857157.0041156085, }, { x: 12959471.914116394, y: 4857157.004315607, }, { x: 12959468.421265613, y: 4857243.442849801, }, { x: 12959465.42503048, y: 4857320.248131243, }, { x: 12959457.359831337, y: 4857487.904976163, }, { x: 12959441.732397161, y: 4858203.22983063, }, { x: 12959436.13624882, y: 4858459.380345282, }, { x: 12959415.193417262, y: 4858615.8007214, }, { x: 12959400.093169626, y: 4858713.511716538, }, { x: 12959399.09985982, y: 4858740.126114421, }, { x: 12959398.923112214, y: 4858756.581567208, }, { x: 12959400.425177053, y: 4858770.664816282, }, { x: 12959403.329731172, y: 4858781.277141151, }, { x: 12959406.81271103, y: 4858791.891385901, }, { x: 12959411.454041706, y: 4858801.77406984, }, { x: 12959416.960302725, y: 4858809.912175236, }, { x: 12959421.887523, y: 4858817.179145314, }, { x: 12959428.263989503, y: 4858824.297946437, }, { x: 12959438.405571558, y: 4858834.467323184, }, { x: 12959446.951603249, y: 4858840.418765018, }, { x: 12959453.47044277, y: 4858844.047635263, }, { x: 12959461.338227013, y: 4858847.889734993, }, { x: 12959468.530699532, y: 4858850.719229388, }, { x: 12959476.367733365, y: 4858853.206677165, }, { x: 12959486.177776907, y: 4858855.242211642, }, { x: 12959498.356965585, y: 4858856.501662772, }, { x: 12959543.238861157, y: 4858861.103129856, }, { x: 12959564.955544673, y: 4858862.823145494, }, { x: 12959585.658078235, y: 4858864.541516278, }, { x: 12959595.839429364, y: 4858866.740035375, }, { x: 12959604.626178885, y: 4858869.753969439, }, { x: 12959619.393890884, y: 4858875.118084437, }, { x: 12959634.602011, y: 4858883.533997516, }, { x: 12959647.926199682, y: 4858893.114601357, }, { x: 12959659.08101609, y: 4858903.862660445, }, { x: 12959672.122859873, y: 4858920.571917142, }, { x: 12959683.284136135, y: 4858939.464230514, }, { x: 12959691.987331163, y: 4858961.4122961955, }, { x: 12959695.907905033, y: 4858977.986510597, }, { x: 12959696.897168944, y: 4858990.458458495, }, { x: 12959696.95704519, y: 4859022.197030113, }, { x: 12959693.756261105, y: 4859059.590188502, }, { x: 12959690.179340184, y: 4859134.214310129, }, { x: 12959685.340567466, y: 4859249.237691335, }, { x: 12959685.339668898, y: 4859260.445091072, }, { x: 12959679.606577044, y: 4859423.720155937, }, { x: 12959665.286089724, y: 4859737.709063406, }, { x: 12959643.000270054, y: 4860035.900026235, }, { x: 12959632.910441214, y: 4860295.517810925, }, { x: 12959592.233549183, y: 4861342.088331037, }, { x: 12959588.730015729, y: 4861432.225749819, }, { x: 12959556.060278306, y: 4862388.960503767, }, { x: 12959545.695101015, y: 4862688.364754779, }, { x: 12959518.592346862, y: 4863435.743969738, }, { x: 12959485.60762339, y: 4864345.2318098685, }, { x: 12959486.001310887, y: 4864482.759632916, }, { x: 12959486.585650299, y: 4865230.9384146165, }, { x: 12959489.44520427, y: 4865436.730097548, }, { x: 12959497.988421464, y: 4865529.704413291, }, { x: 12959497.988421455, y: 4865529.704613299, }, { x: 12959519.200702442, y: 4865741.969269226, }, { x: 12959522.357194034, y: 4865776.148131042, }, { x: 12959522.573317947, y: 4865778.504652967, }, { x: 12959522.916097239, y: 4865782.246629099, }, { x: 12959551.022895565, y: 4866071.32380023, }, { x: 12959556.838158142, y: 4866160.7037429465, }, { x: 12959551.949571997, y: 4866262.940886653, }, { x: 12959540.38150212, y: 4866354.7103297105, }, { x: 12959539.340979226, y: 4866362.459925865, }, { x: 12959513.475078186, y: 4866576.75533692, }, { x: 12959513.47507818, y: 4866576.755436918, }, { x: 12959497.755400725, y: 4866692.268572319, }, { x: 12959497.610949984, y: 4866693.40672459, }, { x: 12959483.493606979, y: 4866796.261737931, }, { x: 12959466.691132883, y: 4866917.22829191, }, { x: 12959461.210504338, y: 4866960.1057711635, }, { x: 12959426.407796139, y: 4867225.807957604, }, { x: 12959418.801394718, y: 4867288.213382227, }, { x: 12959416.692326868, y: 4867306.0886218455, }, { x: 12959410.47637647, y: 4867351.37610048, }, { x: 12959400.148907803, y: 4867462.455263302, }, { x: 12959399.112409318, y: 4867478.93856583, }, { x: 12959396.256439034, y: 4867556.841285077, }, { x: 12959394.84524912, y: 4867623.882782224, }, { x: 12959402.914618, y: 4867739.272140503, }, { x: 12959407.505976537, y: 4867797.003244392, }, { x: 12959415.808022052, y: 4867872.177101691, }, { x: 12959437.831136882, y: 4868003.5787004335, }, { x: 12959443.098101616, y: 4868036.394816039, }, { x: 12959464.101440175, y: 4868167.242968876, }, { x: 12959478.37498549, y: 4868261.98680037, }, { x: 12959508.23051181, y: 4868432.816097544, }, { x: 12959539.922123043, y: 4868629.3165109595, }, { x: 12959551.24160535, y: 4868728.22086592, }, { x: 12959555.049512597, y: 4868834.379861189, }, { x: 12959557.09776522, y: 4869178.128956159, }, { x: 12959557.46233141, y: 4869212.439258056, }, { x: 12959560.523011155, y: 4869592.048363338, }, { x: 12959577.865984676, y: 4869718.394291774, }, { x: 12959590.012423703, y: 4869827.204686913, }, { x: 12959595.795077762, y: 4869869.18333726, }, { x: 12959598.248023918, y: 4869952.360503471, }, { x: 12959599.56821579, y: 4870095.040123146, }, { x: 12959609.728836436, y: 4870531.437161518, }, { x: 12959603.972221585, y: 4870603.500963714, }, { x: 12959588.040449219, y: 4870699.62726807, }, { x: 12959577.341958042, y: 4870759.729165575, }, { x: 12959552.550153958, y: 4870890.017106278, }, { x: 12959549.504474476, y: 4870907.895185102, }, { x: 12959536.238199469, y: 4870980.633462292, }, { x: 12959519.906514881, y: 4871059.136581221, }, { x: 12959498.606091205, y: 4871123.470002014, }, { x: 12959483.02793797, y: 4871158.4458806105, }, { x: 12959398.579719294, y: 4871307.904408066, }, { x: 12959372.473708287, y: 4871364.923557604, }, { x: 12959355.676189639, y: 4871417.85108307, }, { x: 12959345.382419249, y: 4871467.110988155, }, { x: 12959337.246138988, y: 4871518.719362454, }, { x: 12959331.993689496, y: 4871552.047085774, }, { x: 12959329.720869558, y: 4871566.954753559, }, { x: 12959309.401737848, y: 4871682.640660545, }, { x: 12959284.09575571, y: 4871813.104051212, }, { x: 12959272.141485408, y: 4871880.577467433, }, { x: 12959212.679174809, y: 4872024.938082188, }, { x: 12959122.218527583, y: 4872236.515550644, }, { x: 12959101.497205438, y: 4872286.842893077, }, { x: 12959082.233978389, y: 4872332.857224708, }, { x: 12959064.438388105, y: 4872374.568487362, }, { x: 12959002.833097033, y: 4872476.910775585, }, { x: 12958978.720982237, y: 4872510.998020613, }, { x: 12958934.40716439, y: 4872572.781793622, }, { x: 12958888.474905616, y: 4872641.302003023, }, { x: 12958847.253143456, y: 4872732.877987774, }, { x: 12958840.613299651, y: 4872775.301160091, }, { x: 12958826.01344493, y: 4872861.8293480575, }, { x: 12958817.526527362, y: 4873017.26494393, }, { x: 12958814.054718142, y: 4873226.284171534, }, { x: 12958816.11193364, y: 4873266.055943593, }, { x: 12958816.129135203, y: 4873290.15488096, }, { x: 12958821.354560152, y: 4873309.887136759, }, { x: 12958841.32562995, y: 4873397.115248937, }, { x: 12958844.285408415, y: 4873409.713148855, }, { x: 12958847.915875804, y: 4873422.442037873, }, { x: 12958889.630321097, y: 4873507.434415227, }, { x: 12958925.449787276, y: 4873574.258471447, }, { x: 12959052.396737209, y: 4873809.916450764, }, { x: 12959072.334776778, y: 4873851.7039971035, }, { x: 12959091.382334014, y: 4873912.579314463, }, { x: 12959103.205925986, y: 4873994.365655067, }, { x: 12959105.049669469, y: 4874040.715385412, }, { x: 12959098.781538986, y: 4874130.696496499, }, { x: 12959091.653604891, y: 4874277.942229356, }, { x: 12959073.762015432, y: 4874560.621555201, }, { x: 12959055.88026487, y: 4874851.491609374, }, { x: 12959035.313639542, y: 4875190.5466335295, }, { x: 12959020.984397592, y: 4875394.165125814, }, { x: 12958976.23099209, y: 4876077.778969328, }, { x: 12958959.745692749, y: 4876337.611516656, }, { x: 12958959.782791425, y: 4876388.517880667, }, { x: 12958963.47494545, y: 4876487.604684548, }, { x: 12958978.051701134, y: 4876614.863733437, }, { x: 12959002.615098093, y: 4876782.118274665, }, { x: 12959044.457185756, y: 4877060.270620597, }, { x: 12959067.219679391, y: 4877241.168949157, }, { x: 12959071.783226173, y: 4877290.243072816, }, { x: 12959070.11534219, y: 4877482.0814475445, }, { x: 12959050.419169253, y: 4877777.579645479, }, { x: 12959032.750496056, y: 4878102.221159315, }, { x: 12959032.750496058, y: 4878102.221259315, }, { x: 12959003.26866052, y: 4878470.802548815, }, { x: 12959000.418311324, y: 4878535.557270987, }, { x: 12958996.46075172, y: 4878573.393290567, }, { x: 12958986.710555336, y: 4878612.325690378, }, { x: 12958984.36114175, y: 4878620.285756933, }, { x: 12958979.482719835, y: 4878633.567604723, }, { x: 12958971.70519758, y: 4878648.669953857, }, { x: 12958960.310788708, y: 4878668.732809022, }, { x: 12958954.159688484, y: 4878678.6962916935, }, { x: 12958940.408512954, y: 4878697.079788669, }, { x: 12958920.863620294, y: 4878718.556967109, }, { x: 12958911.0902516, y: 4878726.568490176, }, { x: 12958895.161451222, y: 4878738.950175331, }, { x: 12958883.032721909, y: 4878747.3254355155, }, { x: 12958866.73870309, y: 4878756.433205192, }, { x: 12958839.217742998, y: 4878769.914421513, }, { x: 12958816.400635526, y: 4878777.388295637, }, { x: 12958783.623366289, y: 4878784.917193882, }, { x: 12958771.309150409, y: 4878786.744063957, }, { x: 12958739.429878792, y: 4878788.584452175, }, { x: 12958705.738986243, y: 4878786.424910058, }, { x: 12958578.932445105, y: 4878772.682927707, }, { x: 12958490.16318142, y: 4878762.546866739, }, { x: 12958476.030639933, y: 4878759.645153562, }, { x: 12958398.482079366, y: 4878738.585155731, }, { x: 12958337.60009126, y: 4878723.697450009, }, { x: 12958319.258018306, y: 4878717.823743411, }, { x: 12958285.414545368, y: 4878706.985809459, }, { x: 12958281.24441303, y: 4878706.124142206, }, { x: 12958265.300704759, y: 4878704.674592208, }, { x: 12958248.322873216, y: 4878700.7330124155, }, { x: 12958235.48402549, y: 4878697.874149074, }, { x: 12958209.66504376, y: 4878694.661718712, }, { x: 12958185.394430613, y: 4878692.518259022, }, { x: 12958163.832025072, y: 4878687.433936088, }, { x: 12958149.29817478, y: 4878683.5722363135, }, { x: 12958127.588537483, y: 4878677.8039692715, }, { x: 12958103.488411777, y: 4878671.445979302, }, { x: 12958088.084013943, y: 4878666.72080967, }, { x: 12958073.22210372, y: 4878661.450932288, }, { x: 12958053.105073934, y: 4878653.090874466, }, { x: 12958019.939165607, y: 4878639.8218743205, }, { x: 12957987.498125235, y: 4878626.005036278, }, { x: 12957976.804148829, y: 4878622.369122046, }, { x: 12957959.95128188, y: 4878618.734327142, }, { x: 12957933.674733272, y: 4878614.921507571, }, ], }, { id: "2", source: "4", target: "5", class: "地铁房山线", name: "地铁房山线 0", controlPoints: [ { x: 12924448.17238817, y: 4826880.333482542, }, { x: 12924525.979211709, y: 4826872.878344628, }, { x: 12924651.003975658, y: 4826850.186382258, }, { x: 12924772.909010362, y: 4826831.637862584, }, { x: 12924892.815210382, y: 4826808.910764785, }, { x: 12924979.825081667, y: 4826797.17955122, }, { x: 12925084.39744784, y: 4826783.365645579, }, { x: 12925155.81120956, y: 4826773.302022665, }, { x: 12925191.531802883, y: 4826763.145386636, }, { x: 12925246.401130036, y: 4826741.508641205, }, { x: 12925289.809143692, y: 4826716.000219138, }, { x: 12925328.122217724, y: 4826687.913828323, }, { x: 12925435.446934095, y: 4826589.547291209, }, { x: 12925667.935929714, y: 4826383.866700324, }, { x: 12925703.114335984, y: 4826349.828286723, }, { x: 12925770.622207448, y: 4826279.8993723765, }, { x: 12925812.089063462, y: 4826236.363691168, }, { x: 12925860.064926796, y: 4826185.624213163, }, { x: 12925972.45908047, y: 4826067.695006573, }, { x: 12926072.836947165, y: 4825968.627523454, }, { x: 12926117.70970191, y: 4825926.122953221, }, { x: 12926163.925422803, y: 4825891.864408059, }, { x: 12926224.487089904, y: 4825859.005237854, }, { x: 12926272.713245494, y: 4825838.833351052, }, { x: 12926306.225330409, y: 4825828.247220456, }, { x: 12926323.66112753, y: 4825823.471552652, }, { x: 12926342.999038229, y: 4825815.638790402, }, { x: 12926395.038321048, y: 4825807.019948717, }, { x: 12926456.619666297, y: 4825801.386693386, }, { x: 12926771.931888463, y: 4825802.616129439, }, { x: 12926851.048048986, y: 4825801.631130125, }, { x: 12926918.475671358, y: 4825800.789146462, }, { x: 12927029.359667536, y: 4825801.827672996, }, { x: 12927182.830807276, y: 4825803.048420769, }, { x: 12927499.41885292, y: 4825801.064920832, }, { x: 12927985.316114604, y: 4825802.302803997, }, { x: 12928151.253302878, y: 4825800.059199896, }, { x: 12928748.07329185, y: 4825800.240476295, }, { x: 12929111.030443402, y: 4825800.274953787, }, { x: 12929262.734959431, y: 4825802.042122076, }, { x: 12929411.395781256, y: 4825802.035455338, }, { x: 12929506.992909838, y: 4825802.706934221, }, { x: 12929650.07556503, y: 4825802.544157764, }, { x: 12929720.668591391, y: 4825802.142241587, }, { x: 12929772.983434387, y: 4825800.887369454, }, { x: 12929857.446321096, y: 4825798.160825567, }, { x: 12929912.070413183, y: 4825797.961849597, }, { x: 12930020.049115648, y: 4825798.40702736, }, { x: 12930163.955832295, y: 4825797.372447041, }, { x: 12930397.554672962, y: 4825796.54976334, }, { x: 12930475.738706259, y: 4825796.886377486, }, { x: 12930546.696718559, y: 4825797.190814849, }, { x: 12930678.19064345, y: 4825796.767765474, }, { x: 12930758.84637836, y: 4825797.611875748, }, { x: 12930844.12941692, y: 4825797.184218957, }, { x: 12931658.797219362, y: 4825797.407901417, }, { x: 12932033.235206187, y: 4825795.320207194, }, { x: 12932233.393439343, y: 4825794.180152587, }, { x: 12932721.308799969, y: 4825803.219910631, }, { x: 12932928.523249036, y: 4825803.557711617, }, { x: 12933053.790329, y: 4825812.987185039, }, { x: 12933138.900921563, y: 4825833.806609662, }, { x: 12933190.809829095, y: 4825856.349271142, }, { x: 12933226.429307265, y: 4825874.795930243, }, { x: 12933272.213535246, y: 4825905.5475769965, }, { x: 12933330.19116232, y: 4825952.706628941, }, { x: 12933394.224417783, y: 4826031.661583878, }, { x: 12933434.848204572, y: 4826099.343443693, }, { x: 12933457.160278024, y: 4826153.699179631, }, { x: 12933477.393874265, y: 4826231.651463547, }, { x: 12933483.411973838, y: 4826283.965274176, }, { x: 12933484.24966211, y: 4826383.467920047, }, { x: 12933484.612918697, y: 4826744.564537366, }, { x: 12933484.578816487, y: 4826763.36453251, }, { x: 12933483.779386565, y: 4826924.895615106, }, { x: 12933482.610669505, y: 4827007.992815708, }, { x: 12933492.646572754, y: 4827092.110644749, }, { x: 12933513.41196703, y: 4827439.884337276, }, { x: 12933543.228519833, y: 4827854.75280781, }, { x: 12933566.570100563, y: 4828176.552121379, }, { x: 12933594.643939137, y: 4828596.572517603, }, { x: 12933629.925192222, y: 4829103.087824667, }, { x: 12933645.64381434, y: 4829320.597027384, }, { x: 12933649.89045366, y: 4829382.144115338, }, { x: 12933667.168927083, y: 4829632.556420974, }, { x: 12933676.117122944, y: 4829774.023766041, }, { x: 12933682.081289982, y: 4829869.157117123, }, { x: 12933689.928693485, y: 4829940.817807672, }, { x: 12933703.310192509, y: 4830006.297419812, }, { x: 12933719.154849395, y: 4830066.214843579, }, { x: 12933755.774424188, y: 4830174.310550475, }, { x: 12933810.744445253, y: 4830313.90749861, }, { x: 12933922.503728205, y: 4830609.788269573, }, { x: 12934038.543576436, y: 4830918.028547641, }, { x: 12934058.694520555, y: 4830974.859139696, }, { x: 12934069.58014834, y: 4831005.072471465, }, { x: 12934119.846976575, y: 4831143.433958218, }, { x: 12934149.991077174, y: 4831222.949836257, }, { x: 12934198.033104936, y: 4831349.678156342, }, { x: 12934223.473509623, y: 4831400.412253144, }, { x: 12934259.369952803, y: 4831461.028016709, }, { x: 12934309.114426302, y: 4831520.072779361, }, { x: 12934377.085065225, y: 4831581.991332408, }, { x: 12934396.69835483, y: 4831595.164926664, }, { x: 12934437.243386144, y: 4831618.212550709, }, { x: 12934478.449542966, y: 4831638.623777254, }, { x: 12934524.898399867, y: 4831655.075704626, }, { x: 12934580.515549589, y: 4831668.889447878, }, { x: 12934636.143351322, y: 4831676.770691342, }, { x: 12934666.908025475, y: 4831679.39163554, }, { x: 12934765.756048232, y: 4831678.685510442, }, { x: 12934930.73367185, y: 4831674.651678714, }, { x: 12935250.876591342, y: 4831667.251747576, }, { x: 12935499.671785736, y: 4831663.187574107, }, { x: 12935746.513249094, y: 4831659.130713738, }, { x: 12935815.915508969, y: 4831660.42132409, }, { x: 12935908.050789848, y: 4831663.982781072, }, { x: 12935967.815653212, y: 4831666.293463208, }, { x: 12936241.494185515, y: 4831674.4963234225, }, { x: 12936369.370711273, y: 4831678.336400013, }, { x: 12936425.785732588, y: 4831676.31555289, }, { x: 12936581.316240864, y: 4831673.037189442, }, { x: 12936633.370649267, y: 4831674.963771561, }, { x: 12936737.713978717, y: 4831679.370178035, }, { x: 12936831.315349536, y: 4831683.322450787, }, { x: 12936877.589160608, y: 4831685.252679165, }, { x: 12936910.361308584, y: 4831690.419854687, }, { x: 12936949.558532905, y: 4831696.881239256, }, { x: 12936987.467610013, y: 4831706.574167675, }, { x: 12937022.15788816, y: 4831719.5039792955, }, { x: 12937065.199754963, y: 4831736.958924886, }, { x: 12937110.158974504, y: 4831760.881236912, }, { x: 12937157.036534246, y: 4831793.8590075895, }, { x: 12937199.404558316, y: 4831833.307823846, }, { x: 12937237.91287837, y: 4831875.343509309, }, { x: 12937258.446807722, y: 4831901.211682247, }, { x: 12937284.10526521, y: 4831938.723324833, }, { x: 12937312.95239147, y: 4831994.991182708, }, { x: 12937327.68762551, y: 4832030.564244142, }, { x: 12937343.684707167, y: 4832083.600788961, }, { x: 12937351.972602425, y: 4832131.461705969, }, { x: 12937358.31940185, y: 4832186.438225887, }, { x: 12937355.622857124, y: 4832274.4059191365, }, { x: 12937339.975481886, y: 4832427.060379704, }, { x: 12937324.788945852, y: 4832705.848365801, }, { x: 12937293.01305762, y: 4832897.32304263, }, { x: 12937270.892804373, y: 4833079.740939002, }, { x: 12937248.767915612, y: 4833263.455352972, }, { x: 12937209.689481642, y: 4833612.138889359, }, { x: 12937165.784590699, y: 4834031.900756954, }, { x: 12937138.418116648, y: 4834222.711592586, }, { x: 12937083.08660543, y: 4834535.844936789, }, { x: 12937052.334413424, y: 4834663.757169239, }, { x: 12936994.342385216, y: 4834895.126983638, }, { x: 12936953.854431149, y: 4835030.737985154, }, { x: 12936869.843218748, y: 4835313.3219827665, }, { x: 12936862.532161772, y: 4835339.778036121, }, { x: 12936836.320704404, y: 4835434.637730703, }, { x: 12936827.217503313, y: 4835519.169988192, }, { x: 12936827.124637516, y: 4835581.758973662, }, { x: 12936837.906126408, y: 4835663.063325517, }, { x: 12936864.056538468, y: 4835757.266142062, }, { x: 12936880.668495258, y: 4835797.917881852, }, { x: 12936907.667939143, y: 4835847.318738415, }, { x: 12936952.878761742, y: 4835914.1082075, }, { x: 12937000.216170117, y: 4835969.234486032, }, { x: 12937063.361933991, y: 4836023.2971759755, }, { x: 12937143.36704171, y: 4836079.4810301885, }, { x: 12937217.081887215, y: 4836115.519519725, }, { x: 12937329.790312514, y: 4836151.556748291, }, { x: 12937431.328256749, y: 4836175.655924688, }, { x: 12937851.122850813, y: 4836275.4876682935, }, { x: 12938154.622310877, y: 4836341.2390868, }, { x: 12938362.244614977, y: 4836390.037264124, }, { x: 12938503.041870078, y: 4836411.664485504, }, { x: 12938564.047320768, y: 4836418.793423229, }, { x: 12938988.303480383, y: 4836457.009886602, }, { x: 12939480.568825236, y: 4836493.208155112, }, { x: 12939792.38983277, y: 4836515.385447704, }, { x: 12940262.993302846, y: 4836548.909357694, }, { x: 12940393.59269819, y: 4836559.504709913, }, { x: 12940478.91780255, y: 4836571.822251312, }, { x: 12940790.622461848, y: 4836636.837138435, }, { x: 12941203.633091165, y: 4836730.122990206, }, { x: 12941712.749939607, y: 4836839.200160033, }, { x: 12942167.786199445, y: 4836936.5137574095, }, { x: 12942294.984682916, y: 4836959.65357408, }, { x: 12942610.524821742, y: 4837005.682620561, }, { x: 12942843.547300853, y: 4837039.413158133, }, { x: 12943166.318173433, y: 4837086.947605261, }, { x: 12943510.46784253, y: 4837134.81698191, }, { x: 12943617.3707184, y: 4837150.799628537, }, { x: 12943658.487001108, y: 4837158.769269097, }, { x: 12943691.736804834, y: 4837167.08383111, }, { x: 12943717.587123148, y: 4837172.921819401, }, { x: 12943814.810048617, y: 4837200.232098826, }, { x: 12943917.263605423, y: 4837238.058053253, }, { x: 12943974.78713743, y: 4837264.277939439, }, { x: 12944030.153658753, y: 4837291.952562648, }, { x: 12944135.650915911, y: 4837354.294186727, }, { x: 12944445.141549075, y: 4837528.417611227, }, { x: 12944644.509050895, y: 4837635.945078776, }, { x: 12944685.94060137, y: 4837654.409708789, }, { x: 12944719.086739298, y: 4837669.359215808, }, { x: 12944794.975247588, y: 4837699.716510274, }, { x: 12944947.1976908, y: 4837760.873124597, }, { x: 12945035.745333357, y: 4837798.266491122, }, { x: 12945124.72566364, y: 4837845.286033468, }, { x: 12945270.414963193, y: 4837921.319729365, }, { x: 12945450.582071586, y: 4838013.632744957, }, { x: 12945577.533408465, y: 4838080.445217846, }, { x: 12945834.434212714, y: 4838202.613398697, }, { x: 12946075.31690205, y: 4838296.146027662, }, { x: 12946292.279576164, y: 4838360.532187274, }, { x: 12946521.019224824, y: 4838491.165573925, }, { x: 12946638.949600644, y: 4838621.542593471, }, { x: 12946650.686066799, y: 4838737.438298838, }, ], }, { id: "3", source: "6", target: "7", class: "地铁亦庄线", name: "地铁亦庄线 0", controlPoints: [ { x: 12960801.92985531, y: 4843268.231642703, }, { x: 12960819.048596159, y: 4842751.648234617, }, { x: 12960883.71369413, y: 4842268.659267911, }, { x: 12960932.9503868, y: 4842163.931739517, }, { x: 12961006.927248925, y: 4842097.692273121, }, { x: 12961168.66192465, y: 4842014.7338780835, }, { x: 12962601.717469966, y: 4841896.79575762, }, { x: 12962754.46753597, y: 4841885.241291034, }, { x: 12962943.500290178, y: 4841880.673982279, }, { x: 12963012.112349365, y: 4841876.615867013, }, { x: 12963059.010006737, y: 4841861.67650217, }, { x: 12963116.452138275, y: 4841834.8158408785, }, { x: 12963210.447880082, y: 4841771.47221078, }, { x: 12963235.833946913, y: 4841754.363392143, }, { x: 12963662.654879957, y: 4841466.647965242, }, { x: 12964038.994342858, y: 4841212.831358209, }, { x: 12964154.545155134, y: 4841070.441342094, }, { x: 12964171.735590378, y: 4841010.993206987, }, { x: 12964339.916463993, y: 4840434.314594529, }, { x: 12964343.389385078, y: 4840399.329742603, }, { x: 12964334.817316562, y: 4840225.397102979, }, { x: 12964331.221136974, y: 4840162.554061632, }, { x: 12964328.50535713, y: 4840100.593094604, }, { x: 12964332.779831221, y: 4840004.0775054535, }, { x: 12964346.582668858, y: 4839794.207556842, }, { x: 12964363.097590594, y: 4839601.773416806, }, { x: 12964380.328964364, y: 4839365.602941362, }, { x: 12964385.8482237, y: 4839211.548689884, }, { x: 12964387.499547305, y: 4839127.002529577, }, { x: 12964391.276917182, y: 4838985.794324284, }, { x: 12964392.443018869, y: 4838864.958482721, }, { x: 12964394.955731656, y: 4838766.690857032, }, { x: 12964393.975998627, y: 4838687.027470687, }, { x: 12964387.294707682, y: 4838617.567328025, }, { x: 12964367.416052649, y: 4838539.309062238, }, { x: 12964347.51619, y: 4838431.650587995, }, { x: 12964322.767169563, y: 4838324.645467618, }, { x: 12964313.562428541, y: 4838262.541243617, }, { x: 12964310.411869453, y: 4838225.729635625, }, { x: 12964309.355618041, y: 4838208.017849213, }, { x: 12964309.656222237, y: 4838174.319843992, }, { x: 12964311.684558112, y: 4838140.960443022, }, { x: 12964317.833830703, y: 4838091.9543595165, }, { x: 12964329.018005343, y: 4838019.745353896, }, { x: 12964357.57037216, y: 4837928.397117701, }, { x: 12964379.95742845, y: 4837836.721116149, }, { x: 12964395.761376698, y: 4837785.937210788, }, { x: 12964408.481659109, y: 4837751.494051737, }, { x: 12964423.958059136, y: 4837713.2194660455, }, { x: 12964454.929082762, y: 4837651.608776794, }, { x: 12964485.908545986, y: 4837599.028090593, }, { x: 12964502.078122087, y: 4837575.000819509, }, { x: 12964507.944067815, y: 4837566.284373945, }, { x: 12964538.941616124, y: 4837526.901722564, }, { x: 12964580.623847708, y: 4837481.571345544, }, { x: 12964632.30168787, y: 4837432.37855521, }, { x: 12964707.289879689, y: 4837377.0810903795, }, { x: 12964746.5828552, y: 4837352.947415166, }, { x: 12964787.599945143, y: 4837330.888655926, }, { x: 12964847.234552702, y: 4837303.540100147, }, { x: 12964952.379239444, y: 4837263.837261641, }, { x: 12965041.659042722, y: 4837228.367036585, }, { x: 12965086.817706559, y: 4837212.190291242, }, { x: 12965125.425630035, y: 4837197.083091712, }, { x: 12965198.852510314, y: 4837173.487209741, }, { x: 12965285.035077993, y: 4837148.788444636, }, { x: 12965345.022458684, y: 4837136.015256971, }, { x: 12965376.741696445, y: 4837131.008352433, }, { x: 12965413.288189877, y: 4837126.675422853, }, { x: 12965466.732716972, y: 4837121.571415942, }, { x: 12965495.35177725, y: 4837119.3559531085, }, { x: 12965530.521028334, y: 4837117.112703386, }, { x: 12965593.968191253, y: 4837116.473776446, }, { x: 12965649.486601945, y: 4837118.648806222, }, { x: 12965697.768784914, y: 4837122.941340376, }, { x: 12965780.881747998, y: 4837133.843576874, }, { x: 12965906.431954557, y: 4837162.43093923, }, { x: 12966118.21979879, y: 4837224.64350029, }, { x: 12966330.35727124, y: 4837296.215654915, }, { x: 12966430.728530029, y: 4837328.721880014, }, { x: 12966526.230111593, y: 4837358.910915481, }, { x: 12966643.884234305, y: 4837396.097468287, }, { x: 12966715.9714909, y: 4837420.053074277, }, { x: 12966775.298984269, y: 4837442.68182159, }, { x: 12966834.282130612, y: 4837464.615069852, }, { x: 12966877.402287401, y: 4837483.848933528, }, { x: 12966941.220910013, y: 4837513.053573998, }, { x: 12967048.56698116, y: 4837567.953487057, }, { x: 12967160.356455721, y: 4837633.033932691, }, { x: 12967341.830451151, y: 4837734.223029286, }, { x: 12967598.515018187, y: 4837876.520746398, }, { x: 12967695.550281677, y: 4837931.8672629995, }, { x: 12967769.295083275, y: 4837973.927233142, }, { x: 12967806.210225426, y: 4837994.921276422, }, { x: 12967880.373314308, y: 4838029.263222194, }, { x: 12967942.458581364, y: 4838054.463929446, }, { x: 12968006.949619304, y: 4838074.960467259, }, { x: 12968064.880156811, y: 4838089.239839763, }, { x: 12968160.7317529, y: 4838106.785960654, }, { x: 12968223.818423554, y: 4838111.656953844, }, { x: 12968280.003925696, y: 4838113.086931953, }, { x: 12968326.878944056, y: 4838112.138498563, }, { x: 12968367.54589312, y: 4838109.4857799625, }, { x: 12968389.51656575, y: 4838106.448409635, }, { x: 12968438.187831255, y: 4838099.719152986, }, { x: 12968498.833145326, y: 4838088.619169914, }, { x: 12968538.110375632, y: 4838079.370846887, }, { x: 12968616.314083783, y: 4838057.750684839, }, { x: 12968698.633058043, y: 4838023.949189746, }, { x: 12968811.931290373, y: 4837966.003419178, }, { x: 12968881.824553497, y: 4837922.53959489, }, { x: 12968943.430079784, y: 4837870.786756742, }, { x: 12969022.924111847, y: 4837800.520362136, }, { x: 12969055.9530577, y: 4837765.945136667, }, { x: 12969084.843050089, y: 4837731.392991392, }, { x: 12969120.958078042, y: 4837688.466172142, }, { x: 12969155.332209961, y: 4837635.4723625, }, { x: 12969242.285513127, y: 4837496.730319538, }, { x: 12969333.712761667, y: 4837355.187852096, }, { x: 12969408.647255532, y: 4837235.936020544, }, { x: 12969513.801304353, y: 4837064.791048047, }, { x: 12969590.779687598, y: 4836941.394981127, }, { x: 12969705.899936745, y: 4836755.955416486, }, { x: 12969806.238916375, y: 4836594.567940544, }, { x: 12969938.533153186, y: 4836382.639398942, }, { x: 12970039.8160462, y: 4836217.531831086, }, { x: 12970129.245947173, y: 4836071.878209337, }, { x: 12970220.246216761, y: 4835926.897614078, }, { x: 12970286.073547151, y: 4835822.025633852, }, { x: 12970415.07546836, y: 4835612.642595116, }, { x: 12970568.870650535, y: 4835365.18734994, }, { x: 12970669.724938907, y: 4835202.376148994, }, { x: 12970752.484735584, y: 4835070.152439515, }, { x: 12970832.895625059, y: 4834939.975857269, }, { x: 12970899.569476828, y: 4834832.910757041, }, { x: 12971033.918129083, y: 4834616.066050077, }, { x: 12971144.158073269, y: 4834433.937266104, }, { x: 12971198.069970135, y: 4834344.871445297, }, { x: 12971305.26943295, y: 4834167.479451596, }, { x: 12971364.235194443, y: 4834074.351988931, }, { x: 12971525.71156008, y: 4833814.364471716, }, { x: 12971682.679083303, y: 4833562.284042895, }, { x: 12971812.288419375, y: 4833350.753875024, }, { x: 12972017.979800759, y: 4833021.125112385, }, { x: 12972103.744545488, y: 4832885.194999167, }, { x: 12972135.257382995, y: 4832846.417732776, }, { x: 12972160.077781122, y: 4832821.220722371, }, { x: 12972199.662509607, y: 4832785.10628778, }, { x: 12972264.123885086, y: 4832742.901302573, }, { x: 12972264.12408505, y: 4832742.901202536, }, { x: 12972324.21434308, y: 4832713.4141902095, }, { x: 12972386.305619905, y: 4832692.675651716, }, { x: 12972428.804140508, y: 4832685.222868618, }, { x: 12972485.012097614, y: 4832680.520476171, }, { x: 12972542.168608952, y: 4832680.834396475, }, { x: 12972604.011630796, y: 4832688.654398485, }, { x: 12972644.212348452, y: 4832699.10386752, }, { x: 12972696.734916897, y: 4832717.642597281, }, { x: 12972757.695351638, y: 4832749.00336457, }, { x: 12972859.999908108, y: 4832813.088811927, }, { x: 12972941.093523078, y: 4832860.97338974, }, { x: 12973004.727402989, y: 4832901.107069043, }, { x: 12973063.375094922, y: 4832939.388312671, }, { x: 12973118.709117647, y: 4832976.2564467145, }, { x: 12973157.278549964, y: 4833001.955820043, }, { x: 12973287.045299167, y: 4833078.76948663, }, { x: 12973336.018910544, y: 4833107.376876498, }, { x: 12973532.737387815, y: 4833234.050880133, }, { x: 12973711.056147737, y: 4833345.140835251, }, { x: 12973939.785549805, y: 4833486.730983602, }, { x: 12974177.84357694, y: 4833635.477147498, }, { x: 12974448.095380764, y: 4833804.380259698, }, { x: 12974616.656587714, y: 4833906.469350846, }, { x: 12974744.179042902, y: 4833983.66343434, }, { x: 12974848.457567113, y: 4834048.738895861, }, { x: 12975023.307596708, y: 4834158.038177878, }, { x: 12975344.80631824, y: 4834362.369596276, }, { x: 12975542.195598783, y: 4834485.718127945, }, { x: 12975589.153098417, y: 4834515.976788436, }, { x: 12975743.362999665, y: 4834615.341611351, }, { x: 12976018.28541726, y: 4834788.58647766, }, { x: 12976156.837017762, y: 4834874.4406398935, }, { x: 12976203.26410973, y: 4834903.209489788, }, { x: 12976425.749449603, y: 4835044.1395141035, }, { x: 12976682.803252261, y: 4835209.05760146, }, { x: 12977612.288689816, y: 4836078.591476348, }, { x: 12977703.538800083, y: 4836157.900805114, }, { x: 12977801.888863295, y: 4836235.662686368, }, { x: 12978758.33292605, y: 4837259.312987513, }, { x: 12978842.971959101, y: 4837349.736883194, }, { x: 12979531.54154612, y: 4838049.719256911, }, { x: 12979689.378903074, y: 4838256.735438744, }, { x: 12980051.853140548, y: 4838731.323685468, }, { x: 12980384.15998818, y: 4839120.990048823, }, { x: 12980467.93565266, y: 4839255.613023306, }, { x: 12980521.623321274, y: 4839397.296177998, }, { x: 12980529.827086125, y: 4839430.697709363, }, { x: 12980535.501366084, y: 4839564.805608976, }, { x: 12980538.135068312, y: 4840222.645451332, }, { x: 12980538.379641674, y: 4840283.5996034695, }, { x: 12980538.543424217, y: 4840324.221498785, }, { x: 12980535.067586645, y: 4840405.430398631, }, { x: 12980525.345959615, y: 4840470.937074263, }, { x: 12980513.995958695, y: 4840544.736949112, }, ], }, { id: "4", source: "8", target: "9", class: "地铁一号线", name: "地铁一号线 0", controlPoints: [ { x: 12969787.144385956, y: 4852662.477041108, }, { x: 12969236.284285808, y: 4852670.237943584, }, { x: 12968944.36629118, y: 4852676.464039239, }, { x: 12968472.728321342, y: 4852684.58530441, }, { x: 12968414.420578972, y: 4852687.842999674, }, { x: 12968235.54912727, y: 4852697.8323459625, }, { x: 12968069.523958666, y: 4852708.845800531, }, { x: 12967520.284252618, y: 4852709.247613191, }, { x: 12967117.366149856, y: 4852665.62205985, }, { x: 12966772.612022452, y: 4852628.17396013, }, { x: 12966517.096762186, y: 4852623.936320605, }, { x: 12966223.985369124, y: 4852617.830735498, }, { x: 12964521.542056274, y: 4852636.984637193, }, { x: 12964462.063732337, y: 4852637.63680008, }, { x: 12964380.646967553, y: 4852638.41249018, }, { x: 12964310.636384122, y: 4852638.548196548, }, { x: 12964259.391907305, y: 4852638.609292217, }, { x: 12964063.789477564, y: 4852640.250627404, }, { x: 12964002.433399238, y: 4852641.068996505, }, { x: 12963990.595935801, y: 4852641.261031478, }, { x: 12963890.25903454, y: 4852642.515969342, }, { x: 12963809.987625448, y: 4852643.546429879, }, { x: 12963781.834338633, y: 4852643.942282169, }, { x: 12963774.327120606, y: 4852643.970398907, }, { x: 12963455.081045607, y: 4852646.588025983, }, { x: 12963322.230220675, y: 4852647.784045951, }, { x: 12963223.166991241, y: 4852649.725733759, }, { x: 12963190.819152791, y: 4852650.417434513, }, { x: 12963127.561328052, y: 4852650.0517423265, }, { x: 12963039.607865393, y: 4852649.766256757, }, { x: 12962819.058636826, y: 4852651.358893755, }, { x: 12962593.866965737, y: 4852653.665194887, }, { x: 12962462.408622202, y: 4852654.791986625, }, { x: 12962183.756523842, y: 4852657.365475698, }, { x: 12962157.173752429, y: 4852659.766562548, }, { x: 12961924.104038442, y: 4852660.11712501, }, { x: 12961924.059855, y: 4852660.116942157, }, { x: 12961900.696391538, y: 4852660.033076115, }, { x: 12961567.092653673, y: 4852663.388779601, }, { x: 12961454.569802668, y: 4852664.505495348, }, { x: 12961217.079500727, y: 4852658.515584384, }, { x: 12961149.13715287, y: 4852657.212458487, }, { x: 12961133.237071244, y: 4852657.247371087, }, { x: 12961027.846655574, y: 4852654.2780048065, }, { x: 12960863.900760658, y: 4852649.966801163, }, { x: 12960818.644700909, y: 4852648.896293183, }, { x: 12960637.184863163, y: 4852644.743311257, }, { x: 12960624.025816733, y: 4852644.477645673, }, { x: 12960602.480219977, y: 4852643.937047354, }, { x: 12960506.031680021, y: 4852641.9318091385, }, { x: 12960391.353551494, y: 4852639.083787939, }, { x: 12960320.201913092, y: 4852637.313773441, }, { x: 12960062.18095632, y: 4852628.1362550985, }, { x: 12959904.438548937, y: 4852627.023597047, }, { x: 12959595.684288755, y: 4852619.8846618915, }, { x: 12959323.178066703, y: 4852609.481755874, }, { x: 12958840.802221617, y: 4852590.942915122, }, { x: 12957502.352622895, y: 4852528.684166141, }, { x: 12956620.835296787, y: 4852504.508925668, }, { x: 12955674.942021938, y: 4852471.61015628, }, { x: 12955416.308852747, y: 4852469.018503432, }, { x: 12954706.035138829, y: 4852461.803325078, }, { x: 12953928.716739, y: 4852464.489858927, }, { x: 12952788.83672684, y: 4852466.54282573, }, { x: 12952748.81253644, y: 4852466.605133841, }, { x: 12951563.203060223, y: 4852477.671537925, }, { x: 12951199.751181506, y: 4852495.122833292, }, { x: 12950198.141508736, y: 4852495.025451202, }, { x: 12949965.299984097, y: 4852495.077305805, }, { x: 12949129.26242653, y: 4852504.598358415, }, { x: 12947838.444126923, y: 4852505.90698292, }, { x: 12947589.306786017, y: 4852505.320736883, }, { x: 12945901.390879856, y: 4852501.577557874, }, { x: 12944980.974916212, y: 4852499.625168126, }, { x: 12943548.12132782, y: 4852497.380847655, }, { x: 12942376.001682293, y: 4852500.03430738, }, { x: 12941203.789519304, y: 4852502.985840143, }, { x: 12939774.001753055, y: 4852500.299665425, }, { x: 12938324.854233196, y: 4852497.834034189, }, { x: 12938281.788912078, y: 4852497.828983922, }, { x: 12938058.817138307, y: 4852497.810737135, }, { x: 12937898.86276059, y: 4852497.3685845565, }, { x: 12937671.875809424, y: 4852496.791572168, }, { x: 12937460.220387606, y: 4852497.967734828, }, { x: 12937174.041187, y: 4852498.731022245, }, { x: 12937173.96999806, y: 4852498.730233027, }, { x: 12937136.194604035, y: 4852498.300376261, }, { x: 12936946.821682766, y: 4852498.918736944, }, { x: 12936849.614381388, y: 4852498.356186343, }, { x: 12936692.322356569, y: 4852497.959326306, }, { x: 12936587.17645106, y: 4852498.5677669365, }, { x: 12934252.339824114, y: 4852499.457888381, }, { x: 12934092.666854141, y: 4852498.783005591, }, { x: 12933957.2920676, y: 4852554.157396755, }, { x: 12933867.245068891, y: 4852636.768727248, }, { x: 12933790.29537299, y: 4852771.049393255, }, { x: 12933709.54499776, y: 4852986.243814959, }, { x: 12933275.354659256, y: 4854146.7353322515, }, ], }, { id: "5", source: "10", target: "11", class: "地铁大兴线", name: "地铁大兴线 0", controlPoints: [ { x: 12954320.097829182, y: 4841755.370768595, }, { x: 12954269.565863218, y: 4841475.231416884, }, { x: 12954109.467427691, y: 4840587.804965775, }, { x: 12953795.666789988, y: 4838847.936111765, }, { x: 12953779.74076359, y: 4838781.406112334, }, { x: 12953764.911988458, y: 4838735.372116771, }, { x: 12953728.040718146, y: 4838684.612972186, }, { x: 12953200.942060454, y: 4837849.787883376, }, { x: 12953071.02731984, y: 4837651.869209399, }, { x: 12952979.616992796, y: 4837589.00545091, }, { x: 12952903.159508042, y: 4837579.42379109, }, { x: 12952782.211602798, y: 4837577.388802782, }, { x: 12952678.006507806, y: 4837568.850794091, }, { x: 12952630.246652557, y: 4837568.346663251, }, { x: 12952563.144880537, y: 4837569.3784104185, }, { x: 12952459.727695232, y: 4837576.654353493, }, { x: 12952047.259057738, y: 4837602.473680529, }, { x: 12951992.11263072, y: 4837607.014363404, }, { x: 12951930.600837775, y: 4837607.287158209, }, { x: 12951859.333033504, y: 4837604.988006545, }, { x: 12951659.950799704, y: 4837590.463923004, }, { x: 12951511.86811374, y: 4837581.708907432, }, { x: 12951503.592170091, y: 4837581.306936129, }, { x: 12951471.758692794, y: 4837579.760443551, }, { x: 12951416.434195919, y: 4837581.464508876, }, { x: 12951320.836636368, y: 4837591.26673181, }, { x: 12951208.471245904, y: 4837608.1171654025, }, { x: 12951130.332944639, y: 4837620.206020496, }, { x: 12951053.162266875, y: 4837624.532130631, }, { x: 12950994.073467728, y: 4837620.818036712, }, { x: 12950952.099045333, y: 4837614.236065724, }, { x: 12950903.02068405, y: 4837603.431351229, }, { x: 12950854.265358152, y: 4837586.804646552, }, { x: 12950803.897617934, y: 4837565.966975064, }, { x: 12950750.622557428, y: 4837538.00750994, }, { x: 12950713.171179097, y: 4837512.0295137195, }, { x: 12950613.406373397, y: 4837431.864322759, }, { x: 12950473.803516785, y: 4837318.037136518, }, { x: 12950224.739204535, y: 4837111.815739738, }, { x: 12949781.71624435, y: 4836761.283068602, }, { x: 12949728.565575039, y: 4836716.7570553925, }, { x: 12949703.653419532, y: 4836690.060944494, }, { x: 12949670.437469736, y: 4836646.1427171705, }, { x: 12949640.546313735, y: 4836599.462744173, }, { x: 12949602.355321119, y: 4836518.919640969, }, { x: 12949581.32899617, y: 4836447.855053628, }, { x: 12949571.933781365, y: 4836366.283691224, }, { x: 12949570.99564922, y: 4836297.018513739, }, { x: 12949583.773060184, y: 4836131.096596216, }, { x: 12949630.95790481, y: 4835587.242148269, }, { x: 12949644.605106963, y: 4835427.978435933, }, { x: 12949674.069930378, y: 4835084.076939791, }, { x: 12949741.123785608, y: 4834412.860058607, }, { x: 12949881.255387962, y: 4833114.597124276, }, { x: 12949988.167188657, y: 4831634.321648644, }, { x: 12950011.8904392, y: 4831024.642033773, }, { x: 12950045.949834898, y: 4830169.250105037, }, { x: 12950067.86965607, y: 4829187.531131907, }, { x: 12950068.411119526, y: 4828643.488667632, }, { x: 12950089.439076275, y: 4827012.598861079, }, { x: 12950075.332266735, y: 4825735.265538567, }, { x: 12950077.6177772, y: 4825610.926281617, }, { x: 12950063.743562018, y: 4825551.423688702, }, { x: 12949886.484341538, y: 4825355.5838901615, }, { x: 12949714.24435096, y: 4825240.542840744, }, { x: 12948810.72447873, y: 4824919.1962220995, }, { x: 12948630.372620959, y: 4824779.957329413, }, { x: 12948551.763527192, y: 4824562.001534207, }, { x: 12948571.333401924, y: 4824233.799839876, }, { x: 12948851.677430334, y: 4820591.681083957, }, { x: 12948856.025176648, y: 4820535.340838382, }, { x: 12948857.519128771, y: 4820485.531178259, }, ], }, { id: "6", source: "12", target: "13", class: "地铁四号线", name: "地铁四号线 0", controlPoints: [ { x: 12954373.657756021, y: 4843560.934009259, }, { x: 12954403.308395952, y: 4844637.092136642, }, { x: 12954443.631939387, y: 4845049.84687948, }, { x: 12954465.385927541, y: 4845230.316998346, }, { x: 12954477.104733607, y: 4845295.713890768, }, { x: 12954510.159202749, y: 4845363.4843960125, }, { x: 12954722.716019211, y: 4845628.35857464, }, { x: 12954922.594454948, y: 4845874.895440882, }, { x: 12955211.028271338, y: 4846209.062552702, }, { x: 12955269.78815066, y: 4846334.5600019405, }, { x: 12955267.306704495, y: 4846529.094981971, }, { x: 12955200.99362026, y: 4846713.313157282, }, { x: 12955050.45468214, y: 4846989.573067081, }, { x: 12954853.97442472, y: 4847378.402945743, }, { x: 12954774.906886864, y: 4847675.2444390515, }, { x: 12954731.85449024, y: 4848212.883938044, }, { x: 12954744.79924884, y: 4848786.391306657, }, { x: 12954747.612023802, y: 4849835.643590178, }, { x: 12954747.682216099, y: 4849861.774043528, }, { x: 12954741.08816034, y: 4850881.230635524, }, { x: 12954737.645653786, y: 4851386.201206222, }, { x: 12954721.760149185, y: 4851926.74810973, }, { x: 12954706.035138829, y: 4852461.803325078, }, { x: 12954661.27452527, y: 4853769.120768002, }, { x: 12954633.49377667, y: 4854880.847809376, }, { x: 12954587.535533391, y: 4856278.18149549, }, { x: 12954557.952698175, y: 4857155.485744631, }, { x: 12954557.437163154, y: 4857170.770202318, }, { x: 12954537.64640468, y: 4857234.798733779, }, { x: 12954507.61800925, y: 4857265.498611502, }, { x: 12954448.18840873, y: 4857290.387739614, }, { x: 12954389.022163786, y: 4857304.787614773, }, { x: 12954302.10618948, y: 4857314.253741188, }, { x: 12954046.446788153, y: 4857314.448443049, }, { x: 12952788.718781503, y: 4857298.136733208, }, { x: 12952635.915840019, y: 4857296.152572144, }, { x: 12952564.595755607, y: 4857295.107641618, }, { x: 12952364.409316596, y: 4857273.12227582, }, { x: 12952154.040871462, y: 4857235.468350076, }, { x: 12951969.43909615, y: 4857201.456667664, }, { x: 12951808.104168849, y: 4857155.825128381, }, { x: 12951795.707910977, y: 4857150.112186163, }, { x: 12951672.542241815, y: 4857093.348351254, }, { x: 12951530.459501661, y: 4857032.392475653, }, { x: 12951457.165035697, y: 4857016.611367204, }, { x: 12951413.82925054, y: 4857010.241801462, }, { x: 12951362.398381047, y: 4857007.948880891, }, { x: 12951289.260741765, y: 4857006.283719927, }, { x: 12951243.494159421, y: 4857003.966436169, }, { x: 12951198.613096055, y: 4857003.604147996, }, { x: 12951191.52223199, y: 4857003.216630181, }, { x: 12951176.410532618, y: 4857002.724713779, }, { x: 12950664.103792224, y: 4856969.636138788, }, { x: 12950490.915616779, y: 4856960.604637075, }, { x: 12950376.449417142, y: 4856957.730451393, }, { x: 12950275.412423559, y: 4856958.095432962, }, { x: 12950197.754097624, y: 4856965.795888429, }, { x: 12950087.769172028, y: 4856976.7011729805, }, { x: 12949969.030407438, y: 4856988.731925641, }, { x: 12949611.385620916, y: 4857033.614270364, }, { x: 12949433.088418497, y: 4857064.900798794, }, { x: 12949359.045249254, y: 4857097.992433988, }, { x: 12949324.284422386, y: 4857141.787668212, }, { x: 12949323.829516204, y: 4857143.221560914, }, { x: 12949294.040752294, y: 4857237.088716105, }, { x: 12949290.965819698, y: 4857281.5241520675, }, { x: 12949290.844836328, y: 4857284.326685918, }, { x: 12949286.84859171, y: 4857363.3786635455, }, { x: 12949255.74271649, y: 4857669.774620552, }, { x: 12949251.021282567, y: 4857716.034187529, }, { x: 12949240.534414742, y: 4857818.781418282, }, { x: 12949229.599655101, y: 4857925.935052169, }, { x: 12949223.285025857, y: 4857987.8014169345, }, { x: 12949218.68930698, y: 4858032.839792737, }, { x: 12949202.705857255, y: 4858189.081518219, }, { x: 12949201.91675542, y: 4858197.081514944, }, { x: 12949188.720634252, y: 4858325.005565848, }, { x: 12949171.484932527, y: 4858492.101118972, }, { x: 12949140.242605533, y: 4858794.965387163, }, { x: 12949128.462758997, y: 4858908.105794337, }, { x: 12949119.684607878, y: 4858997.242106079, }, { x: 12949117.630120248, y: 4859021.712509141, }, { x: 12949113.161648553, y: 4859077.167116614, }, { x: 12949110.991163222, y: 4859101.470621213, }, { x: 12949110.099969309, y: 4859112.821822983, }, { x: 12949108.911677599, y: 4859127.083425599, }, { x: 12949101.505333235, y: 4859206.231246072, }, { x: 12949098.141760852, y: 4859235.087958121, }, { x: 12949086.945661454, y: 4859330.204405712, }, { x: 12949080.506525062, y: 4859390.090037273, }, { x: 12949072.760807924, y: 4859454.574381684, }, { x: 12949053.421043288, y: 4859613.1813176535, }, { x: 12949006.291508188, y: 4860099.103019413, }, { x: 12948987.273876615, y: 4860281.083185734, }, { x: 12948981.095505225, y: 4860340.214580902, }, { x: 12948971.386815451, y: 4860438.818238612, }, { x: 12948968.790673513, y: 4860465.186182631, }, { x: 12948957.099444743, y: 4860583.923590711, }, { x: 12948954.944696926, y: 4860602.30153119, }, { x: 12948953.629329322, y: 4860611.371156355, }, { x: 12948945.376137566, y: 4860665.772419023, }, { x: 12948943.371389516, y: 4860677.809759844, }, { x: 12948941.428640455, y: 4860688.287999877, }, { x: 12948940.027077485, y: 4860695.8687290335, }, { x: 12948933.979640268, y: 4860726.099657515, }, { x: 12948928.21129958, y: 4860754.943783897, }, { x: 12948925.53477491, y: 4860767.8741438445, }, { x: 12948914.390798561, y: 4860816.020402436, }, { x: 12948908.818966143, y: 4860838.981437038, }, { x: 12948891.21272109, y: 4860906.962985634, }, { x: 12948891.084425297, y: 4860907.371989038, }, { x: 12948849.368497113, y: 4861042.125295077, }, { x: 12948835.90431828, y: 4861088.737227414, }, { x: 12948830.296142103, y: 4861108.420813816, }, { x: 12948822.04407856, y: 4861138.651794888, }, { x: 12948813.499036651, y: 4861166.617294492, }, { x: 12948805.08019881, y: 4861193.008798196, }, { x: 12948779.113573417, y: 4861277.779889043, }, { x: 12948764.04589559, y: 4861326.974101848, }, { x: 12948764.026496535, y: 4861327.037202654, }, { x: 12948753.359326178, y: 4861360.815953497, }, { x: 12948743.747416658, y: 4861389.941771785, }, { x: 12948718.178381432, y: 4861470.921841358, }, { x: 12948696.13872888, y: 4861543.199816692, }, { x: 12948691.345809, y: 4861558.918058851, }, { x: 12948670.805545585, y: 4861626.292230624, }, { x: 12948635.660998613, y: 4861741.800393923, }, { x: 12948620.137949644, y: 4861792.813013884, }, { x: 12948586.362157172, y: 4861900.900528574, }, { x: 12948570.146171637, y: 4861955.959000696, }, { x: 12948553.55913321, y: 4862007.46980901, }, { x: 12948506.607909067, y: 4862151.020102147, }, { x: 12948474.477154713, y: 4862249.710439044, }, { x: 12948433.854782313, y: 4862372.508539395, }, { x: 12948405.896567902, y: 4862457.026555028, }, { x: 12948387.467864858, y: 4862540.95750102, }, { x: 12948369.72084694, y: 4862608.589042327, }, { x: 12948351.287448928, y: 4862705.352991365, }, { x: 12948349.399856329, y: 4862717.969572795, }, { x: 12948342.9554688, y: 4862761.161096935, }, { x: 12948334.103059907, y: 4862815.789967469, }, { x: 12948330.745336216, y: 4862847.533998459, }, { x: 12948330.324781813, y: 4862857.667238568, }, { x: 12948330.719618713, y: 4862923.321583864, }, { x: 12948329.271456743, y: 4863030.035711758, }, { x: 12948318.983617261, y: 4863152.700650098, }, { x: 12948308.624791207, y: 4863323.528821448, }, { x: 12948305.573238118, y: 4863383.023344128, }, { x: 12948304.882713268, y: 4863410.205718649, }, { x: 12948304.34907461, y: 4863418.883075538, }, { x: 12948304.349074604, y: 4863418.883175537, }, { x: 12948293.57852302, y: 4863594.090943488, }, { x: 12948292.26537664, y: 4863615.222388438, }, { x: 12948285.911429897, y: 4863694.78289179, }, { x: 12948279.888862576, y: 4863721.625153882, }, { x: 12948276.328498306, y: 4863738.652548549, }, { x: 12948273.0212985, y: 4863779.761424982, }, { x: 12948271.391195413, y: 4863804.060012918, }, { x: 12948269.44583099, y: 4863833.063038297, }, { x: 12948268.544436276, y: 4863862.57964908, }, { x: 12948264.951457486, y: 4863980.229798113, }, { x: 12948262.743327497, y: 4864012.842760259, }, { x: 12948253.95970473, y: 4864163.393230665, }, { x: 12948251.540303396, y: 4864206.470731608, }, { x: 12948212.079753308, y: 4864794.335183325, }, { x: 12948192.775449837, y: 4865057.815886522, }, { x: 12948172.296877252, y: 4865301.5112607, }, { x: 12948164.786289226, y: 4865392.804538419, }, { x: 12948154.255917, y: 4865512.14757284, }, { x: 12948154.255917, y: 4865512.1477728365, }, { x: 12948149.74303433, y: 4865560.011840421, }, { x: 12948144.366829144, y: 4865612.142398512, }, { x: 12948143.959623424, y: 4865618.525997311, }, { x: 12948137.439734928, y: 4865720.508486359, }, { x: 12948107.519605923, y: 4865814.2291544955, }, { x: 12948078.069647746, y: 4865856.462480031, }, { x: 12948024.306038419, y: 4865884.525941556, }, { x: 12947948.793208137, y: 4865895.857790665, }, { x: 12947726.110412342, y: 4865901.65407643, }, { x: 12947662.03325602, y: 4865903.549335554, }, { x: 12947582.728775566, y: 4865884.474219018, }, { x: 12947578.428732935, y: 4865883.43990478, }, { x: 12947516.084078891, y: 4865861.968135664, }, { x: 12947457.991019811, y: 4865841.929292836, }, { x: 12947430.320338927, y: 4865825.17744688, }, { x: 12947403.34891173, y: 4865801.908641243, }, { x: 12947385.583410634, y: 4865783.125515066, }, { x: 12947366.462947419, y: 4865758.28002787, }, { x: 12947349.636991477, y: 4865736.761035594, }, { x: 12947325.434427919, y: 4865705.9521581745, }, { x: 12947293.294439247, y: 4865662.223273893, }, { x: 12947280.026460873, y: 4865645.503535422, }, { x: 12947272.790190758, y: 4865637.152186299, }, { x: 12947264.45234974, y: 4865630.50206878, }, { x: 12947253.895662466, y: 4865622.890310138, }, { x: 12947242.3961359, y: 4865615.799413275, }, { x: 12947228.023148427, y: 4865608.898160762, }, { x: 12947219.081559768, y: 4865605.561492597, }, { x: 12947209.673061684, y: 4865603.139115063, }, { x: 12947199.896463385, y: 4865601.658737004, }, { x: 12947170.376100887, y: 4865598.241728645, }, { x: 12947114.262342412, y: 4865594.002744353, }, { x: 12947069.303568143, y: 4865590.097302363, }, { x: 12946996.955287198, y: 4865580.432522639, }, { x: 12946941.228131976, y: 4865573.255125918, }, { x: 12946900.084918642, y: 4865569.517658332, }, { x: 12946822.761463061, y: 4865560.673446433, }, { x: 12946727.614742137, y: 4865552.84563637, }, { x: 12946678.905013254, y: 4865548.119018174, }, { x: 12946642.17997207, y: 4865544.956115833, }, { x: 12946584.893309405, y: 4865543.859270443, }, { x: 12946544.506879704, y: 4865545.213818521, }, { x: 12946501.165103968, y: 4865545.26638306, }, { x: 12946422.048745677, y: 4865542.2614939865, }, { x: 12946366.591065088, y: 4865538.478497777, }, { x: 12946343.54274385, y: 4865536.796393288, }, { x: 12946313.331102742, y: 4865534.072102609, }, { x: 12946276.992936801, y: 4865530.295722415, }, { x: 12946044.983768271, y: 4865506.53848812, }, { x: 12946044.982468616, y: 4865506.538388461, }, { x: 12945999.054564236, y: 4865501.51634233, }, { x: 12945939.11875475, y: 4865501.919490546, }, { x: 12945842.188083762, y: 4865505.838142619, }, { x: 12945841.360324211, y: 4865506.238193714, }, { x: 12945718.088826543, y: 4865565.803399573, }, { x: 12945361.171856038, y: 4865725.241244186, }, { x: 12945288.888034362, y: 4865771.876347319, }, { x: 12944971.787632536, y: 4865960.501491743, }, { x: 12944694.050529143, y: 4866125.748562615, }, { x: 12944571.275779925, y: 4866175.496896087, }, { x: 12944486.984637886, y: 4866196.026940467, }, { x: 12944376.91914833, y: 4866212.279980763, }, { x: 12943875.491423381, y: 4866303.184805465, }, { x: 12943715.625648474, y: 4866329.140561554, }, { x: 12943691.286623739, y: 4866336.782693048, }, { x: 12943666.684753045, y: 4866355.700580207, }, { x: 12943647.036226608, y: 4866386.77867161, }, { x: 12943618.683377, y: 4866431.5171539625, }, { x: 12943575.591938026, y: 4866503.065200196, }, { x: 12943549.272841655, y: 4866548.372445914, }, { x: 12943513.655516205, y: 4866606.664160266, }, { x: 12943464.443157, y: 4866692.552688016, }, { x: 12943362.33352031, y: 4866844.144888357, }, { x: 12943298.332087196, y: 4866965.865469642, }, { x: 12943194.660765983, y: 4867152.9265388595, }, { x: 12943140.884084987, y: 4867273.386822292, }, { x: 12943114.423065275, y: 4867594.932334096, }, { x: 12943113.763426922, y: 4867602.948598135, }, { x: 12943108.181515867, y: 4867757.799791251, }, ], }, { id: "7", source: "14", target: "15", class: "地铁六号线", name: "地铁六号线 0", controlPoints: [ { x: 12944329.792132245, y: 4856125.732393313, }, { x: 12944374.963417206, y: 4856132.075934602, }, { x: 12944438.830775484, y: 4856136.896376604, }, { x: 12944515.16641718, y: 4856137.056480541, }, { x: 12944577.483953971, y: 4856135.625803216, }, { x: 12944642.924413817, y: 4856126.389908644, }, { x: 12944711.48482392, y: 4856114.036716937, }, { x: 12944790.955263415, y: 4856098.58349056, }, { x: 12944854.842780758, y: 4856089.348004857, }, { x: 12944925.484679118, y: 4856086.034136885, }, { x: 12944964.41973033, y: 4856083.331773158, }, { x: 12944978.393002376, y: 4856082.950699846, }, { x: 12945058.975743152, y: 4856080.754937213, }, { x: 12945281.461997462, y: 4856092.418480259, }, { x: 12945643.041754864, y: 4856110.003093847, }, { x: 12945784.907202916, y: 4856113.134308052, }, { x: 12946578.056629626, y: 4856112.4447421245, }, { x: 12947587.39674028, y: 4856115.133251456, }, { x: 12947613.274919279, y: 4856115.203954564, }, { x: 12948409.558918482, y: 4856120.2980670845, }, { x: 12950197.88091994, y: 4856127.655709365, }, { x: 12950522.56167453, y: 4856128.972474555, }, { x: 12952789.177160164, y: 4856124.15803456, }, { x: 12953464.615126304, y: 4856122.0006891955, }, { x: 12954530.376567366, y: 4856151.814350079, }, { x: 12955417.241989752, y: 4856201.3555319505, }, { x: 12956068.761834681, y: 4856237.46303956, }, { x: 12956833.347700687, y: 4856274.21357933, }, { x: 12958297.780383743, y: 4856277.010194032, }, { x: 12958569.623250166, y: 4856268.920119228, }, { x: 12958601.133725567, y: 4855382.984479329, }, { x: 12958611.676282825, y: 4855232.673994465, }, { x: 12958632.866942339, y: 4855139.665765479, }, { x: 12958688.973578054, y: 4855045.110782978, }, { x: 12958728.4139951, y: 4855000.874038989, }, { x: 12958770.892719645, y: 4854961.207780969, }, { x: 12958799.677543039, y: 4854945.921102297, }, { x: 12959324.962061018, y: 4854945.451113535, }, { x: 12959585.872160498, y: 4854945.153439757, }, { x: 12961042.442201044, y: 4854962.677000188, }, { x: 12961432.109595038, y: 4854972.467899889, }, { x: 12961926.386577822, y: 4854934.294285994, }, { x: 12962148.74759053, y: 4854917.131482158, }, { x: 12962283.599321207, y: 4854895.403863202, }, { x: 12962563.81989391, y: 4854825.953182589, }, { x: 12962930.401073314, y: 4854769.91200932, }, { x: 12963190.916752387, y: 4854738.551506216, }, { x: 12964441.84613731, y: 4854799.404628956, }, { x: 12964524.312877567, y: 4854798.896359394, }, { x: 12965180.991672397, y: 4854794.927301339, }, { x: 12965609.29152333, y: 4854782.320431698, }, { x: 12965890.746902762, y: 4854765.761862335, }, { x: 12966166.126872526, y: 4854749.201512711, }, { x: 12966285.65860789, y: 4854745.572490727, }, { x: 12966514.13404955, y: 4854747.498023047, }, { x: 12967120.576418092, y: 4854750.252015507, }, { x: 12968417.872233221, y: 4854755.563269503, }, { x: 12968618.637517042, y: 4854756.352373138, }, { x: 12969113.28223611, y: 4854778.000756352, }, { x: 12969684.88717921, y: 4854779.300801552, }, { x: 12970067.575502042, y: 4854781.712135722, }, { x: 12970534.989097549, y: 4854786.685865359, }, { x: 12970699.884643015, y: 4854793.3733178545, }, { x: 12970823.931856325, y: 4854795.719200881, }, { x: 12970982.830224, y: 4854826.832892539, }, { x: 12971113.005257478, y: 4854865.732206641, }, { x: 12971202.287273336, y: 4854878.94766238, }, { x: 12971370.206297623, y: 4854874.950868926, }, { x: 12972309.189289698, y: 4854855.496835954, }, { x: 12973018.812017871, y: 4854841.117131226, }, { x: 12973547.047963066, y: 4854830.666734374, }, { x: 12974064.854700932, y: 4854852.350465733, }, { x: 12974472.82455872, y: 4854876.455052272, }, { x: 12975051.371356072, y: 4854904.052996347, }, { x: 12975605.826026462, y: 4854907.507188204, }, { x: 12975778.549655946, y: 4854906.705688043, }, { x: 12976205.686714906, y: 4854908.883752931, }, { x: 12977221.096053148, y: 4854914.252570144, }, { x: 12977364.010499585, y: 4854929.9394761175, }, { x: 12977849.475332348, y: 4854987.676906845, }, { x: 12978108.4311247, y: 4855013.81299573, }, { x: 12978521.22706543, y: 4855058.406105899, }, { x: 12980109.377856214, y: 4855165.781190299, }, { x: 12980283.977902222, y: 4855177.638637634, }, { x: 12980489.227525037, y: 4855187.924099469, }, { x: 12980583.71991004, y: 4855179.543517038, }, { x: 12980688.925014246, y: 4855138.6160322325, }, { x: 12980767.103468414, y: 4855089.631526497, }, { x: 12980869.512862012, y: 4855013.486901767, }, { x: 12981090.661572816, y: 4854899.114190809, }, { x: 12981198.816266755, y: 4854879.956045967, }, { x: 12981320.40982718, y: 4854890.50993648, }, { x: 12982163.741886314, y: 4855124.274679628, }, ], }, { id: "8", source: "16", target: "17", class: "地铁九号线", name: "地铁九号线 0", controlPoints: [ { x: 12946648.06073432, y: 4839260.025729084, }, { x: 12946544.074465087, y: 4839619.202216059, }, { x: 12946445.496254807, y: 4839771.777087536, }, { x: 12946363.495286731, y: 4839808.518510458, }, { x: 12946292.702186562, y: 4839843.812617867, }, { x: 12946221.884510016, y: 4839925.221959326, }, { x: 12946200.062497655, y: 4839988.63678963, }, { x: 12946126.464738874, y: 4840577.558530562, }, { x: 12946154.121327115, y: 4841454.65715364, }, { x: 12946159.216413628, y: 4841615.166540137, }, { x: 12946163.133984758, y: 4841750.3172009885, }, { x: 12946166.16397019, y: 4841854.414496068, }, { x: 12946134.718988903, y: 4842145.305047408, }, { x: 12946011.482648093, y: 4842839.443615038, }, { x: 12945967.3702783, y: 4843175.101744513, }, { x: 12945875.098454604, y: 4843833.607067226, }, { x: 12945815.866086949, y: 4844216.664802826, }, { x: 12945773.952396747, y: 4844701.295741741, }, { x: 12945762.960414361, y: 4844884.183169307, }, { x: 12945811.645641796, y: 4846485.73907944, }, { x: 12945821.760873735, y: 4846713.698002954, }, { x: 12945850.240499485, y: 4847377.283903233, }, { x: 12945860.277378498, y: 4847457.126713241, }, { x: 12945889.251105716, y: 4847545.70699325, }, { x: 12946012.904132249, y: 4847683.799611397, }, { x: 12946527.681154523, y: 4848401.627416125, }, { x: 12946550.388778795, y: 4848450.652934715, }, { x: 12946578.885636054, y: 4848483.879589509, }, { x: 12946614.230164707, y: 4848509.121830013, }, { x: 12946687.204717232, y: 4848555.03996301, }, { x: 12946714.570161361, y: 4848573.402833471, }, { x: 12946927.965178315, y: 4848771.050237301, }, { x: 12947039.251749933, y: 4848874.121019451, }, { x: 12947590.671676153, y: 4849210.0301651545, }, { x: 12947894.176283287, y: 4849394.908355361, }, { x: 12948001.161563184, y: 4849454.528594686, }, { x: 12948726.115618171, y: 4849833.574366419, }, { x: 12948780.697656307, y: 4849859.709410215, }, { x: 12948804.10908822, y: 4849909.061453937, }, { x: 12948808.591585146, y: 4849968.572800762, }, { x: 12948813.15515829, y: 4850598.421530288, }, { x: 12949122.850263117, y: 4852505.623073113, }, { x: 12949328.200350346, y: 4854831.558034923, }, { x: 12949353.269647257, y: 4856109.000245334, }, { x: 12949291.632125383, y: 4857143.131243851, }, ], }, { id: "9", source: "18", target: "19", class: "地铁八号线", name: "地铁八号线 0", controlPoints: [ { x: 12957190.97175418, y: 4856829.187045242, }, { x: 12957268.3578042, y: 4856387.328711017, }, { x: 12957289.353013203, y: 4856359.317449307, }, { x: 12957331.343025276, y: 4856327.797491008, }, { x: 12957376.831138888, y: 4856317.277947678, }, { x: 12957891.704380175, y: 4856296.418069313, }, ], }, { id: "10", source: "20", target: "21", class: "地铁昌平线", name: "地铁昌平线 0", controlPoints: [ { x: 12947094.115985483, y: 4873731.336740117, }, { x: 12947072.54413634, y: 4873784.735931892, }, { x: 12947042.017514793, y: 4873859.579611177, }, { x: 12946995.4508778, y: 4873970.753583026, }, { x: 12946943.109137688, y: 4874095.283923113, }, { x: 12946899.787751423, y: 4874206.107863865, }, { x: 12946881.01472949, y: 4874253.759727108, }, { x: 12946789.68802783, y: 4874467.089710582, }, { x: 12946751.78362451, y: 4874555.5292996485, }, { x: 12946700.523958035, y: 4874674.650758464, }, { x: 12946655.766671386, y: 4874767.410641011, }, { x: 12946571.364045683, y: 4874925.748577232, }, { x: 12946510.5646055, y: 4875031.897509199, }, { x: 12946472.444944305, y: 4875099.449536901, }, { x: 12946378.125857558, y: 4875270.873813889, }, { x: 12946315.432537835, y: 4875442.5781064425, }, { x: 12945987.019381497, y: 4876429.405849195, }, { x: 12945494.324537683, y: 4877247.425781118, }, { x: 12945212.872442825, y: 4877783.708641315, }, { x: 12944881.49739096, y: 4878774.737871047, }, { x: 12944906.896743502, y: 4879158.180641696, }, { x: 12945532.959607262, y: 4879647.417083359, }, { x: 12946150.468651066, y: 4879791.647184245, }, { x: 12946905.53928399, y: 4879921.626008038, }, { x: 12947757.621608311, y: 4880143.70392179, }, { x: 12948030.412870025, y: 4880398.632118471, }, { x: 12948052.616659699, y: 4880692.773681223, }, { x: 12947846.20854383, y: 4881514.465746558, }, { x: 12947597.065183768, y: 4882366.221916524, }, { x: 12947351.139175126, y: 4883370.132124624, }, { x: 12947176.67206149, y: 4883933.272704212, }, { x: 12946774.041093351, y: 4884211.771737467, }, { x: 12946459.054291379, y: 4884228.537864571, }, { x: 12945934.213743346, y: 4884401.946771053, }, { x: 12945765.765805947, y: 4884775.110386402, }, { x: 12945765.322226081, y: 4884788.004333703, }, { x: 12945769.507831955, y: 4885435.210764532, }, { x: 12945706.715861775, y: 4886123.159872877, }, { x: 12945619.689717943, y: 4886769.72363822, }, { x: 12945442.673617564, y: 4887206.479468694, }, { x: 12945265.150235325, y: 4887443.841590078, }, { x: 12944956.967706354, y: 4887910.572665611, }, { x: 12944764.2703165, y: 4888414.954761419, }, { x: 12944490.393851373, y: 4889211.049688148, }, { x: 12944158.000725761, y: 4890227.3009047955, }, { x: 12943939.50054619, y: 4890938.589379339, }, { x: 12943741.193033013, y: 4891765.333179633, }, { x: 12943523.89343197, y: 4892817.059629789, }, { x: 12943477.185800951, y: 4893223.648609116, }, { x: 12943632.832055906, y: 4893581.194364219, }, { x: 12944230.352351204, y: 4893813.015893581, }, { x: 12944907.808217492, y: 4894017.717405242, }, { x: 12945120.621122792, y: 4894152.507246883, }, { x: 12945341.919177428, y: 4894481.916219006, }, ], }, { id: "11", source: "22", target: "23", class: "地铁八通线", name: "地铁八通线 0", controlPoints: [ { x: 12970985.252146643, y: 4852637.932500459, }, { x: 12971008.063154463, y: 4852637.603850775, }, { x: 12971057.7816163, y: 4852638.1331448015, }, { x: 12971134.73710355, y: 4852640.9154947065, }, { x: 12971179.237531189, y: 4852645.416718783, }, { x: 12971201.570727265, y: 4852648.649302951, }, { x: 12971249.17801756, y: 4852658.196621391, }, { x: 12971255.746157914, y: 4852659.512994105, }, { x: 12971346.991565293, y: 4852680.378101265, }, { x: 12971465.503559206, y: 4852715.45222975, }, { x: 12971556.44305453, y: 4852739.194460047, }, { x: 12971603.653185746, y: 4852750.417086441, }, { x: 12971652.445129333, y: 4852760.353265841, }, { x: 12971690.783407204, y: 4852768.115819445, }, { x: 12971748.39988629, y: 4852774.830285477, }, { x: 12971832.350691043, y: 4852785.209187933, }, { x: 12971909.010570884, y: 4852791.801163421, }, { x: 12971924.359283764, y: 4852792.523685262, }, { x: 12971999.921089781, y: 4852796.079471216, }, { x: 12972107.290890923, y: 4852793.567220141, }, { x: 12972304.93984065, y: 4852791.354142118, }, { x: 12972304.939940628, y: 4852791.354142104, }, { x: 12972558.358169641, y: 4852786.198665246, }, { x: 12972686.068063304, y: 4852781.700119552, }, { x: 12972843.240578711, y: 4852778.233391634, }, { x: 12972922.890764125, y: 4852776.13617569, }, { x: 12973043.782765854, y: 4852773.582308092, }, { x: 12973160.438646115, y: 4852771.291533754, }, { x: 12973301.369215274, y: 4852766.977022844, }, { x: 12973376.555572206, y: 4852766.575507644, }, { x: 12973483.79407899, y: 4852764.105804903, }, { x: 12973602.57893526, y: 4852764.972085765, }, { x: 12973986.241797326, y: 4852757.068452248, }, { x: 12974216.115580516, y: 4852753.700414064, }, { x: 12974536.719347281, y: 4852751.372519053, }, { x: 12974901.466203645, y: 4852758.063962363, }, { x: 12974983.483695555, y: 4852759.700171818, }, { x: 12975075.477382166, y: 4852761.366109267, }, { x: 12975146.21345055, y: 4852762.740995125, }, { x: 12975252.652350875, y: 4852765.001749013, }, { x: 12975418.029274665, y: 4852769.231663441, }, { x: 12975512.274773095, y: 4852771.693583396, }, { x: 12975667.430020995, y: 4852774.665220624, }, { x: 12975945.482280165, y: 4852780.652428524, }, { x: 12976048.941242512, y: 4852783.088273825, }, { x: 12976157.13466884, y: 4852786.1686903015, }, { x: 12976200.541262798, y: 4852787.159456441, }, { x: 12976234.258291336, y: 4852787.5677579185, }, { x: 12976365.991912834, y: 4852790.688773559, }, { x: 12976483.576280847, y: 4852793.632750944, }, { x: 12976521.657226892, y: 4852795.637126801, }, { x: 12976580.431624653, y: 4852800.4899075935, }, { x: 12976630.833259074, y: 4852806.145179798, }, { x: 12976695.08046594, y: 4852815.315654606, }, { x: 12976729.999958823, y: 4852820.657543227, }, { x: 12976776.474955026, y: 4852827.352541805, }, { x: 12976812.252139, y: 4852833.2147945, }, { x: 12976815.968375333, y: 4852833.822868197, }, { x: 12976885.429953378, y: 4852844.764512234, }, { x: 12976975.596115217, y: 4852858.43044723, }, { x: 12977055.606962522, y: 4852871.247395306, }, { x: 12977150.103301922, y: 4852886.690040669, }, { x: 12977164.484104557, y: 4852889.144325767, }, { x: 12977349.452764807, y: 4852911.35750741, }, { x: 12977396.826802246, y: 4852914.6312842835, }, { x: 12977445.21322845, y: 4852917.3740233835, }, { x: 12977499.905881032, y: 4852919.653667679, }, { x: 12977561.24229945, y: 4852918.623041482, }, { x: 12977618.078808535, y: 4852916.964759332, }, { x: 12977670.621610347, y: 4852911.879830347, }, { x: 12977751.148635335, y: 4852902.670739922, }, { x: 12977786.88548381, y: 4852897.948010646, }, { x: 12977824.596628416, y: 4852892.215955226, }, { x: 12977838.222668163, y: 4852889.785354156, }, { x: 12977897.63684129, y: 4852879.987122803, }, { x: 12978112.587513769, y: 4852847.147889897, }, { x: 12978212.010580407, y: 4852831.849550509, }, { x: 12978289.722346092, y: 4852819.825778696, }, { x: 12978376.198797919, y: 4852806.369032904, }, { x: 12978443.1247446, y: 4852796.941799674, }, { x: 12978511.962721677, y: 4852789.040221515, }, { x: 12978556.675266935, y: 4852784.800445814, }, { x: 12978603.675698506, y: 4852781.445204418, }, { x: 12978657.285893984, y: 4852778.451914039, }, { x: 12978800.565625936, y: 4852773.68229988, }, { x: 12978914.98070244, y: 4852769.67853182, }, { x: 12979058.626918213, y: 4852765.050844271, }, { x: 12979117.93108979, y: 4852764.395843838, }, { x: 12979200.907964638, y: 4852760.896022486, }, { x: 12979376.070149522, y: 4852755.492429703, }, { x: 12979821.264409432, y: 4852740.865419091, }, { x: 12979869.005644636, y: 4852738.659817284, }, { x: 12980006.684293807, y: 4852733.642694393, }, { x: 12980010.412107708, y: 4852733.505705852, }, { x: 12980102.14796544, y: 4852731.09585125, }, { x: 12980102.150365561, y: 4852731.095751376, }, { x: 12980241.426094191, y: 4852724.458911123, }, { x: 12980383.972661799, y: 4852720.275860491, }, { x: 12980452.567191115, y: 4852718.295604612, }, { x: 12980501.279651301, y: 4852717.168056968, }, { x: 12980511.817043953, y: 4852716.940679275, }, { x: 12980527.720170368, y: 4852714.900895137, }, { x: 12980546.205864942, y: 4852712.0589568885, }, { x: 12980556.739903979, y: 4852710.6345186, }, { x: 12980575.024717016, y: 4852707.192393184, }, { x: 12980600.064811092, y: 4852702.138990685, }, { x: 12980620.733107321, y: 4852697.095017998, }, { x: 12980641.992123496, y: 4852691.0518540675, }, { x: 12980667.422524082, y: 4852682.803530873, }, { x: 12980697.81666234, y: 4852671.350689514, }, { x: 12980750.44375973, y: 4852646.269770028, }, { x: 12980789.758654011, y: 4852625.613153645, }, { x: 12980817.158831125, y: 4852610.176831961, }, { x: 12980871.562055342, y: 4852579.505635189, }, { x: 12980917.628692484, y: 4852553.447517574, }, { x: 12981043.583099704, y: 4852484.690581212, }, { x: 12981099.336563937, y: 4852456.01893319, }, { x: 12981140.890511304, y: 4852432.9686271055, }, { x: 12981182.135998141, y: 4852411.356320457, }, { x: 12981255.809566528, y: 4852369.673110186, }, { x: 12981306.254684363, y: 4852342.213287527, }, { x: 12981355.360464152, y: 4852316.156478455, }, { x: 12981380.125408497, y: 4852304.328818308, }, { x: 12981404.370375846, y: 4852293.9445663355, }, { x: 12981411.357722916, y: 4852291.019192892, }, { x: 12981429.138416857, y: 4852284.705685185, }, { x: 12981449.445248626, y: 4852278.144038033, }, { x: 12981466.988468504, y: 4852273.038244298, }, { x: 12981483.934169278, y: 4852269.01732057, }, { x: 12981501.72129354, y: 4852264.633525485, }, { x: 12981521.195052542, y: 4852260.970876668, }, { x: 12981540.429482171, y: 4852257.912291013, }, { x: 12981556.300366443, y: 4852255.823523872, }, { x: 12981570.366991611, y: 4852253.983978159, }, { x: 12981590.808079034, y: 4852252.37024785, }, { x: 12981606.562289793, y: 4852251.488995252, }, { x: 12981636.507357743, y: 4852250.579113849, }, { x: 12981656.356278451, y: 4852250.896393729, }, { x: 12981692.086214192, y: 4852252.868202504, }, { x: 12981714.223939104, y: 4852254.872887953, }, { x: 12981755.862461897, y: 4852261.416093576, }, { x: 12981787.756915031, y: 4852268.344546958, }, { x: 12981824.48947952, y: 4852277.740325138, }, { x: 12982006.994348593, y: 4852327.843007399, }, { x: 12982014.941592565, y: 4852330.480576966, }, { x: 12982026.402121745, y: 4852333.381042817, }, { x: 12982040.946943458, y: 4852337.063108767, }, { x: 12982067.796619976, y: 4852344.124059822, }, { x: 12982082.244231999, y: 4852347.351909036, }, { x: 12982111.255736986, y: 4852353.085681991, }, { x: 12982129.791819442, y: 4852355.941803544, }, { x: 12982150.73459613, y: 4852358.6745200455, }, { x: 12982173.599064307, y: 4852360.678826859, }, { x: 12982199.590729142, y: 4852362.073329141, }, { x: 12982224.25684918, y: 4852362.508778318, }, { x: 12982242.781496631, y: 4852362.108043774, }, { x: 12982265.278136691, y: 4852361.098500819, }, { x: 12982291.742691308, y: 4852358.874468977, }, { x: 12982315.67474395, y: 4852355.811827975, }, { x: 12982335.035976896, y: 4852352.394862233, }, { x: 12982357.042847889, y: 4852348.851728803, }, { x: 12982382.295058098, y: 4852343.857827946, }, { x: 12982417.531268932, y: 4852337.395309842, }, { x: 12982448.197524806, y: 4852331.785528333, }, { x: 12982478.86330164, y: 4852326.658255823, }, { x: 12982531.423479121, y: 4852319.199320662, }, { x: 12982583.51522219, y: 4852315.239714849, }, { x: 12982619.249260034, y: 4852313.483230399, }, { x: 12982707.726446714, y: 4852311.01354565, }, { x: 12982818.643484026, y: 4852310.195081021, }, { x: 12982926.718911368, y: 4852308.423580399, }, { x: 12982969.351654056, y: 4852307.719497175, }, { x: 12983023.546593202, y: 4852306.599390685, }, { x: 12983109.423810175, y: 4852304.789328974, }, { x: 12983167.539974144, y: 4852304.283514513, }, { x: 12983217.219463198, y: 4852303.191877694, }, { x: 12983281.254377576, y: 4852302.216069689, }, { x: 12983366.75675525, y: 4852300.701005913, }, { x: 12983452.20281669, y: 4852299.1755383825, }, { x: 12983534.11611313, y: 4852296.359641885, }, { x: 12983559.667424409, y: 4852295.629501179, }, { x: 12983601.161266102, y: 4852294.627091015, }, { x: 12983611.984969016, y: 4852293.890433964, }, { x: 12983622.368472738, y: 4852292.692271228, }, { x: 12983631.964793393, y: 4852291.967613732, }, { x: 12983642.347676827, y: 4852290.532228432, }, { x: 12983664.288969724, y: 4852286.790795176, }, { x: 12983681.665854465, y: 4852283.294093203, }, { x: 12983691.650165133, y: 4852280.518425564, }, { x: 12983704.937446222, y: 4852276.871566698, }, { x: 12983719.485094307, y: 4852271.960088485, }, { x: 12983734.576153021, y: 4852266.573224977, }, { x: 12983749.349894535, y: 4852260.636238543, }, { x: 12983764.356448224, y: 4852253.439065454, }, { x: 12983783.229950167, y: 4852243.675282068, }, { x: 12983809.54016834, y: 4852227.647694631, }, { x: 12983819.177255707, y: 4852221.021988448, }, { x: 12983830.24508297, y: 4852212.4117375035, }, { x: 12983845.626987867, y: 4852200.007109512, }, { x: 12983856.53356637, y: 4852190.291205582, }, { x: 12983870.184671514, y: 4852177.732756121, }, { x: 12983883.752366735, y: 4852163.04569551, }, { x: 12983893.242055438, y: 4852153.491082963, }, { x: 12983901.156669818, y: 4852143.226680874, }, { x: 12983911.419729222, y: 4852128.860448257, }, { x: 12983920.032326968, y: 4852115.678436422, }, { x: 12983928.333826244, y: 4852103.047421788, }, { x: 12983936.314326718, y: 4852088.763105886, }, { x: 12983946.18360984, y: 4852068.498493203, }, { x: 12984045.08972995, y: 4851885.404455599, }, { x: 12984080.804905687, y: 4851817.337034466, }, { x: 12984134.748354, y: 4851706.836804487, }, { x: 12984195.8623765, y: 4851591.525543062, }, { x: 12984254.587788567, y: 4851478.621198026, }, { x: 12984307.768564539, y: 4851379.326535712, }, { x: 12984344.27421628, y: 4851308.864740265, }, { x: 12984375.225174434, y: 4851249.609910724, }, { x: 12984415.701271733, y: 4851172.74323114, }, { x: 12984461.729403371, y: 4851084.666569579, }, { x: 12984517.277267791, y: 4850976.575614915, }, { x: 12984628.35638987, y: 4850756.39703862, }, { x: 12984643.441411281, y: 4850729.173746353, }, { x: 12984659.718515014, y: 4850700.1083314745, }, { x: 12984681.711487297, y: 4850670.601281623, }, { x: 12984717.725659953, y: 4850629.896011068, }, { x: 12984754.999484044, y: 4850595.784380661, }, { x: 12984794.35474119, y: 4850566.24036794, }, { x: 12984822.179769346, y: 4850548.063337961, }, { x: 12984863.461169159, y: 4850526.723240278, }, { x: 12984915.289983816, y: 4850505.12020892, }, { x: 12984951.72965507, y: 4850491.149559257, }, { x: 12985164.594748862, y: 4850408.269419757, }, { x: 12985223.73663421, y: 4850386.334720776, }, { x: 12985231.332473703, y: 4850382.288306166, }, { x: 12985243.255608164, y: 4850375.964354305, }, { x: 12985309.485768877, y: 4850350.550316565, }, { x: 12985309.485868897, y: 4850350.550316587, }, { x: 12986172.233193466, y: 4850032.791403444, }, { x: 12986172.8663129, y: 4850032.558329904, }, { x: 12986339.175501348, y: 4849968.327595861, }, { x: 12986505.507225916, y: 4849904.089056084, }, { x: 12986656.604391119, y: 4849847.60963517, }, { x: 12986702.483696718, y: 4849828.918664281, }, { x: 12986760.975453354, y: 4849792.3676841725, }, { x: 12986797.326063676, y: 4849765.012441939, }, { x: 12986830.880906345, y: 4849735.181111031, }, { x: 12986886.127819829, y: 4849677.217710046, }, { x: 12987120.13083682, y: 4849429.888750661, }, { x: 12987545.455182405, y: 4848990.56075093, }, { x: 12987572.780970717, y: 4848962.972667584, }, { x: 12987750.347789623, y: 4848775.995218805, }, { x: 12987812.698881118, y: 4848712.132626582, }, { x: 12987888.840439832, y: 4848629.514697122, }, { x: 12987922.383888729, y: 4848595.374774107, }, { x: 12988054.963756831, y: 4848456.434616343, }, { x: 12988203.560175221, y: 4848293.895912913, }, { x: 12988250.566429619, y: 4848245.193567729, }, { x: 12988306.722374829, y: 4848191.552325912, }, { x: 12988429.814042207, y: 4848060.358476343, }, { x: 12988509.892477134, y: 4847972.732590752, }, { x: 12988516.052521963, y: 4847966.473292817, }, { x: 12988531.25232795, y: 4847951.020837734, }, { x: 12988547.774189414, y: 4847934.22664656, }, { x: 12988684.205479793, y: 4847792.520992836, }, { x: 12988709.83813206, y: 4847765.978322433, }, { x: 12988751.064218508, y: 4847721.917838166, }, { x: 12988806.893480845, y: 4847664.753238427, }, { x: 12988838.47984446, y: 4847638.4005759265, }, { x: 12988863.550537288, y: 4847617.484576525, }, { x: 12988871.447747946, y: 4847610.900250857, }, { x: 12988928.71596574, y: 4847568.305396379, }, { x: 12989015.639990052, y: 4847513.087871169, }, { x: 12989070.178705394, y: 4847482.192075563, }, { x: 12989148.863691295, y: 4847447.998694799, }, { x: 12989221.630766438, y: 4847420.154502207, }, { x: 12989339.331564289, y: 4847380.68202523, }, { x: 12989542.519483887, y: 4847312.531220079, }, { x: 12989591.848173946, y: 4847295.984625068, }, ], }, { id: "12", source: "24", target: "25", class: "城铁十三号线", name: "城铁十三号线 0", controlPoints: [ { x: 12961384.821093876, y: 4857604.895638846, }, { x: 12961379.888425605, y: 4857950.407662031, }, { x: 12961378.603161972, y: 4858178.984029268, }, { x: 12961378.251699504, y: 4858199.941669665, }, { x: 12961362.948288757, y: 4859113.050576728, }, { x: 12961351.774871988, y: 4859246.305776181, }, { x: 12961344.673628464, y: 4859330.995740561, }, { x: 12961338.185205506, y: 4859379.136027955, }, { x: 12961326.701474292, y: 4859430.3762181355, }, { x: 12961296.23872469, y: 4859534.623118192, }, { x: 12961279.573160157, y: 4859595.157872784, }, { x: 12961271.432916135, y: 4859636.755033974, }, { x: 12961227.692613533, y: 4859930.467545727, }, { x: 12961219.290961184, y: 4859990.017196776, }, { x: 12961215.868152, y: 4860031.195887179, }, { x: 12961213.956200192, y: 4860042.603136049, }, { x: 12961206.891662417, y: 4860091.520899557, }, { x: 12961188.165871859, y: 4860211.789308975, }, { x: 12961182.052734978, y: 4860252.9748706035, }, { x: 12961177.381970651, y: 4860285.458304639, }, { x: 12961133.584798172, y: 4861282.165295659, }, { x: 12961131.197062261, y: 4861339.773361728, }, { x: 12961125.764970018, y: 4861465.195775947, }, { x: 12961124.551248107, y: 4861505.652557301, }, { x: 12961122.644612342, y: 4861570.024727552, }, { x: 12961122.505511757, y: 4861612.817632623, }, { x: 12961126.125387294, y: 4861656.679218022, }, { x: 12961134.236030966, y: 4861724.086379644, }, { x: 12961147.346890498, y: 4861783.573658952, }, { x: 12961169.949061126, y: 4861856.88455326, }, { x: 12961190.92239628, y: 4861908.443200537, }, { x: 12961244.80679, y: 4862017.212104109, }, { x: 12961785.271410704, y: 4863090.557436891, }, { x: 12962406.945922375, y: 4864318.974454228, }, { x: 12963018.284754738, y: 4865521.493683898, }, { x: 12963018.284854762, y: 4865521.493783919, }, { x: 12963224.051473433, y: 4866039.3565800125, }, { x: 12963500.971012274, y: 4867139.241053313, }, { x: 12963650.819367116, y: 4867725.703316142, }, { x: 12963888.949552327, y: 4868660.037686641, }, { x: 12964153.29996666, y: 4869706.424707541, }, { x: 12964161.049777685, y: 4869739.748010959, }, { x: 12964169.022003202, y: 4869783.887620618, }, { x: 12964169.79918989, y: 4869788.187596136, }, { x: 12964170.396725647, y: 4869792.28592288, }, { x: 12964178.09229784, y: 4869845.141780633, }, { x: 12964182.866363246, y: 4869906.602764703, }, { x: 12964186.742670394, y: 4869983.180502373, }, { x: 12964187.80107099, y: 4870004.059485736, }, { x: 12964194.767189663, y: 4870141.601109272, }, { x: 12964195.586355446, y: 4870157.791065987, }, { x: 12964195.629143188, y: 4870158.625753281, }, { x: 12964197.365642045, y: 4870232.162939279, }, { x: 12964199.986983918, y: 4870338.989878203, }, { x: 12964198.233979, y: 4870399.4780171625, }, { x: 12964195.521848764, y: 4870426.330630218, }, { x: 12964189.688597165, y: 4870457.628060375, }, { x: 12964178.76505046, y: 4870495.275356304, }, { x: 12964167.839258399, y: 4870529.241804792, }, { x: 12964156.90262342, y: 4870556.635705516, }, { x: 12964139.446759911, y: 4870591.940950339, }, { x: 12964119.380342938, y: 4870629.3612662265, }, { x: 12964087.063558495, y: 4870686.289743977, }, { x: 12964065.951472988, y: 4870723.716488513, }, { x: 12964052.918280806, y: 4870746.119234959, }, { x: 12964041.187130783, y: 4870764.046505531, }, { x: 12964018.239456784, y: 4870796.744059516, }, { x: 12963997.373145364, y: 4870821.018842714, }, { x: 12963975.979364637, y: 4870842.403550631, }, { x: 12963943.620649595, y: 4870869.876901368, }, { x: 12963912.565489624, y: 4870894.189978186, }, { x: 12963888.553606404, y: 4870910.587164291, }, { x: 12963855.921490764, y: 4870928.856058391, }, { x: 12963818.847341483, y: 4870946.088721298, }, { x: 12963778.372132206, y: 4870961.231012497, }, { x: 12963730.060326898, y: 4870976.4015065245, }, { x: 12963657.978381645, y: 4870995.602780929, }, { x: 12963622.05854108, y: 4871004.430416085, }, { x: 12963558.724530451, y: 4871019.810885714, }, { x: 12963512.503679566, y: 4871035.906957649, }, { x: 12963453.681321735, y: 4871059.763481818, }, { x: 12963248.80497939, y: 4871172.328870646, }, { x: 12963244.572822267, y: 4871174.658396504, }, { x: 12963038.471529033, y: 4871288.035313995, }, { x: 12962853.820973437, y: 4871391.186996228, }, { x: 12962725.303994041, y: 4871462.571934574, }, { x: 12962724.957375426, y: 4871462.752610938, }, { x: 12962723.887909118, y: 4871463.345629024, }, { x: 12962716.736546198, y: 4871467.315161244, }, { x: 12962716.284189595, y: 4871467.567097997, }, { x: 12962579.957906647, y: 4871543.225352538, }, { x: 12962098.530270364, y: 4871808.314025743, }, { x: 12961985.615570927, y: 4871875.438409937, }, { x: 12961943.360948866, y: 4871903.003423259, }, { x: 12961806.371053975, y: 4871987.009769704, }, { x: 12961737.483883223, y: 4872026.3265607115, }, { x: 12961633.115452316, y: 4872086.751682198, }, { x: 12961545.844782017, y: 4872134.320089415, }, { x: 12961361.563495556, y: 4872236.98400638, }, { x: 12961327.331658702, y: 4872255.833857056, }, { x: 12961251.875342408, y: 4872297.087065438, }, { x: 12961204.826219695, y: 4872325.325771341, }, { x: 12961132.023615833, y: 4872361.658743605, }, { x: 12961052.11865231, y: 4872405.144750871, }, { x: 12960972.646711243, y: 4872441.930478759, }, { x: 12960858.106042854, y: 4872506.91698905, }, { x: 12960760.426450621, y: 4872559.359681711, }, { x: 12960724.908352494, y: 4872580.416320622, }, { x: 12960641.560702814, y: 4872626.948672511, }, { x: 12960409.848923735, y: 4872755.68364987, }, { x: 12960214.328045709, y: 4872860.212735837, }, { x: 12960127.928549424, y: 4872909.2953869505, }, { x: 12960102.655544914, y: 4872922.969133999, }, { x: 12960020.162988434, y: 4872967.3561403835, }, { x: 12959950.134860648, y: 4873006.403798974, }, { x: 12959863.03802686, y: 4873054.88910155, }, { x: 12959777.644680386, y: 4873104.258241601, }, { x: 12959699.508191582, y: 4873147.282306783, }, { x: 12959620.328795532, y: 4873191.4477808075, }, { x: 12959477.877193257, y: 4873269.404125038, }, { x: 12959357.123719096, y: 4873335.684058211, }, { x: 12959338.647690238, y: 4873345.82380848, }, { x: 12958925.449787276, y: 4873574.258471447, }, { x: 12958914.496696375, y: 4873580.313011027, }, { x: 12958908.925432095, y: 4873583.384761498, }, { x: 12958469.664608255, y: 4873826.333185746, }, { x: 12958317.119431961, y: 4873910.348894859, }, { x: 12958173.63725258, y: 4873989.354939118, }, { x: 12958109.864433711, y: 4874026.411209632, }, { x: 12958056.459419694, y: 4874055.42987156, }, { x: 12958035.572431948, y: 4874066.780988242, }, { x: 12957541.464879088, y: 4874339.316503633, }, { x: 12957541.314450411, y: 4874339.40007746, }, { x: 12957515.50602984, y: 4874353.589680841, }, { x: 12957515.424667433, y: 4874353.63521974, }, { x: 12957178.774763126, y: 4874538.369890689, }, { x: 12957143.891148778, y: 4874557.897348821, }, { x: 12956953.433700653, y: 4874662.620502712, }, { x: 12956865.14112665, y: 4874711.491226545, }, { x: 12956730.395010892, y: 4874784.283691582, }, { x: 12956584.60989753, y: 4874864.17479837, }, { x: 12956514.690003015, y: 4874902.207189248, }, { x: 12956415.921079142, y: 4874957.945257982, }, { x: 12956350.318605551, y: 4874993.942196934, }, { x: 12955970.523661379, y: 4875204.572856644, }, { x: 12955961.168925371, y: 4875209.826648806, }, { x: 12955608.616340334, y: 4875403.58048848, }, { x: 12955424.989326235, y: 4875505.19312055, }, { x: 12955208.191654494, y: 4875621.246472876, }, { x: 12955106.685266893, y: 4875676.949542184, }, { x: 12954909.088653814, y: 4875785.6214146055, }, { x: 12954898.699293226, y: 4875791.33469513, }, { x: 12954809.86015897, y: 4875840.183103034, }, { x: 12954515.78755851, y: 4876003.857567704, }, { x: 12954425.351083811, y: 4876047.515434021, }, { x: 12954361.536701877, y: 4876075.173523097, }, { x: 12954318.522177251, y: 4876092.11950955, }, { x: 12954285.295954525, y: 4876103.586379883, }, { x: 12954230.248733655, y: 4876121.545707381, }, { x: 12954175.140615348, y: 4876137.686398102, }, { x: 12954117.372576779, y: 4876152.031328337, }, { x: 12954117.372476779, y: 4876152.031328334, }, { x: 12954063.303781305, y: 4876163.662863832, }, { x: 12954007.331071056, y: 4876172.399246002, }, { x: 12953967.211788474, y: 4876178.65975709, }, { x: 12953802.621925015, y: 4876196.237827291, }, { x: 12953668.73601341, y: 4876199.186105529, }, { x: 12953503.298073018, y: 4876194.053015986, }, { x: 12953435.898150826, y: 4876195.031116625, }, { x: 12952907.1719517, y: 4876202.110021278, }, { x: 12952854.57708836, y: 4876202.818902422, }, { x: 12952810.046254802, y: 4876203.418551955, }, { x: 12952736.613090457, y: 4876203.294253911, }, { x: 12952624.4348891, y: 4876204.555723625, }, { x: 12952552.43031391, y: 4876204.964896776, }, { x: 12952497.943888191, y: 4876207.608055034, }, { x: 12952468.042451413, y: 4876210.829014632, }, { x: 12952437.79969268, y: 4876214.509841102, }, { x: 12952375.588643614, y: 4876223.886731359, }, { x: 12952301.856311196, y: 4876236.1209624605, }, { x: 12952251.31522576, y: 4876242.8451233655, }, { x: 12952214.021838313, y: 4876246.965370512, }, { x: 12952162.807325037, y: 4876250.527753233, }, { x: 12952103.452750135, y: 4876251.697783142, }, { x: 12952023.611417918, y: 4876253.082581543, }, { x: 12951892.55511939, y: 4876253.812631988, }, { x: 12951846.328905031, y: 4876253.171084735, }, { x: 12951802.992080217, y: 4876249.116505366, }, { x: 12951766.843265098, y: 4876244.26441203, }, { x: 12951714.743373726, y: 4876233.633230178, }, { x: 12951654.073062496, y: 4876222.691277131, }, { x: 12951616.46554052, y: 4876216.252301995, }, { x: 12951584.63468386, y: 4876213.574076274, }, { x: 12951561.015438031, y: 4876212.359467597, }, { x: 12951502.289814433, y: 4876212.143345088, }, { x: 12951293.085304, y: 4876214.875420837, }, { x: 12951031.075470097, y: 4876215.897535212, }, { x: 12950959.097605025, y: 4876216.275884133, }, { x: 12950894.730929183, y: 4876215.974946514, }, { x: 12950773.64057589, y: 4876216.703301484, }, { x: 12950673.746751422, y: 4876225.670588799, }, { x: 12950616.565179903, y: 4876229.034309006, }, { x: 12950568.486162541, y: 4876230.042798452, }, { x: 12950375.145719487, y: 4876231.976121928, }, { x: 12950194.78158641, y: 4876234.464466195, }, { x: 12950048.658437809, y: 4876236.2574803205, }, { x: 12950001.4772779, y: 4876235.293804152, }, { x: 12949948.747199, y: 4876229.307334167, }, { x: 12949849.140274497, y: 4876224.443260822, }, { x: 12948886.90103617, y: 4876237.644317312, }, { x: 12948886.90093617, y: 4876237.644317315, }, { x: 12948715.380098497, y: 4876239.997015189, }, { x: 12948425.68643085, y: 4876243.705096172, }, { x: 12948424.112088347, y: 4876243.72353365, }, { x: 12948407.06491928, y: 4876243.944145824, }, { x: 12948405.98243078, y: 4876243.95624331, }, { x: 12948361.171213618, y: 4876244.531933125, }, { x: 12948356.092076505, y: 4876244.596227219, }, { x: 12948294.145588111, y: 4876245.390073654, }, { x: 12948293.421376245, y: 4876245.398151391, }, { x: 12948245.081662236, y: 4876246.017528498, }, { x: 12948244.258669348, y: 4876246.030423269, }, { x: 12948227.313400865, y: 4876246.246399225, }, { x: 12948226.443416782, y: 4876246.256701933, }, { x: 12948223.250043418, y: 4876246.298279974, }, { x: 12947945.409350824, y: 4876250.961636466, }, { x: 12947934.332267188, y: 4876250.890472651, }, { x: 12947877.07401595, y: 4876250.914315445, }, { x: 12947815.021065967, y: 4876253.851354821, }, { x: 12947763.487477783, y: 4876261.1465055365, }, { x: 12947725.059790507, y: 4876269.052617193, }, { x: 12947653.430817837, y: 4876293.225426714, }, { x: 12947609.2695425, y: 4876314.985599062, }, { x: 12947579.101654992, y: 4876329.096570221, }, { x: 12947532.916624067, y: 4876357.08904473, }, { x: 12947462.2262063, y: 4876393.072714213, }, { x: 12947421.555621969, y: 4876408.477083252, }, { x: 12947369.78948997, y: 4876424.051528886, }, { x: 12947316.08051995, y: 4876430.96623273, }, { x: 12947288.108453162, y: 4876433.523245403, }, { x: 12947233.34126908, y: 4876432.790803788, }, { x: 12947188.401168212, y: 4876429.088000529, }, { x: 12947141.165666422, y: 4876420.772086076, }, { x: 12947111.803456603, y: 4876412.760024161, }, { x: 12947064.825877437, y: 4876399.584901326, }, { x: 12947029.14763327, y: 4876383.288698463, }, { x: 12947000.45767468, y: 4876366.611471653, }, { x: 12946972.12493202, y: 4876348.110056718, }, { x: 12946952.979055353, y: 4876335.007395409, }, { x: 12946936.827550543, y: 4876323.077202845, }, { x: 12946921.333707113, y: 4876310.548771458, }, { x: 12946816.8297496, y: 4876219.287650481, }, { x: 12946732.699527778, y: 4876127.270037018, }, { x: 12946657.488720905, y: 4876045.210086455, }, { x: 12946622.587940522, y: 4875983.965371542, }, { x: 12946496.471341081, y: 4875762.643722024, }, { x: 12946423.522392513, y: 4875557.850478406, }, { x: 12946399.995473424, y: 4875459.537530149, }, { x: 12946396.978958678, y: 4875437.0025600875, }, { x: 12946396.993859813, y: 4875409.162322274, }, { x: 12946399.79561764, y: 4875362.09033934, }, { x: 12946402.86393251, y: 4875338.563648224, }, { x: 12946405.625597931, y: 4875320.088412483, }, { x: 12946410.942566253, y: 4875295.299492259, }, { x: 12946416.254743187, y: 4875274.811186232, }, { x: 12946428.647654204, y: 4875238.394850413, }, { x: 12946449.128231185, y: 4875187.827926565, }, { x: 12946468.842936842, y: 4875151.68413807, }, { x: 12946489.817988945, y: 4875118.8342050975, }, { x: 12946522.546502326, y: 4875072.470895908, }, { x: 12946570.68181112, y: 4875007.932055009, }, { x: 12946590.31852286, y: 4874978.982263895, }, { x: 12946617.815584973, y: 4874935.88435813, }, { x: 12946646.325475948, y: 4874873.520782715, }, { x: 12946820.499390153, y: 4874459.418667514, }, { x: 12946888.30456704, y: 4874294.857213484, }, { x: 12946930.646429846, y: 4874192.6851136675, }, { x: 12946949.005201655, y: 4874148.378390104, }, { x: 12947044.284756513, y: 4873918.4637040915, }, { x: 12947056.289818808, y: 4873889.083139696, }, { x: 12947165.66572366, y: 4873622.718414709, }, { x: 12947202.737800827, y: 4873531.999517411, }, { x: 12947209.63262473, y: 4873515.652391753, }, { x: 12947273.282788856, y: 4873364.7546024555, }, { x: 12947273.708122, y: 4873363.743532597, }, { x: 12947287.460317507, y: 4873331.140831067, }, { x: 12947304.830566434, y: 4873289.959057868, }, { x: 12947411.8537799, y: 4873054.533746381, }, { x: 12947541.50808741, y: 4872842.7485984, }, { x: 12947580.982706897, y: 4872777.370338213, }, { x: 12947615.711724276, y: 4872723.318503141, }, { x: 12947649.183798542, y: 4872667.856626571, }, { x: 12947675.12323022, y: 4872624.93555951, }, { x: 12947696.263067583, y: 4872593.158431816, }, { x: 12947734.29565014, y: 4872530.60731087, }, { x: 12947764.795609327, y: 4872480.528620551, }, { x: 12947824.300805386, y: 4872380.158015446, }, { x: 12947865.335921923, y: 4872300.691582129, }, { x: 12947868.4019642, y: 4872293.260799115, }, { x: 12947877.607004203, y: 4872273.69886109, }, { x: 12947897.445241943, y: 4872226.595834379, }, { x: 12947927.647142874, y: 4872153.107787066, }, { x: 12947994.798658265, y: 4871994.343646774, }, { x: 12948026.296440713, y: 4871921.612665893, }, { x: 12948040.948586507, y: 4871894.217878682, }, { x: 12948057.308193548, y: 4871865.8032324435, }, { x: 12948067.326472418, y: 4871850.338413439, }, { x: 12948081.773480348, y: 4871830.043075507, }, { x: 12948106.005618699, y: 4871796.572364472, }, { x: 12948147.255517324, y: 4871752.044003956, }, { x: 12948212.569000661, y: 4871679.780786607, }, { x: 12948214.328663053, y: 4871677.809478982, }, { x: 12948273.504086189, y: 4871611.484093596, }, { x: 12948317.798932584, y: 4871561.862160343, }, { x: 12948344.377879875, y: 4871527.5162396645, }, { x: 12948380.890677512, y: 4871477.605026336, }, { x: 12948413.38959998, y: 4871425.5829799725, }, { x: 12948414.44249342, y: 4871423.82499065, }, { x: 12948447.049964357, y: 4871369.071132418, }, { x: 12948447.986775042, y: 4871367.444350426, }, { x: 12948505.566148069, y: 4871267.333064074, }, { x: 12948544.503004055, y: 4871190.001687928, }, { x: 12948579.413090972, y: 4871111.04819233, }, { x: 12948621.84723699, y: 4871002.001678927, }, { x: 12948649.245005308, y: 4870919.800386681, }, { x: 12948729.034075115, y: 4870659.041565615, }, { x: 12948806.660201645, y: 4870408.542141671, }, { x: 12948816.10369674, y: 4870377.056894108, }, { x: 12948817.112454178, y: 4870373.69505771, }, { x: 12948822.827115472, y: 4870354.633454126, }, { x: 12948823.264697373, y: 4870353.177438731, }, { x: 12948871.583647873, y: 4870192.062297062, }, { x: 12948888.256377492, y: 4870137.412837239, }, { x: 12948888.256477488, y: 4870137.412437243, }, { x: 12948981.13241698, y: 4869833.0181290535, }, { x: 12949020.38513926, y: 4869703.696545276, }, { x: 12949062.757994082, y: 4869570.843921744, }, { x: 12949090.169382466, y: 4869479.2850293545, }, { x: 12949123.989708498, y: 4869371.588525548, }, { x: 12949143.001308247, y: 4869300.813594804, }, { x: 12949146.761492698, y: 4869288.429210793, }, { x: 12949163.7803404, y: 4869233.145301005, }, { x: 12949175.026622072, y: 4869195.787679086, }, { x: 12949196.938022848, y: 4869123.013569744, }, { x: 12949208.873643316, y: 4869083.2070951825, }, { x: 12949223.461787153, y: 4869036.1056654295, }, { x: 12949242.728116639, y: 4868973.956351733, }, { x: 12949271.681629652, y: 4868877.983261017, }, { x: 12949297.10128093, y: 4868796.606128646, }, { x: 12949301.07802554, y: 4868786.43636378, }, { x: 12949316.770515563, y: 4868745.313714858, }, { x: 12949322.956596527, y: 4868730.50358208, }, { x: 12949339.748933367, y: 4868696.689288448, }, { x: 12949362.183788385, y: 4868657.470406632, }, { x: 12949389.99988878, y: 4868612.036959275, }, { x: 12949405.211090067, y: 4868588.465232985, }, { x: 12949424.342096223, y: 4868564.828507317, }, { x: 12949513.190764954, y: 4868460.242782986, }, { x: 12949542.465744024, y: 4868426.322580645, }, { x: 12949544.338502375, y: 4868424.150033486, }, { x: 12949600.872280473, y: 4868356.658526145, }, { x: 12949646.996273136, y: 4868303.803243655, }, { x: 12949696.144125719, y: 4868246.537783951, }, { x: 12949755.723785738, y: 4868181.855453389, }, { x: 12949832.37526342, y: 4868093.127098315, }, { x: 12949851.813717443, y: 4868068.399532126, }, { x: 12949894.667583121, y: 4868017.630119035, }, { x: 12949932.221547332, y: 4867975.033422636, }, { x: 12949984.350867936, y: 4867915.6628556745, }, { x: 12950051.280432409, y: 4867836.640979047, }, { x: 12950119.532814305, y: 4867759.173557603, }, { x: 12950170.049738903, y: 4867700.545102677, }, { x: 12950196.18372548, y: 4867669.647630281, }, { x: 12950245.012623828, y: 4867612.641024118, }, { x: 12950366.341310102, y: 4867472.554440256, }, { x: 12950396.016682621, y: 4867437.159853344, }, { x: 12950433.41414459, y: 4867388.174952161, }, { x: 12950467.047766922, y: 4867337.197051575, }, { x: 12950472.727024797, y: 4867327.624837841, }, { x: 12950504.43931956, y: 4867270.541731104, }, { x: 12950506.66515916, y: 4867265.686943075, }, { x: 12950513.328076823, y: 4867251.147877864, }, { x: 12950522.125427773, y: 4867231.948518946, }, { x: 12950543.25084689, y: 4867180.747377998, }, { x: 12950554.610753339, y: 4867148.755648968, }, { x: 12950565.938845547, y: 4867113.7289358685, }, { x: 12950577.077540115, y: 4867070.725547691, }, { x: 12950584.992247868, y: 4867034.253515085, }, { x: 12950597.570781464, y: 4866945.446932178, }, { x: 12950602.621253733, y: 4866858.218872007, }, { x: 12950604.351725787, y: 4866798.591035709, }, { x: 12950604.673463916, y: 4866769.830411211, }, { x: 12950608.500044588, y: 4866652.0108254915, }, { x: 12950610.319620667, y: 4866589.554543856, }, { x: 12950610.359324489, y: 4866588.2321465295, }, { x: 12950610.80126891, y: 4866566.6265690895, }, { x: 12950612.409021743, y: 4866522.173389596, }, { x: 12950616.621330654, y: 4866372.98018754, }, { x: 12950618.97605836, y: 4866293.007567341, }, { x: 12950619.842244353, y: 4866255.184129226, }, { x: 12950625.910927346, y: 4866063.848140013, }, { x: 12950628.387367597, y: 4865977.081155829, }, { x: 12950629.753005603, y: 4865908.9763710955, }, { x: 12950632.086528255, y: 4865841.0262908945, }, { x: 12950632.35165354, y: 4865833.33471617, }, { x: 12950633.79978892, y: 4865801.28505746, }, { x: 12950635.690965662, y: 4865759.427843475, }, { x: 12950637.922484085, y: 4865674.26866093, }, { x: 12950641.139187874, y: 4865591.213986744, }, { x: 12950643.134781921, y: 4865519.6466930285, }, { x: 12950643.368005117, y: 4865509.419217591, }, { x: 12950643.529421674, y: 4865500.599934787, }, { x: 12950643.977363357, y: 4865491.176881495, }, { x: 12950644.362001631, y: 4865474.307022515, }, { x: 12950644.872350669, y: 4865458.107876617, }, { x: 12950645.130576981, y: 4865444.560304754, }, { x: 12950645.57682058, y: 4865427.882852814, }, { x: 12950645.993461674, y: 4865410.917198133, }, { x: 12950646.667225737, y: 4865391.909170426, }, { x: 12950647.177975576, y: 4865372.994126345, }, { x: 12950647.75493018, y: 4865357.594288625, }, { x: 12950648.042257652, y: 4865348.937219927, }, { x: 12950648.42689613, y: 4865331.427963337, }, { x: 12950649.226270262, y: 4865315.3585491525, }, { x: 12950650.507293697, y: 4865273.423391737, }, { x: 12950650.697711246, y: 4865269.97251224, }, { x: 12950651.401779896, y: 4865244.094692232, }, { x: 12950652.233156506, y: 4865229.016682226, }, { x: 12950652.74640693, y: 4865208.822741665, }, { x: 12950653.64269155, y: 4865185.438841808, }, { x: 12950654.09033895, y: 4865156.015598994, }, { x: 12950655.11473383, y: 4865135.615712103, }, { x: 12950655.81880249, y: 4865109.7205952415, }, { x: 12950656.266944723, y: 4865098.219646195, }, { x: 12950656.776491228, y: 4865090.42570183, }, { x: 12950657.610074416, y: 4865053.173004747, }, { x: 12950657.80429587, y: 4865037.45393246, }, { x: 12950665.057790544, y: 4864813.469608394, }, { x: 12950666.31470639, y: 4864789.756353396, }, { x: 12950666.825456835, y: 4864768.799620799, }, { x: 12950667.593330417, y: 4864744.839817025, }, { x: 12950667.977868663, y: 4864728.163469017, }, { x: 12950669.195489043, y: 4864677.813533126, }, { x: 12950669.835947098, y: 4864668.869905654, }, { x: 12950670.091873968, y: 4864653.088344843, }, { x: 12950670.988058263, y: 4864630.3428553175, }, { x: 12950670.92435391, y: 4864626.509652139, }, { x: 12950671.691826217, y: 4864606.63864744, }, { x: 12950672.203278288, y: 4864580.504222692, }, { x: 12950673.228074549, y: 4864554.884550185, }, { x: 12950673.73952671, y: 4864528.497326723, }, { x: 12950674.890434487, y: 4864500.769470086, }, { x: 12950675.2757754, y: 4864475.593033784, }, { x: 12950675.409487799, y: 4864472.776850138, }, { x: 12950676.010148842, y: 4864442.529341358, }, { x: 12950677.468085546, y: 4864406.737226046, }, { x: 12950678.344374934, y: 4864361.629262644, }, { x: 12950681.645047376, y: 4864252.127616024, }, { x: 12950682.9547692, y: 4864216.335625385, }, { x: 12950683.100682352, y: 4864214.154238779, }, { x: 12950684.236285895, y: 4864191.999439908, }, { x: 12950685.866634507, y: 4864160.1778856525, }, { x: 12950689.79278639, y: 4864108.3870529765, }, { x: 12950689.938599342, y: 4864106.931066905, }, { x: 12950697.064031562, y: 4864036.379448896, }, { x: 12950699.534748787, y: 4864019.216889406, }, { x: 12950699.680561578, y: 4864018.345103669, }, { x: 12950716.396330617, y: 4863888.161824789, }, { x: 12950718.57772101, y: 4863874.636737837, }, { x: 12950718.577821152, y: 4863874.05533762, }, { x: 12950732.387228379, y: 4863767.873478454, }, { x: 12950748.375318805, y: 4863648.896232093, }, { x: 12950765.67291641, y: 4863514.502311158, }, { x: 12950777.731654065, y: 4863426.117281793, }, { x: 12950782.448058736, y: 4863391.472539309, }, { x: 12950787.587200012, y: 4863348.835337318, }, { x: 12950801.256266356, y: 4863250.146561549, }, { x: 12950805.275908938, y: 4863217.932650578, }, { x: 12950818.28101368, y: 4863113.762708521, }, { x: 12950822.999512516, y: 4863078.5401642835, }, { x: 12950827.797217675, y: 4863040.997227563, }, { x: 12950833.851926966, y: 4862997.421011249, }, { x: 12950838.379305013, y: 4862973.344145836, }, { x: 12950848.476446522, y: 4862915.367113537, }, { x: 12950856.118280582, y: 4862873.256843487, }, { x: 12950862.060671719, y: 4862842.477409358, }, { x: 12950882.653269414, y: 4862709.589368273, }, { x: 12950907.883131918, y: 4862524.421459502, }, { x: 12950907.90533372, y: 4862524.26986159, }, { x: 12950920.067918759, y: 4862435.001208198, }, { x: 12950928.527198693, y: 4862379.783399951, }, { x: 12950939.681083987, y: 4862336.514125757, }, { x: 12950954.29343263, y: 4862293.863553435, }, { x: 12950967.571566563, y: 4862263.107846068, }, { x: 12950978.195387682, y: 4862240.704492119, }, { x: 12950999.06198339, y: 4862206.546426427, }, { x: 12951021.446772633, y: 4862168.969866098, }, { x: 12951097.70213785, y: 4862042.200138503, }, { x: 12951174.075577334, y: 4861915.693221821, }, { x: 12951267.776776478, y: 4861760.078948706, }, { x: 12951395.236453552, y: 4861519.784399533, }, { x: 12951412.303520849, y: 4861476.874540171, }, { x: 12951451.654131988, y: 4861334.408202046, }, { x: 12951451.745536273, y: 4861334.052106667, }, { x: 12951466.623726709, y: 4861241.564646258, }, { x: 12951489.13393889, y: 4861018.001826673, }, { x: 12951490.383194035, y: 4860999.999285448, }, { x: 12951491.439840542, y: 4860985.560035131, }, { x: 12951503.010040093, y: 4860889.175072468, }, { x: 12951531.140403, y: 4860680.970427163, }, { x: 12951557.758936353, y: 4860485.587344637, }, { x: 12951565.10420882, y: 4860453.124738692, }, { x: 12951575.364280945, y: 4860406.458640103, }, { x: 12951581.065583235, y: 4860384.268158007, }, { x: 12951610.884689623, y: 4860288.296338669, }, { x: 12951620.19888619, y: 4860261.224956072, }, { x: 12951627.274605729, y: 4860242.081190622, }, { x: 12951637.413111666, y: 4860215.23171692, }, { x: 12951657.721893568, y: 4860163.979635463, }, { x: 12951666.949544173, y: 4860142.223200858, }, { x: 12951668.869595224, y: 4860137.696654858, }, { x: 12951693.982928237, y: 4860078.331821876, }, { x: 12951736.262245214, y: 4859972.802878212, }, { x: 12951779.310281485, y: 4859859.063131411, }, { x: 12951799.296553789, y: 4859804.14710355, }, { x: 12951825.224839896, y: 4859739.862680752, }, { x: 12951906.509982908, y: 4859546.26065336, }, { x: 12951960.443026407, y: 4859429.470375646, }, { x: 12951999.771882042, y: 4859335.105420177, }, { x: 12952032.435444733, y: 4859254.969474848, }, { x: 12952037.41706581, y: 4859242.9403781, }, { x: 12952060.923649335, y: 4859187.91377235, }, { x: 12952072.317820875, y: 4859160.3641980635, }, { x: 12952084.970246904, y: 4859131.4834706, }, { x: 12952113.084959969, y: 4859065.12985738, }, { x: 12952130.693674402, y: 4859023.732486952, }, { x: 12952141.643150551, y: 4858996.55370852, }, { x: 12952162.804377414, y: 4858947.308924186, }, { x: 12952171.755373834, y: 4858927.981571281, }, { x: 12952175.604139445, y: 4858917.094515989, }, { x: 12952180.82205369, y: 4858900.9651018735, }, { x: 12952184.554718394, y: 4858889.243946094, }, { x: 12952190.769288482, y: 4858868.280381973, }, { x: 12952193.507485226, y: 4858857.610563799, }, { x: 12952195.947291974, y: 4858845.681757747, }, { x: 12952197.797320686, y: 4858836.642376694, }, { x: 12952199.129268397, y: 4858825.304718492, }, { x: 12952203.716285268, y: 4858778.431416472, }, { x: 12952205.964993557, y: 4858749.46331663, }, { x: 12952207.408630643, y: 4858703.901754291, }, { x: 12952205.633196818, y: 4858677.13773786, }, { x: 12952200.97007183, y: 4858631.018552714, }, { x: 12952196.971420817, y: 4858601.209733323, }, { x: 12952192.67917836, y: 4858569.843524169, }, { x: 12952188.386933465, y: 4858539.217911885, }, { x: 12952168.84610709, y: 4858394.254627763, }, { x: 12952159.519210786, y: 4858329.002694597, }, { x: 12952158.632838566, y: 4858318.547228751, }, { x: 12952157.151183436, y: 4858288.818485506, }, { x: 12952156.706496444, y: 4858276.218902411, }, { x: 12952157.149780104, y: 4858257.685985396, }, { x: 12952159.218710119, y: 4858232.933605842, }, { x: 12952159.810389748, y: 4858223.449482893, }, { x: 12952162.532997137, y: 4858196.9427767545, }, { x: 12952172.755045319, y: 4858146.897168553, }, { x: 12952179.958089378, y: 4858120.216771117, }, { x: 12952191.658258049, y: 4858079.657970377, }, { x: 12952208.58059935, y: 4858022.51880722, }, { x: 12952216.501576891, y: 4857997.283134168, }, { x: 12952225.680391517, y: 4857966.100288983, }, { x: 12952269.24519301, y: 4857823.342887307, }, { x: 12952302.724863112, y: 4857711.949002681, }, ], }, { id: "13", source: "26", target: "27", class: "地铁十号线", name: "地铁十号线 0", controlPoints: [ { x: 12964391.173261674, y: 4847959.964747035, }, { x: 12964381.421162914, y: 4847238.950861313, }, { x: 12964379.013229802, y: 4847130.369249381, }, { x: 12964369.707333228, y: 4846953.233573841, }, { x: 12964365.098653296, y: 4846899.529372901, }, { x: 12964350.271597194, y: 4846844.7236321755, }, { x: 12964328.613459915, y: 4846773.943192761, }, { x: 12964303.571447244, y: 4846720.321707801, }, { x: 12964261.49123042, y: 4846658.767114734, }, { x: 12964219.422329223, y: 4846606.356004327, }, { x: 12964163.72308854, y: 4846548.283066274, }, { x: 12964117.115347376, y: 4846498.174184149, }, { x: 12963719.24125982, y: 4846081.363070078, }, { x: 12963666.940189386, y: 4846020.980269377, }, { x: 12963651.029381108, y: 4846008.466281171, }, { x: 12963640.792827746, y: 4845993.645627467, }, { x: 12963630.555030722, y: 4845977.682026026, }, { x: 12963622.579870086, y: 4845954.85254285, }, { x: 12963622.547271827, y: 4845927.422297171, }, { x: 12963624.705055857, y: 4845832.5516995825, }, { x: 12963605.106422728, y: 4844950.156548626, }, { x: 12963600.552929461, y: 4844939.887775902, }, { x: 12963641.28504856, y: 4844029.840890613, }, { x: 12963635.07102118, y: 4843895.785437119, }, { x: 12963592.56494142, y: 4843790.304489117, }, { x: 12963515.79594813, y: 4843723.544249312, }, { x: 12963437.02641232, y: 4843673.039785006, }, { x: 12963372.392513098, y: 4843630.608396946, }, { x: 12963273.452605404, y: 4843594.387913362, }, { x: 12963212.653908446, y: 4843577.914113967, }, { x: 12963206.82489125, y: 4843576.334664474, }, { x: 12963057.427614385, y: 4843550.431693091, }, { x: 12962954.477380954, y: 4843548.741287049, }, { x: 12962788.932332132, y: 4843539.119846538, }, { x: 12960734.413928954, y: 4843579.436506579, }, { x: 12960615.677401308, y: 4843579.296389959, }, { x: 12959224.804679275, y: 4843577.132908265, }, { x: 12958165.962075146, y: 4843552.786071934, }, { x: 12958015.842937116, y: 4843539.299682281, }, { x: 12957633.083574392, y: 4843505.052930688, }, { x: 12956758.552751072, y: 4843474.381786778, }, { x: 12956086.236845858, y: 4843457.686331021, }, { x: 12955417.836020822, y: 4843562.642953932, }, { x: 12955413.075883733, y: 4843564.0987397935, }, { x: 12955318.578314304, y: 4843592.994666116, }, { x: 12955279.765356282, y: 4843598.897849127, }, { x: 12955190.622782081, y: 4843602.847728858, }, { x: 12953646.394080758, y: 4843575.957979132, }, { x: 12953060.552869217, y: 4843574.760301962, }, { x: 12952787.031931885, y: 4843571.511276698, }, { x: 12951953.230827896, y: 4843561.903501986, }, { x: 12951924.357645055, y: 4843559.360785293, }, { x: 12951835.590379665, y: 4843551.541948503, }, { x: 12951527.588141518, y: 4843484.482094485, }, { x: 12951075.84273588, y: 4843410.169546208, }, { x: 12950795.208394462, y: 4843386.56777375, }, { x: 12950199.79003986, y: 4843370.818621907, }, { x: 12950187.299179578, y: 4843370.485690744, }, { x: 12948755.739655264, y: 4843370.555741397, }, { x: 12948301.7684026, y: 4843375.188304583, }, { x: 12948278.325845689, y: 4843375.123114149, }, { x: 12947913.423896424, y: 4843373.865129756, }, { x: 12947592.303468505, y: 4843394.1161822025, }, { x: 12947581.215097992, y: 4843394.815685296, }, { x: 12947415.424213238, y: 4843437.701399312, }, { x: 12947274.850617228, y: 4843509.5493655335, }, { x: 12947145.066987505, y: 4843631.989033849, }, { x: 12947083.745603528, y: 4843765.448522134, }, { x: 12947029.622192265, y: 4843916.987015813, }, { x: 12946979.091048203, y: 4844090.2070025485, }, { x: 12946955.102622215, y: 4844184.990607465, }, { x: 12946945.915349547, y: 4844319.830258014, }, { x: 12946923.770701075, y: 4845315.372927731, }, { x: 12946851.421569752, y: 4846551.5626413245, }, { x: 12946848.88594415, y: 4846594.6202231655, }, { x: 12946848.609652413, y: 4846598.19993173, }, { x: 12946696.54362537, y: 4848569.1295227185, }, { x: 12946757.730386814, y: 4848764.400754196, }, { x: 12946757.762984468, y: 4848770.602855413, }, { x: 12946761.025258096, y: 4849389.514336067, }, { x: 12946767.82605037, y: 4850217.041711847, }, { x: 12946789.423173606, y: 4850282.143556595, }, { x: 12946825.465052422, y: 4850311.148186556, }, { x: 12947052.561481878, y: 4850452.686121019, }, { x: 12947214.803034527, y: 4850514.554585377, }, { x: 12947308.555685857, y: 4850529.261912783, }, { x: 12947449.196901781, y: 4850533.256072254, }, { x: 12947590.121115766, y: 4850533.639384969, }, { x: 12947604.269979956, y: 4850533.6780554075, }, { x: 12947595.595432382, y: 4853171.930337626, }, { x: 12947588.6332791, y: 4853230.507756927, }, { x: 12947570.25534986, y: 4853385.134998881, }, { x: 12947534.132989677, y: 4853500.7123848, }, { x: 12947451.113532243, y: 4853616.16379296, }, { x: 12947332.03107398, y: 4853706.215145492, }, { x: 12947133.576039799, y: 4853828.591678857, }, { x: 12946866.97284939, y: 4854028.085858982, }, { x: 12946608.167520212, y: 4854187.260197411, }, { x: 12946364.738988684, y: 4854328.7254704805, }, { x: 12946303.257037977, y: 4854430.402571901, }, { x: 12946252.383757986, y: 4854573.552461346, }, { x: 12946214.461752877, y: 4854793.706838007, }, { x: 12946220.215499429, y: 4854990.273434222, }, { x: 12946219.011349382, y: 4855034.084710322, }, { x: 12946156.333146382, y: 4855155.899273862, }, { x: 12946061.71710423, y: 4855352.240931815, }, { x: 12946050.635431375, y: 4855405.652363556, }, { x: 12946036.841429455, y: 4855472.970938698, }, { x: 12945937.184814524, y: 4856212.898218268, }, { x: 12945963.10362221, y: 4857094.046675076, }, { x: 12945958.921351675, y: 4857134.026535522, }, { x: 12945884.03047807, y: 4857857.218830575, }, { x: 12945847.638054904, y: 4858399.611054495, }, { x: 12945847.280553274, y: 4859007.224022067, }, { x: 12945860.526034107, y: 4859226.599693325, }, { x: 12945864.842806887, y: 4859298.0925262105, }, { x: 12945879.5175261, y: 4859405.1651427485, }, { x: 12945886.625513952, y: 4859589.651325276, }, { x: 12945864.662784807, y: 4859694.379973758, }, { x: 12945784.912348324, y: 4859882.159043464, }, { x: 12945727.11821354, y: 4859994.151868572, }, { x: 12945701.784202412, y: 4860124.311216468, }, { x: 12945698.14559977, y: 4860174.944243185, }, { x: 12945452.47590781, y: 4860713.3477798365, }, { x: 12945196.058016783, y: 4861128.770078741, }, { x: 12945092.686995683, y: 4861317.482488749, }, { x: 12945051.578445194, y: 4861392.531520205, }, { x: 12945015.437229244, y: 4861490.129152049, }, { x: 12945008.163701242, y: 4861576.939256895, }, { x: 12945015.284018965, y: 4861718.049761452, }, { x: 12945022.23002506, y: 4861756.836245517, }, { x: 12945035.651318152, y: 4861797.3254907355, }, { x: 12945054.888690906, y: 4861837.528089324, }, { x: 12945105.325637072, y: 4861946.179124048, }, { x: 12945125.370065786, y: 4861974.055941134, }, { x: 12945163.446826743, y: 4862019.098382124, }, { x: 12945194.809906306, y: 4862048.391273372, }, { x: 12945228.090067945, y: 4862073.16642714, }, { x: 12945255.305523323, y: 4862092.36230406, }, { x: 12945285.556679495, y: 4862110.414454173, }, { x: 12945315.808265274, y: 4862128.467023728, }, { x: 12945361.54760602, y: 4862142.217026062, }, { x: 12945487.830327151, y: 4862156.985505024, }, ], }, { id: "14", source: "28", target: "29", class: "地铁十四号线", name: "地铁十四号线 0", controlPoints: [ { x: 12937234.877597623, y: 4846515.674866713, }, { x: 12937368.988537306, y: 4846593.191490097, }, { x: 12937461.335291399, y: 4846647.398606839, }, { x: 12937532.375518117, y: 4846688.019702177, }, { x: 12937591.769328088, y: 4846720.059432032, }, { x: 12937621.188342465, y: 4846732.002843995, }, { x: 12937671.789557256, y: 4846748.737535954, }, { x: 12937709.602904188, y: 4846758.320650579, }, { x: 12937735.762316125, y: 4846763.326932602, }, { x: 12937752.397758542, y: 4846765.615152837, }, { x: 12937773.44091199, y: 4846768.332774585, }, { x: 12937804.297495496, y: 4846770.764304414, }, { x: 12937827.33427437, y: 4846772.051537565, }, { x: 12937868.008451082, y: 4846771.479321919, }, { x: 12937892.32897584, y: 4846770.33498424, }, { x: 12937918.075058706, y: 4846766.901995257, }, { x: 12937940.834554123, y: 4846763.6122220345, }, { x: 12937968.574529182, y: 4846758.463006948, }, { x: 12937995.180239107, y: 4846751.025023762, }, { x: 12938017.517118562, y: 4846745.160619812, }, { x: 12938042.132414829, y: 4846737.43681869, }, { x: 12938076.570282334, y: 4846723.276240112, }, { x: 12938122.822349729, y: 4846702.393192925, }, { x: 12938155.702757211, y: 4846683.512634498, }, { x: 12938188.444042044, y: 4846662.62954278, }, { x: 12938219.76602793, y: 4846639.600848661, }, { x: 12938250.095861865, y: 4846614.140497331, }, { x: 12938278.438376905, y: 4846585.962328421, }, { x: 12938304.220769178, y: 4846557.783944012, }, { x: 12938329.579807637, y: 4846527.173999285, }, { x: 12938353.520818293, y: 4846493.274026497, }, { x: 12938372.907309297, y: 4846461.6623603245, }, { x: 12938391.017690128, y: 4846427.046785262, }, { x: 12938412.561981687, y: 4846377.125676343, }, { x: 12938434.974010698, y: 4846316.476277426, }, { x: 12938448.248669473, y: 4846281.574595996, }, { x: 12938475.656359944, y: 4846207.766580478, }, { x: 12938490.211433839, y: 4846172.579389068, }, { x: 12938507.041724533, y: 4846137.6790905995, }, { x: 12938526.29072453, y: 4846102.493274418, }, { x: 12938542.26056133, y: 4846073.028826507, }, { x: 12938584.740041988, y: 4846003.660309321, }, { x: 12938633.06400581, y: 4845924.638571542, }, { x: 12938715.454181843, y: 4845792.771941782, }, { x: 12938776.553557053, y: 4845700.585488995, }, { x: 12938781.398345944, y: 4845694.149817628, }, { x: 12938800.081236716, y: 4845673.873968367, }, { x: 12938830.820290571, y: 4845645.815687927, }, { x: 12938844.393556165, y: 4845633.390067325, }, { x: 12938873.132778017, y: 4845610.143030206, }, { x: 12938936.183000699, y: 4845573.274183875, }, { x: 12938969.9751077, y: 4845523.292870295, }, { x: 12939008.30658488, y: 4845483.611718048, }, { x: 12939046.62636937, y: 4845453.553428374, }, { x: 12939107.67397802, y: 4845425.508528395, }, { x: 12939139.988430338, y: 4845415.095566754, }, { x: 12939215.636890687, y: 4845415.718690437, }, { x: 12939308.039270518, y: 4845421.266472513, }, { x: 12939491.25690715, y: 4845458.350894194, }, { x: 12939790.511140315, y: 4845556.207267058, }, { x: 12939988.628771447, y: 4845616.1622475535, }, { x: 12940117.839141306, y: 4845661.911291016, }, { x: 12940686.897376765, y: 4845952.2196258595, }, { x: 12941074.89764744, y: 4846157.503429323, }, { x: 12941335.171058182, y: 4846317.370755986, }, { x: 12941559.500148436, y: 4846435.253157876, }, { x: 12941942.0737714, y: 4846649.584496282, }, { x: 12942044.003008543, y: 4846663.89086179, }, { x: 12942128.18335582, y: 4846652.232800751, }, { x: 12942566.46418881, y: 4846526.042660932, }, { x: 12942889.715147126, y: 4846450.953434545, }, { x: 12943968.393642, y: 4846408.250017698, }, { x: 12944809.837601995, y: 4846425.649451, }, { x: 12944985.099897848, y: 4846441.60822536, }, { x: 12945546.215890277, y: 4846492.747584046, }, { x: 12946211.229001617, y: 4846547.780306945, }, ], }, { id: "15", source: "30", target: "31", class: "地铁十五号线", name: "地铁十五号线 0", controlPoints: [ { x: 12975220.360613192, y: 4878868.526210992, }, { x: 12975170.101829547, y: 4878482.810853661, }, { x: 12975127.393577926, y: 4878166.084186471, }, { x: 12975102.3383307, y: 4877971.094415046, }, { x: 12975067.230635904, y: 4877703.212676576, }, { x: 12975028.196639525, y: 4877408.433615002, }, { x: 12974992.782733576, y: 4877135.782488413, }, { x: 12974961.616855532, y: 4876898.418269849, }, { x: 12974957.635438241, y: 4876867.667671654, }, { x: 12974924.692424836, y: 4876613.225913413, }, { x: 12974904.122140514, y: 4876457.185169152, }, { x: 12974891.114395186, y: 4876358.838107704, }, { x: 12974881.80755435, y: 4876318.801830084, }, { x: 12974850.30174708, y: 4876128.145737729, }, { x: 12974841.600142721, y: 4876060.242186066, }, { x: 12974833.693115635, y: 4875993.44712488, }, { x: 12974824.851303473, y: 4875896.879010218, }, { x: 12974823.581860177, y: 4875861.890374971, }, { x: 12974804.231609207, y: 4875717.818793602, }, { x: 12974793.363254767, y: 4875644.593833729, }, { x: 12974780.733046675, y: 4875579.452634726, }, { x: 12974765.457217943, y: 4875526.588724708, }, { x: 12974748.090285787, y: 4875469.247595661, }, { x: 12974731.657055452, y: 4875430.44830189, }, { x: 12974707.759133428, y: 4875374.935044397, }, { x: 12974682.982388051, y: 4875324.213162166, }, { x: 12974660.60794111, y: 4875285.743106426, }, { x: 12974635.85688353, y: 4875245.7891169265, }, { x: 12974592.33221722, y: 4875182.6007377645, }, { x: 12974565.515120054, y: 4875148.641781552, }, { x: 12974477.340428105, y: 4875046.200795493, }, { x: 12974324.23997027, y: 4874868.727412534, }, { x: 12974285.225031873, y: 4874824.06709895, }, { x: 12974250.676817749, y: 4874784.765451768, }, { x: 12974226.548435159, y: 4874754.982961457, }, { x: 12974179.793554721, y: 4874702.287665765, }, { x: 12974152.700378012, y: 4874674.611620291, }, { x: 12974102.993937358, y: 4874629.4094777135, }, { x: 12974057.281876976, y: 4874592.149864237, }, { x: 12974010.571259402, y: 4874557.10058754, }, { x: 12973965.349593911, y: 4874523.243715123, }, { x: 12973927.86306645, y: 4874495.325444062, }, { x: 12973778.829987278, y: 4874388.442810681, }, { x: 12973631.292726409, y: 4874281.260318043, }, { x: 12973511.128084678, y: 4874193.07702723, }, { x: 12973457.885669941, y: 4874152.090015151, }, { x: 12973424.569167605, y: 4874125.653511811, }, { x: 12973401.064728435, y: 4874103.948181291, }, { x: 12973364.466450525, y: 4874069.155318013, }, { x: 12973343.040548371, y: 4874047.737895291, }, { x: 12973301.971003683, y: 4874004.595285215, }, { x: 12973268.333740914, y: 4873965.001992706, }, { x: 12973223.968151508, y: 4873907.523655236, }, { x: 12973200.145078428, y: 4873874.757068463, }, { x: 12973184.359140303, y: 4873851.817254196, }, { x: 12973151.288220981, y: 4873799.065100245, }, { x: 12973133.104508085, y: 4873765.071843533, }, { x: 12973115.220516248, y: 4873731.975402937, }, { x: 12973083.514099035, y: 4873666.6145877475, }, { x: 12972958.272448545, y: 4873409.226124313, }, { x: 12972918.910218379, y: 4873326.610352403, }, { x: 12972826.476255693, y: 4873134.840144364, }, { x: 12972795.763337882, y: 4873070.719005933, }, { x: 12972744.76742065, y: 4872959.163678453, }, { x: 12972720.60264992, y: 4872901.886303345, }, { x: 12972659.997036628, y: 4872735.667320859, }, { x: 12972643.299525585, y: 4872699.580940345, }, { x: 12972559.100747146, y: 4872455.805418115, }, { x: 12972532.783339068, y: 4872369.677216135, }, { x: 12972491.590280673, y: 4872256.099208747, }, { x: 12972431.316032, y: 4872100.655541013, }, { x: 12972411.705557901, y: 4872052.949093282, }, { x: 12972344.317184499, y: 4871873.754390362, }, { x: 12972344.317084517, y: 4871873.754090381, }, { x: 12972283.901539784, y: 4871713.096747656, }, { x: 12972231.51025757, y: 4871590.704161345, }, { x: 12972220.786418218, y: 4871568.055674147, }, { x: 12972187.677583814, y: 4871506.46596912, }, { x: 12972159.917606726, y: 4871462.740223999, }, { x: 12972122.405523332, y: 4871409.778587388, }, { x: 12972070.897276413, y: 4871345.708445298, }, { x: 12972018.521820415, y: 4871290.250138916, }, { x: 12971949.740475345, y: 4871227.65827687, }, { x: 12971856.352377752, y: 4871157.9745282065, }, { x: 12971744.543129945, y: 4871096.1426233165, }, { x: 12971666.305498093, y: 4871059.28347291, }, { x: 12971573.517186211, y: 4871028.317100962, }, { x: 12971543.275268642, y: 4871019.710796947, }, { x: 12970313.75580163, y: 4871029.4038401535, }, { x: 12969743.624482477, y: 4871013.157693107, }, { x: 12969526.746136123, y: 4871006.97216711, }, { x: 12969268.713759044, y: 4870954.619065353, }, { x: 12969027.21710455, y: 4870806.293398591, }, { x: 12968695.732934553, y: 4870386.919417365, }, { x: 12968267.842089783, y: 4869845.614706303, }, { x: 12968041.977084596, y: 4869507.853755934, }, { x: 12967897.801472468, y: 4868972.889715916, }, { x: 12967878.337220326, y: 4867594.394019558, }, { x: 12967868.77862341, y: 4866238.919959571, }, { x: 12967801.717744218, y: 4865970.777359848, }, { x: 12967494.283058798, y: 4865925.768674796, }, { x: 12965837.973847104, y: 4865743.023798019, }, { x: 12965348.196035301, y: 4865688.751628207, }, { x: 12964443.21307059, y: 4865516.203149938, }, ], }, { id: "16", source: "32", target: "33", class: "机场轻轨线", name: "机场轻轨线 0", controlPoints: [ { x: 12981108.370146083, y: 4871488.68313175, }, { x: 12981018.508214273, y: 4871439.9092021575, }, { x: 12980902.535834748, y: 4871405.203097882, }, { x: 12980821.525095403, y: 4871396.07635756, }, { x: 12980751.756629316, y: 4871395.085485736, }, { x: 12980685.769679295, y: 4871406.921907764, }, { x: 12980609.835639, y: 4871428.117243195, }, { x: 12980553.791983627, y: 4871454.35924438, }, { x: 12980504.260708505, y: 4871483.782440005, }, { x: 12980435.350114407, y: 4871539.621344493, }, { x: 12980398.504969673, y: 4871582.03131289, }, { x: 12980362.007896207, y: 4871632.577822356, }, { x: 12980332.654508604, y: 4871686.360369531, }, { x: 12980319.13294245, y: 4871720.246401924, }, { x: 12980306.26908758, y: 4871757.385237568, }, { x: 12980293.763164897, y: 4871806.2405863255, }, { x: 12980277.698010115, y: 4871929.260816189, }, { x: 12980261.290169481, y: 4871965.0230897125, }, { x: 12980254.749320468, y: 4871910.852033942, }, { x: 12980243.756181171, y: 4871816.594568528, }, { x: 12980227.70573535, y: 4871752.941176994, }, { x: 12980203.072226636, y: 4871672.165283503, }, { x: 12980150.33990551, y: 4871582.889266779, }, { x: 12980101.34029352, y: 4871516.884384831, }, { x: 12980048.722460367, y: 4871461.910039693, }, { x: 12979996.111785132, y: 4871413.06501025, }, { x: 12979909.333892826, y: 4871359.422428334, }, { x: 12979799.058829894, y: 4871312.3731178045, }, { x: 12979720.936799372, y: 4871295.456660487, }, { x: 12979624.500482768, y: 4871274.924462654, }, { x: 12979479.39873571, y: 4871277.213494264, }, { x: 12979085.453077132, y: 4871280.917372964, }, { x: 12978992.156225236, y: 4871279.384364794, }, { x: 12978956.177897697, y: 4871277.666599098, }, { x: 12978900.674255166, y: 4871271.113841657, }, { x: 12978860.293281717, y: 4871262.702607095, }, { x: 12978764.752916442, y: 4871245.472966051, }, { x: 12978664.480746558, y: 4871226.718917767, }, { x: 12978629.714270562, y: 4871220.650472208, }, { x: 12978620.414652059, y: 4871219.068466421, }, { x: 12978564.580504624, y: 4871213.590081386, }, { x: 12978460.737579372, y: 4871195.649671084, }, { x: 12978328.733081415, y: 4871172.822299577, }, { x: 12978213.58406164, y: 4871153.546776074, }, { x: 12978126.884770632, y: 4871139.996553964, }, { x: 12978030.808147773, y: 4871127.039056859, }, { x: 12977949.096244726, y: 4871117.637013953, }, { x: 12977857.7281794, y: 4871107.719554274, }, { x: 12977818.256715368, y: 4871103.431990254, }, { x: 12977782.926936783, y: 4871099.961185381, }, { x: 12977738.76375114, y: 4871094.860768784, }, { x: 12977699.015983863, y: 4871089.466841593, }, { x: 12977670.034107389, y: 4871085.695982234, }, { x: 12977617.58207723, y: 4871075.083050405, }, { x: 12977586.096101644, y: 4871069.051658005, }, { x: 12977553.816080883, y: 4871065.107010753, }, { x: 12977547.258727068, y: 4871063.901849335, }, { x: 12977530.618654177, y: 4871060.843754747, }, { x: 12977510.63402144, y: 4871057.271591576, }, { x: 12977488.410456756, y: 4871052.304085646, }, { x: 12977476.108263735, y: 4871049.825167599, }, { x: 12977449.974956136, y: 4871043.750099359, }, { x: 12977426.211063186, y: 4871036.9651420405, }, { x: 12977355.623273922, y: 4871014.777517495, }, { x: 12977296.479809767, y: 4870992.125603299, }, { x: 12977282.77631216, y: 4870986.002440447, }, { x: 12977251.719621776, y: 4870972.154493815, }, { x: 12977247.24550043, y: 4870969.812148521, }, { x: 12977238.854476603, y: 4870965.421079147, }, { x: 12977209.761773894, y: 4870950.136411922, }, { x: 12977096.757856315, y: 4870889.44525773, }, { x: 12976968.08990173, y: 4870816.956775016, }, { x: 12976780.16768485, y: 4870720.01310895, }, { x: 12976677.82368606, y: 4870666.528023298, }, { x: 12976655.8764118, y: 4870655.5205783425, }, { x: 12976529.223142704, y: 4870592.317432991, }, { x: 12976428.586317737, y: 4870542.427981049, }, { x: 12976366.5421185, y: 4870518.407870099, }, { x: 12976329.380473636, y: 4870506.354736436, }, { x: 12976271.82754423, y: 4870490.321866817, }, { x: 12976228.111302977, y: 4870481.388277324, }, { x: 12976188.09288433, y: 4870478.038546045, }, { x: 12976149.436712662, y: 4870471.373423314, }, { x: 12976071.072179394, y: 4870465.607346994, }, { x: 12975965.86990555, y: 4870455.646798379, }, { x: 12975917.917454332, y: 4870449.027466127, }, { x: 12975868.894021038, y: 4870442.773831003, }, { x: 12975820.580020344, y: 4870433.638390911, }, { x: 12975790.158459982, y: 4870426.94054179, }, { x: 12975775.838848663, y: 4870422.328125062, }, { x: 12975751.13866662, y: 4870414.524700168, }, { x: 12975725.00528259, y: 4870405.648373743, }, { x: 12975714.620193584, y: 4870400.657944233, }, { x: 12975694.938773984, y: 4870397.150636553, }, { x: 12975674.888572035, y: 4870388.966441453, }, { x: 12975636.937384691, y: 4870373.667942694, }, { x: 12975612.227725828, y: 4870361.187195985, }, { x: 12975582.510264473, y: 4870348.370360326, }, { x: 12975500.513648823, y: 4870309.887833572, }, { x: 12975383.793644667, y: 4870256.097796813, }, { x: 12975133.184359929, y: 4870136.739612404, }, { x: 12974949.40711058, y: 4870050.794763821, }, { x: 12974941.365436705, y: 4870047.009858454, }, { x: 12974724.15676446, y: 4869944.777526178, }, { x: 12974559.111049827, y: 4869868.410730108, }, { x: 12974550.453614099, y: 4869864.520617537, }, { x: 12974441.55043712, y: 4869814.212693192, }, { x: 12974270.106768792, y: 4869734.071269941, }, { x: 12974091.838388277, y: 4869651.027056911, }, { x: 12973885.444597295, y: 4869555.245051317, }, { x: 12973766.248404168, y: 4869500.831533556, }, { x: 12973540.981958374, y: 4869392.930468844, }, { x: 12973391.381564768, y: 4869323.244557277, }, { x: 12973283.232700225, y: 4869272.859937838, }, { x: 12972573.852092165, y: 4868943.251794805, }, { x: 12970368.479611576, y: 4867801.281579257, }, { x: 12970186.368543653, y: 4867581.247939134, }, { x: 12970138.160652429, y: 4867522.999803067, }, { x: 12970014.83652081, y: 4867376.428914912, }, { x: 12969982.687756885, y: 4867339.028822399, }, { x: 12969938.176704682, y: 4867288.1582316635, }, { x: 12969884.318320546, y: 4867223.8002079725, }, { x: 12969842.279029265, y: 4867174.850547206, }, { x: 12969736.51761531, y: 4867052.928304552, }, { x: 12969715.618553909, y: 4867028.835423228, }, { x: 12969620.004793288, y: 4866917.186788599, }, { x: 12969438.04374979, y: 4866711.844669058, }, { x: 12969408.156057132, y: 4866677.285747163, }, { x: 12969324.820910655, y: 4866578.791680055, }, { x: 12969226.67533753, y: 4866469.379122947, }, { x: 12968956.364812195, y: 4866149.976631404, }, { x: 12968801.20089387, y: 4865953.939934027, }, { x: 12968661.628187554, y: 4865774.016041136, }, { x: 12968440.203180425, y: 4865520.086029257, }, { x: 12968418.752663735, y: 4865496.720383862, }, { x: 12968265.16366474, y: 4865329.4158122465, }, { x: 12968082.376416814, y: 4865118.794538391, }, { x: 12967977.74367467, y: 4865003.326373822, }, { x: 12967875.580874648, y: 4864890.602510729, }, { x: 12967828.859212246, y: 4864840.529032915, }, { x: 12967771.529788392, y: 4864773.642307851, }, { x: 12967754.0789727, y: 4864752.1729925005, }, { x: 12967615.98897636, y: 4864590.439552254, }, { x: 12967559.654778784, y: 4864523.543494982, }, { x: 12967512.793535465, y: 4864468.1316355625, }, { x: 12967489.97373297, y: 4864440.960919648, }, { x: 12967391.600998314, y: 4864324.055311191, }, { x: 12967258.997379664, y: 4864167.803726059, }, { x: 12967157.800077152, y: 4864048.489056851, }, { x: 12967072.064892631, y: 4863952.160647396, }, { x: 12966932.938263306, y: 4863786.109663975, }, { x: 12966772.422852328, y: 4863597.399173657, }, { x: 12966615.568496268, y: 4863412.808523439, }, { x: 12966305.336633127, y: 4863047.703772259, }, { x: 12966269.190687215, y: 4863001.279273752, }, { x: 12965833.711641828, y: 4862475.155696717, }, { x: 12965806.851898653, y: 4862442.704151941, }, { x: 12964858.528949967, y: 4861327.4237803, }, { x: 12964224.475284964, y: 4860561.038983111, }, { x: 12963811.623681322, y: 4860051.71716615, }, { x: 12963154.244359475, y: 4859240.959120094, }, { x: 12962659.851017611, y: 4858630.950164011, }, { x: 12962035.08051321, y: 4857953.39954861, }, { x: 12961929.533509394, y: 4857864.163282811, }, { x: 12961663.821656032, y: 4857639.499910775, }, { x: 12961465.562880669, y: 4857485.1627320545, }, { x: 12961385.775293019, y: 4857425.3359782435, }, ], }, ], }; const colors = [ "rgb(64, 174, 247)", "rgb(108, 207, 169)", "rgb(157, 223, 125)", "rgb(240, 198, 74)", "rgb(221, 158, 97)", "rgb(141, 163, 112)", "rgb(115, 136, 220)", "rgb(133, 88, 219)", "rgb(203, 135, 226)", "rgb(227, 137, 163)", ]; const { nodes } = data; const { edges } = data; const classMap = new Map(); let classId = 0; nodes.forEach((node) => { node.y = -node.y; }); edges.forEach((edge) => { edge.id = `edge-${edge.id}`; // edge cluster if (edge.class && classMap.get(edge.class) === undefined) { classMap.set(edge.class, classId); classId++; } const cid = classMap.get(edge.class); edge.color = colors[cid % colors.length]; const { controlPoints } = edge; controlPoints.forEach((cp) => { cp.y = -cp.y; }); }); export { nodes, edges, data }; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/metro-lines/index.js ================================================ import F6 from "@antv/f6-wx"; import { nodes, edges, data } from "./data"; /** * metro-lines */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); wx.setBackgroundColor({ backgroundColorTop: "#000000", backgroundColorBottom: "#000000", }); // custom the node F6.registerNode( "breath-node", { afterDraw(cfg, group) { const r = cfg.size / 2; const back1 = group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r, fill: cfg.color || (cfg.style && cfg.style.fill), opacity: 0.6, }, name: "back1-shape", }); const back2 = group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r, fill: cfg.color, // 为了显示清晰,随意设置了颜色 opacity: 0.6, }, name: "back2-shape", }); const back3 = group.addShape("circle", { zIndex: -1, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, name: "back3-shape", }); group.sort(); // 排序,根据zIndex 排序 const delayBase = Math.random() * 2000; back1.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase, // 无延迟 }, ); back2.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase + 1000, // 1 秒延迟 }, ); back3.animate( { // 逐渐放大,并消失 r: r + 10, opacity: 0.0, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: delayBase + 2000, // 2 秒延迟 }, ); }, }, "circle", ); // custom the edge F6.registerEdge( "running-polyline", { afterDraw(cfg, group) { const shape = group.get("children")[0]; const length = shape.getTotalLength(); let circleCount = Math.ceil(length / 20); circleCount = circleCount === 0 ? 1 : circleCount; const _loop = function _loop(i) { const delay = Math.random() * 1000; const start = shape.getPoint(i / circleCount); const circle = group.addShape("circle", { attrs: { x: start.x, y: start.y, r: 0.8, fill: "#A0F3AF", shadowColor: "#fff", shadowBlur: 30, }, name: "circle-shape", }); circle.animate( (ratio) => { ratio += i / circleCount; if (ratio > 1) { ratio %= 1; } const tmpPoint = shape.getPoint(ratio); return { x: tmpPoint.x, y: tmpPoint.y, }; }, { repeat: true, duration: 10 * length, easing: "easeCubic", delay, }, ); }; for (let i = 0; i < circleCount; i++) { _loop(i); } }, }, "polyline", ); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; function scaleNodesPoints(nodes_, edges_, graphSize) { const size = graphSize[0] < graphSize[1] ? graphSize[0] : graphSize[1]; let minX = 99999999999999999; let maxX = -99999999999999999; let minY = 99999999999999999; let maxY = -99999999999999999; nodes_.forEach((node) => { if (node.x > maxX) maxX = node.x; if (node.x < minX) minX = node.x; if (node.y > maxY) maxY = node.y; if (node.y < minY) minY = node.y; }); edges_.forEach((edge) => { const { controlPoints } = edge; controlPoints.forEach((cp) => { if (cp.x > maxX) maxX = cp.x; if (cp.x < minX) minX = cp.x; if (cp.y > maxY) maxY = cp.y; if (cp.y < minY) minY = cp.y; }); }); const xScale = maxX - minX; const yScale = maxY - minY; nodes_.forEach((node) => { node.orix = node.x; node.oriy = node.y; node.x = ((node.x - minX) / xScale) * size; node.y = ((node.y - minY) / yScale) * size; }); edges_.forEach((edge) => { const { controlPoints } = edge; controlPoints.forEach((cp) => { cp.x = ((cp.x - minX) / xScale) * size; cp.y = ((cp.y - minY) / yScale) * size; }); }); } // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, linkCenter: true, fitView: true, modes: { default: [ { type: "edge-tooltip", formatText: function formatText(model) { const text = model.class; return text; }, }, ], }, defaultNode: { type: "breath-node", size: 3, style: { lineWidth: 0, fill: "rgb(240, 223, 83)", }, }, defaultEdge: { type: "running-polyline", size: 1, color: "rgb(14,142,63)", style: { opacity: 0.4, lineAppendWidth: 3, }, }, }); const graphSize = [500, 500]; scaleNodesPoints(nodes, edges, graphSize); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/metro-lines/index.json ================================================ { "navigationBarTitleText": "地铁路线图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/metro-lines/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/metro-lines/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/mind-map/data.js ================================================ const rawData = { label: "Modeling Methods", id: "0", children: [ { label: "Classification", id: "0-1", color: "#5AD8A6", children: [ { label: "Logistic regression", id: "0-1-1", }, { label: "Linear discriminant analysis", id: "0-1-2", }, { label: "Rules", id: "0-1-3", }, { label: "Decision trees", id: "0-1-4", }, { label: "Naive Bayes", id: "0-1-5", }, { label: "K nearest neighbor", id: "0-1-6", }, { label: "Probabilistic neural network", id: "0-1-7", }, { label: "Support vector machine", id: "0-1-8", }, ], }, { label: "Consensus", id: "0-2", color: "#F6BD16", children: [ { label: "Models diversity", id: "0-2-1", children: [ { label: "Different initializations", id: "0-2-1-1", }, { label: "Different parameter choices", id: "0-2-1-2", }, { label: "Different architectures", id: "0-2-1-3", }, { label: "Different modeling methods", id: "0-2-1-4", }, { label: "Different training sets", id: "0-2-1-5", }, { label: "Different feature sets", id: "0-2-1-6", }, ], }, { label: "Methods", id: "0-2-2", children: [ { label: "Classifier selection", id: "0-2-2-1", }, { label: "Classifier fusion", id: "0-2-2-2", }, ], }, { label: "Common", id: "0-2-3", children: [ { label: "Bagging", id: "0-2-3-1", }, { label: "Boosting", id: "0-2-3-2", }, { label: "AdaBoost", id: "0-2-3-3", }, ], }, ], }, { label: "Regression", id: "0-3", color: "#269A99", children: [ { label: "Multiple linear regression", id: "0-3-1", }, { label: "Partial least squares", id: "0-3-2", }, { label: "Multi-layer feedforward neural network", id: "0-3-3", }, { label: "General regression neural network", id: "0-3-4", }, { label: "Support vector regression", id: "0-3-5", }, ], }, ], }; const dataTransform = (data_) => { const changeData = (d, level = 0, color) => { const data = { ...d, }; switch (level) { case 0: data.type = "dice-mind-map-root"; break; case 1: data.type = "dice-mind-map-sub"; break; default: data.type = "dice-mind-map-leaf"; break; } data.hover = false; if (color) { data.color = color; } if (level === 1 && !d.direction) { if (!d.direction) { data.direction = d.id.charCodeAt(d.id.length - 1) % 2 === 0 ? "right" : "left"; } } if (d.children) { data.children = d.children.map((child) => changeData(child, level + 1, data.color), ); } return data; }; return changeData(data_); }; const result = dataTransform(rawData); export default result; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/mind-map/index.js ================================================ import F6 from "@antv/f6-wx"; import result from "./data"; /** * mind-map */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { const { Util } = F6; // const colorArr = [ // '#5B8FF9', // '#5AD8A6', // '#5D7092', // '#F6BD16', // '#6F5EF9', // '#6DC8EC', // '#D3EEF9', // '#DECFEA', // '#FFE0C7', // '#1E9493', // '#BBDEDE', // '#FF99C3', // '#FFE0ED', // '#CDDDFD', // '#CDF3E4', // '#CED4DE', // '#FCEBB9', // '#D3CEFD', // '#945FB9', // '#FF9845', // ]; F6.registerNode( "dice-mind-map-root", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 16)[0] + 24; const stroke = cfg.style.stroke || "#096dd9"; return ` ${ cfg.label } + `; }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-sub", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 14)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-leaf", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 12)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerBehavior("dice-mindmap", { getEvents() { return { "node:click": "clickNode", "node:dblclick": "editNode", "node:mouseenter": "hoverNode", "node:mouseleave": "hoverNodeOut", }; }, clickNode(evt) { // const model = evt.item.get('model'); const name = evt.target.get("action"); switch (name) { // TODO:这里没办法过语法检查 // case 'add': // const newId = `${model.id}-${ // ((model.children || []).reduce((a, b) => { // const num = Number(b.id.split('-').pop()); // return a < num ? num : a; // }, 0) || 0) + 1 // }`; // evt.currentTarget.updateItem(evt.item, { // children: (model.children || []).concat([ // { // id: newId, // direction: newId.charCodeAt(newId.length - 1) % 2 === 0 ? 'right' : 'left', // label: 'New', // type: 'dice-mind-map-leaf', // color: model.color || colorArr[Math.floor(Math.random() * colorArr.length)], // }, // ]), // }); // evt.currentTarget.layout(false); // break; // case 'delete': // const parent = evt.item.get('parent'); // evt.currentTarget.updateItem(parent, { // children: (parent.get('model').children || []).filter((e) => e.id !== model.id), // }); // evt.currentTarget.layout(false); // break; case "edit": break; default: } }, editNode(evt) { const { item } = evt; const model = item.get("model"); const { x, y } = item.calculateBBox(); const graph = evt.currentTarget; const realPosition = evt.currentTarget.getClientByPoint(x, y); const el = document.createElement("div"); const fontSizeMap = { "dice-mind-map-root": 24, "dice-mind-map-sub": 18, "dice-mind-map-leaf": 16, }; el.style.fontSize = `${fontSizeMap[model.type]}px`; el.style.position = "fixed"; el.style.top = `${realPosition.y}px`; el.style.left = `${realPosition.x}px`; el.style.paddingLeft = "12px"; el.style.transformOrigin = "top left"; el.style.transform = `scale(${evt.currentTarget.getZoom()})`; const input = document.createElement("input"); input.style.border = "none"; input.value = model.label; input.style.width = `${ Util.getTextSize(model.label, fontSizeMap[model.type])[0] }px`; input.className = "dice-input"; el.className = "dice-input"; el.appendChild(input); document.body.appendChild(el); const destroyEl = () => { document.body.removeChild(el); }; const clickEvt = (event) => { if ( !( event.target && event.target.className && event.target.className.includes("dice-input") ) ) { window.removeEventListener("mousedown", clickEvt); window.removeEventListener("scroll", clickEvt); graph.updateItem(item, { label: input.value, }); graph.layout(false); graph.off("wheelZoom", clickEvt); destroyEl(); } }; graph.on("wheelZoom", clickEvt); window.addEventListener("mousedown", clickEvt); window.addEventListener("scroll", clickEvt); input.addEventListener("keyup", (event) => { if (event.key === "Enter") { clickEvt({ target: {}, }); } }); }, hoverNode(evt) { evt.currentTarget.updateItem(evt.item, { hover: true, }); }, hoverNodeOut(evt) { evt.currentTarget.updateItem(evt.item, { hover: false, }); }, }); F6.registerBehavior("scroll-canvas", { getEvents: function getEvents() { return { wheel: "onWheel", }; }, onWheel: function onWheel(ev) { const { graph } = this; if (!graph) { return; } if (ev.ctrlKey) { const canvas = graph.get("canvas"); const point = canvas.getPointByClient(ev.clientX, ev.clientY); let ratio = graph.getZoom(); if (ev.wheelDelta > 0) { ratio += ratio * 0.05; } else { ratio *= ratio * 0.05; } graph.zoomTo(ratio, { x: point.x, y: point.y, }); } else { const x = ev.deltaX || ev.movementX; const y = ev.deltaY || ev.movementY || (-ev.wheelDelta * 125) / 3; graph.translate(-x, -y); } ev.preventDefault(); }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, fitViewPadding: [10, 20], layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: (node) => { return node.level === 0 ? F6.Util.getTextSize(node.label, 16)[0] + 12 : F6.Util.getTextSize(node.label, 12)[0]; }, getVGap: () => { return 10; }, getHGap: () => { return 60; }, getSide: (node) => { return node.data.direction; }, }, defaultEdge: { type: "cubic-horizontal", style: { lineWidth: 2, }, }, minZoom: 0.5, modes: { default: ["drag-canvas", "zoom-canvas", "dice-mindmap"], }, }); this.graph.data(result); this.graph.render(); // this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/mind-map/index.json ================================================ { "navigationBarTitleText": "思维导图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/mind-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/mind-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/sankey/data.js ================================================ const colorArr = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#6F5EF9", "#6DC8EC", "#D3EEF9", "#DECFEA", "#FFE0C7", "#1E9493", "#BBDEDE", "#FF99C3", "#FFE0ED", "#CDDDFD", "#CDF3E4", "#CED4DE", "#FCEBB9", "#D3CEFD", "#945FB9", "#FF9845", ]; const rawData = [ { label: "A", id: "A", to: [ { target: "C", value: 200, }, ], }, { label: "B", id: "B", to: [ { target: "C", value: 400, }, ], }, { label: "C", id: "C", to: [ { target: "D", value: 300, }, { target: "E", value: 300, }, ], }, { label: "D", id: "D", to: [ { target: "F", value: 100, }, { target: "G", value: 200, }, ], }, { label: "E", id: "E", to: [ { target: "F", value: 200, }, { target: "G", value: 100, }, ], }, { label: "F", id: "F", }, { label: "G", id: "G", }, ]; const dataTransform = (data) => { const nodes = []; const edges = []; const nodeRecvMap = {}; data.forEach((node, i) => { const { id, label, color = colorArr[i % colorArr.length], to = [] } = node; let index = 0; to.forEach((rel) => { edges.push({ source: id, target: rel.target, value: rel.value, color, sourceIndex: index, targetIndex: nodeRecvMap[rel.target] || 0, }); index += rel.value || 0; if (rel.value) { nodeRecvMap[rel.target] = (nodeRecvMap[rel.target] || 0) + rel.value; } }); nodes.push({ id, label, color, outSize: index, }); }); nodes.forEach((node) => { node.inSize = nodeRecvMap[node.id] || 0; node.size = [4, Math.max(4, node.inSize, node.outSize)]; }); return { nodes, edges, }; }; const result = dataTransform(rawData); export default result; ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/sankey/index.js ================================================ import F6 from "@antv/f6-wx"; import result from "./data"; import dagreLayout from "@antv/f6-wx/extends/layout/dagreLayout"; /** * sankey */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { F6.registerLayout("dagre", dagreLayout); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); F6.registerNode( "dice-sankey-node", { jsx: (cfg) => ` ${cfg.label} ${cfg.size[1]} `, getAnchorPoints() { return [[0, 0]]; }, }, "single-node", ); F6.registerEdge("dice-sankey-edge", { draw(cfg, group) { const { startPoint, endPoint, color } = cfg; const deltaY1 = Number(cfg.sourceIndex); const deltaY2 = Number(cfg.sourceIndex) + Number(cfg.value); const deltaY3 = Number(cfg.targetIndex); const deltaY4 = Number(cfg.targetIndex) + Number(cfg.value); const quaterX = (Math.abs(endPoint.x - startPoint.x) / 5) * 3; return group.addShape("path", { attrs: { fill: color, opacity: 0.6, path: [ ["M", startPoint.x, startPoint.y + deltaY1], [ "C", endPoint.x - quaterX, startPoint.y + deltaY1, startPoint.x + quaterX, endPoint.y + deltaY3, endPoint.x, endPoint.y + deltaY3, ], ["L", endPoint.x, endPoint.y + deltaY4], [ "C", startPoint.x + quaterX, endPoint.y + deltaY4, endPoint.x - quaterX, startPoint.y + deltaY2, startPoint.x, startPoint.y + deltaY2, ], ["L", startPoint.x, startPoint.y + deltaY1], ["Z"], ], }, }); }, }); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.Graph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, defaultNode: { type: "dice-sankey-node", }, defaultEdge: { type: "dice-sankey-edge", }, fitView: true, fitViewPadding: 60, layout: { type: "dagre", rankdir: "LR", nodesep: 10, ranksep: 130, align: "ul", }, }); this.graph.data(result); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/sankey/index.json ================================================ { "navigationBarTitleText": "桑基图", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/sankey/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-scene-case/pages/scene-case/sankey/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } .f6-canvas { z-index: 10; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/basic-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/basic-dendrogram/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 生态树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "dendrogram", direction: "LR", nodeSep: 30, rankSep: 100, getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node((node) => { return { label: node.id, labelCfg: { offset: 5, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/basic-dendrogram/index.json ================================================ { "navigationBarTitleText": "生态树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/basic-dendrogram/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/basic-dendrogram/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression" }, { id: "Linear discriminant analysis" }, { id: "Rules" }, { id: "Decision trees" }, { id: "Naive Bayes" }, { id: "K nearest neighbor" }, { id: "Probabilistic neural network" }, { id: "Support vector machine" }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations" }, { id: "Different parameter choices" }, { id: "Different architectures" }, { id: "Different modeling methods" }, { id: "Different training sets" }, { id: "Different feature sets" }, ], }, { id: "Methods", children: [ { id: "Classifier selection" }, { id: "Classifier fusion" }, ], }, { id: "Common", children: [{ id: "Bagging" }, { id: "Boosting" }, { id: "AdaBoost" }], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression" }, { id: "Partial least squares" }, { id: "Multi-layer feedforward neural network" }, { id: "General regression neural network" }, { id: "Support vector regression" }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box/index.js ================================================ // TreeGraph/file-system/index.js import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data.js"; Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 2, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); this.graph.node((node) => { return { label: node.id, labelCfg: { offset: 10, position: node.children && node.children.length > 0 ? "left" : "right", }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box/index.json ================================================ { "navigationBarTitleText": "紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box-left-align/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box-left-align/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data.js"; /** * 节点左右对齐的紧凑树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const fontSize = 15; F6.registerNode("crect", { draw: (cfg, group) => { const width = cfg.id.length * 10; const rect = group.addShape("rect", { attrs: { x: 0, y: -10, ...cfg.style, width, height: 20, lineWidth: 0, opacity: 0, }, name: "rect-shape", draggable: true, }); const label = group.addShape("text", { attrs: { text: cfg.id, fill: "#ccc", fontSize, x: 0, y: 0, }, name: "label-shape", draggable: true, }); const bboxWidth = label.getBBox().width + 20; rect.attr({ width: bboxWidth }); group.addShape("path", { attrs: { lineWidth: 1, fill: "#ccc", stroke: "#ccc", path: [ ["M", 0, 0], ["L", bboxWidth, 0], ], }, name: "path-shape", draggable: true, }); return rect; }, getAnchorPoints: () => { return [ [0, 0.5], [1, 0.5], ]; }, }); const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: ["collapse-expand", "drag-canvas", "zoom-canvas"], }, defaultNode: { type: "crect", }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, getWidth: function getWidth(d) { return F6.Util.getTextSize(d.id, fontSize)[0] + 20; }, }, }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box-left-align/index.json ================================================ { "navigationBarTitleText": "节点左右对齐的紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box-left-align/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/compact-box-left-align/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-edge-tree/data.js ================================================ export default { id: "root", label: "root", children: [ { id: "c1", label: "c1", children: [ { id: "c1-1", label: "c1-1", }, { id: "c1-2", label: "c1-2", children: [ { id: "c1-2-1", label: "c1-2-1", }, { id: "c1-2-2", label: "c1-2-2", }, ], }, ], }, { id: "c2", label: "c2", }, { id: "c3", label: "c3", children: [ { id: "c3-1", label: "c3-1", }, { id: "c3-2", label: "c3-2", children: [ { id: "c3-2-1", label: "c3-2-1", }, { id: "c3-2-2", label: "c3-2-2", }, { id: "c3-2-3", label: "c3-2-3", }, ], }, { id: "c3-3", label: "c3-3", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-edge-tree/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 自定义图中的边 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; const COLLAPSE_ICON = function COLLAPSE_ICON(x, y, r) { return [ ["M", x - r, y - r], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x + 2 - r, y - r], ["L", x + r - 2, y - r], ]; }; const EXPAND_ICON = function EXPAND_ICON(x, y, r) { return [ ["M", x - r, y - r], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x + 2 - r, y - r], ["L", x + r - 2, y - r], ["M", x, y - 2 * r + 2], ["L", x, y - 2], ]; }; F6.Util.traverseTree(data, (d) => { d.leftIcon = { style: { fill: "#e6fffb", stroke: "#e6fffb", }, img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Q_FQT6nwEC8AAAAAAAAAAABkARQnAQ", }; return true; }); F6.registerNode( "icon-node", { options: { size: [60, 20], stroke: "#91d5ff", fill: "#91d5ff", }, draw(cfg, group) { const styles = this.getShapeStyle(cfg); const { labelCfg = {} } = cfg; const w = styles.width; const h = styles.height; const keyShape = group.addShape("rect", { attrs: { ...styles, x: -w / 2, y: -h / 2, }, }); /** * leftIcon 格式如下: * { * style: ShapeStyle; * img: '' * } */ console.log("cfg.leftIcon", cfg.leftIcon); if (cfg.leftIcon) { const { style, img } = cfg.leftIcon; group.addShape("rect", { attrs: { x: 1 - w / 2, y: 1 - h / 2, width: 38, height: styles.height - 2, fill: "#8c8c8c", ...style, }, }); group.addShape("image", { attrs: { x: 8 - w / 2, y: 8 - h / 2, width: 24, height: 24, img: img || "https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png", }, name: "image-shape", }); } // 如果不需要动态增加或删除元素,则不需要 add 这两个 marker group.addShape("marker", { attrs: { x: 40 - w / 2, y: 52 - h / 2, r: 6, stroke: "#73d13d", cursor: "pointer", symbol: EXPAND_ICON, }, name: "add-item", }); group.addShape("marker", { attrs: { x: 80 - w / 2, y: 52 - h / 2, r: 6, stroke: "#ff4d4f", cursor: "pointer", symbol: COLLAPSE_ICON, }, name: "remove-item", }); if (cfg.label) { group.addShape("text", { attrs: { ...labelCfg.style, text: cfg.label, x: 50 - w / 2, y: 25 - h / 2, }, }); } return keyShape; }, update: undefined, }, "rect", ); F6.registerEdge("flow-line", { draw(cfg, group) { const { startPoint } = cfg; const { endPoint } = cfg; const { style } = cfg; const shape = group.addShape("path", { attrs: { stroke: style.stroke, endArrow: style.endArrow, path: [ ["M", startPoint.x, startPoint.y], ["L", startPoint.x, (startPoint.y + endPoint.y) / 2], ["L", endPoint.x, (startPoint.y + endPoint.y) / 2], ["L", endPoint.x, endPoint.y], ], }, }); return shape; }, }); const defaultStateStyles = { hover: { stroke: "#1890ff", lineWidth: 2, }, }; const defaultNodeStyle = { fill: "#91d5ff", stroke: "#40a9ff", radius: 5, }; const defaultEdgeStyle = { stroke: "#91d5ff", endArrow: { path: "M 0,0 L 12, 6 L 9,0 L 12, -6 Z", fill: "#91d5ff", d: -20, }, }; const defaultLayout = { type: "compactBox", direction: "TB", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 40; }, getHGap: function getHGap() { return 70; }, }; const defaultLabelCfg = { style: { fill: "#000", fontSize: 12, }, }; // 创建F6实例 this.graph = new F6.TreeGraph({ container: this.canvas, context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, // plugins: [minimap], modes: { default: ["drag-canvas", "zoom-canvas"], }, defaultNode: { type: "icon-node", size: [120, 40], style: defaultNodeStyle, labelCfg: defaultLabelCfg, }, defaultEdge: { type: "flow-line", style: defaultEdgeStyle, }, nodeStateStyles: defaultStateStyles, edgeStateStyles: defaultStateStyles, layout: defaultLayout, extra: { createImage: this.canvas && this.canvas.createImage, }, }); // 监听 this.graph.on("node:mouseenter", (evt) => { const { item } = evt; this.graph.setItemState(item, "hover", true); }); this.graph.on("node:mouseleave", (evt) => { const { item } = evt; this.graph.setItemState(item, "hover", false); }); this.graph.on("node:tap", (evt) => { const { item, target } = evt; const targetType = target.get("type"); const name = target.get("name"); // 增加元素 if (targetType === "marker") { const model = item.getModel(); if (name === "add-item") { if (!model.children) { model.children = []; } const id = `n-${Math.random()}`; model.children.push({ id, label: id.substr(0, 8), leftIcon: { style: { fill: "#e6fffb", stroke: "#e6fffb", }, img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Q_FQT6nwEC8AAAAAAAAAAABkARQnAQ", }, }); this.graph.updateChild(model, model.id); } else if (name === "remove-item") { this.graph.removeChild(model.id); } } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-edge-tree/index.json ================================================ { "navigationBarTitleText": "自定义树中的边", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-edge-tree/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-edge-tree/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-side-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-side-mind-map/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 脑图-自定义子节点分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 50; }, getSide: (d) => { if (d.id === "Classification") { return "left"; } return "right"; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-side-mind-map/index.json ================================================ { "navigationBarTitleText": "自定义子节点分布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-side-mind-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-side-mind-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-tree/data.js ================================================ export default { name: "Modeling Methods", children: [ { name: "Classification", children: [ { name: "Logistic regression", }, { name: "Linear discriminant analysis", }, { name: "Rules", }, { name: "Decision trees", }, { name: "Naive Bayes", }, { name: "K nearest neighbor", }, { name: "Probabilistic neural network", }, { name: "Support vector machine", }, ], }, { name: "Consensus", children: [ { name: "Models diversity", children: [ { name: "Different initializations", }, { name: "Different parameter choices", }, { name: "Different architectures", }, { name: "Different modeling methods", }, { name: "Different training sets", }, { name: "Different feature sets", }, ], }, { name: "Methods", children: [ { name: "Classifier selection", }, { name: "Classifier fusion", }, ], }, { name: "Common", children: [ { name: "Bagging", }, { name: "Boosting", }, { name: "AdaBoost", }, ], }, ], }, { name: "Regression", children: [ { name: "Multiple linear regression", }, { name: "Partial least squares", }, { name: "Multi-layer feedforward neural network", }, { name: "General regression neural network", }, { name: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-tree/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 自定义复杂树图样式 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); F6.registerNode( "tree-node", { drawShape: function drawShape(cfg, group) { const rect = group.addShape("rect", { attrs: { fill: "#fff", stroke: "#666", x: 0, y: 0, width: 1, height: 1, }, name: "rect-shape", }); const content = cfg.name.replace(/(.{19})/g, "$1\n"); const text = group.addShape("text", { attrs: { text: content, x: 0, y: 0, textAlign: "left", textBaseline: "middle", fill: "#666", }, name: "text-shape", }); const bbox = text.getBBox(); const hasChildren = cfg.children && cfg.children.length > 0; rect.attr({ x: -bbox.width / 2 - 4, y: -bbox.height / 2 - 6, width: bbox.width + (hasChildren ? 26 : 12), height: bbox.height + 12, }); text.attr({ x: -bbox.width / 2, y: 0, }); if (hasChildren) { group.addShape("marker", { attrs: { x: bbox.width / 2 + 12, y: 0, r: 6, symbol: cfg.collapsed ? F6.Marker.expand : F6.Marker.collapse, stroke: "#666", lineWidth: 2, }, name: "collapse-icon", }); } return rect; }, update: (cfg, item) => { const group = item.getContainer(); const icon = group.find((e) => e.get("name") === "collapse-icon"); icon.attr( "symbol", cfg.collapsed ? F6.Marker.expand : F6.Marker.collapse, ); }, }, "single-node", ); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); this.graph.updateItem(item, { collapsed, }); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { type: "tree-node", anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", style: { stroke: "#A3B1BF", }, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 20; }, getHGap: function getHGap() { return 80; }, }, }); F6.Util.traverseTree(data_, (item) => { item.id = item.name; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-tree/index.json ================================================ { "navigationBarTitleText": "复杂树样式", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-tree/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/custom-tree/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/file-system/data.js ================================================ export default { id: "1", name: "src", children: [ { id: "1-1", name: "behavior", children: [], }, { id: "1-3", name: "graph", children: [ { id: "1-3-1", name: "controller", children: [], }, ], }, { id: "1-5", name: "item", children: [], }, { id: "1-6", name: "shape", children: [ { id: "1-6-2", name: "extend", children: [], }, ], }, { id: "1-7", name: "util", children: [], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/file-system/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 缩进树-文件系统 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // registerNode F6.registerNode("file-node", { draw: function draw(cfg, group) { const keyShape = group.addShape("rect", { attrs: { x: 10, y: -12, fill: "#fff", stroke: null, }, }); let isLeaf = false; if (cfg.collapsed) { group.addShape("marker", { attrs: { symbol: "triangle", x: 4, y: -2, r: 4, fill: "#666", }, name: "marker-shape", }); } else if (cfg.children && cfg.children.length > 0) { group.addShape("marker", { attrs: { symbol: "triangle-down", x: 4, y: -2, r: 4, fill: "#666", }, name: "marker-shape", }); } else { isLeaf = true; } const shape = group.addShape("text", { attrs: { x: 15, y: 4, text: cfg.name, fill: "#666", fontSize: 16, textAlign: "left", fontFamily: typeof window !== "undefined" ? window .getComputedStyle(document.body, null) .getPropertyValue("font-family") || "Arial, sans-serif" : "Arial, sans-serif", }, name: "text-shape", }); const bbox = shape.getBBox(); let backRectW = bbox.width; let backRectX = keyShape.attr("x"); if (!isLeaf) { backRectW += 8; backRectX -= 15; } keyShape.attr({ width: backRectW, height: bbox.height + 4, x: backRectX, }); return keyShape; }, }); // registerEdge F6.registerEdge( "step-line", { getControlPoints: function getControlPoints(cfg) { const { startPoint } = cfg; const { endPoint } = cfg; return [ startPoint, { x: startPoint.x, y: endPoint.y, }, endPoint, ]; }, }, "polyline", ); // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", animate: false, onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultEdge: { style: { stroke: "#A3B1BF", }, }, layout: { type: "indented", isHorizontal: true, direction: "LR", indent: 30, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } // position的取值(由于ESlint禁止嵌套的三元表达,所以单独提取出来写) let position_value = null; if (node.children && node.children.length > 0) { position_value = "left"; } else if (node.x > centerX) position_value = "right"; else position_value = "left"; return { label: node.id, labelCfg: { offset: 5, position: position_value, }, }; }); this.graph.node((node) => { return { type: "file-node", label: node.name, }; }); this.graph.edge(() => { return { type: "step-line", }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/file-system/index.json ================================================ { "navigationBarTitleText": "文件系统", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/file-system/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/file-system/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/h-intended/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/h-intended/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 缩进树-子节点两侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: ["drag-canvas"], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "indented", direction: "H", indent: 80, getHeight: () => { return 10; }, getWidth: () => { return 10; }, getSide: (d) => { if (d.id === "Regression" || d.id === "Classification") return "left"; return "right"; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "left"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/h-intended/index.json ================================================ { "navigationBarTitleText": "子节点两侧分布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/h-intended/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/h-intended/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/intend-align-top/data.js ================================================ export default { id: "A", children: [ { id: "A1", children: [{ id: "A11" }, { id: "A12" }, { id: "A13" }, { id: "A14" }], }, { id: "A2", children: [ { id: "A21", children: [{ id: "A211" }, { id: "A212" }], }, { id: "A22", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/intend-align-top/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 缩进树-顶部对齐 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); F6.registerNode("card-node", { draw: function drawShape(cfg, group) { const r = 2; const color = "#5B8FF9"; const w = cfg.size[0]; const h = cfg.size[1]; const shape = group.addShape("rect", { attrs: { x: -w / 2, y: -h / 2, width: w, // 200, height: h, // 60 stroke: color, radius: r, fill: "#fff", }, name: "main-box", draggable: true, }); group.addShape("rect", { attrs: { x: -w / 2, y: -h / 2, width: w, // 200, height: h / 2, // 60 fill: color, radius: [r, r, 0, 0], }, name: "title-box", draggable: true, }); // title text group.addShape("text", { attrs: { textBaseline: "top", x: -w / 2 + 8, y: -h / 2 + 2, lineHeight: 20, text: cfg.id, fill: "#fff", }, name: "title", }); cfg.children && group.addShape("marker", { attrs: { x: w / 2, y: 0, r: 6, cursor: "pointer", symbol: F6.Marker.collapse, stroke: "#666", lineWidth: 1, fill: "#fff", }, name: "collapse-icon", }); group.addShape("text", { attrs: { textBaseline: "top", x: -w / 2 + 8, y: -h / 2 + 24, lineHeight: 20, text: "description", fill: "rgba(0,0,0, 1)", }, name: `description`, }); return shape; }, setState(name, value, item) { if (name === "collapsed") { const marker = item .get("group") .find((ele) => ele.get("name") === "collapse-icon"); const icon = value ? F6.Marker.expand : F6.Marker.collapse; marker.attr("symbol", icon); } }, }); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: ["drag-canvas"], }, defaultNode: { type: "card-node", size: [100, 40], }, defaultEdge: { type: "cubic-horizontal", style: { endArrow: true, }, }, layout: { type: "indented", direction: "LR", dropCap: false, indent: 200, getHeight: () => { return 60; }, }, }); this.graph.on("node:tap", (e) => { if (e.target.get("name") === "collapse-icon") { e.item.getModel().collapsed = !e.item.getModel().collapsed; this.graph.setItemState( e.item, "collapsed", e.item.getModel().collapsed, ); this.graph.layout(); } }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/intend-align-top/index.json ================================================ { "navigationBarTitleText": "顶部对齐", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/intend-align-top/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/intend-align-top/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/left-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/left-mind-map/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 脑图-子节点右侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 100; }, getSide: () => { return "left"; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/left-mind-map/index.json ================================================ { "navigationBarTitleText": "子节点左侧分布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/left-mind-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/left-mind-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/mind-map/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 脑图-自节点自动两侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 50; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } // position的取值(由于ESlint禁止嵌套的三元表达,所以单独提取出来写) let position_value = null; if (node.children && node.children.length > 0) { position_value = "left"; } else if (node.x > centerX) position_value = "right"; else position_value = "left"; return { label: node.id, labelCfg: { offset: 5, position: position_value, }, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/mind-map/index.json ================================================ { "navigationBarTitleText": "子节点自动两侧分布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/mind-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/mind-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-compact-box/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 紧凑辐射树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, }, layout: { type: "compactBox", direction: "RL", getId: function getId(d) { return d.id; }, getHeight: () => { return 26; }, getWidth: () => { return 26; }, getVGap: () => { return 20; }, getHGap: () => { return 30; }, radial: true, }, }); this.graph.node((node) => { return { label: node.id, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-compact-box/index.json ================================================ { "navigationBarTitleText": "紧凑辐射树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-compact-box/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-compact-box/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-dendrogram/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data from "./data"; /** * 生态辐射树 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const model = item.getModel(); model.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, }, layout: { type: "dendrogram", direction: "LR", nodeSep: 20, rankSep: 100, radial: true, }, }); this.graph.node((node) => { return { label: node.id, }; }); this.graph.data(data); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-dendrogram/index.json ================================================ { "navigationBarTitleText": "生态辐射树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-dendrogram/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/radial-dendrogram/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/right-mind-map/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/right-mind-map/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 脑图-子节点右侧分布 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-horizontal", }, layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: () => { return 16; }, getVGap: () => { return 10; }, getHGap: () => { return 100; }, getSide: () => { return "right"; }, }, }); let centerX = 0; this.graph.node((node) => { if (node.id === "Modeling Methods") { centerX = node.x; } let pos = ""; if (node.children && node.children.length > 0) { pos = "right"; } else if (node.x > centerX) pos = "right"; else pos = "left"; return { label: node.id, labelCfg: { position: pos, offset: 5, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/right-mind-map/index.json ================================================ { "navigationBarTitleText": "子节点右侧分布", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/right-mind-map/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/right-mind-map/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-compact-box/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-compact-box/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data.js"; /** * 至上而下的紧凑树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化canvas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, linkCenter: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.getModel(); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-vertical", }, layout: { type: "compactBox", direction: "TB", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 80; }, getHGap: function getHGap() { return 20; }, }, }); this.graph.node((node) => { let position = "right"; let rotate = 0; if (!node.children) { position = "bottom"; rotate = Math.PI / 2; } return { label: node.id, labelCfg: { position, offset: 5, style: { rotate, textAlign: "start", }, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-compact-box/index.json ================================================ { "navigationBarTitleText": "至上而下的紧凑树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-compact-box/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-compact-box/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-dendrogram/data.js ================================================ export default { id: "Modeling Methods", children: [ { id: "Classification", children: [ { id: "Logistic regression", }, { id: "Linear discriminant analysis", }, { id: "Rules", }, { id: "Decision trees", }, { id: "Naive Bayes", }, { id: "K nearest neighbor", }, { id: "Probabilistic neural network", }, { id: "Support vector machine", }, ], }, { id: "Consensus", children: [ { id: "Models diversity", children: [ { id: "Different initializations", }, { id: "Different parameter choices", }, { id: "Different architectures", }, { id: "Different modeling methods", }, { id: "Different training sets", }, { id: "Different feature sets", }, ], }, { id: "Methods", children: [ { id: "Classifier selection", }, { id: "Classifier fusion", }, ], }, { id: "Common", children: [ { id: "Bagging", }, { id: "Boosting", }, { id: "AdaBoost", }, ], }, ], }, { id: "Regression", children: [ { id: "Multiple linear regression", }, { id: "Partial least squares", }, { id: "Multi-layer feedforward neural network", }, { id: "General regression neural network", }, { id: "Support vector regression", }, ], }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-dendrogram/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 至上而下的生态树 */ Page({ canvas: null, ctx: null, // 延迟获取的2d context renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, pixelRatio, fitView: true, linkCenter: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 26, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, defaultEdge: { type: "cubic-vertical", }, layout: { type: "dendrogram", direction: "TB", // H / V / LR / RL / TB / BT nodeSep: 40, rankSep: 100, }, }); this.graph.node((node) => { let position = "right"; let rotate = 0; if (!node.children) { position = "bottom"; rotate = Math.PI / 2; } return { label: node.id, labelCfg: { position, offset: 5, style: { rotate, textAlign: "start", }, }, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-dendrogram/index.json ================================================ { "navigationBarTitleText": "至上而下的生态树", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-dendrogram/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tb-dendrogram/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tree-edge-label/data.js ================================================ export default { isRoot: true, id: "Root", style: { fill: "red", }, children: [ { id: "SubTreeNode1", raw: {}, children: [ { id: "SubTreeNode1.1", }, { id: "SubTreeNode1.2", children: [ { id: "SubTreeNode1.2.1", }, { id: "SubTreeNode1.2.2", }, { id: "SubTreeNode1.2.3", }, ], }, ], }, { id: "SubTreeNode2", children: [ { id: "SubTreeNode2.1", }, ], }, { id: "SubTreeNode3", children: [ { id: "SubTreeNode3.1", }, { id: "SubTreeNode3.2", }, { id: "SubTreeNode3.3", }, ], }, { id: "SubTreeNode4", }, { id: "SubTreeNode5", }, { id: "SubTreeNode6", }, { id: "SubTreeNode7", }, { id: "SubTreeNode8", }, { id: "SubTreeNode9", }, { id: "SubTreeNode10", }, { id: "SubTreeNode11", }, ], }; ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tree-edge-label/index.js ================================================ import F6 from "@antv/f6-wx"; import TreeGraph from "@antv/f6-wx/extends/graph/treeGraph"; import data_ from "./data"; /** * 树图边上的标签 */ Page({ canvas: null, ctx: null, renderer: "", // mini、mini-native等,F6需要,标记环境 isCanvasInit: false, // canvas是否准备好了 graph: null, data: { width: 375, height: 600, pixelRatio: 1, forceMini: false, }, onLoad() { // 注册自定义树,节点等 F6.registerGraph("TreeGraph", TreeGraph); // 同步获取window的宽高 const { windowWidth, windowHeight, pixelRatio } = wx.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, /** * 初始化cnavas回调,缓存获得的context * @param {*} ctx 绘图context * @param {*} rect 宽高信息 * @param {*} canvas canvas对象,在render为mini时为null * @param {*} renderer 使用canvas 1.0还是canvas 2.0,mini | mini-native */ handleInit(event) { const { ctx, canvas, renderer } = event.detail; this.isCanvasInit = true; this.ctx = ctx; this.renderer = renderer; this.canvas = canvas; this.updateChart(); }, /** * canvas派发的事件,转派给graph实例 */ handleTouch(e) { this.graph && this.graph.emitEvent(e.detail); }, updateChart() { const { width, height, pixelRatio } = this.data; // 创建F6实例 this.graph = new F6.TreeGraph({ context: this.ctx, renderer: this.renderer, width, height, linkCenter: true, pixelRatio, fitView: true, modes: { default: [ { type: "collapse-expand", onChange: function onChange(item, collapsed) { const data = item.get("model"); data.collapsed = collapsed; return true; }, }, "drag-canvas", "zoom-canvas", ], }, defaultNode: { size: 30, }, layout: { type: "compactBox", direction: "LR", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 100; }, }, }); // 点 this.graph.node((node) => { return { size: 16, anchorPoints: [ [0, 0.5], [1, 0.5], ], style: { fill: "#C6E5FF", stroke: "#5B8FF9", }, label: node.id, labelCfg: { position: node.children && node.children.length > 0 ? "left" : "right", offset: 5, }, }; }); // 边 let i = 0; this.graph.edge(() => { i++; return { type: "cubic-horizontal", color: "#A3B1BF", label: i, }; }); this.graph.data(data_); this.graph.render(); this.graph.fitView(); }, onUnload() { this.graph && this.graph.destroy(); }, }); ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tree-edge-label/index.json ================================================ { "navigationBarTitleText": "树边上的标签", "usingComponents": { "f6-canvas": "@antv/f6-wx/canvas/canvas" } } ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tree-edge-label/index.wxml ================================================ ================================================ FILE: packages/examples-wx/package-tree-graph/pages/tree-graph/tree-edge-label/index.wxss ================================================ page { background-color: #f7f7f7; border: 1px solid rgba(0, 0, 0, 0); box-sizing: border-box; } .page-section-demo { padding: 32rpx; } ================================================ FILE: packages/examples-wx/package.json ================================================ { "name": "miniprogram-1", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@antv/f6-plugin": "^1.0.3", "@antv/f6-wx": "^0.0.6" }, "repository": "git@github.com:antvis/F6.git" } ================================================ FILE: packages/examples-wx/pages/index/index.js ================================================ import { processed_treeGraphContainer as treeGraphContainer, processed_generalGraphContainer as generalGraphContainer, processed_basicElementContainer as basicElementContainer, processed_basicInteractiveContainer as basicInteractiveContainer, processed_aminationContainer as aminationContainer, processed_customizeTree as customizeTree, processed_classicCace as classicCace, processed_newsMapVisualize as newsMapVisualize, processed_plugins as plugins, } from "../../utils/index"; const basicComponentList = [ { type: "树图", list: treeGraphContainer, }, { type: "一般图", list: generalGraphContainer, }, { type: "元素", list: basicElementContainer, }, { type: "交互", list: basicInteractiveContainer, }, { type: "动画", list: aminationContainer, }, { type: "自定义树", list: customizeTree, }, { type: "经典案例", list: classicCace, }, { type: "新闻图可视化", list: newsMapVisualize, }, { type: "自定义组件", list: plugins, }, ]; // // 这里控制拓展组件的盒子个数 // const extComponentList = [ // ]; Page({ onShow() { wx.reportAnalytics("enter_home_programmatically", {}); }, onShareAppMessage() { return { title: "F6能力演示", path: "pages/index/index", }; }, data: { all_list: basicComponentList, // 展示列表 theme: "light", // 日间夜间主题 'light', 'dark' }, onLoad() { console.log("导入list", this.data.all_list); this.setData({ theme: wx.getSystemInfoSync().theme || "light", }); if (wx.onThemeChange) { wx.onThemeChange(({ theme }) => { this.setData({ theme }); }); } }, kindToggle(e) { const { id } = e.currentTarget; const lists = this.data.all_list; lists.forEach((component) => { const { list } = component; list.forEach((obj) => { console.log(obj.open); if (obj.id === id) { obj.open = !obj.open; } else { obj.open = false; } }); }); this.setData({ all_list: lists, }); }, testClick(e) { console.log(e); }, }); ================================================ FILE: packages/examples-wx/pages/index/index.json ================================================ { "navigationBarTitleText": "F6" } ================================================ FILE: packages/examples-wx/pages/index/index.wxml ================================================ F6 官方示例 移动端可视化解决方案F6 demos {{component.type}} {{item.name}} {{item.nameEn}} {{page.name}} ================================================ FILE: packages/examples-wx/pages/index/index.wxss ================================================ .index { position: relative; overflow-x: hidden; } .background { position: absolute; height: 166px; width: 1000px; z-index: -1; } .index-hd { padding: 40px 40px 40px; text-align: center; background-image: url(https://gw.alipayobjects.com/mdn/rms_5c3b4a/afts/img/A*64rwQa4miUkAAAAAAAAAAAAAARQnAQ); } .index-bd { /* padding: 0 15px 20px; */ padding: 0 20px 20px; } .index-ft { padding-bottom: 10px; text-align: center; } .index-logo { /* width: 43px; height: 43px; */ width: 43px; height: 43px; } .index-desc { margin-top: 10px; color: white; font-size: 20px; } .index-sub-desc { color: gray; font-size: 12px; } .navigator-box { opacity: 0; position: relative; background-color: var(--weui-BG-2); line-height: 1.41176471; /* font-size: 32px; */ font-size: 17px; transform: translateY(-50%); transition: 0.3s; } .navigator-box-show { opacity: 1; transform: translateY(0); } .navigator { /* padding: 10px 15px; */ padding: 10px 15px; position: relative; display: flex; align-items: center; } .navigator:before { content: " "; position: absolute; /* left: 15px; */ left: 15px; top: 0; /* right: 15px; */ right: 15px; height: 1px; /* border-top: 1px solid var(--weui-FG-3); */ border-top: 1px solid var(--weui-FG-3); color: var(--weui-FG-3); } .navigator:first-child:before { display: none; } .navigator-text { flex: 1; } .navigator-arrow { /* padding-right: 13px; */ padding-right: 13px; position: relative; } .navigator-arrow:after { content: " "; display: inline-block; /* height: 9px; width: 9px; border-width: 1px 1px 0 0; */ height: 9px; width: 9px; border-width: 1px 1px 0 0; border-color: var(--weui-FG-2); border-style: solid; transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0); position: absolute; top: 50%; /* margin-top: -4px; */ margin-top: -4px; /* right: 14px; */ right: 14px; } .list-title { font-weight: bold; font-size: larger; margin: 40px 0 20px 0; } .kind-list-item { /* margin: 10px 0; */ margin: 10px 0; background-color: var(--weui-BG-2); border-radius: 2px; overflow: hidden; } .kind-list-item:first-child { margin-top: 0; } .kind-list-text { margin-right: 15px; } .kind-list-en-text { color: gray; flex: 1; } .kind-list-img { /* width: 30px; height: 30px; */ width: 20px; height: 20px; } .kind-list-item-hd { padding-bottom: 10px; display: flex; align-items: flex-start; border-bottom: 1px solid rgba(0, 0, 0, 0.1); transition: opacity 0.3s; } .kind-list-item-hd-show { opacity: 0.2; } .kind-list-item-bd { height: 0; overflow: hidden; } .kind-list-item-bd-show { height: auto; } .weui-agree__link { display: inline; color: var(--weui-LINK); } ================================================ FILE: packages/examples-wx/project.config.json ================================================ { "description": "项目配置文件", "packOptions": { "ignore": [] }, "setting": { "urlCheck": true, "es6": true, "enhance": false, "postcss": true, "preloadBackgroundData": false, "minified": true, "newFeature": false, "coverView": true, "nodeModules": false, "autoAudits": false, "showShadowRootInWxmlPanel": true, "scopeDataCheck": false, "uglifyFileName": false, "checkInvalidKey": true, "checkSiteMap": true, "uploadWithSourceMap": true, "compileHotReLoad": false, "lazyloadPlaceholderEnable": false, "useMultiFrameRuntime": true, "useApiHook": true, "useApiHostProcess": true, "babelSetting": { "ignore": [], "disablePlugins": [], "outputPath": "" }, "enableEngineNative": false, "useIsolateContext": true, "userConfirmedBundleSwitch": false, "packNpmManually": true, "packNpmRelationList": [ { "packageJsonPath": "./f6_node_modules_1/package.json", "miniprogramNpmDistDir": "./miniprogram/" }, { "packageJsonPath": "./src_node_modules_2/package.json", "miniprogramNpmDistDir": "./miniprogram/sub_package" } ], "minifyWXSS": true, "showES6CompileOption": false }, "compileType": "miniprogram", "libVersion": "2.19.1", "appid": "wx203a86077094f3b7", "projectname": "wx", "debugOptions": { "hidedInDevtools": [] }, "scripts": {}, "staticServerOptions": { "baseURL": "", "servePath": "" }, "isGameTourist": false, "condition": { "search": { "list": [] }, "conversation": { "list": [] }, "game": { "list": [] }, "plugin": { "list": [] }, "gamePlugin": { "list": [] }, "miniprogram": { "list": [] } } } ================================================ FILE: packages/examples-wx/project.private.config.json ================================================ { "setting": {}, "condition": { "plugin": { "list": [] }, "game": { "list": [] }, "gamePlugin": { "list": [] }, "miniprogram": { "list": [ { "name": "package-plugin/pages/plugin/edge-filter/index", "pathName": "package-plugin/pages/plugin/edge-filter/index", "query": "", "scene": null }, { "name": "package-plugin/pages/plugin/fish-eye/index", "pathName": "package-plugin/pages/plugin/fish-eye/index", "query": "", "scene": null }, { "name": "package-plugin/pages/plugin/time-bar/index", "pathName": "package-plugin/pages/plugin/time-bar/index", "query": "", "scene": null } ] } } } ================================================ FILE: packages/examples-wx/sitemap.json ================================================ { "desc": "F6演示", "rules": [ { "action": "allow", "page": "*" } ] } ================================================ FILE: packages/examples-wx/utils/common.js ================================================ function strLen(str = "") { let len = 0; for (let i = 0; i < str.length; i++) { if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) { len += 1; } else { len += 2; } } return len; } function measureText(text, font) { let fontSize = 12; if (font) { fontSize = parseInt(font.split(" ")[3], 10); } fontSize /= 2; return { width: strLen(text) * fontSize, }; } function processSearchData(all_data) { const all_result = []; all_data.forEach((obj) => { const { name: groupName, thumb, nameEn, detailList } = obj; detailList.forEach((detail) => { const { name, path: tmpPath } = detail; const suggestion = nameEn + groupName + name; const path = tmpPath.replace(/../, "/pages"); const result = { name, thumb, path, suggestion, }; all_result.push(result); }); }); return all_result; } export { measureText, processSearchData }; ================================================ FILE: packages/examples-wx/utils/data.js ================================================ export const list = [ { id: "view", name: "视图容器", open: false, pages: ["view", "scroll-view", "swiper", "movable-view", "cover-view"], }, { id: "content", name: "基础内容", open: false, pages: ["text", "icon", "progress", "rich-text"], }, { id: "form", name: "表单组件", open: false, pages: [ "button", "checkbox", "form", "input", "label", "picker", "picker-view", "radio", "slider", "switch", "textarea", "editor", ], }, { id: "nav", name: "导航", open: false, pages: ["navigator"], }, { id: "media", name: "媒体组件", open: false, pages: ["image", "video", "camera", "live-pusher", "live-player"], }, { id: "map", name: "地图", open: false, pages: ["map"], }, { id: "canvas", name: "画布", open: false, pages: ["canvas", "canvas-2d", "webgl"], }, { id: "open", name: "开放能力", open: false, pages: ["ad", "open-data", "web-view"], }, { id: "obstacle-free", name: "无障碍访问", open: false, pages: ["aria-component"], }, ]; // 下面是第一个tab中的内容 export const treeGraphContainer = [ { name: "紧凑树", thumb: "/images/icon/compactbox.png", nameEn: "CompactTree", detailList: [ { name: "紧凑树", path: "/package-tree-graph/pages/tree-graph/compact-box/index", }, { name: "至上而下的紧凑树", path: "/package-tree-graph/pages/tree-graph/tb-compact-box/index", }, { name: "节点左对齐的紧凑树", path: "/package-tree-graph/pages/tree-graph/compact-box-left-align/index", }, ], }, { name: "生态树", thumb: "/images/icon/dendrogram.png", nameEn: "Dendrogram", detailList: [ { name: "生态树", path: "/package-tree-graph/pages/tree-graph/basic-dendrogram/index", }, { name: "至上而下的生态树", path: "/package-tree-graph/pages/tree-graph/tb-dendrogram/index", }, ], }, { name: "脑图树", thumb: "/images/icon/mind.png", nameEn: "MindMap", detailList: [ { name: "子节点自动两侧分布", path: "/package-tree-graph/pages/tree-graph/mind-map/index", }, { name: "子节点右侧分布", path: "/package-tree-graph/pages/tree-graph/right-mind-map/index", }, { name: "子节点左侧分布", path: "/package-tree-graph/pages/tree-graph/left-mind-map/index", }, { name: "自定义子节点分布", path: "/package-tree-graph/pages/tree-graph/custom-side-mind-map/index", }, ], }, { name: "缩进树", thumb: "/images/icon/indent.png", nameEn: "Intend", path: "/page/component/movable-view/movable-view", detailList: [ { name: "文件系统", path: "/package-tree-graph/pages/tree-graph/file-system/index", }, { name: "顶部对齐", path: "/package-tree-graph/pages/tree-graph/intend-align-top/index", }, { name: "子节点两侧分布", path: "/package-tree-graph/pages/tree-graph/h-intended/index", }, ], }, { name: "辐射树", thumb: "/images/icon/radial.png", nameEn: "Radial", detailList: [ { name: "生态辐射树", path: "/package-tree-graph/pages/tree-graph/radial-dendrogram/index", }, { name: "紧凑辐射树", path: "/package-tree-graph/pages/tree-graph/radial-compact-box/index", }, ], }, { name: "定制样式树", thumb: "/images/icon/dingzhi.png", nameEn: "Custom", detailList: [ { name: "自定义树中的边", path: "/package-tree-graph/pages/tree-graph/custom-edge-tree/index", }, { name: "树边上的标签", path: "/package-tree-graph/pages/tree-graph/tree-edge-label/index", }, { name: "复杂树样式", path: "/package-tree-graph/pages/tree-graph/custom-tree/index", }, ], }, ]; export const generalGraphContainer = [ { name: "力导向图", thumb: "/images/icon/fa.png", nameEn: "ForceAtalas", detailList: [ { name: "FA布局及节点拖拽", path: "/package-general-graph/pages/general-graph/basic-force-directed/index", }, { name: "FA2布局", path: "/package-general-graph/pages/general-graph/basic-FA2/index", }, { name: "FA布局防止节点重叠", path: "/package-general-graph/pages/general-graph/force-directed-prevent-overlap/index", }, { name: "FA布局聚类", path: "/package-general-graph/pages/general-graph/force-directed-force-clustering/index", }, { name: "定制不同节点的参数", path: "/package-general-graph/pages/general-graph/force-directed-functional-params/index", }, { name: "固定被拖拽节点", path: "/package-general-graph/pages/general-graph/basic-force-directed-drag-fix/index", }, { name: "FA布局参数动态变化", path: "/package-general-graph/pages/general-graph/force-directed-configuration-translate/index", }, { name: "FA气泡图", path: "/package-general-graph/pages/general-graph/force-bubbles/index", }, { name: "约束在范围内布局", path: "/package-general-graph/pages/general-graph/force-constrained-in-rect/index", }, { name: "Combo FA布局", path: "/package-general-graph/pages/general-graph/basic-combo-force/index", }, ], }, { name: "流程图", thumb: "/images/icon/dagre.png", nameEn: "Dagre", detailList: [ { name: "流程图", path: "/package-general-graph/pages/general-graph/basic-dagre/index", }, { name: "带有Combo的流程图", path: "/package-general-graph/pages/general-graph/dagre-combo/index", }, { name: "自左向右的流程图", path: "/package-general-graph/pages/general-graph/dagre/index", }, { name: "自左向右的流程图对齐", path: "/package-general-graph/pages/general-graph/dagre-UL/index", }, { name: "布局参数动态变化", path: "/package-general-graph/pages/general-graph/dagre-configuration-translate/index", }, ], }, { name: "Fruchterman图", thumb: "/images/icon/terms.png", nameEn: "Fruchterman", detailList: [ { name: "基本Fruchterman", path: "/package-general-graph/pages/general-graph/fruchterman/index", }, { name: "Fruchterman聚类", path: "/package-general-graph/pages/general-graph/fruchterman-clustering/index", }, { name: "参数动态变化", path: "/package-general-graph/pages/general-graph/fruchterman-configuration-translate/index", }, ], }, { name: "辐射图", thumb: "/images/icon/radial.png", nameEn: "Radial", detailList: [ { name: "基本辐射布局", path: "/package-general-graph/pages/general-graph/basic-radial/index", }, { name: "防止节点重叠的严格辐射布局", path: "/package-general-graph/pages/general-graph/prevent-overlap-radial/index", }, { name: "防止节点重叠的非严格辐射布局", path: "/package-general-graph/pages/general-graph/prevent-overlap-unstrict-radial/index", }, { name: "交互扩展节点的辐射布局", path: "/package-general-graph/pages/general-graph/interact-radial/index", }, { name: "布局参数动态变化", path: "/package-general-graph/pages/general-graph/radial-configuration-translate/index", }, { name: "同层节点按照指定字段聚类", path: "/package-general-graph/pages/general-graph/sort-radial/index", }, ], }, { name: "环形图", thumb: "/images/icon/circle.png", nameEn: "Circle", detailList: [ { name: "基本环形布局", path: "/package-general-graph/pages/general-graph/basic-circular/index", }, { name: "按节点度数排序", path: "/package-general-graph/pages/general-graph/degree-circular/index", }, { name: "螺旋线布局", path: "/package-general-graph/pages/general-graph/spiral-circular/index", }, { name: "分割环形布局", path: "/package-general-graph/pages/general-graph/division-circular/index", }, { name: "参数动态变化", path: "/package-general-graph/pages/general-graph/circular-configuration-translate/index", }, ], }, { name: "网格图", thumb: "/images/icon/grid.png", nameEn: "Grid", detailList: [ { name: "基本网格布局", path: "/package-general-graph/pages/general-graph/basic-grid/index", }, { name: "指定排序方式的网格布局", path: "/package-general-graph/pages/general-graph/cluster-grid/index", }, ], }, { name: "同心圆", thumb: "/images/icon/concentric.png", nameEn: "Concentric", detailList: [ { name: "基本同心圆布局", path: "/package-general-graph/pages/general-graph/basic-concentric/index", }, ], }, { name: "降维图", thumb: "/images/icon/degree.png", nameEn: "MDS", detailList: [ { name: "基本降维布局图", path: "/package-general-graph/pages/general-graph/basic-MDS/index", }, ], }, { name: "弧线图", thumb: "/images/icon/arc.png", nameEn: "Arc Diagram ", detailList: [ { name: "基本弧线图", path: "/package-general-graph/pages/general-graph/basic-arc-diagram/index", }, { name: "环形弧线图", path: "/package-general-graph/pages/general-graph/circular-arc-diagram/index", }, ], }, { name: "布局机制", thumb: "/images/icon/buju.png", nameEn: "Layout", detailList: [ { name: "布局切换", path: "/package-general-graph/pages/general-graph/layoutTranslate/index", }, { name: "子图布局", path: "/package-general-graph/pages/general-graph/subgraph-layout/index", }, { name: "流水线子图布局", path: "/package-general-graph/pages/general-graph/sublayout-pipes/index", }, { name: "数据动态切换", path: "/package-general-graph/pages/general-graph/data-change/index", }, { name: "自定义二分图布局", path: "/package-general-graph/pages/general-graph/custom-bi-graph/index", }, { name: "布局时机监听", path: "/package-general-graph/pages/general-graph/layout-timing/index", }, ], }, ]; export const basicElementContainer = [ { name: "内置节点", thumb: "/images/icon/node.png", nameEn: "Node", detailList: [ { name: "圆形", path: "/package-elements/pages/elements/circle/index", }, { name: "甜甜圈", path: "/package-elements/pages/elements/donut/index", }, { name: "椭圆", path: "/package-elements/pages/elements/ellipse/index", }, { name: "矩形", path: "/package-elements/pages/elements/rect/index", }, { name: "模态矩形", path: "/package-elements/pages/elements/mode-rect/index", }, { name: "模态菱形", path: "/package-elements/pages/elements/diamond/index", }, { name: "五角星", path: "/package-elements/pages/elements/star/index", }, { name: "三角形", path: "/package-elements/pages/elements/triangle/index", }, { name: "图片", path: "/package-elements/pages/elements/image/index", }, ], }, { name: "内置边", thumb: "/images/icon/defaultEdge.png", nameEn: "Edge", detailList: [ { name: "折线1", path: "/package-elements/pages/elements/polyline1/index", }, { name: "折线2", path: "/package-elements/pages/elements/polyline2/index", }, { name: "折线3", path: "/package-elements/pages/elements/polyline3/index", }, { name: "三次贝塞尔曲线-垂直", path: "/package-elements/pages/elements/cubic1/index", }, { name: "三次贝塞尔曲线-水平", path: "/package-elements/pages/elements/cubic2/index", }, { name: "弧线", path: "/package-elements/pages/elements/arc/index", }, { name: "自环边", path: "/package-elements/pages/elements/loop/index", }, ], }, { name: "内置组合", thumb: "/images/icon/combo.png", nameEn: "Combo", detailList: [ { name: "圆形", path: "/package-elements/pages/elements/circle-with-combo/index", }, { name: "矩形", path: "/package-elements/pages/elements/rect-with-combo/index", }, ], }, { name: "边的箭头", thumb: "/images/icon/arrow.png", nameEn: "Arrow", detailList: [ { name: "默认内置箭头", path: "/package-elements/pages/elements/built-in-arrows/index", }, { name: "自定义箭头", path: "/package-elements/pages/elements/custom-arrows/index", }, ], }, { name: "自定义节点", thumb: "/images/icon/customNode.png", nameEn: "CustomNode", detailList: [ { name: "卡片", path: "/package-elements/pages/elements/card/index", }, { name: "卡片2", path: "/package-elements/pages/elements/card-node/index", }, { name: "面积图节点", path: "/package-elements/pages/elements/area-chart/index", }, { name: "堆叠图节点", path: "/package-elements/pages/elements/stack-chart/index", }, { name: "折线图节点", path: "/package-elements/pages/elements/line-chart/index", }, { name: "南丁格尔图节点", path: "/package-elements/pages/elements/bar-chart/index", }, { name: "点线图节点", path: "/package-elements/pages/elements/point-chart/index", }, { name: "饼图节点", path: "/package-elements/pages/elements/pie-chart/index", }, { name: "列表", path: "/package-elements/pages/elements/list/index", }, ], }, { name: "自定义边", thumb: "/images/icon/customEdge.png", nameEn: "CustomEdge", detailList: [ { name: "添加额外图形", path: "/package-elements/pages/elements/extra-shape/index", }, { name: "自定义折线", path: "/package-elements/pages/elements/custom-polyline/index", }, { name: "自定义折线2", path: "/package-elements/pages/elements/custom-polyline2/index", }, { name: "多标签边", path: "/package-elements/pages/elements/edge-mul-label/index", }, ], }, { name: "自定义组合", thumb: "/images/icon/customCombo.png", nameEn: "CustomCombo", detailList: [ { name: "带有Marker的圆", path: "/package-elements/pages/elements/c-circle/index", }, { name: "带有Marker的矩形", path: "/package-elements/pages/elements/c-rect/index", }, ], }, { name: "超长文本", thumb: "/images/icon/article.png", nameEn: "Long", detailList: [ { name: "文本超长", path: "/package-elements/pages/elements/label-len/index", }, { name: "使用换行符处理", path: "/package-elements/pages/elements/label-len1/index", }, ], }, { name: "文本背景", thumb: "/images/icon/background.png", nameEn: "Background", detailList: [ { name: "节点文本背景", path: "/package-elements/pages/elements/node-bg/index", }, { name: "边上文本背景", path: "/package-elements/pages/elements/edge-bg/index", }, ], }, { name: "多边定点", thumb: "/images/icon/multiedges.png", nameEn: "Multiple", detailList: [ { name: "两节点间存在多条边", path: "/package-elements/pages/elements/multi-edges/index", }, ], }, ]; export const basicInteractiveContainer = [ // { // name: '高亮', // thumb: '/images/icon/button.png', // nameEn: 'HighLight', // detailList: [ // { // name: '内置的高亮节点', // path: '/package-interactive/pages/interactive/activate-relations/index', // }, // { // name: '自定义高亮', // path: '/package-interactive/pages/interactive/highlight-dark/index', // }, // ], // }, { name: "自定义树图交互", thumb: "/images/icon/interact.png", nameEn: "Tree-Graph", detailList: [ { name: "拖拽子树改变结构", path: "/package-interactive/pages/interactive/drag-subtree/index", }, { name: "合并同类兄弟节点", path: "/package-interactive/pages/interactive/collapse-slibing/index", }, { name: "使用changeData", path: "/package-interactive/pages/interactive/change-data/index", }, { name: "使用addChild", path: "/package-interactive/pages/interactive/add-child/index", }, ], }, { name: "节点分组", thumb: "/images/icon/label.png", nameEn: "Combo", detailList: [ { name: "圆形组合", path: "/package-interactive/pages/interactive/combo-circle/index", }, { name: "矩形组合", path: "/package-interactive/pages/interactive/combo-rect/index", }, ], }, { name: "节点集轮廓包裹", thumb: "/images/icon/textarea.png", nameEn: "Hull", detailList: [ { name: "用轮廓包裹节点集合", path: "/package-interactive/pages/interactive/hull/index", }, { name: "修改包裹内部成员", path: "/package-interactive/pages/interactive/change-members/index", }, ], }, { name: "聚集一个节点", thumb: "/images/icon/radio.png", nameEn: "Move", detailList: [ { name: "点击节点移动", path: "/package-interactive/pages/interactive/move/index", }, { name: "点击节点动画", path: "/package-interactive/pages/interactive/move-animate/index", }, ], }, { name: "响应区域事件", thumb: "/images/icon/checkbox.png", nameEn: "Response", detailList: [ { name: "响应节点中部分区域", path: "/package-interactive/pages/interactive/partial-node/index", }, ], }, { name: "切换模式增加点和边", thumb: "/images/icon/switch.png", nameEn: "Switch", detailList: [ { name: "设置交互模式", path: "/package-interactive/pages/interactive/set-mode/index", }, ], }, { name: "自定义交互", thumb: "/images/icon/slider.png", nameEn: "CustomInteraction", detailList: [ { name: "两指平移画布", path: "/package-interactive/pages/interactive/canvas-two-fingers/index", }, ], }, { name: "画布交互", thumb: "/images/icon/picker-view.png", nameEn: "Canvas", detailList: [ { name: "缩放画布时固定元素", path: "/package-interactive/pages/interactive/fix-item/index", }, { name: "拖拽画布时候隐藏", path: "/package-interactive/pages/interactive/hide-item/index", }, ], }, ]; export const aminationContainer = [ { name: "节点动画", thumb: "/images/icon/nodeAminate.png", nameEn: "NodeAnimate", detailList: [ { name: "节点动画", path: "/package-animation/pages/animation/node-node/index", }, ], }, { name: "边动画", thumb: "/images/icon/edgeMove.png", nameEn: "EdgeAnimate", detailList: [ { name: "圆点沿边运动", path: "/package-animation/pages/animation/point-in-line/index", }, { name: "虚线运动", path: "/package-animation/pages/animation/edge-edge/index", }, { name: "无到有的边", path: "/package-animation/pages/animation/edge-line-growth/index", }, ], }, { name: "状态切换", thumb: "/images/icon/change.png", nameEn: "Change", detailList: [ { name: "状态与动画", path: "/package-animation/pages/animation/state-change-hover/index", }, ], }, { name: "节点移动动画", thumb: "/images/icon/nodeMove.png", nameEn: "NodeMove", detailList: [ { name: "节点移动动画", path: "/package-animation/pages/animation/change-position-default/index", }, ], }, { name: "自定义动画", thumb: "/images/icon/navigator.png", nameEn: "CustomAminate", detailList: [ { name: "自定义动画", path: "/package-animation/pages/animation/custom-animate-position/index", }, ], }, ]; // 下面是第二个tab内容 export const customizeTree = [ { name: "自定义树图", thumb: "/images/icon/radial.png", nameEn: "Custom", detailList: [ { name: "决策树", path: "/package-scene-case/pages/scene-case/decision-tree/index", }, { name: "知识图谱树", path: "/package-scene-case/pages/scene-case/knowledge-tree-graph/index", }, ], }, ]; export const classicCace = [ { name: "经典案例", thumb: "/images/icon/classic.png", nameEn: "Classic", detailList: [ { name: "自定义流向图", path: "/package-scene-case/pages/scene-case/custom-flow/index", }, // { // name: '桑基图', // path: '/package-scene-case/pages/scene-case/sankey/index', // }, // { // name: '思维导图', // path: '/package-scene-case/pages/scene-case/mind-map/index', // }, { name: "甜甜圈转账图", path: "/package-scene-case/pages/scene-case/donut-transfer/index", }, ], }, ]; export const newsMapVisualize = [ { name: "新闻图可视化", thumb: "/images/icon/news.png", nameEn: "News", detailList: [ { name: "地铁路线图", path: "/package-scene-case/pages/scene-case/metro-lines/index", }, ], }, ]; export const plugins = [ { name: "提示框", nameEn: "Tooltip", detailList: [ { name: "Tooltip", path: "/package-plugin/pages/plugin/tool-tip/index", }, ], }, { name: "图例", nameEn: "Legend", detailList: [ { name: "Legend", path: "/package-plugin/pages/plugin/legend/index", }, ], }, { name: "边过滤", nameEn: "EdgeFilter", detailList: [ { name: "EdgeFilter", path: "/package-plugin/pages/plugin/edge-filter/index", }, ], }, { name: "鱼眼", nameEn: "Fisheye", detailList: [ { name: "Fisheye", path: "/package-plugin/pages/plugin/fish-eye/index", }, ], }, { name: "时间轴", nameEn: "Timebar", detailList: [ { name: "Timebar", path: "/package-plugin/pages/plugin/time-bar/index", }, ], }, { name: "缩放轴", nameEn: "ZoomSlider", detailList: [ { name: "ZoomSlider", path: "/package-plugin/pages/plugin/zoom-slider/index", }, ], }, { name: "边绑定", nameEn: "Bundling", detailList: [ { name: "Bundling", path: "/package-plugin/pages/plugin/bundling/index", }, ], }, { name: "上下文菜单", nameEn: "Menu", detailList: [ { name: "Menu", path: "/package-plugin/pages/plugin/menu/index", }, ], }, { name: "对齐线", nameEn: "SnapLine", detailList: [ { name: "SnapLine", path: "/package-plugin/pages/plugin/snap-line/index", }, ], }, { name: "miniMap", nameEn: "miniMap", detailList: [ { name: "miniMap", path: "/package-plugin/pages/plugin/mini-map/index", }, ], }, ]; ================================================ FILE: packages/examples-wx/utils/index.js ================================================ import { processDisplayData } from "./util"; import { treeGraphContainer, generalGraphContainer, basicElementContainer, basicInteractiveContainer, aminationContainer, customizeTree, classicCace, newsMapVisualize, plugins, } from "./data"; const processed_treeGraphContainer = processDisplayData(treeGraphContainer); const processed_generalGraphContainer = processDisplayData( generalGraphContainer, ); const processed_basicElementContainer = processDisplayData( basicElementContainer, ); const processed_basicInteractiveContainer = processDisplayData( basicInteractiveContainer, ); const processed_aminationContainer = processDisplayData(aminationContainer); const processed_customizeTree = processDisplayData(customizeTree); const processed_classicCace = processDisplayData(classicCace); const processed_newsMapVisualize = processDisplayData(newsMapVisualize); const processed_plugins = processDisplayData(plugins); // 所有处理好的列表数据,用于展示 // const list = processDisplayData(all_data) const all_list = [ processed_treeGraphContainer, processed_generalGraphContainer, processed_basicElementContainer, processed_basicInteractiveContainer, processed_aminationContainer, processed_customizeTree, processed_classicCace, processed_newsMapVisualize, processed_plugins, ]; export { all_list, processed_treeGraphContainer, processed_generalGraphContainer, processed_basicElementContainer, processed_basicInteractiveContainer, processed_aminationContainer, processed_customizeTree, processed_classicCace, processed_newsMapVisualize, processed_plugins, }; ================================================ FILE: packages/examples-wx/utils/util.js ================================================ const formatTime = (date) => { const year = date.getFullYear(); const month = date.getMonth() + 1; const day = date.getDate(); const hour = date.getHours(); const minute = date.getMinutes(); const second = date.getSeconds(); return `${[year, month, day].map(formatNumber).join("/")} ${[ hour, minute, second, ] .map(formatNumber) .join(":")}`; }; const formatNumber = (n) => { n = n.toString(); return n[1] ? n : `0${n}`; }; // 对data.js中的列表数据进行处理 const processDisplayData = (displayContainers) => { const containerResult = []; displayContainers.forEach((container) => { const { name, thumb, nameEn, detailList } = container; const id = name + nameEn; const pages = []; detailList.forEach((obj) => { pages.push(obj); }); const list = { id, name, nameEn, open: false, pages, thumb, }; containerResult.push(list); }); return containerResult; }; export { formatTime, processDisplayData }; ================================================ FILE: packages/f6/.storybook/main.ts ================================================ import * as path from "path"; const config = { stories: [ "../stories/**/*.mdx", "../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)", ], addons: [ "@storybook/addon-onboarding", "@storybook/addon-links", "@storybook/addon-essentials", "@chromatic-com/storybook", "@storybook/addon-interactions", "@storybook/preset-create-react-app", ], framework: { name: "@storybook/react-vite", options: {}, }, core: { builder: "@storybook/builder-vite", }, }; export default config; ================================================ FILE: packages/f6/.storybook/preview.ts ================================================ import { Preview } from "@storybook/react"; import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS, } from "@storybook/addon-viewport"; const preview: Preview = { parameters: { viewport: { viewports: { ...INITIAL_VIEWPORTS, ...MINIMAL_VIEWPORTS, }, defaultViewport: "iphone14promax", }, }, }; export default preview; ================================================ FILE: packages/f6/package.json ================================================ { "name": "@antv/f6", "version": "0.0.16", "description": "A Mobile Graph Visualization Framework in JavaScript", "keywords": [ "antv", "f6", "graph", "graph analysis", "graph editor", "graph visualization", "relational data" ], "homepage": "https://f6.antv.vision", "bugs": { "url": "https://github.com/antvis/F6/issues" }, "repository": { "type": "git", "url": "https://github.com/antvis/F6" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "files": [ "package.json", "esm", "lib", "dist", "LICENSE", "README.md" ], "scripts": { "clean": "rimraf dist", "storybook": "storybook dev", "build": "vite build" }, "dependencies": { "@ant-design/colors": "^5.0.1", "@antv/algorithm": "^0.1.8", "@antv/chart-node-g6": "^0.0.3", "@antv/dom-util": "^2.0.1", "@antv/event-emitter": "~0.1.0", "@antv/f6-core": "workspace:*", "@antv/f6-element": "workspace:*", "@antv/f6-ui": "workspace:*", "@antv/f6-plugin": "workspace:*", "@antv/g-math": "^0.1.1", "@antv/g-mobile": "^0.0.13", "@antv/hierarchy": "^0.6.2", "@antv/layout": "0.1.14", "@antv/matrix-util": "^3.0.4", "@antv/path-util": "^2.0.3", "@antv/scale": "^0.3.1", "@antv/util": "~2.0.5", "@react-docgen/cli": "^2.0.3", "color": "^3.1.3", "@babel/runtime": "~7.24.7", "@antv/g-base": "~0.5.16", "react-dom": "~18.3.1", "react": "~18.3.1", "@storybook/preset-create-react-app": "~8.1.10" }, "devDependencies": { "@storybook/react-vite": "~8.1.10", "@storybook/builder-vite": "~8.1.10", "@storybook/addon-actions": "^8.1.10", "@storybook/addon-viewport": "^8.1.10", "react-docgen-loader": "^2.9.1", "react-docgen-typescript": "^2.2.2", "@chromatic-com/storybook": "^1.5.0", "@storybook/addon-essentials": "^8.1.10", "@storybook/addon-interactions": "^8.1.10", "@storybook/addon-links": "^8.1.10", "@storybook/addon-onboarding": "^8.1.10", "@storybook/addon-webpack5-compiler-swc": "^1.0.3", "@storybook/blocks": "^8.1.10", "@storybook/react": "^8.1.10", "prop-types": "^15.8.1", "storybook": "^8.1.10", "vite": "~5.3.1", "@vitejs/plugin-react": "~4.3.1" }, "miniprogram": "dist" } ================================================ FILE: packages/f6/src/behavior/activate-relations.ts ================================================ import { G6Event, IG6GraphEvent, INode } from "@antv/f6-core"; export default { getDefaultCfg(): object { return { activeState: "active", inactiveState: "inactive", resetSelected: false, shouldUpdate() { return true; }, }; }, getEvents(): { [key in G6Event]?: string } { return { "node:tap": "setAllItemStates", "canvas:tap": "clearAllItemStates", }; }, setAllItemStates(e: IG6GraphEvent) { const self = this; const item: INode = e.item as INode; const graph = self.graph; self.item = item; if (!self.shouldUpdate(e.item, { event: e, action: "activate" })) { return; } const activeState = self.activeState; const inactiveState = self.inactiveState; const nodes = graph.getNodes(); const edges = graph.getEdges(); const nodeLength = nodes.length; const edgeLength = edges.length; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; const hasSelected = node.hasState("selected"); if (self.resetSelected) { if (hasSelected) { graph.setItemState(node, "selected", false); } } graph.setItemState(node, activeState, false); if (inactiveState) { graph.setItemState(node, inactiveState, true); } } for (let i = 0; i < edgeLength; i++) { const edge = edges[i]; graph.setItemState(edge, activeState, false); if (inactiveState) { graph.setItemState(edge, inactiveState, true); } } if (inactiveState) { graph.setItemState(item, inactiveState, false); } graph.setItemState(item, activeState, true); const rEdges = item.getEdges(); const rEdgeLegnth = rEdges.length; for (let i = 0; i < rEdgeLegnth; i++) { const edge = rEdges[i]; let otherEnd; if (edge.getSource() === item) { otherEnd = edge.getTarget(); } else { otherEnd = edge.getSource(); } if (inactiveState) { graph.setItemState(otherEnd, inactiveState, false); } graph.setItemState(otherEnd, activeState, true); graph.setItemState(edge, inactiveState, false); graph.setItemState(edge, activeState, true); edge.toFront(); } graph.emit("afteractivaterelations", { item: e.item, action: "activate" }); }, clearActiveState(e: any) { const self = this; const graph = self.get("graph"); if (!self.shouldUpdate(e.item, { event: e, action: "deactivate" })) { return; } const activeState = this.activeState; const inactiveState = this.inactiveState; const autoPaint = graph.get("autoPaint"); graph.setAutoPaint(false); const nodes = graph.getNodes(); const edges = graph.getEdges(); const nodeLength = nodes.length; const edgeLength = edges.length; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; graph.clearItemStates(node, [activeState, inactiveState]); } for (let i = 0; i < edgeLength; i++) { const edge = edges[i]; graph.clearItemStates(edge, [activeState, inactiveState, "deactivate"]); } graph.paint(); graph.setAutoPaint(autoPaint); graph.emit("afteractivaterelations", { item: e.item || self.get("item"), action: "deactivate", }); }, clearAllItemStates(e: any) { const self = this; const graph = self.graph; if (!self.shouldUpdate(e.item, { event: e, action: "deactivate" })) { return; } const activeState = this.activeState; const inactiveState = this.inactiveState; const nodes = graph.getNodes(); const edges = graph.getEdges(); const nodeLength = nodes.length; const edgeLength = edges.length; for (let i = 0; i < nodeLength; i++) { const node = nodes[i]; graph.clearItemStates(node, [activeState, inactiveState]); } for (let i = 0; i < edgeLength; i++) { const edge = edges[i]; graph.clearItemStates(edge, [activeState, inactiveState, "deactivate"]); } graph.emit("afteractivaterelations", { item: e.item || self.get("item"), action: "deactivate", }); }, }; ================================================ FILE: packages/f6/src/behavior/click-select.ts ================================================ import { each } from "@antv/util"; import { G6Event, IG6GraphEvent } from "@antv/f6-core"; export default { getDefaultCfg(): object { return { multiple: true, selectedState: "selected", }; }, getEvents(): { [key in G6Event]?: string } { const self = this as any; return { "node:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onCanvasClick", }; }, onClick(evt: IG6GraphEvent) { const self = this; const { item } = evt; if (!item || item.destroyed) { return; } const type = item.getType(); const { graph, multiple, shouldUpdate, shouldBegin } = self; if (!shouldBegin.call(self, evt)) { return; } // allow to select multiple nodes but did not press a key || do not allow the select multiple nodes if (!multiple) { const selected = graph.findAllByState(type, self.selectedState); each(selected, (combo) => { if (combo !== item) { graph.setItemState(combo, self.selectedState, false); } }); } if (item.hasState(self.selectedState)) { if (shouldUpdate.call(self, evt)) { graph.setItemState(item, self.selectedState, false); } const selectedNodes = graph.findAllByState("node", self.selectedState); const selectedCombos = graph.findAllByState("combo", self.selectedState); graph.emit("nodeselectchange", { target: item, selectedItems: { nodes: selectedNodes, combos: selectedCombos, }, select: false, }); } else { if (shouldUpdate.call(self, evt)) { graph.setItemState(item, self.selectedState, true); } const selectedNodes = graph.findAllByState("node", self.selectedState); const selectedCombos = graph.findAllByState("combo", self.selectedState); graph.emit("nodeselectchange", { target: item, selectedItems: { nodes: selectedNodes, combos: selectedCombos, }, select: true, }); } }, onCanvasClick() { const { graph } = this; const selected = graph.findAllByState("node", this.selectedState); each(selected, (node) => { graph.setItemState(node, this.selectedState, false); }); const selectedCombos = graph.findAllByState("combo", this.selectedState); each(selectedCombos, (combo) => { graph.setItemState(combo, this.selectedState, false); }); graph.emit("nodeselectchange", { selectedItems: { nodes: [], edges: [], combos: [] }, select: false, }); }, }; ================================================ FILE: packages/f6/src/behavior/collapse-expand-combo.ts ================================================ /* * @Author: Shiwu * @Description: 收起和展开 Combo */ import { G6Event, IG6GraphEvent } from "@antv/f6-core"; const DEFAULT_TRIGGER = "dblclick"; const ALLOW_EVENTS = ["click", "dblclick"]; export default { getDefaultCfg(): object { return { trigger: DEFAULT_TRIGGER, relayout: true, }; }, getEvents(): { [key in G6Event]?: string } { let trigger: string; // 检测输入是否合法 if (ALLOW_EVENTS.includes(this.trigger)) { trigger = this.trigger; } else { trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console console.warn( "Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", ); } return { [`combo:${trigger}`]: "onComboClick", }; }, onComboClick(evt: IG6GraphEvent) { const { item } = evt; const { graph, relayout } = this; if (!item || item.destroyed || item.getType() !== "combo") return; const model = item.getModel(); const comboId = model.id; if (!comboId) { return; } graph.collapseExpandCombo(comboId); if (relayout && graph.get("layout")) graph.layout(); else graph.refreshPositions(); }, }; ================================================ FILE: packages/f6/src/behavior/collapse-expand.ts ================================================ import { G6Event, IG6GraphEvent } from "@antv/f6-core"; const DEFAULT_TRIGGER = "tap"; const ALLOW_EVENTS = ["tap", "dbltap"]; export default { getDefaultCfg(): object { return { /** * 发生收缩/扩展变化时的回调 */ trigger: DEFAULT_TRIGGER, onChange() {}, }; }, getEvents(): { [key in G6Event]?: string } { let trigger: string; // 检测输入是否合法 if (ALLOW_EVENTS.includes(this.trigger)) { ({ trigger } = this); } else { trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console console.warn( "Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", ); } return { [`node:${trigger}`]: "onNodeTap", // 支持移动端事件 touchstart: "onNodeTap", }; }, onNodeTap(e: IG6GraphEvent) { const { item } = e; // 如果节点进行过更新,model 会进行 merge,直接改 model 就不能改布局,所以需要去改源数据 const sourceData = this.graph.findDataById(item.get("id")); if (!sourceData) { return; } const { children } = sourceData; // 叶子节点的收缩和展开没有意义 if (!children || children.length === 0) { return; } const collapsed = !sourceData.collapsed; if (!this.shouldBegin(e, collapsed)) { return; } sourceData.collapsed = collapsed; item.getModel().collapsed = collapsed; this.graph.emit("itemcollapsed", { item: e.item, collapsed }); if (!this.shouldUpdate(e, collapsed)) { return; } try { this.onChange(item, collapsed); } catch (err) { // eslint-disable-next-line no-console console.warn(err); } this.graph.layout(); }, }; ================================================ FILE: packages/f6/src/behavior/create-edge.ts ================================================ import { G6Event, IG6GraphEvent, EdgeConfig } from "@antv/f6-core"; import { IGraph } from "../interface/graph"; const DEFAULT_TRIGGER = "tap"; const ALLOW_EVENTS = ["tap", "drag"]; const DEFAULT_KEY = undefined; const ALLOW_KEYS = ["shift", "ctrl", "control", "alt", "meta", undefined]; export default { getDefaultCfg(): object { return { trigger: DEFAULT_TRIGGER, key: DEFAULT_KEY, edgeConfig: {}, }; }, getEvents(): { [key in G6Event]?: string } { const self = this as any; // 检测输入是否合法 if (!(ALLOW_EVENTS.indexOf(self.trigger.toLowerCase()) > -1)) { self.trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console console.warn( "Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'", ); } if (self.key && ALLOW_KEYS.indexOf(self.key.toLowerCase()) === -1) { self.trigger = DEFAULT_KEY; // eslint-disable-next-line no-console console.warn( "Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined", ); } let events; if (self.trigger === "drag") { events = { "node:dragstart": "onClick", "combo:dragstart": "onClick", drag: "updateEndPoint", "node:drop": "onClick", "combo:drop": "onClick", dragend: "onDragEnd", }; } else if (self.trigger === "click") { events = { "node:tap": "onClick", // The event is node:click, the responsing function is onClick mousemove: "updateEndPoint", // The event is mousemove, the responsing function is onMousemove "edge:tap": "cancelCreating", // The event is edge:click, the responsing function is onEdgeClick "canvas:tap": "cancelCreating", "combo:tap": "onClick", }; } if (self.key) { events.keydown = "onKeyDown"; events.keyup = "onKeyUp"; } return events; }, onDragEnd(ev: IG6GraphEvent) { const self = this; if (self.key && !self.keydown) return; const { item } = ev; if (!item || item.getID() === self.source || item.getType() !== "node") self.cancelCreating({ item: self.edge, x: ev.x, y: ev.y, }); }, // 如果边的起点没有指定,则根据起点创建新边;如果起点已经指定而终点未指定,则指定终点 onClick(ev: IG6GraphEvent) { const self = this; if (self.key && !self.keydown) return; const node = ev.item; const graph: IGraph = self.graph; const model = node.getModel(); // 如果起点已经指定而终点未指定,则指定终点 if (self.addingEdge && self.edge) { if (!self.shouldEnd.call(self, ev)) return; const updateCfg: EdgeConfig = { target: model.id, }; if (self.source === model.id) { updateCfg.type = "loop"; } graph.emit("beforecreateedge", {}); graph.updateItem(self.edge, updateCfg); graph.emit("aftercreateedge", { edge: self.edge, }); // 暂时将该边的 capture 恢复为 true self.edge.getKeyShape().set("capture", true); self.edge = null; self.addingEdge = false; } else { // 如果边的起点没有指定,则根据起点创建新边 if (!self.shouldBegin.call(self, ev)) return; self.edge = graph.addItem( "edge", { source: model.id, target: model.id, ...self.edgeConfig, }, false, ); self.source = model.id; self.addingEdge = true; // 暂时将该边的 capture 设置为 false,这样可以拾取到后面的元素 self.edge.getKeyShape().set("capture", false); } }, // 边的起点已经确定,边的末端跟随鼠标移动 updateEndPoint(ev: IG6GraphEvent) { const self = this; if (self.key && !self.keydown) return; const point = { x: ev.x, y: ev.y }; // 若此时 source 节点已经被移除,结束添加边 if (!self.graph.findById(self.source)) { self.addingEdge = false; return; } if (self.addingEdge && self.edge) { // 更新边的终点为鼠标位置 self.graph.updateItem( self.edge, { target: point, }, false, ); } }, // 取消增加边,删除该边;或指定终点 cancelCreating(ev: IG6GraphEvent) { const self = this; if (self.key && !self.keydown) return; const graph: IGraph = self.graph; const currentEdge = ev.item; if ( self.addingEdge && ev.target && ev.target.isCanvas && ev.target.isCanvas() ) { graph.removeItem(self.edge, false); self.edge = null; self.addingEdge = false; return; } if (self.addingEdge && self.edge === currentEdge) { let cancelEdge = true; // !graph.get('groupByTypes') 将会导致选中终点时实际上边在最上层,节点无法响应 click 事件 if (!graph.get("groupByTypes")) { // 此时需要判断点击的位置是否在节点范围内,若在,则指定终点。否则取消增加边 const { x, y } = ev; const nodes = graph.getNodes(); const length = nodes.length; for (let i = 0; i < length; i++) { const node = nodes[i]; const model = node.getModel(); const nodeBBox = node.getBBox(); if ( x <= nodeBBox.maxX && x >= nodeBBox.minX && y <= nodeBBox.maxY && y >= nodeBBox.minY ) { if ( !self.shouldEnd.call(self, { x: ev.x, y: ev.y, canvasX: ev.canvasX, canvasY: ev.canvasY, clientX: ev.clientX, clientY: ev.clientY, item: node, }) ) { return; } graph.emit("beforecreateedge", {}); graph.updateItem(self.edge, { target: model.id, }); graph.emit("aftercreateedge", { edge: self.edge, }); cancelEdge = false; break; } } } if (cancelEdge) graph.removeItem(self.edge, false); self.edge = null; self.addingEdge = false; } }, onKeyDown(e: IG6GraphEvent) { const self = this; const code = e.key; if (!code) { return; } if (code.toLowerCase() === self.key.toLowerCase()) { self.keydown = true; } else { self.keydown = false; } }, onKeyUp() { const self = this; if (self.addingEdge && self.edge) { // 清除正在增加的边 self.graph.removeItem(self.edge, false); self.addingEdge = false; self.edge = null; } this.keydown = false; }, }; ================================================ FILE: packages/f6/src/behavior/drag-canvas.ts ================================================ import { G6Event, IG6GraphEvent } from "@antv/f6-core"; import { IGraph } from "../interface/graph"; import Util from "../util"; const { cloneEvent, isNaN } = Util; const { abs } = Math; const DRAG_OFFSET = 10; export default { getDefaultCfg(): object { return { direction: "both", enableOptimize: false, // drag-canvas 可拖动的扩展范围,默认为 0,即最多可以拖动一屏的位置 // 当设置的值大于 0 时,即拖动可以超过一屏 // 当设置的值小于 0 时,相当于缩小了可拖动范围 // 具体实例可参考:https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ scalableRange: 0, allowDragOnItem: false, }; }, getEvents(): { [key in G6Event]?: string } { return { dragstart: "onDragStart", drag: "onDragMove", dragend: "onDragEnd", }; }, updateViewport(e: IG6GraphEvent) { const { origin } = this; const clientX = +e.clientX; const clientY = +e.clientY; if (isNaN(clientX) || isNaN(clientY)) { return; } let dx = clientX - origin.x; let dy = clientY - origin.y; if (this.get("direction") === "x") { dy = 0; } else if (this.get("direction") === "y") { dx = 0; } this.origin = { x: clientX, y: clientY, }; const width = this.graph.get("width"); const height = this.graph.get("height"); const graphCanvasBBox = this.graph.get("canvas").getCanvasBBox(); if ( (graphCanvasBBox.minX <= width + this.scalableRange && graphCanvasBBox.minX + dx > width + this.scalableRange) || (graphCanvasBBox.maxX + this.scalableRange >= 0 && graphCanvasBBox.maxX + this.scalableRange + dx < 0) ) { dx = 0; } if ( (graphCanvasBBox.minY <= height + this.scalableRange && graphCanvasBBox.minY + dy > height + this.scalableRange) || (graphCanvasBBox.maxY + this.scalableRange >= 0 && graphCanvasBBox.maxY + this.scalableRange + dy < 0) ) { dy = 0; } this.graph.translate(dx, dy); }, onDragStart(e: IG6GraphEvent) { const self = this as any; const event = e.originalEvent as Event; if (!this.shouldBegin.call(this, e)) { return; } const target = e.target; const targetIsCanvas = target && target.isCanvas && target.isCanvas(); if (!this.allowDragOnItem && !targetIsCanvas) return; self.origin = { x: e.clientX, y: e.clientY }; self.dragging = false; if (this.enableOptimize) { // 拖动 canvas 过程中隐藏所有的边及label const graph: IGraph = this.graph; const edges = graph.getEdges(); for (let i = 0, len = edges.length; i < len; i++) { const shapes = edges[i].get("group").get("children"); if (!shapes) continue; shapes.forEach((shape) => { shape.set( "ori-visibility", shape.get("ori-visibility") || shape.get("visible"), ); shape.hide(); }); } const nodes = graph.getNodes(); for (let j = 0, nodeLen = nodes.length; j < nodeLen; j++) { const container = nodes[j].getContainer(); const children = container.get("children"); for (const child of children) { const isKeyShape = child.get("isKeyShape"); if (!isKeyShape) { child.set( "ori-visibility", child.get("ori-visibility") || child.get("visible"), ); child.hide(); } } } } }, onDragMove(e: IG6GraphEvent) { const { graph } = this; const target = e.target; const targetIsCanvas = target && target.isCanvas && target.isCanvas(); if (!this.allowDragOnItem && !targetIsCanvas) return; e = cloneEvent(e); if (!this.origin) { return; } if (!this.dragging) { if ( abs(this.origin.x - e.clientX) + abs(this.origin.y - e.clientY) < DRAG_OFFSET ) { return; } if (this.shouldBegin.call(this, e)) { e.type = "dragstart"; this.dragging = true; } } if (this.shouldUpdate.call(this, e)) { this.updateViewport(e); } }, onDragEnd(e: IG6GraphEvent) { const { graph } = this; if (this.enableOptimize) { // 拖动结束后显示所有的边 const edges = graph.getEdges(); for (let i = 0, len = edges.length; i < len; i++) { const shapes = edges[i].get("group").get("children"); if (!shapes) continue; shapes.forEach((shape) => { const oriVis = shape.get("ori-visibility"); if (oriVis) shape.show(); }); } const nodes = graph.getNodes(); for (let j = 0, nodeLen = nodes.length; j < nodeLen; j++) { const container = nodes[j].getContainer(); const children = container.get("children"); for (const child of children) { const isKeyShape = child.get("isKeyShape"); if (!isKeyShape) { const oriVis = child.get("ori-visibility"); if (oriVis) child.show(); } } } } if (!this.dragging) { this.origin = null; return; } e = cloneEvent(e); if (this.shouldEnd.call(this, e)) { this.updateViewport(e); } e.type = "dragend"; // graph.emit('canvas:dragend', e); this.endDrag(); }, endDrag() { this.origin = null; this.dragging = false; this.dragbegin = false; }, }; ================================================ FILE: packages/f6/src/behavior/drag-combo.ts ================================================ /* * @Author: moyee * @LastEditors: moyee * @Description: 拖动 Combo */ import { each } from "@antv/util"; import { IGroup } from "@antv/g-base"; import { G6Event, IG6GraphEvent, Item, ComboConfig, ICombo, INode, } from "@antv/f6-core"; import { IGraph } from "../interface/graph"; import Util from "../util"; import Global from "../global"; const { calculationItemsBBox } = Util; /** * 遍历拖动的 Combo 下的所有 Combo * @param data 拖动的 Combo * @param fn */ const traverseCombo = (data, fn: (param: any) => boolean) => { if (fn(data) === false) { return; } if (data) { const combos = data.get("combos"); if (combos.length === 0) { return false; } each(combos, (child) => { traverseCombo(child, fn); }); } }; export default { getDefaultCfg() { return { enableDelegate: false, delegateStyle: {}, // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构 onlyChangeComboSize: false, // 拖动过程中目标 combo 状态样式 activeState: "", selectedState: "selected", }; }, getEvents(): { [key in G6Event]?: string } { return { "combo:dragstart": "onDragStart", "combo:drag": "onDrag", "combo:dragend": "onDragEnd", "combo:drop": "onDrop", "node:drop": "onNodeDrop", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", }; }, validationCombo(evt: IG6GraphEvent) { const { item } = evt; if (!item || item.destroyed) { return false; } if (!this.shouldUpdate(this, evt)) { return false; } const type = item.getType(); if (type !== "combo") { return false; } return true; }, onDragStart(evt: IG6GraphEvent) { const graph: IGraph = this.graph; const { item } = evt; if (!this.validationCombo(evt)) return; this.targets = []; // 获取所有选中的 Combo const combos = graph.findAllByState("combo", this.selectedState); const currentCombo = item.get("id"); const dragCombos = combos.filter((combo) => { const comboId = combo.get("id"); return currentCombo === comboId; }); if (dragCombos.length === 0) { this.targets.push(item); } else { this.targets = combos; } if (this.activeState) { this.targets.map((combo: ICombo) => { const model = combo.getModel() as ComboConfig; if (model.parentId) { const parentCombo = graph.findById(model.parentId); if (parentCombo) { graph.setItemState(parentCombo, this.activeState, true); } } }); } this.point = {}; this.originPoint = {}; this.origin = { x: evt.x, y: evt.y, }; this.currentItemChildCombos = []; traverseCombo(item, (param) => { if (param.destroyed) { return false; } const model = param.getModel(); this.currentItemChildCombos.push(model.id); return true; }); }, onDrag(evt: IG6GraphEvent) { if (!this.origin) { return; } if (!this.validationCombo(evt)) return; if (this.enableDelegate) { this.updateDelegate(evt); } else { if (this.activeState) { const graph: IGraph = this.graph; const item: Item = evt.item; const model = item.getModel(); // 拖动过程中实时计算距离 const combos = graph.getCombos(); const sourceBBox = item.getBBox(); const { centerX, centerY, width } = sourceBBox; // 参与计算的 Combo,需要排除掉: // 1、拖动 combo 自己 // 2、拖动 combo 的 parent // 3、拖动 Combo 的 children const calcCombos = combos.filter((combo) => { const cmodel = combo.getModel() as ComboConfig; // 被拖动的是最外层的 Combo,无 parent,排除自身和子元素 if (!model.parentId) { return ( cmodel.id !== model.id && !this.currentItemChildCombos.includes(cmodel.id) ); } return ( cmodel.id !== model.id && !this.currentItemChildCombos.includes(cmodel.id) ); }); calcCombos.map((combo) => { const { centerX: cx, centerY: cy, width: w } = combo.getBBox(); // 拖动的 combo 和要进入的 combo 之间的距离 const disX = centerX - cx; const disY = centerY - cy; // 圆心距离 const distance = 2 * Math.sqrt(disX * disX + disY * disY); if (width + w - distance > 0.8 * width) { graph.setItemState(combo, this.activeState, true); } else { graph.setItemState(combo, this.activeState, false); } }); } each(this.targets, (item) => { this.updateCombo(item, evt); }); } }, updatePositions(evt: IG6GraphEvent) { // 当启用 delegate 时,拖动结束时需要更新 combo if (this.enableDelegate) { each(this.targets, (item) => { this.updateCombo(item, evt); }); } }, onDrop(evt: IG6GraphEvent) { // 被放下的目标 combo const { item } = evt; if (!item || !this.targets || item.destroyed) { return; } this.updatePositions(evt); const graph: IGraph = this.graph; const targetModel = item.getModel(); this.targets.map((combo: ICombo) => { const model = combo.getModel(); if (model.parentId !== targetModel.id) { if (this.activeState) { graph.setItemState(item, this.activeState, false); } // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构 if (!this.onlyChangeComboSize) { graph.updateComboTree(combo, targetModel.id); } else { graph.updateCombo(combo); } } else { graph.updateCombo(item as ICombo); } }); this.end(item, evt); // 如果已经拖放下了,则不需要再通过距离判断了 this.endComparison = true; }, onNodeDrop(evt: IG6GraphEvent) { if (!this.targets || this.targets.length === 0) return; this.updatePositions(evt); const graph: IGraph = this.graph; const item = evt.item as INode; const comboId = item.getModel().comboId as string; let droppedCombo; // 如果被放置的的节点有 comboId,且这个 comboId 与正在被拖拽的 combo 的父 id 不相同,则更新父亲为 comboId if (comboId) { if (this.activeState) { const combo = graph.findById(comboId); graph.setItemState(combo, this.activeState, false); } this.targets.map((combo: ICombo) => { if (!this.onlyChangeComboSize) { if (comboId !== combo.getID()) { droppedCombo = graph.findById(comboId); if (comboId !== combo.getModel().parentId) graph.updateComboTree(combo, comboId); } } else { graph.updateCombo(combo); } }); } else { // 如果被放置的节点没有 comboId,且正在被拖拽的 combo 有父 id,则更新父亲为 undefined this.targets.map((combo: ICombo) => { if (!this.onlyChangeComboSize) { const model = combo.getModel(); if (model.comboId) { graph.updateComboTree(combo); } } else { graph.updateCombo(combo); } }); } // 如果已经拖放下了,则不需要再通过距离判断了 this.endComparison = true; this.end(droppedCombo, evt); }, onDragEnter(evt: IG6GraphEvent) { if (!this.origin) { return; } if (!this.validationCombo(evt)) return; const { item } = evt; const graph: IGraph = this.graph; if (this.activeState) { graph.setItemState(item, this.activeState, true); } }, onDragLeave(evt) { if (!this.origin) { return; } if (!this.validationCombo(evt)) return; const item = evt.item as ICombo; const graph: IGraph = this.graph; if (this.activeState) { graph.setItemState(item, this.activeState, false); } }, onDragEnd(evt: IG6GraphEvent) { if (!this.targets || this.targets.length === 0) return; const item = evt.item; this.updatePositions(evt); const parentCombo = this.getParentCombo(item.getModel().parentId); const graph: IGraph = this.graph; if (parentCombo && this.activeState) { graph.setItemState(parentCombo, this.activeState, false); } this.end(undefined, evt); }, end(comboDropedOn: ICombo | undefined, evt: IG6GraphEvent) { if (!this.origin) return; const graph: IGraph = this.graph; // 删除delegate shape if (this.delegateShape) { const delegateGroup = graph.get("delegateGroup"); delegateGroup.clear(); this.delegateShape = null; } if (comboDropedOn && this.activeState) { graph.setItemState(comboDropedOn, this.activeState, false); } // 若没有被放置的 combo,则是被放置在画布上 if (!comboDropedOn) { this.targets.map((combo: ICombo) => { // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构 if (!this.onlyChangeComboSize) { graph.updateComboTree(combo); } else { graph.updateCombo(combo); } }); } this.point = []; this.origin = null; this.originPoint = null; this.targets.length = 0; }, /** * 遍历 comboTree,分别更新 node 和 combo * @param data * @param fn */ traverse(data: T, fn: (param: T) => boolean) { if (fn(data) === false) { return; } if (data) { const combos = data.get("combos"); each(combos, (child) => { this.traverse(child, fn); }); const nodes = data.get("nodes"); each(nodes, (child) => { this.traverse(child, fn); }); } }, updateCombo(item: ICombo, evt: IG6GraphEvent) { this.traverse(item, (param) => { if (param.destroyed) { return false; } this.updateSignleItem(param, evt); return true; }); }, /** * * @param item 当前正在拖动的元素 * @param evt */ updateSignleItem(item: Item, evt: IG6GraphEvent) { const { origin } = this; const graph: IGraph = this.graph; const model = item.getModel() as ComboConfig; const itemId = item.get("id"); if (!this.point[itemId]) { this.point[itemId] = { x: model.x, y: model.y, }; } const x: number = evt.x - origin.x + this.point[itemId].x; const y: number = evt.y - origin.y + this.point[itemId].y; graph.updateItem(item, { x, y }); }, /** * 根据 ID 获取父 Combo * @param parentId 父 Combo ID */ getParentCombo(parentId: string): ICombo | undefined { const graph: IGraph = this.graph; if (!parentId) { return undefined; } const parentCombo = graph.findById(parentId) as ICombo; if (!parentCombo) { return undefined; } return parentCombo; }, updateDelegate(evt: IG6GraphEvent) { const graph: IGraph = this.graph; // 当没有 delegate shape 时创建 if (!this.delegateShape) { const delegateGroup: IGroup = graph.get("delegateGroup"); let bbox = null; if (this.targets.length > 1) { bbox = calculationItemsBBox(this.targets); } else { bbox = this.targets[0].getBBox(); } const { x, y, width, height, minX, minY } = bbox; this.originPoint = { x, y, width, height, minX, minY }; const attrs = { ...Global.delegateStyle, ...this.delegateStyle }; this.delegateShape = delegateGroup.addShape("rect", { attrs: { width: bbox.width, height: bbox.height, x: bbox.x, y: bbox.y, ...attrs, }, name: "combo-delegate-shape", }); } else { const clientX = evt.x - this.origin.x + this.originPoint.minX; const clientY = evt.y - this.origin.y + this.originPoint.minY; this.delegateShape.attr({ x: clientX, y: clientY, }); } }, }; ================================================ FILE: packages/f6/src/behavior/drag-node.ts ================================================ /* * @Author: moyee * @Date: 2019-06-27 18:12:06 * @LastEditors: moyee * @LastEditTime: 2019-08-22 18:41:45 * @Description: 拖动节点的Behavior */ import { Point } from "@antv/g-base"; import { deepMix, clone } from "@antv/util"; import { G6Event, IG6GraphEvent, Item, NodeConfig, INode, ICombo, } from "@antv/f6-core"; import { IGraph } from "../interface/graph"; import Global from "../global"; export default { getDefaultCfg(): object { return { updateEdge: true, delegateStyle: {}, // 是否开启delegate enableDelegate: false, // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构 onlyChangeComboSize: false, // 拖动过程中目标 combo 状态样式 comboActiveState: "", selectedState: "selected", }; }, getEvents(): { [key in G6Event]?: string } { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", "combo:drop": "onDropCombo", "node:drop": "onDropNode", "canvas:drop": "onDropCanvas", }; }, validationCombo(item: ICombo) { if (!this.origin || !item || item.destroyed) { return false; } const type = item.getType(); if (type !== "combo") { return false; } return true; }, /** * 开始拖动节点 * @param evt */ onDragStart(evt: IG6GraphEvent) { if (!this.shouldBegin.call(this, evt)) { return; } const item: INode = evt.item as INode; if (!item || item.destroyed || item.hasLocked()) { return; } // 如果拖动的target 是linkPoints / anchorPoints 则不允许拖动 const { target } = evt; if (target) { const isAnchorPoint = target.get("isAnchorPoint"); if (isAnchorPoint) { return; } } const { graph } = this; this.targets = []; // 将节点拖入到指定的 Combo this.targetCombo = null; // 获取所有选中的元素 const nodes = graph.findAllByState("node", this.selectedState); const currentNodeId = item.get("id"); // 当前拖动的节点是否是选中的节点 const dragNodes = nodes.filter((node) => { const nodeId = node.get("id"); return currentNodeId === nodeId; }); // 只拖动当前节点 if (dragNodes.length === 0) { this.targets.push(item); } else if (nodes.length > 1) { // 拖动多个节点 nodes.forEach((node) => { const locked = node.hasLocked(); if (!locked) { this.targets.push(node); } }); } else { this.targets.push(item); } const beforeDragNodes = []; this.targets.forEach((t) => { beforeDragNodes.push(clone(t.getModel())); }); this.set("beforeDragNodes", beforeDragNodes); this.origin = { x: evt.x, y: evt.y, }; this.point = {}; this.originPoint = {}; }, /** * 持续拖动节点 * @param evt */ onDrag(evt: IG6GraphEvent) { if (!this.origin) { return; } if (!this.shouldUpdate(this, evt)) { return; } if (this.get("enableDelegate")) { this.updateDelegate(evt); } else { this.targets.map((target) => { this.update(target, evt); }); } }, /** * 拖动结束,设置拖动元素capture为true,更新元素位置,如果是拖动涉及到 combo,则更新 combo 结构 * @param evt */ onDragEnd(evt: IG6GraphEvent) { if (!this.origin || !this.shouldEnd.call(this, evt)) { return; } // 拖动结束后,设置拖动元素 group 的 capture 为 true,允许拾取拖动元素 const item = evt.item as INode; if (item) { const group = item.getContainer(); group.set("capture", true); } if (this.delegateRect) { this.delegateRect.remove(); this.delegateRect = null; } this.updatePositions(evt); const graph: IGraph = this.graph; // 拖动结束后,入栈 if (graph.get("enabledStack")) { const stackData = { before: { nodes: this.get("beforeDragNodes"), edges: [], combos: [] }, after: { nodes: [], edges: [], combos: [] }, }; this.targets.forEach((target) => { stackData.after.nodes.push(target.getModel()); }); graph.pushStack("update", clone(stackData)); } // 拖动结束后emit事件,将当前操作的节点抛出去,目标节点为null graph.emit("dragnodeend", { items: this.targets, targetItem: null, }); this.point = {}; this.origin = null; this.originPoint = {}; this.targets.length = 0; this.targetCombo = null; }, /** * 拖动过程中将节点放置到 combo 上 * @param evt */ onDropCombo(evt: IG6GraphEvent) { const item = evt.item as ICombo; if (!this.validationCombo(item)) return; this.updatePositions(evt); const graph: IGraph = this.graph; if (this.comboActiveState) { graph.setItemState(item, this.comboActiveState, false); } this.targetCombo = item; // 拖动结束后是动态改变 Combo 大小还是将节点从 Combo 中删除 if (this.onlyChangeComboSize) { // 拖动节点结束后,动态改变 Combo 的大小 graph.updateCombos(); } else { const targetComboModel = item.getModel(); this.targets.map((node: INode) => { const nodeModel = node.getModel(); if (nodeModel.comboId !== targetComboModel.id) { graph.updateComboTree(node, targetComboModel.id); } }); graph.updateCombo(item as ICombo); } // 将节点拖动到 combo 上面,emit事件抛出当前操作的节点及目标 combo graph.emit("dragnodeend", { items: this.targets, targetItem: this.targetCombo, }); }, onDropCanvas(evt: IG6GraphEvent) { const graph: IGraph = this.graph; if (!this.targets || this.targets.length === 0) return; this.updatePositions(evt); if (this.onlyChangeComboSize) { // 拖动节点结束后,动态改变 Combo 的大小 graph.updateCombos(); } else { this.targets.map((node: INode) => { // 拖动的节点有 comboId,即是从其他 combo 中拖出时才处理 const model = node.getModel(); if (model.comboId) { graph.updateComboTree(node); } }); } }, /** * 拖动放置到某个 combo 中的子 node 上 * @param evt */ onDropNode(evt: IG6GraphEvent) { const self = this; if (!self.targets || self.targets.length === 0) return; const item = evt.item as INode; self.updatePositions(evt); const graph: IGraph = self.graph; const comboId = item.getModel().comboId as string; if (comboId) { const combo = graph.findById(comboId); if (self.comboActiveState) { graph.setItemState(combo, self.comboActiveState, false); } self.targets.map((node: INode) => { const nodeModel = node.getModel(); if (comboId !== nodeModel.comboId) { graph.updateComboTree(node, comboId); } }); graph.updateCombo(combo as ICombo); } else { self.targets.map((node: INode) => { const model = node.getModel(); if (model.comboId) { graph.updateComboTree(node); } }); } // 将节点拖动到另外个节点上面,emit 事件抛出当前操作的节点及目标节点 graph.emit("dragnodeend", { items: self.targets, targetItem: item, }); }, /** * 将节点拖入到 Combo 中 * @param evt */ onDragEnter(evt: IG6GraphEvent) { const item = evt.item as ICombo; if (!this.validationCombo(item)) return; const graph: IGraph = this.graph; if (this.comboActiveState) { graph.setItemState(item, this.comboActiveState, true); } }, /** * 将节点从 Combo 中拖出 * @param evt */ onDragLeave(evt: IG6GraphEvent) { const item = evt.item as ICombo; if (!this.validationCombo(item)) return; const graph: IGraph = this.graph; if (this.comboActiveState) { graph.setItemState(item, this.comboActiveState, false); } }, updatePositions(evt: IG6GraphEvent) { if (!this.targets || this.targets.length === 0) return; // 当开启 delegate 时,拖动结束后需要更新所有已选中节点的位置 if (this.get("enableDelegate")) { this.targets.map((node) => this.update(node, evt)); } }, /** * 更新节点 * @param item 拖动的节点实例 * @param evt */ update(item: Item, evt: IG6GraphEvent) { const { origin } = this; const model: NodeConfig = item.get("model"); const nodeId: string = item.get("id"); if (!this.point[nodeId]) { this.point[nodeId] = { x: model.x || 0, y: model.y || 0, }; } const x: number = evt.x - origin.x + this.point[nodeId].x; const y: number = evt.y - origin.y + this.point[nodeId].y; const pos: Point = { x, y }; if (this.get("updateEdge")) { this.graph.updateItem(item, pos, false); } else { item.updatePosition(pos); } }, /** * 更新拖动元素时的delegate * @param {Event} e 事件句柄 * @param {number} x 拖动单个元素时候的x坐标 * @param {number} y 拖动单个元素时候的y坐标 */ updateDelegate(e) { const { graph } = this; if (!this.delegateRect) { // 拖动多个 const parent = this.graph.get("group"); const attrs = deepMix({}, Global.delegateStyle, this.delegateStyle); const { x: cx, y: cy, width, height, minX, minY, } = this.calculationGroupPosition(e); this.originPoint = { x: cx, y: cy, width, height, minX, minY }; // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标 this.delegateRect = parent.addShape("rect", { attrs: { width, height, x: cx, y: cy, ...attrs, }, name: "rect-delegate-shape", }); // this.delegateRect.set('capture', false); } else { const clientX = e.x - this.origin.x + this.originPoint.minX; const clientY = e.y - this.origin.y + this.originPoint.minY; this.delegateRect.attr({ x: clientX, y: clientY, }); } }, /** * 计算delegate位置,包括左上角左边及宽度和高度 * @memberof ItemGroup * @return {object} 计算出来的delegate坐标信息及宽高 */ calculationGroupPosition(evt: IG6GraphEvent) { const { graph } = this; const nodes = graph.findAllByState("node", this.selectedState); if (nodes.length === 0) { nodes.push(evt.item); } let minx = Infinity; let maxx = -Infinity; let miny = Infinity; let maxy = -Infinity; // 获取已节点的所有最大最小x y值 for (let i = 0; i < nodes.length; i++) { const element = nodes[i]; const bbox = element.getBBox(); const { minX, minY, maxX, maxY } = bbox; if (minX < minx) { minx = minX; } if (minY < miny) { miny = minY; } if (maxX > maxx) { maxx = maxX; } if (maxY > maxy) { maxy = maxY; } } const x = Math.floor(minx); const y = Math.floor(miny); const width = Math.ceil(maxx) - Math.floor(minx); const height = Math.ceil(maxy) - Math.floor(miny); return { x, y, width, height, minX: minx, minY: miny, }; }, }; ================================================ FILE: packages/f6/src/behavior/index.ts ================================================ import { each } from "@antv/util"; import { registerBehavior } from "@antv/f6-core"; import DragCanvas from "./drag-canvas"; import DragNode from "./drag-node"; import ActivateRelations from "./activate-relations"; import ClickSelect from "./click-select"; import ZoomCanvas from "./zoom-canvas"; import CollapseExpand from "./collapse-expand"; import DragCombo from "./drag-combo"; import CollapseExpandCombo from "./collapse-expand-combo"; import CreateEdge from "./create-edge"; import mobileBehavior from "./mobile-behavior"; const behaviors = { "drag-canvas": DragCanvas, "zoom-canvas": ZoomCanvas, "drag-node": DragNode, "activate-relations": ActivateRelations, "click-select": ClickSelect, "collapse-expand": CollapseExpand, "drag-combo": DragCombo, "collapse-expand-combo": CollapseExpandCombo, "create-edge": CreateEdge, }; each(behaviors, (behavior, type: string) => { registerBehavior(type, { ...behavior, ...mobileBehavior }); }); // export default Behavior; ================================================ FILE: packages/f6/src/behavior/mobile-behavior.ts ================================================ import { each } from "@antv/util"; import { IAbstractGraph, G6Event } from "@antv/f6-core"; export default { /** * auto bind events when register behavior * @param graph Graph instance */ bind(graph: IAbstractGraph) { if (this.type === "drag-canvas") { graph.get("canvas").set("draggable", true); } const { events } = this; this.graph = graph; each(events, (handler: () => void, event: G6Event) => { graph.on(event, handler); }); }, unbind(graph: IAbstractGraph) { const { events } = this; if (this.type === "drag-canvas") { graph.get("canvas").set("draggable", false); } this.graph = null; each(events, (handler: () => void, event: G6Event) => { graph.off(event, handler); }); }, }; ================================================ FILE: packages/f6/src/behavior/tooltip.ts ================================================ import { G6Event, IG6GraphEvent } from "@antv/f6-core"; export default { getDefaultCfg(): object { return { item: "node", offset: 12, formatText(model) { return model.label; }, }; }, getEvents(): { [key in G6Event | "afterremoveitem"]?: string } { return { "node:press": "onPress", actionend: "onPressEnd", }; }, onPress(e: IG6GraphEvent) { const { item } = e; this.currentTarget = item; this.showTooltip(e); this.graph.emit("tooltipchange", { item: e.item, action: "show" }); }, onPressEnd(e: IG6GraphEvent) { if (!this.shouldEnd(e)) { return; } this.hideTooltip(); this.graph.emit("tooltipchange", { item: this.currentTarget, action: "hide", }); this.currentTarget = null; }, showTooltip(e: IG6GraphEvent) { // 绘制tip }, hideTooltip() { // 隐藏tip }, }; ================================================ FILE: packages/f6/src/behavior/zoom-canvas.ts ================================================ import { G6Event } from "@antv/f6-core"; export default { firstScale: null, getDefaultCfg(): object { return { originScale: 1, sensitivity: 2, minZoom: undefined, maxZoom: undefined, enableOptimize: false, optimizeZoom: 0.1, fixSelectedItems: { fixAll: false, fixLineWidth: false, fixLabel: false, fixState: "selected", }, }; }, getEvents(): { [key in G6Event]?: string } { const { fixSelectedItems } = this; if (!fixSelectedItems.fixState) fixSelectedItems.fixState = "selected"; if (fixSelectedItems.fixAll) { fixSelectedItems.fixLineWidth = true; fixSelectedItems.fixLabel = true; } return { pinchstart: "onPinch", pinchmove: "onPinch", }; }, onPinch(evt) { if (evt.preventDefault) evt.preventDefault(); if (evt.originalEvent.preventDefault) evt.originalEvent.preventDefault(); const pointers = evt.originalEvent.pointers; if (pointers.length < 2) return; if (evt.type === "pinchstart") { this.firstScale = this.graph.getZoom(); } const scale = evt.originalEvent.scale || evt.originalEvent.srcEvent.extra.scale; // 应用到画布上的缩放比例 const zoom = this.firstScale * scale; // 缓存当前的缩放比例 this.currentScale = zoom; const minZoom = this.get("minZoom") || this.graph.get("minZoom"); const maxZoom = this.get("maxZoom") || this.graph.get("maxZoom"); if (zoom > maxZoom || zoom < minZoom) { return; } const canvas = this.graph.get("canvas"); const posA = { x: pointers[0].clientX, y: pointers[0].clientY }; const posB = { x: pointers[1].clientX, y: pointers[1].clientY }; // 缩放点放中间 const point = canvas.getPointByClient( (posA.x + posB.x) / 2, (posA.y + posB.y) / 2, ); this.graph.zoomTo(zoom, { x: point.x, y: point.y }); }, }; ================================================ FILE: packages/f6/src/element/index.ts ================================================ import "@antv/f6-element"; ================================================ FILE: packages/f6/src/extends/graph/treeGraph/index.ts ================================================ // @ts-nocheck import { Point } from "@antv/g-base"; import Hierarchy from "@antv/hierarchy"; import { each, isString } from "@antv/util"; import { GraphData, Item, NodeConfig, ShapeStyle, TreeGraphData, GraphOptions, } from "@antv/f6-core"; import { ITreeGraph } from "../../../interface/graph"; // import { makeExtender } from '../../../util/extender'; const treeGraph = (G6: { Graph?: any; Util?: any }): ITreeGraph => { const { Graph, Util } = G6; const { radialLayout, traverseTree } = Util; class TreeGraph extends Graph implements ITreeGraph { private layoutAnimating: boolean; constructor(cfg: GraphOptions) { super(cfg); this.layoutAnimating = false; // 用于缓存动画结束后需要删除的节点 this.set("removeList", []); this.set("layoutMethod", this.getLayout()); } /** * 通过 Layout 配置获取布局配置 */ private getLayout() { const layout = this.get("layout"); if (!layout) { return null; } if (typeof layout === "function") { return layout; } if (!layout.type) { layout.type = "dendrogram"; } if (!layout.direction) { layout.direction = "TB"; } if (layout.radial) { return (data: any) => { const layoutData = Hierarchy[layout.type](data, layout); radialLayout(layoutData); return layoutData; }; } return (data: any) => Hierarchy[layout.type](data, layout); } /** * 返回指定节点在树图数据中的索引 * @param children 树图数据 * @param child 树图中某一个 Item 的数据 */ private static indexOfChild(children: TreeGraphData[], id: string): number { let index = -1; // eslint-disable-next-line consistent-return each(children, (former, i) => { if (id === former.id) { index = i; return false; } }); return index; } public getDefaultCfg(): any { const cfg = super.getDefaultCfg(); // 树图默认打开动画 cfg.animate = true; return cfg; } /** * 向🌲树中添加数据 * @param treeData 树图数据 * @param parent 父节点实例 * @param animate 是否开启动画 */ private innerAddChild( treeData: TreeGraphData, parent: Item | undefined, animate: boolean, ): Item { const self = this; const model = treeData.data; if (model) { // model 中应存储真实的数据,特别是真实的 children model.x = treeData.x; model.y = treeData.y; model.depth = treeData.depth; } const node = self.addItem("node", model!, false); if (parent) { node.set("parent", parent); if (animate) { const origin = parent.get("originAttrs"); if (origin) { node.set("originAttrs", origin); } else { const parentModel = parent.getModel(); node.set("originAttrs", { x: parentModel.x, y: parentModel.y, }); } } const childrenList = parent.get("children"); if (!childrenList) { parent.set("children", [node]); } else { childrenList.push(node); } self.addItem( "edge", { source: parent, target: node, id: `${parent.get("id")}:${node.get("id")}`, }, false, ); } // 渲染到视图上应参考布局的children, 避免多绘制了收起的节点 each(treeData.children || [], (child) => { self.innerAddChild(child, node, animate); }); self.emit("afteraddchild", { item: node, parent }); return node; } /** * 将数据上的变更转换到视图上 * @param data * @param parent * @param animate */ private innerUpdateChild( data: TreeGraphData, parent: Item | undefined, animate: boolean, ) { const self = this; const current = self.findById(data.id); // 若子树不存在,整体添加即可 if (!current) { self.innerAddChild(data, parent, animate); return; } // 更新新节点下所有子节点 each(data.children || [], (child: TreeGraphData) => { self.innerUpdateChild(child, current, animate); }); // 用现在节点的children实例来删除移除的子节点 const children = current.get("children"); if (children) { const len = children.length; if (len > 0) { for (let i = children.length - 1; i >= 0; i--) { const child = children[i].getModel(); if (TreeGraph.indexOfChild(data.children || [], child.id) === -1) { self.innerRemoveChild( child.id, { x: data.x!, y: data.y!, }, animate, ); // 更新父节点下缓存的子节点 item 实例列表 children.splice(i, 1); } } } } let oriX: number; let oriY: number; if (current.get("originAttrs")) { oriX = current.get("originAttrs").x; oriY = current.get("originAttrs").y; } const model = current.getModel(); if (animate) { // 如果有动画,先缓存节点运动再更新节点 current.set("originAttrs", { x: model.x, y: model.y, }); } current.set("model", data.data); if (oriX !== data.x || oriY !== data.y) { current.updatePosition({ x: data.x, y: data.y }); } } /** * 删除子节点Item对象 * @param id * @param to * @param animate */ private innerRemoveChild(id: string, to: Point, animate: boolean) { const self = this; const node: Item = self.findById(id); if (!node) { return; } each(node.get("children"), (child) => { self.innerRemoveChild(child.getModel().id, to, animate); }); if (animate) { const model = node.getModel(); node.set("to", to); node.set("originAttrs", { x: model.x, y: model.y }); self.get("removeList").push(node); } else { self.removeItem(node); } } /** * 更新数据模型,差量更新并重新渲染 * @param {object} data 数据模型 */ public changeData(data?: GraphData | TreeGraphData): any { const self = this; // 更改数据源后,取消所有状态 this.getNodes().map((node) => self.clearItemStates(node)); this.getEdges().map((edge) => self.clearItemStates(edge)); if (data) { self.data(data); self.render(); } else { self.layout(this.get("fitView")); } } /** * 已更名为 updateLayout,为保持兼容暂且保留。 * 更改并应用树布局算法 * @param {object} layout 布局算法 */ public changeLayout(layout: any) { // eslint-disable-next-line no-console console.warn( "Please call updateLayout instead of changeLayout. changeLayout will be discarded soon", ); const self = this; self.updateLayout(layout); } /** * 更改并应用树布局算法 * @param {object} layout 布局算法 */ public updateLayout(layout: any) { const self = this; if (!layout) { // eslint-disable-next-line no-console console.warn("layout cannot be null"); return; } self.set("layout", layout); self.set("layoutMethod", self.getLayout()); self.layout(); } /** * 已更名为 layout,为保持兼容暂且保留。 * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。 * @param {boolean} fitView 更新布局时是否需要适应窗口 */ public refreshLayout(fitView?: boolean) { // eslint-disable-next-line no-console console.warn( "Please call layout instead of refreshLayout. refreshLayout will be discarded soon", ); const self = this; self.layout(fitView); } /** * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。 * @param {boolean} fitView 更新布局时是否需要适应窗口 */ public layout(fitView?: boolean) { const self = this; const data: TreeGraphData = self.get("data"); const layoutMethod = self.get("layoutMethod"); const layoutData = layoutMethod(data, self.get("layout")); const animate: boolean = self.get("animate"); self.emit("beforerefreshlayout", { data, layoutData }); self.emit("beforelayout"); self.innerUpdateChild(layoutData, undefined, animate); if (fitView) { const viewController = self.get("viewController"); viewController.fitView(); } if (!animate) { // 如果没有动画,目前仅更新了节点的位置,刷新一下边的样式 self.refresh(); self.paint(); } else { self.layoutAnimate(layoutData); } self.emit("afterrefreshlayout", { data, layoutData }); self.emit("afterlayout"); } /** * 添加子树到对应 id 的节点 * @param {TreeGraphData} data 子树数据模型 * @param {string} parent 子树的父节点id */ public addChild(data: TreeGraphData, parent: string | Item): void { const self = this; self.emit("beforeaddchild", { model: data, parent }); // 将数据添加到源数据中,走changeData方法 if (!isString(parent)) { parent = parent.get("id") as string; } const parentData = self.findDataById(parent); if (parentData) { if (!parentData.children) { parentData.children = []; } parentData.children.push(data); self.changeData(); } } /** * 更新某个节点下的所有子节点 * @param {TreeGraphData[]} data 子树数据模型集合 * @param {string} parent 子树的父节点id */ public updateChildren(data: TreeGraphData[], parentId: string): void { const self = this; // 如果没有父节点或找不到该节点,是全量的更新,直接重置data if (!parentId || !self.findById(parentId)) { console.warn( `Update children failed! There is no node with id '${parentId}'`, ); return; } const parentModel = self.findDataById(parentId) as NodeConfig; parentModel.children = data; self.changeData(); } /** * 更新源数据,差量更新子树 * @param {TreeGraphData} data 子树数据模型 * @param {string} parentId 子树的父节点id */ public updateChild(data: TreeGraphData, parentId?: string): void { const self = this; // 如果没有父节点或找不到该节点,是全量的更新,直接重置data if (!parentId || !self.findById(parentId)) { self.changeData(data); return; } const parentModel = self.findDataById(parentId) as NodeConfig; const current = self.findById(data.id); if (!parentModel.children) { // 当 current 不存在时,children 为空数组 parentModel.children = []; } // 如果不存在该节点,则添加 if (!current) { parentModel.children.push(data); } else { const index = TreeGraph.indexOfChild(parentModel.children, data.id); parentModel.children[index] = data; } self.changeData(); } /** * 删除子树 * @param {string} id 子树根节点id */ public removeChild(id: string): void { const self = this; const node = self.findById(id); if (!node) { return; } const parent = node.get("parent"); if (parent && !parent.destroyed) { const parentNode = self.findDataById(parent.get("id")); const siblings = (parentNode && parentNode.children) || []; const model: NodeConfig = node.getModel() as NodeConfig; const index = TreeGraph.indexOfChild(siblings, model.id); siblings.splice(index, 1); } self.changeData(); } /** * 根据id获取对应的源数据 * @param {string} id 元素id * @param {TreeGraphData | undefined} parent 从哪个节点开始寻找,为空时从根节点开始查找 * @return {TreeGraphData} 对应源数据 */ public findDataById( id: string, parent?: TreeGraphData | undefined, ): TreeGraphData | null { const self = this; if (!parent) { parent = self.get("data") as TreeGraphData; } if (id === parent.id) { return parent; } let result: TreeGraphData | null = null; // eslint-disable-next-line consistent-return each(parent.children || [], (child) => { if (child.id === id) { result = child; return false; } result = self.findDataById(id, child); if (result) { return false; } }); return result; } /** * 布局动画接口,用于数据更新时做节点位置更新的动画 * @param {TreeGraphData} data 更新的数据 * @param {function} onFrame 定义节点位置更新时如何移动 */ public layoutAnimate( data: TreeGraphData, onFrame?: ( item: Item, ratio: number, originAttrs?: ShapeStyle, data?: TreeGraphData, ) => unknown, ): void { const self = this; const animateCfg = this.get("animateCfg"); self.emit("beforeanimate", { data }); // 如果边中没有指定锚点,但是本身有锚点控制,在动画过程中保持锚点不变 self.getEdges().forEach((edge) => { const model = edge.get("model"); if (!model.sourceAnchor) { model.sourceAnchor = edge.get("sourceAnchorIndex"); } }); this.get("canvas").animate( (ratio: number) => { traverseTree(data, (child) => { const node = self.findById(child.id); // 只有当存在node的时候才执行 if (node) { let origin = node.get("originAttrs"); const model = node.get("model"); if (!origin) { origin = { x: model.x, y: model.y, }; node.set("originAttrs", origin); } if (onFrame) { const attrs = onFrame(node, ratio, origin, data); node.set("model", Object.assign(model, attrs)); } else { model.x = origin.x + (child.x! - origin.x) * ratio; model.y = origin.y + (child.y! - origin.y) * ratio; } } return true; }); each(self.get("removeList"), (node) => { const model = node.getModel(); const from = node.get("originAttrs"); const to = node.get("to"); model.x = from.x + (to.x - from.x) * ratio; model.y = from.y + (to.y - from.y) * ratio; }); self.refreshPositions(); }, { duration: animateCfg.duration, easing: animateCfg.ease, callback: () => { each(self.getNodes(), (node) => { node.set("originAttrs", null); }); each(self.get("removeList"), (node) => { self.removeItem(node); }); self.set("removeList", []); if (animateCfg.callback) { animateCfg.callback(); } self.emit("afteranimate", { data }); }, delay: animateCfg.delay, }, ); } /** * 立即停止布局动画 */ public stopLayoutAnimate(): void { this.get("canvas").stopAnimate(); this.emit("layoutanimateend", { data: this.get("data") }); this.layoutAnimating = false; } /** * 是否在布局动画 * @return {boolean} 是否有布局动画 */ public isLayoutAnimating(): boolean { return this.layoutAnimating; } /** * 根据data接口的数据渲染视图 */ public render(): void { const self = this; const data: TreeGraphData = self.get("data"); if (!data) { throw new Error("data must be defined first"); } self.clear(); self.emit("beforerender"); self.layout(this.get("fitView")); self.emit("afterrender"); } /** * 导出图数据 * @return {object} data */ public save(): TreeGraphData | GraphData { return this.get("data"); } } return TreeGraph; }; export default treeGraph; ================================================ FILE: packages/f6/src/extends/layout/circularLayout/index.ts ================================================ import { CircularLayout } from "@antv/layout/lib/layout/circular"; export default CircularLayout; ================================================ FILE: packages/f6/src/extends/layout/comboForceLayout/index.ts ================================================ import { ComboForceLayout } from "@antv/layout/lib/layout/comboForce"; export default ComboForceLayout; ================================================ FILE: packages/f6/src/extends/layout/concentricLayout/index.ts ================================================ import { ConcentricLayout } from "@antv/layout/lib/layout/concentric"; export default ConcentricLayout; ================================================ FILE: packages/f6/src/extends/layout/dagreLayout/index.ts ================================================ import { DagreLayout } from "@antv/layout/lib/layout/dagre"; export default DagreLayout; ================================================ FILE: packages/f6/src/extends/layout/forceAtlas2Layout/index.ts ================================================ import { ForceAtlas2Layout } from "@antv/layout/lib/layout/forceAtlas2"; export default ForceAtlas2Layout; ================================================ FILE: packages/f6/src/extends/layout/forceLayout/index.ts ================================================ import { ForceLayout } from "@antv/layout/lib/layout/force"; export default ForceLayout; ================================================ FILE: packages/f6/src/extends/layout/fruchtermanLayout/index.ts ================================================ import { FruchtermanLayout } from "@antv/layout/lib/layout/fruchterman"; export default FruchtermanLayout; ================================================ FILE: packages/f6/src/extends/layout/gForceLayout/index.ts ================================================ import { GForceLayout } from "@antv/layout/lib/layout/gForce"; export default GForceLayout; ================================================ FILE: packages/f6/src/extends/layout/gridLayout/index.ts ================================================ import { GridLayout } from "@antv/layout/lib/layout/grid"; export default GridLayout; ================================================ FILE: packages/f6/src/extends/layout/mdsLayout/index.ts ================================================ import { MDSLayout } from "@antv/layout/lib/layout/mds"; export default MDSLayout; ================================================ FILE: packages/f6/src/extends/layout/radialLayout/index.ts ================================================ import { RadialLayout } from "@antv/layout/lib/layout/radial"; export default RadialLayout; ================================================ FILE: packages/f6/src/extends/layout/randomLayout/index.ts ================================================ import { RandomLayout } from "@antv/layout/lib/layout/random"; export default RandomLayout; ================================================ FILE: packages/f6/src/global.ts ================================================ import { getColorsWithSubjectColor } from "./util/color"; const subjectColor = "rgb(95, 149, 255)"; const backColor = "rgb(255, 255, 255)"; const textColor = "rgb(0, 0, 0)"; const colorSet = getColorsWithSubjectColor(subjectColor, backColor); export default { version: "0.0.16", rootContainerClassName: "root-container", uiContainerClassName: "ui-container", waterContainerClassName: "water-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, // 节点的默认文本不居中时的偏移量 }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: colorSet.mainStroke, fill: colorSet.mainFill, }, size: 20, color: colorSet.mainStroke, linkPoints: { size: 8, lineWidth: 1, fill: colorSet.activeFill, stroke: colorSet.activeStroke, }, }, // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 nodeStateStyles: { active: { fill: colorSet.activeFill, stroke: colorSet.activeStroke, lineWidth: 2, shadowColor: colorSet.mainStroke, shadowBlur: 10, }, selected: { fill: colorSet.selectedFill, stroke: colorSet.selectedStroke, lineWidth: 4, shadowColor: colorSet.selectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { fill: colorSet.highlightFill, stroke: colorSet.highlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500, }, }, inactive: { fill: colorSet.inactiveFill, stroke: colorSet.inactiveStroke, lineWidth: 1, }, disable: { fill: colorSet.disableFill, stroke: colorSet.disableStroke, lineWidth: 1, }, }, edgeLabel: { style: { fill: textColor, textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: colorSet.edgeMainStroke, lineAppendWidth: 2, }, color: colorSet.edgeMainStroke, }, // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 edgeStateStyles: { active: { stroke: colorSet.edgeActiveStroke, lineWidth: 1, }, selected: { stroke: colorSet.edgeSelectedStroke, lineWidth: 2, shadowColor: colorSet.edgeSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { stroke: colorSet.edgeHighlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500, }, }, inactive: { stroke: colorSet.edgeInactiveStroke, lineWidth: 1, }, disable: { stroke: colorSet.edgeDisableStroke, lineWidth: 1, }, }, comboLabel: { style: { fill: textColor, // textAlign: 'center', textBaseline: "middle", fontSize: 12, }, refY: 10, // Combo 的默认文本不居中时的偏移量 refX: 10, // Combo 的默认文本不居中时的偏移量 }, defaultCombo: { type: "circle", style: { fill: colorSet.comboMainFill, lineWidth: 1, stroke: colorSet.comboMainStroke, r: 5, width: 20, height: 10, }, size: [20, 5], color: colorSet.comboMainStroke, padding: [25, 20, 15, 20], }, // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展 comboStateStyles: { active: { stroke: colorSet.comboActiveStroke, lineWidth: 1, fill: colorSet.comboActiveFill, }, selected: { stroke: colorSet.comboSelectedStroke, lineWidth: 2, fill: colorSet.comboSelectedFill, shadowColor: colorSet.comboSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500, }, }, highlight: { stroke: colorSet.comboHighlightStroke, lineWidth: 2, fill: colorSet.comboHighlightFill, "text-shape": { fontWeight: 500, }, }, inactive: { stroke: colorSet.comboInactiveStroke, fill: colorSet.comboInactiveFill, lineWidth: 1, }, disable: { stroke: colorSet.comboDisableStroke, fill: colorSet.comboDisableFill, lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, // 文本水印默认配置 textWaterMarkerConfig: { width: 150, height: 100, compatible: false, text: { x: 0, y: 60, lineHeight: 20, rotate: 20, fontSize: 14, fontFamily: "Microsoft YaHei", fill: "rgba(0, 0, 0, 0.1)", baseline: "Middle", }, }, imageWaterMarkerConfig: { // compatible: false, image: { x: 0, y: 0, width: 30, height: 20, rotate: 0, }, }, waterMarkerImage: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", }; ================================================ FILE: packages/f6/src/graph/controller/event.ts ================================================ import { ICanvas, IGroup, IShape } from "@antv/g-base"; import { each, wrapBehavior } from "@antv/util"; import { AbstractEvent, IG6GraphEvent, Matrix, Item, Util, } from "@antv/f6-core"; import Graph from "../graph"; const { cloneEvent, isViewportChanged } = Util; type Fun = () => void; export default class EventController extends AbstractEvent { protected extendEvents: any[] = []; protected canvasHandler!: Fun; protected dragging: boolean = false; protected preItem: Item | null = null; public destroyed: boolean; constructor(graph: Graph) { super(graph); this.graph = graph; this.destroyed = false; } // 初始化 G6 中的事件 protected initEvents() { const { graph, extendEvents = [] } = this; const canvas: ICanvas = graph.get("canvas"); this.canvasHandler = wrapBehavior(this, "onCanvasEvents") as Fun; canvas.off("*").on("*", this.canvasHandler); } // 获取 shape 的 item 对象 private static getItemRoot(shape: any): T { while (shape && !shape.get("item")) { shape = shape.get("parent"); } return shape; } /** * 处理 canvas 事件 * @param evt 事件句柄 */ protected onCanvasEvents(evt: IG6GraphEvent) { const { graph } = this; const canvas = graph.get("canvas"); const { target } = evt; const eventType = evt.type; /** * (clientX, clientY): 相对于页面的坐标; * (canvasX, canvasY): 相对于 左上角的坐标; * (x, y): 相对于整个画布的坐标, 与 model 的 x, y 是同一维度的。 */ evt.canvasX = evt.x; evt.canvasY = evt.y; let point = { x: evt.canvasX, y: evt.canvasY }; const group: IGroup = graph.get("group"); let matrix: Matrix = group.getMatrix(); if (!matrix) { matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; } if (isViewportChanged(matrix)) { point = graph.getPointByClient(evt.clientX, evt.clientY); } evt.x = point.x; evt.y = point.y; evt.currentTarget = graph; if (target === canvas) { if (eventType === "panmove") { this.handleTouchMove(evt, "canvas"); } evt.target = canvas; evt.item = null; graph.emit(eventType, evt); graph.emit(`canvas:${eventType}`, evt); return; } const itemShape: IShape = EventController.getItemRoot(target); if (!itemShape) { graph.emit(eventType, evt); return; } const item = itemShape.get("item"); if (item.destroyed) { return; } const type = item.getType(); // 事件target是触发事件的Shape实例,item是触发事件的item实例 evt.target = target; evt.item = item; if (evt.canvasX === evt.x && evt.canvasY === evt.y) { const canvasPoint = graph.getCanvasByPoint(evt.x, evt.y); evt.canvasX = canvasPoint.x; evt.canvasY = canvasPoint.y; } graph.emit(eventType, evt); if (evt.name && !evt.name.includes(":")) { graph.emit(`${type}:${eventType}`, evt); } else { graph.emit(evt.name, evt); } if (eventType === "dragstart") { this.dragging = true; } if (eventType === "dragend") { this.dragging = false; } if (eventType === "panmove") { this.handleTouchMove(evt, type); } } /** * 处理扩展事件 * @param evt 事件句柄 */ protected onExtendEvents(evt: IG6GraphEvent) { this.graph.emit(evt.type, evt); } /** * 在 graph 上面 emit 事件 * @param itemType item 类型 * @param eventType 事件类型 * @param evt 事件句柄 */ private emitCustomEvent( itemType: string, eventType: string, evt: IG6GraphEvent, ) { evt.type = eventType; this.graph.emit(`${itemType}:${eventType}`, evt); } public destroy() { const { graph, canvasHandler, extendEvents } = this; const canvas: ICanvas = graph.get("canvas"); // each(EVENTS, event => { // canvas.off(event, canvasHandler); // }); canvas.off("*", canvasHandler); each(extendEvents, (event) => { event.remove(); }); this.dragging = false; this.preItem = null; this.extendEvents.length = 0; (this.canvasHandler as Fun | null) = null; this.destroyed = true; } /** * 处理移动事件 * @param evt 事件句柄 * @param type item 类型 */ private handleTouchMove(evt: IG6GraphEvent, type: string) { const { graph, preItem } = this; const canvas: ICanvas = graph.get("canvas"); const item = (evt.target as any) === canvas ? null : evt.item; evt = cloneEvent(evt) as IG6GraphEvent; // 从前一个item直接移动到当前item,触发前一个item的leave事件 if (preItem && preItem !== item && !preItem.destroyed) { evt.item = preItem; this.emitCustomEvent(preItem.getType(), "touchleave", evt); if (this.dragging) { this.emitCustomEvent(preItem.getType(), "dragleave", evt); } } // 从一个item或canvas移动到当前item,触发当前item的enter事件 if (item && preItem !== item) { evt.item = item; this.emitCustomEvent(type, "touchenter", evt); if (this.dragging) { this.emitCustomEvent(type, "dragenter", evt); } } this.preItem = item; } } ================================================ FILE: packages/f6/src/graph/controller/index.ts ================================================ export { default as EventController } from "./event"; export { default as LayoutController } from "./layout"; ================================================ FILE: packages/f6/src/graph/controller/layout.ts ================================================ import { AbstractLayout, GraphData } from "@antv/f6-core"; import { Layout } from "../../layout"; import { mix, clone } from "@antv/util"; import { IGraph } from "../../interface/graph"; const LayoutPipesAdjustNames = ["force", "grid", "circular"]; export default class LayoutController extends AbstractLayout { public graph: IGraph; public destroyed: boolean; constructor(graph: IGraph) { super(graph); this.graph = graph; this.layoutCfg = graph.get("layout") || {}; this.layoutType = this.getLayoutType(); } // 更新布局参数 public updateLayoutCfg(cfg) { const { graph, layoutMethods } = this; const layoutCfg = mix({}, this.layoutCfg, cfg); this.layoutCfg = layoutCfg; if (!layoutMethods?.length) { this.layout(); return; } this.data = this.setDataFromGraph(); graph.emit("beforelayout"); let start = Promise.resolve(); if (layoutMethods.length === 1) { start = start.then(() => this.updateLayoutMethod(layoutMethods[0], layoutCfg), ); } else { layoutMethods?.forEach((layoutMethod, index) => { const currentCfg = layoutCfg.pipes[index]; start = start.then(() => this.updateLayoutMethod(layoutMethod, currentCfg), ); }); } this.data = this.setDataFromGraph(); start .then(() => { if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd(); }) .catch((error) => { console.warn("layout failed", error); }); } /** * @param {function} success callback * @return {boolean} 是否使用web worker布局 */ public layout(success?: () => void): boolean { const { graph } = this; this.data = this.setDataFromGraph(); const { nodes, hiddenNodes } = this.data; if (!nodes) { return false; } const width = graph.get("width"); const height = graph.get("height"); const layoutCfg: any = {}; Object.assign( layoutCfg, { width, height, center: [width / 2, height / 2], }, this.layoutCfg, ); this.layoutCfg = layoutCfg; this.destoryLayoutMethods(); graph.emit("beforelayout"); this.initPositions(layoutCfg.center, nodes); // init hidden ndoes this.initPositions(layoutCfg.center, hiddenNodes); // 在 onAllLayoutEnd 中执行用户自定义 onLayoutEnd,触发 afterlayout、更新节点位置、fitView/fitCenter、触发 afterrender const { onLayoutEnd, layoutEndFormatted, adjust } = layoutCfg; if (!layoutEndFormatted) { layoutCfg.layoutEndFormatted = true; layoutCfg.onAllLayoutEnd = async () => { // 执行用户自定义 onLayoutEnd if (onLayoutEnd) { onLayoutEnd(); } // 更新节点位置 this.refreshLayout(); // 最后再次调整 if (adjust && layoutCfg.pipes) { await this.adjustPipesBox(this.data, adjust); this.refreshLayout(); } // 触发 afterlayout graph.emit("afterlayout"); }; } let start = Promise.resolve(); if (layoutCfg.type) { start = start.then(() => this.execLayoutMethod(layoutCfg, 0)); } else if (layoutCfg.pipes) { layoutCfg.pipes.forEach((cfg, index) => { start = start.then(() => this.execLayoutMethod(cfg, index)); }); } // 最后统一在外部调用onAllLayoutEnd start .then(() => { if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd(); // 在执行 execute 后立即执行 success,且在 timeBar 中有 throttle,可以防止 timeBar 监听 afterrender 进行 changeData 后 layout,从而死循环 // 对于 force 一类布局完成后的 fitView 需要用户自己在 onLayoutEnd 中配置 if (success) success(); }) .catch((error) => { console.warn("graph layout failed,", error); }); return false; } private execLayoutMethod(layoutCfg, order): Promise { return new Promise((reslove, reject) => { const { graph } = this; const layoutType = layoutCfg.type; // 每个布局方法都需要注册 layoutCfg.onLayoutEnd = () => { graph.emit("aftersublayout", { type: layoutType }); reslove(); }; const isForce = layoutType === "force" || layoutType === "g6force" || layoutType === "gForce"; if (isForce) { const { onTick } = layoutCfg; const tick = () => { if (onTick) { onTick(); } graph.refreshPositions(); }; layoutCfg.tick = tick; } else if (layoutCfg.type === "comboForce") { layoutCfg.comboTrees = graph.get("comboTrees"); } let enableTick = false; let layoutMethod; try { layoutMethod = new Layout(layoutCfg); } catch (e) { console.warn( `The layout method: '${layoutType}' does not exist! Please specify it first.`, ); reject(); } // 是否需要迭代的方式完成布局。这里是来自布局对象的实例属性,是由布局的定义者在布局类定义的。 enableTick = layoutMethod.enableTick; if (enableTick) { const { onTick } = layoutCfg; const tick = () => { if (onTick) { onTick(); } graph.refreshPositions(); }; layoutMethod.tick = tick; } const layoutData = this.filterLayoutData(this.data, layoutCfg); addLayoutOrder(layoutData, order); layoutMethod.init(layoutData); // 若存在节点没有位置信息,且没有设置 layout,在 initPositions 中 random 给出了所有节点的位置,不需要再次执行 random 布局 // 所有节点都有位置信息,且指定了 layout,则执行布局(代表不是第一次进行布局) graph.emit("beforesublayout", { type: layoutType }); layoutMethod.execute(); if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd(); this.layoutMethods.push(layoutMethod); }); } private updateLayoutMethod(layoutMethod, layoutCfg): Promise { return new Promise((reslove, reject) => { const { graph } = this; const layoutType = layoutCfg?.type; // 每个布局方法都需要注册 layoutCfg.onLayoutEnd = () => { graph.emit("aftersublayout", { type: layoutType }); reslove(); }; const layoutData = this.filterLayoutData(this.data, layoutCfg); layoutMethod.init(layoutData); layoutMethod.updateCfg(layoutCfg); graph.emit("beforesublayout", { type: layoutType }); layoutMethod.execute(); if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd(); }); } protected adjustPipesBox(data, adjust: string): Promise { return new Promise((resolve) => { const { nodes } = data; if (!nodes?.length) { resolve(); } if (!LayoutPipesAdjustNames.includes(adjust)) { console.warn( `The adjust type ${adjust} is not supported yet, please assign it with 'force', 'grid', or 'circular'.`, ); resolve(); } const layoutCfg = { center: this.layoutCfg.center, nodeSize: (d) => Math.max(d.height, d.width), preventOverlap: true, onLayoutEnd: () => {}, }; // 计算出大单元 const { groupNodes, layoutNodes } = this.getLayoutBBox(nodes); const preNodes = clone(layoutNodes); // 根据大单元坐标的变化,调整这里面每个小单元nodes layoutCfg.onLayoutEnd = () => { layoutNodes?.forEach((ele, index) => { const dx = ele.x - preNodes[index]?.x; const dy = ele.y - preNodes[index]?.y; groupNodes[index]?.forEach((n: any) => { n.x += dx; n.y += dy; }); }); resolve(); }; const layoutMethod = new Layout(layoutCfg); layoutMethod.layout({ nodes: layoutNodes }); }); } public destroy() { this.destoryLayoutMethods(); this.destroyed = true; this.graph.set("layout", undefined); this.layoutCfg = undefined; this.layoutType = undefined; this.layoutMethods = undefined; this.graph = null; } } function addLayoutOrder(data, order) { if (!data?.nodes?.length) { return; } const { nodes } = data; nodes.forEach((node) => { node.layoutOrder = order; }); } ================================================ FILE: packages/f6/src/graph/graph.ts ================================================ import { Canvas as GMobileCanvas } from "@antv/g-mobile"; import { IGroup } from "@antv/g-base"; import { mat3 } from "@antv/matrix-util"; import { clone, deepMix, each, isString, isNumber } from "@antv/util"; import { IGraph, DataUrlType } from "../interface/graph"; import { AbstractGraph, GraphOptions } from "@antv/f6-core"; import { WaterMarkerConfig } from "../types"; import Global from "../global"; import { LayoutController, EventController } from "./controller"; import PluginBase from "../plugin/base"; import { createDom } from "@antv/dom-util"; export const registerGraph = ( graphName: string, GraphFunction: any, G6: Object, ): Object => { if (G6[graphName]) { console.warn( `The graph with the name ${graphName} exists already, it will be overridden`, ); } G6[graphName] = GraphFunction(G6); return G6; }; export default class Graph extends AbstractGraph implements IGraph { // private cfg: GraphOptions & { [key: string]: any }; public destroyed: boolean; constructor(cfg: GraphOptions) { super(cfg); if (this.get("renderer").startsWith("mini")) { this.set("context", (cfg as any).context); } super.init(); const defaultNode = this.get("defaultNode"); if (!defaultNode) { this.set("defaultNode", { type: "circle" }); } if (!defaultNode.type) { defaultNode.type = "circle"; this.set("defaultNode", defaultNode); } this.destroyed = false; } // 这里是为了规避基类那个deepmix,等待架构调整 protected init() {} public emitEvent(event) { const canvas: GMobileCanvas = this.get("canvas"); event.type = event.type.toLowerCase(); canvas.registerEventCallback(event); } protected initLayoutController() { const layoutController = new LayoutController(this); this.set({ layoutController, }); } protected initEventController() { const eventController = new EventController(this); this.set({ eventController, }); if (this.get("renderer").startsWith("mini")) { return; } const canvas: GMobileCanvas = this.get("canvas"); const canvasDom = canvas.get("el"); "touchstart touchmove touchend touchcancel".split(" ").forEach((key) => { canvasDom.addEventListener( key, canvas.registerEventCallback.bind(canvas), false, ); }); } protected initCanvas() { let container: string | HTMLElement | Element | null = this.get("container"); if (container !== null && typeof container === "string") { container = document.getElementById(container); this.set("container", container); } const renderer: string = this.get("renderer"); if (!container && !renderer.startsWith("mini")) { throw new Error("invalid container"); } const width: number = this.get("width"); const height: number = this.get("height"); const context: string = this.get("context"); const fitView: boolean = this.get("fitView"); const canvasCfg: any = { container, // native canvas 会传递 requestAnimationFrame, clearAnimationFrame 等函数进来 context, width, height, renderer, fitView, }; const pixelRatio = this.get("pixelRatio"); if (pixelRatio) { canvasCfg.pixelRatio = pixelRatio; } const canvas = new GMobileCanvas(canvasCfg); this.set("canvas", canvas); } protected initPlugins(): void { const self = this; each(self.get("plugins"), (plugin) => { if (!plugin.destroyed && plugin.initPlugin) { plugin.initPlugin(self); } }); } /** * 返回可见区域的图的 dataUrl,用于生成图片 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {string} backgroundColor 图片背景色 * @return {string} 图片 dataURL */ public toDataURL(type?: DataUrlType, backgroundColor?: string): string { const canvas: GMobileCanvas = this.get("canvas"); const renderer = canvas.getRenderer(); const canvasDom = canvas.get("el"); if (!type) type = "image/png"; let dataURL = ""; if (renderer === "svg") { const cloneNode = canvasDom.cloneNode(true); const svgDocType = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ); const svgDoc = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", svgDocType, ); svgDoc.replaceChild(cloneNode, svgDoc.documentElement); const svgData = new XMLSerializer().serializeToString(svgDoc); dataURL = `data:image/svg+xml;charset=utf8,${encodeURIComponent( svgData, )}`; } else { let imageData; const context = canvasDom.getContext("2d"); const width = this.get("width"); const height = this.get("height"); let compositeOperation; if (backgroundColor) { const pixelRatio = typeof window !== "undefined" ? window.devicePixelRatio : 1; imageData = context.getImageData( 0, 0, width * pixelRatio, height * pixelRatio, ); compositeOperation = context.globalCompositeOperation; context.globalCompositeOperation = "destination-over"; context.fillStyle = backgroundColor; context.fillRect(0, 0, width, height); } dataURL = canvasDom.toDataURL(type); if (backgroundColor) { context.clearRect(0, 0, width, height); context.putImageData(imageData, 0, 0); context.globalCompositeOperation = compositeOperation; } } return dataURL; } /** * 返回整个图(包括超出可见区域的部分)的 dataUrl,用于生成图片 * @param {Function} callback 异步生成 dataUrl 完成后的回调函数,在这里处理生成的 dataUrl 字符串 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding */ public toFullDataURL( callback: (res: string) => any, type?: DataUrlType, imageConfig?: { backgroundColor?: string; padding?: number | number[] }, ) { const bbox = this.get("group").getCanvasBBox(); const height = bbox.height; const width = bbox.width; const renderer = this.get("renderer"); const vContainerDOM: HTMLDivElement = createDom( '', ); const backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined; let padding = imageConfig ? imageConfig.padding : undefined; if (!padding) padding = [0, 0, 0, 0]; else if (isNumber(padding)) padding = [padding, padding, padding, padding]; const vHeight = height + padding[0] + padding[2]; const vWidth = width + padding[1] + padding[3]; const canvasOptions = { container: vContainerDOM, height: vHeight, width: vWidth, quickHit: true, }; const vCanvas = new GMobileCanvas(canvasOptions); const group = this.get("group"); const vGroup = group.clone(); let matrix = clone(vGroup.getMatrix()); if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; const centerX = (bbox.maxX + bbox.minX) / 2; const centerY = (bbox.maxY + bbox.minY) / 2; mat3.translate(matrix, matrix, [-centerX, -centerY]); mat3.translate(matrix, matrix, [ width / 2 + padding[3], height / 2 + padding[0], ]); vGroup.resetMatrix(); vGroup.setMatrix(matrix); vCanvas.add(vGroup); const vCanvasEl = vCanvas.get("el"); let dataURL = ""; if (!type) type = "image/png"; setTimeout(() => { if (renderer === "svg") { const cloneNode = vCanvasEl.cloneNode(true); const svgDocType = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ); const svgDoc = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", svgDocType, ); svgDoc.replaceChild(cloneNode, svgDoc.documentElement); const svgData = new XMLSerializer().serializeToString(svgDoc); dataURL = `data:image/svg+xml;charset=utf8,${encodeURIComponent( svgData, )}`; } else { let imageData; const context = vCanvasEl.getContext("2d"); let compositeOperation; if (backgroundColor) { const pixelRatio = typeof window !== "undefined" ? window.devicePixelRatio : 1; imageData = context.getImageData( 0, 0, vWidth * pixelRatio, vHeight * pixelRatio, ); compositeOperation = context.globalCompositeOperation; context.globalCompositeOperation = "destination-over"; context.fillStyle = backgroundColor; context.fillRect(0, 0, vWidth, vHeight); } dataURL = vCanvasEl.toDataURL(type); if (backgroundColor) { context.clearRect(0, 0, vWidth, vHeight); context.putImageData(imageData, 0, 0); context.globalCompositeOperation = compositeOperation; } } if (callback) callback(dataURL); }, 16); } /** * 导出包含全图的图片 * @param {String} name 图片的名称 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding */ public downloadFullImage( name?: string, type?: DataUrlType, imageConfig?: { backgroundColor?: string; padding?: number | number[] }, ): void { const bbox = this.get("group").getCanvasBBox(); const height = bbox.height; const width = bbox.width; const renderer = this.get("renderer"); const vContainerDOM: HTMLDivElement = createDom( '', ); const backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined; let padding = imageConfig ? imageConfig.padding : undefined; if (!padding) padding = [0, 0, 0, 0]; else if (isNumber(padding)) padding = [padding, padding, padding, padding]; const vHeight = height + padding[0] + padding[2]; const vWidth = width + padding[1] + padding[3]; const canvasOptions = { container: vContainerDOM, height: vHeight, width: vWidth, }; const vCanvas = new GMobileCanvas(canvasOptions); const group = this.get("group"); const vGroup = group.clone(); let matrix = clone(vGroup.getMatrix()); if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; const centerX = (bbox.maxX + bbox.minX) / 2; const centerY = (bbox.maxY + bbox.minY) / 2; mat3.translate(matrix, matrix, [-centerX, -centerY]); mat3.translate(matrix, matrix, [ width / 2 + padding[3], height / 2 + padding[0], ]); vGroup.resetMatrix(); vGroup.setMatrix(matrix); vCanvas.add(vGroup); const vCanvasEl = vCanvas.get("el"); if (!type) type = "image/png"; setTimeout(() => { let dataURL = ""; if (renderer === "svg") { const cloneNode = vCanvasEl.cloneNode(true); const svgDocType = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ); const svgDoc = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", svgDocType, ); svgDoc.replaceChild(cloneNode, svgDoc.documentElement); const svgData = new XMLSerializer().serializeToString(svgDoc); dataURL = `data:image/svg+xml;charset=utf8,${encodeURIComponent( svgData, )}`; } else { let imageData; const context = vCanvasEl.getContext("2d"); let compositeOperation; if (backgroundColor) { const pixelRatio = typeof window !== "undefined" ? window.devicePixelRatio : 1; imageData = context.getImageData( 0, 0, vWidth * pixelRatio, vHeight * pixelRatio, ); compositeOperation = context.globalCompositeOperation; context.globalCompositeOperation = "destination-over"; context.fillStyle = backgroundColor; context.fillRect(0, 0, vWidth, vHeight); } dataURL = vCanvasEl.toDataURL(type); if (backgroundColor) { context.clearRect(0, 0, vWidth, vHeight); context.putImageData(imageData, 0, 0); context.globalCompositeOperation = compositeOperation; } } const link: HTMLAnchorElement = document.createElement("a"); const fileName: string = (name || "graph") + (renderer === "svg" ? ".svg" : `.${type.split("/")[1]}`); this.dataURLToImage(dataURL, renderer, link, fileName); const e = document.createEvent("MouseEvents"); e.initEvent("click", false, false); link.dispatchEvent(e); }, 16); } /** * 画布导出图片,图片仅包含画布可见区域部分内容 * @param {String} name 图片的名称 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {string} backgroundColor 图片背景色 */ public downloadImage( name?: string, type?: DataUrlType, backgroundColor?: string, ): void { const self = this; if (self.isAnimating()) { self.stopAnimate(); } const canvas = self.get("canvas"); const renderer = canvas.getRenderer(); if (!type) type = "image/png"; const fileName: string = (name || "graph") + (renderer === "svg" ? ".svg" : type.split("/")[1]); const link: HTMLAnchorElement = document.createElement("a"); setTimeout(() => { const dataURL = self.toDataURL(type, backgroundColor); this.dataURLToImage(dataURL, renderer, link, fileName); const e = document.createEvent("MouseEvents"); e.initEvent("click", false, false); link.dispatchEvent(e); }, 16); } private dataURLToImage(dataURL: string, renderer: string, link, fileName) { if (typeof window !== "undefined") { if (window.Blob && window.URL && renderer !== "svg") { const arr = dataURL.split(","); let mime = ""; if (arr && arr.length > 0) { const match = arr[0].match(/:(.*?);/); // eslint-disable-next-line prefer-destructuring if (match && match.length >= 2) mime = match[1]; } const bstr = atob(arr[1]); let n = bstr.length; const u8arr = new Uint8Array(n); while (n--) { u8arr[n] = bstr.charCodeAt(n); } const blobObj = new Blob([u8arr], { type: mime }); if (window.navigator["msSaveBlob"]) { window.navigator["msSaveBlob"](blobObj, fileName); } else { link.addEventListener("click", () => { link.download = fileName; link.href = window.URL.createObjectURL(blobObj); }); } } else { link.addEventListener("click", () => { link.download = fileName; link.href = dataURL; }); } } } /** * 添加插件 * @param {object} plugin 插件实例 */ public addPlugin(plugin: PluginBase): void { const self = this; if (plugin.destroyed) { return; } self.get("plugins").push(plugin); plugin.initPlugin(self); } /** * 添加插件 * @param {object} plugin 插件实例 */ public removePlugin(plugin: PluginBase): void { const plugins = this.get("plugins"); const index = plugins.indexOf(plugin); if (index >= 0) { plugin.destroyPlugin(); plugins.splice(index, 1); } } private isMiniNative() { return this.get("renderer") === "mini-native"; } private isMini() { return this.get("renderer").startsWith("mini"); } private isBrowser() { return this.get("renderer") === "canvas"; } /** * 设置图片水印 * @param {string} imgURL 图片水印的url地址 * @param {WaterMarkerConfig} config 文本水印的配置项 * @param {any} waterCanvas 小程序canvas */ public setImageWaterMarker( imgURL: string, config: WaterMarkerConfig, waterCanvas?: any, ) { //水印的设置合并 const waterMarkerConfig = deepMix( {}, Global.imageWaterMarkerConfig, config, ); const { width, height, image } = waterMarkerConfig; const { rotate, x, y, width: imgWidth, height: imgHeight } = image; //mini if (this.isMini() && !this.isMiniNative()) { //设置属性为背景图 } //mini-native if (this.isMiniNative()) { //设定水印canvas的宽高 waterCanvas.width = width ? width : this.get("width"); waterCanvas.height = height ? height : this.get("height"); //获取context const waterCanvasContext = waterCanvas.getContext("2d"); const { createImage } = this.get("extra"); const img = createImage(); img.crossOrigin = "anonymous"; img.src = imgURL; img.onload = () => { if (this.destroyed) return; //计算缩放比例 const scaleX = imgWidth / img.width; const scaleY = imgHeight / img.height; //旋转 waterCanvasContext.rotate(-(rotate * Math.PI) / 180); //循环重复绘制 const pattern = waterCanvasContext.createPattern(img, "repeat"); waterCanvasContext.fillStyle = pattern; waterCanvasContext.scale(scaleX, scaleY); //调整位置 waterCanvasContext.fillRect( -this.get("width") * 2, -this.get("height"), this.get("width") * 10, this.get("height") * 10, ); this.get("waterGroup").addShape("image", { attrs: { img: waterCanvas, }, }); }; } //render if (this.isBrowser()) { const waterCanvas = document.createElement("canvas"); //获取整个画布的宽高,以确定水印层的宽高 waterCanvas.width = width ? width : this.get("width"); waterCanvas.height = height ? height : this.get("height"); const context = waterCanvas.getContext("2d"); const img = new Image(); img.crossOrigin = "anonymous"; img.src = imgURL; img.onload = () => { if (this.destroyed) return; //计算图片宽高的缩放比例 const scaleX = imgWidth / img.width; const scaleY = imgHeight / img.height; //旋转 context.rotate(-(rotate * Math.PI) / 180); //循环重复绘制 const pattern = context.createPattern(img, "repeat"); context.fillStyle = pattern; context.scale(scaleX, scaleY); //调整位置 context.fillRect( -this.get("width") * 2, -this.get("height"), this.get("width") * 10, this.get("height") * 10, ); const water_img_url = waterCanvas.toDataURL(); this.get("waterGroup").addShape("image", { attrs: { img: water_img_url, }, }); }; } } /** * 设置文本水印 * @param {string[]} texts 水印的文本内容 * @param {WaterMarkerConfig} config 文本水印的配置项 */ public setTextWaterMarker(texts: string[], config?: WaterMarkerConfig) { let container: string | HTMLElement | null = this.get("container"); if (isString(container)) { container = document.getElementById(container); } if (!container.style.position) { container.style.position = "relative"; } let canvas = this.get("graphWaterMarker"); const waterMarkerConfig: WaterMarkerConfig = deepMix( {}, Global.textWaterMarkerConfig, config, ); const { width, height, compatible, text } = waterMarkerConfig; if (!canvas) { const canvasCfg: any = { container, width, height, capture: false, }; const pixelRatio = this.get("pixelRatio"); if (pixelRatio) { canvasCfg.pixelRatio = pixelRatio; } canvas = new GMobileCanvas(canvasCfg); this.set("graphWaterMarker", canvas); } canvas.get("el").style.display = "none"; const ctx = canvas.get("context"); const { rotate, fill, fontFamily, fontSize, baseline, x, y, lineHeight } = text; // 旋转20度 ctx.rotate((-rotate * Math.PI) / 180); // 设置文字样式 ctx.font = `${fontSize}px ${fontFamily}`; // 设置文字颜色 ctx.fillStyle = fill; ctx.textBaseline = baseline; for (let i = texts.length - 1; i >= 0; i--) { // 将文字绘制到画布 ctx.fillText(texts[i], x, y + i * lineHeight); } // 恢复旋转角度 ctx.rotate((rotate * Math.PI) / 180); // 默认按照现代浏览器处理 if (!compatible) { let box = document.querySelector(".g6-graph-watermarker") as HTMLElement; if (!box) { box = document.createElement("div"); box.className = "g6-graph-watermarker"; } box.style.cssText = `background-image: url(${canvas .get("el") .toDataURL( "image/png", )});background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;`; container.appendChild(box); } else { // 当需要兼容不支持 pointer-events属性的浏览器时,将 compatible 设置为 true container.style.cssText = `background-image: url(${canvas .get("el") .toDataURL("image/png")});background-repeat:repeat;`; } } /** * 销毁画布 */ public destroy() { each(this.get("plugins"), (plugin) => { plugin.destroyPlugin(); }); // destroy tooltip doms, removed when upgrade G6 4.0 const tooltipDOMs = this.get("tooltips"); if (tooltipDOMs) { for (let i = 0; i < tooltipDOMs.length; i++) { const container = tooltipDOMs[i]; if (!container) continue; const parent = container.parentElement; if (!parent) continue; parent.removeChild(container); } } this.get("eventController").destroy(); this.get("layoutController")?.destroy(); if (this.get("graphWaterMarker")) { this.get("graphWaterMarker").destroy(); } if ( typeof document !== "undefined" && document.querySelector && document.querySelector(".g6-graph-watermarker") ) { document.querySelector(".g6-graph-watermarker").remove(); } super.destroy(); } // 初始化所有 Group protected initGroups(): void { const canvas: GMobileCanvas = this.get("canvas"); const group: IGroup = canvas.addGroup({ id: "root", className: Global.rootContainerClassName, }); const waterGroup: IGroup = canvas.addGroup({ id: "water", className: Global.waterContainerClassName, }); if (this.get("groupByTypes")) { const edgeGroup: IGroup = group.addGroup({ id: "edge", className: Global.edgeContainerClassName, }); const nodeGroup: IGroup = group.addGroup({ id: "node", className: Global.nodeContainerClassName, }); const comboGroup: IGroup = group.addGroup({ id: "combo", className: Global.comboContainerClassName, }); // 用于存储自定义的群组 comboGroup.toBack(); this.set({ nodeGroup, edgeGroup, comboGroup }); } const uiGroup: IGroup = canvas.addGroup({ id: "uiGroup", className: Global.uiContainerClassName, }); const delegateGroup: IGroup = group.addGroup({ id: "delegate", className: Global.delegateContainerClassName, }); this.set({ delegateGroup }); this.set("group", group); this.set("uiGroup", uiGroup); this.set("waterGroup", waterGroup); } } ================================================ FILE: packages/f6/src/index.ts ================================================ import { registerBehavior, registerCombo, registerEdge, registerNode, Arrow, Marker, Shape, } from "@antv/f6-core"; import { ICanvas, IGroup, IShape } from "@antv/g-base"; import * as Algorithm from "@antv/algorithm"; import Graph, { registerGraph as oRegisterGraph } from "./graph/graph"; import { Layout, Layouts, registerLayout, unRegisterLayout } from "./layout"; import Global from "./global"; import Util from "./util"; import "./element"; import "./behavior"; const F6 = { version: Global.version, Graph, Util, Layout, Layouts, registerLayout, unRegisterLayout, Global, registerBehavior, registerCombo, registerEdge, registerNode, Algorithm, Arrow, Marker, Shape, }; function registerExtenderWrapper( registerExtender: ( registerName: T1, registerFunction: T2, global: Object, ) => Object, ): (registerName: T1, registerFunction: T2) => Object { return function (...args) { return registerExtender.apply(null, [...args, F6]); }; } const registerGraph = registerExtenderWrapper(oRegisterGraph); (F6 as any).registerGraph = registerGraph; export * from "@antv/f6-core"; export * from "./types"; export * from "./interface/graph"; export { Graph, Util, Layout, registerLayout, registerGraph, Global, Algorithm, Arrow, Marker, Shape, // 对外暴露 G-Base 的几个类型定义 // ICanvas, // IGroup, // IShape, }; export default F6; ================================================ FILE: packages/f6/src/index.umd.ts ================================================ // @ts-nocheck import F6 from "./index"; // @ts-ignore:兼容旧版本H5导出,不用考虑其他环境,其他环境会使用其他规范 var getGlobal = function () { if (typeof globalThis !== "undefined") { return globalThis; } if (typeof self !== "undefined") { return self; } if (typeof window !== "undefined") { return window; } if (typeof global !== "undefined") { return global; } }; const root = getGlobal(); // umd 部分定义 if (typeof exports === "object" && typeof module === "object") { } else if (typeof define === "function" && define.amd) { } else if (typeof exports === "object") { } else { Object.defineProperties(root, { f6: { get: function () { console.warn("废弃的特性: f6, 请使用 F6 代替 f6"); return F6; }, }, }); } export default F6; ================================================ FILE: packages/f6/src/interface/graph.ts ================================================ import { IAbstractGraph, Item, ShapeStyle, TreeGraphData } from "@antv/f6-core"; import { WaterMarkerConfig } from "../types"; import PluginBase from "../plugin/base"; export type DataUrlType = | "image/png" | "image/jpeg" | "image/webp" | "image/bmp"; export interface IGraph extends IAbstractGraph { /** * 返回图表的 dataUrl 用于生成图片 */ toDataURL: () => string; /** * 画布导出图片 * @param {String} name 图片的名称 */ downloadImage: ( name?: string, type?: DataUrlType, backgroundColor?: string, ) => void; /** * 导出包含全图的图片 * @param {String} name 图片的名称 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding */ downloadFullImage: ( name?: string, type?: DataUrlType, imageConfig?: { backgroundColor?: string; padding?: number | number[] }, ) => void; /** * 返回整个图(包括超出可见区域的部分)的 dataUrl,用于生成图片 * @param {Function} callback 异步生成 dataUrl 完成后的回调函数,在这里处理生成的 dataUrl 字符串 * @param {String} type 图片类型,可选值:"image/png" | "image/jpeg" | "image/webp" | "image/bmp" * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding */ toFullDataURL: ( callback: (res: string) => any, type?: DataUrlType, imageConfig?: { backgroundColor?: string; padding?: number | number[] }, ) => void; /** * 添加插件 * @param {object} plugin 插件实例 */ addPlugin: (plugin: PluginBase) => void; /** * 添加插件 * @param {object} plugin 插件实例 */ removePlugin: (plugin: PluginBase) => void; /** * 设置图片水印 * @param {string} imgURL 图片水印的url地址 * @param {WaterMarkerConfig} config 文本水印的配置项 */ setImageWaterMarker: ( imgURL: string, config: WaterMarkerConfig, waterCanvas: any, ) => void; /** * 设置文本水印 * @param {string[]} texts 水印的文本内容 * @param {WaterMarkerConfig} config 文本水印的配置项 */ setTextWaterMarker: (texts: string[], config?: WaterMarkerConfig) => void; } export interface ITreeGraph extends IGraph { /** * 添加子树到对应 id 的节点 * @param {TreeGraphData} data 子树数据模型 * @param {string | Item} parent 子树的父节点id */ addChild: (data: TreeGraphData, parent: string | Item) => void; /** * 更新源数据,差量更新子树 * @param {TreeGraphData} data 子树数据模型 * @param {string} parent 子树的父节点id */ updateChild: (data: TreeGraphData, parent?: string) => void; /** * 删除子树 * @param {string} id 子树根节点id */ removeChild: (id: string) => void; /** * 根据id获取对应的源数据 * @param {string} id 元素id * @param {TreeGraphData | undefined} parent 从哪个节点开始寻找,为空时从根节点开始查找 * @return {TreeGraphData} 对应源数据 */ findDataById: ( id: string, parent?: TreeGraphData | undefined, ) => TreeGraphData | null; /** * 布局动画接口,用于数据更新时做节点位置更新的动画 * @param {TreeGraphData} data 更新的数据 * @param {function} onFrame 定义节点位置更新时如何移动 */ layoutAnimate: ( data: TreeGraphData, onFrame?: ( item: Item, ratio: number, originAttrs?: ShapeStyle, data?: TreeGraphData, ) => unknown, ) => void; /** * 立即停止布局动画 */ stopLayoutAnimate: () => void; /** * 是否在布局动画 * @return {boolean} 是否有布局动画 */ isLayoutAnimating: () => boolean; } ================================================ FILE: packages/f6/src/layout/index.ts ================================================ import { Layout, Layouts } from "@antv/layout/lib/layout/layout"; import { registerLayout, unRegisterLayout } from "@antv/layout/lib/registy"; import { RandomLayout } from "@antv/layout/lib/layout/random"; // 默认提供 random 布局 registerLayout("random", RandomLayout); export { Layout, Layouts, registerLayout, unRegisterLayout }; ================================================ FILE: packages/f6/src/plugin/base.ts ================================================ import { wrapBehavior, each, deepMix } from "@antv/util"; import { IGraph } from "../interface/graph"; import { IG6GraphEvent } from "@antv/f6-core"; export interface IPluginBaseConfig { container?: HTMLDivElement | string | null; className?: string; graph?: IGraph; [key: string]: any; } interface EventMapType { [key: string]: any; } export default abstract class PluginBase { private _events: EventMapType; public _cfgs: IPluginBaseConfig; public destroyed: boolean; /** * 插件基类的构造函数 * @param cfgs 插件的配置项 */ constructor(cfgs?: IPluginBaseConfig) { this._cfgs = deepMix(this.getDefaultCfgs(), cfgs); this._events = {}; this.destroyed = false; } /** * 获取默认的插件配置 */ public getDefaultCfgs() { return {}; } /** * 初始化插件 * @param graph IGraph 实例 */ public initPlugin(graph: IGraph) { const self = this; self.set("graph", graph); const events = self.getEvents(); const bindEvents: EventMapType = {}; each(events, (v, k) => { const event = wrapBehavior(self, v) as (e: IG6GraphEvent) => void; bindEvents[k] = event; graph.on(k, event); }); this._events = bindEvents; this.init(); } /** * 初始化方法,供子类实现 */ public init() {} /** * 获取插件中的事件和事件处理方法,供子类实现 */ public getEvents() { return {}; } /** * 获取配置项中的某个值 * @param key 键值 */ public get(key: string) { return this._cfgs[key]; } /** * 将指定的值存储到 cfgs 中 * @param key 键值 * @param val 设置的值 */ public set(key: string, val: any) { this._cfgs[key] = val; } /** * 销毁方法,供子类复写 */ public destroy() {} /** * 销毁插件 */ public destroyPlugin() { this.destroy(); const graph = this.get("graph"); const events = this._events; each(events, (v, k) => { graph.off(k, v); }); (this._events as EventMapType | null) = null; (this._cfgs as IPluginBaseConfig | null) = null; this.destroyed = true; } } ================================================ FILE: packages/f6/src/plugin/index.ts ================================================ // import Plugin from '@antv/g6-plugins'; export default Plugin; // export default {}; ================================================ FILE: packages/f6/src/types/index.ts ================================================ /* eslint @typescript-eslint/no-use-before-define: 0 */ export type WaterMarkerConfig = Partial<{ // 水印 canvas 容器的宽高 width: number; height: number; compatible: boolean; text: { x?: number; y?: number; lineHeight?: number; rotate?: number; fontSize?: number; fontFamily?: string; fill?: string; baseline?: string; }; image: { x?: number; y?: number; // 图片的宽高 width?: number; height: number; rotate?: number; }; }>; ================================================ FILE: packages/f6/src/util/color.ts ================================================ import color from "color"; import { generate } from "@ant-design/colors"; /** * get the mix color of backColor and frontColor with alpah * @param backColor background color * @param frontColor foreground color * @param frontAlpha the opacity of foreground color */ export const mixColor = (backColor, frontColor, frontAlpha) => { const bc = color(backColor); const fc = color(frontColor); return color([ (1 - frontAlpha) * bc.red() + frontAlpha * fc.red(), (1 - frontAlpha) * bc.green() + frontAlpha * fc.green(), (1 - frontAlpha) * bc.blue() + frontAlpha * fc.blue(), ]).rgb(); }; const getColorsWithDefaultTheme = ( subjectColor, backColor = "#fff", disableColor = "rgb(150, 150, 150)", ) => { const subjectColor005 = mixColor(backColor, subjectColor, 0.05) .rgb() .toString(); const subjectColor01 = mixColor(backColor, subjectColor, 0.1) .rgb() .toString(); const subjectColor02 = mixColor(backColor, subjectColor, 0.2) .rgb() .toString(); const subjectColor04 = mixColor(backColor, subjectColor, 0.4) .rgb() .toString(); const disableColor002 = mixColor(backColor, disableColor, 0.02) .rgb() .toString(); const disableColor005 = mixColor(backColor, disableColor, 0.05) .rgb() .toString(); const disableColor01 = mixColor(backColor, disableColor, 0.1) .rgb() .toString(); const disableColor02 = mixColor(backColor, disableColor, 0.2) .rgb() .toString(); const disableColor03 = mixColor(backColor, disableColor, 0.3) .rgb() .toString(); const paletteFromSubject = generate(subjectColor, { theme: "default", backgroundColor: backColor, }); const subjectHex = color(subjectColor).hex().toLowerCase(); const subjectIdx = paletteFromSubject.indexOf(subjectHex); let deeperSubject = subjectColor; if (subjectIdx !== -1) { deeperSubject = paletteFromSubject[subjectIdx + 1]; } return { // for nodes mainStroke: subjectColor, mainFill: subjectColor01, activeStroke: subjectColor, activeFill: subjectColor005, inactiveStroke: subjectColor04, inactiveFill: subjectColor005, selectedStroke: subjectColor, selectedFill: backColor, highlightStroke: deeperSubject, highlightFill: subjectColor02, disableStroke: disableColor03, disableFill: disableColor005, // for edges edgeMainStroke: disableColor03, edgeActiveStroke: subjectColor, edgeInactiveStroke: disableColor02, edgeSelectedStroke: subjectColor, edgeHighlightStroke: subjectColor, edgeDisableStroke: disableColor01, // for combos comboMainStroke: disableColor03, comboMainFill: disableColor002, comboActiveStroke: subjectColor, comboActiveFill: subjectColor005, comboInactiveStroke: disableColor03, comboInactiveFill: disableColor002, comboSelectedStroke: subjectColor, comboSelectedFill: disableColor002, comboHighlightStroke: deeperSubject, // 'rgb(53, 119, 222)', // TODO: how to generate it ??? comboHighlightFill: disableColor002, comboDisableStroke: disableColor02, comboDisableFill: disableColor005, }; }; const getColorsWithDarkTheme = ( subjectColor, backColor = "#fff", disableColor = "#777", ) => { const subjectColor02 = mixColor(backColor, subjectColor, 0.2) .rgb() .toString(); const subjectColor03 = mixColor(backColor, subjectColor, 0.3) .rgb() .toString(); const subjectColor06 = mixColor(backColor, subjectColor, 0.6) .rgb() .toString(); const subjectColor08 = mixColor(backColor, subjectColor, 0.8) .rgb() .toString(); const disableColor02 = mixColor(backColor, disableColor, 0.2) .rgb() .toString(); const disableColor025 = mixColor(backColor, disableColor, 0.25) .rgb() .toString(); const disableColor03 = mixColor(backColor, disableColor, 0.3) .rgb() .toString(); const disableColor04 = mixColor(backColor, disableColor, 0.4) .rgb() .toString(); const disableColor05 = mixColor(backColor, disableColor, 0.5) .rgb() .toString(); const paletteFromSubject = generate(subjectColor, { theme: "dark", backgroundColor: backColor, }); const subjectHex = color(subjectColor).hex().toLowerCase(); const subjectIdx = paletteFromSubject.indexOf(subjectHex); let deeperSubject = subjectColor; if (subjectIdx !== -1) { deeperSubject = paletteFromSubject[subjectIdx + 1]; } return { // for nodes mainStroke: subjectColor08, mainFill: subjectColor02, activeStroke: subjectColor, activeFill: subjectColor03, inactiveStroke: subjectColor08, inactiveFill: subjectColor02, selectedStroke: subjectColor, selectedFill: subjectColor02, highlightStroke: subjectColor, highlightFill: subjectColor06, disableStroke: disableColor05, disableFill: disableColor025, // for edges edgeMainStroke: disableColor, edgeActiveStroke: subjectColor, edgeInactiveStroke: disableColor, edgeSelectedStroke: subjectColor, edgeHighlightStroke: subjectColor, edgeDisableStroke: disableColor03, // for combos comboMainStroke: disableColor04, comboMainFill: disableColor025, comboActiveStroke: subjectColor, comboActiveFill: disableColor02, comboInactiveStroke: disableColor04, comboInactiveFill: disableColor025, comboSelectedStroke: subjectColor, comboSelectedFill: disableColor02, comboHighlightStroke: deeperSubject, // 'rgb(53, 119, 222)', // TODO: how to generate it ??? comboHighlightFill: disableColor025, comboDisableStroke: disableColor04, comboDisableFill: disableColor02, }; }; /** * get the set of colors according to the subject color and background color * @param subjectColor the subject color * @param backColor background color * @param disableColor the color for disable state */ export const getColorsWithSubjectColor = ( subjectColor, backColor = "#fff", theme: "default" | "dark" = "default", disableColor = "rgb(150, 150, 150)", ) => { if (theme === "default") return getColorsWithDefaultTheme( subjectColor, backColor, "rgb(150, 150, 150)", ); return getColorsWithDarkTheme(subjectColor, backColor, "#777"); }; export const getColorSetsBySubjectColors = ( subjectColors, backColor = "#fff", theme: "default" | "dark" = "default", disableColor = "rgb(150, 150, 150)", ) => { const sets = []; subjectColors.forEach((sColor) => { sets.push( getColorsWithSubjectColor(sColor, backColor, theme, disableColor), ); }); return sets; }; ================================================ FILE: packages/f6/src/util/index.ts ================================================ import * as ColorUtil from "./color"; import * as LayoutUtil from "./layout"; import { Util } from "@antv/f6-core"; const G6Util: any = { ...Util, ...ColorUtil, ...LayoutUtil }; export default G6Util; ================================================ FILE: packages/f6/src/util/layout.ts ================================================ import { IPoint, TreeGraphData, Util } from "@antv/f6-core"; import { isNumber } from "@antv/util"; const { traverseTree } = Util; /** * 将 number | Function 类型的参数转换为 return number 的 Function * @param {number | Function} value 需要被转换的值 * @param {number} defaultV 返回函数的默认返回值 * @return {Function} 转换后的函数 */ export const proccessToFunc = ( value: number | Function, defaultV?: number, ): ((d?: any) => number) => { let func; if (!value) { func = (d) => { return defaultV || 1; }; } else if (isNumber(value)) { func = (d) => { return value; }; } else { func = value; } return func; }; /** * 将节点和边数据转换为 GPU 可读的数组。并返回 maxEdgePerVetex,每个节点上最多的边数 * @param {NodeConfig[]} nodes 需要被转换的值 * @param {EdgeConfig[]} edges 返回函数的默认返回值 * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象 */ export const buildTextureData = ( nodes, edges, ): { array: Float32Array; maxEdgePerVetex: number; } => { const dataArray = []; const nodeDict = []; const mapIdPos = {}; let i = 0; for (i = 0; i < nodes.length; i++) { const n = nodes[i]; mapIdPos[n.id] = i; dataArray.push(n.x); dataArray.push(n.y); dataArray.push(0); dataArray.push(0); nodeDict.push([]); } for (i = 0; i < edges.length; i++) { const e = edges[i]; nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]); nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]); } let maxEdgePerVetex = 0; for (i = 0; i < nodes.length; i++) { const offset = dataArray.length; const dests = nodeDict[i]; const len = dests.length; dataArray[i * 4 + 2] = offset; dataArray[i * 4 + 3] = dests.length; maxEdgePerVetex = Math.max(maxEdgePerVetex, dests.length); for (let j = 0; j < len; ++j) { const dest = dests[j]; dataArray.push(+dest); } } while (dataArray.length % 4 !== 0) { dataArray.push(0); } return { array: new Float32Array(dataArray), maxEdgePerVetex, }; }; /** * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数 * @param {NodeConfig[]} nodes 节点数组 * @param {EdgeConfig[]} edges 边数组 * @param {Function} attrs 读取边属性的函数 * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象 */ export const buildTextureDataWithOneEdgeAttr = ( nodes, edges, attrs: Function, ): { array: Float32Array; maxEdgePerVetex: number; } => { const dataArray = []; const nodeDict = []; const mapIdPos = {}; let i = 0; for (i = 0; i < nodes.length; i++) { const n = nodes[i]; mapIdPos[n.id] = i; dataArray.push(n.x); dataArray.push(n.y); dataArray.push(0); dataArray.push(0); nodeDict.push([]); } for (i = 0; i < edges.length; i++) { const e = edges[i]; nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]); nodeDict[mapIdPos[e.source]].push(attrs(e)); // 理想边长,后续可以改成每条边不同 nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]); nodeDict[mapIdPos[e.target]].push(attrs(e)); // 理想边长,后续可以改成每条边不同 } let maxEdgePerVetex = 0; for (i = 0; i < nodes.length; i++) { const offset = dataArray.length; const dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长…… const len = dests.length; dataArray[i * 4 + 2] = offset; dataArray[i * 4 + 3] = len / 2; // 第四位存储与该节点相关的所有节点个数 maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 2); for (let j = 0; j < len; ++j) { const dest = dests[j]; dataArray.push(+dest); } } // 不是 4 的倍数,填充 0 while (dataArray.length % 4 !== 0) { dataArray.push(0); } return { array: new Float32Array(dataArray), maxEdgePerVetex, }; }; /** * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数 * @param {NodeConfig[]} nodes 节点数组 * @param {EdgeConfig[]} edges 边数组 * @param {Function} attrs 读取边属性的函数 * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象 */ export const buildTextureDataWithTwoEdgeAttr = ( nodes, edges, attrs1: Function, attrs2: Function, ): { array: Float32Array; maxEdgePerVetex: number; } => { const dataArray = []; const nodeDict = []; const mapIdPos = {}; let i = 0; for (i = 0; i < nodes.length; i++) { const n = nodes[i]; mapIdPos[n.id] = i; dataArray.push(n.x); dataArray.push(n.y); dataArray.push(0); dataArray.push(0); nodeDict.push([]); } for (i = 0; i < edges.length; i++) { const e = edges[i]; nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]); nodeDict[mapIdPos[e.source]].push(attrs1(e)); nodeDict[mapIdPos[e.source]].push(attrs2(e)); nodeDict[mapIdPos[e.source]].push(0); nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]); nodeDict[mapIdPos[e.target]].push(attrs1(e)); nodeDict[mapIdPos[e.target]].push(attrs2(e)); nodeDict[mapIdPos[e.target]].push(0); } let maxEdgePerVetex = 0; for (i = 0; i < nodes.length; i++) { const offset = dataArray.length; const dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长…… const len = dests.length; // dataArray[i * 4 + 2] = offset; // dataArray[i * 4 + 3] = len / 4; // 第四位存储与该节点相关的所有节点个数 // pack offset & length into float32: offset 20bit, length 12bit dataArray[i * 4 + 2] = offset + (1048576 * len) / 4; dataArray[i * 4 + 3] = 0; // 第四位存储与上一次的距离差值 maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 4); for (let j = 0; j < len; ++j) { const dest = dests[j]; dataArray.push(+dest); } } // 不是 4 的倍数,填充 0 while (dataArray.length % 4 !== 0) { dataArray.push(0); } return { array: new Float32Array(dataArray), maxEdgePerVetex, }; }; /** * transform the extended attributes of nodes or edges to a texture array * @param {string[]} attributeNames attributes' name to be read from items and put into output array * @param {ModelConfig[]} items the items to be read * @return {Float32Array} the attributes' value array to be read by GPU */ export const attributesToTextureData = ( attributeNames: string[], items, ): { array: Float32Array; count: number } => { const dataArray = []; const attributeNum = attributeNames.length; const attributteStringMap = {}; items.forEach((item) => { attributeNames.forEach((name, i) => { if (attributteStringMap[item[name]] === undefined) { attributteStringMap[item[name]] = Object.keys(attributteStringMap).length; } dataArray.push(attributteStringMap[item[name]]); // insure each node's attributes take inter number of grids if (i === attributeNum - 1) { while (dataArray.length % 4 !== 0) { dataArray.push(0); } } }); }); return { array: new Float32Array(dataArray), count: Object.keys(attributteStringMap).length, }; }; /** * transform the number array format of extended attributes of nodes or edges to a texture array * @param {string[]} attributeNames attributes' name to be read from items and put into output array * @return {Float32Array} the attributes' value array to be read by GPU */ export const arrayToTextureData = (valueArrays: number[][]): Float32Array => { const dataArray = []; const attributeNum = valueArrays.length; const itemNum = valueArrays[0].length; for (let j = 0; j < itemNum; j++) { valueArrays.forEach((valueArray, i) => { dataArray.push(valueArray[j]); // insure each node's attributes take inter number of grids if (i === attributeNum - 1) { while (dataArray.length % 4 !== 0) { dataArray.push(0); } } }); } return new Float32Array(dataArray); }; export type TreeGraphDataWithPosition = TreeGraphData & { x: number; y: number; children?: TreeGraphDataWithPosition[]; }; /** * * @param data Tree graph data * @param layout */ export const radialLayout = ( data: TreeGraphDataWithPosition, layout?: string, ): TreeGraphDataWithPosition => { // 布局方式有 H / V / LR / RL / TB / BT const VERTICAL_LAYOUTS: string[] = ["V", "TB", "BT"]; const min: IPoint = { x: Infinity, y: Infinity, }; const max: IPoint = { x: -Infinity, y: -Infinity, }; // 默认布局是垂直布局TB,此时x对应rad,y对应r let rScale: "x" | "y" = "x"; let radScale: "x" | "y" = "y"; if (layout && VERTICAL_LAYOUTS.indexOf(layout) >= 0) { // 若是水平布局,y对应rad,x对应r radScale = "x"; rScale = "y"; } let count = 0; traverseTree(data, (node: TreeGraphDataWithPosition) => { count++; if (node.x > max.x) { max.x = node.x; } if (node.x < min.x) { min.x = node.x; } if (node.y > max.y) { max.y = node.y; } if (node.y < min.y) { min.y = node.y; } return true; }); const avgRad = (Math.PI * 2) / count; const radDiff = max[radScale] - min[radScale]; if (radDiff === 0) { return data; } traverseTree(data, (node) => { const radial = ((node[radScale] - min[radScale]) / radDiff) * (Math.PI * 2 - avgRad) + avgRad; const r = Math.abs(rScale === "x" ? node.x - data.x : node.y - data.y); node.x = r * Math.cos(radial); node.y = r * Math.sin(radial); return true; }); return data; }; ================================================ FILE: packages/f6/stories/algorithm/dfs/data.ts ================================================ export default { nodes: [ { id: "A", label: "A", }, { id: "B", label: "B", }, { id: "C", label: "C", }, { id: "D", label: "D", }, { id: "E", label: "E", }, { id: "F", label: "F", }, { id: "G", label: "G", }, ], edges: [ { source: "A", target: "B", }, { source: "B", target: "C", }, { source: "C", target: "G", }, { source: "A", target: "D", }, { source: "A", target: "E", }, { source: "E", target: "F", }, { source: "F", target: "D", }, { source: "D", target: "G", }, ], }; ================================================ FILE: packages/f6/stories/algorithm/dfs/index.tsx ================================================ import React, { useEffect } from "react"; import F6, { Algorithm } from "@antv/f6"; import dagreLayout from "@antv/f6/src/extends/layout/dagreLayout"; import data from "./data"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; F6.registerLayout("dagre", dagreLayout); useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", sortByCombo: false, ranksep: 10, nodesep: 10, }, animate: true, defaultNode: { size: 30, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, } as any); graph.data(data); graph.render(); graph.fitView(); const { depthFirstSearch } = Algorithm; const commands = []; graph.getNodes().forEach((node) => { graph.setItemState(node, "inactive", true); }); depthFirstSearch(data, "A", { enter: ({ current: id }) => { commands.push({ action: "enter", id, }); }, leave: ({ current: id }) => { commands.push({ action: "leave", id, }); }, }); function loop() { const command = commands.shift(); if (command) { const pathNode = graph.findById(command.id); if (command.action === "enter") { pathNode.toFront(); graph.clearItemStates(pathNode); graph.setItemState(pathNode, "highlight", true); } if (command.action === "leave") { graph.clearItemStates(pathNode); graph.setItemState(pathNode, "inactive", true); } setTimeout(loop, 1000); } } loop(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/algorithm/index.stories.tsx ================================================ import React, { useEffect } from "react"; import DFSDemo from "./dfs"; import ShortestPathDemo from "./shortestPath"; export default { title: "Example/Algorithm", }; export const DFS = (args) => ; export const ShortestPath = (args) => ; ================================================ FILE: packages/f6/stories/algorithm/shortestPath/data.ts ================================================ export default { nodes: [ { id: "Myriel", }, { id: "Napoleon", }, { id: "Mlle.Baptistine", }, { id: "Mme.Magloire", }, { id: "CountessdeLo", }, { id: "Geborand", }, { id: "Champtercier", }, { id: "Cravatte", }, { id: "Count", }, { id: "OldMan", }, { id: "Labarre", }, { id: "Valjean", }, { id: "Marguerite", }, { id: "Mme.deR", }, { id: "Isabeau", }, { id: "Gervais", }, { id: "Tholomyes", }, { id: "Listolier", }, { id: "Fameuil", }, { id: "Blacheville", }, { id: "Favourite", }, { id: "Dahlia", }, { id: "Zephine", }, { id: "Fantine", }, { id: "Mme.Thenardier", }, { id: "Thenardier", }, { id: "Cosette", }, { id: "Javert", }, { id: "Fauchelevent", }, { id: "Bamatabois", }, { id: "Perpetue", }, { id: "Simplice", }, { id: "Scaufflaire", }, { id: "Woman1", }, { id: "Judge", }, { id: "Champmathieu", }, { id: "Brevet", }, { id: "Chenildieu", }, { id: "Cochepaille", }, { id: "Pontmercy", }, { id: "Boulatruelle", }, { id: "Eponine", }, { id: "Anzelma", }, { id: "Woman2", }, { id: "MotherInnocent", }, { id: "Gribier", }, { id: "Jondrette", }, { id: "Mme.Burgon", }, { id: "Gavroche", }, { id: "Gillenormand", }, { id: "Magnon", }, { id: "Mlle.Gillenormand", }, { id: "Mme.Pontmercy", }, { id: "Mlle.Vaubois", }, { id: "Lt.Gillenormand", }, { id: "Marius", }, { id: "BaronessT", }, { id: "Mabeuf", }, { id: "Enjolras", }, { id: "Combeferre", }, { id: "Prouvaire", }, { id: "Feuilly", }, { id: "Courfeyrac", }, { id: "Bahorel", }, { id: "Bossuet", }, { id: "Joly", }, { id: "Grantaire", }, { id: "MotherPlutarch", }, { id: "Gueulemer", }, { id: "Babet", }, { id: "Claquesous", }, { id: "Montparnasse", }, { id: "Toussaint", }, { id: "Child1", }, { id: "Child2", }, { id: "Brujon", }, { id: "Mme.Hucheloup", }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; ================================================ FILE: packages/f6/stories/algorithm/shortestPath/index.tsx ================================================ import React, { useEffect } from "react"; import F6, { Algorithm } from "@antv/f6"; import force from "@antv/f6/src/extends/layout/forceLayout"; import data from "./data"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; // 注册布局 F6.registerLayout("force", force); useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["click-select", "drag-canvas", "drag-node"], }, layout: { type: "force", alphaDecay: 0, }, animate: true, defaultNode: { size: 30, }, defaultEdge: { style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, } as any); graph.data(data); graph.render(); graph.fitView(); const { findShortestPath } = Algorithm; // 清除状态 const clearStates = () => { graph.getNodes().forEach((node) => { graph.clearItemStates(node); }); graph.getEdges().forEach((edge) => { graph.clearItemStates(edge); }); }; graph.on("node:tap", (e) => { const selectedNodes = graph.findAllByState("node", "selected"); if (selectedNodes.length !== 2) { return; } // 清除状态 clearStates(); // path 为其中一条最短路径 const { path } = findShortestPath( data, selectedNodes[0].getID(), selectedNodes[1].getID(), ); const pathNodeMap = {}; // 高亮节点 path.forEach((id) => { const pathNode = graph.findById(id); pathNode.toFront(); graph.setItemState(pathNode, "highlight", true); pathNodeMap[id] = true; }); // 高亮边,置灰非路径中边 graph.getEdges().forEach((edge) => { const edgeModel = edge.getModel(); const source = edgeModel.source; const target = edgeModel.target; const sourceInPathIdx = path.indexOf(source); const targetInPathIdx = path.indexOf(target); if (sourceInPathIdx === -1 || targetInPathIdx === -1) return; if (Math.abs(sourceInPathIdx - targetInPathIdx) === 1) { graph.setItemState(edge, "highlight", true); } else { graph.setItemState(edge, "inactive", true); } }); // 置灰非路径中节点 graph.getNodes().forEach((node) => { if (!pathNodeMap[node.getID()]) { graph.setItemState(node, "inactive", true); } }); }); } }, []); return
; }; ================================================ FILE: packages/f6/stories/fruchterman/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import GridLayout from "../../src/extends/layout/fruchtermanLayout"; F6.registerLayout("fruchterman", GridLayout); const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 5, speed: 5, // for rendering after each iteration tick: () => { console.log("e"); graph.refreshPositions(); }, }, animate: true, defaultNode: { size: 30, }, } as any); graph.get("canvas").set("localRefresh", false); graph.data(data); const waterURL = "https://gw.alipayobjects.com/zos/bmw-prod/8088a9d7-e5b0-42f2-b6b2-27c823043993.svg"; const waterConfig = { image: { x: -15, //图片在水印画布的开始位置 y: 35, // 图片在水印画布的开始位置 width: 156, //图片的大小 height: 34, //图片的大小 rotate: 30, //图片的旋转角度 }, }; graph.render(); graph.fitView(); graph.setImageWaterMarker(waterURL, waterConfig, null); } }, []); return
; }; ================================================ FILE: packages/f6/stories/g-force/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import GridLayout from "../../src/extends/layout/fruchtermanLayout"; F6.registerLayout("fruchterman", GridLayout); const data = { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "fruchterman", gravity: 5, speed: 5, // for rendering after each iteration tick: () => { console.log("e"); graph.refreshPositions(); }, }, animate: true, defaultNode: { size: 30, }, } as any); graph.get("canvas").set("localRefresh", false); graph.data(data); const waterURL = "https://gw.alipayobjects.com/zos/bmw-prod/8088a9d7-e5b0-42f2-b6b2-27c823043993.svg"; const waterConfig = { image: { x: -15, //图片在水印画布的开始位置 y: 35, // 图片在水印画布的开始位置 width: 156, //图片的大小 height: 34, //图片的大小 rotate: 30, //图片的旋转角度 }, }; graph.render(); graph.fitView(); graph.setImageWaterMarker(waterURL, waterConfig, null); } }, []); return
; }; ================================================ FILE: packages/f6/stories/generalGraph/dagreConfigurationTranslate/data.ts ================================================ export default { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; ================================================ FILE: packages/f6/stories/generalGraph/dagreConfigurationTranslate/index.tsx ================================================ import React, { useEffect, useState } from "react"; import F6 from "../../../src"; import dagreLayout from "../../../src/extends/layout/dagreLayout"; import data from "./data"; F6.registerLayout("dagre", dagreLayout); export default () => { const ref = React.useRef(null); const [description, setDescription] = useState(""); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { // 创建F6实例 graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, fitViewPadding: 30, modes: { default: ["drag-canvas", "drag-node"], }, layout: { type: "dagre", nodeSize: [40, 20], nodesep: 1, ranksep: 1, }, animate: true, defaultNode: { size: [40, 20], type: "rect", style: { lineWidth: 2, stroke: "#5B8FF9", fill: "#C6E5FF", }, }, defaultEdge: { size: 1, color: "#e2e2e2", style: { endArrow: { path: "M 0,0 L 8,4 L 8,-4 Z", fill: "#e2e2e2", }, }, }, }); graph.data(data); graph.render(); graph.fitView(); layoutConfigTranslation(); function layoutConfigTranslation() { setTimeout(() => { setDescription( "Dagre layout, rank seperation: 10, node seperation in same level: 1, layout direction: Top->Bottom, alignment of nodes: DL", ), graph.updateLayout({ ranksep: 10, }); }, 1000); setTimeout(() => { setDescription( "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: DL", ); graph.updateLayout({ nodesep: 5, }); }, 2500); setTimeout(() => { setDescription( "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UL", ); graph.updateLayout({ align: "UL", }); }, 4000); setTimeout(() => { setDescription( "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: UR", ); graph.updateLayout({ align: "UR", }); }, 5500); setTimeout(() => { setDescription( "Dagre layout, rank seperation: 10, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", ); graph.updateLayout({ rankdir: "LR", align: "DL", }); }, 7000); setTimeout(() => { setDescription( "Dagre layout, rank seperation: 30, node seperation in same level: 5, layout direction: Left->Right, alignment of nodes: Down Right, alignment of nodes: DL", ); graph.updateLayout({ ranksep: 30, }); }, 8500); } } }, []); return (
{description}
); }; ================================================ FILE: packages/f6/stories/index.stories.tsx ================================================ import React from "react"; import type { Meta, StoryObj } from "@storybook/react"; import FruchtermanDemo from "./fruchterman"; import CollapseSlibingDemo from "./interactive/collapseSlibing"; import DagreConfigurationTranslateDemo from "./generalGraph/dagreConfigurationTranslate"; import MindMapDemo from "./sceneCase/mindMap"; import UITest from "./uiTest"; import SnapLineDemo from "./snapLine"; import PluginTooltipDemo from "./pluginTooltip"; import PluginLegendDemo from "./pluginLegend"; import PluginZoomSliderDemo from "./pluginZoomSlider"; import PluginEdgeFilterDemo from "./pluginEdgeFilter"; import PluginFisheyeDemo from "./pluginFisheye"; import PluginMniMapDemo from "./pluginMiniMap"; import PluginBundlingDemo from "./pluginBundling"; import MenuDemo from "./pluginMenu"; import NodeDemo from "./nodeDemo"; import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS, } from "@storybook/addon-viewport"; export default { title: "Example", parameters: { viewports: { ...INITIAL_VIEWPORTS, ...MINIMAL_VIEWPORTS, }, defaultViewport: "iphone14promax", }, } as Meta; export const CollapseSlibing = ((args) => ( )).bind({}); export const MindMap = ((args) => ).bind({}); export const DagreConfigurationTranslate = ((args) => ( )).bind({}); export const fruchterman = (args) => ; export const uiTest = (args) => ; export const SnapLine = (args) => ; export const PluginTooltip = (args) => ; export const PluginLegend = (args) => ; export const PluginZoomSlider = (args) => ; export const PluginEdgeFilter = (args) => ; export const PluginFisheye = (args) => ; // mini map export const PluginMniMap = (args) => ; export const PluginBundling = (args) => ; export const PluginMenu = (args) => ; export const nodeDemo = (args) => ; ================================================ FILE: packages/f6/stories/interactive/collapseSlibing/data.ts ================================================ export default { isRoot: true, id: "Root", cluster: "c0", children: [ { id: "SubTreeNode1", cluster: "c0", raw: {}, children: [ { id: "SubTreeNode1.1", cluster: "c1", }, { id: "SubTreeNode1.2", cluster: "c1", children: [ { id: "SubTreeNode1.2.1", cluster: "c0", }, { id: "SubTreeNode1.2.2", cluster: "c0", }, { id: "SubTreeNode1.2.3", cluster: "c1", }, ], }, ], }, { id: "SubTreeNode2", cluster: "c0", children: [ { id: "SubTreeNode2.1", cluster: "c2", }, ], }, { id: "SubTreeNode3", cluster: "c0", children: [ { id: "SubTreeNode3.1", cluster: "c2", }, { id: "SubTreeNode3.2", cluster: "c2", }, { id: "SubTreeNode3.3", cluster: "c2", }, ], }, { id: "SubTreeNode4", cluster: "c1", }, { id: "SubTreeNode5", cluster: "c1", }, { id: "SubTreeNode6", cluster: "c1", }, ], }; ================================================ FILE: packages/f6/stories/interactive/collapseSlibing/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../../src"; import TreeGraph from "../../../src/extends/graph/treeGraph"; import data from "./data"; F6.registerGraph("TreeGraph", TreeGraph); // custom the collapse-sibling behavior F6.registerBehavior("collapse-slibing", { getEvents() { return { "node:tap": "onTap", }; }, onTap(evt) { const { item } = evt; const model = item.getModel(); const { cluster } = model; const parentData = item.get("parent").getModel(); const me = this; if (model.collapsedSiblings) { this.graph.removeChild(model.id); setTimeout(() => { const { children } = parentData; for (let i = model.collapsedSiblings.length - 1; i >= 0; i--) { const add = model.collapsedSiblings[i]; children.splice(add.idx, 0, add); } delete model.collapsedSiblings; me.graph.updateChildren(children, parentData.id); }, 550); return; } const siblingData = parentData.children; if (siblingData.length <= 1) return; let count = 0; const aggregateNode = { id: `aggregate-node-${model.id}`, children: [], cluster, collapsedSiblings: [], }; let modelIdx = siblingData.length - 1; for (let i = siblingData.length - 1; i >= 0; i--) { const sibling = siblingData[i]; if (sibling.id === model.id) { const remove = siblingData[i]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); } else if (sibling.cluster === cluster && sibling.id !== model.id) { count++; aggregateNode.children = (siblingData[i].children || []).concat( aggregateNode.children, ); const remove = siblingData.splice(i, 1)[0]; remove.idx = i; aggregateNode.collapsedSiblings.push(remove); modelIdx = Math.min(i, modelIdx); } } if (!count) return; aggregateNode.label = count + 1; aggregateNode.size = 16 + (count + 1) * 4; this.graph.removeChild(model.id); siblingData.splice(modelIdx, 0, aggregateNode); setTimeout(() => { me.graph.updateChildren(siblingData, parentData.id); }, 550); }, }); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { const colors = ["#5F95FF", "#61DDAA", "#65789B"]; const colorSets = F6.Util.getColorSetsBySubjectColors( colors, "#fff", "default", "#777", ); // 创建F6实例 graph = new F6.TreeGraph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, modes: { default: ["collapse-slibing", "drag-canvas"], }, layout: { type: "compactBox", direction: "LR", defalutPosition: [], getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 16; }, getWidth: function getWidth() { return 16; }, getVGap: function getVGap() { return 10; }, getHGap: function getHGap() { return 50; }, }, defaultEdge: { type: "cubic-horizontal", color: "#A3B1BF", }, }); graph.node(function (node) { const colorSet = colorSets[+node.cluster.replace("c", "")]; return { size: node.size || 16, style: { fill: colorSet.mainFill || "#DEE9FF", stroke: colorSet.mainStroke || "#5B8FF9", }, }; }); graph.data(data); graph.render(); graph.fitView(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/nodeDemo/data.ts ================================================ const data = { type: "rect", label: "F6UI演示", children: [ { id: "18", type: "EQUITY_GRAPH_NODE_TYPE_COMPANY", tip: "测试", circleIcon: "", formattedName: "深圳丹邦科技股份有限公\n司", x: 0, y: 0, children: [], originChildren: [], side: "down", path: { 招商银行股份有限公司: 1, }, relationType: null, tyshxydm: "91440300732076027R", investRatio: 0.0238, hasExpand: true, ratio: 0.0238, nodeType: "ENTERPRISE_ORGANIZATION", name: "深圳丹邦科技股份有限公司", formattedRatio: "2.38%", isCircle: true, }, { id: "19", type: "EQUITY_GRAPH_NODE_TYPE_COMPANY_F6UI", tip: "测试", circleIcon: "", formattedName: "上海黄金交易所", x: 0, y: 0, children: [], originChildren: [], side: "down", path: { 招商银行股份有限公司: 1, }, relationType: null, tyshxydm: "91310000736228569K", investRatio: 0.0071, hasExpand: true, ratio: 0.0071, nodeType: "ENTERPRISE_ORGANIZATION", name: "上海黄金交易所", formattedRatio: "0.71%", isCircle: true, }, ], }; export default data; ================================================ FILE: packages/f6/stories/nodeDemo/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import TreeGraph from "../../src/extends/graph/treeGraph"; import data from "./data"; import equityCompanyNode from "./node"; import equityCompanyNodeF6UI from "./uiNode"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { // debugger F6.registerNode( "EQUITY_GRAPH_NODE_TYPE_COMPANY", equityCompanyNode, "rect", ); F6.registerNode( "EQUITY_GRAPH_NODE_TYPE_COMPANY_F6UI", equityCompanyNodeF6UI, "rect", ); F6.registerGraph("TreeGraph", TreeGraph); graph = new F6.TreeGraph({ container: ref.current, width, height, fitView: true, linkCenter: true, defaultNode: { type: "rect", maxTextCount: 20, size: [242, 106], style: { radius: 0, fill: "#FFFFFF", stroke: "#91D5FF", }, labelCfg: { style: { fill: "#333333", fontSize: 20, textAlign: "center", }, }, anchorPoints: [ [0.5, 0], [0.5, 1], ], }, modes: { default: ["drag-node", "zoom-canvas"], }, layout: { type: "compactBox", direction: "V", getId: function getId(d) { return d.id; }, getHeight: function getHeight() { return 106; }, getWidth: function getWidth() { return 242; }, getVGap: function getVGap() { return 154 / 2; }, getHGap: function getHGap() { return 24 / 2; }, getSide: function getSide(node) { switch (node.data.side) { case "up": return "left"; case "down": return "right"; default: return "left"; } }, }, defaultEdge: { color: "#999", style: { stroke: "#C5C5C5", }, labelCfg: { style: { fill: "#000", fontSize: 20, textAlign: "left", fontStyle: "Italic", }, }, }, }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/nodeDemo/node.ts ================================================ // 展开icon const collipseIcon = function collipseIcon(x, y, r) { return [ ["M", x - r, y], ["A", r, r, 0, 1, 0, x + r, y], ["A", r, r, 0, 1, 0, x - r, y], ["M", x + 7 - r, y], ["L", x + r - 7, y], ]; }; // 折叠icon const expandIcon = function expandIcon(x, y, r) { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x + 7 - r, y], ["L", x + r - 7, y], ["M", x, y - r + 7], ["L", x, y + r - 7], ]; }; /** * 添加展开/折叠标记 * @param {*} group * @param {*} side up | down 上下布局的时候,位置不一样 * @param {*} type expand | collipse 展开/折叠类型 * @param {*} h 容器高度 */ export function addMarker(group, side, type, h, circleIcon?) { let markerY = 0; if (side === "up") { markerY = -h / 2 - 1 - 16; } if (side === "down") { markerY = h / 2 + 16 + 1; } group.addShape("marker", { attrs: { x: 0, y: markerY, r: 14, stroke: "#FFFFFF", cursor: "pointer", fill: "#1890FF", symbol: type === "expand" ? expandIcon : collipseIcon, }, name: type === "expand" ? "add-item" : "remove-item", }); } /** * 增加循环持股标记 * @param {*} group * @param {*} x * @param {*} y * @param {*} icon */ export function addTag(group, x, y) { const tagGroup = group.addGroup({ id: "equity-tag", name: "equity-tag", }); const tagKeyShape = tagGroup.addShape("rect", { attrs: { width: 98, height: 28, stroke: "#FFA39E", fill: "#FFF1F0", x, y, radius: 2, }, }); group.set("tagKeyShape", tagKeyShape); tagGroup.addShape("text", { attrs: { fill: "#FF4D4F", text: "循环持股", textAlign: "left", fontSize: 20, width: 98, x: x + 8, y: y + 20 / 2 + 6 + 9, }, }); } export default { draw(cfg, group) { const styles = this.getShapeStyle(cfg); const { side, children, isCircle, hasExpand } = cfg; const w = styles.width; const h = styles.height; const keyShape = group.addShape("rect", { attrs: { ...styles, x: -w / 2, y: -h / 2, }, }); const bg = "#E6F7FF"; const fontColor = "#333333"; let labelY = 10; let rectH = h; if (cfg.formattedName.includes("\n")) { labelY = 6; } rectH = 70; // 边框 group.addShape("rect", { attrs: { width: w - 2, height: rectH - 2, fill: bg, x: 1 - w / 2, y: 1 - h / 2, }, draggable: true, }); // 格式化后文本 group.addShape("text", { attrs: { fontSize: 20, fill: fontColor, text: cfg.formattedName, width: w, textAlign: "center", x: 0, y: labelY, lineHeight: 28, }, draggable: true, }); group.addShape("text", { attrs: { fill: "#000000", fillOpacity: 0.45, text: cfg.tip, fontSize: 16, width: w, textAlign: "center", x: 0, y: (h - 70) / 2 + 70 - h / 2 + 8, }, }); // addCircleBubble(group, -104 / 2, -h / 2 - 36 - 6, '循环持股'); addTag(group, 10, -22 / 2 - h / 2 - 5); addMarker(group, side, children.length > 0 ? "ellipse" : "expand", h); return keyShape; }, }; ================================================ FILE: packages/f6/stories/nodeDemo/uiNode.ts ================================================ import { createUI } from "@antv/f6-ui"; export default { draw(cfg, group) { const styles = this.getShapeStyle(cfg); const w = styles.width; const h = styles.height; const bg = "#E6F7FF"; const html = `
上海黄金交易所
测试
循环持股
`; const css = ` text{ font-family: sans-serif; } .f6_ui_node{ display: flex; width: ${w}; height: ${h}; color: #333333; text-align: center; border: 1 solid #91D5FF; } .title{ padding: 20; font-size: 20; height: 70; background: ${bg}; pointer-events: none; } .tip { font-size: 16; padding: 10; color: #999; } .tag{ position: absolute; top: -15; right: 15; width: 98; height: 28; border: 1 solid #FFA39E; background: #FFF1F0; padding: 2; border-radius: 2; font-size: 20; color: #FF4D4F; } .marker{ position: absolute; bottom: -30; left: ${w / 2 - 28 / 2}; background: #1890FF; width: 28; height: 28; border-radius: 14; } shape{ background: black; border: 1 solid #fff; } `; const ui = createUI(html, css, group); return ui.backgroudNode.get("children")[0]; }, }; ================================================ FILE: packages/f6/stories/pluginBundling/data.ts ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, { id: "16", label: "16", }, { id: "17", label: "17", }, { id: "18", label: "18", }, { id: "19", label: "19", }, { id: "20", label: "20", }, { id: "21", label: "21", }, { id: "22", label: "22", }, { id: "23", label: "23", }, { id: "24", label: "24", }, { id: "25", label: "25", }, { id: "26", label: "26", }, { id: "27", label: "27", }, { id: "28", label: "28", }, { id: "29", label: "29", }, { id: "30", label: "30", }, { id: "31", label: "31", }, { id: "32", label: "32", }, { id: "33", label: "33", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginBundling/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import data from "./data"; import { Bundling } from "@antv/f6-plugin"; import CircularLayout from "@antv/f6/src/extends/layout/circularLayout"; F6.registerLayout("circular", CircularLayout); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; const edgeBundling = new Bundling({ bundleThreshold: 0.1, }); let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, layout: { type: "circular", center: [width / 2, height / 2], radius: height / 2.5, ordering: null, }, plugins: [edgeBundling], defaultNode: { size: [20, 20], color: "steelblue", }, defaultEdge: { size: 1, color: "#999", }, }); graph.data(data); graph.render(); } setTimeout(() => { edgeBundling.bundling(data); }, 1000); }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginEdgeFilter/data.ts ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, { id: "Gribier", x: 437.51920169330805, y: 160.14388411785757, }, { id: "Jondrette", x: 510.1406569699257, y: 327.7456828911454, }, { id: "Mme.Burgon", x: 466.0856874797108, y: 368.0210264990602, }, { id: "Gavroche", x: 393.6973181801981, y: 380.40382743216634, }, { id: "Gillenormand", x: 338.1148595335302, y: 286.4434006942807, }, { id: "Magnon", x: 277.12320020410266, y: 317.4384382481713, }, { id: "Mlle.Gillenormand", x: 257.52167498720337, y: 306.4604520400414, }, { id: "Mme.Pontmercy", x: 307.71325168392366, y: 318.0074114921048, }, { id: "Mlle.Vaubois", x: 197.63137784390082, y: 325.2999365859076, }, { id: "Lt.Gillenormand", x: 294.4105849543593, y: 296.53686533697186, }, { id: "Marius", x: 336.3436812430268, y: 350.8376519695578, }, { id: "BaronessT", x: 390.6807729530675, y: 322.9175698803163, }, { id: "Mabeuf", x: 366.77554563642803, y: 445.26666512175433, }, { id: "Enjolras", x: 376.9421415192702, y: 371.1750781444891, }, { id: "Combeferre", x: 397.0516872015465, y: 416.38478793328625, }, { id: "Prouvaire", x: 309.0241345496318, y: 426.44215271462605, }, { id: "Feuilly", x: 314.71137563489117, y: 456.80172690673896, }, { id: "Courfeyrac", x: 332.8405296045364, y: 435.8881866127797, }, { id: "Bahorel", x: 343.1268360879219, y: 466.9404473411801, }, { id: "Bossuet", x: 305.84814130923144, y: 382.89355947309724, }, { id: "Joly", x: 371.447442010866, y: 415.99688422022257, }, { id: "Grantaire", x: 370.72651876919826, y: 466.96671298340794, }, { id: "MotherPlutarch", x: 424.04457501182867, y: 461.9373924104361, }, { id: "Gueulemer", x: 344.1315821958891, y: 323.7890765583486, }, { id: "Babet", x: 367.3969014122835, y: 319.2359576043117, }, { id: "Claquesous", x: 303.23885194199465, y: 347.8041412708572, }, { id: "Montparnasse", x: 322.6528688110919, y: 330.01757397802925, }, { id: "Toussaint", x: 306.6921797724685, y: 277.05255454452566, }, { id: "Child1", x: 361.1652068827243, y: 387.9769951347244, }, { id: "Child2", x: 415.98942162128606, y: 432.37341762016945, }, { id: "Brujon", x: 330.44198511493056, y: 394.6025799878689, }, { id: "Mme.Hucheloup", x: 394.43875881505835, y: 450.4056149101193, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginEdgeFilter/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import data from "./data"; import plugins from "../../../plugin/src"; const EdgeFilterLens = plugins.EdgeFilterLens; data.edges.forEach((edge) => { edge.color = "#aaa"; edge.size = 2; edge.style = { opacity: 0.7, }; edge.label = "a"; }); const filterConfigs = { trigger: "drag", showLabel: "edge", r: 60, }; let filterLens = new EdgeFilterLens(filterConfigs); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [filterLens], defaultEdge: { labelCfg: { autoRotate: true, style: { stroke: "#fff", lineWidth: 2, }, }, }, defaultNode: { size: 15, color: "#5B8FF9", style: { lineWidth: 2, fill: "#C6E5FF", }, }, }); graph.data(data); graph.render(); graph.getEdges().forEach((edge) => { edge .getContainer() .getChildren() .forEach((shape) => { if (shape.get("type") === "text") shape.set("visible", false); }); }); } }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginFisheye/data.ts ================================================ const data = { nodes: [ { id: "Myriel", x: 197.13154409979438, y: 58.49567372045294, }, { id: "Napoleon", x: 147.01896389692396, y: 22.47017586685877, }, { id: "Mlle.Baptistine", x: 225.53929622396657, y: 141.52203994343503, }, { id: "Mme.Magloire", x: 255.07906424356426, y: 120.2538776202175, }, { id: "CountessdeLo", x: 151.886941377147, y: -3.5440526274605024, }, { id: "Geborand", x: 136.99780912786676, y: 41.74972346367764, }, { id: "Champtercier", x: 227.06448529213904, y: 8.803245731763797, }, { id: "Cravatte", x: 172.28712104569624, y: -10.28659385020346, }, { id: "Count", x: 172.9776128536988, y: 12.515280485950003, }, { id: "OldMan", x: 198.7549153659034, y: -6.143466139379697, }, { id: "Labarre", x: 266.5746386228216, y: 203.98384539788222, }, { id: "Valjean", x: 322.22242753596396, y: 221.58991461580462, }, { id: "Marguerite", x: 265.1218339265034, y: 171.59761511302105, }, { id: "Mme.deR", x: 299.78639359854327, y: 133.57398015667923, }, { id: "Isabeau", x: 282.69786358028415, y: 191.50678051232913, }, { id: "Gervais", x: 334.4562033716733, y: 148.86340203151713, }, { id: "Tholomyes", x: 359.6758601570104, y: 158.51932058679517, }, { id: "Listolier", x: 308.6408107258377, y: 80.08978211784734, }, { id: "Fameuil", x: 329.1208783621155, y: 89.50783923513406, }, { id: "Blacheville", x: 351.31710942912247, y: 95.62381874446997, }, { id: "Favourite", x: 284.0990966456606, y: 153.6649901350214, }, { id: "Dahlia", x: 303.2794454950651, y: 170.87469919068386, }, { id: "Zephine", x: 286.9038607953858, y: 94.82364610010669, }, { id: "Fantine", x: 337.7295856292113, y: 187.2760733153313, }, { id: "Mme.Thenardier", x: 283.8431887426204, y: 267.7101161193055, }, { id: "Thenardier", x: 317.6539018281542, y: 300.0586304481375, }, { id: "Cosette", x: 343.4495217104461, y: 248.14013534143953, }, { id: "Javert", x: 368.6281356589531, y: 263.5847126845181, }, { id: "Fauchelevent", x: 377.3520676841103, y: 176.72534157485532, }, { id: "Bamatabois", x: 391.75313851634024, y: 156.5212161097912, }, { id: "Perpetue", x: 234.8199749437348, y: 195.99976079362335, }, { id: "Simplice", x: 286.4937544345336, y: 227.73420851527578, }, { id: "Scaufflaire", x: 250.02919011143416, y: 231.2513211913802, }, { id: "Woman1", x: 375.4668487891018, y: 202.783515421686, }, { id: "Judge", x: 370.1700307319093, y: 139.4810861650384, }, { id: "Champmathieu", x: 404.6422482933774, y: 216.58364918349568, }, { id: "Brevet", x: 399.2513775912632, y: 183.03026453336724, }, { id: "Chenildieu", x: 425.90996667472837, y: 194.79658513642403, }, { id: "Cochepaille", x: 419.38361105364334, y: 148.69180823448008, }, { id: "Pontmercy", x: 375.2946100421193, y: 307.66682817782345, }, { id: "Boulatruelle", x: 260.66757416917164, y: 279.0949406815367, }, { id: "Eponine", x: 268.68796660221636, y: 365.8200533034293, }, { id: "Anzelma", x: 234.53762633403787, y: 303.08504254821366, }, { id: "Woman2", x: 304.29126463264043, y: 254.05392981470945, }, { id: "MotherInnocent", x: 350.35613429759803, y: 214.42252912270644, }, { id: "Gribier", x: 437.51920169330805, y: 160.14388411785757, }, { id: "Jondrette", x: 510.1406569699257, y: 327.7456828911454, }, { id: "Mme.Burgon", x: 466.0856874797108, y: 368.0210264990602, }, { id: "Gavroche", x: 393.6973181801981, y: 380.40382743216634, }, { id: "Gillenormand", x: 338.1148595335302, y: 286.4434006942807, }, { id: "Magnon", x: 277.12320020410266, y: 317.4384382481713, }, { id: "Mlle.Gillenormand", x: 257.52167498720337, y: 306.4604520400414, }, { id: "Mme.Pontmercy", x: 307.71325168392366, y: 318.0074114921048, }, { id: "Mlle.Vaubois", x: 197.63137784390082, y: 325.2999365859076, }, { id: "Lt.Gillenormand", x: 294.4105849543593, y: 296.53686533697186, }, { id: "Marius", x: 336.3436812430268, y: 350.8376519695578, }, { id: "BaronessT", x: 390.6807729530675, y: 322.9175698803163, }, { id: "Mabeuf", x: 366.77554563642803, y: 445.26666512175433, }, { id: "Enjolras", x: 376.9421415192702, y: 371.1750781444891, }, { id: "Combeferre", x: 397.0516872015465, y: 416.38478793328625, }, { id: "Prouvaire", x: 309.0241345496318, y: 426.44215271462605, }, { id: "Feuilly", x: 314.71137563489117, y: 456.80172690673896, }, { id: "Courfeyrac", x: 332.8405296045364, y: 435.8881866127797, }, { id: "Bahorel", x: 343.1268360879219, y: 466.9404473411801, }, { id: "Bossuet", x: 305.84814130923144, y: 382.89355947309724, }, { id: "Joly", x: 371.447442010866, y: 415.99688422022257, }, { id: "Grantaire", x: 370.72651876919826, y: 466.96671298340794, }, { id: "MotherPlutarch", x: 424.04457501182867, y: 461.9373924104361, }, { id: "Gueulemer", x: 344.1315821958891, y: 323.7890765583486, }, { id: "Babet", x: 367.3969014122835, y: 319.2359576043117, }, { id: "Claquesous", x: 303.23885194199465, y: 347.8041412708572, }, { id: "Montparnasse", x: 322.6528688110919, y: 330.01757397802925, }, { id: "Toussaint", x: 306.6921797724685, y: 277.05255454452566, }, { id: "Child1", x: 361.1652068827243, y: 387.9769951347244, }, { id: "Child2", x: 415.98942162128606, y: 432.37341762016945, }, { id: "Brujon", x: 330.44198511493056, y: 394.6025799878689, }, { id: "Mme.Hucheloup", x: 394.43875881505835, y: 450.4056149101193, }, ], edges: [ { source: "Napoleon", target: "Myriel", value: 1, }, { source: "Mlle.Baptistine", target: "Myriel", value: 8, }, { source: "Mme.Magloire", target: "Myriel", value: 10, }, { source: "Mme.Magloire", target: "Mlle.Baptistine", value: 6, }, { source: "CountessdeLo", target: "Myriel", value: 1, }, { source: "Geborand", target: "Myriel", value: 1, }, { source: "Champtercier", target: "Myriel", value: 1, }, { source: "Cravatte", target: "Myriel", value: 1, }, { source: "Count", target: "Myriel", value: 2, }, { source: "OldMan", target: "Myriel", value: 1, }, { source: "Valjean", target: "Labarre", value: 1, }, { source: "Valjean", target: "Mme.Magloire", value: 3, }, { source: "Valjean", target: "Mlle.Baptistine", value: 3, }, { source: "Valjean", target: "Myriel", value: 5, }, { source: "Marguerite", target: "Valjean", value: 1, }, { source: "Mme.deR", target: "Valjean", value: 1, }, { source: "Isabeau", target: "Valjean", value: 1, }, { source: "Gervais", target: "Valjean", value: 1, }, { source: "Listolier", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Tholomyes", value: 4, }, { source: "Fameuil", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Tholomyes", value: 4, }, { source: "Blacheville", target: "Listolier", value: 4, }, { source: "Blacheville", target: "Fameuil", value: 4, }, { source: "Favourite", target: "Tholomyes", value: 3, }, { source: "Favourite", target: "Listolier", value: 3, }, { source: "Favourite", target: "Fameuil", value: 3, }, { source: "Favourite", target: "Blacheville", value: 4, }, { source: "Dahlia", target: "Tholomyes", value: 3, }, { source: "Dahlia", target: "Listolier", value: 3, }, { source: "Dahlia", target: "Fameuil", value: 3, }, { source: "Dahlia", target: "Blacheville", value: 3, }, { source: "Dahlia", target: "Favourite", value: 5, }, { source: "Zephine", target: "Tholomyes", value: 3, }, { source: "Zephine", target: "Listolier", value: 3, }, { source: "Zephine", target: "Fameuil", value: 3, }, { source: "Zephine", target: "Blacheville", value: 3, }, { source: "Zephine", target: "Favourite", value: 4, }, { source: "Zephine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Tholomyes", value: 3, }, { source: "Fantine", target: "Listolier", value: 3, }, { source: "Fantine", target: "Fameuil", value: 3, }, { source: "Fantine", target: "Blacheville", value: 3, }, { source: "Fantine", target: "Favourite", value: 4, }, { source: "Fantine", target: "Dahlia", value: 4, }, { source: "Fantine", target: "Zephine", value: 4, }, { source: "Fantine", target: "Marguerite", value: 2, }, { source: "Fantine", target: "Valjean", value: 9, }, { source: "Mme.Thenardier", target: "Fantine", value: 2, }, { source: "Mme.Thenardier", target: "Valjean", value: 7, }, { source: "Thenardier", target: "Mme.Thenardier", value: 13, }, { source: "Thenardier", target: "Fantine", value: 1, }, { source: "Thenardier", target: "Valjean", value: 12, }, { source: "Cosette", target: "Mme.Thenardier", value: 4, }, { source: "Cosette", target: "Valjean", value: 31, }, { source: "Cosette", target: "Tholomyes", value: 1, }, { source: "Cosette", target: "Thenardier", value: 1, }, { source: "Javert", target: "Valjean", value: 17, }, { source: "Javert", target: "Fantine", value: 5, }, { source: "Javert", target: "Thenardier", value: 5, }, { source: "Javert", target: "Mme.Thenardier", value: 1, }, { source: "Javert", target: "Cosette", value: 1, }, { source: "Fauchelevent", target: "Valjean", value: 8, }, { source: "Fauchelevent", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Fantine", value: 1, }, { source: "Bamatabois", target: "Javert", value: 1, }, { source: "Bamatabois", target: "Valjean", value: 2, }, { source: "Perpetue", target: "Fantine", value: 1, }, { source: "Simplice", target: "Perpetue", value: 2, }, { source: "Simplice", target: "Valjean", value: 3, }, { source: "Simplice", target: "Fantine", value: 2, }, { source: "Simplice", target: "Javert", value: 1, }, { source: "Scaufflaire", target: "Valjean", value: 1, }, { source: "Woman1", target: "Valjean", value: 2, }, { source: "Woman1", target: "Javert", value: 1, }, { source: "Judge", target: "Valjean", value: 3, }, { source: "Judge", target: "Bamatabois", value: 2, }, { source: "Champmathieu", target: "Valjean", value: 3, }, { source: "Champmathieu", target: "Judge", value: 3, }, { source: "Champmathieu", target: "Bamatabois", value: 2, }, { source: "Brevet", target: "Judge", value: 2, }, { source: "Brevet", target: "Champmathieu", value: 2, }, { source: "Brevet", target: "Valjean", value: 2, }, { source: "Brevet", target: "Bamatabois", value: 1, }, { source: "Chenildieu", target: "Judge", value: 2, }, { source: "Chenildieu", target: "Champmathieu", value: 2, }, { source: "Chenildieu", target: "Brevet", value: 2, }, { source: "Chenildieu", target: "Valjean", value: 2, }, { source: "Chenildieu", target: "Bamatabois", value: 1, }, { source: "Cochepaille", target: "Judge", value: 2, }, { source: "Cochepaille", target: "Champmathieu", value: 2, }, { source: "Cochepaille", target: "Brevet", value: 2, }, { source: "Cochepaille", target: "Chenildieu", value: 2, }, { source: "Cochepaille", target: "Valjean", value: 2, }, { source: "Cochepaille", target: "Bamatabois", value: 1, }, { source: "Pontmercy", target: "Thenardier", value: 1, }, { source: "Boulatruelle", target: "Thenardier", value: 1, }, { source: "Eponine", target: "Mme.Thenardier", value: 2, }, { source: "Eponine", target: "Thenardier", value: 3, }, { source: "Anzelma", target: "Eponine", value: 2, }, { source: "Anzelma", target: "Thenardier", value: 2, }, { source: "Anzelma", target: "Mme.Thenardier", value: 1, }, { source: "Woman2", target: "Valjean", value: 3, }, { source: "Woman2", target: "Cosette", value: 1, }, { source: "Woman2", target: "Javert", value: 1, }, { source: "MotherInnocent", target: "Fauchelevent", value: 3, }, { source: "MotherInnocent", target: "Valjean", value: 1, }, { source: "Gribier", target: "Fauchelevent", value: 2, }, { source: "Mme.Burgon", target: "Jondrette", value: 1, }, { source: "Gavroche", target: "Mme.Burgon", value: 2, }, { source: "Gavroche", target: "Thenardier", value: 1, }, { source: "Gavroche", target: "Javert", value: 1, }, { source: "Gavroche", target: "Valjean", value: 1, }, { source: "Gillenormand", target: "Cosette", value: 3, }, { source: "Gillenormand", target: "Valjean", value: 2, }, { source: "Magnon", target: "Gillenormand", value: 1, }, { source: "Magnon", target: "Mme.Thenardier", value: 1, }, { source: "Mlle.Gillenormand", target: "Gillenormand", value: 9, }, { source: "Mlle.Gillenormand", target: "Cosette", value: 2, }, { source: "Mlle.Gillenormand", target: "Valjean", value: 2, }, { source: "Mme.Pontmercy", target: "Mlle.Gillenormand", value: 1, }, { source: "Mme.Pontmercy", target: "Pontmercy", value: 1, }, { source: "Mlle.Vaubois", target: "Mlle.Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Mlle.Gillenormand", value: 2, }, { source: "Lt.Gillenormand", target: "Gillenormand", value: 1, }, { source: "Lt.Gillenormand", target: "Cosette", value: 1, }, { source: "Marius", target: "Mlle.Gillenormand", value: 6, }, { source: "Marius", target: "Gillenormand", value: 12, }, { source: "Marius", target: "Pontmercy", value: 1, }, { source: "Marius", target: "Lt.Gillenormand", value: 1, }, { source: "Marius", target: "Cosette", value: 21, }, { source: "Marius", target: "Valjean", value: 19, }, { source: "Marius", target: "Tholomyes", value: 1, }, { source: "Marius", target: "Thenardier", value: 2, }, { source: "Marius", target: "Eponine", value: 5, }, { source: "Marius", target: "Gavroche", value: 4, }, { source: "BaronessT", target: "Gillenormand", value: 1, }, { source: "BaronessT", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Marius", value: 1, }, { source: "Mabeuf", target: "Eponine", value: 1, }, { source: "Mabeuf", target: "Gavroche", value: 1, }, { source: "Enjolras", target: "Marius", value: 7, }, { source: "Enjolras", target: "Gavroche", value: 7, }, { source: "Enjolras", target: "Javert", value: 6, }, { source: "Enjolras", target: "Mabeuf", value: 1, }, { source: "Enjolras", target: "Valjean", value: 4, }, { source: "Combeferre", target: "Enjolras", value: 15, }, { source: "Combeferre", target: "Marius", value: 5, }, { source: "Combeferre", target: "Gavroche", value: 6, }, { source: "Combeferre", target: "Mabeuf", value: 2, }, { source: "Prouvaire", target: "Gavroche", value: 1, }, { source: "Prouvaire", target: "Enjolras", value: 4, }, { source: "Prouvaire", target: "Combeferre", value: 2, }, { source: "Feuilly", target: "Gavroche", value: 2, }, { source: "Feuilly", target: "Enjolras", value: 6, }, { source: "Feuilly", target: "Prouvaire", value: 2, }, { source: "Feuilly", target: "Combeferre", value: 5, }, { source: "Feuilly", target: "Mabeuf", value: 1, }, { source: "Feuilly", target: "Marius", value: 1, }, { source: "Courfeyrac", target: "Marius", value: 9, }, { source: "Courfeyrac", target: "Enjolras", value: 17, }, { source: "Courfeyrac", target: "Combeferre", value: 13, }, { source: "Courfeyrac", target: "Gavroche", value: 7, }, { source: "Courfeyrac", target: "Mabeuf", value: 2, }, { source: "Courfeyrac", target: "Eponine", value: 1, }, { source: "Courfeyrac", target: "Feuilly", value: 6, }, { source: "Courfeyrac", target: "Prouvaire", value: 3, }, { source: "Bahorel", target: "Combeferre", value: 5, }, { source: "Bahorel", target: "Gavroche", value: 5, }, { source: "Bahorel", target: "Courfeyrac", value: 6, }, { source: "Bahorel", target: "Mabeuf", value: 2, }, { source: "Bahorel", target: "Enjolras", value: 4, }, { source: "Bahorel", target: "Feuilly", value: 3, }, { source: "Bahorel", target: "Prouvaire", value: 2, }, { source: "Bahorel", target: "Marius", value: 1, }, { source: "Bossuet", target: "Marius", value: 5, }, { source: "Bossuet", target: "Courfeyrac", value: 12, }, { source: "Bossuet", target: "Gavroche", value: 5, }, { source: "Bossuet", target: "Bahorel", value: 4, }, { source: "Bossuet", target: "Enjolras", value: 10, }, { source: "Bossuet", target: "Feuilly", value: 6, }, { source: "Bossuet", target: "Prouvaire", value: 2, }, { source: "Bossuet", target: "Combeferre", value: 9, }, { source: "Bossuet", target: "Mabeuf", value: 1, }, { source: "Bossuet", target: "Valjean", value: 1, }, { source: "Joly", target: "Bahorel", value: 5, }, { source: "Joly", target: "Bossuet", value: 7, }, { source: "Joly", target: "Gavroche", value: 3, }, { source: "Joly", target: "Courfeyrac", value: 5, }, { source: "Joly", target: "Enjolras", value: 5, }, { source: "Joly", target: "Feuilly", value: 5, }, { source: "Joly", target: "Prouvaire", value: 2, }, { source: "Joly", target: "Combeferre", value: 5, }, { source: "Joly", target: "Mabeuf", value: 1, }, { source: "Joly", target: "Marius", value: 2, }, { source: "Grantaire", target: "Bossuet", value: 3, }, { source: "Grantaire", target: "Enjolras", value: 3, }, { source: "Grantaire", target: "Combeferre", value: 1, }, { source: "Grantaire", target: "Courfeyrac", value: 2, }, { source: "Grantaire", target: "Joly", value: 2, }, { source: "Grantaire", target: "Gavroche", value: 1, }, { source: "Grantaire", target: "Bahorel", value: 1, }, { source: "Grantaire", target: "Feuilly", value: 1, }, { source: "Grantaire", target: "Prouvaire", value: 1, }, { source: "MotherPlutarch", target: "Mabeuf", value: 3, }, { source: "Gueulemer", target: "Thenardier", value: 5, }, { source: "Gueulemer", target: "Valjean", value: 1, }, { source: "Gueulemer", target: "Mme.Thenardier", value: 1, }, { source: "Gueulemer", target: "Javert", value: 1, }, { source: "Gueulemer", target: "Gavroche", value: 1, }, { source: "Gueulemer", target: "Eponine", value: 1, }, { source: "Babet", target: "Thenardier", value: 6, }, { source: "Babet", target: "Gueulemer", value: 6, }, { source: "Babet", target: "Valjean", value: 1, }, { source: "Babet", target: "Mme.Thenardier", value: 1, }, { source: "Babet", target: "Javert", value: 2, }, { source: "Babet", target: "Gavroche", value: 1, }, { source: "Babet", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Thenardier", value: 4, }, { source: "Claquesous", target: "Babet", value: 4, }, { source: "Claquesous", target: "Gueulemer", value: 4, }, { source: "Claquesous", target: "Valjean", value: 1, }, { source: "Claquesous", target: "Mme.Thenardier", value: 1, }, { source: "Claquesous", target: "Javert", value: 1, }, { source: "Claquesous", target: "Eponine", value: 1, }, { source: "Claquesous", target: "Enjolras", value: 1, }, { source: "Montparnasse", target: "Javert", value: 1, }, { source: "Montparnasse", target: "Babet", value: 2, }, { source: "Montparnasse", target: "Gueulemer", value: 2, }, { source: "Montparnasse", target: "Claquesous", value: 2, }, { source: "Montparnasse", target: "Valjean", value: 1, }, { source: "Montparnasse", target: "Gavroche", value: 1, }, { source: "Montparnasse", target: "Eponine", value: 1, }, { source: "Montparnasse", target: "Thenardier", value: 1, }, { source: "Toussaint", target: "Cosette", value: 2, }, { source: "Toussaint", target: "Javert", value: 1, }, { source: "Toussaint", target: "Valjean", value: 1, }, { source: "Child1", target: "Gavroche", value: 2, }, { source: "Child2", target: "Gavroche", value: 2, }, { source: "Child2", target: "Child1", value: 3, }, { source: "Brujon", target: "Babet", value: 3, }, { source: "Brujon", target: "Gueulemer", value: 3, }, { source: "Brujon", target: "Thenardier", value: 3, }, { source: "Brujon", target: "Gavroche", value: 1, }, { source: "Brujon", target: "Eponine", value: 1, }, { source: "Brujon", target: "Claquesous", value: 1, }, { source: "Brujon", target: "Montparnasse", value: 1, }, { source: "Mme.Hucheloup", target: "Bossuet", value: 1, }, { source: "Mme.Hucheloup", target: "Joly", value: 1, }, { source: "Mme.Hucheloup", target: "Grantaire", value: 1, }, { source: "Mme.Hucheloup", target: "Bahorel", value: 1, }, { source: "Mme.Hucheloup", target: "Courfeyrac", value: 1, }, { source: "Mme.Hucheloup", target: "Gavroche", value: 1, }, { source: "Mme.Hucheloup", target: "Enjolras", value: 1, }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginFisheye/index.tsx ================================================ import React, { useEffect } from "react"; import F6, { ShapeStyle } from "../../src"; import data from "./data"; import { Fisheye } from "@antv/f6-plugin"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { let fisheye = new Fisheye({ r: 200, showLabel: true, trigger: "tap", scaleRBy: "drag", }); const colors = [ "#8FE9FF", "#87EAEF", "#FFC9E3", "#A7C2FF", "#FFA1E3", "#FFE269", "#BFCFEE", "#FFA0C5", "#D5FF86", ]; data.nodes.forEach((node: ShapeStyle) => { node.label = node.id; node.size = Math.random() * 30 + 10; node.style = { fill: colors[Math.floor(Math.random() * 9)], lineWidth: 0, }; }); graph = new F6.Graph({ container: ref.current, width, height, fitView: true, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [fisheye], }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginLegend/data.ts ================================================ const data = { nodes: [ { id: "1", label: "1:type1", legendType: "type1", }, { id: "2", label: "2:type2", legendType: "type2", }, { id: "3", label: "3:type1", legendType: "type1", }, { id: "4", label: "4:type3", legendType: "type3", }, ], edges: [ { source: "1", target: "2", legendType: "eType1", label: "1->2:edge-type1", }, { source: "1", target: "4", legendType: "eType3", label: "1->4:edge-type3", }, { source: "3", target: "4", }, { source: "2", target: "4", legendType: "eType1", label: "2->4:edge-type1", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginLegend/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import data from "./data"; import { Legend } from "@antv/f6-plugin"; const typeConfigs = { type1: { type: "circle", size: 5, style: { fill: "#5B8FF9", }, }, type2: { type: "circle", size: 20, style: { fill: "#5AD8A6", }, }, type3: { type: "rect", size: [10, 10], style: { fill: "#5D7092", }, }, eType1: { type: "line", style: { width: 20, stroke: "#F6BD16", }, }, eType2: { type: "cubic", }, eType3: { type: "quadratic", style: { width: 25, stroke: "#6F5EF9", }, }, }; data.nodes.forEach((node) => { if (!node.legendType) return; node = Object.assign(node, { ...typeConfigs[node.legendType] }); }); data.edges.forEach((edge) => { if (!edge.legendType) return; const config = typeConfigs[edge.legendType]; edge = Object.assign(edge, { ...config }); }); const legendData = { nodes: [ { id: "type1", label: "node-type1", order: 4, ...typeConfigs["type1"], }, { id: "type2", label: "node-type2", order: 0, ...typeConfigs["type2"], }, { id: "type3", label: "node-type3", order: 2, ...typeConfigs["type3"], }, ], edges: [ { id: "eType1", label: "edge-type1", order: 2, ...typeConfigs["eType1"], }, { id: "eType2", label: "edge-type2", ...typeConfigs["eType2"], }, { id: "eType3", label: "edge-type3", ...typeConfigs["eType3"], }, ], }; const legend = new Legend({ width: 300, height: 200, data: legendData, align: "center", layout: "vertical", // vertical position: "bottom-right", offsetY: 0, padding: 10, containerStyle: { fill: "#ccc", lineWidth: 1, }, title: "Legend", titleConfig: { position: "center", offsetX: 0, offsetY: 0, }, itemConfig: {}, filter: { enable: true, multiple: true, trigger: "click", graphActiveState: "activeByLegend", graphInactiveState: "inactiveByLegend", filterFunctions: { type1: (d) => { if (d.legendType === "type1") return true; return false; }, type2: (d) => { if (d.legendType === "type2") return true; return false; }, type3: (d) => { if (d.legendType === "type3") return true; return false; }, eType1: (d) => { if (d.legendType === "eType1") return true; return false; }, eType2: (d) => { if (d.legendType === "eType2") return true; return false; }, eType3: (d) => { if (d.legendType === "eType3") return true; return false; }, }, }, }); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, defaultNode: { size: [80, 40], type: "rect", }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [legend], nodeStateStyles: { activeByLegend: { lineWidth: 10, strokeOpacity: 0.5, }, inactiveByLegend: { opacity: 0.5, }, }, edgeStateStyles: { activeByLegend: { lineWidth: 3, }, inactiveByLegend: { opacity: 0.5, }, }, }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginMenu/data.ts ================================================ const data = { nodes: [ { id: "node1", label: "node1", x: 200, y: 100, type: "rect", }, { id: "node2", label: "node2", x: 250, y: 250, type: "rect", }, { id: "node3", label: "node3", x: 350, y: 100, type: "rect", }, ], edges: [ { source: "node1", target: "node2", label: "Test Label", }, { source: "node1", target: "node3", label: "Test Label 2", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginMenu/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import data from "./data"; import { Menu } from "@antv/f6-plugin"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { const contextMenu = new Menu({ getContent(evt) { let header; if (evt.target && evt.target.isCanvas && evt.target.isCanvas()) { header = "Canvas ContextMenu"; } else if (evt.item) { const itemType = evt.item.getType(); header = `${itemType.toUpperCase()} ContextMenu`; } return `
${header}
div 1
div 2
`; }, getCss: () => { return ` .container { opacity: 0.9; width: 150; padding: 10 8; border: 1 solid #e2e2e2; } .header { padding-bottom: 10; font-weight: bold; } .li { padding-bottom: 10; } `; }, handleMenuClick: (target, item) => { console.log(target, item); }, // offsetX and offsetY include the padding of the parent container // 需要加上父级容器的 padding-left 16 与自身偏移量 10 offsetX: 0, // 需要加上父级容器的 padding-top 24 、画布兄弟元素高度、与自身偏移量 10 offsetY: 0, // the types of items that allow the menu show up // 在哪些类型的元素上响应 itemTypes: ["node", "edge", "canvas"], }); if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, fitView: true, plugins: [contextMenu], defaultNode: { size: [80, 40], type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", lineAppendWidth: 3, // Enlarge the range the edge to be hitted }, labelCfg: { autoRotate: true, style: { // A white stroke with width 5 helps show the label more clearly avoiding the interference of the overlapped edge stroke: "white", lineWidth: 5, }, }, }, modes: { default: ["drag-node"], }, }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginMiniMap/data.ts ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginMiniMap/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import { MiniMap } from "@antv/f6-plugin/src"; import data from "./data"; const miniMap = new MiniMap(); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, layout: { type: "dagre", rankdir: "LR", align: "DL", nodesepFunc: () => 1, ranksepFunc: () => 1, }, defaultNode: { size: [80, 40], type: "rect", style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, }, defaultEdge: { style: { stroke: "#b5b5b5", lineAppendWidth: 3, }, }, modes: { default: ["drag-canvas", "zoom-canvas"], }, plugins: [miniMap], }); graph.data(data); graph.render(); } const handleZoom = (e) => { console.log(e); }; ref.current.addEventListener("wheel", handleZoom); return () => { ref.current.removeEventListener("wheel", handleZoom); }; }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginTooltip/data.ts ================================================ const data = { nodes: [ { id: "0", label: "node-0", x: 100, y: 100, description: "This is node-0.", subdescription: "This is subdescription of node-0.", }, { id: "1", label: "node-1", x: 250, y: 100, description: "This is node-1.", subdescription: "This is subdescription of node-1.", }, { id: "2", label: "node-2", x: 150, y: 310, description: "This is node-2.", subdescription: "This is subdescription of node-2.", }, { id: "3", label: "node-3", x: 320, y: 310, description: "This is node-3.", subdescription: "This is subdescription of node-3.", }, ], edges: [ { id: "e0", source: "0", target: "1", description: "This is edge from node 0 to node 1.", }, { id: "e1", source: "0", target: "2", description: "This is edge from node 0 to node 2.", }, { id: "e2", source: "0", target: "3", description: "This is edge from node 0 to node 3.", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginTooltip/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import data from "./data"; import { Tooltip } from "@antv/f6-plugin"; const tooltip = new Tooltip({ trigger: "press", offsetX: 0, offsetY: 0, // the types of items that allow the tooltip show up // 允许出现 tooltip 的 item 类型 itemTypes: ["node", "edge"], // custom the tooltip's content // 自定义 tooltip 内容 getContent: (e) => { // outDiv.style.padding = '0px 0px 20px 0px'; return `
Custom Content
Type: ${e.item.getType()}
Label: ${ e.item.getModel().label || e.item.getModel().id }
`; }, getCss: () => ` .f6-tooltip-container { position: absolute; width: 150; border: 1 solid #e2e2e2; border-radius: 4; font-size: 12; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10 8; } .f6-tooltip-container div{ height: 20; } .tooltip-type { padding: 0; margin: 0; } .tooltip-id { color: #531dab; } `, }); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, defaultNode: { size: [80, 40], type: "rect", }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [tooltip], }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/pluginZoomSlider/data.ts ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/f6/stories/pluginZoomSlider/index.tsx ================================================ import React, { useEffect } from "react"; import { ZoomSlider } from "@antv/f6-plugin"; import F6 from "../../src"; import data from "./data"; const zoomSlider = new ZoomSlider(); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [zoomSlider], }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/sceneCase/mindMap/data.ts ================================================ const rawData = { label: "Modeling Methods", id: "0", children: [ { label: "Classification", id: "0-1", color: "#5AD8A6", children: [ { label: "Logistic regression", id: "0-1-1", }, { label: "Linear discriminant analysis", id: "0-1-2", }, { label: "Rules", id: "0-1-3", }, { label: "Decision trees", id: "0-1-4", }, { label: "Naive Bayes", id: "0-1-5", }, { label: "K nearest neighbor", id: "0-1-6", }, { label: "Probabilistic neural network", id: "0-1-7", }, { label: "Support vector machine", id: "0-1-8", }, ], }, { label: "Consensus", id: "0-2", color: "#F6BD16", children: [ { label: "Models diversity", id: "0-2-1", children: [ { label: "Different initializations", id: "0-2-1-1", }, { label: "Different parameter choices", id: "0-2-1-2", }, { label: "Different architectures", id: "0-2-1-3", }, { label: "Different modeling methods", id: "0-2-1-4", }, { label: "Different training sets", id: "0-2-1-5", }, { label: "Different feature sets", id: "0-2-1-6", }, ], }, { label: "Methods", id: "0-2-2", children: [ { label: "Classifier selection", id: "0-2-2-1", }, { label: "Classifier fusion", id: "0-2-2-2", }, ], }, { label: "Common", id: "0-2-3", children: [ { label: "Bagging", id: "0-2-3-1", }, { label: "Boosting", id: "0-2-3-2", }, { label: "AdaBoost", id: "0-2-3-3", }, ], }, ], }, { label: "Regression", id: "0-3", color: "#269A99", children: [ { label: "Multiple linear regression", id: "0-3-1", }, { label: "Partial least squares", id: "0-3-2", }, { label: "Multi-layer feedforward neural network", id: "0-3-3", }, { label: "General regression neural network", id: "0-3-4", }, { label: "Support vector regression", id: "0-3-5", }, ], }, ], }; const dataTransform = (data_) => { const changeData = (d, level = 0, color) => { const data = { ...d, }; switch (level) { case 0: data.type = "dice-mind-map-root"; break; case 1: data.type = "dice-mind-map-sub"; break; default: data.type = "dice-mind-map-leaf"; break; } data.hover = false; if (color) { data.color = color; } if (level === 1 && !d.direction) { if (!d.direction) { data.direction = d.id.charCodeAt(d.id.length - 1) % 2 === 0 ? "right" : "left"; } } if (d.children) { data.children = d.children.map((child) => changeData(child, level + 1, data.color), ); } return data; }; return changeData(data_); }; const result = dataTransform(rawData); export default result; ================================================ FILE: packages/f6/stories/sceneCase/mindMap/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../../src"; import TreeGraph from "../../../src/extends/graph/treeGraph"; import data from "./data"; const { Util } = F6; F6.registerGraph("TreeGraph", TreeGraph); const colorArr = [ "#5B8FF9", "#5AD8A6", "#5D7092", "#F6BD16", "#6F5EF9", "#6DC8EC", "#D3EEF9", "#DECFEA", "#FFE0C7", "#1E9493", "#BBDEDE", "#FF99C3", "#FFE0ED", "#CDDDFD", "#CDF3E4", "#CED4DE", "#FCEBB9", "#D3CEFD", "#945FB9", "#FF9845", ]; const rawData = { label: "Modeling Methods", id: "0", children: [ { label: "Classification", id: "0-1", color: "#5AD8A6", children: [ { label: "Logistic regression", id: "0-1-1", }, { label: "Linear discriminant analysis", id: "0-1-2", }, { label: "Rules", id: "0-1-3", }, { label: "Decision trees", id: "0-1-4", }, { label: "Naive Bayes", id: "0-1-5", }, { label: "K nearest neighbor", id: "0-1-6", }, { label: "Probabilistic neural network", id: "0-1-7", }, { label: "Support vector machine", id: "0-1-8", }, ], }, { label: "Consensus", id: "0-2", color: "#F6BD16", children: [ { label: "Models diversity", id: "0-2-1", children: [ { label: "Different initializations", id: "0-2-1-1", }, { label: "Different parameter choices", id: "0-2-1-2", }, { label: "Different architectures", id: "0-2-1-3", }, { label: "Different modeling methods", id: "0-2-1-4", }, { label: "Different training sets", id: "0-2-1-5", }, { label: "Different feature sets", id: "0-2-1-6", }, ], }, { label: "Methods", id: "0-2-2", children: [ { label: "Classifier selection", id: "0-2-2-1", }, { label: "Classifier fusion", id: "0-2-2-2", }, ], }, { label: "Common", id: "0-2-3", children: [ { label: "Bagging", id: "0-2-3-1", }, { label: "Boosting", id: "0-2-3-2", }, { label: "AdaBoost", id: "0-2-3-3", }, ], }, ], }, { label: "Regression", id: "0-3", color: "#269A99", children: [ { label: "Multiple linear regression", id: "0-3-1", }, { label: "Partial least squares", id: "0-3-2", }, { label: "Multi-layer feedforward neural network", id: "0-3-3", }, { label: "General regression neural network", id: "0-3-4", }, { label: "Support vector regression", id: "0-3-5", }, ], }, ], }; F6.registerNode( "dice-mind-map-root", { jsx: (cfg) => { debugger; const width = Util.getTextSize(cfg.label, 16)[0] + 24; const stroke = cfg.style.stroke || "#096dd9"; const fill = cfg.style.fill; return ` ${ cfg.label } + `; }, getAnchorPoints() { return [ [0, 0.5], [1, 0.5], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-sub", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 14)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerNode( "dice-mind-map-leaf", { jsx: (cfg) => { const width = Util.getTextSize(cfg.label, 12)[0] + 24; const color = cfg.color || cfg.style.stroke; return ` ${ cfg.label } + - `; }, getAnchorPoints() { return [ [0, 0.965], [1, 0.965], ]; }, }, "single-node", ); F6.registerBehavior("dice-mindmap", { getEvents() { return { "node:tap": "clickNode", "node:dbltap": "editNode", }; }, clickNode(evt) { debugger; const model = evt.item.get("model"); const name = evt.target.get("action"); switch (name) { case "add": const newId = model.id + "-" + (((model.children || []).reduce((a, b) => { const num = Number(b.id.split("-").pop()); return a < num ? num : a; }, 0) || 0) + 1); evt.currentTarget.updateItem(evt.item, { children: (model.children || []).concat([ { id: newId, direction: newId.charCodeAt(newId.length - 1) % 2 === 0 ? "right" : "left", label: "New", type: "dice-mind-map-leaf", color: model.color || colorArr[Math.floor(Math.random() * colorArr.length)], }, ]), }); evt.currentTarget.layout(false); break; case "delete": const parent = evt.item.get("parent"); evt.currentTarget.updateItem(parent, { children: (parent.get("model").children || []).filter( (e) => e.id !== model.id, ), }); evt.currentTarget.layout(false); break; case "edit": break; default: return; } }, editNode(evt) { const item = evt.item; const model = item.get("model"); const { x, y } = item.calculateBBox(); const graph = evt.currentTarget; const realPosition = evt.currentTarget.getClientByPoint(x, y); const el = document.createElement("div"); const fontSizeMap = { "dice-mind-map-root": 24, "dice-mind-map-sub": 18, "dice-mind-map-leaf": 16, }; el.style.fontSize = fontSizeMap[model.type] + "px"; el.style.position = "fixed"; el.style.top = realPosition.y + "px"; el.style.left = realPosition.x + "px"; el.style.paddingLeft = "12px"; el.style.transformOrigin = "top left"; el.style.transform = `scale(${evt.currentTarget.getZoom()})`; const input = document.createElement("input"); input.style.border = "none"; input.value = model.label; input.style.width = Util.getTextSize(model.label, fontSizeMap[model.type])[0] + "px"; input.className = "dice-input"; el.className = "dice-input"; el.appendChild(input); document.body.appendChild(el); const destroyEl = () => { document.body.removeChild(el); }; const clickEvt = (event) => { if ( !( event.target && event.target.className && event.target.className.includes("dice-input") ) ) { window.removeEventListener("mousedown", clickEvt); window.removeEventListener("scroll", clickEvt); graph.updateItem(item, { label: input.value, }); graph.layout(false); graph.off("wheelZoom", clickEvt); destroyEl(); } }; graph.on("wheelZoom", clickEvt); window.addEventListener("mousedown", clickEvt); window.addEventListener("scroll", clickEvt); input.addEventListener("keyup", (event) => { if (event.key === "Enter") { clickEvt({ target: {}, }); } }); }, }); F6.registerBehavior("scroll-canvas", { getEvents: function getEvents() { return { wheel: "onWheel", }; }, onWheel: function onWheel(ev) { const { graph } = this; if (!graph) { return; } if (ev.ctrlKey) { const canvas = graph.get("canvas"); const point = canvas.getPointByClient(ev.clientX, ev.clientY); let ratio = graph.getZoom(); if (ev.wheelDelta > 0) { ratio += ratio * 0.05; } else { ratio *= ratio * 0.05; } graph.zoomTo(ratio, { x: point.x, y: point.y, }); } else { const x = ev.deltaX || ev.movementX; const y = ev.deltaY || ev.movementY || (-ev.wheelDelta * 125) / 3; graph.translate(-x, -y); } ev.preventDefault(); }, }); const dataTransform = (data) => { const changeData = (d, level = 0, color) => { const data = { ...d, }; switch (level) { case 0: data.type = "dice-mind-map-root"; break; case 1: data.type = "dice-mind-map-sub"; break; default: data.type = "dice-mind-map-leaf"; break; } data.hover = false; if (color) { data.color = color; } if (level === 1 && !d.direction) { if (!d.direction) { data.direction = d.id.charCodeAt(d.id.length - 1) % 2 === 0 ? "right" : "left"; } } if (d.children) { data.children = d.children.map((child) => changeData(child, level + 1, data.color), ); } return data; }; return changeData(data); }; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { // 创建F6实例 graph = new F6.TreeGraph({ container: ref.current, width, height, fitView: true, fitViewPadding: [10, 20], layout: { type: "mindmap", direction: "H", getHeight: () => { return 16; }, getWidth: (node) => { return node.level === 0 ? Util.getTextSize(node.label, 16)[0] + 12 : Util.getTextSize(node.label, 12)[0]; }, getVGap: () => { return 10; }, getHGap: () => { return 60; }, getSide: (node) => { return node.data.direction; }, }, defaultEdge: { type: "cubic-horizontal", style: { lineWidth: 2, }, }, minZoom: 0.5, modes: { default: ["drag-canvas", "zoom-canvas", "dice-mindmap"], }, }); graph.data(dataTransform(rawData)); graph.render(); graph.fitView(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/snapLine/data.ts ================================================ const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, { id: "3", label: "3", }, { id: "4", label: "4", }, { id: "5", label: "5", }, { id: "6", label: "6", }, { id: "7", label: "7", }, { id: "8", label: "8", }, { id: "9", label: "9", }, { id: "10", label: "10", }, { id: "11", label: "11", }, { id: "12", label: "12", }, { id: "13", label: "13", }, { id: "14", label: "14", }, { id: "15", label: "15", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "11", target: "14", }, { source: "12", target: "13", }, ], }; export default data; ================================================ FILE: packages/f6/stories/snapLine/index.tsx ================================================ import React, { useEffect } from "react"; import { SnapLine } from "@antv/f6-plugin"; import F6 from "../../src"; import data from "./data"; const snapLine = new SnapLine(); export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, linkCenter: true, defaultNode: { size: 30, }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, plugins: [snapLine], }); graph.data(data); graph.render(); } }, []); return
; }; ================================================ FILE: packages/f6/stories/uiTest/data.ts ================================================ export default { nodes: [ { id: "0", label: "0", cluster: "a", }, { id: "1", label: "1", cluster: "a", }, { id: "2", label: "2", cluster: "a", }, { id: "3", label: "3", cluster: "a", }, { id: "4", label: "4", cluster: "a", }, { id: "5", label: "5", cluster: "a", }, { id: "6", label: "6", cluster: "a", }, { id: "7", label: "7", cluster: "a", }, { id: "8", label: "8", cluster: "a", }, { id: "9", label: "9", cluster: "a", }, { id: "10", label: "10", cluster: "a", }, { id: "11", label: "11", cluster: "a", }, { id: "12", label: "12", cluster: "a", }, { id: "13", label: "13", cluster: "b", }, { id: "14", label: "14", cluster: "b", }, { id: "15", label: "15", cluster: "b", }, { id: "16", label: "16", cluster: "b", }, { id: "17", label: "17", cluster: "b", }, { id: "18", label: "18", cluster: "c", }, { id: "19", label: "19", cluster: "c", }, { id: "20", label: "20", cluster: "c", }, { id: "21", label: "21", cluster: "c", }, { id: "22", label: "22", cluster: "c", }, { id: "23", label: "23", cluster: "c", }, { id: "24", label: "24", cluster: "c", }, { id: "25", label: "25", cluster: "c", }, { id: "26", label: "26", cluster: "c", }, { id: "27", label: "27", cluster: "c", }, { id: "28", label: "28", cluster: "c", }, { id: "29", label: "29", cluster: "c", }, { id: "30", label: "30", cluster: "c", }, { id: "31", label: "31", cluster: "d", }, { id: "32", label: "32", cluster: "d", }, { id: "33", label: "33", cluster: "d", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, { source: "0", target: "3", }, { source: "0", target: "4", }, { source: "0", target: "5", }, { source: "0", target: "7", }, { source: "0", target: "8", }, { source: "0", target: "9", }, { source: "0", target: "10", }, { source: "0", target: "11", }, { source: "0", target: "13", }, { source: "0", target: "14", }, { source: "0", target: "15", }, { source: "0", target: "16", }, { source: "2", target: "3", }, { source: "4", target: "5", }, { source: "4", target: "6", }, { source: "5", target: "6", }, { source: "7", target: "13", }, { source: "8", target: "14", }, { source: "9", target: "10", }, { source: "10", target: "22", }, { source: "10", target: "14", }, { source: "10", target: "12", }, { source: "10", target: "24", }, { source: "10", target: "21", }, { source: "10", target: "20", }, { source: "11", target: "24", }, { source: "11", target: "22", }, { source: "11", target: "14", }, { source: "12", target: "13", }, { source: "16", target: "17", }, { source: "16", target: "18", }, { source: "16", target: "21", }, { source: "16", target: "22", }, { source: "17", target: "18", }, { source: "17", target: "20", }, { source: "18", target: "19", }, { source: "19", target: "20", }, { source: "19", target: "33", }, { source: "19", target: "22", }, { source: "19", target: "23", }, { source: "20", target: "21", }, { source: "21", target: "22", }, { source: "22", target: "24", }, { source: "22", target: "25", }, { source: "22", target: "26", }, { source: "22", target: "23", }, { source: "22", target: "28", }, { source: "22", target: "30", }, { source: "22", target: "31", }, { source: "22", target: "32", }, { source: "22", target: "33", }, { source: "23", target: "28", }, { source: "23", target: "27", }, { source: "23", target: "29", }, { source: "23", target: "30", }, { source: "23", target: "31", }, { source: "23", target: "33", }, { source: "32", target: "33", }, ], }; ================================================ FILE: packages/f6/stories/uiTest/index.tsx ================================================ import React, { useEffect } from "react"; import F6 from "../../src"; import { TimeBar } from "@antv/f6-plugin"; export default () => { const ref = React.useRef(null); const height = window.innerHeight - 32; // demos padding const width = window.innerWidth - 32; const data = { nodes: [], edges: [], }; for (let i = 0; i < 50; i++) { const id = `node-${i}`; data.nodes.push({ id, date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); data.edges.push({ source: `node-${Math.round(Math.random() * 90)}`, target: `node-${Math.round(Math.random() * 90)}`, }); } const timeBarData = []; for (let i = 0; i < 50; i++) { timeBarData.push({ date: Number(`2020${i}`), value: Math.round(Math.random() * 300), }); } let count = 0; const timebar = new TimeBar({ x: 0, y: 0, width, padding: 0, type: "simple", data: timeBarData, }); let graph = null; useEffect(() => { if (!graph) { graph = new F6.Graph({ container: ref.current, width, height, pixelRatio: 2, fitView: true, localRefresh: false, modes: { default: ["drag-canvas", "drag-node"], }, animate: false, defaultNode: { size: 30, }, plugins: [timebar], } as any); graph.get("canvas").set("localRefresh", false); graph.data(data); graph.render(); graph.fitView(); } }, []); return
; }; ================================================ FILE: packages/f6/vite.config.ts ================================================ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "src"), "@antv/f6": path.resolve(__dirname), "@antv/f6-ui": path.resolve(__dirname, "../f6-ui"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), // 入口文件 name: "f6", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/f6-alipay/CHANGELOG.md ================================================ ================================================ FILE: packages/f6-alipay/LICENSE ================================================ MIT License Copyright (c) 2021 openwayne Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: packages/f6-alipay/babel.config.js ================================================ module.exports = { presets: [ [ "@babel/preset-env", { loose: true, modules: false, }, ], "@babel/preset-typescript", ], plugins: [ "@babel/plugin-syntax-dynamic-import", "@babel/plugin-transform-runtime", ], }; ================================================ FILE: packages/f6-alipay/demo/app.acss ================================================ page { background-color: #f5f5f5; } ================================================ FILE: packages/f6-alipay/demo/app.js ================================================ App({ globalData: { // miniAliUiLang: 'en-US', }, onLaunch() {}, onShow() {}, onHide() {}, }); ================================================ FILE: packages/f6-alipay/demo/app.json ================================================ { "pages": [ "pages/native-test/native-test", "pages/g6/g6", "pages/native-canvas/index", "pages/native-test-fullpage/index", "pages/image/image" ], "window": { "enableWK": "YES", "enableDSL": "YES", "enableJSC": "YES", "defaultTitle": "F6组件测试", "backgroundColor": "#F5F5F9", "pullRefresh": false, "allowsBounceVertical": "NO" }, "debug": true } ================================================ FILE: packages/f6-alipay/demo/mini.project.json ================================================ { "component2": true, "axmlStrictCheck": true, "enableAppxNg": true, "enableNodeModuleBabelTransform": true, "exclude": ["dist/**/*"] } ================================================ FILE: packages/f6-alipay/demo/package.json ================================================ { "name": "demo", "version": "1.0.0", "description": "", "main": "app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@antv/g6-mobile": "^0.0.1-beta.14", "tslib": "2.3.0", "@antv/f6": "^0.0.13", "@antv/f6-ui": "1.0.0" } } ================================================ FILE: packages/f6-alipay/demo/pages/g6/g6.acss ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/g6/g6.axml ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/g6/g6.js ================================================ import { createUI } from "@antv/f6-ui/dist/f6GUI"; import F6 from "../../../../f6"; import forceLayout from "../../../../f6/dist/extends/layout/forceLayout"; F6.registerLayout("force", forceLayout); function test(group) { const html = `
ttt
testtesetsets
testtesetsets
testtesetsets
`; const css = ` #lll { width: 600; height: 200; display: flex; flexDirection: row; flex-wrap: nowrap; justify-content: flex-start; align-items: center; background: blue; color: black; border: 20 solid rgba(0,0,0,0.5); border-radius: 10; font-size: 24; } div { background: red; } .test { background: yellow; padding-left: 0; } #lll div{ margin-left: 10; text-align: left; width: 100; height: 100; } #lll div.real{ text-align: left; } shape { background: #ff00ff; top: 0; left: 0; width: 50; height: 50; text-align: center; } image { width: 50; height: 50; } `; // 样式解析计算,简写样式展开。 console.log(createUI); const ui = createUI(html, css, group); console.log("query", ui.query("#lll div.real")); console.log(ui); } function refreshDragedNodePosition(e) { const model = e.item.get("model"); model.fx = e.x; model.fy = e.y; } const data = { nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, { id: "node4", size: 30, isLeaf: true }, { id: "node5", size: 30, isLeaf: true }, { id: "node6", size: 15, isLeaf: true }, { id: "node7", size: 15, isLeaf: true }, { id: "node8", size: 15, isLeaf: true }, { id: "node9", size: 15, isLeaf: true }, { id: "node10", size: 15, isLeaf: true }, { id: "node11", size: 15, isLeaf: true }, { id: "node12", size: 15, isLeaf: true }, { id: "node13", size: 15, isLeaf: true }, { id: "node14", size: 15, isLeaf: true }, { id: "node15", size: 15, isLeaf: true }, { id: "node16", size: 15, isLeaf: true }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node0", target: "node4" }, { source: "node0", target: "node5" }, { source: "node1", target: "node6" }, { source: "node1", target: "node7" }, { source: "node2", target: "node8" }, { source: "node2", target: "node9" }, { source: "node2", target: "node10" }, { source: "node2", target: "node11" }, { source: "node2", target: "node12" }, { source: "node2", target: "node13" }, { source: "node3", target: "node14" }, { source: "node3", target: "node15" }, { source: "node3", target: "node16" }, ], }; Page({ data: { width: 500, height: 500, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { console.log(ctx, rect, canvas); this.graph = new F6.Graph({ context: ctx, renderer, width: this.data.width, height: this.data.height, fitView: true, layout: { type: "force", preventOverlap: true, linkDistance: (d) => { if (d.source.id === "node0") { return 100; } return 30; }, nodeStrength: (d) => { if (d.isLeaf) { return -50; } return -10; }, edgeStrength: (d) => { if ( d.source.id === "node1" || d.source.id === "node2" || d.source.id === "node3" ) { return 0.7; } return 0.1; }, onTick: () => { const nodeItems = this.graph.getNodes(); const height = this.graph.get("height"); const width = this.graph.get("width"); const padding = 10; nodeItems.forEach((item) => { const model = item.getModel(); if (model.x > width - padding) model.x = width - padding; else if (model.x < padding) model.x = padding; if (model.y > height - padding) model.y = height - padding; else if (model.y < padding) model.y = padding; }); }, }, defaultNode: { color: "#5B8FF9", }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.on("node:dragstart", (e) => { this.graph.layout(); refreshDragedNodePosition(e); }); this.graph.on("node:drag", (e) => { refreshDragedNodePosition(e); }); this.graph.on("node:dragend", (e) => { e.item.get("model").fx = null; e.item.get("model").fy = null; }); test(this.graph.get("uiGroup")); }, onTouch(e) { this.graph.emitEvent(e); }, }); ================================================ FILE: packages/f6-alipay/demo/pages/g6/g6.json ================================================ { "defaultTitle": "g6-native-canvas", "usingComponents": { "native-canvas": "../../../es/container/container" } } ================================================ FILE: packages/f6-alipay/demo/pages/image/image.acss ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/image/image.axml ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/image/image.js ================================================ import F6 from "../../../../f6"; const data = { nodes: [ { id: "node0", img: "https://yyb.gtimg.com/aiplat/page/product/visionimgidy/img/demo6-16a47e5d31.jpg?max_age=31536000", type: "image", size: 200, label: "AntV Team", labelCfg: { position: "bottom", }, // 裁剪图片配置 clipCfg: { show: false, type: "circle", r: 15, }, }, { id: "node1", img: "https://yyb.gtimg.com/aiplat/page/product/visionimgidy/img/demo6-16a47e5d31.jpg?max_age=31536000", type: "circle", size: 200, label: "AntV Team", labelCfg: { position: "bottom", }, }, ], edges: [{ source: "node0", target: "node1" }], }; Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { console.log(ctx, rect, canvas, renderer); this.graph = new F6.Graph({ context: ctx, renderer, width: this.data.width, height: this.data.height, extra: { createImage: canvas && canvas.createImage, }, defaultNode: { type: "image", label: "AntV Team", // 其他配置 }, modes: { default: ["drag-canvas", "drag-node", "zoom-canvas"], }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.on("panstart", (e) => { console.log("pan", e); }); this.graph.on("panmove", (e) => { console.log("pan move", e); }); this.graph.on("panend", (e) => { console.log("pan end", e); }); }, onTouch(e) { this.graph.emitEvent(e); }, }); ================================================ FILE: packages/f6-alipay/demo/pages/image/image.json ================================================ { "defaultTitle": "g6-native-canvas", "usingComponents": { "native-canvas": "../../../es/container/container" } } ================================================ FILE: packages/f6-alipay/demo/pages/native-canvas/index.acss ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/native-canvas/index.axml ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/native-canvas/index.js ================================================ Page({ data: { width: 500, height: 500, }, onLoad() { const { windowWidth, windowHeight } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, }); }, onCanvasInit(ctx, rect, canvas, renderer) { // ctx.fillStyle = '#000'; console.log(ctx, rect, canvas); ctx.fillStyle = `rgb(${12}, ${255}, ${44})`; ctx.beginPath(); ctx.arc(100, 100, 20, 0, 2 * Math.PI); ctx.fill(); ctx.save(); ctx.beginPath(); ctx.strokeStyle = "#108ee9"; ctx.rect(25, 25, 50, 50); ctx.stroke(); ctx.scale(2, 2); ctx.beginPath(); ctx.rect(25, 25, 50, 50); ctx.stroke(); ctx.restore(); if (renderer === "mini") { ctx.draw(); } }, onTouch(e) { console.log("canvas on touch", e); }, }); ================================================ FILE: packages/f6-alipay/demo/pages/native-canvas/index.json ================================================ { "defaultTitle": "native-canvas", "usingComponents": { "native-canvas": "../../../es/container/container" } } ================================================ FILE: packages/f6-alipay/demo/pages/native-test/native-test.acss ================================================ page { height: 1000px; } .container { display: flex; justify-content: center; align-items: center; } .canvas { border: 2px solid red; margin: 40px; width: 300px; height: 400px; } ================================================ FILE: packages/f6-alipay/demo/pages/native-test/native-test.axml ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/native-test/native-test.js ================================================ import F6 from "../../../../f6"; const data = { nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node1", target: "node3" }, { source: "node2", target: "node3" }, ], }; Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { pixelRatio } = my.getSystemInfoSync(); this.setData({ pixelRatio, }); }, onCanvasInit(ctx, rect, canvas, renderer) { console.log(ctx, rect, canvas); this.graph = new F6.Graph({ context: ctx, renderer, width: this.data.width, height: this.data.height, defaultNode: { color: "#5B8FF9", }, modes: { default: ["drag-canvas", "drag-node", "zoom-canvas"], }, extra: { createImage: canvas && canvas.createImage, }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); //水印的设置 const waterConfig = { image: { x: -15, y: 35, width: 156 / 2, height: 34 / 2, rotate: 30, }, }; const waterURL = "https://gw.alipayobjects.com/zos/bmw-prod/8088a9d7-e5b0-42f2-b6b2-27c823043993.svg"; this.graph.render(); const waterCanvas = my.createOffscreenCanvas(); this.graph.setImageWaterMarker(waterURL, waterConfig, waterCanvas); }, onTouch(e) { this.graph.emitEvent(e); }, }); ================================================ FILE: packages/f6-alipay/demo/pages/native-test/native-test.json ================================================ { "defaultTitle": "g6-native-canvas", "usingComponents": { "native-canvas": "../../../es/container/container" } } ================================================ FILE: packages/f6-alipay/demo/pages/native-test-fullpage/index.acss ================================================ page { height: 1000px; } .container { display: flex; justify-content: center; align-items: center; } ================================================ FILE: packages/f6-alipay/demo/pages/native-test-fullpage/index.axml ================================================ ================================================ FILE: packages/f6-alipay/demo/pages/native-test-fullpage/index.js ================================================ import F6 from "../../../../f6"; const data = { nodes: [ { id: "node0", size: 50 }, { id: "node1", size: 30 }, { id: "node2", size: 30 }, { id: "node3", size: 30 }, ], edges: [ { source: "node0", target: "node1" }, { source: "node0", target: "node2" }, { source: "node0", target: "node3" }, { source: "node1", target: "node3" }, { source: "node2", target: "node3" }, ], }; Page({ data: { width: 300, height: 400, pixelRatio: 1, }, onLoad() { const { windowWidth, windowHeight, pixelRatio } = my.getSystemInfoSync(); this.setData({ width: windowWidth, height: windowHeight, pixelRatio, }); }, onCanvasInit(ctx, rect, canvas) { console.log(ctx, rect, canvas); this.graph = new F6.Graph({ context: ctx, renderer: "mini-native", width: this.data.width, height: this.data.height, defaultNode: { color: "#5B8FF9", }, modes: { default: ["drag-canvas", "drag-node", "zoom-canvas"], }, }); const { nodes } = data; this.graph.data({ nodes, edges: data.edges.map((edge, i) => { edge.id = `edge${i}`; return Object.assign({}, edge); }), }); this.graph.render(); this.graph.on("panstart", (e) => { console.log("pan", e); }); this.graph.on("panmove", (e) => { console.log("pan move", e); }); this.graph.on("panend", (e) => { console.log("pan end", e); }); }, onTouch(e) { this.graph.emitEvent(e); }, }); ================================================ FILE: packages/f6-alipay/demo/pages/native-test-fullpage/index.json ================================================ { "defaultTitle": "g6-native-canvas", "usingComponents": { "native-canvas": "../../../es/container/container" } } ================================================ FILE: packages/f6-alipay/package.json ================================================ { "name": "@antv/f6-alipay", "version": "0.0.7", "description": "支付宝小程序F6组件", "files": [ "es" ], "keywords": [ "F6", "G6Mobile" ], "license": "MIT", "miniprogram": "es", "devDependencies": { "@babel/runtime": "^7.11.2", "@babel/core": "^7.6.4", "@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/plugin-transform-runtime": "^7.11.5", "@babel/preset-env": "^7.6.3", "@babel/preset-typescript": "^7.6.0", "alipay-style": "^0.1.0", "gulp": "^4.0.0", "gulp-babel": "^8.0.0", "gulp-clean-css": "^4.0.0", "gulp-if": "^2.0.2", "gulp-inject-envs": "^1.1.1", "gulp-less": "^4.0.1", "gulp-rename": "^1.2.3", "mini-types": "^0.0.1", "pre-commit": "^1.2.2" }, "dependencies": {}, "scripts": { "build": "NODE_ENV=production node scripts/compiler.js", "pub": "npm run build && node scripts/pub.js", "dev": "node scripts/compiler.js", "build:rpx": "NODE_ENV=production node scripts/compiler.js --rpx", "pub:rpx": "npm run build:rpx && node scripts/pub.js --rpx", "dev:rpx": "node scripts/compiler.js --rpx" }, "repository": "git@github.com:antvis/F6.git" } ================================================ FILE: packages/f6-alipay/scripts/compiler.js ================================================ const path = require("path"); const gulp = require("gulp"); const less = require("gulp-less"); const rename = require("gulp-rename"); const cleanCss = require("gulp-clean-css"); const babel = require("gulp-babel"); const gulpif = require("gulp-if"); const injectEnvs = require("gulp-inject-envs"); const isProduction = process.env.NODE_ENV === "production"; const dist = isProduction ? path.join(__dirname, "../es") : path.join(__dirname, "../demo/es"); const src = path.join(__dirname, "../src"); const extTypes = ["ts", "less", "json", "axml", "sjs"]; const isRpx = process.argv.splice(2)[0] === "--rpx"; const env = { jsUnitRpx: isRpx }; gulp.task("less", () => gulp .src(`${src}/**/*.less`) .pipe( less({ modifyVars: { "@pixelSize": isRpx ? "1rpx" : "0.5px", }, }), ) .on("error", (e) => console.error(e)) .pipe(gulpif(isProduction, cleanCss())) .pipe( rename({ extname: ".acss", }), ) .pipe(gulp.dest(dist)), ); gulp.task("ts", () => gulp .src(`${src}/**/*.ts`) .pipe(babel()) .pipe(injectEnvs(env)) .on("error", (err) => { console.log(err); }) .pipe(gulp.dest(dist)), ); gulp.task("json", () => gulp.src(`${src}/**/*.json`).pipe(gulp.dest(dist))); gulp.task("axml", () => gulp.src(`${src}/**/*.axml`).pipe(gulp.dest(dist))); gulp.task("sjs", () => gulp.src(`${src}/**/*.sjs`).pipe(gulp.dest(dist))); const build = gulp.series(...extTypes); build(); if (!isProduction) { extTypes.forEach((type) => { const watcher = gulp.watch(`${src}/**/*${type}`, gulp.series(type)); watcher.on("change", (event) => { console.log(`File ${event} was change`); }); watcher.on("add", (event) => { console.log(`File ${event} was add`); }); watcher.on("unlink", (event) => { console.log(`File ${event} was remove`); }); }); } ================================================ FILE: packages/f6-alipay/scripts/pub.js ================================================ const { execSync, spawn } = require("child_process"); const packageJson = require(`${process.cwd()}/package.json`); const { version } = packageJson; const runner = spawn("npm", ["publish"]); runner.on("close", () => { execSync(`git tag ${version}`); execSync(`git push origin ${version}:${version}`); execSync("git push origin master:master"); }); ================================================ FILE: packages/f6-alipay/src/container/container.axml ================================================ ================================================ FILE: packages/f6-alipay/src/container/container.json ================================================ { "component": true } ================================================ FILE: packages/f6-alipay/src/container/container.ts ================================================ Component({ data: { supportNative: !!my._createCanvas, waterStyle: "", finalPixelRatio: 1, }, props: { style: "", width: 100, height: 100, forceMini: false, pixelRatio: 1, onTouchEvent: () => {}, onInit: () => {}, onError: () => {}, waterMarker: null, updateEventOffsetFlag: null, }, didMount() { // pixel 向上取整,保持和g同样的规则 const pixelRatio = this.props.pixelRatio; const finalPixelRatio = pixelRatio >= 1 ? Math.ceil(pixelRatio) : 1; this.setData({ finalPixelRatio, }); if (!this.data.supportNative || this.props.forceMini) { this.onCanvasReady(); } }, didUpdate(prev) { if (prev.updateEventOffsetFlag !== this.props.updateEventOffsetFlag) { this.refreshOffset(); } }, methods: { onCanvasReady() { const canvasId = `f6-canvas-${this.$id}`; my.createSelectorQuery() .select(`#${canvasId}`) .boundingClientRect() .exec((ret) => { if (ret && ret[0]) { this.rect = ret[0]; } else { this.rect = { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, }; this.props.onError && this.props.onError(ret); } if (this.data.supportNative && !this.props.forceMini) { console.log("native support"); my._createCanvas({ id: canvasId, success: (canvas) => { this.ctx = canvas.getContext("2d"); this.props.onInit(this.ctx, ret[0], canvas, "mini-native"); }, }); } else { console.log("web support"); this.ctx = my.createCanvasContext(canvasId); this.props.onInit(this.ctx, ret[0], null, "mini"); } }); if (this.props.waterMarker && this.props.forceMini) { this.setData({ waterStyle: `background: url("${this.props.waterMarker}") repeat; background-size: 156px 34px;`, //这里面的url需不需要双引号? }); } }, ontouch(e) { const { target } = e; const ev: any = { ...e, changedTouches: [], touches: [], }; e.touches.forEach((touchEvent) => { ev.touches.push(modifyEvent(touchEvent, target, this.rect)); }); e.changedTouches.forEach((touchEvent) => { // 真实的x的位置为client的位置 + rect的位置 + ev.changedTouches.push(modifyEvent(touchEvent, target, this.rect)); }); this.props.onTouchEvent(ev); }, refreshOffset() { const canvasId = `f6-canvas-${this.$id}`; my.createSelectorQuery() .select(`#${canvasId}`) .boundingClientRect() .exec((ret) => { if (ret && ret[0]) { this.rect = ret[0]; } else { this.rect = { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, }; this.props.onError && this.props.onError(ret); } }); }, }, }); function modifyEvent(touchEvent, target, rect) { var x = touchEvent.pageX - rect.left; // target.offsetLeft; var y = touchEvent.pageY - rect.top; // target.offsetTop; return { x, y, identifier: touchEvent.identifier, clientX: x, clientY: y, pageX: x, pageY: y, }; } ================================================ FILE: packages/f6-rax/README.md ================================================ ## f6-rax ## Install ``` $ npm install @antv/f6-rax --save ``` ## Usage ``` import F6Rax from '@antv/f6-rax'; ``` ## API ### Props | 属性名 | 默认值 | 类型 | 是否必传 | 描述 | | --------------------- | ------ | -------------------- | -------- | -------------------------------------------- | | data | -- | {nodes:[],edges: []} | 是 | 图数据 | | width | --- | Number | 否 | canvas 的宽度,这个值是页面中组件的宽度 | | height | --- | Number | 否 | canvas 的高度,这个值是页面中组件的高度 | | handleClick | --- | ()=> {} | 否 | 点击事件回调函数 | | updateEventOffsetFlag | --- | false | 否 | 小程序中生效,当容器改变时,需手动更新该标志 | | config | --- | object | 否 | 参考f6的config参数 | ## Example ``` import { createElement } from 'rax'; import View from 'rax-view'; import F6Rax from '@antv/f6-rax'; export default function Home() { const data = { nodes: [ { id: '0', label: '0', }, { id: '1', label: '1', }, { id: '2', label: '2', }, ], edges: [ { source: '0', target: '1', }, { source: '0', target: '2', }, ], }; return ( ); } ``` ================================================ FILE: packages/f6-rax/build.json ================================================ { "type": "rax", "targets": ["web", "miniapp"], "plugins": ["build-plugin-component"], "enablePlatformLoader": true } ================================================ FILE: packages/f6-rax/demo/basic.md ================================================ --- title: Baisc order: 1 --- basic usage ```jsx import { createElement } from "rax"; import F6Rax from "@antv/f6-rax"; function App() { const data = { nodes: [ { id: "0", label: "0", }, { id: "1", label: "1", }, { id: "2", label: "2", }, ], edges: [ { source: "0", target: "1", }, { source: "0", target: "2", }, ], }; return ; } export default App; ``` ================================================ FILE: packages/f6-rax/package.json ================================================ { "name": "@antv/f6-rax", "version": "0.0.1", "description": "rax F6组件,支持H5和小程序端", "main": "lib/index.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "miniappConfig": { "main": "lib/miniapp/index", "main:wechat": "lib/wechat-miniprogram/index" }, "files": [ "build", "dist", "es", "lib" ], "keywords": [ "Rax", "rax-component" ], "scripts": { "start": "build-scripts start", "build": "", "build:rax": "build-scripts build", "eslint": "eslint --ext .js,.jsx,.ts,.tsx ./", "eslint:fix": "npm run eslint -- --fix", "stylelint": "stylelint \"**/*.{css,scss,less}\"", "lint": "npm run eslint && npm run stylelint", "prepublishOnly": "npm run build" }, "dependencies": { "@antv/f6": "^0.0.16", "@antv/f6-alipay": "^0.0.7", "@uni/element": "^1.0.9", "@uni/system-info": "^1.0.8", "rax-text": "^2.0.0", "rax-view": "^2.0.0", "rax": "^1.1.0", "universal-env": "^3.0.0" }, "devDependencies": { "@iceworks/spec": "^1.0.0", "@types/rax": "^1.0.0", "build-plugin-component": "^1.0.0", "build-scripts": "^1.1.1", "driver-universal": "^3.1.0", "rax-test-renderer": "^1.0.0", "stylelint": "^13.7.2" }, "componentConfig": { "name": "rax-example", "title": "示例组件", "category": "" }, "exports": { ".": { "default": "./es/index.js" }, "./*": "./*" }, "publishConfig": { "registry": "https://registry.npm.alibaba-inc.com" }, "license": "MIT", "homepage": "https://unpkg.com/@antv/f6-rax@0.0.1/build/index.html", "repository": "git@github.com:antvis/F6.git" } ================================================ FILE: packages/f6-rax/src/index.ali.tsx ================================================ import { createElement, useEffect, useRef } from "rax"; import View from "rax-view"; import F6 from "@antv/f6"; import NativeCanvas from "@antv/f6-alipay/es/container/container"; import force from "@antv/f6/dist/extends/layout/forceLayout"; import { getInfoSync } from "@uni/system-info"; import "./index.css"; const miniF6 = (props) => { const { data, config, handleClick = () => {}, updateEventOffsetFlag = false, width, height, } = props; const f6Chart = useRef(null); const { pixelRatio } = getInfoSync(); const renderChart = (config) => { if (window) { // 目前F6内部使用了getComputedStyle处理判断逻辑,rax注入了该函数,导致绘制错误,屏蔽掉 window.getComputedStyle = undefined; } F6.registerLayout("force", force); const chart = new F6.Graph({ fitView: true, pixelRatio: pixelRatio, layout: { type: "force", }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, ...config, }); chart.data(data); chart.get("canvas").set("localRefresh", false); chart.render(); chart.on("node:tap", handleClick); f6Chart.current = chart; }; const handleInit = (_ctx, ret, _canvas, _renderer) => { if (!_ctx || !_renderer) return; renderChart({ context: _ctx, container: _canvas, renderer: _renderer, width: width, height: height, ...config, }); }; useEffect(() => { if (data.nodes.length && f6Chart.current) { f6Chart.current.changeData(data); } }, [data]); return ( { f6Chart.current && f6Chart.current.emitEvent(e); }} onInit={handleInit} updateEventOffsetFlag={updateEventOffsetFlag} /> ); }; export default miniF6; ================================================ FILE: packages/f6-rax/src/index.css ================================================ .rax-demo-title { margin: 20rpx 0; font-weight: bold; font-size: 45rpx; } #f6-rax-container { width: 100%; height: 100%; } #f6-rax-mini-container { width: 100%; height: 100%; } ================================================ FILE: packages/f6-rax/src/index.tsx ================================================ import { createElement, useEffect, useRef } from "rax"; import View from "rax-view"; import F6 from "@antv/f6"; import force from "@antv/f6/dist/extends/layout/forceLayout"; import { getInfoSync } from "@uni/system-info"; import { isWeb } from "@uni/env"; import "./index.css"; const F6Chart = (props) => { const { data, config, handleClick = () => {}, width, height } = props; const f6Chart = useRef(null); const { pixelRatio } = getInfoSync(); const renderChart = (config) => { if (window) { // 目前F6内部使用了getComputedStyle处理判断逻辑,rax注入了该函数,导致绘制错误,屏蔽掉 window.getComputedStyle = undefined; } F6.registerLayout("force", force); const chart = new F6.Graph({ fitView: true, pixelRatio: pixelRatio, layout: { type: "force", }, modes: { default: ["drag-canvas", "zoom-canvas", "drag-node"], }, ...config, }); chart.data(data); chart.get("canvas").set("localRefresh", false); chart.render(); chart.on("node:tap", handleClick); f6Chart.current = chart; }; useEffect(() => { let query = { offsetWidth: 0, offsetHeight: 0 }; // bug: 不加判断会影响小程序代码 if (isWeb) { query = document.getElementById("f6-rax-container"); } renderChart({ container: "f6-rax-container", width: width || query.offsetWidth, height: height || query.offsetHeight, ...config, }); }, []); useEffect(() => { if (data.nodes.length && f6Chart.current) { f6Chart.current.changeData(data); } }, [data]); return ; }; export default F6Chart; ================================================ FILE: packages/f6-rax/tsconfig.json ================================================ { "compileOnSave": false, "buildOnSave": false, "compilerOptions": { "baseUrl": ".", "outDir": "build", "module": "esnext", "target": "es6", "jsx": "preserve", "jsxFactory": "createElement", "moduleResolution": "node", "allowSyntheticDefaultImports": true, "lib": ["es6", "dom"], "sourceMap": true, "allowJs": true, "rootDir": "./", "forceConsistentCasingInFileNames": true, "noImplicitReturns": true, "noImplicitThis": false, "noImplicitAny": false, "importHelpers": true, "strictNullChecks": false, "suppressImplicitAnyIndexErrors": true, "noUnusedLocals": true, "skipLibCheck": true, "paths": { "@/*": ["./src/*"], "rax-app": [".rax/index.ts"] } }, "include": ["src", ".rax"], "exclude": ["node_modules", "build", "public"] } ================================================ FILE: packages/f6-ui/package.json ================================================ { "name": "@antv/f6-ui", "version": "1.0.3", "description": "UI system for @antv/f6", "keywords": [ "antv", "f6", "graph", "graph analysis", "graph editor", "graph visualization", "relational data" ], "repository": { "type": "git", "url": "git+https://github.com/antvis/F6.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "files": [ "package.json", "es", "lib", "dist", "LICENSE", "README.md" ], "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "browser": "dist/umd/index.umd.js", "miniprogram": "dist", "types": "lib/index.d.ts", "bugs": { "url": "https://github.com/antvis/F6/issues" }, "homepage": "https://github.com/antvis/F6#readme", "scripts": { "clean": "rimraf dist", "build": "vite build" }, "dependencies": { "@antv/g-base": "~0.5.16", "@antv/g-mobile": "^0.0.13", "css-layout": "1.1.1" }, "devDependencies": { "vite": "~5.3.1", "@vitejs/plugin-react": "~4.3.1" } } ================================================ FILE: packages/f6-ui/src/index.ts ================================================ import htmlParse from "./om/dom"; import cssParse from "./om/css"; import styleParse from "./om/style"; import { createUINode } from "./ui-node"; import { registerUINode } from "./ui-node"; import { registerAttr } from "./parser/attr-parser"; import UIBaseNode from "./ui-node/base"; function createUI(htmlString, cssString, group) { const tree = create(htmlString, cssString, true); tree.manualMount(group); return tree; } function createSegmentNode(htmlString, cssString, group?) { const tree = create(htmlString, cssString, false); if (group) tree.manualMount(group); return tree; } function create(htmlString, cssString, isNeedRoot = false) { const dom = htmlParse(htmlString, isNeedRoot); const cssTree = cssParse(cssString); const styleTree = styleParse(dom, cssTree); const tree = createUINode(styleTree.dom.tagName, styleTree); // 创建ui节点 const stack = [[styleTree, tree]]; while (stack.length) { const [node, parent] = stack.pop(); for (let child of node.originChildren) { const uiNode = createUINode(child.dom.tagName, child); parent.children.push(uiNode); uiNode.setParent(parent); stack.push([child, uiNode]); } } return tree; } const f6ui = { UIBaseNode, createUI, registerUINode, registerAttr, createSegmentNode, }; export default f6ui; export { UIBaseNode, createUI, registerUINode, registerAttr, createSegmentNode, }; ================================================ FILE: packages/f6-ui/src/om/css.ts ================================================ // https://github.com/reworkcss/css var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; function parse(css, options?) { options = options || {}; /** * Positional. */ var lineno = 1; var column = 1; /** * Update lineno and column based on `str`. */ function updatePosition(str) { var lines = str.match(/\n/g); if (lines) lineno += lines.length; var i = str.lastIndexOf("\n"); column = ~i ? str.length - i : column + str.length; } /** * Mark position and patch `node.position`. */ function position() { var start = { line: lineno, column: column }; return function (node) { node.position = new Position(start); whitespace(); return node; }; } /** * Store position information for a node */ function Position(start) { this.start = start; this.end = { line: lineno, column: column }; this.source = options.source; } /** * Non-enumerable source string */ Position.prototype.content = css; /** * Error `msg`. */ var errorsList = []; function error(msg) { var err: any = new Error( options.source + ":" + lineno + ":" + column + ": " + msg, ); err.reason = msg; err.filename = options.source; err.line = lineno; err.column = column; err.source = css; if (options.silent) { errorsList.push(err); } else { throw err; } } /** * Parse stylesheet. */ function stylesheet() { var rulesList = rules(); return { type: "stylesheet", stylesheet: { source: options.source, rules: rulesList, parsingErrors: errorsList, }, }; } /** * Opening brace. */ function open() { return match(/^{\s*/); } /** * Closing brace. */ function close() { return match(/^}/); } /** * Parse ruleset. */ function rules() { var node; var rules = []; whitespace(); comments(rules); while (css.length && css.charAt(0) != "}" && (node = atrule() || rule())) { if (node !== false) { rules.push(node); comments(rules); } } return rules; } /** * Match `re` and return captures. */ function match(re) { var m = re.exec(css); if (!m) return; var str = m[0]; updatePosition(str); css = css.slice(str.length); return m; } /** * Parse whitespace. */ function whitespace() { match(/^\s*/); } /** * Parse comments; */ function comments(rules?) { var c; rules = rules || []; while ((c = comment())) { if (c !== false) { rules.push(c); } } return rules; } /** * Parse comment. */ function comment() { var pos = position(); if ("/" != css.charAt(0) || "*" != css.charAt(1)) return; var i = 2; while ( "" != css.charAt(i) && ("*" != css.charAt(i) || "/" != css.charAt(i + 1)) ) ++i; i += 2; if ("" === css.charAt(i - 1)) { return error("End of comment missing"); } var str = css.slice(2, i - 2); column += 2; updatePosition(str); css = css.slice(i); column += 2; return pos({ type: "comment", comment: str, }); } /** * Parse selector. */ function selector() { var m = match(/^([^{]+)/); if (!m) return; /* @fix Remove all comments from selectors * http://ostermiller.org/findcomment.html */ return trim(m[0]) .replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "") .replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) { return m.replace(/,/g, "\u200C"); }) .split(/\s*(?![^(]*\)),\s*/) .map(function (s) { return s.replace(/\u200C/g, ","); }); } /** * Parse declaration. */ function declaration() { var pos = position(); // prop var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/); if (!prop) return; prop = trim(prop[0]); // : if (!match(/^:\s*/)) return error("property missing ':'"); // val var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/); var ret = pos({ type: "declaration", property: prop.replace(commentre, ""), value: val ? trim(val[0]).replace(commentre, "") : "", }); // ; match(/^[;\s]*/); return ret; } /** * Parse declarations. */ function declarations() { var decls = []; if (!open()) return error("missing '{'"); comments(decls); // declarations var decl; while ((decl = declaration())) { if (decl !== false) { decls.push(decl); comments(decls); } } if (!close()) return error("missing '}'"); return decls; } /** * Parse keyframe. */ function keyframe() { var m; var vals = []; var pos = position(); while ((m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/))) { vals.push(m[1]); match(/^,\s*/); } if (!vals.length) return; return pos({ type: "keyframe", values: vals, declarations: declarations(), }); } /** * Parse keyframes. */ function atkeyframes() { var pos = position(); var m = match(/^@([-\w]+)?keyframes\s*/); if (!m) return; var vendor = m[1]; // identifier var m = match(/^([-\w]+)\s*/); if (!m) return error("@keyframes missing name"); var name = m[1]; if (!open()) return error("@keyframes missing '{'"); var frame; var frames = comments(); while ((frame = keyframe())) { frames.push(frame); frames = frames.concat(comments()); } if (!close()) return error("@keyframes missing '}'"); return pos({ type: "keyframes", name: name, vendor: vendor, keyframes: frames, }); } /** * Parse supports. */ function atsupports() { var pos = position(); var m = match(/^@supports *([^{]+)/); if (!m) return; var supports = trim(m[1]); if (!open()) return error("@supports missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@supports missing '}'"); return pos({ type: "supports", supports: supports, rules: style, }); } /** * Parse host. */ function athost() { var pos = position(); var m = match(/^@host\s*/); if (!m) return; if (!open()) return error("@host missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@host missing '}'"); return pos({ type: "host", rules: style, }); } /** * Parse media. */ function atmedia() { var pos = position(); var m = match(/^@media *([^{]+)/); if (!m) return; var media = trim(m[1]); if (!open()) return error("@media missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@media missing '}'"); return pos({ type: "media", media: media, rules: style, }); } /** * Parse custom-media. */ function atcustommedia() { var pos = position(); var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/); if (!m) return; return pos({ type: "custom-media", name: trim(m[1]), media: trim(m[2]), }); } /** * Parse paged media. */ function atpage() { var pos = position(); var m = match(/^@page */); if (!m) return; var sel = selector() || []; if (!open()) return error("@page missing '{'"); var decls = comments(); // declarations var decl; while ((decl = declaration())) { decls.push(decl); decls = decls.concat(comments()); } if (!close()) return error("@page missing '}'"); return pos({ type: "page", selectors: sel, declarations: decls, }); } /** * Parse document. */ function atdocument() { var pos = position(); var m = match(/^@([-\w]+)?document *([^{]+)/); if (!m) return; var vendor = trim(m[1]); var doc = trim(m[2]); if (!open()) return error("@document missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@document missing '}'"); return pos({ type: "document", document: doc, vendor: vendor, rules: style, }); } /** * Parse font-face. */ function atfontface() { var pos = position(); var m = match(/^@font-face\s*/); if (!m) return; if (!open()) return error("@font-face missing '{'"); var decls = comments(); // declarations var decl; while ((decl = declaration())) { decls.push(decl); decls = decls.concat(comments()); } if (!close()) return error("@font-face missing '}'"); return pos({ type: "font-face", declarations: decls, }); } /** * Parse import */ var atimport = _compileAtrule("import"); /** * Parse charset */ var atcharset = _compileAtrule("charset"); /** * Parse namespace */ var atnamespace = _compileAtrule("namespace"); /** * Parse non-block at-rules */ function _compileAtrule(name) { var re = new RegExp("^@" + name + "\\s*([^;]+);"); return function () { var pos = position(); var m = match(re); if (!m) return; var ret = { type: name }; ret[name] = m[1].trim(); return pos(ret); }; } /** * Parse at rule. */ function atrule() { if (css[0] != "@") return; return ( atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface() ); } /** * Parse rule. */ function rule() { var pos = position(); var sel = selector(); if (!sel) return error("selector missing"); comments(); return pos({ type: "rule", selectors: sel, declarations: declarations(), }); } return addParent(stylesheet()); } /** * Trim `str`. */ function trim(str) { return str ? str.replace(/^\s+|\s+$/g, "") : ""; } /** * Adds non-enumerable parent node reference to each node. */ function addParent(obj, parent?) { var isNode = obj && typeof obj.type === "string"; var childParent = isNode ? obj : parent; for (var k in obj) { var value = obj[k]; if (Array.isArray(value)) { value.forEach(function (v) { addParent(v, childParent); }); } else if (value && typeof value === "object") { addParent(value, childParent); } } if (isNode) { Object.defineProperty(obj, "parent", { configurable: true, writable: true, enumerable: false, value: parent || null, }); } return obj; } export default parse; ================================================ FILE: packages/f6-ui/src/om/dom.ts ================================================ import { parseAttr } from "../parser/attr-parser"; class Node { type = ""; tagName = ""; attrs = {}; children = []; text = ""; } class Helper { input = ""; index = 0; constructor(input) { this.input = input; } stepNext() { this.index++; } cur() { return this.input[this.index]; } twoChar() { return this.input[this.index] + this.input[this.index + 1]; } stepWhile(test) { let s = ""; while ( this.index < this.input.length && test && test(this.input[this.index]) ) { s += this.input[this.index++]; } return s; } skipWhiteSpace() { this.stepWhile((letter) => /\s/.test(letter)); } getText() { return this.stepWhile((letter) => /[a-zA-Z0-9_]/.test(letter)); } eof() { return this.index >= this.input.length; } } class HtmlParser { helper: Helper; constructor(input) { this.helper = new Helper(input); } parse() { return this.parseNodes(); } parseNodes() { const nodes = []; while (true) { nodes.push(this.parseNode()); this.helper.skipWhiteSpace(); if (this.helper.eof() || this.helper.twoChar() === "") { this.helper.stepNext(); this.helper.stepNext(); return node; } // 非自闭 if (this.helper.cur() !== ">") throw new Error("解析标签开始失败"); this.helper.stepNext(); this.helper.skipWhiteSpace(); // 排除空标签 if (this.helper.twoChar() !== "") throw new Error("解析标签结束失败"); this.helper.stepNext(); return node; } parseTextNode() { const node = new Node(); const text = this.helper.stepWhile((s) => /[^<]/.test(s)); node.type = "text"; node.tagName = "text"; node.text = text; return node; } parseAttributes() { let attrs = {}; this.helper.skipWhiteSpace(); while ( !this.helper.eof() && this.helper.cur() !== ">" && this.helper.twoChar() !== "/>" ) { const name = this.helper.stepWhile((letter) => /[^\s=]/.test(letter)); this.helper.skipWhiteSpace(); this.helper.stepNext(); this.helper.skipWhiteSpace(); let value = ""; if (this.helper.cur() === '"') { this.helper.stepNext(); value = this.helper.stepWhile((letter) => /[^"]/.test(letter)); this.helper.stepNext(); } else if (this.helper.cur() === "'") { this.helper.stepNext(); value = this.helper.stepWhile((letter) => /[^']/.test(letter)); this.helper.stepNext(); } else { value = this.helper.stepWhile((letter) => /[^\s/]/.test(letter)); } attrs[name] = parseAttr(name, value); this.helper.skipWhiteSpace(); } return attrs; } removeQuote(value) { let result = value; if (/^["']/.test(result[0])) { result = result.slice(1); } if (/["']$/.test(result[result.length - 1])) { result = result.slice(0, -1); } return result; } } export default function parser(html, isNeedRoot = true) { const nodes = new HtmlParser(html).parse(); let rootNode = nodes[0]; if (nodes[0]?.tagName !== "root" && isNeedRoot) { rootNode = new Node(); rootNode.tagName = "root"; rootNode.children = nodes; } return rootNode; } ================================================ FILE: packages/f6-ui/src/om/style.ts ================================================ import { parseAttr } from "../parser/attr-parser"; import { isSelectorMatchDom, selectorToArr, walkDomSelector, } from "../utils/index"; export class StyleNode { dom = null; style = null; children = []; originChildren = []; } const defaultStyle = { "font-family": "serif", }; const inheritAttr = [ "font", "fontFamily", "fontWeight", "fontSize", "fontVariant", "fontStretch", "textIndent", "textAlign", "textShadow", "lineHeight", "color", "direction", "wordSpacing", "letterSpacing", "textTransform", "captionSide", "borderCollapse", "emptyCells", "listStyleType", "listStyleImage", "listStylePosition", "listStyle", "visibility", "cursor", ]; class StyleParser { domTree = null; cssTree = null; rulesHash = { ids: {}, classes: {}, tagNames: {}, }; constructor(domTree, cssTree) { this.domTree = domTree; this.cssTree = cssTree; } parse() { this.parseRulesHash(this.cssTree); return this.genStyleTree(this.domTree); } parseRulesHash(rules) { const rulesHash = this.rulesHash; for (let rule of rules.stylesheet.rules) { // 处理keyframe等 if (rule.type !== "rule") continue; for (let selector of rule.selectors) { const keySeletor = this.genKeySelector(selector); switch (keySeletor[0]) { case "#": const key = keySeletor.slice(1); rulesHash.ids[key] = [ ...(rulesHash.ids[key] || []), { selector, specificity: this.genSpecificity(selector), style: this.genStyleFromRule(rule), }, ]; break; case ".": const classKey = keySeletor.slice(1); rulesHash.classes[classKey] = [ ...(rulesHash.classes[classKey] || []), { selector, specificity: this.genSpecificity(selector), style: this.genStyleFromRule(rule), }, ]; break; default: rulesHash.tagNames[keySeletor] = [ ...(rulesHash.tagNames[keySeletor] || []), { selector, specificity: this.genSpecificity(selector), style: this.genStyleFromRule(rule), }, ]; break; } } } } genStyleTree(root) { const rootStyleNode = new StyleNode(); // 遍历doms const stack = [[root, [], rootStyleNode]]; while (stack.length) { const [node, path, rootStyleNode, parentStyleNode] = stack.pop(); rootStyleNode.dom = node; rootStyleNode.style = this.computeCSS(node, path, parentStyleNode?.style); // dom 查找样式并合并 for (let child of node.children) { let styleNode = new StyleNode(); rootStyleNode.originChildren.push(styleNode); stack.push([child, [...path, node], styleNode, rootStyleNode]); } } return rootStyleNode; } genSpecificity(selector) { const idCount = selector.match(/#\w+/g)?.length || 0; const classCount = selector.match(/\.\w+/g)?.length || 0; const arr = selector.split(/\s+|#|\./).filter((s) => s !== ""); const tagCount = arr.length - idCount - classCount; return idCount * 100 + classCount * 10 + tagCount; } genKeySelector(ruleSel) { const selector = selectorToArr(ruleSel, /\s/).pop(); let matchs = selector.match(/(#[^\.#]+)/); if (matchs?.length > 0) return matchs[0]; matchs = selector.match(/\.[^\.#]+/); if (matchs?.length > 0) return matchs[0]; return selector; } genStyleFromRule(rule) { return this.genStyleFromDeclaration(rule.declarations); } genStyleFromDeclaration(declarations) { const style = {}; declarations.forEach((dn) => { let value = dn.value; style[dn.property] = value; }); return style; } computeCSS(dom, path, parentStyle) { // 从hash表中拿到匹配的rules const filteredRules = []; walkDomSelector(dom, (keyName, selector) => { switch (keyName) { case "id": filteredRules.push(...(this.rulesHash.ids[selector] || [])); break; case "class": filteredRules.push(...(this.rulesHash.classes[selector] || [])); break; case "tagName": filteredRules.push(...(this.rulesHash.tagNames[selector] || [])); default: break; } }); // 再根据路径筛选一次, 每条rule和dom的path去对比 const finaleRules = filteredRules.filter((rule) => { // 判断selector是否和路径匹配, const ruleSelectors = selectorToArr(rule.selector, /\s+/g); // 逆序判断每个子选择器 let lastSelMatch = ruleSelectors.length - 2; let lastDomMatch = path.length - 1; let result = true; for (; lastSelMatch > -1; lastSelMatch--) { let isMatch = false; for (; lastDomMatch > -1; lastDomMatch--) { // 不断取节点去匹配选择器 const dom = path[lastDomMatch]; // 路径中该节点匹配命中,准备匹配下个 if (isSelectorMatchDom(dom, ruleSelectors[lastSelMatch])) { isMatch = true; break; } } if (!isMatch) { result = false; break; } } return result; }); // 根据优先级排序 finaleRules.sort((a, b) => a.specificity - b.specificity); // 按顺序合并style,高优先级覆盖 const finalStyle = finaleRules.reduce( (prev, cur) => Object.assign(prev, cur.style), { ...defaultStyle, }, ); // 解析属性值/属性转驼峰 let jsStyle = {}; for (let [key, value] of Object.entries(finalStyle)) { const camel = key .split("-") .map((s, index) => { if (index > 0) { return `${s[0].toUpperCase()}${s.slice(1)}`; } return s; }) .join(""); const parsedValue = parseAttr(key, value); if (typeof parsedValue === "object") { jsStyle = { ...jsStyle, ...parsedValue }; } else { jsStyle[camel] = parsedValue; } } if (parentStyle) { // 处理继承属性 for (let [key, value] of Object.entries(jsStyle)) { if (value === "inherit" && inheritAttr.includes(key)) { delete jsStyle[key]; if (parentStyle[key] !== undefined) { jsStyle[key] = parentStyle[key]; } } } for (let [key, value] of Object.entries(parentStyle)) { if (inheritAttr.includes(key) && !jsStyle[key]) { jsStyle[key] = value; } } } return jsStyle; } } export default function (dom, css) { return new StyleParser(dom, css).parse(); } ================================================ FILE: packages/f6-ui/src/parser/attr-parser.ts ================================================ import { isColor, typeParser } from "../utils/parser"; const attributesMap = {}; export function registerAttr(attr, parser: Function) { if (!attr) return; let arr = attr; if (!Array.isArray(arr)) arr = [arr]; arr.forEach((attr) => { if (typeof parser === "function") { attributesMap[attr] = parser; } else { attributesMap[attr] = typeParser; } }); } const boxParser = function (type, value) { const style = {}; const arr = value.split(/\s/g).filter((s) => s !== ""); if (arr.length === 1 && !isNaN(arr[0])) { style[`${type}`] = Number(arr[0]); } if (arr.length === 2) { !isNaN(Number(arr[0])) && (style[`${type}Bottom`] = style[`${type}Top`] = Number(arr[0])); !isNaN(Number(arr[1])) && (style[`${type}Left`] = style[`${type}Right`] = Number(arr[1])); } if (arr.length === 3) { !isNaN(Number(arr[0])) && (style[`${type}Top`] = Number(arr[0])); !isNaN(Number(arr[1])) && (style[`${type}Left`] = style[`${type}Right`] = Number(arr[1])); !isNaN(Number(arr[2])) && (style[`${type}Bottom`] = Number(arr[2])); } if (arr.length === 4) { !isNaN(Number(arr[0])) && (style[`${type}Top`] = Number(arr[0])); !isNaN(Number(arr[1])) && (style[`${type}Right`] = Number(arr[1])); !isNaN(Number(arr[2])) && (style[`${type}Bottom`] = Number(arr[2])); !isNaN(Number(arr[3])) && (style[`${type}Left`] = Number(arr[3])); } return style; }; const borderRadiusParser = function (value) { const style = {}; const arr = value.split(/\s/g).filter((s) => s !== ""); if (arr.length === 1 && !isNaN(arr[0])) { style[`borderTopLeftRadius`] = Number(arr[0]); style[`borderTopRightRadius`] = Number(arr[0]); style[`borderBottomRightRadius`] = Number(arr[0]); style[`borderBottomLeftRadius`] = Number(arr[0]); } if (arr.length === 2) { !isNaN(Number(arr[0])) && (style[`borderTopLeftRadius`] = style[`borderBottomRightRadius`] = Number(arr[0])); !isNaN(Number(arr[2])) && (style[`borderBottomLeftRadius`] = style[`borderTopRightRadius`] = Number(arr[1])); } if (arr.length === 3) { !isNaN(Number(arr[0])) && (style[`borderTopLeftRadius`] = Number(arr[0])); !isNaN(Number(arr[1])) && (style[`borderBottomLeftRadius`] = style[`borderTopRightRadius`] = Number(arr[1])); !isNaN(Number(arr[2])) && (style[`borderBottomRightRadius`] = Number(arr[2])); } if (arr.length === 4) { !isNaN(Number(arr[0])) && (style[`borderTopLeftRadius`] = Number(arr[0])); !isNaN(Number(arr[1])) && (style[`borderTopRightRadius`] = Number(arr[1])); !isNaN(Number(arr[2])) && (style[`borderBottomRightRadius`] = Number(arr[2])); !isNaN(Number(arr[3])) && (style[`borderBottomLeftRadius`] = Number(arr[3])); } return style; }; const backgroundParser = function (value) { const style = {}; const arr = value.split(/\s/g).filter((s) => s !== ""); for (value of arr) { if (isColor(value)) { style["backgroundColor"] = value; } else if (value?.startsWith("url")) { const match = value.match(/url\((.+?)\)/); match && (style["backgroundImage"] = match[1]); } } return style; }; const borders = ["solid", "dashed"]; const borderParser = function (value) { const style = {}; const arr = value.split(/\s/g).filter((s) => s !== ""); for (const value of arr) { if (!isNaN(Number(value))) { style["borderWidth"] = Number(value); } else if (isColor(value)) { style["borderColor"] = value; } else if (borders.includes(value)) { style["borderStyle"] = value; } } return style; }; const shadowParser = function (value) { const style = {}; const arr = value.split(/\s/g).filter((s) => s !== ""); const propers = [ "shadowOffsetX", "shadowOffsetY", "shadowBlur", "shadowColor", ]; while (arr.length) { const value = arr.shift(); if (!isNaN(Number(value))) { const key = propers.shift(); style[key] = Number(value); continue; } else if (isColor(value)) { style["shadowColor"] = value; } } return style; }; registerAttr("padding", boxParser.bind(null, "padding")); registerAttr("margin", boxParser.bind(null, "margin")); registerAttr("border-radius", borderRadiusParser); registerAttr("border", borderParser); registerAttr("background", backgroundParser); registerAttr(["box-shadow", "text-shadow"], shadowParser); export function parseAttr(key, value) { if (attributesMap[key]) { return attributesMap[key](value); } try { return typeParser(value); } catch (e) { console.error(e); return value; } } ================================================ FILE: packages/f6-ui/src/ui-node/UIDivNode.ts ================================================ import { ShapeCfg } from "@antv/g-base"; import UINode from "./base"; export default class UIDivNode extends UINode { backgroudNode = null; draw(parentGNode) { if (!this.gNode) { this.gNode = parentGNode.addGroup({ id: this.attributes?.id, className: this.styleNode.dom.attrs.class, }); } const gNode = this.gNode; const styleNode = this.styleNode; gNode.resetMatrix(); this.backgroudNode?.remove(); const backgroudNode = (this.backgroudNode = gNode.addGroup()); gNode.translate(this.left, this.top); const style = styleNode.style; // zIndex typeof style.zIndex === "number" && gNode.setZIndex(style.zIndex); // 绘制background backgroudNode.addShape("rect", { attrs: { x: 0, // line绘制的时候是沿着两边扩 y: 0, fill: style.backgroundColor || "#fff", fillOpacity: style.backgroundOpacity, opacity: style.opacity, width: this.width, height: this.height, radius: [ style.borderTopLeftRadius || 0, style.borderTopRightRadius || 0, style.borderBottomLeftRadius || 0, style.borderBottomLeftRadius || 0, ], shadowBlur: style.shadowBlur || 0, shadowColor: style.shadowColor || null, shadowOffsetX: style.shadowOffsetX || 0, shadowOffsetY: style.shadowOffsetY || 0, }, capture: style.pointerEvents === "none" ? false : true, }); if (style.backgroundImage) { backgroudNode.addShape("image", { attrs: { x: 0, // line绘制的时候是沿着两边扩 y: 0, img: style.url, width: this.width, height: this.height, }, capture: false, }); } // 绘制边框 const border: ShapeCfg = { attrs: { x: (style.borderWidth || 0) / 2, // line绘制的时候是沿着两边扩 y: (style.borderWidth || 0) / 2, lineWidth: style.borderWidth, stroke: style.borderColor, width: this.width - (style.borderWidth || 0), height: this.height - (style.borderWidth || 0), radius: [ (style.borderTopLeftRadius || 0) * ((this.width - (style.borderWidth || 0)) / this.width), (style.borderTopRightRadius || 0) * ((this.width - (style.borderWidth || 0)) / this.width), (style.borderBottomLeftRadius || 0) * ((this.width - (style.borderWidth || 0)) / this.width), (style.borderBottomLeftRadius || 0) * ((this.width - (style.borderWidth || 0)) / this.width), ], }, capture: false, }; if (style.borderStyle === "dashed") { border.attrs.lineDash = style.lineDash || [2, 2]; } backgroudNode.addShape("rect", border); if (style.overflow === "hidden") { gNode.setClip({ type: "rect", attrs: { width: this.width, height: this.height, radius: [ style.borderTopLeftRadius || 0, style.borderTopRightRadius || 0, style.borderBottomLeftRadius || 0, style.borderBottomLeftRadius || 0, ], }, }); } backgroudNode.toBack(); } } ================================================ FILE: packages/f6-ui/src/ui-node/UIImageNode.ts ================================================ import UINode from "./base"; export default class UIImageNode extends UINode { draw(parentGNode) { const attrs = { x: this.styleNode.layout.left, y: this.styleNode.layout.top, img: this.styleNode.dom.attrs.src, width: this.styleNode.layout.width || 0, height: this.styleNode.layout.height || 0, }; const isCapture = this.styleNode.style.pointerEvents === "none" ? false : true; if (!this.gNode) { this.gNode = parentGNode.addShape("image", { type: "image", attrs, capture: isCapture, }); } const shape = this.gNode; shape.resetMatrix(); shape.set("capture", isCapture); shape.attr(attrs); // zIndex typeof this.styleNode.style.zIndex === "number" && shape.setZIndex(this.styleNode.style.zIndex); switch (this.styleNode.style.textAlign) { case "center": shape.translate(this.styleNode.layout.width / 2); break; case "right": shape.translate(this.styleNode.layout.width); break; default: break; } } } ================================================ FILE: packages/f6-ui/src/ui-node/UIRootNode.ts ================================================ import UIDivNode from "./UIDivNode"; export default class UIRootNode extends UIDivNode {} ================================================ FILE: packages/f6-ui/src/ui-node/UIShapeNode.ts ================================================ import UINode from "./base"; export default class UIShapeNode extends UINode { getAttrs() { const styleNode = this.styleNode; const style = styleNode.style; const layout = styleNode.layout; const dom = styleNode.dom; return { fill: style.backgroundColor, lineWidth: style.borderWidth, fillOpacity: style.backgroundOpacity, stroke: style.borderColor, width: layout.width - (style.borderWidth || 0), height: layout.height - (style.borderWidth || 0), ...dom.attrs, }; } draw(parentGNode) { const styleNode = this.styleNode; const attrs = this.getAttrs(); const dom = styleNode.dom; if (!this.gNode) this.gNode = parentGNode.addShape(dom.attrs.type, { attrs }); this.update(); } update() { const attrs = this.getAttrs(); let shape = this.gNode; const isCapture = this.styleNode.style.pointerEvents === "none" ? false : true; shape.attr(attrs); shape.set("capture", isCapture); shape.resetMatrix(); shape.translate(this.left, this.top); typeof this.style?.zIndex === "number" && shape.setZIndex(this.style.zIndex); } } ================================================ FILE: packages/f6-ui/src/ui-node/UITextNode.ts ================================================ import UINode from "./base"; import { assembleFont, ShapeAttrs } from "@antv/g-base"; export default class UITextNode extends UINode { getAttrs() { const style = this.styleNode.style; const attrs: ShapeAttrs = { x: this.styleNode.layout.left, y: this.styleNode.layout.top, textAlign: style.textAlign, fill: style.color, fontSize: style.fontSize || 12, fontStyle: style.fontStyle, fontFamily: style.fontFamily, lineHeight: style.lineHeight || 0, fontVariant: style.fontVariant, fontWeight: style.fontWeight, textBaseline: "top", opacity: style.opacity, fillOpacity: style.backgroundOpacity, }; return attrs; } draw(parentGNode) { const attrs: ShapeAttrs = this.getAttrs(); if (!this.gNode) { this.gNode = parentGNode.addShape("text", { type: "text", attrs, capture: false, }); } this.update(); } getMultiLineText(text, attrs, width) { const ctx = this.parent.gNode.get("canvas")?.get("context"); if (!ctx) return text; ctx.save(); const font = assembleFont(attrs); ctx.font = font; if (ctx.measureText(text).width < width) return text; let s = ""; let lineWidth = 0; for (let value of text) { const valueW = ctx.measureText(value).width; lineWidth += valueW; if (lineWidth >= width) { lineWidth = valueW; s += `\n${value}`; } else { s += value; } } ctx.restore(); return s; } update() { const style = this.styleNode.style; const attrs: ShapeAttrs = this.getAttrs(); let shape = this.gNode; shape.attr(attrs); shape.resetMatrix(); switch (style.textAlign) { case "center": shape.translate(this.styleNode.layout.width / 2); break; case "right": shape.translate(this.styleNode.layout.width); break; default: break; } if (style.whiteSpace === "nowrap") { shape.attr("text", String(this.styleNode.dom.text)); } else { shape.attr( "text", this.getMultiLineText( String(this.styleNode.dom.text), attrs, this.styleNode.layout.width, ), ); } } } ================================================ FILE: packages/f6-ui/src/ui-node/base.ts ================================================ import { isSelectorMatchDom, reflowAttrs } from "../utils/index"; import { computeLayout } from "../utils/ui"; export default abstract class UIBaseNode { styleNode = null; gNode = null; parent = null; children = []; isMounted = false; isDisplay = true; private _parentGNode = null; private _prevAttrs = null; private _prevStyle = null; private _prevLayout = null; private events = {}; constructor(styleNode?) { this.styleNode = styleNode; } get top() { return this.styleNode?.layout?.top; } get left() { return this.styleNode?.layout?.left; } get width() { return this.styleNode?.layout?.width; } get height() { return this.styleNode?.layout?.height; } get tagName() { return this.styleNode?.dom?.tagName; } get style() { return this.styleNode?.style; } get attributes() { return this.styleNode?.dom?.attrs; } private get _layout() { return this.styleNode?._layout; } set parentGNode(gNode) { this._parentGNode = gNode; } get parentGNode() { return this.parent?.gNode || this._parentGNode; } setParent(parent) { this.parent = parent; } appendChild(...list) { list.forEach((child) => { child.setParent(this); this.children.push(child); child.styleNode && this.styleNode && !this.styleNode.originChildren.includes(child.styleNode) && this.styleNode.originChildren.push(child.styleNode); }); this.reflow(); } removeChild(child) { if (!child) return; child.remove(); } remove() { const parent = this.parent; this.gNode?.remove(); if (parent) { parent.children.splice(1, parent.children.indexOf(this)); parent.styleNode?.children.splice( 1, parent.children.indexOf(this.styleNode), ); if (this.isMounted) parent.reflow(); } if (this.isMounted) this.unmount(); } query(selector) { if (typeof selector !== "string") return; const arr = selector.split(/\s+/g).filter((s) => s !== ""); const stack: any = [[this, arr]]; while (stack.length) { const [uiNode, selectorArr] = stack.shift(); for (const child of uiNode.children) { let rest = []; if ( child.styleNode && isSelectorMatchDom(child.styleNode.dom, selectorArr[0]) ) { if (selectorArr.slice(1).length === 0) { return child; } else { rest = selectorArr.slice(1); } } else { rest = selectorArr; } stack.push([child, rest]); } } } queryAll(selector) { if (typeof selector !== "string") return; const arr = selector.split(/\s+/g).filter((s) => s !== ""); const result = []; const stack: any = [[this, arr, result]]; while (stack.length) { const [uiNode, selectorArr, result] = stack.shift(); for (const child of uiNode.children) { let rest = []; if ( child.styleNode && isSelectorMatchDom(child.styleNode.dom, selectorArr[0]) ) { if (selectorArr.slice(1).length === 0) { result.push(child); rest = [selectorArr[0]]; } else { rest = selectorArr.slice(1); } } else { rest = selectorArr; } stack.push([child, rest, result]); } } return result; } // 手动挂载G节点 private manualMount(parentGNode) { this.parentGNode = parentGNode; this.layout(); this.mount(); } reflow() { // 节点没有挂载到G上 if (!this.parentGNode) return; // 上浮到absolute或根节点 if (this.style?.position !== "absolute" && this.parent) { this.parent.reflow(); return; } // 开始重排 this.layout(); this.render(); } // 计算布局 layout() { this._prevLayout = { ...(this._layout || {}) }; this.clearLayout(); computeLayout(this.styleNode); return; } mount() { if (this.isMounted) { return; } if (this.style?.display === "none") { this.isDisplay = false; return; } // 保存之后会对比 this._prevAttrs = this.attributes; this._prevStyle = this.style; this.draw(this.parentGNode); this.isMounted = true; this.gNode.set("uiNode", this); this.gNode.on("*", this.trigger); this.children.forEach((child) => child.mount()); this.didMount(); } // 全部draw一遍后触发下 didMount() {} unmount() { if (!this.isMounted) return; this.isMounted = false; this.children.forEach((child) => child.unmount()); this.didUnmount(); } didUnmount() {} private render() { if (!this.isMounted) { this.mount(); return; } // if (!this.shouldUpdate(this._prevAttrs, this._prevStyle)) return; // 处理display的情况 if (this.style?.display === "none") { this.isDisplay = false; this.gNode?.remove(false); return false; } if (this.isDisplay === false) { this.isDisplay = true; this.parentGNode?.add(this.gNode); } const should = this.shouldUpdate( this._prevAttrs, this._prevStyle, this._prevLayout, ); should && this.draw(); this.children.forEach((child) => child.render()); should && this.didUpdate(); } didUpdate() {} shouldUpdate(prevAttr, prevStyle, prevLayout) { return true; } draw(parentGNode?) {} animate() {} private clearLayout() { this.styleNode.isDirty = true; this.children.forEach((child) => { child.clearLayout(); }); } setAttribute(key, value) { if (this.styleNode && this.styleNode.dom) { this._prevAttrs = { ...this.styleNode.dom.attrs }; this.styleNode.dom.attrs[key] = value; if (!this.parent?.isMounted) return; this.render(); } } setStyle(key, value) { if (this.styleNode && this.styleNode.style) { this._prevStyle = { ...this.styleNode.dom.style }; this.styleNode.style[key] = value; if (this.parent && !this.parent.isMounted) return; if (reflowAttrs[key]) { this.reflow(); } else { this.render(); } } } getAttribute(key) { return this.styleNode?.dom?.attrs[key]; } getStyle(key) { return this.styleNode?.layout[key] ?? this.styleNode?.style[key]; } setText(text) { const textNode = this.query("text"); if (textNode && textNode.styleNode && textNode.styleNode.dom) { textNode.styleNode.dom.text = text; textNode.render(); } } trigger = (e) => { let shape = e.target; while (shape && !shape.get("uiNode")) { shape = shape.get("parent"); } e.targetGNode = shape || null; e.uiNode = shape?.get("uiNode") ?? null; this.events[e.type]?.forEach((fn) => fn(e, this)); }; on(eventName, fn) { this.events[eventName] = [...(this.events[eventName] || []), fn]; } off(eventName, fn) { if (!fn) { delete this.events[eventName]; return; } const events = this.events[eventName]; const index = events?.indexOf(fn); if (index && index !== -1) events?.splice(index, 1); } } ================================================ FILE: packages/f6-ui/src/ui-node/factory.ts ================================================ const Node_Map = {}; export function registerUINode(tagName, nodeConstruct) { Node_Map[tagName] = nodeConstruct; } export function createUINode(tagName, ...args) { const consturct = Node_Map[tagName]; if (!consturct) throw new Error(`找不到标签${tagName}的构造函数`); const uiNode = new consturct(...args); return uiNode; } ================================================ FILE: packages/f6-ui/src/ui-node/index.ts ================================================ import { registerUINode, createUINode } from "./factory"; import UIDivNode from "./UIDivNode"; import UITextNode from "./UITextNode"; import UIShapeNode from "./UIShapeNode"; import UIImageNode from "./UIImageNode"; import UIRootNode from "./UIRootNode"; registerUINode("div", UIDivNode); registerUINode("text", UITextNode); registerUINode("shape", UIShapeNode); registerUINode("image", UIImageNode); registerUINode("root", UIRootNode); export { createUINode, registerUINode }; ================================================ FILE: packages/f6-ui/src/utils/index.ts ================================================ export * from "./parser"; export * from "./ui"; ================================================ FILE: packages/f6-ui/src/utils/parser.ts ================================================ export function typeParser(value) { if (/^[-\+\.\d]+$/.test(value)) { return Number(value); } if (/true|false/.test(value)) { return Boolean(value); } if (/^\s*\[/.test(value)) { try { return JSON.parse(value); } catch (e) { throw new Error(`解析数组${value}失败`); } } if (/^\s*\{/.test(value)) { try { return JSON.parse(value); } catch (e) { throw new Error(`解析对象${value}失败`); } } return value; } enum colors { "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen", } export function isColor(value) { return ( colors[value] || value.startsWith("rgb(") || value.startsWith("rgba(") || (value.startsWith("#") && !isNaN(Number(`0x${value.slice(1)}`))) ); } export function walkDomSelector(dom, fn) { if (!dom || !fn) return; if (dom.attrs.id) { fn("id", dom.attrs.id); } if (dom.attrs.class) { selectorToArr(dom.attrs.class, /\s+/g).forEach((className) => fn("class", className), ); } fn("tagName", dom.tagName); } export function selectorToArr(selector, rex) { if (!rex) return [selector]; return selector.split(rex).filter((s) => s != ""); } export function isSelectorMatchDom(dom, selector) { if (!dom || !selector) { return false; } const tags = selector.match(/(^[^\.#]+)/g); const ids = selector.match(/#[^\.#]+/g); const classes = selector.match(/\.[^\.#]+/g); const parts = [...(tags || []), ...(ids || []), ...(classes || [])]; const domSels = {}; walkDomSelector(dom, (key, sel) => { switch (key) { case "id": domSels[`#${sel}`] = 1; break; case "class": domSels[`.${sel}`] = 1; break; case "tagName": domSels[`${sel}`] = 1; break; } }); for (const part of parts) { // 对比dom的id/class等是否和selector匹配上的 if (!domSels[part]) return false; } return true; } export const reflowAttrs = { position: 1, display: 1, width: 1, height: 1, minWidth: 1, minHeight: 1, top: 1, left: 1, right: 1, bottom: 1, flex: 1, margin: 1, marginLeft: 1, marginRight: 1, marginTop: 1, marginBottom: 1, padding: 1, paddingLeft: 1, paddingRight: 1, paddingTop: 1, paddingBottom: 1, borderWidth: 1, borderLeftWidth: 1, borderRightWidth: 1, borderTopWidth: 1, borderBottomWidth: 1, flexDirection: 1, justifyContent: 1, alignItems: 1, alignSelf: 1, flexWrap: 1, }; export const layoutAttrs = { left: 1, top: 1, right: 1, bottom: 1, width: 1, height: 1, direction: 1, }; ================================================ FILE: packages/f6-ui/src/utils/ui.ts ================================================ import compute from "css-layout"; export function computeLayout(styleNode) { const stack = [styleNode]; while (stack.length) { const node = stack.pop(); node.children = node.originChildren.filter((child) => { if (child.style.display !== "none") { stack.push(child); return true; } return false; }); } compute(styleNode); } ================================================ FILE: packages/f6-ui/vite.config.ts ================================================ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "src"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), // 入口文件 name: "f6-ui", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6-ui", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/f6-wx/CHANGELOG.md ================================================ ## 0.0.1 提供G6Mobile配套的组件能力 ================================================ FILE: packages/f6-wx/LICENSE ================================================ MIT License Copyright (c) 2021 openwayne Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: packages/f6-wx/package.json ================================================ { "name": "@antv/f6-wx", "version": "0.0.6", "description": "微信小程序f6组件", "files": [ "src" ], "keywords": [ "f6", "Wechat" ], "license": "MIT", "miniprogram": "src", "devDependencies": {}, "dependencies": {}, "scripts": { "build": "echo '@antv/f6-wx is ready'" }, "repository": "git@github.com:antvis/F6.git" } ================================================ FILE: packages/f6-wx/src/canvas/canvas.js ================================================ Component({ data: { finalPixelRatio: 1, }, properties: { style: { type: String, value: "", }, width: { type: Number, value: 100, }, height: { type: Number, value: 100, }, onInit: { type: Function, value: function value() {}, }, onTouchEvent: { type: Function, value: function value() {}, }, onError: { type: Function, value: function value() {}, }, pixelRatio: { type: Number, value: 1, }, }, observers: { pixelRatio: function (pixelRatio) { this.setData({ finalPixelRatio: pixelRatio >= 1 ? Math.ceil(pixelRatio) : 1, }); }, }, ready: function ready() { const query = wx.createSelectorQuery().in(this); query .select("#f6-canvas") .fields({ node: true, size: true, }) .exec((ret) => { console.log("ret", ret); var canvas = ret[0].node; const finalPixelRatio = this.data.finalPixelRatio; canvas.width = this.data.width * finalPixelRatio; canvas.height = this.data.height * finalPixelRatio; this.rect = { width: this.data.width * finalPixelRatio, height: this.data.height * finalPixelRatio, left: canvas._left, top: canvas._top, }; console.log("rect", this.rect); this.ctx = canvas.getContext("2d"); this.triggerEvent("onInit", { ctx: this.ctx, rect: this.rect, canvas: canvas, renderer: "mini-native", }); }); }, methods: { error: function error(e) { this.data.onError(e); }, ontouch: function ontouch(e) { var i = 0; for (i = 0; i < e.touches.length; i++) { modifyEvent(e.touches[i]); } for (i = 0; i < e.changedTouches.length; i++) { modifyEvent(e.changedTouches[i]); } this.triggerEvent("onTouchEvent", e); }, }, }); function modifyEvent(touchEvent) { touchEvent.clientX = touchEvent.x; touchEvent.clientY = touchEvent.y; touchEvent.pageX = touchEvent.x; touchEvent.pageY = touchEvent.y; } ================================================ FILE: packages/f6-wx/src/canvas/canvas.json ================================================ { "component": true, "usingComponents": {} } ================================================ FILE: packages/f6-wx/src/canvas/canvas.wxml ================================================ ================================================ FILE: packages/f6-wx/src/container/container.js ================================================ Component({ data: {}, properties: { style: { type: String, value: "", }, width: { type: Number, value: 100, }, height: { type: Number, value: 100, }, onInit: { type: Function, value: () => {}, }, onTouchEvent: { type: Function, value: () => {}, }, onError: { type: Function, value: () => {}, }, pixelRatio: { type: Number, value: 1, }, }, observers: { pixelRatio: function (pixelRatio) { this.setData({ finalPixelRatio: pixelRatio >= 1 ? Math.ceil(pixelRatio) : 1, }); }, }, ready() { const query = wx.createSelectorQuery().in(this); query .select("#g6-canvas") .fields({ node: true, size: true, }) .exec((ret) => { console.log("ret", ret); const { node: canvas } = ret[0]; const finalPixelRatio = this.data.finalPixelRatio; canvas.width = this.data.width * finalPixelRatio; canvas.height = this.data.height * finalPixelRatio; this.rect = { width: this.data.width * finalPixelRatio, height: this.data.height * finalPixelRatio, left: canvas._left, top: canvas._top, }; console.log("rect", this.rect); this.ctx = canvas.getContext("2d"); this.data.onInit(this.ctx, this.rect, canvas, "mini-native"); }); }, methods: { error(e) { this.data.onError(e); }, ontouch(e) { let i = 0; for (i = 0; i < e.touches.length; i++) { modifyEvent(e.touches[i]); } for (i = 0; i < e.changedTouches.length; i++) { modifyEvent(e.changedTouches[i]); } this.data.onTouchEvent(e); }, }, }); function modifyEvent(touchEvent) { touchEvent.clientX = touchEvent.x; touchEvent.clientY = touchEvent.y; touchEvent.pageX = touchEvent.x; touchEvent.pageY = touchEvent.y; } ================================================ FILE: packages/f6-wx/src/container/container.json ================================================ { "component": true, "usingComponents": {} } ================================================ FILE: packages/f6-wx/src/container/container.wxml ================================================ ================================================ FILE: packages/f6-wx/src/extends/graph/treeGraph.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports; } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: e }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, n) { if ((1 & n && (t = r(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var e = Object.create(null); if ( (r.r(e), Object.defineProperty(e, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var i in t) r.d( e, i, function (n) { return t[n]; }.bind(null, i), ); return e; }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 214)) ); })({ 0: function (t, n, r) { "use strict"; r.d(n, "e", function () { return O; }), r.d(n, "x", function () { return j; }), r.d(n, "l", function () { return w; }), r.d(n, "p", function () { return v; }), r.d(n, "q", function () { return y; }), r.d(n, "s", function () { return A; }), r.d(n, "u", function () { return P; }), r.d(n, "w", function () { return M; }), r.d(n, "f", function () { return c; }), r.d(n, "g", function () { return C; }), r.d(n, "i", function () { return u; }), r.d(n, "j", function () { return a; }), r.d(n, "k", function () { return x; }), r.d(n, "m", function () { return s; }), r.d(n, "n", function () { return p; }), r.d(n, "o", function () { return b; }), r.d(n, "a", function () { return N; }), r.d(n, "b", function () { return k; }), r.d(n, "c", function () { return l; }), r.d(n, "h", function () { return T; }), r.d(n, "r", function () { return I; }), r.d(n, "d", function () { return D; }), r.d(n, "v", function () { return F; }), r.d(n, "t", function () { return R; }); var e = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = {}.toString, o = function (t, n) { return i.call(t) === "[object " + n + "]"; }, u = function (t) { return o(t, "Function"); }, a = function (t) { return null == t; }, c = function (t) { return Array.isArray ? Array.isArray(t) : o(t, "Array"); }; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var s = function (t) { var n = f(t); return (null !== t && "object" === n) || "function" === n; }; var l = function (t, n) { if (t) if (c(t)) for (var r = 0, e = t.length; r < e && !1 !== n(t[r], r); r++); else if (s(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === n(t[i], i)) break; }; Object.keys; function d(t) { return (d = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var h = function (t) { return "object" === d(t) && null !== t; }, p = function (t) { if (!h(t) || !o(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; var v = function (t) { if (c(t)) return t.reduce(function (t, n) { return Math.max(t, n); }, t[0]); }, y = function (t) { if (c(t)) return t.reduce(function (t, n) { return Math.min(t, n); }, t[0]); }, g = Array.prototype, b = (g.splice, g.indexOf, Array.prototype.splice, function (t) { return o(t, "String"); }); var m = Object.prototype.hasOwnProperty; var O = function (t, n) { if (!n || !c(t)) return {}; for ( var r, e = {}, i = u(n) ? n : function (t) { return t[n]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (r = i(a)), m.call(e, r) ? e[r].push(a) : (e[r] = [a]); } return e; }; var j = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }; var x = function (t) { return o(t, "Number"); }; Number.isInteger && Number.isInteger; function w(t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; } var A = function (t, n) { return ((t % n) + n) % n; }, S = (Math.PI, parseInt, Math.PI / 180), P = function (t) { return S * t; }, _ = (Object.values, function (t) { return a(t) ? "" : t.toString(); }); var M = function (t) { var n = _(t); return n.charAt(0).toUpperCase() + n.substring(1); }, C = function (t) { return o(t, "Boolean"); }; Object.prototype; function E(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } function I(t, n, r, e) { return n && E(t, n), r && E(t, r), e && E(t, e), t; } function B(t) { return (B = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var N = function t(n) { if ("object" !== B(n) || null === n) return n; var r; if (c(n)) { r = []; for (var e = 0, i = n.length; e < i; e++) "object" === B(n[e]) && null != n[e] ? (r[e] = t(n[e])) : (r[e] = n[e]); } else for (var o in ((r = {}), n)) "object" === B(n[o]) && null != n[o] ? (r[o] = t(n[o])) : (r[o] = n[o]); return r; }; function L(t, n, r, e) { for (var i in ((r = r || 0), (e = e || 5), n)) if (n.hasOwnProperty(i)) { var o = n[i]; null !== o && p(o) ? (p(t[i]) || (t[i] = {}), r < e ? L(t[i], o, r + 1, e) : (t[i] = n[i])) : c(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var k = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) L(t, n[e]); return t; }; Object.prototype.hasOwnProperty; var T = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (b(n) || b(r)) return !1; if (e(n) || e(r)) { if (n.length !== r.length) return !1; for (var i = !0, o = 0; o < n.length && (i = t(n[o], r[o])); o++); return i; } if (h(n) || h(r)) { var u = Object.keys(n), a = Object.keys(r); if (u.length !== a.length) return !1; for (i = !0, o = 0; o < u.length && (i = t(n[u[o]], r[u[o]])); o++); return i; } return !1; }, D = function (t, n, r) { for (var e = 0, i = b(n) ? n.split(".") : n; t && e < i.length; ) t = t[i[e++]]; return void 0 === t || e < i.length ? r : t; }, H = (Object.prototype.hasOwnProperty, {}), F = function (t) { return H[(t = t || "g")] ? (H[t] += 1) : (H[t] = 1), t + H[t]; }, R = function () {}; !(function () { function t() { this.map = {}; } (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }); })(); }, 1: function (t, n, r) { "use strict"; r.d(n, "c", function () { return i; }), r.d(n, "a", function () { return o; }), r.d(n, "e", function () { return u; }), r.d(n, "b", function () { return a; }), r.d(n, "d", function () { return c; }), r.d(n, "g", function () { return f; }), r.d(n, "f", function () { return s; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var e = function (t, n) { return (e = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]); })(t, n); }; function i(t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function r() { this.constructor = t; } e(t, n), (t.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r())); } var o = function () { return (o = Object.assign || function (t) { for (var n, r = 1, e = arguments.length; r < e; r++) for (var i in (n = arguments[r])) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]); return t; }).apply(this, arguments); }; function u(t, n) { var r = {}; for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && n.indexOf(e) < 0 && (r[e] = t[e]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (e = Object.getOwnPropertySymbols(t); i < e.length; i++) n.indexOf(e[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[i]) && (r[e[i]] = t[e[i]]); } return r; } function a(t, n, r, e) { return new (r || (r = Promise))(function (i, o) { function u(t) { try { c(e.next(t)); } catch (t) { o(t); } } function a(t) { try { c(e.throw(t)); } catch (t) { o(t); } } function c(t) { var n; t.done ? i(t.value) : ((n = t.value), n instanceof r ? n : new r(function (t) { t(n); })).then(u, a); } c((e = e.apply(t, n || [])).next()); }); } function c(t, n) { var r, e, i, o, u = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: a(0), throw: a(1), return: a(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function a(o) { return function (a) { return (function (o) { if (r) throw new TypeError("Generator is already executing."); for (; u; ) try { if ( ((r = 1), e && (i = 2 & o[0] ? e.return : o[0] ? e.throw || ((i = e.return) && i.call(e), 0) : e.next) && !(i = i.call(e, o[1])).done) ) return i; switch (((e = 0), i && (o = [2 & o[0], i.value]), o[0])) { case 0: case 1: i = o; break; case 4: return u.label++, { value: o[1], done: !1 }; case 5: u.label++, (e = o[1]), (o = [0]); continue; case 7: (o = u.ops.pop()), u.trys.pop(); continue; default: if ( !((i = u.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== o[0] && 2 !== o[0])) ) { u = 0; continue; } if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) { u.label = o[1]; break; } if (6 === o[0] && u.label < i[1]) { (u.label = i[1]), (i = o); break; } if (i && u.label < i[2]) { (u.label = i[2]), u.ops.push(o); break; } i[2] && u.ops.pop(), u.trys.pop(); continue; } o = n.call(t, u); } catch (t) { (o = [6, t]), (e = 0); } finally { r = i = 0; } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 }; })([o, a]); }; } } Object.create; function f() { for (var t = 0, n = 0, r = arguments.length; n < r; n++) t += arguments[n].length; var e = Array(t), i = 0; for (n = 0; n < r; n++) for (var o = arguments[n], u = 0, a = o.length; u < a; u++, i++) e[i] = o[u]; return e; } function s(t, n, r) { if (r || 2 === arguments.length) for (var e, i = 0, o = n.length; i < o; i++) (!e && i in n) || (e || (e = Array.prototype.slice.call(n, 0, i)), (e[i] = n[i])); return t.concat(e || n); } Object.create; }, 104: function (t, n, r) { (function (t) { var r, e, i, o; function u(t) { return (u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } "undefined" != typeof self && self, (o = function () { return (function (t) { var n = {}; function r(e) { if (n[e]) return n[e].exports; var i = (n[e] = { i: e, l: !1, exports: {} }); return ( t[e].call(i.exports, i, i.exports, r), (i.l = !0), i.exports ); } return ( (r.m = t), (r.c = n), (r.d = function (t, n, e) { r.o(t, n) || Object.defineProperty(t, n, { configurable: !1, enumerable: !0, get: e, }); }), (r.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(n, "a", n), n; }), (r.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (r.p = ""), r((r.s = 31)) ); })([ function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Array.isArray ? Array.isArray(t) : Object(e.a)(t, "Array"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( null !== t && "function" != typeof t && isFinite(t.length) ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(13); n.a = function (t, n) { if (t) if (Object(e.a)(t)) for ( var r = 0, o = t.length; r < o && !1 !== n(t[r], r); r++ ); else if (Object(i.a)(t)) for (var u in t) if (t.hasOwnProperty(u) && !1 === n(t[u], u)) break; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Function"); }; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t, n) { return e.call(t) === "[object " + n + "]"; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Number"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null == t; }; }, function (t, n, r) { var e = r(33).mix; t.exports = { assign: e }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "String"); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(4); n.a = function (t) { if (!Object(e.a)(t) || !Object(i.a)(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var n = t; null !== Object.getPrototypeOf(n); ) n = Object.getPrototypeOf(n); return Object.getPrototypeOf(t) === n; }; }, function (t, n, r) { "use strict"; var e = r(6); n.a = function (t) { return Object(e.a)(t) ? "" : t.toString(); }; }, function (t, n, r) { var e = r(18), i = (function () { function t(t, n) { void 0 === n && (n = {}), (this.options = n), (this.rootNode = e(t, n)); } return ( (t.prototype.execute = function () { throw new Error("please override this method"); }), t ); })(); t.exports = i; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { return !!Object(e.a)(t) && t.indexOf(n) > -1; }; }, function (t, n, r) { "use strict"; n.a = function (t) { var n = u(t); return (null !== t && "object" === n) || "function" === n; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { n(t, e) && r.push(t); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return "object" === u(t) && null !== t; }; }, function (t, n, r) { "use strict"; function e(t, n) { for (var r in n) n.hasOwnProperty(r) && "constructor" !== r && void 0 !== n[r] && (t[r] = n[r]); } n.a = function (t, n, r, i) { return n && e(t, n), r && e(t, r), i && e(t, i), t; }; }, function (t, n, r) { var e = r(30), i = ["LR", "RL", "TB", "BT", "H", "V"], o = ["LR", "RL", "H"], u = i[0]; t.exports = function (t, n, r) { var a = n.direction || u; if ( ((n.isHorizontal = (function (t) { return o.indexOf(t) > -1; })(a)), a && -1 === i.indexOf(a)) ) throw new TypeError("Invalid direction: " + a); if (a === i[0]) r(t, n); else if (a === i[1]) r(t, n), t.right2left(); else if (a === i[2]) r(t, n); else if (a === i[3]) r(t, n), t.bottom2top(); else if (a === i[4] || a === i[5]) { var c = e(t, n), f = c.left, s = c.right; r(f, n), r(s, n), n.isHorizontal ? f.right2left() : f.bottom2top(), s.translate(f.x - s.x, f.y - s.y), (t.x = f.x), (t.y = s.y); var l = t.getBoundingBox(); n.isHorizontal ? l.top < 0 && t.translate(0, -l.top) : l.left < 0 && t.translate(-l.left, 0); } var d = n.fixedRoot; return ( void 0 === d && (d = !0), d && t.translate( -(t.x + t.width / 2 + t.hgap), -(t.y + t.height / 2 + t.vgap), ), t ); }; }, function (t, n, r) { var e = r(7), i = { getId: function (t) { return t.id || t.name; }, getPreH: function (t) { return t.preH || 0; }, getPreV: function (t) { return t.preV || 0; }, getHGap: function (t) { return t.hgap || 18; }, getVGap: function (t) { return t.vgap || 18; }, getChildren: function (t) { return t.children; }, getHeight: function (t) { return t.height || 36; }, getWidth: function (t) { var n = t.label || " "; return t.width || 18 * n.split("").length; }, }; function o(t, n) { var r = this; if (((r.vgap = r.hgap = 0), t instanceof o)) return t; r.data = t; var e = n.getHGap(t), i = n.getVGap(t); return ( (r.preH = n.getPreH(t)), (r.preV = n.getPreV(t)), (r.width = n.getWidth(t)), (r.height = n.getHeight(t)), (r.width += r.preH), (r.height += r.preV), (r.id = n.getId(t)), (r.x = r.y = 0), (r.depth = 0), r.children || (r.children = []), r.addGap(e, i), r ); } e.assign(o.prototype, { isRoot: function () { return 0 === this.depth; }, isLeaf: function () { return 0 === this.children.length; }, addGap: function (t, n) { (this.hgap += t), (this.vgap += n), (this.width += 2 * t), (this.height += 2 * n); }, eachNode: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = n.children.concat(r)); }, DFTraverse: function (t) { this.eachNode(t); }, BFTraverse: function (t) { for (var n, r = [this]; (n = r.shift()); ) t(n), (r = r.concat(n.children)); }, getBoundingBox: function () { var t = { left: Number.MAX_VALUE, top: Number.MAX_VALUE, width: 0, height: 0, }; return ( this.eachNode(function (n) { (t.left = Math.min(t.left, n.x)), (t.top = Math.min(t.top, n.y)), (t.width = Math.max(t.width, n.x + n.width)), (t.height = Math.max(t.height, n.y + n.height)); }), t ); }, translate: function (t, n) { void 0 === t && (t = 0), void 0 === n && (n = 0), this.eachNode(function (r) { (r.x += t), (r.y += n), (r.x += r.preH), (r.y += r.preV); }); }, right2left: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.x = n.x - 2 * (n.x - t.left) - n.width; }), this.translate(t.width, 0); }, bottom2top: function () { var t = this.getBoundingBox(); this.eachNode(function (n) { n.y = n.y - 2 * (n.y - t.top) - n.height; }), this.translate(0, t.height); }, }), (t.exports = function (t, n, r) { void 0 === n && (n = {}); var u, a = new o(t, (n = e.assign({}, i, n))), c = [a]; if (!r && !t.collapsed) for (; (u = c.shift()); ) if (!u.data.collapsed) { var f = n.getChildren(u.data), s = f ? f.length : 0; if (((u.children = new Array(s)), f && s)) for (var l = 0; l < s; l++) { var d = new o(f[l], n); (u.children[l] = d), c.push(d), (d.parent = u), (d.depth = u.depth + 1); } } return a; }); }, function (t, n, r) { "use strict"; var e = r(6), i = r(20); n.a = function (t, n) { var r = Object(i.a)(n), o = r.length; if (Object(e.a)(t)) return !o; for (var u = 0; u < o; u += 1) { var a = r[u]; if (n[a] !== t[a] || !(a in t)) return !1; } return !0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), o = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(e); }), n ); }; n.a = o; }, function (t, n, r) { "use strict"; var e = r(1), i = Array.prototype.splice; n.a = function (t, n) { if (!Object(e.a)(t)) return []; for (var r = t ? n.length : 0, o = r - 1; r--; ) { var u = void 0, a = n[r]; (r !== o && a === u) || ((u = a), i.call(t, a, 1)); } return t; }; }, function (t, n, r) { "use strict"; var e = r(12), i = r(2); n.a = function (t) { var n = []; return ( Object(i.a)(t, function (t) { Object(e.a)(n, t) || n.push(t); }), n ); }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(3), o = r(24); n.a = function (t, n) { if (!n) return { 0: t }; if (!Object(i.a)(n)) { var r = Object(e.a)(n) ? n : n.replace(/\s+/g, "").split("*"); n = function (t) { for (var n = "_", e = 0, i = r.length; e < i; e++) n += t[r[e]] && t[r[e]].toString(); return n; }; } return Object(o.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3), u = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (!n || !Object(i.a)(t)) return {}; var r, a = {}, c = Object(o.a)(n) ? n : function (t) { return t[n]; }; return ( Object(e.a)(t, function (t) { (r = c(t)), u.call(a, r) ? a[r].push(t) : (a[r] = [t]); }), a ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t.hasOwnProperty(n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(3), o = Object.values ? function (t) { return Object.values(t); } : function (t) { var n = []; return ( Object(e.a)(t, function (r, e) { (Object(i.a)(t) && "prototype" === e) || n.push(r); }), n ); }; n.a = o; }, function (t, n, r) { "use strict"; var e = {}.toString; n.a = function (t) { return e .call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }; }, function (t, n, r) { "use strict"; var e = Object.prototype; n.a = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, r) { "use strict"; var e = r(15), i = r(1), o = r(8); n.a = function t(n, r) { if (n === r) return !0; if (!n || !r) return !1; if (Object(o.a)(n) || Object(o.a)(r)) return !1; if (Object(i.a)(n) || Object(i.a)(r)) { if (n.length !== r.length) return !1; for ( var u = !0, a = 0; a < n.length && (u = t(n[a], r[a])); a++ ); return u; } if (Object(e.a)(n) || Object(e.a)(r)) { var c = Object.keys(n), f = Object.keys(r); if (c.length !== f.length) return !1; for ( u = !0, a = 0; a < c.length && (u = t(n[c[a]], r[c[a]])); a++ ); return u; } return !1; }; }, function (t, n, r) { var e = r(18); t.exports = function (t, n) { for ( var r = e(t.data, n, !0), i = e(t.data, n, !0), o = t.children.length, u = Math.round(o / 2), a = n.getSide || function (t, n) { return n < u ? "right" : "left"; }, c = 0; c < o; c++ ) { var f = t.children[c]; "right" === a(f, c) ? i.children.push(f) : r.children.push(f); } return ( r.eachNode(function (t) { t.isRoot() || (t.side = "left"); }), i.eachNode(function (t) { t.isRoot() || (t.side = "right"); }), { left: r, right: i } ); }; }, function (t, n, r) { var e = { compactBox: r(32), dendrogram: r(114), indented: r(116), mindmap: r(118), }; t.exports = e; }, function (t, n, r) { var e = r(11), i = r(113), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return o(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }); var e = r(12); r.d(n, "contains", function () { return e.a; }), r.d(n, "includes", function () { return e.a; }); var i = r(34); r.d(n, "difference", function () { return i.a; }); var o = r(35); r.d(n, "find", function () { return o.a; }); var u = r(36); r.d(n, "findIndex", function () { return u.a; }); var a = r(37); r.d(n, "firstValue", function () { return a.a; }); var c = r(38); r.d(n, "flatten", function () { return c.a; }); var f = r(39); r.d(n, "flattenDeep", function () { return f.a; }); var s = r(40); r.d(n, "getRange", function () { return s.a; }); var l = r(41); r.d(n, "pull", function () { return l.a; }); var d = r(21); r.d(n, "pullAt", function () { return d.a; }); var h = r(42); r.d(n, "reduce", function () { return h.a; }); var p = r(43); r.d(n, "remove", function () { return p.a; }); var v = r(44); r.d(n, "sortBy", function () { return v.a; }); var y = r(45); r.d(n, "union", function () { return y.a; }); var g = r(22); r.d(n, "uniq", function () { return g.a; }); var b = r(46); r.d(n, "valuesOfKey", function () { return b.a; }); var m = r(47); r.d(n, "head", function () { return m.a; }); var O = r(48); r.d(n, "last", function () { return O.a; }); var j = r(49); r.d(n, "startsWith", function () { return j.a; }); var x = r(50); r.d(n, "endsWith", function () { return x.a; }); var w = r(14); r.d(n, "filter", function () { return w.a; }); var A = r(51); r.d(n, "every", function () { return A.a; }); var S = r(52); r.d(n, "some", function () { return S.a; }); var P = r(53); r.d(n, "group", function () { return P.a; }); var _ = r(24); r.d(n, "groupBy", function () { return _.a; }); var M = r(23); r.d(n, "groupToMap", function () { return M.a; }); var C = r(54); r.d(n, "getWrapBehavior", function () { return C.a; }); var E = r(55); r.d(n, "wrapBehavior", function () { return E.a; }); var I = r(56); r.d(n, "number2color", function () { return I.a; }); var B = r(57); r.d(n, "parseRadius", function () { return B.a; }); var N = r(58); r.d(n, "clamp", function () { return N.a; }); var L = r(59); r.d(n, "fixedBase", function () { return L.a; }); var k = r(60); r.d(n, "isDecimal", function () { return k.a; }); var T = r(61); r.d(n, "isEven", function () { return T.a; }); var D = r(62); r.d(n, "isInteger", function () { return D.a; }); var H = r(63); r.d(n, "isNegative", function () { return H.a; }); var F = r(64); r.d(n, "isNumberEqual", function () { return F.a; }); var R = r(65); r.d(n, "isOdd", function () { return R.a; }); var V = r(66); r.d(n, "isPositive", function () { return V.a; }); var z = r(67); r.d(n, "maxBy", function () { return z.a; }); var q = r(68); r.d(n, "minBy", function () { return q.a; }); var U = r(69); r.d(n, "mod", function () { return U.a; }); var G = r(70); r.d(n, "toDegree", function () { return G.a; }); var Y = r(71); r.d(n, "toInteger", function () { return Y.a; }); var W = r(72); r.d(n, "toRadian", function () { return W.a; }); var K = r(73); r.d(n, "forIn", function () { return K.a; }); var X = r(25); r.d(n, "has", function () { return X.a; }); var $ = r(74); r.d(n, "hasKey", function () { return $.a; }); var J = r(75); r.d(n, "hasValue", function () { return J.a; }); var Q = r(20); r.d(n, "keys", function () { return Q.a; }); var Z = r(19); r.d(n, "isMatch", function () { return Z.a; }); var tt = r(26); r.d(n, "values", function () { return tt.a; }); var nt = r(76); r.d(n, "lowerCase", function () { return nt.a; }); var rt = r(77); r.d(n, "lowerFirst", function () { return rt.a; }); var et = r(78); r.d(n, "substitute", function () { return et.a; }); var it = r(79); r.d(n, "upperCase", function () { return it.a; }); var ot = r(80); r.d(n, "upperFirst", function () { return ot.a; }); var ut = r(27); r.d(n, "getType", function () { return ut.a; }); var at = r(81); r.d(n, "isArguments", function () { return at.a; }); var ct = r(0); r.d(n, "isArray", function () { return ct.a; }); var ft = r(1); r.d(n, "isArrayLike", function () { return ft.a; }); var st = r(82); r.d(n, "isBoolean", function () { return st.a; }); var lt = r(83); r.d(n, "isDate", function () { return lt.a; }); var dt = r(84); r.d(n, "isError", function () { return dt.a; }); var ht = r(3); r.d(n, "isFunction", function () { return ht.a; }); var pt = r(85); r.d(n, "isFinite", function () { return pt.a; }); var vt = r(6); r.d(n, "isNil", function () { return vt.a; }); var yt = r(86); r.d(n, "isNull", function () { return yt.a; }); var gt = r(5); r.d(n, "isNumber", function () { return gt.a; }); var bt = r(13); r.d(n, "isObject", function () { return bt.a; }); var mt = r(15); r.d(n, "isObjectLike", function () { return mt.a; }); var Ot = r(9); r.d(n, "isPlainObject", function () { return Ot.a; }); var jt = r(28); r.d(n, "isPrototype", function () { return jt.a; }); var xt = r(87); r.d(n, "isRegExp", function () { return xt.a; }); var wt = r(8); r.d(n, "isString", function () { return wt.a; }); var At = r(4); r.d(n, "isType", function () { return At.a; }); var St = r(88); r.d(n, "isUndefined", function () { return St.a; }); var Pt = r(89); r.d(n, "isElement", function () { return Pt.a; }); var _t = r(90); r.d(n, "requestAnimationFrame", function () { return _t.a; }); var Mt = r(91); r.d(n, "clearAnimationFrame", function () { return Mt.a; }); var Ct = r(92); r.d(n, "augment", function () { return Ct.a; }); var Et = r(93); r.d(n, "clone", function () { return Et.a; }); var It = r(94); r.d(n, "debounce", function () { return It.a; }); var Bt = r(95); r.d(n, "memoize", function () { return Bt.a; }); var Nt = r(96); r.d(n, "deepMix", function () { return Nt.a; }); var Lt = r(2); r.d(n, "each", function () { return Lt.a; }); var kt = r(97); r.d(n, "extend", function () { return kt.a; }); var Tt = r(98); r.d(n, "indexOf", function () { return Tt.a; }); var Dt = r(99); r.d(n, "isEmpty", function () { return Dt.a; }); var Ht = r(29); r.d(n, "isEqual", function () { return Ht.a; }); var Ft = r(100); r.d(n, "isEqualWith", function () { return Ft.a; }); var Rt = r(101); r.d(n, "map", function () { return Rt.a; }); var Vt = r(102); r.d(n, "mapValues", function () { return Vt.a; }); var zt = r(16); r.d(n, "mix", function () { return zt.a; }), r.d(n, "assign", function () { return zt.a; }); var qt = r(103); r.d(n, "get", function () { return qt.a; }); var Ut = r(104); r.d(n, "set", function () { return Ut.a; }); var Gt = r(105); r.d(n, "pick", function () { return Gt.a; }); var Yt = r(106); r.d(n, "throttle", function () { return Yt.a; }); var Wt = r(107); r.d(n, "toArray", function () { return Wt.a; }); var Kt = r(10); r.d(n, "toString", function () { return Kt.a; }); var Xt = r(108); r.d(n, "uniqueId", function () { return Xt.a; }); var $t = r(109); r.d(n, "noop", function () { return $t.a; }); var Jt = r(110); r.d(n, "identity", function () { return Jt.a; }); var Qt = r(111); r.d(n, "size", function () { return Qt.a; }); var Zt = r(112); r.d(n, "Cache", function () { return Zt.a; }); }, function (t, n, r) { "use strict"; var e = r(14), i = r(12); n.a = function (t, n) { return ( void 0 === n && (n = []), Object(e.a)(t, function (t) { return !Object(i.a)(n, t); }) ); }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(19), o = r(0), u = r(9); n.a = function (t, n) { if (!Object(o.a)(t)) return null; var r; if ( (Object(e.a)(n) && (r = n), Object(u.a)(n) && (r = function (t) { return Object(i.a)(t, n); }), r) ) for (var a = 0; a < t.length; a += 1) if (r(t[a])) return t[a]; return null; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { void 0 === r && (r = 0); for (var e = r; e < t.length; e++) if (n(t[e], e)) return e; return -1; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(0); n.a = function (t, n) { for (var r = null, o = 0; o < t.length; o++) { var u = t[o][n]; if (!Object(e.a)(u)) { r = Object(i.a)(u) ? u[0] : u; break; } } return r; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { if (!Object(e.a)(t)) return []; for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n, r) { if ((void 0 === r && (r = []), Object(e.a)(n))) for (var i = 0; i < n.length; i += 1) t(n[i], r); else r.push(n); return r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(14); n.a = function (t) { if ( !(t = Object(i.a)(t, function (t) { return !isNaN(t); })).length ) return { min: 0, max: 0 }; if (Object(e.a)(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); t = n; } var o = Math.max.apply(null, t); return { min: Math.min.apply(null, t), max: o }; }; }, function (t, n, r) { "use strict"; var e = Array.prototype, i = e.splice, o = e.indexOf; n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e++) for (var u = n[e], a = -1; (a = o.call(t, u)) > -1; ) i.call(t, a, 1); return t; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(9); n.a = function (t, n, r) { if (!Object(i.a)(t) && !Object(o.a)(t)) return t; var u = r; return ( Object(e.a)(t, function (t, r) { u = n(u, t, r); }), u ); }; }, function (t, n, r) { "use strict"; var e = r(1), i = r(21); n.a = function (t, n) { var r = []; if (!Object(e.a)(t)) return r; for (var o = -1, u = [], a = t.length; ++o < a; ) { var c = t[o]; n(c, o, t) && (r.push(c), u.push(o)); } return Object(i.a)(t, u), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8), o = r(3); n.a = function (t, n) { var r; if (Object(o.a)(n)) r = function (t, r) { return n(t) - n(r); }; else { var u = []; Object(i.a)(n) ? u.push(n) : Object(e.a)(n) && (u = n), (r = function (t, n) { for (var r = 0; r < u.length; r += 1) { var e = u[r]; if (t[e] > n[e]) return 1; if (t[e] < n[e]) return -1; } return 0; }); } return t.sort(r), t; }; }, function (t, n, r) { "use strict"; var e = r(22); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; return Object(e.a)([].concat.apply([], t)); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(6); n.a = function (t, n) { var r = [], u = {}; return ( t.forEach(function (t) { var a = t[n]; Object(o.a)(a) || (Object(i.a)(a) || (a = [a]), Object(e.a)(a, function (t) { u[t] || (r.push(t), (u[t] = !0)); })); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[0]; }; var e = r(1); }, function (t, n, r) { "use strict"; n.a = function (t) { if (Object(e.a)(t)) return t[t.length - 1]; }; var e = r(1); }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return !(!Object(e.a)(t) && !Object(i.a)(t)) && t[0] === n; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(8); n.a = function (t, n) { return ( !(!Object(e.a)(t) && !Object(i.a)(t)) && t[t.length - 1] === n ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (!n(t[r], r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { for (var r = 0; r < t.length; r++) if (n(t[r], r)) return !0; return !1; }; }, function (t, n, r) { "use strict"; var e = r(23); n.a = function (t, n) { if (!n) return [t]; var r = Object(e.a)(t, n), i = []; for (var o in r) i.push(r[o]); return i; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t["_wrap_" + n]; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { if (t["_wrap_" + n]) return t["_wrap_" + n]; var r = function (r) { t[n](r); }; return (t["_wrap_" + n] = r), r; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { var n = e[t]; if (!n) { for (var r = t.toString(16), i = r.length; i < 6; i++) r = "0" + r; (n = "#" + r), (e[t] = n); } return n; }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function (t) { var n = 0, r = 0, i = 0, o = 0; return ( Object(e.a)(t) ? 1 === t.length ? (n = r = i = o = t[0]) : 2 === t.length ? ((n = i = t[0]), (r = o = t[1])) : 3 === t.length ? ((n = t[0]), (r = o = t[1]), (i = t[2])) : ((n = t[0]), (r = t[1]), (i = t[2]), (o = t[3])) : (n = r = i = o = t), { r1: n, r2: r, r3: i, r4: o } ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return t < n ? n : t > r ? r : t; }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { var r = n.toString(), e = r.indexOf("."); if (-1 === e) return Math.round(t); var i = r.substr(e + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 1 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 == 0; }; }, function (t, n, r) { "use strict"; var e = r(5), i = Number.isInteger ? Number.isInteger : function (t) { return Object(e.a)(t) && t % 1 == 0; }; n.a = i; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t < 0; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { return void 0 === r && (r = 1e-5), Math.abs(t - n) < r; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t % 2 != 0; }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && t > 0; }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, u, a = t[0]; return ( (r = Object(o.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (u = Object(o.a)(n) ? n(t) : t[n]) > r && ((a = t), (r = u)); }), a ); } }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(0), o = r(3); n.a = function (t, n) { if (Object(i.a)(t)) { var r, u, a = t[0]; return ( (r = Object(o.a)(n) ? n(t[0]) : t[0][n]), Object(e.a)(t, function (t) { (u = Object(o.a)(n) ? n(t) : t[n]) < r && ((a = t), (r = u)); }), a ); } }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return ((t % n) + n) % n; }; }, function (t, n, r) { "use strict"; var e = 180 / Math.PI; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; n.a = parseInt; }, function (t, n, r) { "use strict"; var e = Math.PI / 180; n.a = function (t) { return e * t; }; }, function (t, n, r) { "use strict"; var e = r(2); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(25); n.a = e.a; }, function (t, n, r) { "use strict"; var e = r(12), i = r(26); n.a = function (t, n) { return Object(e.a)(Object(i.a)(t), n); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toLowerCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toLowerCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; n.a = function (t, n) { return t && n ? t.replace(/\\?\{([^{}]+)\}/g, function (t, r) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === n[r] ? "" : n[r]; }) : t; }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { return Object(e.a)(t).toUpperCase(); }; }, function (t, n, r) { "use strict"; var e = r(10); n.a = function (t) { var n = Object(e.a)(t); return n.charAt(0).toUpperCase() + n.substring(1); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Arguments"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Boolean"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Date"); }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "Error"); }; }, function (t, n, r) { "use strict"; var e = r(5); n.a = function (t) { return Object(e.a)(t) && isFinite(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return null === t; }; }, function (t, n, r) { "use strict"; var e = r(4); n.a = function (t) { return Object(e.a)(t, "RegExp"); }; }, function (t, n, r) { "use strict"; n.a = function (t) { return void 0 === t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); }; }, function (t, n, r) { "use strict"; n.a = function (t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; for (var r = t[0], o = 1; o < t.length; o++) { var u = t[o]; Object(i.a)(u) && (u = u.prototype), Object(e.a)(r.prototype, u); } }; }, function (t, n, r) { "use strict"; var e = r(0); n.a = function t(n) { if ("object" !== u(n) || null === n) return n; var r; if (Object(e.a)(n)) { r = []; for (var i = 0, o = n.length; i < o; i++) "object" === u(n[i]) && null != n[i] ? (r[i] = t(n[i])) : (r[i] = n[i]); } else for (var a in ((r = {}), n)) "object" === u(n[a]) && null != n[a] ? (r[a] = t(n[a])) : (r[a] = n[a]); return r; }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e; return function () { var i = this, o = arguments, u = function () { (e = null), r || t.apply(i, o); }, a = r && !e; clearTimeout(e), (e = setTimeout(u, n)), a && t.apply(i, o); }; }; }, function (t, n, r) { "use strict"; var e = r(3); n.a = function (t, n) { if (!Object(e.a)(t)) throw new TypeError("Expected a function"); var r = function r() { for (var e = [], i = 0; i < arguments.length; i++) e[i] = arguments[i]; var o = n ? n.apply(this, e) : e[0], u = r.cache; if (u.has(o)) return u.get(o); var a = t.apply(this, e); return u.set(o, a), a; }; return (r.cache = new Map()), r; }; }, function (t, n, r) { "use strict"; var e = r(0), i = r(9); function o(t, n, r, u) { for (var a in ((r = r || 0), (u = u || 5), n)) if (n.hasOwnProperty(a)) { var c = n[a]; null !== c && Object(i.a)(c) ? (Object(i.a)(t[a]) || (t[a] = {}), r < u ? o(t[a], c, r + 1, u) : (t[a] = n[a])) : Object(e.a)(c) ? ((t[a] = []), (t[a] = t[a].concat(c))) : void 0 !== c && (t[a] = c); } } n.a = function (t) { for (var n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; for (var e = 0; e < n.length; e += 1) o(t, n[e]); return t; }; }, function (t, n, r) { "use strict"; var e = r(16), i = r(3); n.a = function (t, n, r, o) { Object(i.a)(n) || ((r = n), (n = t), (t = function () {})); var u = Object.create ? function (t, n) { return Object.create(t, { constructor: { value: n }, }); } : function (t, n) { function r() {} r.prototype = t; var e = new r(); return (e.constructor = n), e; }, a = u(n.prototype, t); return ( (t.prototype = Object(e.a)(a, t.prototype)), (t.superclass = u(n.prototype, n)), Object(e.a)(a, r), Object(e.a)(t, o), t ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t, n) { if (!Object(e.a)(t)) return -1; var r = Array.prototype.indexOf; if (r) return r.call(t, n); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === n) { i = o; break; } return i; }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(1), o = r(27), u = r(28), a = Object.prototype.hasOwnProperty; n.a = function (t) { if (Object(e.a)(t)) return !0; if (Object(i.a)(t)) return !t.length; var n = Object(o.a)(t); if ("Map" === n || "Set" === n) return !t.size; if (Object(u.a)(t)) return !Object.keys(t).length; for (var r in t) if (a.call(t, r)) return !1; return !0; }; }, function (t, n, r) { "use strict"; var e = r(3), i = r(29); n.a = function (t, n, r) { return Object(e.a)(r) ? !!r(t, n) : Object(i.a)(t, n); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(1); n.a = function (t, n) { if (!Object(i.a)(t)) return t; var r = []; return ( Object(e.a)(t, function (t, e) { r.push(n(t, e)); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(6), i = r(13), o = function (t) { return t; }; n.a = function (t, n) { void 0 === n && (n = o); var r = {}; return ( Object(i.a)(t) && !Object(e.a)(t) && Object.keys(t).forEach(function (e) { r[e] = n(t[e], e); }), r ); }; }, function (t, n, r) { "use strict"; var e = r(8); n.a = function (t, n, r) { for ( var i = 0, o = Object(e.a)(n) ? n.split(".") : n; t && i < o.length; ) t = t[o[i++]]; return void 0 === t || i < o.length ? r : t; }; }, function (t, n, r) { "use strict"; var e = r(13), i = r(8), o = r(5); n.a = function (t, n, r) { var u = t, a = Object(i.a)(n) ? n.split(".") : n; return ( a.forEach(function (t, n) { n < a.length - 1 ? (Object(e.a)(u[t]) || (u[t] = Object(o.a)(a[n + 1]) ? [] : {}), (u = u[t])) : (u[t] = r); }), t ); }; }, function (t, n, r) { "use strict"; var e = r(2), i = r(9), o = Object.prototype.hasOwnProperty; n.a = function (t, n) { if (null === t || !Object(i.a)(t)) return {}; var r = {}; return ( Object(e.a)(n, function (n) { o.call(t, n) && (r[n] = t[n]); }), r ); }; }, function (t, n, r) { "use strict"; n.a = function (t, n, r) { var e, i, o, u, a = 0; r || (r = {}); var c = function () { (a = !1 === r.leading ? 0 : Date.now()), (e = null), (u = t.apply(i, o)), e || (i = o = null); }, f = function () { var f = Date.now(); a || !1 !== r.leading || (a = f); var s = n - (f - a); return ( (i = this), (o = arguments), s <= 0 || s > n ? (e && (clearTimeout(e), (e = null)), (a = f), (u = t.apply(i, o)), e || (i = o = null)) : e || !1 === r.trailing || (e = setTimeout(c, s)), u ); }; return ( (f.cancel = function () { clearTimeout(e), (a = 0), (e = i = o = null); }), f ); }; }, function (t, n, r) { "use strict"; var e = r(1); n.a = function (t) { return Object(e.a)(t) ? Array.prototype.slice.call(t) : []; }; }, function (t, n, r) { "use strict"; var e = {}; n.a = function (t) { return e[(t = t || "g")] ? (e[t] += 1) : (e[t] = 1), t + e[t]; }; }, function (t, n, r) { "use strict"; n.a = function () {}; }, function (t, n, r) { "use strict"; n.a = function (t) { return t; }; }, function (t, n, r) { "use strict"; n.a = function (t) { return Object(e.a)(t) ? 0 : Object(i.a)(t) ? t.length : Object.keys(t).length; }; var e = r(6), i = r(1); }, function (t, n, r) { "use strict"; var e = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, n) { var r = this.map[t]; return void 0 === r ? n : r; }), (t.prototype.set = function (t, n) { this.map[t] = n; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); n.a = e; }, function (t, n) { function r(t, n, r, e) { void 0 === e && (e = []); var i = this; (i.w = t || 0), (i.h = n || 0), (i.y = r || 0), (i.x = 0), (i.c = e || []), (i.cs = e.length), (i.prelim = 0), (i.mod = 0), (i.shift = 0), (i.change = 0), (i.tl = null), (i.tr = null), (i.el = null), (i.er = null), (i.msel = 0), (i.mser = 0); } function e(t, n) { var r = (function t(n, r) { var e = r ? n.y : n.x; return ( n.children.forEach(function (n) { e = Math.min(t(n, r), e); }), e ); })(t, n); !(function t(n, r, e) { e ? (n.y += r) : (n.x += r), n.children.forEach(function (n) { t(n, r, e); }); })(t, -r, n); } (r.fromNode = function (t, n) { if (!t) return null; var e = []; return ( t.children.forEach(function (t) { e.push(r.fromNode(t, n)); }), n ? new r(t.height, t.width, t.x, e) : new r(t.width, t.height, t.y, e) ); }), (t.exports = function (t, n) { void 0 === n && (n = {}); var i = n.isHorizontal; function o(t) { 0 === t.cs ? ((t.el = t), (t.er = t), (t.msel = t.mser = 0)) : ((t.el = t.c[0].el), (t.msel = t.c[0].msel), (t.er = t.c[t.cs - 1].er), (t.mser = t.c[t.cs - 1].mser)); } function u(t, n, r) { for ( var e = t.c[n - 1], i = e.mod, o = t.c[n], u = o.mod; null !== e && null !== o; ) { s(e) > r.low && (r = r.nxt); var l = i + e.prelim + e.w - (u + o.prelim); l > 0 && ((u += l), a(t, n, r.index, l)); var d = s(e), h = s(o); d <= h && null !== (e = f(e)) && (i += e.mod), d >= h && null !== (o = c(o)) && (u += o.mod); } !e && o ? (function (t, n, r, e) { var i = t.c[0].el; i.tl = r; var o = e - r.mod - t.c[0].msel; (i.mod += o), (i.prelim -= o), (t.c[0].el = t.c[n].el), (t.c[0].msel = t.c[n].msel); })(t, n, o, u) : e && !o && (function (t, n, r, e) { var i = t.c[n].er; i.tr = r; var o = e - r.mod - t.c[n].mser; (i.mod += o), (i.prelim -= o), (t.c[n].er = t.c[n - 1].er), (t.c[n].mser = t.c[n - 1].mser); })(t, n, e, i); } function a(t, n, r, e) { (t.c[n].mod += e), (t.c[n].msel += e), (t.c[n].mser += e), (function (t, n, r, e) { if (r !== n - 1) { var i = n - r; (t.c[r + 1].shift += e / i), (t.c[n].shift -= e / i), (t.c[n].change -= e - e / i); } })(t, n, r, e); } function c(t) { return 0 === t.cs ? t.tl : t.c[0]; } function f(t) { return 0 === t.cs ? t.tr : t.c[t.cs - 1]; } function s(t) { return t.y + t.h; } function l(t, n, r) { for (; null !== r && t >= r.low; ) r = r.nxt; return { low: t, index: n, nxt: r }; } !(function t(n, r, e) { void 0 === e && (e = 0), r ? ((n.x = e), (e += n.width)) : ((n.y = e), (e += n.height)), n.children.forEach(function (n) { t(n, r, e); }); })(t, i); var d = r.fromNode(t, i); return ( (function t(n) { if (0 !== n.cs) { t(n.c[0]); for ( var r = l(s(n.c[0].el), 0, null), e = 1; e < n.cs; ++e ) { t(n.c[e]); var i = s(n.c[e].er); u(n, e, r), (r = l(i, e, r)); } !(function (t) { t.prelim = (t.c[0].prelim + t.c[0].mod + t.c[t.cs - 1].mod + t.c[t.cs - 1].prelim + t.c[t.cs - 1].w) / 2 - t.w / 2; })(n), o(n); } else o(n); })(d), (function t(n, r) { (r += n.mod), (n.x = n.prelim + r), (function (t) { for (var n = 0, r = 0, e = 0; e < t.cs; e++) (n += t.c[e].shift), (r += n + t.c[e].change), (t.c[e].mod += r); })(n); for (var e = 0; e < n.cs; e++) t(n.c[e], r); })(d, 0), (function t(n, r, e) { e ? (r.y = n.x) : (r.x = n.x), n.c.forEach(function (n, i) { t(n, r.children[i], e); }); })(d, t, i), e(t, i), t ); }); }, function (t, n, r) { var e = r(11), i = r(115), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return ( (this.rootNode.width = 0), o(this.rootNode, this.options, i) ); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7); function i(t, n) { void 0 === t && (t = 0), void 0 === n && (n = []); var r = this; (r.x = r.y = 0), (r.leftChild = r.rightChild = null), (r.height = 0), (r.children = n); } var o = { isHorizontal: !0, nodeSep: 20, nodeSize: 20, rankSep: 200, subTreeSep: 10, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, o, n)); var r, u = 0, a = (function t(n) { if (!n) return null; (n.width = 0), n.depth && n.depth > u && (u = n.depth); var r = n.children, e = r.length, o = new i(n.height, []); return ( r.forEach(function (n, r) { var i = t(n); o.children.push(i), 0 === r && (o.leftChild = i), r === e - 1 && (o.rightChild = i); }), (o.originNode = n), (o.isLeaf = n.isLeaf()), o ); })(t); return ( (function t(n) { if (n.isLeaf || 0 === n.children.length) n.drawingDepth = u; else { var r = n.children.map(function (n) { return t(n); }), e = Math.min.apply(null, r); n.drawingDepth = e - 1; } return n.drawingDepth; })(a), (function t(e) { (e.x = e.drawingDepth * n.rankSep), e.isLeaf ? ((e.y = 0), r && ((e.y = r.y + r.height + n.nodeSep), e.originNode.parent !== r.originNode.parent && (e.y += n.subTreeSep)), (r = e)) : (e.children.forEach(function (n) { t(n); }), (e.y = (e.leftChild.y + e.rightChild.y) / 2)); })(a), (function t(n, r, e) { e ? ((r.x = n.x), (r.y = n.y)) : ((r.x = n.y), (r.y = n.x)), n.children.forEach(function (n, i) { t(n, r.children[i], e); }); })(a, t, n.isHorizontal), t ); }; }, function (t, n, r) { var e = r(11), i = r(117), o = r(30), u = r(7), a = ["LR", "RL", "H"], c = a[0], f = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { var t = this.options, n = this.rootNode; t.isHorizontal = !0; var r = t.indent, e = void 0 === r ? 20 : r, u = t.dropCap, f = void 0 === u || u, s = t.direction || c; if (s && -1 === a.indexOf(s)) throw new TypeError("Invalid direction: " + s); if (s === a[0]) i(n, e, f); else if (s === a[1]) i(n, e, f), n.right2left(); else if (s === a[2]) { var l = o(n, t), d = l.left, h = l.right; i(d, e, f), d.right2left(), i(h, e, f); var p = d.getBoundingBox(); h.translate(p.width, 0), (n.x = h.x - n.width / 2); } return n; }), e ); })(e), s = {}; t.exports = function (t, n) { return (n = u.assign({}, s, n)), new f(t, n).execute(); }; }, function (t, n) { t.exports = function (t, n, r) { var e = null; t.eachNode(function (t) { !(function (t, n, r, e) { if (!e) try { if (t.id === t.parent.children[0].id) return ( (t.x += r * t.depth), void (t.y = n ? n.y : 0) ); } catch (t) {} (t.x += r * t.depth), (t.y = n ? n.y + n.height : 0); })(t, e, n, r), (e = t); }); }; }, function (t, n, r) { var e = r(11), i = r(119), o = r(17), u = r(7), a = (function (t) { var n, r; function e() { return t.apply(this, arguments) || this; } return ( (r = t), ((n = e).prototype = Object.create(r.prototype)), (n.prototype.constructor = n), (n.__proto__ = r), (e.prototype.execute = function () { return o(this.rootNode, this.options, i); }), e ); })(e), c = {}; t.exports = function (t, n) { return (n = u.assign({}, c, n)), new a(t, n).execute(); }; }, function (t, n, r) { var e = r(7), i = { getSubTreeSep: function () { return 0; }, }; t.exports = function (t, n) { void 0 === n && (n = {}), (n = e.assign({}, i, n)), (t.parent = { x: 0, width: 0, height: 0, y: 0 }), t.BFTraverse(function (t) { t.x = t.parent.x + t.parent.width; }), (t.parent = null), (function t(n, r) { var e = 0; return ( n.children.length ? n.children.forEach(function (n) { e += t(n, r); }) : (e = n.height), (n._subTreeSep = r.getSubTreeSep(n.data)), (n.totalHeight = Math.max(n.height, e) + 2 * n._subTreeSep), n.totalHeight ); })(t, n), (t.startY = 0), (t.y = t.totalHeight / 2 - t.height / 2), t.eachNode(function (t) { var n = t.children, r = n.length; if (r) { var e = n[0]; if (((e.startY = t.startY + t._subTreeSep), 1 === r)) e.y = t.y + t.height / 2 - e.height / 2; else { e.y = e.startY + e.totalHeight / 2 - e.height / 2; for (var i = 1; i < r; i++) { var o = n[i]; (o.startY = n[i - 1].startY + n[i - 1].totalHeight), (o.y = o.startY + o.totalHeight / 2 - o.height / 2); } } } }), (function t(n) { var r = n.children, e = r.length; if (e) { r.forEach(function (n) { t(n); }); var i = r[0], o = r[e - 1], u = o.y - i.y + o.height, a = 0; if ( (r.forEach(function (t) { a += t.totalHeight; }), u > n.height) ) n.y = i.y + u / 2 - n.height / 2; else if (1 !== r.length || n.height > a) { var c = n.y + (n.height - u) / 2 - i.y; r.forEach(function (t) { t.translate(0, c); }); } else n.y = (i.y + i.height / 2 + o.y + o.height / 2) / 2 - n.height / 2; } })(t); }; }, ]); }), "object" === u(n) && "object" === u(t) ? (t.exports = o()) : ((e = []), void 0 === (i = "function" == typeof (r = o) ? r.apply(n, e) : r) || (t.exports = i)); }).call(this, r(50)(t)); }, 214: function (t, n, r) { "use strict"; r.r(n); var e = r(1), i = r(104), o = r.n(i), u = r(0); n.default = function (t) { var n = t.Graph, r = t.Util, i = r.radialLayout, a = r.traverseTree; return (function (t) { function n(n) { var r = t.call(this, n) || this; return ( (r.layoutAnimating = !1), r.set("removeList", []), r.set("layoutMethod", r.getLayout()), r ); } return ( Object(e.c)(n, t), (n.prototype.getLayout = function () { var t = this.get("layout"); return t ? "function" == typeof t ? t : (t.type || (t.type = "dendrogram"), t.direction || (t.direction = "TB"), t.radial ? function (n) { var r = o.a[t.type](n, t); return i(r), r; } : function (n) { return o.a[t.type](n, t); }) : null; }), (n.indexOfChild = function (t, n) { var r = -1; return ( Object(u.c)(t, function (t, e) { if (n === t.id) return (r = e), !1; }), r ); }), (n.prototype.getDefaultCfg = function () { var n = t.prototype.getDefaultCfg.call(this); return (n.animate = !0), n; }), (n.prototype.innerAddChild = function (t, n, r) { var e = this, i = t.data; i && ((i.x = t.x), (i.y = t.y), (i.depth = t.depth)); var o = e.addItem("node", i, !1); if (n) { if ((o.set("parent", n), r)) { var a = n.get("originAttrs"); if (a) o.set("originAttrs", a); else { var c = n.getModel(); o.set("originAttrs", { x: c.x, y: c.y }); } } var f = n.get("children"); f ? f.push(o) : n.set("children", [o]), e.addItem( "edge", { source: n, target: o, id: n.get("id") + ":" + o.get("id"), }, !1, ); } return ( Object(u.c)(t.children || [], function (t) { e.innerAddChild(t, o, r); }), e.emit("afteraddchild", { item: o, parent: n }), o ); }), (n.prototype.innerUpdateChild = function (t, r, e) { var i = this, o = i.findById(t.id); if (o) { Object(u.c)(t.children || [], function (t) { i.innerUpdateChild(t, o, e); }); var a, c, f = o.get("children"); if (f) if (f.length > 0) for (var s = f.length - 1; s >= 0; s--) { var l = f[s].getModel(); -1 === n.indexOfChild(t.children || [], l.id) && (i.innerRemoveChild(l.id, { x: t.x, y: t.y }, e), f.splice(s, 1)); } o.get("originAttrs") && ((a = o.get("originAttrs").x), (c = o.get("originAttrs").y)); var d = o.getModel(); e && o.set("originAttrs", { x: d.x, y: d.y }), o.set("model", t.data), (a === t.x && c === t.y) || o.updatePosition({ x: t.x, y: t.y }); } else i.innerAddChild(t, r, e); }), (n.prototype.innerRemoveChild = function (t, n, r) { var e = this, i = e.findById(t); if (i) if ( (Object(u.c)(i.get("children"), function (t) { e.innerRemoveChild(t.getModel().id, n, r); }), r) ) { var o = i.getModel(); i.set("to", n), i.set("originAttrs", { x: o.x, y: o.y }), e.get("removeList").push(i); } else e.removeItem(i); }), (n.prototype.changeData = function (t) { var n = this; this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }), t ? (n.data(t), n.render()) : n.layout(this.get("fitView")); }), (n.prototype.changeLayout = function (t) { console.warn( "Please call updateLayout instead of changeLayout. changeLayout will be discarded soon", ); this.updateLayout(t); }), (n.prototype.updateLayout = function (t) { t ? (this.set("layout", t), this.set("layoutMethod", this.getLayout()), this.layout()) : console.warn("layout cannot be null"); }), (n.prototype.refreshLayout = function (t) { console.warn( "Please call layout instead of refreshLayout. refreshLayout will be discarded soon", ); this.layout(t); }), (n.prototype.layout = function (t) { var n = this.get("data"), r = this.get("layoutMethod")(n, this.get("layout")), e = this.get("animate"); (this.emit("beforerefreshlayout", { data: n, layoutData: r }), this.emit("beforelayout"), this.innerUpdateChild(r, void 0, e), t) && this.get("viewController").fitView(); e ? this.layoutAnimate(r) : (this.refresh(), this.paint()), this.emit("afterrefreshlayout", { data: n, layoutData: r }), this.emit("afterlayout"); }), (n.prototype.addChild = function (t, n) { this.emit("beforeaddchild", { model: t, parent: n }), Object(u.o)(n) || (n = n.get("id")); var r = this.findDataById(n); r && (r.children || (r.children = []), r.children.push(t), this.changeData()); }), (n.prototype.updateChildren = function (t, n) { n && this.findById(n) ? ((this.findDataById(n).children = t), this.changeData()) : console.warn( "Update children failed! There is no node with id '" + n + "'", ); }), (n.prototype.updateChild = function (t, r) { if (r && this.findById(r)) { var e = this.findDataById(r), i = this.findById(t.id); if ((e.children || (e.children = []), i)) { var o = n.indexOfChild(e.children, t.id); e.children[o] = t; } else e.children.push(t); this.changeData(); } else this.changeData(t); }), (n.prototype.removeChild = function (t) { var r = this.findById(t); if (r) { var e = r.get("parent"); if (e && !e.destroyed) { var i = this.findDataById(e.get("id")), o = (i && i.children) || [], u = r.getModel(), a = n.indexOfChild(o, u.id); o.splice(a, 1); } this.changeData(); } }), (n.prototype.findDataById = function (t, n) { var r = this; if ((n || (n = r.get("data")), t === n.id)) return n; var e = null; return ( Object(u.c)(n.children || [], function (n) { return n.id === t ? ((e = n), !1) : !(e = r.findDataById(t, n)) && void 0; }), e ); }), (n.prototype.layoutAnimate = function (t, n) { var r = this, e = this.get("animateCfg"); r.emit("beforeanimate", { data: t }), r.getEdges().forEach(function (t) { var n = t.get("model"); n.sourceAnchor || (n.sourceAnchor = t.get("sourceAnchorIndex")); }), this.get("canvas").animate( function (e) { a(t, function (i) { var o = r.findById(i.id); if (o) { var u = o.get("originAttrs"), a = o.get("model"); if ( (u || ((u = { x: a.x, y: a.y }), o.set("originAttrs", u)), n) ) { var c = n(o, e, u, t); o.set("model", Object.assign(a, c)); } else (a.x = u.x + (i.x - u.x) * e), (a.y = u.y + (i.y - u.y) * e); } return !0; }), Object(u.c)(r.get("removeList"), function (t) { var n = t.getModel(), r = t.get("originAttrs"), i = t.get("to"); (n.x = r.x + (i.x - r.x) * e), (n.y = r.y + (i.y - r.y) * e); }), r.refreshPositions(); }, { duration: e.duration, easing: e.ease, callback: function () { Object(u.c)(r.getNodes(), function (t) { t.set("originAttrs", null); }), Object(u.c)(r.get("removeList"), function (t) { r.removeItem(t); }), r.set("removeList", []), e.callback && e.callback(), r.emit("afteranimate", { data: t }); }, delay: e.delay, }, ); }), (n.prototype.stopLayoutAnimate = function () { this.get("canvas").stopAnimate(), this.emit("layoutanimateend", { data: this.get("data") }), (this.layoutAnimating = !1); }), (n.prototype.isLayoutAnimating = function () { return this.layoutAnimating; }), (n.prototype.render = function () { if (!this.get("data")) throw new Error("data must be defined first"); this.clear(), this.emit("beforerender"), this.layout(this.get("fitView")), this.emit("afterrender"); }), (n.prototype.save = function () { return this.get("data"); }), n ); })(n); }; }, 50: function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, }).default; }); //# sourceMappingURL=treeGraph.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/circularLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function r(n) { if (e[n]) return e[n].exports; var o = (e[n] = { i: n, l: !1, exports: {} }); return t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; } return ( (r.m = t), (r.c = e), (r.d = function (t, e, n) { r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); }), (r.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (r.t = function (t, e) { if ((1 & e && (t = r(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var n = Object.create(null); if ( (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) r.d( n, o, function (e) { return t[e]; }.bind(null, o), ); return n; }), (r.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return r.d(e, "a", e), e; }), (r.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (r.p = ""), r((r.s = 215)) ); })({ 10: function (t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? function (t, e, r, n) { void 0 === n && (n = r), Object.defineProperty(t, n, { enumerable: !0, get: function () { return e[r]; }, }); } : function (t, e, r, n) { void 0 === n && (n = r), (t[n] = e[r]); }), o = (this && this.__exportStar) || function (t, e) { for (var r in t) "default" === r || Object.prototype.hasOwnProperty.call(e, r) || n(e, t, r); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(r(11), e), o(r(12), e), o(r(13), e), o(r(14), e), o(r(15), e), o(r(16), e); }, 11: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var n, o, i = /-(\w)/g; e.camelize = ((n = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = n(t)); }); }, 12: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var r = parseFloat(t); return e.isNaN(r) ? t : r; }; }, 14: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, r) { for (var n = [], o = 0; o < t; o++) n[o] = 0; return r ? (r.forEach(function (t) { t.source && (n[e[t.source]] += 1), t.target && (n[e[t.target]] += 1); }), n) : n; }; e.floydWarshall = function (t) { for (var e = [], r = t.length, n = 0; n < r; n += 1) { e[n] = []; for (var o = 0; o < r; o += 1) n === o ? (e[n][o] = 0) : 0 !== t[n][o] && t[n][o] ? (e[n][o] = t[n][o]) : (e[n][o] = 1 / 0); } for (var i = 0; i < r; i += 1) for (n = 0; n < r; n += 1) for (o = 0; o < r; o += 1) e[n][o] > e[n][i] + e[i][o] && (e[n][o] = e[n][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var r = t.nodes, n = t.edges, o = [], i = {}; if (!r) throw new Error("invalid nodes data!"); return ( r && r.forEach(function (t, e) { i[t.id] = e; o.push([]); }), n && n.forEach(function (t) { var r = t.source, n = t.target, u = i[r], s = i[n]; (o[u][s] = 1), e || (o[s][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var r = []; return ( t.forEach(function (t) { var n = []; t.forEach(function (t) { n.push(t * e); }), r.push(n); }), r ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, r) { if (e && e.children) for (var n = e.children.length - 1; n >= 0; n--) if (!t(e.children[n], r)) return; return !!r(e); })(t, e); }; }, 15: function (t, e, r) { "use strict"; function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, r = 1, n = arguments.length; r < n; r++) for (var o in (e = arguments[r])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === n(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var r = []; return ( t.forEach(function (t) { r.push(t); }), r.map(function (t) { return e.clone(t); }) ); } if ("object" === n(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 171: function (t, e, r) { "use strict"; var n, o = (this && this.__extends) || ((n = function (t, e) { return (n = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function r() { this.constructor = t; } n(t, e), (t.prototype = null === e ? Object.create(e) : ((r.prototype = e.prototype), new r())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.CircularLayout = void 0); var i = r(7), u = r(10); function s(t, e) { var r = t.degree, n = e.degree; return r < n ? -1 : r > n ? 1 : 0; } var c = (function (t) { function e(e) { var r = t.call(this) || this; return ( (r.radius = null), (r.startRadius = null), (r.endRadius = null), (r.startAngle = 0), (r.endAngle = 2 * Math.PI), (r.clockwise = !0), (r.divisions = 1), (r.ordering = null), (r.angleRatio = 1), (r.nodes = []), (r.edges = []), (r.nodeMap = {}), (r.degrees = []), (r.width = 300), (r.height = 300), r.updateCfg(e), r ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { radius: null, startRadius: null, endRadius: null, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0, divisions: 1, ordering: null, angleRatio: 1, }; }), (e.prototype.execute = function () { var t = this.nodes, e = this.edges, r = t.length; if (0 !== r) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === r) return ( (t[0].x = n[0]), (t[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var o = this.radius, i = this.startRadius, s = this.endRadius, c = this.divisions, a = this.startAngle, f = this.endAngle, d = (f - a) / r, l = {}; t.forEach(function (t, e) { l[t.id] = e; }), (this.nodeMap = l); var h = u.getDegree(t.length, l, e); (this.degrees = h), o || i || s ? !i && s ? (i = s) : i && !s && (s = i) : (o = this.height > this.width ? this.width / 2 : this.height / 2); var p = d * this.angleRatio, y = this.ordering, g = []; g = "topology" === y ? this.topologyOrdering() : "topology-directed" === y ? this.topologyOrdering(!0) : "degree" === y ? this.degreeOrdering() : t; for ( var v = this.clockwise, b = Math.ceil(r / c), _ = 0; _ < r; ++_ ) { var O = o; O || null === i || null === s || (O = i + (_ * (s - i)) / (r - 1)), O || (O = 10 + (100 * _) / (r - 1)); var j = a + (_ % b) * p + ((2 * Math.PI) / c) * Math.floor(_ / b); v || (j = f - (_ % b) * p - ((2 * Math.PI) / c) * Math.floor(_ / b)), (g[_].x = n[0] + Math.cos(j) * O), (g[_].y = n[1] + Math.sin(j) * O), (g[_].weight = h[_]); } return ( this.onLayoutEnd && this.onLayoutEnd(), { nodes: g, edges: this.edges } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.topologyOrdering = function (t) { void 0 === t && (t = !1); var e = this.degrees, r = this.edges, n = this.nodes, o = u.clone(n), i = this.nodeMap, s = [o[0]], c = [n[0]], a = [], f = n.length; (a[0] = !0), (function (t, e, r, n) { t.forEach(function (e, r) { (t[r].children = []), (t[r].parent = []); }), n ? e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].parent; i.push(t[o].id), u.push(t[n].id); }) : e.forEach(function (e) { var n = 0; e.source && (n = r[e.source]); var o = 0; e.target && (o = r[e.target]); var i = t[n].children, u = t[o].children; i.push(t[o].id), u.push(t[n].id); }); })(o, r, i, t); var d = 0; return ( o.forEach(function (t, u) { if (0 !== u) if ( (u !== f - 1 && e[u] === e[u + 1] && !(function (t, e, r) { for (var n = r.length, o = 0; o < n; o++) if ( (t.id === r[o].source && e.id === r[o].target) || (e.id === r[o].source && t.id === r[o].target) ) return !0; return !1; })(s[d], t, r)) || a[u] ) { for ( var l = s[d].children, h = !1, p = 0; p < l.length; p++ ) { var y = i[l[p]]; if (e[y] === e[u] && !a[y]) { s.push(o[y]), c.push(n[i[o[y].id]]), (a[y] = !0), (h = !0); break; } } for ( var g = 0; !h && (a[g] || (s.push(o[g]), c.push(n[i[o[g].id]]), (a[g] = !0), (h = !0)), ++g !== f); ); } else s.push(t), c.push(n[i[t.id]]), (a[u] = !0), d++; }), c ); }), (e.prototype.degreeOrdering = function () { var t = this.nodes, e = [], r = this.degrees; return ( t.forEach(function (t, n) { (t.degree = r[n]), e.push(t); }), e.sort(s), e ); }), (e.prototype.getType = function () { return "circular"; }), e ); })(i.Base); e.CircularLayout = c; }, 215: function (t, e, r) { "use strict"; r.r(e); var n = r(171); e.default = n.CircularLayout; }, 7: function (t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var n = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = n; }, }).default; }); //# sourceMappingURL=circularLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/comboForceLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 216)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, c = i[o], a = i[r]; (n[c][a] = 1), t || (n[a][c] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 172: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ComboForceLayout = void 0); var i = o(7), c = o(10), a = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.center = [0, 0]), (o.maxIteration = 100), (o.gravity = 10), (o.comboGravity = 10), (o.linkDistance = 10), (o.alpha = 1), (o.alphaMin = 0.001), (o.alphaDecay = 1 - Math.pow(o.alphaMin, 1 / 300)), (o.alphaTarget = 0), (o.velocityDecay = 0.6), (o.edgeStrength = 0.6), (o.nodeStrength = 30), (o.preventOverlap = !1), (o.preventNodeOverlap = !1), (o.preventComboOverlap = !1), (o.collideStrength = void 0), (o.nodeCollideStrength = 0.5), (o.comboCollideStrength = 0.5), (o.comboSpacing = 20), (o.comboPadding = 10), (o.optimizeRangeFactor = 1), (o.onTick = function () {}), (o.onLayoutEnd = function () {}), (o.depthAttractiveForceScale = 1), (o.depthRepulsiveForceScale = 2), (o.nodes = []), (o.edges = []), (o.combos = []), (o.comboTrees = []), (o.width = 300), (o.height = 300), (o.bias = []), (o.nodeMap = {}), (o.oriComboMap = {}), (o.indexMap = {}), (o.comboMap = {}), (o.previousLayouted = !1), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { maxIteration: 100, center: [0, 0], gravity: 10, speed: 1, comboGravity: 30, preventOverlap: !1, preventComboOverlap: !0, preventNodeOverlap: !0, nodeSpacing: void 0, collideStrength: void 0, nodeCollideStrength: 0.5, comboCollideStrength: 0.5, comboSpacing: 20, comboPadding: 10, edgeStrength: 0.6, nodeStrength: 30, linkDistance: 10, }; }), (t.prototype.execute = function () { var e = this.nodes, t = this.center; if ( ((this.comboTree = { id: "comboTreeRoot", depth: -1, children: this.comboTrees, }), e && 0 !== e.length) ) { if (1 === e.length) return ( (e[0].x = t[0]), (e[0].y = t[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); this.initVals(), this.run(), this.onLayoutEnd && this.onLayoutEnd(); } else this.onLayoutEnd && this.onLayoutEnd(); }), (t.prototype.run = function () { var e = this, t = e.nodes, o = e.previousLayouted ? e.maxIteration / 5 : e.maxIteration; e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var r = e.center, n = e.velocityDecay, i = e.comboMap; e.previousLayouted || e.initPos(i); for ( var a = function (o) { var r = []; t.forEach(function (e, t) { r[t] = { x: 0, y: 0 }; }), e.applyCalculate(r), e.applyComboCenterForce(r), t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += r[t].x * n), (e.y += r[t].y * n)); }), (e.alpha += (e.alphaTarget - e.alpha) * e.alphaDecay), e.onTick(); }, u = 0; u < o; u++ ) a(); var s = [0, 0]; t.forEach(function (e) { c.isNumber(e.x) && c.isNumber(e.y) && ((s[0] += e.x), (s[1] += e.y)); }), (s[0] /= t.length), (s[1] /= t.length); var f = [r[0] - s[0], r[1] - s[1]]; t.forEach(function (e, t) { c.isNumber(e.x) && c.isNumber(e.y) && ((e.x += f[0]), (e.y += f[1])); }), e.combos.forEach(function (e) { var t = i[e.id]; t && t.empty && ((e.x = t.cx || e.x), (e.y = t.cy || e.y)); }), (e.previousLayouted = !0); }), (t.prototype.initVals = function () { var e = this.edges, t = this.nodes, o = this.combos, r = {}, n = {}, i = {}; t.forEach(function (e, t) { (n[e.id] = e), (i[e.id] = t); }), (this.nodeMap = n), (this.indexMap = i); var a = {}; o.forEach(function (e) { a[e.id] = e; }), (this.oriComboMap = a), (this.comboMap = this.getComboMap()); var u = this.preventOverlap; (this.preventComboOverlap = this.preventComboOverlap || u), (this.preventNodeOverlap = this.preventNodeOverlap || u); var s = this.collideStrength; s && ((this.comboCollideStrength = s), (this.nodeCollideStrength = s)), (this.comboCollideStrength = this.comboCollideStrength ? this.comboCollideStrength : 0), (this.nodeCollideStrength = this.nodeCollideStrength ? this.nodeCollideStrength : 0); for (var f = 0; f < e.length; ++f) r[e[f].source] ? r[e[f].source]++ : (r[e[f].source] = 1), r[e[f].target] ? r[e[f].target]++ : (r[e[f].target] = 1); var d = []; for (f = 0; f < e.length; ++f) d[f] = r[e[f].source] / (r[e[f].source] + r[e[f].target]); this.bias = d; var p, h, l = this.nodeSize, y = this.nodeSpacing; if ( ((h = c.isNumber(y) ? function () { return y; } : c.isFunction(y) ? y : function () { return 0; }), (this.nodeSpacing = h), l) ) if (c.isFunction(l)) p = function (e) { return l(e); }; else if (c.isArray(l)) { var v = (l[0] > l[1] ? l[0] : l[1]) / 2; p = function (e) { return v; }; } else { var m = l / 2; p = function (e) { return m; }; } else p = function (e) { return e.size ? c.isArray(e.size) ? (e.size[0] > e.size[1] ? e.size[0] : e.size[1]) / 2 : e.size / 2 : 10; }; this.nodeSize = p; var b, g = this.comboSpacing; (b = c.isNumber(g) ? function () { return g; } : c.isFunction(g) ? g : function () { return 0; }), (this.comboSpacing = b); var x, S = this.comboPadding; (x = c.isNumber(S) ? function () { return S; } : c.isArray(S) ? function () { return Math.max.apply(null, S); } : c.isFunction(S) ? S : function () { return 0; }), (this.comboPadding = x); var M, O = this.linkDistance; O || (O = 10), (M = c.isNumber(O) ? function (e) { return O; } : O), (this.linkDistance = M); var N, C = this.edgeStrength; C || (C = 1), (N = c.isNumber(C) ? function (e) { return C; } : C), (this.edgeStrength = N); var E, _ = this.nodeStrength; _ || (_ = 30), (E = c.isNumber(_) ? function (e) { return _; } : _), (this.nodeStrength = E); }), (t.prototype.initPos = function (e) { this.nodes.forEach(function (t, o) { var r = t.comboId, n = e[r]; r && n ? ((t.x = n.cx + 100 / (o + 1)), (t.y = n.cy + 100 / (o + 1))) : ((t.x = 100 / (o + 1)), (t.y = 100 / (o + 1))); }); }), (t.prototype.getComboMap = function () { var e = this, t = e.nodeMap, o = e.indexMap, r = e.comboTrees, n = e.oriComboMap, i = {}; return ( (r || []).forEach(function (r) { var a = []; c.traverseTreeUp(r, function (r) { if ("node" === r.itemType) return !0; if (!n[r.id]) return !0; if (void 0 === i[r.id]) { var u = { id: r.id, name: r.id, cx: 0, cy: 0, count: 0, depth: e.oriComboMap[r.id].depth, children: [], }; i[r.id] = u; } var s = r.children; s && s.forEach(function (e) { if (!i[e.id] && !t[e.id]) return !0; a.push(e); }); var f = i[r.id]; if (((f.cx = 0), (f.cy = 0), 0 === a.length)) { f.empty = !0; var d = n[r.id], p = Object.keys(t).length, h = r.id + "-visual-child-" + p, l = { id: h, x: d.x, y: d.y, depth: f.depth + 1, itemType: "node", }; e.nodes.push(l), (t[h] = l), (o[h] = p), (f.cx = d.x), (f.cy = d.y), a.push(l); } return ( a.forEach(function (e) { if ((f.count++, "node" !== e.itemType)) { var o = i[e.id]; return ( c.isNumber(o.cx) && (f.cx += o.cx), void (c.isNumber(o.cy) && (f.cy += o.cy)) ); } var r = t[e.id]; r && (c.isNumber(r.x) && (f.cx += r.x), c.isNumber(r.y) && (f.cy += r.y)); }), (f.cx /= f.count), (f.cy /= f.count), (f.children = a), !0 ); }); }), i ); }), (t.prototype.applyComboCenterForce = function (e) { var t = this.gravity, o = this.comboGravity || t, r = this.alpha, n = this.comboTrees, i = this.indexMap, a = this.nodeMap, u = this.comboMap; (n || []).forEach(function (t) { c.traverseTreeUp(t, function (t) { if ("node" === t.itemType) return !0; if (!u[t.id]) return !0; var n = u[t.id], s = ((n.depth + 1) / 10) * 0.5, f = n.cx, d = n.cy; return ( (n.cx = 0), (n.cy = 0), n.children.forEach(function (t) { if ("node" !== t.itemType) { var p = u[t.id]; return ( p && c.isNumber(p.cx) && (n.cx += p.cx), void (p && c.isNumber(p.cy) && (n.cy += p.cy)) ); } var h = a[t.id], l = h.x - f || 0.005, y = h.y - d || 0.005, v = Math.sqrt(l * l + y * y), m = i[h.id], b = ((o * r) / v) * s; (e[m].x -= l * b), (e[m].y -= y * b), c.isNumber(h.x) && (n.cx += h.x), c.isNumber(h.y) && (n.cy += h.y); }), (n.cx /= n.count), (n.cy /= n.count), !0 ); }); }); }), (t.prototype.applyCalculate = function (e) { var t = this.comboMap, o = this.nodes, r = {}; o.forEach(function (e, t) { o.forEach(function (o, n) { if (!(t < n)) { var i = e.x - o.x || 0.005, c = e.y - o.y || 0.005, a = i * i + c * c, u = Math.sqrt(a); a < 1 && (a = u), (r[e.id + "-" + o.id] = { vx: i, vy: c, vl2: a, vl: u }), (r[o.id + "-" + e.id] = { vl2: a, vl: u, vx: -i, vy: -c, }); } }); }), this.updateComboSizes(t), this.calRepulsive(e, r), this.calAttractive(e, r), this.preventComboOverlap && this.comboNonOverlapping(e, t); }), (t.prototype.updateComboSizes = function (e) { var t = this, o = t.comboTrees, r = t.nodeMap, n = t.nodeSize, i = t.comboSpacing, a = t.comboPadding; (o || []).forEach(function (o) { var u = []; c.traverseTreeUp(o, function (o) { if ("node" === o.itemType) return !0; var s = e[o.id]; if (!s) return !1; var f = o.children; f && f.forEach(function (t) { (e[t.id] || r[t.id]) && u.push(t); }), (s.minX = 1 / 0), (s.minY = 1 / 0), (s.maxX = -1 / 0), (s.maxY = -1 / 0), u.forEach(function (e) { if ("node" !== e.itemType) return !0; var t = r[e.id]; if (!t) return !0; var o = n(t), i = t.x - o, c = t.y - o, a = t.x + o, u = t.y + o; s.minX > i && (s.minX = i), s.minY > c && (s.minY = c), s.maxX < a && (s.maxX = a), s.maxY < u && (s.maxY = u); }); var d = t.oriComboMap[o.id].size || 10; c.isArray(d) && (d = d[0]); var p = Math.max(s.maxX - s.minX, s.maxY - s.minY, d); return (s.r = p / 2 + i(s) / 2 + a(s)), !0; }); }); }), (t.prototype.comboNonOverlapping = function (e, t) { var o = this.comboTree, r = this.comboCollideStrength, n = this.indexMap, i = this.nodeMap; c.traverseTreeUp(o, function (o) { if (!t[o.id] && !i[o.id] && "comboTreeRoot" !== o.id) return !1; var c = o.children; return ( c && c.length > 1 && c.forEach(function (o, a) { if ("node" === o.itemType) return !1; var u = t[o.id]; u && c.forEach(function (c, s) { if (a <= s) return !1; if ("node" === c.itemType) return !1; var f = t[c.id]; if (!f) return !1; var d = u.cx - f.cx || 0.005, p = u.cy - f.cy || 0.005, h = d * d + p * p, l = u.r, y = f.r, v = l + y, m = y * y, b = l * l; if (h < v * v) { var g = o.children; if (!g || 0 === g.length) return !1; var x = c.children; if (!x || 0 === x.length) return !1; var S = Math.sqrt(h), M = ((v - S) / S) * r, O = d * M, N = p * M, C = m / (b + m), E = 1 - C; g.forEach(function (t) { if ("node" !== t.itemType) return !1; if (i[t.id]) { var o = n[t.id]; x.forEach(function (t) { if ("node" !== t.itemType) return !1; if (!i[t.id]) return !1; var r = n[t.id]; (e[o].x += O * C), (e[o].y += N * C), (e[r].x -= O * E), (e[r].y -= N * E); }); } }); } }); }), !0 ); }); }), (t.prototype.calRepulsive = function (e, t) { var o = this, r = o.nodes, n = o.width * o.optimizeRangeFactor, i = o.nodeStrength, c = o.alpha, a = o.nodeCollideStrength, u = o.preventNodeOverlap, s = o.nodeSize, f = o.nodeSpacing, d = o.depthRepulsiveForceScale, p = o.center; r.forEach(function (h, l) { if (h.x && h.y) { if (p) { var y = o.gravity, v = h.x - p[0] || 0.005, m = h.y - p[1] || 0.005, b = Math.sqrt(v * v + m * m); (e[l].x -= (v * y * c) / b), (e[l].y -= (m * y * c) / b); } r.forEach(function (o, r) { if (l !== r && o.x && o.y) { var p = t[h.id + "-" + o.id], y = p.vl2, v = p.vl; if (!(v > n)) { var m = t[h.id + "-" + o.id], b = m.vx, g = m.vy, x = Math.log(Math.abs(o.depth - h.depth) / 10) + 1 || 1; (x = x < 1 ? 1 : x), o.comboId !== h.comboId && (x += 1); var S = x ? Math.pow(d, x) : 1, M = ((i(o) * c) / y) * S; if ( ((e[l].x += b * M), (e[l].y += g * M), l < r && u) ) { var O = s(h) + f(h), N = s(o) + f(o), C = O + N; if (y < C * C) { var E = ((C - v) / v) * a, _ = N * N, j = _ / (O * O + _), T = b * E, w = g * E; (e[l].x += T * j), (e[l].y += w * j), (j = 1 - j), (e[r].x -= T * j), (e[r].y -= w * j); } } } } }); } }); }), (t.prototype.calAttractive = function (e, t) { var o = this, r = o.edges, n = o.linkDistance, i = o.alpha, a = o.edgeStrength, u = o.bias, s = o.depthAttractiveForceScale; r.forEach(function (r, f) { if (r.source && r.target && r.source !== r.target) { var d = o.indexMap[r.source], p = o.indexMap[r.target], h = o.nodeMap[r.source], l = o.nodeMap[r.target]; if (h && l) { var y = Math.log(Math.abs(h.depth - l.depth) / 10); h.comboId === l.comboId && (y /= 2); var v = y ? Math.pow(s, y) : 1; if ( (h.comboId !== l.comboId && 1 === v ? (v = s / 2) : h.comboId === l.comboId && (v = 2), c.isNumber(l.x) && c.isNumber(h.x) && c.isNumber(l.y) && c.isNumber(h.y)) ) { var m = t[r.target + "-" + r.source], b = m.vl, g = m.vx, x = m.vy, S = ((b - n(r)) / b) * i * a(r) * v, M = g * S, O = x * S, N = u[f]; (e[p].x -= M * N), (e[p].y -= O * N), (e[d].x += M * (1 - N)), (e[d].y += O * (1 - N)); } } } }); }), (t.prototype.getType = function () { return "comboForce"; }), t ); })(i.Base); t.ComboForceLayout = a; }, 216: function (e, t, o) { "use strict"; o.r(t); var r = o(172); t.default = r.ComboForceLayout; }, 7: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=comboForceLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/concentricLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function n(r) { if (t[r]) return t[r].exports; var o = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = e), (n.c = t), (n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (n.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (n.t = function (e, t) { if ((1 & t && (e = n(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var o in e) n.d( r, o, function (t) { return e[t]; }.bind(null, o), ); return r; }), (n.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return n.d(t, "a", t), t; }), (n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (n.p = ""), n((n.s = 217)) ); })({ 10: function (e, t, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, n, r) { void 0 === r && (r = n), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[n]; }, }); } : function (e, t, n, r) { void 0 === r && (r = n), (e[r] = t[n]); }), o = (this && this.__exportStar) || function (e, t) { for (var n in e) "default" === n || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n); }; Object.defineProperty(t, "__esModule", { value: !0 }), o(n(11), t), o(n(12), t), o(n(13), t), o(n(14), t), o(n(15), t), o(n(16), t); }, 11: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, o, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (o = Object.create(null)), function (e) { return o[e] || (o[e] = r(e)); }); }, 12: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var n = parseFloat(e); return t.isNaN(n) ? e : n; }; }, 14: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, n) { for (var r = [], o = 0; o < e; o++) r[o] = 0; return n ? (n.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], n = e.length, r = 0; r < n; r += 1) { t[r] = []; for (var o = 0; o < n; o += 1) r === o ? (t[r][o] = 0) : 0 !== e[r][o] && e[r][o] ? (t[r][o] = e[r][o]) : (t[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) t[r][o] > t[r][i] + t[i][o] && (t[r][o] = t[r][i] + t[i][o]); return t; }; t.getAdjMatrix = function (e, t) { var n = e.nodes, r = e.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (e, t) { i[e.id] = t; o.push([]); }), r && r.forEach(function (e) { var n = e.source, r = e.target, u = i[n], c = i[r]; (o[u][c] = 1), t || (o[c][u] = 1); }), o ); }; t.scaleMatrix = function (e, t) { var n = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), n.push(r); }), n ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, n) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], n)) return; return !!n(t); })(e, t); }; }, 15: function (e, t, n) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (e) { for (var t, n = 1, r = arguments.length; n < r; n++) for (var o in (t = arguments[n])) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var n = []; return ( e.forEach(function (e) { n.push(e); }), n.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = o({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 173: function (e, t, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function n() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((n.prototype = t.prototype), new n())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.ConcentricLayout = void 0); var i = n(10), u = (function (e) { function t(t) { var n = e.call(this) || this; return ( (n.nodeSize = 30), (n.minNodeSpacing = 10), (n.preventOverlap = !1), (n.equidistant = !1), (n.startAngle = 1.5 * Math.PI), (n.clockwise = !0), (n.sortBy = "degree"), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.onLayoutEnd = function () {}), n.updateCfg(t), n ); } return ( o(t, e), (t.prototype.getDefaultCfg = function () { return { nodeSize: 30, minNodeSpacing: 10, preventOverlap: !1, sweep: void 0, equidistant: !1, startAngle: 1.5 * Math.PI, clockwise: !0, maxLevelDiff: void 0, sortBy: "degree", }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, n = e.edges, r = t.length; if (0 !== r) { e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight), e.center || (e.center = [e.width / 2, e.height / 2]); var o = e.center; if (1 === r) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var u, c = []; (u = i.isArray(e.nodeSize) ? Math.max(e.nodeSize[0], e.nodeSize[1]) : e.nodeSize), t.forEach(function (e) { c.push(e); var t = u; i.isArray(e.size) ? (t = Math.max(e.size[0], e.size[1])) : i.isNumber(e.size) && (t = e.size), (u = Math.max(u, t)); }), (e.clockwise = void 0 !== e.counterclockwise ? !e.counterclockwise : e.clockwise); var a = {}, s = {}; if ( (c.forEach(function (e, t) { (a[e.id] = e), (s[e.id] = t); }), !( ("degree" !== e.sortBy && i.isString(e.sortBy) && void 0 !== c[0][e.sortBy]) || ((e.sortBy = "degree"), i.isNumber(t[0].degree)) )) ) { var f = i.getDegree(t.length, s, n); c.forEach(function (e, t) { e.degree = f[t]; }); } c.sort(function (t, n) { return n[e.sortBy] - t[e.sortBy]; }), (e.maxValueNode = c[0]), (e.maxLevelDiff = e.maxLevelDiff || e.maxValueNode[e.sortBy] / 4); var d = [[]], l = d[0]; c.forEach(function (t) { if (l.length > 0) { var n = Math.abs(l[0][e.sortBy] - t[e.sortBy]); e.maxLevelDiff && n >= e.maxLevelDiff && ((l = []), d.push(l)); } l.push(t); }); var p = u + e.minNodeSpacing; if (!e.preventOverlap) { var h = d.length > 0 && d[0].length > 1, y = (Math.min(e.width, e.height) / 2 - p) / (d.length + (h ? 1 : 0)); p = Math.min(p, y); } var v = 0; if ( (d.forEach(function (t) { var n = e.sweep; void 0 === n && (n = 2 * Math.PI - (2 * Math.PI) / t.length); var r = (t.dTheta = n / Math.max(1, t.length - 1)); if (t.length > 1 && e.preventOverlap) { var o = Math.cos(r) - Math.cos(0), i = Math.sin(r) - Math.sin(0), u = Math.sqrt((p * p) / (o * o + i * i)); v = Math.max(u, v); } (t.r = v), (v += p); }), e.equidistant) ) { for (var g = 0, b = 0, m = 0; m < d.length; m++) { var _ = d[m].r - b; g = Math.max(g, _); } (b = 0), d.forEach(function (e, t) { 0 === t && (b = e.r), (e.r = b), (b += g); }); } return ( d.forEach(function (t) { var n = t.dTheta, r = t.r; t.forEach(function (t, i) { var u = e.startAngle + (e.clockwise ? 1 : -1) * n * i; (t.x = o[0] + r * Math.cos(u)), (t.y = o[1] + r * Math.sin(u)); }); }), e.onLayoutEnd && e.onLayoutEnd(), { nodes: t, edges: n } ); } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.getType = function () { return "concentric"; }), t ); })(n(7).Base); t.ConcentricLayout = u; }, 217: function (e, t, n) { "use strict"; n.r(t); var r = n(173); t.default = r.ConcentricLayout; }, 7: function (e, t, n) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=concentricLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/dagreLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 218)) ); })([ , , , , , , , function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, , function (t, n, e) { var r; try { r = { cloneDeep: e(335), constant: e(95), defaults: e(336), each: e(131), filter: e(134), find: e(337), flatten: e(161), forEach: e(132), forIn: e(344), has: e(145), isUndefined: e(146), last: e(345), map: e(147), mapValues: e(346), max: e(347), merge: e(349), min: e(355), minBy: e(356), now: e(357), pick: e(358), range: e(363), reduce: e(149), sortBy: e(366), uniqueId: e(371), values: e(154), zipObject: e(372), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, function (t, n) { var e = Array.isArray; t.exports = e; }, , function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph; function i(t, n, e, o) { var i; do { i = r.uniqueId(o); } while (t.hasNode(i)); return (e.dummy = n), t.setNode(i, e), i; } function u(t) { return r.max( r.map(t.nodes(), function (n) { var e = t.node(n).rank; if (!r.isUndefined(e)) return e; }), ); } t.exports = { addDummyNode: i, simplify: function (t) { var n = new o().setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { var r = n.edge(e.v, e.w) || { weight: 0, minlen: 1 }, o = t.edge(e); n.setEdge(e.v, e.w, { weight: r.weight + o.weight, minlen: Math.max(r.minlen, o.minlen), }); }), n ); }, asNonCompoundGraph: function (t) { var n = new o({ multigraph: t.isMultigraph() }).setGraph(t.graph()); return ( r.forEach(t.nodes(), function (e) { t.children(e).length || n.setNode(e, t.node(e)); }), r.forEach(t.edges(), function (e) { n.setEdge(e, t.edge(e)); }), n ); }, successorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.outEdges(n), function (n) { e[n.w] = (e[n.w] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, predecessorWeights: function (t) { var n = r.map(t.nodes(), function (n) { var e = {}; return ( r.forEach(t.inEdges(n), function (n) { e[n.v] = (e[n.v] || 0) + t.edge(n).weight; }), e ); }); return r.zipObject(t.nodes(), n); }, intersectRect: function (t, n) { var e, r, o = t.x, i = t.y, u = n.x - o, c = n.y - i, a = t.width / 2, f = t.height / 2; if (!u && !c) throw new Error( "Not possible to find intersection inside of the rectangle", ); Math.abs(c) * a > Math.abs(u) * f ? (c < 0 && (f = -f), (e = (f * u) / c), (r = f)) : (u < 0 && (a = -a), (e = a), (r = (a * c) / u)); return { x: o + e, y: i + r }; }, buildLayerMatrix: function (t) { var n = r.map(r.range(u(t) + 1), function () { return []; }); return ( r.forEach(t.nodes(), function (e) { var o = t.node(e), i = o.rank; r.isUndefined(i) || (n[i][o.order] = e); }), n ); }, normalizeRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ); r.forEach(t.nodes(), function (e) { var o = t.node(e); r.has(o, "rank") && (o.rank -= n); }); }, removeEmptyRanks: function (t) { var n = r.min( r.map(t.nodes(), function (n) { return t.node(n).rank; }), ), e = []; r.forEach(t.nodes(), function (r) { var o = t.node(r).rank - n; e[o] || (e[o] = []), e[o].push(r); }); var o = 0, i = t.graph().nodeRankFactor; r.forEach(e, function (n, e) { r.isUndefined(n) && e % i != 0 ? --o : o && r.forEach(n, function (n) { t.node(n).rank += o; }); }); }, addBorderNode: function (t, n, e, r) { var o = { width: 0, height: 0 }; arguments.length >= 4 && ((o.rank = e), (o.order = r)); return i(t, "border", o, n); }, maxRank: u, partition: function (t, n) { var e = { lhs: [], rhs: [] }; return ( r.forEach(t, function (t) { n(t) ? e.lhs.push(t) : e.rhs.push(t); }), e ); }, time: function (t, n) { var e = r.now(); try { return n(); } finally { console.log(t + " time: " + (r.now() - e) + "ms"); } }, notime: function (t, n) { return n(); }, }; }, , function (t, n, e) { var r; try { r = { clone: e(222), constant: e(95), each: e(131), filter: e(134), has: e(145), isArray: e(17), isEmpty: e(299), isFunction: e(51), isUndefined: e(146), keys: e(33), map: e(147), reduce: e(149), size: e(302), transform: e(308), union: e(309), values: e(154), }; } catch (t) {} r || (r = window._), (t.exports = r); }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return null != t && ("object" == n || "function" == n); }; }, function (t, n, e) { var r; try { r = e(220); } catch (t) {} r || (r = window.graphlib), (t.exports = r); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(114), i = "object" == ("undefined" == typeof self ? "undefined" : r(self)) && self && self.Object === Object && self, u = o || i || Function("return this")(); t.exports = u; }, , function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { return null != t && "object" == e(t); }; }, , , , function (t, n, e) { var r = e(51), o = e(89); t.exports = function (t) { return null != t && o(t.length) && !r(t); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(279), i = e(289), u = e(38), c = e(17), a = e(296); t.exports = function (t) { return "function" == typeof t ? t : null == t ? u : "object" == r(t) ? c(t) ? i(t[0], t[1]) : o(t) : a(t); }; }, , function (t, n, e) { var r = e(117), o = e(91), i = e(30); t.exports = function (t) { return i(t) ? r(t) : o(t); }; }, , function (t, n, e) { var r = e(233), o = e(239); t.exports = function (t, n) { var e = o(t, n); return r(e) ? e : void 0; }; }, function (t, n, e) { var r = e(42), o = e(235), i = e(236), u = r ? r.toStringTag : void 0; t.exports = function (t) { return null == t ? void 0 === t ? "[object Undefined]" : "[object Null]" : u && u in Object(t) ? o(t) : i(t); }; }, function (t, n, e) { var r = e(117), o = e(259), i = e(30); t.exports = function (t) { return i(t) ? r(t, !0) : o(t); }; }, function (t, n) { t.exports = function (t) { return t; }; }, , , function (t, n) { t.exports = function (t, n) { return t === n || (t != t && n != n); }; }, function (t, n, e) { var r = e(24).Symbol; t.exports = r; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = e(255), u = "object" == r(n) && n && !n.nodeType && n, c = u && "object" == r(t) && t && !t.nodeType && t, a = c && c.exports === u ? o.Buffer : void 0, f = (a ? a.isBuffer : void 0) || i; t.exports = f; }).call(this, e(50)(t)); }, function (t, n, e) { var r = e(264), o = e(86), i = e(265), u = e(126), c = e(266), a = e(36), f = e(115), s = f(r), p = f(o), d = f(i), h = f(u), l = f(c), v = a; ((r && "[object DataView]" != v(new r(new ArrayBuffer(1)))) || (o && "[object Map]" != v(new o())) || (i && "[object Promise]" != v(i.resolve())) || (u && "[object Set]" != v(new u())) || (c && "[object WeakMap]" != v(new c()))) && (v = function (t) { var n = a(t), e = "[object Object]" == n ? t.constructor : void 0, r = e ? f(e) : ""; if (r) switch (r) { case s: return "[object DataView]"; case p: return "[object Map]"; case d: return "[object Promise]"; case h: return "[object Set]"; case l: return "[object WeakMap]"; } return n; }), (t.exports = v); }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(36), i = e(26); t.exports = function (t) { return "symbol" == r(t) || (i(t) && "[object Symbol]" == o(t)); }; }, , , , , function (t, n) { t.exports = function (t) { return ( t.webpackPolyfill || ((t.deprecate = function () {}), (t.paths = []), t.children || (t.children = []), Object.defineProperty(t, "loaded", { enumerable: !0, get: function () { return t.l; }, }), Object.defineProperty(t, "id", { enumerable: !0, get: function () { return t.i; }, }), (t.webpackPolyfill = 1)), t ); }; }, function (t, n, e) { var r = e(36), o = e(22); t.exports = function (t) { if (!o(t)) return !1; var n = r(t); return ( "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n ); }; }, function (t, n, e) { var r = e(63), o = e(64); t.exports = function (t, n, e, i) { var u = !e; e || (e = {}); for (var c = -1, a = n.length; ++c < a; ) { var f = n[c], s = i ? i(e[f], t[f], f, e, t) : void 0; void 0 === s && (s = t[f]), u ? o(e, f, s) : r(e, f, s); } return e; }; }, function (t, n, e) { var r = e(254), o = e(26), i = Object.prototype, u = i.hasOwnProperty, c = i.propertyIsEnumerable, a = r( (function () { return arguments; })(), ) ? r : function (t) { return o(t) && u.call(t, "callee") && !c.call(t, "callee"); }; t.exports = a; }, function (t, n, e) { var r = e(256), o = e(66), i = e(90), u = i && i.isTypedArray, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(45); t.exports = function (t) { if ("string" == typeof t || r(t)) return t; var n = t + ""; return "0" == n && 1 / t == -1 / 0 ? "-0" : n; }; }, , , function (t, n, e) { var r = e(59), o = e(228), i = e(229), u = e(230), c = e(231), a = e(232); function f(t) { var n = (this.__data__ = new r(t)); this.size = n.size; } (f.prototype.clear = o), (f.prototype.delete = i), (f.prototype.get = u), (f.prototype.has = c), (f.prototype.set = a), (t.exports = f); }, function (t, n, e) { var r = e(223), o = e(224), i = e(225), u = e(226), c = e(227); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(41); t.exports = function (t, n) { for (var e = t.length; e--; ) if (r(t[e][0], n)) return e; return -1; }; }, function (t, n, e) { var r = e(35)(Object, "create"); t.exports = r; }, function (t, n, e) { var r = e(248); t.exports = function (t, n) { var e = t.__data__; return r(n) ? e["string" == typeof n ? "string" : "hash"] : e.map; }; }, function (t, n, e) { var r = e(64), o = e(41), i = Object.prototype.hasOwnProperty; t.exports = function (t, n, e) { var u = t[n]; (i.call(t, n) && o(u, e) && (void 0 !== e || n in t)) || r(t, n, e); }; }, function (t, n, e) { var r = e(116); t.exports = function (t, n, e) { "__proto__" == n && r ? r(t, n, { configurable: !0, enumerable: !0, value: e, writable: !0, }) : (t[n] = e); }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = /^(?:0|[1-9]\d*)$/; t.exports = function (t, n) { var o = e(t); return ( !!(n = null == n ? 9007199254740991 : n) && ("number" == o || ("symbol" != o && r.test(t))) && t > -1 && t % 1 == 0 && t < n ); }; }, function (t, n) { t.exports = function (t) { return function (n) { return t(n); }; }; }, function (t, n) { var e = Object.prototype; t.exports = function (t) { var n = t && t.constructor; return t === (("function" == typeof n && n.prototype) || e); }; }, function (t, n, e) { var r = e(118)(Object.getPrototypeOf, Object); t.exports = r; }, function (t, n, e) { var r = e(96), o = e(277)(r); t.exports = o; }, function (t, n, e) { var r = e(71), o = e(55); t.exports = function (t, n) { for (var e = 0, i = (n = r(n, t)).length; null != t && e < i; ) t = t[o(n[e++])]; return e && e == i ? t : void 0; }; }, function (t, n, e) { var r = e(17), o = e(99), i = e(291), u = e(141); t.exports = function (t, n) { return r(t) ? t : o(t, n) ? [t] : i(u(t)); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length, o = Array(r); ++e < r; ) o[e] = n(t[e], e, t); return o; }; }, function (t, n, e) { var r = e(38), o = e(150), i = e(151); t.exports = function (t, n) { return i(o(t, n, r), t + ""); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(41), i = e(30), u = e(65), c = e(22); t.exports = function (t, n, e) { if (!c(e)) return !1; var a = r(n); return ( !!("number" == a ? i(e) && u(n, e.length) : "string" == a && n in e) && o(e[n], t) ); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = { longestPath: function (t) { var n = {}; r.forEach(t.sources(), function e(o) { var i = t.node(o); if (r.has(n, o)) return i.rank; n[o] = !0; var u = r.min( r.map(t.outEdges(o), function (n) { return e(n.w) - t.edge(n).minlen; }), ); return ( (u !== Number.POSITIVE_INFINITY && null != u) || (u = 0), (i.rank = u) ); }); }, slack: function (t, n) { return t.node(n.w).rank - t.node(n.v).rank - t.edge(n).minlen; }, }; }, , , , , , , , , , function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(21); t.exports = i; function i(t) { (this._isDirected = !o.has(t, "directed") || t.directed), (this._isMultigraph = !!o.has(t, "multigraph") && t.multigraph), (this._isCompound = !!o.has(t, "compound") && t.compound), (this._label = void 0), (this._defaultNodeLabelFn = o.constant(void 0)), (this._defaultEdgeLabelFn = o.constant(void 0)), (this._nodes = {}), this._isCompound && ((this._parent = {}), (this._children = {}), (this._children["\0"] = {})), (this._in = {}), (this._preds = {}), (this._out = {}), (this._sucs = {}), (this._edgeObjs = {}), (this._edgeLabels = {}); } function u(t, n) { t[n] ? t[n]++ : (t[n] = 1); } function c(t, n) { --t[n] || delete t[n]; } function a(t, n, e, r) { var i = "" + n, u = "" + e; if (!t && i > u) { var c = i; (i = u), (u = c); } return i + "" + u + "" + (o.isUndefined(r) ? "\0" : r); } function f(t, n, e, r) { var o = "" + n, i = "" + e; if (!t && o > i) { var u = o; (o = i), (i = u); } var c = { v: o, w: i }; return r && (c.name = r), c; } function s(t, n) { return a(t, n.v, n.w, n.name); } (i.prototype._nodeCount = 0), (i.prototype._edgeCount = 0), (i.prototype.isDirected = function () { return this._isDirected; }), (i.prototype.isMultigraph = function () { return this._isMultigraph; }), (i.prototype.isCompound = function () { return this._isCompound; }), (i.prototype.setGraph = function (t) { return (this._label = t), this; }), (i.prototype.graph = function () { return this._label; }), (i.prototype.setDefaultNodeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultNodeLabelFn = t), this ); }), (i.prototype.nodeCount = function () { return this._nodeCount; }), (i.prototype.nodes = function () { return o.keys(this._nodes); }), (i.prototype.sources = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._in[n]); }); }), (i.prototype.sinks = function () { var t = this; return o.filter(this.nodes(), function (n) { return o.isEmpty(t._out[n]); }); }), (i.prototype.setNodes = function (t, n) { var e = arguments, r = this; return ( o.each(t, function (t) { e.length > 1 ? r.setNode(t, n) : r.setNode(t); }), this ); }), (i.prototype.setNode = function (t, n) { return o.has(this._nodes, t) ? (arguments.length > 1 && (this._nodes[t] = n), this) : ((this._nodes[t] = arguments.length > 1 ? n : this._defaultNodeLabelFn(t)), this._isCompound && ((this._parent[t] = "\0"), (this._children[t] = {}), (this._children["\0"][t] = !0)), (this._in[t] = {}), (this._preds[t] = {}), (this._out[t] = {}), (this._sucs[t] = {}), ++this._nodeCount, this); }), (i.prototype.node = function (t) { return this._nodes[t]; }), (i.prototype.hasNode = function (t) { return o.has(this._nodes, t); }), (i.prototype.removeNode = function (t) { var n = this; if (o.has(this._nodes, t)) { var e = function (t) { n.removeEdge(n._edgeObjs[t]); }; delete this._nodes[t], this._isCompound && (this._removeFromParentsChildList(t), delete this._parent[t], o.each(this.children(t), function (t) { n.setParent(t); }), delete this._children[t]), o.each(o.keys(this._in[t]), e), delete this._in[t], delete this._preds[t], o.each(o.keys(this._out[t]), e), delete this._out[t], delete this._sucs[t], --this._nodeCount; } return this; }), (i.prototype.setParent = function (t, n) { if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); if (o.isUndefined(n)) n = "\0"; else { for (var e = (n += ""); !o.isUndefined(e); e = this.parent(e)) if (e === t) throw new Error( "Setting " + n + " as parent of " + t + " would create a cycle", ); this.setNode(n); } return ( this.setNode(t), this._removeFromParentsChildList(t), (this._parent[t] = n), (this._children[n][t] = !0), this ); }), (i.prototype._removeFromParentsChildList = function (t) { delete this._children[this._parent[t]][t]; }), (i.prototype.parent = function (t) { if (this._isCompound) { var n = this._parent[t]; if ("\0" !== n) return n; } }), (i.prototype.children = function (t) { if ((o.isUndefined(t) && (t = "\0"), this._isCompound)) { var n = this._children[t]; if (n) return o.keys(n); } else { if ("\0" === t) return this.nodes(); if (this.hasNode(t)) return []; } }), (i.prototype.predecessors = function (t) { var n = this._preds[t]; if (n) return o.keys(n); }), (i.prototype.successors = function (t) { var n = this._sucs[t]; if (n) return o.keys(n); }), (i.prototype.neighbors = function (t) { var n = this.predecessors(t); if (n) return o.union(n, this.successors(t)); }), (i.prototype.isLeaf = function (t) { return ( 0 === (this.isDirected() ? this.successors(t) : this.neighbors(t)).length ); }), (i.prototype.filterNodes = function (t) { var n = new this.constructor({ directed: this._isDirected, multigraph: this._isMultigraph, compound: this._isCompound, }); n.setGraph(this.graph()); var e = this; o.each(this._nodes, function (e, r) { t(r) && n.setNode(r, e); }), o.each(this._edgeObjs, function (t) { n.hasNode(t.v) && n.hasNode(t.w) && n.setEdge(t, e.edge(t)); }); var r = {}; return ( this._isCompound && o.each(n.nodes(), function (t) { n.setParent( t, (function t(o) { var i = e.parent(o); return void 0 === i || n.hasNode(i) ? ((r[o] = i), i) : i in r ? r[i] : t(i); })(t), ); }), n ); }), (i.prototype.setDefaultEdgeLabel = function (t) { return ( o.isFunction(t) || (t = o.constant(t)), (this._defaultEdgeLabelFn = t), this ); }), (i.prototype.edgeCount = function () { return this._edgeCount; }), (i.prototype.edges = function () { return o.values(this._edgeObjs); }), (i.prototype.setPath = function (t, n) { var e = this, r = arguments; return ( o.reduce(t, function (t, o) { return r.length > 1 ? e.setEdge(t, o, n) : e.setEdge(t, o), o; }), this ); }), (i.prototype.setEdge = function () { var t, n, e, i, c = !1, s = arguments[0]; "object" === r(s) && null !== s && "v" in s ? ((t = s.v), (n = s.w), (e = s.name), 2 === arguments.length && ((i = arguments[1]), (c = !0))) : ((t = s), (n = arguments[1]), (e = arguments[3]), arguments.length > 2 && ((i = arguments[2]), (c = !0))), (t = "" + t), (n = "" + n), o.isUndefined(e) || (e = "" + e); var p = a(this._isDirected, t, n, e); if (o.has(this._edgeLabels, p)) return c && (this._edgeLabels[p] = i), this; if (!o.isUndefined(e) && !this._isMultigraph) throw new Error( "Cannot set a named edge when isMultigraph = false", ); this.setNode(t), this.setNode(n), (this._edgeLabels[p] = c ? i : this._defaultEdgeLabelFn(t, n, e)); var d = f(this._isDirected, t, n, e); return ( (t = d.v), (n = d.w), Object.freeze(d), (this._edgeObjs[p] = d), u(this._preds[n], t), u(this._sucs[t], n), (this._in[n][p] = d), (this._out[t][p] = d), this._edgeCount++, this ); }), (i.prototype.edge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return this._edgeLabels[r]; }), (i.prototype.hasEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e); return o.has(this._edgeLabels, r); }), (i.prototype.removeEdge = function (t, n, e) { var r = 1 === arguments.length ? s(this._isDirected, arguments[0]) : a(this._isDirected, t, n, e), o = this._edgeObjs[r]; return ( o && ((t = o.v), (n = o.w), delete this._edgeLabels[r], delete this._edgeObjs[r], c(this._preds[n], t), c(this._sucs[t], n), delete this._in[n][r], delete this._out[t][r], this._edgeCount--), this ); }), (i.prototype.inEdges = function (t, n) { var e = this._in[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.v === n; }) : r; } }), (i.prototype.outEdges = function (t, n) { var e = this._out[t]; if (e) { var r = o.values(e); return n ? o.filter(r, function (t) { return t.w === n; }) : r; } }), (i.prototype.nodeEdges = function (t, n) { var e = this.inEdges(t, n); if (e) return e.concat(this.outEdges(t, n)); }); }, function (t, n, e) { var r = e(35)(e(24), "Map"); t.exports = r; }, function (t, n, e) { var r = e(240), o = e(247), i = e(249), u = e(250), c = e(251); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length; ++e < r && !1 !== n(t[e], e, t); ); return t; }; }, function (t, n) { t.exports = function (t) { return ( "number" == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991 ); }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(114), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i && o.process, a = (function () { try { var t = u && u.require && u.require("util").types; return t || (c && c.binding && c.binding("util")); } catch (t) {} })(); t.exports = a; }).call(this, e(50)(t)); }, function (t, n, e) { var r = e(67), o = e(257), i = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return o(t); var n = []; for (var e in Object(t)) i.call(t, e) && "constructor" != e && n.push(e); return n; }; }, function (t, n, e) { var r = e(121), o = e(122), i = Object.prototype.propertyIsEnumerable, u = Object.getOwnPropertySymbols, c = u ? function (t) { return null == t ? [] : ((t = Object(t)), r(u(t), function (n) { return i.call(t, n); })); } : o; t.exports = c; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = n.length, o = t.length; ++e < r; ) t[o + e] = n[e]; return t; }; }, function (t, n, e) { var r = e(127); t.exports = function (t) { var n = new t.constructor(t.byteLength); return new r(n).set(new r(t)), n; }; }, function (t, n) { t.exports = function (t) { return function () { return t; }; }; }, function (t, n, e) { var r = e(97), o = e(33); t.exports = function (t, n) { return t && r(t, n, o); }; }, function (t, n, e) { var r = e(276)(); t.exports = r; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t) { e[++n] = t; }), e ); }; }, function (t, n, e) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(17), i = e(45), u = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, c = /^\w*$/; t.exports = function (t, n) { if (o(t)) return !1; var e = r(t); return ( !( "number" != e && "symbol" != e && "boolean" != e && null != t && !i(t) ) || c.test(t) || !u.test(t) || (null != n && t in Object(n)) ); }; }, function (t, n, e) { var r = e(93), o = e(310); t.exports = function t(n, e, i, u, c) { var a = -1, f = n.length; for (i || (i = o), c || (c = []); ++a < f; ) { var s = n[a]; e > 0 && i(s) ? e > 1 ? t(s, e - 1, i, u, c) : r(c, s) : u || (c[c.length] = s); } return c; }; }, function (t, n, e) { var r = e(45); t.exports = function (t, n, e) { for (var o = -1, i = t.length; ++o < i; ) { var u = t[o], c = n(u); if (null != c && (void 0 === a ? c == c && !r(c) : e(c, a))) var a = c, f = u; } return f; }; }, , , , , , , , , , , , function (t, n, e) { var r = e(58), o = e(88), i = e(63), u = e(252), c = e(258), a = e(119), f = e(120), s = e(261), p = e(262), d = e(124), h = e(263), l = e(44), v = e(267), y = e(268), g = e(129), b = e(17), m = e(43), x = e(272), _ = e(22), w = e(274), E = e(33), j = e(37), k = {}; (k["[object Arguments]"] = k["[object Array]"] = k["[object ArrayBuffer]"] = k["[object DataView]"] = k["[object Boolean]"] = k["[object Date]"] = k["[object Float32Array]"] = k["[object Float64Array]"] = k["[object Int8Array]"] = k["[object Int16Array]"] = k["[object Int32Array]"] = k["[object Map]"] = k["[object Number]"] = k["[object Object]"] = k["[object RegExp]"] = k["[object Set]"] = k["[object String]"] = k["[object Symbol]"] = k["[object Uint8Array]"] = k["[object Uint8ClampedArray]"] = k["[object Uint16Array]"] = k["[object Uint32Array]"] = !0), (k["[object Error]"] = k["[object Function]"] = k["[object WeakMap]"] = !1), (t.exports = function t(n, e, S, O, N, I) { var P, M = 1 & e, C = 2 & e, A = 4 & e; if ((S && (P = N ? S(n, O, N, I) : S(n)), void 0 !== P)) return P; if (!_(n)) return n; var L = b(n); if (L) { if (((P = v(n)), !M)) return f(n, P); } else { var T = l(n), z = "[object Function]" == T || "[object GeneratorFunction]" == T; if (m(n)) return a(n, M); if ( "[object Object]" == T || "[object Arguments]" == T || (z && !N) ) { if (((P = C || z ? {} : g(n)), !M)) return C ? p(n, c(P, n)) : s(n, u(P, n)); } else { if (!k[T]) return N ? n : {}; P = y(n, T, M); } } I || (I = new r()); var F = I.get(n); if (F) return F; I.set(n, P), w(n) ? n.forEach(function (r) { P.add(t(r, e, S, r, n, I)); }) : x(n) && n.forEach(function (r, o) { P.set(o, t(r, e, S, o, n, I)); }); var D = L ? void 0 : (A ? (C ? h : d) : C ? j : E)(n); return ( o(D || n, function (r, o) { D && (r = n[(o = r)]), i(P, o, t(r, e, S, o, n, I)); }), P ); }); }, function (t, n, e) { (function (n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r = "object" == (void 0 === n ? "undefined" : e(n)) && n && n.Object === Object && n; t.exports = r; }).call(this, e(234)); }, function (t, n) { var e = Function.prototype.toString; t.exports = function (t) { if (null != t) { try { return e.call(t); } catch (t) {} try { return t + ""; } catch (t) {} } return ""; }; }, function (t, n, e) { var r = e(35), o = (function () { try { var t = r(Object, "defineProperty"); return t({}, "", {}), t; } catch (t) {} })(); t.exports = o; }, function (t, n, e) { var r = e(253), o = e(53), i = e(17), u = e(43), c = e(65), a = e(54), f = Object.prototype.hasOwnProperty; t.exports = function (t, n) { var e = i(t), s = !e && o(t), p = !e && !s && u(t), d = !e && !s && !p && a(t), h = e || s || p || d, l = h ? r(t.length, String) : [], v = l.length; for (var y in t) (!n && !f.call(t, y)) || (h && ("length" == y || (p && ("offset" == y || "parent" == y)) || (d && ("buffer" == y || "byteLength" == y || "byteOffset" == y)) || c(y, v))) || l.push(y); return l; }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return t(n(e)); }; }; }, function (t, n, e) { (function (t) { function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = e(24), i = "object" == r(n) && n && !n.nodeType && n, u = i && "object" == r(t) && t && !t.nodeType && t, c = u && u.exports === i ? o.Buffer : void 0, a = c ? c.allocUnsafe : void 0; t.exports = function (t, n) { if (n) return t.slice(); var e = t.length, r = a ? a(e) : new t.constructor(e); return t.copy(r), r; }; }).call(this, e(50)(t)); }, function (t, n) { t.exports = function (t, n) { var e = -1, r = t.length; for (n || (n = Array(r)); ++e < r; ) n[e] = t[e]; return n; }; }, function (t, n) { t.exports = function (t, n) { for ( var e = -1, r = null == t ? 0 : t.length, o = 0, i = []; ++e < r; ) { var u = t[e]; n(u, e, t) && (i[o++] = u); } return i; }; }, function (t, n) { t.exports = function () { return []; }; }, function (t, n, e) { var r = e(93), o = e(68), i = e(92), u = e(122), c = Object.getOwnPropertySymbols ? function (t) { for (var n = []; t; ) r(n, i(t)), (t = o(t)); return n; } : u; t.exports = c; }, function (t, n, e) { var r = e(125), o = e(92), i = e(33); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(93), o = e(17); t.exports = function (t, n, e) { var i = n(t); return o(t) ? i : r(i, e(t)); }; }, function (t, n, e) { var r = e(35)(e(24), "Set"); t.exports = r; }, function (t, n, e) { var r = e(24).Uint8Array; t.exports = r; }, function (t, n, e) { var r = e(94); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.length); }; }, function (t, n, e) { var r = e(130), o = e(68), i = e(67); t.exports = function (t) { return "function" != typeof t.constructor || i(t) ? {} : r(o(t)); }; }, function (t, n, e) { var r = e(22), o = Object.create, i = (function () { function t() {} return function (n) { if (!r(n)) return {}; if (o) return o(n); t.prototype = n; var e = new t(); return (t.prototype = void 0), e; }; })(); t.exports = i; }, function (t, n, e) { t.exports = e(132); }, function (t, n, e) { var r = e(88), o = e(69), i = e(133), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n)); }; }, function (t, n, e) { var r = e(38); t.exports = function (t) { return "function" == typeof t ? t : r; }; }, function (t, n, e) { var r = e(121), o = e(278), i = e(31), u = e(17); t.exports = function (t, n) { return (u(t) ? r : o)(t, i(n, 3)); }; }, function (t, n, e) { var r = e(281), o = e(26); t.exports = function t(n, e, i, u, c) { return ( n === e || (null == n || null == e || (!o(n) && !o(e)) ? n != n && e != e : r(n, e, i, u, t, c)) ); }; }, function (t, n, e) { var r = e(137), o = e(284), i = e(138); t.exports = function (t, n, e, u, c, a) { var f = 1 & e, s = t.length, p = n.length; if (s != p && !(f && p > s)) return !1; var d = a.get(t), h = a.get(n); if (d && h) return d == n && h == t; var l = -1, v = !0, y = 2 & e ? new r() : void 0; for (a.set(t, n), a.set(n, t); ++l < s; ) { var g = t[l], b = n[l]; if (u) var m = f ? u(b, g, l, n, t, a) : u(g, b, l, t, n, a); if (void 0 !== m) { if (m) continue; v = !1; break; } if (y) { if ( !o(n, function (t, n) { if (!i(y, n) && (g === t || c(g, t, e, u, a))) return y.push(n); }) ) { v = !1; break; } } else if (g !== b && !c(g, b, e, u, a)) { v = !1; break; } } return a.delete(t), a.delete(n), v; }; }, function (t, n, e) { var r = e(87), o = e(282), i = e(283); function u(t) { var n = -1, e = null == t ? 0 : t.length; for (this.__data__ = new r(); ++n < e; ) this.add(t[n]); } (u.prototype.add = u.prototype.push = o), (u.prototype.has = i), (t.exports = u); }, function (t, n) { t.exports = function (t, n) { return t.has(n); }; }, function (t, n, e) { var r = e(22); t.exports = function (t) { return t == t && !r(t); }; }, function (t, n) { t.exports = function (t, n) { return function (e) { return null != e && e[t] === n && (void 0 !== n || t in Object(e)); }; }; }, function (t, n, e) { var r = e(294); t.exports = function (t) { return null == t ? "" : r(t); }; }, function (t, n, e) { var r = e(295), o = e(143); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n, e) { var r = e(71), o = e(53), i = e(17), u = e(65), c = e(89), a = e(55); t.exports = function (t, n, e) { for (var f = -1, s = (n = r(n, t)).length, p = !1; ++f < s; ) { var d = a(n[f]); if (!(p = null != t && e(t, d))) break; t = t[d]; } return p || ++f != s ? p : !!(s = null == t ? 0 : t.length) && c(s) && u(d, s) && (i(t) || o(t)); }; }, function (t, n) { t.exports = function (t) { return function (n) { return null == n ? void 0 : n[t]; }; }; }, function (t, n, e) { var r = e(298), o = e(143); t.exports = function (t, n) { return null != t && o(t, n, r); }; }, function (t, n) { t.exports = function (t) { return void 0 === t; }; }, function (t, n, e) { var r = e(72), o = e(31), i = e(148), u = e(17); t.exports = function (t, n) { return (u(t) ? r : i)(t, o(n, 3)); }; }, function (t, n, e) { var r = e(69), o = e(30); t.exports = function (t, n) { var e = -1, i = o(t) ? Array(t.length) : []; return ( r(t, function (t, r, o) { i[++e] = n(t, r, o); }), i ); }; }, function (t, n, e) { var r = e(300), o = e(69), i = e(31), u = e(301), c = e(17); t.exports = function (t, n, e) { var a = c(t) ? r : u, f = arguments.length < 3; return a(t, i(n, 4), e, f, o); }; }, function (t, n, e) { var r = e(311), o = Math.max; t.exports = function (t, n, e) { return ( (n = o(void 0 === n ? t.length - 1 : n, 0)), function () { for ( var i = arguments, u = -1, c = o(i.length - n, 0), a = Array(c); ++u < c; ) a[u] = i[n + u]; u = -1; for (var f = Array(n + 1); ++u < n; ) f[u] = i[u]; return (f[n] = e(a)), r(t, this, f); } ); }; }, function (t, n, e) { var r = e(312), o = e(313)(r); t.exports = o; }, function (t, n) { t.exports = function (t, n, e, r) { for (var o = t.length, i = e + (r ? 1 : -1); r ? i-- : ++i < o; ) if (n(t[i], i, t)) return i; return -1; }; }, function (t, n, e) { var r = e(30), o = e(26); t.exports = function (t) { return o(t) && r(t); }; }, function (t, n, e) { var r = e(322), o = e(33); t.exports = function (t) { return null == t ? [] : r(t, o(t)); }; }, function (t, n, e) { var r = e(21), o = e(156); t.exports = function (t, n, e, r) { return (function (t, n, e, r) { var i, u, c = {}, a = new o(), f = function (t) { var n = t.v !== i ? t.v : t.w, r = c[n], o = e(t), f = u.distance + o; if (o < 0) throw new Error( "dijkstra does not allow negative edge weights. Bad edge: " + t + " Weight: " + o, ); f < r.distance && ((r.distance = f), (r.predecessor = i), a.decrease(n, f)); }; t.nodes().forEach(function (t) { var e = t === n ? 0 : Number.POSITIVE_INFINITY; (c[t] = { distance: e }), a.add(t, e); }); for ( ; a.size() > 0 && ((i = a.removeMin()), (u = c[i]).distance !== Number.POSITIVE_INFINITY); ) r(i).forEach(f); return c; })( t, String(n), e || i, r || function (n) { return t.outEdges(n); }, ); }; var i = r.constant(1); }, function (t, n, e) { var r = e(21); function o() { (this._arr = []), (this._keyIndices = {}); } (t.exports = o), (o.prototype.size = function () { return this._arr.length; }), (o.prototype.keys = function () { return this._arr.map(function (t) { return t.key; }); }), (o.prototype.has = function (t) { return r.has(this._keyIndices, t); }), (o.prototype.priority = function (t) { var n = this._keyIndices[t]; if (void 0 !== n) return this._arr[n].priority; }), (o.prototype.min = function () { if (0 === this.size()) throw new Error("Queue underflow"); return this._arr[0].key; }), (o.prototype.add = function (t, n) { var e = this._keyIndices; if (((t = String(t)), !r.has(e, t))) { var o = this._arr, i = o.length; return ( (e[t] = i), o.push({ key: t, priority: n }), this._decrease(i), !0 ); } return !1; }), (o.prototype.removeMin = function () { this._swap(0, this._arr.length - 1); var t = this._arr.pop(); return delete this._keyIndices[t.key], this._heapify(0), t.key; }), (o.prototype.decrease = function (t, n) { var e = this._keyIndices[t]; if (n > this._arr[e].priority) throw new Error( "New priority is greater than current priority. Key: " + t + " Old: " + this._arr[e].priority + " New: " + n, ); (this._arr[e].priority = n), this._decrease(e); }), (o.prototype._heapify = function (t) { var n = this._arr, e = 2 * t, r = e + 1, o = t; e < n.length && ((o = n[e].priority < n[o].priority ? e : o), r < n.length && (o = n[r].priority < n[o].priority ? r : o), o !== t && (this._swap(t, o), this._heapify(o))); }), (o.prototype._decrease = function (t) { for ( var n, e = this._arr, r = e[t].priority; 0 !== t && !(e[(n = t >> 1)].priority < r); ) this._swap(t, n), (t = n); }), (o.prototype._swap = function (t, n) { var e = this._arr, r = this._keyIndices, o = e[t], i = e[n]; (e[t] = i), (e[n] = o), (r[i.key] = t), (r[o.key] = n); }); }, function (t, n, e) { var r = e(21); t.exports = function (t) { var n = 0, e = [], o = {}, i = []; return ( t.nodes().forEach(function (u) { r.has(o, u) || (function u(c) { var a = (o[c] = { onStack: !0, lowlink: n, index: n++ }); if ( (e.push(c), t.successors(c).forEach(function (t) { r.has(o, t) ? o[t].onStack && (a.lowlink = Math.min(a.lowlink, o[t].index)) : (u(t), (a.lowlink = Math.min(a.lowlink, o[t].lowlink))); }), a.lowlink === a.index) ) { var f, s = []; do { (f = e.pop()), (o[f].onStack = !1), s.push(f); } while (c !== f); i.push(s); } })(u); }), i ); }; }, function (t, n, e) { var r = e(21); function o(t) { var n = {}, e = {}, o = []; if ( (r.each(t.sinks(), function u(c) { if (r.has(e, c)) throw new i(); r.has(n, c) || ((e[c] = !0), (n[c] = !0), r.each(t.predecessors(c), u), delete e[c], o.push(c)); }), r.size(n) !== t.nodeCount()) ) throw new i(); return o; } function i() {} (t.exports = o), (o.CycleException = i), (i.prototype = new Error()); }, function (t, n, e) { var r = e(21); t.exports = function (t, n, e) { r.isArray(n) || (n = [n]); var o = (t.isDirected() ? t.successors : t.neighbors).bind(t), i = [], u = {}; return ( r.each(n, function (n) { if (!t.hasNode(n)) throw new Error("Graph does not have node: " + n); !(function t(n, e, o, i, u, c) { r.has(i, e) || ((i[e] = !0), o || c.push(e), r.each(u(e), function (e) { t(n, e, o, i, u, c); }), o && c.push(e)); })(t, n, "post" === e, u, o, i); }), i ); }; }, function (t, n, e) { var r = e(341); t.exports = function (t) { return t ? (t = r(t)) === 1 / 0 || t === -1 / 0 ? 17976931348623157e292 * (t < 0 ? -1 : 1) : t == t ? t : 0 : 0 === t ? t : 0; }; }, function (t, n, e) { var r = e(100); t.exports = function (t) { return (null == t ? 0 : t.length) ? r(t, 1) : []; }; }, function (t, n, e) { var r = e(64), o = e(41); t.exports = function (t, n, e) { ((void 0 !== e && !o(t[n], e)) || (void 0 === e && !(n in t))) && r(t, n, e); }; }, function (t, n) { t.exports = function (t, n) { if ( ("constructor" !== n || "function" != typeof t[n]) && "__proto__" != n ) return t[n]; }; }, function (t, n) { t.exports = function (t, n) { return t < n; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph, i = e(75).slack; function u(t, n) { return ( r.forEach(t.nodes(), function e(o) { r.forEach(n.nodeEdges(o), function (r) { var u = r.v, c = o === u ? r.w : u; t.hasNode(c) || i(n, r) || (t.setNode(c, {}), t.setEdge(o, c, {}), e(c)); }); }), t.nodeCount() ); } function c(t, n) { return r.minBy(n.edges(), function (e) { if (t.hasNode(e.v) !== t.hasNode(e.w)) return i(n, e); }); } function a(t, n, e) { r.forEach(t.nodes(), function (t) { n.node(t).rank += e; }); } t.exports = function (t) { var n, e, r = new o({ directed: !1 }), f = t.nodes()[0], s = t.nodeCount(); r.setNode(f, {}); for (; u(r, t) < s; ) (n = c(r, t)), (e = r.hasNode(n.v) ? i(t, n) : -i(t, n)), a(r, t, e); return r; }; }, , , , , , , , , function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.DagreLayout = void 0); var u = i(e(219)), c = e(10), a = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.rankdir = "TB"), (e.nodesep = 50), (e.ranksep = 50), (e.controlPoints = !1), (e.sortByCombo = !1), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { rankdir: "TB", align: void 0, nodeSize: void 0, nodesepFunc: void 0, ranksepFunc: void 0, nodesep: 50, ranksep: 50, controlPoints: !1, }; }), (n.prototype.execute = function () { var t = this, n = this, e = n.nodes, r = n.nodeSize, o = n.rankdir, i = n.combos; if (e) { var a, s = n.edges || [], p = new u.default.graphlib.Graph({ multigraph: !0, compound: !0, }); a = r ? c.isArray(r) ? function () { return r; } : function () { return [r, r]; } : function (t) { return t.size ? c.isArray(t.size) ? t.size : [t.size, t.size] : [40, 40]; }; var d = f(n.nodesepFunc, n.nodesep, 50), h = f(n.ranksepFunc, n.ranksep, 50); ("LR" !== o && "RL" !== o) || ((d = f(n.ranksepFunc, n.ranksep, 50)), (h = f(n.nodesepFunc, n.nodesep, 50))), p.setDefaultEdgeLabel(function () { return {}; }), p.setGraph(n); var l, v = {}; return ( e.forEach(function (n) { var e = a(n), r = h(n), o = d(n), i = e[0] + 2 * o, u = e[1] + 2 * r; p.setNode(n.id, { width: i, height: u }), t.sortByCombo && n.comboId && (v[n.comboId] || ((v[n.comboId] = !0), p.setNode(n.comboId, {})), p.setParent(n.id, n.comboId)); }), this.sortByCombo && i && i.forEach(function (t) { t.parentId && (v[t.parentId] || ((v[t.parentId] = !0), p.setNode(t.parentId, {})), p.setParent(t.id, t.parentId)); }), s.forEach(function (t) { p.setEdge(t.source, t.target, { weight: t.weight || 1 }); }), u.default.layout(p), p.nodes().forEach(function (t) { l = p.node(t); var n = e.findIndex(function (n) { return n.id === t; }); e[n] && ((e[n].x = l.x), (e[n].y = l.y)); }), p.edges().forEach(function (t) { l = p.edge(t); var e = s.findIndex(function (n) { return n.source === t.v && n.target === t.w; }); n.controlPoints && "loop" !== s[e].type && (s[e].controlPoints = l.points.slice( 1, l.points.length - 1, )); }), n.onLayoutEnd && n.onLayoutEnd(), { nodes: e, edges: s } ); } }), (n.prototype.getType = function () { return "dagre"; }), n ); })(e(7).Base); function f(t, n, e) { return ( t || (c.isNumber(n) ? function () { return n; } : function () { return e; }) ); } n.DagreLayout = a; }, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (t, n, e) { "use strict"; e.r(n); var r = e(174); n.default = r.DagreLayout; }, function (t, n, e) { t.exports = { graphlib: e(23), layout: e(334), debug: e(395), util: { time: e(19).time, notime: e(19).notime }, version: e(396), }; }, function (t, n, e) { var r = e(221); t.exports = { Graph: r.Graph, json: e(324), alg: e(325), version: r.version, }; }, function (t, n, e) { t.exports = { Graph: e(85), version: e(323) }; }, function (t, n, e) { var r = e(113); t.exports = function (t) { return r(t, 4); }; }, function (t, n) { t.exports = function () { (this.__data__ = []), (this.size = 0); }; }, function (t, n, e) { var r = e(60), o = Array.prototype.splice; t.exports = function (t) { var n = this.__data__, e = r(n, t); return ( !(e < 0) && (e == n.length - 1 ? n.pop() : o.call(n, e, 1), --this.size, !0) ); }; }, function (t, n, e) { var r = e(60); t.exports = function (t) { var n = this.__data__, e = r(n, t); return e < 0 ? void 0 : n[e][1]; }; }, function (t, n, e) { var r = e(60); t.exports = function (t) { return r(this.__data__, t) > -1; }; }, function (t, n, e) { var r = e(60); t.exports = function (t, n) { var e = this.__data__, o = r(e, t); return o < 0 ? (++this.size, e.push([t, n])) : (e[o][1] = n), this; }; }, function (t, n, e) { var r = e(59); t.exports = function () { (this.__data__ = new r()), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.__data__, e = n.delete(t); return (this.size = n.size), e; }; }, function (t, n) { t.exports = function (t) { return this.__data__.get(t); }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n, e) { var r = e(59), o = e(86), i = e(87); t.exports = function (t, n) { var e = this.__data__; if (e instanceof r) { var u = e.__data__; if (!o || u.length < 199) return u.push([t, n]), (this.size = ++e.size), this; e = this.__data__ = new i(u); } return e.set(t, n), (this.size = e.size), this; }; }, function (t, n, e) { var r = e(51), o = e(237), i = e(22), u = e(115), c = /^\[object .+?Constructor\]$/, a = Function.prototype, f = Object.prototype, s = a.toString, p = f.hasOwnProperty, d = RegExp( "^" + s .call(p) .replace(/[\\^$.*+?()[\]{}|]/g, "\\$&") .replace( /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?", ) + "$", ); t.exports = function (t) { return !(!i(t) || o(t)) && (r(t) ? d : c).test(u(t)); }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : e(window)) && (r = window); } t.exports = r; }, function (t, n, e) { var r = e(42), o = Object.prototype, i = o.hasOwnProperty, u = o.toString, c = r ? r.toStringTag : void 0; t.exports = function (t) { var n = i.call(t, c), e = t[c]; try { t[c] = void 0; var r = !0; } catch (t) {} var o = u.call(t); return r && (n ? (t[c] = e) : delete t[c]), o; }; }, function (t, n) { var e = Object.prototype.toString; t.exports = function (t) { return e.call(t); }; }, function (t, n, e) { var r, o = e(238), i = (r = /[^.]+$/.exec((o && o.keys && o.keys.IE_PROTO) || "")) ? "Symbol(src)_1." + r : ""; t.exports = function (t) { return !!i && i in t; }; }, function (t, n, e) { var r = e(24)["__core-js_shared__"]; t.exports = r; }, function (t, n) { t.exports = function (t, n) { return null == t ? void 0 : t[n]; }; }, function (t, n, e) { var r = e(241), o = e(59), i = e(86); t.exports = function () { (this.size = 0), (this.__data__ = { hash: new r(), map: new (i || o)(), string: new r(), }); }; }, function (t, n, e) { var r = e(242), o = e(243), i = e(244), u = e(245), c = e(246); function a(t) { var n = -1, e = null == t ? 0 : t.length; for (this.clear(); ++n < e; ) { var r = t[n]; this.set(r[0], r[1]); } } (a.prototype.clear = r), (a.prototype.delete = o), (a.prototype.get = i), (a.prototype.has = u), (a.prototype.set = c), (t.exports = a); }, function (t, n, e) { var r = e(61); t.exports = function () { (this.__data__ = r ? r(null) : {}), (this.size = 0); }; }, function (t, n) { t.exports = function (t) { var n = this.has(t) && delete this.__data__[t]; return (this.size -= n ? 1 : 0), n; }; }, function (t, n, e) { var r = e(61), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; if (r) { var e = n[t]; return "__lodash_hash_undefined__" === e ? void 0 : e; } return o.call(n, t) ? n[t] : void 0; }; }, function (t, n, e) { var r = e(61), o = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = this.__data__; return r ? void 0 !== n[t] : o.call(n, t); }; }, function (t, n, e) { var r = e(61); t.exports = function (t, n) { var e = this.__data__; return ( (this.size += this.has(t) ? 0 : 1), (e[t] = r && void 0 === n ? "__lodash_hash_undefined__" : n), this ); }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { var n = r(this, t).delete(t); return (this.size -= n ? 1 : 0), n; }; }, function (t, n) { function e(t) { return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } t.exports = function (t) { var n = e(t); return "string" == n || "number" == n || "symbol" == n || "boolean" == n ? "__proto__" !== t : null === t; }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { return r(this, t).get(t); }; }, function (t, n, e) { var r = e(62); t.exports = function (t) { return r(this, t).has(t); }; }, function (t, n, e) { var r = e(62); t.exports = function (t, n) { var e = r(this, t), o = e.size; return e.set(t, n), (this.size += e.size == o ? 0 : 1), this; }; }, function (t, n, e) { var r = e(52), o = e(33); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = Array(t); ++e < t; ) r[e] = n(e); return r; }; }, function (t, n, e) { var r = e(36), o = e(26); t.exports = function (t) { return o(t) && "[object Arguments]" == r(t); }; }, function (t, n) { t.exports = function () { return !1; }; }, function (t, n, e) { var r = e(36), o = e(89), i = e(26), u = {}; (u["[object Float32Array]"] = u["[object Float64Array]"] = u["[object Int8Array]"] = u["[object Int16Array]"] = u["[object Int32Array]"] = u["[object Uint8Array]"] = u["[object Uint8ClampedArray]"] = u["[object Uint16Array]"] = u["[object Uint32Array]"] = !0), (u["[object Arguments]"] = u["[object Array]"] = u["[object ArrayBuffer]"] = u["[object Boolean]"] = u["[object DataView]"] = u["[object Date]"] = u["[object Error]"] = u["[object Function]"] = u["[object Map]"] = u["[object Number]"] = u["[object Object]"] = u["[object RegExp]"] = u["[object Set]"] = u["[object String]"] = u["[object WeakMap]"] = !1), (t.exports = function (t) { return i(t) && o(t.length) && !!u[r(t)]; }); }, function (t, n, e) { var r = e(118)(Object.keys, Object); t.exports = r; }, function (t, n, e) { var r = e(52), o = e(37); t.exports = function (t, n) { return t && r(n, o(n), t); }; }, function (t, n, e) { var r = e(22), o = e(67), i = e(260), u = Object.prototype.hasOwnProperty; t.exports = function (t) { if (!r(t)) return i(t); var n = o(t), e = []; for (var c in t) ("constructor" != c || (!n && u.call(t, c))) && e.push(c); return e; }; }, function (t, n) { t.exports = function (t) { var n = []; if (null != t) for (var e in Object(t)) n.push(e); return n; }; }, function (t, n, e) { var r = e(52), o = e(92); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(52), o = e(123); t.exports = function (t, n) { return r(t, o(t), n); }; }, function (t, n, e) { var r = e(125), o = e(123), i = e(37); t.exports = function (t) { return r(t, i, o); }; }, function (t, n, e) { var r = e(35)(e(24), "DataView"); t.exports = r; }, function (t, n, e) { var r = e(35)(e(24), "Promise"); t.exports = r; }, function (t, n, e) { var r = e(35)(e(24), "WeakMap"); t.exports = r; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t) { var n = t.length, r = new t.constructor(n); return ( n && "string" == typeof t[0] && e.call(t, "index") && ((r.index = t.index), (r.input = t.input)), r ); }; }, function (t, n, e) { var r = e(94), o = e(269), i = e(270), u = e(271), c = e(128); t.exports = function (t, n, e) { var a = t.constructor; switch (n) { case "[object ArrayBuffer]": return r(t); case "[object Boolean]": case "[object Date]": return new a(+t); case "[object DataView]": return o(t, e); case "[object Float32Array]": case "[object Float64Array]": case "[object Int8Array]": case "[object Int16Array]": case "[object Int32Array]": case "[object Uint8Array]": case "[object Uint8ClampedArray]": case "[object Uint16Array]": case "[object Uint32Array]": return c(t, e); case "[object Map]": return new a(); case "[object Number]": case "[object String]": return new a(t); case "[object RegExp]": return i(t); case "[object Set]": return new a(); case "[object Symbol]": return u(t); } }; }, function (t, n, e) { var r = e(94); t.exports = function (t, n) { var e = n ? r(t.buffer) : t.buffer; return new t.constructor(e, t.byteOffset, t.byteLength); }; }, function (t, n) { var e = /\w*$/; t.exports = function (t) { var n = new t.constructor(t.source, e.exec(t)); return (n.lastIndex = t.lastIndex), n; }; }, function (t, n, e) { var r = e(42), o = r ? r.prototype : void 0, i = o ? o.valueOf : void 0; t.exports = function (t) { return i ? Object(i.call(t)) : {}; }; }, function (t, n, e) { var r = e(273), o = e(66), i = e(90), u = i && i.isMap, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(44), o = e(26); t.exports = function (t) { return o(t) && "[object Map]" == r(t); }; }, function (t, n, e) { var r = e(275), o = e(66), i = e(90), u = i && i.isSet, c = u ? o(u) : r; t.exports = c; }, function (t, n, e) { var r = e(44), o = e(26); t.exports = function (t) { return o(t) && "[object Set]" == r(t); }; }, function (t, n) { t.exports = function (t) { return function (n, e, r) { for (var o = -1, i = Object(n), u = r(n), c = u.length; c--; ) { var a = u[t ? c : ++o]; if (!1 === e(i[a], a, i)) break; } return n; }; }; }, function (t, n, e) { var r = e(30); t.exports = function (t, n) { return function (e, o) { if (null == e) return e; if (!r(e)) return t(e, o); for ( var i = e.length, u = n ? i : -1, c = Object(e); (n ? u-- : ++u < i) && !1 !== o(c[u], u, c); ); return e; }; }; }, function (t, n, e) { var r = e(69); t.exports = function (t, n) { var e = []; return ( r(t, function (t, r, o) { n(t, r, o) && e.push(t); }), e ); }; }, function (t, n, e) { var r = e(280), o = e(288), i = e(140); t.exports = function (t) { var n = o(t); return 1 == n.length && n[0][2] ? i(n[0][0], n[0][1]) : function (e) { return e === t || r(e, t, n); }; }; }, function (t, n, e) { var r = e(58), o = e(135); t.exports = function (t, n, e, i) { var u = e.length, c = u, a = !i; if (null == t) return !c; for (t = Object(t); u--; ) { var f = e[u]; if (a && f[2] ? f[1] !== t[f[0]] : !(f[0] in t)) return !1; } for (; ++u < c; ) { var s = (f = e[u])[0], p = t[s], d = f[1]; if (a && f[2]) { if (void 0 === p && !(s in t)) return !1; } else { var h = new r(); if (i) var l = i(p, d, s, t, n, h); if (!(void 0 === l ? o(d, p, 3, i, h) : l)) return !1; } } return !0; }; }, function (t, n, e) { var r = e(58), o = e(136), i = e(285), u = e(287), c = e(44), a = e(17), f = e(43), s = e(54), p = "[object Object]", d = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, h, l, v) { var y = a(t), g = a(n), b = y ? "[object Array]" : c(t), m = g ? "[object Array]" : c(n), x = (b = "[object Arguments]" == b ? p : b) == p, _ = (m = "[object Arguments]" == m ? p : m) == p, w = b == m; if (w && f(t)) { if (!f(n)) return !1; (y = !0), (x = !1); } if (w && !x) return ( v || (v = new r()), y || s(t) ? o(t, n, e, h, l, v) : i(t, n, b, e, h, l, v) ); if (!(1 & e)) { var E = x && d.call(t, "__wrapped__"), j = _ && d.call(n, "__wrapped__"); if (E || j) { var k = E ? t.value() : t, S = j ? n.value() : n; return v || (v = new r()), l(k, S, e, h, v); } } return !!w && (v || (v = new r()), u(t, n, e, h, l, v)); }; }, function (t, n) { t.exports = function (t) { return this.__data__.set(t, "__lodash_hash_undefined__"), this; }; }, function (t, n) { t.exports = function (t) { return this.__data__.has(t); }; }, function (t, n) { t.exports = function (t, n) { for (var e = -1, r = null == t ? 0 : t.length; ++e < r; ) if (n(t[e], e, t)) return !0; return !1; }; }, function (t, n, e) { var r = e(42), o = e(127), i = e(41), u = e(136), c = e(286), a = e(98), f = r ? r.prototype : void 0, s = f ? f.valueOf : void 0; t.exports = function (t, n, e, r, f, p, d) { switch (e) { case "[object DataView]": if (t.byteLength != n.byteLength || t.byteOffset != n.byteOffset) return !1; (t = t.buffer), (n = n.buffer); case "[object ArrayBuffer]": return !(t.byteLength != n.byteLength || !p(new o(t), new o(n))); case "[object Boolean]": case "[object Date]": case "[object Number]": return i(+t, +n); case "[object Error]": return t.name == n.name && t.message == n.message; case "[object RegExp]": case "[object String]": return t == n + ""; case "[object Map]": var h = c; case "[object Set]": var l = 1 & r; if ((h || (h = a), t.size != n.size && !l)) return !1; var v = d.get(t); if (v) return v == n; (r |= 2), d.set(t, n); var y = u(h(t), h(n), r, f, p, d); return d.delete(t), y; case "[object Symbol]": if (s) return s.call(t) == s.call(n); } return !1; }; }, function (t, n) { t.exports = function (t) { var n = -1, e = Array(t.size); return ( t.forEach(function (t, r) { e[++n] = [r, t]; }), e ); }; }, function (t, n, e) { var r = e(124), o = Object.prototype.hasOwnProperty; t.exports = function (t, n, e, i, u, c) { var a = 1 & e, f = r(t), s = f.length; if (s != r(n).length && !a) return !1; for (var p = s; p--; ) { var d = f[p]; if (!(a ? d in n : o.call(n, d))) return !1; } var h = c.get(t), l = c.get(n); if (h && l) return h == n && l == t; var v = !0; c.set(t, n), c.set(n, t); for (var y = a; ++p < s; ) { var g = t[(d = f[p])], b = n[d]; if (i) var m = a ? i(b, g, d, n, t, c) : i(g, b, d, t, n, c); if (!(void 0 === m ? g === b || u(g, b, e, i, c) : m)) { v = !1; break; } y || (y = "constructor" == d); } if (v && !y) { var x = t.constructor, _ = n.constructor; x == _ || !("constructor" in t) || !("constructor" in n) || ("function" == typeof x && x instanceof x && "function" == typeof _ && _ instanceof _) || (v = !1); } return c.delete(t), c.delete(n), v; }; }, function (t, n, e) { var r = e(139), o = e(33); t.exports = function (t) { for (var n = o(t), e = n.length; e--; ) { var i = n[e], u = t[i]; n[e] = [i, u, r(u)]; } return n; }; }, function (t, n, e) { var r = e(135), o = e(290), i = e(142), u = e(99), c = e(139), a = e(140), f = e(55); t.exports = function (t, n) { return u(t) && c(n) ? a(f(t), n) : function (e) { var u = o(e, t); return void 0 === u && u === n ? i(e, t) : r(n, u, 3); }; }; }, function (t, n, e) { var r = e(70); t.exports = function (t, n, e) { var o = null == t ? void 0 : r(t, n); return void 0 === o ? e : o; }; }, function (t, n, e) { var r = e(292), o = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g, u = r(function (t) { var n = []; return ( 46 === t.charCodeAt(0) && n.push(""), t.replace(o, function (t, e, r, o) { n.push(r ? o.replace(i, "$1") : e || t); }), n ); }); t.exports = u; }, function (t, n, e) { var r = e(293); t.exports = function (t) { var n = r(t, function (t) { return 500 === e.size && e.clear(), t; }), e = n.cache; return n; }; }, function (t, n, e) { var r = e(87); function o(t, n) { if ("function" != typeof t || (null != n && "function" != typeof n)) throw new TypeError("Expected a function"); var e = function e() { var r = arguments, o = n ? n.apply(this, r) : r[0], i = e.cache; if (i.has(o)) return i.get(o); var u = t.apply(this, r); return (e.cache = i.set(o, u) || i), u; }; return (e.cache = new (o.Cache || r)()), e; } (o.Cache = r), (t.exports = o); }, function (t, n, e) { var r = e(42), o = e(72), i = e(17), u = e(45), c = r ? r.prototype : void 0, a = c ? c.toString : void 0; t.exports = function t(n) { if ("string" == typeof n) return n; if (i(n)) return o(n, t) + ""; if (u(n)) return a ? a.call(n) : ""; var e = n + ""; return "0" == e && 1 / n == -1 / 0 ? "-0" : e; }; }, function (t, n) { t.exports = function (t, n) { return null != t && n in Object(t); }; }, function (t, n, e) { var r = e(144), o = e(297), i = e(99), u = e(55); t.exports = function (t) { return i(t) ? r(u(t)) : o(t); }; }, function (t, n, e) { var r = e(70); t.exports = function (t) { return function (n) { return r(n, t); }; }; }, function (t, n) { var e = Object.prototype.hasOwnProperty; t.exports = function (t, n) { return null != t && e.call(t, n); }; }, function (t, n, e) { var r = e(91), o = e(44), i = e(53), u = e(17), c = e(30), a = e(43), f = e(67), s = e(54), p = Object.prototype.hasOwnProperty; t.exports = function (t) { if (null == t) return !0; if ( c(t) && (u(t) || "string" == typeof t || "function" == typeof t.splice || a(t) || s(t) || i(t)) ) return !t.length; var n = o(t); if ("[object Map]" == n || "[object Set]" == n) return !t.size; if (f(t)) return !r(t).length; for (var e in t) if (p.call(t, e)) return !1; return !0; }; }, function (t, n) { t.exports = function (t, n, e, r) { var o = -1, i = null == t ? 0 : t.length; for (r && i && (e = t[++o]); ++o < i; ) e = n(e, t[o], o, t); return e; }; }, function (t, n) { t.exports = function (t, n, e, r, o) { return ( o(t, function (t, o, i) { e = r ? ((r = !1), t) : n(e, t, o, i); }), e ); }; }, function (t, n, e) { var r = e(91), o = e(44), i = e(30), u = e(303), c = e(304); t.exports = function (t) { if (null == t) return 0; if (i(t)) return u(t) ? c(t) : t.length; var n = o(t); return "[object Map]" == n || "[object Set]" == n ? t.size : r(t).length; }; }, function (t, n, e) { var r = e(36), o = e(17), i = e(26); t.exports = function (t) { return ( "string" == typeof t || (!o(t) && i(t) && "[object String]" == r(t)) ); }; }, function (t, n, e) { var r = e(305), o = e(306), i = e(307); t.exports = function (t) { return o(t) ? i(t) : r(t); }; }, function (t, n, e) { var r = e(144)("length"); t.exports = r; }, function (t, n) { var e = RegExp( "[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]", ); t.exports = function (t) { return e.test(t); }; }, function (t, n) { var e = "[\\ud800-\\udfff]", r = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", o = "\\ud83c[\\udffb-\\udfff]", i = "[^\\ud800-\\udfff]", u = "(?:\\ud83c[\\udde6-\\uddff]){2}", c = "[\\ud800-\\udbff][\\udc00-\\udfff]", a = "(?:" + r + "|" + o + ")" + "?", f = "[\\ufe0e\\ufe0f]?" + a + ("(?:\\u200d(?:" + [i, u, c].join("|") + ")[\\ufe0e\\ufe0f]?" + a + ")*"), s = "(?:" + [i + r + "?", r, u, c, e].join("|") + ")", p = RegExp(o + "(?=" + o + ")|" + s + f, "g"); t.exports = function (t) { for (var n = (p.lastIndex = 0); p.test(t); ) ++n; return n; }; }, function (t, n, e) { var r = e(88), o = e(130), i = e(96), u = e(31), c = e(68), a = e(17), f = e(43), s = e(51), p = e(22), d = e(54); t.exports = function (t, n, e) { var h = a(t), l = h || f(t) || d(t); if (((n = u(n, 4)), null == e)) { var v = t && t.constructor; e = l ? (h ? new v() : []) : p(t) && s(v) ? o(c(t)) : {}; } return ( (l ? r : i)(t, function (t, r, o) { return n(e, t, r, o); }), e ); }; }, function (t, n, e) { var r = e(100), o = e(73), i = e(314), u = e(153), c = o(function (t) { return i(r(t, 1, u, !0)); }); t.exports = c; }, function (t, n, e) { var r = e(42), o = e(53), i = e(17), u = r ? r.isConcatSpreadable : void 0; t.exports = function (t) { return i(t) || o(t) || !!(u && t && t[u]); }; }, function (t, n) { t.exports = function (t, n, e) { switch (e.length) { case 0: return t.call(n); case 1: return t.call(n, e[0]); case 2: return t.call(n, e[0], e[1]); case 3: return t.call(n, e[0], e[1], e[2]); } return t.apply(n, e); }; }, function (t, n, e) { var r = e(95), o = e(116), i = e(38), u = o ? function (t, n) { return o(t, "toString", { configurable: !0, enumerable: !1, value: r(n), writable: !0, }); } : i; t.exports = u; }, function (t, n) { var e = Date.now; t.exports = function (t) { var n = 0, r = 0; return function () { var o = e(), i = 16 - (o - r); if (((r = o), i > 0)) { if (++n >= 800) return arguments[0]; } else n = 0; return t.apply(void 0, arguments); }; }; }, function (t, n, e) { var r = e(137), o = e(315), i = e(319), u = e(138), c = e(320), a = e(98); t.exports = function (t, n, e) { var f = -1, s = o, p = t.length, d = !0, h = [], l = h; if (e) (d = !1), (s = i); else if (p >= 200) { var v = n ? null : c(t); if (v) return a(v); (d = !1), (s = u), (l = new r()); } else l = n ? [] : h; t: for (; ++f < p; ) { var y = t[f], g = n ? n(y) : y; if (((y = e || 0 !== y ? y : 0), d && g == g)) { for (var b = l.length; b--; ) if (l[b] === g) continue t; n && l.push(g), h.push(y); } else s(l, g, e) || (l !== h && l.push(g), h.push(y)); } return h; }; }, function (t, n, e) { var r = e(316); t.exports = function (t, n) { return !!(null == t ? 0 : t.length) && r(t, n, 0) > -1; }; }, function (t, n, e) { var r = e(152), o = e(317), i = e(318); t.exports = function (t, n, e) { return n == n ? i(t, n, e) : r(t, o, e); }; }, function (t, n) { t.exports = function (t) { return t != t; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = e - 1, o = t.length; ++r < o; ) if (t[r] === n) return r; return -1; }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = null == t ? 0 : t.length; ++r < o; ) if (e(n, t[r])) return !0; return !1; }; }, function (t, n, e) { var r = e(126), o = e(321), i = e(98), u = r && 1 / i(new r([, -0]))[1] == 1 / 0 ? function (t) { return new r(t); } : o; t.exports = u; }, function (t, n) { t.exports = function () {}; }, function (t, n, e) { var r = e(72); t.exports = function (t, n) { return r(n, function (n) { return t[n]; }); }; }, function (t, n) { t.exports = "2.1.8"; }, function (t, n, e) { var r = e(21), o = e(85); function i(t) { return r.map(t.nodes(), function (n) { var e = t.node(n), o = t.parent(n), i = { v: n }; return ( r.isUndefined(e) || (i.value = e), r.isUndefined(o) || (i.parent = o), i ); }); } function u(t) { return r.map(t.edges(), function (n) { var e = t.edge(n), o = { v: n.v, w: n.w }; return ( r.isUndefined(n.name) || (o.name = n.name), r.isUndefined(e) || (o.value = e), o ); }); } t.exports = { write: function (t) { var n = { options: { directed: t.isDirected(), multigraph: t.isMultigraph(), compound: t.isCompound(), }, nodes: i(t), edges: u(t), }; r.isUndefined(t.graph()) || (n.value = r.clone(t.graph())); return n; }, read: function (t) { var n = new o(t.options).setGraph(t.value); return ( r.each(t.nodes, function (t) { n.setNode(t.v, t.value), t.parent && n.setParent(t.v, t.parent); }), r.each(t.edges, function (t) { n.setEdge({ v: t.v, w: t.w, name: t.name }, t.value); }), n ); }, }; }, function (t, n, e) { t.exports = { components: e(326), dijkstra: e(155), dijkstraAll: e(327), findCycles: e(328), floydWarshall: e(329), isAcyclic: e(330), postorder: e(331), preorder: e(332), prim: e(333), tarjan: e(157), topsort: e(158), }; }, function (t, n, e) { var r = e(21); t.exports = function (t) { var n, e = {}, o = []; function i(o) { r.has(e, o) || ((e[o] = !0), n.push(o), r.each(t.successors(o), i), r.each(t.predecessors(o), i)); } return ( r.each(t.nodes(), function (t) { (n = []), i(t), n.length && o.push(n); }), o ); }; }, function (t, n, e) { var r = e(155), o = e(21); t.exports = function (t, n, e) { return o.transform( t.nodes(), function (o, i) { o[i] = r(t, i, n, e); }, {}, ); }; }, function (t, n, e) { var r = e(21), o = e(157); t.exports = function (t) { return r.filter(o(t), function (n) { return n.length > 1 || (1 === n.length && t.hasEdge(n[0], n[0])); }); }; }, function (t, n, e) { var r = e(21); t.exports = function (t, n, e) { return (function (t, n, e) { var r = {}, o = t.nodes(); return ( o.forEach(function (t) { (r[t] = {}), (r[t][t] = { distance: 0 }), o.forEach(function (n) { t !== n && (r[t][n] = { distance: Number.POSITIVE_INFINITY }); }), e(t).forEach(function (e) { var o = e.v === t ? e.w : e.v, i = n(e); r[t][o] = { distance: i, predecessor: t }; }); }), o.forEach(function (t) { var n = r[t]; o.forEach(function (e) { var i = r[e]; o.forEach(function (e) { var r = i[t], o = n[e], u = i[e], c = r.distance + o.distance; c < u.distance && ((u.distance = c), (u.predecessor = o.predecessor)); }); }); }), r ); })( t, n || o, e || function (n) { return t.outEdges(n); }, ); }; var o = r.constant(1); }, function (t, n, e) { var r = e(158); t.exports = function (t) { try { r(t); } catch (t) { if (t instanceof r.CycleException) return !1; throw t; } return !0; }; }, function (t, n, e) { var r = e(159); t.exports = function (t, n) { return r(t, n, "post"); }; }, function (t, n, e) { var r = e(159); t.exports = function (t, n) { return r(t, n, "pre"); }; }, function (t, n, e) { var r = e(21), o = e(85), i = e(156); t.exports = function (t, n) { var e, u = new o(), c = {}, a = new i(); function f(t) { var r = t.v === e ? t.w : t.v, o = a.priority(r); if (void 0 !== o) { var i = n(t); i < o && ((c[r] = e), a.decrease(r, i)); } } if (0 === t.nodeCount()) return u; r.each(t.nodes(), function (t) { a.add(t, Number.POSITIVE_INFINITY), u.setNode(t); }), a.decrease(t.nodes()[0], 0); var s = !1; for (; a.size() > 0; ) { if (((e = a.removeMin()), r.has(c, e))) u.setEdge(e, c[e]); else { if (s) throw new Error("Input graph is not connected: " + t); s = !0; } t.nodeEdges(e).forEach(f); } return u; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(374), i = e(377), u = e(378), c = e(19).normalizeRanks, a = e(380), f = e(19).removeEmptyRanks, s = e(381), p = e(382), d = e(383), h = e(384), l = e(393), v = e(19), y = e(23).Graph; t.exports = function (t, n) { var e = n && n.debugTiming ? v.time : v.notime; e("layout", function () { var n = e(" buildLayoutGraph", function () { return (function (t) { var n = new y({ multigraph: !0, compound: !0 }), e = S(t.graph()); return ( n.setGraph(r.merge({}, b, k(e, g), r.pick(e, m))), r.forEach(t.nodes(), function (e) { var o = S(t.node(e)); n.setNode(e, r.defaults(k(o, x), _)), n.setParent(e, t.parent(e)); }), r.forEach(t.edges(), function (e) { var o = S(t.edge(e)); n.setEdge(e, r.merge({}, E, k(o, w), r.pick(o, j))); }), n ); })(t); }); e(" runLayout", function () { !(function (t, n) { n(" makeSpaceForEdgeLabels", function () { !(function (t) { var n = t.graph(); (n.ranksep /= 2), r.forEach(t.edges(), function (e) { var r = t.edge(e); (r.minlen *= 2), "c" !== r.labelpos.toLowerCase() && ("TB" === n.rankdir || "BT" === n.rankdir ? (r.width += r.labeloffset) : (r.height += r.labeloffset)); }); })(t); }), n(" removeSelfEdges", function () { !(function (t) { r.forEach(t.edges(), function (n) { if (n.v === n.w) { var e = t.node(n.v); e.selfEdges || (e.selfEdges = []), e.selfEdges.push({ e: n, label: t.edge(n) }), t.removeEdge(n); } }); })(t); }), n(" acyclic", function () { o.run(t); }), n(" nestingGraph.run", function () { s.run(t); }), n(" rank", function () { u(v.asNonCompoundGraph(t)); }), n(" injectEdgeLabelProxies", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.width && e.height) { var r = t.node(n.v), o = { rank: (t.node(n.w).rank - r.rank) / 2 + r.rank, e: n, }; v.addDummyNode(t, "edge-proxy", o, "_ep"); } }); })(t); }), n(" removeEmptyRanks", function () { f(t); }), n(" nestingGraph.cleanup", function () { s.cleanup(t); }), n(" normalizeRanks", function () { c(t); }), n(" assignRankMinMax", function () { !(function (t) { var n = 0; r.forEach(t.nodes(), function (e) { var o = t.node(e); o.borderTop && ((o.minRank = t.node(o.borderTop).rank), (o.maxRank = t.node(o.borderBottom).rank), (n = r.max(n, o.maxRank))); }), (t.graph().maxRank = n); })(t); }), n(" removeEdgeLabelProxies", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); "edge-proxy" === e.dummy && ((t.edge(e.e).labelRank = e.rank), t.removeNode(n)); }); })(t); }), n(" normalize.run", function () { i.run(t); }), n(" parentDummyChains", function () { a(t); }), n(" addBorderSegments", function () { p(t); }), n(" order", function () { h(t); }), n(" insertSelfEdges", function () { !(function (t) { var n = v.buildLayerMatrix(t); r.forEach(n, function (n) { var e = 0; r.forEach(n, function (n, o) { var i = t.node(n); (i.order = o + e), r.forEach(i.selfEdges, function (n) { v.addDummyNode( t, "selfedge", { width: n.label.width, height: n.label.height, rank: i.rank, order: o + ++e, e: n.e, label: n.label, }, "_se", ); }), delete i.selfEdges; }); }); })(t); }), n(" adjustCoordinateSystem", function () { d.adjust(t); }), n(" position", function () { l(t); }), n(" positionSelfEdges", function () { !(function (t) { r.forEach(t.nodes(), function (n) { var e = t.node(n); if ("selfedge" === e.dummy) { var r = t.node(e.e.v), o = r.x + r.width / 2, i = r.y, u = e.x - o, c = r.height / 2; t.setEdge(e.e, e.label), t.removeNode(n), (e.label.points = [ { x: o + (2 * u) / 3, y: i - c }, { x: o + (5 * u) / 6, y: i - c }, { x: o + u, y: i }, { x: o + (5 * u) / 6, y: i + c }, { x: o + (2 * u) / 3, y: i + c }, ]), (e.label.x = e.x), (e.label.y = e.y); } }); })(t); }), n(" removeBorderNodes", function () { !(function (t) { r.forEach(t.nodes(), function (n) { if (t.children(n).length) { var e = t.node(n), o = t.node(e.borderTop), i = t.node(e.borderBottom), u = t.node(r.last(e.borderLeft)), c = t.node(r.last(e.borderRight)); (e.width = Math.abs(c.x - u.x)), (e.height = Math.abs(i.y - o.y)), (e.x = u.x + e.width / 2), (e.y = o.y + e.height / 2); } }), r.forEach(t.nodes(), function (n) { "border" === t.node(n).dummy && t.removeNode(n); }); })(t); }), n(" normalize.undo", function () { i.undo(t); }), n(" fixupEdgeLabelCoords", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (r.has(e, "x")) switch ( (("l" !== e.labelpos && "r" !== e.labelpos) || (e.width -= e.labeloffset), e.labelpos) ) { case "l": e.x -= e.width / 2 + e.labeloffset; break; case "r": e.x += e.width / 2 + e.labeloffset; } }); })(t); }), n(" undoCoordinateSystem", function () { d.undo(t); }), n(" translateGraph", function () { !(function (t) { var n = Number.POSITIVE_INFINITY, e = 0, o = Number.POSITIVE_INFINITY, i = 0, u = t.graph(), c = u.marginx || 0, a = u.marginy || 0; function f(t) { var r = t.x, u = t.y, c = t.width, a = t.height; (n = Math.min(n, r - c / 2)), (e = Math.max(e, r + c / 2)), (o = Math.min(o, u - a / 2)), (i = Math.max(i, u + a / 2)); } r.forEach(t.nodes(), function (n) { f(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.has(e, "x") && f(e); }), (n -= c), (o -= a), r.forEach(t.nodes(), function (e) { var r = t.node(e); (r.x -= n), (r.y -= o); }), r.forEach(t.edges(), function (e) { var i = t.edge(e); r.forEach(i.points, function (t) { (t.x -= n), (t.y -= o); }), r.has(i, "x") && (i.x -= n), r.has(i, "y") && (i.y -= o); }), (u.width = e - n + c), (u.height = i - o + a); })(t); }), n(" assignNodeIntersects", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e, r, o = t.edge(n), i = t.node(n.v), u = t.node(n.w); o.points ? ((e = o.points[0]), (r = o.points[o.points.length - 1])) : ((o.points = []), (e = u), (r = i)), o.points.unshift(v.intersectRect(i, e)), o.points.push(v.intersectRect(u, r)); }); })(t); }), n(" reversePoints", function () { !(function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); e.reversed && e.points.reverse(); }); })(t); }), n(" acyclic.undo", function () { o.undo(t); }); })(n, e); }), e(" updateInputGraph", function () { !(function (t, n) { r.forEach(t.nodes(), function (e) { var r = t.node(e), o = n.node(e); r && ((r.x = o.x), (r.y = o.y), n.children(e).length && ((r.width = o.width), (r.height = o.height))); }), r.forEach(t.edges(), function (e) { var o = t.edge(e), i = n.edge(e); (o.points = i.points), r.has(i, "x") && ((o.x = i.x), (o.y = i.y)); }), (t.graph().width = n.graph().width), (t.graph().height = n.graph().height); })(t, n); }); }); }; var g = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], b = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, m = ["acyclicer", "ranker", "rankdir", "align"], x = ["width", "height"], _ = { width: 0, height: 0 }, w = ["minlen", "weight", "width", "height", "labeloffset"], E = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r", }, j = ["labelpos"]; function k(t, n) { return r.mapValues(r.pick(t, n), Number); } function S(t) { var n = {}; return ( r.forEach(t, function (t, e) { n[e.toLowerCase()] = t; }), n ); } }, function (t, n, e) { var r = e(113); t.exports = function (t) { return r(t, 5); }; }, function (t, n, e) { var r = e(73), o = e(41), i = e(74), u = e(37), c = Object.prototype, a = c.hasOwnProperty, f = r(function (t, n) { t = Object(t); var e = -1, r = n.length, f = r > 2 ? n[2] : void 0; for (f && i(n[0], n[1], f) && (r = 1); ++e < r; ) for (var s = n[e], p = u(s), d = -1, h = p.length; ++d < h; ) { var l = p[d], v = t[l]; (void 0 === v || (o(v, c[l]) && !a.call(t, l))) && (t[l] = s[l]); } return t; }); t.exports = f; }, function (t, n, e) { var r = e(338)(e(339)); t.exports = r; }, function (t, n, e) { var r = e(31), o = e(30), i = e(33); t.exports = function (t) { return function (n, e, u) { var c = Object(n); if (!o(n)) { var a = r(e, 3); (n = i(n)), (e = function (t) { return a(c[t], t, c); }); } var f = t(n, e, u); return f > -1 ? c[a ? n[f] : f] : void 0; }; }; }, function (t, n, e) { var r = e(152), o = e(31), i = e(340), u = Math.max; t.exports = function (t, n, e) { var c = null == t ? 0 : t.length; if (!c) return -1; var a = null == e ? 0 : i(e); return a < 0 && (a = u(c + a, 0)), r(t, o(n, 3), a); }; }, function (t, n, e) { var r = e(160); t.exports = function (t) { var n = r(t), e = n % 1; return n == n ? (e ? n - e : n) : 0; }; }, function (t, n, e) { var r = e(342), o = e(22), i = e(45), u = /^[-+]0x[0-9a-f]+$/i, c = /^0b[01]+$/i, a = /^0o[0-7]+$/i, f = parseInt; t.exports = function (t) { if ("number" == typeof t) return t; if (i(t)) return NaN; if (o(t)) { var n = "function" == typeof t.valueOf ? t.valueOf() : t; t = o(n) ? n + "" : n; } if ("string" != typeof t) return 0 === t ? t : +t; t = r(t); var e = c.test(t); return e || a.test(t) ? f(t.slice(2), e ? 2 : 8) : u.test(t) ? NaN : +t; }; }, function (t, n, e) { var r = e(343), o = /^\s+/; t.exports = function (t) { return t ? t.slice(0, r(t) + 1).replace(o, "") : t; }; }, function (t, n) { var e = /\s/; t.exports = function (t) { for (var n = t.length; n-- && e.test(t.charAt(n)); ); return n; }; }, function (t, n, e) { var r = e(97), o = e(133), i = e(37); t.exports = function (t, n) { return null == t ? t : r(t, o(n), i); }; }, function (t, n) { t.exports = function (t) { var n = null == t ? 0 : t.length; return n ? t[n - 1] : void 0; }; }, function (t, n, e) { var r = e(64), o = e(96), i = e(31); t.exports = function (t, n) { var e = {}; return ( (n = i(n, 3)), o(t, function (t, o, i) { r(e, o, n(t, o, i)); }), e ); }; }, function (t, n, e) { var r = e(101), o = e(348), i = e(38); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n) { t.exports = function (t, n) { return t > n; }; }, function (t, n, e) { var r = e(350), o = e(354)(function (t, n, e) { r(t, n, e); }); t.exports = o; }, function (t, n, e) { var r = e(58), o = e(162), i = e(97), u = e(351), c = e(22), a = e(37), f = e(163); t.exports = function t(n, e, s, p, d) { n !== e && i( e, function (i, a) { if ((d || (d = new r()), c(i))) u(n, e, a, s, t, p, d); else { var h = p ? p(f(n, a), i, a + "", n, e, d) : void 0; void 0 === h && (h = i), o(n, a, h); } }, a, ); }; }, function (t, n, e) { var r = e(162), o = e(119), i = e(128), u = e(120), c = e(129), a = e(53), f = e(17), s = e(153), p = e(43), d = e(51), h = e(22), l = e(352), v = e(54), y = e(163), g = e(353); t.exports = function (t, n, e, b, m, x, _) { var w = y(t, e), E = y(n, e), j = _.get(E); if (j) r(t, e, j); else { var k = x ? x(w, E, e + "", t, n, _) : void 0, S = void 0 === k; if (S) { var O = f(E), N = !O && p(E), I = !O && !N && v(E); (k = E), O || N || I ? f(w) ? (k = w) : s(w) ? (k = u(w)) : N ? ((S = !1), (k = o(E, !0))) : I ? ((S = !1), (k = i(E, !0))) : (k = []) : l(E) || a(E) ? ((k = w), a(w) ? (k = g(w)) : (h(w) && !d(w)) || (k = c(E))) : (S = !1); } S && (_.set(E, k), m(k, E, b, x, _), _.delete(E)), r(t, e, k); } }; }, function (t, n, e) { var r = e(36), o = e(68), i = e(26), u = Function.prototype, c = Object.prototype, a = u.toString, f = c.hasOwnProperty, s = a.call(Object); t.exports = function (t) { if (!i(t) || "[object Object]" != r(t)) return !1; var n = o(t); if (null === n) return !0; var e = f.call(n, "constructor") && n.constructor; return "function" == typeof e && e instanceof e && a.call(e) == s; }; }, function (t, n, e) { var r = e(52), o = e(37); t.exports = function (t) { return r(t, o(t)); }; }, function (t, n, e) { var r = e(73), o = e(74); t.exports = function (t) { return r(function (n, e) { var r = -1, i = e.length, u = i > 1 ? e[i - 1] : void 0, c = i > 2 ? e[2] : void 0; for ( u = t.length > 3 && "function" == typeof u ? (i--, u) : void 0, c && o(e[0], e[1], c) && ((u = i < 3 ? void 0 : u), (i = 1)), n = Object(n); ++r < i; ) { var a = e[r]; a && t(n, a, r, u); } return n; }); }; }, function (t, n, e) { var r = e(101), o = e(164), i = e(38); t.exports = function (t) { return t && t.length ? r(t, i, o) : void 0; }; }, function (t, n, e) { var r = e(101), o = e(31), i = e(164); t.exports = function (t, n) { return t && t.length ? r(t, o(n, 2), i) : void 0; }; }, function (t, n, e) { var r = e(24); t.exports = function () { return r.Date.now(); }; }, function (t, n, e) { var r = e(359), o = e(362)(function (t, n) { return null == t ? {} : r(t, n); }); t.exports = o; }, function (t, n, e) { var r = e(360), o = e(142); t.exports = function (t, n) { return r(t, n, function (n, e) { return o(t, e); }); }; }, function (t, n, e) { var r = e(70), o = e(361), i = e(71); t.exports = function (t, n, e) { for (var u = -1, c = n.length, a = {}; ++u < c; ) { var f = n[u], s = r(t, f); e(s, f) && o(a, i(f, t), s); } return a; }; }, function (t, n, e) { var r = e(63), o = e(71), i = e(65), u = e(22), c = e(55); t.exports = function (t, n, e, a) { if (!u(t)) return t; for ( var f = -1, s = (n = o(n, t)).length, p = s - 1, d = t; null != d && ++f < s; ) { var h = c(n[f]), l = e; if ("__proto__" === h || "constructor" === h || "prototype" === h) return t; if (f != p) { var v = d[h]; void 0 === (l = a ? a(v, h, d) : void 0) && (l = u(v) ? v : i(n[f + 1]) ? [] : {}); } r(d, h, l), (d = d[h]); } return t; }; }, function (t, n, e) { var r = e(161), o = e(150), i = e(151); t.exports = function (t) { return i(o(t, void 0, r), t + ""); }; }, function (t, n, e) { var r = e(364)(); t.exports = r; }, function (t, n, e) { var r = e(365), o = e(74), i = e(160); t.exports = function (t) { return function (n, e, u) { return ( u && "number" != typeof u && o(n, e, u) && (e = u = void 0), (n = i(n)), void 0 === e ? ((e = n), (n = 0)) : (e = i(e)), (u = void 0 === u ? (n < e ? 1 : -1) : i(u)), r(n, e, u, t) ); }; }; }, function (t, n) { var e = Math.ceil, r = Math.max; t.exports = function (t, n, o, i) { for (var u = -1, c = r(e((n - t) / (o || 1)), 0), a = Array(c); c--; ) (a[i ? c : ++u] = t), (t += o); return a; }; }, function (t, n, e) { var r = e(100), o = e(367), i = e(73), u = e(74), c = i(function (t, n) { if (null == t) return []; var e = n.length; return ( e > 1 && u(t, n[0], n[1]) ? (n = []) : e > 2 && u(n[0], n[1], n[2]) && (n = [n[0]]), o(t, r(n, 1), []) ); }); t.exports = c; }, function (t, n, e) { var r = e(72), o = e(70), i = e(31), u = e(148), c = e(368), a = e(66), f = e(369), s = e(38), p = e(17); t.exports = function (t, n, e) { n = n.length ? r(n, function (t) { return p(t) ? function (n) { return o(n, 1 === t.length ? t[0] : t); } : t; }) : [s]; var d = -1; n = r(n, a(i)); var h = u(t, function (t, e, o) { return { criteria: r(n, function (n) { return n(t); }), index: ++d, value: t, }; }); return c(h, function (t, n) { return f(t, n, e); }); }; }, function (t, n) { t.exports = function (t, n) { var e = t.length; for (t.sort(n); e--; ) t[e] = t[e].value; return t; }; }, function (t, n, e) { var r = e(370); t.exports = function (t, n, e) { for ( var o = -1, i = t.criteria, u = n.criteria, c = i.length, a = e.length; ++o < c; ) { var f = r(i[o], u[o]); if (f) return o >= a ? f : f * ("desc" == e[o] ? -1 : 1); } return t.index - n.index; }; }, function (t, n, e) { var r = e(45); t.exports = function (t, n) { if (t !== n) { var e = void 0 !== t, o = null === t, i = t == t, u = r(t), c = void 0 !== n, a = null === n, f = n == n, s = r(n); if ( (!a && !s && !u && t > n) || (u && c && f && !a && !s) || (o && c && f) || (!e && f) || !i ) return 1; if ( (!o && !u && !s && t < n) || (s && e && i && !o && !u) || (a && e && i) || (!c && i) || !f ) return -1; } return 0; }; }, function (t, n, e) { var r = e(141), o = 0; t.exports = function (t) { var n = ++o; return r(t) + n; }; }, function (t, n, e) { var r = e(63), o = e(373); t.exports = function (t, n) { return o(t || [], n || [], r); }; }, function (t, n) { t.exports = function (t, n, e) { for (var r = -1, o = t.length, i = n.length, u = {}; ++r < o; ) { var c = r < i ? n[r] : void 0; e(u, t[r], c); } return u; }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(375); t.exports = { run: function (t) { var n = "greedy" === t.graph().acyclicer ? o( t, (function (t) { return function (n) { return t.edge(n).weight; }; })(t), ) : (function (t) { var n = [], e = {}, o = {}; function i(u) { r.has(o, u) || ((o[u] = !0), (e[u] = !0), r.forEach(t.outEdges(u), function (t) { r.has(e, t.w) ? n.push(t) : i(t.w); }), delete e[u]); } return r.forEach(t.nodes(), i), n; })(t); r.forEach(n, function (n) { var e = t.edge(n); t.removeEdge(n), (e.forwardName = n.name), (e.reversed = !0), t.setEdge(n.w, n.v, e, r.uniqueId("rev")); }); }, undo: function (t) { r.forEach(t.edges(), function (n) { var e = t.edge(n); if (e.reversed) { t.removeEdge(n); var r = e.forwardName; delete e.reversed, delete e.forwardName, t.setEdge(n.w, n.v, e, r); } }); }, }; }, function (t, n, e) { var r = e(9), o = e(23).Graph, i = e(376); t.exports = function (t, n) { if (t.nodeCount() <= 1) return []; var e = (function (t, n) { var e = new o(), u = 0, c = 0; r.forEach(t.nodes(), function (t) { e.setNode(t, { v: t, in: 0, out: 0 }); }), r.forEach(t.edges(), function (t) { var r = e.edge(t.v, t.w) || 0, o = n(t), i = r + o; e.setEdge(t.v, t.w, i), (c = Math.max(c, (e.node(t.v).out += o))), (u = Math.max(u, (e.node(t.w).in += o))); }); var f = r.range(c + u + 3).map(function () { return new i(); }), s = u + 1; return ( r.forEach(e.nodes(), function (t) { a(f, s, e.node(t)); }), { graph: e, buckets: f, zeroIdx: s } ); })(t, n || u), f = (function (t, n, e) { var r, o = [], i = n[n.length - 1], u = n[0]; for (; t.nodeCount(); ) { for (; (r = u.dequeue()); ) c(t, n, e, r); for (; (r = i.dequeue()); ) c(t, n, e, r); if (t.nodeCount()) for (var a = n.length - 2; a > 0; --a) if ((r = n[a].dequeue())) { o = o.concat(c(t, n, e, r, !0)); break; } } return o; })(e.graph, e.buckets, e.zeroIdx); return r.flatten( r.map(f, function (n) { return t.outEdges(n.v, n.w); }), !0, ); }; var u = r.constant(1); function c(t, n, e, o, i) { var u = i ? [] : void 0; return ( r.forEach(t.inEdges(o.v), function (r) { var o = t.edge(r), c = t.node(r.v); i && u.push({ v: r.v, w: r.w }), (c.out -= o), a(n, e, c); }), r.forEach(t.outEdges(o.v), function (r) { var o = t.edge(r), i = r.w, u = t.node(i); (u.in -= o), a(n, e, u); }), t.removeNode(o.v), u ); } function a(t, n, e) { e.out ? e.in ? t[e.out - e.in + n].enqueue(e) : t[t.length - 1].enqueue(e) : t[0].enqueue(e); } }, function (t, n) { function e() { var t = {}; (t._next = t._prev = t), (this._sentinel = t); } function r(t) { (t._prev._next = t._next), (t._next._prev = t._prev), delete t._next, delete t._prev; } function o(t, n) { if ("_next" !== t && "_prev" !== t) return n; } (t.exports = e), (e.prototype.dequeue = function () { var t = this._sentinel, n = t._prev; if (n !== t) return r(n), n; }), (e.prototype.enqueue = function (t) { var n = this._sentinel; t._prev && t._next && r(t), (t._next = n._next), (n._next._prev = t), (n._next = t), (t._prev = n); }), (e.prototype.toString = function () { for (var t = [], n = this._sentinel, e = n._prev; e !== n; ) t.push(JSON.stringify(e, o)), (e = e._prev); return "[" + t.join(", ") + "]"; }); }, function (t, n, e) { "use strict"; var r = e(9), o = e(19); t.exports = { run: function (t) { (t.graph().dummyChains = []), r.forEach(t.edges(), function (n) { !(function (t, n) { var e, r, i, u = n.v, c = t.node(u).rank, a = n.w, f = t.node(a).rank, s = n.name, p = t.edge(n), d = p.labelRank; if (f === c + 1) return; for (t.removeEdge(n), i = 0, ++c; c < f; ++i, ++c) (p.points = []), (r = { width: 0, height: 0, edgeLabel: p, edgeObj: n, rank: c, }), (e = o.addDummyNode(t, "edge", r, "_d")), c === d && ((r.width = p.width), (r.height = p.height), (r.dummy = "edge-label"), (r.labelpos = p.labelpos)), t.setEdge(u, e, { weight: p.weight }, s), 0 === i && t.graph().dummyChains.push(e), (u = e); t.setEdge(u, a, { weight: p.weight }, s); })(t, n); }); }, undo: function (t) { r.forEach(t.graph().dummyChains, function (n) { var e, r = t.node(n), o = r.edgeLabel; for (t.setEdge(r.edgeObj, o); r.dummy; ) (e = t.successors(n)[0]), t.removeNode(n), o.points.push({ x: r.x, y: r.y }), "edge-label" === r.dummy && ((o.x = r.x), (o.y = r.y), (o.width = r.width), (o.height = r.height)), (n = e), (r = t.node(n)); }); }, }; }, function (t, n, e) { "use strict"; var r = e(75).longestPath, o = e(165), i = e(379); t.exports = function (t) { switch (t.graph().ranker) { case "network-simplex": c(t); break; case "tight-tree": !(function (t) { r(t), o(t); })(t); break; case "longest-path": u(t); break; default: c(t); } }; var u = r; function c(t) { i(t); } }, function (t, n, e) { "use strict"; var r = e(9), o = e(165), i = e(75).slack, u = e(75).longestPath, c = e(23).alg.preorder, a = e(23).alg.postorder, f = e(19).simplify; function s(t) { (t = f(t)), u(t); var n, e = o(t); for (h(e), p(e, t); (n = v(e)); ) g(e, t, n, y(e, t, n)); } function p(t, n) { var e = a(t, t.nodes()); (e = e.slice(0, e.length - 1)), r.forEach(e, function (e) { !(function (t, n, e) { var r = t.node(e).parent; t.edge(e, r).cutvalue = d(t, n, e); })(t, n, e); }); } function d(t, n, e) { var o = t.node(e).parent, i = !0, u = n.edge(e, o), c = 0; return ( u || ((i = !1), (u = n.edge(o, e))), (c = u.weight), r.forEach(n.nodeEdges(e), function (r) { var u, a, f = r.v === e, s = f ? r.w : r.v; if (s !== o) { var p = f === i, d = n.edge(r).weight; if (((c += p ? d : -d), (u = e), (a = s), t.hasEdge(u, a))) { var h = t.edge(e, s).cutvalue; c += p ? -h : h; } } }), c ); } function h(t, n) { arguments.length < 2 && (n = t.nodes()[0]), l(t, {}, 1, n); } function l(t, n, e, o, i) { var u = e, c = t.node(o); return ( (n[o] = !0), r.forEach(t.neighbors(o), function (i) { r.has(n, i) || (e = l(t, n, e, i, o)); }), (c.low = u), (c.lim = e++), i ? (c.parent = i) : delete c.parent, e ); } function v(t) { return r.find(t.edges(), function (n) { return t.edge(n).cutvalue < 0; }); } function y(t, n, e) { var o = e.v, u = e.w; n.hasEdge(o, u) || ((o = e.w), (u = e.v)); var c = t.node(o), a = t.node(u), f = c, s = !1; c.lim > a.lim && ((f = a), (s = !0)); var p = r.filter(n.edges(), function (n) { return s === b(t, t.node(n.v), f) && s !== b(t, t.node(n.w), f); }); return r.minBy(p, function (t) { return i(n, t); }); } function g(t, n, e, o) { var i = e.v, u = e.w; t.removeEdge(i, u), t.setEdge(o.v, o.w, {}), h(t), p(t, n), (function (t, n) { var e = r.find(t.nodes(), function (t) { return !n.node(t).parent; }), o = c(t, e); (o = o.slice(1)), r.forEach(o, function (e) { var r = t.node(e).parent, o = n.edge(e, r), i = !1; o || ((o = n.edge(r, e)), (i = !0)), (n.node(e).rank = n.node(r).rank + (i ? o.minlen : -o.minlen)); }); })(t, n); } function b(t, n, e) { return e.low <= n.lim && n.lim <= e.lim; } (t.exports = s), (s.initLowLimValues = h), (s.initCutValues = p), (s.calcCutValue = d), (s.leaveEdge = v), (s.enterEdge = y), (s.exchangeEdges = g); }, function (t, n, e) { var r = e(9); t.exports = function (t) { var n = (function (t) { var n = {}, e = 0; function o(i) { var u = e; r.forEach(t.children(i), o), (n[i] = { low: u, lim: e++ }); } return r.forEach(t.children(), o), n; })(t); r.forEach(t.graph().dummyChains, function (e) { for ( var r = t.node(e), o = r.edgeObj, i = (function (t, n, e, r) { var o, i, u = [], c = [], a = Math.min(n[e].low, n[r].low), f = Math.max(n[e].lim, n[r].lim); o = e; do { (o = t.parent(o)), u.push(o); } while (o && (n[o].low > a || f > n[o].lim)); (i = o), (o = r); for (; (o = t.parent(o)) !== i; ) c.push(o); return { path: u.concat(c.reverse()), lca: i }; })(t, n, o.v, o.w), u = i.path, c = i.lca, a = 0, f = u[a], s = !0; e !== o.w; ) { if (((r = t.node(e)), s)) { for (; (f = u[a]) !== c && t.node(f).maxRank < r.rank; ) a++; f === c && (s = !1); } if (!s) { for ( ; a < u.length - 1 && t.node((f = u[a + 1])).minRank <= r.rank; ) a++; f = u[a]; } t.setParent(e, f), (e = t.successors(e)[0]); } }); }; }, function (t, n, e) { var r = e(9), o = e(19); t.exports = { run: function (t) { var n = o.addDummyNode(t, "root", {}, "_root"), e = (function (t) { var n = {}; return ( r.forEach(t.children(), function (e) { !(function e(o, i) { var u = t.children(o); u && u.length && r.forEach(u, function (t) { e(t, i + 1); }); n[o] = i; })(e, 1); }), n ); })(t), i = r.max(r.values(e)) - 1, u = 2 * i + 1; (t.graph().nestingRoot = n), r.forEach(t.edges(), function (n) { t.edge(n).minlen *= u; }); var c = (function (t) { return r.reduce( t.edges(), function (n, e) { return n + t.edge(e).weight; }, 0, ); })(t) + 1; r.forEach(t.children(), function (a) { !(function t(n, e, i, u, c, a, f) { var s = n.children(f); if (!s.length) return void ( f !== e && n.setEdge(e, f, { weight: 0, minlen: i }) ); var p = o.addBorderNode(n, "_bt"), d = o.addBorderNode(n, "_bb"), h = n.node(f); n.setParent(p, f), (h.borderTop = p), n.setParent(d, f), (h.borderBottom = d), r.forEach(s, function (r) { t(n, e, i, u, c, a, r); var o = n.node(r), s = o.borderTop ? o.borderTop : r, h = o.borderBottom ? o.borderBottom : r, l = o.borderTop ? u : 2 * u, v = s !== h ? 1 : c - a[f] + 1; n.setEdge(p, s, { weight: l, minlen: v, nestingEdge: !0 }), n.setEdge(h, d, { weight: l, minlen: v, nestingEdge: !0 }); }), n.parent(f) || n.setEdge(e, p, { weight: 0, minlen: c + a[f] }); })(t, n, u, c, i, e, a); }), (t.graph().nodeRankFactor = u); }, cleanup: function (t) { var n = t.graph(); t.removeNode(n.nestingRoot), delete n.nestingRoot, r.forEach(t.edges(), function (n) { t.edge(n).nestingEdge && t.removeEdge(n); }); }, }; }, function (t, n, e) { var r = e(9), o = e(19); function i(t, n, e, r, i, u) { var c = { width: 0, height: 0, rank: u, borderType: n }, a = i[n][u - 1], f = o.addDummyNode(t, "border", c, e); (i[n][u] = f), t.setParent(f, r), a && t.setEdge(a, f, { weight: 1 }); } t.exports = function (t) { r.forEach(t.children(), function n(e) { var o = t.children(e), u = t.node(e); if ((o.length && r.forEach(o, n), r.has(u, "minRank"))) { (u.borderLeft = []), (u.borderRight = []); for (var c = u.minRank, a = u.maxRank + 1; c < a; ++c) i(t, "borderLeft", "_bl", e, u, c), i(t, "borderRight", "_br", e, u, c); } }); }; }, function (t, n, e) { "use strict"; var r = e(9); function o(t) { r.forEach(t.nodes(), function (n) { i(t.node(n)); }), r.forEach(t.edges(), function (n) { i(t.edge(n)); }); } function i(t) { var n = t.width; (t.width = t.height), (t.height = n); } function u(t) { t.y = -t.y; } function c(t) { var n = t.x; (t.x = t.y), (t.y = n); } t.exports = { adjust: function (t) { var n = t.graph().rankdir.toLowerCase(); ("lr" !== n && "rl" !== n) || o(t); }, undo: function (t) { var n = t.graph().rankdir.toLowerCase(); ("bt" !== n && "rl" !== n) || (function (t) { r.forEach(t.nodes(), function (n) { u(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, u), r.has(e, "y") && u(e); }); })(t); ("lr" !== n && "rl" !== n) || (!(function (t) { r.forEach(t.nodes(), function (n) { c(t.node(n)); }), r.forEach(t.edges(), function (n) { var e = t.edge(n); r.forEach(e.points, c), r.has(e, "x") && c(e); }); })(t), o(t)); }, }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(385), i = e(386), u = e(387), c = e(391), a = e(392), f = e(23).Graph, s = e(19); function p(t, n, e) { return r.map(n, function (n) { return c(t, n, e); }); } function d(t, n) { var e = new f(); r.forEach(t, function (t) { var o = t.graph().root, i = u(t, o, e, n); r.forEach(i.vs, function (n, e) { t.node(n).order = e; }), a(t, e, i.vs); }); } function h(t, n) { r.forEach(n, function (n) { r.forEach(n, function (n, e) { t.node(n).order = e; }); }); } t.exports = function (t) { var n = s.maxRank(t), e = p(t, r.range(1, n + 1), "inEdges"), u = p(t, r.range(n - 1, -1, -1), "outEdges"), c = o(t); h(t, c); for ( var a, f = Number.POSITIVE_INFINITY, l = 0, v = 0; v < 4; ++l, ++v ) { d(l % 2 ? e : u, l % 4 >= 2), (c = s.buildLayerMatrix(t)); var y = i(t, c); y < f && ((v = 0), (a = r.cloneDeep(c)), (f = y)); } h(t, a); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = function (t) { var n = {}, e = r.filter(t.nodes(), function (n) { return !t.children(n).length; }), o = r.max( r.map(e, function (n) { return t.node(n).rank; }), ), i = r.map(r.range(o + 1), function () { return []; }); var u = r.sortBy(e, function (n) { return t.node(n).rank; }); return ( r.forEach(u, function e(o) { if (r.has(n, o)) return; n[o] = !0; var u = t.node(o); i[u.rank].push(o), r.forEach(t.successors(o), e); }), i ); }; }, function (t, n, e) { "use strict"; var r = e(9); function o(t, n, e) { for ( var o = r.zipObject( e, r.map(e, function (t, n) { return n; }), ), i = r.flatten( r.map(n, function (n) { return r.sortBy( r.map(t.outEdges(n), function (n) { return { pos: o[n.w], weight: t.edge(n).weight }; }), "pos", ); }), !0, ), u = 1; u < e.length; ) u <<= 1; var c = 2 * u - 1; u -= 1; var a = r.map(new Array(c), function () { return 0; }), f = 0; return ( r.forEach( i.forEach(function (t) { var n = t.pos + u; a[n] += t.weight; for (var e = 0; n > 0; ) n % 2 && (e += a[n + 1]), (a[(n = (n - 1) >> 1)] += t.weight); f += t.weight * e; }), ), f ); } t.exports = function (t, n) { for (var e = 0, r = 1; r < n.length; ++r) e += o(t, n[r - 1], n[r]); return e; }; }, function (t, n, e) { var r = e(9), o = e(388), i = e(389), u = e(390); t.exports = function t(n, e, c, a) { var f = n.children(e), s = n.node(e), p = s ? s.borderLeft : void 0, d = s ? s.borderRight : void 0, h = {}; p && (f = r.filter(f, function (t) { return t !== p && t !== d; })); var l = o(n, f); r.forEach(l, function (e) { if (n.children(e.v).length) { var o = t(n, e.v, c, a); (h[e.v] = o), r.has(o, "barycenter") && ((i = e), (u = o), r.isUndefined(i.barycenter) ? ((i.barycenter = u.barycenter), (i.weight = u.weight)) : ((i.barycenter = (i.barycenter * i.weight + u.barycenter * u.weight) / (i.weight + u.weight)), (i.weight += u.weight))); } var i, u; }); var v = i(l, c); !(function (t, n) { r.forEach(t, function (t) { t.vs = r.flatten( t.vs.map(function (t) { return n[t] ? n[t].vs : t; }), !0, ); }); })(v, h); var y = u(v, a); if ( p && ((y.vs = r.flatten([p, y.vs, d], !0)), n.predecessors(p).length) ) { var g = n.node(n.predecessors(p)[0]), b = n.node(n.predecessors(d)[0]); r.has(y, "barycenter") || ((y.barycenter = 0), (y.weight = 0)), (y.barycenter = (y.barycenter * y.weight + g.order + b.order) / (y.weight + 2)), (y.weight += 2); } return y; }; }, function (t, n, e) { var r = e(9); t.exports = function (t, n) { return r.map(n, function (n) { var e = t.inEdges(n); if (e.length) { var o = r.reduce( e, function (n, e) { var r = t.edge(e), o = t.node(e.v); return { sum: n.sum + r.weight * o.order, weight: n.weight + r.weight, }; }, { sum: 0, weight: 0 }, ); return { v: n, barycenter: o.sum / o.weight, weight: o.weight }; } return { v: n }; }); }; }, function (t, n, e) { "use strict"; var r = e(9); t.exports = function (t, n) { var e = {}; return ( r.forEach(t, function (t, n) { var o = (e[t.v] = { indegree: 0, in: [], out: [], vs: [t.v], i: n, }); r.isUndefined(t.barycenter) || ((o.barycenter = t.barycenter), (o.weight = t.weight)); }), r.forEach(n.edges(), function (t) { var n = e[t.v], o = e[t.w]; r.isUndefined(n) || r.isUndefined(o) || (o.indegree++, n.out.push(e[t.w])); }), (function (t) { var n = []; function e(t) { return function (n) { n.merged || ((r.isUndefined(n.barycenter) || r.isUndefined(t.barycenter) || n.barycenter >= t.barycenter) && (function (t, n) { var e = 0, r = 0; t.weight && ((e += t.barycenter * t.weight), (r += t.weight)); n.weight && ((e += n.barycenter * n.weight), (r += n.weight)); (t.vs = n.vs.concat(t.vs)), (t.barycenter = e / r), (t.weight = r), (t.i = Math.min(n.i, t.i)), (n.merged = !0); })(t, n)); }; } function o(n) { return function (e) { e.in.push(n), 0 == --e.indegree && t.push(e); }; } for (; t.length; ) { var i = t.pop(); n.push(i), r.forEach(i.in.reverse(), e(i)), r.forEach(i.out, o(i)); } return r.map( r.filter(n, function (t) { return !t.merged; }), function (t) { return r.pick(t, ["vs", "i", "barycenter", "weight"]); }, ); })( r.filter(e, function (t) { return !t.indegree; }), ) ); }; }, function (t, n, e) { var r = e(9), o = e(19); function i(t, n, e) { for (var o; n.length && (o = r.last(n)).i <= e; ) n.pop(), t.push(o.vs), e++; return e; } t.exports = function (t, n) { var e = o.partition(t, function (t) { return r.has(t, "barycenter"); }), u = e.lhs, c = r.sortBy(e.rhs, function (t) { return -t.i; }), a = [], f = 0, s = 0, p = 0; u.sort( ((d = !!n), function (t, n) { return t.barycenter < n.barycenter ? -1 : t.barycenter > n.barycenter ? 1 : d ? n.i - t.i : t.i - n.i; }), ), (p = i(a, c, p)), r.forEach(u, function (t) { (p += t.vs.length), a.push(t.vs), (f += t.barycenter * t.weight), (s += t.weight), (p = i(a, c, p)); }); var d; var h = { vs: r.flatten(a, !0) }; s && ((h.barycenter = f / s), (h.weight = s)); return h; }; }, function (t, n, e) { var r = e(9), o = e(23).Graph; t.exports = function (t, n, e) { var i = (function (t) { var n; for (; t.hasNode((n = r.uniqueId("_root"))); ); return n; })(t), u = new o({ compound: !0 }) .setGraph({ root: i }) .setDefaultNodeLabel(function (n) { return t.node(n); }); return ( r.forEach(t.nodes(), function (o) { var c = t.node(o), a = t.parent(o); (c.rank === n || (c.minRank <= n && n <= c.maxRank)) && (u.setNode(o), u.setParent(o, a || i), r.forEach(t[e](o), function (n) { var e = n.v === o ? n.w : n.v, i = u.edge(e, o), c = r.isUndefined(i) ? 0 : i.weight; u.setEdge(e, o, { weight: t.edge(n).weight + c }); }), r.has(c, "minRank") && u.setNode(o, { borderLeft: c.borderLeft[n], borderRight: c.borderRight[n], })); }), u ); }; }, function (t, n, e) { var r = e(9); t.exports = function (t, n, e) { var o, i = {}; r.forEach(e, function (e) { for (var r, u, c = t.parent(e); c; ) { if ( ((r = t.parent(c)) ? ((u = i[r]), (i[r] = c)) : ((u = o), (o = c)), u && u !== c) ) return void n.setEdge(u, c); c = r; } }); }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(19), i = e(394).positionX; t.exports = function (t) { (function (t) { var n = o.buildLayerMatrix(t), e = t.graph().ranksep, i = 0; r.forEach(n, function (n) { var o = r.max( r.map(n, function (n) { return t.node(n).height; }), ); r.forEach(n, function (n) { t.node(n).y = i + o / 2; }), (i += o + e); }); })((t = o.asNonCompoundGraph(t))), r.forEach(i(t), function (n, e) { t.node(e).x = n; }); }; }, function (t, n, e) { "use strict"; var r = e(9), o = e(23).Graph, i = e(19); function u(t, n) { var e = {}; return ( r.reduce(n, function (n, o) { var i = 0, u = 0, c = n.length, f = r.last(o); return ( r.forEach(o, function (n, s) { var p = (function (t, n) { if (t.node(n).dummy) return r.find(t.predecessors(n), function (n) { return t.node(n).dummy; }); })(t, n), d = p ? t.node(p).order : c; (p || n === f) && (r.forEach(o.slice(u, s + 1), function (n) { r.forEach(t.predecessors(n), function (r) { var o = t.node(r), u = o.order; !(u < i || d < u) || (o.dummy && t.node(n).dummy) || a(e, r, n); }); }), (u = s + 1), (i = d)); }), o ); }), e ); } function c(t, n) { var e = {}; function o(n, o, i, u, c) { var f; r.forEach(r.range(o, i), function (o) { (f = n[o]), t.node(f).dummy && r.forEach(t.predecessors(f), function (n) { var r = t.node(n); r.dummy && (r.order < u || r.order > c) && a(e, n, f); }); }); } return ( r.reduce(n, function (n, e) { var i, u = -1, c = 0; return ( r.forEach(e, function (r, a) { if ("border" === t.node(r).dummy) { var f = t.predecessors(r); f.length && ((i = t.node(f[0]).order), o(e, c, a, u, i), (c = a), (u = i)); } o(e, c, e.length, i, n.length); }), e ); }), e ); } function a(t, n, e) { if (n > e) { var r = n; (n = e), (e = r); } var o = t[n]; o || (t[n] = o = {}), (o[e] = !0); } function f(t, n, e) { if (n > e) { var o = n; (n = e), (e = o); } return r.has(t[n], e); } function s(t, n, e, o) { var i = {}, u = {}, c = {}; return ( r.forEach(n, function (t) { r.forEach(t, function (t, n) { (i[t] = t), (u[t] = t), (c[t] = n); }); }), r.forEach(n, function (t) { var n = -1; r.forEach(t, function (t) { var a = o(t); if (a.length) for ( var s = ((a = r.sortBy(a, function (t) { return c[t]; })).length - 1) / 2, p = Math.floor(s), d = Math.ceil(s); p <= d; ++p ) { var h = a[p]; u[t] === t && n < c[h] && !f(e, t, h) && ((u[h] = t), (u[t] = i[t] = i[h]), (n = c[h])); } }); }), { root: i, align: u } ); } function p(t, n, e, i, u) { var c = {}, a = (function (t, n, e, i) { var u = new o(), c = t.graph(), a = (function (t, n, e) { return function (o, i, u) { var c, a = o.node(i), f = o.node(u), s = 0; if (((s += a.width / 2), r.has(a, "labelpos"))) switch (a.labelpos.toLowerCase()) { case "l": c = -a.width / 2; break; case "r": c = a.width / 2; } if ( (c && (s += e ? c : -c), (c = 0), (s += (a.dummy ? n : t) / 2), (s += (f.dummy ? n : t) / 2), (s += f.width / 2), r.has(f, "labelpos")) ) switch (f.labelpos.toLowerCase()) { case "l": c = f.width / 2; break; case "r": c = -f.width / 2; } return c && (s += e ? c : -c), (c = 0), s; }; })(c.nodesep, c.edgesep, i); return ( r.forEach(n, function (n) { var o; r.forEach(n, function (n) { var r = e[n]; if ((u.setNode(r), o)) { var i = e[o], c = u.edge(i, r); u.setEdge(i, r, Math.max(a(t, n, o), c || 0)); } o = n; }); }), u ); })(t, n, e, u), f = u ? "borderLeft" : "borderRight"; function s(t, n) { for (var e = a.nodes(), r = e.pop(), o = {}; r; ) o[r] ? t(r) : ((o[r] = !0), e.push(r), (e = e.concat(n(r)))), (r = e.pop()); } return ( s(function (t) { c[t] = a.inEdges(t).reduce(function (t, n) { return Math.max(t, c[n.v] + a.edge(n)); }, 0); }, a.predecessors.bind(a)), s(function (n) { var e = a.outEdges(n).reduce(function (t, n) { return Math.min(t, c[n.w] - a.edge(n)); }, Number.POSITIVE_INFINITY), r = t.node(n); e !== Number.POSITIVE_INFINITY && r.borderType !== f && (c[n] = Math.max(c[n], e)); }, a.successors.bind(a)), r.forEach(i, function (t) { c[t] = c[e[t]]; }), c ); } function d(t, n) { return r.minBy(r.values(n), function (n) { var e = Number.NEGATIVE_INFINITY, o = Number.POSITIVE_INFINITY; return ( r.forIn(n, function (n, r) { var i = (function (t, n) { return t.node(n).width; })(t, r) / 2; (e = Math.max(n + i, e)), (o = Math.min(n - i, o)); }), e - o ); }); } function h(t, n) { var e = r.values(n), o = r.min(e), i = r.max(e); r.forEach(["u", "d"], function (e) { r.forEach(["l", "r"], function (u) { var c, a = e + u, f = t[a]; if (f !== n) { var s = r.values(f); (c = "l" === u ? o - r.min(s) : i - r.max(s)) && (t[a] = r.mapValues(f, function (t) { return t + c; })); } }); }); } function l(t, n) { return r.mapValues(t.ul, function (e, o) { if (n) return t[n.toLowerCase()][o]; var i = r.sortBy(r.map(t, o)); return (i[1] + i[2]) / 2; }); } t.exports = { positionX: function (t) { var n, e = i.buildLayerMatrix(t), o = r.merge(u(t, e), c(t, e)), a = {}; r.forEach(["u", "d"], function (i) { (n = "u" === i ? e : r.values(e).reverse()), r.forEach(["l", "r"], function (e) { "r" === e && (n = r.map(n, function (t) { return r.values(t).reverse(); })); var u = ("u" === i ? t.predecessors : t.successors).bind(t), c = s(t, n, o, u), f = p(t, n, c.root, c.align, "r" === e); "r" === e && (f = r.mapValues(f, function (t) { return -t; })), (a[i + e] = f); }); }); var f = d(t, a); return h(a, f), l(a, t.graph().align); }, findType1Conflicts: u, findType2Conflicts: c, addConflict: a, hasConflict: f, verticalAlignment: s, horizontalCompaction: p, alignCoordinates: h, findSmallestWidthAlignment: d, balance: l, }; }, function (t, n, e) { var r = e(9), o = e(19), i = e(23).Graph; t.exports = { debugOrdering: function (t) { var n = o.buildLayerMatrix(t), e = new i({ compound: !0, multigraph: !0 }).setGraph({}); return ( r.forEach(t.nodes(), function (n) { e.setNode(n, { label: n }), e.setParent(n, "layer" + t.node(n).rank); }), r.forEach(t.edges(), function (t) { e.setEdge(t.v, t.w, {}, t.name); }), r.forEach(n, function (t, n) { var o = "layer" + n; e.setNode(o, { rank: "same" }), r.reduce(t, function (t, n) { return e.setEdge(t, n, { style: "invis" }), n; }); }), e ); }, }; }, function (t, n) { t.exports = "0.8.5"; }, ]).default; }); //# sourceMappingURL=dagreLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/forceAtlas2Layout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function i(r) { if (e[r]) return e[r].exports; var n = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(n.exports, n, n.exports, i), (n.l = !0), n.exports; } return ( (i.m = t), (i.c = e), (i.d = function (t, e, r) { i.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (i.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (i.t = function (t, e) { if ((1 & e && (t = i(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (i.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var n in t) i.d( r, n, function (e) { return t[e]; }.bind(null, n), ); return r; }), (i.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return i.d(e, "a", e), e; }), (i.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (i.p = ""), i((i.s = 397)) ); })({ 10: function (t, e, i) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, i, r) { void 0 === r && (r = i), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[i]; }, }); } : function (t, e, i, r) { void 0 === r && (r = i), (t[r] = e[i]); }), n = (this && this.__exportStar) || function (t, e) { for (var i in t) "default" === i || Object.prototype.hasOwnProperty.call(e, i) || r(e, t, i); }; Object.defineProperty(e, "__esModule", { value: !0 }), n(i(11), e), n(i(12), e), n(i(13), e), n(i(14), e), n(i(15), e), n(i(16), e); }, 11: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, n, o = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(o, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = r(t)); }); }, 12: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var i = parseFloat(t); return e.isNaN(i) ? t : i; }; }, 14: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, i) { for (var r = [], n = 0; n < t; n++) r[n] = 0; return i ? (i.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], i = t.length, r = 0; r < i; r += 1) { e[r] = []; for (var n = 0; n < i; n += 1) r === n ? (e[r][n] = 0) : 0 !== t[r][n] && t[r][n] ? (e[r][n] = t[r][n]) : (e[r][n] = 1 / 0); } for (var o = 0; o < i; o += 1) for (r = 0; r < i; r += 1) for (n = 0; n < i; n += 1) e[r][n] > e[r][o] + e[o][n] && (e[r][n] = e[r][o] + e[o][n]); return e; }; e.getAdjMatrix = function (t, e) { var i = t.nodes, r = t.edges, n = [], o = {}; if (!i) throw new Error("invalid nodes data!"); return ( i && i.forEach(function (t, e) { o[t.id] = e; n.push([]); }), r && r.forEach(function (t) { var i = t.source, r = t.target, s = o[i], u = o[r]; (n[s][u] = 1), e || (n[u][s] = 1); }), n ); }; e.scaleMatrix = function (t, e) { var i = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), i.push(r); }), i ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, i) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], i)) return; return !!i(e); })(t, e); }; }, 15: function (t, e, i) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var e, i = 1, r = arguments.length; i < r; i++) for (var n in (e = arguments[i])) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var i = []; return ( t.forEach(function (t) { i.push(t); }), i.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var o = n({}, t); return ( Object.keys(o).forEach(function (t) { o[t] = e.clone(o[t]); }), o ); } return t; }; }, 16: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 175: function (t, e, i) { "use strict"; var r, n = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function i() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((i.prototype = e.prototype), new i())); }), o = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.ForceAtlas2Layout = void 0); var s = i(7), u = i(10), h = o(i(398)), a = o(i(399)), c = o(i(400)), d = (function (t) { function e(e) { var i = t.call(this) || this; return ( (i.center = [0, 0]), (i.width = 300), (i.height = 300), (i.nodes = []), (i.edges = []), (i.kr = 5), (i.kg = 1), (i.mode = "normal"), (i.preventOverlap = !1), (i.dissuadeHubs = !1), (i.barnesHut = !1), (i.maxIteration = 0), (i.ks = 0.1), (i.ksmax = 10), (i.tao = 0.1), (i.onLayoutEnd = function () {}), (i.prune = !1), i.updateCfg(e), i ); } return ( n(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.execute = function () { var t = this.nodes, e = this.maxIteration, i = this.onLayoutEnd, r = this.prune; this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight); for (var n = [], o = t.length, s = 0; s < o; s += 1) { var h = t[s], a = 10, c = 10; u.isNumber(h.size) && ((a = h.size), (c = h.size)), u.isArray(h.size) && (isNaN(h.size[0]) || (a = h.size[0]), isNaN(h.size[1]) || (c = h.size[1])), this.getWidth && !isNaN(this.getWidth(h)) && (c = this.getWidth(h)), this.getHeight && !isNaN(this.getHeight(h)) && (a = this.getHeight(h)); var d = Math.max(a, c); n.push(d); } !this.barnesHut && o > 250 && (this.barnesHut = !0), !this.prune && o > 100 && (this.prune = !0), 0 !== this.maxIteration || this.prune ? 0 === this.maxIteration && r && ((e = 100), o <= 200 && o > 100 ? (e = 500) : o > 200 && (e = 950), (this.maxIteration = e)) : ((e = 250), o <= 200 && o > 100 ? (e = 1e3) : o > 200 && (e = 1200), (this.maxIteration = e)), this.kr || ((this.kr = 50), o > 100 && o <= 500 ? (this.kr = 20) : o > 500 && (this.kr = 1)), this.kg || ((this.kg = 20), o > 100 && o <= 500 ? (this.kg = 10) : o > 500 && (this.kg = 1)), (this.nodes = this.updateNodesByForces(n)), i(); }), (e.prototype.updateNodesByForces = function (t) { for ( var e = this.nodes, i = this.edges, r = this.maxIteration, n = i.filter(function (t) { return t.source !== t.target; }), o = e.length, s = n.length, u = [], h = {}, a = {}, c = [], d = 0; d < o; d += 1 ) (h[e[d].id] = d), (u[d] = 0), (void 0 === e[d].x || isNaN(e[d].x)) && (e[d].x = 1e3 * Math.random()), (void 0 === e[d].y || isNaN(e[d].y)) && (e[d].y = 1e3 * Math.random()), c.push({ x: e[d].x, y: e[d].y }); for (d = 0; d < s; d += 1) { for ( var f = void 0, p = void 0, l = 0, y = 0, g = 0; g < o; g += 1 ) e[g].id === n[d].source ? ((f = e[g]), (l = g)) : e[g].id === n[d].target && ((p = e[g]), (y = g)), (a[d] = { sourceIdx: l, targetIdx: y }); f && (u[h[f.id]] += 1), p && (u[h[p.id]] += 1); } var v = r; if (((e = this.iterate(v, h, a, s, u, t)), this.prune)) { for (g = 0; g < s; g += 1) u[a[g].sourceIdx] <= 1 ? ((e[a[g].sourceIdx].x = e[a[g].targetIdx].x), (e[a[g].sourceIdx].y = e[a[g].targetIdx].y)) : u[a[g].targetIdx] <= 1 && ((e[a[g].targetIdx].x = e[a[g].sourceIdx].x), (e[a[g].targetIdx].y = e[a[g].sourceIdx].y)); (this.prune = !1), (this.barnesHut = !1), (v = 100), (e = this.iterate(v, h, a, s, u, t)); } return e; }), (e.prototype.iterate = function (t, e, i, r, n, o) { for ( var s = this.nodes, u = this.kr, a = this.preventOverlap, c = this.barnesHut, d = s.length, f = 0, p = t, l = [], y = [], g = [], v = 0; v < d; v += 1 ) if (((l[2 * v] = 0), (l[2 * v + 1] = 0), c)) { var x = { id: v, rx: s[v].x, ry: s[v].y, mass: 1, g: u, degree: n[v], }; g[v] = new h.default(x); } for (; p > 0; ) { for (v = 0; v < d; v += 1) (y[2 * v] = l[2 * v]), (y[2 * v + 1] = l[2 * v + 1]), (l[2 * v] = 0), (l[2 * v + 1] = 0); (l = this.getAttrForces(p, 50, r, e, i, n, o, l)), (l = c && ((a && p > 50) || !a) ? this.getOptRepGraForces(l, g, n) : this.getRepGraForces(p, 50, l, 100, o, n)); var m = this.updatePos(l, y, f, n); (s = m.nodes), (f = m.sg), p--, this.tick && this.tick(); } return s; }), (e.prototype.getAttrForces = function (t, e, i, r, n, o, s, u) { for ( var h = this.nodes, a = this.preventOverlap, c = this.dissuadeHubs, d = this.mode, f = this.prune, p = 0; p < i; p += 1 ) { var l = h[n[p].sourceIdx], y = n[p].sourceIdx, g = h[n[p].targetIdx], v = n[p].targetIdx; if (!f || !(o[y] <= 1 || o[v] <= 1)) { var x = [g.x - l.x, g.y - l.y], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m), a && t < e && (m = m - s[y] - s[v]); var b = m, _ = b; "linlog" === d && (_ = b = Math.log(1 + m)), c && ((b = m / o[y]), (_ = m / o[v])), a && t < e && m <= 0 ? ((b = 0), (_ = 0)) : a && t < e && m > 0 && ((b = m), (_ = m)), (u[2 * r[l.id]] += b * x[0]), (u[2 * r[g.id]] -= _ * x[0]), (u[2 * r[l.id] + 1] += b * x[1]), (u[2 * r[g.id] + 1] -= _ * x[1]); } } return u; }), (e.prototype.getRepGraForces = function (t, e, i, r, n, o) { for ( var s = this.nodes, u = this.preventOverlap, h = this.kr, a = this.kg, c = this.center, d = this.prune, f = s.length, p = 0; p < f; p += 1 ) { for (var l = p + 1; l < f; l += 1) if (!d || !(o[p] <= 1 || o[l] <= 1)) { var y = [s[l].x - s[p].x, s[l].y - s[p].y], g = Math.hypot(y[0], y[1]); (g = g < 1e-4 ? 1e-4 : g), (y[0] = y[0] / g), (y[1] = y[1] / g), u && t < e && (g = g - n[p] - n[l]); var v = (h * (o[p] + 1) * (o[l] + 1)) / g; u && t < e && g < 0 ? (v = r * (o[p] + 1) * (o[l] + 1)) : u && t < e && 0 === g ? (v = 0) : u && t < e && g > 0 && (v = (h * (o[p] + 1) * (o[l] + 1)) / g), (i[2 * p] -= v * y[0]), (i[2 * l] += v * y[0]), (i[2 * p + 1] -= v * y[1]), (i[2 * l + 1] += v * y[1]); } var x = [s[p].x - c[0], s[p].y - c[1]], m = Math.hypot(x[0], x[1]); (x[0] = x[0] / m), (x[1] = x[1] / m); var b = a * (o[p] + 1); (i[2 * p] -= b * x[0]), (i[2 * p + 1] -= b * x[1]); } return i; }), (e.prototype.getOptRepGraForces = function (t, e, i) { for ( var r = this.nodes, n = this.kg, o = this.center, s = this.prune, u = r.length, h = 9e10, d = -9e10, f = 9e10, p = -9e10, l = 0; l < u; l += 1 ) (s && i[l] <= 1) || (e[l].setPos(r[l].x, r[l].y), r[l].x >= d && (d = r[l].x), r[l].x <= h && (h = r[l].x), r[l].y >= p && (p = r[l].y), r[l].y <= f && (f = r[l].y)); var y = { xmid: (d + h) / 2, ymid: (p + f) / 2, length: Math.max(d - h, p - f), massCenter: o, mass: u, }, g = new a.default(y), v = new c.default(g); for (l = 0; l < u; l += 1) (s && i[l] <= 1) || (e[l].in(g) && v.insert(e[l])); for (l = 0; l < u; l += 1) if (!(s && i[l] <= 1)) { e[l].resetForce(), v.updateForce(e[l]), (t[2 * l] -= e[l].fx), (t[2 * l + 1] -= e[l].fy); var x = [r[l].x - o[0], r[l].y - o[1]], m = Math.hypot(x[0], x[1]); (m = m < 1e-4 ? 1e-4 : m), (x[0] = x[0] / m), (x[1] = x[1] / m); var b = n * (i[l] + 1); (t[2 * l] -= b * x[0]), (t[2 * l + 1] -= b * x[1]); } return t; }), (e.prototype.updatePos = function (t, e, i, r) { for ( var n = this.nodes, o = this.ks, s = this.tao, u = this.prune, h = this.ksmax, a = n.length, c = [], d = [], f = 0, p = 0, l = 0; l < a; l += 1 ) if (!(u && r[l] <= 1)) { var y = [t[2 * l] - e[2 * l], t[2 * l + 1] - e[2 * l + 1]], g = Math.hypot(y[0], y[1]), v = [t[2 * l] + e[2 * l], t[2 * l + 1] + e[2 * l + 1]], x = Math.hypot(v[0], v[1]); (c[l] = g), (d[l] = x / 2), (f += (r[l] + 1) * c[l]), (p += (r[l] + 1) * d[l]); } var m = i; (i = (s * p) / f), 0 !== m && (i = i > 1.5 * m ? 1.5 * m : i); for (l = 0; l < a; l += 1) if (!(u && r[l] <= 1)) { var b = (o * i) / (1 + i * Math.sqrt(c[l])), _ = Math.hypot(t[2 * l], t[2 * l + 1]), N = h / (_ = _ < 1e-4 ? 1e-4 : _), O = (b = b > N ? N : b) * t[2 * l], j = b * t[2 * l + 1]; (n[l].x += O), (n[l].y += j); } return { nodes: n, sg: i }; }), e ); })(s.Base); e.ForceAtlas2Layout = d; }, 397: function (t, e, i) { "use strict"; i.r(e); var r = i(175); e.default = r.ForceAtlas2Layout; }, 398: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.id = t.id || 0), (this.rx = t.rx), (this.ry = t.ry), (this.fx = 0), (this.fy = 0), (this.mass = t.mass), (this.degree = t.degree), (this.g = t.g || 0); } return ( (t.prototype.distanceTo = function (t) { var e = this.rx - t.rx, i = this.ry - t.ry; return Math.hypot(e, i); }), (t.prototype.setPos = function (t, e) { (this.rx = t), (this.ry = e); }), (t.prototype.resetForce = function () { (this.fx = 0), (this.fy = 0); }), (t.prototype.addForce = function (t) { var e = t.rx - this.rx, i = t.ry - this.ry, r = Math.hypot(e, i); r = r < 1e-4 ? 1e-4 : r; var n = (this.g * (this.degree + 1) * (t.degree + 1)) / r; (this.fx += (n * e) / r), (this.fy += (n * i) / r); }), (t.prototype.in = function (t) { return t.contains(this.rx, this.ry); }), (t.prototype.add = function (e) { var i = this.mass + e.mass; return new t({ rx: (this.rx * this.mass + e.rx * e.mass) / i, ry: (this.ry * this.mass + e.ry * e.mass) / i, mass: i, degree: this.degree + e.degree, }); }), t ); })(); e.default = r; }, 399: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.xmid = t.xmid), (this.ymid = t.ymid), (this.length = t.length), (this.massCenter = t.massCenter || [0, 0]), (this.mass = t.mass || 1); } return ( (t.prototype.getLength = function () { return this.length; }), (t.prototype.contains = function (t, e) { var i = this.length / 2; return ( t <= this.xmid + i && t >= this.xmid - i && e <= this.ymid + i && e >= this.ymid - i ); }), (t.prototype.NW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.NE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid + this.length / 4, length: this.length / 2, }); }), (t.prototype.SW = function () { return new t({ xmid: this.xmid - this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), (t.prototype.SE = function () { return new t({ xmid: this.xmid + this.length / 4, ymid: this.ymid - this.length / 4, length: this.length / 2, }); }), t ); })(); e.default = r; }, 400: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = (function () { function t(t) { (this.body = null), (this.quad = null), (this.NW = null), (this.NE = null), (this.SW = null), (this.SE = null), (this.theta = 0.5), null != t && (this.quad = t); } return ( (t.prototype.insert = function (e) { null != this.body ? this._isExternal() ? (this.quad && ((this.NW = new t(this.quad.NW())), (this.NE = new t(this.quad.NE())), (this.SW = new t(this.quad.SW())), (this.SE = new t(this.quad.SE()))), this._putBody(this.body), this._putBody(e), (this.body = this.body.add(e))) : ((this.body = this.body.add(e)), this._putBody(e)) : (this.body = e); }), (t.prototype._putBody = function (t) { this.quad && (t.in(this.quad.NW()) && this.NW ? this.NW.insert(t) : t.in(this.quad.NE()) && this.NE ? this.NE.insert(t) : t.in(this.quad.SW()) && this.SW ? this.SW.insert(t) : t.in(this.quad.SE()) && this.SE && this.SE.insert(t)); }), (t.prototype._isExternal = function () { return ( null == this.NW && null == this.NE && null == this.SW && null == this.SE ); }), (t.prototype.updateForce = function (t) { null != this.body && t !== this.body && (this._isExternal() || (this.quad ? this.quad.getLength() : 0) / this.body.distanceTo(t) < this.theta ? t.addForce(this.body) : (this.NW && this.NW.updateForce(t), this.NE && this.NE.updateForce(t), this.SW && this.SW.updateForce(t), this.SE && this.SE.updateForce(t))); }), t ); })(); e.default = r; }, 7: function (t, e, i) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=forceAtlas2Layout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/forceLayout.js ================================================ !(function (t, n) { "object" == typeof exports && "object" == typeof module ? (module.exports = n()) : "function" == typeof define && define.amd ? define([], n) : "object" == typeof exports ? (exports.f6 = n()) : (t.f6 = n()); })(this, function () { return (function (t) { var n = {}; function e(r) { if (n[r]) return n[r].exports; var o = (n[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, e), (o.l = !0), o.exports; } return ( (e.m = t), (e.c = n), (e.d = function (t, n, r) { e.o(t, n) || Object.defineProperty(t, n, { enumerable: !0, get: r }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, n) { if ((1 & n && (t = e(t)), 8 & n)) return t; if (4 & n && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (e.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & n && "string" != typeof t) ) for (var o in t) e.d( r, o, function (n) { return t[n]; }.bind(null, o), ); return r; }), (e.n = function (t) { var n = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(n, "a", n), n; }), (e.o = function (t, n) { return Object.prototype.hasOwnProperty.call(t, n); }), (e.p = ""), e((e.s = 401)) ); })({ 10: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(11), n), o(e(12), n), o(e(13), n), o(e(14), n), o(e(15), n), o(e(16), n); }, 11: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.camelize = n.isString = void 0); n.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; n.camelize = ((r = function (t) { return t.replace(i, function (t, n) { return n ? n.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isArray = void 0), (n.isArray = Array.isArray); }, 13: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.toNumber = n.isNaN = n.isNumber = void 0); n.isNumber = function (t) { return "number" == typeof t; }; n.isNaN = function (t) { return Number.isNaN(Number(t)); }; n.toNumber = function (t) { var e = parseFloat(t); return n.isNaN(e) ? t : e; }; }, 14: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.traverseTreeUp = n.scaleMatrix = n.getAdjMatrix = n.floydWarshall = n.getDegree = void 0); n.getDegree = function (t, n, e) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return e ? (e.forEach(function (t) { t.source && (r[n[t.source]] += 1), t.target && (r[n[t.target]] += 1); }), r) : r; }; n.floydWarshall = function (t) { for (var n = [], e = t.length, r = 0; r < e; r += 1) { n[r] = []; for (var o = 0; o < e; o += 1) r === o ? (n[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (n[r][o] = t[r][o]) : (n[r][o] = 1 / 0); } for (var i = 0; i < e; i += 1) for (r = 0; r < e; r += 1) for (o = 0; o < e; o += 1) n[r][o] > n[r][i] + n[i][o] && (n[r][o] = n[r][i] + n[i][o]); return n; }; n.getAdjMatrix = function (t, n) { var e = t.nodes, r = t.edges, o = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, n) { i[t.id] = n; o.push([]); }), r && r.forEach(function (t) { var e = t.source, r = t.target, u = i[e], c = i[r]; (o[u][c] = 1), n || (o[c][u] = 1); }), o ); }; n.scaleMatrix = function (t, n) { var e = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * n); }), e.push(r); }), e ); }; n.traverseTreeUp = function (t, n) { "function" == typeof n && (function t(n, e) { if (n && n.children) for (var r = n.children.length - 1; r >= 0; r--) if (!t(n.children[r], e)) return; return !!e(n); })(t, n); }; }, 15: function (t, n, e) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var n, e = 1, r = arguments.length; e < r; e++) for (var o in (n = arguments[e])) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]); return t; }).apply(this, arguments); }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.clone = n.isObject = void 0); n.isObject = function (t) { return null !== t && "object" === r(t); }; n.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return n.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = n.clone(i[t]); }), i ); } return t; }; }, 16: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.isFunction = void 0); n.isFunction = function (t) { return "function" == typeof t; }; }, 167: function (t, n, e) { "use strict"; e.r(n), e.d(n, "forceCenter", function () { return r; }), e.d(n, "forceCollide", function () { return v; }), e.d(n, "forceLink", function () { return b; }), e.d(n, "forceManyBody", function () { return V; }), e.d(n, "forceRadial", function () { return Z; }), e.d(n, "forceSimulation", function () { return Q; }), e.d(n, "forceX", function () { return $; }), e.d(n, "forceY", function () { return tt; }); var r = function (t, n) { var e, r = 1; function o() { var o, i, u = e.length, c = 0, f = 0; for (o = 0; o < u; ++o) (c += (i = e[o]).x), (f += i.y); for (c = (c / u - t) * r, f = (f / u - n) * r, o = 0; o < u; ++o) ((i = e[o]).x -= c), (i.y -= f); } return ( null == t && (t = 0), null == n && (n = 0), (o.initialize = function (t) { e = t; }), (o.x = function (n) { return arguments.length ? ((t = +n), o) : t; }), (o.y = function (t) { return arguments.length ? ((n = +t), o) : n; }), (o.strength = function (t) { return arguments.length ? ((r = +t), o) : r; }), o ); }; function o(t, n, e, r) { if (isNaN(n) || isNaN(e)) return t; var o, i, u, c, f, a, l, s, h, d = t._root, y = { data: r }, p = t._x0, v = t._y0, g = t._x1, _ = t._y1; if (!d) return (t._root = y), t; for (; d.length; ) if ( ((a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u), (o = d), !(d = d[(s = (l << 1) | a)])) ) return (o[s] = y), t; if ( ((c = +t._x.call(null, d.data)), (f = +t._y.call(null, d.data)), n === c && e === f) ) return (y.next = d), o ? (o[s] = y) : (t._root = y), t; do { (o = o ? (o[s] = new Array(4)) : (t._root = new Array(4))), (a = n >= (i = (p + g) / 2)) ? (p = i) : (g = i), (l = e >= (u = (v + _) / 2)) ? (v = u) : (_ = u); } while ((s = (l << 1) | a) == (h = ((f >= u) << 1) | (c >= i))); return (o[h] = d), (o[s] = y), t; } var i = function (t, n, e, r, o) { (this.node = t), (this.x0 = n), (this.y0 = e), (this.x1 = r), (this.y1 = o); }; function u(t) { return t[0]; } function c(t) { return t[1]; } function f(t, n, e) { var r = new a(null == n ? u : n, null == e ? c : e, NaN, NaN, NaN, NaN); return null == t ? r : r.addAll(t); } function a(t, n, e, r, o, i) { (this._x = t), (this._y = n), (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), (this._root = void 0); } function l(t) { for (var n = { data: t.data }, e = n; (t = t.next); ) e = e.next = { data: t.data }; return n; } var s = (f.prototype = a.prototype); (s.copy = function () { var t, n, e = new a(this._x, this._y, this._x0, this._y0, this._x1, this._y1), r = this._root; if (!r) return e; if (!r.length) return (e._root = l(r)), e; for ( t = [{ source: r, target: (e._root = new Array(4)) }]; (r = t.pop()); ) for (var o = 0; o < 4; ++o) (n = r.source[o]) && (n.length ? t.push({ source: n, target: (r.target[o] = new Array(4)) }) : (r.target[o] = l(n))); return e; }), (s.add = function (t) { var n = +this._x.call(null, t), e = +this._y.call(null, t); return o(this.cover(n, e), n, e, t); }), (s.addAll = function (t) { var n, e, r, i, u = t.length, c = new Array(u), f = new Array(u), a = 1 / 0, l = 1 / 0, s = -1 / 0, h = -1 / 0; for (e = 0; e < u; ++e) isNaN((r = +this._x.call(null, (n = t[e])))) || isNaN((i = +this._y.call(null, n))) || ((c[e] = r), (f[e] = i), r < a && (a = r), r > s && (s = r), i < l && (l = i), i > h && (h = i)); if (a > s || l > h) return this; for (this.cover(a, l).cover(s, h), e = 0; e < u; ++e) o(this, c[e], f[e], t[e]); return this; }), (s.cover = function (t, n) { if (isNaN((t = +t)) || isNaN((n = +n))) return this; var e = this._x0, r = this._y0, o = this._x1, i = this._y1; if (isNaN(e)) (o = (e = Math.floor(t)) + 1), (i = (r = Math.floor(n)) + 1); else { for ( var u, c, f = o - e || 1, a = this._root; e > t || t >= o || r > n || n >= i; ) switch ( ((c = ((n < r) << 1) | (t < e)), ((u = new Array(4))[c] = a), (a = u), (f *= 2), c) ) { case 0: (o = e + f), (i = r + f); break; case 1: (e = o - f), (i = r + f); break; case 2: (o = e + f), (r = i - f); break; case 3: (e = o - f), (r = i - f); } this._root && this._root.length && (this._root = a); } return ( (this._x0 = e), (this._y0 = r), (this._x1 = o), (this._y1 = i), this ); }), (s.data = function () { var t = []; return ( this.visit(function (n) { if (!n.length) do { t.push(n.data); } while ((n = n.next)); }), t ); }), (s.extent = function (t) { return arguments.length ? this.cover(+t[0][0], +t[0][1]).cover(+t[1][0], +t[1][1]) : isNaN(this._x0) ? void 0 : [ [this._x0, this._y0], [this._x1, this._y1], ]; }), (s.find = function (t, n, e) { var r, o, u, c, f, a, l, s = this._x0, h = this._y0, d = this._x1, y = this._y1, p = [], v = this._root; for ( v && p.push(new i(v, s, h, d, y)), null == e ? (e = 1 / 0) : ((s = t - e), (h = n - e), (d = t + e), (y = n + e), (e *= e)); (a = p.pop()); ) if ( !( !(v = a.node) || (o = a.x0) > d || (u = a.y0) > y || (c = a.x1) < s || (f = a.y1) < h ) ) if (v.length) { var g = (o + c) / 2, _ = (u + f) / 2; p.push( new i(v[3], g, _, c, f), new i(v[2], o, _, g, f), new i(v[1], g, u, c, _), new i(v[0], o, u, g, _), ), (l = ((n >= _) << 1) | (t >= g)) && ((a = p[p.length - 1]), (p[p.length - 1] = p[p.length - 1 - l]), (p[p.length - 1 - l] = a)); } else { var x = t - +this._x.call(null, v.data), b = n - +this._y.call(null, v.data), w = x * x + b * b; if (w < e) { var m = Math.sqrt((e = w)); (s = t - m), (h = n - m), (d = t + m), (y = n + m), (r = v.data); } } return r; }), (s.remove = function (t) { if ( isNaN((i = +this._x.call(null, t))) || isNaN((u = +this._y.call(null, t))) ) return this; var n, e, r, o, i, u, c, f, a, l, s, h, d = this._root, y = this._x0, p = this._y0, v = this._x1, g = this._y1; if (!d) return this; if (d.length) for (;;) { if ( ((a = i >= (c = (y + v) / 2)) ? (y = c) : (v = c), (l = u >= (f = (p + g) / 2)) ? (p = f) : (g = f), (n = d), !(d = d[(s = (l << 1) | a)])) ) return this; if (!d.length) break; (n[(s + 1) & 3] || n[(s + 2) & 3] || n[(s + 3) & 3]) && ((e = n), (h = s)); } for (; d.data !== t; ) if (((r = d), !(d = d.next))) return this; return ( (o = d.next) && delete d.next, r ? (o ? (r.next = o) : delete r.next, this) : n ? (o ? (n[s] = o) : delete n[s], (d = n[0] || n[1] || n[2] || n[3]) && d === (n[3] || n[2] || n[1] || n[0]) && !d.length && (e ? (e[h] = d) : (this._root = d)), this) : ((this._root = o), this) ); }), (s.removeAll = function (t) { for (var n = 0, e = t.length; n < e; ++n) this.remove(t[n]); return this; }), (s.root = function () { return this._root; }), (s.size = function () { var t = 0; return ( this.visit(function (n) { if (!n.length) do { ++t; } while ((n = n.next)); }), t ); }), (s.visit = function (t) { var n, e, r, o, u, c, f = [], a = this._root; for ( a && f.push(new i(a, this._x0, this._y0, this._x1, this._y1)); (n = f.pop()); ) if ( !t( (a = n.node), (r = n.x0), (o = n.y0), (u = n.x1), (c = n.y1), ) && a.length ) { var l = (r + u) / 2, s = (o + c) / 2; (e = a[3]) && f.push(new i(e, l, s, u, c)), (e = a[2]) && f.push(new i(e, r, s, l, c)), (e = a[1]) && f.push(new i(e, l, o, u, s)), (e = a[0]) && f.push(new i(e, r, o, l, s)); } return this; }), (s.visitAfter = function (t) { var n, e = [], r = []; for ( this._root && e.push(new i(this._root, this._x0, this._y0, this._x1, this._y1)); (n = e.pop()); ) { var o = n.node; if (o.length) { var u, c = n.x0, f = n.y0, a = n.x1, l = n.y1, s = (c + a) / 2, h = (f + l) / 2; (u = o[0]) && e.push(new i(u, c, f, s, h)), (u = o[1]) && e.push(new i(u, s, f, a, h)), (u = o[2]) && e.push(new i(u, c, h, s, l)), (u = o[3]) && e.push(new i(u, s, h, a, l)); } r.push(n); } for (; (n = r.pop()); ) t(n.node, n.x0, n.y0, n.x1, n.y1); return this; }), (s.x = function (t) { return arguments.length ? ((this._x = t), this) : this._x; }), (s.y = function (t) { return arguments.length ? ((this._y = t), this) : this._y; }); var h = function (t) { return function () { return t; }; }, d = function (t) { return 1e-6 * (t() - 0.5); }; function y(t) { return t.x + t.vx; } function p(t) { return t.y + t.vy; } var v = function (t) { var n, e, r, o = 1, i = 1; function u() { for (var t, u, a, l, s, h, v, g = n.length, _ = 0; _ < i; ++_) for (u = f(n, y, p).visitAfter(c), t = 0; t < g; ++t) (a = n[t]), (h = e[a.index]), (v = h * h), (l = a.x + a.vx), (s = a.y + a.vy), u.visit(x); function x(t, n, e, i, u) { var c = t.data, f = t.r, y = h + f; if (!c) return n > l + y || i < l - y || e > s + y || u < s - y; if (c.index > a.index) { var p = l - c.x - c.vx, g = s - c.y - c.vy, _ = p * p + g * g; _ < y * y && (0 === p && (_ += (p = d(r)) * p), 0 === g && (_ += (g = d(r)) * g), (_ = ((y - (_ = Math.sqrt(_))) / _) * o), (a.vx += (p *= _) * (y = (f *= f) / (v + f))), (a.vy += (g *= _) * y), (c.vx -= p * (y = 1 - y)), (c.vy -= g * y)); } } } function c(t) { if (t.data) return (t.r = e[t.data.index]); for (var n = (t.r = 0); n < 4; ++n) t[n] && t[n].r > t.r && (t.r = t[n].r); } function a() { if (n) { var r, o, i = n.length; for (e = new Array(i), r = 0; r < i; ++r) (o = n[r]), (e[o.index] = +t(o, r, n)); } } return ( "function" != typeof t && (t = h(null == t ? 1 : +t)), (u.initialize = function (t, e) { (n = t), (r = e), a(); }), (u.iterations = function (t) { return arguments.length ? ((i = +t), u) : i; }), (u.strength = function (t) { return arguments.length ? ((o = +t), u) : o; }), (u.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), a(), u) : t; }), u ); }; function g(t) { return (g = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function _(t) { return t.index; } function x(t, n) { var e = t.get(n); if (!e) throw new Error("node not found: " + n); return e; } var b = function (t) { var n, e, r, o, i, u, c = _, f = function (t) { return 1 / Math.min(o[t.source.index], o[t.target.index]); }, a = h(30), l = 1; function s(r) { for (var o = 0, c = t.length; o < l; ++o) for (var f, a, s, h, y, p, v, g = 0; g < c; ++g) (a = (f = t[g]).source), (h = (s = f.target).x + s.vx - a.x - a.vx || d(u)), (y = s.y + s.vy - a.y - a.vy || d(u)), (h *= p = (((p = Math.sqrt(h * h + y * y)) - e[g]) / p) * r * n[g]), (y *= p), (s.vx -= h * (v = i[g])), (s.vy -= y * v), (a.vx += h * (v = 1 - v)), (a.vy += y * v); } function y() { if (r) { var u, f, a = r.length, l = t.length, s = new Map( r.map(function (t, n) { return [c(t, n, r), t]; }), ); for (u = 0, o = new Array(a); u < l; ++u) ((f = t[u]).index = u), "object" !== g(f.source) && (f.source = x(s, f.source)), "object" !== g(f.target) && (f.target = x(s, f.target)), (o[f.source.index] = (o[f.source.index] || 0) + 1), (o[f.target.index] = (o[f.target.index] || 0) + 1); for (u = 0, i = new Array(l); u < l; ++u) (f = t[u]), (i[u] = o[f.source.index] / (o[f.source.index] + o[f.target.index])); (n = new Array(l)), p(), (e = new Array(l)), v(); } } function p() { if (r) for (var e = 0, o = t.length; e < o; ++e) n[e] = +f(t[e], e, t); } function v() { if (r) for (var n = 0, o = t.length; n < o; ++n) e[n] = +a(t[n], n, t); } return ( null == t && (t = []), (s.initialize = function (t, n) { (r = t), (u = n), y(); }), (s.links = function (n) { return arguments.length ? ((t = n), y(), s) : t; }), (s.id = function (t) { return arguments.length ? ((c = t), s) : c; }), (s.iterations = function (t) { return arguments.length ? ((l = +t), s) : l; }), (s.strength = function (t) { return arguments.length ? ((f = "function" == typeof t ? t : h(+t)), p(), s) : f; }), (s.distance = function (t) { return arguments.length ? ((a = "function" == typeof t ? t : h(+t)), v(), s) : a; }), s ); }, w = { value: function () {} }; function m() { for (var t, n = 0, e = arguments.length, r = {}; n < e; ++n) { if (!(t = arguments[n] + "") || t in r || /[\s.]/.test(t)) throw new Error("illegal type: " + t); r[t] = []; } return new S(r); } function S(t) { this._ = t; } function N(t, n) { return t .trim() .split(/^|\s+/) .map(function (t) { var e = "", r = t.indexOf("."); if ( (r >= 0 && ((e = t.slice(r + 1)), (t = t.slice(0, r))), t && !n.hasOwnProperty(t)) ) throw new Error("unknown type: " + t); return { type: t, name: e }; }); } function O(t, n) { for (var e, r = 0, o = t.length; r < o; ++r) if ((e = t[r]).name === n) return e.value; } function k(t, n, e) { for (var r = 0, o = t.length; r < o; ++r) if (t[r].name === n) { (t[r] = w), (t = t.slice(0, r).concat(t.slice(r + 1))); break; } return null != e && t.push({ name: n, value: e }), t; } S.prototype = m.prototype = { constructor: S, on: function (t, n) { var e, r = this._, o = N(t + "", r), i = -1, u = o.length; if (!(arguments.length < 2)) { if (null != n && "function" != typeof n) throw new Error("invalid callback: " + n); for (; ++i < u; ) if ((e = (t = o[i]).type)) r[e] = k(r[e], t.name, n); else if (null == n) for (e in r) r[e] = k(r[e], t.name, null); return this; } for (; ++i < u; ) if ((e = (t = o[i]).type) && (e = O(r[e], t.name))) return e; }, copy: function () { var t = {}, n = this._; for (var e in n) t[e] = n[e].slice(); return new S(t); }, call: function (t, n) { if ((e = arguments.length - 2) > 0) for (var e, r, o = new Array(e), i = 0; i < e; ++i) o[i] = arguments[i + 2]; if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (i = 0, e = (r = this._[t]).length; i < e; ++i) r[i].value.apply(n, o); }, apply: function (t, n, e) { if (!this._.hasOwnProperty(t)) throw new Error("unknown type: " + t); for (var r = this._[t], o = 0, i = r.length; o < i; ++o) r[o].value.apply(n, e); }, }; var M = m; function j(t) { return (j = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var E, A, P = 0, z = 0, D = 0, T = 0, L = 0, F = 0, U = "object" === ("undefined" == typeof performance ? "undefined" : j(performance)) && performance.now ? performance : Date, C = "object" === ("undefined" == typeof window ? "undefined" : j(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function q() { return L || (C(B), (L = U.now() + F)); } function B() { L = 0; } function Y() { this._call = this._time = this._next = null; } function R(t, n, e) { var r = new Y(); return r.restart(t, n, e), r; } function G() { (L = (T = U.now()) + F), (P = z = 0); try { !(function () { q(), ++P; for (var t, n = E; n; ) (t = L - n._time) >= 0 && n._call.call(null, t), (n = n._next); --P; })(); } finally { (P = 0), (function () { var t, n, e = E, r = 1 / 0; for (; e; ) e._call ? (r > e._time && (r = e._time), (t = e), (e = e._next)) : ((n = e._next), (e._next = null), (e = t ? (t._next = n) : (E = n))); (A = t), W(r); })(), (L = 0); } } function I() { var t = U.now(), n = t - T; n > 1e3 && ((F -= n), (T = t)); } function W(t) { P || (z && (z = clearTimeout(z)), t - L > 24 ? (t < 1 / 0 && (z = setTimeout(G, t - U.now() - F)), D && (D = clearInterval(D))) : (D || ((T = U.now()), (D = setInterval(I, 1e3))), (P = 1), C(G))); } Y.prototype = R.prototype = { constructor: Y, restart: function (t, n, e) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (e = (null == e ? q() : +e) + (null == n ? 0 : +n)), this._next || A === this || (A ? (A._next = this) : (E = this), (A = this)), (this._call = t), (this._time = e), W(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), W()); }, }; var X = 4294967296; function K(t) { return t.x; } function H(t) { return t.y; } var J = Math.PI * (3 - Math.sqrt(5)), Q = function (t) { var n, e, r = 1, o = 0.001, i = 1 - Math.pow(o, 1 / 300), u = 0, c = 0.6, f = new Map(), a = R(h), l = M("tick", "end"), s = ((e = 1), function () { return (e = (1664525 * e + 1013904223) % X) / X; }); function h() { d(), l.call("tick", n), r < o && (a.stop(), l.call("end", n)); } function d(e) { var o, a, l = t.length; void 0 === e && (e = 1); for (var s = 0; s < e; ++s) for ( r += (u - r) * i, f.forEach(function (t) { t(r); }), o = 0; o < l; ++o ) null == (a = t[o]).fx ? (a.x += a.vx *= c) : ((a.x = a.fx), (a.vx = 0)), null == a.fy ? (a.y += a.vy *= c) : ((a.y = a.fy), (a.vy = 0)); return n; } function y() { for (var n, e = 0, r = t.length; e < r; ++e) { if ( (((n = t[e]).index = e), null != n.fx && (n.x = n.fx), null != n.fy && (n.y = n.fy), isNaN(n.x) || isNaN(n.y)) ) { var o = 10 * Math.sqrt(0.5 + e), i = e * J; (n.x = o * Math.cos(i)), (n.y = o * Math.sin(i)); } (isNaN(n.vx) || isNaN(n.vy)) && (n.vx = n.vy = 0); } } function p(n) { return n.initialize && n.initialize(t, s), n; } return ( null == t && (t = []), y(), (n = { tick: d, restart: function () { return a.restart(h), n; }, stop: function () { return a.stop(), n; }, nodes: function (e) { return arguments.length ? ((t = e), y(), f.forEach(p), n) : t; }, alpha: function (t) { return arguments.length ? ((r = +t), n) : r; }, alphaMin: function (t) { return arguments.length ? ((o = +t), n) : o; }, alphaDecay: function (t) { return arguments.length ? ((i = +t), n) : +i; }, alphaTarget: function (t) { return arguments.length ? ((u = +t), n) : u; }, velocityDecay: function (t) { return arguments.length ? ((c = 1 - t), n) : 1 - c; }, randomSource: function (t) { return arguments.length ? ((s = t), f.forEach(p), n) : s; }, force: function (t, e) { return arguments.length > 1 ? (null == e ? f.delete(t) : f.set(t, p(e)), n) : f.get(t); }, find: function (n, e, r) { var o, i, u, c, f, a = 0, l = t.length; for (null == r ? (r = 1 / 0) : (r *= r), a = 0; a < l; ++a) (u = (o = n - (c = t[a]).x) * o + (i = e - c.y) * i) < r && ((f = c), (r = u)); return f; }, on: function (t, e) { return arguments.length > 1 ? (l.on(t, e), n) : l.on(t); }, }) ); }, V = function () { var t, n, e, r, o, i = h(-30), u = 1, c = 1 / 0, a = 0.81; function l(e) { var o, i = t.length, u = f(t, K, H).visitAfter(y); for (r = e, o = 0; o < i; ++o) (n = t[o]), u.visit(p); } function s() { if (t) { var n, e, r = t.length; for (o = new Array(r), n = 0; n < r; ++n) (e = t[n]), (o[e.index] = +i(e, n, t)); } } function y(t) { var n, e, r, i, u, c = 0, f = 0; if (t.length) { for (r = i = u = 0; u < 4; ++u) (n = t[u]) && (e = Math.abs(n.value)) && ((c += n.value), (f += e), (r += e * n.x), (i += e * n.y)); (t.x = r / f), (t.y = i / f); } else { ((n = t).x = n.data.x), (n.y = n.data.y); do { c += o[n.data.index]; } while ((n = n.next)); } t.value = c; } function p(t, i, f, l) { if (!t.value) return !0; var s = t.x - n.x, h = t.y - n.y, y = l - i, p = s * s + h * h; if ((y * y) / a < p) return ( p < c && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p)), (n.vx += (s * t.value * r) / p), (n.vy += (h * t.value * r) / p)), !0 ); if (!(t.length || p >= c)) { (t.data !== n || t.next) && (0 === s && (p += (s = d(e)) * s), 0 === h && (p += (h = d(e)) * h), p < u && (p = Math.sqrt(u * p))); do { t.data !== n && ((y = (o[t.data.index] * r) / p), (n.vx += s * y), (n.vy += h * y)); } while ((t = t.next)); } } return ( (l.initialize = function (n, r) { (t = n), (e = r), s(); }), (l.strength = function (t) { return arguments.length ? ((i = "function" == typeof t ? t : h(+t)), s(), l) : i; }), (l.distanceMin = function (t) { return arguments.length ? ((u = t * t), l) : Math.sqrt(u); }), (l.distanceMax = function (t) { return arguments.length ? ((c = t * t), l) : Math.sqrt(c); }), (l.theta = function (t) { return arguments.length ? ((a = t * t), l) : Math.sqrt(a); }), l ); }, Z = function (t, n, e) { var r, o, i, u = h(0.1); function c(t) { for (var u = 0, c = r.length; u < c; ++u) { var f = r[u], a = f.x - n || 1e-6, l = f.y - e || 1e-6, s = Math.sqrt(a * a + l * l), h = ((i[u] - s) * o[u] * t) / s; (f.vx += a * h), (f.vy += l * h); } } function f() { if (r) { var n, e = r.length; for (o = new Array(e), i = new Array(e), n = 0; n < e; ++n) (i[n] = +t(r[n], n, r)), (o[n] = isNaN(i[n]) ? 0 : +u(r[n], n, r)); } } return ( "function" != typeof t && (t = h(+t)), null == n && (n = 0), null == e && (e = 0), (c.initialize = function (t) { (r = t), f(); }), (c.strength = function (t) { return arguments.length ? ((u = "function" == typeof t ? t : h(+t)), f(), c) : u; }), (c.radius = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), f(), c) : t; }), (c.x = function (t) { return arguments.length ? ((n = +t), c) : n; }), (c.y = function (t) { return arguments.length ? ((e = +t), c) : e; }), c ); }, $ = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vx += (r[i] - o.x) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.x = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }, tt = function (t) { var n, e, r, o = h(0.1); function i(t) { for (var o, i = 0, u = n.length; i < u; ++i) (o = n[i]).vy += (r[i] - o.y) * e[i] * t; } function u() { if (n) { var i, u = n.length; for (e = new Array(u), r = new Array(u), i = 0; i < u; ++i) e[i] = isNaN((r[i] = +t(n[i], i, n))) ? 0 : +o(n[i], i, n); } } return ( "function" != typeof t && (t = h(null == t ? 0 : +t)), (i.initialize = function (t) { (n = t), u(); }), (i.strength = function (t) { return arguments.length ? ((o = "function" == typeof t ? t : h(+t)), u(), i) : o; }), (i.y = function (n) { return arguments.length ? ((t = "function" == typeof n ? n : h(+n)), u(), i) : t; }), i ); }; }, 176: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__exportStar) || function (t, n) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(n, e) || r(n, t, e); }; Object.defineProperty(n, "__esModule", { value: !0 }), o(e(402), n); }, 401: function (t, n, e) { "use strict"; e.r(n); var r = e(176); n.default = r.ForceLayout; }, 402: function (t, n, e) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, n) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, n) { t.__proto__ = n; }) || function (t, n) { for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] = n[e]); })(t, n); }), function (t, n) { if ("function" != typeof n && null !== n) throw new TypeError( "Class extends value " + String(n) + " is not a constructor or null", ); function e() { this.constructor = t; } r(t, n), (t.prototype = null === n ? Object.create(n) : ((e.prototype = n.prototype), new e())); }), i = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), u = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), c = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && i(n, t, e); return u(n, t), n; }, f = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(n, "__esModule", { value: !0 }), (n.ForceLayout = void 0); var a = c(e(167)), l = f(e(403)), s = e(10), h = e(7), d = e(404), y = (function (t) { function n(n) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.nodeStrength = null), (e.edgeStrength = null), (e.preventOverlap = !1), (e.clusterNodeStrength = null), (e.clusterEdgeStrength = null), (e.clusterEdgeDistance = null), (e.clusterNodeSize = null), (e.clusterFociStrength = null), (e.linkDistance = 50), (e.alphaDecay = 0.028), (e.alphaMin = 0.001), (e.alpha = 0.3), (e.collideStrength = 1), (e.workerEnabled = !1), (e.tick = function () {}), (e.onLayoutEnd = function () {}), (e.ticking = void 0), n && e.updateCfg(n), e ); } return ( o(n, t), (n.prototype.getDefaultCfg = function () { return { center: [0, 0], nodeStrength: null, edgeStrength: null, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, linkDistance: 50, forceSimulation: null, alphaDecay: 0.028, alphaMin: 0.001, alpha: 0.3, collideStrength: 1, clustering: !1, clusterNodeStrength: -1, clusterEdgeStrength: 0.1, clusterEdgeDistance: 100, clusterFociStrength: 0.8, clusterNodeSize: 10, tick: function () {}, onLayoutEnd: function () {}, workerEnabled: !1, }; }), (n.prototype.init = function (t) { this.nodes = t.nodes || []; var n = t.edges || []; (this.edges = n.map(function (t) { var n = {}, e = ["targetNode", "sourceNode", "startPoint", "endPoint"]; return ( Object.keys(t).forEach(function (r) { e.indexOf(r) > -1 || (n[r] = t[r]); }), n ); })), (this.ticking = !1); }), (n.prototype.execute = function (t) { var n = this, e = n.nodes, r = n.edges; if (!n.ticking) { var o = n.forceSimulation, i = n.alphaMin, u = n.alphaDecay, c = n.alpha; if (o) { if (t) if ( (n.clustering && n.clusterForce && (n.clusterForce.nodes(e), n.clusterForce.links(r)), o.nodes(e), r && n.edgeForce) ) n.edgeForce.links(r); else if (r && !n.edgeForce) { h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } n.preventOverlap && n.overlapProcess(o), o.alpha(c).restart(), (this.ticking = !0); } else try { var f = a.forceManyBody(); if ( (n.nodeStrength && f.strength(n.nodeStrength), (o = a.forceSimulation().nodes(e)), n.clustering) ) { var s = l.default(); s .centerX(n.center[0]) .centerY(n.center[1]) .template("force") .strength(n.clusterFociStrength), r && s.links(r), e && s.nodes(e), s .forceLinkDistance(n.clusterEdgeDistance) .forceLinkStrength(n.clusterEdgeStrength) .forceCharge(n.clusterNodeStrength) .forceNodeSize(n.clusterNodeSize), (n.clusterForce = s), o.force("group", s); } if ( (o .force( "center", a.forceCenter(n.center[0], n.center[1]), ) .force("charge", f) .alpha(c) .alphaDecay(u) .alphaMin(i), n.preventOverlap && n.overlapProcess(o), r) ) { var h = a .forceLink() .id(function (t) { return t.id; }) .links(r); n.edgeStrength && h.strength(n.edgeStrength), n.linkDistance && h.distance(n.linkDistance), (n.edgeForce = h), o.force("link", h); } if ( (n.workerEnabled && !p() && ((n.workerEnabled = !1), console.warn( "workerEnabled option is only supported when running in web worker.", )), n.workerEnabled) ) { o.stop(); for ( var y = (function (t) { var n = t.alphaMin(), e = t.alphaTarget(), r = t.alpha(), o = Math.log((n - e) / (r - e)) / Math.log(1 - t.alphaDecay()); return Math.ceil(o); })(o), v = 1; v <= y; v++ ) o.tick(), postMessage( { nodes: e, currentTick: v, totalTicks: y, type: d.LAYOUT_MESSAGE.TICK, }, void 0, ); n.ticking = !1; } else o .on("tick", function () { n.tick(); }) .on("end", function () { (n.ticking = !1), n.onLayoutEnd && n.onLayoutEnd(); }), (n.ticking = !0); (n.forceSimulation = o), (n.ticking = !0); } catch (t) { (n.ticking = !1), console.warn(t); } } }), (n.prototype.overlapProcess = function (t) { var n, e, r = this.nodeSize, o = this.nodeSpacing, i = this.collideStrength; if ( ((e = s.isNumber(o) ? function () { return o; } : s.isFunction(o) ? o : function () { return 0; }), r) ) if (s.isFunction(r)) n = function (t) { return r(t) + e(t); }; else if (s.isArray(r)) { var u = (r[0] > r[1] ? r[0] : r[1]) / 2; n = function (t) { return u + e(t); }; } else if (s.isNumber(r)) { var c = r / 2; n = function (t) { return c + e(t); }; } else n = function () { return 10; }; else n = function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) / 2 + e(t) : t.size / 2 + e(t) : 10 + e(t); }; t.force("collisionForce", a.forceCollide(n).strength(i)); }), (n.prototype.updateCfg = function (t) { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.forceSimulation = null), Object.assign(this, t); }), (n.prototype.destroy = function () { this.ticking && (this.forceSimulation.stop(), (this.ticking = !1)), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), n ); })(h.Base); function p() { return ( "undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope ); } n.ForceLayout = y; }, 403: function (t, n, e) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, n, e, r) { void 0 === r && (r = e), Object.defineProperty(t, r, { enumerable: !0, get: function () { return n[e]; }, }); } : function (t, n, e, r) { void 0 === r && (r = e), (t[r] = n[e]); }), o = (this && this.__setModuleDefault) || (Object.create ? function (t, n) { Object.defineProperty(t, "default", { enumerable: !0, value: n, }); } : function (t, n) { t.default = n; }), i = (this && this.__importStar) || function (t) { if (t && t.__esModule) return t; var n = {}; if (null != t) for (var e in t) "default" !== e && Object.prototype.hasOwnProperty.call(t, e) && r(n, t, e); return o(n, t), n; }; Object.defineProperty(n, "__esModule", { value: !0 }); var u = i(e(167)); n.default = function () { function t(t) { return function () { return t; }; } var n, e = function (t) { return t.cluster; }, r = t(1), o = t(-1), i = t(100), c = t(0.1), f = [0, 0], a = [], l = {}, s = [], h = 100, d = 100, y = { none: { x: 0, y: 0 } }, p = [], v = "force", g = !0, _ = 0.1; function x(t) { if (!g) return x; n.tick(), w(); for (var r = 0, o = a.length, i = void 0, u = t * _; r < o; ++r) ((i = a[r]).vx += (y[e(i)].x - i.x) * u), (i.vy += (y[e(i)].y - i.y) * u); } function b() { a && (function () { if (!a || !a.length) return; if (void 0 === e(a[0])) throw Error( "Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()", ); var t = ((y = []), (v = []), (g = {}), (_ = []), (f = (function (t) { var n = {}; return ( t.forEach(function (t) { var r = e(t); n[r] || (n[r] = { count: 0, sumforceNodeSize: 0 }); }), t.forEach(function (t) { var o = e(t), i = r(t), u = n[o]; (u.count = u.count + 1), (u.sumforceNodeSize = u.sumforceNodeSize + Math.PI * (i * i) * 1.3), (n[o] = u); }), n ); })(a)), (_ = (function (t) { var n = {}, r = []; return ( t.forEach(function (t) { var r = (function (t) { var n = e(l[t.source]), r = e(l[t.target]); return n <= r ? n + "~" + r : r + "~" + n; })(t), o = 0; void 0 !== n[r] && (o = n[r]), (o += 1), (n[r] = o); }), Object.entries(n).forEach(function (t) { var n = t[0], e = t[1], o = n.split("~")[0], i = n.split("~")[1]; void 0 !== o && void 0 !== i && r.push({ source: o, target: i, count: e }); }), r ); })(s)), Object.keys(f).forEach(function (t, n) { var e = f[t]; y.push({ id: t, size: e.count, r: Math.sqrt(e.sumforceNodeSize / Math.PI), }), (g[t] = n); }), _.forEach(function (t) { var n = g[t.source], e = g[t.target]; void 0 !== n && void 0 !== e && v.push({ source: n, target: e, count: t.count }); }), { nodes: y, links: v }); var f, y, v, g, _; (n = u .forceSimulation(t.nodes) .force("x", u.forceX(h).strength(0.1)) .force("y", u.forceY(d).strength(0.1)) .force( "collide", u .forceCollide(function (t) { return t.r; }) .iterations(4), ) .force("charge", u.forceManyBody().strength(o)) .force( "links", u .forceLink(t.nodes.length ? t.links : []) .distance(i) .strength(c), )), (p = n.nodes()), w(); })(); } function w() { return ( (y = { none: { x: 0, y: 0 } }), p.forEach(function (t) { y[t.id] = { x: t.x - f[0], y: t.y - f[1] }; }), y ); } function m(t) { (l = {}), t.forEach(function (t) { l[t.id] = t; }); } return ( (x.initialize = function (t) { (a = t), b(); }), (x.template = function (t) { return arguments.length ? ((v = t), b(), x) : v; }), (x.groupBy = function (t) { return arguments.length ? "string" == typeof t ? ((e = function (n) { return n[t]; }), x) : ((e = t), x) : e; }), (x.enableGrouping = function (t) { return arguments.length ? ((g = t), x) : g; }), (x.strength = function (t) { return arguments.length ? ((_ = t), x) : _; }), (x.centerX = function (t) { return arguments.length ? ((h = t), x) : h; }), (x.centerY = function (t) { return arguments.length ? ((d = t), x) : d; }), (x.nodes = function (t) { return arguments.length ? (m(t || []), (a = t || []), x) : a; }), (x.links = function (t) { return arguments.length ? ((s = t || []), b(), x) : s; }), (x.forceNodeSize = function (n) { return arguments.length ? ((r = "function" == typeof n ? n : t(+n)), b(), x) : r; }), (x.nodeSize = x.forceNodeSize), (x.forceCharge = function (n) { return arguments.length ? ((o = "function" == typeof n ? n : t(+n)), b(), x) : o; }), (x.forceLinkDistance = function (n) { return arguments.length ? ((i = "function" == typeof n ? n : t(+n)), b(), x) : i; }), (x.forceLinkStrength = function (n) { return arguments.length ? ((c = "function" == typeof n ? n : t(+n)), b(), x) : c; }), (x.offset = function (t) { return arguments.length ? ((f = t), x) : f; }), (x.getFocis = w), x ); }; }, 404: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.LAYOUT_MESSAGE = void 0), (n.LAYOUT_MESSAGE = { RUN: "LAYOUT_RUN", END: "LAYOUT_END", ERROR: "LAYOUT_ERROR", TICK: "LAYOUT_TICK", GPURUN: "GPU_LAYOUT_RUN", GPUEND: "GPU_LAYOUT_END", }); }, 7: function (t, n, e) { "use strict"; Object.defineProperty(n, "__esModule", { value: !0 }), (n.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); n.Base = r; }, }).default; }); //# sourceMappingURL=forceLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/fruchtermanLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 405)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], c = i[r]; (o[u][c] = 1), e || (o[c][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 177: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.FruchtermanLayout = void 0); var i = n(7), u = n(10), c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.gravity = 10), (n.speed = 5), (n.clustering = !1), (n.clusterGravity = 10), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), (n.onLayoutEnd = function () {}), (n.tick = function () {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, gravity: 10, speed: 1, clustering: !1, clusterGravity: 10, }; }), (e.prototype.execute = function () { var t = this, e = this.nodes; if ( (void 0 !== this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval), e && 0 !== e.length) ) { this.width || "undefined" == typeof window || (this.width = window.innerWidth), this.height || "undefined" == typeof window || (this.height = window.innerHeight), this.center || (this.center = [this.width / 2, this.height / 2]); var n = this.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var r = {}, o = {}; return ( e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (this.nodeMap = r), (this.nodeIdxMap = o), this.run() ); } this.onLayoutEnd && this.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes; if (e) { var n = t.edges, r = t.maxIteration, o = t.center, i = t.height * t.width, c = Math.sqrt(i) / 10, s = i / (e.length + 1), a = Math.sqrt(s), f = t.gravity, y = t.speed, l = t.clustering, d = {}; if (l) for (var p in (e.forEach(function (t) { if (void 0 === d[t.cluster]) { var e = { name: t.cluster, cx: 0, cy: 0, count: 0 }; d[t.cluster] = e; } var n = d[t.cluster]; u.isNumber(t.x) && (n.cx += t.x), u.isNumber(t.y) && (n.cy += t.y), n.count++; }), d)) (d[p].cx /= d[p].count), (d[p].cy /= d[p].count); if ("undefined" != typeof window) { var h = 0; return ( (this.timeInterval = window.setInterval(function () { if (e) { var i = []; if ( (e.forEach(function (t, e) { i[e] = { x: 0, y: 0 }; }), t.applyCalculate(e, n, i, a, s), l) ) { var p = t.clusterGravity || f; for (var v in (e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = d[t.cluster], r = Math.sqrt( (t.x - n.cx) * (t.x - n.cx) + (t.y - n.cy) * (t.y - n.cy), ), o = a * p; (i[e].x -= (o * (t.x - n.cx)) / r), (i[e].y -= (o * (t.y - n.cy)) / r); } }), d)) (d[v].cx = 0), (d[v].cy = 0), (d[v].count = 0); for (var v in (e.forEach(function (t) { var e = d[t.cluster]; u.isNumber(t.x) && (e.cx += t.x), u.isNumber(t.y) && (e.cy += t.y), e.count++; }), d)) (d[v].cx /= d[v].count), (d[v].cy /= d[v].count); } e.forEach(function (t, e) { if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = 0.01 * a * f; (i[e].x -= n * (t.x - o[0])), (i[e].y -= n * (t.y - o[1])); } }), e.forEach(function (t, e) { if (u.isNumber(t.fx) && u.isNumber(t.fy)) return (t.x = t.fx), void (t.y = t.fy); if (u.isNumber(t.x) && u.isNumber(t.y)) { var n = Math.sqrt( i[e].x * i[e].x + i[e].y * i[e].y, ); if (n > 0) { var r = Math.min(c * (y / 800), n); (t.x += (i[e].x / n) * r), (t.y += (i[e].y / n) * r); } } }), t.tick && t.tick(), ++h >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0)), { nodes: e, edges: n } ); } } }), (e.prototype.applyCalculate = function (t, e, n, r, o) { this.calRepulsive(t, n, o), e && this.calAttractive(e, n, r); }), (e.prototype.calRepulsive = function (t, e, n) { t.forEach(function (r, o) { (e[o] = { x: 0, y: 0 }), t.forEach(function (t, i) { if ( o !== i && u.isNumber(r.x) && u.isNumber(t.x) && u.isNumber(r.y) && u.isNumber(t.y) ) { var c = r.x - t.x, s = r.y - t.y, a = c * c + s * s; if (0 === a) { a = 1; var f = o > i ? 1 : -1; (c = 0.01 * f), (s = 0.01 * f); } var y = n / a; (e[o].x += c * y), (e[o].y += s * y); } }); }); }), (e.prototype.calAttractive = function (t, e, n) { var r = this; t.forEach(function (t) { if (t.source && t.target) { var o = r.nodeIdxMap[t.source], i = r.nodeIdxMap[t.target]; if (o !== i) { var c = r.nodeMap[t.source], s = r.nodeMap[t.target]; if ( u.isNumber(s.x) && u.isNumber(c.x) && u.isNumber(s.y) && u.isNumber(c.y) ) { var a = s.x - c.x, f = s.y - c.y, y = Math.sqrt(a * a + f * f), l = (y * y) / n; (e[i].x -= (a / y) * l), (e[i].y -= (f / y) * l), (e[o].x += (a / y) * l), (e[o].y += (f / y) * l); } } } }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "fruchterman"; }), e ); })(i.Base); e.FruchtermanLayout = c; }, 405: function (t, e, n) { "use strict"; n.r(e); var r = n(177); e.default = r.FruchtermanLayout; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=fruchtermanLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/gForceLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var o = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var o in t) n.d( r, o, function (e) { return t[e]; }.bind(null, o), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 406)) ); })({ 10: function (t, e, n) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }), o = (this && this.__exportStar) || function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), o(n(11), e), o(n(12), e), o(n(13), e), o(n(14), e), o(n(15), e), o(n(16), e); }, 11: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r, o, i = /-(\w)/g; e.camelize = ((r = function (t) { return t.replace(i, function (t, e) { return e ? e.toUpperCase() : ""; }); }), (o = Object.create(null)), function (t) { return o[t] || (o[t] = r(t)); }); }, 12: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 13: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 14: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { for (var r = [], o = 0; o < t; o++) r[o] = 0; return n ? (n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r) : r; }; e.floydWarshall = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var o = 0; o < n; o += 1) r === o ? (e[r][o] = 0) : 0 !== t[r][o] && t[r][o] ? (e[r][o] = t[r][o]) : (e[r][o] = 1 / 0); } for (var i = 0; i < n; i += 1) for (r = 0; r < n; r += 1) for (o = 0; o < n; o += 1) e[r][o] > e[r][i] + e[i][o] && (e[r][o] = e[r][i] + e[i][o]); return e; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, o = [], i = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { i[t.id] = e; o.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, u = i[n], a = i[r]; (o[u][a] = 1), e || (o[a][u] = 1); }), o ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 15: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var o = (this && this.__assign) || function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === r(t); }; e.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var n = []; return ( t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); }) ); } if ("object" === r(t) && t !== {}) { var i = o({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = e.clone(i[t]); }), i ); } return t; }; }, 16: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 178: function (t, e, n) { "use strict"; var r, o = (this && this.__extends) || ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.GForceLayout = void 0); var i = n(7), u = n(10), a = function (t, e) { return t ? u.isNumber(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, c = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.maxIteration = 1e3), (n.edgeStrength = 200), (n.nodeStrength = 1e3), (n.coulombDisScale = 0.005), (n.damping = 0.9), (n.maxSpeed = 1e3), (n.minMovement = 0.5), (n.interval = 0.02), (n.factor = 1), (n.linkDistance = 1), (n.gravity = 10), (n.preventOverlap = !0), (n.tick = function () {}), (n.nodes = []), (n.edges = []), (n.width = 300), (n.height = 300), (n.nodeMap = {}), (n.nodeIdxMap = {}), n.updateCfg(e), n ); } return ( o(e, t), (e.prototype.getDefaultCfg = function () { return { maxIteration: 500, gravity: 10, enableTick: !0 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes; if ( (void 0 !== t.timeInterval && "undefined" != typeof window && window.clearInterval(t.timeInterval), e && 0 !== e.length) ) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var n = t.center; if (1 === e.length) return ( (e[0].x = n[0]), (e[0].y = n[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var r = {}, o = {}; e.forEach(function (e, n) { u.isNumber(e.x) || (e.x = Math.random() * t.width), u.isNumber(e.y) || (e.y = Math.random() * t.height), (r[e.id] = e), (o[e.id] = n); }), (t.nodeMap = r), (t.nodeIdxMap = o), (t.linkDistance = a(t.linkDistance, 1)), (t.nodeStrength = a(t.nodeStrength, 1)), (t.edgeStrength = a(t.edgeStrength, 1)); var i, c = t.nodeSize; if (t.preventOverlap) { var s, f = t.nodeSpacing; (s = u.isNumber(f) ? function () { return f; } : u.isFunction(f) ? f : function () { return 0; }), (i = c ? u.isArray(c) ? function (t) { return (c[0] > c[1] ? c[0] : c[1]) + s(t); } : function (t) { return c + s(t); } : function (t) { return t.size ? u.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + s(t) : t.size + s(t) : 10 + s(t); }); } t.nodeSize = i; var d = t.edges; (t.degrees = u.getDegree(e.length, t.nodeIdxMap, d)), t.getMass || (t.getMass = function (e) { return t.degrees[t.nodeIdxMap[e.id]] || 1; }), t.run(); } else t.onLayoutEnd && t.onLayoutEnd(); }), (e.prototype.run = function () { var t = this, e = t.nodes, n = t.edges, r = t.maxIteration; if ("undefined" != typeof window) { var o = 0; this.timeInterval = window.setInterval(function () { var i = [], u = []; if (e) { e.forEach(function (t, e) { (i[2 * e] = 0), (i[2 * e + 1] = 0), (u[2 * e] = 0), (u[2 * e + 1] = 0); }), t.calRepulsive(i, e), n && t.calAttractive(i, n), t.calGravity(i, e); var a = Math.max(0.02, t.interval - 0.002 * o); t.updateVelocity(i, u, a, e); var c = []; e.forEach(function (t) { c.push({ x: t.x, y: t.y }); }), t.updatePosition(u, a, e), t.tick && t.tick(); var s = 0; e.forEach(function (t, e) { var n = t.x - c[e].x, r = t.y - c[e].y; s += Math.sqrt(n * n + r * r); }), (s /= e.length) < t.minMovement && (window.clearInterval(t.timeInterval), t.onLayoutEnd && t.onLayoutEnd()), ++o >= r && (t.onLayoutEnd && t.onLayoutEnd(), window.clearInterval(t.timeInterval)); } }, 0); } }), (e.prototype.calRepulsive = function (t, e) { var n = this.getMass, r = this.nodeStrength, o = this.factor, i = this.coulombDisScale, u = this.preventOverlap, a = this.nodeSize; e.forEach(function (c, s) { var f = n ? n(c) : 1; e.forEach(function (e, d) { if (!(s >= d)) { var l = c.x - e.x, p = c.y - e.y, y = Math.sqrt(l * l + p * p) + 0.01, h = (y + 0.1) * i, v = l / y, g = p / y, b = (((r(c) + r(e)) / 2) * o) / (h * h), m = n ? n(e) : 1; if ( ((t[2 * s] += v * b), (t[2 * s + 1] += g * b), (t[2 * d] -= v * b), (t[2 * d + 1] -= g * b), u && y < (a(c) + a(e)) / 2) ) { var x = (r(c) + r(e)) / 2 / (y * y); (t[2 * s] += (v * x) / f), (t[2 * s + 1] += (g * x) / f), (t[2 * d] -= (v * x) / m), (t[2 * d + 1] -= (g * x) / m); } } }); }); }), (e.prototype.calAttractive = function (t, e) { var n = this.nodeMap, r = this.nodeIdxMap, o = this.linkDistance, i = this.edgeStrength, u = this.getMass; e.forEach(function (e, a) { var c = n[e.source], s = n[e.target], f = s.x - c.x, d = s.y - c.y, l = Math.sqrt(f * f + d * d) + 0.01, p = f / l, y = d / l, h = ((o(e) || 1) - l) * i(e), v = r[e.source], g = r[e.target], b = u ? u(c) : 1, m = u ? u(s) : 1; (t[2 * v] -= (p * h) / b), (t[2 * v + 1] -= (y * h) / b), (t[2 * g] += (p * h) / m), (t[2 * g + 1] += (y * h) / m); }); }), (e.prototype.calGravity = function (t, e) { for ( var n = this.center, r = this.gravity, o = this.degrees, i = e.length, a = 0; a < i; a++ ) { var c = e[a], s = c.x - n[0], f = c.y - n[1], d = r; if (this.getCenter) { var l = this.getCenter(c, o[a]); l && u.isNumber(l[0]) && u.isNumber(l[1]) && u.isNumber(l[2]) && ((s = c.x - l[0]), (f = c.y - l[1]), (d = l[2])); } d && ((t[2 * a] -= d * s), (t[2 * a + 1] -= d * f)); } }), (e.prototype.updateVelocity = function (t, e, n, r) { var o = this, i = n * o.damping; r.forEach(function (n, r) { var u = t[2 * r] * i || 0.01, a = t[2 * r + 1] * i || 0.01, c = Math.sqrt(u * u + a * a); if (c > o.maxSpeed) { var s = o.maxSpeed / c; (u *= s), (a *= s); } (e[2 * r] = u), (e[2 * r + 1] = a); }); }), (e.prototype.updatePosition = function (t, e, n) { n.forEach(function (n, r) { if (u.isNumber(n.fx) && u.isNumber(n.fy)) return (n.x = n.fx), void (n.y = n.fy); var o = t[2 * r] * e, i = t[2 * r + 1] * e; (n.x += o), (n.y += i); }); }), (e.prototype.stop = function () { this.timeInterval && "undefined" != typeof window && window.clearInterval(this.timeInterval); }), (e.prototype.destroy = function () { this.stop(), (this.tick = null), (this.nodes = null), (this.edges = null), (this.destroyed = !0); }), (e.prototype.getType = function () { return "gForce"; }), e ); })(i.Base); e.GForceLayout = c; }, 406: function (t, e, n) { "use strict"; n.r(e); var r = n(178); e.default = r.GForceLayout; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, }).default; }); //# sourceMappingURL=gForceLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/gridLayout.js ================================================ !(function (e, t) { "object" == typeof exports && "object" == typeof module ? (module.exports = t()) : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? (exports.f6 = t()) : (e.f6 = t()); })(this, function () { return (function (e) { var t = {}; function o(r) { if (t[r]) return t[r].exports; var n = (t[r] = { i: r, l: !1, exports: {} }); return e[r].call(n.exports, n, n.exports, o), (n.l = !0), n.exports; } return ( (o.m = e), (o.c = t), (o.d = function (e, t, r) { o.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }), (o.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }), (o.t = function (e, t) { if ((1 & t && (e = o(e)), 8 & t)) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if ( (o.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) ) for (var n in e) o.d( r, n, function (t) { return e[t]; }.bind(null, n), ); return r; }), (o.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return o.d(t, "a", t), t; }), (o.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }), (o.p = ""), o((o.s = 407)) ); })({ 10: function (e, t, o) { "use strict"; var r = (this && this.__createBinding) || (Object.create ? function (e, t, o, r) { void 0 === r && (r = o), Object.defineProperty(e, r, { enumerable: !0, get: function () { return t[o]; }, }); } : function (e, t, o, r) { void 0 === r && (r = o), (e[r] = t[o]); }), n = (this && this.__exportStar) || function (e, t) { for (var o in e) "default" === o || Object.prototype.hasOwnProperty.call(t, o) || r(t, e, o); }; Object.defineProperty(t, "__esModule", { value: !0 }), n(o(11), t), n(o(12), t), n(o(13), t), n(o(14), t), n(o(15), t), n(o(16), t); }, 11: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.camelize = t.isString = void 0); t.isString = function (e) { return "string" == typeof e; }; var r, n, i = /-(\w)/g; t.camelize = ((r = function (e) { return e.replace(i, function (e, t) { return t ? t.toUpperCase() : ""; }); }), (n = Object.create(null)), function (e) { return n[e] || (n[e] = r(e)); }); }, 12: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isArray = void 0), (t.isArray = Array.isArray); }, 13: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.toNumber = t.isNaN = t.isNumber = void 0); t.isNumber = function (e) { return "number" == typeof e; }; t.isNaN = function (e) { return Number.isNaN(Number(e)); }; t.toNumber = function (e) { var o = parseFloat(e); return t.isNaN(o) ? e : o; }; }, 14: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.traverseTreeUp = t.scaleMatrix = t.getAdjMatrix = t.floydWarshall = t.getDegree = void 0); t.getDegree = function (e, t, o) { for (var r = [], n = 0; n < e; n++) r[n] = 0; return o ? (o.forEach(function (e) { e.source && (r[t[e.source]] += 1), e.target && (r[t[e.target]] += 1); }), r) : r; }; t.floydWarshall = function (e) { for (var t = [], o = e.length, r = 0; r < o; r += 1) { t[r] = []; for (var n = 0; n < o; n += 1) r === n ? (t[r][n] = 0) : 0 !== e[r][n] && e[r][n] ? (t[r][n] = e[r][n]) : (t[r][n] = 1 / 0); } for (var i = 0; i < o; i += 1) for (r = 0; r < o; r += 1) for (n = 0; n < o; n += 1) t[r][n] > t[r][i] + t[i][n] && (t[r][n] = t[r][i] + t[i][n]); return t; }; t.getAdjMatrix = function (e, t) { var o = e.nodes, r = e.edges, n = [], i = {}; if (!o) throw new Error("invalid nodes data!"); return ( o && o.forEach(function (e, t) { i[e.id] = t; n.push([]); }), r && r.forEach(function (e) { var o = e.source, r = e.target, s = i[o], u = i[r]; (n[s][u] = 1), t || (n[u][s] = 1); }), n ); }; t.scaleMatrix = function (e, t) { var o = []; return ( e.forEach(function (e) { var r = []; e.forEach(function (e) { r.push(e * t); }), o.push(r); }), o ); }; t.traverseTreeUp = function (e, t) { "function" == typeof t && (function e(t, o) { if (t && t.children) for (var r = t.children.length - 1; r >= 0; r--) if (!e(t.children[r], o)) return; return !!o(t); })(e, t); }; }, 15: function (e, t, o) { "use strict"; function r(e) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (e) { return typeof e; } : function (e) { return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; })(e); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (e) { for (var t, o = 1, r = arguments.length; o < r; o++) for (var n in (t = arguments[o])) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); return e; }).apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), (t.clone = t.isObject = void 0); t.isObject = function (e) { return null !== e && "object" === r(e); }; t.clone = function (e) { if (null === e) return e; if (e instanceof Date) return new Date(e.getTime()); if (e instanceof Array) { var o = []; return ( e.forEach(function (e) { o.push(e); }), o.map(function (e) { return t.clone(e); }) ); } if ("object" === r(e) && e !== {}) { var i = n({}, e); return ( Object.keys(i).forEach(function (e) { i[e] = t.clone(i[e]); }), i ); } return e; }; }, 16: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.isFunction = void 0); t.isFunction = function (e) { return "function" == typeof e; }; }, 179: function (e, t, o) { "use strict"; var r, n = (this && this.__extends) || ((r = function (e, t) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (e, t) { e.__proto__ = t; }) || function (e, t) { for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]); })(e, t); }), function (e, t) { if ("function" != typeof t && null !== t) throw new TypeError( "Class extends value " + String(t) + " is not a constructor or null", ); function o() { this.constructor = e; } r(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o())); }); Object.defineProperty(t, "__esModule", { value: !0 }), (t.GridLayout = void 0); var i = o(10), s = (function (e) { function t(t) { var o = e.call(this) || this; return ( (o.begin = [0, 0]), (o.preventOverlap = !0), (o.preventOverlapPadding = 10), (o.condense = !1), (o.sortBy = "degree"), (o.nodeSize = 30), (o.nodes = []), (o.edges = []), (o.width = 300), (o.height = 300), (o.row = 0), (o.col = 0), (o.cellWidth = 0), (o.cellHeight = 0), (o.cellUsed = {}), (o.id2manPos = {}), (o.onLayoutEnd = function () {}), o.updateCfg(t), o ); } return ( n(t, e), (t.prototype.getDefaultCfg = function () { return { begin: [0, 0], preventOverlap: !0, preventOverlapPadding: 10, condense: !1, rows: void 0, cols: void 0, position: void 0, sortBy: "degree", nodeSize: 30, }; }), (t.prototype.execute = function () { var e = this, t = e.nodes, o = t.length, r = e.begin; if (0 !== o) { if (1 === o) return ( (t[0].x = r[0]), (t[0].y = r[1]), void (e.onLayoutEnd && e.onLayoutEnd()) ); var n = e.edges, s = []; t.forEach(function (e) { s.push(e); }); var u = {}; if ( (s.forEach(function (e, t) { u[e.id] = t; }), ("degree" === e.sortBy || !i.isString(e.sortBy) || void 0 === s[0][e.sortBy]) && ((e.sortBy = "degree"), i.isNaN(t[0].degree))) ) { var c = i.getDegree(s.length, u, n); s.forEach(function (e, t) { e.degree = c[t]; }); } s.sort(function (t, o) { return o[e.sortBy] - t[e.sortBy]; }), e.width || "undefined" == typeof window || (e.width = window.innerWidth), e.height || "undefined" == typeof window || (e.height = window.innerHeight); var l = e.rows, a = null != e.cols ? e.cols : e.columns; if ( ((e.cells = o), null != l && null != a ? ((e.rows = l), (e.cols = a)) : null != l && null == a ? ((e.rows = l), (e.cols = Math.ceil(e.cells / e.rows))) : null == l && null != a ? ((e.cols = a), (e.rows = Math.ceil(e.cells / e.cols))) : ((e.splits = Math.sqrt((e.cells * e.height) / e.width)), (e.rows = Math.round(e.splits)), (e.cols = Math.round((e.width / e.height) * e.splits))), e.cols * e.rows > e.cells) ) ((d = e.small()) - 1) * (f = e.large()) >= e.cells ? e.small(d - 1) : (f - 1) * d >= e.cells && e.large(f - 1); else for (; e.cols * e.rows < e.cells; ) { var f, d = e.small(); ((f = e.large()) + 1) * d >= e.cells ? e.large(f + 1) : e.small(d + 1); } (e.cellWidth = e.width / e.cols), (e.cellHeight = e.height / e.rows), e.condense && ((e.cellWidth = 0), (e.cellHeight = 0)), e.preventOverlap && s.forEach(function (t) { var o, r; (t.x && t.y) || ((t.x = 0), (t.y = 0)), i.isArray(t.size) ? ((o = t.size[0]), (r = t.size[1])) : i.isNumber(t.size) && ((o = t.size), (r = t.size)), (void 0 !== o && void 0 !== r) || (i.isArray(e.nodeSize) ? ((o = e.nodeSize[0]), (r = e.nodeSize[1])) : i.isNumber(e.nodeSize) ? ((o = e.nodeSize), (r = e.nodeSize)) : ((o = 30), (r = 30))); var n = e.preventOverlapPadding, s = o + n, u = r + n; (e.cellWidth = Math.max(e.cellWidth, s)), (e.cellHeight = Math.max(e.cellHeight, u)); }), (e.cellUsed = {}), (e.row = 0), (e.col = 0), (e.id2manPos = {}); for (var p = 0; p < s.length; p++) { var h = s[p], y = void 0; if ( (e.position && (y = e.position(h)), y && (void 0 !== y.row || void 0 !== y.col)) ) { var v = { row: y.row, col: y.col }; if (void 0 === v.col) for (v.col = 0; e.used(v.row, v.col); ) v.col++; else if (void 0 === v.row) for (v.row = 0; e.used(v.row, v.col); ) v.row++; (e.id2manPos[h.id] = v), e.use(v.row, v.col); } e.getPos(h); } return e.onLayoutEnd && e.onLayoutEnd(), { edges: n, nodes: s }; } e.onLayoutEnd && e.onLayoutEnd(); }), (t.prototype.small = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.min(o, r)) : Math.min(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.large = function (e) { var t, o = this.rows || 5, r = this.cols || 5; null == e ? (t = Math.max(o, r)) : Math.max(o, r) === this.rows ? (this.rows = e) : (this.cols = e); return t; }), (t.prototype.used = function (e, t) { return this.cellUsed["c-" + e + "-" + t] || !1; }), (t.prototype.use = function (e, t) { this.cellUsed["c-" + e + "-" + t] = !0; }), (t.prototype.moveToNextCell = function () { var e = this.cols || 5; this.col++, this.col >= e && ((this.col = 0), this.row++); }), (t.prototype.getPos = function (e) { var t, o, r = this.begin, n = this.cellWidth, i = this.cellHeight, s = this.id2manPos[e.id]; if (s) (t = s.col * n + n / 2 + r[0]), (o = s.row * i + i / 2 + r[1]); else { for (; this.used(this.row, this.col); ) this.moveToNextCell(); (t = this.col * n + n / 2 + r[0]), (o = this.row * i + i / 2 + r[1]), this.use(this.row, this.col), this.moveToNextCell(); } (e.x = t), (e.y = o); }), (t.prototype.getType = function () { return "grid"; }), t ); })(o(7).Base); t.GridLayout = s; }, 407: function (e, t, o) { "use strict"; o.r(t); var r = o(179); t.default = r.GridLayout; }, 7: function (e, t, o) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), (t.Base = void 0); var r = (function () { function e() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (e.prototype.layout = function (e) { return this.init(e), this.execute(!0); }), (e.prototype.init = function (e) { (this.nodes = e.nodes || []), (this.edges = e.edges || []), (this.combos = e.combos || []); }), (e.prototype.execute = function (e) {}), (e.prototype.executeWithWorker = function () {}), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.updateCfg = function (e) { e && Object.assign(this, e); }), (e.prototype.getType = function () { return "base"; }), (e.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), e ); })(); t.Base = r; }, }).default; }); //# sourceMappingURL=gridLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/mdsLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.f6 = r()) : (t.f6 = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 408)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 102: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return Q; }), e.d(r, "default", function () { return K; }), e.d(r, "Matrix", function () { return K; }), e.d(r, "MatrixColumnView", function () { return at; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return xt; }), e.d(r, "MatrixFlipRowView", function () { return _t; }), e.d(r, "MatrixRowView", function () { return Vt; }), e.d(r, "MatrixRowSelectionView", function () { return Ut; }), e.d(r, "MatrixSelectionView", function () { return Xt; }), e.d(r, "MatrixSubView", function () { return or; }), e.d(r, "MatrixTransposeView", function () { return cr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return wr; }), e.d(r, "WrapperMatrix2D", function () { return Er; }), e.d(r, "solve", function () { return Vr; }), e.d(r, "inverse", function () { return Ir; }), e.d(r, "determinant", function () { return qr; }), e.d(r, "linearDependencies", function () { return Br; }), e.d(r, "pseudoInverse", function () { return Lr; }), e.d(r, "covariance", function () { return Ur; }), e.d(r, "correlation", function () { return Qr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Hr; }), e.d(r, "EVD", function () { return Hr; }), e.d(r, "CholeskyDecomposition", function () { return re; }), e.d(r, "CHO", function () { return re; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return Tr; }), e.d(r, "QR", function () { return Tr; }), e.d(r, "Nipals", function () { return oe; }), e.d(r, "NIPALS", function () { return oe; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } var i = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; }; var s = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; }; var u = function (t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError( "output option must be an array if specified", ); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; }, a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t) { return (p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function v(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function g(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function w(t, r, e) { return { row: b(t, r), column: d(t, e) }; } function b(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for row indices"); if ( r.some(function (r) { return r < 0 || r >= t.rows; }) ) throw new RangeError("row indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function d(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for column indices"); if ( r.some(function (r) { return r < 0 || r >= t.columns; }) ) throw new RangeError("column indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function M(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (k("startRow", r), k("endRow", e), k("startColumn", o), k("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function x(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function k(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function S(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function E(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function O(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function R(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function P(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function T(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function A(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function C(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function N(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function I(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function V(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function q(t, r) { return (q = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function D(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = B(t); if (r) { var n = B(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return F(this, e); }; } function F(t, r) { return !r || ("object" !== L(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function B(t) { return (B = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function L(t) { return (L = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function z(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function U(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function W(t, r, e) { return r && U(t.prototype, r), e && U(t, e), t; } var Q = (function () { function t() { z(this, t); } return ( W( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new K(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { v(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return K.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { v(this, t), (r = m(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { v(this, t), v(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return K.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = g(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { v(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { S(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { S(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { v(this, t), S(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { v(this, t), S(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), S(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), S(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new K(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = K.checkMatrix(t); var r = new K(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), v = (e + n) * f, y = c + p - v + (n - a) * (u + f), m = l + v, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, y), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = K.checkMatrix(t); var r = new K(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), v = t.get(1, 0), y = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), b = t.get(2, 2), d = (e - i) * (-l + y), M = (-e + i + s) * (h - l + y), x = (i + s) * (-h + l), k = e * h, S = (-e + a + f) * (h - p + m), E = (-e + a) * (p - m), O = (a + f) * (-h + p), R = (-n + f + c) * (y + g - w), j = (n - c) * (y - w), _ = n * g, P = (f + c) * (-g + w), T = (-n + s + u) * (m + g - b), A = (n - u) * (m - b), C = (s + u) * (-g + b), N = k + _ + o * v, I = (e + o + n - i - s - f - c) * y + M + x + k + R + _ + P, V = k + S + O + (e + o + n - s - u - a - f) * m + _ + T + C, q = d + s * (-h + l + v - y - m - g + b) + M + k + _ + T + A, D = d + M + x + k + u * w, F = _ + T + A + C + i * p, B = k + S + E + f * (-h + p + v - y - m - g + w) + R + j + _, L = R + j + _ + P + a * l, z = k + S + E + O + c * b; return ( r.set(0, 0, N), r.set(0, 1, I), r.set(0, 2, V), r.set(1, 0, q), r.set(1, 1, D), r.set(1, 2, F), r.set(2, 0, B), r.set(2, 1, L), r.set(2, 2, z), r ); }, }, { key: "mmulStrassen", value: function (r) { r = K.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), v = o.subMatrix(s, o.rows - 1, 0, a - 1), y = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, y), t.add(c, m), s, a), w = r(t.add(p, y), c, s, a), b = r(f, t.sub(l, m), s, a), d = r(y, t.sub(v, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), k = r(t.sub(h, y), t.add(v, m), s, a), S = t.add(g, d); S.sub(M), S.add(k); var E = t.add(b, M), O = t.add(w, d), R = t.sub(g, w); R.add(b), R.add(x); var j = t.zeros(2 * S.rows, 2 * S.columns); return (j = (j = (j = (j = j.setSubMatrix( S, 0, 0, )).setSubMatrix(E, S.rows, 0)).setSubMatrix( O, 0, S.columns, )).setSubMatrix(R, S.rows, S.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== L(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new K(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = K.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(K.eye(e, e)), n = K.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new K(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { M(this, t, r, e, o); for (var n = new K(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new K(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new K(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = K.checkMatrix(t)).isEmpty()) return this; M(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { for ( var e = w(this, t, r), o = new K(t.length, r.length), n = 0; n < e.row.length; n++ ) for (var i = e.row[n], s = 0; s < e.column.length; s++) { var u = e.column[s]; o.set(n, s, this.get(i, u)); } return o; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new K(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, n = void 0 === o || o, i = e.mean, s = void 0 === i ? this.mean(t) : i; if ("boolean" != typeof n) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return E(this, n, s); case "column": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return O(this, n, s); case void 0: if ("number" != typeof s) throw new TypeError("mean must be a number"); return R(this, n, s); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === L(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, n = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return j(this, n), this; case "column": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return _(this, n), this; case void 0: if ("number" != typeof n) throw new TypeError("center must be a number"); return P(this, n), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === L(t) && ((r = t), (t = void 0)), "object" !== L(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = T(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return A(this, e), this; case "column": if (void 0 === e) e = C(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return N(this, e), this; case void 0: if (void 0 === e) e = I(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return V(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new K(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new K(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new K(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new K(t, r); }, }, { key: "ones", value: function (t, r) { return new K(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== L(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new K(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== L(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new K(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new K(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new K(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function J(t, r) { return t - r; } (Q.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (Q.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (Q.random = Q.rand), (Q.randomInt = Q.randInt), (Q.diagonal = Q.diag), (Q.prototype.diagonal = Q.prototype.diag), (Q.identity = Q.eye), (Q.prototype.negate = Q.prototype.neg), (Q.prototype.tensorProduct = Q.prototype.kroneckerProduct); var Y, H, K = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && q(t, r); })(e, t); var r = D(e); function e(t, o) { var n; if ((z(this, e), (n = r.call(this)), e.isMatrix(t))) return F(n, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((n.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var i = 0; i < t; i++) n.data.push(new Float64Array(o)); } else { if (!Array.isArray(t)) throw new TypeError( "First argument must be a positive number or an array", ); var s = t; if ("number" != typeof (o = (t = s.length) ? s[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); n.data = []; for (var u = 0; u < t; u++) { if (s[u].length !== o) throw new RangeError("Inconsistent array dimensions"); n.data.push(Float64Array.from(s[u])); } } return (n.rows = t), (n.columns = o), n; } return ( W(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( v(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), v(this, t, !0), (r = Float64Array.from(m(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = g(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(Q); function X(t) { return (X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function G(t, r) { return (G = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Z(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = tt(t); if (r) { var n = tt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return $(this, e); }; } function $(t, r) { return !r || ("object" !== X(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function tt(t) { return (tt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (H = K), ((Y = Q).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (Y.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (Y.prototype.addM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (Y.add = function (t, r) { return new H(t).add(r); }), (Y.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (Y.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (Y.prototype.subM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (Y.sub = function (t, r) { return new H(t).sub(r); }), (Y.prototype.subtract = Y.prototype.sub), (Y.prototype.subtractS = Y.prototype.subS), (Y.prototype.subtractM = Y.prototype.subM), (Y.subtract = Y.sub), (Y.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (Y.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (Y.prototype.mulM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (Y.mul = function (t, r) { return new H(t).mul(r); }), (Y.prototype.multiply = Y.prototype.mul), (Y.prototype.multiplyS = Y.prototype.mulS), (Y.prototype.multiplyM = Y.prototype.mulM), (Y.multiply = Y.mul), (Y.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (Y.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (Y.prototype.divM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (Y.div = function (t, r) { return new H(t).div(r); }), (Y.prototype.divide = Y.prototype.div), (Y.prototype.divideS = Y.prototype.divS), (Y.prototype.divideM = Y.prototype.divM), (Y.divide = Y.div), (Y.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (Y.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (Y.prototype.modM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (Y.mod = function (t, r) { return new H(t).mod(r); }), (Y.prototype.modulus = Y.prototype.mod), (Y.prototype.modulusS = Y.prototype.modS), (Y.prototype.modulusM = Y.prototype.modM), (Y.modulus = Y.mod), (Y.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (Y.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (Y.prototype.andM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (Y.and = function (t, r) { return new H(t).and(r); }), (Y.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (Y.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (Y.prototype.orM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (Y.or = function (t, r) { return new H(t).or(r); }), (Y.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (Y.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (Y.prototype.xorM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (Y.xor = function (t, r) { return new H(t).xor(r); }), (Y.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (Y.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (Y.prototype.leftShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (Y.leftShift = function (t, r) { return new H(t).leftShift(r); }), (Y.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (Y.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (Y.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (Y.signPropagatingRightShift = function (t, r) { return new H(t).signPropagatingRightShift(r); }), (Y.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (Y.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (Y.prototype.rightShiftM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (Y.rightShift = function (t, r) { return new H(t).rightShift(r); }), (Y.prototype.zeroFillRightShift = Y.prototype.rightShift), (Y.prototype.zeroFillRightShiftS = Y.prototype.rightShiftS), (Y.prototype.zeroFillRightShiftM = Y.prototype.rightShiftM), (Y.zeroFillRightShift = Y.rightShift), (Y.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (Y.not = function (t) { return new H(t).not(); }), (Y.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (Y.abs = function (t) { return new H(t).abs(); }), (Y.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (Y.acos = function (t) { return new H(t).acos(); }), (Y.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (Y.acosh = function (t) { return new H(t).acosh(); }), (Y.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (Y.asin = function (t) { return new H(t).asin(); }), (Y.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (Y.asinh = function (t) { return new H(t).asinh(); }), (Y.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (Y.atan = function (t) { return new H(t).atan(); }), (Y.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (Y.atanh = function (t) { return new H(t).atanh(); }), (Y.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (Y.cbrt = function (t) { return new H(t).cbrt(); }), (Y.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (Y.ceil = function (t) { return new H(t).ceil(); }), (Y.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (Y.clz32 = function (t) { return new H(t).clz32(); }), (Y.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (Y.cos = function (t) { return new H(t).cos(); }), (Y.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (Y.cosh = function (t) { return new H(t).cosh(); }), (Y.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (Y.exp = function (t) { return new H(t).exp(); }), (Y.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (Y.expm1 = function (t) { return new H(t).expm1(); }), (Y.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (Y.floor = function (t) { return new H(t).floor(); }), (Y.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (Y.fround = function (t) { return new H(t).fround(); }), (Y.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (Y.log = function (t) { return new H(t).log(); }), (Y.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (Y.log1p = function (t) { return new H(t).log1p(); }), (Y.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (Y.log10 = function (t) { return new H(t).log10(); }), (Y.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (Y.log2 = function (t) { return new H(t).log2(); }), (Y.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (Y.round = function (t) { return new H(t).round(); }), (Y.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (Y.sign = function (t) { return new H(t).sign(); }), (Y.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (Y.sin = function (t) { return new H(t).sin(); }), (Y.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (Y.sinh = function (t) { return new H(t).sinh(); }), (Y.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (Y.sqrt = function (t) { return new H(t).sqrt(); }), (Y.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (Y.tan = function (t) { return new H(t).tan(); }), (Y.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (Y.tanh = function (t) { return new H(t).tanh(); }), (Y.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (Y.trunc = function (t) { return new H(t).trunc(); }), (Y.pow = function (t, r) { return new H(t).pow(r); }), (Y.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (Y.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (Y.prototype.powM = function (t) { if ( ((t = H.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && G(t, r); })(e, t); var r = Z(e); function e(t, o, n) { var i; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, e), ((i = r.call(this)).matrix = t), (i.rows = o), (i.columns = n), i ); } return e; })(Q); function et(t) { return (et = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ot(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function nt(t, r) { return (nt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function it(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ut(t); if (r) { var n = ut(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return st(this, e); }; } function st(t, r) { return !r || ("object" !== et(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function ut(t) { return (ut = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var at = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && nt(t, r); })(i, t); var r, e, o, n = it(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && ot(r.prototype, e), o && ot(r, o), i ); })(rt); function ft(t) { return (ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ct(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ht(t, r) { return (ht = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function lt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = vt(t); if (r) { var n = vt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return pt(this, e); }; } function pt(t, r) { return !r || ("object" !== ft(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function vt(t) { return (vt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && ht(t, r); })(i, t); var r, e, o, n = lt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = d(t, r)), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ct(r.prototype, e), o && ct(r, o), i ); })(rt); function mt(t) { return (mt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function wt(t, r) { return (wt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Mt(t); if (r) { var n = Mt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return dt(this, e); }; } function dt(t, r) { return !r || ("object" !== mt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Mt(t) { return (Mt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && wt(t, r); })(i, t); var r, e, o, n = bt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && gt(r.prototype, e), o && gt(r, o), i ); })(rt); function kt(t) { return (kt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function St(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Et(t, r) { return (Et = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Rt(this, e); }; } function Rt(t, r) { return !r || ("object" !== kt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var _t = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Et(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && St(r.prototype, e), o && St(r, o), i ); })(rt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Tt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ct(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = It(t); if (r) { var n = It(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { return !r || ("object" !== Pt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function It(t) { return (It = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Vt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && At(t, r); })(i, t); var r, e, o, n = Ct(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), v(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && Tt(r.prototype, e), o && Tt(r, o), i ); })(rt); function qt(t) { return (qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Dt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Ft(t, r) { return (Ft = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = zt(t); if (r) { var n = zt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Lt(this, e); }; } function Lt(t, r) { return !r || ("object" !== qt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function zt(t) { return (zt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Ft(t, r); })(i, t); var r, e, o, n = Bt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = b(t, r)), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && Dt(r.prototype, e), o && Dt(r, o), i ); })(rt); function Wt(t) { return (Wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Jt(t, r) { return (Jt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Yt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Kt(t); if (r) { var n = Kt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Ht(this, e); }; } function Ht(t, r) { return !r || ("object" !== Wt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Kt(t) { return (Kt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Jt(t, r); })(i, t); var r, e, o, n = Yt(i); function i(t, r, e) { var o; !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i); var s = w(t, r, e); return ( ((o = n.call(this, t, s.row.length, s.column.length)).rowIndices = s.row), (o.columnIndices = s.column), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Qt(r.prototype, e), o && Qt(r, o), i ); })(rt); function Gt(t) { return (Gt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Zt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function $t(t, r) { return ($t = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function tr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = er(t); if (r) { var n = er(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return rr(this, e); }; } function rr(t, r) { return !r || ("object" !== Gt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function er(t) { return (er = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var or = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && $t(t, r); })(i, t); var r, e, o, n = tr(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), M(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Zt(r.prototype, e), o && Zt(r, o), i ); })(rt); function nr(t) { return (nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function sr(t, r) { return (sr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ur(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = fr(t); if (r) { var n = fr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ar(this, e); }; } function ar(t, r) { return !r || ("object" !== nr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function fr(t) { return (fr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var cr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && sr(t, r); })(i, t); var r, e, o, n = ur(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && ir(r.prototype, e), o && ir(r, o), i ); })(rt); function hr(t) { return (hr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function lr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function vr(t, r) { return (vr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = gr(t); if (r) { var n = gr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return mr(this, e); }; } function mr(t, r) { return !r || ("object" !== hr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function gr(t) { return (gr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var wr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && vr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; lr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && pr(r.prototype, e), o && pr(r, o), i ); })(Q); function br(t) { return (br = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function dr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Mr(t, r) { return (Mr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function xr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Sr(t); if (r) { var n = Sr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return kr(this, e); }; } function kr(t, r) { return !r || ("object" !== br(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Sr(t) { return (Sr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Mr(t, r); })(i, t); var r, e, o, n = xr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && dr(r.prototype, e), o && dr(r, o), i ); })(Q); function Or(t, r) { if (Array.isArray(t)) return t[0] && Array.isArray(t[0]) ? new Er(t) : new wr(t, r); throw new Error("the argument is not an array"); } function Rr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Er.checkMatrix(r)).clone(), l = h.rows, p = h.columns, v = new Float64Array(l), y = 1; for (e = 0; e < l; e++) v[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = v[i]), (v[i] = v[o]), (v[o] = a), (y = -y); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = v), (this.pivotSign = y); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Rr(r.prototype, e), o && Rr(r, o), t ); })(); function _r(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Tr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Er.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = _r(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new K(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new K(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), t ); })(); function Ar(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Cr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Ar(this, t), (r = Er.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), v = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (v = !0); var y = l; (l = p), (p = y); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), b = new K(n, m), d = new K(i, i), M = new Float64Array(i), x = new Float64Array(n), k = new Float64Array(g), S = 0; S < g; S++ ) k[S] = S; for ( var E = Math.min(n - 1, i), O = Math.max(0, Math.min(i - 2, n)), R = Math.max(E, O), j = 0; j < R; j++ ) { if (j < E) { w[j] = 0; for (var _ = j; _ < n; _++) w[j] = _r(w[j], o.get(_, j)); if (0 !== w[j]) { o.get(j, j) < 0 && (w[j] = -w[j]); for (var P = j; P < n; P++) o.set(P, j, o.get(P, j) / w[j]); o.set(j, j, o.get(j, j) + 1); } w[j] = -w[j]; } for (var T = j + 1; T < i; T++) { if (j < E && 0 !== w[j]) { for (var A = 0, C = j; C < n; C++) A += o.get(C, j) * o.get(C, T); A = -A / o.get(j, j); for (var N = j; N < n; N++) o.set(N, T, o.get(N, T) + A * o.get(N, j)); } M[T] = o.get(j, T); } if (l && j < E) for (var I = j; I < n; I++) b.set(I, j, o.get(I, j)); if (j < O) { M[j] = 0; for (var V = j + 1; V < i; V++) M[j] = _r(M[j], M[V]); if (0 !== M[j]) { M[j + 1] < 0 && (M[j] = 0 - M[j]); for (var q = j + 1; q < i; q++) M[q] /= M[j]; M[j + 1] += 1; } if (((M[j] = -M[j]), j + 1 < n && 0 !== M[j])) { for (var D = j + 1; D < n; D++) x[D] = 0; for (var F = j + 1; F < n; F++) for (var B = j + 1; B < i; B++) x[F] += M[B] * o.get(F, B); for (var L = j + 1; L < i; L++) for (var z = -M[L] / M[j + 1], U = j + 1; U < n; U++) o.set(U, L, o.get(U, L) + z * x[U]); } if (p) for (var W = j + 1; W < i; W++) d.set(W, j, M[W]); } } var Q = Math.min(i, n + 1); if ( (E < i && (w[E] = o.get(E, E)), n < Q && (w[Q - 1] = 0), O + 1 < Q && (M[O] = o.get(O, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = E; J < m; J++) { for (var Y = 0; Y < n; Y++) b.set(Y, J, 0); b.set(J, J, 1); } for (var H = E - 1; H >= 0; H--) if (0 !== w[H]) { for (var X = H + 1; X < m; X++) { for (var G = 0, Z = H; Z < n; Z++) G += b.get(Z, H) * b.get(Z, X); G = -G / b.get(H, H); for (var $ = H; $ < n; $++) b.set($, X, b.get($, X) + G * b.get($, H)); } for (var tt = H; tt < n; tt++) b.set(tt, H, -b.get(tt, H)); b.set(H, H, 1 + b.get(H, H)); for (var rt = 0; rt < H - 1; rt++) b.set(rt, H, 0); } else { for (var et = 0; et < n; et++) b.set(et, H, 0); b.set(H, H, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < O && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += d.get(st, ot) * d.get(st, nt); it = -it / d.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) d.set(ut, nt, d.get(ut, nt) + it * d.get(ut, ot)); } for (var at = 0; at < i; at++) d.set(at, ot, 0); d.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var vt = void 0; for (vt = Q - 1; vt >= ht && vt !== ht; vt--) { var yt = (vt !== Q ? Math.abs(M[vt]) : 0) + (vt !== ht + 1 ? Math.abs(M[vt - 1]) : 0); if (Math.abs(w[vt]) <= ct * yt) { w[vt] = 0; break; } } vt === ht ? (lt = 3) : vt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = vt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = _r(w[gt], mt), bt = w[gt] / wt, dt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -dt * M[gt - 1]), (M[gt - 1] = bt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = bt * d.get(Mt, gt) + dt * d.get(Mt, Q - 1)), d.set( Mt, Q - 1, -dt * d.get(Mt, gt) + bt * d.get(Mt, Q - 1), ), d.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var kt = ht; kt < Q; kt++) { var St = _r(w[kt], xt), Et = w[kt] / St, Ot = xt / St; if ( ((w[kt] = St), (xt = -Ot * M[kt]), (M[kt] = Et * M[kt]), l) ) for (var Rt = 0; Rt < n; Rt++) (St = Et * b.get(Rt, kt) + Ot * b.get(Rt, ht - 1)), b.set( Rt, ht - 1, -Ot * b.get(Rt, kt) + Et * b.get(Rt, ht - 1), ), b.set(Rt, kt, St); } break; case 3: var jt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), _t = w[Q - 1] / jt, Pt = w[Q - 2] / jt, Tt = M[Q - 2] / jt, At = w[ht] / jt, Ct = M[ht] / jt, Nt = ((Pt + _t) * (Pt - _t) + Tt * Tt) / 2, It = _t * Tt * (_t * Tt), Vt = 0; (0 === Nt && 0 === It) || (Vt = It / (Nt + (Vt = Nt < 0 ? 0 - Math.sqrt(Nt * Nt + It) : Math.sqrt(Nt * Nt + It)))); for ( var qt = (At + _t) * (At - _t) + Vt, Dt = At * Ct, Ft = ht; Ft < Q - 1; Ft++ ) { var Bt = _r(qt, Dt); 0 === Bt && (Bt = Number.MIN_VALUE); var Lt = qt / Bt, zt = Dt / Bt; if ( (Ft !== ht && (M[Ft - 1] = Bt), (qt = Lt * w[Ft] + zt * M[Ft]), (M[Ft] = Lt * M[Ft] - zt * w[Ft]), (Dt = zt * w[Ft + 1]), (w[Ft + 1] = Lt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Bt = Lt * d.get(Ut, Ft) + zt * d.get(Ut, Ft + 1)), d.set( Ut, Ft + 1, -zt * d.get(Ut, Ft) + Lt * d.get(Ut, Ft + 1), ), d.set(Ut, Ft, Bt); if ( (0 === (Bt = _r(qt, Dt)) && (Bt = Number.MIN_VALUE), (Lt = qt / Bt), (zt = Dt / Bt), (w[Ft] = Bt), (qt = Lt * M[Ft] + zt * w[Ft + 1]), (w[Ft + 1] = -zt * M[Ft] + Lt * w[Ft + 1]), (Dt = zt * M[Ft + 1]), (M[Ft + 1] = Lt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Bt = Lt * b.get(Wt, Ft) + zt * b.get(Wt, Ft + 1)), b.set( Wt, Ft + 1, -zt * b.get(Wt, Ft) + Lt * b.get(Wt, Ft + 1), ), b.set(Wt, Ft, Bt); } (M[Q - 2] = qt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) d.set(Qt, ht, -d.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Yt = 0; Yt < i; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); if (l && ht < n - 1) for (var Ht = 0; Ht < n; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); ht++; } 0, Q--; } } if (v) { var Kt = d; (d = b), (b = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = b), (this.V = d); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = K.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = K.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var v = 0, y = 0; y < o; y++) v += a.get(l, y) * s.get(p, y); h.set(l, p, v); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(K.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new K(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new K(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, v = 0; v < f; v++) p += n.get(h, v) * u.get(l, v); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return K.diag(this.s); }, }, ]) && Cr(r.prototype, e), o && Cr(r, o), t ); })(); function Ir(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Er.checkMatrix(t)), r ? new Nr(t).inverse() : Vr(t, K.eye(t.rows)) ); } function Vr(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Er.checkMatrix(t)), (r = Er.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new Tr(t).solve(r) ); } function qr(t) { var r, e, o, n, i, s; if ((t = K.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Xt(t, [1, 2], [1, 2])), (i = new Xt(t, [1, 2], [0, 2])), (s = new Xt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * qr(n) - e * qr(i) + o * qr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function Dr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Fr(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Br(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = K.checkMatrix(t)).rows, u = new K(s, s), a = 0; a < s; a++ ) { var f = K.columnVector(t.getRow(a)), c = t.subMatrixRow(Dr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = K.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Fr(p, l, a, o, i)); } return u; } function Lr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = K.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(K.diag(i).mmul(o.transpose())); } function zr(t) { return (zr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Ur(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== zr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i; s && ((t = t.center("column")), o || (r = r.center("column"))); for (var u = t.transpose().mmul(r), a = 0; a < u.rows; a++) for (var f = 0; f < u.columns; f++) u.set(a, f, u.get(a, f) * (1 / (t.rows - 1))); return u; } function Wr(t) { return (Wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Wr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i, u = n.scale, a = void 0 === u || u; s && (t.center("column"), o || r.center("column")), a && (t.scale("column"), o || r.scale("column")); for ( var f = t.standardDeviation("column", { unbiased: !0 }), c = o ? f : r.standardDeviation("column", { unbiased: !0 }), h = t.transpose().mmul(r), l = 0; l < h.rows; l++ ) for (var p = 0; p < h.columns; p++) h.set(l, p, h.get(l, p) * (1 / (f[l] * c[p])) * (1 / (t.rows - 1))); return h; } function Jr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Yr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Hr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Jr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Er.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new K(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Kr(u, c, f, a), Xr(u, c, f, a); } else { var l = new K(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Gr(u, l, p, a), Zr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new K(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Yr(r.prototype, e), o && Yr(r, o), t ); })(); function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, v, y, m, g, w, b; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var d = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = _r((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( d += i, h = e[c], y = v = 1, m = v, g = r[f + 1], w = 0, b = 0, s = c - 1; s >= f; s-- ) for ( m = y, y = v, b = w, n = v * r[s], i = v * h, l = _r(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (v = h / l) * e[s] - w * n, e[s + 1] = i + w * (v * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + v * i), o.set(a, s, v * o.get(a, s) - w * i); (h = (-w * b * m * g * r[f]) / p), (r[f] = w * h), (e[f] = v * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + d), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Gr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Zr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, v, y, m, g, w, b, d = t - 1, M = t - 1, x = Number.EPSILON, k = 0, S = 0, E = 0, O = 0, R = 0, j = 0, _ = 0, P = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) S += Math.abs(n.get(i, s)); for (; d >= 0; ) { for ( a = d; a > 0 && (0 === (j = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (j = S), !(Math.abs(n.get(a, a - 1)) < x * j)); ) a--; if (a === d) n.set(d, d, n.get(d, d) + k), (e[d] = n.get(d, d)), (r[d] = 0), d--, (P = 0); else if (a === d - 1) { if ( ((h = n.get(d, d - 1) * n.get(d - 1, d)), (O = (E = (n.get(d - 1, d - 1) - n.get(d, d)) / 2) * E + h), (_ = Math.sqrt(Math.abs(O))), n.set(d, d, n.get(d, d) + k), n.set(d - 1, d - 1, n.get(d - 1, d - 1) + k), (l = n.get(d, d)), O >= 0) ) { for ( _ = E >= 0 ? E + _ : E - _, e[d - 1] = l + _, e[d] = e[d - 1], 0 !== _ && (e[d] = l - h / _), r[d - 1] = 0, r[d] = 0, E = (l = n.get(d, d - 1)) / (j = Math.abs(l) + Math.abs(_)), O = _ / j, E /= R = Math.sqrt(E * E + O * O), O /= R, s = d - 1; s < t; s++ ) (_ = n.get(d - 1, s)), n.set(d - 1, s, O * _ + E * n.get(d, s)), n.set(d, s, O * n.get(d, s) - E * _); for (i = 0; i <= d; i++) (_ = n.get(i, d - 1)), n.set(i, d - 1, O * _ + E * n.get(i, d)), n.set(i, d, O * n.get(i, d) - E * _); for (i = 0; i <= M; i++) (_ = o.get(i, d - 1)), o.set(i, d - 1, O * _ + E * o.get(i, d)), o.set(i, d, O * o.get(i, d) - E * _); } else (e[d - 1] = l + E), (e[d] = l + E), (r[d - 1] = _), (r[d] = -_); (d -= 2), (P = 0); } else { if ( ((l = n.get(d, d)), (p = 0), (h = 0), a < d && ((p = n.get(d - 1, d - 1)), (h = n.get(d, d - 1) * n.get(d - 1, d))), 10 === P) ) { for (k += l, i = 0; i <= d; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (j = Math.abs(n.get(d, d - 1)) + Math.abs(n.get(d - 1, d - 2)))), (h = -0.4375 * j * j); } if (30 === P && (j = (j = (p - l) / 2) * j + h) > 0) { for ( j = Math.sqrt(j), p < l && (j = -j), j = l - h / ((p - l) / 2 + j), i = 0; i <= d; i++ ) n.set(i, i, n.get(i, i) - j); (k += j), (l = p = h = 0.964); } for ( P += 1, f = d - 2; f >= a && ((E = ((R = l - (_ = n.get(f, f))) * (j = p - _) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (O = n.get(f + 1, f + 1) - _ - R - j), (R = n.get(f + 2, f + 1)), (E /= j = Math.abs(E) + Math.abs(O) + Math.abs(R)), (O /= j), (R /= j), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(O) + Math.abs(R)) < x * (Math.abs(E) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(_) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= d; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= d - 1 && ((w = u !== d - 1), u !== f && ((E = n.get(u, u - 1)), (O = n.get(u + 1, u - 1)), (R = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(E) + Math.abs(O) + Math.abs(R)) && ((E /= l), (O /= l), (R /= l))), 0 !== l); u++ ) if ( ((j = Math.sqrt(E * E + O * O + R * R)), E < 0 && (j = -j), 0 !== j) ) { for ( u !== f ? n.set(u, u - 1, -j * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (E += j) / j, p = O / j, _ = R / j, O /= E, R /= E, s = u; s < t; s++ ) (E = n.get(u, s) + O * n.get(u + 1, s)), w && ((E += R * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - E * _)), n.set(u, s, n.get(u, s) - E * l), n.set(u + 1, s, n.get(u + 1, s) - E * p); for (i = 0; i <= Math.min(d, u + 3); i++) (E = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((E += _ * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - E * R)), n.set(i, u, n.get(i, u) - E), n.set(i, u + 1, n.get(i, u + 1) - E * O); for (i = 0; i <= M; i++) (E = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((E += _ * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - E * R)), o.set(i, u, o.get(i, u) - E), o.set(i, u + 1, o.get(i, u + 1) - E * O); } } } if (0 !== S) { for (d = t - 1; d >= 0; d--) if (((E = e[d]), 0 === (O = r[d]))) for (a = d, n.set(d, d, 1), i = d - 1; i >= 0; i--) { for (h = n.get(i, i) - E, R = 0, s = a; s <= d; s++) R += n.get(i, s) * n.get(s, d); if (r[i] < 0) (_ = h), (j = R); else if ( ((a = i), 0 === r[i] ? n.set(i, d, 0 !== h ? -R / h : -R / (x * S)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * j - _ * R) / (O = (e[i] - E) * (e[i] - E) + r[i] * r[i])), n.set(i, d, c), n.set( i + 1, d, Math.abs(l) > Math.abs(_) ? (-R - h * c) / l : (-j - p * c) / _, )), x * (c = Math.abs(n.get(i, d))) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d, n.get(s, d) / c); } else if (O < 0) for ( a = d - 1, Math.abs(n.get(d, d - 1)) > Math.abs(n.get(d - 1, d)) ? (n.set(d - 1, d - 1, O / n.get(d, d - 1)), n.set(d - 1, d, -(n.get(d, d) - E) / n.get(d, d - 1))) : ((b = $r( 0, -n.get(d - 1, d), n.get(d - 1, d - 1) - E, O, )), n.set(d - 1, d - 1, b[0]), n.set(d - 1, d, b[1])), n.set(d, d - 1, 0), n.set(d, d, 1), i = d - 2; i >= 0; i-- ) { for (v = 0, y = 0, s = a; s <= d; s++) (v += n.get(i, s) * n.get(s, d - 1)), (y += n.get(i, s) * n.get(s, d)); if (((h = n.get(i, i) - E), r[i] < 0)) (_ = h), (R = v), (j = y); else if ( ((a = i), 0 === r[i] ? ((b = $r(-v, -y, h, O)), n.set(i, d - 1, b[0]), n.set(i, d, b[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - E) * (e[i] - E) + r[i] * r[i] - O * O), (g = 2 * (e[i] - E) * O), 0 === m && 0 === g && (m = x * S * (Math.abs(h) + Math.abs(O) + Math.abs(l) + Math.abs(p) + Math.abs(_))), (b = $r( l * R - _ * v + O * y, l * j - _ * y - O * v, m, g, )), n.set(i, d - 1, b[0]), n.set(i, d, b[1]), Math.abs(l) > Math.abs(_) + Math.abs(O) ? (n.set( i + 1, d - 1, (-v - h * n.get(i, d - 1) + O * n.get(i, d)) / l, ), n.set( i + 1, d, (-y - h * n.get(i, d) - O * n.get(i, d - 1)) / l, )) : ((b = $r( -R - p * n.get(i, d - 1), -j - p * n.get(i, d), _, O, )), n.set(i + 1, d - 1, b[0]), n.set(i + 1, d, b[1]))), x * (c = Math.max( Math.abs(n.get(i, d - 1)), Math.abs(n.get(i, d)), )) * c > 1) ) for (s = i; s <= d; s++) n.set(s, d - 1, n.get(s, d - 1) / c), n.set(s, d, n.get(s, d) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (_ = 0, u = 0; u <= Math.min(s, M); u++) _ += o.get(i, u) * n.get(u, s); o.set(i, s, _); } } } function $r(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function te(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var re = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Er.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new K(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Er.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && te(r.prototype, e), o && te(r, o), t ); })(); function ee(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var oe = function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; ee(this, t), (r = Er.checkMatrix(r)); var o, n = e.Y, i = e.scaleScores, s = void 0 !== i && i, u = e.maxIterations, a = void 0 === u ? 1e3 : u, f = e.terminationCriteria, c = void 0 === f ? 1e-10 : f; if (n) { if ( (n = Array.isArray(n) && "number" == typeof n[0] ? K.columnVector(n) : Er.checkMatrix(n)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = n.getColumnVector(0); } else o = r.getColumnVector(0); for (var h, l, p, v, y = 1, m = 0; m < a && y > c; m++) (p = (p = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(p.norm())), (h = r.mmul(p).div(p.transpose().mmul(p).get(0, 0))), m > 0 && (y = h.clone().sub(v).pow(2).sum()), (v = h.clone()), n ? ((l = (l = n .transpose() .mmul(h) .div(h.transpose().mmul(h).get(0, 0))).div(l.norm())), (o = n.mmul(l).div(l.transpose().mmul(l).get(0, 0)))) : (o = h); if (n) { var g = r.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)); g = g.div(g.norm()); var w = r.clone().sub(h.clone().mmul(g.transpose())), b = o.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)), d = n.clone().sub(h.clone().mulS(b.get(0, 0)).mmul(l.transpose())); (this.t = h), (this.p = g.transpose()), (this.w = p.transpose()), (this.q = l), (this.u = o), (this.s = h.transpose().mmul(h)), (this.xResidual = w), (this.yResidual = d), (this.betas = b); } else (this.w = p.transpose()), (this.s = h.transpose().mmul(h).sqrt()), (this.t = s ? h.clone().div(this.s.get(0, 0)) : h), (this.xResidual = r.sub(h.mmul(p.transpose()))); }; }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 180: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }); Object.defineProperty(r, "__esModule", { value: !0 }), (r.MDSLayout = void 0); var i = e(102), s = e(10), u = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.center = [0, 0]), (e.linkDistance = 50), (e.nodes = []), (e.edges = []), (e.onLayoutEnd = function () {}), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { center: [0, 0], linkDistance: 50 }; }), (r.prototype.execute = function () { var t = this.nodes, r = this.edges, e = void 0 === r ? [] : r, o = this.center; if (t && 0 !== t.length) { if (1 === t.length) return ( (t[0].x = o[0]), (t[0].y = o[1]), void (this.onLayoutEnd && this.onLayoutEnd()) ); var n = this.linkDistance, i = s.getAdjMatrix({ nodes: t, edges: e }, !1), u = s.floydWarshall(i); this.handleInfinity(u); var a = s.scaleMatrix(u, n); this.scaledDistances = a; var f = this.runMDS(); return ( (this.positions = f), f.forEach(function (r, e) { (t[e].x = r[0] + o[0]), (t[e].y = r[1] + o[1]); }), this.onLayoutEnd && this.onLayoutEnd(), { nodes: t, edges: e } ); } this.onLayoutEnd && this.onLayoutEnd(); }), (r.prototype.runMDS = function () { var t = this.scaledDistances, r = i.Matrix.mul(i.Matrix.pow(t, 2), -0.5), e = r.mean("row"), o = r.mean("column"), n = r.mean(); r.add(n).subRowVector(e).subColumnVector(o); var s = new i.SingularValueDecomposition(r), u = i.Matrix.sqrt(s.diagonalMatrix).diagonal(); return s.leftSingularVectors.toJSON().map(function (t) { return i.Matrix.mul([t], [u]).toJSON()[0].splice(0, 2); }); }), (r.prototype.handleInfinity = function (t) { var r = -999999; t.forEach(function (t) { t.forEach(function (t) { t !== 1 / 0 && r < t && (r = t); }); }), t.forEach(function (e, o) { e.forEach(function (e, n) { e === 1 / 0 && (t[o][n] = r); }); }); }), (r.prototype.getType = function () { return "mds"; }), r ); })(e(7).Base); r.MDSLayout = u; }, 408: function (t, r, e) { "use strict"; e.r(r); var o = e(180); r.default = o.MDSLayout; }, 7: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, }).default; }); //# sourceMappingURL=mdsLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/radialLayout.js ================================================ !(function (t, r) { "object" == typeof exports && "object" == typeof module ? (module.exports = r()) : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? (exports.f6 = r()) : (t.f6 = r()); })(this, function () { return (function (t) { var r = {}; function e(o) { if (r[o]) return r[o].exports; var n = (r[o] = { i: o, l: !1, exports: {} }); return t[o].call(n.exports, n, n.exports, e), (n.l = !0), n.exports; } return ( (e.m = t), (e.c = r), (e.d = function (t, r, o) { e.o(t, r) || Object.defineProperty(t, r, { enumerable: !0, get: o }); }), (e.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (e.t = function (t, r) { if ((1 & r && (t = e(t)), 8 & r)) return t; if (4 & r && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (e.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & r && "string" != typeof t) ) for (var n in t) e.d( o, n, function (r) { return t[r]; }.bind(null, n), ); return o; }), (e.n = function (t) { var r = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return e.d(r, "a", r), r; }), (e.o = function (t, r) { return Object.prototype.hasOwnProperty.call(t, r); }), (e.p = ""), e((e.s = 409)) ); })({ 10: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(11), r), n(e(12), r), n(e(13), r), n(e(14), r), n(e(15), r), n(e(16), r); }, 102: function (t, r, e) { "use strict"; e.r(r), e.d(r, "AbstractMatrix", function () { return Q; }), e.d(r, "default", function () { return K; }), e.d(r, "Matrix", function () { return K; }), e.d(r, "MatrixColumnView", function () { return at; }), e.d(r, "MatrixColumnSelectionView", function () { return yt; }), e.d(r, "MatrixFlipColumnView", function () { return xt; }), e.d(r, "MatrixFlipRowView", function () { return _t; }), e.d(r, "MatrixRowView", function () { return Dt; }), e.d(r, "MatrixRowSelectionView", function () { return Ut; }), e.d(r, "MatrixSelectionView", function () { return Xt; }), e.d(r, "MatrixSubView", function () { return or; }), e.d(r, "MatrixTransposeView", function () { return cr; }), e.d(r, "wrap", function () { return Or; }), e.d(r, "WrapperMatrix1D", function () { return wr; }), e.d(r, "WrapperMatrix2D", function () { return Er; }), e.d(r, "solve", function () { return Dr; }), e.d(r, "inverse", function () { return Cr; }), e.d(r, "determinant", function () { return Vr; }), e.d(r, "linearDependencies", function () { return Br; }), e.d(r, "pseudoInverse", function () { return zr; }), e.d(r, "covariance", function () { return Ur; }), e.d(r, "correlation", function () { return Qr; }), e.d(r, "SingularValueDecomposition", function () { return Nr; }), e.d(r, "SVD", function () { return Nr; }), e.d(r, "EigenvalueDecomposition", function () { return Yr; }), e.d(r, "EVD", function () { return Yr; }), e.d(r, "CholeskyDecomposition", function () { return re; }), e.d(r, "CHO", function () { return re; }), e.d(r, "LuDecomposition", function () { return jr; }), e.d(r, "LU", function () { return jr; }), e.d(r, "QrDecomposition", function () { return Tr; }), e.d(r, "QR", function () { return Tr; }), e.d(r, "Nipals", function () { return oe; }), e.d(r, "NIPALS", function () { return oe; }); var o = Object.prototype.toString; function n(t) { return o.call(t).endsWith("Array]"); } var i = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] > u && (u = t[a]); return u; }; var s = function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); var e = r.fromIndex, o = void 0 === e ? 0 : e, i = r.toIndex, s = void 0 === i ? t.length : i; if (o < 0 || o >= t.length || !Number.isInteger(o)) throw new Error( "fromIndex must be a positive integer smaller than length", ); if (s <= o || s > t.length || !Number.isInteger(s)) throw new Error( "toIndex must be an integer greater than fromIndex and at most equal to length", ); for (var u = t[o], a = o + 1; a < s; a++) t[a] < u && (u = t[a]); return u; }; var u = function (t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!n(t)) throw new TypeError("input must be an array"); if (0 === t.length) throw new TypeError("input must not be empty"); if (void 0 !== e.output) { if (!n(e.output)) throw new TypeError( "output option must be an array if specified", ); r = e.output; } else r = new Array(t.length); var o = s(t), u = i(t); if (o === u) throw new RangeError( "minimum and maximum input values are equal. Cannot rescale a constant array", ); var a = e.min, f = void 0 === a ? (e.autoMinMax ? o : 0) : a, c = e.max, h = void 0 === c ? (e.autoMinMax ? u : 1) : c; if (f >= h) throw new RangeError("min option must be smaller than max option"); for (var l = (h - f) / (u - o), p = 0; p < t.length; p++) r[p] = (t[p] - o) * l + f; return r; }, a = " ".repeat(2), f = " ".repeat(4); function c(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.maxRows, o = void 0 === e ? 15 : e, n = r.maxColumns, i = void 0 === n ? 10 : n, s = r.maxNumSize, u = void 0 === s ? 8 : s; return "" .concat(t.constructor.name, " {\n") .concat(a, "[\n") .concat(f) .concat(h(t, o, i, u), "\n") .concat(a, "]\n") .concat(a, "rows: ") .concat(t.rows, "\n") .concat(a, "columns: ") .concat(t.columns, "\n}"); } function h(t, r, e, o) { for ( var n = t.rows, i = t.columns, s = Math.min(n, r), u = Math.min(i, e), a = [], c = 0; c < s; c++ ) { for (var h = [], p = 0; p < u; p++) h.push(l(t.get(c, p), o)); a.push("".concat(h.join(" "))); } return ( u !== i && (a[a.length - 1] += " ... ".concat(i - e, " more columns")), s !== n && a.push("... ".concat(n - r, " more rows")), a.join("\n".concat(f)) ); } function l(t, r) { var e = String(t); if (e.length <= r) return e.padEnd(r, " "); var o = t.toPrecision(r - 2); if (o.length <= r) return o; var n = t.toExponential(r - 2), i = n.indexOf("e"), s = n.slice(i); return n.slice(0, r - s.length) + s; } function p(t) { return (p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function v(t, r, e) { var o = e ? t.rows : t.rows - 1; if (r < 0 || r > o) throw new RangeError("Row index out of range"); } function y(t, r, e) { var o = e ? t.columns : t.columns - 1; if (r < 0 || r > o) throw new RangeError("Column index out of range"); } function m(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.columns)) throw new RangeError( "vector size must be the same as the number of columns", ); return r; } function g(t, r) { if ((r.to1DArray && (r = r.to1DArray()), r.length !== t.rows)) throw new RangeError( "vector size must be the same as the number of rows", ); return r; } function w(t, r, e) { return { row: d(t, r), column: b(t, e) }; } function d(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for row indices"); if ( r.some(function (r) { return r < 0 || r >= t.rows; }) ) throw new RangeError("row indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function b(t, r) { if ("object" !== p(r)) throw new TypeError("unexpected type for column indices"); if ( r.some(function (r) { return r < 0 || r >= t.columns; }) ) throw new RangeError("column indices are out of range"); return Array.isArray(r) || (r = Array.from(r)), r; } function M(t, r, e, o, n) { if (5 !== arguments.length) throw new RangeError("expected 4 arguments"); if ( (S("startRow", r), S("endRow", e), S("startColumn", o), S("endColumn", n), r > e || o > n || r < 0 || r >= t.rows || e < 0 || e >= t.rows || o < 0 || o >= t.columns || n < 0 || n >= t.columns) ) throw new RangeError("Submatrix indices are out of range"); } function x(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, e = [], o = 0; o < t; o++ ) e.push(r); return e; } function S(t, r) { if ("number" != typeof r) throw new TypeError("".concat(t, " must be a number")); } function k(t) { if (t.isEmpty()) throw new Error("Empty matrix has no elements to index"); } function E(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < o; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < n; c++) (u += f = t.get(s, c) - e[s]), (a += f * f); r ? i.push((a - (u * u) / n) / (n - 1)) : i.push((a - (u * u) / n) / n); } return i; } function O(t, r, e) { for (var o = t.rows, n = t.columns, i = [], s = 0; s < n; s++) { for (var u = 0, a = 0, f = 0, c = 0; c < o; c++) (u += f = t.get(c, s) - e[s]), (a += f * f); r ? i.push((a - (u * u) / o) / (o - 1)) : i.push((a - (u * u) / o) / o); } return i; } function R(t, r, e) { for ( var o = t.rows, n = t.columns, i = o * n, s = 0, u = 0, a = 0, f = 0; f < o; f++ ) for (var c = 0; c < n; c++) (s += a = t.get(f, c) - e), (u += a * a); return r ? (u - (s * s) / i) / (i - 1) : (u - (s * s) / i) / i; } function j(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[e]); } function _(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r[o]); } function P(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) - r); } function T(t) { for (var r = [], e = 0; e < t.rows; e++) { for (var o = 0, n = 0; n < t.columns; n++) o += Math.pow(t.get(e, n), 2) / (t.columns - 1); r.push(Math.sqrt(o)); } return r; } function A(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[e]); } function I(t) { for (var r = [], e = 0; e < t.columns; e++) { for (var o = 0, n = 0; n < t.rows; n++) o += Math.pow(t.get(n, e), 2) / (t.rows - 1); r.push(Math.sqrt(o)); } return r; } function N(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r[o]); } function C(t) { for (var r = t.size - 1, e = 0, o = 0; o < t.columns; o++) for (var n = 0; n < t.rows; n++) e += Math.pow(t.get(n, o), 2) / r; return Math.sqrt(e); } function D(t, r) { for (var e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) t.set(e, o, t.get(e, o) / r); } function V(t, r) { return (V = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function q(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = B(t); if (r) { var n = B(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return F(this, e); }; } function F(t, r) { return !r || ("object" !== z(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function B(t) { return (B = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } function z(t) { return (z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function L(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function U(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function W(t, r, e) { return r && U(t.prototype, r), e && U(t, e), t; } var Q = (function () { function t() { L(this, t); } return ( W( t, [ { key: "size", get: function () { return this.rows * this.columns; }, }, { key: "apply", value: function (t) { if ("function" != typeof t) throw new TypeError("callback must be a function"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.call(this, r, e); return this; }, }, { key: "to1DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) t.push(this.get(r, e)); return t; }, }, { key: "to2DArray", value: function () { for (var t = [], r = 0; r < this.rows; r++) { t.push([]); for (var e = 0; e < this.columns; e++) t[r].push(this.get(r, e)); } return t; }, }, { key: "toJSON", value: function () { return this.to2DArray(); }, }, { key: "isRowVector", value: function () { return 1 === this.rows; }, }, { key: "isColumnVector", value: function () { return 1 === this.columns; }, }, { key: "isVector", value: function () { return 1 === this.rows || 1 === this.columns; }, }, { key: "isSquare", value: function () { return this.rows === this.columns; }, }, { key: "isEmpty", value: function () { return 0 === this.rows || 0 === this.columns; }, }, { key: "isSymmetric", value: function () { if (this.isSquare()) { for (var t = 0; t < this.rows; t++) for (var r = 0; r <= t; r++) if (this.get(t, r) !== this.get(r, t)) return !1; return !0; } return !1; }, }, { key: "isEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); t++; } return o; }, }, { key: "isReducedEchelonForm", value: function () { for ( var t = 0, r = 0, e = -1, o = !0, n = !1; t < this.rows && o; ) { for (r = 0, n = !1; r < this.columns && !1 === n; ) 0 === this.get(t, r) ? r++ : 1 === this.get(t, r) && r > e ? ((n = !0), (e = r)) : ((o = !1), (n = !0)); for (var i = r + 1; i < this.rows; i++) 0 !== this.get(t, i) && (o = !1); t++; } return o; }, }, { key: "echelonForm", value: function () { for ( var t = this.clone(), r = 0, e = 0; r < t.rows && e < t.columns; ) { for (var o = r, n = r; n < t.rows; n++) t.get(n, e) > t.get(o, e) && (o = n); if (0 === t.get(o, e)) e++; else { t.swapRows(r, o); for (var i = t.get(r, e), s = e; s < t.columns; s++) t.set(r, s, t.get(r, s) / i); for (var u = r + 1; u < t.rows; u++) { var a = t.get(u, e) / t.get(r, e); t.set(u, e, 0); for (var f = e + 1; f < t.columns; f++) t.set(u, f, t.get(u, f) - t.get(r, f) * a); } r++, e++; } } return t; }, }, { key: "reducedEchelonForm", value: function () { for ( var t = this.echelonForm(), r = t.columns, e = t.rows, o = e - 1; o >= 0; ) if (0 === t.maxRow(o)) o--; else { for (var n = 0, i = !1; n < e && !1 === i; ) 1 === t.get(o, n) ? (i = !0) : n++; for (var s = 0; s < o; s++) for (var u = t.get(s, n), a = n; a < r; a++) { var f = t.get(s, a) - u * t.get(o, a); t.set(s, a, f); } o--; } return t; }, }, { key: "set", value: function () { throw new Error("set method is unimplemented"); }, }, { key: "get", value: function () { throw new Error("get method is unimplemented"); }, }, { key: "repeat", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.rows, e = void 0 === r ? 1 : r, o = t.columns, n = void 0 === o ? 1 : o; if (!Number.isInteger(e) || e <= 0) throw new TypeError("rows must be a positive integer"); if (!Number.isInteger(n) || n <= 0) throw new TypeError("columns must be a positive integer"); for ( var i = new K(this.rows * e, this.columns * n), s = 0; s < e; s++ ) for (var u = 0; u < n; u++) i.setSubMatrix(this, this.rows * s, this.columns * u); return i; }, }, { key: "fill", value: function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, t); return this; }, }, { key: "neg", value: function () { return this.mulS(-1); }, }, { key: "getRow", value: function (t) { v(this, t); for (var r = [], e = 0; e < this.columns; e++) r.push(this.get(t, e)); return r; }, }, { key: "getRowVector", value: function (t) { return K.rowVector(this.getRow(t)); }, }, { key: "setRow", value: function (t, r) { v(this, t), (r = m(this, r)); for (var e = 0; e < this.columns; e++) this.set(t, e, r[e]); return this; }, }, { key: "swapRows", value: function (t, r) { v(this, t), v(this, r); for (var e = 0; e < this.columns; e++) { var o = this.get(t, e); this.set(t, e, this.get(r, e)), this.set(r, e, o); } return this; }, }, { key: "getColumn", value: function (t) { y(this, t); for (var r = [], e = 0; e < this.rows; e++) r.push(this.get(e, t)); return r; }, }, { key: "getColumnVector", value: function (t) { return K.columnVector(this.getColumn(t)); }, }, { key: "setColumn", value: function (t, r) { y(this, t), (r = g(this, r)); for (var e = 0; e < this.rows; e++) this.set(e, t, r[e]); return this; }, }, { key: "swapColumns", value: function (t, r) { y(this, t), y(this, r); for (var e = 0; e < this.rows; e++) { var o = this.get(e, t); this.set(e, t, this.get(e, r)), this.set(e, r, o); } return this; }, }, { key: "addRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[e]); return this; }, }, { key: "subRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[e]); return this; }, }, { key: "mulRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[e]); return this; }, }, { key: "divRowVector", value: function (t) { t = m(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[e]); return this; }, }, { key: "addColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t[r]); return this; }, }, { key: "subColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t[r]); return this; }, }, { key: "mulColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t[r]); return this; }, }, { key: "divColumnVector", value: function (t) { t = g(this, t); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t[r]); return this; }, }, { key: "mulRow", value: function (t, r) { v(this, t); for (var e = 0; e < this.columns; e++) this.set(t, e, this.get(t, e) * r); return this; }, }, { key: "mulColumn", value: function (t, r) { y(this, t); for (var e = 0; e < this.rows; e++) this.set(e, t, this.get(e, t) * r); return this; }, }, { key: "max", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) > t && (t = this.get(r, e)); return t; }, }, { key: "maxIndex", value: function () { k(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) > t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "min", value: function () { if (this.isEmpty()) return NaN; for (var t = this.get(0, 0), r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.get(r, e) < t && (t = this.get(r, e)); return t; }, }, { key: "minIndex", value: function () { k(this); for ( var t = this.get(0, 0), r = [0, 0], e = 0; e < this.rows; e++ ) for (var o = 0; o < this.columns; o++) this.get(e, o) < t && ((t = this.get(e, o)), (r[0] = e), (r[1] = o)); return r; }, }, { key: "maxRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) > r && (r = this.get(t, e)); return r; }, }, { key: "maxRowIndex", value: function (t) { v(this, t), k(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) > r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "minRow", value: function (t) { if ((v(this, t), this.isEmpty())) return NaN; for (var r = this.get(t, 0), e = 1; e < this.columns; e++) this.get(t, e) < r && (r = this.get(t, e)); return r; }, }, { key: "minRowIndex", value: function (t) { v(this, t), k(this); for ( var r = this.get(t, 0), e = [t, 0], o = 1; o < this.columns; o++ ) this.get(t, o) < r && ((r = this.get(t, o)), (e[1] = o)); return e; }, }, { key: "maxColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) > r && (r = this.get(e, t)); return r; }, }, { key: "maxColumnIndex", value: function (t) { y(this, t), k(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) > r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "minColumn", value: function (t) { if ((y(this, t), this.isEmpty())) return NaN; for (var r = this.get(0, t), e = 1; e < this.rows; e++) this.get(e, t) < r && (r = this.get(e, t)); return r; }, }, { key: "minColumnIndex", value: function (t) { y(this, t), k(this); for ( var r = this.get(0, t), e = [0, t], o = 1; o < this.rows; o++ ) this.get(o, t) < r && ((r = this.get(o, t)), (e[0] = o)); return e; }, }, { key: "diag", value: function () { for ( var t = Math.min(this.rows, this.columns), r = [], e = 0; e < t; e++ ) r.push(this.get(e, e)); return r; }, }, { key: "norm", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "frobenius", r = 0; if ("max" === t) return this.max(); if ("frobenius" === t) { for (var e = 0; e < this.rows; e++) for (var o = 0; o < this.columns; o++) r += this.get(e, o) * this.get(e, o); return Math.sqrt(r); } throw new RangeError("unknown norm type: ".concat(t)); }, }, { key: "cumulativeSum", value: function () { for (var t = 0, r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) (t += this.get(r, e)), this.set(r, e, t); return this; }, }, { key: "dot", value: function (r) { t.isMatrix(r) && (r = r.to1DArray()); var e = this.to1DArray(); if (e.length !== r.length) throw new RangeError("vectors do not have the same size"); for (var o = 0, n = 0; n < e.length; n++) o += e[n] * r[n]; return o; }, }, { key: "mmul", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.columns, n = new K(r, o), i = new Float64Array(e), s = 0; s < o; s++ ) { for (var u = 0; u < e; u++) i[u] = t.get(u, s); for (var a = 0; a < r; a++) { for (var f = 0, c = 0; c < e; c++) f += this.get(a, c) * i[c]; n.set(a, s, f); } } return n; }, }, { key: "strassen2x2", value: function (t) { t = K.checkMatrix(t); var r = new K(2, 2), e = this.get(0, 0), o = t.get(0, 0), n = this.get(0, 1), i = t.get(0, 1), s = this.get(1, 0), u = t.get(1, 0), a = this.get(1, 1), f = t.get(1, 1), c = (e + a) * (o + f), h = (s + a) * o, l = e * (i - f), p = a * (u - o), v = (e + n) * f, y = c + p - v + (n - a) * (u + f), m = l + v, g = h + p, w = c - h + l + (s - e) * (o + i); return ( r.set(0, 0, y), r.set(0, 1, m), r.set(1, 0, g), r.set(1, 1, w), r ); }, }, { key: "strassen3x3", value: function (t) { t = K.checkMatrix(t); var r = new K(3, 3), e = this.get(0, 0), o = this.get(0, 1), n = this.get(0, 2), i = this.get(1, 0), s = this.get(1, 1), u = this.get(1, 2), a = this.get(2, 0), f = this.get(2, 1), c = this.get(2, 2), h = t.get(0, 0), l = t.get(0, 1), p = t.get(0, 2), v = t.get(1, 0), y = t.get(1, 1), m = t.get(1, 2), g = t.get(2, 0), w = t.get(2, 1), d = t.get(2, 2), b = (e - i) * (-l + y), M = (-e + i + s) * (h - l + y), x = (i + s) * (-h + l), S = e * h, k = (-e + a + f) * (h - p + m), E = (-e + a) * (p - m), O = (a + f) * (-h + p), R = (-n + f + c) * (y + g - w), j = (n - c) * (y - w), _ = n * g, P = (f + c) * (-g + w), T = (-n + s + u) * (m + g - d), A = (n - u) * (m - d), I = (s + u) * (-g + d), N = S + _ + o * v, C = (e + o + n - i - s - f - c) * y + M + x + S + R + _ + P, D = S + k + O + (e + o + n - s - u - a - f) * m + _ + T + I, V = b + s * (-h + l + v - y - m - g + d) + M + S + _ + T + A, q = b + M + x + S + u * w, F = _ + T + A + I + i * p, B = S + k + E + f * (-h + p + v - y - m - g + w) + R + j + _, z = R + j + _ + P + a * l, L = S + k + E + O + c * d; return ( r.set(0, 0, N), r.set(0, 1, C), r.set(0, 2, D), r.set(1, 0, V), r.set(1, 1, q), r.set(1, 2, F), r.set(2, 0, B), r.set(2, 1, z), r.set(2, 2, L), r ); }, }, { key: "mmulStrassen", value: function (r) { r = K.checkMatrix(r); var e = this.clone(), o = e.rows, n = e.columns, i = r.rows, s = r.columns; function u(r, e, o) { var n = r.rows, i = r.columns; if (n === e && i === o) return r; var s = t.zeros(e, o); return (s = s.setSubMatrix(r, 0, 0)); } n !== i && console.warn( "Multiplying " .concat(o, " x ") .concat(n, " and ") .concat(i, " x ") .concat(s, " matrix: dimensions do not match."), ); var a = Math.max(o, i), f = Math.max(n, s); return (function r(e, o, n, i) { if (n <= 512 || i <= 512) return e.mmul(o); n % 2 == 1 && i % 2 == 1 ? ((e = u(e, n + 1, i + 1)), (o = u(o, n + 1, i + 1))) : n % 2 == 1 ? ((e = u(e, n + 1, i)), (o = u(o, n + 1, i))) : i % 2 == 1 && ((e = u(e, n, i + 1)), (o = u(o, n, i + 1))); var s = parseInt(e.rows / 2, 10), a = parseInt(e.columns / 2, 10), f = e.subMatrix(0, s - 1, 0, a - 1), c = o.subMatrix(0, s - 1, 0, a - 1), h = e.subMatrix(0, s - 1, a, e.columns - 1), l = o.subMatrix(0, s - 1, a, o.columns - 1), p = e.subMatrix(s, e.rows - 1, 0, a - 1), v = o.subMatrix(s, o.rows - 1, 0, a - 1), y = e.subMatrix(s, e.rows - 1, a, e.columns - 1), m = o.subMatrix(s, o.rows - 1, a, o.columns - 1), g = r(t.add(f, y), t.add(c, m), s, a), w = r(t.add(p, y), c, s, a), d = r(f, t.sub(l, m), s, a), b = r(y, t.sub(v, c), s, a), M = r(t.add(f, h), m, s, a), x = r(t.sub(p, f), t.add(c, l), s, a), S = r(t.sub(h, y), t.add(v, m), s, a), k = t.add(g, b); k.sub(M), k.add(S); var E = t.add(d, M), O = t.add(w, b), R = t.sub(g, w); R.add(d), R.add(x); var j = t.zeros(2 * k.rows, 2 * k.columns); return (j = (j = (j = (j = j.setSubMatrix( k, 0, 0, )).setSubMatrix(E, k.rows, 0)).setSubMatrix( O, 0, k.columns, )).setSubMatrix(R, k.rows, k.columns)).subMatrix( 0, n - 1, 0, i - 1, ); })((e = u(e, a, f)), (r = u(r, a, f)), a, f); }, }, { key: "scaleRows", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.rows; s++ ) { var a = this.getRow(s); a.length > 0 && u(a, { min: e, max: n, output: a }), i.setRow(s, a); } return i; }, }, { key: "scaleColumns", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if ("object" !== z(t)) throw new TypeError("options must be an object"); var r = t.min, e = void 0 === r ? 0 : r, o = t.max, n = void 0 === o ? 1 : o; if (!Number.isFinite(e)) throw new TypeError("min must be a number"); if (!Number.isFinite(n)) throw new TypeError("max must be a number"); if (e >= n) throw new RangeError("min must be smaller than max"); for ( var i = new K(this.rows, this.columns), s = 0; s < this.columns; s++ ) { var a = this.getColumn(s); a.length && u(a, { min: e, max: n, output: a }), i.setColumn(s, a); } return i; }, }, { key: "flipRows", value: function () { for ( var t = Math.ceil(this.columns / 2), r = 0; r < this.rows; r++ ) for (var e = 0; e < t; e++) { var o = this.get(r, e), n = this.get(r, this.columns - 1 - e); this.set(r, e, n), this.set(r, this.columns - 1 - e, o); } return this; }, }, { key: "flipColumns", value: function () { for ( var t = Math.ceil(this.rows / 2), r = 0; r < this.columns; r++ ) for (var e = 0; e < t; e++) { var o = this.get(e, r), n = this.get(this.rows - 1 - e, r); this.set(e, r, n), this.set(this.rows - 1 - e, r, o); } return this; }, }, { key: "kroneckerProduct", value: function (t) { t = K.checkMatrix(t); for ( var r = this.rows, e = this.columns, o = t.rows, n = t.columns, i = new K(r * o, e * n), s = 0; s < r; s++ ) for (var u = 0; u < e; u++) for (var a = 0; a < o; a++) for (var f = 0; f < n; f++) i.set( o * s + a, n * u + f, this.get(s, u) * t.get(a, f), ); return i; }, }, { key: "kroneckerSum", value: function (t) { if ( ((t = K.checkMatrix(t)), !this.isSquare() || !t.isSquare()) ) throw new Error("Kronecker Sum needs two Square Matrices"); var r = this.rows, e = t.rows, o = this.kroneckerProduct(K.eye(e, e)), n = K.eye(r, r).kroneckerProduct(t); return o.add(n); }, }, { key: "transpose", value: function () { for ( var t = new K(this.columns, this.rows), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(e, r, this.get(r, e)); return t; }, }, { key: "sortRows", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.rows; r++ ) this.setRow(r, this.getRow(r).sort(t)); return this; }, }, { key: "sortColumns", value: function () { for ( var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : J, r = 0; r < this.columns; r++ ) this.setColumn(r, this.getColumn(r).sort(t)); return this; }, }, { key: "subMatrix", value: function (t, r, e, o) { M(this, t, r, e, o); for (var n = new K(r - t + 1, o - e + 1), i = t; i <= r; i++) for (var s = e; s <= o; s++) n.set(i - t, s - e, this.get(i, s)); return n; }, }, { key: "subMatrixRow", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.columns - 1), r > e || r < 0 || r >= this.columns || e < 0 || e >= this.columns) ) throw new RangeError("Argument out of range"); for ( var o = new K(t.length, e - r + 1), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.rows) throw new RangeError( "Row index out of range: ".concat(t[n]), ); o.set(n, i - r, this.get(t[n], i)); } return o; }, }, { key: "subMatrixColumn", value: function (t, r, e) { if ( (void 0 === r && (r = 0), void 0 === e && (e = this.rows - 1), r > e || r < 0 || r >= this.rows || e < 0 || e >= this.rows) ) throw new RangeError("Argument out of range"); for ( var o = new K(e - r + 1, t.length), n = 0; n < t.length; n++ ) for (var i = r; i <= e; i++) { if (t[n] < 0 || t[n] >= this.columns) throw new RangeError( "Column index out of range: ".concat(t[n]), ); o.set(i - r, n, this.get(i, t[n])); } return o; }, }, { key: "setSubMatrix", value: function (t, r, e) { if ((t = K.checkMatrix(t)).isEmpty()) return this; M(this, r, r + t.rows - 1, e, e + t.columns - 1); for (var o = 0; o < t.rows; o++) for (var n = 0; n < t.columns; n++) this.set(r + o, e + n, t.get(o, n)); return this; }, }, { key: "selection", value: function (t, r) { for ( var e = w(this, t, r), o = new K(t.length, r.length), n = 0; n < e.row.length; n++ ) for (var i = e.row[n], s = 0; s < e.column.length; s++) { var u = e.column[s]; o.set(n, s, this.get(i, u)); } return o; }, }, { key: "trace", value: function () { for ( var t = Math.min(this.rows, this.columns), r = 0, e = 0; e < t; e++ ) r += this.get(e, e); return r; }, }, { key: "clone", value: function () { for ( var t = new K(this.rows, this.columns), r = 0; r < this.rows; r++ ) for (var e = 0; e < this.columns; e++) t.set(r, e, this.get(r, e)); return t; }, }, { key: "sum", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] += t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] += t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 0, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r += t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "product", value: function (t) { switch (t) { case "row": return (function (t) { for (var r = x(t.rows, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[e] *= t.get(e, o); return r; })(this); case "column": return (function (t) { for (var r = x(t.columns, 1), e = 0; e < t.rows; ++e) for (var o = 0; o < t.columns; ++o) r[o] *= t.get(e, o); return r; })(this); case void 0: return (function (t) { for (var r = 1, e = 0; e < t.rows; e++) for (var o = 0; o < t.columns; o++) r *= t.get(e, o); return r; })(this); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "mean", value: function (t) { var r = this.sum(t); switch (t) { case "row": for (var e = 0; e < this.rows; e++) r[e] /= this.columns; return r; case "column": for (var o = 0; o < this.columns; o++) r[o] /= this.rows; return r; case void 0: return r / this.size; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "variance", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.unbiased, n = void 0 === o || o, i = e.mean, s = void 0 === i ? this.mean(t) : i; if ("boolean" != typeof n) throw new TypeError("unbiased must be a boolean"); switch (t) { case "row": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return E(this, n, s); case "column": if (!Array.isArray(s)) throw new TypeError("mean must be an array"); return O(this, n, s); case void 0: if ("number" != typeof s) throw new TypeError("mean must be a number"); return R(this, n, s); default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "standardDeviation", value: function (t, r) { "object" === z(t) && ((r = t), (t = void 0)); var e = this.variance(t, r); if (void 0 === t) return Math.sqrt(e); for (var o = 0; o < e.length; o++) e[o] = Math.sqrt(e[o]); return e; }, }, { key: "center", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r, o = e.center, n = void 0 === o ? this.mean(t) : o; switch (t) { case "row": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return j(this, n), this; case "column": if (!Array.isArray(n)) throw new TypeError("center must be an array"); return _(this, n), this; case void 0: if ("number" != typeof n) throw new TypeError("center must be a number"); return P(this, n), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "scale", value: function (t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ( ("object" === z(t) && ((r = t), (t = void 0)), "object" !== z(r)) ) throw new TypeError("options must be an object"); var e = r.scale; switch (t) { case "row": if (void 0 === e) e = T(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return A(this, e), this; case "column": if (void 0 === e) e = I(this); else if (!Array.isArray(e)) throw new TypeError("scale must be an array"); return N(this, e), this; case void 0: if (void 0 === e) e = C(this); else if ("number" != typeof e) throw new TypeError("scale must be a number"); return D(this, e), this; default: throw new Error("invalid option: ".concat(t)); } }, }, { key: "toString", value: function (t) { return c(this, t); }, }, ], [ { key: "from1DArray", value: function (t, r, e) { if (t * r !== e.length) throw new RangeError( "data length does not match given dimensions", ); for (var o = new K(t, r), n = 0; n < t; n++) for (var i = 0; i < r; i++) o.set(n, i, e[n * r + i]); return o; }, }, { key: "rowVector", value: function (t) { for (var r = new K(1, t.length), e = 0; e < t.length; e++) r.set(0, e, t[e]); return r; }, }, { key: "columnVector", value: function (t) { for (var r = new K(t.length, 1), e = 0; e < t.length; e++) r.set(e, 0, t[e]); return r; }, }, { key: "zeros", value: function (t, r) { return new K(t, r); }, }, { key: "ones", value: function (t, r) { return new K(t, r).fill(1); }, }, { key: "rand", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== z(e)) throw new TypeError("options must be an object"); for ( var o = e.random, n = void 0 === o ? Math.random : o, i = new K(t, r), s = 0; s < t; s++ ) for (var u = 0; u < r; u++) i.set(s, u, n()); return i; }, }, { key: "randInt", value: function (t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; if ("object" !== z(e)) throw new TypeError("options must be an object"); var o = e.min, n = void 0 === o ? 0 : o, i = e.max, s = void 0 === i ? 1e3 : i, u = e.random, a = void 0 === u ? Math.random : u; if (!Number.isInteger(n)) throw new TypeError("min must be an integer"); if (!Number.isInteger(s)) throw new TypeError("max must be an integer"); if (n >= s) throw new RangeError("min must be smaller than max"); for (var f = s - n, c = new K(t, r), h = 0; h < t; h++) for (var l = 0; l < r; l++) { var p = n + Math.round(a() * f); c.set(h, l, p); } return c; }, }, { key: "eye", value: function (t, r, e) { void 0 === r && (r = t), void 0 === e && (e = 1); for ( var o = Math.min(t, r), n = this.zeros(t, r), i = 0; i < o; i++ ) n.set(i, i, e); return n; }, }, { key: "diag", value: function (t, r, e) { var o = t.length; void 0 === r && (r = o), void 0 === e && (e = r); for ( var n = Math.min(o, r, e), i = this.zeros(r, e), s = 0; s < n; s++ ) i.set(s, s, t[s]); return i; }, }, { key: "min", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new K(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.min(t.get(i, s), r.get(i, s))); return n; }, }, { key: "max", value: function (t, r) { (t = this.checkMatrix(t)), (r = this.checkMatrix(r)); for ( var e = t.rows, o = t.columns, n = new this(e, o), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) n.set(i, s, Math.max(t.get(i, s), r.get(i, s))); return n; }, }, { key: "checkMatrix", value: function (r) { return t.isMatrix(r) ? r : new K(r); }, }, { key: "isMatrix", value: function (t) { return null != t && "Matrix" === t.klass; }, }, ], ), t ); })(); function J(t, r) { return t - r; } (Q.prototype.klass = "Matrix"), "undefined" != typeof Symbol && (Q.prototype[Symbol.for("nodejs.util.inspect.custom")] = function () { return c(this); }), (Q.random = Q.rand), (Q.randomInt = Q.randInt), (Q.diagonal = Q.diag), (Q.prototype.diagonal = Q.prototype.diag), (Q.identity = Q.eye), (Q.prototype.negate = Q.prototype.neg), (Q.prototype.tensorProduct = Q.prototype.kroneckerProduct); var H, Y, K = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && V(t, r); })(e, t); var r = q(e); function e(t, o) { var n; if ((L(this, e), (n = r.call(this)), e.isMatrix(t))) return F(n, t.clone()); if (Number.isInteger(t) && t >= 0) { if (((n.data = []), !(Number.isInteger(o) && o >= 0))) throw new TypeError("nColumns must be a positive integer"); for (var i = 0; i < t; i++) n.data.push(new Float64Array(o)); } else { if (!Array.isArray(t)) throw new TypeError( "First argument must be a positive number or an array", ); var s = t; if ("number" != typeof (o = (t = s.length) ? s[0].length : 0)) throw new TypeError( "Data must be a 2D array with at least one element", ); n.data = []; for (var u = 0; u < t; u++) { if (s[u].length !== o) throw new RangeError("Inconsistent array dimensions"); n.data.push(Float64Array.from(s[u])); } } return (n.rows = t), (n.columns = o), n; } return ( W(e, [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, { key: "removeRow", value: function (t) { return ( v(this, t), this.data.splice(t, 1), (this.rows -= 1), this ); }, }, { key: "addRow", value: function (t, r) { return ( void 0 === r && ((r = t), (t = this.rows)), v(this, t, !0), (r = Float64Array.from(m(this, r))), this.data.splice(t, 0, r), (this.rows += 1), this ); }, }, { key: "removeColumn", value: function (t) { y(this, t); for (var r = 0; r < this.rows; r++) { for ( var e = new Float64Array(this.columns - 1), o = 0; o < t; o++ ) e[o] = this.data[r][o]; for (var n = t + 1; n < this.columns; n++) e[n - 1] = this.data[r][n]; this.data[r] = e; } return (this.columns -= 1), this; }, }, { key: "addColumn", value: function (t, r) { void 0 === r && ((r = t), (t = this.columns)), y(this, t, !0), (r = g(this, r)); for (var e = 0; e < this.rows; e++) { for ( var o = new Float64Array(this.columns + 1), n = 0; n < t; n++ ) o[n] = this.data[e][n]; for (o[n++] = r[e]; n < this.columns + 1; n++) o[n] = this.data[e][n - 1]; this.data[e] = o; } return (this.columns += 1), this; }, }, ]), e ); })(Q); function X(t) { return (X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function G(t, r) { return (G = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Z(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = tt(t); if (r) { var n = tt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return $(this, e); }; } function $(t, r) { return !r || ("object" !== X(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function tt(t) { return (tt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } (Y = K), ((H = Q).prototype.add = function (t) { return "number" == typeof t ? this.addS(t) : this.addM(t); }), (H.prototype.addS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t); return this; }), (H.prototype.addM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) + t.get(r, e)); return this; }), (H.add = function (t, r) { return new Y(t).add(r); }), (H.prototype.sub = function (t) { return "number" == typeof t ? this.subS(t) : this.subM(t); }), (H.prototype.subS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t); return this; }), (H.prototype.subM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) - t.get(r, e)); return this; }), (H.sub = function (t, r) { return new Y(t).sub(r); }), (H.prototype.subtract = H.prototype.sub), (H.prototype.subtractS = H.prototype.subS), (H.prototype.subtractM = H.prototype.subM), (H.subtract = H.sub), (H.prototype.mul = function (t) { return "number" == typeof t ? this.mulS(t) : this.mulM(t); }), (H.prototype.mulS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t); return this; }), (H.prototype.mulM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) * t.get(r, e)); return this; }), (H.mul = function (t, r) { return new Y(t).mul(r); }), (H.prototype.multiply = H.prototype.mul), (H.prototype.multiplyS = H.prototype.mulS), (H.prototype.multiplyM = H.prototype.mulM), (H.multiply = H.mul), (H.prototype.div = function (t) { return "number" == typeof t ? this.divS(t) : this.divM(t); }), (H.prototype.divS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t); return this; }), (H.prototype.divM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) / t.get(r, e)); return this; }), (H.div = function (t, r) { return new Y(t).div(r); }), (H.prototype.divide = H.prototype.div), (H.prototype.divideS = H.prototype.divS), (H.prototype.divideM = H.prototype.divM), (H.divide = H.div), (H.prototype.mod = function (t) { return "number" == typeof t ? this.modS(t) : this.modM(t); }), (H.prototype.modS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t); return this; }), (H.prototype.modM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) % t.get(r, e)); return this; }), (H.mod = function (t, r) { return new Y(t).mod(r); }), (H.prototype.modulus = H.prototype.mod), (H.prototype.modulusS = H.prototype.modS), (H.prototype.modulusM = H.prototype.modM), (H.modulus = H.mod), (H.prototype.and = function (t) { return "number" == typeof t ? this.andS(t) : this.andM(t); }), (H.prototype.andS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t); return this; }), (H.prototype.andM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) & t.get(r, e)); return this; }), (H.and = function (t, r) { return new Y(t).and(r); }), (H.prototype.or = function (t) { return "number" == typeof t ? this.orS(t) : this.orM(t); }), (H.prototype.orS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t); return this; }), (H.prototype.orM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) | t.get(r, e)); return this; }), (H.or = function (t, r) { return new Y(t).or(r); }), (H.prototype.xor = function (t) { return "number" == typeof t ? this.xorS(t) : this.xorM(t); }), (H.prototype.xorS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t); return this; }), (H.prototype.xorM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) ^ t.get(r, e)); return this; }), (H.xor = function (t, r) { return new Y(t).xor(r); }), (H.prototype.leftShift = function (t) { return "number" == typeof t ? this.leftShiftS(t) : this.leftShiftM(t); }), (H.prototype.leftShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t); return this; }), (H.prototype.leftShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) << t.get(r, e)); return this; }), (H.leftShift = function (t, r) { return new Y(t).leftShift(r); }), (H.prototype.signPropagatingRightShift = function (t) { return "number" == typeof t ? this.signPropagatingRightShiftS(t) : this.signPropagatingRightShiftM(t); }), (H.prototype.signPropagatingRightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t); return this; }), (H.prototype.signPropagatingRightShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >> t.get(r, e)); return this; }), (H.signPropagatingRightShift = function (t, r) { return new Y(t).signPropagatingRightShift(r); }), (H.prototype.rightShift = function (t) { return "number" == typeof t ? this.rightShiftS(t) : this.rightShiftM(t); }), (H.prototype.rightShiftS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t); return this; }), (H.prototype.rightShiftM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, this.get(r, e) >>> t.get(r, e)); return this; }), (H.rightShift = function (t, r) { return new Y(t).rightShift(r); }), (H.prototype.zeroFillRightShift = H.prototype.rightShift), (H.prototype.zeroFillRightShiftS = H.prototype.rightShiftS), (H.prototype.zeroFillRightShiftM = H.prototype.rightShiftM), (H.zeroFillRightShift = H.rightShift), (H.prototype.not = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, ~this.get(t, r)); return this; }), (H.not = function (t) { return new Y(t).not(); }), (H.prototype.abs = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.abs(this.get(t, r))); return this; }), (H.abs = function (t) { return new Y(t).abs(); }), (H.prototype.acos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acos(this.get(t, r))); return this; }), (H.acos = function (t) { return new Y(t).acos(); }), (H.prototype.acosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.acosh(this.get(t, r))); return this; }), (H.acosh = function (t) { return new Y(t).acosh(); }), (H.prototype.asin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asin(this.get(t, r))); return this; }), (H.asin = function (t) { return new Y(t).asin(); }), (H.prototype.asinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.asinh(this.get(t, r))); return this; }), (H.asinh = function (t) { return new Y(t).asinh(); }), (H.prototype.atan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atan(this.get(t, r))); return this; }), (H.atan = function (t) { return new Y(t).atan(); }), (H.prototype.atanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.atanh(this.get(t, r))); return this; }), (H.atanh = function (t) { return new Y(t).atanh(); }), (H.prototype.cbrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cbrt(this.get(t, r))); return this; }), (H.cbrt = function (t) { return new Y(t).cbrt(); }), (H.prototype.ceil = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.ceil(this.get(t, r))); return this; }), (H.ceil = function (t) { return new Y(t).ceil(); }), (H.prototype.clz32 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.clz32(this.get(t, r))); return this; }), (H.clz32 = function (t) { return new Y(t).clz32(); }), (H.prototype.cos = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cos(this.get(t, r))); return this; }), (H.cos = function (t) { return new Y(t).cos(); }), (H.prototype.cosh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.cosh(this.get(t, r))); return this; }), (H.cosh = function (t) { return new Y(t).cosh(); }), (H.prototype.exp = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.exp(this.get(t, r))); return this; }), (H.exp = function (t) { return new Y(t).exp(); }), (H.prototype.expm1 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.expm1(this.get(t, r))); return this; }), (H.expm1 = function (t) { return new Y(t).expm1(); }), (H.prototype.floor = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.floor(this.get(t, r))); return this; }), (H.floor = function (t) { return new Y(t).floor(); }), (H.prototype.fround = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.fround(this.get(t, r))); return this; }), (H.fround = function (t) { return new Y(t).fround(); }), (H.prototype.log = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log(this.get(t, r))); return this; }), (H.log = function (t) { return new Y(t).log(); }), (H.prototype.log1p = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log1p(this.get(t, r))); return this; }), (H.log1p = function (t) { return new Y(t).log1p(); }), (H.prototype.log10 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log10(this.get(t, r))); return this; }), (H.log10 = function (t) { return new Y(t).log10(); }), (H.prototype.log2 = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.log2(this.get(t, r))); return this; }), (H.log2 = function (t) { return new Y(t).log2(); }), (H.prototype.round = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.round(this.get(t, r))); return this; }), (H.round = function (t) { return new Y(t).round(); }), (H.prototype.sign = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sign(this.get(t, r))); return this; }), (H.sign = function (t) { return new Y(t).sign(); }), (H.prototype.sin = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sin(this.get(t, r))); return this; }), (H.sin = function (t) { return new Y(t).sin(); }), (H.prototype.sinh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sinh(this.get(t, r))); return this; }), (H.sinh = function (t) { return new Y(t).sinh(); }), (H.prototype.sqrt = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.sqrt(this.get(t, r))); return this; }), (H.sqrt = function (t) { return new Y(t).sqrt(); }), (H.prototype.tan = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tan(this.get(t, r))); return this; }), (H.tan = function (t) { return new Y(t).tan(); }), (H.prototype.tanh = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.tanh(this.get(t, r))); return this; }), (H.tanh = function (t) { return new Y(t).tanh(); }), (H.prototype.trunc = function () { for (var t = 0; t < this.rows; t++) for (var r = 0; r < this.columns; r++) this.set(t, r, Math.trunc(this.get(t, r))); return this; }), (H.trunc = function (t) { return new Y(t).trunc(); }), (H.pow = function (t, r) { return new Y(t).pow(r); }), (H.prototype.pow = function (t) { return "number" == typeof t ? this.powS(t) : this.powM(t); }), (H.prototype.powS = function (t) { for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t)); return this; }), (H.prototype.powM = function (t) { if ( ((t = Y.checkMatrix(t)), this.rows !== t.rows || this.columns !== t.columns) ) throw new RangeError("Matrices dimensions must be equal"); for (var r = 0; r < this.rows; r++) for (var e = 0; e < this.columns; e++) this.set(r, e, Math.pow(this.get(r, e), t.get(r, e))); return this; }); var rt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && G(t, r); })(e, t); var r = Z(e); function e(t, o, n) { var i; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, e), ((i = r.call(this)).matrix = t), (i.rows = o), (i.columns = n), i ); } return e; })(Q); function et(t) { return (et = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ot(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function nt(t, r) { return (nt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function it(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = ut(t); if (r) { var n = ut(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return st(this, e); }; } function st(t, r) { return !r || ("object" !== et(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function ut(t) { return (ut = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var at = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && nt(t, r); })(i, t); var r, e, o, n = it(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), y(t, r), ((e = n.call(this, t, t.rows, 1)).column = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.column, e), this; }, }, { key: "get", value: function (t) { return this.matrix.get(t, this.column); }, }, ]) && ot(r.prototype, e), o && ot(r, o), i ); })(rt); function ft(t) { return (ft = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ct(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function ht(t, r) { return (ht = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function lt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = vt(t); if (r) { var n = vt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return pt(this, e); }; } function pt(t, r) { return !r || ("object" !== ft(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function vt(t) { return (vt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var yt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && ht(t, r); })(i, t); var r, e, o, n = lt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = b(t, r)), ((e = n.call(this, t, t.rows, r.length)).columnIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columnIndices[r], e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columnIndices[r]); }, }, ]) && ct(r.prototype, e), o && ct(r, o), i ); })(rt); function mt(t) { return (mt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function gt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function wt(t, r) { return (wt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function dt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Mt(t); if (r) { var n = Mt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return bt(this, e); }; } function bt(t, r) { return !r || ("object" !== mt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Mt(t) { return (Mt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && wt(t, r); })(i, t); var r, e, o, n = dt(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(t, this.columns - r - 1, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(t, this.columns - r - 1); }, }, ]) && gt(r.prototype, e), o && gt(r, o), i ); })(rt); function St(t) { return (St = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function kt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Et(t, r) { return (Et = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ot(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = jt(t); if (r) { var n = jt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Rt(this, e); }; } function Rt(t, r) { return !r || ("object" !== St(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function jt(t) { return (jt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var _t = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Et(t, r); })(i, t); var r, e, o, n = Ot(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.rows, t.columns) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rows - t - 1, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rows - t - 1, r); }, }, ]) && kt(r.prototype, e), o && kt(r, o), i ); })(rt); function Pt(t) { return (Pt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Tt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function At(t, r) { return (At = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function It(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Ct(t); if (r) { var n = Ct(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Nt(this, e); }; } function Nt(t, r) { return !r || ("object" !== Pt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Dt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && At(t, r); })(i, t); var r, e, o, n = It(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), v(t, r), ((e = n.call(this, t, 1, t.columns)).row = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.row, r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.row, r); }, }, ]) && Tt(r.prototype, e), o && Tt(r, o), i ); })(rt); function Vt(t) { return (Vt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Ft(t, r) { return (Ft = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Bt(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Lt(t); if (r) { var n = Lt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return zt(this, e); }; } function zt(t, r) { return !r || ("object" !== Vt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Lt(t) { return (Lt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Ut = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Ft(t, r); })(i, t); var r, e, o, n = Bt(i); function i(t, r) { var e; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), (r = d(t, r)), ((e = n.call(this, t, r.length, t.columns)).rowIndices = r), e ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(this.rowIndices[t], r, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.rowIndices[t], r); }, }, ]) && qt(r.prototype, e), o && qt(r, o), i ); })(rt); function Wt(t) { return (Wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Jt(t, r) { return (Jt = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function Ht(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = Kt(t); if (r) { var n = Kt(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Yt(this, e); }; } function Yt(t, r) { return !r || ("object" !== Wt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function Kt(t) { return (Kt = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Xt = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Jt(t, r); })(i, t); var r, e, o, n = Ht(i); function i(t, r, e) { var o; !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i); var s = w(t, r, e); return ( ((o = n.call(this, t, s.row.length, s.column.length)).rowIndices = s.row), (o.columnIndices = s.column), o ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.rowIndices[t], this.columnIndices[r], e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get( this.rowIndices[t], this.columnIndices[r], ); }, }, ]) && Qt(r.prototype, e), o && Qt(r, o), i ); })(rt); function Gt(t) { return (Gt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Zt(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function $t(t, r) { return ($t = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function tr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = er(t); if (r) { var n = er(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return rr(this, e); }; } function rr(t, r) { return !r || ("object" !== Gt(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function er(t) { return (er = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var or = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && $t(t, r); })(i, t); var r, e, o, n = tr(i); function i(t, r, e, o, s) { var u; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), M(t, r, e, o, s), ((u = n.call(this, t, e - r + 1, s - o + 1)).startRow = r), (u.startColumn = o), u ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return ( this.matrix.set(this.startRow + t, this.startColumn + r, e), this ); }, }, { key: "get", value: function (t, r) { return this.matrix.get(this.startRow + t, this.startColumn + r); }, }, ]) && Zt(r.prototype, e), o && Zt(r, o), i ); })(rt); function nr(t) { return (nr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function sr(t, r) { return (sr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function ur(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = fr(t); if (r) { var n = fr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return ar(this, e); }; } function ar(t, r) { return !r || ("object" !== nr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function fr(t) { return (fr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var cr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && sr(t, r); })(i, t); var r, e, o, n = ur(i); function i(t) { return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), n.call(this, t, t.columns, t.rows) ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return this.matrix.set(r, t, e), this; }, }, { key: "get", value: function (t, r) { return this.matrix.get(r, t); }, }, ]) && ir(r.prototype, e), o && ir(r, o), i ); })(rt); function hr(t) { return (hr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function lr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function vr(t, r) { return (vr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function yr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = gr(t); if (r) { var n = gr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return mr(this, e); }; } function mr(t, r) { return !r || ("object" !== hr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function gr(t) { return (gr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var wr = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && vr(t, r); })(i, t); var r, e, o, n = yr(i); function i(t) { var r, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; lr(this, i); var o = e.rows, s = void 0 === o ? 1 : o; if (t.length % s != 0) throw new Error( "the data length is not divisible by the number of rows", ); return ( ((r = n.call(this)).rows = s), (r.columns = t.length / s), (r.data = t), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { var o = this._calculateIndex(t, r); return (this.data[o] = e), this; }, }, { key: "get", value: function (t, r) { var e = this._calculateIndex(t, r); return this.data[e]; }, }, { key: "_calculateIndex", value: function (t, r) { return t * this.columns + r; }, }, ]) && pr(r.prototype, e), o && pr(r, o), i ); })(Q); function dr(t) { return (dr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function br(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } function Mr(t, r) { return (Mr = Object.setPrototypeOf || function (t, r) { return (t.__proto__ = r), t; })(t, r); } function xr(t) { var r = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })(); return function () { var e, o = kr(t); if (r) { var n = kr(this).constructor; e = Reflect.construct(o, arguments, n); } else e = o.apply(this, arguments); return Sr(this, e); }; } function Sr(t, r) { return !r || ("object" !== dr(r) && "function" != typeof r) ? (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t) : r; } function kr(t) { return (kr = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Er = (function (t) { !(function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), r && Mr(t, r); })(i, t); var r, e, o, n = xr(i); function i(t) { var r; return ( (function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, i), ((r = n.call(this)).data = t), (r.rows = t.length), (r.columns = t[0].length), r ); } return ( (r = i), (e = [ { key: "set", value: function (t, r, e) { return (this.data[t][r] = e), this; }, }, { key: "get", value: function (t, r) { return this.data[t][r]; }, }, ]) && br(r.prototype, e), o && br(r, o), i ); })(Q); function Or(t, r) { if (Array.isArray(t)) return t[0] && Array.isArray(t[0]) ? new Er(t) : new wr(t, r); throw new Error("the argument is not an array"); } function Rr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var jr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s, u, a, f, c, h = (r = Er.checkMatrix(r)).clone(), l = h.rows, p = h.columns, v = new Float64Array(l), y = 1; for (e = 0; e < l; e++) v[e] = e; for (f = new Float64Array(l), o = 0; o < p; o++) { for (e = 0; e < l; e++) f[e] = h.get(e, o); for (e = 0; e < l; e++) { for (c = Math.min(e, o), s = 0, n = 0; n < c; n++) s += h.get(e, n) * f[n]; (f[e] -= s), h.set(e, o, f[e]); } for (i = o, e = o + 1; e < l; e++) Math.abs(f[e]) > Math.abs(f[i]) && (i = e); if (i !== o) { for (n = 0; n < p; n++) (u = h.get(i, n)), h.set(i, n, h.get(o, n)), h.set(o, n, u); (a = v[i]), (v[i] = v[o]), (v[o] = a), (y = -y); } if (o < l && 0 !== h.get(o, o)) for (e = o + 1; e < l; e++) h.set(e, o, h.get(e, o) / h.get(o, o)); } (this.LU = h), (this.pivotVector = v), (this.pivotSign = y); } var r, e, o; return ( (r = t), (e = [ { key: "isSingular", value: function () { for (var t = this.LU, r = t.columns, e = 0; e < r; e++) if (0 === t.get(e, e)) return !0; return !1; }, }, { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.LU; if (r.rows !== t.rows) throw new Error("Invalid matrix dimensions"); if (this.isSingular()) throw new Error("LU matrix is singular"); var e, o, n, i = t.columns, s = t.subMatrixRow(this.pivotVector, 0, i - 1), u = r.columns; for (n = 0; n < u; n++) for (e = n + 1; e < u; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); for (n = u - 1; n >= 0; n--) { for (o = 0; o < i; o++) s.set(n, o, s.get(n, o) / r.get(n, n)); for (e = 0; e < n; e++) for (o = 0; o < i; o++) s.set(e, o, s.get(e, o) - s.get(n, o) * r.get(e, n)); } return s; }, }, { key: "determinant", get: function () { var t = this.LU; if (!t.isSquare()) throw new Error("Matrix must be square"); for (var r = this.pivotSign, e = t.columns, o = 0; o < e; o++) r *= t.get(o, o); return r; }, }, { key: "lowerTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n > i ? o.set(n, i, t.get(n, i)) : n === i ? o.set(n, i, 1) : o.set(n, i, 0); return o; }, }, { key: "upperTriangularMatrix", get: function () { for ( var t = this.LU, r = t.rows, e = t.columns, o = new K(r, e), n = 0; n < r; n++ ) for (var i = 0; i < e; i++) n <= i ? o.set(n, i, t.get(n, i)) : o.set(n, i, 0); return o; }, }, { key: "pivotPermutationVector", get: function () { return Array.from(this.pivotVector); }, }, ]) && Rr(r.prototype, e), o && Rr(r, o), t ); })(); function _r(t, r) { var e = 0; return Math.abs(t) > Math.abs(r) ? ((e = r / t), Math.abs(t) * Math.sqrt(1 + e * e)) : 0 !== r ? ((e = t / r), Math.abs(r) * Math.sqrt(1 + e * e)) : 0; } function Pr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Tr = (function () { function t(r) { !(function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t); var e, o, n, i, s = (r = Er.checkMatrix(r)).clone(), u = r.rows, a = r.columns, f = new Float64Array(a); for (n = 0; n < a; n++) { var c = 0; for (e = n; e < u; e++) c = _r(c, s.get(e, n)); if (0 !== c) { for (s.get(n, n) < 0 && (c = -c), e = n; e < u; e++) s.set(e, n, s.get(e, n) / c); for (s.set(n, n, s.get(n, n) + 1), o = n + 1; o < a; o++) { for (i = 0, e = n; e < u; e++) i += s.get(e, n) * s.get(e, o); for (i = -i / s.get(n, n), e = n; e < u; e++) s.set(e, o, s.get(e, o) + i * s.get(e, n)); } } f[n] = -c; } (this.QR = s), (this.Rdiag = f); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { t = K.checkMatrix(t); var r = this.QR, e = r.rows; if (t.rows !== e) throw new Error("Matrix row dimensions must agree"); if (!this.isFullRank()) throw new Error("Matrix is rank deficient"); var o, n, i, s, u = t.columns, a = t.clone(), f = r.columns; for (i = 0; i < f; i++) for (n = 0; n < u; n++) { for (s = 0, o = i; o < e; o++) s += r.get(o, i) * a.get(o, n); for (s = -s / r.get(i, i), o = i; o < e; o++) a.set(o, n, a.get(o, n) + s * r.get(o, i)); } for (i = f - 1; i >= 0; i--) { for (n = 0; n < u; n++) a.set(i, n, a.get(i, n) / this.Rdiag[i]); for (o = 0; o < i; o++) for (n = 0; n < u; n++) a.set(o, n, a.get(o, n) - a.get(i, n) * r.get(o, i)); } return a.subMatrix(0, f - 1, 0, u - 1); }, }, { key: "isFullRank", value: function () { for (var t = this.QR.columns, r = 0; r < t; r++) if (0 === this.Rdiag[r]) return !1; return !0; }, }, { key: "upperTriangularMatrix", get: function () { var t, r, e = this.QR, o = e.columns, n = new K(o, o); for (t = 0; t < o; t++) for (r = 0; r < o; r++) t < r ? n.set(t, r, e.get(t, r)) : t === r ? n.set(t, r, this.Rdiag[t]) : n.set(t, r, 0); return n; }, }, { key: "orthogonalMatrix", get: function () { var t, r, e, o, n = this.QR, i = n.rows, s = n.columns, u = new K(i, s); for (e = s - 1; e >= 0; e--) { for (t = 0; t < i; t++) u.set(t, e, 0); for (u.set(e, e, 1), r = e; r < s; r++) if (0 !== n.get(e, e)) { for (o = 0, t = e; t < i; t++) o += n.get(t, e) * u.get(t, r); for (o = -o / n.get(e, e), t = e; t < i; t++) u.set(t, r, u.get(t, r) + o * n.get(t, e)); } } return u; }, }, ]) && Pr(r.prototype, e), o && Pr(r, o), t ); })(); function Ar(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Ir(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Nr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if ((Ar(this, t), (r = Er.checkMatrix(r)).isEmpty())) throw new Error("Matrix must be non-empty"); var o, n = r.rows, i = r.columns, s = e.computeLeftSingularVectors, u = void 0 === s || s, a = e.computeRightSingularVectors, f = void 0 === a || a, c = e.autoTranspose, h = void 0 !== c && c, l = Boolean(u), p = Boolean(f), v = !1; if (n < i) if (h) { (n = (o = r.transpose()).rows), (i = o.columns), (v = !0); var y = l; (l = p), (p = y); } else (o = r.clone()), console.warn( "Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose", ); else o = r.clone(); for ( var m = Math.min(n, i), g = Math.min(n + 1, i), w = new Float64Array(g), d = new K(n, m), b = new K(i, i), M = new Float64Array(i), x = new Float64Array(n), S = new Float64Array(g), k = 0; k < g; k++ ) S[k] = k; for ( var E = Math.min(n - 1, i), O = Math.max(0, Math.min(i - 2, n)), R = Math.max(E, O), j = 0; j < R; j++ ) { if (j < E) { w[j] = 0; for (var _ = j; _ < n; _++) w[j] = _r(w[j], o.get(_, j)); if (0 !== w[j]) { o.get(j, j) < 0 && (w[j] = -w[j]); for (var P = j; P < n; P++) o.set(P, j, o.get(P, j) / w[j]); o.set(j, j, o.get(j, j) + 1); } w[j] = -w[j]; } for (var T = j + 1; T < i; T++) { if (j < E && 0 !== w[j]) { for (var A = 0, I = j; I < n; I++) A += o.get(I, j) * o.get(I, T); A = -A / o.get(j, j); for (var N = j; N < n; N++) o.set(N, T, o.get(N, T) + A * o.get(N, j)); } M[T] = o.get(j, T); } if (l && j < E) for (var C = j; C < n; C++) d.set(C, j, o.get(C, j)); if (j < O) { M[j] = 0; for (var D = j + 1; D < i; D++) M[j] = _r(M[j], M[D]); if (0 !== M[j]) { M[j + 1] < 0 && (M[j] = 0 - M[j]); for (var V = j + 1; V < i; V++) M[V] /= M[j]; M[j + 1] += 1; } if (((M[j] = -M[j]), j + 1 < n && 0 !== M[j])) { for (var q = j + 1; q < n; q++) x[q] = 0; for (var F = j + 1; F < n; F++) for (var B = j + 1; B < i; B++) x[F] += M[B] * o.get(F, B); for (var z = j + 1; z < i; z++) for (var L = -M[z] / M[j + 1], U = j + 1; U < n; U++) o.set(U, z, o.get(U, z) + L * x[U]); } if (p) for (var W = j + 1; W < i; W++) b.set(W, j, M[W]); } } var Q = Math.min(i, n + 1); if ( (E < i && (w[E] = o.get(E, E)), n < Q && (w[Q - 1] = 0), O + 1 < Q && (M[O] = o.get(O, Q - 1)), (M[Q - 1] = 0), l) ) { for (var J = E; J < m; J++) { for (var H = 0; H < n; H++) d.set(H, J, 0); d.set(J, J, 1); } for (var Y = E - 1; Y >= 0; Y--) if (0 !== w[Y]) { for (var X = Y + 1; X < m; X++) { for (var G = 0, Z = Y; Z < n; Z++) G += d.get(Z, Y) * d.get(Z, X); G = -G / d.get(Y, Y); for (var $ = Y; $ < n; $++) d.set($, X, d.get($, X) + G * d.get($, Y)); } for (var tt = Y; tt < n; tt++) d.set(tt, Y, -d.get(tt, Y)); d.set(Y, Y, 1 + d.get(Y, Y)); for (var rt = 0; rt < Y - 1; rt++) d.set(rt, Y, 0); } else { for (var et = 0; et < n; et++) d.set(et, Y, 0); d.set(Y, Y, 1); } } if (p) for (var ot = i - 1; ot >= 0; ot--) { if (ot < O && 0 !== M[ot]) for (var nt = ot + 1; nt < i; nt++) { for (var it = 0, st = ot + 1; st < i; st++) it += b.get(st, ot) * b.get(st, nt); it = -it / b.get(ot + 1, ot); for (var ut = ot + 1; ut < i; ut++) b.set(ut, nt, b.get(ut, nt) + it * b.get(ut, ot)); } for (var at = 0; at < i; at++) b.set(at, ot, 0); b.set(ot, ot, 1); } for (var ft = Q - 1, ct = Number.EPSILON; Q > 0; ) { var ht = void 0, lt = void 0; for (ht = Q - 2; ht >= -1 && -1 !== ht; ht--) { var pt = Number.MIN_VALUE + ct * Math.abs(w[ht] + Math.abs(w[ht + 1])); if (Math.abs(M[ht]) <= pt || Number.isNaN(M[ht])) { M[ht] = 0; break; } } if (ht === Q - 2) lt = 4; else { var vt = void 0; for (vt = Q - 1; vt >= ht && vt !== ht; vt--) { var yt = (vt !== Q ? Math.abs(M[vt]) : 0) + (vt !== ht + 1 ? Math.abs(M[vt - 1]) : 0); if (Math.abs(w[vt]) <= ct * yt) { w[vt] = 0; break; } } vt === ht ? (lt = 3) : vt === Q - 1 ? (lt = 1) : ((lt = 2), (ht = vt)); } switch ((ht++, lt)) { case 1: var mt = M[Q - 2]; M[Q - 2] = 0; for (var gt = Q - 2; gt >= ht; gt--) { var wt = _r(w[gt], mt), dt = w[gt] / wt, bt = mt / wt; if ( ((w[gt] = wt), gt !== ht && ((mt = -bt * M[gt - 1]), (M[gt - 1] = dt * M[gt - 1])), p) ) for (var Mt = 0; Mt < i; Mt++) (wt = dt * b.get(Mt, gt) + bt * b.get(Mt, Q - 1)), b.set( Mt, Q - 1, -bt * b.get(Mt, gt) + dt * b.get(Mt, Q - 1), ), b.set(Mt, gt, wt); } break; case 2: var xt = M[ht - 1]; M[ht - 1] = 0; for (var St = ht; St < Q; St++) { var kt = _r(w[St], xt), Et = w[St] / kt, Ot = xt / kt; if ( ((w[St] = kt), (xt = -Ot * M[St]), (M[St] = Et * M[St]), l) ) for (var Rt = 0; Rt < n; Rt++) (kt = Et * d.get(Rt, St) + Ot * d.get(Rt, ht - 1)), d.set( Rt, ht - 1, -Ot * d.get(Rt, St) + Et * d.get(Rt, ht - 1), ), d.set(Rt, St, kt); } break; case 3: var jt = Math.max( Math.abs(w[Q - 1]), Math.abs(w[Q - 2]), Math.abs(M[Q - 2]), Math.abs(w[ht]), Math.abs(M[ht]), ), _t = w[Q - 1] / jt, Pt = w[Q - 2] / jt, Tt = M[Q - 2] / jt, At = w[ht] / jt, It = M[ht] / jt, Nt = ((Pt + _t) * (Pt - _t) + Tt * Tt) / 2, Ct = _t * Tt * (_t * Tt), Dt = 0; (0 === Nt && 0 === Ct) || (Dt = Ct / (Nt + (Dt = Nt < 0 ? 0 - Math.sqrt(Nt * Nt + Ct) : Math.sqrt(Nt * Nt + Ct)))); for ( var Vt = (At + _t) * (At - _t) + Dt, qt = At * It, Ft = ht; Ft < Q - 1; Ft++ ) { var Bt = _r(Vt, qt); 0 === Bt && (Bt = Number.MIN_VALUE); var zt = Vt / Bt, Lt = qt / Bt; if ( (Ft !== ht && (M[Ft - 1] = Bt), (Vt = zt * w[Ft] + Lt * M[Ft]), (M[Ft] = zt * M[Ft] - Lt * w[Ft]), (qt = Lt * w[Ft + 1]), (w[Ft + 1] = zt * w[Ft + 1]), p) ) for (var Ut = 0; Ut < i; Ut++) (Bt = zt * b.get(Ut, Ft) + Lt * b.get(Ut, Ft + 1)), b.set( Ut, Ft + 1, -Lt * b.get(Ut, Ft) + zt * b.get(Ut, Ft + 1), ), b.set(Ut, Ft, Bt); if ( (0 === (Bt = _r(Vt, qt)) && (Bt = Number.MIN_VALUE), (zt = Vt / Bt), (Lt = qt / Bt), (w[Ft] = Bt), (Vt = zt * M[Ft] + Lt * w[Ft + 1]), (w[Ft + 1] = -Lt * M[Ft] + zt * w[Ft + 1]), (qt = Lt * M[Ft + 1]), (M[Ft + 1] = zt * M[Ft + 1]), l && Ft < n - 1) ) for (var Wt = 0; Wt < n; Wt++) (Bt = zt * d.get(Wt, Ft) + Lt * d.get(Wt, Ft + 1)), d.set( Wt, Ft + 1, -Lt * d.get(Wt, Ft) + zt * d.get(Wt, Ft + 1), ), d.set(Wt, Ft, Bt); } (M[Q - 2] = Vt), 1; break; case 4: if (w[ht] <= 0 && ((w[ht] = w[ht] < 0 ? -w[ht] : 0), p)) for (var Qt = 0; Qt <= ft; Qt++) b.set(Qt, ht, -b.get(Qt, ht)); for (; ht < ft && !(w[ht] >= w[ht + 1]); ) { var Jt = w[ht]; if (((w[ht] = w[ht + 1]), (w[ht + 1] = Jt), p && ht < i - 1)) for (var Ht = 0; Ht < i; Ht++) (Jt = b.get(Ht, ht + 1)), b.set(Ht, ht + 1, b.get(Ht, ht)), b.set(Ht, ht, Jt); if (l && ht < n - 1) for (var Yt = 0; Yt < n; Yt++) (Jt = d.get(Yt, ht + 1)), d.set(Yt, ht + 1, d.get(Yt, ht)), d.set(Yt, ht, Jt); ht++; } 0, Q--; } } if (v) { var Kt = b; (b = d), (d = Kt); } (this.m = n), (this.n = i), (this.s = w), (this.U = d), (this.V = b); } var r, e, o; return ( (r = t), (e = [ { key: "solve", value: function (t) { for ( var r = t, e = this.threshold, o = this.s.length, n = K.zeros(o, o), i = 0; i < o; i++ ) Math.abs(this.s[i]) <= e ? n.set(i, i, 0) : n.set(i, i, 1 / this.s[i]); for ( var s = this.U, u = this.rightSingularVectors, a = u.mmul(n), f = u.rows, c = s.rows, h = K.zeros(f, c), l = 0; l < f; l++ ) for (var p = 0; p < c; p++) { for (var v = 0, y = 0; y < o; y++) v += a.get(l, y) * s.get(p, y); h.set(l, p, v); } return h.mmul(r); }, }, { key: "solveForDiagonal", value: function (t) { return this.solve(K.diag(t)); }, }, { key: "inverse", value: function () { for ( var t = this.V, r = this.threshold, e = t.rows, o = t.columns, n = new K(e, this.s.length), i = 0; i < e; i++ ) for (var s = 0; s < o; s++) Math.abs(this.s[s]) > r && n.set(i, s, t.get(i, s) / this.s[s]); for ( var u = this.U, a = u.rows, f = u.columns, c = new K(e, a), h = 0; h < e; h++ ) for (var l = 0; l < a; l++) { for (var p = 0, v = 0; v < f; v++) p += n.get(h, v) * u.get(l, v); c.set(h, l, p); } return c; }, }, { key: "condition", get: function () { return this.s[0] / this.s[Math.min(this.m, this.n) - 1]; }, }, { key: "norm2", get: function () { return this.s[0]; }, }, { key: "rank", get: function () { for ( var t = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON, r = 0, e = this.s, o = 0, n = e.length; o < n; o++ ) e[o] > t && r++; return r; }, }, { key: "diagonal", get: function () { return Array.from(this.s); }, }, { key: "threshold", get: function () { return ( (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0] ); }, }, { key: "leftSingularVectors", get: function () { return this.U; }, }, { key: "rightSingularVectors", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { return K.diag(this.s); }, }, ]) && Ir(r.prototype, e), o && Ir(r, o), t ); })(); function Cr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; return ( (t = Er.checkMatrix(t)), r ? new Nr(t).inverse() : Dr(t, K.eye(t.rows)) ); } function Dr(t, r) { var e = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return ( (t = Er.checkMatrix(t)), (r = Er.checkMatrix(r)), e ? new Nr(t).solve(r) : t.isSquare() ? new jr(t).solve(r) : new Tr(t).solve(r) ); } function Vr(t) { var r, e, o, n, i, s; if ((t = K.checkMatrix(t)).isSquare()) return 0 === t.columns ? 1 : 2 === t.columns ? ((r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(1, 0)), r * t.get(1, 1) - e * o) : 3 === t.columns ? ((n = new Xt(t, [1, 2], [1, 2])), (i = new Xt(t, [1, 2], [0, 2])), (s = new Xt(t, [1, 2], [0, 1])), (r = t.get(0, 0)), (e = t.get(0, 1)), (o = t.get(0, 2)), r * Vr(n) - e * Vr(i) + o * Vr(s)) : new jr(t).determinant; throw Error("determinant can only be calculated for a square matrix"); } function qr(t, r) { for (var e = [], o = 0; o < t; o++) o !== r && e.push(o); return e; } function Fr(t, r, e) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1e-9, n = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 1e-9; if (t > n) return new Array(r.rows + 1).fill(0); for (var i = r.addRow(e, [0]), s = 0; s < i.rows; s++) Math.abs(i.get(s, 0)) < o && i.set(s, 0, 0); return i.to1DArray(); } function Br(t) { for ( var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, e = r.thresholdValue, o = void 0 === e ? 1e-9 : e, n = r.thresholdError, i = void 0 === n ? 1e-9 : n, s = (t = K.checkMatrix(t)).rows, u = new K(s, s), a = 0; a < s; a++ ) { var f = K.columnVector(t.getRow(a)), c = t.subMatrixRow(qr(s, a)).transpose(), h = new Nr(c), l = h.solve(f), p = K.sub(f, c.mmul(l)).abs().max(); u.setRow(a, Fr(p, l, a, o, i)); } return u; } function zr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Number.EPSILON; if ((t = K.checkMatrix(t)).isEmpty()) return t.transpose(); for ( var e = new Nr(t, { autoTranspose: !0 }), o = e.leftSingularVectors, n = e.rightSingularVectors, i = e.diagonal, s = 0; s < i.length; s++ ) Math.abs(i[s]) > r ? (i[s] = 1 / i[s]) : (i[s] = 0); return n.mmul(K.diag(i).mmul(o.transpose())); } function Lr(t) { return (Lr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Ur(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Lr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i; s && ((t = t.center("column")), o || (r = r.center("column"))); for (var u = t.transpose().mmul(r), a = 0; a < u.rows; a++) for (var f = 0; f < u.columns; f++) u.set(a, f, u.get(a, f) * (1 / (t.rows - 1))); return u; } function Wr(t) { return (Wr = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Qr(t) { var r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : t, e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; t = new K(t); var o = !1; if ( ("object" !== Wr(r) || K.isMatrix(r) || Array.isArray(r) ? (r = new K(r)) : ((e = r), (r = t), (o = !0)), t.rows !== r.rows) ) throw new TypeError( "Both matrices must have the same number of rows", ); var n = e, i = n.center, s = void 0 === i || i, u = n.scale, a = void 0 === u || u; s && (t.center("column"), o || r.center("column")), a && (t.scale("column"), o || r.scale("column")); for ( var f = t.standardDeviation("column", { unbiased: !0 }), c = o ? f : r.standardDeviation("column", { unbiased: !0 }), h = t.transpose().mmul(r), l = 0; l < h.rows; l++ ) for (var p = 0; p < h.columns; p++) h.set(l, p, h.get(l, p) * (1 / (f[l] * c[p])) * (1 / (t.rows - 1))); return h; } function Jr(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } function Hr(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var Yr = (function () { function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Jr(this, t); var o = e.assumeSymmetric, n = void 0 !== o && o; if (!(r = Er.checkMatrix(r)).isSquare()) throw new Error("Matrix is not a square matrix"); if (r.isEmpty()) throw new Error("Matrix must be non-empty"); var i, s, u = r.columns, a = new K(u, u), f = new Float64Array(u), c = new Float64Array(u), h = r; if (!!n || r.isSymmetric()) { for (i = 0; i < u; i++) for (s = 0; s < u; s++) a.set(i, s, h.get(i, s)); Kr(u, c, f, a), Xr(u, c, f, a); } else { var l = new K(u, u), p = new Float64Array(u); for (s = 0; s < u; s++) for (i = 0; i < u; i++) l.set(i, s, h.get(i, s)); Gr(u, l, p, a), Zr(u, c, f, a, l); } (this.n = u), (this.e = c), (this.d = f), (this.V = a); } var r, e, o; return ( (r = t), (e = [ { key: "realEigenvalues", get: function () { return Array.from(this.d); }, }, { key: "imaginaryEigenvalues", get: function () { return Array.from(this.e); }, }, { key: "eigenvectorMatrix", get: function () { return this.V; }, }, { key: "diagonalMatrix", get: function () { var t, r, e = this.n, o = this.e, n = this.d, i = new K(e, e); for (t = 0; t < e; t++) { for (r = 0; r < e; r++) i.set(t, r, 0); i.set(t, t, n[t]), o[t] > 0 ? i.set(t, t + 1, o[t]) : o[t] < 0 && i.set(t, t - 1, o[t]); } return i; }, }, ]) && Hr(r.prototype, e), o && Hr(r, o), t ); })(); function Kr(t, r, e, o) { var n, i, s, u, a, f, c, h; for (a = 0; a < t; a++) e[a] = o.get(t - 1, a); for (u = t - 1; u > 0; u--) { for (h = 0, s = 0, f = 0; f < u; f++) h += Math.abs(e[f]); if (0 === h) for (r[u] = e[u - 1], a = 0; a < u; a++) (e[a] = o.get(u - 1, a)), o.set(u, a, 0), o.set(a, u, 0); else { for (f = 0; f < u; f++) (e[f] /= h), (s += e[f] * e[f]); for ( n = e[u - 1], i = Math.sqrt(s), n > 0 && (i = -i), r[u] = h * i, s -= n * i, e[u - 1] = n - i, a = 0; a < u; a++ ) r[a] = 0; for (a = 0; a < u; a++) { for ( n = e[a], o.set(a, u, n), i = r[a] + o.get(a, a) * n, f = a + 1; f <= u - 1; f++ ) (i += o.get(f, a) * e[f]), (r[f] += o.get(f, a) * n); r[a] = i; } for (n = 0, a = 0; a < u; a++) (r[a] /= s), (n += r[a] * e[a]); for (c = n / (s + s), a = 0; a < u; a++) r[a] -= c * e[a]; for (a = 0; a < u; a++) { for (n = e[a], i = r[a], f = a; f <= u - 1; f++) o.set(f, a, o.get(f, a) - (n * r[f] + i * e[f])); (e[a] = o.get(u - 1, a)), o.set(u, a, 0); } } e[u] = s; } for (u = 0; u < t - 1; u++) { if ( (o.set(t - 1, u, o.get(u, u)), o.set(u, u, 1), 0 !== (s = e[u + 1])) ) { for (f = 0; f <= u; f++) e[f] = o.get(f, u + 1) / s; for (a = 0; a <= u; a++) { for (i = 0, f = 0; f <= u; f++) i += o.get(f, u + 1) * o.get(f, a); for (f = 0; f <= u; f++) o.set(f, a, o.get(f, a) - i * e[f]); } } for (f = 0; f <= u; f++) o.set(f, u + 1, 0); } for (a = 0; a < t; a++) (e[a] = o.get(t - 1, a)), o.set(t - 1, a, 0); o.set(t - 1, t - 1, 1), (r[0] = 0); } function Xr(t, r, e, o) { var n, i, s, u, a, f, c, h, l, p, v, y, m, g, w, d; for (s = 1; s < t; s++) r[s - 1] = r[s]; r[t - 1] = 0; var b = 0, M = 0, x = Number.EPSILON; for (f = 0; f < t; f++) { for ( M = Math.max(M, Math.abs(e[f]) + Math.abs(r[f])), c = f; c < t && !(Math.abs(r[c]) <= x * M); ) c++; if (c > f) { 0; do { for ( 1, n = e[f], l = _r((h = (e[f + 1] - n) / (2 * r[f])), 1), h < 0 && (l = -l), e[f] = r[f] / (h + l), e[f + 1] = r[f] * (h + l), p = e[f + 1], i = n - e[f], s = f + 2; s < t; s++ ) e[s] -= i; for ( b += i, h = e[c], y = v = 1, m = v, g = r[f + 1], w = 0, d = 0, s = c - 1; s >= f; s-- ) for ( m = y, y = v, d = w, n = v * r[s], i = v * h, l = _r(h, r[s]), r[s + 1] = w * l, w = r[s] / l, h = (v = h / l) * e[s] - w * n, e[s + 1] = i + w * (v * n + w * e[s]), a = 0; a < t; a++ ) (i = o.get(a, s + 1)), o.set(a, s + 1, w * o.get(a, s) + v * i), o.set(a, s, v * o.get(a, s) - w * i); (h = (-w * d * m * g * r[f]) / p), (r[f] = w * h), (e[f] = v * h); } while (Math.abs(r[f]) > x * M); } (e[f] = e[f] + b), (r[f] = 0); } for (s = 0; s < t - 1; s++) { for (a = s, h = e[s], u = s + 1; u < t; u++) e[u] < h && ((a = u), (h = e[u])); if (a !== s) for (e[a] = e[s], e[s] = h, u = 0; u < t; u++) (h = o.get(u, s)), o.set(u, s, o.get(u, a)), o.set(u, a, h); } } function Gr(t, r, e, o) { var n, i, s, u, a, f, c, h = t - 1; for (f = 1; f <= h - 1; f++) { for (c = 0, u = f; u <= h; u++) c += Math.abs(r.get(u, f - 1)); if (0 !== c) { for (s = 0, u = h; u >= f; u--) (e[u] = r.get(u, f - 1) / c), (s += e[u] * e[u]); for ( i = Math.sqrt(s), e[f] > 0 && (i = -i), s -= e[f] * i, e[f] = e[f] - i, a = f; a < t; a++ ) { for (n = 0, u = h; u >= f; u--) n += e[u] * r.get(u, a); for (n /= s, u = f; u <= h; u++) r.set(u, a, r.get(u, a) - n * e[u]); } for (u = 0; u <= h; u++) { for (n = 0, a = h; a >= f; a--) n += e[a] * r.get(u, a); for (n /= s, a = f; a <= h; a++) r.set(u, a, r.get(u, a) - n * e[a]); } (e[f] = c * e[f]), r.set(f, f - 1, c * i); } } for (u = 0; u < t; u++) for (a = 0; a < t; a++) o.set(u, a, u === a ? 1 : 0); for (f = h - 1; f >= 1; f--) if (0 !== r.get(f, f - 1)) { for (u = f + 1; u <= h; u++) e[u] = r.get(u, f - 1); for (a = f; a <= h; a++) { for (i = 0, u = f; u <= h; u++) i += e[u] * o.get(u, a); for (i = i / e[f] / r.get(f, f - 1), u = f; u <= h; u++) o.set(u, a, o.get(u, a) + i * e[u]); } } } function Zr(t, r, e, o, n) { var i, s, u, a, f, c, h, l, p, v, y, m, g, w, d, b = t - 1, M = t - 1, x = Number.EPSILON, S = 0, k = 0, E = 0, O = 0, R = 0, j = 0, _ = 0, P = 0; for (i = 0; i < t; i++) for ( (i < 0 || i > M) && ((e[i] = n.get(i, i)), (r[i] = 0)), s = Math.max(i - 1, 0); s < t; s++ ) k += Math.abs(n.get(i, s)); for (; b >= 0; ) { for ( a = b; a > 0 && (0 === (j = Math.abs(n.get(a - 1, a - 1)) + Math.abs(n.get(a, a))) && (j = k), !(Math.abs(n.get(a, a - 1)) < x * j)); ) a--; if (a === b) n.set(b, b, n.get(b, b) + S), (e[b] = n.get(b, b)), (r[b] = 0), b--, (P = 0); else if (a === b - 1) { if ( ((h = n.get(b, b - 1) * n.get(b - 1, b)), (O = (E = (n.get(b - 1, b - 1) - n.get(b, b)) / 2) * E + h), (_ = Math.sqrt(Math.abs(O))), n.set(b, b, n.get(b, b) + S), n.set(b - 1, b - 1, n.get(b - 1, b - 1) + S), (l = n.get(b, b)), O >= 0) ) { for ( _ = E >= 0 ? E + _ : E - _, e[b - 1] = l + _, e[b] = e[b - 1], 0 !== _ && (e[b] = l - h / _), r[b - 1] = 0, r[b] = 0, E = (l = n.get(b, b - 1)) / (j = Math.abs(l) + Math.abs(_)), O = _ / j, E /= R = Math.sqrt(E * E + O * O), O /= R, s = b - 1; s < t; s++ ) (_ = n.get(b - 1, s)), n.set(b - 1, s, O * _ + E * n.get(b, s)), n.set(b, s, O * n.get(b, s) - E * _); for (i = 0; i <= b; i++) (_ = n.get(i, b - 1)), n.set(i, b - 1, O * _ + E * n.get(i, b)), n.set(i, b, O * n.get(i, b) - E * _); for (i = 0; i <= M; i++) (_ = o.get(i, b - 1)), o.set(i, b - 1, O * _ + E * o.get(i, b)), o.set(i, b, O * o.get(i, b) - E * _); } else (e[b - 1] = l + E), (e[b] = l + E), (r[b - 1] = _), (r[b] = -_); (b -= 2), (P = 0); } else { if ( ((l = n.get(b, b)), (p = 0), (h = 0), a < b && ((p = n.get(b - 1, b - 1)), (h = n.get(b, b - 1) * n.get(b - 1, b))), 10 === P) ) { for (S += l, i = 0; i <= b; i++) n.set(i, i, n.get(i, i) - l); (l = p = 0.75 * (j = Math.abs(n.get(b, b - 1)) + Math.abs(n.get(b - 1, b - 2)))), (h = -0.4375 * j * j); } if (30 === P && (j = (j = (p - l) / 2) * j + h) > 0) { for ( j = Math.sqrt(j), p < l && (j = -j), j = l - h / ((p - l) / 2 + j), i = 0; i <= b; i++ ) n.set(i, i, n.get(i, i) - j); (S += j), (l = p = h = 0.964); } for ( P += 1, f = b - 2; f >= a && ((E = ((R = l - (_ = n.get(f, f))) * (j = p - _) - h) / n.get(f + 1, f) + n.get(f, f + 1)), (O = n.get(f + 1, f + 1) - _ - R - j), (R = n.get(f + 2, f + 1)), (E /= j = Math.abs(E) + Math.abs(O) + Math.abs(R)), (O /= j), (R /= j), f !== a) && !( Math.abs(n.get(f, f - 1)) * (Math.abs(O) + Math.abs(R)) < x * (Math.abs(E) * (Math.abs(n.get(f - 1, f - 1)) + Math.abs(_) + Math.abs(n.get(f + 1, f + 1)))) ); ) f--; for (i = f + 2; i <= b; i++) n.set(i, i - 2, 0), i > f + 2 && n.set(i, i - 3, 0); for ( u = f; u <= b - 1 && ((w = u !== b - 1), u !== f && ((E = n.get(u, u - 1)), (O = n.get(u + 1, u - 1)), (R = w ? n.get(u + 2, u - 1) : 0), 0 !== (l = Math.abs(E) + Math.abs(O) + Math.abs(R)) && ((E /= l), (O /= l), (R /= l))), 0 !== l); u++ ) if ( ((j = Math.sqrt(E * E + O * O + R * R)), E < 0 && (j = -j), 0 !== j) ) { for ( u !== f ? n.set(u, u - 1, -j * l) : a !== f && n.set(u, u - 1, -n.get(u, u - 1)), l = (E += j) / j, p = O / j, _ = R / j, O /= E, R /= E, s = u; s < t; s++ ) (E = n.get(u, s) + O * n.get(u + 1, s)), w && ((E += R * n.get(u + 2, s)), n.set(u + 2, s, n.get(u + 2, s) - E * _)), n.set(u, s, n.get(u, s) - E * l), n.set(u + 1, s, n.get(u + 1, s) - E * p); for (i = 0; i <= Math.min(b, u + 3); i++) (E = l * n.get(i, u) + p * n.get(i, u + 1)), w && ((E += _ * n.get(i, u + 2)), n.set(i, u + 2, n.get(i, u + 2) - E * R)), n.set(i, u, n.get(i, u) - E), n.set(i, u + 1, n.get(i, u + 1) - E * O); for (i = 0; i <= M; i++) (E = l * o.get(i, u) + p * o.get(i, u + 1)), w && ((E += _ * o.get(i, u + 2)), o.set(i, u + 2, o.get(i, u + 2) - E * R)), o.set(i, u, o.get(i, u) - E), o.set(i, u + 1, o.get(i, u + 1) - E * O); } } } if (0 !== k) { for (b = t - 1; b >= 0; b--) if (((E = e[b]), 0 === (O = r[b]))) for (a = b, n.set(b, b, 1), i = b - 1; i >= 0; i--) { for (h = n.get(i, i) - E, R = 0, s = a; s <= b; s++) R += n.get(i, s) * n.get(s, b); if (r[i] < 0) (_ = h), (j = R); else if ( ((a = i), 0 === r[i] ? n.set(i, b, 0 !== h ? -R / h : -R / (x * k)) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (c = (l * j - _ * R) / (O = (e[i] - E) * (e[i] - E) + r[i] * r[i])), n.set(i, b, c), n.set( i + 1, b, Math.abs(l) > Math.abs(_) ? (-R - h * c) / l : (-j - p * c) / _, )), x * (c = Math.abs(n.get(i, b))) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b, n.get(s, b) / c); } else if (O < 0) for ( a = b - 1, Math.abs(n.get(b, b - 1)) > Math.abs(n.get(b - 1, b)) ? (n.set(b - 1, b - 1, O / n.get(b, b - 1)), n.set(b - 1, b, -(n.get(b, b) - E) / n.get(b, b - 1))) : ((d = $r( 0, -n.get(b - 1, b), n.get(b - 1, b - 1) - E, O, )), n.set(b - 1, b - 1, d[0]), n.set(b - 1, b, d[1])), n.set(b, b - 1, 0), n.set(b, b, 1), i = b - 2; i >= 0; i-- ) { for (v = 0, y = 0, s = a; s <= b; s++) (v += n.get(i, s) * n.get(s, b - 1)), (y += n.get(i, s) * n.get(s, b)); if (((h = n.get(i, i) - E), r[i] < 0)) (_ = h), (R = v), (j = y); else if ( ((a = i), 0 === r[i] ? ((d = $r(-v, -y, h, O)), n.set(i, b - 1, d[0]), n.set(i, b, d[1])) : ((l = n.get(i, i + 1)), (p = n.get(i + 1, i)), (m = (e[i] - E) * (e[i] - E) + r[i] * r[i] - O * O), (g = 2 * (e[i] - E) * O), 0 === m && 0 === g && (m = x * k * (Math.abs(h) + Math.abs(O) + Math.abs(l) + Math.abs(p) + Math.abs(_))), (d = $r( l * R - _ * v + O * y, l * j - _ * y - O * v, m, g, )), n.set(i, b - 1, d[0]), n.set(i, b, d[1]), Math.abs(l) > Math.abs(_) + Math.abs(O) ? (n.set( i + 1, b - 1, (-v - h * n.get(i, b - 1) + O * n.get(i, b)) / l, ), n.set( i + 1, b, (-y - h * n.get(i, b) - O * n.get(i, b - 1)) / l, )) : ((d = $r( -R - p * n.get(i, b - 1), -j - p * n.get(i, b), _, O, )), n.set(i + 1, b - 1, d[0]), n.set(i + 1, b, d[1]))), x * (c = Math.max( Math.abs(n.get(i, b - 1)), Math.abs(n.get(i, b)), )) * c > 1) ) for (s = i; s <= b; s++) n.set(s, b - 1, n.get(s, b - 1) / c), n.set(s, b, n.get(s, b) / c); } for (i = 0; i < t; i++) if (i < 0 || i > M) for (s = i; s < t; s++) o.set(i, s, n.get(i, s)); for (s = t - 1; s >= 0; s--) for (i = 0; i <= M; i++) { for (_ = 0, u = 0; u <= Math.min(s, M); u++) _ += o.get(i, u) * n.get(u, s); o.set(i, s, _); } } } function $r(t, r, e, o) { var n, i; return Math.abs(e) > Math.abs(o) ? [(t + (n = o / e) * r) / (i = e + n * o), (r - n * t) / i] : [((n = e / o) * t + r) / (i = o + n * e), (n * r - t) / i]; } function te(t, r) { for (var e = 0; e < r.length; e++) { var o = r[e]; (o.enumerable = o.enumerable || !1), (o.configurable = !0), "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o); } } var re = (function () { function t(r) { if ( ((function (t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); })(this, t), !(r = Er.checkMatrix(r)).isSymmetric()) ) throw new Error("Matrix is not symmetric"); var e, o, n, i = r, s = i.rows, u = new K(s, s), a = !0; for (o = 0; o < s; o++) { var f = 0; for (n = 0; n < o; n++) { var c = 0; for (e = 0; e < n; e++) c += u.get(n, e) * u.get(o, e); (c = (i.get(o, n) - c) / u.get(n, n)), u.set(o, n, c), (f += c * c); } for ( a &= (f = i.get(o, o) - f) > 0, u.set(o, o, Math.sqrt(Math.max(f, 0))), n = o + 1; n < s; n++ ) u.set(o, n, 0); } (this.L = u), (this.positiveDefinite = Boolean(a)); } var r, e, o; return ( (r = t), (e = [ { key: "isPositiveDefinite", value: function () { return this.positiveDefinite; }, }, { key: "solve", value: function (t) { t = Er.checkMatrix(t); var r = this.L, e = r.rows; if (t.rows !== e) throw new Error("Matrix dimensions do not match"); if (!1 === this.isPositiveDefinite()) throw new Error("Matrix is not positive definite"); var o, n, i, s = t.columns, u = t.clone(); for (i = 0; i < e; i++) for (n = 0; n < s; n++) { for (o = 0; o < i; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(i, o)); u.set(i, n, u.get(i, n) / r.get(i, i)); } for (i = e - 1; i >= 0; i--) for (n = 0; n < s; n++) { for (o = i + 1; o < e; o++) u.set(i, n, u.get(i, n) - u.get(o, n) * r.get(o, i)); u.set(i, n, u.get(i, n) / r.get(i, i)); } return u; }, }, { key: "lowerTriangularMatrix", get: function () { return this.L; }, }, ]) && te(r.prototype, e), o && te(r, o), t ); })(); function ee(t, r) { if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function"); } var oe = function t(r) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; ee(this, t), (r = Er.checkMatrix(r)); var o, n = e.Y, i = e.scaleScores, s = void 0 !== i && i, u = e.maxIterations, a = void 0 === u ? 1e3 : u, f = e.terminationCriteria, c = void 0 === f ? 1e-10 : f; if (n) { if ( (n = Array.isArray(n) && "number" == typeof n[0] ? K.columnVector(n) : Er.checkMatrix(n)).rows !== r.rows ) throw new Error("Y should have the same number of rows as X"); o = n.getColumnVector(0); } else o = r.getColumnVector(0); for (var h, l, p, v, y = 1, m = 0; m < a && y > c; m++) (p = (p = r .transpose() .mmul(o) .div(o.transpose().mmul(o).get(0, 0))).div(p.norm())), (h = r.mmul(p).div(p.transpose().mmul(p).get(0, 0))), m > 0 && (y = h.clone().sub(v).pow(2).sum()), (v = h.clone()), n ? ((l = (l = n .transpose() .mmul(h) .div(h.transpose().mmul(h).get(0, 0))).div(l.norm())), (o = n.mmul(l).div(l.transpose().mmul(l).get(0, 0)))) : (o = h); if (n) { var g = r.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)); g = g.div(g.norm()); var w = r.clone().sub(h.clone().mmul(g.transpose())), d = o.transpose().mmul(h).div(h.transpose().mmul(h).get(0, 0)), b = n.clone().sub(h.clone().mulS(d.get(0, 0)).mmul(l.transpose())); (this.t = h), (this.p = g.transpose()), (this.w = p.transpose()), (this.q = l), (this.u = o), (this.s = h.transpose().mmul(h)), (this.xResidual = w), (this.yResidual = b), (this.betas = d); } else (this.w = p.transpose()), (this.s = h.transpose().mmul(h).sqrt()), (this.t = s ? h.clone().div(this.s.get(0, 0)) : h), (this.xResidual = r.sub(h.mmul(p.transpose()))); }; }, 11: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.camelize = r.isString = void 0); r.isString = function (t) { return "string" == typeof t; }; var o, n, i = /-(\w)/g; r.camelize = ((o = function (t) { return t.replace(i, function (t, r) { return r ? r.toUpperCase() : ""; }); }), (n = Object.create(null)), function (t) { return n[t] || (n[t] = o(t)); }); }, 12: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isArray = void 0), (r.isArray = Array.isArray); }, 13: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.toNumber = r.isNaN = r.isNumber = void 0); r.isNumber = function (t) { return "number" == typeof t; }; r.isNaN = function (t) { return Number.isNaN(Number(t)); }; r.toNumber = function (t) { var e = parseFloat(t); return r.isNaN(e) ? t : e; }; }, 14: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.traverseTreeUp = r.scaleMatrix = r.getAdjMatrix = r.floydWarshall = r.getDegree = void 0); r.getDegree = function (t, r, e) { for (var o = [], n = 0; n < t; n++) o[n] = 0; return e ? (e.forEach(function (t) { t.source && (o[r[t.source]] += 1), t.target && (o[r[t.target]] += 1); }), o) : o; }; r.floydWarshall = function (t) { for (var r = [], e = t.length, o = 0; o < e; o += 1) { r[o] = []; for (var n = 0; n < e; n += 1) o === n ? (r[o][n] = 0) : 0 !== t[o][n] && t[o][n] ? (r[o][n] = t[o][n]) : (r[o][n] = 1 / 0); } for (var i = 0; i < e; i += 1) for (o = 0; o < e; o += 1) for (n = 0; n < e; n += 1) r[o][n] > r[o][i] + r[i][n] && (r[o][n] = r[o][i] + r[i][n]); return r; }; r.getAdjMatrix = function (t, r) { var e = t.nodes, o = t.edges, n = [], i = {}; if (!e) throw new Error("invalid nodes data!"); return ( e && e.forEach(function (t, r) { i[t.id] = r; n.push([]); }), o && o.forEach(function (t) { var e = t.source, o = t.target, s = i[e], u = i[o]; (n[s][u] = 1), r || (n[u][s] = 1); }), n ); }; r.scaleMatrix = function (t, r) { var e = []; return ( t.forEach(function (t) { var o = []; t.forEach(function (t) { o.push(t * r); }), e.push(o); }), e ); }; r.traverseTreeUp = function (t, r) { "function" == typeof r && (function t(r, e) { if (r && r.children) for (var o = r.children.length - 1; o >= 0; o--) if (!t(r.children[o], e)) return; return !!e(r); })(t, r); }; }, 15: function (t, r, e) { "use strict"; function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var n = (this && this.__assign) || function () { return (n = Object.assign || function (t) { for (var r, e = 1, o = arguments.length; e < o; e++) for (var n in (r = arguments[e])) Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]); return t; }).apply(this, arguments); }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.clone = r.isObject = void 0); r.isObject = function (t) { return null !== t && "object" === o(t); }; r.clone = function (t) { if (null === t) return t; if (t instanceof Date) return new Date(t.getTime()); if (t instanceof Array) { var e = []; return ( t.forEach(function (t) { e.push(t); }), e.map(function (t) { return r.clone(t); }) ); } if ("object" === o(t) && t !== {}) { var i = n({}, t); return ( Object.keys(i).forEach(function (t) { i[t] = r.clone(i[t]); }), i ); } return t; }; }, 16: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.isFunction = void 0); r.isFunction = function (t) { return "function" == typeof t; }; }, 181: function (t, r, e) { "use strict"; var o = (this && this.__createBinding) || (Object.create ? function (t, r, e, o) { void 0 === o && (o = e), Object.defineProperty(t, o, { enumerable: !0, get: function () { return r[e]; }, }); } : function (t, r, e, o) { void 0 === o && (o = e), (t[o] = r[e]); }), n = (this && this.__exportStar) || function (t, r) { for (var e in t) "default" === e || Object.prototype.hasOwnProperty.call(r, e) || o(r, t, e); }; Object.defineProperty(r, "__esModule", { value: !0 }), n(e(410), r); }, 409: function (t, r, e) { "use strict"; e.r(r); var o = e(181); r.default = o.RadialLayout; }, 410: function (t, r, e) { "use strict"; var o, n = (this && this.__extends) || ((o = function (t, r) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, r) { t.__proto__ = r; }) || function (t, r) { for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]); })(t, r); }), function (t, r) { if ("function" != typeof r && null !== r) throw new TypeError( "Class extends value " + String(r) + " is not a constructor or null", ); function e() { this.constructor = t; } o(t, r), (t.prototype = null === r ? Object.create(r) : ((e.prototype = r.prototype), new e())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(r, "__esModule", { value: !0 }), (r.RadialLayout = void 0); var s = e(10), u = e(7), a = i(e(411)), f = i(e(412)); function c(t, r) { return Math.sqrt( (t[0] - r[0]) * (t[0] - r[0]) + (t[1] - r[1]) * (t[1] - r[1]), ); } var h = (function (t) { function r(r) { var e = t.call(this) || this; return ( (e.maxIteration = 1e3), (e.focusNode = null), (e.unitRadius = null), (e.linkDistance = 50), (e.preventOverlap = !1), (e.strictRadial = !0), (e.maxPreventOverlapIteration = 200), (e.sortStrength = 10), (e.nodes = []), (e.edges = []), e.updateCfg(r), e ); } return ( n(r, t), (r.prototype.getDefaultCfg = function () { return { maxIteration: 1e3, focusNode: null, unitRadius: null, linkDistance: 50, preventOverlap: !1, nodeSize: void 0, nodeSpacing: void 0, strictRadial: !0, maxPreventOverlapIteration: 200, sortBy: void 0, sortStrength: 10, }; }), (r.prototype.execute = function () { var t = this, r = t.nodes, e = t.edges || []; if (r && 0 !== r.length) { t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), t.center || (t.center = [t.width / 2, t.height / 2]); var o = t.center; if (1 === r.length) return ( (r[0].x = o[0]), (r[0].y = o[1]), void (t.onLayoutEnd && t.onLayoutEnd()) ); var n = t.linkDistance, i = null; if (s.isString(t.focusNode)) { for (var u = !1, c = 0; c < r.length; c++) r[c].id === t.focusNode && ((i = r[c]), (t.focusNode = i), (u = !0), (c = r.length)); u || (i = null); } else i = t.focusNode; i || ((i = r[0]), (t.focusNode = i)); var h, l, p, v = ((h = r), (l = i.id), (p = -1), h.forEach(function (t, r) { t.id === l && (p = r); }), p); t.focusIndex = v; var y = s.getAdjMatrix({ nodes: r, edges: e }, !1), m = s.floydWarshall(y), g = t.maxToFocus(m, v); t.handleInfinity(m, v, g + 1), (t.distances = m); var w = m[v], d = t.width || 500, b = t.height || 500, M = d - o[0] > o[0] ? o[0] : d - o[0], x = b - o[1] > o[1] ? o[1] : b - o[1]; 0 === M && (M = d / 2), 0 === x && (x = b / 2); var S = x > M ? M : x, k = Math.max.apply(Math, w), E = []; w.forEach(function (r, e) { t.unitRadius || (t.unitRadius = S / k), (E[e] = r * t.unitRadius); }), (t.radii = E); var O = t.eIdealDisMatrix(); t.eIdealDistances = O; var R = (function (t) { for ( var r = t.length, e = t[0].length, o = [], n = 0; n < r; n++ ) { for (var i = [], s = 0; s < e; s++) 0 !== t[n][s] ? i.push(1 / (t[n][s] * t[n][s])) : i.push(0); o.push(i); } return o; })(O); t.weights = R; var j = new a.default({ linkDistance: n, distances: O }).layout(); j.forEach(function (t) { s.isNaN(t[0]) && (t[0] = Math.random() * n), s.isNaN(t[1]) && (t[1] = Math.random() * n); }), (t.positions = j), j.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), j.forEach(function (t) { (t[0] -= j[v][0]), (t[1] -= j[v][1]); }), t.run(); var _, P = t.preventOverlap, T = t.nodeSize, A = t.strictRadial; if (P) { var I, N = t.nodeSpacing; (I = s.isNumber(N) ? function () { return N; } : s.isFunction(N) ? N : function () { return 0; }), (_ = T ? s.isArray(T) ? function (t) { return (T[0] > T[1] ? T[0] : T[1]) + I(t); } : function (t) { return T + I(t); } : function (t) { return t.size ? s.isArray(t.size) ? (t.size[0] > t.size[1] ? t.size[0] : t.size[1]) + I(t) : t.size + I(t) : 10 + I(t); }); var C = { nodes: r, nodeSizeFunc: _, adjMatrix: y, positions: j, radii: E, height: b, width: d, strictRadial: A, focusID: v, iterations: t.maxPreventOverlapIteration || 200, k: j.length / 4.5, }, D = new f.default(C); j = D.layout(); } return ( j.forEach(function (t, e) { (r[e].x = t[0] + o[0]), (r[e].y = t[1] + o[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: r, edges: e } ); } t.onLayoutEnd && t.onLayoutEnd(); }), (r.prototype.run = function () { for ( var t = this.maxIteration, r = this.positions || [], e = this.weights || [], o = this.eIdealDistances || [], n = this.radii || [], i = 0; i <= t; i++ ) { var s = i / t; this.oneIteration(s, r, n, o, e); } }), (r.prototype.oneIteration = function (t, r, e, o, n) { var i = 1 - t, s = this.focusIndex; r.forEach(function (u, a) { var f = c(u, [0, 0]), h = 0 === f ? 0 : 1 / f; if (a !== s) { var l = 0, p = 0, v = 0; r.forEach(function (t, r) { if (a !== r) { var e = c(u, t), i = 0 === e ? 0 : 1 / e, s = o[r][a]; (v += n[a][r]), (l += n[a][r] * (t[0] + s * (u[0] - t[0]) * i)), (p += n[a][r] * (t[1] + s * (u[1] - t[1]) * i)); } }); var y = 0 === e[a] ? 0 : 1 / e[a]; (v *= i), (v += t * y * y), (l *= i), (l += t * y * u[0] * h), (u[0] = l / v), (p *= i), (p += t * y * u[1] * h), (u[1] = p / v); } }); }), (r.prototype.eIdealDisMatrix = function () { var t = this, r = t.nodes; if (!r) return []; var e = t.distances, o = t.linkDistance, n = t.radii || [], i = t.unitRadius || 50, u = []; return ( e && e.forEach(function (e, a) { var f = []; e.forEach(function (e, u) { if (a === u) f.push(0); else if (n[a] === n[u]) if ("data" === t.sortBy) f.push( (e * (Math.abs(a - u) * t.sortStrength)) / (n[a] / i), ); else if (t.sortBy) { var c = r[a][t.sortBy] || 0, h = r[u][t.sortBy] || 0; s.isString(c) && (c = c.charCodeAt(0)), s.isString(h) && (h = h.charCodeAt(0)), f.push( (e * (Math.abs(c - h) * t.sortStrength)) / (n[a] / i), ); } else f.push((e * o) / (n[a] / i)); else { var l = (o + i) / 2; f.push(e * l); } }), u.push(f); }), u ); }), (r.prototype.handleInfinity = function (t, r, e) { for (var o = t.length, n = 0; n < o; n++) if (t[r][n] === 1 / 0) { (t[r][n] = e), (t[n][r] = e); for (var i = 0; i < o; i++) t[n][i] !== 1 / 0 && t[r][i] === 1 / 0 && ((t[r][i] = e + t[n][i]), (t[i][r] = e + t[n][i])); } for (n = 0; n < o; n++) if (n !== r) for (i = 0; i < o; i++) if (t[n][i] === 1 / 0) { var s = Math.abs(t[r][n] - t[r][i]); (s = 0 === s ? 1 : s), (t[n][i] = s); } }), (r.prototype.maxToFocus = function (t, r) { for (var e = 0, o = 0; o < t[r].length; o++) t[r][o] !== 1 / 0 && (e = t[r][o] > e ? t[r][o] : e); return e; }), (r.prototype.getType = function () { return "radial"; }), r ); })(u.Base); r.RadialLayout = h; }, 411: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = e(102), n = (function () { function t(t) { (this.distances = t.distances), (this.dimension = t.dimension || 2), (this.linkDistance = t.linkDistance); } return ( (t.prototype.layout = function () { var t = this.dimension, r = this.distances, e = this.linkDistance; try { var n = o.Matrix.mul(o.Matrix.pow(r, 2), -0.5), i = n.mean("row"), s = n.mean("column"), u = n.mean(); n.add(u).subRowVector(i).subColumnVector(s); var a = new o.SingularValueDecomposition(n), f = o.Matrix.sqrt(a.diagonalMatrix).diagonal(); return a.leftSingularVectors.toJSON().map(function (r) { return o.Matrix.mul([r], [f]).toJSON()[0].splice(0, t); }); } catch (t) { for (var c = [], h = 0; h < r.length; h++) { var l = Math.random() * e, p = Math.random() * e; c.push([l, p]); } return c; } }), t ); })(); r.default = n; }, 412: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }); var o = (function () { function t(t) { (this.disp = []), (this.positions = t.positions), (this.adjMatrix = t.adjMatrix), (this.focusID = t.focusID), (this.radii = t.radii), (this.iterations = t.iterations || 10), (this.height = t.height || 10), (this.width = t.width || 10), (this.speed = t.speed || 100), (this.gravity = t.gravity || 10), (this.nodeSizeFunc = t.nodeSizeFunc), (this.k = t.k || 5), (this.strictRadial = t.strictRadial), (this.nodes = t.nodes); } return ( (t.prototype.layout = function () { var t = this.positions, r = [], e = this.iterations, o = this.width / 10; (this.maxDisplace = o), (this.disp = r); for (var n = 0; n < e; n++) t.forEach(function (t, e) { r[e] = { x: 0, y: 0 }; }), this.getRepulsion(), this.updatePositions(); return t; }), (t.prototype.getRepulsion = function () { var t = this, r = t.positions, e = t.nodes, o = t.disp, n = t.k, i = t.radii || []; r.forEach(function (s, u) { (o[u] = { x: 0, y: 0 }), r.forEach(function (r, a) { if (u !== a && i[u] === i[a]) { var f = s[0] - r[0], c = s[1] - r[1], h = Math.sqrt(f * f + c * c); if (0 === h) { h = 1; var l = u > a ? 1 : -1; (f = 0.01 * l), (c = 0.01 * l); } if ( h < t.nodeSizeFunc(e[u]) / 2 + t.nodeSizeFunc(e[a]) / 2 ) { var p = (n * n) / h; (o[u].x += (f / h) * p), (o[u].y += (c / h) * p); } } }); }); }), (t.prototype.updatePositions = function () { var t = this.positions, r = this.disp, e = this.speed, o = this.strictRadial, n = this.focusID, i = this.maxDisplace || this.width / 10; o && r.forEach(function (r, e) { var o = t[e][0] - t[n][0], i = t[e][1] - t[n][1], s = Math.sqrt(o * o + i * i), u = i / s, a = -o / s, f = Math.sqrt(r.x * r.x + r.y * r.y), c = Math.acos((u * r.x + a * r.y) / f); c > Math.PI / 2 && ((c -= Math.PI / 2), (u *= -1), (a *= -1)); var h = Math.cos(c) * f; (r.x = u * h), (r.y = a * h); }); var s = this.radii; t.forEach(function (u, a) { if (a !== n) { var f = Math.sqrt(r[a].x * r[a].x + r[a].y * r[a].y); if (f > 0 && a !== n) { var c = Math.min(i * (e / 800), f); if ( ((u[0] += (r[a].x / f) * c), (u[1] += (r[a].y / f) * c), o) ) { var h = u[0] - t[n][0], l = u[1] - t[n][1], p = Math.sqrt(h * h + l * l); (h = (h / p) * s[a]), (l = (l / p) * s[a]), (u[0] = t[n][0] + h), (u[1] = t[n][1] + l); } } } }); }), t ); })(); r.default = o; }, 7: function (t, r, e) { "use strict"; Object.defineProperty(r, "__esModule", { value: !0 }), (r.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); r.Base = o; }, }).default; }); //# sourceMappingURL=radialLayout.js.map ================================================ FILE: packages/f6-wx/src/extends/layout/randomLayout.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.f6 = e()) : (t.f6 = e()); })(this, function () { return (function (t) { var e = {}; function n(o) { if (e[o]) return e[o].exports; var r = (e[o] = { i: o, l: !1, exports: {} }); return t[o].call(r.exports, r, r.exports, n), (r.l = !0), r.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, o) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: o }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var o = Object.create(null); if ( (n.r(o), Object.defineProperty(o, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var r in t) n.d( o, r, function (e) { return t[e]; }.bind(null, r), ); return o; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 413)) ); })({ 413: function (t, e, n) { "use strict"; n.r(e); var o = n(57); e.default = o.RandomLayout; }, 57: function (t, e, n) { "use strict"; var o, r = (this && this.__extends) || ((o = function (t, e) { return (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var i = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.center = [0, 0]), (n.width = 300), (n.height = 300), (n.nodes = []), (n.edges = []), (n.onLayoutEnd = function () {}), n.updateCfg(e), n ); } return ( r(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, n = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + n[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + n[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(n(7).Base); e.RandomLayout = i; }, 7: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var o = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function (t) {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = o; }, }).default; }); //# sourceMappingURL=randomLayout.js.map ================================================ FILE: packages/f6-wx/src/index.js ================================================ !(function (t, e) { "object" == typeof exports && "object" == typeof module ? (module.exports = e()) : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? (exports.F6 = e()) : (t.F6 = e()); })(this, function () { return (function (t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = (e[r] = { i: r, l: !1, exports: {} }); return t[r].call(i.exports, i, i.exports, n), (i.l = !0), i.exports; } return ( (n.m = t), (n.c = e), (n.d = function (t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }); }), (n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }); }), (n.t = function (t, e) { if ((1 & e && (t = n(t)), 8 & e)) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if ( (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) ) for (var i in t) n.d( r, i, function (e) { return t[e]; }.bind(null, i), ); return r; }), (n.n = function (t) { var e = t && t.__esModule ? function () { return t.default; } : function () { return t; }; return n.d(e, "a", e), e; }), (n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }), (n.p = ""), n((n.s = 205)) ); })({ 0: function (t, e, n) { "use strict"; n.r(e), n.d(e, "contains", function () { return i; }), n.d(e, "includes", function () { return i; }), n.d(e, "difference", function () { return a; }), n.d(e, "find", function () { return x; }), n.d(e, "findIndex", function () { return S; }), n.d(e, "firstValue", function () { return w; }), n.d(e, "flatten", function () { return O; }), n.d(e, "flattenDeep", function () { return M; }), n.d(e, "getRange", function () { return C; }), n.d(e, "pull", function () { return I; }), n.d(e, "pullAt", function () { return N; }), n.d(e, "reduce", function () { return B; }), n.d(e, "remove", function () { return L; }), n.d(e, "sortBy", function () { return _; }), n.d(e, "union", function () { return F; }), n.d(e, "uniq", function () { return R; }), n.d(e, "valuesOfKey", function () { return Y; }), n.d(e, "head", function () { return X; }), n.d(e, "last", function () { return z; }), n.d(e, "startsWith", function () { return W; }), n.d(e, "endsWith", function () { return q; }), n.d(e, "filter", function () { return o; }), n.d(e, "every", function () { return V; }), n.d(e, "some", function () { return G; }), n.d(e, "group", function () { return K; }), n.d(e, "groupBy", function () { return U; }), n.d(e, "groupToMap", function () { return Z; }), n.d(e, "getWrapBehavior", function () { return $; }), n.d(e, "wrapBehavior", function () { return Q; }), n.d(e, "number2color", function () { return tt; }), n.d(e, "parseRadius", function () { return et; }), n.d(e, "clamp", function () { return nt; }), n.d(e, "fixedBase", function () { return rt; }), n.d(e, "isDecimal", function () { return ot; }), n.d(e, "isEven", function () { return at; }), n.d(e, "isInteger", function () { return st; }), n.d(e, "isNegative", function () { return ct; }), n.d(e, "isNumberEqual", function () { return ut; }), n.d(e, "isOdd", function () { return ht; }), n.d(e, "isPositive", function () { return lt; }), n.d(e, "max", function () { return k; }), n.d(e, "maxBy", function () { return ft; }), n.d(e, "min", function () { return j; }), n.d(e, "minBy", function () { return dt; }), n.d(e, "mod", function () { return pt; }), n.d(e, "toDegree", function () { return vt; }), n.d(e, "toInteger", function () { return yt; }), n.d(e, "toRadian", function () { return bt; }), n.d(e, "forIn", function () { return xt; }), n.d(e, "has", function () { return St; }), n.d(e, "hasKey", function () { return wt; }), n.d(e, "hasValue", function () { return Mt; }), n.d(e, "keys", function () { return g; }), n.d(e, "isMatch", function () { return v; }), n.d(e, "values", function () { return Ot; }), n.d(e, "lowerCase", function () { return jt; }), n.d(e, "lowerFirst", function () { return Ct; }), n.d(e, "substitute", function () { return Et; }), n.d(e, "upperCase", function () { return Pt; }), n.d(e, "upperFirst", function () { return At; }), n.d(e, "getType", function () { return Tt; }), n.d(e, "isArguments", function () { return Nt; }), n.d(e, "isArray", function () { return l; }), n.d(e, "isArrayLike", function () { return r; }), n.d(e, "isBoolean", function () { return Bt; }), n.d(e, "isDate", function () { return Lt; }), n.d(e, "isError", function () { return Dt; }), n.d(e, "isFunction", function () { return u; }), n.d(e, "isFinite", function () { return _t; }), n.d(e, "isNil", function () { return h; }), n.d(e, "isNull", function () { return Rt; }), n.d(e, "isNumber", function () { return it; }), n.d(e, "isObject", function () { return d; }), n.d(e, "isObjectLike", function () { return m; }), n.d(e, "isPlainObject", function () { return b; }), n.d(e, "isPrototype", function () { return Yt; }), n.d(e, "isRegExp", function () { return Xt; }), n.d(e, "isString", function () { return D; }), n.d(e, "isType", function () { return c; }), n.d(e, "isUndefined", function () { return zt; }), n.d(e, "isElement", function () { return Wt; }), n.d(e, "requestAnimationFrame", function () { return qt; }), n.d(e, "clearAnimationFrame", function () { return Vt; }), n.d(e, "augment", function () { return Ut; }), n.d(e, "clone", function () { return Kt; }), n.d(e, "debounce", function () { return $t; }), n.d(e, "memoize", function () { return Qt; }), n.d(e, "deepMix", function () { return te; }), n.d(e, "each", function () { return p; }), n.d(e, "extend", function () { return ee; }), n.d(e, "indexOf", function () { return ne; }), n.d(e, "isEmpty", function () { return ie; }), n.d(e, "isEqual", function () { return oe; }), n.d(e, "isEqualWith", function () { return ae; }), n.d(e, "map", function () { return se; }), n.d(e, "mapValues", function () { return ue; }), n.d(e, "mix", function () { return Ht; }), n.d(e, "assign", function () { return Ht; }), n.d(e, "get", function () { return he; }), n.d(e, "set", function () { return le; }), n.d(e, "pick", function () { return de; }), n.d(e, "omit", function () { return pe; }), n.d(e, "throttle", function () { return ge; }), n.d(e, "toArray", function () { return ve; }), n.d(e, "toString", function () { return kt; }), n.d(e, "uniqueId", function () { return me; }), n.d(e, "noop", function () { return be; }), n.d(e, "identity", function () { return xe; }), n.d(e, "size", function () { return Se; }), n.d(e, "measureTextWidth", function () { return Me; }), n.d(e, "getEllipsisText", function () { return ke; }), n.d(e, "Cache", function () { return je; }); var r = function (t) { return null !== t && "function" != typeof t && isFinite(t.length); }, i = function (t, e) { return !!r(t) && t.indexOf(e) > -1; }, o = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; e(o, i) && n.push(o); } return n; }, a = function (t, e) { return ( void 0 === e && (e = []), o(t, function (t) { return !i(e, t); }) ); }, s = {}.toString, c = function (t, e) { return s.call(t) === "[object " + e + "]"; }, u = function (t) { return c(t, "Function"); }, h = function (t) { return null == t; }, l = function (t) { return Array.isArray ? Array.isArray(t) : c(t, "Array"); }; function f(t) { return (f = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var d = function (t) { var e = f(t); return (null !== t && "object" === e) || "function" === e; }; var p = function (t, e) { if (t) if (l(t)) for (var n = 0, r = t.length; n < r && !1 !== e(t[n], n); n++); else if (d(t)) for (var i in t) if (t.hasOwnProperty(i) && !1 === e(t[i], i)) break; }, g = Object.keys ? function (t) { return Object.keys(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(r); }), e ); }; var v = function (t, e) { var n = g(e), r = n.length; if (h(t)) return !r; for (var i = 0; i < r; i += 1) { var o = n[i]; if (e[o] !== t[o] || !(o in t)) return !1; } return !0; }; function y(t) { return (y = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var m = function (t) { return "object" === y(t) && null !== t; }, b = function (t) { if (!m(t) || !c(t, "Object")) return !1; if (null === Object.getPrototypeOf(t)) return !0; for (var e = t; null !== Object.getPrototypeOf(e); ) e = Object.getPrototypeOf(e); return Object.getPrototypeOf(t) === e; }; var x = function (t, e) { if (!l(t)) return null; var n; if ( (u(e) && (n = e), b(e) && (n = function (t) { return v(t, e); }), n) ) for (var r = 0; r < t.length; r += 1) if (n(t[r])) return t[r]; return null; }; var S = function (t, e, n) { void 0 === n && (n = 0); for (var r = n; r < t.length; r++) if (e(t[r], r)) return r; return -1; }, w = function (t, e) { for (var n = null, r = 0; r < t.length; r++) { var i = t[r][e]; if (!h(i)) { n = l(i) ? i[0] : i; break; } } return n; }, O = function (t) { if (!l(t)) return []; for (var e = [], n = 0; n < t.length; n++) e = e.concat(t[n]); return e; }, M = function t(e, n) { if ((void 0 === n && (n = []), l(e))) for (var r = 0; r < e.length; r += 1) t(e[r], n); else n.push(e); return n; }, k = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.max(t, e); }, t[0]); }, j = function (t) { if (l(t)) return t.reduce(function (t, e) { return Math.min(t, e); }, t[0]); }, C = function (t) { var e = t.filter(function (t) { return !isNaN(t); }); if (!e.length) return { min: 0, max: 0 }; if (l(t[0])) { for (var n = [], r = 0; r < t.length; r++) n = n.concat(t[r]); e = n; } var i = k(e); return { min: j(e), max: i }; }, E = Array.prototype, P = E.splice, A = E.indexOf, I = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r++) for (var i = e[r], o = -1; (o = A.call(t, i)) > -1; ) P.call(t, o, 1); return t; }, T = Array.prototype.splice, N = function (t, e) { if (!r(t)) return []; for (var n = t ? e.length : 0, i = n - 1; n--; ) { var o = void 0, a = e[n]; (n !== i && a === o) || ((o = a), T.call(t, a, 1)); } return t; }, B = function (t, e, n) { if (!l(t) && !b(t)) return t; var r = n; return ( p(t, function (t, n) { r = e(r, t, n); }), r ); }, L = function (t, e) { var n = []; if (!r(t)) return n; for (var i = -1, o = [], a = t.length; ++i < a; ) { var s = t[i]; e(s, i, t) && (n.push(s), o.push(i)); } return N(t, o), n; }, D = function (t) { return c(t, "String"); }; var _ = function (t, e) { var n; if (u(e)) n = function (t, n) { return e(t) - e(n); }; else { var r = []; D(e) ? r.push(e) : l(e) && (r = e), (n = function (t, e) { for (var n = 0; n < r.length; n += 1) { var i = r[n]; if (t[i] > e[i]) return 1; if (t[i] < e[i]) return -1; } return 0; }); } return t.sort(n), t; }; function R(t, e) { void 0 === e && (e = new Map()); var n = []; if (Array.isArray(t)) for (var r = 0, i = t.length; r < i; r++) { var o = t[r]; e.has(o) || (n.push(o), e.set(o, !0)); } return n; } var F = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return R([].concat.apply([], t)); }, Y = function (t, e) { for (var n = [], r = {}, i = 0; i < t.length; i++) { var o = t[i][e]; if (!h(o)) { l(o) || (o = [o]); for (var a = 0; a < o.length; a++) { var s = o[a]; r[s] || (n.push(s), (r[s] = !0)); } } } return n; }; function X(t) { if (r(t)) return t[0]; } function z(t) { if (r(t)) { return t[t.length - 1]; } } var W = function (t, e) { return !(!l(t) && !D(t)) && t[0] === e; }; var q = function (t, e) { return !(!l(t) && !D(t)) && t[t.length - 1] === e; }, V = function (t, e) { for (var n = 0; n < t.length; n++) if (!e(t[n], n)) return !1; return !0; }, G = function (t, e) { for (var n = 0; n < t.length; n++) if (e(t[n], n)) return !0; return !1; }, H = Object.prototype.hasOwnProperty; var U = function (t, e) { if (!e || !l(t)) return {}; for ( var n, r = {}, i = u(e) ? e : function (t) { return t[e]; }, o = 0; o < t.length; o++ ) { var a = t[o]; (n = i(a)), H.call(r, n) ? r[n].push(a) : (r[n] = [a]); } return r; }; function Z(t, e) { if (!e) return { 0: t }; if (!u(e)) { var n = l(e) ? e : e.replace(/\s+/g, "").split("*"); e = function (t) { for (var e = "_", r = 0, i = n.length; r < i; r++) e += t[n[r]] && t[n[r]].toString(); return e; }; } return U(t, e); } var K = function (t, e) { if (!e) return [t]; var n = Z(t, e), r = []; for (var i in n) r.push(n[i]); return r; }; var $ = function (t, e) { return t["_wrap_" + e]; }; var Q = function (t, e) { if (t["_wrap_" + e]) return t["_wrap_" + e]; var n = function (n) { t[e](n); }; return (t["_wrap_" + e] = n), n; }, J = {}; var tt = function (t) { var e = J[t]; if (!e) { for (var n = t.toString(16), r = n.length; r < 6; r++) n = "0" + n; (e = "#" + n), (J[t] = e); } return e; }; var et = function (t) { var e = 0, n = 0, r = 0, i = 0; return ( l(t) ? 1 === t.length ? (e = n = r = i = t[0]) : 2 === t.length ? ((e = r = t[0]), (n = i = t[1])) : 3 === t.length ? ((e = t[0]), (n = i = t[1]), (r = t[2])) : ((e = t[0]), (n = t[1]), (r = t[2]), (i = t[3])) : (e = n = r = i = t), { r1: e, r2: n, r3: r, r4: i } ); }, nt = function (t, e, n) { return t < e ? e : t > n ? n : t; }, rt = function (t, e) { var n = e.toString(), r = n.indexOf("."); if (-1 === r) return Math.round(t); var i = n.substr(r + 1).length; return i > 20 && (i = 20), parseFloat(t.toFixed(i)); }, it = function (t) { return c(t, "Number"); }, ot = function (t) { return it(t) && t % 1 != 0; }, at = function (t) { return it(t) && t % 2 == 0; }, st = Number.isInteger ? Number.isInteger : function (t) { return it(t) && t % 1 == 0; }, ct = function (t) { return it(t) && t < 0; }; function ut(t, e, n) { return void 0 === n && (n = 1e-5), Math.abs(t - e) < n; } var ht = function (t) { return it(t) && t % 2 != 0; }, lt = function (t) { return it(t) && t > 0; }, ft = function (t, e) { if (l(t)) { for (var n, r = -1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a > r && ((n = o), (r = a)); } return n; } }, dt = function (t, e) { if (l(t)) { for (var n, r = 1 / 0, i = 0; i < t.length; i++) { var o = t[i], a = u(e) ? e(o) : o[e]; a < r && ((n = o), (r = a)); } return n; } }, pt = function (t, e) { return ((t % e) + e) % e; }, gt = 180 / Math.PI, vt = function (t) { return gt * t; }, yt = parseInt, mt = Math.PI / 180, bt = function (t) { return mt * t; }, xt = p, St = function (t, e) { return t.hasOwnProperty(e); }, wt = St, Ot = Object.values ? function (t) { return Object.values(t); } : function (t) { var e = []; return ( p(t, function (n, r) { (u(t) && "prototype" === r) || e.push(n); }), e ); }, Mt = function (t, e) { return i(Ot(t), e); }, kt = function (t) { return h(t) ? "" : t.toString(); }, jt = function (t) { return kt(t).toLowerCase(); }, Ct = function (t) { var e = kt(t); return e.charAt(0).toLowerCase() + e.substring(1); }; var Et = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { return "\\" === t.charAt(0) ? t.slice(1) : void 0 === e[n] ? "" : e[n]; }) : t; }, Pt = function (t) { return kt(t).toUpperCase(); }, At = function (t) { var e = kt(t); return e.charAt(0).toUpperCase() + e.substring(1); }, It = {}.toString, Tt = function (t) { return It.call(t) .replace(/^\[object /, "") .replace(/]$/, ""); }, Nt = function (t) { return c(t, "Arguments"); }, Bt = function (t) { return c(t, "Boolean"); }, Lt = function (t) { return c(t, "Date"); }, Dt = function (t) { return c(t, "Error"); }, _t = function (t) { return it(t) && isFinite(t); }, Rt = function (t) { return null === t; }, Ft = Object.prototype, Yt = function (t) { var e = t && t.constructor; return t === (("function" == typeof e && e.prototype) || Ft); }, Xt = function (t) { return c(t, "RegExp"); }, zt = function (t) { return void 0 === t; }, Wt = function (t) { return t instanceof Element || t instanceof HTMLDocument; }; function qt(t) { return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (t) { return setTimeout(t, 16); } )(t); } function Vt(t) { ( window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.msCancelAnimationFrame || clearTimeout )(t); } function Gt(t, e) { for (var n in e) e.hasOwnProperty(n) && "constructor" !== n && void 0 !== e[n] && (t[n] = e[n]); } function Ht(t, e, n, r) { return e && Gt(t, e), n && Gt(t, n), r && Gt(t, r), t; } var Ut = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; for (var n = t[0], r = 1; r < t.length; r++) { var i = t[r]; u(i) && (i = i.prototype), Ht(n.prototype, i); } }; function Zt(t) { return (Zt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Kt = function t(e) { if ("object" !== Zt(e) || null === e) return e; var n; if (l(e)) { n = []; for (var r = 0, i = e.length; r < i; r++) "object" === Zt(e[r]) && null != e[r] ? (n[r] = t(e[r])) : (n[r] = e[r]); } else for (var o in ((n = {}), e)) "object" === Zt(e[o]) && null != e[o] ? (n[o] = t(e[o])) : (n[o] = e[o]); return n; }; var $t = function (t, e, n) { var r; return function () { var i = this, o = arguments, a = function () { (r = null), n || t.apply(i, o); }, s = n && !r; clearTimeout(r), (r = setTimeout(a, e)), s && t.apply(i, o); }; }, Qt = function (t, e) { if (!u(t)) throw new TypeError("Expected a function"); var n = function n() { for (var r = [], i = 0; i < arguments.length; i++) r[i] = arguments[i]; var o = e ? e.apply(this, r) : r[0], a = n.cache; if (a.has(o)) return a.get(o); var s = t.apply(this, r); return a.set(o, s), s; }; return (n.cache = new Map()), n; }; function Jt(t, e, n, r) { for (var i in ((n = n || 0), (r = r || 5), e)) if (e.hasOwnProperty(i)) { var o = e[i]; null !== o && b(o) ? (b(t[i]) || (t[i] = {}), n < r ? Jt(t[i], o, n + 1, r) : (t[i] = e[i])) : l(o) ? ((t[i] = []), (t[i] = t[i].concat(o))) : void 0 !== o && (t[i] = o); } } var te = function (t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0; r < e.length; r += 1) Jt(t, e[r]); return t; }, ee = function (t, e, n, r) { u(e) || ((n = e), (e = t), (t = function () {})); var i = Object.create ? function (t, e) { return Object.create(t, { constructor: { value: e } }); } : function (t, e) { function n() {} n.prototype = t; var r = new n(); return (r.constructor = e), r; }, o = i(e.prototype, t); return ( (t.prototype = Ht(o, t.prototype)), (t.superclass = i(e.prototype, e)), Ht(o, n), Ht(t, r), t ); }, ne = function (t, e) { if (!r(t)) return -1; var n = Array.prototype.indexOf; if (n) return n.call(t, e); for (var i = -1, o = 0; o < t.length; o++) if (t[o] === e) { i = o; break; } return i; }, re = Object.prototype.hasOwnProperty; var ie = function (t) { if (h(t)) return !0; if (r(t)) return !t.length; var e = Tt(t); if ("Map" === e || "Set" === e) return !t.size; if (Yt(t)) return !Object.keys(t).length; for (var n in t) if (re.call(t, n)) return !1; return !0; }, oe = function t(e, n) { if (e === n) return !0; if (!e || !n) return !1; if (D(e) || D(n)) return !1; if (r(e) || r(n)) { if (e.length !== n.length) return !1; for (var i = !0, o = 0; o < e.length && (i = t(e[o], n[o])); o++); return i; } if (m(e) || m(n)) { var a = Object.keys(e), s = Object.keys(n); if (a.length !== s.length) return !1; for (i = !0, o = 0; o < a.length && (i = t(e[a[o]], n[a[o]])); o++); return i; } return !1; }, ae = function (t, e, n) { return u(n) ? !!n(t, e) : oe(t, e); }, se = function (t, e) { if (!r(t)) return t; for (var n = [], i = 0; i < t.length; i++) { var o = t[i]; n.push(e(o, i)); } return n; }, ce = function (t) { return t; }, ue = function (t, e) { void 0 === e && (e = ce); var n = {}; return ( d(t) && !h(t) && Object.keys(t).forEach(function (r) { n[r] = e(t[r], r); }), n ); }, he = function (t, e, n) { for (var r = 0, i = D(e) ? e.split(".") : e; t && r < i.length; ) t = t[i[r++]]; return void 0 === t || r < i.length ? n : t; }, le = function (t, e, n) { var r = t, i = D(e) ? e.split(".") : e; return ( i.forEach(function (t, e) { e < i.length - 1 ? (d(r[t]) || (r[t] = it(i[e + 1]) ? [] : {}), (r = r[t])) : (r[t] = n); }), t ); }, fe = Object.prototype.hasOwnProperty, de = function (t, e) { if (null === t || !b(t)) return {}; var n = {}; return ( p(e, function (e) { fe.call(t, e) && (n[e] = t[e]); }), n ); }, pe = function (t, e) { return B( t, function (t, n, r) { return e.includes(r) || (t[r] = n), t; }, {}, ); }, ge = function (t, e, n) { var r, i, o, a, s = 0; n || (n = {}); var c = function () { (s = !1 === n.leading ? 0 : Date.now()), (r = null), (a = t.apply(i, o)), r || (i = o = null); }, u = function () { var u = Date.now(); s || !1 !== n.leading || (s = u); var h = e - (u - s); return ( (i = this), (o = arguments), h <= 0 || h > e ? (r && (clearTimeout(r), (r = null)), (s = u), (a = t.apply(i, o)), r || (i = o = null)) : r || !1 === n.trailing || (r = setTimeout(c, h)), a ); }; return ( (u.cancel = function () { clearTimeout(r), (s = 0), (r = i = o = null); }), u ); }, ve = function (t) { return r(t) ? Array.prototype.slice.call(t) : []; }, ye = {}, me = function (t) { return ye[(t = t || "g")] ? (ye[t] += 1) : (ye[t] = 1), t + ye[t]; }, be = function () {}, xe = function (t) { return t; }; function Se(t) { return h(t) ? 0 : r(t) ? t.length : Object.keys(t).length; } var we, Oe = n(1), Me = Qt( function (t, e) { void 0 === e && (e = {}); var n = e.fontSize, r = e.fontFamily, i = e.fontWeight, o = e.fontStyle, a = e.fontVariant; return ( we || (we = document.createElement("canvas").getContext("2d")), (we.font = [o, a, i, n + "px", r].join(" ")), we.measureText(D(t) ? t : "").width ); }, function (t, e) { return void 0 === e && (e = {}), Object(Oe.g)([t], Ot(e)).join(""); }, ), ke = function (t, e, n, r) { void 0 === r && (r = "..."); var i, o, a = Me(r, n), s = D(t) ? t : kt(t), c = e, u = []; if (Me(t, n) <= e) return t; for (; (i = s.substr(0, 16)), !((o = Me(i, n)) + a > c && o > c); ) if ((u.push(i), (c -= o), !(s = s.substr(16)))) return u.join(""); for (; (i = s.substr(0, 1)), !((o = Me(i, n)) + a > c); ) if ((u.push(i), (c -= o), !(s = s.substr(1)))) return u.join(""); return "" + u.join("") + r; }, je = (function () { function t() { this.map = {}; } return ( (t.prototype.has = function (t) { return void 0 !== this.map[t]; }), (t.prototype.get = function (t, e) { var n = this.map[t]; return void 0 === n ? e : n; }), (t.prototype.set = function (t, e) { this.map[t] = e; }), (t.prototype.clear = function () { this.map = {}; }), (t.prototype.delete = function (t) { delete this.map[t]; }), (t.prototype.size = function () { return Object.keys(this.map).length; }), t ); })(); }, 1: function (t, e, n) { "use strict"; n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }), n.d(e, "e", function () { return a; }), n.d(e, "b", function () { return s; }), n.d(e, "d", function () { return c; }), n.d(e, "g", function () { return u; }), n.d(e, "f", function () { return h; }); var r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }; function i(t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); } var o = function () { return (o = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function a(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } function s(t, e, n, r) { return new (n || (n = Promise))(function (i, o) { function a(t) { try { c(r.next(t)); } catch (t) { o(t); } } function s(t) { try { c(r.throw(t)); } catch (t) { o(t); } } function c(t) { var e; t.done ? i(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } c((r = r.apply(t, e || [])).next()); }); } function c(t, e) { var n, r, i, o, a = { label: 0, sent: function () { if (1 & i[0]) throw i[1]; return i[1]; }, trys: [], ops: [], }; return ( (o = { next: s(0), throw: s(1), return: s(2) }), "function" == typeof Symbol && (o[Symbol.iterator] = function () { return this; }), o ); function s(s) { return function (c) { return (function (s) { if (n) throw new TypeError("Generator is already executing."); for (; o && ((o = 0), s[0] && (a = 0)), a; ) try { if ( ((n = 1), r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) ) return i; switch (((r = 0), i && (s = [2 & s[0], i.value]), s[0])) { case 0: case 1: i = s; break; case 4: return a.label++, { value: s[1], done: !1 }; case 5: a.label++, (r = s[1]), (s = [0]); continue; case 7: (s = a.ops.pop()), a.trys.pop(); continue; default: if ( !((i = a.trys), (i = i.length > 0 && i[i.length - 1]) || (6 !== s[0] && 2 !== s[0])) ) { a = 0; continue; } if (3 === s[0] && (!i || (s[1] > i[0] && s[1] < i[3]))) { a.label = s[1]; break; } if (6 === s[0] && a.label < i[1]) { (a.label = i[1]), (i = s); break; } if (i && a.label < i[2]) { (a.label = i[2]), a.ops.push(s); break; } i[2] && a.ops.pop(), a.trys.pop(); continue; } s = e.call(t, a); } catch (t) { (s = [6, t]), (r = 0); } finally { n = i = 0; } if (5 & s[0]) throw s[1]; return { value: s[0] ? s[1] : void 0, done: !0 }; })([s, c]); }; } } Object.create; function u() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t), i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r; } function h(t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); } Object.create; }, 11: function (t, e, n) { "use strict"; var r = n(1), i = n(8), o = n(3), a = n(12), s = n(31), c = n(52), u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(r.a)(Object(r.a)({}, e), { lineWidth: 1, lineAppendWidth: 0, strokeOpacity: 1, fillOpacity: 1, }); }), (e.prototype.getShapeBase = function () { return s; }), (e.prototype.getGroupBase = function () { return c.a; }), (e.prototype.onCanvasChange = function (t) { Object(a.h)(this, t); }), (e.prototype.calculateBBox = function () { var t = this.get("type"), e = this.getHitLineWidth(), n = Object(i.getBBoxMethod)(t)(this), r = e / 2, o = n.x - r, a = n.y - r, s = n.x + n.width + r, c = n.y + n.height + r; return { x: o, minX: o, y: a, minY: a, width: n.width + e, height: n.height + e, maxX: s, maxY: c, }; }), (e.prototype.isFill = function () { return !!this.attrs.fill || this.isClipShape(); }), (e.prototype.isStroke = function () { return !!this.attrs.stroke; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), Object(a.a)(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.draw = function (t, e) { var n = this.cfg.clipShape; if (e) { if (!1 === this.cfg.refresh) return void this.set("hasChanged", !1); var r = this.getCanvasBBox(); if (!Object(o.e)(e, r)) return ( this.set("hasChanged", !1), void (this.cfg.isInView && this._afterDraw()) ); } t.save(), Object(a.a)(t, this), this._applyClip(t, n), this.drawPath(t), t.restore(), this._afterDraw(); }), (e.prototype.getCanvasViewBox = function () { var t = this.cfg.canvas; return t ? t.getViewRange() : null; }), (e.prototype.cacheCanvasBBox = function () { var t = this.getCanvasViewBox(); if (t) { var e = this.getCanvasBBox(), n = Object(o.e)(e, t); this.set("isInView", n), n ? this.set("cacheCanvasBBox", e) : this.set("cacheCanvasBBox", null); } }), (e.prototype._afterDraw = function () { this.cacheCanvasBBox(), this.set("hasChanged", !1), this.set("refresh", null); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("isInView", null), this.set("hasChanged", !1); }), (e.prototype.drawPath = function (t) { this.createPath(t), this.strokeAndFill(t), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { t.fill(); }), (e.prototype.stroke = function (t) { t.stroke(); }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, a = e.fillOpacity; this.isFill() && (Object(o.h)(a) || 1 === a ? this.fill(t) : ((t.globalAlpha = a), this.fill(t), (t.globalAlpha = r))), this.isStroke() && n > 0 && (Object(o.h)(i) || 1 === i || (t.globalAlpha = i), this.stroke(t)), this.afterDrawPath(t); }), (e.prototype.createPath = function (t) {}), (e.prototype.afterDrawPath = function (t) {}), (e.prototype.isInShape = function (t, e) { var n = this.isStroke(), r = this.isFill(), i = this.getHitLineWidth(); return this.isInStrokeOrPath(t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !1; }), (e.prototype.getHitLineWidth = function () { if (!this.isStroke()) return 0; var t = this.attrs; return t.lineWidth + t.lineAppendWidth; }), e ); })(i.AbstractShape); e.a = u; }, 118: function (t, e, n) { "use strict"; n.d(e, "a", function () { return o; }), n.d(e, "b", function () { return i; }); var r = new Map(); function i(t, e) { r.set(t, e); } function o(t) { return r.get(t); } var a = function (t) { var e = t.attr(); return { x: e.x, y: e.y, width: e.width, height: e.height }; }, s = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.r; return { x: n - i, y: r - i, width: 2 * i, height: 2 * i }; }, c = n(9); function u(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function h(t, e) { var n = t.get("startArrowShape"), r = t.get("endArrowShape"); return ( n && (e = u(e, n.getCanvasBBox())), r && (e = u(e, r.getCanvasBBox())), e ); } var l = n(46), f = n(28), d = n(0); function p(t, e) { var n = t.prePoint, r = t.currentPoint, i = t.nextPoint, o = Math.pow(r[0] - n[0], 2) + Math.pow(r[1] - n[1], 2), a = Math.pow(r[0] - i[0], 2) + Math.pow(r[1] - i[1], 2), s = Math.pow(n[0] - i[0], 2) + Math.pow(n[1] - i[1], 2), c = Math.acos((o + a - s) / (2 * Math.sqrt(o) * Math.sqrt(a))); if (!c || 0 === Math.sin(c) || Object(d.isNumberEqual)(c, 0)) return { xExtra: 0, yExtra: 0 }; var u = Math.abs(Math.atan2(i[1] - r[1], i[0] - r[0])), h = Math.abs(Math.atan2(i[0] - r[0], i[1] - r[1])); return ( (u = u > Math.PI / 2 ? Math.PI - u : u), (h = h > Math.PI / 2 ? Math.PI - h : h), { xExtra: Math.cos(c / 2 - u) * ((e / 2) * (1 / Math.sin(c / 2))) - e / 2 || 0, yExtra: Math.cos(h - c / 2) * ((e / 2) * (1 / Math.sin(c / 2))) - e / 2 || 0, } ); } i("rect", a), i("image", a), i("circle", s), i("marker", s), i("polyline", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } var a = c.f.getBBoxByArray(n, r), s = a.x, u = a.y, l = { minX: s, minY: u, maxX: s + a.width, maxY: u + a.height }; return { x: (l = h(t, l)).minX, y: l.minY, width: l.maxX - l.minX, height: l.maxY - l.minY, }; }), i("polygon", function (t) { for ( var e = t.attr().points, n = [], r = [], i = 0; i < e.length; i++ ) { var o = e[i]; n.push(o[0]), r.push(o[1]); } return c.f.getBBoxByArray(n, r); }), i("text", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Object(l.a)(e)); var c, u = Object(l.c)(i, s); if (u) { var h = e.textAlign, f = e.textBaseline, d = Object(l.b)(i, o, a), p = { x: n, y: r - d }; h && ("end" === h || "right" === h ? (p.x -= u) : "center" === h && (p.x -= u / 2)), f && ("top" === f ? (p.y += d) : "middle" === f && (p.y += d / 2)), (c = { x: p.x, y: p.y, width: u, height: d }); } else c = { x: n, y: r, width: 0, height: 0 }; return c; }), i("path", function (t) { var e = t.attr(), n = e.path, r = e.stroke ? e.lineWidth : 0, i = (function (t, e) { for (var n = [], r = [], i = [], o = 0; o < t.length; o++) { var a = (m = t[o]).currentPoint, s = m.params, u = m.prePoint, h = void 0; switch (m.command) { case "Q": h = c.e.box(u[0], u[1], s[1], s[2], s[3], s[4]); break; case "C": h = c.b.box(u[0], u[1], s[1], s[2], s[3], s[4], s[5], s[6]); break; case "A": var l = m.arcParams; h = c.a.box( l.cx, l.cy, l.rx, l.ry, l.xRotation, l.startAngle, l.endAngle, ); break; default: n.push(a[0]), r.push(a[1]); } h && ((m.box = h), n.push(h.x, h.x + h.width), r.push(h.y, h.y + h.height)), e && ("L" === m.command || "M" === m.command) && m.prePoint && m.nextPoint && i.push(m); } (n = n.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })), (r = r.filter(function (t) { return !Number.isNaN(t) && t !== 1 / 0 && t !== -1 / 0; })); var f = Object(d.min)(n), g = Object(d.min)(r), v = Object(d.max)(n), y = Object(d.max)(r); if (0 === i.length) return { x: f, y: g, width: v - f, height: y - g }; for (o = 0; o < i.length; o++) { var m; (a = (m = i[o]).currentPoint)[0] === f ? (f -= p(m, e).xExtra) : a[0] === v && (v += p(m, e).xExtra), a[1] === g ? (g -= p(m, e).yExtra) : a[1] === y && (y += p(m, e).yExtra); } return { x: f, y: g, width: v - f, height: y - g }; })(t.get("segments") || Object(f.d)(n), r), o = i.x, a = i.y, s = { minX: o, minY: a, maxX: o + i.width, maxY: a + i.height }; return { x: (s = h(t, s)).minX, y: s.minY, width: s.maxX - s.minX, height: s.maxY - s.minY, }; }), i("line", function (t) { var e = t.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = { minX: Math.min(n, i), maxX: Math.max(n, i), minY: Math.min(r, o), maxY: Math.max(r, o), }; return { x: (a = h(t, a)).minX, y: a.minY, width: a.maxX - a.minX, height: a.maxY - a.minY, }; }), i("ellipse", function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; return { x: n - i, y: r - o, width: 2 * i, height: 2 * o }; }); }, 119: function (t, e, n) { "use strict"; var r = n(1), i = n(2), o = (n(8), n(35)), a = n(96), s = n(33), c = n(22), u = n(41), h = (n(423), n(424), n(127), n(128), { version: c.a.version, Graph: a.a, Util: u.a, Layout: s.a, Layouts: s.b, registerLayout: s.c, unRegisterLayout: s.d, Global: c.a, registerBehavior: i.i, registerCombo: i.j, registerEdge: i.k, registerNode: i.l, Algorithm: o, Arrow: i.d, Marker: i.f, Shape: i.g, }); var l, f = ((l = a.b), function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return l.apply(null, Object(r.g)(t, [h])); }); (h.registerGraph = f), (e.default = h); }, 12: function (t, e, n) { "use strict"; n.d(e, "a", function () { return u; }), n.d(e, "d", function () { return h; }), n.d(e, "b", function () { return l; }), n.d(e, "c", function () { return f; }), n.d(e, "e", function () { return g; }), n.d(e, "h", function () { return v; }), n.d(e, "f", function () { return y; }), n.d(e, "g", function () { return m; }); var r = n(0), i = n(94), o = n(63), a = n(3), s = n(23), c = { fill: "fillStyle", stroke: "strokeStyle", opacity: "globalAlpha", }; function u(t, e) { var n = e.attr(); for (var o in n) { var a = n[o], s = c[o] ? c[o] : o; "matrix" === s && a ? t.transform(a[0], a[1], a[3], a[4], a[6], a[7]) : "lineDash" === s && t.setLineDash ? Object(r.isArray)(a) && t.setLineDash(a) : ("strokeStyle" === s || "fillStyle" === s ? (a = Object(i.b)(t, e, a)) : "globalAlpha" === s && (a *= t.globalAlpha), (t[s] = a)); } } function h(t, e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; i.cfg.visible ? i.draw(t, n) : i.skipDraw(); } } function l(t, e, n) { var i = t.get("refreshElements"); Object(r.each)(i, function (e) { if (e !== t) for (var n = e.cfg.parent; n && n !== t && !n.cfg.refresh; ) (n.cfg.refresh = !0), (n = n.cfg.parent); }), i[0] === t ? d(e, n) : (function t(e, n) { for (var r = 0; r < e.length; r++) { var i = e[r]; if (i.cfg.visible) if (i.cfg.hasChanged) (i.cfg.refresh = !0), i.isGroup() && d(i.cfg.children, n); else if (i.cfg.refresh) i.isGroup() && t(i.cfg.children, n); else { var o = p(i, n); (i.cfg.refresh = o), o && i.isGroup() && t(i.cfg.children, n); } } })(e, n); } function f(t) { for (var e = 0; e < t.length; e++) { var n = t[e]; (n.cfg.hasChanged = !1), n.isGroup() && !n.destroyed && f(n.cfg.children); } } function d(t, e) { for (var n = 0; n < t.length; n++) { var r = t[n]; (r.cfg.refresh = !0), r.isGroup() && d(r.get("children"), e); } } function p(t, e) { var n = t.cfg.cacheCanvasBBox; return t.cfg.isInView && n && Object(a.e)(n, e); } function g(t, e, n, r) { var i = n.path, a = n.startArrow, c = n.endArrow; if (i) { var u = [0, 0], h = [0, 0], l = { dx: 0, dy: 0 }; e.beginPath(); for (var f = 0; f < i.length; f++) { var d = i[f], p = d[0]; if (0 === f && a && a.d) { var g = t.getStartTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], a.d); } else if (f === i.length - 2 && "Z" === i[f + 1][0] && c && c.d) { if ("Z" === i[f + 1][0]) { g = t.getEndTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], c.d); } } else if (f === i.length - 1 && c && c.d && "Z" !== i[0]) { g = t.getEndTangent(); l = s.c(g[0][0], g[0][1], g[1][0], g[1][1], c.d); } var v = l.dx, y = l.dy; switch (p) { case "M": e.moveTo(d[1] - v, d[2] - y), (h = [d[1], d[2]]); break; case "L": e.lineTo(d[1] - v, d[2] - y); break; case "Q": e.quadraticCurveTo(d[1], d[2], d[3] - v, d[4] - y); break; case "C": e.bezierCurveTo(d[1], d[2], d[3], d[4], d[5] - v, d[6] - y); break; case "A": var m = void 0; r ? (m = r[f]) || ((m = Object(o.a)(u, d)), (r[f] = m)) : (m = Object(o.a)(u, d)); var b = m.cx, x = m.cy, S = m.rx, w = m.ry, O = m.startAngle, M = m.endAngle, k = m.xRotation, j = m.sweepFlag; if (e.ellipse) e.ellipse(b, x, S, w, k, O, M, 1 - j); else { var C = S > w ? S : w, E = S > w ? 1 : S / w, P = S > w ? w / S : 1; e.translate(b, x), e.rotate(k), e.scale(E, P), e.arc(0, 0, C, O, M, 1 - j), e.scale(1 / E, 1 / P), e.rotate(-k), e.translate(-b, -x); } break; case "Z": e.closePath(); } if ("Z" === p) u = h; else { var A = d.length; u = [d[A - 2], d[A - 1]]; } } } } function v(t, e) { var n = t.get("canvas"); n && ("remove" === e && (t._cacheCanvasBBox = t.get("cacheCanvasBBox")), t.get("hasChanged") || (t.set("hasChanged", !0), (t.cfg.parent && t.cfg.parent.get("hasChanged")) || (n.refreshElement(t, e, n), n.get("autoDraw") && n.draw()))); } function y(t) { if (!t.length) return null; var e = [], n = [], i = [], o = []; return ( Object(r.each)(t, function (t) { var r = (function (t) { var e; if (t.destroyed) e = t._cacheCanvasBBox; else { var n = t.get("cacheCanvasBBox"), r = n && !(!n.width || !n.height), i = t.getCanvasBBox(), o = i && !(!i.width || !i.height); r && o ? (e = Object(a.l)(n, i)) : r ? (e = n) : o && (e = i); } return e; })(t); r && (e.push(r.minX), n.push(r.minY), i.push(r.maxX), o.push(r.maxY)); }), { minX: Math.min.apply(null, e), minY: Math.min.apply(null, n), maxX: Math.max.apply(null, i), maxY: Math.max.apply(null, o), } ); } function m(t, e) { return t && e && Object(a.e)(t, e) ? { minX: Math.max(t.minX, e.minX), minY: Math.max(t.minY, e.minY), maxX: Math.min(t.maxX, e.maxX), maxY: Math.min(t.maxY, e.maxY), } : null; } }, 120: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.assembleFont = e.getTextWidth = e.getLineSpaceing = e.getTextHeight = void 0); var r = n(207), i = n(208); function o(t, e) { return e ? e - t : 0.14 * t; } (e.getTextHeight = function (t, e, n) { var i = 1; return ( r.isString(t) && (i = t.split("\n").length), i > 1 ? e * i + o(e, n) * (i - 1) : e ); }), (e.getLineSpaceing = o), (e.getTextWidth = function (t, e) { var n = i.getOffScreenContext(), o = 0; if (r.isNil(t) || "" === t) return o; if ((n.save(), (n.font = e), r.isString(t) && t.includes("\n"))) { var a = t.split("\n"); r.each(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; }), (e.assembleFont = function (t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); }); }, 122: function (t, e) {}, 123: function (t, e) {}, 124: function (t, e, n) { "use strict"; var r = n(1), i = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.isGroup = function () { return !0; }), (e.prototype.isEntityGroup = function () { return !1; }), (e.prototype.clone = function () { for ( var e = t.prototype.clone.call(this), n = this.getChildren(), r = 0; r < n.length; r++ ) { var i = n[r]; e.add(i.clone()); } return e; }), e ); })(n(92).a); e.a = i; }, 125: function (t, e, n) { "use strict"; var r = n(1), i = n(93), o = n(25), a = (function (t) { function e(e) { return t.call(this, e) || this; } return ( Object(r.c)(e, t), (e.prototype._isInBBox = function (t, e) { var n = this.getBBox(); return n.minX <= t && n.maxX >= t && n.minY <= e && n.maxY >= e; }), (e.prototype.afterAttrsChange = function (e) { t.prototype.afterAttrsChange.call(this, e), this.clearCacheBBox(); }), (e.prototype.getBBox = function () { var t = this.cfg.bbox; return t || ((t = this.calculateBBox()), this.set("bbox", t)), t; }), (e.prototype.getCanvasBBox = function () { var t = this.cfg.canvasBBox; return ( t || ((t = this.calculateCanvasBBox()), this.set("canvasBBox", t)), t ); }), (e.prototype.applyMatrix = function (e) { t.prototype.applyMatrix.call(this, e), this.set("canvasBBox", null); }), (e.prototype.calculateCanvasBBox = function () { var t = this.getBBox(), e = this.getTotalMatrix(), n = t.minX, r = t.minY, i = t.maxX, a = t.maxY; if (e) { var s = Object(o.c)(e, [t.minX, t.minY]), c = Object(o.c)(e, [t.maxX, t.minY]), u = Object(o.c)(e, [t.minX, t.maxY]), h = Object(o.c)(e, [t.maxX, t.maxY]); (n = Math.min(s[0], c[0], u[0], h[0])), (i = Math.max(s[0], c[0], u[0], h[0])), (r = Math.min(s[1], c[1], u[1], h[1])), (a = Math.max(s[1], c[1], u[1], h[1])); } var l = this.attrs; if (l.shadowColor) { var f = l.shadowBlur, d = void 0 === f ? 0 : f, p = l.shadowOffsetX, g = void 0 === p ? 0 : p, v = l.shadowOffsetY, y = void 0 === v ? 0 : v, m = n - d + g, b = i + d + g, x = r - d + y, S = a + d + y; (n = Math.min(n, m)), (i = Math.max(i, b)), (r = Math.min(r, x)), (a = Math.max(a, S)); } return { x: n, y: r, minX: n, minY: r, maxX: i, maxY: a, width: i - n, height: a - r, }; }), (e.prototype.clearCacheBBox = function () { this.set("bbox", null), this.set("canvasBBox", null); }), (e.prototype.isClipShape = function () { return this.get("isClipShape"); }), (e.prototype.isInShape = function (t, e) { return !1; }), (e.prototype.isOnlyHitBox = function () { return !1; }), (e.prototype.isHit = function (t, e) { var n = this.get("startArrowShape"), r = this.get("endArrowShape"), i = [t, e, 1], o = (i = this.invertFromMatrix(i))[0], a = i[1], s = this._isInBBox(o, a); if (this.isOnlyHitBox()) return s; if (s && !this.isClipped(o, a)) { if (this.isInShape(o, a)) return !0; if (n && n.isHit(o, a)) return !0; if (r && r.isHit(o, a)) return !0; } return !1; }), e ); })(i.a); e.a = a; }, 126: function (t, e, n) { "use strict"; var r = n(214), i = {}; for (var o in r) r.hasOwnProperty(o) && (i[r[o]] = o); var a = (t.exports = { rgb: { channels: 3, labels: "rgb" }, hsl: { channels: 3, labels: "hsl" }, hsv: { channels: 3, labels: "hsv" }, hwb: { channels: 3, labels: "hwb" }, cmyk: { channels: 4, labels: "cmyk" }, xyz: { channels: 3, labels: "xyz" }, lab: { channels: 3, labels: "lab" }, lch: { channels: 3, labels: "lch" }, hex: { channels: 1, labels: ["hex"] }, keyword: { channels: 1, labels: ["keyword"] }, ansi16: { channels: 1, labels: ["ansi16"] }, ansi256: { channels: 1, labels: ["ansi256"] }, hcg: { channels: 3, labels: ["h", "c", "g"] }, apple: { channels: 3, labels: ["r16", "g16", "b16"] }, gray: { channels: 1, labels: ["gray"] }, }); for (var s in a) if (a.hasOwnProperty(s)) { if (!("channels" in a[s])) throw new Error("missing channels property: " + s); if (!("labels" in a[s])) throw new Error("missing channel labels property: " + s); if (a[s].labels.length !== a[s].channels) throw new Error("channel and label counts mismatch: " + s); var c = a[s].channels, u = a[s].labels; delete a[s].channels, delete a[s].labels, Object.defineProperty(a[s], "channels", { value: c }), Object.defineProperty(a[s], "labels", { value: u }); } function h(t, e) { return ( Math.pow(t[0] - e[0], 2) + Math.pow(t[1] - e[1], 2) + Math.pow(t[2] - e[2], 2) ); } (a.rgb.hsl = function (t) { var e, n, r = t[0] / 255, i = t[1] / 255, o = t[2] / 255, a = Math.min(r, i, o), s = Math.max(r, i, o), c = s - a; return ( s === a ? (e = 0) : r === s ? (e = (i - o) / c) : i === s ? (e = 2 + (o - r) / c) : o === s && (e = 4 + (r - i) / c), (e = Math.min(60 * e, 360)) < 0 && (e += 360), (n = (a + s) / 2), [ e, 100 * (s === a ? 0 : n <= 0.5 ? c / (s + a) : c / (2 - s - a)), 100 * n, ] ); }), (a.rgb.hsv = function (t) { var e, n, r, i, o, a = t[0] / 255, s = t[1] / 255, c = t[2] / 255, u = Math.max(a, s, c), h = u - Math.min(a, s, c), l = function (t) { return (u - t) / 6 / h + 0.5; }; return ( 0 === h ? (i = o = 0) : ((o = h / u), (e = l(a)), (n = l(s)), (r = l(c)), a === u ? (i = r - n) : s === u ? (i = 1 / 3 + e - r) : c === u && (i = 2 / 3 + n - e), i < 0 ? (i += 1) : i > 1 && (i -= 1)), [360 * i, 100 * o, 100 * u] ); }), (a.rgb.hwb = function (t) { var e = t[0], n = t[1], r = t[2]; return [ a.rgb.hsl(t)[0], (1 / 255) * Math.min(e, Math.min(n, r)) * 100, 100 * (r = 1 - (1 / 255) * Math.max(e, Math.max(n, r))), ]; }), (a.rgb.cmyk = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255, i = Math.min(1 - e, 1 - n, 1 - r); return [ 100 * ((1 - e - i) / (1 - i) || 0), 100 * ((1 - n - i) / (1 - i) || 0), 100 * ((1 - r - i) / (1 - i) || 0), 100 * i, ]; }), (a.rgb.keyword = function (t) { var e, n = i[t]; if (n) return n; var o, a = 1 / 0; for (var s in r) r.hasOwnProperty(s) && (e = h(t, r[s])) < a && ((a = e), (o = s)); return o; }), (a.keyword.rgb = function (t) { return r[t]; }), (a.rgb.xyz = function (t) { var e = t[0] / 255, n = t[1] / 255, r = t[2] / 255; return [ 100 * (0.4124 * (e = e > 0.04045 ? Math.pow((e + 0.055) / 1.055, 2.4) : e / 12.92) + 0.3576 * (n = n > 0.04045 ? Math.pow((n + 0.055) / 1.055, 2.4) : n / 12.92) + 0.1805 * (r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92)), 100 * (0.2126 * e + 0.7152 * n + 0.0722 * r), 100 * (0.0193 * e + 0.1192 * n + 0.9505 * r), ]; }), (a.rgb.lab = function (t) { var e = a.rgb.xyz(t), n = e[0], r = e[1], i = e[2]; return ( (r /= 100), (i /= 108.883), (n = (n /= 95.047) > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116), [ 116 * (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116) - 16, 500 * (n - r), 200 * (r - (i = i > 0.008856 ? Math.pow(i, 1 / 3) : 7.787 * i + 16 / 116)), ] ); }), (a.hsl.rgb = function (t) { var e, n, r, i, o, a, s = t[0] / 360, c = t[1] / 100, u = t[2] / 100; if (0 === c) return [(a = 255 * u), a, a]; for ( n = 2 * u - (r = u < 0.5 ? u * (1 + c) : u + c - u * c), o = [0, 0, 0], e = 0; e < 3; e++ ) (i = s + (1 / 3) * -(e - 1)) < 0 && i++, i > 1 && i--, (a = 6 * i < 1 ? n + 6 * (r - n) * i : 2 * i < 1 ? r : 3 * i < 2 ? n + (r - n) * (2 / 3 - i) * 6 : n), (o[e] = 255 * a); return o; }), (a.hsl.hsv = function (t) { var e = t[0], n = t[1] / 100, r = t[2] / 100, i = n, o = Math.max(r, 0.01); return ( (n *= (r *= 2) <= 1 ? r : 2 - r), (i *= o <= 1 ? o : 2 - o), [ e, 100 * (0 === r ? (2 * i) / (o + i) : (2 * n) / (r + n)), ((r + n) / 2) * 100, ] ); }), (a.hsv.rgb = function (t) { var e = t[0] / 60, n = t[1] / 100, r = t[2] / 100, i = Math.floor(e) % 6, o = e - Math.floor(e), a = 255 * r * (1 - n), s = 255 * r * (1 - n * o), c = 255 * r * (1 - n * (1 - o)); switch (((r *= 255), i)) { case 0: return [r, c, a]; case 1: return [s, r, a]; case 2: return [a, r, c]; case 3: return [a, s, r]; case 4: return [c, a, r]; case 5: return [r, a, s]; } }), (a.hsv.hsl = function (t) { var e, n, r = t[0], i = t[1] / 100, o = t[2] / 100, a = Math.max(o, 0.01), s = (2 - i) * o; return ( (n = i * a), [ r, 100 * (n = (n /= (e = (2 - i) * a) <= 1 ? e : 2 - e) || 0), 100 * (s /= 2), ] ); }), (a.hwb.rgb = function (t) { var e, n, r, i, o, a, s, c = t[0] / 360, u = t[1] / 100, h = t[2] / 100, l = u + h; switch ( (l > 1 && ((u /= l), (h /= l)), (r = 6 * c - (e = Math.floor(6 * c))), 0 != (1 & e) && (r = 1 - r), (i = u + r * ((n = 1 - h) - u)), e) ) { default: case 6: case 0: (o = n), (a = i), (s = u); break; case 1: (o = i), (a = n), (s = u); break; case 2: (o = u), (a = n), (s = i); break; case 3: (o = u), (a = i), (s = n); break; case 4: (o = i), (a = u), (s = n); break; case 5: (o = n), (a = u), (s = i); } return [255 * o, 255 * a, 255 * s]; }), (a.cmyk.rgb = function (t) { var e = t[0] / 100, n = t[1] / 100, r = t[2] / 100, i = t[3] / 100; return [ 255 * (1 - Math.min(1, e * (1 - i) + i)), 255 * (1 - Math.min(1, n * (1 - i) + i)), 255 * (1 - Math.min(1, r * (1 - i) + i)), ]; }), (a.xyz.rgb = function (t) { var e, n, r, i = t[0] / 100, o = t[1] / 100, a = t[2] / 100; return ( (n = -0.9689 * i + 1.8758 * o + 0.0415 * a), (r = 0.0557 * i + -0.204 * o + 1.057 * a), (e = (e = 3.2406 * i + -1.5372 * o + -0.4986 * a) > 0.0031308 ? 1.055 * Math.pow(e, 1 / 2.4) - 0.055 : 12.92 * e), (n = n > 0.0031308 ? 1.055 * Math.pow(n, 1 / 2.4) - 0.055 : 12.92 * n), (r = r > 0.0031308 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : 12.92 * r), [ 255 * (e = Math.min(Math.max(0, e), 1)), 255 * (n = Math.min(Math.max(0, n), 1)), 255 * (r = Math.min(Math.max(0, r), 1)), ] ); }), (a.xyz.lab = function (t) { var e = t[0], n = t[1], r = t[2]; return ( (n /= 100), (r /= 108.883), (e = (e /= 95.047) > 0.008856 ? Math.pow(e, 1 / 3) : 7.787 * e + 16 / 116), [ 116 * (n = n > 0.008856 ? Math.pow(n, 1 / 3) : 7.787 * n + 16 / 116) - 16, 500 * (e - n), 200 * (n - (r = r > 0.008856 ? Math.pow(r, 1 / 3) : 7.787 * r + 16 / 116)), ] ); }), (a.lab.xyz = function (t) { var e, n, r, i = t[0]; (e = t[1] / 500 + (n = (i + 16) / 116)), (r = n - t[2] / 200); var o = Math.pow(n, 3), a = Math.pow(e, 3), s = Math.pow(r, 3); return ( (n = o > 0.008856 ? o : (n - 16 / 116) / 7.787), (e = a > 0.008856 ? a : (e - 16 / 116) / 7.787), (r = s > 0.008856 ? s : (r - 16 / 116) / 7.787), [(e *= 95.047), (n *= 100), (r *= 108.883)] ); }), (a.lab.lch = function (t) { var e, n = t[0], r = t[1], i = t[2]; return ( (e = (360 * Math.atan2(i, r)) / 2 / Math.PI) < 0 && (e += 360), [n, Math.sqrt(r * r + i * i), e] ); }), (a.lch.lab = function (t) { var e = t[0], n = t[1], r = (t[2] / 360) * 2 * Math.PI; return [e, n * Math.cos(r), n * Math.sin(r)]; }), (a.rgb.ansi16 = function (t) { var e = t[0], n = t[1], r = t[2], i = 1 in arguments ? arguments[1] : a.rgb.hsv(t)[2]; if (0 === (i = Math.round(i / 50))) return 30; var o = 30 + ((Math.round(r / 255) << 2) | (Math.round(n / 255) << 1) | Math.round(e / 255)); return 2 === i && (o += 60), o; }), (a.hsv.ansi16 = function (t) { return a.rgb.ansi16(a.hsv.rgb(t), t[2]); }), (a.rgb.ansi256 = function (t) { var e = t[0], n = t[1], r = t[2]; return e === n && n === r ? e < 8 ? 16 : e > 248 ? 231 : Math.round(((e - 8) / 247) * 24) + 232 : 16 + 36 * Math.round((e / 255) * 5) + 6 * Math.round((n / 255) * 5) + Math.round((r / 255) * 5); }), (a.ansi16.rgb = function (t) { var e = t % 10; if (0 === e || 7 === e) return t > 50 && (e += 3.5), [(e = (e / 10.5) * 255), e, e]; var n = 0.5 * (1 + ~~(t > 50)); return [ (1 & e) * n * 255, ((e >> 1) & 1) * n * 255, ((e >> 2) & 1) * n * 255, ]; }), (a.ansi256.rgb = function (t) { return t >= 232 ? [(n = 10 * (t - 232) + 8), n, n] : ((t -= 16), [ (Math.floor(t / 36) / 5) * 255, (Math.floor((e = t % 36) / 6) / 5) * 255, ((e % 6) / 5) * 255, ]); var e, n; }), (a.rgb.hex = function (t) { var e = ( ((255 & Math.round(t[0])) << 16) + ((255 & Math.round(t[1])) << 8) + (255 & Math.round(t[2])) ) .toString(16) .toUpperCase(); return "000000".substring(e.length) + e; }), (a.hex.rgb = function (t) { var e = t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!e) return [0, 0, 0]; var n = e[0]; 3 === e[0].length && (n = n .split("") .map(function (t) { return t + t; }) .join("")); var r = parseInt(n, 16); return [(r >> 16) & 255, (r >> 8) & 255, 255 & r]; }), (a.rgb.hcg = function (t) { var e, n = t[0] / 255, r = t[1] / 255, i = t[2] / 255, o = Math.max(Math.max(n, r), i), a = Math.min(Math.min(n, r), i), s = o - a; return ( (e = s <= 0 ? 0 : o === n ? ((r - i) / s) % 6 : o === r ? 2 + (i - n) / s : 4 + (n - r) / s + 4), (e /= 6), [360 * (e %= 1), 100 * s, 100 * (s < 1 ? a / (1 - s) : 0)] ); }), (a.hsl.hcg = function (t) { var e, n = t[1] / 100, r = t[2] / 100, i = 0; return ( (e = r < 0.5 ? 2 * n * r : 2 * n * (1 - r)) < 1 && (i = (r - 0.5 * e) / (1 - e)), [t[0], 100 * e, 100 * i] ); }), (a.hsv.hcg = function (t) { var e = t[1] / 100, n = t[2] / 100, r = e * n, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.hcg.rgb = function (t) { var e = t[0] / 360, n = t[1] / 100, r = t[2] / 100; if (0 === n) return [255 * r, 255 * r, 255 * r]; var i, o = [0, 0, 0], a = (e % 1) * 6, s = a % 1, c = 1 - s; switch (Math.floor(a)) { case 0: (o[0] = 1), (o[1] = s), (o[2] = 0); break; case 1: (o[0] = c), (o[1] = 1), (o[2] = 0); break; case 2: (o[0] = 0), (o[1] = 1), (o[2] = s); break; case 3: (o[0] = 0), (o[1] = c), (o[2] = 1); break; case 4: (o[0] = s), (o[1] = 0), (o[2] = 1); break; default: (o[0] = 1), (o[1] = 0), (o[2] = c); } return ( (i = (1 - n) * r), [255 * (n * o[0] + i), 255 * (n * o[1] + i), 255 * (n * o[2] + i)] ); }), (a.hcg.hsv = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e), r = 0; return n > 0 && (r = e / n), [t[0], 100 * r, 100 * n]; }), (a.hcg.hsl = function (t) { var e = t[1] / 100, n = (t[2] / 100) * (1 - e) + 0.5 * e, r = 0; return ( n > 0 && n < 0.5 ? (r = e / (2 * n)) : n >= 0.5 && n < 1 && (r = e / (2 * (1 - n))), [t[0], 100 * r, 100 * n] ); }), (a.hcg.hwb = function (t) { var e = t[1] / 100, n = e + (t[2] / 100) * (1 - e); return [t[0], 100 * (n - e), 100 * (1 - n)]; }), (a.hwb.hcg = function (t) { var e = t[1] / 100, n = 1 - t[2] / 100, r = n - e, i = 0; return r < 1 && (i = (n - r) / (1 - r)), [t[0], 100 * r, 100 * i]; }), (a.apple.rgb = function (t) { return [ (t[0] / 65535) * 255, (t[1] / 65535) * 255, (t[2] / 65535) * 255, ]; }), (a.rgb.apple = function (t) { return [ (t[0] / 255) * 65535, (t[1] / 255) * 65535, (t[2] / 255) * 65535, ]; }), (a.gray.rgb = function (t) { return [(t[0] / 100) * 255, (t[0] / 100) * 255, (t[0] / 100) * 255]; }), (a.gray.hsl = a.gray.hsv = function (t) { return [0, 0, t[0]]; }), (a.gray.hwb = function (t) { return [0, 100, t[0]]; }), (a.gray.cmyk = function (t) { return [0, 0, 0, t[0]]; }), (a.gray.lab = function (t) { return [t[0], 0, 0]; }), (a.gray.hex = function (t) { var e = 255 & Math.round((t[0] / 100) * 255), n = ((e << 16) + (e << 8) + e).toString(16).toUpperCase(); return "000000".substring(n.length) + n; }), (a.rgb.gray = function (t) { return [((t[0] + t[1] + t[2]) / 3 / 255) * 100]; }); }, 127: function (t, e) {}, 128: function (t, e) {}, 183: function (t, e, n) { "use strict"; var r = n(1), i = n(185), o = n(92), a = n(6), s = n(0); function c(t) { return (c = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var u, h, l = 0, f = 0, d = 0, p = 0, g = 0, v = 0, y = "object" === ("undefined" == typeof performance ? "undefined" : c(performance)) && performance.now ? performance : Date, m = "object" === ("undefined" == typeof window ? "undefined" : c(window)) && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (t) { setTimeout(t, 17); }; function b() { return g || (m(x), (g = y.now() + v)); } function x() { g = 0; } function S() { this._call = this._time = this._next = null; } function w(t, e, n) { var r = new S(); return r.restart(t, e, n), r; } function O() { (g = (p = y.now()) + v), (l = f = 0); try { !(function () { b(), ++l; for (var t, e = u; e; ) (t = g - e._time) >= 0 && e._call.call(null, t), (e = e._next); --l; })(); } finally { (l = 0), (function () { var t, e, n = u, r = 1 / 0; for (; n; ) n._call ? (r > n._time && (r = n._time), (t = n), (n = n._next)) : ((e = n._next), (n._next = null), (n = t ? (t._next = e) : (u = e))); (h = t), k(r); })(), (g = 0); } } function M() { var t = y.now(), e = t - p; e > 1e3 && ((v -= e), (p = t)); } function k(t) { l || (f && (f = clearTimeout(f)), t - g > 24 ? (t < 1 / 0 && (f = setTimeout(O, t - y.now() - v)), d && (d = clearInterval(d))) : (d || ((p = y.now()), (d = setInterval(M, 1e3))), (l = 1), m(O))); } S.prototype = w.prototype = { constructor: S, restart: function (t, e, n) { if ("function" != typeof t) throw new TypeError("callback is not a function"); (n = (null == n ? b() : +n) + (null == e ? 0 : +e)), this._next || h === this || (h ? (h._next = this) : (u = this), (h = this)), (this._call = t), (this._time = n), k(); }, stop: function () { this._call && ((this._call = null), (this._time = 1 / 0), k()); }, }; var j = function (t, e, n) { (t.prototype = e.prototype = n), (n.constructor = t); }; function C(t, e) { var n = Object.create(t.prototype); for (var r in e) n[r] = e[r]; return n; } function E() {} var P = "\\s*([+-]?\\d+)\\s*", A = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", I = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", T = /^#([0-9a-f]{3,8})$/, N = new RegExp( "^rgb\\(".concat(P, ",").concat(P, ",").concat(P, "\\)$"), ), B = new RegExp( "^rgb\\(".concat(I, ",").concat(I, ",").concat(I, "\\)$"), ), L = new RegExp( "^rgba\\(" .concat(P, ",") .concat(P, ",") .concat(P, ",") .concat(A, "\\)$"), ), D = new RegExp( "^rgba\\(" .concat(I, ",") .concat(I, ",") .concat(I, ",") .concat(A, "\\)$"), ), _ = new RegExp( "^hsl\\(".concat(A, ",").concat(I, ",").concat(I, "\\)$"), ), R = new RegExp( "^hsla\\(" .concat(A, ",") .concat(I, ",") .concat(I, ",") .concat(A, "\\)$"), ), F = { aliceblue: 15792383, antiquewhite: 16444375, aqua: 65535, aquamarine: 8388564, azure: 15794175, beige: 16119260, bisque: 16770244, black: 0, blanchedalmond: 16772045, blue: 255, blueviolet: 9055202, brown: 10824234, burlywood: 14596231, cadetblue: 6266528, chartreuse: 8388352, chocolate: 13789470, coral: 16744272, cornflowerblue: 6591981, cornsilk: 16775388, crimson: 14423100, cyan: 65535, darkblue: 139, darkcyan: 35723, darkgoldenrod: 12092939, darkgray: 11119017, darkgreen: 25600, darkgrey: 11119017, darkkhaki: 12433259, darkmagenta: 9109643, darkolivegreen: 5597999, darkorange: 16747520, darkorchid: 10040012, darkred: 9109504, darksalmon: 15308410, darkseagreen: 9419919, darkslateblue: 4734347, darkslategray: 3100495, darkslategrey: 3100495, darkturquoise: 52945, darkviolet: 9699539, deeppink: 16716947, deepskyblue: 49151, dimgray: 6908265, dimgrey: 6908265, dodgerblue: 2003199, firebrick: 11674146, floralwhite: 16775920, forestgreen: 2263842, fuchsia: 16711935, gainsboro: 14474460, ghostwhite: 16316671, gold: 16766720, goldenrod: 14329120, gray: 8421504, green: 32768, greenyellow: 11403055, grey: 8421504, honeydew: 15794160, hotpink: 16738740, indianred: 13458524, indigo: 4915330, ivory: 16777200, khaki: 15787660, lavender: 15132410, lavenderblush: 16773365, lawngreen: 8190976, lemonchiffon: 16775885, lightblue: 11393254, lightcoral: 15761536, lightcyan: 14745599, lightgoldenrodyellow: 16448210, lightgray: 13882323, lightgreen: 9498256, lightgrey: 13882323, lightpink: 16758465, lightsalmon: 16752762, lightseagreen: 2142890, lightskyblue: 8900346, lightslategray: 7833753, lightslategrey: 7833753, lightsteelblue: 11584734, lightyellow: 16777184, lime: 65280, limegreen: 3329330, linen: 16445670, magenta: 16711935, maroon: 8388608, mediumaquamarine: 6737322, mediumblue: 205, mediumorchid: 12211667, mediumpurple: 9662683, mediumseagreen: 3978097, mediumslateblue: 8087790, mediumspringgreen: 64154, mediumturquoise: 4772300, mediumvioletred: 13047173, midnightblue: 1644912, mintcream: 16121850, mistyrose: 16770273, moccasin: 16770229, navajowhite: 16768685, navy: 128, oldlace: 16643558, olive: 8421376, olivedrab: 7048739, orange: 16753920, orangered: 16729344, orchid: 14315734, palegoldenrod: 15657130, palegreen: 10025880, paleturquoise: 11529966, palevioletred: 14381203, papayawhip: 16773077, peachpuff: 16767673, peru: 13468991, pink: 16761035, plum: 14524637, powderblue: 11591910, purple: 8388736, rebeccapurple: 6697881, red: 16711680, rosybrown: 12357519, royalblue: 4286945, saddlebrown: 9127187, salmon: 16416882, sandybrown: 16032864, seagreen: 3050327, seashell: 16774638, sienna: 10506797, silver: 12632256, skyblue: 8900331, slateblue: 6970061, slategray: 7372944, slategrey: 7372944, snow: 16775930, springgreen: 65407, steelblue: 4620980, tan: 13808780, teal: 32896, thistle: 14204888, tomato: 16737095, turquoise: 4251856, violet: 15631086, wheat: 16113331, white: 16777215, whitesmoke: 16119285, yellow: 16776960, yellowgreen: 10145074, }; function Y() { return this.rgb().formatHex(); } function X() { return this.rgb().formatRgb(); } function z(t) { var e, n; return ( (t = (t + "").trim().toLowerCase()), (e = T.exec(t)) ? ((n = e[1].length), (e = parseInt(e[1], 16)), 6 === n ? W(e) : 3 === n ? new H( ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), ((15 & e) << 4) | (15 & e), 1, ) : 8 === n ? q( (e >> 24) & 255, (e >> 16) & 255, (e >> 8) & 255, (255 & e) / 255, ) : 4 === n ? q( ((e >> 12) & 15) | ((e >> 8) & 240), ((e >> 8) & 15) | ((e >> 4) & 240), ((e >> 4) & 15) | (240 & e), (((15 & e) << 4) | (15 & e)) / 255, ) : null) : (e = N.exec(t)) ? new H(e[1], e[2], e[3], 1) : (e = B.exec(t)) ? new H( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, 1, ) : (e = L.exec(t)) ? q(e[1], e[2], e[3], e[4]) : (e = D.exec(t)) ? q( (255 * e[1]) / 100, (255 * e[2]) / 100, (255 * e[3]) / 100, e[4], ) : (e = _.exec(t)) ? J(e[1], e[2] / 100, e[3] / 100, 1) : (e = R.exec(t)) ? J(e[1], e[2] / 100, e[3] / 100, e[4]) : F.hasOwnProperty(t) ? W(F[t]) : "transparent" === t ? new H(NaN, NaN, NaN, 0) : null ); } function W(t) { return new H((t >> 16) & 255, (t >> 8) & 255, 255 & t, 1); } function q(t, e, n, r) { return r <= 0 && (t = e = n = NaN), new H(t, e, n, r); } function V(t) { return ( t instanceof E || (t = z(t)), t ? new H((t = t.rgb()).r, t.g, t.b, t.opacity) : new H() ); } function G(t, e, n, r) { return 1 === arguments.length ? V(t) : new H(t, e, n, null == r ? 1 : r); } function H(t, e, n, r) { (this.r = +t), (this.g = +e), (this.b = +n), (this.opacity = +r); } function U() { return "#".concat(Q(this.r)).concat(Q(this.g)).concat(Q(this.b)); } function Z() { var t = K(this.opacity); return "" .concat(1 === t ? "rgb(" : "rgba(") .concat($(this.r), ", ") .concat($(this.g), ", ") .concat($(this.b)) .concat(1 === t ? ")" : ", ".concat(t, ")")); } function K(t) { return isNaN(t) ? 1 : Math.max(0, Math.min(1, t)); } function $(t) { return Math.max(0, Math.min(255, Math.round(t) || 0)); } function Q(t) { return ((t = $(t)) < 16 ? "0" : "") + t.toString(16); } function J(t, e, n, r) { return ( r <= 0 ? (t = e = n = NaN) : n <= 0 || n >= 1 ? (t = e = NaN) : e <= 0 && (t = NaN), new et(t, e, n, r) ); } function tt(t) { if (t instanceof et) return new et(t.h, t.s, t.l, t.opacity); if ((t instanceof E || (t = z(t)), !t)) return new et(); if (t instanceof et) return t; var e = (t = t.rgb()).r / 255, n = t.g / 255, r = t.b / 255, i = Math.min(e, n, r), o = Math.max(e, n, r), a = NaN, s = o - i, c = (o + i) / 2; return ( s ? ((a = e === o ? (n - r) / s + 6 * (n < r) : n === o ? (r - e) / s + 2 : (e - n) / s + 4), (s /= c < 0.5 ? o + i : 2 - o - i), (a *= 60)) : (s = c > 0 && c < 1 ? 0 : a), new et(a, s, c, t.opacity) ); } function et(t, e, n, r) { (this.h = +t), (this.s = +e), (this.l = +n), (this.opacity = +r); } function nt(t) { return (t = (t || 0) % 360) < 0 ? t + 360 : t; } function rt(t) { return Math.max(0, Math.min(1, t || 0)); } function it(t, e, n) { return ( 255 * (t < 60 ? e + ((n - e) * t) / 60 : t < 180 ? n : t < 240 ? e + ((n - e) * (240 - t)) / 60 : e) ); } function ot(t, e, n, r, i) { var o = t * t, a = o * t; return ( ((1 - 3 * t + 3 * o - a) * e + (4 - 6 * o + 3 * a) * n + (1 + 3 * t + 3 * o - 3 * a) * r + a * i) / 6 ); } j(E, z, { copy: function (t) { return Object.assign(new this.constructor(), this, t); }, displayable: function () { return this.rgb().displayable(); }, hex: Y, formatHex: Y, formatHex8: function () { return this.rgb().formatHex8(); }, formatHsl: function () { return tt(this).formatHsl(); }, formatRgb: X, toString: X, }), j( H, G, C(E, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new H(this.r * t, this.g * t, this.b * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new H(this.r * t, this.g * t, this.b * t, this.opacity) ); }, rgb: function () { return this; }, clamp: function () { return new H($(this.r), $(this.g), $(this.b), K(this.opacity)); }, displayable: function () { return ( -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1 ); }, hex: U, formatHex: U, formatHex8: function () { return "#" .concat(Q(this.r)) .concat(Q(this.g)) .concat(Q(this.b)) .concat(Q(255 * (isNaN(this.opacity) ? 1 : this.opacity))); }, formatRgb: Z, toString: Z, }), ), j( et, function (t, e, n, r) { return 1 === arguments.length ? tt(t) : new et(t, e, n, null == r ? 1 : r); }, C(E, { brighter: function (t) { return ( (t = null == t ? 1 / 0.7 : Math.pow(1 / 0.7, t)), new et(this.h, this.s, this.l * t, this.opacity) ); }, darker: function (t) { return ( (t = null == t ? 0.7 : Math.pow(0.7, t)), new et(this.h, this.s, this.l * t, this.opacity) ); }, rgb: function () { var t = (this.h % 360) + 360 * (this.h < 0), e = isNaN(t) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * e, i = 2 * n - r; return new H( it(t >= 240 ? t - 240 : t + 120, i, r), it(t, i, r), it(t < 120 ? t + 240 : t - 120, i, r), this.opacity, ); }, clamp: function () { return new et( nt(this.h), rt(this.s), rt(this.l), K(this.opacity), ); }, displayable: function () { return ( ((0 <= this.s && this.s <= 1) || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1 ); }, formatHsl: function () { var t = K(this.opacity); return "" .concat(1 === t ? "hsl(" : "hsla(") .concat(nt(this.h), ", ") .concat(100 * rt(this.s), "%, ") .concat(100 * rt(this.l), "%") .concat(1 === t ? ")" : ", ".concat(t, ")")); }, }), ); var at = function (t) { return function () { return t; }; }; function st(t, e) { return function (n) { return t + n * e; }; } function ct(t) { return 1 == (t = +t) ? ut : function (e, n) { return n - e ? (function (t, e, n) { return ( (t = Math.pow(t, n)), (e = Math.pow(e, n) - t), (n = 1 / n), function (r) { return Math.pow(t + r * e, n); } ); })(e, n, t) : at(isNaN(e) ? n : e); }; } function ut(t, e) { var n = e - t; return n ? st(t, n) : at(isNaN(t) ? e : t); } var ht = (function t(e) { var n = ct(e); function r(t, e) { var r = n((t = G(t)).r, (e = G(e)).r), i = n(t.g, e.g), o = n(t.b, e.b), a = ut(t.opacity, e.opacity); return function (e) { return ( (t.r = r(e)), (t.g = i(e)), (t.b = o(e)), (t.opacity = a(e)), t + "" ); }; } return (r.gamma = t), r; })(1); function lt(t) { return function (e) { var n, r, i = e.length, o = new Array(i), a = new Array(i), s = new Array(i); for (n = 0; n < i; ++n) (r = G(e[n])), (o[n] = r.r || 0), (a[n] = r.g || 0), (s[n] = r.b || 0); return ( (o = t(o)), (a = t(a)), (s = t(s)), (r.opacity = 1), function (t) { return (r.r = o(t)), (r.g = a(t)), (r.b = s(t)), r + ""; } ); }; } lt(function (t) { var e = t.length - 1; return function (n) { var r = n <= 0 ? (n = 0) : n >= 1 ? ((n = 1), e - 1) : Math.floor(n * e), i = t[r], o = t[r + 1], a = r > 0 ? t[r - 1] : 2 * i - o, s = r < e - 1 ? t[r + 2] : 2 * o - i; return ot((n - r / e) * e, a, i, o, s); }; }), lt(function (t) { var e = t.length; return function (n) { var r = Math.floor(((n %= 1) < 0 ? ++n : n) * e), i = t[(r + e - 1) % e], o = t[r % e], a = t[(r + 1) % e], s = t[(r + 2) % e]; return ot((n - r / e) * e, i, o, a, s); }; }); var ft = function (t, e) { e || (e = []); var n, r = t ? Math.min(e.length, t.length) : 0, i = e.slice(); return function (o) { for (n = 0; n < r; ++n) i[n] = t[n] * (1 - o) + e[n] * o; return i; }; }; function dt(t) { return ArrayBuffer.isView(t) && !(t instanceof DataView); } function pt(t, e) { var n, r = e ? e.length : 0, i = t ? Math.min(r, t.length) : 0, o = new Array(i), a = new Array(r); for (n = 0; n < i; ++n) o[n] = Ot(t[n], e[n]); for (; n < r; ++n) a[n] = e[n]; return function (t) { for (n = 0; n < i; ++n) a[n] = o[n](t); return a; }; } var gt = function (t, e) { var n = new Date(); return ( (t = +t), (e = +e), function (r) { return n.setTime(t * (1 - r) + e * r), n; } ); }, vt = function (t, e) { return ( (t = +t), (e = +e), function (n) { return t * (1 - n) + e * n; } ); }; function yt(t) { return (yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var mt = function (t, e) { var n, r = {}, i = {}; for (n in ((null !== t && "object" === yt(t)) || (t = {}), (null !== e && "object" === yt(e)) || (e = {}), e)) n in t ? (r[n] = Ot(t[n], e[n])) : (i[n] = e[n]); return function (t) { for (n in r) i[n] = r[n](t); return i; }; }, bt = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, xt = new RegExp(bt.source, "g"); var St = function (t, e) { var n, r, i, o = (bt.lastIndex = xt.lastIndex = 0), a = -1, s = [], c = []; for (t += "", e += ""; (n = bt.exec(t)) && (r = xt.exec(e)); ) (i = r.index) > o && ((i = e.slice(o, i)), s[a] ? (s[a] += i) : (s[++a] = i)), (n = n[0]) === (r = r[0]) ? s[a] ? (s[a] += r) : (s[++a] = r) : ((s[++a] = null), c.push({ i: a, x: vt(n, r) })), (o = xt.lastIndex); return ( o < e.length && ((i = e.slice(o)), s[a] ? (s[a] += i) : (s[++a] = i)), s.length < 2 ? c[0] ? (function (t) { return function (e) { return t(e) + ""; }; })(c[0].x) : (function (t) { return function () { return t; }; })(e) : ((e = c.length), function (t) { for (var n, r = 0; r < e; ++r) s[(n = c[r]).i] = n.x(t); return s.join(""); }) ); }; function wt(t) { return (wt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Ot = function (t, e) { var n, r = wt(e); return null == e || "boolean" === r ? at(e) : ("number" === r ? vt : "string" === r ? (n = z(e)) ? ((e = n), ht) : St : e instanceof z ? ht : e instanceof Date ? gt : dt(e) ? ft : Array.isArray(e) ? pt : ("function" != typeof e.valueOf && "function" != typeof e.toString) || isNaN(e) ? mt : vt)(t, e); }, Mt = n(90), kt = n(34), jt = [1, 0, 0, 0, 1, 0, 0, 0, 1]; function Ct(t, e, n) { var r, i = e.startTime; if (n < i + e.delay || e._paused) return !1; var o = e.duration, a = e.easing, c = Object(Mt.a)(a); if (((n = n - i - e.delay), e.repeat)) r = c((r = (n % o) / o)); else { if (!((r = n / o) < 1)) return e.onFrame ? t.attr(e.onFrame(1)) : t.attr(e.toAttrs), !0; r = c(r); } if (e.onFrame) { var u = e.onFrame(r); t.attr(u); } else !(function (t, e, n) { var r = {}, i = e.fromAttrs, o = e.toAttrs; if (!t.destroyed) { var a, c, u, h; for (var l in o) if (!Object(s.isEqual)(i[l], o[l])) if ("path" === l) { var f = o[l], d = i[l]; f.length > d.length ? ((f = kt.parsePathString(o[l])), (d = kt.parsePathString(i[l])), (d = kt.fillPathByDiff(d, f)), (d = kt.formatPath(d, f)), (e.fromAttrs.path = d), (e.toAttrs.path = f)) : e.pathFormatted || ((f = kt.parsePathString(o[l])), (d = kt.parsePathString(i[l])), (d = kt.formatPath(d, f)), (e.fromAttrs.path = d), (e.toAttrs.path = f), (e.pathFormatted = !0)), (r[l] = []); for (var p = 0; p < f.length; p++) { for ( var g = f[p], v = d[p], y = [], m = 0; m < g.length; m++ ) Object(s.isNumber)(g[m]) && v && Object(s.isNumber)(v[m]) ? ((a = Ot(v[m], g[m])), y.push(a(n))) : y.push(g[m]); r[l].push(y); } } else if ("matrix" === l) { var b = ((u = i[l] || jt), (dt((h = o[l] || jt)) ? ft : pt)(u, h))(n); r[l] = b; } else ["fill", "stroke", "fillStyle", "strokeStyle"].includes( l, ) && ((c = o[l]), /^[r,R,L,l]{1}[\s]*\(/.test(c)) ? (r[l] = o[l]) : Object(s.isFunction)(o[l]) || ((a = Ot(i[l], o[l])), (r[l] = a(n))); t.attr(r); } })(t, e, r); return !1; } var Et = (function () { function t(t) { (this.animators = []), (this.current = 0), (this.timer = null), (this.canvas = t); } return ( (t.prototype.initTimer = function () { var t, e, n, r = this; this.timer = w(function (i) { if (((r.current = i), r.animators.length > 0)) { for (var o = r.animators.length - 1; o >= 0; o--) if ((t = r.animators[o]).destroyed) r.removeAnimator(o); else { if (!t.isAnimatePaused()) for ( var a = (e = t.get("animations")).length - 1; a >= 0; a-- ) (n = e[a]), Ct(t, n, i) && (e.splice(a, 1), !1, n.callback && n.callback()); 0 === e.length && r.removeAnimator(o); } r.canvas.get("autoDraw") || r.canvas.draw(); } }); }), (t.prototype.addAnimator = function (t) { this.animators.push(t); }), (t.prototype.removeAnimator = function (t) { this.animators.splice(t, 1); }), (t.prototype.isAnimating = function () { return !!this.animators.length; }), (t.prototype.stop = function () { this.timer && this.timer.stop(); }), (t.prototype.stopAllAnimations = function (t) { void 0 === t && (t = !0), this.animators.forEach(function (e) { e.stopAnimate(t); }), (this.animators = []), this.canvas.draw(); }), (t.prototype.getTime = function () { return this.current; }), t ); })(), Pt = n(86), At = [ "mousedown", "mouseup", "dblclick", "mouseout", "mouseover", "mousemove", "mouseleave", "mouseenter", "touchstart", "touchmove", "touchend", "dragenter", "dragover", "dragleave", "drop", "contextmenu", "mousewheel", ]; function It(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function Tt(t, e, n) { if (n.bubbles) { var r = void 0, i = !1; if ( ("mouseenter" === e ? ((r = n.fromShape), (i = !0)) : "mouseleave" === e && ((i = !0), (r = n.toShape)), t.isCanvas() && i) ) return; if (r && Object(a.g)(t, r)) return void (n.bubbles = !1); (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var Nt = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.mousedownShape = null), (this.mousedownPoint = null), (this._eventCallback = function (t) { var n = t.type; e._triggerEvent(n, t); }), (this._onDocumentMove = function (t) { if ( e.canvas.get("el") !== t.target && (e.dragging || e.currentShape) ) { var n = e._getPointInfo(t); e.dragging && e._emitEvent("drag", t, n, e.draggingShape); } }), (this._onDocumentMouseUp = function (t) { if (e.canvas.get("el") !== t.target && e.dragging) { var n = e._getPointInfo(t); e.draggingShape && e._emitEvent("drop", t, n, null), e._emitEvent("dragend", t, n, e.draggingShape), e._afterDrag(e.draggingShape, n, t); } }), (this.canvas = t.canvas); } return ( (t.prototype.init = function () { this._bindEvents(); }), (t.prototype._bindEvents = function () { var t = this, e = this.canvas.get("el"); Object(a.a)(At, function (n) { e.addEventListener(n, t._eventCallback); }), document && (document.addEventListener("mousemove", this._onDocumentMove), document.addEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._clearEvents = function () { var t = this, e = this.canvas.get("el"); Object(a.a)(At, function (n) { e.removeEventListener(n, t._eventCallback); }), document && (document.removeEventListener( "mousemove", this._onDocumentMove, ), document.removeEventListener( "mouseup", this._onDocumentMouseUp, )); }), (t.prototype._getEventObj = function (t, e, n, r, i, o) { var a = new Pt.a(t, e); return ( (a.fromShape = i), (a.toShape = o), (a.x = n.x), (a.y = n.y), (a.clientX = n.clientX), (a.clientY = n.clientY), a.propagationPath.push(r), a ); }), (t.prototype._getShape = function (t, e) { return this.canvas.getShape(t.x, t.y, e); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t], o = !1; if (i) i.call(this, n, r, e); else { var a = this.currentShape; "mouseenter" === t || "dragenter" === t || "mouseover" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "mouseenter" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "mouseleave" === t || "dragleave" === t || "mouseout" === t ? ((o = !0), a && this._emitEvent(t, e, n, a, a, null), this._emitEvent(t, e, n, null, a, null), "mouseleave" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } if ((o || (this.currentShape = r), r && !r.get("destroyed"))) { var s = this.canvas; s.get("el").style.cursor = r.attr("cursor") || s.get("cursor"); } }), (t.prototype._onmousedown = function (t, e, n) { 0 === n.button && ((this.mousedownShape = e), (this.mousedownPoint = t), (this.mousedownTimeStamp = n.timeStamp)), this._emitEvent("mousedown", n, t, e, null, null); }), (t.prototype._emitMouseoverEvents = function (t, e, n, r) { var i = this.canvas.get("el"); n !== r && (n && (this._emitEvent("mouseout", t, e, n, n, r), this._emitEvent("mouseleave", t, e, n, n, r), (r && !r.get("destroyed")) || (i.style.cursor = this.canvas.get("cursor"))), r && (this._emitEvent("mouseover", t, e, r, n, r), this._emitEvent("mouseenter", t, e, r, n, r))); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); r !== t && this._emitMouseoverEvents(n, e, t, r), (this.currentShape = r); }), (t.prototype._onmouseup = function (t, e, n) { if (0 === n.button) { var r = this.draggingShape; this.dragging ? (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)) : (this._emitEvent("mouseup", n, t, e), e === this.mousedownShape && this._emitEvent("click", n, t, e), (this.mousedownShape = null), (this.mousedownPoint = null)); } }), (t.prototype._ondragover = function (t, e, n) { n.preventDefault(); var r = this.currentShape; this._emitDragoverEvents(n, t, r, e, !0); }), (t.prototype._onmousemove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.mousedownPoint; if (a) { var s = this.mousedownShape, c = n.timeStamp - this.mousedownTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; c > 120 || u * u + h * h > 40 ? s && s.get("draggable") ? ((o = this.mousedownShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.mousedownShape = null), (this.mousedownPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.mousedownShape = null), (this.mousedownPoint = null)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)) : (this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e)); } else this._emitMouseoverEvents(n, t, i, e), this._emitEvent("mousemove", n, t, e); } }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), It(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || Tt(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { It(this.canvas, t, a); } }), (t.prototype.destroy = function () { this._clearEvents(), (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.mousedownPoint = null), (this.mousedownShape = null), (this.mousedownTimeStamp = null); }), t ); })(), Bt = Object(i.a)(), Lt = Bt && "firefox" === Bt.name, Dt = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( n.initContainer(), n.initDom(), n.initEvents(), n.initTimeline(), n ); } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.cursor = "default"), (e.supportCSSTransform = !1), e; }), (e.prototype.initContainer = function () { var t = this.get("container"); Object(a.h)(t) && ((t = document.getElementById(t)), this.set("container", t)); }), (e.prototype.initDom = function () { var t = this.createDom(); this.set("el", t), this.get("container").appendChild(t), this.setDOMSize(this.get("width"), this.get("height")); }), (e.prototype.initEvents = function () { var t = new Nt({ canvas: this }); t.init(), this.set("eventController", t); }), (e.prototype.initTimeline = function () { var t = new Et(this); this.set("timeline", t); }), (e.prototype.setDOMSize = function (t, e) { var n = this.get("el"); a.c && ((n.style.width = t + "px"), (n.style.height = e + "px")); }), (e.prototype.changeSize = function (t, e) { this.setDOMSize(t, e), this.set("width", t), this.set("height", e), this.onCanvasChange("changeSize"); }), (e.prototype.getRenderer = function () { return this.get("renderer"); }), (e.prototype.getCursor = function () { return this.get("cursor"); }), (e.prototype.setCursor = function (t) { this.set("cursor", t); var e = this.get("el"); a.c && e && (e.style.cursor = t); }), (e.prototype.getPointByEvent = function (t) { if (this.get("supportCSSTransform")) { if (Lt && !Object(a.e)(t.layerX) && t.layerX !== t.offsetX) return { x: t.layerX, y: t.layerY }; if (!Object(a.e)(t.offsetX)) return { x: t.offsetX, y: t.offsetY }; } var e = this.getClientByEvent(t), n = e.x, r = e.y; return this.getPointByClient(n, r); }), (e.prototype.getClientByEvent = function (t) { var e = t; return ( t.touches && (e = "touchend" === t.type ? t.changedTouches[0] : t.touches[0]), { x: e.clientX, y: e.clientY } ); }), (e.prototype.getPointByClient = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t - n.left, y: e - n.top }; }), (e.prototype.getClientByPoint = function (t, e) { var n = this.get("el").getBoundingClientRect(); return { x: t + n.left, y: e + n.top }; }), (e.prototype.draw = function () {}), (e.prototype.removeDom = function () { var t = this.get("el"); t.parentNode.removeChild(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.isCanvas = function () { return !0; }), (e.prototype.getParent = function () { return null; }), (e.prototype.destroy = function () { var e = this.get("timeline"); this.get("destroyed") || (this.clear(), e && e.stop(), this.clearEvents(), this.removeDom(), t.prototype.destroy.call(this)); }), e ); })(o.a); e.a = Dt; }, 184: function (t, e, n) { "use strict"; var r = n(1), i = n(8); function o(t, e, n) { var r = t.getTotalMatrix(); if (r) { var o = (function (t, e) { if (e) { var n = Object(i.invert)(e); return Object(i.multiplyVec2)(n, t); } return t; })([e, n, 1], r); return [o[0], o[1]]; } return [e, n]; } function a(t, e, n) { if (t.isCanvas && t.isCanvas()) return !0; if (!Object(i.isAllowCapture)(t) || !1 === t.cfg.isInView) return !1; if (t.cfg.clipShape) { var r = o(t, e, n), a = r[0], s = r[1]; if (t.isClipped(a, s)) return !1; } var c = t.cfg.cacheCanvasBBox || t.getCanvasBBox(); return e >= c.minX && e <= c.maxX && n >= c.minY && n <= c.maxY; } var s = n(31), c = n(52), u = n(3), h = n(40), l = n(12), f = n(38), d = n.n(f); function p(t, e, n) { (n.name = e), (n.target = t), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } function g(t, e, n) { if (n.bubbles) { t.isCanvas(), 0, (n.name = e), (n.currentTarget = t), (n.delegateTarget = t), t.emit(e, n); } } var v = (function () { function t(t) { var e = this; (this.draggingShape = null), (this.dragging = !1), (this.currentShape = null), (this.panstartShape = null), (this.panstartPoint = null), (this.handleEvent = function (t) { e.hammerRuntime.emit("origin_input:" + t.type, t); }), (this.canvas = t.canvas), this._initEvent(); } return ( (t.prototype._initEvent = function () { var t = this; (this.hammerRuntime = new d.a({}, { inputClass: f.TouchInput })), this.hammerRuntime.add( new d.a.Pan({ threshold: 0, pointers: 1 }), ), this.hammerRuntime .add(new d.a.Swipe()) .recognizeWith(this.hammerRuntime.get("pan")), this.hammerRuntime.add( new d.a.Pinch({ threshold: 0, pointers: 2 }), ), this.hammerRuntime.add( new d.a.Tap({ event: "dbltap", taps: 2 }), ), this.hammerRuntime.add(new d.a.Tap()), this.hammerRuntime.add(new d.a.Press({ time: 500 })), this.hammerRuntime.on( "panstart panmove panend pancancel", function (e) { e.srcEvent.extra = e; var n = t._getPointInfo(e), r = t._getShape(n, e); ("panend" !== e.type && "pancancel" !== e.type) || t._onpanend(n, r, e), "panstart" === e.type && (t.dragging && ((t.draggingShape = null), (t.dragging = !1), (t.panstartShape = null), (t.panstartPoint = null)), t._onpanstart(n, r, e)), "panmove" === e.type && t._onpanmove(n, r, e), (t.currentShape = r); }, ), this.hammerRuntime.on( "tap dbltap press swipe rotatestart rotatemove", function (e) { t._emitMobileEvent(e.type, e); }, ), this.hammerRuntime.on( "pinchstart pinchmove pinchend pinchcancel", function (e) { "pinchend" !== e.type && "pinchcancel" !== e.type ? ((e.srcEvent.extra = { scale: e.scale }), t._emitMobileEvent(e.type, e)) : t._emitMobileEvent(e.type, e); }, ); }), (t.prototype._emitMobileEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e); this._emitEvent(t, e, n, r); }), (t.prototype._getEventObj = function (t, e, n, r, o, a) { var s = new i.Event(t, e); return ( (s.fromShape = o), (s.toShape = a), (s.x = n.x), (s.y = n.y), (s.clientX = n.clientX), (s.clientY = n.clientY), s.propagationPath.push(r), s ); }), (t.prototype._getShape = function (t, e) { var n = e.srcEvent; return this.canvas.getShape(t.x, t.y, n); }), (t.prototype._getPointInfo = function (t) { var e = this.canvas, n = e.getClientByEvent(t), r = e.getPointByEvent(t); return { x: r.x, y: r.y, clientX: n.x, clientY: n.y }; }), (t.prototype._triggerEvent = function (t, e) { var n = this._getPointInfo(e), r = this._getShape(n, e), i = this["_on" + t]; if (i) i.call(this, n, r, e); else { var o = this.currentShape; "panstart" === t || "dragenter" === t ? (this._emitEvent(t, e, n, null, null, r), r && this._emitEvent(t, e, n, r, null, r), "panstart" === t && this.draggingShape && this._emitEvent("dragenter", e, n, null)) : "panend" === t || "dragleave" === t ? (o && this._emitEvent(t, e, n, o, o, null), this._emitEvent(t, e, n, null, o, null), "panend" === t && this.draggingShape && this._emitEvent("dragleave", e, n, null)) : this._emitEvent(t, e, n, r, null, null); } }), (t.prototype._onpanstart = function (t, e, n) { (this.panstartShape = e), (this.panstartPoint = t), (this.panstartTimeStamp = n.timeStamp), this._emitEvent("panstart", n, t, e, null, null); }), (t.prototype._emitDragoverEvents = function (t, e, n, r, i) { r ? (r !== n && (n && this._emitEvent("dragleave", t, e, n, n, r), this._emitEvent("dragenter", t, e, r, n, r)), i || this._emitEvent("dragover", t, e, r)) : n && this._emitEvent("dragleave", t, e, n, n, r), i && this._emitEvent("dragover", t, e, r); }), (t.prototype._afterDrag = function (t, e, n) { t && (t.set("capture", !0), (this.draggingShape = null)), (this.dragging = !1); var r = this._getShape(e, n); this.currentShape = r; }), (t.prototype._onpanend = function (t, e, n) { var r = this.draggingShape; this.dragging && (r && this._emitEvent("drop", n, t, e), this._emitEvent("dragend", n, t, r), this._afterDrag(r, t, n)), this._emitEvent("panend", n, t, e), (this.panstartShape = null), (this.panstartPoint = null); }), (t.prototype._onpanmove = function (t, e, n) { var r = this.canvas, i = this.currentShape, o = this.draggingShape; if (this.dragging) o && this._emitDragoverEvents(n, t, i, e, !1), this._emitEvent("drag", n, t, o); else { var a = this.panstartPoint; if (a) { var s = this.panstartShape, c = n.timeStamp - this.panstartTimeStamp, u = a.clientX - t.clientX, h = a.clientY - t.clientY; (c > 120 || u * u + h * h > 40) && (s && s.get("draggable") ? ((o = this.panstartShape).set("capture", !1), (this.draggingShape = o), (this.dragging = !0), this._emitEvent("dragstart", n, t, o), (this.panstartShape = null), (this.panstartPoint = null)) : !s && r.get("draggable") ? ((this.dragging = !0), this._emitEvent("dragstart", n, t, null), (this.panstartShape = null), (this.panstartPoint = null)) : this._emitEvent("panmove", n, t, e)); } } this._emitEvent("panmove", n, t, e); }), (t.prototype._emitEvent = function (t, e, n, r, i, o) { var a = this._getEventObj(t, e, n, r, i, o); if (r) { (a.shape = r), p(r, t, a); for (var s = r.getParent(); s; ) s.emitDelegation(t, a), a.propagationStopped || g(s, t, a), a.propagationPath.push(s), (s = s.getParent()); } else { p(this.canvas, t, a); } }), (t.prototype.destroy = function () { (this.canvas = null), (this.currentShape = null), (this.draggingShape = null), (this.panstartPoint = null), (this.panstartShape = null), (this.panstartTimeStamp = null); }), t ); })(), y = (function () { function t() {} return ( (t.prototype.set = function (t, e, n) { switch (e) { case "strokeStyle": t.setStrokeStyle(n); break; case "fillStyle": t.setFillStyle(n); break; case "lineWidth": t.setLineWidth(n); break; case "lineDash": t.setLineDash(n); break; case "globalAlpha": (n || 0 === n) && ((t.globalAlpha = n), t.setGlobalAlpha(n)); break; case "fontSize": t.setFontSize(n); break; case "textAlign": t.setTextAlign(n); break; case "fontStyle": case "font": t.setFont(n); break; case "textBaseline": t.setTextBaseline(n); break; default: t[e] = n; } return !0; }), (t.prototype.get = function (t, e) { return "globalAlpha" === e && void 0 === t[e] ? 1 : "function" == typeof t[e] ? t[e].bind(t) : t[e]; }), t ); })(), m = n(0), b = n(120), x = null; var S = function (t) { var e = t.attr(), n = e.x, r = e.y, i = e.text, o = e.fontSize, a = e.lineHeight, s = e.font; s || (s = Object(b.assembleFont)(e)); var c, u = (function (t, e) { var n = 0; if (Object(m.isNil)(t) || "" === t) return n; if ( (x.save(), (x.font = e), Object(m.isString)(t) && t.includes("\n")) ) { var r = t.split("\n"); Object(m.each)(r, function (t) { var e = x.measureText(t).width; n < e && (n = e); }); } else n = x.measureText(t).width; return x.restore(), n; })(i, s); if (u) { var h = e.textAlign, l = e.textBaseline, f = Object(b.getTextHeight)(i, o, a), d = { x: n, y: r - f }; h && ("end" === h || "right" === h ? (d.x -= u) : "center" === h && (d.x -= u / 2)), l && ("top" === l ? (d.y += f) : "middle" === l && (d.y += f / 2)), (c = { x: d.x, y: d.y, width: u, height: f }); } else c = { x: n, y: r, width: 0, height: 0 }; return c; }, w = function (t) { (x = t), Object(i.registerBBox)("text", S); }, O = n(89), M = (function (t) { function e(e) { var n, r, i = t.call(this, e) || this, o = i.get("context"); return ( i.isMini() && (i.isMiniNative() ? Object(h.c)(i.get("container")) : i.set("context", new Proxy(o, new y())), (n = o), (r = i), Object(O.b)(r), w(n)), i ); } return ( Object(r.c)(e, t), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return ( (e.renderer = "canvas"), (e.autoDraw = !0), (e.localRefresh = !0), (e.refreshElements = []), (e.clipView = !0), (e.quickHit = !1), (e.boundingClientRect = { width: 0, height: 0, left: 0, top: 0, bottom: 0, right: 0, }), e ); }), (e.prototype.initEvents = function () { var t = new v({ canvas: this }); this.set("eventController", t); }), (e.prototype.registerEventCallback = function (t) { this.get("eventController").handleEvent(t); }), (e.prototype.clearEvents = function () { this.get("eventController").destroy(); }), (e.prototype.onCanvasChange = function (t) { ("attr" !== t && "sort" !== t && "changeSize" !== t) || (this.set("refreshElements", [this]), this.draw()); }), (e.prototype.getShapeBase = function () { return s; }), (e.prototype.getGroupBase = function () { return c.a; }), (e.prototype.getPixelRatio = function () { var t = this.get("pixelRatio") || Object(u.c)(); return t >= 1 ? Math.ceil(t) : 1; }), (e.prototype.getViewRange = function () { return { minX: 0, minY: 0, maxX: this.cfg.width, maxY: this.cfg.height, }; }), (e.prototype.initDom = function () { if (this.isMini()) { var e = this.get("context"), n = this.getPixelRatio(); n > 1 && e.scale(n, n); } else t.prototype.initDom.call(this); }), (e.prototype.createDom = function () { var t = document.createElement("canvas"), e = t.getContext("2d"); return this.set("context", e), t; }), (e.prototype.setDOMSize = function (e, n) { t.prototype.setDOMSize.call(this, e, n); var r = this.get("context"), i = this.get("el"), o = this.getPixelRatio(); (i.width = o * e), (i.height = o * n), o > 1 && r.scale(o, o); }), (e.prototype.clear = function () { t.prototype.clear.call(this), this._clearFrame(), this.get("context").clearRect( 0, 0, this.get("width"), this.get("height"), ); }), (e.prototype.getShape = function (e, n) { return this.get("quickHit") ? (function t(e, n, r) { if (!a(e, n, r)) return null; for ( var i = null, s = e.getChildren(), c = s.length - 1; c >= 0; c-- ) { var u = s[c]; if (u.isGroup()) i = t(u, n, r); else if (a(u, n, r)) { var h = u, l = o(u, n, r), f = l[0], d = l[1]; h.isInShape(f, d) && (i = u); } if (i) break; } return i; })(this, e, n) : t.prototype.getShape.call(this, e, n, null); }), (e.prototype._getRefreshRegion = function () { var t, e = this.get("refreshElements"), n = this.getViewRange(); e.length && e[0] === this ? (t = n) : (t = Object(l.f)(e)) && ((t.minX = Math.floor(t.minX)), (t.minY = Math.floor(t.minY)), (t.maxX = Math.ceil(t.maxX)), (t.maxY = Math.ceil(t.maxY)), (t.maxY += 1), this.get("clipView") && (t = Object(l.g)(t, n))); return t; }), (e.prototype._clearFrame = function () { var t = this.get("drawFrame"); t && (Object(h.a)(t), this.set("drawFrame", null), this.set("refreshElements", [])); }), (e.prototype.draw = function () { var t = this.get("drawFrame"); (this.get("autoDraw") && t) || this._startDraw(); }), (e.prototype._startDraw = function () { var t = this, e = this.get("drawFrame"); e || ((e = Object(h.b)(function () { t.get("localRefresh") ? t._drawRegion() : t._drawAll(), Object(h.a)(e), t.set("drawFrame", null); })), this.set("drawFrame", e)); }), (e.prototype._drawRegion = function () { var t = this.get("context"), e = this.get("refreshElements"), n = this.getChildren(), r = this._getRefreshRegion(); r ? (t.clearRect( r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY, ), t.save(), t.beginPath(), t.rect(r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY), t.clip(), Object(l.a)(t, this), Object(l.b)(this, n, r), Object(l.d)(t, n, r), t.restore()) : e.length && Object(l.c)(e), Object(u.b)(e, function (t) { t.get("hasChanged") && t.set("hasChanged", !1); }), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype._drawAll = function () { var t = this.get("context"), e = this.getChildren(); t.clearRect(0, 0, this.get("width"), this.get("height")), Object(l.a)(t, this), Object(l.d)(t, e), this.isMini() && !this.isMiniNative() && t.draw(!0), this.set("refreshElements", []); }), (e.prototype.skipDraw = function () {}), (e.prototype.refreshElement = function (t) { this.get("refreshElements").push(t); }), (e.prototype.getPointByEvent = function (e) { if (this.isMini()) { var n = this.getClientByEvent(e), r = n.x, i = n.y; return this.getPointByClient(r, i); } return t.prototype.getPointByEvent.call(this, e); }), (e.prototype.getClientByEvent = function (t) { var e = t.srcEvent, n = null; return ( e.touches && (n = "touchend" === e.type ? e.changedTouches[0] : e.touches[0]), n ? { x: n.clientX, y: n.clientY } : {} ); }), (e.prototype.getPointByClient = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t - r.left, y: e - r.top }; }), (e.prototype.removeDom = function () { this.isMini() || t.prototype.removeDom.call(this); }), (e.prototype.getClientByPoint = function (t, e) { if (this.isMini()) { var n = this.get("boundingClientRect"); return { x: t + n.left, y: e + n.top }; } var r = this.get("el").getBoundingClientRect(); return { x: t + r.left, y: e + r.top }; }), e ); })(i.AbstractCanvas); e.a = M; }, 185: function (t, e, n) { "use strict"; (function (t) { n.d(e, "a", function () { return f; }); var r = function (t, e, n) { if (n || 2 === arguments.length) for (var r, i = 0, o = e.length; i < o; i++) (!r && i in e) || (r || (r = Array.prototype.slice.call(e, 0, i)), (r[i] = e[i])); return t.concat(r || Array.prototype.slice.call(e)); }, i = function (t, e, n) { (this.name = t), (this.version = e), (this.os = n), (this.type = "browser"); }, o = function (e) { (this.version = e), (this.type = "node"), (this.name = "node"), (this.os = t.platform); }, a = function (t, e, n, r) { (this.name = t), (this.version = e), (this.os = n), (this.bot = r), (this.type = "bot-device"); }, s = function () { (this.type = "bot"), (this.bot = !0), (this.name = "bot"), (this.version = null), (this.os = null); }, c = function () { (this.type = "react-native"), (this.name = "react-native"), (this.version = null), (this.os = null); }, u = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/, h = [ ["aol", /AOLShield\/([0-9\._]+)/], ["edge", /Edge\/([0-9\._]+)/], ["edge-ios", /EdgiOS\/([0-9\._]+)/], ["yandexbrowser", /YaBrowser\/([0-9\._]+)/], ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/], ["samsung", /SamsungBrowser\/([0-9\.]+)/], ["silk", /\bSilk\/([0-9._-]+)\b/], ["miui", /MiuiBrowser\/([0-9\.]+)$/], ["beaker", /BeakerBrowser\/([0-9\.]+)/], ["edge-chromium", /EdgA?\/([0-9\.]+)/], [ "chromium-webview", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/, ], ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/], ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/], ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/], ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/], ["fxios", /FxiOS\/([0-9\.]+)/], ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/], ["opera", /Opera\/([0-9\.]+)(?:\s|$)/], ["opera", /OPR\/([0-9\.]+)(:?\s|$)/], ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/], [ "pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/, ], ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/], ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/], ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/], ["ie", /MSIE\s(7\.0)/], ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/], ["android", /Android\s([0-9\.]+)/], ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/], ["safari", /Version\/([0-9\._]+).*Safari/], ["facebook", /FB[AS]V\/([0-9\.]+)/], ["instagram", /Instagram\s([0-9\.]+)/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/], ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/], ["curl", /^curl\/([0-9\.]+)$/], [ "searchbot", /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/, ], ], l = [ ["iOS", /iP(hone|od|ad)/], ["Android OS", /Android/], ["BlackBerry OS", /BlackBerry|BB10/], ["Windows Mobile", /IEMobile/], ["Amazon OS", /Kindle/], ["Windows 3.11", /Win16/], ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/], ["Windows 98", /(Windows 98)|(Win98)/], ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/], ["Windows XP", /(Windows NT 5.1)|(Windows XP)/], ["Windows Server 2003", /(Windows NT 5.2)/], ["Windows Vista", /(Windows NT 6.0)/], ["Windows 7", /(Windows NT 6.1)/], ["Windows 8", /(Windows NT 6.2)/], ["Windows 8.1", /(Windows NT 6.3)/], ["Windows 10", /(Windows NT 10.0)/], ["Windows ME", /Windows ME/], [ "Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/, ], ["Open BSD", /OpenBSD/], ["Sun OS", /SunOS/], ["Chrome OS", /CrOS/], ["Linux", /(Linux)|(X11)/], ["Mac OS", /(Mac_PowerPC)|(Macintosh)/], ["QNX", /QNX/], ["BeOS", /BeOS/], ["OS/2", /OS\/2/], ]; function f(e) { return e ? p(e) : "undefined" == typeof document && "undefined" != typeof navigator && "ReactNative" === navigator.product ? new c() : "undefined" != typeof navigator ? p(navigator.userAgent) : void 0 !== t && t.version ? new o(t.version.slice(1)) : null; } function d(t) { return ( "" !== t && h.reduce(function (e, n) { var r = n[0], i = n[1]; if (e) return e; var o = i.exec(t); return !!o && [r, o]; }, !1) ); } function p(t) { var e = d(t); if (!e) return null; var n = e[0], o = e[1]; if ("searchbot" === n) return new s(); var c = o[1] && o[1].split(".").join("_").split("_").slice(0, 3); c ? c.length < 3 && (c = r( r([], c, !0), (function (t) { for (var e = [], n = 0; n < t; n++) e.push("0"); return e; })(3 - c.length), !0, )) : (c = []); var h = c.join("."), f = (function (t) { for (var e = 0, n = l.length; e < n; e++) { var r = l[e], i = r[0]; if (r[1].exec(t)) return i; } return null; })(t), p = u.exec(t); return p && p[1] ? new a(n, h, f, p[1]) : new i(n, h, f); } }).call(this, n(206)); }, 2: function (t, e, n) { "use strict"; n.d(e, "d", function () { return Le; }), n.d(e, "g", function () { return _e; }), n.d(e, "f", function () { return De; }), n.d(e, "l", function () { return We; }), n.d(e, "j", function () { return Ve; }), n.d(e, "b", function () { return Se; }), n.d(e, "h", function () { return Ye; }), n.d(e, "k", function () { return qe; }), n.d(e, "i", function () { return Ge; }), n.d(e, "c", function () { return Xe; }), n.d(e, "a", function () { return ze; }), n.d(e, "e", function () { return He; }); var r = {}; n.r(r), n.d(r, "compare", function () { return m; }), n.d(r, "getLineIntersect", function () { return x; }), n.d(r, "getRectIntersectByPoint", function () { return S; }), n.d(r, "getCircleIntersectByPoint", function () { return w; }), n.d(r, "getEllipseIntersectByPoint", function () { return O; }), n.d(r, "applyMatrix", function () { return M; }), n.d(r, "invertMatrix", function () { return k; }), n.d(r, "getCircleCenterByPoints", function () { return j; }), n.d(r, "distance", function () { return C; }), n.d(r, "scaleMatrix", function () { return E; }), n.d(r, "floydWarshall", function () { return P; }), n.d(r, "getAdjMatrix", function () { return A; }), n.d(r, "translate", function () { return I; }), n.d(r, "move", function () { return T; }), n.d(r, "scale", function () { return N; }), n.d(r, "rotate", function () { return B; }), n.d(r, "getDegree", function () { return L; }), n.d(r, "isPointInPolygon", function () { return _; }), n.d(r, "intersectBBox", function () { return R; }), n.d(r, "isPolygonsIntersect", function () { return F; }), n.d(r, "Line", function () { return Y; }), n.d(r, "getBBoxBoundLine", function () { return X; }), n.d(r, "itemIntersectByLine", function () { return W; }), n.d(r, "fractionToLine", function () { return q; }), n.d(r, "getPointsCenter", function () { return V; }), n.d(r, "squareDist", function () { return G; }), n.d(r, "pointLineSquareDist", function () { return H; }), n.d(r, "isPointsOverlap", function () { return U; }), n.d(r, "pointRectSquareDist", function () { return Z; }), n.d(r, "pointLineDistance", function () { return K; }); var i = {}; n.r(i), n.d(i, "getBBox", function () { return ut; }), n.d(i, "getLoopCfgs", function () { return ht; }), n.d(i, "getLabelPosition", function () { return lt; }), n.d(i, "traverseTree", function () { return dt; }), n.d(i, "traverseTreeUp", function () { return pt; }), n.d(i, "getLetterWidth", function () { return gt; }), n.d(i, "getTextSize", function () { return vt; }), n.d(i, "plainCombosToTrees", function () { return yt; }), n.d(i, "reconstructTree", function () { return mt; }), n.d(i, "getComboBBox", function () { return bt; }), n.d(i, "shouldRefreshEdge", function () { return xt; }), n.d(i, "cloneBesidesImg", function () { return St; }); var o = {}; n.r(o), n.d(o, "uniqueId", function () { return jt; }), n.d(o, "formatPadding", function () { return Ct; }), n.d(o, "cloneEvent", function () { return Et; }), n.d(o, "isViewportChanged", function () { return Pt; }), n.d(o, "isNaN", function () { return At; }), n.d(o, "calculationItemsBBox", function () { return It; }), n.d(o, "processParallelEdges", function () { return Tt; }); var a = {}; n.r(a), n.d(a, "getSpline", function () { return te; }), n.d(a, "getControlPoint", function () { return ee; }), n.d(a, "pointsToPolygon", function () { return ne; }), n.d(a, "pathToPoints", function () { return re; }), n.d(a, "getClosedSpline", function () { return ie; }), n.d(a, "roundedHull", function () { return ce; }), n.d(a, "paddedHull", function () { return ue; }); var s = {}; n.r(s), n.d(s, "defaultSubjectColors", function () { return Re; }); var c = n(0), u = { getDefaultCfg: function () { return {}; }, getEvents: function () { return {}; }, updateCfg: function (t) { return Object.assign(this, t), !0; }, shouldBegin: function () { return !0; }, shouldUpdate: function () { return !0; }, shouldEnd: function () { return !0; }, bind: function (t) { var e = this.events; (this.graph = t), ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !0), Object(c.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; ("drag-canvas" !== this.type && "brush-select" !== this.type && "lasso-select" !== this.type) || t.get("canvas").set("draggable", !1), Object(c.each)(e, function (e, n) { t.off(n, e); }); }, get: function (t) { return this[t]; }, set: function (t, e) { return (this[t] = e), this; }, }, h = (function () { function t() {} return ( (t.registerBehavior = function (e, n) { if (!n) throw new Error( "please specify handler for this behavior: ".concat(e), ); var r = Object(c.clone)(u); Object.assign(r, n); var i = function (t) { var e = this; Object.assign(this, this.getDefaultCfg(), t); var n = this.getEvents(); this.events = null; var r = {}; n && (Object(c.each)(n, function (t, n) { r[n] = Object(c.wrapBehavior)(e, t); }), (this.events = r)); }; (i.prototype = r), (t.types[e] = i); }), (t.hasBehavior = function (e) { return !!t.types[e]; }), (t.getBehavior = function (e) { return t.types[e]; }), (t.types = {}), t ); })(), l = h, f = n(1), d = n(91), p = n(97), g = n(4), v = n(35), y = g.a.transform, m = function (t) { return function (e, n) { return e[t] - n[t]; }; }, b = function (t, e, n) { return t >= e && t <= n; }, x = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = e.x - t.x, s = e.y - t.y, c = r.x - n.x, u = r.y - n.y, h = a * u - s * c, l = 1 / h; if (h * h > 1e-4 * (a * a + s * s) * (c * c + u * u)) { var f = (i * u - o * c) * l, d = (i * s - o * a) * l; return b(f, 0, 1) && b(d, 0, 1) ? { x: t.x + f * a, y: t.y + f * s } : null; } return null; }, S = function (t, e) { var n = t.x, r = t.y, i = t.width, o = t.height, a = [], s = { x: n + i / 2, y: r + o / 2 }; a.push({ x: n, y: r }), a.push({ x: n + i, y: r }), a.push({ x: n + i, y: r + o }), a.push({ x: n, y: r + o }), a.push({ x: n, y: r }); for ( var c = null, u = 1; u < a.length && !(c = x(a[u - 1], a[u], s, e)); u++ ); return c; }, w = function (t, e) { var n = t.x, r = t.y, i = t.r, o = e.x - n, a = e.y - r; if (Math.sqrt(o * o + a * a) < i) return null; var s = Math.sign(o), c = Math.sign(a), u = Math.atan(a / o); return { x: n + Math.abs(i * Math.cos(u)) * s, y: r + Math.abs(i * Math.sin(u)) * c, }; }, O = function (t, e) { var n = t.rx, r = t.ry, i = t.x, o = t.y, a = e.x - i, s = e.y - o, c = Math.atan2(s / r, a / n); return ( c < 0 && (c += 2 * Math.PI), { x: i + n * Math.cos(c), y: o + r * Math.sin(c) } ); }, M = function (t, e, n) { void 0 === n && (n = 1); var r = [t.x, t.y, n]; return ( (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]), g.d.transformMat3(r, r, e), { x: r[0], y: r[1] } ); }, k = function (t, e, n) { void 0 === n && (n = 1), (e && !isNaN(e[0])) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = g.b.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], e); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var i = [t.x, t.y, n]; return g.d.transformMat3(i, i, r), { x: i[0], y: i[1] }; }, j = function (t, e, n) { var r = t.x - e.x, i = t.y - e.y, o = t.x - n.x, a = t.y - n.y, s = (t.x * t.x - e.x * e.x - e.y * e.y + t.y * t.y) / 2, c = (t.x * t.x - n.x * n.x - n.y * n.y + t.y * t.y) / 2, u = i * o - r * a; return { x: -(a * s - i * c) / u, y: -(r * c - o * s) / u }; }, C = function (t, e) { var n = t.x - e.x, r = t.y - e.y; return Math.sqrt(n * n + r * r); }, E = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }, P = function (t) { for (var e = [], n = t.length, r = 0; r < n; r += 1) { e[r] = []; for (var i = 0; i < n; i += 1) r === i ? (e[r][i] = 0) : 0 !== t[r][i] && t[r][i] ? (e[r][i] = t[r][i]) : (e[r][i] = 1 / 0); } for (var o = 0; o < n; o += 1) for (r = 0; r < n; r += 1) for (i = 0; i < n; i += 1) e[r][i] > e[r][o] + e[o][i] && (e[r][i] = e[r][o] + e[o][i]); return e; }, A = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }, I = function (t, e) { t.translate(e.x, e.y); }, T = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = t.getCanvasBBox(), i = e.x - r.minX, o = e.y - r.minY, a = y(n, [["t", i, o]]); t.setMatrix(a); }, N = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e; Object(c.isArray)(e) || (r = [e, e]), Object(c.isArray)(e) && 1 === e.length && (r = [e[0], e[0]]), (n = y(n, [["s", r[0], r[1]]])), t.setMatrix(n); }, B = function (t, e) { var n = t.getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (n = y(n, [["r", e]])), t.setMatrix(n); }, L = function (t, e, n) { for (var r = [], i = 0; i < t; i++) r[i] = 0; return ( n.forEach(function (t) { t.source && (r[e[t.source]] += 1), t.target && (r[e[t.target]] += 1); }), r ); }; function D(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } var _ = function (t, e, n) { var r = !1, i = t.length; function o(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } if (i <= 2) return !1; for (var a = 0; a < i; a++) { var s = t[a], c = t[(a + 1) % i]; if (D(s, c, [e, n])) return !0; o(s[1] - n) > 0 != o(c[1] - n) > 0 && o(e - ((n - s[1]) * (s[0] - c[0])) / (s[1] - c[1]) - s[0]) < 0 && (r = !r); } return r; }, R = function (t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); }, F = function (t, e) { var n = function (t) { var e = t.map(function (t) { return t[0]; }), n = t.map(function (t) { return t[1]; }); return { minX: Math.min.apply(null, e), maxX: Math.max.apply(null, e), minY: Math.min.apply(null, n), maxY: Math.max.apply(null, n), }; }, r = function (t) { for (var e = [], n = t.length, r = 0; r < n - 1; r++) { var i = t[r], o = t[r + 1]; e.push({ from: { x: i[0], y: i[1] }, to: { x: o[0], y: o[1] }, }); } if (e.length > 1) { var a = t[0], s = t[n - 1]; e.push({ from: { x: s[0], y: s[1] }, to: { x: a[0], y: a[1] }, }); } return e; }; if (t.length < 2 || e.length < 2) return !1; var i = n(t), o = n(e); if (!R(i, o)) return !1; var a = !1; if ( (Object(c.each)(e, function (e) { if (_(t, e[0], e[1])) return (a = !0), !1; }), a) ) return !0; if ( (Object(c.each)(t, function (t) { if (_(e, t[0], t[1])) return (a = !0), !1; }), a) ) return !0; var s = r(t), u = r(e), h = !1; return ( Object(c.each)(u, function (t) { if ( (function (t, e) { var n = !1; return ( Object(c.each)(t, function (t) { if (x(t.from, t.to, e.from, e.to)) return (n = !0), !1; }), n ); })(s, t) ) return (h = !0), !1; }), h ); }, Y = (function () { function t(t, e, n, r) { (this.x1 = t), (this.y1 = e), (this.x2 = n), (this.y2 = r); } return ( (t.prototype.getBBox = function () { var t = Math.min(this.x1, this.x2), e = Math.min(this.y1, this.y2), n = Math.max(this.x1, this.x2), r = Math.max(this.y1, this.y2); return { x: t, y: e, minX: t, minY: e, maxX: n, maxY: r, width: n - t, height: r - e, }; }), t ); })(), X = function (t, e) { return { top: [t.minX, t.minY, t.maxX, t.minY], left: [t.minX, t.minY, t.minX, t.maxY], bottom: [t.minX, t.maxY, t.maxX, t.maxY], right: [t.maxX, t.minY, t.maxX, t.maxY], }[e]; }, z = function (t, e) { var n = (e.x2 - e.x1) * (t.y1 - e.y1) - (e.y2 - e.y1) * (t.x1 - e.x1), r = (t.x2 - t.x1) * (t.y1 - e.y1) - (t.y2 - t.y1) * (t.x1 - e.x1), i = (e.y2 - e.y1) * (t.x2 - t.x1) - (e.x2 - e.x1) * (t.y2 - t.y1); if (i) { var o = n / i, a = r / i; if (o >= 0 && o <= 1 && a >= 0 && a <= 1) return o; } return Number.POSITIVE_INFINITY; }, W = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = 0, o = [], a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3]; (o[a] = x( { x: e.x1, y: e.y1 }, { x: e.x2, y: e.y2 }, { x: c, y: u }, { x: h, y: l }, )), o[a] && (i += 1); } return [o, i]; }, q = function (t, e) { for ( var n = ["top", "left", "bottom", "right"], r = t.getBBox(), i = Number.POSITIVE_INFINITY, o = 0, a = 0; a < 4; a++ ) { var s = X(r, n[a]), c = s[0], u = s[1], h = s[2], l = s[3], f = z(e, new Y(c, u, h, l)); (f = Math.abs(f - 0.5)) >= 0 && f <= 1 && ((o += 1), (i = f < i ? f : i)); } return 0 === o ? -1 : i; }, V = function (t) { var e = 0, n = 0; if (t.length > 0) { for (var r = 0, i = t; r < i.length; r++) { var o = i[r]; (e += o.x), (n += o.y); } (e /= t.length), (n /= t.length); } return { x: e, y: n }; }, G = function (t, e) { return Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2); }, H = function (t, e) { var n, r = e.x1, i = e.y1, o = e.x2 - r, a = e.y2 - i, s = t.x - r, c = t.y - i, u = s * o + c * a; n = u <= 0 || (u = (s = o - s) * o + (c = a - c) * a) <= 0 ? 0 : (u * u) / (o * o + a * a); var h = s * s + c * c - n; return h < 0 && (h = 0), h; }, U = function (t, e, n) { return ( void 0 === n && (n = 0.001), Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2) < Math.pow(n, 2) ); }, Z = function (t, e) { var n = t.x < e.x, r = t.x > e.x + e.width, i = t.y > e.y + e.height, o = t.y < e.y; if (!(n || r || i || o)) return 0; if (i && !n && !r) return Math.pow(e.y + e.height - t.y, 2); if (o && !n && !r) return Math.pow(t.y - e.y, 2); if (n && !i && !o) return Math.pow(e.x - t.x, 2); if (r && !i && !o) return Math.pow(e.x + e.width - t.x, 2); var a = Math.min(Math.abs(e.x - t.x), Math.abs(e.x + e.width - t.x)), s = Math.min(Math.abs(e.y - t.y), Math.abs(e.y + e.height - t.y)); return a * a + s * s; }, K = function (t, e) { var n = t[0], r = t[1], i = t[2], o = t[3], a = e.x, s = e.y, c = [i - n, o - r]; if (g.c.exactEquals(c, [0, 0])) return NaN; var u = [-c[1], c[0]]; g.c.normalize(u, u); var h = [a - n, s - r]; return Math.abs(g.c.dot(h, u)); }, $ = "rgb(95, 149, 255)", Q = "rgb(253, 253, 253)", J = "rgb(247, 250, 255)", tt = "rgb(224, 224, 224)", et = "rgb(224, 224, 224)", nt = { version: "0.0.2", rootContainerClassName: "root-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: $, fill: "rgb(239, 244, 255)" }, size: 20, color: $, linkPoints: { size: 8, lineWidth: 1, fill: J, stroke: $ }, }, nodeStateStyles: { active: { fill: J, stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, }, selected: { fill: "rgb(255, 255, 255)", stroke: $, lineWidth: 4, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: "rgb(223, 234, 255)", stroke: "#4572d9", lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: "rgb(247, 250, 255)", stroke: "rgb(191, 213, 255)", lineWidth: 1, }, disable: { fill: "rgb(250, 250, 250)", stroke: "rgb(224, 224, 224)", lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: tt, lineAppendWidth: 2 }, color: tt, }, edgeStateStyles: { active: { stroke: $, lineWidth: 1 }, selected: { stroke: $, lineWidth: 2, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: $, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(234, 234, 234)", lineWidth: 1 }, disable: { stroke: "rgb(245, 245, 245)", lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12, }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: Q, lineWidth: 1, stroke: et, r: 5, width: 20, height: 10, }, size: [20, 5], color: et, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: $, lineWidth: 1, fill: "rgb(247, 250, 255)" }, selected: { stroke: $, lineWidth: 2, fill: Q, shadowColor: $, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: "#4572d9", lineWidth: 2, fill: Q, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: "rgb(224, 224, 224)", fill: Q, lineWidth: 1 }, disable: { stroke: "rgb(234, 234, 234)", fill: "rgb(250, 250, 250)", lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, }, rt = { " ": 0.3329986572265625, a: 0.5589996337890625, A: 0.6569992065429687, b: 0.58599853515625, B: 0.6769989013671875, c: 0.5469985961914062, C: 0.7279998779296875, d: 0.58599853515625, D: 0.705999755859375, e: 0.554998779296875, E: 0.63699951171875, f: 0.37299957275390627, F: 0.5769989013671875, g: 0.5909988403320312, G: 0.7479995727539063, h: 0.555999755859375, H: 0.7199996948242188, i: 0.255999755859375, I: 0.23699951171875, j: 0.26699981689453123, J: 0.5169998168945312, k: 0.5289993286132812, K: 0.6899993896484375, l: 0.23499908447265624, L: 0.5879989624023437, m: 0.854998779296875, M: 0.8819992065429687, n: 0.5589996337890625, N: 0.7189987182617188, o: 0.58599853515625, O: 0.7669998168945312, p: 0.58599853515625, P: 0.6419998168945312, q: 0.58599853515625, Q: 0.7669998168945312, r: 0.3649993896484375, R: 0.6759994506835938, s: 0.504998779296875, S: 0.6319992065429687, t: 0.354998779296875, T: 0.6189987182617187, u: 0.5599990844726562, U: 0.7139999389648437, v: 0.48199920654296874, V: 0.6389999389648438, w: 0.754998779296875, W: 0.929998779296875, x: 0.5089996337890625, X: 0.63699951171875, y: 0.4959991455078125, Y: 0.66199951171875, z: 0.48699951171875, Z: 0.6239990234375, 0: 0.6, 1: 0.40099945068359377, 2: 0.6, 3: 0.6, 4: 0.6, 5: 0.6, 6: 0.6, 7: 0.5469985961914062, 8: 0.6, 9: 0.6, "[": 0.3329986572265625, "]": 0.3329986572265625, ",": 0.26399993896484375, ".": 0.26399993896484375, ";": 0.26399993896484375, ":": 0.26399993896484375, "{": 0.3329986572265625, "}": 0.3329986572265625, "\\": 0.5, "|": 0.19499969482421875, "=": 0.604998779296875, "+": 0.604998779296875, "-": 0.604998779296875, _: 0.5, "`": 0.3329986572265625, " ~": 0.8329986572265625, "!": 0.3329986572265625, "@": 0.8579986572265625, "#": 0.6, $: 0.6, "%": 0.9699996948242188, "^": 0.517999267578125, "&": 0.7259994506835937, "*": 0.505999755859375, "(": 0.3329986572265625, ")": 0.3329986572265625, "<": 0.604998779296875, ">": 0.604998779296875, "/": 0.5, "?": 0.53699951171875, }, it = Math.PI, ot = Math.sin, at = Math.cos, st = ot(it / 8), ct = at(it / 8), ut = function (t, e) { var n = t.getBBox(), r = { x: n.minX, y: n.minY }, i = { x: n.maxX, y: n.maxY }; if (e) { var o = e.getMatrix(); o || (o = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = M(r, o)), (i = M(i, o)); } var a = r.x, s = r.y, c = i.x, u = i.y; return { x: a, y: s, minX: a, minY: s, maxX: c, maxY: u, width: c - a, height: u - s, }; }, ht = function (t) { var e = t.sourceNode || t.targetNode, n = e.get("group").getMatrix(); n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var r = e.getKeyShape().getBBox(), i = t.loopCfg || {}, o = i.dist || 2 * Math.max(r.width, r.height), a = i.position || nt.defaultLoopPosition, s = [n[6], n[7]], c = [t.startPoint.x, t.startPoint.y], u = [t.endPoint.x, t.endPoint.y], h = r.height / 2, l = r.height / 2, f = h * st, d = h * ct, p = l * st, v = l * ct; if (c[0] === u[0] && c[1] === u[1]) { switch (a) { case "top": (c = [s[0] - f, s[1] - d]), (u = [s[0] + p, s[1] - v]); break; case "top-right": (h = r.height / 2), (l = r.width / 2), (c = [s[0] + (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (v = l * ct), s[1] - (p = l * st)]); break; case "right": (h = r.width / 2), (l = r.width / 2), (c = [s[0] + (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] + (v = l * ct), s[1] + (p = l * st)]); break; case "bottom-right": (h = r.width / 2), (l = r.height / 2), (c = [s[0] + (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] + (p = l * st), s[1] + (v = l * ct)]); break; case "bottom": (h = r.height / 2), (l = r.height / 2), (c = [s[0] + (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (p = l * st), s[1] + (v = l * ct)]); break; case "bottom-left": (h = r.height / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] + (d = h * ct)]), (u = [s[0] - (v = l * ct), s[1] + (p = l * st)]); break; case "left": (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (d = h * ct), s[1] + (f = h * st)]), (u = [s[0] - (v = l * ct), s[1] - (p = l * st)]); break; case "top-left": (h = r.width / 2), (l = r.height / 2), (c = [s[0] - (d = h * ct), s[1] - (f = h * st)]), (u = [s[0] - (p = l * st), s[1] - (v = l * ct)]); break; default: (h = r.width / 2), (l = r.width / 2), (c = [s[0] - (f = h * st), s[1] - (d = h * ct)]), (u = [s[0] + (p = l * st), s[1] - (v = l * ct)]); } if (!1 === i.clockwise) { var y = [c[0], c[1]]; (c = [u[0], u[1]]), (u = [y[0], y[1]]); } } var m = [c[0] - s[0], c[1] - s[1]], b = (h + o) / h, x = (l + o) / l; !1 === i.clockwise && ((b = (l + o) / l), (x = (h + o) / h)); var S = g.c.scale([0, 0], m, b), w = [s[0] + S[0], s[1] + S[1]], O = [u[0] - s[0], u[1] - s[1]], M = g.c.scale([0, 0], O, x), k = [s[0] + M[0], s[1] + M[1]]; return ( (t.startPoint = { x: c[0], y: c[1] }), (t.endPoint = { x: u[0], y: u[1] }), (t.controlPoints = [ { x: w[0], y: w[1] }, { x: k[0], y: k[1] }, ]), t ); }, lt = function (t, e, n, r, i) { var o = [], a = t.getPoint(e); if (null === a) return { x: 0, y: 0, angle: 0 }; if (e < 1e-4) o = t.getStartTangent().reverse(); else if (e > 0.9999) o = t.getEndTangent(); else { var s = t.getPoint(e + 1e-4); o.push([a.x, a.y]), o.push([s.x, s.y]); } var c = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]); if ( (c < 0 && (c += 2 * it), n && ((a.x += at(c) * n), (a.y += ot(c) * n)), r) ) { var u = c - it / 2; c > 0.5 * it && c < 1.5 * it && (u -= it), (a.x += at(u) * r), (a.y += ot(u) * r); } var h = { x: a.x, y: a.y, angle: c }; return i ? (c > 0.5 * it && c < 1.5 * it && (c -= it), Object(f.a)({ rotate: c }, h)) : h; }, ft = function t(e, n) { if (!1 === n(e)) return !1; if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return !1; return !0; }, dt = function (t, e) { "function" == typeof e && ft(t, e); }, pt = function (t, e) { "function" == typeof e && (function t(e, n) { if (e && e.children) for (var r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !1 !== n(e); })(t, e); }, gt = function (t, e) { return e * (rt[t] || 1); }, vt = function (t, e) { var n = 0, r = new RegExp("[一-龥]+"); return ( t.split("").forEach(function (t) { r.test(t) ? (n += e) : (n += gt(t, e)); }), [n, e] ); }, yt = function (t, e) { var n = [], r = {}, i = {}; t.forEach(function (t) { i[t.id] = t; }), t.forEach(function (t, e) { var o = Object(c.clone)(t); (o.itemType = "combo"), (o.children = void 0), o.parentId === o.id ? (console.warn( "The parentId for combo ".concat( o.id, " can not be the same as the combo's id", ), ), delete o.parentId) : o.parentId && !i[o.parentId] && (console.warn( "The parent combo for combo ".concat( o.id, " does not exist!", ), ), delete o.parentId); var a = r[o.id]; if (a) { if ( ((o.children = a.children), (r[o.id] = o), !(a = o).parentId) ) return void n.push(a); var s = r[a.parentId]; if (s) s.children ? s.children.push(o) : (s.children = [o]); else { var u = { id: a.parentId, children: [a] }; (r[a.parentId] = u), (r[o.id] = o); } } else if (Object(c.isString)(t.parentId)) { var h = r[t.parentId]; if (h) h.children ? h.children.push(o) : (h.children = [o]), (r[o.id] = o); else { var l = { id: t.parentId, children: [o] }; (r[l.id] = l), (r[o.id] = o); } } else n.push(o), (r[o.id] = o); }); var o = {}; (e || []).forEach(function (t) { o[t.id] = t; var e = r[t.comboId]; if (e) { var n = { id: t.id, comboId: t.comboId }; e.children ? e.children.push(n) : (e.children = [n]), (n.itemType = "node"), (r[t.id] = n); } }); var a = 0; return ( n.forEach(function (t) { (t.depth = a + 10), ft(t, function (t) { var e, n = r[t.id].itemType; (e = "node" === n ? r[t.comboId] : r[t.parentId]), (t.depth = e && "node" === n ? a + 1 : a + 10), a < t.depth && (a = t.depth); var i = o[t.id]; return i && (i.depth = t.depth), !0; }); }), n ); }, mt = function (t, e, n) { var r, i = t, o = { root: { children: t } }, a = !1, s = "root"; (t || []).forEach(function (t) { if (!a) return t.id === e ? ((r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), void (a = !0)) : void dt(t, function (t) { return ( (o[t.id] = { children: t.children }), (i = o[t.parentId || t.comboId || "root"].children), !t || (!t.removed && e !== t.id) || !i || ((s = t.parentId || t.comboId || "root"), (r = t), "combo" === t.itemType ? (r.parentId = n) : (r.comboId = n), (a = !0), !1) ); }); }); var c = (i = o[s].children) ? i.indexOf(r) : -1; if ( (c > -1 && i.splice(c, 1), a || ((r = { id: e, itemType: "node", comboId: n }), (o[e] = { children: void 0 })), e) ) { var u = !1; if (n) { var h = 0; (t || []).forEach(function (t) { u || dt(t, function (t) { return ( n !== t.id || ((u = !0), t.children ? t.children.push(r) : (t.children = [r]), (h = t.depth), "node" === r.itemType ? (r.depth = h + 2) : (r.depth = h + 1), !1) ); }); }); } else (n && u) || "node" === r.itemType || t.push(r); var l = r.depth; dt(r, function (t) { return ( "node" === t.itemType ? (l += 2) : (l += 1), (t.depth = l), !0 ); }); } return t; }, bt = function (t, e) { var n = { minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0, x: void 0, y: void 0, width: void 0, height: void 0, centerX: void 0, centerY: void 0, }; return t && 0 !== t.length ? (t.forEach(function (t) { var r = e.findById(t.id); if (r && r.isVisible()) { r.set("bboxCanvasCache", void 0); var i = r.getCanvasBBox(); i.x && n.minX > i.minX && (n.minX = i.minX), i.y && n.minY > i.minY && (n.minY = i.minY), i.x && n.maxX < i.maxX && (n.maxX = i.maxX), i.y && n.maxY < i.maxY && (n.maxY = i.maxY); } }), (n.x = (n.minX + n.maxX) / 2), (n.y = (n.minY + n.maxY) / 2), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), Object.keys(n).forEach(function (t) { (n[t] !== 1 / 0 && n[t] !== -1 / 0) || (n[t] = void 0); }), n) : n; }, xt = function (t) { var e = Object(c.isNumber)(t.x) || Object(c.isNumber)(t.y) || t.type || t.anchorPoints || t.size; return ( t.style && (e = e || Object(c.isNumber)(t.style.r) || Object(c.isNumber)(t.style.width) || Object(c.isNumber)(t.style.height) || Object(c.isNumber)(t.style.rx) || Object(c.isNumber)(t.style.ry)), e ); }, St = function (t) { var e = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n]; if (Object(c.isObject)(r)) { var i = {}; Object.keys(r).forEach(function (t) { var e = r[t]; ("img" !== t || Object(c.isString)(e)) && (i[t] = Object(c.clone)(e)); }), (e[n] = i); } else e[n] = Object(c.clone)(r); }), e ); }, wt = function (t) { if (!t) return console.error("G6 Error Tips: the data must be defined"), !1; var e = t.nodes, n = t.edges, r = t.combos, i = void 0 === r ? [] : r; if (!e && !n) { var o = !0; return ( dt(t, function (t) { return !!Object(c.isString)(t.id) || ((o = !1), !1); }), o ); } var a = (e || []).find(function (t) { return !Object(c.isString)(t.id); }); if (a) return ( console.warn( "G6 Warning Tips: missing 'id' property, or %c".concat( a.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); var s = (e || []).map(function (t) { return t.id; }), u = i.map(function (t) { return t.id; }), h = Object(f.f)(Object(f.f)([], s, !0), u, !0), l = (n || []).find(function (t) { return !h.includes(t.source) || !h.includes(t.target); }); return ( !l || (console.warn( "G6 Warning Tips: The source %c" .concat(l.source, "%c or the target %c") .concat( l.target, "%c of the edge do not exist in the nodes or combos.", ), "font-size: 20px; color: red;", "", "font-size: 20px; color: red;", "", ), !1) ); }, Ot = (function () { function t(t) { (this.graph = t), (this.destroyed = !1), (this.modes = t.get("modes") || { default: [] }), this.formatModes(), (this.mode = t.get("defaultMode") || "default"), (this.currentBehaves = []), this.setMode(this.mode); } return ( (t.prototype.formatModes = function () { var t = this.modes; Object(c.each)(t, function (t) { Object(c.each)(t, function (e, n) { Object(c.isString)(e) && (t[n] = { type: e }); }); }); }), (t.prototype.setBehaviors = function (t) { var e, n = this.graph, r = this.modes[t], i = []; Object(c.each)(r || [], function (t) { var r = h.getBehavior(t.type || t); r && (e = new r(t)) && (e.bind(n), i.push(e)); }), (this.currentBehaves = i); }), (t.mergeBehaviors = function (t, e) { return ( Object(c.each)(e, function (e) { t.indexOf(e) < 0 && (Object(c.isString)(e) && (e = { type: e }), t.push(e)); }), t ); }), (t.filterBehaviors = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = ""; (r = Object(c.isString)(t) ? t : t.type), e.indexOf(r) < 0 && n.push(t); }), n ); }), (t.prototype.setMode = function (t) { var e = this.modes, n = this.graph, r = t; e[r] && (n.emit("beforemodechange", { mode: t }), Object(c.each)(this.currentBehaves, function (t) { t.delegate && t.delegate.remove(), t.unbind(n); }), this.setBehaviors(r), n.emit("aftermodechange", { mode: t }), (this.mode = t)); }), (t.prototype.getMode = function () { return this.mode; }), (t.prototype.manipulateBehaviors = function (e, n, r) { var i, o = this; if (((i = Object(c.isArray)(e) ? e : [e]), Object(c.isArray)(n))) return ( Object(c.each)(n, function (e) { o.modes[e] ? (o.modes[e] = r ? t.mergeBehaviors(o.modes[e] || [], i) : t.filterBehaviors(o.modes[e] || [], i)) : r && (o.modes[e] = i); }), this ); var a = n; return ( n || (a = this.mode), this.modes[a] || (r && (this.modes[a] = i)), (this.modes[a] = r ? t.mergeBehaviors(this.modes[a] || [], i) : t.filterBehaviors(this.modes[a] || [], i)), this.setMode(this.mode), this ); }), (t.prototype.updateBehavior = function (t, e, n) { Object(c.isString)(t) && (t = { type: t }); var r = []; if (n && n !== this.mode && "default" !== n) { if (!(r = this.modes[n]) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); var i = r.length; for (a = 0; a < i; a++) { if ((s = r[a]).type === t.type || s === t.type) return ( s === t.type && (s = { type: s }), Object.assign(s, e), (r[a] = s), this ); a === i - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } else { if (!(r = this.currentBehaves) || !r.length) return ( console.warn( "Update behavior failed! There is no behaviors in this mode on the graph.", ), this ); for (var o = r.length, a = 0; a < o; a++) { var s; if ((s = r[a]).type === t.type) return s.updateCfg(e), this; a === o - 1 && console.warn( "Update behavior failed! There is no such behavior in the mode", ); } } return this; }), (t.prototype.destroy = function () { (this.graph = null), (this.modes = null), (this.currentBehaves = null), (this.destroyed = !0); }), t ); })(), Mt = n(54), kt = (function (t) { function e(e, n) { var r = t.call(this, e, n) || this; return ( (r.item = n.item), (r.canvasX = n.canvasX), (r.canvasY = n.canvasY), (r.detail = n.detail), r ); } return Object(f.c)(e, t), e; })(n(8).Event), jt = function (t) { return "".concat(t, "-").concat(Math.random()).concat(Date.now()); }, Ct = function (t) { var e = 0, n = 0, r = 0, i = 0; if (Object(c.isNumber)(t)) e = n = r = i = t; else if (Object(c.isString)(t)) { e = n = r = i = parseInt(t, 10); } else Object(c.isArray)(t) && ((e = t[0]), (r = Object(c.isNil)(t[1]) ? t[0] : t[1]), (i = Object(c.isNil)(t[2]) ? t[0] : t[2]), (n = Object(c.isNil)(t[3]) ? r : t[3])); return [e, r, i, n]; }, Et = function (t) { var e = new kt(t.type, t); return ( (e.clientX = t.clientX), (e.clientY = t.clientY), (e.x = t.x), (e.y = t.y), (e.target = t.target), (e.currentTarget = t.currentTarget), (e.bubbles = !0), (e.item = t.item), e ); }, Pt = function (t) { if (!t) return !1; for (var e = [1, 0, 0, 0, 1, 0, 0, 0, 1], n = 0; n < 9; n++) if (t[n] !== e[n]) return !0; return !1; }, At = function (t) { return Number.isNaN(Number(t)); }, It = function (t) { for ( var e = 1 / 0, n = -1 / 0, r = 1 / 0, i = -1 / 0, o = 0; o < t.length; o++ ) { var a = t[o].getBBox(), s = a.minX, c = a.minY, u = a.maxX, h = a.maxY; s < e && (e = s), c < r && (r = c), u > n && (n = u), h > i && (i = h); } return { x: Math.floor(e), y: Math.floor(r), width: Math.ceil(n) - Math.floor(e), height: Math.ceil(i) - Math.floor(r), minX: e, minY: r, maxX: n, maxY: i, }; }, Tt = function (t, e, n, r, i) { void 0 === e && (e = 15), void 0 === n && (n = "quadratic"), void 0 === r && (r = void 0), void 0 === i && (i = void 0); for ( var o = t.length, a = 2 * e, s = [ "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ], c = {}, u = [], h = {}, l = 0; l < o; l++ ) { var f = t[l], d = f.source, p = f.target, g = "".concat(d, "-").concat(p); if (!u[l]) { c[g] || (c[g] = []), (u[l] = !0), c[g].push(f); for (var v = 0; v < o; v++) if (l !== v) { var y = t[v], m = y.source, b = y.target; u[v] || (d === b && p === m ? (c[g].push(y), (u[v] = !0), (h[ "" .concat(m, "|") .concat(b, "|") .concat(c[g].length - 1) ] = !0)) : d === m && p === b && (c[g].push(y), (u[v] = !0))); } } } for (var x in c) for (var S = c[x], w = S.length, O = 0; O < w; O++) { var M = S[O]; if (M.source !== M.target) if (1 === w && r && M.source !== M.target) M.type = r; else { M.type = n; var k = (O % 2 == 0 ? 1 : -1) * (h["".concat(M.source, "|").concat(M.target, "|").concat(O)] ? -1 : 1); M.curveOffset = w % 2 == 1 ? k * Math.ceil(O / 2) * a : k * (Math.floor(O / 2) * a + e); } else i && (M.type = i), (M.loopCfg = { position: s[O % 8], dist: 20 * Math.floor(O / 8) + 50, }); } return t; }, Nt = (function () { function t(t) { (this.destroyed = !1), (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.getViewCenter = function () { var t = this.getFormatPadding(), e = this.graph, n = this.graph.get("width"), r = e.get("height"); return { x: (n - t[1] - t[3]) / 2 + t[3], y: (r - t[0] - t[2]) / 2 + t[0], }; }), (t.prototype.fitCenter = function () { var t = this.graph, e = t.get("group"); e.resetMatrix(); var n = e.getCanvasBBox(); if (0 !== n.width && 0 !== n.height) { var r = this.getViewCenter(), i = n.x + n.width / 2, o = n.y + n.height / 2; t.translate(r.x - i, r.y - o); } }), (t.prototype.fitView = function () { var t = this.graph, e = this.getFormatPadding(), n = t.get("width"), r = t.get("height"), i = t.get("group"); i.resetMatrix(); var o = i.getCanvasBBox(); if (0 !== o.width && 0 !== o.height) { var a = this.getViewCenter(), s = o.x + o.width / 2, c = o.y + o.height / 2; t.translate(a.x - s, a.y - c); var u = (n - e[1] - e[3]) / o.width, h = (r - e[0] - e[2]) / o.height, l = u; u > h && (l = h), t.zoom(l, a); } }), (t.prototype.getFormatPadding = function () { var t = this.graph.get("fitViewPadding"); return Ct(t); }), (t.prototype.focusPoint = function (t, e, n) { var r = this, i = this.getViewCenter(), o = this.getPointByCanvas(i.x, i.y), a = this.graph.get("group").getMatrix(); if ((a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), e)) { var s = (o.x - t.x) * a[0], c = (o.y - t.y) * a[4], u = 0, h = 0, l = 0, d = 0; this.graph.get("canvas").animate( function (t) { (l = s * t), (d = c * t), r.graph.translate(l - u, d - h), (u = l), (h = d); }, Object(f.a)({}, n), ); } else this.graph.translate((o.x - t.x) * a[0], (o.y - t.y) * a[4]); }), (t.prototype.getPointByCanvas = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), k({ x: t, y: e }, n) ); }), (t.prototype.getPointByClient = function (t, e) { var n = this.graph.get("canvas").getPointByClient(t, e); return this.getPointByCanvas(n.x, n.y); }), (t.prototype.getClientByPoint = function (t, e) { var n = this.graph.get("canvas"), r = this.getCanvasByPoint(t, e), i = n.getClientByPoint(r.x, r.y); return { x: i.x, y: i.y }; }), (t.prototype.getCanvasByPoint = function (t, e) { var n = this.graph.get("group").getMatrix(); return ( n || (n = [1, 0, 0, 0, 1, 0, 0, 0, 1]), M({ x: t, y: e }, n) ); }), (t.prototype.focus = function (t, e, n) { if ((Object(c.isString)(t) && (t = this.graph.findById(t)), t)) { var r = 0, i = 0; if (t.getType && "edge" === t.getType()) { var o = t.getSource().get("group").getMatrix(), a = t.getTarget().get("group").getMatrix(); o && a ? ((r = (o[6] + a[6]) / 2), (i = (o[7] + a[7]) / 2)) : (o || a) && ((r = o ? o[6] : a[6]), (i = o ? o[7] : a[7])); } else { var s = t.get("group").getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = s[6]), (i = s[7]); } this.focusPoint({ x: r, y: i }, e, n); } }), (t.prototype.changeSize = function (t, e) { var n = this.graph; if (!Object(c.isNumber)(t) || !Object(c.isNumber)(e)) throw Error( "invalid canvas width & height, please make sure width & height type is number", ); n.set({ width: t, height: e }), n.get("canvas").changeSize(t, e), n.get("plugins").forEach(function (r) { if (r.get("gridContainer")) { var i = n.get("minZoom"); Object(Mt.b)(r.get("container"), { width: "".concat(t, "px"), height: "".concat(e, "px"), }), Object(Mt.b)(r.get("gridContainer"), { width: "".concat(t / i, "px"), height: "".concat(e / i, "px"), left: 0, top: 0, }); } }); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !1); }), t ); })(); function Bt(t) { return (Bt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Lt(t) { if ("string" != typeof t) return t; var e = function (t) { if ("string" != typeof t) return t; try { return JSON.parse(t.trim()); } catch (e) { return t.trim(); } }, n = e(t); if ("string" != typeof n) return n; for ( var r = function (t) { return t[t.length - 1]; }, i = t.trim(), o = [], a = [], s = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; return t.some(function (t) { return r(a) === t; }); }, c = null, u = 0, h = ""; u < i.length; ) { var l = i[u], f = s('"', "'"); if (f || l.trim()) { var d = "\\" === i[u - 1], p = s("}"), g = s("]"), v = s(","), y = r(o); if (f) if (r(a) !== l || d) h += l; else { a.pop(); var m = e(h); y.push(m), (c = m), (h = ""); } else if (g && "," === l) h && (y.push(e(h)), (h = "")); else if (p && ":" === l) a.push(","), h && (y.push(h), (h = "")); else if (v && "," === l) h && (y.push(e(h)), (h = "")), a.pop(); else if ("}" === l && (p || v)) { h && (y.push(e(h)), (h = "")), v && a.pop(); for (var b = {}, x = 1; x < y.length; x += 2) b[y[x - 1]] = y[x]; o.pop(), o.length && r(o).push(b), a.pop(), (c = b); } else "]" === l && g ? (h && (y.push(e(h)), (h = "")), o.pop(), o.length && r(o).push(y), a.pop(), (c = y)) : "{" === l ? (o.push([]), a.push("}")) : "[" === l ? (o.push([]), a.push("]")) : '"' === l ? a.push('"') : "'" === l ? a.push("'") : (h += l); u += 1; } else u += 1; } return c || h; } function Dt(t, e) { var n; void 0 === e && (e = { x: 0, y: 0 }); var r = Object(f.a)({ x: 0, y: 0, width: 0, height: 0 }, e); if (null === (n = t.children) || void 0 === n ? void 0 : n.length) { var i = t.attrs, o = void 0 === i ? {} : i, a = o.marginTop, s = Object(f.a)({}, e); a && (s.y += a); for (var c = 0; c < t.children.length; c++) { t.children[c].attrs.key = "" .concat(o.key || "root", " -") .concat(c, " "); var u = Dt(t.children[c], s); if (u.bbox) { var h = u.bbox; "inline" === u.attrs.next ? (s.x += u.bbox.width) : (s.y += u.bbox.height), h.width + h.x > r.width && (r.width = h.width + h.x), h.height + h.y > r.height && (r.height = h.height + h.y); } } } return ( (t.bbox = (function (t, e, n) { var r, i, o = t.attrs, a = void 0 === o ? {} : o, s = { x: e.x || 0, y: e.y || 0, width: n.width || 0, height: n.height || 0, }; switch (t.type) { case "maker": case "circle": a.r && ((i = 2 * a.r), (r = 2 * a.r)); break; case "text": a.text && ((i = vt(a.text, a.fontSize || 12)[0]), (r = 16), (s.y += r), (s.height = r), (s.width = i), (t.attrs = Object(f.a)({ fontSize: 12, fill: "#000" }, a))); break; default: a.width && (i = a.width), a.height && (r = a.height); } return ( r >= 0 && (s.height = r), i >= 0 && (s.width = i), a.marginTop && (s.y += a.marginTop), a.marginLeft && (s.x += a.marginLeft), s ); })(t, e, r)), (t.attrs = Object(f.a)(Object(f.a)({}, t.attrs), t.bbox)), t ); } function _t(t) { var e = {}, n = function (e) { var n = (function (t) { return function (e) { for (var n = t.length, r = [], i = 0, o = ""; i < n; ) if ("{" === t[i] && "{" === t[i + 1]) r.push(o), (o = ""), (i += 2); else if ("}" === t[i] && "}" === t[i + 1]) { if (r.length) { var a = r.pop(); (o = Object(c.get)( e, o, a.endsWith("=") ? '"{'.concat(o, '}"') : o, )), r.push(a + o); } (i += 2), (o = ""); } else (o += t[i]), (i += 1); return ( r.push(o), r .map(function (t, e) { return r[e - 1] && r[e - 1].endsWith("=") ? '"{'.concat(t, '}"') : t; }) .join("") ); }; })("function" == typeof t ? t(e) : t)(e), r = document.createElement("div"); r.innerHTML = n; var i = Dt( (function t(e, n) { var r = {}, i = (e.getAttributeNames && e.getAttributeNames()) || [], o = e.children && Array.from(e.children).map(function (e) { return t(e, n); }), a = {}, s = e.tagName ? e.tagName.toLowerCase() : "group"; return ( "text" === s && (r.text = e.innerText), (a.type = s), "img" === s && (a.type = "image"), Array.from(i).forEach(function (t) { var n = t.split("-").reduce(function (t, e) { return t + e.charAt(0).toUpperCase() + e.slice(1); }), i = e.getAttribute(t); try { if ("style" === n || "attrs" === n) { var o = Lt(i); r = Object(f.a)(Object(f.a)({}, r), o); } else a[n] = Lt(i); } catch (t) { if ("style" === n) throw t; a[n] = i; } }), (a.attrs = r), n && n.style && a.name && "object" === Bt(n.style[a.name]) && (a.attrs = Object(f.a)( Object(f.a)({}, a.attrs), n.style[a.name], )), n && n.style && a.keyshape && (a.attrs = Object(f.a)(Object(f.a)({}, a.attrs), n.style)), o.length && (a.children = o), a ); })(r.children[0], e), ); return r.remove(), i; }; return { draw: function (t, r) { var i = n(t), o = r; return ( (function t(e) { var n = e.attrs, i = void 0 === n ? {} : n, a = e.bbox, s = e.type, c = e.children, u = Object(f.e)(e, ["attrs", "bbox", "type", "children"]); if ("group" !== e.type) { var h = r.addShape( e.type, Object(f.a)( { attrs: i, origin: { bbox: a, type: s, children: c } }, u, ), ); e.keyshape && (o = h); } e.children && e.children.forEach(function (e) { return t(e); }); })(i), (e[t.id] = [i]), o ); }, update: function (t, r) { e[t.id] || (e[t.id] = []); var i = r.getContainer(), o = i.get("children"), a = n(t), s = (function t(e, n) { var r, i, o, a, s = (e || {}).type, c = ((null == n ? void 0 : n.attrs) || {}).key; if ((c && e && (e.attrs.key = c), !e && n)) return { action: "delete", val: n, type: s, key: c }; if (e && !n) return { action: "add", val: e, type: s }; if (!e && !n) return { action: "same", type: s }; var u = []; if ( (null === (r = e.children) || void 0 === r ? void 0 : r.length) > 0 || (null === (i = n.children) || void 0 === i ? void 0 : i.length) > 0 ) for ( var h = Math.max( null === (o = e.children) || void 0 === o ? void 0 : o.length, null === (a = n.children) || void 0 === a ? void 0 : a.length, ), l = n.children || [], f = e.children || [], d = 0; d < h; d += 1 ) u.push(t(f[d], l[d])); var p = Object.keys(n.attrs), g = Object.keys(e.attrs); return n.type !== e.type ? { action: "restructure", nowTarget: e, formerTarget: n, key: c, children: u, } : p .filter(function (t) { return "children" !== t; }) .some(function (t) { return e.attrs[t] !== n.attrs[t] || !g.includes(t); }) ? { action: "change", val: e, children: u, type: s, key: c } : { action: "same", children: u, type: s, key: c }; })(a, e[t.id].pop()), c = function t(e) { var n; "group" !== e.type && i.addShape(e.type, { attrs: e.attrs }), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }, u = function t(e) { var n, r = o.find(function (t) { return t.attrs.key === e.attrs.key; }); r && i.removeChild(r), (null === (n = e.children) || void 0 === n ? void 0 : n.length) && e.children.map(function (e) { return t(e); }); }; !(function t(e) { var n = e.key; if ("group" !== e.type) { var i = o.find(function (t) { return t.attrs.key === n; }); switch (e.action) { case "change": if (i) { var a = e.val.keyshape ? r.getOriginStyle() : {}; i.attr(Object(f.a)(Object(f.a)({}, a), e.val.attrs)); } break; case "add": c(e.val); break; case "delete": u(e.val); break; case "restructure": u(e.formerTarget), c(e.nowTarget); } } e.children && e.children.forEach(function (e) { return t(e); }); })(s), e[t.id].push(a); }, getAnchorPoints: function () { return [ [0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0], ]; }, }; } var Rt = {}; function Ft(t) { return Rt[t] || (Rt[t] = Object(c.upperFirst)(t)), Rt[t]; } var Yt = { defaultShapeType: "defaultType", className: null, getShape: function (t) { return ( this[t] || this[this.defaultShapeType] || this["simple-circle"] ); }, draw: function (t, e, n) { var r = this.getShape(t), i = r.draw(e, n); return r.afterDraw && r.afterDraw(e, n, i), i; }, baseUpdate: function (t, e, n) { var r = this.getShape(t); r.update && r.update(e, n), r.afterUpdate && r.afterUpdate(e, n); }, setState: function (t, e, n, r) { this.getShape(t).setState(e, n, r); }, shouldUpdate: function (t) { return !!this.getShape(t).update; }, getControlPoints: function (t, e) { return this.getShape(t).getControlPoints(e); }, getAnchorPoints: function (t, e) { return this.getShape(t).getAnchorPoints(e); }, }, Xt = { options: {}, draw: function (t, e) { return this.drawShape(t, e); }, drawShape: function () {}, afterDraw: function () {}, afterUpdate: function () {}, setState: function () {}, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { var e = this.options.anchorPoints; return t.anchorPoints || e; }, }, zt = (function () { function t() {} return ( (t.registerFactory = function (e, n) { var r = Ft(e), i = Yt, o = Object(f.a)(Object(f.a)({}, i), n); return (t[r] = o), (o.className = r), o; }), (t.getFactory = function (e) { return t[Ft(e)]; }), (t.registerNode = function (e, n, r) { var i, o = t.Node; if ("string" == typeof n || "function" == typeof n) { var a = _t(n); i = Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a); } else if (n.jsx) { a = _t(n.jsx); i = Object(f.a)( Object(f.a)(Object(f.a)({}, o.getShape("single-node")), a), n, ); } else { o.getShape(r); var s = r ? o.getShape(r) : Xt; i = Object(f.a)(Object(f.a)({}, s), n); } return (i.type = e), (i.itemType = "node"), (o[e] = i), i; }), (t.registerEdge = function (e, n, r) { var i = t.Edge, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "edge"), (i[e] = a), a; }), (t.registerCombo = function (e, n, r) { var i = t.Combo, o = r ? i.getShape(r) : Xt, a = Object(f.a)(Object(f.a)({}, o), n); return (a.type = e), (a.itemType = "combo"), (i[e] = a), a; }), t ); })(), Wt = zt; zt.registerFactory("node", { defaultShapeType: "circle" }), zt.registerFactory("edge", { defaultShapeType: "line" }), zt.registerFactory("combo", { defaultShapeType: "circle" }); var qt = (function () { function t(t) { (this._cfg = {}), (this.destroyed = !1); var e = { id: void 0, type: "item", model: {}, group: void 0, animate: !1, visible: !0, locked: !1, event: !0, keyShape: void 0, states: [], }; this._cfg = Object.assign(e, this.getDefaultCfg(), t); var n = this.get("model"), r = n.id, i = this.get("type"); r || ((r = jt(i)), (this.get("model").id = r)), this.set("id", r); var o = t.group; o && (o.set("item", this), o.set("id", r)), this.init(), this.draw(); var a = n.shape || n.type || ("edge" === i ? "line" : "circle"), s = this.get("shapeFactory"); if (s && s[a]) { var u = s[a].options; if (u && u.stateStyles) { var h = this.get("styles") || n.stateStyles; (h = Object(c.deepMix)({}, u.stateStyles, h)), this.set("styles", h); } } } return ( (t.prototype.calculateBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.calculateCanvasBBox = function () { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); return ( (n.x = n.minX), (n.y = n.minY), (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2), n ); }), (t.prototype.drawInner = function () { var t = this.get("shapeFactory"), e = this.get("group"), n = this.get("model"); e.clear(); var r = n.visible; if ((void 0 === r || r || this.changeVisibility(r), t)) { this.updatePosition(n); var i = this.getShapeCfg(n), o = i.type, a = t.draw(o, i, e); a && (this.set("keyShape", a), a.set("isKeyShape", !0), a.set("draggable", !0)), this.setOriginStyle(), this.set("currentShape", o), this.restoreStates(t, o); } }), (t.prototype.setOriginStyle = function () { var t = this.get("group").get("children"), e = this.getKeyShape(), n = this, r = e.get("name"); if (this.get("originStyle")) { var i = this.getOriginStyle(); r && !i[r] && (i[r] = {}); var o = this.getCurrentStatesStyle(); Object(c.each)(t, function (t) { var e = t.get("name"), a = t.attr(); if (e && e !== r) { var s = o[e]; i[e] || (i[e] = {}), s ? Object.keys(a).forEach(function (t) { var n = a[t]; n !== s[t] && (i[e][t] = n); }) : (i[e] = "image" !== t.get("type") ? Object(c.clone)(a) : n.getShapeStyleByName(e)); } else { var u = t.attr(), h = Object(f.a)(Object(f.a)({}, o), o[r]); Object.keys(u).forEach(function (t) { var e = u[t]; h[t] !== e && (r ? (i[r][t] = e) : (i[t] = e)); }); } }), i.path && delete i.path, i.matrix && delete i.matrix, i.x && delete i.x, i.y && delete i.y, i[r] && i[r].x && delete i[r].x, i[r] && i[r].y && delete i[r].y, n.set("originStyle", i); } else { var a = {}; Object(c.each)(t, function (t) { var e = t.get("type"), i = t.get("name"); if (i && i !== r) a[i] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i); else { var o = n.getShapeStyleByName(); if ( (o.path && delete o.path, o.matrix && delete o.matrix, r) ) if (i) a[r] = o; else { var s = jt("shape"); t.set("name", s), (a[s] = "image" !== e ? Object(c.clone)(t.attr()) : n.getShapeStyleByName(i)); } else Object.assign(a, o); } }), n.set("originStyle", a); } }), (t.prototype.restoreStates = function (t, e) { var n = this, r = n.get("states"); Object(c.each)(r, function (r) { t.setState(e, r, !0, n); }); }), (t.prototype.init = function () { var t = Wt.getFactory(this.get("type")); this.set("shapeFactory", t); }), (t.prototype.get = function (t) { return this._cfg[t]; }), (t.prototype.set = function (t, e) { Object(c.isPlainObject)(t) ? (this._cfg = Object(f.a)(Object(f.a)({}, this._cfg), t)) : (this._cfg[t] = e); }), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null); }), (t.prototype.beforeDraw = function () {}), (t.prototype.afterDraw = function () {}), (t.prototype.afterUpdate = function () {}), (t.prototype.draw = function () { this.beforeDraw(), this.drawInner(), this.afterDraw(); }), (t.prototype.getShapeStyleByName = function (t) { var e, n = this.get("group"); if ( (e = t ? n.find(function (e) { return e.get("name") === t; }) : this.getKeyShape()) ) { var r = {}; return ( Object(c.each)(e.attr(), function (t, e) { "img" !== e && (r[e] = t); }), r ); } return {}; }), (t.prototype.getShapeCfg = function (t) { var e = this.get("styles"); if (e) { var n = t; return (n.style = Object(f.a)(Object(f.a)({}, e), t.style)), n; } return t; }), (t.prototype.getStateStyle = function (t) { var e = this.get("styles"); return e && e[t]; }), (t.prototype.getOriginStyle = function () { return this.get("originStyle"); }), (t.prototype.getCurrentStatesStyle = function () { var t = this, e = {}, n = t.getStates(); return n && n.length ? (Object(c.each)(t.getStates(), function (n) { e = Object.assign(e, t.getStateStyle(n)); }), e) : this.getOriginStyle(); }), (t.prototype.setState = function (t, e) { var n = this.get("states"), r = this.get("shapeFactory"), i = t, o = t; Object(c.isString)(e) && ((i = "".concat(t, ":").concat(e)), (o = "".concat(t, ":"))); var a = n; if (Object(c.isBoolean)(e)) { var s = n.indexOf(o); if (e) { if (s > -1) return; n.push(i); } else s > -1 && n.splice(s, 1); } else if (Object(c.isString)(e)) { var u = n.filter(function (t) { return t.includes(o); }); u.length > 0 && this.clearStates(u), (a = a.filter(function (t) { return !t.includes(o); })).push(i), this.set("states", a); } if (r) { var h = this.get("model").type; r.setState(h, t, e, this); } }), (t.prototype.clearStates = function (t) { var e = this, n = e.getStates(), r = e.get("shapeFactory"), i = e.get("model").type; t || (t = n), Object(c.isString)(t) && (t = [t]); var o = n.filter(function (e) { return -1 === t.indexOf(e); }); e.set("states", o), t.forEach(function (t) { r.setState(i, t, !1, e); }); }), (t.prototype.getContainer = function () { return this.get("group"); }), (t.prototype.getKeyShape = function () { return this.get("keyShape"); }), (t.prototype.getModel = function () { return this.get("model"); }), (t.prototype.getType = function () { return this.get("type"); }), (t.prototype.getID = function () { return this.get("id"); }), (t.prototype.isItem = function () { return !0; }), (t.prototype.getStates = function () { return this.get("states"); }), (t.prototype.hasState = function (t) { return this.getStates().indexOf(t) >= 0; }), (t.prototype.refresh = function () { var t = this.get("model"); this.updatePosition(t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (t.prototype.isOnlyMove = function (t) { return !1; }), (t.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = n.x, a = n.y; (t.x = isNaN(t.x) ? n.x : t.x), (t.y = isNaN(t.y) ? n.y : t.y); var s = this.get("styles"); if (t.stateStyles) { var u = t.stateStyles; Object(c.mix)(s, u), delete t.stateStyles; } Object.assign(n, t), e ? this.updatePosition(t) : ((o === t.x && a === t.y) || this.updatePosition(t), this.updateShape()), this.afterUpdate(), this.clearCache(); }), (t.prototype.updateShape = function () { var t = this.get("shapeFactory"), e = this.get("model"), n = e.type; if (t.shouldUpdate(n) && n === this.get("currentShape")) { var r = this.getShapeCfg(e); t.baseUpdate(n, r, this), this.setOriginStyle(); } else this.draw(); this.restoreStates(t, n); }), (t.prototype.updatePosition = function (t) { var e = this.get("model"), n = Object(c.isNil)(t.x) ? e.x : t.x, r = Object(c.isNil)(t.y) ? e.y : t.y, i = this.get("group"); if (Object(c.isNil)(n) || Object(c.isNil)(r)) return !1; (e.x = n), (e.y = r); var o = i.getMatrix(); return ( (!o || o[6] !== n || o[7] !== r) && (i.resetMatrix(), I(i, { x: n, y: r }), this.clearCache(), !0) ); }), (t.prototype.getBBox = function () { var t = this.get("bboxCache"); return ( t || ((t = this.calculateBBox()), this.set("bboxCache", t)), t ); }), (t.prototype.getCanvasBBox = function () { var t = this.get("bboxCanvasCache"); return ( t || ((t = this.calculateCanvasBBox()), this.set("bboxCanvasCache", t)), t ); }), (t.prototype.toFront = function () { this.get("group").toFront(); }), (t.prototype.toBack = function () { this.get("group").toBack(); }), (t.prototype.show = function () { this.changeVisibility(!0); }), (t.prototype.hide = function () { this.changeVisibility(!1); }), (t.prototype.changeVisibility = function (t) { var e = this.get("group"); t ? e.show() : e.hide(), this.set("visible", t); }), (t.prototype.isVisible = function () { return this.get("visible"); }), (t.prototype.enableCapture = function (t) { var e = this.get("group"); e && e.set("capture", t); }), (t.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), t ); })(), Vt = { source: "start", target: "end" }, Gt = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "edge", sourceNode: null, targetNode: null, startPoint: null, endPoint: null, linkCenter: !1, }; }), (e.prototype.setEnd = function (t, e) { var n = Vt[t] + "Point", r = t + "Node", i = this.get(r); i && !i.destroyed && i.removeEdge(this), Object(c.isPlainObject)(e) ? (this.set(n, e), this.set(r, null)) : (e.addEdge(this), this.set(r, e), this.set(n, null)); }), (e.prototype.getLinkPoint = function (t, e, n) { var r = Vt[t] + "Point", i = t + "Node", o = this.get(r); if (!o) { var a = this.get(i), s = t + "Anchor", u = this.getPrePoint(t, n), h = e[s]; Object(c.isNil)(h) || (o = a.getLinkPointByAnchor(h)), (o = o || a.getLinkPoint(u)), Object(c.isNil)(o.index) || this.set("".concat(t, "AnchorIndex"), o.index); } return o; }), (e.prototype.getPrePoint = function (t, e) { if (e && e.length) return e["source" === t ? 0 : e.length - 1]; var n = "source" === t ? "target" : "source"; return this.getEndPoint(n); }), (e.prototype.getEndPoint = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); return r ? r.get("model") : this.get(n); }), (e.prototype.getControlPointsByCenter = function (t) { var e = this.getEndPoint("source"), n = this.getEndPoint("target"), r = this.get("shapeFactory"), i = t.type; return r.getControlPoints(i, { startPoint: e, endPoint: n }); }), (e.prototype.getEndCenter = function (t) { var e = t + "Node", n = Vt[t] + "Point", r = this.get(e); if (r) { var i = r.getBBox(); return { x: i.centerX, y: i.centerY }; } return this.get(n); }), (e.prototype.init = function () { t.prototype.init.call(this), this.setSource(this.get("source")), this.setTarget(this.get("target")); }), (e.prototype.getShapeCfg = function (e) { var n = this.get("linkCenter"), r = t.prototype.getShapeCfg.call(this, e); if (n) (r.startPoint = this.getEndCenter("source")), (r.endPoint = this.getEndCenter("target")); else { var i = r.controlPoints || this.getControlPointsByCenter(r); (r.startPoint = this.getLinkPoint("source", e, i)), (r.endPoint = this.getLinkPoint("target", e, i)); } return ( (r.sourceNode = this.get("sourceNode")), (r.targetNode = this.get("targetNode")), r ); }), (e.prototype.getModel = function () { var t = this.get("model"), e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); return ( e ? delete t["source".concat("Node")] : (t.source = this.get("start".concat("Point"))), n ? delete t["target".concat("Node")] : (t.target = this.get("end".concat("Point"))), Object(c.isString)(t.source) || Object(c.isPlainObject)(t.source) || (t.source = t.source.getID()), Object(c.isString)(t.target) || Object(c.isPlainObject)(t.target) || (t.target = t.target.getID()), t ); }), (e.prototype.setSource = function (t) { this.setEnd("source", t), this.set("source", t); }), (e.prototype.setTarget = function (t) { this.setEnd("target", t), this.set("target", t); }), (e.prototype.getSource = function () { return this.get("source"); }), (e.prototype.getTarget = function () { return this.get("target"); }), (e.prototype.updatePosition = function () { return !1; }), (e.prototype.update = function (t, e) { void 0 === e && (e = !1); var n = this.get("model"), r = n.visible, i = t.visible; r !== i && void 0 !== i && this.changeVisibility(i); var o = this.get("styles"); if (t.stateStyles) { var a = t.stateStyles; Object(c.mix)(o, a), delete t.stateStyles; } Object.assign(n, t), this.updateShape(), this.afterUpdate(), this.clearCache(); }), (e.prototype.destroy = function () { var e = this.get("source".concat("Node")), n = this.get("target".concat("Node")); e && !e.destroyed && e.removeEdge(this), n && !n.destroyed && n.removeEdge(this), t.prototype.destroy.call(this); }), e ); })(qt), Ht = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getNearestPoint = function (t, e) { for ( var n = 0, r = t[0], i = C(t[0], e), o = 0; o < t.length; o++ ) { var a = t[o], s = C(a, e); s < i && ((r = a), (i = s), (n = o)); } return (r.anchorIndex = n), r; }), (e.prototype.getDefaultCfg = function () { return { type: "node", edges: [] }; }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getInEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("target") === t; }); }), (e.prototype.getOutEdges = function () { var t = this; return this.get("edges").filter(function (e) { return e.get("source") === t; }); }), (e.prototype.getNeighbors = function (t) { var e = this, n = this.get("edges"); if ("target" === t) { return n .filter(function (t) { return t.getSource() === e; }) .map(function (t) { return t.getTarget(); }); } if ("source" === t) { return n .filter(function (t) { return t.getTarget() === e; }) .map(function (t) { return t.getSource(); }); } return n.map(function (t) { return t.getSource() === e ? t.getTarget() : t.getSource(); }); }), (e.prototype.getLinkPointByAnchor = function (t) { return this.getAnchorPoints()[t]; }), (e.prototype.getLinkPoint = function (t) { var e, n, r = this.get("keyShape").get("type"), i = this.get("type"), o = this.getBBox(); "combo" === i ? ((e = o.centerX || (o.maxX + o.minX) / 2), (n = o.centerY || (o.maxY + o.minY) / 2)) : ((e = o.centerX), (n = o.centerY)); var a, s = this.getAnchorPoints(); switch (r) { case "circle": a = w({ x: e, y: n, r: o.width / 2 }, t); break; case "ellipse": a = O({ x: e, y: n, rx: o.width / 2, ry: o.height / 2 }, t); break; default: a = S(o, t); } var c = a; return ( s.length && (c || (c = t), (c = this.getNearestPoint(s, c))), c || (c = { x: e, y: n }), c ); }), (e.prototype.getAnchorPoints = function () { var t = this.get("anchorPointsCache"); if (!t) { t = []; var e = this.get("shapeFactory"), n = this.getBBox(), r = this.get("model"), i = this.getShapeCfg(r), o = r.type, a = e.getAnchorPoints(o, i) || []; Object(c.each)(a, function (e, r) { var i = { x: n.minX + e[0] * n.width, y: n.minY + e[1] * n.height, anchorIndex: r, }; t.push(i); }), this.set("anchorPointsCache", t); } return t; }), (e.prototype.addEdge = function (t) { this.get("edges").push(t); }), (e.prototype.lock = function () { this.set("locked", !0); }), (e.prototype.unlock = function () { this.set("locked", !1); }), (e.prototype.hasLocked = function () { return this.get("locked"); }), (e.prototype.removeEdge = function (t) { var e = this.getEdges(), n = e.indexOf(t); n > -1 && e.splice(n, 1); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("anchorPointsCache", null); }), (e.prototype.isOnlyMove = function (t) { if (!t) return !1; var e = !Object(c.isNil)(t.x), n = !Object(c.isNil)(t.y), r = Object.keys(t); return (1 === r.length && (e || n)) || (2 === r.length && e && n); }), e ); })(qt), Ut = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(f.c)(e, t), (e.prototype.getDefaultCfg = function () { return { type: "combo", nodes: [], edges: [], combos: [] }; }), (e.prototype.getShapeCfg = function (t) { var e = this.get("styles"), n = this.get("bbox"); if (e && n) { var r = t, i = { r: Math.hypot(n.height, n.width) / 2 || nt.defaultCombo.size[0] / 2, width: n.width || nt.defaultCombo.size[0], height: n.height || nt.defaultCombo.size[1], }; r.style = Object(f.a)( Object(f.a)(Object(f.a)({}, e), t.style), i, ); var o = t.padding || nt.defaultCombo.padding; return ( Object(c.isNumber)(o) ? ((i.r += o), (i.width += 2 * o), (i.height += 2 * o)) : ((i.r += o[0]), (i.width += o[1] + o[3] || 2 * o[1]), (i.height += o[0] + o[2] || 2 * o[0])), this.set("sizeCache", i), r ); } return t; }), (e.prototype.calculateCanvasBBox = function () { if (!this.destroyed) { var t = this.get("keyShape"), e = this.get("group"), n = ut(t, e); (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); var r = this.get("sizeCache"), i = this.get("bboxCache") || {}, o = i.x, a = i.x; if (r) (r.width = Math.max(r.width, n.width)), (r.height = Math.max(r.height, n.height)), "circle" === t.get("type") ? ((n.width = 2 * r.r), (n.height = 2 * r.r)) : ((n.width = r.width), (n.height = r.height)), (n.minX = n.centerX - n.width / 2), (n.minY = n.centerY - n.height / 2), (n.maxX = n.centerX + n.width / 2), (n.maxY = n.centerY + n.height / 2); else (n.width = n.maxX - n.minX), (n.height = n.maxY - n.minY), (n.centerX = (n.minX + n.maxX) / 2), (n.centerY = (n.minY + n.maxY) / 2); return ( (n.x = n.minX), (n.y = n.minY), (n.x === o && n.y === a) || this.set("anchorPointsCache", null), n ); } }), (e.prototype.getChildren = function () { return { nodes: this.getNodes(), combos: this.getCombos() }; }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.addChild = function (t) { switch (t.getType()) { case "node": this.addNode(t); break; case "combo": this.addCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.addCombo = function (t) { return this.get("combos").push(t), !0; }), (e.prototype.addNode = function (t) { return this.get("nodes").push(t), !0; }), (e.prototype.removeChild = function (t) { switch (t.getType()) { case "node": this.removeNode(t); break; case "combo": this.removeCombo(t); break; default: return ( console.warn( "Only node or combo items are allowed to be added into a combo", ), !1 ); } return !0; }), (e.prototype.removeCombo = function (t) { if (t) { var e = this.getCombos(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.removeNode = function (t) { if (t) { var e = this.getNodes(), n = e.indexOf(t); return n > -1 && (e.splice(n, 1), !0); } }), (e.prototype.isOnlyMove = function (t) { return !1; }), (e.prototype.getBBox = function () { return ( this.set("bboxCanvasCache", null), this.calculateCanvasBBox() ); }), (e.prototype.clearCache = function () { this.set("bboxCache", null), this.set("bboxCanvasCache", null), this.set("anchorPointsCache", null); }), (e.prototype.destroy = function () { if (!this.destroyed) { var t = this.get("animate"), e = this.get("group"); t && e.stopAnimate(), this.clearCache(), this.set("sizeCache", null), this.set("bbox", null), e.remove(), (this._cfg = null), (this.destroyed = !0); } }), e ); })(Ht), Zt = (function () { function t(t) { (this.graph = t), (this.destroyed = !1); } return ( (t.prototype.addItem = function (t, e) { var n = this.graph, r = "vedge" === t ? "edge" : t, i = n.get("".concat(r, "Group")) || n.get("group"), o = Object(c.upperFirst)(r), a = null, s = n.get(r + Object(c.upperFirst)("stateStyles")) || {}, u = n.get("default" + o); e.stateStyles && (s = e.stateStyles), u && Object(c.each)(u, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, t, e[n])) : Object(c.isArray)(t) ? (e[n] = e[n] || Object(c.clone)(u[n])) : (e[n] = e[n] || u[n]); }); var h = n.get(r + "Mapper"); if (h) { var l = h(e); l.stateStyles && ((s = l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { Object(c.isObject)(t) && !Object(c.isArray)(t) ? (e[n] = Object(c.deepMix)({}, e[n], t)) : (e[n] = l[n] || e[n]); }); } if ( (n.emit("beforeadditem", { type: t, model: e }), "edge" === t || "vedge" === t) ) { var f = void 0, d = void 0; if ( ((f = e.source), (d = e.target), f && Object(c.isString)(f) && (f = n.findById(f)), d && Object(c.isString)(d) && (d = n.findById(d)), !f || !d) ) return void console.warn( "The source or target node of edge ".concat( e.id, " does not exist!", ), ); f.getType && "combo" === f.getType() && (e.isComboEdge = !0), d.getType && "combo" === d.getType() && (e.isComboEdge = !0), (a = new Gt({ model: e, source: f, target: d, styles: s, linkCenter: n.get("linkCenter"), group: i.addGroup(), })); } else if ("node" === t) a = new Ht({ model: e, styles: s, group: i.addGroup() }); else if ("combo" === t) { var p = e.children, g = bt(p, n); isNaN(g.x) ? isNaN(e.x) && (e.x = 100 * Math.random()) : (e.x = g.x), isNaN(g.y) ? isNaN(e.y) && (e.y = 100 * Math.random()) : (e.y = g.y); var v = i.addGroup(); v.setZIndex(e.depth); var y = (a = new Ut({ model: e, styles: s, bbox: e.collapsed ? bt([], n) : g, group: v, })).getModel(); (p || []).forEach(function (t) { var e = n.findById(t.id); a.addChild(e), (t.depth = y.depth + 2); }), e.collapsed && setTimeout(function () { n.collapseCombo(a); }, 16); } if (a) return ( n.get("".concat(t, "s")).push(a), (n.get("itemMap")[a.get("id")] = a), n.emit("afteradditem", { item: a, model: e }), a ); }), (t.prototype.updateItem = function (t, e) { var n, r, i = this.graph; if ( (Object(c.isString)(t) && (t = i.findById(t)), t && !t.destroyed) ) { var o = ""; t.getType && (o = t.getType()); var a = i.get(o + "Mapper"), s = t.getModel(), u = t.isOnlyMove(e); if (a) { var h = a(Object(c.deepMix)({}, s, e)), l = Object(c.deepMix)({}, s, h, e); h.stateStyles && (t.set("styles", l.stateStyles), delete l.stateStyles), Object(c.each)(l, function (t, n) { e[n] = t; }); } else Object(c.each)(e, function (t, n) { s[n] && Object(c.isObject)(t) && !Object(c.isArray)(t) && (e[n] = Object(f.a)(Object(f.a)({}, s[n]), e[n])); }); if ( (i.emit("beforeupdateitem", { item: t, cfg: e }), "edge" === o) ) { if (e.source) { var d = e.source; Object(c.isString)(d) && (d = i.findById(d)), t.setSource(d); } if (e.target) { var p = e.target; Object(c.isString)(p) && (p = i.findById(p)), t.setTarget(p); } t.update(e); } if ("node" === o || "combo" === o) { t.update(e, u); var g = t.getEdges(), v = xt(e); if (v && "node" === o) Object(c.each)(g, function (t) { t.refresh(); }); else if (v && "combo" === o) { var y = t.get("shapeFactory"), m = s.type || "circle"; ( void 0 === s.animate || void 0 === e.animate ? null === (r = null === (n = y[m]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : s.animate || e.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && Object(c.each)(g, function (t) { t && !t.destroyed && t.refresh(); }); } }, 201) : Object(c.each)(g, function (t) { t.refresh(); }); } } i.emit("afterupdateitem", { item: t, cfg: e }); } }), (t.prototype.updateCombo = function (t, e) { var n, r, i = this, o = this.graph; if ( (Object(c.isString)(t) && (t = o.findById(t)), t && !t.destroyed) ) { var a = t.getModel(), s = bt(a.collapsed ? [] : e, o); t.set("bbox", s), t.update({ x: s.x, y: s.y }); var u = t.get("shapeFactory"), h = a.type || "circle"; ( void 0 === a.animate ? null === (r = null === (n = u[h]) || void 0 === n ? void 0 : n.options) || void 0 === r ? void 0 : r.animate : a.animate ) ? setTimeout(function () { if (t && !t.destroyed) { var e = t.getKeyShape(); e && !e.destroyed && (t.getShapeCfg(a), i.updateComboEdges(t)); } }, 201) : this.updateComboEdges(t); } }), (t.prototype.updateComboEdges = function (t) { for (var e = t.getEdges() || [], n = 0; n < e.length; n++) { var r = e[n]; if (r && !r.destroyed) { var i = r.get("shapeFactory"), o = r.getShapeCfg(r.getModel()), a = r.getContainer(); a.clear(); var s = i.draw(o.type, o, a); r.set("keyShape", s), s.set("isKeyShape", !0), s.set("draggable", !0), r.setOriginStyle(); } } }), (t.prototype.collapseCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.hideItem(t); }), n.combos.forEach(function (t) { e.hideItem(t); }); }), (t.prototype.expandCombo = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)); var n = t.getChildren(); n.nodes.forEach(function (t) { e.showItem(t); }), n.combos.forEach(function (t) { t.getModel().collapsed ? t.show() : e.showItem(t); }); }), (t.prototype.removeItem = function (t) { var e = this, n = this.graph; if ( (Object(c.isString)(t) && (t = n.findById(t)), t && !t.destroyed) ) { var r = Object(c.clone)(t.getModel()); n.emit("beforeremoveitem", { item: r }); var i = ""; t.getType && (i = t.getType()); var o = n.get("".concat(i, "s")), a = o.indexOf(t); if ((a > -1 && o.splice(a, 1), "edge" === i)) { var s = n.get("v".concat(i, "s")), u = s.indexOf(t); u > -1 && s.splice(u, 1); } var h = t.get("id"); delete n.get("itemMap")[h]; var l = n.get("comboTrees"), f = t.get("id"); if ("node" === i) { var d = t.getModel().comboId; if (l && d) { var p = l, g = !1; l.forEach(function (t) { g || dt(t, function (t) { if (t.id === f && p) { var e = p.indexOf(t); return p.splice(e, 1), (g = !0), !1; } return (p = t.children), !0; }); }); } for (var v = (x = t.getEdges()).length - 1; v >= 0; v--) n.removeItem(x[v], !1); d && n.updateCombo(d); } else if ("combo" === i) { var y, m = t.getModel().parentId, b = !1; (l || []).forEach(function (t) { b || dt(t, function (t) { return t.id !== f || ((y = t), (b = !0), !1); }); }), (y.removed = !0), y && y.children && y.children.forEach(function (t) { e.removeItem(t.id); }); var x; for (v = (x = t.getEdges()).length; v >= 0; v--) n.removeItem(x[v], !1); m && n.updateCombo(m); } t.destroy(), n.emit("afterremoveitem", { item: r }); } }), (t.prototype.setItemState = function (t, e, n) { var r = this.graph, i = e; Object(c.isString)(n) && (i = "".concat(e, ":").concat(n)), (t.hasState(i) === n && n) || (Object(c.isString)(n) && t.hasState(i)) || (r.emit("beforeitemstatechange", { item: t, state: i, enabled: n, }), t.setState(e, n), r.autoPaint(), r.emit("afteritemstatechange", { item: t, state: i, enabled: n, })); }), (t.prototype.priorityState = function (t, e) { var n = this.graph, r = t; Object(c.isString)(t) && (r = n.findById(t)), this.setItemState(r, e, !1), this.setItemState(r, e, !0); }), (t.prototype.clearItemStates = function (t, e) { var n = this.graph; Object(c.isString)(t) && (t = n.findById(t)), n.emit("beforeitemstatesclear", { item: t, states: e }), t.clearStates(e), n.emit("afteritemstatesclear", { item: t, states: e }); }), (t.prototype.refreshItem = function (t) { var e = this.graph; Object(c.isString)(t) && (t = e.findById(t)), e.emit("beforeitemrefresh", { item: t }), t.refresh(), e.emit("afteritemrefresh", { item: t }); }), (t.prototype.addCombos = function (t, e) { var n = this, r = this.graph; (t || []).forEach(function (t) { pt(t, function (t) { var r; return ( e.forEach(function (e) { e.id === t.id && ((e.children = t.children), (e.depth = t.depth), (r = e)); }), r && n.addItem("combo", r), !0 ); }); }); var i = r.get("comboGroup"); i && i.sort(); }), (t.prototype.changeItemVisibility = function (t, e) { var n = this, r = this.graph; if ((Object(c.isString)(t) && (t = r.findById(t)), t)) { if ( (r.emit("beforeitemvisibilitychange", { item: t, visible: e, }), t.changeVisibility(e), t.getType && "node" === t.getType()) ) { var i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } else if (t.getType && "combo" === t.getType()) { var o = r.get("comboTrees"), a = t.get("id"), s = [], u = !1; (o || []).forEach(function (t) { u || (t.children && 0 !== t.children.length && dt(t, function (t) { return t.id !== a || ((s = t.children), (u = !0), !1); })); }), s && (!e || (e && !t.getModel().collapsed)) && s.forEach(function (t) { var i = r.findById(t.id); n.changeItemVisibility(i, e); }); i = t.getEdges(); Object(c.each)(i, function (t) { (!e || (t.get("source").isVisible() && t.get("target").isVisible())) && n.changeItemVisibility(t, e); }); } return ( r.emit("afteritemvisibilitychange", { item: t, visible: e }), t ); } console.warn("The item to be shown or hidden does not exist!"); }), (t.prototype.destroy = function () { (this.graph = null), (this.destroyed = !0); }), t ); })(), Kt = null, $t = (function () { function t(t) { (this.graph = t), (this.cachedStates = { enabled: {}, disabled: {} }), (this.destroyed = !1); } return ( (t.checkCache = function (t, e, n) { if (n[e]) { var r = n[e].indexOf(t); r >= 0 && n[e].splice(r, 1); } }), (t.cacheState = function (t, e, n) { n[e] || (n[e] = []), n[e].push(t); }), (t.prototype.updateState = function (e, n, r) { var i = this, o = t.checkCache, a = t.cacheState; if (!e.destroyed) { var s = this.cachedStates, c = s.enabled, u = s.disabled; r ? (o(e, n, u), a(e, n, c)) : (o(e, n, c), a(e, n, u)), Kt && clearTimeout(Kt), (Kt = setTimeout(function () { (Kt = null), i.updateGraphStates(); }, 16)); } }), (t.prototype.updateStates = function (t, e, n) { var r = this; Object(c.isString)(e) ? this.updateState(t, e, n) : e.forEach(function (e) { r.updateState(t, e, n); }); }), (t.prototype.updateGraphStates = function () { var t = this.graph.get("states"), e = this.cachedStates; Object(c.each)(e.disabled, function (e, n) { t[n] && (t[n] = t[n].filter(function (t) { return e.indexOf(t) < 0 && !e.destroyed; })); }), Object(c.each)(e.enabled, function (e, n) { if (t[n]) { var r = {}; t[n].forEach(function (t) { t.destroyed || (r[t.get("id")] = !0); }), e.forEach(function (e) { if (!e.destroyed) { var i = e.get("id"); r[i] || ((r[i] = !0), t[n].push(e)); } }); } else t[n] = e; }), this.graph.emit("graphstatechange", { states: t }), (this.cachedStates = { enabled: {}, disabled: {} }); }), (t.prototype.destroy = function () { (this.graph = null), (this.cachedStates = null), Kt && clearTimeout(Kt), (Kt = null), (this.destroyed = !0); }), t ); })(), Qt = n(28), Jt = function (t, e) { return t && e ? t.replace(/\\?\{([^{}]+)\}/g, function (t, n) { if ("\\" === t.charAt(0)) return t.slice(1); var r = e[n]; return 0 === r && (r = "0"), r || ""; }) : t; }, te = function (t) { var e = []; if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); for (var n = 0, r = t; n < r.length; n++) { var i = r[n], o = i.x, a = i.y; e.push(o), e.push(a); } var s = Object(Qt.a)(e); return s.unshift(["M", t[0].x, t[0].y]), s; }, ee = function (t, e, n, r) { void 0 === n && (n = 0), void 0 === r && (r = 0); var i = { x: (1 - n) * t.x + n * e.x, y: (1 - n) * t.y + n * e.y }, o = [0, 0]; g.c.normalize(o, [e.x - t.x, e.y - t.y]), (o && (o[0] || o[1])) || (o = [0, 0]); var a = [-o[1] * r, o[0] * r]; return (i.x += a[0]), (i.y += a[1]), i; }, ne = function (t, e) { var n = t.length; if (!n) return ""; for (var r = "", i = 0; i < n; i++) { var o = t[i]; r += Jt(0 === i ? "M{x} {y}" : "L{x} {y}", o); } return e && (r += "Z"), r; }, re = function (t) { var e = []; return ( t.forEach(function (t) { if ("A" !== t[0]) for (var n = 1; n < t.length; n += 2) e.push([t[n], t[n + 1]]); else { var r = t.length; e.push([t[r - 2], t[r - 1]]); } }), e ); }, ie = function (t) { if (t.length < 2) throw new Error( "point length must largn than 2, now it's ".concat(t.length), ); var e = t[0], n = t[1], r = t[t.length - 1], i = t[t.length - 2]; t.unshift(r), t.unshift(i), t.push(e), t.push(n); for (var o = [], a = 1; a < t.length - 2; a += 1) { var s = t[a - 1].x, c = t[a - 1].y, u = t[a].x, h = t[a].y, l = t[a + 1].x, f = t[a + 1].y, d = u + (l - s) / 6, p = h + (f - c) / 6, g = l - ((a !== t.length - 2 ? t[a + 2].x : l) - u) / 6, v = f - ((a !== t.length - 2 ? t[a + 2].y : f) - h) / 6; o.push(["C", d, p, g, v, l, f]); } return o.unshift(["M", r.x, r.y]), o; }, oe = function (t, e) { return g.c.scale([0, 0], g.c.normalize([0, 0], t), e); }, ae = function (t, e) { var n = [t[1] - e[1], e[0] - t[0]], r = Math.sqrt(n[0] * n[0] + n[1] * n[1]); if (0 === r) throw new Error("p0 should not be equal to p1"); return [n[0] / r, n[1] / r]; }, se = function (t, e) { return [e[0] - t[0], e[1] - t[1]]; }; function ce(t, e) { if (!t || t.length < 1) return ""; if (1 === t.length) return (function (t) { var n = [t[0][0], t[0][1] - e], r = [t[0][0], t[0][1] + e]; return "M " .concat(n, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(r, " A ") .concat(e, ",") .concat(e, ",0,0,0,") .concat(n); })(t); if (2 === t.length) return (function (t) { var n = g.c.scale([0, 0], ae(t[0], t[1]), e), r = g.c.scale([0, 0], n, -1), i = g.c.add([0, 0], t[0], n), o = g.c.add([0, 0], t[1], n), a = g.c.add([0, 0], t[1], r), s = g.c.add([0, 0], t[0], r); return "M " .concat(i, " L ") .concat(o, " A ") .concat([e, e, "0,0,0", a].join(","), " L ") .concat(s, " A ") .concat([e, e, "0,0,0", i].join(",")); })(t); for (var n = new Array(t.length), r = 0; r < n.length; ++r) { var i = 0 === r ? t[t.length - 1] : t[r - 1], o = t[r], a = g.c.scale([0, 0], ae(i, o), e); n[r] = [g.c.add([0, 0], i, a), g.c.add([0, 0], o, a)]; } var s = "A ".concat([e, e, "0,0,0,"].join(",")); return (n = n.map(function (t, e) { var r = ""; return ( 0 === e && (r = "M ".concat(n[n.length - 1][1], " ")), (r += "".concat(s + t[0], " L ").concat(t[1])) ); })).join(" "); } function ue(t, e) { var n, r, i, o = t.length; if (!t || o < 1) return ""; if (1 === o) return ( (r = [(n = t)[0][0], n[0][1] - e]), (i = [n[0][0], n[0][1] + e]), "M " .concat(r, " A ") .concat([e, e, "0,0,0", i].join(","), " A ") .concat([e, e, "0,0,0", r].join(",")) ); if (2 === o) return (function (t) { var n = se(t[0], t[1]), r = oe(n, e), i = g.c.add([0, 0], t[0], g.c.scale([0, 0], r, -1)), o = g.c.add([0, 0], t[1], r), a = 1.2 * e, s = oe(g.c.normalize([0, 0], n), a), c = g.c.scale([0, 0], s, -1), u = g.c.add([0, 0], i, c), h = g.c.add([0, 0], o, c), l = g.c.add([0, 0], i, s); return "M " .concat(i, " C ") .concat([u, h, o].join(","), " S ") .concat([l, i].join(","), " Z"); })(t); for ( var a = t.map(function (e, n) { var r = t[(n + 1) % o]; return { p: e, v: g.c.normalize([0, 0], se(e, r)) }; }), s = 0; s < a.length; ++s ) { var c = s > 0 ? s - 1 : o - 1, u = g.c.normalize( [0, 0], g.c.add([0, 0], a[c].v, g.c.scale([0, 0], a[s].v, -1)), ); a[s].p = g.c.add([0, 0], a[s].p, g.c.scale([0, 0], u, e)); } return a.map(function (t) { var e = t.p; return { x: e[0], y: e[1] }; }); } var he = function (t, e, n) { return (t.y - n.y) * (e.x - n.x) - (t.x - n.x) * (e.y - n.y); }, le = function (t) { var e = t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }); if ( (e.sort(function (t, e) { return t.x === e.x ? t.y - e.y : t.x - e.x; }), 1 === e.length) ) return e; for (var n = [], r = 0; r < e.length; r++) { for ( ; n.length >= 2 && he(n[n.length - 2], n[n.length - 1], e[r]) <= 0; ) n.pop(); n.push(e[r]); } var i = []; for (r = e.length - 1; r >= 0; r--) { for ( ; i.length >= 2 && he(i[i.length - 2], i[i.length - 1], e[r]) <= 0; ) i.pop(); i.push(e[r]); } return i.pop(), n.pop(), n.concat(i); }, fe = { maxRoutingIterations: 100, maxMarchingIterations: 100, pixelGroupSize: 2, edgeR0: 10, edgeR1: 10, nodeR0: 5, nodeR1: 10, morphBuffer: 5, threshold: 0.001, skip: 16, nodeInfluenceFactor: 1, edgeInfluenceFactor: 1, negativeNodeInfluenceFactor: -0.5, }; function de(t, e, n) { var r = !1, i = function (t, n) { return e.cells[t + n * e.width]; }, o = function (t, e) { var r = 0; return ( i(t - 1, e - 1) >= n && (r += 1), i(t, e - 1) > n && (r += 2), i(t - 1, e) > n && (r += 4), i(t, e) > n && (r += 8), r ); }, a = function (n, r) { for (var i, a, s = n, c = r, u = 0; u < e.width * e.height; u++) { if ( ((i = s), (a = c), t.findIndex(function (t) { return t.x === s && t.y === c; }) > -1) ) { if (t[0].x === s && t[0].y === c) return !0; } else t.push({ x: s, y: c }); var h = o(s, c); switch (h) { case -1: return console.warn("Marched out of bounds"), !0; case 0: case 3: case 2: case 7: s++; break; case 12: case 14: case 4: s--; break; case 6: 0 === i && (-1 === a ? (s -= 1) : (s += 1)); break; case 1: case 13: case 5: c--; break; case 9: 1 === i && (0 === a ? (c -= 1) : (c += 1)); break; case 10: case 8: case 11: c++; break; default: return ( console.warn("Marching squares invalid state: ".concat(h)), !0 ); } } }; this.march = function () { for (var t = 0; t < e.width && !r; t += 1) for (var s = 0; s < e.height && !r; s += 1) i(t, s) > n && 15 !== o(t, s) && (r = a(t, s)); return r; }; } var pe = function (t, e) { var n = Number.POSITIVE_INFINITY, r = null; return ( t.forEach(function (t) { var i = q(t, e); i >= 0 && i < n && ((r = t), (n = i)); }), r ); }; function ge(t, e, n, r, i) { var o = (function (t, e, n) { var r = null, i = Number.POSITIVE_INFINITY; return ( e.forEach(function (e) { var o = { x: t.getModel().x, y: t.getModel().y }, a = { x: e.getModel().x, y: e.getModel().y }, s = G(o, a), c = new Y(o.x, o.y, a.x, a.y), u = n.reduce(function (t, e) { return q(e, c) > 0 ? t + 1 : t; }, 0); s * Math.pow(u + 1, 2) < i && ((r = e), (i = s * Math.pow(u + 1, 2))); }), r ); })(t, n, e); if (null === o) return []; return (function (t) { for (var n = []; t.length > 0; ) { var r = t.pop(); if (0 === t.length) { n.push(r); break; } var i = t.pop(), o = new Y(r.x1, r.y1, i.x2, i.y2); pe(e, o) ? (n.push(r), t.push(i)) : t.push(o); } return n; })( (function (t, e, n, r) { var i = [], o = []; o.push(t); for ( var a = !0, s = 0, c = function (t, e) { var n = !1; return ( e.forEach(function (e) { n || ((U(t, { x: e.x1, y: e.y1 }) || U(t, { x: e.x2, y: e.y2 })) && (n = !0)); }), n ); }, u = function (t, e) { for (var n = 0, r = e; n < r.length; n++) { var i = r[n].getBBox(), o = [ [i.x, i.y], [i.x + i.width, i.y], [i.x, i.y + i.height], [i.x + i.width, i.y + i.height], ]; if (_(o, t.x, t.y)) return !0; } return !1; }; a && s < n; ) { a = !1; for ( var h = function () { var t = o.pop(), n = pe(e, t); if (n) { var h = W(n, t), l = h[0]; if (2 === h[1]) { var f = function (s) { for ( var h = r, f = me(n, h, l, s), d = c(f, o) || c(f, i), p = u(f, e); !d && p && h >= 1; ) (f = me(n, (h /= 1.5), l, s)), (d = c(f, o) || c(f, i)), (p = u(f, e)); !f || d || (s && p) || (o.push(new Y(t.x1, t.y1, f.x, f.y)), o.push(new Y(f.x, f.y, t.x2, t.y2)), (a = !0)); }; f(!0), a || f(!1); } } a || i.push(t), (s += 1); }; !a && o.length; ) h(); } for (; o.length; ) i.push(o.pop()); return i; })( new Y( t.getModel().x, t.getModel().y, o.getModel().x, o.getModel().y, ), e, r, i, ), ); } var ve = function (t, e, n) { var r = Object.assign(fe, n), i = V( t.map(function (t) { return { x: t.getModel().x, y: t.getModel().y }; }), ); t = t.sort(function (t, e) { return ( G({ x: t.getModel().x, y: t.getModel().y }, i) - G({ x: e.getModel().x, y: e.getModel().y }, i) ); }); var o = [], a = []; t.forEach(function (t) { ge(t, e, o, r.maxRoutingIterations, r.morphBuffer).forEach( function (t) { a.push(t); }, ), o.push(t); }); for ( var s, c, u, h, l, f = (function (t, e, n) { var r = { minX: Number.POSITIVE_INFINITY, minY: Number.POSITIVE_INFINITY, maxX: Number.NEGATIVE_INFINITY, maxY: Number.NEGATIVE_INFINITY, width: 0, height: 0, x: 0, y: 0, }, i = []; t.forEach(function (t) { i.push(t.getBBox()); }), e.forEach(function (t) { i.push(t.getBBox()); }); for (var o = 0, a = i; o < a.length; o++) { var s = a[o]; (r.minX = (s.minX < r.minX ? s.minX : r.minX) - n), (r.minY = (s.minY < r.minY ? s.minY : r.minY) - n), (r.maxX = (s.maxX > r.maxX ? s.maxX : r.maxX) + n), (r.maxY = (s.maxY > r.maxY ? s.maxY : r.maxY) + n); } return ( (r.width = r.maxX - r.minX), (r.height = r.maxY - r.minY), (r.x = r.minX), (r.y = r.minY), r ); })(t, a, r.nodeR0), d = ((s = f.width), (c = f.height), (u = r.pixelGroupSize), (h = Math.ceil(s / u)), (l = Math.ceil(c / u)), { cells: new Float32Array(Math.max(0, h * l)).fill(0), width: h, height: l, }), p = [], g = [], v = 0; v < r.maxMarchingIterations; v++ ) if ( (ye(t, e, a, f, d, r), (g = []), new de((p = []), d, r.threshold).march()) ) { var y = p.map(function (t) { return { x: Math.round(t.x * r.pixelGroupSize + f.minX), y: Math.round(t.y * r.pixelGroupSize + f.minY), }; }); if (y) { var m = y.length; if (r.skip > 1) for (m = Math.floor(y.length / r.skip); m < 3 && r.skip > 1; ) (r.skip -= 1), (m = Math.floor(y.length / r.skip)); for (var b = 0, x = 0; x < m; x += 1, b += r.skip) g.push({ x: y[b].x, y: y[b].y }); } if ( g && (function () { for (var e = 0, n = t; e < n.length; e++) { var r = n[e], i = g.map(function (t) { return [t.x, t.y]; }); if (!_(i, r.getBBox().centerX, r.getBBox().centerY)) return !1; } return !0; })() ) return g; if (((r.threshold *= 0.9), v <= 0.5 * r.maxMarchingIterations)) (r.memberInfluenceFactor *= 1.2), (r.edgeInfluenceFactor *= 1.2); else { if (!(0 !== r.nonMemberInfluenceFactor && e.length > 0)) break; r.nonMemberInfluenceFactor *= 0.8; } } return g; }; function ye(t, e, n, r, i, o) { function a(t, e) { var n = Math.floor((t - e) / o.pixelGroupSize); return n < 0 ? 0 : n; } function s(t, e) { return t * o.pixelGroupSize + e; } var c = (o.nodeR0 - o.nodeR1) * (o.nodeR0 - o.nodeR1), u = (o.edgeR0 - o.edgeR1) * (o.edgeR0 - o.edgeR1), h = function (t, e) { return [ Math.min(a(t.minX, e + r.minX), i.width), Math.min(a(t.minY, e + r.minY), i.height), Math.min(a(t.maxX, -e + r.minX), i.width), Math.min(a(t.maxY, -e + r.minY), i.height), ]; }, l = function (t, e) { for ( var n = t.getBBox(), a = h(n, o.nodeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = Z( { x: g, y: v }, { x: n.minX, y: n.minY, width: n.width, height: n.height, }, ); if (y < Math.pow(o.nodeR1, 2)) { var m = Math.sqrt(y) - o.nodeR1; i.cells[p + d * i.width] += e * m * m; } } }; o.nodeInfluenceFactor && t.forEach(function (t) { l(t, o.nodeInfluenceFactor / c); }), o.edgeInfluenceFactor && n.forEach(function (t) { !(function (t, e) { for ( var n = t.getBBox(), a = h(n, o.edgeR1), c = a[0], u = a[1], l = a[2], f = a[3], d = u; d < f; d += 1 ) for (var p = c; p < l; p += 1) if (!(e < 0 && i.cells[p + d * i.width] <= 0)) { var g = s(p, r.minX), v = s(d, r.minY), y = H({ x: g, y: v }, t); if (y < Math.pow(o.edgeR1, 2)) { var m = Math.sqrt(y) - o.edgeR1; i.cells[p + d * i.width] += e * m * m; } } })(t, o.edgeInfluenceFactor / u); }), o.negativeNodeInfluenceFactor && e.forEach(function (t) { l(t, o.negativeNodeInfluenceFactor / c); }); } function me(t, e, n, r) { var i = t.getBBox(), o = n[0], a = n[1], s = n[2], c = n[3], u = { topLeft: { x: i.minX - e, y: i.minY - e }, topRight: { x: i.maxX + e, y: i.minY - e }, bottomLeft: { x: i.minX - e, y: i.maxY + e }, bottomRight: { x: i.maxX + e, y: i.maxY + e }, }, h = i.height * i.width; function l(t, e) { return i.width * (0.5 * (t.y - i.minY + (e.y - i.minY))); } if (a) return o ? r ? u.topLeft : u.bottomRight : s ? r ? u.bottomLeft : u.topRight : l(a, c) < 0.5 * h ? a.y > c.y ? r ? u.topLeft : u.bottomRight : r ? u.topRight : u.bottomLeft : a.y < c.y ? r ? u.bottomLeft : u.topRight : r ? u.bottomRight : u.topLeft; if (c) { if (o) return r ? u.topRight : u.bottomLeft; if (s) return r ? u.bottomRight : u.topLeft; } return l(o, s) < 0.5 * h ? o.x > s.x ? r ? u.topLeft : u.bottomRight : r ? u.bottomLeft : u.topRight : o.x < s.x ? r ? u.topRight : u.bottomLeft : r ? u.bottomRight : u.topLeft; } var be = (function () { function t(t, e) { (this.cfg = Object(c.deepMix)(this.getDefaultCfg(), e)), (this.graph = t), (this.id = this.cfg.id), (this.group = this.cfg.group), (this.members = this.cfg.members.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), (this.nonMembers = this.cfg.nonMembers.map(function (e) { return Object(c.isString)(e) ? t.findById(e) : e; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); } return ( (t.prototype.getDefaultCfg = function () { return { id: "g6-hull", type: "round-convex", members: [], nonMembers: [], style: { fill: "lightblue", stroke: "blue", opacity: 0.2 }, padding: 10, }; }), (t.prototype.setPadding = function () { var t = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2; (this.padding = this.cfg.padding > 0 ? this.cfg.padding + t : 10 + t), (this.cfg.bubbleCfg = { nodeR0: this.padding - t, nodeR1: this.padding - t, morphBuffer: this.padding - t, }); }), (t.prototype.setType = function () { (this.type = this.cfg.type), this.members.length < 3 && (this.type = "round-convex"), "round-convex" !== this.type && "smooth-convex" !== this.type && "bubble" !== this.type && (console.warn( "The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.", ), (this.type = "round-convex")); }), (t.prototype.calcPath = function (t, e) { var n, r, i; switch (this.type) { case "round-convex": (i = ce( (n = le(t)).map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i)); break; case "smooth-convex": 2 === (n = le(t)).length ? ((i = ce( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = Object(Qt.b)(i))) : n.length > 2 && ((i = ue( n.map(function (t) { return [t.x, t.y]; }), this.padding, )), (r = ie(i))); break; case "bubble": r = (n = ve(t, e, this.cfg.bubbleCfg)).length >= 2 && ie(n); } return r; }), (t.prototype.render = function () { this.group.addShape("path", { attrs: Object(f.a)({ path: this.path }, this.cfg.style), id: this.id, name: this.cfg.id, }), this.group.toBack(); }), (t.prototype.addMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.members.push(t); var e = this.nonMembers.indexOf(t); return ( e > -1 && this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.addNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)), this.nonMembers.push(t); var e = this.members.indexOf(t); return ( e > -1 && this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0 ); } }), (t.prototype.removeMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.members.indexOf(t); return ( e > -1 && (this.members.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.removeNonMember = function (t) { if (t) { Object(c.isString)(t) && (t = this.graph.findById(t)); var e = this.nonMembers.indexOf(t); return ( e > -1 && (this.nonMembers.splice(e, 1), this.updateData(this.members, this.nonMembers), !0) ); } }), (t.prototype.updateData = function (t, e) { var n = this; this.group.findById(this.id).remove(), t && (this.members = t.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), e && (this.nonMembers = e.map(function (t) { return Object(c.isString)(t) ? n.graph.findById(t) : t; })), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.updateStyle = function (t) { this.group.findById(this.id).attr(Object(f.a)({}, t)); }), (t.prototype.updateCfg = function (t) { var e = this; (this.cfg = Object(c.deepMix)(this.cfg, t)), (this.id = this.cfg.id), (this.group = this.cfg.group), t.members && (this.members = this.cfg.members.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), t.nonMembers && (this.nonMembers = this.cfg.nonMembers.map(function (t) { return Object(c.isString)(t) ? e.graph.findById(t) : t; })), this.setPadding(), this.setType(), (this.path = this.calcPath(this.members, this.nonMembers)), this.render(); }), (t.prototype.contain = function (t) { var e, n, r = this, i = (e = Object(c.isString)(t) ? this.graph.findById(t) : t).getKeyShape(); if ("path" === e.get("type")) n = re(i.attr("path")); else { var o = i.getCanvasBBox(); n = [ [o.minX, o.minY], [o.maxX, o.minY], [o.maxX, o.maxY], [o.minX, o.maxY], ]; } return ( (n = n.map(function (t) { var e = r.graph.getPointByCanvas(t[0], t[1]); return [e.x, e.y]; })), F(n, re(this.path)) ); }), (t.prototype.destroy = function () { this.group.remove(), (this.cfg = null); }), t ); })(), xe = g.a.transform, Se = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.cfg = Object(c.deepMix)(n.getDefaultCfg(), e)), n.init(), (n.animating = !1), (n.destroyed = !1), n.cfg.enabledStack && ((n.undoStack = new v.Stack(n.cfg.maxStep)), (n.redoStack = new v.Stack(n.cfg.maxStep))), n ); } return ( Object(f.c)(e, t), (e.prototype.init = function () { this.initCanvas(); var t = new Nt(this), e = new Ot(this), n = new Zt(this), r = new $t(this); this.set({ viewController: t, modeController: e, itemController: n, stateController: r, }), this.initLayoutController(), this.initEventController(), this.initGroups(), this.initPlugins(), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), )); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = this.get("canvas").get("el").id, n = t.addGroup({ id: "".concat(e, "-root"), className: nt.rootContainerClassName, }); if (this.get("groupByTypes")) { var r = n.addGroup({ id: "".concat(e, "-edge"), className: nt.edgeContainerClassName, }), i = n.addGroup({ id: "".concat(e, "-node"), className: nt.nodeContainerClassName, }), o = n.addGroup({ id: "".concat(e, "-combo"), className: nt.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = n.addGroup({ id: "".concat(e, "-delegate"), className: nt.delegateContainerClassName, }); this.set({ delegateGroup: a }), this.set("group", n); }), (e.prototype.getDefaultCfg = function () { return { container: void 0, width: void 0, height: void 0, renderer: "canvas", modes: {}, plugins: [], data: {}, fitViewPadding: 10, minZoom: 0.2, maxZoom: 10, event: !0, groupByTypes: !0, directed: !1, autoPaint: !0, nodes: [], edges: [], combos: [], vedges: [], itemMap: {}, linkCenter: !1, defaultNode: {}, defaultEdge: {}, nodeStateStyles: {}, edgeStateStyles: {}, states: {}, animate: !1, animateCfg: { onFrame: void 0, duration: 500, easing: "easeLinear", }, callback: void 0, enabledStack: !1, maxStep: 10, tooltips: [], }; }), (e.prototype.set = function (t, e) { return ( Object(c.isPlainObject)(t) ? (this.cfg = Object(f.a)(Object(f.a)({}, this.cfg), t)) : (this.cfg[t] = e), this ); }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.getGroup = function () { return this.get("group"); }), (e.prototype.getContainer = function () { return this.get("container"); }), (e.prototype.getMinZoom = function () { return this.get("minZoom"); }), (e.prototype.setMinZoom = function (t) { return this.set("minZoom", t); }), (e.prototype.getMaxZoom = function () { return this.get("maxZoom"); }), (e.prototype.setMaxZoom = function (t) { return this.set("maxZoom", t); }), (e.prototype.getWidth = function () { return this.get("width"); }), (e.prototype.getHeight = function () { return this.get("height"); }), (e.prototype.clearItemStates = function (t, e) { Object(c.isString)(t) && (t = this.findById(t)); var n = this.get("itemController"); e || (e = t.get("states")), n.clearItemStates(t, e), this.get("stateController").updateStates(t, e, !1); }), (e.prototype.node = function (t) { "function" == typeof t && this.set("nodeMapper", t); }), (e.prototype.edge = function (t) { "function" == typeof t && this.set("edgeMapper", t); }), (e.prototype.combo = function (t) { "function" == typeof t && this.set("comboMapper", t); }), (e.prototype.findById = function (t) { return this.get("itemMap")[t]; }), (e.prototype.find = function (t, e) { var n, r = this.get("".concat(t, "s")); return ( Object(c.each)(r, function (t, r) { if (e(t, r)) return (n = t); }), n ); }), (e.prototype.findAll = function (t, e) { var n = []; return ( Object(c.each)(this.get("".concat(t, "s")), function (t, r) { e(t, r) && n.push(t); }), n ); }), (e.prototype.findAllByState = function (t, e) { return this.findAll(t, function (t) { return t.hasState(e); }); }), (e.prototype.translate = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe(r, [["t", t, e]])), n.setMatrix(r), this.emit("viewportchange", { action: "translate", matrix: n.getMatrix(), }), this.autoPaint(); }), (e.prototype.moveTo = function (t, e) { var n = this.get("group"); T(n, { x: t, y: e }), this.emit("viewportchange", { action: "move", matrix: n.getMatrix(), }); }), (e.prototype.fitView = function (t) { t && this.set("fitViewPadding", t), this.get("viewController").fitView(), this.autoPaint(); }), (e.prototype.fitCenter = function () { this.get("viewController").fitCenter(), this.autoPaint(); }), (e.prototype.addBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !0), this ); }), (e.prototype.removeBehaviors = function (t, e) { return ( this.get("modeController").manipulateBehaviors(t, e, !1), this ); }), (e.prototype.updateBehavior = function (t, e, n) { return this.get("modeController").updateBehavior(t, e, n), this; }), (e.prototype.zoom = function (t, e) { var n = this.get("group"), r = Object(c.clone)(n.getMatrix()), i = this.get("minZoom"), o = this.get("maxZoom"); r || (r = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (r = xe( r, e ? [ ["t", -e.x, -e.y], ["s", t, t], ["t", e.x, e.y], ] : [["s", t, t]], )), (i && r[0] < i) || (o && r[0] > o) || (n.setMatrix(r), this.emit("viewportchange", { action: "zoom", matrix: r }), this.autoPaint()); }), (e.prototype.zoomTo = function (t, e) { var n = t / this.getZoom(); this.zoom(n, e); }), (e.prototype.focusItem = function (t, e, n) { var r = this.get("viewController"), i = !1; e ? (i = !0) : void 0 === e && (i = this.get("animate")); var o = {}; n ? (o = n) : void 0 === n && (o = this.get("animateCfg")), r.focus(t, i, o), this.autoPaint(); }), (e.prototype.autoPaint = function () { this.get("autoPaint") && this.paint(); }), (e.prototype.paint = function () { this.emit("beforepaint"), this.get("canvas").draw(), this.emit("afterpaint"); }), (e.prototype.getPointByClient = function (t, e) { return this.get("viewController").getPointByClient(t, e); }), (e.prototype.getClientByPoint = function (t, e) { return this.get("viewController").getClientByPoint(t, e); }), (e.prototype.getPointByCanvas = function (t, e) { return this.get("viewController").getPointByCanvas(t, e); }), (e.prototype.getCanvasByPoint = function (t, e) { return this.get("viewController").getCanvasByPoint(t, e); }), (e.prototype.getGraphCenterPoint = function () { var t = this.get("group").getCanvasBBox(); return { x: (t.minX + t.maxX) / 2, y: (t.minY + t.maxY) / 2 }; }), (e.prototype.getViewPortCenterPoint = function () { return this.getPointByCanvas( this.get("width") / 2, this.get("height") / 2, ); }), (e.prototype.showItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !0); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !1 }]), (o.nodes = [{ id: r, visible: !0 }]); break; case "edge": (i.nodes = [{ id: r, visible: !1 }]), (o.edges = [{ id: r, visible: !0 }]); break; case "combo": (i.nodes = [{ id: r, visible: !1 }]), (o.combos = [{ id: r, visible: !0 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.hideItem = function (t, e) { void 0 === e && (e = !0); var n = this.get("itemController").changeItemVisibility(t, !1); if (e && this.get("enabledStack")) { var r = n.getID(), i = {}, o = {}; switch (n.getType()) { case "node": (i.nodes = [{ id: r, visible: !0 }]), (o.nodes = [{ id: r, visible: !1 }]); break; case "edge": (i.nodes = [{ id: r, visible: !0 }]), (o.edges = [{ id: r, visible: !1 }]); break; case "combo": (i.nodes = [{ id: r, visible: !0 }]), (o.combos = [{ id: r, visible: !1 }]); } this.pushStack("visible", { before: i, after: o }); } }), (e.prototype.refreshItem = function (t) { this.get("itemController").refreshItem(t); }), (e.prototype.setAutoPaint = function (t) { this.set("autoPaint", t), this.get("canvas").set("autoDraw", t); }), (e.prototype.remove = function (t, e) { void 0 === e && (e = !0), this.removeItem(t, e); }), (e.prototype.removeItem = function (t, e) { void 0 === e && (e = !0); var n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n && Object(c.isString)(t)) ) console.warn("The item to be removed does not exist!"); else if (n) { var r = ""; if ( (n.getType && (r = n.getType()), e && this.get("enabledStack")) ) { var i = Object(f.a)(Object(f.a)({}, n.getModel()), { itemType: r, }), o = {}; switch (r) { case "node": (o.nodes = [i]), (o.edges = []); for (var a = n.getEdges(), s = a.length - 1; s >= 0; s--) o.edges.push( Object(f.a)(Object(f.a)({}, a[s].getModel()), { itemType: "edge", }), ); break; case "edge": o.edges = [i]; break; case "combo": o.combos = [i]; } this.pushStack("delete", { before: o, after: {} }); } if ("node" === r) n.getModel().comboId && this.updateComboTree(n); if ((this.get("itemController").removeItem(n), "combo" === r)) { var u = mt(this.get("comboTrees")); this.set("comboTrees", u); } } }), (e.prototype.addItem = function (t, e, n, r) { void 0 === n && (n = !0), void 0 === r && (r = !0); var i = this.get("comboSorted"); this.set("comboSorted", i && !r); var o = this.get("itemController"); if ( !(function (t, e) { if ("node" === t || "combo" === t) { if (e.id && !Object(c.isString)(e.id)) return ( console.warn( "G6 Warning Tips: missing 'id' property, or the 'id' %c".concat( e.id, "%c is not a string.", ), "font-size: 20px; color: red;", "", ), !1 ); } else if (!("edge" !== t || (e.source && e.target))) return ( console.warn( "G6 Warning Tips: missing 'source' or 'target' for the edge.", ), !1 ); return !0; })(t, e) ) return !1; if (!e.id || !this.findById(e.id)) { var a, s = this.get("comboTrees"); if ((s || (s = []), "combo" === t)) { var u = this.get("itemMap"), h = !1; if ( (s.forEach(function (n) { h || pt(n, function (n) { if (e.parentId === n.id) { h = !0; var r = Object(f.a)( { id: e.id, depth: n.depth + 2 }, e, ); n.children ? n.children.push(r) : (n.children = [r]), (e.depth = r.depth), (a = o.addItem(t, e)); } var i = u[n.id]; return ( h && i && i.getType && "combo" === i.getType() && o.updateCombo(i, n.children), !0 ); }); }), !h) ) { var l = Object(f.a)({ id: e.id, depth: 0 }, e); (e.depth = l.depth), s.push(l), (a = o.addItem(t, e)); } this.set("comboTrees", s); } else if ("node" === t && Object(c.isString)(e.comboId) && s) { var d; (d = this.findById(e.comboId)) && d.getType && "combo" !== d.getType() && console.warn( "'".concat( e.comboId, "' is not a id of a combo in the graph, the node will be added without combo.", ), ), (a = o.addItem(t, e)); var p = this.get("itemMap"), g = !1, v = !1; (s || []).forEach(function (t) { v || g || pt(t, function (t) { if (t.id === e.id) return (v = !0), !1; if (e.comboId === t.id && !v) { g = !0; var n = Object(c.clone)(e); (n.itemType = "node"), t.children ? t.children.push(n) : (t.children = [n]), (n.depth = t.depth + 1); } return ( g && p[t.id].getType && "combo" === p[t.id].getType() && o.updateCombo(p[t.id], t.children), !0 ); }); }); } else a = o.addItem(t, e); if ( ("node" === t && e.comboId) || ("combo" === t && e.parentId) ) (d = this.findById(e.comboId || e.parentId)) && d.getType && "combo" === d.getType() && d.addChild(a); var y = this.get("combos"); if ( (y && y.length > 0 && this.sortCombos(), this.autoPaint(), n && this.get("enabledStack")) ) { var m = Object(f.a)(Object(f.a)({}, a.getModel()), { itemType: t, }), b = {}; switch (t) { case "node": b.nodes = [m]; break; case "edge": b.edges = [m]; break; case "combo": b.combos = [m]; } this.pushStack("add", { before: {}, after: b }); } return a; } console.warn( "This item exists already. Be sure the id %c".concat( e.id, "%c is unique.", ), "font-size: 20px; color: red;", "", ); }), (e.prototype.add = function (t, e, n, r) { return ( void 0 === n && (n = !0), void 0 === r && (r = !0), this.addItem(t, e, n, r) ); }), (e.prototype.updateItem = function (t, e, n) { var r = this; void 0 === n && (n = !0); var i, o = this.get("itemController"); i = Object(c.isString)(t) ? this.findById(t) : t; var a = Object(c.clone)(i.getModel()), s = ""; i.getType && (s = i.getType()); var u = Object(f.f)([], i.getStates(), !0); if ( ("combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !1); }), o.updateItem(i, e), "combo" === s && Object(c.each)(u, function (t) { return r.setItemState(i, t, !0); }), n && this.get("enabledStack")) ) { var h = { nodes: [], edges: [], combos: [] }, l = { nodes: [], edges: [], combos: [] }, d = Object(f.a)({ id: a.id }, e); switch (s) { case "node": h.nodes.push(a), l.nodes.push(d); break; case "edge": h.edges.push(a), l.edges.push(d); break; case "combo": h.combos.push(a), l.combos.push(d); } "node" === s && h.nodes.push(a), this.pushStack("update", { before: h, after: l }); } }), (e.prototype.update = function (t, e, n) { void 0 === n && (n = !0), this.updateItem(t, e, n); }), (e.prototype.setItemState = function (t, e, n) { Object(c.isString)(t) && (t = this.findById(t)), this.get("itemController").setItemState(t, e, n); var r = this.get("stateController"); Object(c.isString)(n) ? r.updateState(t, "".concat(e, ":").concat(n), !0) : r.updateState(t, e, n); }), (e.prototype.priorityState = function (t, e) { this.get("itemController").priorityState(t, e); }), (e.prototype.data = function (t) { wt(t), this.set("data", t); }), (e.prototype.render = function () { var t = this; this.set("comboSorted", !1); var e = this.get("data"); if ((this.get("enabledStack") && this.clearStack(), !e)) throw new Error("data must be defined first"); var n = e.nodes, r = void 0 === n ? [] : n, i = e.edges, o = void 0 === i ? [] : i, a = e.combos, s = void 0 === a ? [] : a; if ( (this.clear(!0), this.emit("beforerender"), Object(c.each)(r, function (e) { t.add("node", e, !1, !1); }), s && 0 !== s.length) ) { var u = yt(s, r); this.set("comboTrees", u), t.addCombos(s); } Object(c.each)(o, function (e) { t.add("edge", e, !1, !1); }); var h = t.get("animate"); (t.get("fitView") || t.get("fitCenter")) && t.set("animate", !1); var l = t.get("layoutController"); if (l) { if ( (l.layout(function () { t.get("fitView") ? t.fitView() : t.get("fitCenter") && t.fitCenter(); t.autoPaint(), t.emit("afterrender"), (t.get("fitView") || t.get("fitCenter")) && t.set("animate", h); }), this.refreshPositions(), this.destroyed) ) return; } else t.get("fitView") && t.fitView(), t.get("fitCenter") && t.fitCenter(), t.emit("afterrender"), t.set("animate", h); this.get("groupByTypes") || (s && 0 !== s.length ? this.sortCombos() : e.nodes && e.edges && e.nodes.length < e.edges.length ? this.getNodes().forEach(function (t) { t.toFront(); }) : this.getEdges().forEach(function (t) { t.toBack(); })); this.get("enabledStack") && this.pushStack("render"); }), (e.prototype.read = function (t) { this.data(t), this.render(); }), (e.prototype.diffItems = function (t, e, n) { var r, i = this, o = this.get("itemMap"); Object(c.each)(n, function (n) { if ((r = o[n.id])) { if (i.get("animate") && "node" === t) { var a = r.getContainer().getMatrix(); a || (a = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.set("originAttrs", { x: a[6], y: a[7] }); } i.updateItem(r, n, !1); } else r = i.addItem(t, n, !1); r && e["".concat(t, "s")].push(r); }); }), (e.prototype.changeData = function (t, e) { void 0 === e && (e = !0); var n = this; if (!wt(t)) return this; e && this.get("enabledStack") && this.pushStack("changedata", { before: n.save(), after: t }), this.set("comboSorted", !1), this.removeHulls(), this.getNodes().map(function (t) { return n.clearItemStates(t); }), this.getEdges().map(function (t) { return n.clearItemStates(t); }); var r = this.get("canvas"), i = r.get("localRefresh"); r.set("localRefresh", !1), n.get("data") || (n.data(t), n.render()); var o = this.get("itemMap"), a = { nodes: [], edges: [] }, s = t.combos; if (s) { var u = yt(s, t.nodes); this.set("comboTrees", u); } this.diffItems("node", a, t.nodes), Object(c.each)(o, function (t, e) { (o[e].getModel().depth = 0), (t.getType && "edge" === t.getType()) || (t.getType && "combo" === t.getType() ? (delete o[e], t.destroy()) : a.nodes.indexOf(t) < 0 && (delete o[e], n.remove(t, !1))); }); for (var h = this.getCombos(), l = h.length - 1; l >= 0; l--) h[l].destroyed && h.splice(l, 1); s && (n.addCombos(s), this.get("groupByTypes") || this.sortCombos()), this.diffItems("edge", a, t.edges), Object(c.each)(o, function (t, e) { (!t.getType || ("node" !== t.getType() && "combo" !== t.getType())) && a.edges.indexOf(t) < 0 && (delete o[e], n.remove(t, !1)); }), this.set({ nodes: a.nodes, edges: a.edges }); var f = this.get("layoutController"); return ( f && (f.changeData(), n.get("animate") && !f.getLayoutType() ? n.positionsAnimate() : n.autoPaint()), setTimeout(function () { r.set("localRefresh", i); }, 16), this ); }), (e.prototype.addCombos = function (t) { var e = this.get("comboTrees"); this.get("itemController").addCombos(e, t); }), (e.prototype.createCombo = function (t, e) { var n = this; this.set("comboSorted", !1); var r, i = ""; if (t) { if (Object(c.isString)(t)) (i = t), (r = { id: t }); else { if (!(i = t.id)) return void console.warn( "Create combo failed. Please assign a unique string id for the adding combo.", ); r = t; } var o = e.map(function (t) { var e = n.findById(t), r = e.getModel(), o = ""; e.getType && (o = e.getType()); var a = { id: e.getID(), itemType: o }; return ( "combo" === o ? ((a.parentId = i), (r.parentId = i)) : "node" === o && ((a.comboId = i), (r.comboId = i)), a ); }); (r.children = o), this.addItem("combo", r, !1), this.set("comboSorted", !1); var a = this.get("comboTrees"); (a || []).forEach(function (t) { pt(t, function (t) { return ( t.id !== i || ((t.itemType = "combo"), (t.children = o), !1) ); }); }), a && this.sortCombos(); } }), (e.prototype.uncombo = function (t) { var e = this, n = t; if ( (Object(c.isString)(t) && (n = this.findById(t)), !n || (n.getType && "combo" !== n.getType())) ) console.warn("The item is not a combo!"); else { var r = n.getModel().parentId, i = this.get("comboTrees"); i || (i = []); var o, a = this.get("itemMap"), s = n.get("id"), u = [], h = this.get("combos"), l = this.findById(r); if ( (i.forEach(function (i) { o || pt(i, function (i) { if (i.id === s) { (o = i), n.getEdges().forEach(function (t) { e.removeItem(t, !1); }); var c = h.indexOf(t); h.splice(c, 1), delete a[s], n.destroy(); } return ( !r || !o || i.id !== r || (l.removeCombo(n), -1 !== (c = (u = i.children).indexOf(o)) && u.splice(c, 1), o.children.forEach(function (t) { var n = e.findById(t.id), i = n.getModel(); n.getType && "combo" === n.getType() ? ((t.parentId = r), delete t.comboId, (i.parentId = r), delete i.comboId) : n.getType && "node" === n.getType() && ((t.comboId = r), (i.comboId = r)), l.addChild(n), u.push(t); }), !1) ); }); }), !r && o) ) { var f = i.indexOf(o); i.splice(f, 1), o.children.forEach(function (t) { t.parentId = void 0; var n = e.findById(t.id).getModel(); delete n.parentId, delete n.comboId, "node" !== t.itemType && i.push(t); }); } } }), (e.prototype.updateCombos = function () { var t = this, e = this.get("comboTrees"), n = this.get("itemController"), r = this.get("itemMap"); (e || []).forEach(function (e) { pt(e, function (e) { if (!e) return !0; var i = r[e.id]; if (i && i.getType && "combo" === i.getType()) { var o = Object(f.f)([], i.getStates(), !0); Object(c.each)(o, function (e) { return t.setItemState(i, e, !1); }), n.updateCombo(i, e.children), Object(c.each)(o, function (e) { return t.setItemState(i, e, !0); }); } return !0; }); }), this.sortCombos(); }), (e.prototype.updateCombo = function (t) { var e, n = this, r = t; if ( (Object(c.isString)(t) && (r = this.findById(t)), !r || (r.getType && "combo" !== r.getType())) ) console.warn("The item to be updated is not a combo!"); else { e = r.get("id"); var i = this.get("comboTrees"), o = this.get("itemController"), a = this.get("itemMap"); (i || []).forEach(function (t) { pt(t, function (t) { if (!t) return !0; var r = a[t.id]; if ( e === t.id && r && r.getType && "combo" === r.getType() ) { var i = Object(f.f)([], r.getStates(), !0); Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !1); }), o.updateCombo(r, t.children), Object(c.each)(i, function (t) { r.getStateStyle(t) && n.setItemState(r, t, !0); }), e && (e = t.parentId); } return !0; }); }); } }), (e.prototype.updateComboTree = function (t, e, n) { void 0 === n && (n = !0); var r; this.set("comboSorted", !1); var i, o = (r = Object(c.isString)(t) ? this.findById(t) : t).getModel(), a = o.comboId || o.parentId, s = ""; if ((r.getType && (s = r.getType()), e && "combo" === s)) { var u, h = this.get("comboTrees"), l = !0; if ( ((h || []).forEach(function (t) { u || dt(t, function (t) { if (!u) return t.id === r.getID() && (u = t), !0; }); }), dt(u, function (t) { return t.id !== e || ((l = !1), !1); }), !l) ) return void console.warn( "Failed to update the combo tree! The parentId points to a descendant of the combo!", ); } if (n && this.get("enabledStack")) { var f = {}, d = {}; "combo" === s ? ((f.combos = [{ id: o.id, parentId: o.parentId }]), (d.combos = [{ id: o.id, parentId: e }])) : "node" === s && ((f.nodes = [{ id: o.id, parentId: o.comboId }]), (d.nodes = [{ id: o.id, parentId: e }])), this.pushStack("updateComboTree", { before: f, after: d }); } if (o.parentId || o.comboId) { var p = this.findById(o.parentId || o.comboId); p && p.removeChild(r); } ("combo" === s ? (o.parentId = e) : "node" === s && (o.comboId = e), e) && (i = this.findById(e)) && i.addChild(r); a && (i = this.findById(a)) && i.removeChild(r); var g = mt(this.get("comboTrees"), o.id, e); this.set("comboTrees", g), this.updateCombos(); }), (e.prototype.save = function () { var t = [], e = [], n = []; return ( Object(c.each)(this.get("nodes"), function (e) { t.push(e.getModel()); }), Object(c.each)(this.get("edges"), function (t) { e.push(t.getModel()); }), Object(c.each)(this.get("combos"), function (t) { n.push(t.getModel()); }), { nodes: t, edges: e, combos: n } ); }), (e.prototype.changeSize = function (t, e) { return this.get("viewController").changeSize(t, e), this; }), (e.prototype.refresh = function () { if ((this.emit("beforegraphrefresh"), this.get("animate"))) this.positionsAnimate(); else { var t = this.get("nodes"), e = this.get("edges"), n = this.get("edges"); Object(c.each)(t, function (t) { t.refresh(); }), Object(c.each)(e, function (t) { t.refresh(); }), Object(c.each)(n, function (t) { t.refresh(); }); } this.emit("aftergraphrefresh"), this.autoPaint(); }), (e.prototype.getNodes = function () { return this.get("nodes"); }), (e.prototype.getEdges = function () { return this.get("edges"); }), (e.prototype.getCombos = function () { return this.get("combos"); }), (e.prototype.getComboChildren = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) return t.getChildren(); console.warn("The combo does not exist!"); }), (e.prototype.positionsAnimate = function () { var t = this; t.emit("beforeanimate"); var e = t.get("animateCfg"), n = e.onFrame, r = t.getNodes(), i = r.map(function (t) { var e = t.getModel(); return { id: e.id, x: e.x, y: e.y }; }); t.isAnimating() && t.stopAnimate(), t.get("canvas").animate( function (e) { Object(c.each)(i, function (r) { var i = t.findById(r.id); if (i && !i.destroyed) { var o = i.get("originAttrs"), a = i.get("model"); if (!o) { var s = i.getContainer().getMatrix(); s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), (o = { x: s[6], y: s[7] }), i.set("originAttrs", o); } if (n) { var c = n(i, e, r, o); i.set("model", Object.assign(a, c)); } else (a.x = o.x + (r.x - o.x) * e), (a.y = o.y + (r.y - o.y) * e); } }), t.refreshPositions(); }, { duration: e.duration, easing: e.easing, callback: function () { Object(c.each)(r, function (t) { t.set("originAttrs", null); }), e.callback && e.callback(), t.emit("afteranimate"), (t.animating = !1); }, }, ); }), (e.prototype.refreshPositions = function () { this.emit("beforegraphrefreshposition"); var t, e = this.get("nodes"), n = this.get("edges"), r = this.get("vedges"), i = this.get("combos"), o = {}; Object(c.each)(e, function (e) { t = e.getModel(); var n = e.get("originAttrs"); if (!n || t.x !== n.x || t.y !== n.y) { var r = e.updatePosition({ x: t.x, y: t.y }); (o[t.id] = r), t.comboId && (o[t.comboId] = o[t.comboId] || r); } }), i && 0 !== i.length && this.updateCombos(), Object(c.each)(n, function (t) { var e = t.getSource().getModel(), n = t.getTarget(); if (!Object(c.isPlainObject)(n)) { var r = n.getModel(); (o[e.id] || o[r.id] || t.getModel().isComboEdge) && t.refresh(); } }), Object(c.each)(r, function (t) { t.refresh(); }), this.emit("aftergraphrefreshposition"), this.autoPaint(); }), (e.prototype.stopAnimate = function () { this.get("canvas").stopAnimate(); }), (e.prototype.isAnimating = function () { return this.animating; }), (e.prototype.getZoom = function () { var t = this.get("group").getMatrix(); return t ? t[0] : 1; }), (e.prototype.getCurrentMode = function () { return this.get("modeController").getMode(); }), (e.prototype.setMode = function (t) { return this.get("modeController").setMode(t), this; }), (e.prototype.clear = function (t) { return ( void 0 === t && (t = !1), this.get("canvas").clear(), this.initGroups(), this.set({ itemMap: {}, nodes: [], edges: [], groups: [], combos: [], comboTrees: [], }), t || this.emit("afterrender"), this ); }), (e.prototype.updateLayout = function (t) { var e = this.get("layoutController"); Object(c.isString)(t) && (t = { type: t }); var n = this.get("layout"), r = {}; Object.assign(r, n, t), this.set("layout", r), e.isLayoutTypeSame(r) && r.gpuEnabled === n.gpuEnabled ? e.updateLayoutCfg(r) : e.changeLayout(r); }), (e.prototype.destroyLayout = function () { this.get("layoutController").destroyLayout(); }), (e.prototype.layout = function () { var t = this.get("layoutController"), e = this.get("layout"); e && t && (e.workerEnabled ? t.layout() : t.layoutMethod ? t.relayout(!0) : t.layout()); }), (e.prototype.collapseCombo = function (t) { var e = this; if ((Object(c.isString)(t) && (t = this.findById(t)), t)) { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").collapseCombo(t), (n.collapsed = !0); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = []; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || r.getModel().id === n.id ) { if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var s = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(s.parentId || s.comboId)) || (!s.parentId && !s.comboId) ) return; s = a.getModel(); } var c = s.id; if (u["".concat(n.id, "-").concat(c)]) return void (u["".concat(n.id, "-").concat(c)] += f.size || 1); var l = e.addItem( "vedge", { source: n.id, target: c, isVEdge: !0 }, !1, ); (u["".concat(n.id, "-").concat(c)] = f.size || 1), h.push(l); } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || a.getModel().id === n.id ) { var f; if ((f = t.getModel()).isVEdge) return void e.removeItem(t, !1); for (var d = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(d.parentId || d.comboId)) || (!d.parentId && !d.comboId) ) return; d = r.getModel(); } var p = d.id; if (u["".concat(p, "-").concat(n.id)]) return void (u["".concat(p, "-").concat(n.id)] += f.size || 1); l = e.addItem( "vedge", { target: n.id, source: p, isVEdge: !0 }, !1, ); (u["".concat(p, "-").concat(n.id)] = f.size || 1), h.push(l); } } }), h.forEach(function (t) { var n = t.getModel(); e.updateItem( t, { size: u["".concat(n.source, "-").concat(n.target)] }, !1, ); }), this.emit("aftercollapseexpandcombo", { action: "collapse", item: t, }); } else console.warn("The combo to be collapsed does not exist!"); }), (e.prototype.expandCombo = function (t) { var e = this; if ( (Object(c.isString)(t) && (t = this.findById(t)), !t || (t.getType && "combo" !== t.getType())) ) console.warn("The combo to be collapsed does not exist!"); else { this.emit("beforecollapseexpandcombo", { action: "expand", item: t, }); var n = t.getModel(); this.get("itemController").expandCombo(t), (n.collapsed = !1); var r = this.getEdges().concat(this.get("vedges")), i = [], o = [], a = this.get("comboTrees"), s = !1; (a || []).forEach(function (t) { s || dt(t, function (t) { if (s && t.depth <= n.depth) return !1; if ((n.id === t.id && (s = !0), s)) { var r = e.findById(t.id); r && r.getType && "combo" === r.getType() && ((i = i.concat(r.getNodes())), (o = o.concat(r.getCombos()))); } return !0; }); }); var u = {}, h = {}; r.forEach(function (t) { if (!t.isVisible() || t.getModel().isVEdge) { var r = t.getSource(), a = t.getTarget(), s = r.get("id"), c = a.get("id"); if ( ((i.includes(r) || o.includes(r)) && !i.includes(a) && !o.includes(a)) || s === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (var l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; l = a.getModel(); } c = l.id; for (var f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; if (f.comboId === n.id || f.parentId === n.id) break; f = r.getModel(); } if (((s = f.id), c)) { var d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); var p = e.addItem( "vedge", { source: s, target: c, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else if ( (!i.includes(r) && !o.includes(r) && (i.includes(a) || o.includes(a))) || c === n.id ) { if (t.getModel().isVEdge) return void e.removeItem(t, !1); for (f = r.getModel(); !r.isVisible(); ) { if ( !(r = e.findById(f.comboId || f.parentId)) || (!f.parentId && !f.comboId) ) return; f = r.getModel(); } s = f.id; for (l = a.getModel(); !a.isVisible(); ) { if ( !(a = e.findById(l.comboId || l.parentId)) || (!l.parentId && !l.comboId) ) return; if (l.comboId === n.id || l.parentId === n.id) break; l = a.getModel(); } if (((c = l.id), s)) { d = "".concat(s, "-").concat(c); if (u[d]) return ( (u[d] += t.getModel().size || 1), void e.updateItem(h[d], { size: u[d] }, !1) ); p = e.addItem( "vedge", { target: c, source: s, isVEdge: !0 }, !1, ); (u[d] = t.getModel().size || 1), (h[d] = p); } } else (i.includes(r) || o.includes(r)) && (i.includes(a) || o.includes(a)) && r.isVisible() && a.isVisible() && t.show(); } }), this.emit("aftercollapseexpandcombo", { action: "expand", item: t, }); } }), (e.prototype.collapseExpandCombo = function (t) { if ( (Object(c.isString)(t) && (t = this.findById(t)), t && (!t.getType || "combo" === t.getType())) ) { for (var e = t.getModel(), n = this.findById(e.parentId); n; ) { var r = n.getModel(); if (r.collapsed) return ( console.warn( "Fail to expand the combo since it's ancestor combo is collapsed.", ), void (n = void 0) ); n = this.findById(r.parentId); } e.collapsed ? this.expandCombo(t) : this.collapseCombo(t), this.updateCombo(t); } }), (e.prototype.sortCombos = function () { var t = this; if (!this.get("comboSorted")) { this.set("comboSorted", !0); var e = [], n = {}; (this.get("comboTrees") || []).forEach(function (t) { dt(t, function (t) { return ( e[t.depth] ? e[t.depth].push(t.id) : (e[t.depth] = [t.id]), (n[t.id] = t.depth), !0 ); }); }), (this.getEdges().concat(this.get("vedges")) || []).forEach( function (t) { var r = t.getModel(), i = n[r.source] || 0, o = n[r.target] || 0, a = Math.max(i, o); e[a] ? e[a].push(r.id) : (e[a] = [r.id]); }, ), e.forEach(function (e) { if (e && e.length) for (var n = e.length - 1; n >= 0; n--) { var r = t.findById(e[n]); r && r.toFront(); } }); } }), (e.prototype.getNeighbors = function (t, e) { var n = t; return ( Object(c.isString)(t) && (n = this.findById(t)), n.getNeighbors(e) ); }), (e.prototype.getNodeDegree = function (t, e, n) { void 0 === e && (e = void 0), void 0 === n && (n = !1); var r = t; Object(c.isString)(t) && (r = this.findById(t)); var i = this.get("degrees"); (i && !n) || ((i = Object(v.getDegree)(this.save())), this.set("degrees", i)); var o = i[r.getID()], a = 0; if (!o) return 0; switch (e) { case "in": a = o.inDegree; break; case "out": a = o.outDegree; break; case "all": a = o; break; default: a = o.degree; } return a; }), (e.prototype.getUndoStack = function () { return this.undoStack; }), (e.prototype.getRedoStack = function () { return this.redoStack; }), (e.prototype.getStackData = function () { return this.get("enabledStack") ? { undoStack: this.undoStack.toArray(), redoStack: this.redoStack.toArray(), } : null; }), (e.prototype.clearStack = function () { this.get("enabledStack") && (this.undoStack.clear(), this.redoStack.clear()); }), (e.prototype.pushStack = function (t, e, n) { if ( (void 0 === t && (t = "update"), void 0 === n && (n = "undo"), this.get("enabledStack")) ) { var r = e ? Object(c.clone)(e) : { before: {}, after: Object(c.clone)(this.save()) }; "redo" === n ? this.redoStack.push({ action: t, data: r }) : this.undoStack.push({ action: t, data: r }), this.emit("stackchange", { undoStack: this.undoStack, redoStack: this.redoStack, }); } else console.warn( "请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !", ); }), (e.prototype.getAdjMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), n ); }), (e.prototype.getShortestPathMatrix = function (t, e) { void 0 === t && (t = !0), void 0 === e && (e = this.get("directed")); var n = this.get("adjMatrix"), r = this.get("shortestPathMatrix"); return ( (n && t) || ((n = Object(v.getAdjMatrix)(this.save(), e)), this.set("adjMatrix", n)), (r && t) || ((r = Object(v.floydWarshall)(this.save(), e)), this.set("shortestPathMatrix", r)), r ); }), (e.prototype.on = function (e, n, r) { return t.prototype.on.call(this, e, n, r); }), (e.prototype.destroy = function () { this.clear(), Object(p.clearAnimationFrame)(this.timeIndex), this.clearStack(), this.get("itemController").destroy(), this.get("modeController").destroy(), this.get("viewController").destroy(), this.get("stateController").destroy(), this.get("canvas").destroy(), (this.cfg = null), (this.destroyed = !0), (this.redoStack = null), (this.undoStack = null); }), (e.prototype.createHull = function (t) { if (t.members && !(t.members.length < 1)) { var e = this.get("hullGroup"), n = this.get("hullMap"); if ( (n || ((n = {}), this.set("hullMap", n)), (e && !e.get("destroyed")) || ((e = this.get("group").addGroup({ id: "hullGroup", })).toBack(), this.set("hullGroup", e)), n[t.id]) ) return console.warn("Existed hull id."), n[t.id]; var r = e.addGroup({ id: "".concat(t.id, "-container") }), i = new be( this, Object(f.a)(Object(f.a)({}, t), { group: r }), ); return (n[i.id] = i), i; } console.warn("Create hull failed! The members is empty."); }), (e.prototype.getHulls = function () { return this.get("hullMap"); }), (e.prototype.getHullById = function (t) { return this.get("hullMap")[t]; }), (e.prototype.removeHull = function (t) { var e; (e = Object(c.isString)(t) ? this.getHullById(t) : t), delete this.get("hullMap")[e.id], e.destroy(); }), (e.prototype.removeHulls = function () { var t = this.getHulls(); t && Object.keys(t).length && (Object.keys(t).forEach(function (e) { t[e].destroy(); }), this.set("hullMap", {})); }), (e.prototype.onTick = function (t) { var e = this.get("layoutController"); e && (e.onTick(t), (this.timeIndex = Object(p.requestAnimationFrame)( this.onTick.bind(this), ))); }), e ); })(d.a); function we(t) { return (we = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Oe = g.a.transform, Me = ["startArrow", "endArrow"], ke = { lineWidth: 1, stroke: void 0, fill: void 0, lineAppendWidth: 1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, x: 0, y: 0, r: 10, width: 20, height: 20, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, je = { edge: { lineWidth: 1, stroke: "#000", lineDash: void 0, startArrow: !1, endArrow: !1, opacity: void 0, strokeOpacity: void 0, fillOpacity: void 0, shadowColor: void 0, shadowBlur: 0, shadowOffsetX: 0, shadowOffsetY: 0, }, node: ke, combo: ke, }, Ce = { options: {}, itemType: "", type: "", getCustomConfig: function (t) { return {}; }, getOptions: function (t) { return Object(c.deepMix)( { labelCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, descriptionCfg: { style: { fontFamily: ("undefined" != typeof window && window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif", }, }, }, this.options, this.getCustomConfig(t) || {}, t, ); }, draw: function (t, e) { var n = this.drawShape(t, e); (n.set("className", this.itemType + "-shape"), t.label) && this.drawLabel(t, e).set("className", this.itemType + "-label"); return n; }, afterDraw: function (t, e, n) {}, drawShape: function (t, e) { return null; }, drawLabel: function (t, e) { var n = this.getOptions(t).labelCfg || {}, r = this.getLabelStyle(t, n, e), i = r.rotate; delete r.rotate; var o = e.addShape("text", { attrs: r, draggable: !0, className: "text-shape", name: "text-shape", }); if (i) { var a = o.getBBox(), s = o.getMatrix(); if ((s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), r.rotateCenter)) switch (r.rotateCenter) { case "center": s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); break; case "lefttop": s = Oe(s, [ ["t", -r.x, -r.y], ["r", i], ["t", r.x, r.y], ]); break; case "leftcenter": s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); break; default: s = Oe(s, [ ["t", -a.width / 2, -a.height / 2], ["r", i], ["t", a.width / 2, a.height / 2], ]); } else s = Oe(s, [ ["t", -r.x, -r.y - a.height / 2], ["r", i], ["t", r.x, r.y + a.height / 2], ]); o.setMatrix(s); } if (r.background) { var c = this.drawLabelBg(t, e, o), u = this.itemType + "-label-bg"; c.set("classname", u), o.toFront(); } return o; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.mix)({}, r, t.labelCfg), o = this.getLabelBgStyleByPosition(n, t, i, e); return e.addShape("rect", { name: "text-bg-shape", attrs: o }); }, getLabelStyleByPosition: function (t, e, n) { return { text: t.label }; }, getLabelBgStyleByPosition: function (t, e, n, r) { return {}; }, getLabelStyle: function (t, e, n) { var r = this.getLabelStyleByPosition(t, e, n), i = "".concat(this.itemType, "Label"), o = nt[i] ? nt[i].style : null; return Object(f.a)(Object(f.a)(Object(f.a)({}, o), r), e.style); }, getShapeStyle: function (t) { return t.style; }, update: function (t, e) { this.updateShapeStyle(t, e), this.updateLabel(t, e); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = e.getKeyShape(), i = Object(c.mix)({}, r.attr(), t.style), o = function (t) { var e, o = i[t]; if (Object(c.isPlainObject)(o)) { var a = n.find(function (e) { return e.get("name") === t; }); a && a.attr(o); } else r.attr((((e = {})[t] = o), e)); }; for (var a in i) o(a); }, updateLabel: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).labelCfg, i = this.itemType + "-label", o = n.find(function (t) { return t.get("className") === i; }), a = this.itemType + "-label-bg", s = n.find(function (t) { return t.get("classname") === a; }); if (t.label || "" === t.label) if (o) { var u = {}; e.getModel && (u = e.getModel().labelCfg); var h = Object(c.deepMix)({}, r, u, t.labelCfg), l = this.getLabelStyleByPosition(t, h, n), d = t.labelCfg ? t.labelCfg.style : void 0, p = h.style && h.style.background, g = Object(f.a)(Object(f.a)(Object(f.a)({}, o.attr()), l), d), v = g.rotate; if ((delete g.rotate, v)) { var y = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (y = Oe(y, [ ["t", -g.x, -g.y], ["r", v], ["t", g.x, g.y], ])), o.resetMatrix(), o.attr(Object(f.a)(Object(f.a)({}, g), { matrix: y })); } else o.resetMatrix(), o.attr(g); if (s) if (g.background) { var m = this.getLabelBgStyleByPosition(o, t, h, n), b = Object(f.a)(Object(f.a)({}, m), p); if ((s.resetMatrix(), v)) { var x = [1, 0, 0, 0, 1, 0, 0, 0, 1]; (x = Oe(x, [ ["t", -b.x, -b.y], ["r", v], ["t", b.x, b.y], ])), (b.matrix = x); } s.attr(b); } else n.removeChild(s); else g.background && ((s = this.drawLabelBg(t, n, o)).set("classname", a), o.toFront()); } else { this.drawLabel(t, n).set("className", i); } }, afterUpdate: function (t, e) {}, setState: function (t, e, n) { var r, i, o = n.get("keyShape"); if (o && !o.destroyed) { var a = n.getType(), s = Object(c.isBoolean)(e) ? t : "".concat(t, ":").concat(e), u = this.getStateStyle(s, n), h = n.getStateStyle(s); if (h || u) { var l = Object(c.mix)({}, h || u), f = n.getContainer(), d = { x: 1, y: 1, cx: 1, cy: 1 }; if ( ("combo" === a && ((d.r = 1), (d.width = 1), (d.height = 1)), e) ) { var p = function (t) { var e, n = l[t]; if (Object(c.isPlainObject)(n) && !Me.includes(t)) { var r = f.find(function (e) { return e.get("name") === t; }); r && r.attr(n); } else o.attr((((e = {})[t] = n), e)); }; for (var g in l) p(g); } else { var v = St(n.getCurrentStatesStyle()), y = n.getModel(), m = Object(c.mix)({}, y.style, St(n.getOriginStyle())), b = o.get("name"), x = o.attr(), S = {}; Object.keys(x).forEach(function (t) { if ("img" !== t) { var e = x[t]; e && "object" === we(e) ? (S[t] = Object(c.clone)(e)) : (S[t] = e); } }); var w = {}, O = function (t) { var e = l[t]; if (Object(c.isPlainObject)(e) && !Me.includes(t)) { var n = f.find(function (e) { return e.get("name") === t; }); if (n) { var r = Object(c.clone)(n.attr()); Object(c.each)(e, function (e, i) { if (t === b && S[i] && !d[i]) { delete S[i]; var s = m[t][i] || je[a][i]; o.attr(i, s); } else if (r[i] || 0 === r[i]) { delete r[i]; var c = m[t][i] || je[a][i]; n.attr(i, c); } }), (w[t] = r); } } else if (S[t] && !d[t]) { delete S[t]; var i = m[t] || (m[b] ? m[b][t] : void 0) || je[a][t]; o.attr(t, i); } }; for (var M in l) O(M); for (var g in (b ? (w[b] = S) : Object(c.mix)(w, S), v)) if (!d[g]) { var k = v[g]; (Object(c.isPlainObject)(k) && !Me.includes(g)) || (b ? (Object(c.mix)(m[b], (((i = {})[g] = k), i)), delete m[g]) : Object(c.mix)(m, (((r = {})[g] = k), r)), delete v[g]); } var j = {}; Object(c.deepMix)(j, m, w, v); var C = !1, E = function (t) { var e, n, r = j[t]; if (Object(c.isPlainObject)(r) && !Me.includes(t)) { var i = f.find(function (e) { return e.get("name") === t; }); i && (t === b && ("combo" === a && (delete r.r, delete r.width, delete r.height), (C = !0)), i.attr(r)); } else if (!C) { var s = r || je[a][t]; "combo" === a ? b || o.attr((((e = {})[t] = s), e)) : o.attr((((n = {})[t] = s), n)); } }; for (var P in j) E(P); } } } }, getStateStyle: function (t, e) { var n = e.getModel(), r = e.getType(), i = this.getOptions(n), o = i.stateStyles, a = i.style, s = void 0 === a ? {} : a, u = n.stateStyles ? n.stateStyles[t] : o && o[t]; return "combo" === r ? Object(c.clone)(u) : Object(c.mix)({}, s, u); }, getControlPoints: function (t) { return t.controlPoints; }, getAnchorPoints: function (t) { return this.getOptions(t).anchorPoints; }, }, Ee = { itemType: "node", shapeType: "single-node", labelPosition: "center", offset: nt.nodeLabel.offset, getSize: function (t) { var e = t.size || this.getOptions({}).size || nt.defaultNode.size; return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition; if ("center" === n) return { x: 0, y: 0, text: t.label }; var r = e.offset; Object(c.isNil)(r) && (r = this.offset); var i, o = this.getSize(t), a = o[0], s = o[1]; switch (n) { case "top": i = { x: 0, y: 0 - s / 2 - r, textBaseline: "bottom" }; break; case "bottom": i = { x: 0, y: s / 2 + r, textBaseline: "top" }; break; case "left": i = { x: 0 - a / 2 - r, y: 0, textAlign: "right" }; break; default: i = { x: a / 2 + r, y: 0, textAlign: "left" }; } return (i.text = t.label), i; }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = Ct(o.padding), u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.offset; return ( Object(c.isNil)(l) && (l = this.offset), (a = { x: i.minX - s[3], y: i.minY - s[0] }), (a = Object(f.a)(Object(f.a)(Object(f.a)({}, a), o), { width: u, height: h, })) ); }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "node-shape", }); }, updateLinkPoints: function (t, e) { var n, r = this.getOptions(t).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), a = e.find(function (t) { return "link-point-top" === t.get("className"); }), s = e.find(function (t) { return "link-point-bottom" === t.get("className"); }); i && (n = i.attr()), o && !n && (n = o.attr()), a && !n && (n = a.attr()), s && !n && (n = s.attr()), n || (n = r); var u = Object(c.mix)({}, n, t.linkPoints), h = u.fill, l = u.stroke, d = u.lineWidth, p = u.size / 2; p || (p = u.r); var g = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0 }, v = g.left, y = g.right, m = g.top, b = g.bottom, x = this.getSize(t), S = x[0], w = x[1], O = { r: p, fill: h, stroke: l, lineWidth: d }; i ? v || void 0 === v ? i.attr(Object(f.a)(Object(f.a)({}, O), { x: -S / 2, y: 0 })) : i.remove() : v && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: -S / 2, y: 0 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), o ? (y || void 0 === y || o.remove(), o.attr(Object(f.a)(Object(f.a)({}, O), { x: S / 2, y: 0 }))) : y && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: S / 2, y: 0 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a ? (m || void 0 === m || a.remove(), a.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: -w / 2 }))) : m && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: -w / 2 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), s ? b || void 0 === b ? s.attr(Object(f.a)(Object(f.a)({}, O), { x: 0, y: w / 2 })) : s.remove() : b && e.addShape("circle", { attrs: Object(f.a)(Object(f.a)({}, O), { x: 0, y: w / 2 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, updateShape: function (t, e, n, r) { e.get("keyShape").attr(Object(f.a)({}, n)), this.updateLabel(t, e), r && this.updateIcon(t, e); }, updateIcon: function (t, e) { var n = this, r = e.getContainer(), i = this.getOptions(t).icon, o = (t.icon ? t.icon : { show: void 0 }).show, a = r.find(function (t) { return t.get("className") === "".concat(n.type, "-icon"); }); if (a) if (o || void 0 === o) { var s = Object(c.mix)({}, a.attr(), i), u = s.width, h = s.height; a.attr( Object(f.a)(Object(f.a)({}, s), { x: -u / 2, y: -h / 2 }), ); } else a.remove(); else if (o) { (u = i.width), (h = i.height); r.addShape("image", { attrs: Object(f.a)(Object(f.a)({}, i), { x: -u / 2, y: -h / 2, }), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), }); var l = r.find(function (t) { return "node-label" === t.get("className"); }); l && l.toFront(); } }, }, Pe = Object(f.a)(Object(f.a)({}, Ce), Ee); Wt.registerNode("single-node", Pe); var Ae = { itemType: "edge", labelPosition: "center", refX: 0, refY: 0, labelAutoRotate: !1, options: { size: nt.defaultEdge.size, style: { x: 0, y: 0, stroke: nt.defaultEdge.style.stroke, lineAppendWidth: nt.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: nt.edgeLabel.style.fill, fontSize: nt.edgeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.edgeStateStyles), }, getPath: function (t) { var e = []; return ( Object(c.each)(t, function (t, n) { 0 === n ? e.push(["M", t.x, t.y]) : e.push(["L", t.x, t.y]); }), e ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n, t.style), i = t.size || nt.defaultEdge.size, o = (t = this.getPathPoints(t)).startPoint, a = t.endPoint, s = this.getControlPoints(t), u = [o]; s && (u = u.concat(s)), u.push(a); var h = this.getPath(u); return Object(c.mix)( {}, nt.defaultEdge.style, { stroke: nt.defaultEdge.color, lineWidth: i, path: h }, r, ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, a = (t = this.getPathPoints(t)).startPoint, s = t.endPoint, u = this.getControlPoints(t), h = [a]; u && (h = h.concat(u)), h.push(s); var l = i.attr(), f = Object(c.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = { radius: f.radius }; u || (g = { source: d, target: p, offset: f.offset, radius: f.radius, }), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var v = this.getPath(h, g), y = Object(c.mix)( r, i.attr(), { lineWidth: o, path: v }, t.style, ); i && i.attr(y); }, getLabelStyleByPosition: function (t, e, n) { var r, i = e.position || this.labelPosition, o = {}, a = n && n.find(function (t) { return "edge-shape" === t.get("className"); }); r = "start" === i ? 0 : "end" === i ? 1 : 0.5; var s, u = e.refX || this.refX, h = e.refY || this.refY; if ( t.startPoint.x === t.endPoint.x && t.startPoint.y === t.endPoint.y ) return ( (o.x = t.startPoint.x + u), (o.y = t.startPoint.y + h), (o.text = t.label), o ); s = Object(c.isNil)(e.autoRotate) ? this.labelAutoRotate : e.autoRotate; var l = lt(a, r, u, h, s); return ( (o.x = l.x), (o.y = l.y), (o.rotate = l.rotate), (o.textAlign = this._getTextAlign(i, l.angle)), (o.text = t.label), o ); }, getLabelBgStyleByPosition: function (t, e, n, r) { if (!t) return {}; var i = t.getBBox(), o = n.style && n.style.background; if (!o) return {}; var a, s = o.padding, u = i.width + s[1] + s[3], h = i.height + s[0] + s[2], l = n.position || this.labelPosition, d = Object(f.a)(Object(f.a)({}, o), { width: u, height: h, x: i.minX - s[2], y: i.minY - s[0], rotate: 0, }); a = Object(c.isNil)(n.autoRotate) ? this.labelAutoRotate : n.autoRotate; var p, g = r && r.find(function (t) { return "edge-shape" === t.get("className"); }); p = "start" === l ? 0 : "end" === l ? 1 : 0.5; var v = n.refX || this.refX, y = n.refY || this.refY; if ( e.startPoint.x === e.endPoint.x && e.startPoint.y === e.endPoint.y ) return ( (d.x = e.startPoint.x + v - u / 2), (d.y = e.startPoint.y + y - h / 2), d ); var m = lt(g, p, v - u / 2, y + h / 2, a), b = m.angle; return ( b > 0.5 * Math.PI && b < 1.5 * Math.PI && (m = lt(g, p, v + u / 2, y + h / 2, a)), a && ((d.x = m.x), (d.y = m.y)), (d.rotate = m.rotate), d ); }, _getTextAlign: function (t, e) { var n = "center"; return e ? ((e %= 2 * Math.PI), "center" !== t && (n = (e >= 0 && e <= Math.PI / 2) || (e >= 1.5 * Math.PI && e < 2 * Math.PI) ? t : (function (t) { var e = t; return ( "start" === t ? (e = "end") : "end" === t && (e = "start"), e ); })(t)), n) : t; }, getControlPoints: function (t) { return t.controlPoints; }, getPathPoints: function (t) { return t; }, drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }); }, drawLabel: function (t, e) { var n, r = this.options.labelCfg; n = ("undefined" != typeof window && void 0 !== window.getComputedStyle && window .getComputedStyle(document.body, null) .getPropertyValue("font-family")) || "Arial, sans-serif"; var i = Object(c.deepMix)({ fontFamily: n }, r, t.labelCfg), o = this.getLabelStyle(t, i, e), a = o.rotate; delete o.rotate; var s = e.addShape("text", { attrs: o, name: "text-shape" }); if ((a && s.rotateAtStart(a), o.background)) { var u = this.drawLabelBg(t, e, s), h = this.itemType + "-label-bg"; u.set("classname", h), s.toFront(); } return s; }, drawLabelBg: function (t, e, n) { var r = this.options.labelCfg, i = Object(c.deepMix)({}, r, t.labelCfg), o = this.getLabelStyle(t, i, e).rotate, a = this.getLabelBgStyleByPosition(n, t, i, e); delete a.rotate; var s = e.addShape("rect", { name: "text-bg-shape", attrs: a }); return o && s.rotateAtStart(o), s; }, }, Ie = Object(f.a)(Object(f.a)({}, Ce), Ae); Wt.registerEdge("single-edge", Ie), Wt.registerEdge( "line", { getControlPoints: function () {} }, "single-edge", ), Wt.registerEdge( "spline", { getPath: function (t) { return te(t); }, }, "single-edge", ), Wt.registerEdge( "arc", { curveOffset: 20, clockwise: 1, getControlPoints: function (t) { var e, n, r = t.startPoint, i = t.endPoint, o = (r.x + i.x) / 2, a = (r.y + i.y) / 2; if (void 0 !== t.controlPoints) { if ( ((n = t.controlPoints[0]), (e = j(r, n, i)), r.x <= i.x && r.y > i.y ? (this.clockwise = e.x > n.x ? 0 : 1) : r.x <= i.x && r.y < i.y ? (this.clockwise = e.x > n.x ? 1 : 0) : r.x > i.x && r.y <= i.y ? (this.clockwise = e.y < n.y ? 0 : 1) : (this.clockwise = e.y < n.y ? 1 : 0), (n.x - r.x) / (n.y - r.y) == (i.x - r.x) / (i.y - r.y)) ) return []; } else { void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), Object(c.isArray)(t.curveOffset) && (t.curveOffset = t.curveOffset[0]), t.curveOffset < 0 ? (this.clockwise = 0) : (this.clockwise = 1); var s = { x: i.x - r.x, y: i.y - r.y }, u = Math.atan2(s.y, s.x); (n = { x: t.curveOffset * Math.cos(-Math.PI / 2 + u) + o, y: t.curveOffset * Math.sin(-Math.PI / 2 + u) + a, }), (e = j(r, n, i)); } var h = C(r, e); return [{ x: h, y: h }]; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), 2 === t.length ? e.push(["L", t[1].x, t[1].y]) : e.push([ "A", t[1].x, t[1].y, 0, 0, this.clockwise, t[2].x, t[2].y, ]), e ); }, }, "single-edge", ), Wt.registerEdge( "quadratic", { curvePosition: 0.5, curveOffset: -20, getControlPoints: function (t) { var e = t.controlPoints; if (!e || !e.length) { var n = t.startPoint, r = t.endPoint; void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isArray)(this.curveOffset) && (t.curveOffset = t.curveOffset[0]), Object(c.isArray)(this.curvePosition) && (t.curvePosition = t.curveOffset[0]), (e = [ee(n, r, t.curvePosition, t.curveOffset)]); } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["Q", t[1].x, t[1].y, t[2].x, t[2].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic", { curvePosition: [0.5, 0.5], curveOffset: [-20, 20], getControlPoints: function (t) { var e = t.controlPoints; if ( (void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]), !e || !e.length || e.length < 2) ) { var n = t.startPoint, r = t.endPoint; e = [ ee(n, r, t.curvePosition[0], t.curveOffset[0]), ee(n, r, t.curvePosition[1], t.curveOffset[1]), ]; } return e; }, getPath: function (t) { var e = []; return ( e.push(["M", t[0].x, t[0].y]), e.push(["C", t[1].x, t[1].y, t[2].x, t[2].y, t[3].x, t[3].y]), e ); }, }, "single-edge", ), Wt.registerEdge( "cubic-vertical", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.y - e.y, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x, y: e.y + r * this.curvePosition[0] + i[0] }, { x: n.x, y: n.y - r * this.curvePosition[1] + i[1] }, ] ); }, }, "cubic", ), Wt.registerEdge( "cubic-horizontal", { curvePosition: [0.5, 0.5], minCurveOffset: [0, 0], curveOffset: void 0, getControlPoints: function (t) { var e = t.startPoint, n = t.endPoint; void 0 === t.curvePosition && (t.curvePosition = this.curvePosition), void 0 === t.curveOffset && (t.curveOffset = this.curveOffset), void 0 === t.minCurveOffset && (t.minCurveOffset = this.minCurveOffset), Object(c.isNumber)(t.curveOffset) && (t.curveOffset = [t.curveOffset, -t.curveOffset]), Object(c.isNumber)(t.minCurveOffset) && (t.minCurveOffset = [t.minCurveOffset, -t.minCurveOffset]), Object(c.isNumber)(t.curvePosition) && (t.curvePosition = [t.curvePosition, 1 - t.curvePosition]); var r = n.x - e.x, i = [0, 0]; return ( t.curveOffset ? (i = t.curveOffset) : Math.abs(r) < Math.abs(t.minCurveOffset[0]) && (i = t.minCurveOffset), [ { x: e.x + r * this.curvePosition[0] + i[0], y: e.y }, { x: n.x - r * this.curvePosition[1] + i[1], y: n.y }, ] ); }, }, "cubic", ), Wt.registerEdge( "loop", { getPathPoints: function (t) { return ht(t); }, getControlPoints: function (t) { return t.controlPoints; }, afterDraw: function (t) { t.controlPoints = void 0; }, afterUpdate: function (t) { t.controlPoints = void 0; }, }, "cubic", ); var Te = { itemType: "combo", shapeType: "single-combo", labelPosition: "top", refX: nt.comboLabel.refX, refY: nt.comboLabel.refY, options: { style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, getSize: function (t) { var e = Object(c.clone)( t.size || this.options.size || nt.defaultCombo.size, ); return ( Object(c.isArray)(e) && 1 === e.length && (e = [e[0], e[0]]), Object(c.isArray)(e) || (e = [e, e]), e ); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isArray)(i) && (i = i[0]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = this.getSize(t), h = (Math.max(r.r, u[0] / 2) || u[0] / 2) + i; switch (n) { case "top": s = { x: 0, y: -h - a, textBaseline: "bottom", textAlign: "center", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: -h + o, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: h + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); return e.addShape(n, { attrs: r, draggable: !0, name: "combo-shape", }); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, Ne = Object(f.a)(Object(f.a)({}, Ce), Te); Wt.registerCombo("single-combo", Ne), Wt.registerCombo( "circle", { options: { size: [nt.defaultCombo.size[0], nt.defaultCombo.size[0]], padding: nt.defaultCombo.padding[0], animate: !0, style: { stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, refX: 0, refY: 0, }, stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "circle", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( delete n.height, delete n.width, e.addShape("circle", { attrs: n, className: "circle-combo", name: "circle-combo", draggable: !0, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isArray)(n) && (n = n[0]); var r, i = { stroke: t.color }, o = Object(c.mix)({}, e, i, t.style); if (t.fixSize) r = Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0]; else { var a = this.getSize(t); r = !Object(c.isNumber)(o.r) || isNaN(o.r) ? a[0] / 2 || nt.defaultCombo.style.r : Math.max(o.r, a[0] / 2) || a[0] / 2; } o.r = r + n; var s = Object(f.a)({ x: 0, y: 0 }, o); return t.style ? (t.style.r = r) : (t.style = { r: r }), s; }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isArray)(r) && (r = r[0]); var i, o = Object(c.clone)(t.style); (i = t.fixSize ? Object(c.isNumber)(t.fixSize) ? t.fixSize : t.fixSize[0] : Math.max(o.r, n[0] / 2) || n[0] / 2), (o.r = i + r); var a = e.get("sizeCache"); a && (a.r = o.r); var s = { stroke: t.color }, u = e.get("keyShape"), h = Object(c.mix)({}, u.attr(), s, o); t.style ? (t.style.r = i) : (t.style = { r: i }), this.updateShape(t, e, h, !0); }, }, "single-combo", ), Wt.registerCombo( "rect", { options: { size: [40, 5], padding: [25, 20, 15, 20], animate: !0, style: { radius: 0, stroke: nt.defaultCombo.style.stroke, fill: nt.defaultCombo.style.fill, lineWidth: nt.defaultCombo.style.lineWidth, }, labelCfg: { style: { fill: nt.comboLabel.style.fill, fontSize: nt.comboLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.comboStateStyles), }, shapeType: "rect", labelPosition: "top", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "rect-combo", name: "rect-combo", draggable: !0, }); }, getLabelStyleByPosition: function (t, e) { var n = e.position || this.labelPosition, r = t.style, i = t.padding || this.options.padding; Object(c.isNumber)(i) && (i = [i, i, i, i]); var o = e.refX, a = e.refY; Object(c.isNil)(o) && (o = this.refX), Object(c.isNil)(a) && (a = this.refY); var s, u = r.width / 2 + i[3], h = r.height / 2 + i[0]; switch (n) { case "top": s = { x: 0 - u + o, y: 0 - h + a, textBaseline: "top", textAlign: "left", }; break; case "bottom": s = { x: 0, y: h + a, textBaseline: "bottom", textAlign: "center", }; break; case "left": s = { x: 0 - u + a, y: 0, textAlign: "left" }; break; case "center": s = { x: 0, y: 0, text: t.label, textAlign: "center" }; break; default: s = { x: u + o, y: 0, textAlign: "right" }; } return (s.text = t.label), s; }, getShapeStyle: function (t) { var e = this.options.style, n = t.padding || this.options.padding; Object(c.isNumber)(n) && (n = [n, n, n, n]); var r, i, o = { stroke: t.color }, a = Object(c.mix)({}, e, o, t.style), s = this.getSize(t), u = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; u ? Object(c.isNumber)(u) ? ((r = u), (i = u)) : ((r = u[0]), (i = u[1])) : ((r = !Object(c.isNumber)(a.width) || isNaN(a.width) ? s[0] || nt.defaultCombo.style.width : Math.max(a.width, s[0]) || s[0]), (i = !Object(c.isNumber)(a.height) || isNaN(a.height) ? s[1] || nt.defaultCombo.style.height : Math.max(a.height, s[1]) || s[1])); var h = -r / 2 - n[3], l = -i / 2 - n[0]; (a.width = r + n[1] + n[3]), (a.height = i + n[0] + n[2]); var d = Object(f.a)({ x: h, y: l }, a); return ( t.style ? ((t.style.width = r), (t.style.height = i)) : (t.style = { width: r, height: i }), d ); }, update: function (t, e) { var n = this.getSize(t), r = t.padding || this.options.padding; Object(c.isNumber)(r) && (r = [r, r, r, r]); var i, o, a = Object(c.clone)(t.style), s = t.collapsed && t.fixCollapseSize ? t.fixCollapseSize : t.fixSize; s ? Object(c.isNumber)(s) ? ((i = s), (o = s)) : ((i = s[0]), (o = s[1])) : ((i = Math.max(a.width, n[0]) || n[0]), (o = Math.max(a.height, n[1]) || n[1])), (a.width = i + r[1] + r[3]), (a.height = o + r[0] + r[2]); var u = e.get("sizeCache"); u && ((u.width = a.width), (u.height = a.height)), (a.x = -i / 2 - r[3]), (a.y = -o / 2 - r[0]); var h = { stroke: t.color }, l = e.get("keyShape"), f = Object(c.mix)({}, l.attr(), h, a); t.style ? ((t.style.width = i), (t.style.height = o)) : (t.style = { width: i, height: o }), this.updateShape(t, e, f, !1); }, updateShape: function (t, e, n) { var r = e.get("keyShape"); (void 0 === t.animate ? this.options.animate : t.animate) && r.animate ? r.animate(n, { duration: 200, easing: "easeLinear" }) : r.attr(Object(f.a)({}, n)), this.updateLabel(t, e); }, }, "single-combo", ), Wt.registerNode( "simple-circle", { options: { size: nt.defaultNode.size, style: { x: 0, y: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("circle", { attrs: n, className: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.deepMix)({}, e, n), i = this.getSize(t)[0] / 2; return Object(f.a)({ x: 0, y: 0, r: i }, r); }, update: function (t, e) { var n = this.getSize(t), r = { stroke: t.color, r: n[0] / 2 }, i = e.get("keyShape"), o = Object(c.deepMix)({}, i.attr(), r, t.style); this.updateShape(t, e, o, !0); }, }, "single-node", ), Wt.registerNode( "simple-rect", { options: { size: [100, 30], style: { radius: 0, stroke: nt.defaultNode.style.stroke, fill: nt.defaultNode.style.fill, lineWidth: nt.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: nt.nodeLabel.style.fill, fontSize: nt.nodeLabel.style.fontSize, }, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: Object(f.a)({}, nt.nodeStateStyles), }, shapeType: "simple-rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, r = Object(c.mix)({}, e, n), i = this.getSize(t), o = r.width || i[0], a = r.height || i[1]; return Object(f.a)( { x: -o / 2, y: -a / 2, width: o, height: a }, r, ); }, update: function (t, e) { e.getContainer(); var n = this.getOptions({}).style, r = this.getSize(t), i = e.get("keyShape"); t.size || ((r[0] = i.attr("width") || n.width), (r[1] = i.attr("height") || n.height)); var o = { stroke: t.color, x: -r[0] / 2, y: -r[1] / 2, width: r[0], height: r[1], }, a = Object(c.mix)({}, n, i.attr(), o); (a = Object(c.mix)(a, t.style)), this.updateShape(t, e, a, !1); }, }, "single-node", ), Wt.registerNode( "image", { options: { img: "https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ", size: 200, clipCfg: { show: !1, type: "circle", r: 50, rx: 50, ry: 35, width: 50, height: 35, points: [ [30, 12], [12, 30], [30, 48], [48, 30], ], path: [ ["M", 25, 25], ["L", 50, 25], ["A", 12.5, 12.5, 0, 1, 1, 50, 50], ["A", 12.5, 12.5, 0, 1, 0, 50, 50], ["L", 25, 75], ["Z"], ], x: 0, y: 0, }, }, shapeType: "image", labelPosition: "bottom", drawShape: function (t, e) { var n = this.shapeType, r = this.getShapeStyle(t); delete r.fill; var i = e.addShape(n, { attrs: r, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawClip(t, i), i; }, drawClip: function (t, e) { var n = this.getOptions(t).clipCfg; if (n.show) { var r = n.type, i = n.x, o = n.y, a = n.style; if ("circle" === r) { var s = n.r; e.setClip({ type: "circle", attrs: Object(f.a)({ r: s, x: i, y: o }, a), }); } else if ("rect" === r) { var c = n.width, u = n.height, h = i - c / 2, l = o - u / 2; e.setClip({ type: "rect", attrs: Object(f.a)({ x: h, y: l, width: c, height: u }, a), }); } else if ("ellipse" === r) { var d = n.rx, p = n.ry; e.setClip({ type: "ellipse", attrs: Object(f.a)({ x: i, y: o, rx: d, ry: p }, a), }); } else if ("polygon" === r) { var g = n.points; e.setClip({ type: "polygon", attrs: Object(f.a)({ points: g }, a), }); } else if ("path" === r) { var v = n.path; e.setClip({ type: "path", attrs: Object(f.a)({ path: v }, a), }); } } }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = this.getSize(t), r = this.getOptions(t).img, i = n[0], o = n[1]; return ( e && ((i = e.width || n[0]), (o = e.height || n[1])), Object(f.a)( { x: -i / 2, y: -o / 2, width: i, height: o, img: r }, e, ) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(), r = "".concat(this.itemType, "-shape"), i = n.find(function (t) { return t.get("className") === r; }) || e.getKeyShape(), o = this.getShapeStyle(t); i && i.attr(o); }, }, "single-node", ); var Be, Le = { triangle: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, " L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, vee: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 20), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 L ") .concat(r + e, ",-") .concat(t / 2, "\n L ") .concat(r + (2 * e) / 3, ",0 L ") .concat(r + e, ",") .concat(t / 2, " Z"); }, circle: function (t, e) { return ( void 0 === t && (t = 5), void 0 === e && (e = 0), "M " .concat(2 * e, ", 0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * t, ",0\n a ") .concat(t, ",") .concat(t, " 0 1,0 ") .concat(2 * -t, ",0") ); }, rect: function (t, e, n) { void 0 === t && (t = 10), void 0 === e && (e = 10), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",") .concat(t / 2, " \n L ") .concat(r, ",") .concat(t / 2, " Z"); }, diamond: function (t, e, n) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 0); var r = 2 * n; return "M " .concat(r, ",0 \n L ") .concat(r + e / 2, ",") .concat(-t / 2, " \n L ") .concat(r + e, ",0 \n L ") .concat(r + e / 2, ",") .concat(t / 2, " Z"); }, triangleRect: function (t, e, n, r, i, o) { void 0 === t && (t = 15), void 0 === e && (e = 15), void 0 === n && (n = 15), void 0 === r && (r = 3), void 0 === i && (i = 5), void 0 === o && (o = 0); var a = 2 * o, s = a + e + i; return "M " .concat(a, ",0 L ") .concat(a + e, ",-") .concat(t / 2, " L ") .concat(a + e, ",") .concat(t / 2, " Z\n M ") .concat(s, ", -") .concat(n / 2, "\n L ") .concat(s + r, " -") .concat(n / 2, "\n L ") .concat(s + r, " ") .concat(n / 2, "\n L ") .concat(s, " ") .concat(n / 2, "\n Z"); }, }, De = { collapse: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t + n - 4, e], ]; }, expand: function (t, e, n) { return [ ["M", t - n, e], ["a", n, n, 0, 1, 0, 2 * n, 0], ["a", n, n, 0, 1, 0, 2 * -n, 0], ["M", t - n + 4, e], ["L", t - n + 2 * n - 4, e], ["M", t - n + n, e - n + 4], ["L", t, e + n - 4], ]; }, upTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e + i], ["L", t + r, e + i], ["L", t, e - n], ["Z"], ]; }, downTriangle: function (t, e, n) { var r = n * Math.cos(Math.PI / 6), i = n * Math.sin(Math.PI / 6); return [ ["M", t - r, e - i], ["L", t + r, e - i], ["L", t, e + n], ["Z"], ]; }, }, _e = Wt, Re = [ "#5F95FF", "#61DDAA", "#65789B", "#F6BD16", "#7262FD", "#78D3F8", "#9661BC", "#F6903D", "#008685", "#F08BB4", ], Fe = g.a.transform, Ye = Object(f.a)( Object(f.a)( Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({}, o), i), a), r), s, ), { transform: Fe, mat3: g.b }, ), Xe = (function () { function t(t) { (this.graph = t), (this.layoutCfg = t.get("layout") || {}), (this.layoutType = this.getLayoutType()), (this.layoutMethods = []), this.initLayout(); } return ( (t.prototype.initLayout = function () {}), (t.prototype.getLayoutType = function () { return this.getLayoutCfgType(this.layoutCfg); }), (t.prototype.getLayoutCfgType = function (t) { var e = t.type; if (e) return e; var n = t.pipes; return Array.isArray(n) ? n.map(function (t) { return (null == t ? void 0 : t.type) || ""; }) : null; }), (t.prototype.isLayoutTypeSame = function (t) { var e = this.getLayoutCfgType(t); return Array.isArray(this.layoutType) ? this.layoutType.every(function (t, n) { return t === e[n]; }) : (null == t ? void 0 : t.type) === this.layoutType; }), (t.prototype.refreshLayout = function () { var t = this.graph; t && (t.get("animate") ? t.positionsAnimate() : t.refreshPositions()); }), (t.prototype.changeLayout = function (t) { (this.layoutCfg = t), this.destoryLayoutMethods(), this.layout(); }), (t.prototype.changeData = function () { this.destoryLayoutMethods(), this.layout(); }), (t.prototype.destoryLayoutMethods = function () { var t = this.layoutMethods; null == t || t.forEach(function (t) { t.destroy(); }), (this.layoutMethods = []); }), (t.prototype.destroyLayout = function () { var t = this.graph; this.destoryLayoutMethods(), t.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0); }), (t.prototype.setDataFromGraph = function () { for ( var t = [], e = [], n = [], r = [], i = [], o = [], a = this.graph.getNodes(), s = this.graph.getEdges(), c = this.graph.getCombos(), u = a.length, h = 0; h < u; h++ ) { var l = a[h]; if (l && !l.destroyed) { var f = l.getModel(); l.isVisible() ? t.push(f) : e.push(f); } } var d = s.length; for (h = 0; h < d; h++) { var p = s[h]; if (p && !p.destroyed) { f = p.getModel(); p.isVisible() ? f.isComboEdge ? i.push(f) : n.push(f) : r.push(f); } } var g = c.length; for (h = 0; h < g; h++) { var v = c[h]; if (!v.destroyed) { f = v.getModel(); v.isVisible() ? o.push(f) : r.push(f); } } return { nodes: t, hiddenNodes: e, edges: n, hiddenEdges: r, combos: o, hiddenCombos: [], comboEdges: i, }; }), (t.prototype.reLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; (e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), t.init(n.data), "force" === a && ((t.ticking = !1), t.forceSimulation.stop()), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (t.prototype.relayout = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = this.layoutCfg; if (t) { this.data = this.setDataFromGraph(); var o = this.data.nodes; if (!o) return !1; this.initPositions(i.center, o); } n.emit("beforelayout"); var a = Promise.resolve(); null == r || r.forEach(function (t, n) { var r = i[n]; a = a.then(function () { return e.reLayoutMethod(t, r); }); }), a .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("relayout failed", t); }); }), (t.prototype.filterLayoutData = function (t, e) { var n, r, i = t.nodes, o = t.edges, a = Object(f.e)(t, ["nodes", "edges"]); if (!i) return t; if ( ((n = Object(c.isFunction)(null == e ? void 0 : e.nodesFilter) ? e.nodesFilter : function () { return !0; }), Object(c.isFunction)(null == e ? void 0 : e.edgesFilter)) ) r = e.edgesFilter; else { var s = i.reduce(function (t, e) { return (t[e.id] = !0), t; }, {}); r = function (t) { return s[t.source] && s[t.target]; }; } return Object(f.a)({ nodes: i.filter(n), edges: o.filter(r) }, a); }), (t.prototype.getLayoutBBox = function (t) { var e = this.graph, n = Object(c.groupBy)(e.getNodes(), function (t) { return t.getModel().layoutOrder; }), r = Object.values(n).map(function (t) { var e = It(t); return (e.size = [e.width, e.height]), e; }); return { groupNodes: Object.values(Object(c.groupBy)(t, "layoutOrder")), layoutNodes: r, }; }), (t.prototype.layoutAnimate = function () {}), (t.prototype.moveToZero = function () { var t = this.graph.get("data").nodes; if (void 0 !== t[0].x && null !== t[0].x && !At(t[0].x)) { for (var e = [0, 0], n = t.length, r = 0; r < n; r++) { var i = t[r]; (e[0] += i.x), (e[1] += i.y); } (e[0] /= t.length), (e[1] /= t.length); for (r = 0; r < n; r++) { ((i = t[r]).x -= e[0]), (i.y -= e[1]); } } }), (t.prototype.initPositions = function (t, e) { var n = this.graph; if (!e) return !1; var r = e ? e.length : 0; if (r) { var i = 0.85 * n.get("width"), o = 0.85 * n.get("height"), a = Math.ceil(Math.sqrt(r) * (i / o)), s = i / (a - 1), c = o / (Math.ceil(r / a) - 1); (isFinite(s) && s) || (s = 0), (isFinite(c) && s) || (c = 0); for ( var u = t[0] - i / 2, h = t[1] - o / 2, l = !0, f = 0; f < r; f++ ) { var d = e[f]; At(d.x) && ((l = !1), (d.x = (f % a) * s + u)), At(d.y) && ((l = !1), (d.y = Math.floor(f / a) * c + h)); } return l; } }), (t.prototype.destroy = function () { (this.graph = null), this.destoryLayoutMethods(), (this.destroyed = !0); }), (t.prototype.onTick = function (t) { var e; null === (e = this.layoutMethods) || void 0 === e || e.forEach(function (e) { var n; null === (n = null == e ? void 0 : e.onTick) || void 0 === n || n.call(e, t); }); }), t ); })(), ze = function (t) { (this.graph = t), (this.destroyed = !1), this.initEvents(); }; !(function (t) { (t.CLICK = "click"), (t.DBLCLICK = "dblclick"), (t.TAP = "tap"), (t.DBLTAP = "dbltap"), (t.DRAGSTART = "dragstart"), (t.DRAGEND = "dragend"), (t.DRAG = "drag"), (t.DRAGENTER = "dragenter"), (t.DRAGLEAVE = "dragleave"), (t.DRAGOVER = "dragover"), (t.DRAGOUT = "dragout"), (t.DDROP = "drop"), (t.PINCHSTART = "pinchstart"), (t.PINCHMOVE = "pinchmove"), (t.PANSTART = "panstart"), (t.PANMOVE = "panmove"), (t.PANEND = "panend"), (t.PRESS = "press"), (t.ACTION_END = "actionend"), (t.TOUCHSTART = "touchstart"), (t.TOUCHMOVE = "touchmove"), (t.TOUCHEND = "touchend"), (t.CANVAS_TOUCHSTART = "canvas:touchstart"), (t.CANVAS_TOUCHMOVE = "canvas:touchmove"), (t.CANVAS_TOUCHEND = "canvas:touchend"), (t.NODE_TOUCHSTART = "node:touchstart"), (t.NODE_TOUCHMOVE = "node:touchmove"), (t.NODE_TOUCHEND = "node:touchend"), (t.COMBO_TOUCHSTART = "combo:touchstart"), (t.COMBO_TOUCHMOVE = "combo:touchmove"), (t.COMBO_TOUCHEND = "combo:touchend"), (t.EDGE_TOUCHSTART = "edge:touchstart"), (t.EDGE_TOUCHMOVE = "edge:touchmove"), (t.EDGE_TOUCHEND = "edge:touchend"), (t.NODE_CLICK = "node:click"), (t.NODE_DBLCLICK = "node:dblclick"), (t.NODE_DROP = "node:drop"), (t.NODE_DRAGOVER = "node:dragover"), (t.NODE_DRAGENTER = "node:dragenter"), (t.NODE_DRAGLEAVE = "node:dragleave"), (t.NODE_DRAGSTART = "node:dragstart"), (t.NODE_DRAG = "node:drag"), (t.NODE_DRAGEND = "node:dragend"), (t.NODE_TAP = "node:tap"), (t.NODE_DBLTAP = "node:dbltap"), (t.NODE_PANSTART = "node:panstart"), (t.NODE_PANMOVE = "node:panmove"), (t.NODE_PANEND = "node:panend"), (t.NODE_PRESS = "node:press"), (t.COMBO_CLICK = "combo:click"), (t.COMBO_DBLCLICK = "combo:dblclick"), (t.COMBO_DROP = "combo:drop"), (t.COMBO_DRAGOVER = "combo:dragover"), (t.COMBO_DRAGENTER = "combo:dragenter"), (t.COMBO_DRAGLEAVE = "combo:dragleave"), (t.COMBO_DRAGSTART = "combo:dragstart"), (t.COMBO_DRAG = "combo:drag"), (t.COMBO_DRAGEND = "combo:dragend"), (t.COMBO_TAP = "combo:tap"), (t.COMBO_DBLTAP = "combo:dbltap"), (t.COMBO_PANSTART = "combo:panstart"), (t.COMBO_PANMOVE = "combo:panmove"), (t.COMBO_PANEND = "combo:panend"), (t.COMBO_PRESS = "combo:press"), (t.EDGE_CLICK = "edge:click"), (t.EDGE_DBLCLICK = "edge:dblclick"), (t.EDGE_DROP = "edge:drop"), (t.EDGE_DRAGOVER = "edge:dragover"), (t.EDGE_DRAGENTER = "edge:dragenter"), (t.EDGE_DRAGLEAVE = "edge:dragleave"), (t.EDGE_TAP = "edge:tap"), (t.EDGE_DBLTAP = "edge:dbltap"), (t.EDGE_PRESS = "edge:press"), (t.CANVAS_CLICK = "canvas:click"), (t.CANVAS_DBLCLICK = "canvas:dblclick"), (t.CANVAS_DROP = "canvas:drop"), (t.CANVAS_DRAGENTER = "canvas:dragenter"), (t.CANVAS_DRAGLEAVE = "canvas:dragleave"), (t.CANVAS_DRAGSTART = "canvas:dragstart"), (t.CANVAS_DRAG = "canvas:drag"), (t.CANVAS_DRAGEND = "canvas:dragend"), (t.CANVAS_TAP = "canvas:tap"), (t.CANVAS_DBLTAP = "canvas:dbltap"), (t.CANVAS_PANSTART = "canvas:panstart"), (t.CANVAS_PANMOVE = "canvas:panmove"), (t.CANVAS_PANEND = "canvas:panend"), (t.CANVAS_PRESS = "canvas:press"), (t.BEFORERENDER = "beforerender"), (t.AFTERRENDER = "afterrender"), (t.BEFOREADDITEM = "beforeadditem"), (t.AFTERADDITEM = "afteradditem"), (t.BEFOREREMOVEITEM = "beforeremoveitem"), (t.AFTERREMOVEITEM = "afterremoveitem"), (t.BEFOREUPDATEITEM = "beforeupdateitem"), (t.AFTERUPDATEITEM = "afterupdateitem"), (t.BEFOREITEMVISIBILITYCHANGE = "beforeitemvisibilitychange"), (t.AFTERITEMVISIBILITYCHANGE = "afteritemvisibilitychange"), (t.BEFOREITEMSTATECHANGE = "beforeitemstatechange"), (t.AFTERITEMSTATECHANGE = "afteritemstatechange"), (t.BEFOREITEMREFRESH = "beforeitemrefresh"), (t.AFTERITEMREFRESH = "afteritemrefresh"), (t.BEFOREITEMSTATESCLEAR = "beforeitemstatesclear"), (t.AFTERITEMSTATESCLEAR = "afteritemstatesclear"), (t.BEFOREMODECHANGE = "beforemodechange"), (t.AFTERMODECHANGE = "aftermodechange"), (t.BEFORELAYOUT = "beforelayout"), (t.AFTERLAYOUT = "afterlayout"), (t.BEFORECREATEEDGE = "beforecreateedge"), (t.AFTERCREATEEDGE = "aftercreateedge"), (t.BEFOREGRAPHREFRESHPOSITION = "beforegraphrefreshposition"), (t.AFTERGRAPHREFRESHPOSITION = "aftergraphrefreshposition"), (t.BEFOREGRAPHREFRESH = "beforegraphrefresh"), (t.AFTERGRAPHREFRESH = "aftergraphrefresh"), (t.BEFOREANIMATE = "beforeanimate"), (t.AFTERANIMATE = "afteranimate"), (t.BEFOREPAINT = "beforepaint"), (t.AFTERPAINT = "afterpaint"), (t.BEFORECOLLAPSEEXPANDCOMBO = "beforecollapseexpandcombo"), (t.AFTERCOLLAPSEEXPANDCOMBO = "aftercollapseexpandcombo"), (t.GRAPHSTATECHANGE = "graphstatechange"), (t.AFTERACTIVATERELATIONS = "afteractivaterelations"), (t.NODESELECTCHANGE = "nodeselectchange"), (t.TOOLTIPCHANGE = "tooltipchange"), (t.WHEELZOOM = "wheelzoom"), (t.VIEWPORTCHANGE = "viewportchange"), (t.DRAGNODEEND = "dragnodeend"), (t.STACKCHANGE = "stackchange"); })(Be || (Be = {})); var We = _e.registerNode, qe = _e.registerEdge, Ve = _e.registerCombo, Ge = l.registerBehavior, He = nt; _e.registerNode, _e.registerEdge, _e.registerCombo, l.registerBehavior; }, 205: function (t, e, n) { "use strict"; n.r(e), function (r) { var i = n(119), o = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== r ? r : void 0; ("object" == typeof exports && "object" == typeof t) || ("function" == typeof define && n(223)) || "object" == typeof exports || Object.defineProperties(o, { f6: { get: function () { return ( console.warn("废弃的特性: f6, 请使用 F6 代替 f6"), i.default ); }, }, }), (e.default = i.default); }.call(this, n(98)); }, 206: function (t, e) { var n, r, i = (t.exports = {}); function o() { throw new Error("setTimeout has not been defined"); } function a() { throw new Error("clearTimeout has not been defined"); } function s(t) { if (n === setTimeout) return setTimeout(t, 0); if ((n === o || !n) && setTimeout) return (n = setTimeout), setTimeout(t, 0); try { return n(t, 0); } catch (e) { try { return n.call(null, t, 0); } catch (e) { return n.call(this, t, 0); } } } !(function () { try { n = "function" == typeof setTimeout ? setTimeout : o; } catch (t) { n = o; } try { r = "function" == typeof clearTimeout ? clearTimeout : a; } catch (t) { r = a; } })(); var c, u = [], h = !1, l = -1; function f() { h && c && ((h = !1), c.length ? (u = c.concat(u)) : (l = -1), u.length && d()); } function d() { if (!h) { var t = s(f); h = !0; for (var e = u.length; e; ) { for (c = u, u = []; ++l < e; ) c && c[l].run(); (l = -1), (e = u.length); } (c = null), (h = !1), (function (t) { if (r === clearTimeout) return clearTimeout(t); if ((r === a || !r) && clearTimeout) return (r = clearTimeout), clearTimeout(t); try { r(t); } catch (e) { try { return r.call(null, t); } catch (e) { return r.call(this, t); } } })(t); } } function p(t, e) { (this.fun = t), (this.array = e); } function g() {} (i.nextTick = function (t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) for (var n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; u.push(new p(t, e)), 1 !== u.length || h || s(d); }), (p.prototype.run = function () { this.fun.apply(null, this.array); }), (i.title = "browser"), (i.browser = !0), (i.env = {}), (i.argv = []), (i.version = ""), (i.versions = {}), (i.on = g), (i.addListener = g), (i.once = g), (i.off = g), (i.removeListener = g), (i.removeAllListeners = g), (i.emit = g), (i.prependListener = g), (i.prependOnceListener = g), (i.listeners = function (t) { return []; }), (i.binding = function (t) { throw new Error("process.binding is not supported"); }), (i.cwd = function () { return "/"; }), (i.chdir = function (t) { throw new Error("process.chdir is not supported"); }), (i.umask = function () { return 0; }); }, 207: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isAllowCapture = e.isParent = e.isBrowser = e.removeFromArray = void 0), (e.removeFromArray = function (t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); }), (e.isBrowser = "undefined" != typeof window && void 0 !== window.document); var r = n(0); Object.defineProperty(e, "isNil", { enumerable: !0, get: function () { return r.isNil; }, }), Object.defineProperty(e, "isFunction", { enumerable: !0, get: function () { return r.isFunction; }, }), Object.defineProperty(e, "isString", { enumerable: !0, get: function () { return r.isString; }, }), Object.defineProperty(e, "isObject", { enumerable: !0, get: function () { return r.isObject; }, }), Object.defineProperty(e, "isArray", { enumerable: !0, get: function () { return r.isArray; }, }), Object.defineProperty(e, "mix", { enumerable: !0, get: function () { return r.mix; }, }), Object.defineProperty(e, "each", { enumerable: !0, get: function () { return r.each; }, }), Object.defineProperty(e, "upperFirst", { enumerable: !0, get: function () { return r.upperFirst; }, }), (e.isParent = function (t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; }), (e.isAllowCapture = function (t) { return t.cfg.visible && t.cfg.capture; }); }, 208: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.getOffScreenContext = void 0); var r = null; e.getOffScreenContext = function () { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; }; }, 209: function (t, e, n) { "use strict"; var r = n(210), i = n(211), o = Object.hasOwnProperty, a = Object.create(null); for (var s in r) o.call(r, s) && (a[r[s]] = s); var c = (t.exports = { to: {}, get: {} }); function u(t, e, n) { return Math.min(Math.max(e, t), n); } function h(t) { var e = Math.round(t).toString(16).toUpperCase(); return e.length < 2 ? "0" + e : e; } (c.get = function (t) { var e, n; switch (t.substring(0, 3).toLowerCase()) { case "hsl": (e = c.get.hsl(t)), (n = "hsl"); break; case "hwb": (e = c.get.hwb(t)), (n = "hwb"); break; default: (e = c.get.rgb(t)), (n = "rgb"); } return e ? { model: n, value: e } : null; }), (c.get.rgb = function (t) { if (!t) return null; var e, n, i, a, s = [0, 0, 0, 1]; if ((n = t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i))) { for (a = n[2], n = n[1], i = 0; i < 3; i++) (e = 2 * i), (s[i] = parseInt(n.slice(e, e + 2), 16)); a && (s[3] = parseInt(a, 16) / 255); } else if ((n = t.match(/^#([a-f0-9]{3,4})$/i))) { for (a = (n = n[1])[3], i = 0; i < 3; i++) s[i] = parseInt(n[i] + n[i], 16); a && (s[3] = parseInt(a + a, 16) / 255); } else if ( (n = t.match( /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) { for (i = 0; i < 3; i++) s[i] = parseInt(n[i + 1], 0); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } else { if ( !(n = t.match( /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/, )) ) return (n = t.match(/^(\w+)$/)) ? "transparent" === n[1] ? [0, 0, 0, 0] : o.call(r, n[1]) ? (((s = r[n[1]])[3] = 1), s) : null : null; for (i = 0; i < 3; i++) s[i] = Math.round(2.55 * parseFloat(n[i + 1])); n[4] && (n[5] ? (s[3] = 0.01 * parseFloat(n[4])) : (s[3] = parseFloat(n[4]))); } for (i = 0; i < 3; i++) s[i] = u(s[i], 0, 255); return (s[3] = u(s[3], 0, 1)), s; }), (c.get.hsl = function (t) { if (!t) return null; var e, n = t.match( /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.get.hwb = function (t) { if (!t) return null; var e, n = t.match( /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, ); return n ? ((e = parseFloat(n[4])), [ ((parseFloat(n[1]) % 360) + 360) % 360, u(parseFloat(n[2]), 0, 100), u(parseFloat(n[3]), 0, 100), u(isNaN(e) ? 1 : e, 0, 1), ]) : null; }), (c.to.hex = function () { var t = i(arguments); return ( "#" + h(t[0]) + h(t[1]) + h(t[2]) + (t[3] < 1 ? h(Math.round(255 * t[3])) : "") ); }), (c.to.rgb = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "rgb(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ")" : "rgba(" + Math.round(t[0]) + ", " + Math.round(t[1]) + ", " + Math.round(t[2]) + ", " + t[3] + ")"; }), (c.to.rgb.percent = function () { var t = i(arguments), e = Math.round((t[0] / 255) * 100), n = Math.round((t[1] / 255) * 100), r = Math.round((t[2] / 255) * 100); return t.length < 4 || 1 === t[3] ? "rgb(" + e + "%, " + n + "%, " + r + "%)" : "rgba(" + e + "%, " + n + "%, " + r + "%, " + t[3] + ")"; }), (c.to.hsl = function () { var t = i(arguments); return t.length < 4 || 1 === t[3] ? "hsl(" + t[0] + ", " + t[1] + "%, " + t[2] + "%)" : "hsla(" + t[0] + ", " + t[1] + "%, " + t[2] + "%, " + t[3] + ")"; }), (c.to.hwb = function () { var t = i(arguments), e = ""; return ( t.length >= 4 && 1 !== t[3] && (e = ", " + t[3]), "hwb(" + t[0] + ", " + t[1] + "%, " + t[2] + "%" + e + ")" ); }), (c.to.keyword = function (t) { return a[t.slice(0, 3)]; }); }, 210: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 211: function (t, e, n) { "use strict"; var r = n(212), i = Array.prototype.concat, o = Array.prototype.slice, a = (t.exports = function (t) { var e, n, a, s = []; for (e = 0, n = t.length; e < n; e++) (a = t[e]), r(a) ? (s = i.call(s, o.call(a))) : s.push(a); return s; }); a.wrap = function (t) { return function () { return t(a(arguments)); }; }; }, 212: function (t, e, n) { "use strict"; t.exports = function (t) { return ( !(!t || "string" == typeof t) && (t instanceof Array || Array.isArray(t) || (t.length >= 0 && (t.splice instanceof Function || (Object.getOwnPropertyDescriptor(t, t.length - 1) && "String" !== t.constructor.name)))) ); }; }, 213: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(126), a = n(215), s = {}; Object.keys(o).forEach(function (t) { (s[t] = {}), Object.defineProperty(s[t], "channels", { value: o[t].channels }), Object.defineProperty(s[t], "labels", { value: o[t].labels }); var e = a(t); Object.keys(e).forEach(function (n) { var r = e[n]; (s[t][n] = (function (t) { var e = function (e) { if (null == e) return e; arguments.length > 1 && (e = Array.prototype.slice.call(arguments)); var n, r, o = t(e); if ("object" === i(o)) for (n = o.length, r = 0; r < n; r++) o[r] = Math.round(o[r]); return o; }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)), (s[t][n].raw = (function (t) { var e = function (e) { return null == e ? e : (arguments.length > 1 && (e = Array.prototype.slice.call(arguments)), t(e)); }; return "conversion" in t && (e.conversion = t.conversion), e; })(r)); }); }), (t.exports = s); }, 214: function (t, e, n) { "use strict"; t.exports = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50], }; }, 215: function (t, e, n) { "use strict"; var r = n(126); function i(t) { var e, n, i, o, a, s, c = (function () { var t, e, n = {}, i = Object.keys(r); for (t = i.length, e = 0; e < t; e++) n[i[e]] = { distance: -1, parent: null }; return n; })(), u = [t]; for (c[t].distance = 0; u.length; ) for ( e = u.pop(), i = (n = Object.keys(r[e])).length, o = 0; o < i; o++ ) -1 === (s = c[(a = n[o])]).distance && ((s.distance = c[e].distance + 1), (s.parent = e), u.unshift(a)); return c; } function o(t, e) { return function (n) { return e(t(n)); }; } function a(t, e) { for ( var n = [e[t].parent, t], i = r[e[t].parent][t], a = e[t].parent; e[a].parent; ) n.unshift(e[a].parent), (i = o(r[e[a].parent][a], i)), (a = e[a].parent); return (i.conversion = n), i; } t.exports = function (t) { var e, n, r, o = i(t), s = {}, c = Object.keys(o); for (e = c.length, n = 0; n < e; n++) null !== o[(r = c[n])].parent && (s[r] = a(r, o)); return s; }; }, 216: function (t, e, n) { "use strict"; var r = Object.create ? function (t, e, n, r) { void 0 === r && (r = n), Object.defineProperty(t, r, { enumerable: !0, get: function () { return e[n]; }, }); } : function (t, e, n, r) { void 0 === r && (r = n), (t[r] = e[n]); }, i = function (t, e) { for (var n in t) "default" === n || Object.prototype.hasOwnProperty.call(e, n) || r(e, t, n); }; Object.defineProperty(e, "__esModule", { value: !0 }), i(n(217), e), i(n(218), e), i(n(219), e), i(n(220), e), i(n(221), e), i(n(222), e); }, 217: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.camelize = e.isString = void 0); e.isString = function (t) { return "string" == typeof t; }; var r = /-(\w)/g; e.camelize = (function (t) { var e = Object.create(null); return function (n) { return e[n] || (e[n] = t(n)); }; })(function (t) { return t.replace(r, function (t, e) { return e ? e.toUpperCase() : ""; }); }); }, 218: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isArray = void 0), (e.isArray = Array.isArray); }, 219: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.toNumber = e.isNaN = e.isNumber = void 0); e.isNumber = function (t) { return "number" == typeof t; }; e.isNaN = function (t) { return Number.isNaN(Number(t)); }; e.toNumber = function (t) { var n = parseFloat(t); return e.isNaN(n) ? t : n; }; }, 22: function (t, e, n) { "use strict"; var r = n(95), i = Object(r.getColorsWithSubjectColor)( "rgb(95, 149, 255)", "rgb(255, 255, 255)", ); e.a = { version: "0.0.16", rootContainerClassName: "root-container", uiContainerClassName: "ui-container", waterContainerClassName: "water-container", nodeContainerClassName: "node-container", edgeContainerClassName: "edge-container", comboContainerClassName: "combo-container", delegateContainerClassName: "delegate-container", defaultLoopPosition: "top", nodeLabel: { style: { fill: "#000", fontSize: 12, textAlign: "center", textBaseline: "middle", }, offset: 4, }, defaultNode: { type: "circle", style: { lineWidth: 1, stroke: i.mainStroke, fill: i.mainFill }, size: 20, color: i.mainStroke, linkPoints: { size: 8, lineWidth: 1, fill: i.activeFill, stroke: i.activeStroke, }, }, nodeStateStyles: { active: { fill: i.activeFill, stroke: i.activeStroke, lineWidth: 2, shadowColor: i.mainStroke, shadowBlur: 10, }, selected: { fill: i.selectedFill, stroke: i.selectedStroke, lineWidth: 4, shadowColor: i.selectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { fill: i.highlightFill, stroke: i.highlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { fill: i.inactiveFill, stroke: i.inactiveStroke, lineWidth: 1, }, disable: { fill: i.disableFill, stroke: i.disableStroke, lineWidth: 1, }, }, edgeLabel: { style: { fill: "rgb(0, 0, 0)", textAlign: "center", textBaseline: "middle", fontSize: 12, }, }, defaultEdge: { type: "line", size: 1, style: { stroke: i.edgeMainStroke, lineAppendWidth: 2 }, color: i.edgeMainStroke, }, edgeStateStyles: { active: { stroke: i.edgeActiveStroke, lineWidth: 1 }, selected: { stroke: i.edgeSelectedStroke, lineWidth: 2, shadowColor: i.edgeSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.edgeHighlightStroke, lineWidth: 2, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.edgeInactiveStroke, lineWidth: 1 }, disable: { stroke: i.edgeDisableStroke, lineWidth: 1 }, }, comboLabel: { style: { fill: "rgb(0, 0, 0)", textBaseline: "middle", fontSize: 12 }, refY: 10, refX: 10, }, defaultCombo: { type: "circle", style: { fill: i.comboMainFill, lineWidth: 1, stroke: i.comboMainStroke, r: 5, width: 20, height: 10, }, size: [20, 5], color: i.comboMainStroke, padding: [25, 20, 15, 20], }, comboStateStyles: { active: { stroke: i.comboActiveStroke, lineWidth: 1, fill: i.comboActiveFill, }, selected: { stroke: i.comboSelectedStroke, lineWidth: 2, fill: i.comboSelectedFill, shadowColor: i.comboSelectedStroke, shadowBlur: 10, "text-shape": { fontWeight: 500 }, }, highlight: { stroke: i.comboHighlightStroke, lineWidth: 2, fill: i.comboHighlightFill, "text-shape": { fontWeight: 500 }, }, inactive: { stroke: i.comboInactiveStroke, fill: i.comboInactiveFill, lineWidth: 1, }, disable: { stroke: i.comboDisableStroke, fill: i.comboDisableFill, lineWidth: 1, }, }, delegateStyle: { fill: "#F3F9FF", fillOpacity: 0.5, stroke: "#1890FF", strokeOpacity: 0.9, lineDash: [5, 5], }, textWaterMarkerConfig: { width: 150, height: 100, compatible: !1, text: { x: 0, y: 60, lineHeight: 20, rotate: 20, fontSize: 14, fontFamily: "Microsoft YaHei", fill: "rgba(0, 0, 0, 0.1)", baseline: "Middle", }, }, imageWaterMarkerConfig: { image: { x: 0, y: 0, width: 30, height: 20, rotate: 0 }, }, waterMarkerImage: "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", }; }, 220: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.traverseTreeUp = e.scaleMatrix = e.getAdjMatrix = e.floydWarshall = e.getDegree = void 0); e.getDegree = function (t, e, n) { var r, i = []; for (r = 0; r < t; r++) i[r] = 0; return n ? (n.forEach(function (t) { t.source && (i[e[t.source]] += 1), t.target && (i[e[t.target]] += 1); }), i) : i; }; e.floydWarshall = function (t) { var e, n = [], r = t.length; for (i = 0; i < r; i += 1) for (n[i] = [], o = 0; o < r; o += 1) i === o ? (n[i][o] = 0) : 0 !== t[i][o] && t[i][o] ? (n[i][o] = t[i][o]) : (n[i][o] = 1 / 0); for (e = 0; e < r; e += 1) for (var i = 0; i < r; i += 1) for (var o = 0; o < r; o += 1) n[i][o] > n[i][e] + n[e][o] && (n[i][o] = n[i][e] + n[e][o]); return n; }; e.getAdjMatrix = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { (o[t.id] = e), i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (i[a][s] = 1), e || (i[s][a] = 1); }), i ); }; e.scaleMatrix = function (t, e) { var n = []; return ( t.forEach(function (t) { var r = []; t.forEach(function (t) { r.push(t * e); }), n.push(r); }), n ); }; e.traverseTreeUp = function (t, e) { "function" == typeof e && (function t(e, n) { var r; if (e && e.children) for (r = e.children.length - 1; r >= 0; r--) if (!t(e.children[r], n)) return; return !!n(e); })(t, e); }; }, 221: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = function () { return (o = Object.assign || function (t) { var e, n, r; for (n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; Object.defineProperty(e, "__esModule", { value: !0 }), (e.clone = e.isObject = void 0); e.isObject = function (t) { return null !== t && "object" === i(t); }; e.clone = function (t) { var n, r; return null === t ? t : t instanceof Date ? new Date(t.getTime()) : t instanceof Array ? ((n = []), t.forEach(function (t) { n.push(t); }), n.map(function (t) { return e.clone(t); })) : "object" === i(t) && t !== {} ? ((r = o({}, t)), Object.keys(r).forEach(function (t) { r[t] = e.clone(r[t]); }), r) : t; }; }, 222: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.isFunction = void 0); e.isFunction = function (t) { return "function" == typeof t; }; }, 223: function (t, e) { (function (e) { t.exports = e; }).call(this, {}); }, 23: function (t, e, n) { "use strict"; n.d(e, "c", function () { return f; }), n.d(e, "b", function () { return d; }), n.d(e, "a", function () { return p; }); var r = n(1), i = n(31); function o(t) { return (o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var a = Math.sin, s = Math.cos, c = Math.atan2, u = Math.PI; function h(t, e, n, r, o, h, l) { var f = e.stroke, d = e.lineWidth, p = c(r - h, n - o), g = new i.Path({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: { path: "M" + 10 * s(u / 6) + "," + 10 * a(u / 6) + " L0,0 L" + 10 * s(u / 6) + ",-" + 10 * a(u / 6), stroke: f, lineWidth: d, }, }); g.translate(o, h), g.rotateAtPoint(o, h, p), t.set(l ? "startArrowShape" : "endArrowShape", g); } function l(t, e, n, o, u, h, l) { var f = e.startArrow, d = e.endArrow, p = e.stroke, g = e.lineWidth, v = l ? f : d, y = v.d, m = v.fill, b = v.stroke, x = v.lineWidth, S = Object(r.e)(v, ["d", "fill", "stroke", "lineWidth"]), w = c(o - h, n - u); y && ((u -= s(w) * y), (h -= a(w) * y)); var O = new i.Path({ type: "path", canvas: t.get("canvas"), isArrowShape: !0, attrs: Object(r.a)(Object(r.a)({}, S), { stroke: b || p, lineWidth: x || g, fill: m, }), }); O.translate(u, h), O.rotateAtPoint(u, h, w), t.set(l ? "startArrowShape" : "endArrowShape", O); } function f(t, e, n, r, i) { var o = c(r - e, n - t); return { dx: s(o) * i, dy: a(o) * i }; } function d(t, e, n, r, i, a) { "object" === o(e.startArrow) ? l(t, e, n, r, i, a, !0) : e.startArrow ? h(t, e, n, r, i, a, !0) : t.set("startArrowShape", null); } function p(t, e, n, r, i, a) { "object" === o(e.endArrow) ? l(t, e, n, r, i, a, !1) : e.endArrow ? h(t, e, n, r, i, a, !1) : t.set("startArrowShape", null); } }, 25: function (t, e, n) { "use strict"; function r(t, e) { var n = [], r = t[0], i = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( (n[0] = f * r + d * a + p * u), (n[1] = f * i + d * s + p * h), (n[2] = f * o + d * c + p * l), (n[3] = g * r + v * a + y * u), (n[4] = g * i + v * s + y * h), (n[5] = g * o + v * c + y * l), (n[6] = m * r + b * a + x * u), (n[7] = m * i + b * s + x * h), (n[8] = m * o + b * c + x * l), n ); } function i(t, e) { var n = [], r = e[0], i = e[1]; return ( (n[0] = t[0] * r + t[3] * i + t[6]), (n[1] = t[1] * r + t[4] * i + t[7]), n ); } function o(t) { var e = [], n = t[0], r = t[1], i = t[2], o = t[3], a = t[4], s = t[5], c = t[6], u = t[7], h = t[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (e[0] = l * p), (e[1] = (-h * r + i * u) * p), (e[2] = (s * r - i * a) * p), (e[3] = f * p), (e[4] = (h * n - i * c) * p), (e[5] = (-s * n + i * o) * p), (e[6] = d * p), (e[7] = (-u * n + r * c) * p), (e[8] = (a * n - r * o) * p), e) : null; } n.d(e, "b", function () { return r; }), n.d(e, "c", function () { return i; }), n.d(e, "a", function () { return o; }); }, 28: function (t, e, n) { "use strict"; n.d(e, "a", function () { return c; }), n.d(e, "b", function () { return f; }), n.d(e, "c", function () { return g; }), n.d(e, "d", function () { return w; }); var r = n(0), i = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi, o = /[^\s\,]+/gi; var a = function (t) { var e = t || []; return Object(r.isArray)(e) ? e : Object(r.isString)(e) ? ((e = e.match(i)), Object(r.each)(e, function (t, n) { if ((t = t.match(o))[0].length > 1) { var i = t[0].charAt(0); t.splice(1, 0, t[0].substr(1)), (t[0] = i); } Object(r.each)(t, function (e, n) { isNaN(e) || (t[n] = +e); }), (e[n] = t); }), e) : void 0; }, s = n(5); var c = function (t, e, n) { void 0 === e && (e = !1), void 0 === n && (n = [ [0, 0], [1, 1], ]); for (var r = !!e, i = [], o = 0, a = t.length; o < a; o += 2) i.push([t[o], t[o + 1]]); var c, u, h, l = (function (t, e, n, r) { var i, o, a, c, u, h, l, f = [], d = !!r; if (d) { (a = r[0]), (c = r[1]); for (var p = 0, g = t.length; p < g; p += 1) { var v = t[p]; (a = s.b.min([0, 0], a, v)), (c = s.b.max([0, 0], c, v)); } } p = 0; for (var y = t.length; p < y; p += 1) { v = t[p]; if (0 !== p || n) if (p !== y - 1 || n) { (i = t[[p ? p - 1 : y - 1, p - 1][n ? 0 : 1]]), (o = t[n ? (p + 1) % y : p + 1]); var m = [0, 0]; (m = s.b.sub(m, o, i)), (m = s.b.scale(m, m, e)); var b = s.b.distance(v, i), x = s.b.distance(v, o), S = b + x; 0 !== S && ((b /= S), (x /= S)); var w = s.b.scale([0, 0], m, -b), O = s.b.scale([0, 0], m, x); (h = s.b.add([0, 0], v, w)), (u = s.b.add([0, 0], v, O)), (u = s.b.min([0, 0], u, s.b.max([0, 0], o, v))), (u = s.b.max([0, 0], u, s.b.min([0, 0], o, v))), (w = s.b.sub([0, 0], u, v)), (w = s.b.scale([0, 0], w, -b / x)), (h = s.b.add([0, 0], v, w)), (h = s.b.min([0, 0], h, s.b.max([0, 0], i, v))), (h = s.b.max([0, 0], h, s.b.min([0, 0], i, v))), (O = s.b.sub([0, 0], v, h)), (O = s.b.scale([0, 0], O, x / b)), (u = s.b.add([0, 0], v, O)), d && ((h = s.b.max([0, 0], h, a)), (h = s.b.min([0, 0], h, c)), (u = s.b.max([0, 0], u, a)), (u = s.b.min([0, 0], u, c))), f.push(l), f.push(h), (l = u); } else (h = v), f.push(l), f.push(h); else l = v; } return n && f.push(f.shift()), f; })(i, 0.4, r, n), f = i.length, d = []; for (o = 0; o < f - 1; o += 1) (c = l[2 * o]), (u = l[2 * o + 1]), (h = i[o + 1]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]]); return ( r && ((c = l[f]), (u = l[f + 1]), (h = i[0]), d.push(["C", c[0], c[1], u[0], u[1], h[0], h[1]])), d ); }; var u = "\t\n\v\f\r   ᠎              \u2028\u2029", h = new RegExp( "([a-z])[" + u + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + u + "]*,?[" + u + "]*)+)", "ig", ), l = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + u + "]*,?[" + u + "]*", "ig", ); function f(t) { if (!t) return null; if (Object(r.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(h, function (t, r, i) { var o = [], a = r.toLowerCase(); if ( (i.replace(l, function (t, e) { e && o.push(+e); }), "m" === a && o.length > 2 && (n.push([r].concat(o.splice(0, 2))), (a = "l"), (r = "m" === r ? "l" : "L")), "o" === a && 1 === o.length && n.push([r, o[0]]), "r" === a) ) n.push([r].concat(o)); else for ( ; o.length >= e[a] && (n.push([r].concat(o.splice(0, e[a]))), e[a]); ); return ""; }), n ); } var d = /[a-z]/; function p(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function g(t) { var e = f(t); if (!e || !e.length) return [["M", 0, 0]]; for (var n = !1, r = 0; r < e.length; r++) { var i = e[r][0]; if (d.test(i) || ["V", "H", "T", "S"].indexOf(i) >= 0) { n = !0; break; } } if (!n) return e; var o = [], a = 0, s = 0, c = 0, u = 0, h = 0, l = e[0]; ("M" !== l[0] && "m" !== l[0]) || ((c = a = +l[1]), (u = s = +l[2]), h++, (o[0] = ["M", a, s])); r = h; for (var g = e.length; r < g; r++) { var v = e[r], y = o[r - 1], m = [], b = (i = v[0]).toUpperCase(); if (i !== b) switch (((m[0] = b), b)) { case "A": (m[1] = v[1]), (m[2] = v[2]), (m[3] = v[3]), (m[4] = v[4]), (m[5] = v[5]), (m[6] = +v[6] + a), (m[7] = +v[7] + s); break; case "V": m[1] = +v[1] + s; break; case "H": m[1] = +v[1] + a; break; case "M": (c = +v[1] + a), (u = +v[2] + s), (m[1] = c), (m[2] = u); break; default: for (var x = 1, S = v.length; x < S; x++) m[x] = +v[x] + (x % 2 ? a : s); } else m = e[r]; switch (b) { case "Z": (a = +c), (s = +u); break; case "H": m = ["L", (a = m[1]), s]; break; case "V": m = ["L", a, (s = m[1])]; break; case "T": (a = m[1]), (s = m[2]); var w = p([y[1], y[2]], [y[3], y[4]]); m = ["Q", w[0], w[1], a, s]; break; case "S": (a = m[m.length - 2]), (s = m[m.length - 1]); var O = y.length, M = p([y[O - 4], y[O - 3]], [y[O - 2], y[O - 1]]); m = ["C", M[0], M[1], m[1], m[2], a, s]; break; case "M": (c = m[m.length - 2]), (u = m[m.length - 1]); break; default: (a = m[m.length - 2]), (s = m[m.length - 1]); } o.push(m); } return o; } Math.PI; function v(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function y(t, e) { return v(t) * v(e) ? (t[0] * e[0] + t[1] * e[1]) / (v(t) * v(e)) : 1; } function m(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(y(t, e)); } function b(t, e) { return t[0] === e[0] && t[1] === e[1]; } function x(t, e) { var n = e[1], i = e[2], o = Object(r.mod)(Object(r.toRadian)(e[3]), 2 * Math.PI), a = e[4], s = e[5], c = t[0], u = t[1], h = e[6], l = e[7], f = (Math.cos(o) * (c - h)) / 2 + (Math.sin(o) * (u - l)) / 2, d = (-1 * Math.sin(o) * (c - h)) / 2 + (Math.cos(o) * (u - l)) / 2, p = (f * f) / (n * n) + (d * d) / (i * i); p > 1 && ((n *= Math.sqrt(p)), (i *= Math.sqrt(p))); var g = n * n * (d * d) + i * i * (f * f), v = g ? Math.sqrt((n * n * (i * i) - g) / g) : 1; a === s && (v *= -1), isNaN(v) && (v = 0); var x = i ? (v * n * d) / i : 0, S = n ? (v * -i * f) / n : 0, w = (c + h) / 2 + Math.cos(o) * x - Math.sin(o) * S, O = (u + l) / 2 + Math.sin(o) * x + Math.cos(o) * S, M = [(f - x) / n, (d - S) / i], k = [(-1 * f - x) / n, (-1 * d - S) / i], j = m([1, 0], M), C = m(M, k); return ( y(M, k) <= -1 && (C = Math.PI), y(M, k) >= 1 && (C = 0), 0 === s && C > 0 && (C -= 2 * Math.PI), 1 === s && C < 0 && (C += 2 * Math.PI), { cx: w, cy: O, rx: b(t, [h, l]) ? 0 : n, ry: b(t, [h, l]) ? 0 : i, startAngle: j, endAngle: j + C, xRotation: o, arcFlag: a, sweepFlag: s, } ); } function S(t, e) { return [e[0] + (e[0] - t[0]), e[1] + (e[1] - t[1])]; } function w(t) { for ( var e = [], n = null, r = null, i = null, o = 0, s = (t = a(t)).length, c = 0; c < s; c++ ) { var u = t[c]; r = t[c + 1]; var h = u[0], l = { command: h, prePoint: n, params: u, startTangent: null, endTangent: null, }; switch (h) { case "M": (i = [u[1], u[2]]), (o = c); break; case "A": var f = x(n, u); l.arcParams = f; } if ("Z" === h) (n = i), (r = t[o + 1]); else { var d = u.length; n = [u[d - 2], u[d - 1]]; } r && "Z" === r[0] && ((r = t[o]), e[o] && (e[o].prePoint = n)), (l.currentPoint = n), e[o] && b(n, e[o].currentPoint) && (e[o].prePoint = l.prePoint); var p = r ? [r[r.length - 2], r[r.length - 1]] : null; l.nextPoint = p; var g = l.prePoint; if (["L", "H", "V"].includes(h)) (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]]); else if ("Q" === h) { var v = [u[1], u[2]]; (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]]); } else if ("T" === h) { v = S((w = e[c - 1]).currentPoint, g); "Q" === w.command ? ((l.command = "Q"), (l.startTangent = [g[0] - v[0], g[1] - v[1]]), (l.endTangent = [n[0] - v[0], n[1] - v[1]])) : ((l.command = "TL"), (l.startTangent = [g[0] - n[0], g[1] - n[1]]), (l.endTangent = [n[0] - g[0], n[1] - g[1]])); } else if ("C" === h) { var y = [u[1], u[2]], m = [u[3], u[4]]; (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]]), 0 === l.startTangent[0] && 0 === l.startTangent[1] && (l.startTangent = [y[0] - m[0], y[1] - m[1]]), 0 === l.endTangent[0] && 0 === l.endTangent[1] && (l.endTangent = [m[0] - y[0], m[1] - y[1]]); } else if ("S" === h) { var w; (y = S((w = e[c - 1]).currentPoint, g)), (m = [u[1], u[2]]); "C" === w.command ? ((l.command = "C"), (l.startTangent = [g[0] - y[0], g[1] - y[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])) : ((l.command = "SQ"), (l.startTangent = [g[0] - m[0], g[1] - m[1]]), (l.endTangent = [n[0] - m[0], n[1] - m[1]])); } else if ("A" === h) { var O = 0.001, M = l.arcParams || {}, k = M.cx, j = void 0 === k ? 0 : k, C = M.cy, E = void 0 === C ? 0 : C, P = M.rx, A = void 0 === P ? 0 : P, I = M.ry, T = void 0 === I ? 0 : I, N = M.sweepFlag, B = void 0 === N ? 0 : N, L = M.startAngle, D = void 0 === L ? 0 : L, _ = M.endAngle, R = void 0 === _ ? 0 : _; 0 === B && (O *= -1); var F = A * Math.cos(D - O) + j, Y = T * Math.sin(D - O) + E; l.startTangent = [F - i[0], Y - i[1]]; var X = A * Math.cos(D + R + O) + j, z = T * Math.sin(D + R - O) + E; l.endTangent = [g[0] - X, g[1] - z]; } e.push(l); } return e; } }, 3: function (t, e, n) { "use strict"; n.d(e, "c", function () { return o; }), n.d(e, "a", function () { return a; }), n.d(e, "d", function () { return s; }), n.d(e, "e", function () { return c; }), n.d(e, "l", function () { return u; }), n.d(e, "j", function () { return h; }), n.d(e, "i", function () { return l; }); var r = n(0); n.d(e, "h", function () { return r.isNil; }), n.d(e, "k", function () { return r.isString; }), n.d(e, "g", function () { return r.isFunction; }), n.d(e, "f", function () { return r.isArray; }), n.d(e, "b", function () { return r.each; }), n.d(e, "n", function () { return r.toRadian; }), n.d(e, "m", function () { return r.mod; }); n(40); function i(t) { return (i = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function o() { return "object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.devicePixelRatio ? window.devicePixelRatio : 1; } function a(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function s(t, e, n, r, i, o) { return i >= t && i <= t + n && o >= e && o <= e + r; } function c(t, e) { return !( e.minX > t.maxX || e.maxX < t.minX || e.minY > t.maxY || e.maxY < t.minY ); } function u(t, e) { return t && e ? { minX: Math.min(t.minX, e.minX), minY: Math.min(t.minY, e.minY), maxX: Math.max(t.maxX, e.maxX), maxY: Math.max(t.maxY, e.maxY), } : t || e; } function h(t, e) { return t[0] === e[0] && t[1] === e[1]; } function l(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } }, 31: function (t, e, n) { "use strict"; n.r(e), n.d(e, "Base", function () { return r.a; }), n.d(e, "Circle", function () { return a; }), n.d(e, "Ellipse", function () { return c; }), n.d(e, "Image", function () { return u.a; }), n.d(e, "Line", function () { return d; }), n.d(e, "Marker", function () { return m; }), n.d(e, "Path", function () { return P; }), n.d(e, "Polygon", function () { return I; }), n.d(e, "Polyline", function () { return T; }), n.d(e, "Rect", function () { return B; }), n.d(e, "Text", function () { return L; }); var r = n(11), i = n(1), o = n(3), a = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, r: 0 }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var a = this.attr(), s = a.x, c = a.y, u = a.r, h = i / 2, l = Object(o.a)(s, c, t, e); return r && n ? l <= u + h : r ? l <= u : !!n && l >= u - h && l <= u + h; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.r; t.beginPath(), t.arc(n, r, i, 0, 2 * Math.PI, !1), t.closePath(); }), e ); })(r.a); function s(t, e, n, r) { return t / (n * n) + e / (r * r); } var c = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, rx: 0, ry: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr(), a = i / 2, c = o.x, u = o.y, h = o.rx, l = o.ry, f = (t - c) * (t - c), d = (e - u) * (e - u); return r && n ? s(f, d, h + a, l + a) <= 1 : r ? s(f, d, h, l) <= 1 : !!n && s(f, d, h - a, l - a) >= 1 && s(f, d, h + a, l + a) <= 1; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.rx, o = e.ry; if ((t.beginPath(), t.ellipse)) t.ellipse(n, r, i, o, 0, 0, 2 * Math.PI, !1); else { var a = i > o ? i : o, s = i > o ? 1 : i / o, c = i > o ? o / i : 1; t.save(), t.translate(n, r), t.scale(s, c), t.arc(0, 0, a, 0, 2 * Math.PI), t.restore(), t.closePath(); } }), e ); })(r.a), u = n(89), h = n(9); function l(t, e, n, r, i, o, a) { var s = Math.min(t, n), c = Math.max(t, n), u = Math.min(e, r), l = Math.max(e, r), f = i / 2; return ( o >= s - f && o <= c + f && a >= u - f && a <= l + f && h.c.pointToLine(t, e, n, r, o, a) <= i / 2 ); } var f = n(23), d = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x1: 0, y1: 0, x2: 0, y2: 0, startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(); }), (e.prototype.setArrow = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2, o = t.startArrow, a = t.endArrow; o && f.b(this, t, r, i, e, n), a && f.a(this, t, e, n, r, i); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { if (!n || !i) return !1; var o = this.attr(); return l(o.x1, o.y1, o.x2, o.y2, i, t, e); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2, a = e.startArrow, s = e.endArrow, c = { dx: 0, dy: 0 }, u = { dx: 0, dy: 0 }; a && a.d && (c = f.c(n, r, i, o, e.startArrow.d)), s && s.d && (u = f.c(n, r, i, o, e.endArrow.d)), t.beginPath(), t.moveTo(n + c.dx, r + c.dy), t.lineTo(i - u.dx, o - u.dy); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr(), e = t.x1, n = t.y1, r = t.x2, i = t.y2; return h.c.length(e, n, r, i); }), (e.prototype.getPoint = function (t) { var e = this.attr(), n = e.x1, r = e.y1, i = e.x2, o = e.y2; return h.c.pointAt(n, r, i, o, t); }), e ); })(r.a), p = n(0), g = n(28), v = n(12), y = { circle: function (t, e, n) { return [ ["M", t - n, e], ["A", n, n, 0, 1, 0, t + n, e], ["A", n, n, 0, 1, 0, t - n, e], ]; }, square: function (t, e, n) { return [ ["M", t - n, e - n], ["L", t + n, e - n], ["L", t + n, e + n], ["L", t - n, e + n], ["Z"], ]; }, diamond: function (t, e, n) { return [ ["M", t - n, e], ["L", t, e - n], ["L", t + n, e], ["L", t, e + n], ["Z"], ]; }, triangle: function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e + r], ["L", t, e - r], ["L", t + n, e + r], ["Z"], ]; }, "triangle-down": function (t, e, n) { var r = n * Math.sin((1 / 3) * Math.PI); return [ ["M", t - n, e - r], ["L", t + n, e - r], ["L", t, e + r], ["Z"], ]; }, }, m = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.initAttrs = function (t) { this._resetParamsCache(); }), (e.prototype._resetParamsCache = function () { this.set("paramsCache", {}); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), -1 !== ["symbol", "x", "y", "r", "radius"].indexOf(e) && this._resetParamsCache(); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._getR = function (t) { return Object(p.isNil)(t.r) ? t.radius : t.r; }), (e.prototype._getPath = function () { var t, n, r = this.attr(), i = r.x, a = r.y, s = r.symbol || "circle", c = this._getR(r); if (Object(o.g)(s)) (n = (t = s)(i, a, c)), (n = Object(g.c)(n)); else { if (!(t = e.Symbols[s])) return console.warn(s + " marker is not supported."), null; n = t(i, a, c); } return n; }), (e.prototype.createPath = function (t) { var e = this._getPath(), n = this.get("paramsCache"); Object(v.e)(this, t, { path: e }, n); }), (e.Symbols = y), e ); })(r.a); function b(t) { return Math.abs(t) < 1e-6 ? 0 : t < 0 ? -1 : 1; } function x(t, e, n) { return ( (n[0] - t[0]) * (e[1] - t[1]) == (e[0] - t[0]) * (n[1] - t[1]) && Math.min(t[0], e[0]) <= n[0] && n[0] <= Math.max(t[0], e[0]) && Math.min(t[1], e[1]) <= n[1] && n[1] <= Math.max(t[1], e[1]) ); } function S(t, e, n) { var r = !1, i = t.length; if (i <= 2) return !1; for (var o = 0; o < i; o++) { var a = t[o], s = t[(o + 1) % i]; if (x(a, s, [e, n])) return !0; b(a[1] - n) > 0 != b(s[1] - n) > 0 && b(e - ((n - a[1]) * (a[0] - s[0])) / (a[1] - s[1]) - a[0]) < 0 && (r = !r); } return r; } var w = n(8), O = n(4), M = n(85); function k(t, e, n, r, i, a, s, c) { var u = (Math.atan2(c - e, s - t) + 2 * Math.PI) % (2 * Math.PI); if (u < r || u > i) return !1; var h = { x: t + n * Math.cos(u), y: e + n * Math.sin(u) }; return Object(o.a)(h.x, h.y, s, c) <= a / 2; } var j = O.a.transform; var C = Object(i.a)( { hasArc: function (t) { for (var e = !1, n = t.length, r = 0; r < n; r++) { var i = t[r][0]; if ("C" === i || "A" === i || "Q" === i) { e = !0; break; } } return e; }, extractPolygons: function (t) { for (var e = t.length, n = [], r = [], i = [], o = 0; o < e; o++) { var a = t[o], s = a[0]; "M" === s ? (i.length && (r.push(i), (i = [])), i.push([a[1], a[2]])) : "Z" === s ? i.length && (n.push(i), (i = [])) : i.push([a[1], a[2]]); } return i.length > 0 && r.push(i), { polygons: n, polylines: r }; }, isPointInStroke: function (t, e, n, r, i) { for (var a = !1, s = e / 2, c = 0; c < t.length; c++) { var u = t[c], f = u.currentPoint, d = u.params, p = u.prePoint, g = u.box; if ( !g || Object(o.d)(g.x - s, g.y - s, g.width + e, g.height + e, n, r) ) { switch (u.command) { case "L": case "Z": a = l(p[0], p[1], f[0], f[1], e, n, r); break; case "Q": a = h.e.pointDistance( p[0], p[1], d[1], d[2], d[3], d[4], n, r, ) <= e / 2; break; case "C": a = h.b.pointDistance( p[0], p[1], d[1], d[2], d[3], d[4], d[5], d[6], n, r, i, ) <= e / 2; break; case "A": var v = u.arcParams, y = v.cx, m = v.cy, b = v.rx, x = v.ry, S = v.startAngle, w = v.endAngle, O = v.xRotation, C = [n, r, 1], E = b > x ? b : x, P = j(null, [ ["t", -y, -m], ["r", -O], ["s", 1 / (b > x ? 1 : b / x), 1 / (b > x ? x / b : 1)], ]); M.transformMat3(C, C, P), (a = k(0, 0, E, S, w, e, C[0], C[1])); } if (a) break; } } return a; }, }, w.PathUtil, ); function E(t, e, n) { for (var r = !1, i = 0; i < t.length; i++) { if ((r = S(t[i], e, n))) break; } return r; } var P = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this._setPathArr(t.path), this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "path" === e && this._setPathArr(n), this.setArrow(); }), (e.prototype._setPathArr = function (t) { this.attrs.path = Object(g.c)(t); var e = C.hasArc(t); this.set("hasArc", e), this.set("paramsCache", {}), this.set("segments", null), this.set("curve", null), this.set("tCache", null), this.set("totalLength", null); }), (e.prototype.getSegments = function () { var t = this.get("segements"); return ( t || ((t = Object(g.d)(this.attr("path"))), this.set("segments", t)), t ); }), (e.prototype.setArrow = function () { var t = this.attr(), e = t.startArrow, n = t.endArrow; if (e) { var r = this.getStartTangent(); f.b(this, t, r[0][0], r[0][1], r[1][0], r[1][1]); } if (n) { r = this.getEndTangent(); f.a(this, t, r[0][0], r[0][1], r[1][0], r[1][1]); } }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.getSegments(), a = (this.get("hasArc"), !1); if (n) { var s = this.getTotalLength(); a = C.isPointInStroke(o, i, t, e, s); } if (!a && r) { var c = this.attr("path"), u = C.extractPolygons(c); a = E(u.polygons, t, e) || E(u.polylines, t, e); } return a; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = this.get("paramsCache"); Object(v.e)(this, t, e, n); }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.get("totalLength"); return Object(p.isNil)(t) ? (this._calculateCurve(), this._setTcache(), this.get("totalLength")) : t; }), (e.prototype.getPoint = function (t) { var e, n, r = this.get("tCache"); r || (this._calculateCurve(), this._setTcache(), (r = this.get("tCache"))); var i = this.get("curve"); if (!r || 0 === r.length) return i ? { x: i[0][1], y: i[0][2] } : null; Object(p.each)(r, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }); var o = i[n]; if (Object(p.isNil)(o) || Object(p.isNil)(n)) return null; var a = o.length, s = i[n + 1]; return h.b.pointAt( o[a - 2], o[a - 1], s[1], s[2], s[3], s[4], s[5], s[6], e, ); }), (e.prototype._calculateCurve = function () { var t = this.attr().path; this.set("curve", C.pathToCurve(t)); }), (e.prototype._setTcache = function () { var t, e, n, r, i = 0, o = 0, a = [], s = this.get("curve"); s && (Object(p.each)(s, function (t, e) { (n = s[e + 1]), (r = t.length), n && (i += h.b.length( t[r - 2], t[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], ) || 0); }), this.set("totalLength", i), 0 !== i ? (Object(p.each)(s, function (c, u) { (n = s[u + 1]), (r = c.length), n && (((t = [])[0] = o / i), (e = h.b.length( c[r - 2], c[r - 1], n[1], n[2], n[3], n[4], n[5], n[6], )), (o += e || 0), (t[1] = o / i), a.push(t)); }), this.set("tCache", a)) : this.set("tCache", [])); }), (e.prototype.getStartTangent = function () { var t, e = this.getSegments(); if (e.length > 1) { var n = e[0].currentPoint, r = e[1].currentPoint, i = e[1].startTangent; (t = []), i ? (t.push([n[0] - i[0], n[1] - i[1]]), t.push([n[0], n[1]])) : (t.push([r[0], r[1]]), t.push([n[0], n[1]])); } return t; }), (e.prototype.getEndTangent = function () { var t, e = this.getSegments(), n = e.length; if (n > 1) { var r = e[n - 2].currentPoint, i = e[n - 1].currentPoint, o = e[n - 1].endTangent; (t = []), o ? (t.push([i[0] - o[0], i[1] - o[1]]), t.push([i[0], i[1]])) : (t.push([r[0], r[1]]), t.push([i[0], i[1]])); } return t; }), e ); })(r.a); function A(t, e, n, r, i) { var o = t.length; if (o < 2) return !1; for (var a = 0; a < o - 1; a++) { if (l(t[a][0], t[a][1], t[a + 1][0], t[a + 1][1], e, n, r)) return !0; } if (i) { var s = t[0], c = t[o - 1]; if (l(s[0], s[1], c[0], c[1], e, n, r)) return !0; } return !1; } var I = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var o = this.attr().points, a = !1; return ( n && (a = A(o, i, t, e, !0)), !a && r && (a = S(o, t, e)), a ); }), (e.prototype.createPath = function (t) { var e = this.attr().points; if (!(e.length < 2)) { t.beginPath(); for (var n = 0; n < e.length; n++) { var r = e[n]; 0 === n ? t.moveTo(r[0], r[1]) : t.lineTo(r[0], r[1]); } t.closePath(); } }), e ); })(r.a), T = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { startArrow: !1, endArrow: !1, }); }), (e.prototype.initAttrs = function (t) { this.setArrow(); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), this.setArrow(), -1 !== ["points"].indexOf(e) && this._resetCache(); }), (e.prototype._resetCache = function () { this.set("totalLength", null), this.set("tCache", null); }), (e.prototype.setArrow = function () { var t = this.attr(), e = this.attrs, n = e.points, r = e.startArrow, i = e.endArrow, o = n.length, a = n[0][0], s = n[0][1], c = n[o - 1][0], u = n[o - 1][1]; r && f.b(this, t, n[1][0], n[1][1], a, s), i && f.a(this, t, n[o - 2][0], n[o - 2][1], c, u); }), (e.prototype.isFill = function () { return !1; }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { return !(!n || !i) && A(this.attr().points, i, t, e, !1); }), (e.prototype.isStroke = function () { return !0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.points, r = e.startArrow, i = e.endArrow, o = n.length; if (!(n.length < 2)) { var a, s = n[0][0], c = n[0][1], u = n[o - 1][0], h = n[o - 1][1]; if (r && r.d) (s += (a = f.c(s, c, n[1][0], n[1][1], r.d)).dx), (c += a.dy); if (i && i.d) (u -= (a = f.c(n[o - 2][0], n[o - 2][1], u, h, i.d)).dx), (h -= a.dy); t.beginPath(), t.moveTo(s, c); for (var l = 0; l < o - 1; l++) { var d = n[l]; t.lineTo(d[0], d[1]); } t.lineTo(u, h); } }), (e.prototype.afterDrawPath = function (t) { var e = this.get("startArrowShape"), n = this.get("endArrowShape"); e && e.draw(t), n && n.draw(t); }), (e.prototype.getTotalLength = function () { var t = this.attr().points, e = this.get("totalLength"); return Object(p.isNil)(e) ? (this.set("totalLength", h.d.length(t)), this.get("totalLength")) : e; }), (e.prototype.getPoint = function (t) { var e, n, r = this.attr().points, i = this.get("tCache"); return ( i || (this._setTcache(), (i = this.get("tCache"))), Object(p.each)(i, function (r, i) { t >= r[0] && t <= r[1] && ((e = (t - r[0]) / (r[1] - r[0])), (n = i)); }), h.c.pointAt(r[n][0], r[n][1], r[n + 1][0], r[n + 1][1], e) ); }), (e.prototype._setTcache = function () { var t = this.attr().points; if (t && 0 !== t.length) { var e = this.getTotalLength(); if (!(e <= 0)) { var n, r, i = 0, o = []; Object(p.each)(t, function (a, s) { t[s + 1] && (((n = [])[0] = i / e), (r = h.c.length(a[0], a[1], t[s + 1][0], t[s + 1][1])), (i += r), (n[1] = i / e), o.push(n)); }), this.set("tCache", o); } } }), (e.prototype.getStartTangent = function () { var t = this.attr().points, e = []; return e.push([t[1][0], t[1][1]]), e.push([t[0][0], t[0][1]]), e; }), (e.prototype.getEndTangent = function () { var t = this.attr().points, e = t.length - 1, n = []; return ( n.push([t[e - 1][0], t[e - 1][1]]), n.push([t[e][0], t[e][1]]), n ); }), e ); })(r.a), N = n(94); var B = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, width: 0, height: 0, radius: 0, }); }), (e.prototype.isInStrokeOrPath = function (t, e, n, r, i) { var a = this.attr(), s = a.x, c = a.y, u = a.width, h = a.height, f = a.radius; if (f) { var d = !1; return ( n && (d = (function (t, e, n, r, i, o, a, s) { return ( l(t + i, e, t + n - i, e, o, a, s) || l(t + n, e + i, t + n, e + r - i, o, a, s) || l(t + n - i, e + r, t + i, e + r, o, a, s) || l(t, e + r - i, t, e + i, o, a, s) || k( t + n - i, e + i, i, 1.5 * Math.PI, 2 * Math.PI, o, a, s, ) || k(t + n - i, e + r - i, i, 0, 0.5 * Math.PI, o, a, s) || k( t + i, e + r - i, i, 0.5 * Math.PI, Math.PI, o, a, s, ) || k(t + i, e + i, i, Math.PI, 1.5 * Math.PI, o, a, s) ); })(s, c, u, h, f, i, t, e)), !d && r && (d = Object(o.d)(s, c, u, h, t, e)), d ); } var p = i / 2; return r && n ? Object(o.d)(s - p, c - p, u + p, h + p, t, e) : r ? Object(o.d)(s, c, u, h, t, e) : n ? (function (t, e, n, r, i, a, s) { var c = i / 2; return ( Object(o.d)(t - c, e - c, n, i, a, s) || Object(o.d)(t + n - c, e - c, i, r, a, s) || Object(o.d)(t + c, e + r - c, n, i, a, s) || Object(o.d)(t - c, e + c, i, r, a, s) ); })(s, c, u, h, i, t, e) : void 0; }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.x, r = e.y, i = e.width, o = e.height, a = e.radius; if ((t.beginPath(), 0 === a)) t.rect(n, r, i, o); else { var s = Object(N.a)(a), c = s[0], u = s[1], h = s[2], l = s[3]; t.moveTo(n + c, r), t.lineTo(n + i - u, r), 0 !== u && t.arc(n + i - u, r + u, u, -Math.PI / 2, 0), t.lineTo(n + i, r + o - h), 0 !== h && t.arc(n + i - h, r + o - h, h, 0, Math.PI / 2), t.lineTo(n + l, r + o), 0 !== l && t.arc(n + l, r + o - l, l, Math.PI / 2, Math.PI), t.lineTo(n, r + c), 0 !== c && t.arc(n + c, r + c, c, Math.PI, 1.5 * Math.PI), t.closePath(); } }), e ); })(r.a), L = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(i.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(i.a)(Object(i.a)({}, e), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: "sans-serif", fontStyle: "normal", fontWeight: "normal", fontVariant: "normal", textAlign: "start", textBaseline: "bottom", }); }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype.initAttrs = function (t) { this._assembleFont(), t.text && this._setText(t.text); }), (e.prototype._assembleFont = function () { var t = this.attrs; t.font = Object(w.assembleFont)(t); }), (e.prototype._setText = function (t) { var e = null; Object(o.k)(t) && -1 !== t.indexOf("\n") && (e = t.split("\n")), this.set("textArr", e); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), e.startsWith("font") && this._assembleFont(), "text" === e && this._setText(n); }), (e.prototype._getSpaceingY = function () { var t = this.attrs, e = t.lineHeight, n = 1 * t.fontSize; return e ? e - n : 0.14 * n; }), (e.prototype._drawTextArr = function (t, e, n) { var r, i = this.attrs, a = i.textBaseline, s = i.x, c = i.y, u = 1 * i.fontSize, h = this._getSpaceingY(), l = Object(w.getTextHeight)(i.text, i.fontSize, i.lineHeight); Object(o.b)(e, function (e, i) { (r = c + i * (h + u) - l + u), "middle" === a && (r += l - u - (l - u) / 2), "top" === a && (r += l - u), n ? t.fillText(e, s, r) : t.strokeText(e, s, r); }); }), (e.prototype._drawText = function (t, e) { var n = this.attr(), r = n.x, i = n.y, o = this.get("textArr"); if (o) this._drawTextArr(t, o, e); else { var a = n.text; e ? t.fillText(a, r, i) : t.strokeText(a, r, i); } }), (e.prototype.strokeAndFill = function (t) { var e = this.attrs, n = e.lineWidth, r = e.opacity, i = e.strokeOpacity, a = e.fillOpacity; this.isStroke() && n > 0 && (Object(o.h)(i) || 1 === i || (t.globalAlpha = r), this.stroke(t)), this.isFill() && (Object(o.h)(a) || 1 === a ? this.fill(t) : ((t.globalAlpha = a), this.fill(t), (t.globalAlpha = r))), this.afterDrawPath(t); }), (e.prototype.fill = function (t) { this._drawText(t, !0); }), (e.prototype.stroke = function (t) { this._drawText(t, !1); }), e ); })(r.a); }, 33: function (t, e, n) { "use strict"; var r = n(99); n.d(e, "a", function () { return r.Layout; }), n.d(e, "b", function () { return r.Layouts; }); var i = n(62); n.d(e, "c", function () { return i.registerLayout; }), n.d(e, "d", function () { return i.unRegisterLayout; }); var o = n(64); Object(i.registerLayout)("random", o.RandomLayout); }, 34: function (t, e, n) { "use strict"; n.r(e), n.d(e, "catmullRomToBezier", function () { return c; }), n.d(e, "fillPath", function () { return A; }), n.d(e, "fillPathByDiff", function () { return N; }), n.d(e, "formatPath", function () { return D; }), n.d(e, "intersection", function () { return C; }), n.d(e, "parsePathArray", function () { return v; }), n.d(e, "parsePathString", function () { return s; }), n.d(e, "pathToAbsolute", function () { return h; }), n.d(e, "pathToCurve", function () { return p; }), n.d(e, "rectPath", function () { return w; }); var r = n(0), i = "\t\n\v\f\r   ᠎              \u2028\u2029", o = new RegExp( "([a-z])[" + i + ",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[" + i + "]*,?[" + i + "]*)+)", "ig", ), a = new RegExp( "(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[" + i + "]*,?[" + i + "]*", "ig", ), s = function (t) { if (!t) return null; if (Object(r.isArray)(t)) return t; var e = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0, }, n = []; return ( String(t).replace(o, function (r, i, o) { var s = [], c = i.toLowerCase(); if ( (o.replace(a, function (t, e) { e && s.push(+e); }), "m" === c && s.length > 2 && (n.push([i].concat(s.splice(0, 2))), (c = "l"), (i = "m" === i ? "l" : "L")), "o" === c && 1 === s.length && n.push([i, s[0]]), "r" === c) ) n.push([i].concat(s)); else for ( ; s.length >= e[c] && (n.push([i].concat(s.splice(0, e[c]))), e[c]); ); return t; }), n ); }, c = function (t, e) { for (var n = [], r = 0, i = t.length; i - 2 * !e > r; r += 2) { var o = [ { x: +t[r - 2], y: +t[r - 1] }, { x: +t[r], y: +t[r + 1] }, { x: +t[r + 2], y: +t[r + 3] }, { x: +t[r + 4], y: +t[r + 5] }, ]; e ? r ? i - 4 === r ? (o[3] = { x: +t[0], y: +t[1] }) : i - 2 === r && ((o[2] = { x: +t[0], y: +t[1] }), (o[3] = { x: +t[2], y: +t[3] })) : (o[0] = { x: +t[i - 2], y: +t[i - 1] }) : i - 4 === r ? (o[3] = o[2]) : r || (o[0] = { x: +t[r], y: +t[r + 1] }), n.push([ "C", (-o[0].x + 6 * o[1].x + o[2].x) / 6, (-o[0].y + 6 * o[1].y + o[2].y) / 6, (o[1].x + 6 * o[2].x - o[3].x) / 6, (o[1].y + 6 * o[2].y - o[3].y) / 6, o[2].x, o[2].y, ]); } return n; }, u = function (t, e, n, r, i) { var o = []; if ( (null === i && null === r && (r = n), (t = +t), (e = +e), (n = +n), (r = +r), null !== i) ) { var a = Math.PI / 180, s = t + n * Math.cos(-r * a), c = t + n * Math.cos(-i * a); o = [ ["M", s, e + n * Math.sin(-r * a)], ["A", n, n, 0, +(i - r > 180), 0, c, e + n * Math.sin(-i * a)], ]; } else o = [ ["M", t, e], ["m", 0, -r], ["a", n, r, 0, 1, 1, 0, 2 * r], ["a", n, r, 0, 1, 1, 0, -2 * r], ["z"], ]; return o; }, h = function (t) { if (!(t = s(t)) || !t.length) return [["M", 0, 0]]; var e, n, r = [], i = 0, o = 0, a = 0, h = 0, l = 0; "M" === t[0][0] && ((a = i = +t[0][1]), (h = o = +t[0][2]), l++, (r[0] = ["M", i, o])); for ( var f = 3 === t.length && "M" === t[0][0] && "R" === t[1][0].toUpperCase() && "Z" === t[2][0].toUpperCase(), d = void 0, p = void 0, g = l, v = t.length; g < v; g++ ) { if ((r.push((d = [])), (e = (p = t[g])[0]) !== e.toUpperCase())) switch (((d[0] = e.toUpperCase()), d[0])) { case "A": (d[1] = p[1]), (d[2] = p[2]), (d[3] = p[3]), (d[4] = p[4]), (d[5] = p[5]), (d[6] = +p[6] + i), (d[7] = +p[7] + o); break; case "V": d[1] = +p[1] + o; break; case "H": d[1] = +p[1] + i; break; case "R": for ( var y = 2, m = (n = [i, o].concat(p.slice(1))).length; y < m; y++ ) (n[y] = +n[y] + i), (n[++y] = +n[y] + o); r.pop(), (r = r.concat(c(n, f))); break; case "O": r.pop(), (n = u(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); break; case "U": r.pop(), (r = r.concat(u(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); break; case "M": (a = +p[1] + i), (h = +p[2] + o); break; default: for (y = 1, m = p.length; y < m; y++) d[y] = +p[y] + (y % 2 ? i : o); } else if ("R" === e) (n = [i, o].concat(p.slice(1))), r.pop(), (r = r.concat(c(n, f))), (d = ["R"].concat(p.slice(-2))); else if ("O" === e) r.pop(), (n = u(i, o, p[1], p[2])).push(n[0]), (r = r.concat(n)); else if ("U" === e) r.pop(), (r = r.concat(u(i, o, p[1], p[2], p[3]))), (d = ["U"].concat(r[r.length - 1].slice(-2))); else for (var b = 0, x = p.length; b < x; b++) d[b] = p[b]; if ("O" !== (e = e.toUpperCase())) switch (d[0]) { case "Z": (i = +a), (o = +h); break; case "H": i = d[1]; break; case "V": o = d[1]; break; case "M": (a = d[d.length - 2]), (h = d[d.length - 1]); break; default: (i = d[d.length - 2]), (o = d[d.length - 1]); } } return r; }, l = function (t, e, n, r) { return [t, e, n, r, n, r]; }, f = function (t, e, n, r, i, o) { return [ (1 / 3) * t + (2 / 3) * n, (1 / 3) * e + (2 / 3) * r, (1 / 3) * i + (2 / 3) * n, (1 / 3) * o + (2 / 3) * r, i, o, ]; }, d = function t(e, n, r, i, o, a, s, c, u, h) { r === i && (r += 1); var l, f, d, p, g, v = (120 * Math.PI) / 180, y = (Math.PI / 180) * (+o || 0), m = [], b = function (t, e, n) { return { x: t * Math.cos(n) - e * Math.sin(n), y: t * Math.sin(n) + e * Math.cos(n), }; }; if (h) (f = h[0]), (d = h[1]), (p = h[2]), (g = h[3]); else { (e = (l = b(e, n, -y)).x), (n = l.y), (c = (l = b(c, u, -y)).x), (u = l.y), e === c && n === u && ((c += 1), (u += 1)); var x = (e - c) / 2, S = (n - u) / 2, w = (x * x) / (r * r) + (S * S) / (i * i); w > 1 && ((r *= w = Math.sqrt(w)), (i *= w)); var O = r * r, M = i * i, k = (a === s ? -1 : 1) * Math.sqrt( Math.abs( (O * M - O * S * S - M * x * x) / (O * S * S + M * x * x), ), ); (p = (k * r * S) / i + (e + c) / 2), (g = (k * -i * x) / r + (n + u) / 2), (f = Math.asin(((n - g) / i).toFixed(9))), (d = Math.asin(((u - g) / i).toFixed(9))), (f = e < p ? Math.PI - f : f), (d = c < p ? Math.PI - d : d), f < 0 && (f = 2 * Math.PI + f), d < 0 && (d = 2 * Math.PI + d), s && f > d && (f -= 2 * Math.PI), !s && d > f && (d -= 2 * Math.PI); } var j = d - f; if (Math.abs(j) > v) { var C = d, E = c, P = u; (d = f + v * (s && d > f ? 1 : -1)), (m = t( (c = p + r * Math.cos(d)), (u = g + i * Math.sin(d)), r, i, o, 0, s, E, P, [d, C, p, g], )); } j = d - f; var A = Math.cos(f), I = Math.sin(f), T = Math.cos(d), N = Math.sin(d), B = Math.tan(j / 4), L = (4 / 3) * r * B, D = (4 / 3) * i * B, _ = [e, n], R = [e + L * I, n - D * A], F = [c + L * N, u - D * T], Y = [c, u]; if (((R[0] = 2 * _[0] - R[0]), (R[1] = 2 * _[1] - R[1]), h)) return [R, F, Y].concat(m); for ( var X = [], z = 0, W = (m = [R, F, Y].concat(m).join().split(",")).length; z < W; z++ ) X[z] = z % 2 ? b(m[z - 1], m[z], y).y : b(m[z], m[z + 1], y).x; return X; }, p = function (t, e) { var n, r = h(t), i = e && h(e), o = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, a = { x: 0, y: 0, bx: 0, by: 0, X: 0, Y: 0, qx: null, qy: null }, s = [], c = [], u = "", p = "", g = function (t, e, n) { var r, i; if (!t) return ["C", e.x, e.y, e.x, e.y, e.x, e.y]; switch ( (!(t[0] in { T: 1, Q: 1 }) && (e.qx = e.qy = null), t[0]) ) { case "M": (e.X = t[1]), (e.Y = t[2]); break; case "A": t = ["C"].concat(d.apply(0, [e.x, e.y].concat(t.slice(1)))); break; case "S": "C" === n || "S" === n ? ((r = 2 * e.x - e.bx), (i = 2 * e.y - e.by)) : ((r = e.x), (i = e.y)), (t = ["C", r, i].concat(t.slice(1))); break; case "T": "Q" === n || "T" === n ? ((e.qx = 2 * e.x - e.qx), (e.qy = 2 * e.y - e.qy)) : ((e.qx = e.x), (e.qy = e.y)), (t = ["C"].concat(f(e.x, e.y, e.qx, e.qy, t[1], t[2]))); break; case "Q": (e.qx = t[1]), (e.qy = t[2]), (t = ["C"].concat(f(e.x, e.y, t[1], t[2], t[3], t[4]))); break; case "L": t = ["C"].concat(l(e.x, e.y, t[1], t[2])); break; case "H": t = ["C"].concat(l(e.x, e.y, t[1], e.y)); break; case "V": t = ["C"].concat(l(e.x, e.y, e.x, t[1])); break; case "Z": t = ["C"].concat(l(e.x, e.y, e.X, e.Y)); } return t; }, v = function (t, e) { if (t[e].length > 7) { t[e].shift(); for (var o = t[e]; o.length; ) (s[e] = "A"), i && (c[e] = "A"), t.splice(e++, 0, ["C"].concat(o.splice(0, 6))); t.splice(e, 1), (n = Math.max(r.length, (i && i.length) || 0)); } }, y = function (t, e, o, a, s) { t && e && "M" === t[s][0] && "M" !== e[s][0] && (e.splice(s, 0, ["M", a.x, a.y]), (o.bx = 0), (o.by = 0), (o.x = t[s][1]), (o.y = t[s][2]), (n = Math.max(r.length, (i && i.length) || 0))); }; n = Math.max(r.length, (i && i.length) || 0); for (var m = 0; m < n; m++) { r[m] && (u = r[m][0]), "C" !== u && ((s[m] = u), m && (p = s[m - 1])), (r[m] = g(r[m], o, p)), "A" !== s[m] && "C" === u && (s[m] = "C"), v(r, m), i && (i[m] && (u = i[m][0]), "C" !== u && ((c[m] = u), m && (p = c[m - 1])), (i[m] = g(i[m], a, p)), "A" !== c[m] && "C" === u && (c[m] = "C"), v(i, m)), y(r, i, o, a, m), y(i, r, a, o, m); var b = r[m], x = i && i[m], S = b.length, w = i && x.length; (o.x = b[S - 2]), (o.y = b[S - 1]), (o.bx = parseFloat(b[S - 4]) || o.x), (o.by = parseFloat(b[S - 3]) || o.y), (a.bx = i && (parseFloat(x[w - 4]) || a.x)), (a.by = i && (parseFloat(x[w - 3]) || a.y)), (a.x = i && x[w - 2]), (a.y = i && x[w - 1]); } return i ? [r, i] : r; }, g = /,?([a-z]),?/gi, v = function (t) { return t.join(",").replace(g, "$1"); }, y = function (t, e, n, r, i) { return ( t * (t * (-3 * e + 9 * n - 9 * r + 3 * i) + 6 * e - 12 * n + 6 * r) - 3 * e + 3 * n ); }, m = function (t, e, n, r, i, o, a, s, c) { null === c && (c = 1); for ( var u = (c = c > 1 ? 1 : c < 0 ? 0 : c) / 2, h = [ -0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816, ], l = [ 0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472, ], f = 0, d = 0; d < 12; d++ ) { var p = u * h[d] + u, g = y(p, t, n, i, a), v = y(p, e, r, o, s), m = g * g + v * v; f += l[d] * Math.sqrt(m); } return u * f; }, b = function (t, e, n, r, i, o, a, s) { for (var c, u, h, l, f = [], d = [[], []], p = 0; p < 2; ++p) if ( (0 === p ? ((u = 6 * t - 12 * n + 6 * i), (c = -3 * t + 9 * n - 9 * i + 3 * a), (h = 3 * n - 3 * t)) : ((u = 6 * e - 12 * r + 6 * o), (c = -3 * e + 9 * r - 9 * o + 3 * s), (h = 3 * r - 3 * e)), Math.abs(c) < 1e-12) ) { if (Math.abs(u) < 1e-12) continue; (l = -h / u) > 0 && l < 1 && f.push(l); } else { var g = u * u - 4 * h * c, v = Math.sqrt(g); if (!(g < 0)) { var y = (-u + v) / (2 * c); y > 0 && y < 1 && f.push(y); var m = (-u - v) / (2 * c); m > 0 && m < 1 && f.push(m); } } for (var b, x = f.length, S = x; x--; ) (b = 1 - (l = f[x])), (d[0][x] = b * b * b * t + 3 * b * b * l * n + 3 * b * l * l * i + l * l * l * a), (d[1][x] = b * b * b * e + 3 * b * b * l * r + 3 * b * l * l * o + l * l * l * s); return ( (d[0][S] = t), (d[1][S] = e), (d[0][S + 1] = a), (d[1][S + 1] = s), (d[0].length = d[1].length = S + 2), { min: { x: Math.min.apply(0, d[0]), y: Math.min.apply(0, d[1]) }, max: { x: Math.max.apply(0, d[0]), y: Math.max.apply(0, d[1]) }, } ); }, x = function (t, e, n, r, i, o, a, s) { if ( !( Math.max(t, n) < Math.min(i, a) || Math.min(t, n) > Math.max(i, a) || Math.max(e, r) < Math.min(o, s) || Math.min(e, r) > Math.max(o, s) ) ) { var c = (t - n) * (o - s) - (e - r) * (i - a); if (c) { var u = ((t * r - e * n) * (i - a) - (t - n) * (i * s - o * a)) / c, h = ((t * r - e * n) * (o - s) - (e - r) * (i * s - o * a)) / c, l = +u.toFixed(2), f = +h.toFixed(2); if ( !( l < +Math.min(t, n).toFixed(2) || l > +Math.max(t, n).toFixed(2) || l < +Math.min(i, a).toFixed(2) || l > +Math.max(i, a).toFixed(2) || f < +Math.min(e, r).toFixed(2) || f > +Math.max(e, r).toFixed(2) || f < +Math.min(o, s).toFixed(2) || f > +Math.max(o, s).toFixed(2) ) ) return { x: u, y: h }; } } }, S = function (t, e, n) { return ( e >= t.x && e <= t.x + t.width && n >= t.y && n <= t.y + t.height ); }, w = function (t, e, n, r, i) { if (i) return [ ["M", +t + +i, e], ["l", n - 2 * i, 0], ["a", i, i, 0, 0, 1, i, i], ["l", 0, r - 2 * i], ["a", i, i, 0, 0, 1, -i, i], ["l", 2 * i - n, 0], ["a", i, i, 0, 0, 1, -i, -i], ["l", 0, 2 * i - r], ["a", i, i, 0, 0, 1, i, -i], ["z"], ]; var o = [["M", t, e], ["l", n, 0], ["l", 0, r], ["l", -n, 0], ["z"]]; return (o.parsePathArray = v), o; }, O = function (t, e, n, r) { return ( null === t && (t = e = n = r = 0), null === e && ((e = t.y), (n = t.width), (r = t.height), (t = t.x)), { x: t, y: e, width: n, w: n, height: r, h: r, x2: t + n, y2: e + r, cx: t + n / 2, cy: e + r / 2, r1: Math.min(n, r) / 2, r2: Math.max(n, r) / 2, r0: Math.sqrt(n * n + r * r) / 2, path: w(t, e, n, r), vb: [t, e, n, r].join(" "), } ); }, M = function (t, e, n, i, o, a, s, c) { Object(r.isArray)(t) || (t = [t, e, n, i, o, a, s, c]); var u = b.apply(null, t); return O(u.min.x, u.min.y, u.max.x - u.min.x, u.max.y - u.min.y); }, k = function (t, e, n, r, i, o, a, s, c) { var u = 1 - c, h = Math.pow(u, 3), l = Math.pow(u, 2), f = c * c, d = f * c, p = t + 2 * c * (n - t) + f * (i - 2 * n + t), g = e + 2 * c * (r - e) + f * (o - 2 * r + e), v = n + 2 * c * (i - n) + f * (a - 2 * i + n), y = r + 2 * c * (o - r) + f * (s - 2 * o + r); return { x: h * t + 3 * l * c * n + 3 * u * c * c * i + d * a, y: h * e + 3 * l * c * r + 3 * u * c * c * o + d * s, m: { x: p, y: g }, n: { x: v, y: y }, start: { x: u * t + c * n, y: u * e + c * r }, end: { x: u * i + c * a, y: u * o + c * s }, alpha: 90 - (180 * Math.atan2(p - v, g - y)) / Math.PI, }; }, j = function (t, e, n) { if ( !(function (t, e) { return ( (t = O(t)), (e = O(e)), S(e, t.x, t.y) || S(e, t.x2, t.y) || S(e, t.x, t.y2) || S(e, t.x2, t.y2) || S(t, e.x, e.y) || S(t, e.x2, e.y) || S(t, e.x, e.y2) || S(t, e.x2, e.y2) || (((t.x < e.x2 && t.x > e.x) || (e.x < t.x2 && e.x > t.x)) && ((t.y < e.y2 && t.y > e.y) || (e.y < t.y2 && e.y > t.y))) ); })(M(t), M(e)) ) return n ? 0 : []; for ( var r = ~~(m.apply(0, t) / 8), i = ~~(m.apply(0, e) / 8), o = [], a = [], s = {}, c = n ? 0 : [], u = 0; u < r + 1; u++ ) { var h = k.apply(0, t.concat(u / r)); o.push({ x: h.x, y: h.y, t: u / r }); } for (u = 0; u < i + 1; u++) { h = k.apply(0, e.concat(u / i)); a.push({ x: h.x, y: h.y, t: u / i }); } for (u = 0; u < r; u++) for (var l = 0; l < i; l++) { var f = o[u], d = o[u + 1], p = a[l], g = a[l + 1], v = Math.abs(d.x - f.x) < 0.001 ? "y" : "x", y = Math.abs(g.x - p.x) < 0.001 ? "y" : "x", b = x(f.x, f.y, d.x, d.y, p.x, p.y, g.x, g.y); if (b) { if (s[b.x.toFixed(4)] === b.y.toFixed(4)) continue; s[b.x.toFixed(4)] = b.y.toFixed(4); var w = f.t + Math.abs((b[v] - f[v]) / (d[v] - f[v])) * (d.t - f.t), j = p.t + Math.abs((b[y] - p[y]) / (g[y] - p[y])) * (g.t - p.t); w >= 0 && w <= 1 && j >= 0 && j <= 1 && (n ? (c += 1) : c.push({ x: b.x, y: b.y, t1: w, t2: j })); } } return c; }, C = function (t, e) { return (function (t, e, n) { var r, i, o, a, s, c, u, h, l, f; (t = p(t)), (e = p(e)); for (var d = n ? 0 : [], g = 0, v = t.length; g < v; g++) { var y = t[g]; if ("M" === y[0]) (r = s = y[1]), (i = c = y[2]); else { "C" === y[0] ? ((l = [r, i].concat(y.slice(1))), (r = l[6]), (i = l[7])) : ((l = [r, i, r, i, s, c, s, c]), (r = s), (i = c)); for (var m = 0, b = e.length; m < b; m++) { var x = e[m]; if ("M" === x[0]) (o = u = x[1]), (a = h = x[2]); else { "C" === x[0] ? ((f = [o, a].concat(x.slice(1))), (o = f[6]), (a = f[7])) : ((f = [o, a, o, a, u, h, u, h]), (o = u), (a = h)); var S = j(l, f, n); if (n) d += S; else { for (var w = 0, O = S.length; w < O; w++) (S[w].segment1 = g), (S[w].segment2 = m), (S[w].bez1 = l), (S[w].bez2 = f); d = d.concat(S); } } } } } return d; })(t, e); }; function E(t, e) { var n = [], r = []; return ( t.length && (function t(e, i) { if (1 === e.length) n.push(e[0]), r.push(e[0]); else { for (var o = [], a = 0; a < e.length - 1; a++) 0 === a && n.push(e[0]), a === e.length - 2 && r.push(e[a + 1]), (o[a] = [ (1 - i) * e[a][0] + i * e[a + 1][0], (1 - i) * e[a][1] + i * e[a + 1][1], ]); t(o, i); } })(t, e), { left: n, right: r.reverse() } ); } var P = function (t, e, n) { if (1 === n) return [[].concat(t)]; var r = []; if ("L" === e[0] || "C" === e[0] || "Q" === e[0]) r = r.concat( (function (t, e, n) { var r = [[t[1], t[2]]]; n = n || 2; var i = []; "A" === e[0] ? (r.push(e[6]), r.push(e[7])) : "C" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]]), r.push([e[5], e[6]])) : "S" === e[0] || "Q" === e[0] ? (r.push([e[1], e[2]]), r.push([e[3], e[4]])) : r.push([e[1], e[2]]); for (var o = r, a = 1 / n, s = 0; s < n - 1; s++) { var c = E(o, a / (1 - a * s)); i.push(c.left), (o = c.right); } return ( i.push(o), i.map(function (t) { var e = []; return ( 4 === t.length && (e.push("C"), (e = e.concat(t[2]))), t.length >= 3 && (3 === t.length && e.push("Q"), (e = e.concat(t[1]))), 2 === t.length && e.push("L"), (e = e.concat(t[t.length - 1])) ); }) ); })(t, e, n), ); else { var i = [].concat(t); "M" === i[0] && (i[0] = "L"); for (var o = 0; o <= n - 1; o++) r.push(i); } return r; }, A = function (t, e) { if (1 === t.length) return t; var n = t.length - 1, r = e.length - 1, i = n / r, o = []; if (1 === t.length && "M" === t[0][0]) { for (var a = 0; a < r - n; a++) t.push(t[0]); return t; } for (a = 0; a < r; a++) { var s = Math.floor(i * a); o[s] = (o[s] || 0) + 1; } var c = o.reduce(function (e, r, i) { return i === n ? e.concat(t[n]) : e.concat(P(t[i], t[i + 1], r)); }, []); return ( c.unshift(t[0]), ("Z" !== e[r] && "z" !== e[r]) || c.push("Z"), c ); }, I = function (t, e) { if (t.length !== e.length) return !1; var n = !0; return ( Object(r.each)(t, function (t, r) { if (t !== e[r]) return (n = !1), !1; }), n ); }; function T(t, e, n) { var r = null, i = n; return ( e < i && ((i = e), (r = "add")), t < i && ((i = t), (r = "del")), { type: r, min: i } ); } var N = function (t, e) { var n = (function (t, e) { var n, r, i = t.length, o = e.length, a = 0; if (0 === i || 0 === o) return null; for (var s = [], c = 0; c <= i; c++) (s[c] = []), (s[c][0] = { min: c }); for (var u = 0; u <= o; u++) s[0][u] = { min: u }; for (c = 1; c <= i; c++) { n = t[c - 1]; for (u = 1; u <= o; u++) { (r = e[u - 1]), (a = I(n, r) ? 0 : 1); var h = s[c - 1][u].min + 1, l = s[c][u - 1].min + 1, f = s[c - 1][u - 1].min + a; s[c][u] = T(h, l, f); } } return s; })(t, e), r = t.length, i = e.length, o = [], a = 1, s = 1; if (n[r][i].min !== r) { for (var c = 1; c <= r; c++) { var u = n[c][c].min; s = c; for (var h = a; h <= i; h++) n[c][h].min < u && ((u = n[c][h].min), (s = h)); (a = s), n[c][a].type && o.push({ index: c - 1, type: n[c][a].type }); } for (c = o.length - 1; c >= 0; c--) (a = o[c].index), "add" === o[c].type ? t.splice(a, 0, [].concat(t[a])) : t.splice(a, 1); } var l = i - (r = t.length); if (r < i) for (c = 0; c < l; c++) "z" === t[r - 1][0] || "Z" === t[r - 1][0] ? t.splice(r - 2, 0, t[r - 2]) : t.push(t[r - 1]), (r += 1); return t; }; function B(t, e, n) { for ( var r, i = [].concat(t), o = 1 / (n + 1), a = L(e)[0], s = 1; s <= n; s++ ) (o *= s), 0 === (r = Math.floor(t.length * o)) ? i.unshift([ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]) : i.splice(r, 0, [ a[0] * o + t[r][0] * (1 - o), a[1] * o + t[r][1] * (1 - o), ]); return i; } function L(t) { var e = []; switch (t[0]) { case "M": case "L": e.push([t[1], t[2]]); break; case "A": e.push([t[6], t[7]]); break; case "Q": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "T": e.push([t[1], t[2]]); break; case "C": e.push([t[5], t[6]]), e.push([t[1], t[2]]), e.push([t[3], t[4]]); break; case "S": e.push([t[3], t[4]]), e.push([t[1], t[2]]); break; case "H": case "V": e.push([t[1], t[1]]); } return e; } var D = function (t, e) { if (t.length <= 1) return t; for (var n, r = 0; r < e.length; r++) if (t[r][0] !== e[r][0]) switch (((n = L(t[r])), e[r][0])) { case "M": t[r] = ["M"].concat(n[0]); break; case "L": t[r] = ["L"].concat(n[0]); break; case "A": (t[r] = [].concat(e[r])), (t[r][6] = n[0][0]), (t[r][7] = n[0][1]); break; case "Q": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 1); } t[r] = ["Q"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "T": t[r] = ["T"].concat(n[0]); break; case "C": if (n.length < 3) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 2); } t[r] = ["C"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; case "S": if (n.length < 2) { if (!(r > 0)) { t[r] = e[r]; break; } n = B(n, t[r - 1], 1); } t[r] = ["S"].concat( n.reduce(function (t, e) { return t.concat(e); }, []), ); break; default: t[r] = e[r]; } return t; }; }, 35: function (t, e, n) { "use strict"; n.r(e), n.d(e, "getAdjMatrix", function () { return r; }), n.d(e, "breadthFirstSearch", function () { return l; }), n.d(e, "connectedComponent", function () { return d; }), n.d(e, "getDegree", function () { return g; }), n.d(e, "getInDegree", function () { return v; }), n.d(e, "getOutDegree", function () { return y; }), n.d(e, "detectCycle", function () { return w; }), n.d(e, "detectDirectedCycle", function () { return mt; }), n.d(e, "detectAllCycles", function () { return S; }), n.d(e, "detectAllDirectedCycle", function () { return x; }), n.d(e, "detectAllUndirectedCycle", function () { return b; }), n.d(e, "depthFirstSearch", function () { return m; }), n.d(e, "dijkstra", function () { return k; }), n.d(e, "findAllPath", function () { return P; }), n.d(e, "findShortestPath", function () { return E; }), n.d(e, "floydWarshall", function () { return A; }), n.d(e, "labelPropagation", function () { return I; }), n.d(e, "louvain", function () { return F; }), n.d(e, "iLouvain", function () { return Y; }), n.d(e, "kCore", function () { return X; }), n.d(e, "kMeans", function () { return W; }), n.d(e, "cosineSimilarity", function () { return q; }), n.d(e, "nodesCosineSimilarity", function () { return V; }), n.d(e, "minimumSpanningTree", function () { return $; }), n.d(e, "pageRank", function () { return Q; }), n.d(e, "getNeighbors", function () { return c; }), n.d(e, "Stack", function () { return yt; }), n.d(e, "GADDI", function () { return vt; }); var r = function (t, e) { var n = t.nodes, r = t.edges, i = [], o = {}; if (!n) throw new Error("invalid nodes data!"); return ( n && n.forEach(function (t, e) { o[t.id] = e; i.push([]); }), r && r.forEach(function (t) { var n = t.source, r = t.target, a = o[n], s = o[r]; (!a && 0 !== a) || (!s && 0 !== s) || ((i[a][s] = 1), e || (i[s][a] = 1)); }), i ); }, i = function (t, e) { return t === e; }, o = (function () { function t(t, e) { void 0 === e && (e = null), (this.value = t), (this.next = e); } return ( (t.prototype.toString = function (t) { return t ? t(this.value) : "".concat(this.value); }), t ); })(), a = (function () { function t(t) { void 0 === t && (t = i), (this.head = null), (this.tail = null), (this.compare = t); } return ( (t.prototype.prepend = function (t) { var e = new o(t, this.head); return (this.head = e), this.tail || (this.tail = e), this; }), (t.prototype.append = function (t) { var e = new o(t); return this.head ? ((this.tail.next = e), (this.tail = e), this) : ((this.head = e), (this.tail = e), this); }), (t.prototype.delete = function (t) { if (!this.head) return null; for ( var e = null; this.head && this.compare(this.head.value, t); ) (e = this.head), (this.head = this.head.next); var n = this.head; if (null !== n) for (; n.next; ) this.compare(n.next.value, t) ? ((e = n.next), (n.next = n.next.next)) : (n = n.next); return this.compare(this.tail.value, t) && (this.tail = n), e; }), (t.prototype.find = function (t) { var e = t.value, n = void 0 === e ? void 0 : e, r = t.callback, i = void 0 === r ? void 0 : r; if (!this.head) return null; for (var o = this.head; o; ) { if (i && i(o.value)) return o; if (void 0 !== n && this.compare(o.value, n)) return o; o = o.next; } return null; }), (t.prototype.deleteTail = function () { var t = this.tail; if (this.head === this.tail) return (this.head = null), (this.tail = null), t; for (var e = this.head; e.next; ) e.next.next ? (e = e.next) : (e.next = null); return (this.tail = e), t; }), (t.prototype.deleteHead = function () { if (!this.head) return null; var t = this.head; return ( this.head.next ? (this.head = this.head.next) : ((this.head = null), (this.tail = null)), t ); }), (t.prototype.fromArray = function (t) { var e = this; return ( t.forEach(function (t) { return e.append(t); }), this ); }), (t.prototype.toArray = function () { for (var t = [], e = this.head; e; ) t.push(e), (e = e.next); return t; }), (t.prototype.reverse = function () { for (var t = this.head, e = null, n = null; t; ) (n = t.next), (t.next = e), (e = t), (t = n); (this.tail = this.head), (this.head = e); }), (t.prototype.toString = function (t) { return ( void 0 === t && (t = void 0), this.toArray() .map(function (e) { return e.toString(t); }) .toString() ); }), t ); })(), s = (function () { function t() { this.linkedList = new a(); } return ( (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.peek = function () { return this.linkedList.head ? this.linkedList.head.value : null; }), (t.prototype.enqueue = function (t) { this.linkedList.append(t); }), (t.prototype.dequeue = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toString = function (t) { return this.linkedList.toString(t); }), t ); })(), c = function (t, e, n) { void 0 === e && (e = []); var r = e.filter(function (e) { return e.source === t || e.target === t; }); if ("target" === n) { return r .filter(function (e) { return e.source === t; }) .map(function (t) { return t.target; }); } if ("source" === n) { return r .filter(function (e) { return e.target === t; }) .map(function (t) { return t.source; }); } return r.map(function (e) { return e.source === t ? e.target : e.source; }); }, u = function (t, e) { return e.filter(function (e) { return e.source === t || e.target === t; }); }, h = function (t) { void 0 === t && (t = 0); var e = "".concat(Math.random()).split(".")[1].substr(0, 5), n = "".concat(Math.random()).split(".")[1].substr(0, 5); return "".concat(t, "-").concat(e).concat(n); }; var l = function (t, e, n, r) { void 0 === r && (r = !0); var i = (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), o = new s(), a = t.edges, u = void 0 === a ? [] : a; o.enqueue(e); for ( var h = "", l = function () { var t = o.dequeue(); i.enter({ current: t, previous: h }), c(t, u, r ? "target" : void 0).forEach(function (e) { i.allowTraversal({ previous: h, current: t, next: e }) && o.enqueue(e); }), i.leave({ current: t, previous: h }), (h = t); }; !o.isEmpty(); ) l(); }, f = function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = {}, u = {}, h = [], l = 0, f = function t(e) { (s[e.id] = l), (u[e.id] = l), (l += 1), o.push(e), (a[e.id] = !0); for ( var r = c(e.id, i, "target").filter(function (t) { return ( n .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }), f = function (i) { var o = r[i]; if (s[o] || 0 === s[o]) a[o] && (u[e.id] = Math.min(u[e.id], s[o])); else { var c = n.filter(function (t) { return t.id === o; }); c.length > 0 && t(c[0]), (u[e.id] = Math.min(u[e.id], u[o])); } }, d = 0; d < r.length; d++ ) f(d); if (u[e.id] === s[e.id]) { for (var p = []; o.length > 0; ) { var g = o.pop(); if (((a[g.id] = !1), p.push(g), g === e)) break; } p.length > 0 && h.push(p); } }, d = 0, p = n; d < p.length; d++ ) { var g = p[d]; s[g.id] || 0 === s[g.id] || f(g); } return h; }; function d(t, e) { return e ? f(t) : (function (t) { for ( var e = t.nodes, n = void 0 === e ? [] : e, r = t.edges, i = void 0 === r ? [] : r, o = [], a = {}, s = [], u = function t(e) { s.push(e), (a[e.id] = !0); for ( var r = c(e.id, i), o = function (e) { var i = r[e]; if (!a[i]) { var o = n.filter(function (t) { return t.id === i; }); o.length > 0 && t(o[0]); } }, u = 0; u < r.length; ++u ) o(u); }, h = 0; h < n.length; h++ ) { var l = n[h]; if (!a[l.id]) { u(l); for (var f = []; s.length > 0; ) f.push(s.pop()); o.push(f); } } return o; })(t); } var p = function (t) { var e = {}, n = t.nodes, r = void 0 === n ? [] : n, i = t.edges, o = void 0 === i ? [] : i; return ( r.forEach(function (t) { e[t.id] = { degree: 0, inDegree: 0, outDegree: 0 }; }), o.forEach(function (t) { e[t.source].degree++, e[t.source].outDegree++, e[t.target].degree++, e[t.target].inDegree++; }), e ); }, g = p, v = function (t, e) { return p(t)[e] ? p(t)[e].inDegree : 0; }, y = function (t, e) { return p(t)[e] ? p(t)[e].outDegree : 0; }; function m(t, e, n) { !(function t(e, n, r, i) { i.enter({ current: n, previous: r }); var o = e.edges; c(n, void 0 === o ? [] : o, "target").forEach(function (o) { i.allowTraversal({ previous: r, current: n, next: o }) && t(e, o, n, i); }), i.leave({ current: n, previous: r }); })( t, e, "", (function (t) { void 0 === t && (t = {}); var e, n = t, r = function () {}, i = ((e = {}), function (t) { var n = t.next; return !e[n] && ((e[n] = !0), !0); }); return ( (n.allowTraversal = t.allowTraversal || i), (n.enter = t.enter || r), (n.leave = t.leave || r), n ); })(n), ); } var b = function (t, e, n) { var r, i; void 0 === n && (n = !0); for (var o = [], a = 0, s = d(t, !1); a < s.length; a++) { var u = s[a]; if (u.length) for ( var h = u[0], l = h.id, f = [h], p = (((r = {})[l] = h), r), g = (((i = {})[l] = new Set()), i); f.length > 0; ) for ( var v = f.pop(), y = v.id, m = c(y, t.edges), b = function (r) { var i, a = m[r], s = t.nodes.find(function (t) { return t.id === a; }); if (a === y) o.push((((i = {})[a] = v), i)); else if ((a in g)) { if (!g[y].has(s)) { for ( var c = !0, u = [s, v], h = p[y]; g[a].size && !g[a].has(h) && (u.push(h), h !== p[h.id]); ) h = p[h.id]; if ( (u.push(h), e && n ? ((c = !1), u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !0)) : e && !n && u.findIndex(function (t) { return e.indexOf(t.id) > -1; }) > -1 && (c = !1), c) ) { for (var l = {}, d = 1; d < u.length; d += 1) l[u[d - 1].id] = u[d]; u.length && (l[u[u.length - 1].id] = u[0]), o.push(l); } g[a].add(v); } } else (p[a] = v), f.push(s), (g[a] = new Set([v])); }, x = 0; x < m.length; x += 1 ) b(x); } return o; }, x = function (t, e, n) { void 0 === n && (n = !0); for ( var r = [], i = new Set(), o = [], a = [], s = {}, u = {}, h = function t(c, u, h) { var l = !1; if (e && !1 === n && e.indexOf(c.id) > -1) return l; r.push(c), i.add(c); for (var f = h[c.id], d = 0; d < f.length; d += 1) { if ((v = s[f[d]]) === u) { for (var p = {}, g = 1; g < r.length; g += 1) p[r[g - 1].id] = r[g]; r.length && (p[r[r.length - 1].id] = r[0]), a.push(p), (l = !0); } else i.has(v) || (t(v, u, h) && (l = !0)); } if (l) !(function (t) { for (var e = [t]; e.length > 0; ) { var n = e.pop(); i.has(n) && (i.delete(n), o[n.id].forEach(function (t) { e.push(t); }), o[n.id].clear()); } })(c); else for (d = 0; d < f.length; d += 1) { var v = s[f[d]]; o[v.id].has(c) || o[v.id].add(c); } return r.pop(), l; }, l = t.nodes, d = void 0 === l ? [] : l, p = 0; p < d.length; p += 1 ) { var g = d[p], v = g.id; (u[v] = p), (s[p] = g); } if (e && n) { var y = function (t) { var n = e[t]; (u[d[t].id] = u[n]), (u[n] = 0), (s[0] = d.find(function (t) { return t.id === n; })), (s[u[d[t].id]] = d[t]); }; for (p = 0; p < e.length; p++) y(p); } for ( var m = function (r) { for (var i, o, s = 1 / 0, h = 0; h < r.length; h += 1) for (var l = r[h], f = 0; f < l.length; f++) { var d = u[l[f].id]; d < s && ((s = d), (o = h)); } var p = r[o], g = []; for (h = 0; h < p.length; h += 1) { var v = p[h]; g[v.id] = []; for ( var y = 0, m = c(v.id, t.edges, "target").filter(function (t) { return ( p .map(function (t) { return t.id; }) .indexOf(t) > -1 ); }); y < m.length; y++ ) { var b = m[y]; b !== v.id || (!1 === n && e.indexOf(v.id) > -1) ? g[v.id].push(u[b]) : a.push((((i = {})[v.id] = v), i)); } } return { component: p, adjList: g, minIdx: s }; }, b = 0; b < d.length; ) { var x = d.filter(function (t) { return u[t.id] >= b; }), S = f({ nodes: x, edges: t.edges }).filter(function (t) { return t.length > 1; }); if (0 === S.length) break; var w = m(S), O = w.minIdx, M = w.adjList, k = w.component; if (!(k.length > 1)) break; k.forEach(function (t) { o[t.id] = new Set(); }); var j = s[O]; if (e && n && -1 === e.indexOf(j.id)) return a; h(j, j, M), (b = O + 1); } return a; }, S = function (t, e, n, r) { return void 0 === r && (r = !0), e ? x(t, n, r) : b(t, n, r); }, w = function (t) { var e = null, n = t.nodes, r = {}, i = {}, o = {}, a = {}; (void 0 === n ? [] : n).forEach(function (t) { i[t.id] = t; }); for ( var s = { enter: function (t) { var n = t.current, a = t.previous; if (o[n]) { e = {}; for (var s = n, c = a; c !== n; ) (e[s] = c), (s = c), (c = r[c]); e[s] = c; } else (o[n] = n), delete i[n], (r[n] = a); }, leave: function (t) { var e = t.current; (a[e] = e), delete o[e]; }, allowTraversal: function (t) { var n = t.next; return !e && !a[n]; }, }; Object.keys(i).length; ) { m(t, Object.keys(i)[0], s); } return e; }, O = n(1), M = n(0), k = function (t, e, n, r) { var i = t.nodes, o = void 0 === i ? [] : i, a = t.edges, s = void 0 === a ? [] : a, c = [], h = {}, l = {}, f = {}; o.forEach(function (t, n) { var r = t.id; c.push(r), (l[r] = 1 / 0), r === e && (l[r] = 0); }); for ( var d = o.length, p = function (t) { var e = (function (t, e, n) { for (var r, i = 1 / 0, o = 0; o < e.length; o++) { var a = e[o].id; !n[a] && t[a] <= i && ((i = t[a]), (r = e[o])); } return r; })(l, o, h), i = e.id; if (((h[i] = !0), l[i] === 1 / 0)) return "continue"; (n ? (function (t, e) { return e.filter(function (e) { return e.source === t; }); })(i, s) : u(i, s) ).forEach(function (t) { var n = t.target, o = t.source, a = n === i ? o : n, s = r && t[r] ? t[r] : 1; l[a] > l[e.id] + s ? ((l[a] = l[e.id] + s), (f[a] = [e.id])) : l[a] === l[e.id] + s && f[a].push(e.id); }); }, g = 0; g < d; g++ ) p(); f[e] = [e]; var v = {}; for (var y in l) l[y] !== 1 / 0 && j(e, y, f, v); var m = {}; for (var y in v) m[y] = v[y][0]; return { length: l, path: m, allPath: v }; }; function j(t, e, n, r) { if (t === e) return [t]; if (r[e]) return r[e]; for (var i = [], o = 0, a = n[e]; o < a.length; o++) { var s = j(t, a[o], n, r); if (!s) return; for (var c = 0, u = s; c < u.length; c++) { var h = u[c]; Object(M.isArray)(h) ? i.push(Object(O.f)(Object(O.f)([], h, !0), [e], !1)) : i.push([h, e]); } } return (r[e] = i), r[e]; } var C, E = function (t, e, n, r, i) { var o = k(t, e, r, i), a = o.length, s = o.path, c = o.allPath; return { length: a[n], path: s[n], allPath: c[n] }; }, P = function (t, e, n, r) { var i; if (e === n) return [[e]]; var o = t.edges, a = void 0 === o ? [] : o, s = [e], u = (((i = {})[e] = !0), i), h = [], l = [], f = r ? c(e, a, "target") : c(e, a); for (h.push(f); s.length > 0 && h.length > 0; ) { var d = h[h.length - 1]; if (d.length) { var p = d.shift(); if ( (p && (s.push(p), (u[p] = !0), (f = r ? c(p, a, "target") : c(p, a)), h.push( f.filter(function (t) { return !u[t]; }), )), s[s.length - 1] === n) ) { var g = s.map(function (t) { return t; }); l.push(g); v = s.pop(); (u[v] = !1), h.pop(); } } else { var v = s.pop(); (u[v] = !1), h.pop(); } } return l; }, A = function (t, e) { for (var n = r(t, e), i = [], o = n.length, a = 0; a < o; a += 1) { i[a] = []; for (var s = 0; s < o; s += 1) a === s ? (i[a][s] = 0) : 0 !== n[a][s] && n[a][s] ? (i[a][s] = n[a][s]) : (i[a][s] = 1 / 0); } for (var c = 0; c < o; c += 1) for (a = 0; a < o; a += 1) for (s = 0; s < o; s += 1) i[a][s] > i[a][c] + i[c][s] && (i[a][s] = i[a][c] + i[c][s]); return i; }, I = function (t, e, n, i) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e3); var o = t.nodes, a = void 0 === o ? [] : o, s = t.edges, c = void 0 === s ? [] : s, u = {}, l = {}; a.forEach(function (t, e) { var n = h(); (t.clusterId = n), (u[n] = { id: n, nodes: [t] }), (l[t.id] = { node: t, idx: e }); }); var f = r(t, e), d = [], p = {}; f.forEach(function (t, e) { var n = 0, r = a[e].id; (p[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = a[e].id; p[r][i] = t; } }), d.push(n); }); for ( var g = 0, v = function () { var t = !1; if ( (a.forEach(function (e) { var n = {}; Object.keys(p[e.id]).forEach(function (t) { var r = p[e.id][t], i = l[t].node.clusterId; n[i] || (n[i] = 0), (n[i] += r); }); var r = -1 / 0, i = []; if ( (Object.keys(n).forEach(function (t) { r < n[t] ? ((r = n[t]), (i = [t])) : r === n[t] && i.push(t); }), 1 !== i.length || i[0] !== e.clusterId) ) { var o = i.indexOf(e.clusterId); if ((o >= 0 && i.splice(o, 1), i && i.length)) { t = !0; var a = u[e.clusterId], s = a.nodes.indexOf(e); a.nodes.splice(s, 1); var c = Math.floor(Math.random() * i.length), h = u[i[c]]; h.nodes.push(e), (e.clusterId = h.id); } } }), !t) ) return "break"; g++; }; g < i; ) { if ("break" === v()) break; } Object.keys(u).forEach(function (t) { var e = u[t]; (e.nodes && e.nodes.length) || delete u[t]; }); var y = [], m = {}; c.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = l[e].node.clusterId, a = l[r].node.clusterId, s = "".concat(o, "---").concat(a); if (m[s]) (m[s].weight += i), m[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (m[s] = c), y.push(c); } }); var b = []; return ( Object.keys(u).forEach(function (t) { b.push(u[t]); }), { clusters: b, clusterEdges: y } ); }, T = (function () { function t(t) { this.arr = t; } return ( (t.prototype.getArr = function () { return this.arr || []; }), (t.prototype.add = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] + r[o]; return new t(i); } }), (t.prototype.subtract = function (e) { var n, r = e.arr; if ( !(null === (n = this.arr) || void 0 === n ? void 0 : n.length) ) return new t(r); if (!(null == r ? void 0 : r.length)) return new t(this.arr); if (this.arr.length === r.length) { var i = []; for (var o in this.arr) i[o] = this.arr[o] - r[o]; return new t(i); } }), (t.prototype.avg = function (e) { var n = []; if (0 !== e) for (var r in this.arr) n[r] = this.arr[r] / e; return new t(n); }), (t.prototype.negate = function () { var e = []; for (var n in this.arr) e[n] = -this.arr[n]; return new t(e); }), (t.prototype.squareEuclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return r; } }), (t.prototype.euclideanDistance = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += Math.pow(this.arr[i] - t.arr[i], 2); return Math.sqrt(r); } console.error("The two vectors are unequal in length."); }), (t.prototype.normalize = function () { var e = [], n = Object(M.clone)(this.arr); n.sort(function (t, e) { return t - e; }); var r = n[n.length - 1], i = n[0]; for (var o in this.arr) e[o] = (this.arr[o] - i) / (r - i); return new t(e); }), (t.prototype.norm2 = function () { var t; if ( !(null === (t = this.arr) || void 0 === t ? void 0 : t.length) ) return 0; var e = 0; for (var n in this.arr) e += Math.pow(this.arr[n], 2); return Math.sqrt(e); }), (t.prototype.dot = function (t) { var e, n = t.arr; if ( !(null === (e = this.arr) || void 0 === e ? void 0 : e.length) || !(null == n ? void 0 : n.length) ) return 0; if (this.arr.length === n.length) { var r = 0; for (var i in this.arr) r += this.arr[i] * t.arr[i]; return r; } console.error("The two vectors are unequal in length."); }), (t.prototype.equal = function (t) { var e, n = t.arr; if ( (null === (e = this.arr) || void 0 === e ? void 0 : e.length) !== (null == n ? void 0 : n.length) ) return !1; for (var r in this.arr) if (this.arr[r] !== n[r]) return !1; return !0; }), t ); })(), N = function (t, e) { void 0 === e && (e = void 0); var n = []; return ( t.forEach(function (t) { void 0 === e && n.push(t), void 0 !== t[e] && n.push(t[e]); }), n ); }; !(function (t) { t.EuclideanDistance = "euclideanDistance"; })(C || (C = {})); var B = function (t, e, n) { var r = []; (null == e ? void 0 : e.length) ? (r = e) : (t.forEach(function (t) { r = r.concat(Object.keys(t)); }), (r = Object(M.uniq)(r))); var i = {}; return ( r.forEach(function (e) { var r = []; t.forEach(function (t) { void 0 !== t[e] && "" !== t[e] && r.push(t[e]); }), r.length && !(null == n ? void 0 : n.includes(e)) && (i[e] = Object(M.uniq)(r)); }), i ); }, L = function (t, e, n) { var r = B(t, e, n), i = []; if (!Object.keys(r).length) return i; var o = Object.values(r).every(function (t) { return t.every(function (t) { return "number" == typeof t; }); }); return ( t.forEach(function (t, e) { var n = []; Object.keys(r).forEach(function (e) { var i = t[e], a = r[e], s = a.findIndex(function (t) { return i === t; }), c = []; if (o) c.push(i); else for (var u = 0; u < a.length; u++) u === s ? c.push(1) : c.push(0); n = n.concat(c); }), (i[e] = n); }), i ); }, D = function (t, e, n, r) { void 0 === n && (n = C.EuclideanDistance); var i = 0; switch (n) { case C.EuclideanDistance: i = new T(t).euclideanDistance(new T(e)); } return i; }, _ = function (t, e, n, r) { for (var i = e.length, o = 2 * r, a = 0, s = 0; s < i; s++) for (var c = t[s].clusterId, u = 0; u < i; u++) { if (c === t[u].clusterId) a += (e[s][u] || 0) - ((n[s] || 0) * (n[u] || 0)) / o; } return (a *= 1 / o); }, R = function (t, e) { void 0 === t && (t = []); for (var n = t.length, r = new T([]), i = 0; i < n; i++) r = r.add(new T(e[i])); var o = r.avg(n); o.normalize(); var a = 0; for (i = 0; i < n; i++) { a += (c = new T(e[i])).squareEuclideanDistance(o); } var s = []; t.forEach(function () { s.push([]); }); for (i = 0; i < n; i++) { var c = new T(e[i]); t[i].clusterInertial = 0; for (var u = 0; u < n; u++) if (i !== u) { var h = new T(e[u]); (s[i][u] = c.squareEuclideanDistance(h)), (t[i].clusterInertial += s[i][u]); } else s[i][u] = 0; } var l = 0, f = 2 * n * a; for (i = 0; i < n; i++) { var d = t[i].clusterId; for (u = 0; u < n; u++) { var p = t[u].clusterId; if (i !== u && d === p) l += (t[i].clusterInertial * t[u].clusterInertial) / Math.pow(f, 2) - s[i][u] / f; } } return Number(l.toFixed(4)); }, F = function (t, e, n, i, o, a, s, c, u) { void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === i && (i = 1e-4), void 0 === o && (o = !1), void 0 === a && (a = void 0), void 0 === s && (s = []), void 0 === c && (c = ["id"]), void 0 === u && (u = 1); var h = t.nodes, l = void 0 === h ? [] : h, f = t.edges, d = void 0 === f ? [] : f, p = []; if (o) { l.forEach(function (t, e) { (t.properties = t.properties || {}), (t.originIndex = e); }); var g = []; l.every(function (t) { return t.hasOwnProperty("nodeType"); }) && ((g = Array.from( new Set( l.map(function (t) { return t.nodeType; }), ), )), l.forEach(function (t) { t.properties.nodeType = g.findIndex(function (e) { return e === t.nodeType; }); })); var v = N(l, a); p = L(v, s, c); } var y = 1, m = {}, b = {}; l.forEach(function (t, e) { var n = String(y++); (t.clusterId = n), (m[n] = { id: n, nodes: [t] }), (b[t.id] = { node: t, idx: e }); }); var x = r(t, e), S = [], w = {}, O = 0; x.forEach(function (t, e) { var n = 0, r = l[e].id; (w[r] = {}), t.forEach(function (t, e) { if (t) { n += t; var i = l[e].id; (w[r][i] = t), (O += t); } }), S.push(n); }), (O /= 2); for (var k = 1 / 0, j = 1 / 0, C = 0, E = [], P = {}; ; ) { (k = o && l.every(function (t) { return t.hasOwnProperty("properties"); }) ? _(l, x, S, O) + R(l, p) * u : _(l, x, S, O)), 0 === C && ((j = k), (E = l), (P = m)); var A = k > 0 && k > j && k - j < i; if ( (k > j && ((E = l.map(function (t) { return { node: t, clusterId: t.clusterId }; })), (P = Object(M.clone)(m)), (j = k)), A || C > 100) ) break; C++, Object.keys(m).forEach(function (t) { var e = 0; d.forEach(function (r) { var i = r.source, o = r.target, a = b[i].node.clusterId, s = b[o].node.clusterId; ((a === t && s !== t) || (s === t && a !== t)) && (e += r[n] || 1); }), (m[t].sumTot = e); }), l.forEach(function (t, e) { var r, i = m[t.clusterId], a = 0, s = S[e] / (2 * O), c = 0, h = i.nodes; h.forEach(function (t) { var n = b[t.id].idx; c += x[e][n] || 0; }); var l = c - i.sumTot * s, f = h.filter(function (e) { return e.id !== t.id; }), g = []; f.forEach(function (t, e) { g[e] = p[t.originIndex]; }); var v = R(f, p) * u, y = w[t.id]; if ( (Object.keys(y).forEach(function (n) { var i = b[n].node.clusterId; if (i !== t.clusterId) { var c = m[i], h = c.nodes; if (h && h.length) { var f = 0; h.forEach(function (t) { var n = b[t.id].idx; f += x[e][n] || 0; }); var d = f - c.sumTot * s, g = h.concat([t]), y = []; g.forEach(function (t, e) { y[e] = p[t.originIndex]; }); var S = R(g, p) * u, w = d - l; o && (w = d + S - (l + v)), w > a && ((a = w), (r = c)); } } }), a > 0) ) { r.nodes.push(t); var M = t.clusterId; t.clusterId = r.id; var k = i.nodes.indexOf(t); i.nodes.splice(k, 1); var j = 0, C = 0; d.forEach(function (t) { var e = t.source, i = t.target, o = b[e].node.clusterId, a = b[i].node.clusterId; ((o === r.id && a !== r.id) || (a === r.id && o !== r.id)) && (j += t[n] || 1), ((o === M && a !== M) || (a === M && o !== M)) && (C += t[n] || 1); }), (r.sumTot = j), (i.sumTot = C); } }); } var I = {}, T = 0; Object.keys(P).forEach(function (t) { var e = P[t]; if (e.nodes && e.nodes.length) { var n = String(T + 1); n !== t && ((e.id = n), (e.nodes = e.nodes.map(function (t) { return { id: t.id, clusterId: n }; })), (P[n] = e), (I[t] = n), delete P[t], T++); } else delete P[t]; }), E.forEach(function (t) { var e = t.node, n = t.clusterId; e && ((e.clusterId = n), e.clusterId && I[e.clusterId] && (e.clusterId = I[e.clusterId])); }); var B = [], D = {}; d.forEach(function (t) { var e = t.source, r = t.target, i = t[n] || 1, o = b[e].node.clusterId, a = b[r].node.clusterId; if (o && a) { var s = "".concat(o, "---").concat(a); if (D[s]) (D[s].weight += i), D[s].count++; else { var c = { source: o, target: a, weight: i, count: 1 }; (D[s] = c), B.push(c); } } }); var F = []; return ( Object.keys(P).forEach(function (t) { F.push(P[t]); }), { clusters: F, clusterEdges: B } ); }, Y = function (t, e, n, r, i, o, a, s) { return ( void 0 === e && (e = !1), void 0 === n && (n = "weight"), void 0 === r && (r = 1e-4), void 0 === i && (i = void 0), void 0 === o && (o = []), void 0 === a && (a = ["id"]), void 0 === s && (s = 1), F(t, e, n, r, !0, i, o, a, s) ); }, X = function (t, e) { var n; void 0 === e && (e = 1); for ( var r = Object(M.clone)(t), i = r.nodes, o = void 0 === i ? [] : i, a = r.edges, s = void 0 === a ? [] : a, c = function () { var t = g({ nodes: o, edges: s }), r = Object.keys(t); r.sort(function (e, n) { var r, i; return ( (null === (r = t[e]) || void 0 === r ? void 0 : r.degree) - (null === (i = t[n]) || void 0 === i ? void 0 : i.degree) ); }); var i = r[0]; if ( !o.length || (null === (n = t[i]) || void 0 === n ? void 0 : n.degree) >= e ) return "break"; var a = o.findIndex(function (t) { return t.id === i; }); o.splice(a, 1), (s = s.filter(function (t) { return !(t.source === i || t.target === i); })); }; ; ) { if ("break" === c()) break; } return { nodes: o, edges: s }; }, z = function (t, e, n) { var r = []; switch (t) { case C.EuclideanDistance: r = e[n]; break; default: r = []; } return r; }, W = function (t, e, n, r, i, o) { void 0 === e && (e = 3), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = ["id"]), void 0 === o && (o = C.EuclideanDistance); var a = t.nodes, s = void 0 === a ? [] : a, c = t.edges, u = void 0 === c ? [] : c, h = { clusters: [{ id: "0", nodes: s }], clusterEdges: [] }; if ( o === C.EuclideanDistance && !s.every(function (t) { return t.hasOwnProperty(n); }) ) return h; var l = [], f = []; if ( (o === C.EuclideanDistance && ((l = N(s, n)), (f = L(l, r, i))), !f.length) ) return h; for ( var d = Object(M.uniq)( f.map(function (t) { return t.join(""); }), ), p = Math.min(e, s.length, d.length), g = 0; g < s.length; g++ ) s[g].originIndex = g; var v = [], y = [], m = []; for (g = 0; g < p; g++) if (0 === g) { var b = Math.floor(Math.random() * s.length); switch (o) { case C.EuclideanDistance: v[g] = f[b]; break; default: v[g] = []; } y.push(b), (m[g] = [s[b]]), (s[b].clusterId = String(g)); } else { for ( var x = -1 / 0, S = 0, w = function (t) { if (!y.includes(t)) { for (var e = 0, n = 0; n < v.length; n++) { var r = 0; switch (o) { case C.EuclideanDistance: r = D(f[s[t].originIndex], v[n], o); } e += r; } var i = e / v.length; i > x && !v.find(function (e) { return Object(M.isEqual)( e, z(o, f, s[t].originIndex), ); }) && ((x = i), (S = t)); } }, O = 0; O < s.length; O++ ) w(O); (v[g] = z(o, f, S)), y.push(S), (m[g] = [s[S]]), (s[S].clusterId = String(g)); } for (var k = 0; ; ) { for (g = 0; g < s.length; g++) { var j = 0, E = 1 / 0; if (0 !== k || !y.includes(g)) { for (var P = 0; P < v.length; P++) { var A = 0; switch (o) { case C.EuclideanDistance: A = D(f[g], v[P], o); } A < E && ((E = A), (j = P)); } if (void 0 !== s[g].clusterId) for ( var I = m[Number(s[g].clusterId)].length - 1; I >= 0; I-- ) m[Number(s[g].clusterId)][I].id === s[g].id && m[Number(s[g].clusterId)].splice(I, 1); (s[g].clusterId = String(j)), m[j].push(s[g]); } } var B = !1; for (g = 0; g < m.length; g++) { var _ = m[g], R = new T([]); for (P = 0; P < _.length; P++) R = R.add(new T(f[_[P].originIndex])); var F = R.avg(_.length); F.equal(new T(v[g])) || ((B = !0), (v[g] = F.getArr())); } if ( (k++, (s.every(function (t) { return void 0 !== t.clusterId; }) && B) || k >= 1e3) ) break; } var Y = [], X = {}; return ( u.forEach(function (t) { var e, n, r = t.source, i = t.target, o = null === (e = s.find(function (t) { return t.id === r; })) || void 0 === e ? void 0 : e.clusterId, a = null === (n = s.find(function (t) { return t.id === i; })) || void 0 === n ? void 0 : n.clusterId, c = "".concat(o, "---").concat(a); if (X[c]) X[c].count++; else { var u = { source: o, target: a, count: 1 }; (X[c] = u), Y.push(u); } }), { clusters: m, clusterEdges: Y } ); }, q = function (t, e) { var n = new T(e), r = n.norm2(), i = new T(t), o = i.norm2(), a = n.dot(i), s = r * o, c = s ? a / s : 0; return c; }, V = function (t, e, n, r, i) { void 0 === t && (t = []), void 0 === n && (n = void 0), void 0 === r && (r = []), void 0 === i && (i = []); var o = Object(M.clone)( t.filter(function (t) { return t.id !== e.id; }), ), a = t.findIndex(function (t) { return t.id === e.id; }), s = N(t, n), c = L(s, r, i), u = c[a], h = []; return ( o.forEach(function (t, n) { if (t.id !== e.id) { var r = c[n], i = q(r, u); h.push(i), (t.cosineSimilarity = i); } }), o.sort(function (t, e) { return e.cosineSimilarity - t.cosineSimilarity; }), { allCosineSimilarity: h, similarNodes: o } ); }, G = (function () { function t(t) { (this.count = t.length), (this.parent = {}); for (var e = 0, n = t; e < n.length; e++) { var r = n[e]; this.parent[r] = r; } } return ( (t.prototype.find = function (t) { for (; this.parent[t] !== t; ) t = this.parent[t]; return t; }), (t.prototype.union = function (t, e) { var n = this.find(t), r = this.find(e); n !== r && (n < r ? (this.parent[e] !== e && this.union(this.parent[e], t), (this.parent[e] = this.parent[t])) : (this.parent[t] !== t && this.union(this.parent[t], e), (this.parent[t] = this.parent[e]))); }), (t.prototype.connected = function (t, e) { return this.find(t) === this.find(e); }), t ); })(), H = function (t, e) { return t - e; }, U = (function () { function t(t) { void 0 === t && (t = H), (this.compareFn = t), (this.list = []); } return ( (t.prototype.getLeft = function (t) { return 2 * t + 1; }), (t.prototype.getRight = function (t) { return 2 * t + 2; }), (t.prototype.getParent = function (t) { return 0 === t ? null : Math.floor((t - 1) / 2); }), (t.prototype.isEmpty = function () { return this.list.length <= 0; }), (t.prototype.top = function () { return this.isEmpty() ? void 0 : this.list[0]; }), (t.prototype.delMin = function () { var t = this.top(), e = this.list.pop(); return ( this.list.length > 0 && ((this.list[0] = e), this.moveDown(0)), t ); }), (t.prototype.insert = function (t) { if (null !== t) { this.list.push(t); var e = this.list.length - 1; return this.moveUp(e), !0; } return !1; }), (t.prototype.moveUp = function (t) { for ( var e = this.getParent(t); t && t > 0 && this.compareFn(this.list[e], this.list[t]) > 0; ) { var n = this.list[e]; (this.list[e] = this.list[t]), (this.list[t] = n), (t = e), (e = this.getParent(t)); } }), (t.prototype.moveDown = function (t) { var e, n = t, r = this.getLeft(t), i = this.getRight(t), o = this.list.length; null !== r && r < o && this.compareFn(this.list[n], this.list[r]) > 0 ? (n = r) : null !== i && i < o && this.compareFn(this.list[n], this.list[i]) > 0 && (n = i), t !== n && ((e = [this.list[n], this.list[t]]), (this.list[t] = e[0]), (this.list[n] = e[1]), this.moveDown(n)); }), t ); })(), Z = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = i[0], c = new Set(); c.add(s); var h = new U(function (t, n) { return e ? t.weight - n.weight : 0; }); for ( u(s.id, a).forEach(function (t) { h.insert(t); }); !h.isEmpty(); ) { var l = h.delMin(), f = l.source, d = l.target; (c.has(f) && c.has(d)) || (n.push(l), c.has(f) || (c.add(f), u(f, a).forEach(function (t) { h.insert(t); })), c.has(d) || (c.add(d), u(d, a).forEach(function (t) { h.insert(t); }))); } return n; }, K = function (t, e) { var n = [], r = t.nodes, i = void 0 === r ? [] : r, o = t.edges, a = void 0 === o ? [] : o; if (0 === i.length) return n; var s = a.map(function (t) { return t; }); e && s.sort(function (t, e) { return t.weight - e.weight; }); for ( var c = new G( i.map(function (t) { return t.id; }), ); s.length > 0; ) { var u = s.shift(), h = u.source, l = u.target; c.connected(h, l) || (n.push(u), c.union(h, l)); } return n; }, $ = function (t, e, n) { return n ? { prim: Z, kruskal: K }[n](t, e) : K(t, e); }, Q = function (t, e, n) { "number" != typeof e && (e = 1e-6), "number" != typeof n && (n = 0.85); for ( var r, i = 1, o = 0, a = 1e3, s = t.nodes, u = void 0 === s ? [] : s, h = t.edges, l = void 0 === h ? [] : h, f = u.length, d = {}, p = {}, v = 0; v < f; ++v ) { (d[(m = (O = u[v]).id)] = 1 / f), (p[m] = 1 / f); } for (var y = g(t); a > 0 && i > e; ) { o = 0; for (v = 0; v < f; ++v) { var m = (O = u[v]).id; if (((r = 0), 0 === y[O.id].inDegree)) d[m] = 0; else { for (var b = c(m, l, "source"), x = 0; x < b.length; ++x) { var S = b[x], w = y[S].outDegree; w > 0 && (r += p[S] / w); } (d[m] = n * r), (o += d[m]); } } (o = (1 - o) / f), (i = 0); for (v = 0; v < f; ++v) { var O; (r = d[(m = (O = u[v]).id)] + o), (i += Math.abs(r - p[m])), (p[m] = r); } a -= 1; } return p; }, J = function (t, e, n, r) { void 0 === t && (t = -1), void 0 === e && (e = -1), void 0 === n && (n = -1), void 0 === r && (r = "-1"), (this.id = t), (this.from = e), (this.to = n), (this.label = r); }, tt = (function () { function t(t, e) { void 0 === t && (t = -1), void 0 === e && (e = "-1"), (this.id = t), (this.label = e), (this.edges = []), (this.edgeMap = {}); } return ( (t.prototype.addEdge = function (t) { this.edges.push(t), (this.edgeMap[t.id] = t); }), t ); })(), et = (function () { function t(t, e, n) { void 0 === t && (t = -1), void 0 === e && (e = !0), void 0 === n && (n = !1), (this.id = t), (this.edgeIdAutoIncrease = e), (this.edges = []), (this.nodes = []), (this.nodeMap = {}), (this.edgeMap = {}), (this.nodeLabelMap = {}), (this.edgeLabelMap = {}), (this.counter = 0), (this.directed = n); } return ( (t.prototype.getNodeNum = function () { return this.nodes.length; }), (t.prototype.addNode = function (t, e) { if (!this.nodeMap[t]) { var n = new tt(t, e); this.nodes.push(n), (this.nodeMap[t] = n), this.nodeLabelMap[e] || (this.nodeLabelMap[e] = []), this.nodeLabelMap[e].push(t); } }), (t.prototype.addEdge = function (t, e, n, r) { if ( ((this.edgeIdAutoIncrease || void 0 === t) && (t = this.counter++), !( this.nodeMap[e] && this.nodeMap[n] && this.nodeMap[n].edgeMap[t] )) ) { var i = new J(t, e, n, r); if ( (this.edges.push(i), (this.edgeMap[t] = i), this.nodeMap[e].addEdge(i), this.edgeLabelMap[r] || (this.edgeLabelMap[r] = []), this.edgeLabelMap[r].push(i), !this.directed) ) { var o = new J(t, n, e, r); this.nodeMap[n].addEdge(o), this.edgeLabelMap[r].push(o); } } }), t ); })(), nt = (function () { function t(t, e, n, r, i) { (this.fromNode = t), (this.toNode = e), (this.nodeEdgeNodeLabel = { nodeLabel1: n || "-1", edgeLabel: r || "-1", nodeLabel2: i || "-1", }); } return ( (t.prototype.equalTo = function (t) { return ( this.fromNode === t.formNode && this.toNode === t.toNode && this.nodeEdgeNodeLabel === t.nodeEdgeNodeLabel ); }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), t ); })(), rt = (function () { function t() { (this.rmpath = []), (this.dfsEdgeList = []); } return ( (t.prototype.equalTo = function (t) { var e = this.dfsEdgeList.length; if (e !== t.length) return !1; for (var n = 0; n < e; n++) if (this.dfsEdgeList[n] !== t[n]) return !1; return !0; }), (t.prototype.notEqualTo = function (t) { return !this.equalTo(t); }), (t.prototype.pushBack = function (t, e, n, r, i) { return ( this.dfsEdgeList.push(new nt(t, e, n, r, i)), this.dfsEdgeList ); }), (t.prototype.toGraph = function (t, e) { void 0 === t && (t = -1), void 0 === e && (e = !1); var n = new et(t, !0, e); return ( this.dfsEdgeList.forEach(function (t) { var e = t.fromNode, r = t.toNode, i = t.nodeEdgeNodeLabel, o = i.nodeLabel1, a = i.edgeLabel, s = i.nodeLabel2; "-1" !== o && n.addNode(e, o), "-1" !== s && n.addNode(r, s), "-1" !== o && s !== o && n.addEdge(void 0, e, r, a); }), n ); }), (t.prototype.buildRmpath = function () { this.rmpath = []; for ( var t = void 0, e = this.dfsEdgeList.length - 1; e >= 0; e-- ) { var n = this.dfsEdgeList[e], r = n.fromNode, i = n.toNode; r < i && (void 0 === t || i === t) && (this.rmpath.push(e), (t = r)); } return this.rmpath; }), (t.prototype.getNodeNum = function () { var t = {}; return ( this.dfsEdgeList.forEach(function (e) { t[e.fromNode] || (t[e.fromNode] = !0), t[e.toNode] || (t[e.toNode] = !0); }), Object.keys(t).length ); }), t ); })(), it = (function () { function t(t) { if ( ((this.his = {}), (this.nodesUsed = {}), (this.edgesUsed = {}), (this.edges = []), t) ) { for (; t; ) { var e = t.edge; this.edges.push(e), (this.nodesUsed[e.from] = 1), (this.nodesUsed[e.to] = 1), (this.edgesUsed[e.id] = 1), (t = t.preNode); } this.edges = this.edges.reverse(); } } return ( (t.prototype.hasNode = function (t) { return 1 === this.nodesUsed[t.id]; }), (t.prototype.hasEdge = function (t) { return 1 === this.edgesUsed[t.id]; }), t ); })(), ot = (function () { function t(t) { var e = t.graphs, n = t.minSupport, r = void 0 === n ? 2 : n, i = t.minNodeNum, o = void 0 === i ? 1 : i, a = t.maxNodeNum, s = void 0 === a ? 4 : a, c = t.top, u = void 0 === c ? 10 : c, h = t.directed, l = void 0 !== h && h, f = t.verbose, d = void 0 !== f && f; (this.graphs = e), (this.dfsCode = new rt()), (this.support = 0), (this.frequentSize1Subgraphs = []), (this.frequentSubgraphs = []), (this.minSupport = r), (this.top = u), (this.directed = l), (this.counter = 0), (this.maxNodeNum = s), (this.minNodeNum = o), (this.verbose = d), this.maxNodeNum < this.minNodeNum && (this.maxNodeNum = this.minNodeNum), (this.reportDF = []); } return ( (t.prototype.findForwardRootEdges = function (t, e) { var n = this, r = [], i = t.nodeMap; return ( e.edges.forEach(function (t) { (n.directed || e.label <= i[t.to].label) && r.push(t); }), r ); }), (t.prototype.findBackwardEdge = function (t, e, n, r) { if (!this.directed && e === n) return null; for ( var i = t.nodeMap, o = i[n.to].edges, a = o.length, s = 0; s < a; s++ ) { var c = o[s]; if (!r.hasEdge(c) && c.to === e.from) if (this.directed) { if ( i[e.from].label < i[n.to].label || (i[e.from].label === i[n.to].label && e.label <= c.label) ) return c; } else if ( e.label < c.label || (e.label === c.label && i[e.to].label <= i[n.to].label) ) return c; } return null; }), (t.prototype.findForwardPureEdges = function (t, e, n, r) { for ( var i = [], o = e.to, a = t.nodeMap[o].edges, s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = t.nodeMap[u.to]; n <= h.label && !r.hasNode(h) && i.push(u); } return i; }), (t.prototype.findForwardRmpathEdges = function (t, e, n, r) { for ( var i = [], o = t.nodeMap, a = o[e.to].label, s = o[e.from].edges, c = s.length, u = 0; u < c; u++ ) { var h = s[u], l = o[h.to].label; e.to === h.to || n > l || r.hasNode(o[h.to]) || ((e.label < h.label || (e.label === h.label && a <= l)) && i.push(h)); } return i; }), (t.prototype.getSupport = function (t) { var e = {}; return ( t.forEach(function (t) { e[t.graphId] || (e[t.graphId] = !0); }), Object.keys(e).length ); }), (t.prototype.findMinLabel = function (t) { var e = void 0; return ( Object.keys(t).forEach(function (n) { var r = t[n], i = r.nodeLabel1, o = r.edgeLabel, a = r.nodeLabel2; e ? (i < e.nodeLabel1 || (i === e.nodeLabel1 && o < e.edgeLabel) || (i === e.nodeLabel1 && o === e.edgeLabel && a < e.nodeLabel2)) && (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }) : (e = { nodeLabel1: i, edgeLabel: o, nodeLabel2: a }); }), e ); }), (t.prototype.isMin = function () { var t = this, e = this.dfsCode; if ( (this.verbose && console.log("isMin checking", e), 1 === e.dfsEdgeList.length) ) return !0; var n = this.directed, r = e.toGraph(-1, n), i = r.nodeMap, o = new rt(), a = {}; r.nodes.forEach(function (e) { t.findForwardRootEdges(r, e).forEach(function (t) { var n = i[t.to], o = "" .concat(e.label, "-") .concat(t.label, "-") .concat(n.label); a[o] || (a[o] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: n.label, }); var s = { graphId: r.id, edge: t, preNode: null }; a[o].projected.push(s); }); }); var s = this.findMinLabel(a); if (s) { o.dfsEdgeList.push( new nt(0, 1, s.nodeLabel1, s.edgeLabel, s.nodeLabel2), ); var c = "" .concat(s.nodeLabel1, "-") .concat(s.edgeLabel, "-") .concat(s.nodeLabel2); return (function a(s) { for ( var c = o.buildRmpath(), u = o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, h = o.dfsEdgeList[c[0]].toNode, l = {}, f = !1, d = 0, p = n ? -1 : 0, g = function (e) { if (f) return "break"; s.forEach(function (n) { var i = new it(n), a = t.findBackwardEdge( r, i.edges[c[e]], i.edges[c[0]], i, ); a && (l[a.label] || (l[a.label] = { projected: [], edgeLabel: a.label, }), l[a.label].projected.push({ graphId: r.id, edge: l, preNode: n, }), (d = o.dfsEdgeList[c[e]].fromNode), (f = !0)); }); }, v = c.length - 1; v > p; v-- ) { if ("break" === g(v)) break; } if (f) { var y = t.findMinLabel(l); o.dfsEdgeList.push(new nt(h, d, "-1", y.edgeLabel, "-1")); var m = o.dfsEdgeList.length - 1; return ( t.dfsCode.dfsEdgeList[m] === o.dfsEdgeList[m] && a(l[y.edgeLabel].projected) ); } var b = {}; f = !1; var x = 0; s.forEach(function (e) { var n = new it(e), o = t.findForwardPureEdges(r, n.edges[c[0]], u, n); o.length > 0 && ((f = !0), (x = h), o.forEach(function (t) { var n = "".concat(t.label, "-").concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); var S = c.length, w = function (e) { if (f) return "break"; var n = c[e]; s.forEach(function (e) { var a = new it(e), s = t.findForwardRmpathEdges(r, a.edges[n], u, a); s.length > 0 && ((f = !0), (x = o.dfsEdgeList[n].fromNode), s.forEach(function (t) { var n = "" .concat(t.label, "-") .concat(i[t.to].label); b[n] || (b[n] = { projected: [], edgeLabel: t.label, nodeLabel2: i[t.to].label, }), b[n].projected.push({ graphId: r.id, edge: t, preNode: e, }); })); }); }; for (v = 0; v < S; v++) { if ("break" === w(v)) break; } if (!f) return !0; var O = t.findMinLabel(b); o.dfsEdgeList.push( new nt(x, h + 1, "-1", O.edgeLabel, O.nodeLabel2), ); var M = o.dfsEdgeList.length - 1; return ( e.dfsEdgeList[M] === o.dfsEdgeList[M] && a( b["".concat(O.edgeLabel, "-").concat(O.nodeLabel2)] .projected, ) ); })(a[c].projected); } }), (t.prototype.report = function () { if (!(this.dfsCode.getNodeNum() < this.minNodeNum)) { this.counter++; var t = this.dfsCode.toGraph(this.counter, this.directed); this.frequentSubgraphs.push(Object(M.clone)(t)); } }), (t.prototype.subGraphMining = function (t) { var e = this; if (!(this.getSupport(t) < this.minSupport) && this.isMin()) { this.report(); var n = this.dfsCode.getNodeNum(), r = this.dfsCode.buildRmpath(), i = this.dfsCode.dfsEdgeList[r[0]].toNode, o = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1, a = {}, s = {}; t.forEach(function (t) { for ( var c = e.graphs[t.graphId], u = c.nodeMap, h = new it(t), l = r.length - 1; l >= 0; l-- ) { var f = e.findBackwardEdge( c, h.edges[r[l]], h.edges[r[0]], h, ); if (f) { var d = "" .concat(e.dfsCode.dfsEdgeList[r[l]].fromNode, "-") .concat(f.label); s[d] || (s[d] = { projected: [], toNodeId: e.dfsCode.dfsEdgeList[r[l]].fromNode, edgeLabel: f.label, }), s[d].projected.push({ graphId: t.graphId, edge: f, preNode: t, }); } } if (!(n >= e.maxNodeNum)) { e.findForwardPureEdges(c, h.edges[r[0]], o, h).forEach( function (e) { var n = "" .concat(i, "-") .concat(e.label, "-") .concat(u[e.to].label); a[n] || (a[n] = { projected: [], fromNodeId: i, edgeLabel: e.label, nodeLabel2: u[e.to].label, }), a[n].projected.push({ graphId: t.graphId, edge: e, preNode: t, }); }, ); var p = function (n) { e.findForwardRmpathEdges(c, h.edges[r[n]], o, h).forEach( function (i) { var o = "" .concat(e.dfsCode.dfsEdgeList[r[n]].fromNode, "-") .concat(i.label, "-") .concat(u[i.to].label); a[o] || (a[o] = { projected: [], fromNodeId: e.dfsCode.dfsEdgeList[r[n]].fromNode, edgeLabel: i.label, nodeLabel2: u[i.to].label, }), a[o].projected.push({ graphId: t.graphId, edge: i, preNode: t, }); }, ); }; for (l = 0; l < r.length; l++) p(l); } }), Object.keys(s).forEach(function (t) { var n = s[t], r = n.toNodeId, o = n.edgeLabel; e.dfsCode.dfsEdgeList.push(new nt(i, r, "-1", o, "-1")), e.subGraphMining(s[t].projected), e.dfsCode.dfsEdgeList.pop(); }), Object.keys(a).forEach(function (t) { var n = a[t], r = n.fromNodeId, o = n.edgeLabel, s = n.nodeLabel2; e.dfsCode.dfsEdgeList.push(new nt(r, i + 1, "-1", o, s)), e.subGraphMining(a[t].projected), e.dfsCode.dfsEdgeList.pop(); }); } }), (t.prototype.generate1EdgeFrequentSubGraphs = function () { var t = this.graphs, e = this.directed, n = this.minSupport, r = this.frequentSize1Subgraphs, i = {}, o = {}, a = {}, s = {}; return ( Object.keys(t).forEach(function (n) { var r = t[n], c = r.nodeMap; r.nodes.forEach(function (t, r) { var u = t.label, h = "".concat(n, "-").concat(u); if (!a[h]) { var l = i[u] || 0; l++, (i[u] = l); } (a[h] = { graphKey: n, label: u }), t.edges.forEach(function (t) { var r = u, i = c[t.to].label; if (!e && r > i) { var a = i; (i = r), (r = a); } var h = t.label, l = "" .concat(n, "-") .concat(r, "-") .concat(h, "-") .concat(i), f = "".concat(r, "-").concat(h, "-").concat(i); if (!o[f]) { var d = o[f] || 0; d++, (o[f] = d); } s[l] = { graphId: n, nodeLabel1: r, edgeLabel: h, nodeLabel2: i, }; }); }); }), Object.keys(i).forEach(function (t) { if (!(i[t] < n)) { var e = { nodes: [], edges: [] }; e.nodes.push({ id: "0", label: t }), r.push(e); } }), r ); }), (t.prototype.run = function () { var t = this; if ( ((this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs()), !(this.maxNodeNum < 2)) ) { var e = this.graphs, n = (this.directed, {}); Object.keys(e).forEach(function (r) { var i = e[r], o = i.nodeMap; i.nodes.forEach(function (e) { t.findForwardRootEdges(i, e).forEach(function (t) { var i = o[t.to], a = "" .concat(e.label, "-") .concat(t.label, "-") .concat(i.label); n[a] || (n[a] = { projected: [], nodeLabel1: e.label, edgeLabel: t.label, nodeLabel2: i.label, }); var s = { graphId: r, edge: t, preNode: null }; n[a].projected.push(s); }); }); }), Object.keys(n).forEach(function (e) { var r = n[e], i = r.projected, o = r.nodeLabel1, a = r.edgeLabel, s = r.nodeLabel2; t.dfsCode.dfsEdgeList.push(new nt(0, 1, o, a, s)), t.subGraphMining(i), t.dfsCode.dfsEdgeList.pop(); }); } }), t ); })(), at = function (t) { var e = t.graphs, n = t.directed, r = void 0 !== n && n, i = t.nodeLabelProp, o = void 0 === i ? "cluster" : i, a = t.edgeLabelProp, s = void 0 === a ? "cluster" : a, c = (function (t, e, n, r) { var i = {}; return ( Object.keys(t).forEach(function (o, a) { var s = t[o], c = new et(a, !0, e), u = {}; s.nodes.forEach(function (t, e) { c.addNode(e, t[n]), (u[t.id] = e); }), s.edges.forEach(function (t, e) { var n = u[t.source], i = u[t.target]; c.addEdge(-1, n, i, t[r]); }), c && c.getNodeNum() && (i[c.id] = c); }), i ); })(e, r, o, s), u = t.minSupport, h = t.maxNodeNum, l = t.minNodeNum, f = t.verbose, d = t.top, p = new ot({ graphs: c, minSupport: u, maxNodeNum: h, minNodeNum: l, top: d, verbose: f, directed: r, }); return ( p.run(), (function (t, e, n) { var r = []; return ( t.forEach(function (t) { var i = { nodes: [], edges: [] }; t.nodes.forEach(function (t) { var n; i.nodes.push( (((n = { id: "".concat(t.id) })[e] = t.label), n), ); }), t.edges.forEach(function (t) { var e; i.edges.push( (((e = { source: "".concat(t.from), target: "".concat(t.to), })[n] = t.label), e), ); }), r.push(i); }), r ); })(p.frequentSubgraphs, o, s) ); }, st = function (t, e, n, r) { void 0 === n && (n = "cluster"), void 0 === r && (r = 2); var i = [], o = t.nodes; return ( e.forEach(function (t, e) { i.push(ct(o, t, e, n, r)); }), i ); }, ct = function (t, e, n, r, i) { var o = [n], a = [], s = {}; return ( e.forEach(function (e, c) { if (e <= i && n !== c) { o.push(c), a.push(t[c]); var u = t[c][r]; s[u] ? (s[u].count++, s[u].dists.push(e)) : (s[u] = { count: 1, dists: [e] }); } }), Object.keys(s).forEach(function (t) { s[t].dists = s[t].dists.sort(function (t, e) { return t - e; }); }), { nodeIdx: n, nodeId: t[n].id, nodeIdxs: o, neighbors: a, neighborNum: o.length - 1, nodeLabelCountMap: s, } ); }, ut = function (t, e, n, r) { var i = n.nodes; return ( r || (r = {}), Object.keys(t).forEach(function (o) { var a, s; if (!r || !r[o]) { r[o] = { nodes: [], edges: [] }; var c = t[o], u = null === (a = e[c.start]) || void 0 === a ? void 0 : a.nodeIdxs, h = null === (s = e[c.end]) || void 0 === s ? void 0 : s.nodeIdxs; if (u && h) { var l = new Set(h), f = u.filter(function (t) { return l.has(t); }); if (f && f.length) { for (var d = {}, p = f.length, g = 0; g < p; g++) { var v = i[f[g]]; r[o].nodes.push(v), (d[v.id] = !0); } n.edges.forEach(function (t) { d[t.source] && d[t.target] && r[o].edges.push(t); }); } } } }), r ); }, ht = function (t, e, n, r) { var i, o, a = {}; t.nodes.forEach(function (t) { a[t.id] = t; }); var s = 0; return !(null === (i = null == e ? void 0 : e.edges) || void 0 === i ? void 0 : i.length) || (null === (o = null == e ? void 0 : e.nodes) || void 0 === o ? void 0 : o.length) < 2 ? 0 : (t.edges.forEach(function (t) { var i = a[t.source][n], o = a[t.target][n], c = null == e ? void 0 : e.nodes[0][n], u = null == e ? void 0 : e.nodes[1][n], h = null == e ? void 0 : e.edges[0][r]; t[r] === h && ((i === c && o === u) || (i === u && o === c)) && s++; }), s); }, lt = function (t, e) { var n = {}, r = {}; return ( t.forEach(function (t, i) { n[t.id] = { idx: i, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var o = t[e]; r[o] || (r[o] = []), r[o].push(t); }), { nodeMap: n, nodeLabelMap: r } ); }, ft = function (t, e, n) { var r = {}, i = {}; return ( t.forEach(function (t, o) { r["".concat(h)] = { idx: o, edge: t }; var a = t[e]; i[a] || (i[a] = []), i[a].push(t); var s = n[t.source]; s && (s.degree++, s.outDegree++); var c = n[t.target]; c && (c.degree++, c.inDegree++); }), { edgeMap: r, edgeLabelMap: i } ); }, dt = function (t, e, n) { var r = e.length, i = {}; return ( e.forEach(function (e, o) { for (var a = n ? 0 : o + 1, s = t[o].id, c = a; c < r; c++) if (o !== c) { var u = t[c].id, h = e[c]; (i["".concat(s, "-").concat(u)] = h), n || (i["".concat(u, "-").concat(s)] = h); } }), i ); }, pt = function (t, e, n, r, i, o, a, s, c, u, h) { var l, f = "".concat(e.id, "-").concat(n.id); if (u && u[f]) return u[f]; var d = h ? h[f] : void 0; if (!d) { var p = (((l = {})[f] = { start: r[e.id].idx, end: r[n.id].idx, distance: i, }), l); d = (h = ut(p, o, t, h))[f]; } return ht(d, a, s, c); }, gt = function (t, e, n, r) { var i, o, a, s = null === (i = t[e]) || void 0 === i ? void 0 : i.degree, c = null === (o = t[e]) || void 0 === o ? void 0 : o.inDegree, u = null === (a = t[e]) || void 0 === a ? void 0 : a.outDegree; return ( void 0 === t[e] && ((s = 1 / 0), (c = 1 / 0), (u = 1 / 0), r[e].forEach(function (t) { var e = n[t.id].degree; s > e && (s = e); var r = n[t.id].inDegree; c > r && (c = r); var i = n[t.id].outDegree; u > i && (u = i); }), (t[e] = { degree: s, inDegree: c, outDegree: u })), { minPatternNodeLabelDegree: s, minPatternNodeLabelInDegree: c, minPatternNodeLabelOutDegree: u, } ); }, vt = function (t, e, n, r, i, o, a) { var s; if ( (void 0 === n && (n = !1), void 0 === o && (o = "cluster"), void 0 === a && (a = "cluster"), t && t.nodes) ) { var c = t.nodes.length; if (c) { var u = A(t, n), h = A(e, n), l = dt(t.nodes, u, n), f = dt(e.nodes, h, n), d = lt(t.nodes, o), p = d.nodeMap, g = d.nodeLabelMap, v = lt(e.nodes, o), y = v.nodeMap, m = v.nodeLabelMap; ft(t.edges, a, p); var b = ft(e.edges, a, y).edgeLabelMap, x = []; null == h || h.forEach(function (t) { x = x.concat(t); }), i || (i = Math.max.apply( Math, Object(O.f)(Object(O.f)([], x, !1), [2], !1), )), r || (r = i); var S = st(t, u, o, r), w = st(e, h, o, r), M = (function (t, e, n, r, i) { var o = Math.ceil(n / e), a = {}, s = 0; return ( r.forEach(function (t, r) { for ( var c = 0, u = 0, h = t.nodeIdxs, l = t.neighborNum - 1; c < o; ) { for ( var f = h[1 + Math.floor(Math.random() * l)], d = 0; (a["".concat(r, "-").concat(f)] || a["".concat(f, "-").concat(r)]) && ((f = Math.floor(Math.random() * e)), !(++d > 2 * e)); ); if ( d < 2 * e && ((a["".concat(r, "-").concat(f)] = { start: r, end: f, distance: i[r][f], }), c++, ++s >= n) ) return a; if (++u > 2 * e) break; } c < o && (o = (o + (o - c)) / (e - r - 1)); }), a ); })(0, c, Math.min(100, (c * (c - 1)) / 2), S, u), j = ut(M, S, t), C = at({ graphs: j, nodeLabelProp: o, edgeLabelProp: a, minSupport: 1, minNodeNum: 1, maxNodeNum: 4, directed: n, }).slice(0, 10), E = C.length, P = []; C.forEach(function (t, e) { (P[e] = {}), Object.keys(j).forEach(function (n) { var r = j[n], i = ht(r, t, o, a); P[e][n] = i; }); }); var I = (function (t, e, n) { for ( var r = 1 / 0, i = 0, o = function (e) { var n = t[e], o = Object.keys(n).sort(function (t, e) { return n[t] - n[e]; }), a = []; o.forEach(function (t, e) { a[e % 10] || (a[e % 10] = { graphs: [], totalCount: 0, aveCount: 0, }), a[e % 10].graphs.push(t), (a[e % 10].totalCount += n[t]); }); var s = 0, c = []; a.forEach(function (t) { var e = t.totalCount / t.graphs.length; (t.aveCount = e), c.push(e); var r = 0, i = t.length; t.graphs.forEach(function (e, i) { var o = n[e]; t.graphs.forEach(function (t, e) { i !== e && (r += Math.abs(o - n[t])); }); }), (s += r /= (i * (i - 1)) / 2); }), (s /= a.length); var u = 0; c.forEach(function (t, e) { c.forEach(function (n, r) { e !== r && (u += Math.abs(t - n)); }), (u /= (c.length * (c.length - 1)) / 2); }); var h = u - s; r < h && ((r = h), (i = e)); }, a = 0; a < e; a++ ) o(a); return { structure: n[i], structureCountMap: t[i] }; })(P, E, C), T = I.structure, N = I.structureCountMap, B = e.nodes[0], L = [], D = null === (s = e.nodes[0]) || void 0 === s ? void 0 : s[o], _ = -1 / 0; e.nodes.forEach(function (t) { var e = t[o], n = g[e]; (null == n ? void 0 : n.length) > _ && ((_ = n.length), (L = n), (D = e), (B = t)); }); var R = {}, F = {}, Y = {}, X = {}, z = {}, W = {}; Object.keys(m).forEach(function (r, i) { (z[r] = []), n && (W[r] = []); var s = -1 / 0, c = m[r], u = {}; c.forEach(function (t) { var e = f["".concat(B.id, "-").concat(t.id)]; if ( (e && z[r].push(e), s < e && (s = e), (u["".concat(B.id, "-").concat(t.id)] = { start: 0, end: y[t.id].idx, distance: e, }), n) ) { var i = f["".concat(t.id, "-").concat(B.id)]; i && W[r].push(i); } }), (z[r] = z[r].sort(function (t, e) { return t - e; })), n && (W[r] = W[r].sort(function (t, e) { return t - e; })), (F = ut(u, w, e, F)); var h = []; if ( (Object.keys(u).forEach(function (t) { if (Y[t]) h.push(Y[t]); else { var e = F[t]; (Y[t] = ht(e, T, o, a)), h.push(Y[t]); } }), (h = h.sort(function (t, e) { return e - t; })), (X["".concat(B.id, "-").concat(r)] = h), r !== D) ) for ( var d = function (e) { var n = L[e], i = S[p[n.id].idx], s = i.nodeLabelCountMap[r], c = m[r].length; if (!s || s.count < c) return L.splice(e, 1), "continue"; for (var u = !1, f = 0; f < c; f++) if (s.dists[f] > z[r][f]) { u = !0; break; } if (u) return L.splice(e, 1), "continue"; var d = {}; i.neighbors.forEach(function (t) { var e = l["".concat(n.id, "-").concat(t.id)]; d["".concat(n.id, "-").concat(t.id)] = { start: p[n.id].idx, end: p[t.id].idx, distance: e, }; }), (j = ut(d, S, t, j)); var g = []; Object.keys(d).forEach(function (t) { if (N[t]) g.push(N[t]); else { var e = j[t]; (N[t] = ht(e, T, o, a)), g.push(N[t]); } }), (g = g.sort(function (t, e) { return e - t; })); var v = !1; for (f = 0; f < c; f++) if (g[f] < h[f]) { v = !0; break; } return v ? (L.splice(e, 1), "continue") : void 0; }, g = ((null == L ? void 0 : L.length) || 0) - 1; g >= 0; g-- ) d(g); }); var q = []; null == L || L.forEach(function (r) { for ( var s = p[r.id].idx, c = ct(t.nodes, u[s], s, o, i).neighbors, h = !1, f = c.length - 1; f >= 0; f-- ) { if (c.length + 1 < e.nodes.length) return void (h = !0); var d = c[f], g = d[o]; if (m[g] && m[g].length) if (z[g] && z[g].length) { var v = "".concat(r.id, "-").concat(d.id), b = l[v], x = z[g].length - 1; if (b > z[g][x]) c.splice(f, 1); else { if (n) { var w = "".concat(d.id, "-").concat(r.id), O = l[w]; if (((x = W[g].length - 1), O > W[g][x])) { c.splice(f, 1); continue; } } var M = N[v] ? N[v] : pt(t, r, d, p, b, S, T, o, a, N, j), k = "".concat(B.id, "-").concat(g); if (M < X[k][X[k].length - 1]) c.splice(f, 1); else { var C = gt(R, g, y, m), E = C.minPatternNodeLabelDegree; C.minPatternNodeLabelInDegree, C.minPatternNodeLabelOutDegree; p[d.id].degree < E && c.splice(f, 1); } } } else c.splice(f, 1); else c.splice(f, 1); } h || q.push({ nodes: [r].concat(c) }); }); var V = k(e, B.id, !1).length, G = {}; n ? (Object.keys(V).forEach(function (t) { var e = y[t].node[o]; G[e] ? G[e].push(V[t]) : (G[e] = [V[t]]); }), Object.keys(G).forEach(function (t) { G[t].sort(function (t, e) { return t - e; }); })) : (G = z); for ( var H = function (r) { var i = q[r], s = i.nodes[0], c = {}, u = {}; i.nodes.forEach(function (t, e) { u[t.id] = { idx: e, node: t, degree: 0, inDegree: 0, outDegree: 0, }; var n = t[o]; c[n] ? c[n]++ : (c[n] = 1); }); var h = [], l = {}; t.edges.forEach(function (t) { u[t.source] && u[t.target] && (h.push(t), l[t[a]] ? l[t[a]]++ : (l[t[a]] = 1), u[t.source].degree++, u[t.target].degree++, u[t.source].outDegree++, u[t.target].inDegree++); }); for ( var f = Object.keys(b).length, d = !1, g = 0; g < f; g++ ) { var v = Object.keys(b)[g]; if (!l[v] || l[v] < b[v].length) { d = !0; break; } } if (d) return q.splice(r, 1), "continue"; var x = h.length; if (x < e.edges.length) return q.splice(r, 1), "break"; var S = !1, w = function (t) { var e = h[t], r = e[a], i = b[r]; if (!i || !i.length) return ( l[r]--, i && l[r] < i.length ? ((S = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue") ); var s = u[e.source].node[o], c = u[e.target].node[o], f = !1; return ( i.forEach(function (t) { var e = y[t.source].node, r = y[t.target].node; e[o] === s && r[o] === c && (f = !0), n || e[o] !== c || r[o] !== s || (f = !0); }), f ? void 0 : (l[r]--, i && l[r] < i.length ? ((S = !0), "break") : (h.splice(t, 1), u[e.source].degree--, u[e.target].degree--, u[e.source].outDegree--, u[e.target].inDegree--, "continue")) ); }; for (g = x - 1; g >= 0; g--) { if ("break" === w(g)) break; } if (S) return q.splice(r, 1), "continue"; i.edges = h; var O = k(i, i.nodes[0].id, !1).length; if ( (Object.keys(O) .reverse() .forEach(function (t) { if (t !== i.nodes[0].id && !S) { if (O[t] === 1 / 0) { var e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (S = !0); var n = i.nodes.indexOf(u[t].node); return i.nodes.splice(n, 1), void (u[t] = void 0); } var r = p[t].node[o]; if ( !G[r] || !G[r].length || O[t] > G[r][G[r].length - 1] ) { e = u[t].node[o]; if ((c[e]--, c[e] < m[e].length)) return void (S = !0); n = i.nodes.indexOf(u[t].node); i.nodes.splice(n, 1), (u[t] = void 0); } } }), S) ) return q.splice(r, 1), "continue"; for (var M = !0, j = 0; M && !S; ) { if ( ((M = !1), n ? u[s.id].degree < y[B.id].degree || u[s.id].inDegree < y[B.id].inDegree || u[s.id].outDegree < y[B.id].outDegree : u[s.id].degree < y[B.id].degree) ) { S = !0; break; } if (c[s[o]] < m[s[o]].length) { S = !0; break; } for (var C = i.nodes.length - 1; C >= 0; C--) { var E = i.nodes[C], P = u[E.id].degree, A = u[E.id].inDegree, I = u[E.id].outDegree, T = E[o], N = gt(R, T, y, m), L = N.minPatternNodeLabelDegree, D = N.minPatternNodeLabelInDegree, _ = N.minPatternNodeLabelOutDegree; if (n ? P < L || A < D || I < _ : P < L) { if ((c[E[o]]--, c[E[o]] < m[E[o]].length)) { S = !0; break; } i.nodes.splice(C, 1), (u[E.id] = void 0), (M = !0); } } if (S || (!M && 0 !== j)) break; for (var F = (x = h.length) - 1; F >= 0; F--) { var Y = h[F]; if (!u[Y.source] || !u[Y.target]) { h.splice(F, 1); var X = Y[a]; if ( (l[X]--, u[Y.source] && (u[Y.source].degree--, u[Y.source].outDegree--), u[Y.target] && (u[Y.target].degree--, u[Y.target].inDegree--), b[X] && l[X] < b[X].length) ) { S = !0; break; } M = !0; } } j++; } return S || S || i.nodes.length < e.nodes.length || h.length < e.edges.length ? (q.splice(r, 1), "continue") : void 0; }, U = q.length - 1; U >= 0; U-- ) { if ("break" === H(U)) break; } var Z = q.length, K = function (t) { var e = q[t], n = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); n[e] ? n[e]++ : (n[e] = 1); }); for ( var r = function (t) { var e = q[t], r = {}; e.edges.forEach(function (t) { var e = "" .concat(t.source, "-") .concat(t.target, "-") .concat(t.label); r[e] ? r[e]++ : (r[e] = 1); }); var i = !0; Object.keys(r).length !== Object.keys(n).length ? (i = !1) : Object.keys(n).forEach(function (t) { r[t] !== n[t] && (i = !1); }), i && q.splice(t, 1); }, i = Z - 1; i > t; i-- ) r(i); Z = q.length; }; for (U = 0; U <= Z - 1; U++) K(U); return q; } } }, yt = (function () { function t(t) { void 0 === t && (t = 10), (this.linkedList = new a()), (this.maxStep = t); } return ( Object.defineProperty(t.prototype, "length", { get: function () { return this.linkedList.toArray().length; }, enumerable: !1, configurable: !0, }), (t.prototype.isEmpty = function () { return !this.linkedList.head; }), (t.prototype.isMaxStack = function () { return this.toArray().length >= this.maxStep; }), (t.prototype.peek = function () { return this.isEmpty() ? null : this.linkedList.head.value; }), (t.prototype.push = function (t) { this.linkedList.prepend(t), this.length > this.maxStep && this.linkedList.deleteTail(); }), (t.prototype.pop = function () { var t = this.linkedList.deleteHead(); return t ? t.value : null; }), (t.prototype.toArray = function () { return this.linkedList.toArray().map(function (t) { return t.value; }); }), (t.prototype.clear = function () { for (; !this.isEmpty(); ) this.pop(); }), t ); })(), mt = w; e.default = { getAdjMatrix: r, breadthFirstSearch: l, connectedComponent: d, getDegree: g, getInDegree: v, getOutDegree: y, detectCycle: w, detectDirectedCycle: mt, detectAllCycles: S, detectAllDirectedCycle: x, detectAllUndirectedCycle: b, depthFirstSearch: m, dijkstra: k, findAllPath: P, findShortestPath: E, floydWarshall: A, labelPropagation: I, louvain: F, iLouvain: Y, kCore: X, kMeans: W, cosineSimilarity: q, nodesCosineSimilarity: V, minimumSpanningTree: $, pageRank: Q, getNeighbors: c, Stack: yt, GADDI: vt, }; }, 38: function (t, e, n) { self, (t.exports = (function () { "use strict"; var t = { d: function (e, n) { for (var r in n) t.o(n, r) && !t.o(e, r) && Object.defineProperty(e, r, { enumerable: !0, get: n[r] }); }, o: function (t, e) { return Object.prototype.hasOwnProperty.call(t, e); }, r: function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module", }), Object.defineProperty(t, "__esModule", { value: !0 }); }, }, e = {}; function n(t, e) { return void 0 === t ? e : t; } t.r(e), t.d(e, { default: function () { return me; }, }); var r, i = Math.round, o = Math.abs, a = Date.now, s = "compute", c = "auto", u = "manipulation", h = "none", l = "pan-x", f = "pan-y", d = ((r = {}), [ "auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none", ].forEach(function (t) { return (r[t] = !0); }), r), p = "touch", g = ["x", "y"], v = ["clientX", "clientY"], y = 32, m = "function" != typeof Object.assign ? function (t) { if (null == t) throw new TypeError( "Cannot convert undefined or null to object", ); for (var e = Object(t), n = 1; n < arguments.length; n++) { var r = arguments[n]; if (null != r) for (var i in r) r.hasOwnProperty(i) && (e[i] = r[i]); } return e; } : Object.assign, b = 1; function x(t, e, n) { var r; if (t) if (t.forEach) t.forEach(e, n); else if (void 0 !== t.length) for (r = 0; r < t.length; ) e.call(n, t[r], r, t), r++; else for (r in t) t.hasOwnProperty(r) && e.call(n, t[r], r, t); } function S(t, e, n) { return !!Array.isArray(t) && (x(t, n[e], n), !0); } function w(t, e, n) { if (t.indexOf && !n) return t.indexOf(e); for (var r = 0; r < t.length; ) { if ((n && t[r][n] == e) || (!n && t[r] === e)) return r; r++; } return -1; } function O(t) { return (O = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function M(t, e) { return "function" === O(t) ? t.apply((e && e[0]) || void 0, e) : t; } function k(t, e) { var n = e.manager; return n ? n.get(t) : t; } function j(t) { return 16 & t ? "cancel" : 8 & t ? "end" : 4 & t ? "move" : 2 & t ? "start" : ""; } function C(t) { return (C = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var E = (function () { function t(e) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, this.defaults, e || {})), (this.id = b++), (this.manager = null), (this.options.enable = n(this.options.enable, !0)), (this.state = 1), (this.simultaneous = {}), (this.requireFail = []); } var e, r; return ( (e = t), (r = [ { key: "set", value: function (t) { return ( m(this.options, t), this.manager && this.manager.touchAction.update(), this ); }, }, { key: "recognizeWith", value: function (t) { if (S(t, "recognizeWith", this)) return this; var e = this.simultaneous; return ( e[(t = k(t, this)).id] || ((e[t.id] = t), t.recognizeWith(this)), this ); }, }, { key: "dropRecognizeWith", value: function (t) { return ( S(t, "dropRecognizeWith", this) || ((t = k(t, this)), delete this.simultaneous[t.id]), this ); }, }, { key: "requireFailure", value: function (t) { if (S(t, "requireFailure", this)) return this; var e = this.requireFail; return ( -1 === w(e, (t = k(t, this))) && (e.push(t), t.requireFailure(this)), this ); }, }, { key: "dropRequireFailure", value: function (t) { if (S(t, "dropRequireFailure", this)) return this; t = k(t, this); var e = w(this.requireFail, t); return e > -1 && this.requireFail.splice(e, 1), this; }, }, { key: "hasRequireFailures", value: function () { return this.requireFail.length > 0; }, }, { key: "canRecognizeWith", value: function (t) { return !!this.simultaneous[t.id]; }, }, { key: "emit", value: function (t) { var e = this, n = this.state; function r(n) { e.manager.emit(n, t); } n < 8 && r(e.options.event + j(n)), r(e.options.event), t.additionalEvent && r(t.additionalEvent), n >= 8 && r(e.options.event + j(n)); }, }, { key: "tryEmit", value: function (t) { if (this.canEmit()) return this.emit(t); this.state = y; }, }, { key: "canEmit", value: function () { for (var t = 0; t < this.requireFail.length; ) { if (!(33 & this.requireFail[t].state)) return !1; t++; } return !0; }, }, { key: "recognize", value: function (t) { var e = m({}, t); if (!M(this.options.enable, [this, e])) return this.reset(), void (this.state = y); 56 & this.state && (this.state = 1), (this.state = this.process(e)), 30 & this.state && this.tryEmit(e); }, }, { key: "process", value: function (t) {} }, { key: "getTouchAction", value: function () {} }, { key: "reset", value: function () {} }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== C(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== C(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === C(i) ? i : String(i)), r, ); } var i; })(e.prototype, r), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function P(t) { return (P = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function A(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function I(t, e) { return (I = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function T(t, e) { if (e && ("object" === P(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function N(t) { return (N = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } E.prototype.defaults = {}; var B = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && I(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = N(r); if (i) { var n = N(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return T(this, t); }); function a() { return A(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "attrTest", value: function (t) { var e = this.options.pointers; return 0 === e || t.pointers.length === e; }, }, { key: "process", value: function (t) { var e = this.state, n = t.eventType, r = 6 & e, i = this.attrTest(t); return r && (8 & n || !i) ? 16 | e : r || i ? 4 & n ? 8 | e : 2 & e ? 4 | e : 2 : y; }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== P(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== P(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === P(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function L(t) { return (L = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function D(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function _() { return (_ = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = R(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function R(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = X(t)); ); return t; } function F(t, e) { return (F = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function Y(t, e) { if (e && ("object" === L(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function X(t) { return (X = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } B.prototype.defaults = { pointers: 1 }; var z = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && F(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = X(r); if (i) { var n = X(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return Y(this, t); }); function a() { return D(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( _(X(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.rotation) > this.options.threshold || 2 & this.state) ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== L(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== L(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === L(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function W(t) { return (W = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function q(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function V() { return (V = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = G(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function G(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = Z(t)); ); return t; } function H(t, e) { return (H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function U(t, e) { if (e && ("object" === W(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Z(t) { return (Z = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } z.prototype.defaults = { event: "rotate", threshold: 0, pointers: 2 }; var K = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && H(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Z(r); if (i) { var n = Z(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return U(this, t); }); function a() { return q(this, a), o.apply(this, arguments); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [h]; }, }, { key: "attrTest", value: function (t) { return ( V(Z(a.prototype), "attrTest", this).call(this, t) && (Math.abs(t.scale - 1) > this.options.threshold || 2 & this.state) ); }, }, { key: "emit", value: function (t) { if (1 !== t.scale) { var e = t.scale < 1 ? "in" : "out"; t.additionalEvent = this.options.event + e; } V(Z(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== W(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== W(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === W(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function $(t) { return 16 === t ? "down" : 8 === t ? "up" : 2 === t ? "left" : 4 === t ? "right" : ""; } function Q(t) { return (Q = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function J(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function tt() { return (tt = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = et(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function et(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = it(t)); ); return t; } function nt(t, e) { return (nt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function rt(t, e) { if (e && ("object" === Q(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function it(t) { return (it = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } K.prototype.defaults = { event: "pinch", threshold: 0, pointers: 2 }; var ot = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && nt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = it(r); if (i) { var n = it(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return rt(this, t); }); function a() { var t; return ( J(this, a), ((t = o.apply(this, arguments)).pX = null), (t.pY = null), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { var t = this.options.direction, e = []; return 6 & t && e.push(f), 24 & t && e.push(l), e; }, }, { key: "directionTest", value: function (t) { var e = this.options, n = !0, r = t.distance, i = t.direction, o = t.deltaX, a = t.deltaY; return ( i & e.direction || (6 & e.direction ? ((i = 0 === o ? 1 : o < 0 ? 2 : 4), (n = o !== this.pX), (r = Math.abs(t.deltaX))) : ((i = 0 === a ? 1 : a < 0 ? 8 : 16), (n = a !== this.pY), (r = Math.abs(t.deltaY)))), (t.direction = i), n && r > e.threshold && i & e.direction ); }, }, { key: "attrTest", value: function (t) { return ( B.prototype.attrTest.call(this, t) && (2 & this.state || (!(2 & this.state) && this.directionTest(t))) ); }, }, { key: "emit", value: function (t) { (this.pX = t.deltaX), (this.pY = t.deltaY); var e = $(t.direction); e && (t.additionalEvent = this.options.event + e), tt(it(a.prototype), "emit", this).call(this, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Q(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Q(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Q(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(B); function at(t) { return (at = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function st(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ct() { return (ct = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (t, e, n) { var r = ut(t, e); if (r) { var i = Object.getOwnPropertyDescriptor(r, e); return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value; } }).apply(this, arguments); } function ut(t, e) { for ( ; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = ft(t)); ); return t; } function ht(t, e) { return (ht = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function lt(t, e) { if (e && ("object" === at(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ft(t) { return (ft = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } ot.prototype.defaults = { event: "pan", threshold: 10, pointers: 1, direction: 30, }; var dt = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ht(t, e); })(s, t); var e, n, r, i, a = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = ft(r); if (i) { var n = ft(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return lt(this, t); }); function s() { return st(this, s), a.apply(this, arguments); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return ot.prototype.getTouchAction.call(this); }, }, { key: "attrTest", value: function (t) { var e, n = this.options.direction; return ( 30 & n ? (e = t.overallVelocity) : 6 & n ? (e = t.overallVelocityX) : 24 & n && (e = t.overallVelocityY), ct(ft(s.prototype), "attrTest", this).call(this, t) && n & t.offsetDirection && t.distance > this.options.threshold && t.maxPointers === this.options.pointers && o(e) > this.options.velocity && 4 & t.eventType ); }, }, { key: "emit", value: function (t) { var e = $(t.offsetDirection); e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== at(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== at(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === at(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(B); function pt(t, e) { return function () { return t.apply(e, arguments); }; } function gt(t, e, n) { return setTimeout(pt(t, n), e); } function vt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return Math.sqrt(r * r + i * i); } function yt(t) { return (yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function mt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function bt(t, e) { return (bt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function xt(t, e) { if (e && ("object" === yt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function St(t) { return (St = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } dt.prototype.defaults = { event: "swipe", threshold: 10, velocity: 0.3, direction: 30, pointers: 1, }; var wt = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && bt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = St(r); if (i) { var n = St(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return xt(this, t); }); function a() { var t; return ( mt(this, a), ((t = o.apply(this, arguments)).pTime = !1), (t.pCenter = !1), (t._timer = null), (t._input = null), (t.count = 0), t ); } return ( (e = a), (n = [ { key: "getTouchAction", value: function () { return [u]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime < n.time; if ((this.reset(), 1 & t.eventType && 0 === this.count)) return this.failTimeout(); if (i && o && r) { if (4 !== t.eventType) return this.failTimeout(); var a = !this.pTime || t.timeStamp - this.pTime < n.interval, s = !this.pCenter || vt(this.pCenter, t.center) < n.posThreshold; if ( ((this.pTime = t.timeStamp), (this.pCenter = t.center), s && a ? (this.count += 1) : (this.count = 1), (this._input = t), 0 == this.count % n.taps) ) return this.hasRequireFailures() ? ((this._timer = gt( function () { (e.state = 8), e.tryEmit(); }, n.interval, this, )), 2) : 8; } return y; }, }, { key: "failTimeout", value: function () { var t = this; return ( (this._timer = gt( function () { t.state = y; }, this.options.interval, this, )), y ); }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function () { 8 === this.state && ((this._input.tapCount = this.count), this.manager.emit(this.options.event, this._input)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== yt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== yt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === yt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(E); function Ot(t) { return (Ot = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Mt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function kt(t, e) { return (kt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function jt(t, e) { if (e && ("object" === Ot(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ct(t) { return (Ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } wt.prototype.defaults = { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10, }; var Et = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && kt(t, e); })(s, t); var e, n, r, i, o = ((r = s), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Ct(r); if (i) { var n = Ct(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return jt(this, t); }); function s() { var t; return ( Mt(this, s), ((t = o.apply(this, arguments))._timer = null), (t._input = null), t ); } return ( (e = s), (n = [ { key: "getTouchAction", value: function () { return [c]; }, }, { key: "process", value: function (t) { var e = this, n = this.options, r = t.pointers.length === n.pointers, i = t.distance < n.threshold, o = t.deltaTime > n.time; if ( ((this._input = t), !i || !r || (12 & t.eventType && !o)) ) this.reset(); else if (1 & t.eventType) this.reset(), (this._timer = gt( function () { (e.state = 8), e.tryEmit(); }, n.time, this, )); else if (4 & t.eventType) return 8; return y; }, }, { key: "reset", value: function () { clearTimeout(this._timer), (this._timer = null); }, }, { key: "emit", value: function (t) { 8 === this.state && (t && 4 & t.eventType ? this.manager.emit( "".concat(this.options.event, "up"), t, ) : ((this._input.timeStamp = a()), this.manager.emit(this.options.event, this._input))); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Ot(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Ot(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Ot(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), s ); })(E); function Pt(t, e) { return t.indexOf(e) > -1; } function At(t) { return (At = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } Et.prototype.defaults = { event: "press", pointers: 1, time: 251, threshold: 9, }; var It = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.manager = e), this.set(n); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { t === s && (t = this.compute()), (this.actions = t.toLowerCase().trim()); }, }, { key: "update", value: function () { this.set(this.manager.options.touchAction); }, }, { key: "compute", value: function () { var t = []; return ( x(this.manager.recognizers, function (e) { M(e.options.enable, [e]) && (t = t.concat(e.getTouchAction())); }), (function (t) { if (Pt(t, h)) return h; var e = Pt(t, l), n = Pt(t, f); return e && n ? h : e || n ? e ? l : f : Pt(t, u) ? u : c; })(t.join(" ")) ); }, }, { key: "preventDefaults", value: function (t) { var e = t.srcEvent, n = t.offsetDirection; if (this.manager.session.prevented) e.preventDefault(); else { var r = this.actions, i = Pt(r, h) && !d[h], o = Pt(r, f) && !d[f], a = Pt(r, l) && !d[l]; if (i) { var s = 1 === t.pointers.length, c = t.distance < 2, u = t.deltaTime < 250; if (s && c && u) return; } if (!a || !o) return i || (o && 6 & n) || (a && 24 & n) ? this.preventSrc(e) : void 0; } }, }, { key: "preventSrc", value: function (t) { (this.manager.session.prevented = !0), t.preventDefault(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== At(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== At(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === At(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function Tt(t) { var e = t.length; if (1 === e) return { x: i(t[0].clientX), y: i(t[0].clientY) }; for (var n = 0, r = 0, o = 0; o < e; ) (n += t[o].clientX), (r += t[o].clientY), o++; return { x: i(n / e), y: i(r / e) }; } function Nt(t) { for (var e = [], n = 0; n < t.pointers.length; ) (e[n] = { clientX: i(t.pointers[n].clientX), clientY: i(t.pointers[n].clientY), }), n++; return { timeStamp: a(), pointers: e, center: Tt(e), deltaX: t.deltaX, deltaY: t.deltaY, }; } function Bt(t, e, n) { n || (n = g); var r = e[n[0]] - t[n[0]], i = e[n[1]] - t[n[1]]; return (180 * Math.atan2(i, r)) / Math.PI; } function Lt(t, e) { return t === e ? 1 : o(t) >= o(e) ? t < 0 ? 2 : 4 : e < 0 ? 8 : 16; } function Dt(t, e, n) { return { x: e / t || 0, y: n / t || 0 }; } function _t(t, e, n) { var r = n.pointers.length, i = n.changedPointers.length, s = 1 & e && r - i == 0, c = 12 & e && r - i == 0; (n.isFirst = !!s), (n.isFinal = !!c), s && (t.session = {}), (n.eventType = e), (function (t, e) { var n = t.session, r = e.pointers, i = r.length; n.firstInput || (n.firstInput = Nt(e)), i > 1 && !n.firstMultiple ? (n.firstMultiple = Nt(e)) : 1 === i && (n.firstMultiple = !1); var s = n.firstInput, c = n.firstMultiple, u = c ? c.center : s.center, h = (e.center = Tt(r)); (e.timeStamp = a()), (e.deltaTime = e.timeStamp - s.timeStamp), (e.angle = Bt(u, h)), (e.distance = vt(u, h)), (function (t, e) { var n = e.center, r = t.offsetDelta || {}, i = t.prevDelta || {}, o = t.prevInput || {}; (1 !== e.eventType && 4 !== o.eventType) || ((i = t.prevDelta = { x: o.deltaX || 0, y: o.deltaY || 0 }), (r = t.offsetDelta = { x: n.x, y: n.y })), (e.deltaX = i.x + (n.x - r.x)), (e.deltaY = i.y + (n.y - r.y)); })(n, e), (e.offsetDirection = Lt(e.deltaX, e.deltaY)); var l, f, d = Dt(e.deltaTime, e.deltaX, e.deltaY); (e.overallVelocityX = d.x), (e.overallVelocityY = d.y), (e.overallVelocity = o(d.x) > o(d.y) ? d.x : d.y), (e.scale = c ? ((l = c.pointers), vt((f = r)[0], f[1], v) / vt(l[0], l[1], v)) : 1), (e.rotation = c ? (function (t, e) { return Bt(e[1], e[0], v) + Bt(t[1], t[0], v); })(c.pointers, r) : 0), (e.maxPointers = n.prevInput ? e.pointers.length > n.prevInput.maxPointers ? e.pointers.length : n.prevInput.maxPointers : e.pointers.length), (function (t, e) { var n, r, i, a, s = t.lastInterval || e, c = e.timeStamp - s.timeStamp; if ( 8 !== e.eventType && (c > 25 || void 0 === s.velocity) ) { var u = e.deltaX - s.deltaX, h = e.deltaY - s.deltaY, l = Dt(c, u, h); (r = l.x), (i = l.y), (n = o(l.x) > o(l.y) ? l.x : l.y), (a = Lt(u, h)), (t.lastInterval = e); } else (n = s.velocity), (r = s.velocityX), (i = s.velocityY), (a = s.direction); (e.velocity = n), (e.velocityX = r), (e.velocityY = i), (e.direction = a); })(n, e); })(t, n), t.emit("hammer.input", n), t.recognize(n), (t.session.prevInput = n); } function Rt(t) { return t.trim().split(/\s+/g); } function Ft(t, e, n) { x(Rt(e), function (e) { t.addEventListener(e, n, !1); }); } function Yt(t) { return (Yt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var Xt = (function () { function t(e, n) { !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t); var r = this; (this.manager = e), (this.callback = n), (this.eventHandler = function (t) { M(e.options.enable, [e]) && r.handler(t); }), this.init(); } var e, n; return ( (e = t), (n = [ { key: "handler", value: function () {} }, { key: "init", value: function () { var t, e, n; (t = this.manager), (e = this.events || ""), (n = this.eventHandler), x(Rt(e), function (e) { t.on("origin_input:".concat(e), n); }); }, }, { key: "destroy", value: function () { removeManagerListeners( this.manager, this.events || "", this.eventHandler, ); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Yt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Yt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Yt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function zt(t) { return Array.prototype.slice.call(t, 0); } function Wt(t, e, n) { for (var r = [], i = [], o = 0; o < t.length; ) { var a = e ? t[o][e] : t[o]; w(i, a) < 0 && r.push(t[o]), (i[o] = a), o++; } return ( n && (r = e ? r.sort(function (t, n) { return t[e] > n[e]; }) : r.sort()), r ); } function qt(t) { return (qt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function Vt(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Gt(t, e) { return (Gt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function Ht(t, e) { if (e && ("object" === qt(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function Ut(t) { return (Ut = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } var Zt = { touchstart: 1, touchmove: 2, touchend: 4, touchcancel: 8 }, Kt = "touchstart touchmove touchend touchcancel", $t = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && Gt(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = Ut(r); if (i) { var n = Ut(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return Ht(this, t); }); function a() { var t; return ( Vt(this, a), (a.prototype.evTarget = Kt), (a.prototype.targetIds = {}), (a.prototype.events = Kt), ((t = o.apply(this, arguments)).evTarget = Kt), (t.targetIds = {}), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = Zt[t.type], n = Qt.call(this, t, e); n && this.callback(this.manager, e, { pointers: n[0], changedPointers: n[1], pointerType: p, srcEvent: t, }); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== qt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== qt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === qt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Xt); function Qt(t, e) { var n, r, i = zt(t.touches), o = this.targetIds; if (3 & e && 1 === i.length) return (o[i[0].identifier] = !0), [i, i]; var a = zt(t.changedTouches), s = []; if ((this.target, (r = i), 1 === e)) for (n = 0; n < r.length; ) (o[r[n].identifier] = !0), n++; for (n = 0; n < a.length; ) o[a[n].identifier] && s.push(a[n]), 12 & e && delete o[a[n].identifier], n++; return s.length ? [Wt(r.concat(s), "identifier", !0), s] : void 0; } function Jt(t) { return (Jt = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var te = (function () { function t(e) { var n, r = this; !(function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), (this.options = m({}, re.defaults, e || {})), (this.handlers = {}), (this.filters = []), (this.session = {}), (this.recognizers = []), (this.input = ((n = $t), this.options.inputClass && (n = inputClass), new n(this, _t))), (this.touchAction = new It(this, this.options.touchAction)), x( this.options.recognizers, function (t) { var e = r.add(new t[0](t[1])); t[2] && e.recognizeWith(t[2]), t[3] && e.requireFailure(t[3]); }, this, ); } var e, n; return ( (e = t), (n = [ { key: "set", value: function (t) { return ( m(this.options, t), t.touchAction && this.touchAction.update(), this ); }, }, { key: "stop", value: function (t) { this.session.stopped = t ? 2 : 1; }, }, { key: "addFilter", value: function (t) { if ("function" != typeof t) throw new Error("filter must be a function"); this.filters.push(t); }, }, { key: "recognize", value: function (t) { var e = this.session; if (!e.stopped) { var n; this.touchAction.preventDefaults(t); var r = this.recognizers, i = e.curRecognizer; (!i || (i && 8 & i.state)) && (i = e.curRecognizer = null); for (var o = 0; o < r.length; ) (n = r[o]), 2 === e.stopped || (i && n !== i && !n.canRecognizeWith(i)) ? n.reset() : n.recognize(t), !i && 14 & n.state && (i = e.curRecognizer = n), o++; } }, }, { key: "get", value: function (t) { if (t instanceof E) return t; for (var e = this.recognizers, n = 0; n < e.length; n++) if (e[n].options.event === t) return e[n]; return null; }, }, { key: "add", value: function (t) { if (S(t, "add", this)) return this; var e = this.get(t.options.event); return ( e && this.remove(e), this.recognizers.push(t), (t.manager = this), this.touchAction.update(), t ); }, }, { key: "remove", value: function (t) { if (S(t, "remove", this)) return this; if ((t = this.get(t))) { var e = this.recognizers, n = w(e, t); -1 !== n && (e.splice(n, 1), this.touchAction.update()); } return this; }, }, { key: "on", value: function (t, e) { if (void 0 !== t && void 0 !== e) { var n = this.handlers; return ( x(Rt(t), function (t) { (n[t] = n[t] || []), n[t].push(e); }), this ); } }, }, { key: "off", value: function (t, e) { if (void 0 !== t) { var n = this.handlers; return ( x(Rt(t), function (t) { e ? n[t] && n[t].splice(w(n[t], e), 1) : delete n[t]; }), this ); } }, }, { key: "emit", value: function (t, e) { var n = this.handlers[t] && this.handlers[t].slice(); if ((this.filters, n && n.length)) { t.startsWith("origin_input") || ((e.type = t), (e.preventDefault = function () { e.srcEvent.preventDefault && e.srcEvent.preventDefault(); })); for (var r = 0; r < n.length; ) n[r](e), r++; } }, }, { key: "destroy", value: function () { (this.handlers = {}), (this.filters = []), (this.session = {}), this.input.destroy(); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== Jt(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== Jt(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === Jt(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), t ); })(); function ee(t) { return (ee = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function ne(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== ee(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== ee(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === ee(i) ? i : String(i)), r, ); } var i; } var re = (function (t, e, n) { return ( e && ne(t.prototype, e), n && ne(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t ); })(function t(e) { return ( (function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); })(this, t), ((e = e || {}).recognizers = n(e.recognizers, t.defaults.preset)), new te(e) ); }); function ie(t) { return (ie = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function oe(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function"); } function ae(t, e) { return (ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return (t.__proto__ = e), t; })(t, e); } function se(t, e) { if (e && ("object" === ie(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError( "Derived constructors may only return object or undefined", ); return (function (t) { if (void 0 === t) throw new ReferenceError( "this hasn't been initialised - super() hasn't been called", ); return t; })(t); } function ce(t) { return (ce = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); })(t); } re.defaults = { domEvents: !1, touchAction: s, enable: !0, inputClass: null, preset: [ [z, { enable: !1 }], [K, { enable: !1 }, ["rotate"]], [dt, { direction: 6 }], [ot, { direction: 6 }, ["swipe"]], [wt], [wt, { event: "doubletap", taps: 2 }, ["tap"]], [Et], ], }; var ue = { pointerdown: 1, pointermove: 2, pointerup: 4, pointercancel: 8, pointerout: 8, }, he = { 2: p, 3: "pen", 4: "mouse", 5: "kinect" }, le = "pointerdown", fe = "pointermove pointerup pointercancel", de = (function (t) { !(function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Super expression must either be null or a function", ); (t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 }, })), Object.defineProperty(t, "prototype", { writable: !1 }), e && ae(t, e); })(a, t); var e, n, r, i, o = ((r = a), (i = (function () { if ("undefined" == typeof Reflect || !Reflect.construct) return !1; if (Reflect.construct.sham) return !1; if ("function" == typeof Proxy) return !0; try { return ( Boolean.prototype.valueOf.call( Reflect.construct(Boolean, [], function () {}), ), !0 ); } catch (t) { return !1; } })()), function () { var t, e = ce(r); if (i) { var n = ce(this).constructor; t = Reflect.construct(e, arguments, n); } else t = e.apply(this, arguments); return se(this, t); }); function a() { var t; return ( oe(this, a), (a.prototype.events = "".concat(le, " ").concat(fe)), ((t = o.apply(this, arguments)).evEl = le), (t.evWin = fe), (t.store = t.manager.session.pointerEvents = []), t ); } return ( (e = a), (n = [ { key: "handler", value: function (t) { var e = this.store, n = !1, r = t.type.toLowerCase().replace("ms", ""), i = ue[r], o = he[t.pointerType] || t.pointerType, a = o === p, s = w(e, t.pointerId, "pointerId"); 1 & i && (0 === t.button || a) ? s < 0 && (e.push(t), (s = e.length - 1)) : 12 & i && (n = !0), s < 0 || ((e[s] = t), this.callback(this.manager, i, { pointers: e, changedPointers: [t], pointerType: o, srcEvent: t, }), n && e.splice(s, 1)); }, }, ]) && (function (t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; (r.enumerable = r.enumerable || !1), (r.configurable = !0), "value" in r && (r.writable = !0), Object.defineProperty( t, ((i = (function (t, e) { if ("object" !== ie(t) || null === t) return t; var n = t[Symbol.toPrimitive]; if (void 0 !== n) { var r = n.call(t, "string"); if ("object" !== ie(r)) return r; throw new TypeError( "@@toPrimitive must return a primitive value.", ); } return String(t); })(r.key)), "symbol" === ie(i) ? i : String(i)), r, ); } var i; })(e.prototype, n), Object.defineProperty(e, "prototype", { writable: !1 }), a ); })(Xt); function pe(t, e, n) { x(Rt(e), function (e) { t.removeEventListener(e, n, !1); }); } function ge(t, e, n) { var r = "DEPRECATED METHOD: ".concat(e, "\n").concat(n, " AT \n"); return function () { var e = new Error("get-stack-trace"), n = e && e.stack ? e.stack .replace(/^[^\(]+?[\n$]/gm, "") .replace(/^\s+at\s+/gm, "") .replace(/^Object.\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", i = console.warn; return i && i(r, n), t.apply(this, arguments); }; } var ve = ge( function (t, e, n) { for (var r = Object.keys(e), i = 0; i < r.length; ) (!n || (n && void 0 === t[r[i]])) && (t[r[i]] = e[r[i]]), i++; return t; }, "extend", "Use `assign`.", ), ye = ge( function (t, e) { return ve(t, e, !0); }, "merge", "Use `assign`.", ), me = m(re, { INPUT_START: 1, INPUT_MOVE: 2, INPUT_END: 4, INPUT_CANCEL: 8, STATE_POSSIBLE: 1, STATE_BEGAN: 2, STATE_CHANGED: 4, STATE_ENDED: 8, STATE_RECOGNIZED: 8, STATE_CANCELLED: 16, STATE_FAILED: y, DIRECTION_NONE: 1, DIRECTION_LEFT: 2, DIRECTION_RIGHT: 4, DIRECTION_UP: 8, DIRECTION_DOWN: 16, DIRECTION_HORIZONTAL: 6, DIRECTION_VERTICAL: 24, DIRECTION_ALL: 30, Manager: te, Input: Xt, TouchAction: It, TouchInput: $t, PointerEventInput: de, Recognizer: E, AttrRecognizer: B, Tap: wt, Pan: ot, Swipe: dt, Pinch: K, Rotate: z, Press: Et, on: Ft, off: pe, each: x, merge: ye, extend: ve, assign: m, inherit: function (t, e, n) { var r, i = e.prototype; ((r = t.prototype = Object.create(i)).constructor = t), (r._super = i), n && m(r, n); }, bindFn: pt, toArray: zt, inArray: w, uniqueArray: Wt, splitStr: Rt, boolOrFn: M, hasParent: function (t, e) { for (; t; ) { if (t === e) return !0; t = t.parentNode; } return !1; }, addEventListeners: Ft, removeEventListeners: pe, }); return e; })()); }, 4: function (t, e, n) { "use strict"; n.d(e, "b", function () { return i.a; }), n.d(e, "c", function () { return i.b; }), n.d(e, "d", function () { return i.c; }), n.d(e, "a", function () { return r; }); var r = {}; n.r(r), n.d(r, "leftTranslate", function () { return o; }), n.d(r, "leftRotate", function () { return a; }), n.d(r, "leftScale", function () { return s; }), n.d(r, "transform", function () { return c; }), n.d(r, "direction", function () { return u; }), n.d(r, "angleTo", function () { return h; }), n.d(r, "vertical", function () { return l; }); var i = n(5); function o(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromTranslation(r, n), i.a.multiply(t, r, e); } function a(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromRotation(r, n), i.a.multiply(t, r, e); } function s(t, e, n) { var r = [0, 0, 0, 0, 0, 0, 0, 0, 0]; return i.a.fromScaling(r, n), i.a.multiply(t, r, e); } function c(t, e) { for ( var n, r, c, u = t ? [].concat(t) : [1, 0, 0, 0, 1, 0, 0, 0, 1], h = 0, l = e.length; h < l; h++ ) { var f = e[h]; switch (f[0]) { case "t": o(u, u, [f[1], f[2]]); break; case "s": s(u, u, [f[1], f[2]]); break; case "r": a(u, u, f[1]); break; case "m": (n = u), (r = u), (c = f[1]), i.a.multiply(n, c, r); } } return u; } function u(t, e) { return t[0] * e[1] - e[0] * t[1]; } function h(t, e, n) { var r = i.b.angle(t, e), o = u(t, e) >= 0; return n ? (o ? 2 * Math.PI - r : r) : o ? r : 2 * Math.PI - r; } function l(t, e, n) { return ( n ? ((t[0] = e[1]), (t[1] = -1 * e[0])) : ((t[0] = -1 * e[1]), (t[1] = e[0])), t ); } }, 40: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } n.d(e, "c", function () { return o; }), n.d(e, "b", function () { return a; }), n.d(e, "a", function () { return s; }); var i = {}; function o(t) { void 0 === t && (t = {}), (t = t); } function a(t) { return (null == i ? void 0 : i.requestAnimationFrame) ? i.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : r(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); } function s(t) { return (null == i ? void 0 : i.clearAnimationFrame) ? i.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : r(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); } }, 41: function (t, e, n) { "use strict"; var r = {}; n.r(r), n.d(r, "proccessToFunc", function () { return u; }), n.d(r, "buildTextureData", function () { return h; }), n.d(r, "buildTextureDataWithOneEdgeAttr", function () { return l; }), n.d(r, "buildTextureDataWithTwoEdgeAttr", function () { return f; }), n.d(r, "attributesToTextureData", function () { return d; }), n.d(r, "arrayToTextureData", function () { return p; }), n.d(r, "radialLayout", function () { return g; }); var i = n(1), o = n(95), a = n(2), s = n(0), c = a.h.traverseTree, u = function (t, e) { return t ? Object(s.isNumber)(t) ? function (e) { return t; } : t : function (t) { return e || 1; }; }, h = function (t, e) { var n = [], r = [], i = {}, o = 0; for (o = 0; o < t.length; o++) { var a = t[o]; (i[a.id] = o), n.push(a.x), n.push(a.y), n.push(0), n.push(0), r.push([]); } for (o = 0; o < e.length; o++) { var s = e[o]; r[i[s.source]].push(i[s.target]), r[i[s.target]].push(i[s.source]); } var c = 0; for (o = 0; o < t.length; o++) { var u = n.length, h = r[o], l = h.length; (n[4 * o + 2] = u), (n[4 * o + 3] = h.length), (c = Math.max(c, h.length)); for (var f = 0; f < l; ++f) { var d = h[f]; n.push(+d); } } for (; n.length % 4 != 0; ) n.push(0); return { array: new Float32Array(n), maxEdgePerVetex: c }; }, l = function (t, e, n) { var r = [], i = [], o = {}, a = 0; for (a = 0; a < t.length; a++) { var s = t[a]; (o[s.id] = a), r.push(s.x), r.push(s.y), r.push(0), r.push(0), i.push([]); } for (a = 0; a < e.length; a++) { var c = e[a]; i[o[c.source]].push(o[c.target]), i[o[c.source]].push(n(c)), i[o[c.target]].push(o[c.source]), i[o[c.target]].push(n(c)); } var u = 0; for (a = 0; a < t.length; a++) { var h = r.length, l = i[a], f = l.length; (r[4 * a + 2] = h), (r[4 * a + 3] = f / 2), (u = Math.max(u, f / 2)); for (var d = 0; d < f; ++d) { var p = l[d]; r.push(+p); } } for (; r.length % 4 != 0; ) r.push(0); return { array: new Float32Array(r), maxEdgePerVetex: u }; }, f = function (t, e, n, r) { var i = [], o = [], a = {}, s = 0; for (s = 0; s < t.length; s++) { var c = t[s]; (a[c.id] = s), i.push(c.x), i.push(c.y), i.push(0), i.push(0), o.push([]); } for (s = 0; s < e.length; s++) { var u = e[s]; o[a[u.source]].push(a[u.target]), o[a[u.source]].push(n(u)), o[a[u.source]].push(r(u)), o[a[u.source]].push(0), o[a[u.target]].push(a[u.source]), o[a[u.target]].push(n(u)), o[a[u.target]].push(r(u)), o[a[u.target]].push(0); } var h = 0; for (s = 0; s < t.length; s++) { var l = i.length, f = o[s], d = f.length; (i[4 * s + 2] = l + (1048576 * d) / 4), (i[4 * s + 3] = 0), (h = Math.max(h, d / 4)); for (var p = 0; p < d; ++p) { var g = f[p]; i.push(+g); } } for (; i.length % 4 != 0; ) i.push(0); return { array: new Float32Array(i), maxEdgePerVetex: h }; }, d = function (t, e) { var n = [], r = t.length, i = {}; return ( e.forEach(function (e) { t.forEach(function (t, o) { if ( (void 0 === i[e[t]] && (i[e[t]] = Object.keys(i).length), n.push(i[e[t]]), o === r - 1) ) for (; n.length % 4 != 0; ) n.push(0); }); }), { array: new Float32Array(n), count: Object.keys(i).length } ); }, p = function (t) { for ( var e = [], n = t.length, r = t[0].length, i = function (r) { t.forEach(function (t, i) { if ((e.push(t[r]), i === n - 1)) for (; e.length % 4 != 0; ) e.push(0); }); }, o = 0; o < r; o++ ) i(o); return new Float32Array(e); }, g = function (t, e) { var n = { x: 1 / 0, y: 1 / 0 }, r = { x: -1 / 0, y: -1 / 0 }, i = "x", o = "y"; e && ["V", "TB", "BT"].indexOf(e) >= 0 && ((o = "x"), (i = "y")); var a = 0; c(t, function (t) { return ( a++, t.x > r.x && (r.x = t.x), t.x < n.x && (n.x = t.x), t.y > r.y && (r.y = t.y), t.y < n.y && (n.y = t.y), !0 ); }); var s = (2 * Math.PI) / a, u = r[o] - n[o]; return ( 0 === u || c(t, function (e) { var r = ((e[o] - n[o]) / u) * (2 * Math.PI - s) + s, a = Math.abs("x" === i ? e.x - t.x : e.y - t.y); return (e.x = a * Math.cos(r)), (e.y = a * Math.sin(r)), !0; }), t ); }, v = Object(i.a)(Object(i.a)(Object(i.a)({}, a.h), o), r); e.a = v; }, 423: function (t, e, n) { "use strict"; var r = function () { return (r = Object.assign || function (t) { for (var e, n = 1, r = arguments.length; n < r; n++) for (var i in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]); return t; }).apply(this, arguments); }; function i(t, e) { var n = {}; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]); if (null != t && "function" == typeof Object.getOwnPropertySymbols) { var i = 0; for (r = Object.getOwnPropertySymbols(t); i < r.length; i++) e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[i]) && (n[r[i]] = t[r[i]]); } return n; } var o = n(2), a = n(0); Object(o.l)( "circle", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), s = Object(a.deepMix)({}, i, t.icon), c = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, }), u = s.width, h = s.height, l = s.show, f = s.text; return ( l && (f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, s, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -u / 2, y: -h / 2 }, s), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), c ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t)[0] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -d, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: d, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -d, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: d, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.deepMix)({}, e, n), o = this.getSize(t)[0] / 2; return r({ x: 0, y: 0, r: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getSize(t), i = { stroke: t.color, r: r[0] / 2 }, o = e.get("keyShape"), s = Object(a.deepMix)({}, o.attr(), i, t.style); this.updateShape(t, e, s, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "rect", { options: { size: [100, 30], style: { radius: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "rect", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t), r = e.addShape("rect", { attrs: n, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }); return this.drawLinkPoints(t, e), r; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = e.get("keyShape"); t.size || ((i[0] = o.attr("width") || r.width), (i[1] = o.attr("height") || r.height)); var s = { stroke: t.color, x: -i[0] / 2, y: -i[1] / 2, width: i[0], height: i[1], }, c = Object(a.mix)({}, r, o.attr(), s); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !1), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "ellipse", { options: { size: [80, 40], style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "ellipse", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("ellipse", { attrs: o, className: "ellipse-keyShape", name: "ellipse-keyShape", draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0] / 2, g = d[1] / 2; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = o[0] / 2, c = o[1] / 2; return r({ x: 0, y: 0, rx: s, ry: c }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getSize(t), o = { stroke: t.color, rx: i[0] / 2, ry: i[1] / 2 }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "diamond", { options: { size: [80, 80], style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "diamond", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, getPath: function (t) { var e = this.getSize(t), n = e[0], r = e[1]; return [ ["M", 0, -r / 2], ["L", n / 2, 0], ["L", 0, r / 2], ["L", -n / 2, 0], ["Z"], ]; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, }, "single-node", ), Object(o.l)( "triangle", { options: { size: 40, direction: "up", style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, offset: 15, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, offset: 6, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "triangle", labelPosition: "bottom", drawShape: function (t, e) { var n = this.getOptions(t), i = n.icon, o = void 0 === i ? {} : i, a = n.direction, s = this.getShapeStyle(t), c = t.direction || a, u = e.addShape("path", { attrs: s, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), h = o.width, l = o.height, f = o.show, d = o.offset, p = o.text; if (f) if (p) e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, o, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); else { var g = -h / 2, v = -l / 2; ("up" !== c && "down" !== c) || (v += d), ("left" !== c && "right" !== c) || (g += d), e.addShape("image", { attrs: r({ x: g, y: v }, o), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }); } return this.drawLinkPoints(t, e), u; }, drawLinkPoints: function (t, e) { var n = this.getOptions(t), o = n.linkPoints, a = void 0 === o ? {} : o, s = n.direction, c = t.direction || s, u = a.top, h = a.left, l = a.right, f = a.bottom, d = a.size, p = a.r, g = i(a, ["top", "left", "right", "bottom", "size", "r"]), v = this.getSize(t)[0]; if (h) { var y = null, m = v * Math.sin((1 / 3) * Math.PI), b = v * Math.sin((1 / 3) * Math.PI); "up" === c ? (y = [-b, m]) : "down" === c ? (y = [-b, -m]) : "left" === c && (y = [-b, b - m]), y && e.addShape("circle", { attrs: r(r({}, g), { x: y[0], y: y[1], r: d / 2 || p || 5, }), className: "link-point-left", name: "link-point-left", }); } if (l) { var x = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (x = [b, m]) : "down" === c ? (x = [b, -m]) : "right" === c && (x = [b, b - m]), x && e.addShape("circle", { attrs: r(r({}, g), { x: x[0], y: x[1], r: d / 2 || p || 5, }), className: "link-point-right", name: "link-point-right", }); } if (u) { var S = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "up" === c ? (S = [b - m, -m]) : "left" === c ? (S = [b, -m]) : "right" === c && (S = [-b, -m]), S && e.addShape("circle", { attrs: r(r({}, g), { x: S[0], y: S[1], r: d / 2 || p || 5, }), className: "link-point-top", name: "link-point-top", }); } if (f) { var w = null; (m = v * Math.sin((1 / 3) * Math.PI)), (b = v * Math.sin((1 / 3) * Math.PI)); "down" === c ? (w = [-b + m, m]) : "left" === c ? (w = [b, m]) : "right" === c && (w = [-b, m]), w && e.addShape("circle", { attrs: r(r({}, g), { x: w[0], y: w[1], r: d / 2 || p || 5, }), className: "link-point-bottom", name: "link-point-bottom", }); } }, getPath: function (t) { var e = this.getOptions(t).direction, n = t.direction || e, r = this.getSize(t)[0], i = r * Math.sin((1 / 3) * Math.PI), o = r * Math.sin((1 / 3) * Math.PI), a = [["M", -o, i], ["L", 0, -i], ["L", o, i], ["Z"]]; return ( "down" === n ? (a = [["M", -o, -i], ["L", o, -i], ["L", 0, i], ["Z"]]) : "left" === n ? (a = [["M", -o, o - i], ["L", o, -o], ["L", o, o], ["Z"]]) : "right" === n && (a = [["M", o, o - i], ["L", -o, o], ["L", -o, -o], ["Z"]]), a ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}), i = n.linkPoints, o = n.direction, s = t.direction || o, c = e.find(function (t) { return "link-point-left" === t.get("className"); }), u = e.find(function (t) { return "link-point-right" === t.get("className"); }), h = e.find(function (t) { return "link-point-top" === t.get("className"); }), l = e.find(function (t) { return "link-point-bottom" === t.get("className"); }), f = i, d = c || u || h || l; d && (f = d.attr()); var p = Object(a.mix)({}, f, t.linkPoints), g = p.fill, v = p.stroke, y = p.lineWidth, m = p.size / 2; m || (m = p.r); var b = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, bottom: void 0, }, x = b.left, S = b.right, w = b.top, O = b.bottom, M = this.getSize(t)[0], k = { r: m, fill: g, stroke: v, lineWidth: y }, j = null, C = M * Math.sin((1 / 3) * Math.PI), E = M * Math.sin((1 / 3) * Math.PI); "up" === s ? (j = [-E, C]) : "down" === s ? (j = [-E, -C]) : "left" === s && (j = [-E, E - C]), j && (c ? x || void 0 === x ? c.attr(r(r({}, k), { x: j[0], y: j[1] })) : c.remove() : x && e.addShape("circle", { attrs: r(r({}, k), { x: j[0], y: j[1] }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, })); var P = null; "up" === s ? (P = [E, C]) : "down" === s ? (P = [E, -C]) : "right" === s && (P = [E, E - C]), P && (u ? S || void 0 === S ? u.attr(r(r({}, k), { x: P[0], y: P[1] })) : u.remove() : S && e.addShape("circle", { attrs: r(r({}, k), { x: P[0], y: P[1] }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, })); var A = null; "up" === s ? (A = [E - C, -C]) : "left" === s ? (A = [E, -C]) : "right" === s && (A = [-E, -C]), A && (h ? w || void 0 === w ? h.attr(r(r({}, k), { x: A[0], y: A[1] })) : h.remove() : w && e.addShape("circle", { attrs: r(r({}, k), { x: A[0], y: A[1] }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, })); var I = null; "down" === s ? (I = [-E + C, C]) : "left" === s ? (I = [E, C]) : "right" === s && (I = [-E, C]), I && (l ? O || void 0 === O ? l.attr(r(r({}, k), { x: I[0], y: I[1] })) : l.remove() : O && e.addShape("circle", { attrs: r(r({}, k), { x: I[0], y: I[1] }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, })); }, }, "single-node", ), Object(o.l)( "modelRect", { options: { size: [185, 70], style: { radius: 5, stroke: "#69c0ff", fill: "#ffffff", lineWidth: o.e.defaultNode.style.lineWidth, fillOpacity: 1, }, labelCfg: { style: { fill: "#595959", fontSize: 14 }, offset: 30, }, descriptionCfg: { style: { fontSize: 12, fill: "#bfbfbf" }, paddingTop: 0, }, preRect: { show: !0, width: 4, fill: "#40a9ff", radius: 2 }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: 10, lineWidth: 1, fill: "#72CC4A", stroke: "#72CC4A", }, logoIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg", width: 16, height: 16, offset: 0, }, stateIcon: { show: !0, x: 0, y: 0, img: "https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg", width: 16, height: 16, offset: -5, }, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, shapeType: "modelRect", drawShape: function (t, e) { var n = this.getOptions(t).preRect, o = void 0 === n ? {} : n, a = this.getShapeStyle(t), s = this.getSize(t), c = s[0], u = s[1], h = e.addShape("rect", { attrs: a, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), l = o.show, f = i(o, ["show"]); return ( l && e.addShape("rect", { attrs: r({ x: -c / 2, y: -u / 2, height: u }, f), className: "pre-rect", name: "pre-rect", draggable: !0, }), this.drawLogoIcon(t, e), this.drawStateIcon(t, e), this.drawLinkPoints(t, e), h ); }, drawLogoIcon: function (t, e) { var n = this.getOptions(t).logoIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || -a / 2 + s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-logo-icon", name: "rect-logo-icon", draggable: !0, }); } }, drawStateIcon: function (t, e) { var n = this.getOptions(t).stateIcon, o = void 0 === n ? {} : n, a = this.getSize(t)[0]; if (o.show) { var s = o.width, c = o.height, u = o.x, h = o.y, l = o.offset, f = o.text, d = i(o, ["width", "height", "x", "y", "offset", "text"]); f ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, d, ), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }) : e.addShape("image", { attrs: r(r({}, d), { x: u || a / 2 - s + l, y: h || -c / 2, width: s, height: c, }), className: "rect-state-icon", name: "rect-state-icon", draggable: !0, }); } }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.bottom, h = o.size, l = o.r, f = i(o, ["top", "left", "right", "bottom", "size", "r"]), d = this.getSize(t), p = d[0], g = d[1]; s && e.addShape("circle", { attrs: r(r({}, f), { x: -p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), c && e.addShape("circle", { attrs: r(r({}, f), { x: p / 2, y: 0, r: h / 2 || l || 5 }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), a && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: -g / 2, r: h / 2 || l || 5 }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), u && e.addShape("circle", { attrs: r(r({}, f), { x: 0, y: g / 2, r: h / 2 || l || 5 }), className: "link-point-bottom", name: "link-point-bottom", isAnchorPoint: !0, }); }, drawLabel: function (t, e) { var n = this.getOptions(t), i = n.labelCfg, o = void 0 === i ? {} : i, s = n.logoIcon, c = void 0 === s ? {} : s, u = n.descriptionCfg, h = void 0 === u ? {} : u, l = this.getSize(t)[0], f = null, d = c.show, p = c.width, g = -l / 2 + o.offset; d && (g = -l / 2 + p + o.offset); var v = o.style, y = h.style, m = h.paddingTop; return ( Object(a.isString)(t.description) ? ((f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: -5, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), e.addShape("text", { attrs: r(r({}, y), { x: g, y: 17 + (m || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, })) : (f = e.addShape("text", { attrs: r(r({}, v), { x: g, y: 7, text: t.label }), className: "text-shape", name: "text-shape", draggable: !0, })), f ); }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getSize(t), s = i.width || o[0], c = i.height || o[1]; return r({ x: -s / 2, y: -c / 2, width: s, height: c }, i); }, update: function (t, e) { var n = this.getOptions(t), o = n.style, s = void 0 === o ? {} : o, c = n.labelCfg, u = void 0 === c ? {} : c, h = n.descriptionCfg, l = void 0 === h ? {} : h, f = this.getSize(t), d = f[0], p = f[1]; e.get("keyShape").attr( r(r({}, s), { x: -d / 2, y: -p / 2, width: d, height: p }), ); var g = e.getContainer(), v = g.find(function (t) { return "rect-logo-icon" === t.get("className"); }), y = v ? v.attr() : {}, m = Object(a.mix)({}, y, t.logoIcon), b = m.width; void 0 === b && (b = this.options.logoIcon.width); var x = t.logoIcon ? t.logoIcon.show : void 0, S = u.offset, w = -d / 2 + b + S; x || void 0 === x || (w = -d / 2 + S); var O = g.find(function (t) { return "node-label" === t.get("className"); }), M = g.find(function (t) { return "rect-description" === t.get("className"); }); if (t.label) if (O) { var k = t.labelCfg ? t.labelCfg.style : {}, j = Object(a.mix)({}, O.attr(), k); t.label && (j.text = t.label), (j.x = w), Object(a.isString)(t.description) && (j.y = -5), M && (M.resetMatrix(), M.attr({ x: w })), O.resetMatrix(), O.attr(j); } else g.addShape("text", { attrs: r(r({}, u.style), { x: w, y: t.description ? -5 : 7, text: t.label, }), className: "node-label", name: "node-label", draggable: !0, }); if (Object(a.isString)(t.description)) { var C = l.paddingTop; if (M) { k = t.descriptionCfg ? t.descriptionCfg.style : {}; var E = Object(a.mix)({}, M.attr(), k); Object(a.isString)(t.description) && (E.text = t.description), (E.x = w), M.resetMatrix(), M.attr(r(r({}, E), { y: 17 + (C || 0) })); } else g.addShape("text", { attrs: r(r({}, l.style), { x: w, y: 17 + (C || 0), text: t.description, }), className: "rect-description", name: "rect-description", draggable: !0, }); } var P = g.find(function (t) { return "pre-rect" === t.get("className"); }); if (P) { var A = Object(a.mix)({}, P.attr(), t.preRect); P.attr(r(r({}, A), { x: -d / 2, y: -p / 2, height: p })); } if (v) if (x || void 0 === x) { var I = m.width, T = m.height, N = m.x, B = m.y, L = m.offset, D = i(m, ["width", "height", "x", "y", "offset"]); v.attr( r(r({}, D), { x: N || -d / 2 + I + L, y: B || -T / 2, width: I, height: T, }), ); } else v.remove(); else x && this.drawLogoIcon(t, g); var _ = g.find(function (t) { return "rect-state-icon" === t.get("className"); }), R = _ ? _.attr() : {}, F = Object(a.mix)({}, R, t.stateIcon); if (_) { F.show || void 0 === F.show || _.remove(); var Y = F.width, X = ((T = F.height), (N = F.x), (B = F.y), F.offset), z = i(F, ["width", "height", "x", "y", "offset"]); _.attr( r(r({}, z), { x: N || d / 2 - Y + X, y: B || -T / 2, width: Y, height: T, }), ); } else F.show && this.drawStateIcon(t, g); this.updateLinkPoints(t, g); }, }, "single-node", ), Object(o.l)( "star", { options: { size: 60, style: { stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "star", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), a = e.addShape("path", { attrs: o, className: "".concat(this.type, "-keyShape"), name: "".concat(this.type, "-keyShape"), draggable: !0, }), s = i.width, c = i.height, u = i.show, h = i.text; return ( u && (h ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, i, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -s / 2, y: -c / 2 }, i), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })), this.drawLinkPoints(t, e), a ); }, drawLinkPoints: function (t, e) { var n = this.getOptions(t).linkPoints, o = void 0 === n ? {} : n, a = o.top, s = o.left, c = o.right, u = o.leftBottom, h = o.rightBottom, l = o.size, f = o.r, d = i(o, [ "top", "left", "right", "leftBottom", "rightBottom", "size", "r", ]), p = this.getSize(t)[0]; if (c) { var g = Math.cos(0.1 * Math.PI) * p, v = Math.sin(0.1 * Math.PI) * p; e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right", name: "link-point-right", }); } if (a) { (g = Math.cos(0.5 * Math.PI) * p), (v = Math.sin(0.5 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-top", name: "link-point-top", }); } if (s) { (g = Math.cos(0.9 * Math.PI) * p), (v = Math.sin(0.9 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left", name: "link-point-left", }); } if (u) { (g = Math.cos(1.3 * Math.PI) * p), (v = Math.sin(1.3 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-left-bottom", name: "link-point-left-bottom", }); } if (h) { (g = Math.cos(1.7 * Math.PI) * p), (v = Math.sin(1.7 * Math.PI) * p); e.addShape("circle", { attrs: r(r({}, d), { x: g, y: -v, r: l / 2 || f || 5 }), className: "link-point-right-bottom", name: "link-point-right-bottom", }); } }, getPath: function (t) { for ( var e = this.getSize(t)[0], n = (3 * e) / 8, r = t.innerR || n, i = [], o = 0; o < 5; o++ ) { var a = Math.cos(((18 + 72 * o) / 180) * Math.PI) * e, s = Math.sin(((18 + 72 * o) / 180) * Math.PI) * e, c = Math.cos(((54 + 72 * o) / 180) * Math.PI) * r, u = Math.sin(((54 + 72 * o) / 180) * Math.PI) * r; 0 === o ? i.push(["M", a, -s]) : i.push(["L", a, -s]), i.push(["L", c, -u]); } return i.push(["Z"]), i; }, getShapeStyle: function (t) { var e = this.getOptions(t).style, n = { stroke: t.color }, i = Object(a.mix)({}, e, n), o = this.getPath(t); return r({ path: o }, i); }, update: function (t, e) { var n = e.getContainer(), r = this.getOptions({}).style, i = this.getPath(t), o = { stroke: t.color, path: i }, s = e.get("keyShape"), c = Object(a.mix)({}, r, s.attr(), o); (c = Object(a.mix)(c, t.style)), this.updateShape(t, e, c, !0), this.updateLinkPoints(t, n); }, updateLinkPoints: function (t, e) { var n = this.getOptions({}).linkPoints, i = e.find(function (t) { return "link-point-left" === t.get("className"); }), o = e.find(function (t) { return "link-point-right" === t.get("className"); }), s = e.find(function (t) { return "link-point-top" === t.get("className"); }), c = e.find(function (t) { return "link-point-left-bottom" === t.get("className"); }), u = e.find(function (t) { return "link-point-right-bottom" === t.get("className"); }), h = n, l = i || o || s || c || u; l && (h = l.attr()); var f = Object(a.mix)({}, h, t.linkPoints), d = f.fill, p = f.stroke, g = f.lineWidth, v = f.size / 2; v || (v = f.r); var y = t.linkPoints ? t.linkPoints : { left: void 0, right: void 0, top: void 0, leftBottom: void 0, rightBottom: void 0, }, m = y.left, b = y.right, x = y.top, S = y.leftBottom, w = y.rightBottom, O = this.getSize(t)[0], M = { r: v, fill: d, stroke: p, lineWidth: g }, k = Math.cos(0.1 * Math.PI) * O, j = Math.sin(0.1 * Math.PI) * O; o ? b || void 0 === b ? o.attr(r(r({}, M), { x: k, y: -j })) : o.remove() : b && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-right", name: "link-point-right", isAnchorPoint: !0, }), (k = Math.cos(0.5 * Math.PI) * O), (j = Math.sin(0.5 * Math.PI) * O), s ? x || void 0 === x ? s.attr(r(r({}, M), { x: k, y: -j })) : s.remove() : x && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-top", name: "link-point-top", isAnchorPoint: !0, }), (k = Math.cos(0.9 * Math.PI) * O), (j = Math.sin(0.9 * Math.PI) * O), i ? m || void 0 === m ? i.attr(r(r({}, M), { x: k, y: -j })) : i.remove() : m && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-left", name: "link-point-left", isAnchorPoint: !0, }), (k = Math.cos(1.3 * Math.PI) * O), (j = Math.sin(1.3 * Math.PI) * O), c ? S || void 0 === S ? c.attr(r(r({}, M), { x: k, y: -j })) : c.remove() : S && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-left-bottom", name: "link-point-left-bottom", isAnchorPoint: !0, }), (k = Math.cos(1.7 * Math.PI) * O), (j = Math.sin(1.7 * Math.PI) * O), u ? w || void 0 === w ? u.attr(r(r({}, M), { x: k, y: -j })) : c.remove() : w && e.addShape("circle", { attrs: r(r({}, M), { x: k, y: -j }), className: "link-point-right-bottom", name: "link-point-right-bottom", isAnchorPoint: !0, }); }, }, "single-node", ); var s = o.h.defaultSubjectColors; Object(o.l)( "donut", { options: { size: o.e.defaultNode.size, style: { x: 0, y: 0, stroke: o.e.defaultNode.style.stroke, fill: o.e.defaultNode.style.fill, lineWidth: o.e.defaultNode.style.lineWidth, }, labelCfg: { style: { fill: o.e.nodeLabel.style.fill, fontSize: o.e.nodeLabel.style.fontSize, }, }, linkPoints: { top: !1, right: !1, bottom: !1, left: !1, size: o.e.defaultNode.linkPoints.size, lineWidth: o.e.defaultNode.linkPoints.lineWidth, fill: o.e.defaultNode.linkPoints.fill, stroke: o.e.defaultNode.linkPoints.stroke, }, icon: { show: !1, img: "https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg", width: 20, height: 20, }, stateStyles: r({}, o.e.nodeStateStyles), }, shapeType: "circle", labelPosition: "center", drawShape: function (t, e) { var n = this.getOptions(t).icon, i = void 0 === n ? {} : n, o = this.getShapeStyle(t), c = Object(a.deepMix)({}, i, t.icon), u = e.addShape("circle", { attrs: o, className: "".concat(this.type, "-keyShape"), draggable: !0, name: "".concat(this.type, "-keyShape"), }), h = c.width, l = c.height, f = c.show, d = c.text; f && (d ? e.addShape("text", { attrs: r( { x: 0, y: 0, fontSize: 12, fill: "#000", stroke: "#000", textBaseline: "middle", textAlign: "center", }, c, ), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, }) : e.addShape("image", { attrs: r({ x: -h / 2, y: -l / 2 }, c), className: "".concat(this.type, "-icon"), name: "".concat(this.type, "-icon"), draggable: !0, })); var p = u.attr("r"), g = 0.6 * p, v = (p + g) / 2, y = t, m = y.donutAttrs, b = void 0 === m ? {} : m, x = y.donutColorMap, S = void 0 === x ? {} : x, w = Object.keys(b).length; if (b && w > 1) { var O = [], M = 0; if ( (Object.keys(b).forEach(function (t) { var e = b[t] || 0; Object(a.isNumber)(e) && (O.push({ key: t, value: e, color: S[t] }), (M += e)); }), M) ) { var k = p - g; if (1 === w) return void e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: O[0].color || s[0], lineWidth: k, }, name: "fan-shape-0", }); var j = [v, 0], C = 0; O.forEach(function (t, n) { var r = t.value / M; if (!(r < 0.001)) if ((r > 0.999 && (r = 1), 1 !== r)) { (t.percent = r), (t.angle = r * Math.PI * 2), (t.beginAgnle = C), (C += t.angle), (t.endAngle = C), (t.arcBegin = j), (t.arcEnd = [ v * Math.cos(t.endAngle), -v * Math.sin(t.endAngle), ]); var i = t.angle > Math.PI ? 1 : 0, o = [ ["M", t.arcBegin[0], t.arcBegin[1]], ["A", v, v, 0, i, 0, t.arcEnd[0], t.arcEnd[1]], ["L", t.arcEnd[0], t.arcEnd[1]], ]; e.addShape("path", { attrs: { path: o, lineWidth: k, stroke: t.color || s[n % s.length], }, name: "fan-shape-".concat(n), }), (j = t.arcEnd); } else e.addShape("circle", { attrs: { r: v, x: 0, y: 0, stroke: t.color || s[n % s.length], lineWidth: k, }, name: "fan-shape-".concat(n), }); }); } } return this.drawLinkPoints(t, e), u; }, update: void 0, }, "circle", ); var c = function (t) { var e = t.x, n = t.y; return { x: e, y: n, centerX: e, centerY: n, minX: e, minY: n, maxX: e, maxY: n, height: 0, width: 0, }; }, u = function (t) { for (var e = [], n = {}, r = t.length - 1; r >= 0; r--) { var i = t[r]; (i.id = "".concat(i.x, "|||").concat(i.y)), (n[i.id] = i), e.push(i); } return e; }, h = function (t) { return u(t); }, l = function (t, e) { return t.width || t.height ? { centerX: t.centerX, centerY: t.centerY, minX: t.minX - e, minY: t.minY - e, maxX: t.maxX + e, maxY: t.maxY + e, height: t.height + 2 * e, width: t.width + 2 * e, } : t; }, f = function (t, e, n) { var r = (function (t, e) { var n = Math.abs(t.x - e.centerX), r = Math.abs(t.y - e.centerY); return 0 === n && 0 === r ? 0 : n / e.width > r / e.height; })(e, t); if (0 === r) { var i = t.centerX, o = t.centerY; return ( n.y < e.y ? (o = t.minY) : n.x > e.x ? (i = t.maxX) : n.x < e.x ? (i = t.minX) : n.x === e.x && (o = t.maxY), { x: i, y: o } ); } return r ? { x: e.x > t.centerX ? t.maxX : t.minX, y: e.y } : { x: e.x, y: e.y > t.centerY ? t.maxY : t.minY }; }, d = function (t, e) { var n = Math.min(t.minX, e.minX), r = Math.min(t.minY, e.minY), i = Math.max(t.maxX, e.maxX), o = Math.max(t.maxY, e.maxY); return { centerX: (n + i) / 2, centerY: (r + o) / 2, minX: n, minY: r, maxX: i, maxY: o, height: o - r, width: i - n, }; }, p = function (t) { return [ { x: t.minX, y: t.minY }, { x: t.maxX, y: t.minY }, { x: t.maxX, y: t.maxY }, { x: t.minX, y: t.maxY }, ]; }, g = function (t, e) { var n = t.x, r = t.y; return n < e.minX || n > e.maxX || r < e.minY || r > e.maxY; }, v = function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, y = function (t, e, n, r, i) { return ( v(t, e) + v(t, n) + (function (t, e) { var n = 0; return ( e.forEach(function (e) { e && (t.x === e.x && (n += -2), t.y === e.y && (n += -2)); }), n ); })(t, [e, n, r, i]) ); }, m = function t(e, n, r, i, o) { void 0 === o && (o = 0), e.unshift(n[i]), r[i] && r[i] !== i && o <= 100 && t(e, n, r, r[i], o + 1); }, b = function (t, e, n, r) { var i = n.x - t.x, o = n.y - t.y, a = r.x - t.x, s = r.y - t.y, c = n.x - e.x, u = n.y - e.y, h = r.x - e.x, l = r.y - e.y; return ( (i * s - o * a) * (c * l - u * h) <= 0 && (i * u - o * c) * (a * l - s * h) <= 0 ); }, x = function (t, e, n) { if (n.width || n.height) { var r = p(n), i = r[0], o = r[1], a = r[2], s = r[3]; return ( b(t, e, i, o) || b(t, e, i, s) || b(t, e, o, a) || b(t, e, a, s) ); } return !1; }, S = function (t, e, n, r) { var i = []; return ( t.forEach(function (t) { if (t !== e && (t.x === e.x || t.y === e.y)) { if (x(t, e, n) || x(t, e, r)) return; i.push(t); } }), u(i) ); }, w = function (t, e) { var n = [], r = t[0]; return ( n.push("M".concat(r.x, " ").concat(r.y)), t.forEach(function (r, i) { var o = t[i + 1], a = t[i + 2]; if (o && a) if ( (function (t, e, n) { return !( (t.x === e.x && e.x === n.x) || (t.y === e.y && e.y === n.y) ); })(r, o, a) ) { var s = (function (t, e, n, r) { var i = v(t, e), o = v(n, e); return ( i < r && (r = i), o < r && (r = o), [ { x: e.x - (r / i) * (e.x - t.x), y: e.y - (r / i) * (e.y - t.y), }, { x: e.x - (r / o) * (e.x - n.x), y: e.y - (r / o) * (e.y - n.y), }, ] ); })(r, o, a, e), c = s[0], u = s[1]; n.push("L".concat(c.x, " ").concat(c.y)), n.push( "Q" .concat(o.x, " ") .concat(o.y, " ") .concat(u.x, " ") .concat(u.y), ), n.push("L".concat(u.x, " ").concat(u.y)); } else n.push("L".concat(o.x, " ").concat(o.y)); else o && n.push("L".concat(o.x, " ").concat(o.y)); }), n.join("") ); }, O = function (t, e, n, r, i) { var o, a; if (n && n.getType()) if ("combo" === n.getType()) { ((o = n.getKeyShape().getCanvasBBox() || c(t)).centerX = (o.minX + o.maxX) / 2), (o.centerY = (o.minY + o.maxY) / 2); } else o = n.getBBox(); else o = c(t); if (r && r.getType()) if ("combo" === r.getType()) { var s = r.getKeyShape().getBBox(); if (s) { var b = r.getModel(), x = b.x, w = b.y; ((a = { x: x, y: w, width: s.width, height: s.height, minX: s.minX + x, maxX: s.maxX + x, minY: s.minY + w, maxY: s.maxY + w, }).centerX = (a.minX + a.maxX) / 2), (a.centerY = (a.minY + a.maxY) / 2); } else a = c(e); } else a = r && r.getBBox(); else a = c(e); var O = l(o, i), M = l(a, i), k = f(O, t, e), j = f(M, e, t), C = (function (t) { void 0 === t && (t = []); var e = [], n = []; t.forEach(function (t) { e.push(t.x), n.push(t.y); }); var r = Math.min.apply(Math, e), i = Math.max.apply(Math, e), o = Math.min.apply(Math, n), a = Math.max.apply(Math, n); return { centerX: (r + i) / 2, centerY: (o + a) / 2, maxX: i, maxY: a, minX: r, minY: o, height: a - o, width: i - r, }; })([k, j]), E = d(O, C), P = d(M, C), A = []; A = A.concat(p(E)).concat(p(P)); var I = { x: (t.x + e.x) / 2, y: (t.y + e.y) / 2 }; [C, E, P].forEach(function (t) { A = A.concat( (function (t, e) { return (function (t, e) { return e < t.minX || e > t.maxX ? [] : [ { x: e, y: t.minY }, { x: e, y: t.maxY }, ]; })(t, e.x).concat( (function (t, e) { return e < t.minY || e > t.maxY ? [] : [ { x: t.minX, y: e }, { x: t.maxX, y: e }, ]; })(t, e.y), ); })(t, I).filter(function (t) { return g(t, O) && g(t, M); }), ); }), [ { x: k.x, y: j.y }, { x: j.x, y: k.y }, ].forEach(function (t) { g(t, O) && g(t, M) && A.push(t); }), A.unshift(k), A.push(j); var T = (function (t, e, n, r, i, o, a) { var s = [], c = [e], u = {}, h = {}, l = {}; (h[e.id] = 0), (l[e.id] = y(e, n, e)); var f, d, p, g, b, x = {}; for ( t.forEach(function (t) { x[t.id] = t; }); c.length; ) { if ( ((f = void 0), (d = 1 / 0), c.forEach(function (t) { l[t.id] <= d && ((d = l[t.id]), (f = t)); }), f === n) ) { var w = []; return m(w, x, u, n.id), w; } (g = f), (b = void 0), (b = (p = c).indexOf(g)) > -1 && p.splice(b, 1), s.push(f), S(t, f, r, i).forEach(function (t) { if (-1 === s.indexOf(t)) { -1 === c.indexOf(t) && c.push(t); var r = l[f.id] + v(f, t); (h[t.id] && r >= h[t.id]) || ((u[t.id] = f.id), (h[t.id] = r), (l[t.id] = h[t.id] + y(t, n, e, o, a))); } }); } return [e, n]; })((A = u(A)), k, j, o, a, t, e); return T.unshift(t), T.push(e), h(T); }, M = { offset: 20, maxAllowedDirectionChange: Math.PI / 2, maximumLoops: 2e3, gridSize: 10, directions: [ { stepX: 1, stepY: 0 }, { stepX: -1, stepY: 0 }, { stepX: 0, stepY: 1 }, { stepX: 0, stepY: -1 }, ], get penalties() { return { 0: 0, 45: this.gridSize / 2, 90: this.gridSize / 2 }; }, distFunc: function (t, e) { return Math.abs(t.x - e.x) + Math.abs(t.y - e.y); }, fallbackRoute: function (t, e, n, r, i) { return h(O(t, e, n, r, i.offset)); }, }, k = (Math.PI, function (t, e) { var n = Math.round(Math.abs(t / e)); return n < 0 ? 0 : (t < 0 ? -1 : 1) * n; }), j = function (t, e) { var n = e.x - t.x, r = e.y - t.y; return n || r ? Math.atan2(r, n) : 0; }, C = function (t, e) { var n = Math.abs(t - e); return n > Math.PI ? 2 * Math.PI - n : n; }, E = function (t, e, n) { for (var r = 1 / 0, i = 0, o = e.length; i < o; i++) { var a = n(t, e[i]); a < r && (r = a); } return r; }, P = function (t, e, n, r, i) { var a = []; if (!n) return [t]; var s = i.directions, c = i.offset, u = n.getBBox(), h = e.x > u.minX && e.x < u.maxX && e.y > u.minY && e.y < u.maxY, d = l(u, c); for (var p in d) d[p] = k(d[p], i.gridSize); if (h) { for (var g = 0, v = s; g < v.length; g++) { var y = v[g], m = [ [ { x: d.minX, y: d.minY }, { x: d.maxX, y: d.minY }, ], [ { x: d.minX, y: d.minY }, { x: d.minX, y: d.maxY }, ], [ { x: d.maxX, y: d.minY }, { x: d.maxX, y: d.maxY }, ], [ { x: d.minX, y: d.maxY }, { x: d.maxX, y: d.maxY }, ], ]; for (p = 0; p < 4; p++) { var b = m[p], S = o.h.getLineIntersect( t, { x: t.x + y.stepX * d.width, y: t.y + y.stepY * d.height }, b[0], b[1], ); S && !x(t, S, u) && ((S.id = "".concat(S.x, "|||").concat(S.y)), a.push(S)); } } return a; } var w = f(d, t, r); return (w.id = "".concat(w.x, "|||").concat(w.y)), [w]; }, A = function (t, e, n, r) { var i = j(t, e); if (!n[t.id]) { var o = j(r, t); return C(o, i); } var a = j({ x: n[t.id].x, y: n[t.id].y }, t); return C(a, i); }, I = function (t, e, n, r, i, o, a) { var s = [r], c = t.id, u = t.x, h = t.y, l = { x: u, y: h, id: c }; for ( A(l, o, e, n) && s.unshift({ x: o.x === r.x ? r.x : l.x * a, y: o.y === r.y ? r.y : l.y * a, }); e[c] && e[c].id !== c; ) { var f = { x: u, y: h, id: c }, d = e[c].id, p = e[c].x, g = e[c].y, v = { x: p, y: g, id: d }; A(v, f, e, n) && s.unshift({ x: v.x === f.x ? s[0].x : v.x * a, y: v.y === f.y ? s[0].y : v.y * a, }), (c = d), (u = p), (h = g); } var y = u, m = h; return ( (s[0].x = y === n.x ? i.x : s[0].x), (s[0].y = m === n.y ? i.y : s[0].y), s.unshift(i), s ); }, T = function (t, e, n, r, i) { if (isNaN(t.x) || isNaN(e.x)) return []; var o = Object(a.deepMix)(M, i); o.obstacles = o.obstacles || []; var s = o.gridSize, c = (function (t, e, n) { var r = {}; return ( t.forEach(function (t) { if (t) for ( var i = l(t.getBBox(), n), o = k(i.minX, e); o <= k(i.maxX, e); o += 1 ) for (var a = k(i.minY, e); a <= k(i.maxY, e); a += 1) r["".concat(o, "|||").concat(a)] = !0; }), r ); })(o.obstacles.concat([n, r]), s, o.offset), u = { x: k(t.x, s), y: k(t.y, s) }, h = { x: k(e.x, s), y: k(e.y, s) }; (t.id = "".concat(u.x, "|||").concat(u.y)), (e.id = "".concat(h.x, "|||").concat(h.y)); var f = P(u, t, n, h, o), d = P(h, e, r, u, o); f.forEach(function (t) { delete c[t.id]; }), d.forEach(function (t) { delete c[t.id]; }); for ( var p = {}, g = {}, v = {}, y = {}, m = {}, b = 0; b < f.length; b++ ) { var x = f[b]; (p[x.id] = x), (y[x.id] = 0), (m[x.id] = E(x, d, o.distFunc)); } for ( var S, w, O, j, C, T, N, B = o.maximumLoops, L = o.penalties; Object.keys(p).length > 0 && B > 0 && ((S = void 0), (w = 1 / 0), Object.keys(p).forEach(function (t) { var e = p[t].id; m[e] <= w && ((w = m[e]), (S = p[e])); }), S); ) { if ( d.findIndex(function (t) { return t.x === S.x && t.y === S.y; }) > -1 ) return I(S, v, u, e, t, h, s); delete p[S.id], (g[S.id] = !0); for (b = 0; b < o.directions.length; b++) (O = o.directions[b]), g[ (j = { x: S.x + O.stepX, y: S.y + O.stepY, id: "" .concat(Math.round(S.x) + O.stepX, "|||") .concat(Math.round(S.y) + O.stepY), }).id ] || (N = A(S, j, v, u)) > o.maxAllowedDirectionChange || c[j.id] || (p[j.id] || (p[j.id] = j), (C = o.distFunc(S, j) + (isNaN(L[N]) ? s : L[N])), (T = y[S.id] + C), (y[j.id] && T >= y[j.id]) || ((v[j.id] = S), (y[j.id] = T), (m[j.id] = T + E(j, d, o.distFunc)))); B -= 1; } return o.fallbackRoute(t, e, n, r, o); }; Object(o.k)( "polyline", { options: { color: o.e.defaultEdge.color, size: o.e.defaultEdge.size, style: { radius: 0, offset: 15, x: 0, y: 0, stroke: o.e.defaultEdge.style.stroke, lineAppendWidth: o.e.defaultEdge.style.lineAppendWidth, }, labelCfg: { style: { fill: o.e.edgeLabel.style.fill, fontSize: o.e.edgeLabel.style.fontSize, }, }, routeCfg: { obstacles: [], maxAllowedDirectionChange: Math.PI, maximumLoops: 500, gridSize: 10, }, stateStyles: r({}, o.e.edgeStateStyles), }, shapeType: "polyline", labelPosition: "center", drawShape: function (t, e) { var n = this.getShapeStyle(t); return ( 0 === n.radius && delete n.radius, e.addShape("path", { className: "edge-shape", name: "edge-shape", attrs: n, }) ); }, getShapeStyle: function (t) { var e = this.options.style, n = { stroke: t.color }, r = Object(a.mix)({}, e, n, t.style); (t = this.getPathPoints(t)), (this.radius = r.radius), (this.offset = r.offset); var i = t.startPoint, s = t.endPoint, c = this.getControlPoints(t), u = [i]; c && (u = u.concat(c)), u.push(s); var h = t.sourceNode, l = t.targetNode, f = r.radius, d = this.options.routeCfg, p = Object(a.mix)({}, d, t.routeCfg); p.offset = r.offset; var g = this.getPath(u, h, l, f, p); return ( ((Object(a.isArray)(g) && g.length <= 1) || (Object(a.isString)(g) && -1 === g.indexOf("L"))) && (g = "M0 0, L0 0"), (isNaN(i.x) || isNaN(i.y) || isNaN(s.x) || isNaN(s.y)) && (g = "M0 0, L0 0"), Object(a.mix)({}, o.e.defaultEdge.style, r, { lineWidth: t.size, path: g, }) ); }, updateShapeStyle: function (t, e) { var n = e.getContainer(); if (e.isVisible()) { var r = { stroke: t.color }, i = n.find(function (t) { return "edge-shape" === t.get("className"); }) || e.getKeyShape(), o = t.size, s = (t = this.getPathPoints(t)).startPoint, c = t.endPoint, u = this.getControlPoints(t), h = [s]; u && (h = h.concat(u)), h.push(c); var l = i.attr(), f = Object(a.mix)({}, r, l, t.style), d = t.sourceNode, p = t.targetNode, g = f.radius, v = this.options.routeCfg, y = Object(a.mix)({}, v, t.routeCfg); y.offset = f.offset; var m = this.getPath(h, d, p, g, y); ((Object(a.isArray)(m) && m.length <= 1) || (Object(a.isString)(m) && -1 === m.indexOf("L"))) && (m = "M0 0, L0 0"), (isNaN(s.x) || isNaN(s.y) || isNaN(c.x) || isNaN(c.y)) && (m = "M0 0, L0 0"), l.endArrow && !1 === f.endArrow && (t.style.endArrow = { path: "" }), l.startArrow && !1 === f.startArrow && (t.style.startArrow = { path: "" }); var b = Object(a.mix)( r, i.attr(), { lineWidth: o, path: m }, t.style, ); i && i.attr(b); } }, getPath: function (t, e, n, r, i) { var s = i.offset, c = i.simple; if (!s || t.length > 2) { if (r) return w(t, r); var u = []; return ( Object(a.each)(t, function (t, e) { 0 === e ? u.push(["M", t.x, t.y]) : u.push(["L", t.x, t.y]); }), u ); } var h = c ? O(t[t.length - 1], t[0], n, e, s) : T(t[0], t[t.length - 1], e, n, i); return h && h.length ? r ? w(h, r) : o.h.pointsToPolygon(h) : "M0 0, L0 0"; }, }, "single-edge", ); }, 424: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(2), a = n(41), s = a.a.cloneEvent, c = a.a.isNaN, u = Math.abs, h = { getDefaultCfg: function () { return { direction: "both", enableOptimize: !1, scalableRange: 0, allowDragOnItem: !1, }; }, getEvents: function () { return { dragstart: "onDragStart", drag: "onDragMove", dragend: "onDragEnd", }; }, updateViewport: function (t) { var e = this.origin, n = +t.clientX, r = +t.clientY; if (!c(n) && !c(r)) { var i = n - e.x, o = r - e.y; "x" === this.get("direction") ? (o = 0) : "y" === this.get("direction") && (i = 0), (this.origin = { x: n, y: r }); var a = this.graph.get("width"), s = this.graph.get("height"), u = this.graph.get("canvas").getCanvasBBox(); ((u.minX <= a + this.scalableRange && u.minX + i > a + this.scalableRange) || (u.maxX + this.scalableRange >= 0 && u.maxX + this.scalableRange + i < 0)) && (i = 0), ((u.minY <= s + this.scalableRange && u.minY + o > s + this.scalableRange) || (u.maxY + this.scalableRange >= 0 && u.maxY + this.scalableRange + o < 0)) && (o = 0), this.graph.translate(i, o); } }, onDragStart: function (t) { t.originalEvent; if (this.shouldBegin.call(this, t)) { var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ( (this.allowDragOnItem || n) && ((this.origin = { x: t.clientX, y: t.clientY }), (this.dragging = !1), this.enableOptimize) ) { for ( var r = this.graph, i = r.getEdges(), o = 0, a = i.length; o < a; o++ ) { var s = i[o].get("group").get("children"); s && s.forEach(function (t) { t.set( "ori-visibility", t.get("ori-visibility") || t.get("visible"), ), t.hide(); }); } for (var c = r.getNodes(), u = 0, h = c.length; u < h; u++) for ( var l = 0, f = c[u].getContainer().get("children"); l < f.length; l++ ) { var d = f[l]; d.get("isKeyShape") || (d.set( "ori-visibility", d.get("ori-visibility") || d.get("visible"), ), d.hide()); } } } }, onDragMove: function (t) { this.graph; var e = t.target, n = e && e.isCanvas && e.isCanvas(); if ((this.allowDragOnItem || n) && ((t = s(t)), this.origin)) { if (!this.dragging) { if ( u(this.origin.x - t.clientX) + u(this.origin.y - t.clientY) < 10 ) return; this.shouldBegin.call(this, t) && ((t.type = "dragstart"), (this.dragging = !0)); } this.shouldUpdate.call(this, t) && this.updateViewport(t); } }, onDragEnd: function (t) { var e = this.graph; if (this.enableOptimize) { for (var n = e.getEdges(), r = 0, i = n.length; r < i; r++) { var o = n[r].get("group").get("children"); o && o.forEach(function (t) { t.get("ori-visibility") && t.show(); }); } for (var a = e.getNodes(), c = 0, u = a.length; c < u; c++) for ( var h = 0, l = a[c].getContainer().get("children"); h < l.length; h++ ) { var f = l[h]; if (!f.get("isKeyShape")) f.get("ori-visibility") && f.show(); } } this.dragging ? ((t = s(t)), this.shouldEnd.call(this, t) && this.updateViewport(t), (t.type = "dragend"), this.endDrag()) : (this.origin = null); }, endDrag: function () { (this.origin = null), (this.dragging = !1), (this.dragbegin = !1); }, }, l = n(22), f = { getDefaultCfg: function () { return { updateEdge: !0, delegateStyle: {}, enableDelegate: !1, onlyChangeComboSize: !1, comboActiveState: "", selectedState: "selected", }; }, getEvents: function () { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", "combo:drop": "onDropCombo", "node:drop": "onDropNode", "canvas:drop": "onDropCanvas", }; }, validationCombo: function (t) { return ( !(!this.origin || !t || t.destroyed) && "combo" === t.getType() ); }, onDragStart: function (t) { var e = this; if (this.shouldBegin.call(this, t)) { var n = t.item; if (n && !n.destroyed && !n.hasLocked()) { var r = t.target; if (r) if (r.get("isAnchorPoint")) return; var o = this.graph; (this.targets = []), (this.targetCombo = null); var a = o.findAllByState("node", this.selectedState), s = n.get("id"); 0 === a.filter(function (t) { var e = t.get("id"); return s === e; }).length ? this.targets.push(n) : a.length > 1 ? a.forEach(function (t) { t.hasLocked() || e.targets.push(t); }) : this.targets.push(n); var c = []; this.targets.forEach(function (t) { c.push(Object(i.clone)(t.getModel())); }), this.set("beforeDragNodes", c), (this.origin = { x: t.x, y: t.y }), (this.point = {}), (this.originPoint = {}); } } }, onDrag: function (t) { var e = this; this.origin && this.shouldUpdate(this, t) && (this.get("enableDelegate") ? this.updateDelegate(t) : this.targets.map(function (n) { e.update(n, t); })); }, onDragEnd: function (t) { if (this.origin && this.shouldEnd.call(this, t)) { var e = t.item; if (e) e.getContainer().set("capture", !0); this.delegateRect && (this.delegateRect.remove(), (this.delegateRect = null)), this.updatePositions(t); var n = this.graph; if (n.get("enabledStack")) { var r = { before: { nodes: this.get("beforeDragNodes"), edges: [], combos: [], }, after: { nodes: [], edges: [], combos: [] }, }; this.targets.forEach(function (t) { r.after.nodes.push(t.getModel()); }), n.pushStack("update", Object(i.clone)(r)); } n.emit("dragnodeend", { items: this.targets, targetItem: null }), (this.point = {}), (this.origin = null), (this.originPoint = {}), (this.targets.length = 0), (this.targetCombo = null); } }, onDropCombo: function (t) { var e = t.item; if (this.validationCombo(e)) { this.updatePositions(t); var n = this.graph; if ( (this.comboActiveState && n.setItemState(e, this.comboActiveState, !1), (this.targetCombo = e), this.onlyChangeComboSize) ) n.updateCombos(); else { var r = e.getModel(); this.targets.map(function (t) { t.getModel().comboId !== r.id && n.updateComboTree(t, r.id); }), n.updateCombo(e); } n.emit("dragnodeend", { items: this.targets, targetItem: this.targetCombo, }); } }, onDropCanvas: function (t) { var e = this.graph; this.targets && 0 !== this.targets.length && (this.updatePositions(t), this.onlyChangeComboSize ? e.updateCombos() : this.targets.map(function (t) { t.getModel().comboId && e.updateComboTree(t); })); }, onDropNode: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.graph, r = e.getModel().comboId; if (r) { var i = n.findById(r); this.comboActiveState && n.setItemState(i, this.comboActiveState, !1), this.targets.map(function (t) { var e = t.getModel(); r !== e.comboId && n.updateComboTree(t, r); }), n.updateCombo(i); } else this.targets.map(function (t) { t.getModel().comboId && n.updateComboTree(t); }); n.emit("dragnodeend", { items: this.targets, targetItem: e }); } }, onDragEnter: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !0); } }, onDragLeave: function (t) { var e = t.item; if (this.validationCombo(e)) { var n = this.graph; this.comboActiveState && n.setItemState(e, this.comboActiveState, !1); } }, updatePositions: function (t) { var e = this; this.targets && 0 !== this.targets.length && this.get("enableDelegate") && this.targets.map(function (n) { return e.update(n, t); }); }, update: function (t, e) { var n = this.origin, r = t.get("model"), i = t.get("id"); this.point[i] || (this.point[i] = { x: r.x || 0, y: r.y || 0 }); var o = { x: e.x - n.x + this.point[i].x, y: e.y - n.y + this.point[i].y, }; this.get("updateEdge") ? this.graph.updateItem(t, o, !1) : t.updatePosition(o); }, updateDelegate: function (t) { this.graph; if (this.delegateRect) { var e = t.x - this.origin.x + this.originPoint.minX, n = t.y - this.origin.y + this.originPoint.minY; this.delegateRect.attr({ x: e, y: n }); } else { var o = this.graph.get("group"), a = Object(i.deepMix)( {}, l.a.delegateStyle, this.delegateStyle, ), s = this.calculationGroupPosition(t), c = s.x, u = s.y, h = s.width, f = s.height, d = s.minX, p = s.minY; (this.originPoint = { x: c, y: u, width: h, height: f, minX: d, minY: p, }), (this.delegateRect = o.addShape("rect", { attrs: Object(r.a)({ width: h, height: f, x: c, y: u }, a), name: "rect-delegate-shape", })); } }, calculationGroupPosition: function (t) { var e = this.graph.findAllByState("node", this.selectedState); 0 === e.length && e.push(t.item); for ( var n = 1 / 0, r = -1 / 0, i = 1 / 0, o = -1 / 0, a = 0; a < e.length; a++ ) { var s = e[a].getBBox(), c = s.minX, u = s.minY, h = s.maxX, l = s.maxY; c < n && (n = c), u < i && (i = u), h > r && (r = h), l > o && (o = l); } return { x: Math.floor(n), y: Math.floor(i), width: Math.ceil(r) - Math.floor(n), height: Math.ceil(o) - Math.floor(i), minX: n, minY: i, }; }, }, d = { getDefaultCfg: function () { return { multiple: !0, selectedState: "selected" }; }, getEvents: function () { return { "node:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onCanvasClick", }; }, onClick: function (t) { var e = this, n = t.item; if (n && !n.destroyed) { var r = n.getType(), o = e.graph, a = e.multiple, s = e.shouldUpdate; if (e.shouldBegin.call(e, t)) { if (!a) { var c = o.findAllByState(r, e.selectedState); Object(i.each)(c, function (t) { t !== n && o.setItemState(t, e.selectedState, !1); }); } if (n.hasState(e.selectedState)) { s.call(e, t) && o.setItemState(n, e.selectedState, !1); var u = o.findAllByState("node", e.selectedState), h = o.findAllByState("combo", e.selectedState); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !1, }); } else { s.call(e, t) && o.setItemState(n, e.selectedState, !0); (u = o.findAllByState("node", e.selectedState)), (h = o.findAllByState("combo", e.selectedState)); o.emit("nodeselectchange", { target: n, selectedItems: { nodes: u, combos: h }, select: !0, }); } } } }, onCanvasClick: function () { var t = this, e = this.graph, n = e.findAllByState("node", this.selectedState); Object(i.each)(n, function (n) { e.setItemState(n, t.selectedState, !1); }); var r = e.findAllByState("combo", this.selectedState); Object(i.each)(r, function (n) { e.setItemState(n, t.selectedState, !1); }), e.emit("nodeselectchange", { selectedItems: { nodes: [], edges: [], combos: [] }, select: !1, }); }, }, p = { firstScale: null, getDefaultCfg: function () { return { originScale: 1, sensitivity: 2, minZoom: void 0, maxZoom: void 0, enableOptimize: !1, optimizeZoom: 0.1, fixSelectedItems: { fixAll: !1, fixLineWidth: !1, fixLabel: !1, fixState: "selected", }, }; }, getEvents: function () { var t = this.fixSelectedItems; return ( t.fixState || (t.fixState = "selected"), t.fixAll && ((t.fixLineWidth = !0), (t.fixLabel = !0)), { pinchstart: "onPinch", pinchmove: "onPinch" } ); }, onPinch: function (t) { t.preventDefault && t.preventDefault(), t.originalEvent.preventDefault && t.originalEvent.preventDefault(); var e = t.originalEvent.pointers; if (!(e.length < 2)) { "pinchstart" === t.type && (this.firstScale = this.graph.getZoom()); var n = t.originalEvent.scale || t.originalEvent.srcEvent.extra.scale, r = this.firstScale * n; this.currentScale = r; var i = this.get("minZoom") || this.graph.get("minZoom"); if ( !( r > (this.get("maxZoom") || this.graph.get("maxZoom")) || r < i ) ) { var o = this.graph.get("canvas"), a = e[0].clientX, s = e[0].clientY, c = e[1].clientX, u = e[1].clientY, h = o.getPointByClient((a + c) / 2, (s + u) / 2); this.graph.zoomTo(r, { x: h.x, y: h.y }); } } }, }, g = ["tap", "dbltap"], v = { getDefaultCfg: function () { return { trigger: "tap", onChange: function () {} }; }, getEvents: function () { var t, e; return ( g.includes(this.trigger) ? (e = this.trigger) : ((e = "tap"), console.warn( "Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["node:" + e] = "onNodeTap"), (t.touchstart = "onNodeTap"), t ); }, onNodeTap: function (t) { var e = t.item, n = this.graph.findDataById(e.get("id")); if (n) { var r = n.children; if (r && 0 !== r.length) { var i = !n.collapsed; if ( this.shouldBegin(t, i) && ((n.collapsed = i), (e.getModel().collapsed = i), this.graph.emit("itemcollapsed", { item: t.item, collapsed: i, }), this.shouldUpdate(t, i)) ) { try { this.onChange(e, i); } catch (t) { console.warn(t); } this.graph.layout(); } } } }, }, y = a.a.calculationItemsBBox, m = function (t, e) { if (!1 !== e(t) && t) { var n = t.get("combos"); if (0 === n.length) return !1; Object(i.each)(n, function (t) { m(t, e); }); } }, b = ["click", "dblclick"], x = ["tap", "drag"], S = ["shift", "ctrl", "control", "alt", "meta", void 0], w = { bind: function (t) { "drag-canvas" === this.type && t.get("canvas").set("draggable", !0); var e = this.events; (this.graph = t), Object(i.each)(e, function (e, n) { t.on(n, e); }); }, unbind: function (t) { var e = this.events; "drag-canvas" === this.type && t.get("canvas").set("draggable", !1), (this.graph = null), Object(i.each)(e, function (e, n) { t.off(n, e); }); }, }, O = { "drag-canvas": h, "zoom-canvas": p, "drag-node": f, "activate-relations": { getDefaultCfg: function () { return { activeState: "active", inactiveState: "inactive", resetSelected: !1, shouldUpdate: function () { return !0; }, }; }, getEvents: function () { return { "node:tap": "setAllItemStates", "canvas:tap": "clearAllItemStates", }; }, setAllItemStates: function (t) { var e = t.item, n = this.graph; if ( ((this.item = e), this.shouldUpdate(t.item, { event: t, action: "activate" })) ) { for ( var r = this.activeState, i = this.inactiveState, o = n.getNodes(), a = n.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u], l = h.hasState("selected"); this.resetSelected && l && n.setItemState(h, "selected", !1), n.setItemState(h, r, !1), i && n.setItemState(h, i, !0); } for (u = 0; u < c; u++) { var f = a[u]; n.setItemState(f, r, !1), i && n.setItemState(f, i, !0); } i && n.setItemState(e, i, !1), n.setItemState(e, r, !0); var d = e.getEdges(), p = d.length; for (u = 0; u < p; u++) { var g = void 0; (g = (f = d[u]).getSource() === e ? f.getTarget() : f.getSource()), i && n.setItemState(g, i, !1), n.setItemState(g, r, !0), n.setItemState(f, i, !1), n.setItemState(f, r, !0), f.toFront(); } n.emit("afteractivaterelations", { item: t.item, action: "activate", }); } }, clearActiveState: function (t) { var e = this.get("graph"); if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { var n = this.activeState, r = this.inactiveState, i = e.get("autoPaint"); e.setAutoPaint(!1); for ( var o = e.getNodes(), a = e.getEdges(), s = o.length, c = a.length, u = 0; u < s; u++ ) { var h = o[u]; e.clearItemStates(h, [n, r]); } for (u = 0; u < c; u++) { var l = a[u]; e.clearItemStates(l, [n, r, "deactivate"]); } e.paint(), e.setAutoPaint(i), e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, clearAllItemStates: function (t) { var e = this.graph; if ( this.shouldUpdate(t.item, { event: t, action: "deactivate" }) ) { for ( var n = this.activeState, r = this.inactiveState, i = e.getNodes(), o = e.getEdges(), a = i.length, s = o.length, c = 0; c < a; c++ ) { var u = i[c]; e.clearItemStates(u, [n, r]); } for (c = 0; c < s; c++) { var h = o[c]; e.clearItemStates(h, [n, r, "deactivate"]); } e.emit("afteractivaterelations", { item: t.item || this.get("item"), action: "deactivate", }); } }, }, "click-select": d, "collapse-expand": v, "drag-combo": { getDefaultCfg: function () { return { enableDelegate: !1, delegateStyle: {}, onlyChangeComboSize: !1, activeState: "", selectedState: "selected", }; }, getEvents: function () { return { "combo:dragstart": "onDragStart", "combo:drag": "onDrag", "combo:dragend": "onDragEnd", "combo:drop": "onDrop", "node:drop": "onNodeDrop", "combo:dragenter": "onDragEnter", "combo:dragleave": "onDragLeave", }; }, validationCombo: function (t) { var e = t.item; return ( !(!e || e.destroyed) && !!this.shouldUpdate(this, t) && "combo" === e.getType() ); }, onDragStart: function (t) { var e = this, n = this.graph, r = t.item; if (this.validationCombo(t)) { this.targets = []; var i = n.findAllByState("combo", this.selectedState), o = r.get("id"); 0 === i.filter(function (t) { var e = t.get("id"); return o === e; }).length ? this.targets.push(r) : (this.targets = i), this.activeState && this.targets.map(function (t) { var r = t.getModel(); if (r.parentId) { var i = n.findById(r.parentId); i && n.setItemState(i, e.activeState, !0); } }), (this.point = {}), (this.originPoint = {}), (this.origin = { x: t.x, y: t.y }), (this.currentItemChildCombos = []), m(r, function (t) { if (t.destroyed) return !1; var n = t.getModel(); return e.currentItemChildCombos.push(n.id), !0; }); } }, onDrag: function (t) { var e = this; if (this.origin && this.validationCombo(t)) if (this.enableDelegate) this.updateDelegate(t); else { if (this.activeState) { var n = this.graph, r = t.item, o = r.getModel(), a = n.getCombos(), s = r.getBBox(), c = s.centerX, u = s.centerY, h = s.width; a.filter(function (t) { var n = t.getModel(); return ( o.parentId, n.id !== o.id && !e.currentItemChildCombos.includes(n.id) ); }).map(function (t) { var r = t.getBBox(), i = r.centerX, o = r.centerY, a = r.width, s = c - i, l = u - o, f = 2 * Math.sqrt(s * s + l * l); h + a - f > 0.8 * h ? n.setItemState(t, e.activeState, !0) : n.setItemState(t, e.activeState, !1); }); } Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); } }, updatePositions: function (t) { var e = this; this.enableDelegate && Object(i.each)(this.targets, function (n) { e.updateCombo(n, t); }); }, onDrop: function (t) { var e = this, n = t.item; if (n && this.targets && !n.destroyed) { this.updatePositions(t); var r = this.graph, i = n.getModel(); this.targets.map(function (t) { t.getModel().parentId !== i.id ? (e.activeState && r.setItemState(n, e.activeState, !1), e.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t, i.id)) : r.updateCombo(n); }), this.end(n, t), (this.endComparison = !0); } }, onNodeDrop: function (t) { var e = this; if (this.targets && 0 !== this.targets.length) { this.updatePositions(t); var n, r = this.graph, i = t.item.getModel().comboId; if (i) { if (this.activeState) { var o = r.findById(i); r.setItemState(o, this.activeState, !1); } this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : i !== t.getID() && ((n = r.findById(i)), i !== t.getModel().parentId && r.updateComboTree(t, i)); }); } else this.targets.map(function (t) { e.onlyChangeComboSize ? r.updateCombo(t) : t.getModel().comboId && r.updateComboTree(t); }); (this.endComparison = !0), this.end(n, t); } }, onDragEnter: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !0); } }, onDragLeave: function (t) { if (this.origin && this.validationCombo(t)) { var e = t.item, n = this.graph; this.activeState && n.setItemState(e, this.activeState, !1); } }, onDragEnd: function (t) { if (this.targets && 0 !== this.targets.length) { var e = t.item; this.updatePositions(t); var n = this.getParentCombo(e.getModel().parentId), r = this.graph; n && this.activeState && r.setItemState(n, this.activeState, !1), this.end(void 0, t); } }, end: function (t, e) { var n = this; if (this.origin) { var r = this.graph; if (this.delegateShape) r.get("delegateGroup").clear(), (this.delegateShape = null); t && this.activeState && r.setItemState(t, this.activeState, !1), t || this.targets.map(function (t) { n.onlyChangeComboSize ? r.updateCombo(t) : r.updateComboTree(t); }), (this.point = []), (this.origin = null), (this.originPoint = null), (this.targets.length = 0); } }, traverse: function (t, e) { var n = this; if (!1 !== e(t) && t) { var r = t.get("combos"); Object(i.each)(r, function (t) { n.traverse(t, e); }); var o = t.get("nodes"); Object(i.each)(o, function (t) { n.traverse(t, e); }); } }, updateCombo: function (t, e) { var n = this; this.traverse(t, function (t) { return !t.destroyed && (n.updateSignleItem(t, e), !0); }); }, updateSignleItem: function (t, e) { var n = this.origin, r = this.graph, i = t.getModel(), o = t.get("id"); this.point[o] || (this.point[o] = { x: i.x, y: i.y }); var a = e.x - n.x + this.point[o].x, s = e.y - n.y + this.point[o].y; r.updateItem(t, { x: a, y: s }); }, getParentCombo: function (t) { var e = this.graph; if (t) { var n = e.findById(t); if (n) return n; } }, updateDelegate: function (t) { var e = this.graph; if (this.delegateShape) { var n = t.x - this.origin.x + this.originPoint.minX, i = t.y - this.origin.y + this.originPoint.minY; this.delegateShape.attr({ x: n, y: i }); } else { var o = e.get("delegateGroup"), a = null, s = (a = this.targets.length > 1 ? y(this.targets) : this.targets[0].getBBox()).x, c = a.y, u = a.width, h = a.height, f = a.minX, d = a.minY; this.originPoint = { x: s, y: c, width: u, height: h, minX: f, minY: d, }; var p = Object(r.a)( Object(r.a)({}, l.a.delegateStyle), this.delegateStyle, ); this.delegateShape = o.addShape("rect", { attrs: Object(r.a)( { width: a.width, height: a.height, x: a.x, y: a.y }, p, ), name: "combo-delegate-shape", }); } }, }, "collapse-expand-combo": { getDefaultCfg: function () { return { trigger: "dblclick", relayout: !0 }; }, getEvents: function () { var t, e; return ( b.includes(this.trigger) ? (e = this.trigger) : ((e = "dblclick"), console.warn( "Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'", )), ((t = {})["combo:" + e] = "onComboClick"), t ); }, onComboClick: function (t) { var e = t.item, n = this.graph, r = this.relayout; if (e && !e.destroyed && "combo" === e.getType()) { var i = e.getModel().id; i && (n.collapseExpandCombo(i), r && n.get("layout") ? n.layout() : n.refreshPositions()); } }, }, "create-edge": { getDefaultCfg: function () { return { trigger: "tap", key: void 0, edgeConfig: {} }; }, getEvents: function () { var t; return ( x.indexOf(this.trigger.toLowerCase()) > -1 || ((this.trigger = "tap"), console.warn( "Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'", )), this.key && -1 === S.indexOf(this.key.toLowerCase()) && ((this.trigger = void 0), console.warn( "Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined", )), "drag" === this.trigger ? (t = { "node:dragstart": "onClick", "combo:dragstart": "onClick", drag: "updateEndPoint", "node:drop": "onClick", "combo:drop": "onClick", dragend: "onDragEnd", }) : "click" === this.trigger && (t = { "node:tap": "onClick", mousemove: "updateEndPoint", "edge:tap": "cancelCreating", "canvas:tap": "cancelCreating", "combo:tap": "onClick", }), this.key && ((t.keydown = "onKeyDown"), (t.keyup = "onKeyUp")), t ); }, onDragEnd: function (t) { if (!this.key || this.keydown) { var e = t.item; (e && e.getID() !== this.source && "node" === e.getType()) || this.cancelCreating({ item: this.edge, x: t.x, y: t.y }); } }, onClick: function (t) { if (!this.key || this.keydown) { var e = t.item, n = this.graph, i = e.getModel(); if (this.addingEdge && this.edge) { if (!this.shouldEnd.call(this, t)) return; var o = { target: i.id }; this.source === i.id && (o.type = "loop"), n.emit("beforecreateedge", {}), n.updateItem(this.edge, o), n.emit("aftercreateedge", { edge: this.edge }), this.edge.getKeyShape().set("capture", !0), (this.edge = null), (this.addingEdge = !1); } else { if (!this.shouldBegin.call(this, t)) return; (this.edge = n.addItem( "edge", Object(r.a)( { source: i.id, target: i.id }, this.edgeConfig, ), !1, )), (this.source = i.id), (this.addingEdge = !0), this.edge.getKeyShape().set("capture", !1); } } }, updateEndPoint: function (t) { if (!this.key || this.keydown) { var e = { x: t.x, y: t.y }; this.graph.findById(this.source) ? this.addingEdge && this.edge && this.graph.updateItem(this.edge, { target: e }, !1) : (this.addingEdge = !1); } }, cancelCreating: function (t) { if (!this.key || this.keydown) { var e = this.graph, n = t.item; if ( this.addingEdge && t.target && t.target.isCanvas && t.target.isCanvas() ) return ( e.removeItem(this.edge, !1), (this.edge = null), void (this.addingEdge = !1) ); if (this.addingEdge && this.edge === n) { var r = !0; if (!e.get("groupByTypes")) for ( var i = t.x, o = t.y, a = e.getNodes(), s = a.length, c = 0; c < s; c++ ) { var u = a[c], h = u.getModel(), l = u.getBBox(); if ( i <= l.maxX && i >= l.minX && o <= l.maxY && o >= l.minY ) { if ( !this.shouldEnd.call(this, { x: t.x, y: t.y, canvasX: t.canvasX, canvasY: t.canvasY, clientX: t.clientX, clientY: t.clientY, item: u, }) ) return; e.emit("beforecreateedge", {}), e.updateItem(this.edge, { target: h.id }), e.emit("aftercreateedge", { edge: this.edge }), (r = !1); break; } } r && e.removeItem(this.edge, !1), (this.edge = null), (this.addingEdge = !1); } } }, onKeyDown: function (t) { var e = t.key; e && (e.toLowerCase() === this.key.toLowerCase() ? (this.keydown = !0) : (this.keydown = !1)); }, onKeyUp: function () { this.addingEdge && this.edge && (this.graph.removeItem(this.edge, !1), (this.addingEdge = !1), (this.edge = null)), (this.keydown = !1); }, }, }; Object(i.each)(O, function (t, e) { Object(o.i)(e, Object(r.a)(Object(r.a)({}, t), w)); }); }, 46: function (t, e, n) { "use strict"; n.d(e, "b", function () { return o; }), n.d(e, "c", function () { return a; }), n.d(e, "a", function () { return s; }); var r = n(6), i = n(88); function o(t, e, n) { var i = 1; return ( Object(r.h)(t) && (i = t.split("\n").length), i > 1 ? e * i + (function (t, e) { return e ? e - t : 0.14 * t; })(e, n) * (i - 1) : e ); } function a(t, e) { var n = Object(i.a)(), o = 0; if (Object(r.e)(t) || "" === t) return o; if ((n.save(), (n.font = e), Object(r.h)(t) && t.includes("\n"))) { var a = t.split("\n"); Object(r.a)(a, function (t) { var e = n.measureText(t).width; o < e && (o = e); }); } else o = n.measureText(t).width; return n.restore(), o; } function s(t) { var e = t.fontSize, n = t.fontFamily, r = t.fontWeight; return [t.fontStyle, t.fontVariant, r, e + "px", n].join(" ").trim(); } }, 5: function (t, e, n) { "use strict"; n.d(e, "a", function () { return r; }), n.d(e, "b", function () { return _; }), n.d(e, "c", function () { return R; }); var r = {}; n.r(r), n.d(r, "create", function () { return o; }), n.d(r, "fromMat4", function () { return a; }), n.d(r, "clone", function () { return s; }), n.d(r, "copy", function () { return c; }), n.d(r, "fromValues", function () { return u; }), n.d(r, "set", function () { return h; }), n.d(r, "identity", function () { return l; }), n.d(r, "transpose", function () { return f; }), n.d(r, "invert", function () { return d; }), n.d(r, "adjoint", function () { return p; }), n.d(r, "determinant", function () { return g; }), n.d(r, "multiply", function () { return v; }), n.d(r, "translate", function () { return y; }), n.d(r, "rotate", function () { return m; }), n.d(r, "scale", function () { return b; }), n.d(r, "fromTranslation", function () { return x; }), n.d(r, "fromRotation", function () { return S; }), n.d(r, "fromScaling", function () { return w; }), n.d(r, "fromMat2d", function () { return O; }), n.d(r, "fromQuat", function () { return M; }), n.d(r, "normalFromMat4", function () { return k; }), n.d(r, "projection", function () { return j; }), n.d(r, "str", function () { return C; }), n.d(r, "frob", function () { return E; }), n.d(r, "add", function () { return P; }), n.d(r, "subtract", function () { return A; }), n.d(r, "multiplyScalar", function () { return I; }), n.d(r, "multiplyScalarAndAdd", function () { return T; }), n.d(r, "exactEquals", function () { return N; }), n.d(r, "equals", function () { return B; }), n.d(r, "mul", function () { return L; }), n.d(r, "sub", function () { return D; }); var i = n(7); function o() { var t = new i.a(9); return ( i.a != Float32Array && ((t[1] = 0), (t[2] = 0), (t[3] = 0), (t[5] = 0), (t[6] = 0), (t[7] = 0)), (t[0] = 1), (t[4] = 1), (t[8] = 1), t ); } function a(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[4]), (t[4] = e[5]), (t[5] = e[6]), (t[6] = e[8]), (t[7] = e[9]), (t[8] = e[10]), t ); } function s(t) { var e = new i.a(9); return ( (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), (e[3] = t[3]), (e[4] = t[4]), (e[5] = t[5]), (e[6] = t[6]), (e[7] = t[7]), (e[8] = t[8]), e ); } function c(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), (t[3] = e[3]), (t[4] = e[4]), (t[5] = e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function u(t, e, n, r, o, a, s, c, u) { var h = new i.a(9); return ( (h[0] = t), (h[1] = e), (h[2] = n), (h[3] = r), (h[4] = o), (h[5] = a), (h[6] = s), (h[7] = c), (h[8] = u), h ); } function h(t, e, n, r, i, o, a, s, c, u) { return ( (t[0] = e), (t[1] = n), (t[2] = r), (t[3] = i), (t[4] = o), (t[5] = a), (t[6] = s), (t[7] = c), (t[8] = u), t ); } function l(t) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function f(t, e) { if (t === e) { var n = e[1], r = e[2], i = e[5]; (t[1] = e[3]), (t[2] = e[6]), (t[3] = n), (t[5] = e[7]), (t[6] = r), (t[7] = i); } else (t[0] = e[0]), (t[1] = e[3]), (t[2] = e[6]), (t[3] = e[1]), (t[4] = e[4]), (t[5] = e[7]), (t[6] = e[2]), (t[7] = e[5]), (t[8] = e[8]); return t; } function d(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = h * a - s * u, f = -h * o + s * c, d = u * o - a * c, p = n * l + r * f + i * d; return p ? ((p = 1 / p), (t[0] = l * p), (t[1] = (-h * r + i * u) * p), (t[2] = (s * r - i * a) * p), (t[3] = f * p), (t[4] = (h * n - i * c) * p), (t[5] = (-s * n + i * o) * p), (t[6] = d * p), (t[7] = (-u * n + r * c) * p), (t[8] = (a * n - r * o) * p), t) : null; } function p(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8]; return ( (t[0] = a * h - s * u), (t[1] = i * u - r * h), (t[2] = r * s - i * a), (t[3] = s * c - o * h), (t[4] = n * h - i * c), (t[5] = i * o - n * s), (t[6] = o * u - a * c), (t[7] = r * c - n * u), (t[8] = n * a - r * o), t ); } function g(t) { var e = t[0], n = t[1], r = t[2], i = t[3], o = t[4], a = t[5], s = t[6], c = t[7], u = t[8]; return e * (u * o - a * c) + n * (-u * i + a * s) + r * (c * i - o * s); } function v(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1], p = n[2], g = n[3], v = n[4], y = n[5], m = n[6], b = n[7], x = n[8]; return ( (t[0] = f * r + d * a + p * u), (t[1] = f * i + d * s + p * h), (t[2] = f * o + d * c + p * l), (t[3] = g * r + v * a + y * u), (t[4] = g * i + v * s + y * h), (t[5] = g * o + v * c + y * l), (t[6] = m * r + b * a + x * u), (t[7] = m * i + b * s + x * h), (t[8] = m * o + b * c + x * l), t ); } function y(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = n[0], d = n[1]; return ( (t[0] = r), (t[1] = i), (t[2] = o), (t[3] = a), (t[4] = s), (t[5] = c), (t[6] = f * r + d * a + u), (t[7] = f * i + d * s + h), (t[8] = f * o + d * c + l), t ); } function m(t, e, n) { var r = e[0], i = e[1], o = e[2], a = e[3], s = e[4], c = e[5], u = e[6], h = e[7], l = e[8], f = Math.sin(n), d = Math.cos(n); return ( (t[0] = d * r + f * a), (t[1] = d * i + f * s), (t[2] = d * o + f * c), (t[3] = d * a - f * r), (t[4] = d * s - f * i), (t[5] = d * c - f * o), (t[6] = u), (t[7] = h), (t[8] = l), t ); } function b(t, e, n) { var r = n[0], i = n[1]; return ( (t[0] = r * e[0]), (t[1] = r * e[1]), (t[2] = r * e[2]), (t[3] = i * e[3]), (t[4] = i * e[4]), (t[5] = i * e[5]), (t[6] = e[6]), (t[7] = e[7]), (t[8] = e[8]), t ); } function x(t, e) { return ( (t[0] = 1), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = 1), (t[5] = 0), (t[6] = e[0]), (t[7] = e[1]), (t[8] = 1), t ); } function S(t, e) { var n = Math.sin(e), r = Math.cos(e); return ( (t[0] = r), (t[1] = n), (t[2] = 0), (t[3] = -n), (t[4] = r), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function w(t, e) { return ( (t[0] = e[0]), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = e[1]), (t[5] = 0), (t[6] = 0), (t[7] = 0), (t[8] = 1), t ); } function O(t, e) { return ( (t[0] = e[0]), (t[1] = e[1]), (t[2] = 0), (t[3] = e[2]), (t[4] = e[3]), (t[5] = 0), (t[6] = e[4]), (t[7] = e[5]), (t[8] = 1), t ); } function M(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = n + n, s = r + r, c = i + i, u = n * a, h = r * a, l = r * s, f = i * a, d = i * s, p = i * c, g = o * a, v = o * s, y = o * c; return ( (t[0] = 1 - l - p), (t[3] = h - y), (t[6] = f + v), (t[1] = h + y), (t[4] = 1 - u - p), (t[7] = d - g), (t[2] = f - v), (t[5] = d + g), (t[8] = 1 - u - l), t ); } function k(t, e) { var n = e[0], r = e[1], i = e[2], o = e[3], a = e[4], s = e[5], c = e[6], u = e[7], h = e[8], l = e[9], f = e[10], d = e[11], p = e[12], g = e[13], v = e[14], y = e[15], m = n * s - r * a, b = n * c - i * a, x = n * u - o * a, S = r * c - i * s, w = r * u - o * s, O = i * u - o * c, M = h * g - l * p, k = h * v - f * p, j = h * y - d * p, C = l * v - f * g, E = l * y - d * g, P = f * y - d * v, A = m * P - b * E + x * C + S * j - w * k + O * M; return A ? ((A = 1 / A), (t[0] = (s * P - c * E + u * C) * A), (t[1] = (c * j - a * P - u * k) * A), (t[2] = (a * E - s * j + u * M) * A), (t[3] = (i * E - r * P - o * C) * A), (t[4] = (n * P - i * j + o * k) * A), (t[5] = (r * j - n * E - o * M) * A), (t[6] = (g * O - v * w + y * S) * A), (t[7] = (v * x - p * O - y * b) * A), (t[8] = (p * w - g * x + y * m) * A), t) : null; } function j(t, e, n) { return ( (t[0] = 2 / e), (t[1] = 0), (t[2] = 0), (t[3] = 0), (t[4] = -2 / n), (t[5] = 0), (t[6] = -1), (t[7] = 1), (t[8] = 1), t ); } function C(t) { return ( "mat3(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ", " + t[4] + ", " + t[5] + ", " + t[6] + ", " + t[7] + ", " + t[8] + ")" ); } function E(t) { return Math.hypot(t[0], t[1], t[2], t[3], t[4], t[5], t[6], t[7], t[8]); } function P(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), (t[3] = e[3] + n[3]), (t[4] = e[4] + n[4]), (t[5] = e[5] + n[5]), (t[6] = e[6] + n[6]), (t[7] = e[7] + n[7]), (t[8] = e[8] + n[8]), t ); } function A(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), (t[3] = e[3] - n[3]), (t[4] = e[4] - n[4]), (t[5] = e[5] - n[5]), (t[6] = e[6] - n[6]), (t[7] = e[7] - n[7]), (t[8] = e[8] - n[8]), t ); } function I(t, e, n) { return ( (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), (t[3] = e[3] * n), (t[4] = e[4] * n), (t[5] = e[5] * n), (t[6] = e[6] * n), (t[7] = e[7] * n), (t[8] = e[8] * n), t ); } function T(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), (t[3] = e[3] + n[3] * r), (t[4] = e[4] + n[4] * r), (t[5] = e[5] + n[5] * r), (t[6] = e[6] + n[6] * r), (t[7] = e[7] + n[7] * r), (t[8] = e[8] + n[8] * r), t ); } function N(t, e) { return ( t[0] === e[0] && t[1] === e[1] && t[2] === e[2] && t[3] === e[3] && t[4] === e[4] && t[5] === e[5] && t[6] === e[6] && t[7] === e[7] && t[8] === e[8] ); } function B(t, e) { var n = t[0], r = t[1], o = t[2], a = t[3], s = t[4], c = t[5], u = t[6], h = t[7], l = t[8], f = e[0], d = e[1], p = e[2], g = e[3], v = e[4], y = e[5], m = e[6], b = e[7], x = e[8]; return ( Math.abs(n - f) <= i.b * Math.max(1, Math.abs(n), Math.abs(f)) && Math.abs(r - d) <= i.b * Math.max(1, Math.abs(r), Math.abs(d)) && Math.abs(o - p) <= i.b * Math.max(1, Math.abs(o), Math.abs(p)) && Math.abs(a - g) <= i.b * Math.max(1, Math.abs(a), Math.abs(g)) && Math.abs(s - v) <= i.b * Math.max(1, Math.abs(s), Math.abs(v)) && Math.abs(c - y) <= i.b * Math.max(1, Math.abs(c), Math.abs(y)) && Math.abs(u - m) <= i.b * Math.max(1, Math.abs(u), Math.abs(m)) && Math.abs(h - b) <= i.b * Math.max(1, Math.abs(h), Math.abs(b)) && Math.abs(l - x) <= i.b * Math.max(1, Math.abs(l), Math.abs(x)) ); } var L = v, D = A, _ = n(53), R = n(85); }, 52: function (t, e, n) { "use strict"; var r = n(1), i = n(8), o = n(31), a = n(12), s = n(0), c = n(3), u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.onCanvasChange = function (t) { Object(a.h)(this, t); }), (e.prototype.getShapeBase = function () { return o; }), (e.prototype.getGroupBase = function () { return e; }), (e.prototype._applyClip = function (t, e) { e && (t.save(), Object(a.a)(t, e), e.createPath(t), t.restore(), t.clip(), e._afterDraw()); }), (e.prototype.cacheCanvasBBox = function () { var t = this.cfg.children, e = [], n = []; Object(s.each)(t, function (t) { var r = t.cfg.cacheCanvasBBox; r && t.cfg.isInView && (e.push(r.minX, r.maxX), n.push(r.minY, r.maxY)); }); var r = null; if (e.length) { var i = Math.min.apply(null, e), o = Math.max.apply(null, e), a = Math.min.apply(null, n), u = Math.max.apply(null, n); r = { minX: i, minY: a, x: i, y: a, maxX: o, maxY: u, width: o - i, height: u - a, }; var h = this.cfg.canvas; if (h) { var l = h.getViewRange(); this.set("isInView", Object(c.e)(r, l)); } } else this.set("isInView", !1); this.set("cacheCanvasBBox", r); }), (e.prototype.draw = function (t, e) { var n = this.cfg.children, r = !e || this.cfg.refresh; n.length && r && (t.save(), Object(a.a)(t, this), this._applyClip(t, this.getClip()), Object(a.d)(t, n, e), t.restore(), this.cacheCanvasBBox()), (this.cfg.refresh = null), this.set("hasChanged", !1); }), (e.prototype.skipDraw = function () { this.set("cacheCanvasBBox", null), this.set("hasChanged", !1); }), e ); })(i.AbstractGroup); e.a = u; }, 53: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "fromValues", function () { return a; }), n.d(e, "copy", function () { return s; }), n.d(e, "set", function () { return c; }), n.d(e, "add", function () { return u; }), n.d(e, "subtract", function () { return h; }), n.d(e, "multiply", function () { return l; }), n.d(e, "divide", function () { return f; }), n.d(e, "ceil", function () { return d; }), n.d(e, "floor", function () { return p; }), n.d(e, "min", function () { return g; }), n.d(e, "max", function () { return v; }), n.d(e, "round", function () { return y; }), n.d(e, "scale", function () { return m; }), n.d(e, "scaleAndAdd", function () { return b; }), n.d(e, "distance", function () { return x; }), n.d(e, "squaredDistance", function () { return S; }), n.d(e, "length", function () { return w; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return j; }), n.d(e, "dot", function () { return C; }), n.d(e, "cross", function () { return E; }), n.d(e, "lerp", function () { return P; }), n.d(e, "random", function () { return A; }), n.d(e, "transformMat2", function () { return I; }), n.d(e, "transformMat2d", function () { return T; }), n.d(e, "transformMat3", function () { return N; }), n.d(e, "transformMat4", function () { return B; }), n.d(e, "rotate", function () { return L; }), n.d(e, "angle", function () { return D; }), n.d(e, "zero", function () { return _; }), n.d(e, "str", function () { return R; }), n.d(e, "exactEquals", function () { return F; }), n.d(e, "equals", function () { return Y; }), n.d(e, "len", function () { return z; }), n.d(e, "sub", function () { return W; }), n.d(e, "mul", function () { return q; }), n.d(e, "div", function () { return V; }), n.d(e, "dist", function () { return G; }), n.d(e, "sqrDist", function () { return H; }), n.d(e, "sqrLen", function () { return U; }), n.d(e, "forEach", function () { return Z; }); var r = n(7); function i() { var t = new r.a(2); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0)), t; } function o(t) { var e = new r.a(2); return (e[0] = t[0]), (e[1] = t[1]), e; } function a(t, e) { var n = new r.a(2); return (n[0] = t), (n[1] = e), n; } function s(t, e) { return (t[0] = e[0]), (t[1] = e[1]), t; } function c(t, e, n) { return (t[0] = e), (t[1] = n), t; } function u(t, e, n) { return (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), t; } function h(t, e, n) { return (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), t; } function l(t, e, n) { return (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), t; } function f(t, e, n) { return (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), t; } function d(t, e) { return (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), t; } function p(t, e) { return (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), t; } function g(t, e, n) { return (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), t; } function v(t, e, n) { return (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), t; } function y(t, e) { return (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), t; } function m(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), t; } function b(t, e, n, r) { return (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), t; } function x(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return Math.hypot(n, r); } function S(t, e) { var n = e[0] - t[0], r = e[1] - t[1]; return n * n + r * r; } function w(t) { var e = t[0], n = t[1]; return Math.hypot(e, n); } function O(t) { var e = t[0], n = t[1]; return e * e + n * n; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), t; } function j(t, e) { var n = e[0], r = e[1], i = n * n + r * r; return ( i > 0 && (i = 1 / Math.sqrt(i)), (t[0] = e[0] * i), (t[1] = e[1] * i), t ); } function C(t, e) { return t[0] * e[0] + t[1] * e[1]; } function E(t, e, n) { var r = e[0] * n[1] - e[1] * n[0]; return (t[0] = t[1] = 0), (t[2] = r), t; } function P(t, e, n, r) { var i = e[0], o = e[1]; return (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), t; } function A(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI; return (t[0] = Math.cos(n) * e), (t[1] = Math.sin(n) * e), t; } function I(t, e, n) { var r = e[0], i = e[1]; return (t[0] = n[0] * r + n[2] * i), (t[1] = n[1] * r + n[3] * i), t; } function T(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[2] * i + n[4]), (t[1] = n[1] * r + n[3] * i + n[5]), t ); } function N(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[3] * i + n[6]), (t[1] = n[1] * r + n[4] * i + n[7]), t ); } function B(t, e, n) { var r = e[0], i = e[1]; return ( (t[0] = n[0] * r + n[4] * i + n[12]), (t[1] = n[1] * r + n[5] * i + n[13]), t ); } function L(t, e, n, r) { var i = e[0] - n[0], o = e[1] - n[1], a = Math.sin(r), s = Math.cos(r); return (t[0] = i * s - o * a + n[0]), (t[1] = i * a + o * s + n[1]), t; } function D(t, e) { var n = t[0], r = t[1], i = e[0], o = e[1], a = Math.sqrt(n * n + r * r) * Math.sqrt(i * i + o * o), s = a && (n * i + r * o) / a; return Math.acos(Math.min(Math.max(s, -1), 1)); } function _(t) { return (t[0] = 0), (t[1] = 0), t; } function R(t) { return "vec2(" + t[0] + ", " + t[1] + ")"; } function F(t, e) { return t[0] === e[0] && t[1] === e[1]; } function Y(t, e) { var n = t[0], i = t[1], o = e[0], a = e[1]; return ( Math.abs(n - o) <= r.b * Math.max(1, Math.abs(n), Math.abs(o)) && Math.abs(i - a) <= r.b * Math.max(1, Math.abs(i), Math.abs(a)) ); } var X, z = w, W = h, q = l, V = f, G = x, H = S, U = O, Z = ((X = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 2), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (X[0] = t[a]), (X[1] = t[a + 1]), i(X, X, o), (t[a] = X[0]), (t[a + 1] = X[1]); return t; }); }, 54: function (t, e, n) { "use strict"; var r, i, o, a; function s(t) { r || ((r = document.createElement("table")), (i = document.createElement("tr")), (o = /^\s*<(\w+|!)[^>]*>/), (a = { tr: document.createElement("tbody"), tbody: r, thead: r, tfoot: r, td: i, th: i, "*": document.createElement("div"), })); var e = o.test(t) && RegExp.$1; (e && e in a) || (e = "*"); var n = a[e]; (t = "string" == typeof t ? t.replace(/(^\s*)|(\s*$)/g, "") : t), (n.innerHTML = "" + t); var s = n.childNodes[0]; return s && n.contains(s) && n.removeChild(s), s; } function c(t, e) { if (t) for (var n in e) e.hasOwnProperty(n) && (t.style[n] = e[n]); return t; } n.d(e, "a", function () { return s; }), n.d(e, "b", function () { return c; }); }, 55: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } var o = n(209), a = n(213), s = [].slice, c = ["keyword", "gray", "hex"], u = {}; Object.keys(a).forEach(function (t) { u[s.call(a[t].labels).sort().join("")] = t; }); var h = {}; function l(t, e) { if (!(this instanceof l)) return new l(t, e); if ((e && e in c && (e = null), e && !(e in a))) throw new Error("Unknown model: " + e); var n, r, i, f, d, p, g, y, m; if (null == t) (this.model = "rgb"), (this.color = [0, 0, 0]), (this.valpha = 1); else if (t instanceof l) (this.model = t.model), (this.color = t.color.slice()), (this.valpha = t.valpha); else if ("string" == typeof t) { if (null === (r = o.get(t))) throw new Error("Unable to parse color from string: " + t); (this.model = r.model), (m = a[this.model].channels), (this.color = r.value.slice(0, m)), (this.valpha = "number" == typeof r.value[m] ? r.value[m] : 1); } else if (t.length) (this.model = e || "rgb"), (m = a[this.model].channels), (i = s.call(t, 0, m)), (this.color = v(i, m)), (this.valpha = "number" == typeof t[m] ? t[m] : 1); else if ("number" == typeof t) (t &= 16777215), (this.model = "rgb"), (this.color = [(t >> 16) & 255, (t >> 8) & 255, 255 & t]), (this.valpha = 1); else { if ( ((this.valpha = 1), (f = Object.keys(t)), "alpha" in t && (f.splice(f.indexOf("alpha"), 1), (this.valpha = "number" == typeof t.alpha ? t.alpha : 0)), !((d = f.sort().join("")) in u)) ) throw new Error( "Unable to parse color from object: " + JSON.stringify(t), ); for ( this.model = u[d], p = a[this.model].labels, g = [], n = 0; n < p.length; n++ ) g.push(t[p[n]]); this.color = v(g); } if (h[this.model]) for (m = a[this.model].channels, n = 0; n < m; n++) (y = h[this.model][n]) && (this.color[n] = y(this.color[n])); (this.valpha = Math.max(0, Math.min(1, this.valpha))), Object.freeze && Object.freeze(this); } function f(t) { return function (e) { return (function (t, e) { return Number(t.toFixed(e)); })(e, t); }; } function d(t, e, n) { return ( (t = Array.isArray(t) ? t : [t]).forEach(function (t) { (h[t] || (h[t] = []))[e] = n; }), (t = t[0]), function (r) { var i; return arguments.length ? (n && (r = n(r)), ((i = this[t]()).color[e] = r), i) : ((i = this[t]().color[e]), n && (i = n(i)), i); } ); } function p(t) { return function (e) { return Math.max(0, Math.min(t, e)); }; } function g(t) { return Array.isArray(t) ? t : [t]; } function v(t, e) { var n; for (n = 0; n < e; n++) "number" != typeof t[n] && (t[n] = 0); return t; } (l.prototype = { toString: function () { return this.string(); }, toJSON: function () { return this[this.model](); }, string: function (t) { var e = this.model in o.to ? this : this.rgb(), n = 1 === (e = e.round("number" == typeof t ? t : 1)).valpha ? e.color : e.color.concat(this.valpha); return o.to[e.model](n); }, percentString: function (t) { var e = this.rgb().round("number" == typeof t ? t : 1), n = 1 === e.valpha ? e.color : e.color.concat(this.valpha); return o.to.rgb.percent(n); }, array: function () { return 1 === this.valpha ? this.color.slice() : this.color.concat(this.valpha); }, object: function () { var t, e = {}, n = a[this.model].channels, r = a[this.model].labels; for (t = 0; t < n; t++) e[r[t]] = this.color[t]; return 1 !== this.valpha && (e.alpha = this.valpha), e; }, unitArray: function () { var t = this.rgb().color; return ( (t[0] /= 255), (t[1] /= 255), (t[2] /= 255), 1 !== this.valpha && t.push(this.valpha), t ); }, unitObject: function () { var t = this.rgb().object(); return ( (t.r /= 255), (t.g /= 255), (t.b /= 255), 1 !== this.valpha && (t.alpha = this.valpha), t ); }, round: function (t) { return ( (t = Math.max(t || 0, 0)), new l(this.color.map(f(t)).concat(this.valpha), this.model) ); }, alpha: function (t) { return arguments.length ? new l(this.color.concat(Math.max(0, Math.min(1, t))), this.model) : this.valpha; }, red: d("rgb", 0, p(255)), green: d("rgb", 1, p(255)), blue: d("rgb", 2, p(255)), hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function (t) { return ((t % 360) + 360) % 360; }), saturationl: d("hsl", 1, p(100)), lightness: d("hsl", 2, p(100)), saturationv: d("hsv", 1, p(100)), value: d("hsv", 2, p(100)), chroma: d("hcg", 1, p(100)), gray: d("hcg", 2, p(100)), white: d("hwb", 1, p(100)), wblack: d("hwb", 2, p(100)), cyan: d("cmyk", 0, p(100)), magenta: d("cmyk", 1, p(100)), yellow: d("cmyk", 2, p(100)), black: d("cmyk", 3, p(100)), x: d("xyz", 0, p(100)), y: d("xyz", 1, p(100)), z: d("xyz", 2, p(100)), l: d("lab", 0, p(100)), a: d("lab", 1), b: d("lab", 2), keyword: function (t) { return arguments.length ? new l(t) : a[this.model].keyword(this.color); }, hex: function (t) { return arguments.length ? new l(t) : o.to.hex(this.rgb().round().color); }, rgbNumber: function () { var t = this.rgb().color; return ((255 & t[0]) << 16) | ((255 & t[1]) << 8) | (255 & t[2]); }, luminosity: function () { var t, e, n = this.rgb().color, r = []; for (t = 0; t < n.length; t++) (e = n[t] / 255), (r[t] = e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)); return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2]; }, contrast: function (t) { var e = this.luminosity(), n = t.luminosity(); return e > n ? (e + 0.05) / (n + 0.05) : (n + 0.05) / (e + 0.05); }, level: function (t) { var e = this.contrast(t); return e >= 7.1 ? "AAA" : e >= 4.5 ? "AA" : ""; }, isDark: function () { var t = this.rgb().color; return (299 * t[0] + 587 * t[1] + 114 * t[2]) / 1e3 < 128; }, isLight: function () { return !this.isDark(); }, negate: function () { var t, e = this.rgb(); for (t = 0; t < 3; t++) e.color[t] = 255 - e.color[t]; return e; }, lighten: function (t) { var e = this.hsl(); return (e.color[2] += e.color[2] * t), e; }, darken: function (t) { var e = this.hsl(); return (e.color[2] -= e.color[2] * t), e; }, saturate: function (t) { var e = this.hsl(); return (e.color[1] += e.color[1] * t), e; }, desaturate: function (t) { var e = this.hsl(); return (e.color[1] -= e.color[1] * t), e; }, whiten: function (t) { var e = this.hwb(); return (e.color[1] += e.color[1] * t), e; }, blacken: function (t) { var e = this.hwb(); return (e.color[2] += e.color[2] * t), e; }, grayscale: function () { var t = this.rgb().color, e = 0.3 * t[0] + 0.59 * t[1] + 0.11 * t[2]; return l.rgb(e, e, e); }, fade: function (t) { return this.alpha(this.valpha - this.valpha * t); }, opaquer: function (t) { return this.alpha(this.valpha + this.valpha * t); }, rotate: function (t) { var e = this.hsl(), n = e.color[0]; return ( (n = (n = (n + t) % 360) < 0 ? 360 + n : n), (e.color[0] = n), e ); }, mix: function (t, e) { if (!t || !t.rgb) throw new Error( 'Argument to "mix" was not a Color instance, but rather an instance of ' + i(t), ); var n = t.rgb(), r = this.rgb(), o = void 0 === e ? 0.5 : e, a = 2 * o - 1, s = n.alpha() - r.alpha(), c = ((a * s == -1 ? a : (a + s) / (1 + a * s)) + 1) / 2, u = 1 - c; return l.rgb( c * n.red() + u * r.red(), c * n.green() + u * r.green(), c * n.blue() + u * r.blue(), n.alpha() * o + r.alpha() * (1 - o), ); }, }), Object.keys(a).forEach(function (t) { if (-1 === c.indexOf(t)) { var e = a[t].channels; (l.prototype[t] = function () { if (this.model === t) return new l(this); if (arguments.length) return new l(arguments, t); var n = "number" == typeof arguments[e] ? e : this.valpha; return new l(g(a[this.model][t].raw(this.color)).concat(n), t); }), (l[t] = function (n) { return ( "number" == typeof n && (n = v(s.call(arguments), e)), new l(n, t) ); }); } }), (t.exports = l); }, 6: function (t, e, n) { "use strict"; n.d(e, "j", function () { return i; }), n.d(e, "c", function () { return o; }), n.d(e, "g", function () { return a; }), n.d(e, "b", function () { return s; }); var r = n(0); function i(t, e) { var n = t.indexOf(e); -1 !== n && t.splice(n, 1); } n.d(e, "e", function () { return r.isNil; }), n.d(e, "d", function () { return r.isFunction; }), n.d(e, "h", function () { return r.isString; }), n.d(e, "f", function () { return r.isObject; }), n.d(e, "i", function () { return r.mix; }), n.d(e, "a", function () { return r.each; }), n.d(e, "k", function () { return r.upperFirst; }); var o = "undefined" != typeof window && void 0 !== window.document; function a(t, e) { if (t.isCanvas()) return !0; for (var n = e.getParent(), r = !1; n; ) { if (n === t) { r = !0; break; } n = n.getParent(); } return r; } function s(t) { return t.cfg.visible && t.cfg.capture; } }, 62: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.getLayoutByName = e.unRegisterLayout = e.registerLayout = void 0); var o = n(66), a = n(216), s = new Map(); e.registerLayout = function (t, e) { var n; s.get(t) && console.warn( "The layout with the name " + t + " exists already, it will be overridden", ), a.isObject(e) ? ((n = (function (t) { function n(n) { var r = t.call(this) || this, i = r, o = {}, a = i.getDefaultCfg(); return ( Object.assign(o, a, e, n), Object.keys(o).forEach(function (t) { var e = o[t]; i[t] = e; }), r ); } return i(n, t), n; })(o.Base)), s.set(t, n)) : s.set(t, e); }; e.unRegisterLayout = function (t) { s.has(t) && s.delete(t); }; e.getLayoutByName = function (t) { return s.has(t) ? s.get(t) : null; }; }, 63: function (t, e, n) { "use strict"; n.d(e, "a", function () { return s; }); var r = n(3); function i(t) { return Math.sqrt(t[0] * t[0] + t[1] * t[1]); } function o(t, e) { return i(t) * i(e) ? (t[0] * e[0] + t[1] * e[1]) / (i(t) * i(e)) : 1; } function a(t, e) { return (t[0] * e[1] < t[1] * e[0] ? -1 : 1) * Math.acos(o(t, e)); } function s(t, e) { var n = e[1], i = e[2], s = Object(r.m)(Object(r.n)(e[3]), 2 * Math.PI), c = e[4], u = e[5], h = t[0], l = t[1], f = e[6], d = e[7], p = (Math.cos(s) * (h - f)) / 2 + (Math.sin(s) * (l - d)) / 2, g = (-1 * Math.sin(s) * (h - f)) / 2 + (Math.cos(s) * (l - d)) / 2, v = (p * p) / (n * n) + (g * g) / (i * i); v > 1 && ((n *= Math.sqrt(v)), (i *= Math.sqrt(v))); var y = n * n * (g * g) + i * i * (p * p), m = y ? Math.sqrt((n * n * (i * i) - y) / y) : 1; c === u && (m *= -1), isNaN(m) && (m = 0); var b = i ? (m * n * g) / i : 0, x = n ? (m * -i * p) / n : 0, S = (h + f) / 2 + Math.cos(s) * b - Math.sin(s) * x, w = (l + d) / 2 + Math.sin(s) * b + Math.cos(s) * x, O = [(p - b) / n, (g - x) / i], M = [(-1 * p - b) / n, (-1 * g - x) / i], k = a([1, 0], O), j = a(O, M); return ( o(O, M) <= -1 && (j = Math.PI), o(O, M) >= 1 && (j = 0), 0 === u && j > 0 && (j -= 2 * Math.PI), 1 === u && j < 0 && (j += 2 * Math.PI), { cx: S, cy: w, rx: Object(r.j)(t, [f, d]) ? 0 : n, ry: Object(r.j)(t, [f, d]) ? 0 : i, startAngle: k, endAngle: k + j, xRotation: s, arcFlag: c, sweepFlag: u, } ); } }, 64: function (t, e, n) { "use strict"; var r, i = ((r = function (t, e) { return (r = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); })(t, e); }), function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError( "Class extends value " + String(e) + " is not a constructor or null", ); function n() { this.constructor = t; } r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, "__esModule", { value: !0 }), (e.RandomLayout = void 0); var o = (function (t) { function e(e) { var n = t.call(this) || this; return ( (n.center = [0, 0]), (n.width = 300), (n.height = 300), (n.nodes = []), (n.edges = []), (n.onLayoutEnd = function () {}), n.updateCfg(e), n ); } return ( i(e, t), (e.prototype.getDefaultCfg = function () { return { center: [0, 0], width: 300, height: 300 }; }), (e.prototype.execute = function () { var t = this, e = t.nodes, n = t.center; return ( t.width || "undefined" == typeof window || (t.width = window.innerWidth), t.height || "undefined" == typeof window || (t.height = window.innerHeight), e && e.forEach(function (e) { (e.x = 0.9 * (Math.random() - 0.5) * t.width + n[0]), (e.y = 0.9 * (Math.random() - 0.5) * t.height + n[1]); }), t.onLayoutEnd && t.onLayoutEnd(), { nodes: e, edges: this.edges } ); }), (e.prototype.getType = function () { return "random"; }), e ); })(n(66).Base); e.RandomLayout = o; }, 65: function (t, e, n) { "use strict"; n(31), n(8); var r = n(184); n.d(e, "Canvas", function () { return r.a; }); n(52), n(63); }, 66: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Base = void 0); var r = (function () { function t() { (this.nodes = []), (this.edges = []), (this.combos = []), (this.positions = []), (this.destroyed = !1), (this.onLayoutEnd = function () {}); } return ( (t.prototype.layout = function (t) { return this.init(t), this.execute(!0); }), (t.prototype.init = function (t) { (this.nodes = t.nodes || []), (this.edges = t.edges || []), (this.combos = t.combos || []); }), (t.prototype.execute = function () {}), (t.prototype.executeWithWorker = function () {}), (t.prototype.getDefaultCfg = function () { return {}; }), (t.prototype.updateCfg = function (t) { t && Object.assign(this, t); }), (t.prototype.getType = function () { return "base"; }), (t.prototype.destroy = function () { (this.nodes = null), (this.edges = null), (this.combos = null), (this.positions = null), (this.destroyed = !0); }), t ); })(); e.Base = r; }, 7: function (t, e, n) { "use strict"; n.d(e, "b", function () { return r; }), n.d(e, "a", function () { return i; }), n.d(e, "c", function () { return o; }); var r = 1e-6, i = "undefined" != typeof Float32Array ? Float32Array : Array, o = Math.random; Math.PI; Math.hypot || (Math.hypot = function () { for (var t = 0, e = arguments.length; e--; ) t += arguments[e] * arguments[e]; return Math.sqrt(t); }); }, 8: function (t, e, n) { "use strict"; var r = n(34); n.d(e, "PathUtil", function () { return r; }); n(122), n(123); var i = n(86); n.d(e, "Event", function () { return i.a; }); n(87); var o = n(183); n.d(e, "AbstractCanvas", function () { return o.a; }); var a = n(124); n.d(e, "AbstractGroup", function () { return a.a; }); var s = n(125); n.d(e, "AbstractShape", function () { return s.a; }); var c = n(118); n.d(e, "getBBoxMethod", function () { return c.a; }), n.d(e, "registerBBox", function () { return c.b; }); var u = n(46); n.d(e, "getTextHeight", function () { return u.b; }), n.d(e, "assembleFont", function () { return u.a; }); var h = n(6); n.d(e, "isAllowCapture", function () { return h.b; }); var l = n(25); n.d(e, "multiplyVec2", function () { return l.c; }), n.d(e, "invert", function () { return l.a; }); n(88), n(90); }, 85: function (t, e, n) { "use strict"; n.r(e), n.d(e, "create", function () { return i; }), n.d(e, "clone", function () { return o; }), n.d(e, "length", function () { return a; }), n.d(e, "fromValues", function () { return s; }), n.d(e, "copy", function () { return c; }), n.d(e, "set", function () { return u; }), n.d(e, "add", function () { return h; }), n.d(e, "subtract", function () { return l; }), n.d(e, "multiply", function () { return f; }), n.d(e, "divide", function () { return d; }), n.d(e, "ceil", function () { return p; }), n.d(e, "floor", function () { return g; }), n.d(e, "min", function () { return v; }), n.d(e, "max", function () { return y; }), n.d(e, "round", function () { return m; }), n.d(e, "scale", function () { return b; }), n.d(e, "scaleAndAdd", function () { return x; }), n.d(e, "distance", function () { return S; }), n.d(e, "squaredDistance", function () { return w; }), n.d(e, "squaredLength", function () { return O; }), n.d(e, "negate", function () { return M; }), n.d(e, "inverse", function () { return k; }), n.d(e, "normalize", function () { return j; }), n.d(e, "dot", function () { return C; }), n.d(e, "cross", function () { return E; }), n.d(e, "lerp", function () { return P; }), n.d(e, "hermite", function () { return A; }), n.d(e, "bezier", function () { return I; }), n.d(e, "random", function () { return T; }), n.d(e, "transformMat4", function () { return N; }), n.d(e, "transformMat3", function () { return B; }), n.d(e, "transformQuat", function () { return L; }), n.d(e, "rotateX", function () { return D; }), n.d(e, "rotateY", function () { return _; }), n.d(e, "rotateZ", function () { return R; }), n.d(e, "angle", function () { return F; }), n.d(e, "zero", function () { return Y; }), n.d(e, "str", function () { return X; }), n.d(e, "exactEquals", function () { return z; }), n.d(e, "equals", function () { return W; }), n.d(e, "sub", function () { return V; }), n.d(e, "mul", function () { return G; }), n.d(e, "div", function () { return H; }), n.d(e, "dist", function () { return U; }), n.d(e, "sqrDist", function () { return Z; }), n.d(e, "len", function () { return K; }), n.d(e, "sqrLen", function () { return $; }), n.d(e, "forEach", function () { return Q; }); var r = n(7); function i() { var t = new r.a(3); return r.a != Float32Array && ((t[0] = 0), (t[1] = 0), (t[2] = 0)), t; } function o(t) { var e = new r.a(3); return (e[0] = t[0]), (e[1] = t[1]), (e[2] = t[2]), e; } function a(t) { var e = t[0], n = t[1], r = t[2]; return Math.hypot(e, n, r); } function s(t, e, n) { var i = new r.a(3); return (i[0] = t), (i[1] = e), (i[2] = n), i; } function c(t, e) { return (t[0] = e[0]), (t[1] = e[1]), (t[2] = e[2]), t; } function u(t, e, n, r) { return (t[0] = e), (t[1] = n), (t[2] = r), t; } function h(t, e, n) { return ( (t[0] = e[0] + n[0]), (t[1] = e[1] + n[1]), (t[2] = e[2] + n[2]), t ); } function l(t, e, n) { return ( (t[0] = e[0] - n[0]), (t[1] = e[1] - n[1]), (t[2] = e[2] - n[2]), t ); } function f(t, e, n) { return ( (t[0] = e[0] * n[0]), (t[1] = e[1] * n[1]), (t[2] = e[2] * n[2]), t ); } function d(t, e, n) { return ( (t[0] = e[0] / n[0]), (t[1] = e[1] / n[1]), (t[2] = e[2] / n[2]), t ); } function p(t, e) { return ( (t[0] = Math.ceil(e[0])), (t[1] = Math.ceil(e[1])), (t[2] = Math.ceil(e[2])), t ); } function g(t, e) { return ( (t[0] = Math.floor(e[0])), (t[1] = Math.floor(e[1])), (t[2] = Math.floor(e[2])), t ); } function v(t, e, n) { return ( (t[0] = Math.min(e[0], n[0])), (t[1] = Math.min(e[1], n[1])), (t[2] = Math.min(e[2], n[2])), t ); } function y(t, e, n) { return ( (t[0] = Math.max(e[0], n[0])), (t[1] = Math.max(e[1], n[1])), (t[2] = Math.max(e[2], n[2])), t ); } function m(t, e) { return ( (t[0] = Math.round(e[0])), (t[1] = Math.round(e[1])), (t[2] = Math.round(e[2])), t ); } function b(t, e, n) { return (t[0] = e[0] * n), (t[1] = e[1] * n), (t[2] = e[2] * n), t; } function x(t, e, n, r) { return ( (t[0] = e[0] + n[0] * r), (t[1] = e[1] + n[1] * r), (t[2] = e[2] + n[2] * r), t ); } function S(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return Math.hypot(n, r, i); } function w(t, e) { var n = e[0] - t[0], r = e[1] - t[1], i = e[2] - t[2]; return n * n + r * r + i * i; } function O(t) { var e = t[0], n = t[1], r = t[2]; return e * e + n * n + r * r; } function M(t, e) { return (t[0] = -e[0]), (t[1] = -e[1]), (t[2] = -e[2]), t; } function k(t, e) { return (t[0] = 1 / e[0]), (t[1] = 1 / e[1]), (t[2] = 1 / e[2]), t; } function j(t, e) { var n = e[0], r = e[1], i = e[2], o = n * n + r * r + i * i; return ( o > 0 && (o = 1 / Math.sqrt(o)), (t[0] = e[0] * o), (t[1] = e[1] * o), (t[2] = e[2] * o), t ); } function C(t, e) { return t[0] * e[0] + t[1] * e[1] + t[2] * e[2]; } function E(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[0], s = n[1], c = n[2]; return ( (t[0] = i * c - o * s), (t[1] = o * a - r * c), (t[2] = r * s - i * a), t ); } function P(t, e, n, r) { var i = e[0], o = e[1], a = e[2]; return ( (t[0] = i + r * (n[0] - i)), (t[1] = o + r * (n[1] - o)), (t[2] = a + r * (n[2] - a)), t ); } function A(t, e, n, r, i, o) { var a = o * o, s = a * (2 * o - 3) + 1, c = a * (o - 2) + o, u = a * (o - 1), h = a * (3 - 2 * o); return ( (t[0] = e[0] * s + n[0] * c + r[0] * u + i[0] * h), (t[1] = e[1] * s + n[1] * c + r[1] * u + i[1] * h), (t[2] = e[2] * s + n[2] * c + r[2] * u + i[2] * h), t ); } function I(t, e, n, r, i, o) { var a = 1 - o, s = a * a, c = o * o, u = s * a, h = 3 * o * s, l = 3 * c * a, f = c * o; return ( (t[0] = e[0] * u + n[0] * h + r[0] * l + i[0] * f), (t[1] = e[1] * u + n[1] * h + r[1] * l + i[1] * f), (t[2] = e[2] * u + n[2] * h + r[2] * l + i[2] * f), t ); } function T(t, e) { e = e || 1; var n = 2 * r.c() * Math.PI, i = 2 * r.c() - 1, o = Math.sqrt(1 - i * i) * e; return ( (t[0] = Math.cos(n) * o), (t[1] = Math.sin(n) * o), (t[2] = i * e), t ); } function N(t, e, n) { var r = e[0], i = e[1], o = e[2], a = n[3] * r + n[7] * i + n[11] * o + n[15]; return ( (a = a || 1), (t[0] = (n[0] * r + n[4] * i + n[8] * o + n[12]) / a), (t[1] = (n[1] * r + n[5] * i + n[9] * o + n[13]) / a), (t[2] = (n[2] * r + n[6] * i + n[10] * o + n[14]) / a), t ); } function B(t, e, n) { var r = e[0], i = e[1], o = e[2]; return ( (t[0] = r * n[0] + i * n[3] + o * n[6]), (t[1] = r * n[1] + i * n[4] + o * n[7]), (t[2] = r * n[2] + i * n[5] + o * n[8]), t ); } function L(t, e, n) { var r = n[0], i = n[1], o = n[2], a = n[3], s = e[0], c = e[1], u = e[2], h = i * u - o * c, l = o * s - r * u, f = r * c - i * s, d = i * f - o * l, p = o * h - r * f, g = r * l - i * h, v = 2 * a; return ( (h *= v), (l *= v), (f *= v), (d *= 2), (p *= 2), (g *= 2), (t[0] = s + h + d), (t[1] = c + l + p), (t[2] = u + f + g), t ); } function D(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0]), (o[1] = i[1] * Math.cos(r) - i[2] * Math.sin(r)), (o[2] = i[1] * Math.sin(r) + i[2] * Math.cos(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function _(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[2] * Math.sin(r) + i[0] * Math.cos(r)), (o[1] = i[1]), (o[2] = i[2] * Math.cos(r) - i[0] * Math.sin(r)), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function R(t, e, n, r) { var i = [], o = []; return ( (i[0] = e[0] - n[0]), (i[1] = e[1] - n[1]), (i[2] = e[2] - n[2]), (o[0] = i[0] * Math.cos(r) - i[1] * Math.sin(r)), (o[1] = i[0] * Math.sin(r) + i[1] * Math.cos(r)), (o[2] = i[2]), (t[0] = o[0] + n[0]), (t[1] = o[1] + n[1]), (t[2] = o[2] + n[2]), t ); } function F(t, e) { var n = t[0], r = t[1], i = t[2], o = e[0], a = e[1], s = e[2], c = Math.sqrt(n * n + r * r + i * i) * Math.sqrt(o * o + a * a + s * s), u = c && C(t, e) / c; return Math.acos(Math.min(Math.max(u, -1), 1)); } function Y(t) { return (t[0] = 0), (t[1] = 0), (t[2] = 0), t; } function X(t) { return "vec3(" + t[0] + ", " + t[1] + ", " + t[2] + ")"; } function z(t, e) { return t[0] === e[0] && t[1] === e[1] && t[2] === e[2]; } function W(t, e) { var n = t[0], i = t[1], o = t[2], a = e[0], s = e[1], c = e[2]; return ( Math.abs(n - a) <= r.b * Math.max(1, Math.abs(n), Math.abs(a)) && Math.abs(i - s) <= r.b * Math.max(1, Math.abs(i), Math.abs(s)) && Math.abs(o - c) <= r.b * Math.max(1, Math.abs(o), Math.abs(c)) ); } var q, V = l, G = f, H = d, U = S, Z = w, K = a, $ = O, Q = ((q = i()), function (t, e, n, r, i, o) { var a, s; for ( e || (e = 3), n || (n = 0), s = r ? Math.min(r * e + n, t.length) : t.length, a = n; a < s; a += e ) (q[0] = t[a]), (q[1] = t[a + 1]), (q[2] = t[a + 2]), i(q, q, o), (t[a] = q[0]), (t[a + 1] = q[1]), (t[a + 2] = q[2]); return t; }); }, 86: function (t, e, n) { "use strict"; var r = (function () { function t(t, e) { (this.bubbles = !0), (this.target = null), (this.currentTarget = null), (this.delegateTarget = null), (this.delegateObject = null), (this.defaultPrevented = !1), (this.propagationStopped = !1), (this.shape = null), (this.fromShape = null), (this.toShape = null), (this.propagationPath = []), (this.type = t), (this.name = t), (this.originalEvent = e), (this.timeStamp = e.timeStamp); } return ( (t.prototype.preventDefault = function () { (this.defaultPrevented = !0), this.originalEvent.preventDefault && this.originalEvent.preventDefault(); }), (t.prototype.stopPropagation = function () { this.propagationStopped = !0; }), (t.prototype.toString = function () { return "[Event (type=" + this.type + ")]"; }), (t.prototype.save = function () {}), (t.prototype.restore = function () {}), t ); })(); e.a = r; }, 87: function (t, e, n) { "use strict"; var r = n(1), i = n(91), o = n(6), a = (function (t) { function e(e) { var n = t.call(this) || this; n.destroyed = !1; var r = n.getDefaultCfg(); return (n.cfg = Object(o.i)(r, e)), n; } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return {}; }), (e.prototype.get = function (t) { return this.cfg[t]; }), (e.prototype.set = function (t, e) { this.cfg[t] = e; }), (e.prototype.destroy = function () { (this.cfg = { destroyed: !0 }), this.off(), (this.destroyed = !0); }), e ); })(i.a); e.a = a; }, 88: function (t, e, n) { "use strict"; n.d(e, "a", function () { return i; }); var r = null; function i() { if (!r) { var t = document.createElement("canvas"); (t.width = 1), (t.height = 1), (r = t.getContext("2d")); } return r; } }, 89: function (t, e, n) { "use strict"; n.d(e, "b", function () { return c; }); var r = n(1), i = n(11), o = n(3); function a(t) { return ( t instanceof HTMLElement && Object(o.k)(t.nodeName) && "CANVAS" === t.nodeName.toUpperCase() ); } var s = null; function c(t) { s = t; } var u = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.getDefaultAttrs = function () { var e = t.prototype.getDefaultAttrs.call(this); return Object(r.a)(Object(r.a)({}, e), { x: 0, y: 0, width: 0, height: 0, }); }), (e.prototype.initAttrs = function (t) { this._setImage(t.img); }), (e.prototype.isStroke = function () { return !1; }), (e.prototype.isOnlyHitBox = function () { return !0; }), (e.prototype._afterLoading = function () { if (!0 === this.get("toDraw")) { var t = this.get("canvas"); t ? t.draw() : this.createPath(this.get("context")); } }), (e.prototype._setImage = function (t) { var e = this, n = this.attrs; if ( !(null == s ? void 0 : s.isMini()) || (null == s ? void 0 : s.isMiniNative()) ) if (Object(o.k)(t)) { var r = null; ((r = (null == s ? void 0 : s.isMiniNative()) ? null == s ? void 0 : s.get("container").createImage() : new Image()).onload = function () { if (e.destroyed) return !1; e.attr("img", r), e.set("loading", !1), e._afterLoading(); var t = e.get("callback"); t && t.call(e); }), (r.crossOrigin = "Anonymous"), (r.src = t), this.set("loading", !0); } else (null == s ? void 0 : s.isMiniNative()) || t instanceof Image ? (n.width || (n.width = t.width), n.height || (n.height = t.height)) : a(t) && (n.width || (n.width = Number(t.getAttribute("width"))), n.height || (n.height, Number(t.getAttribute("height")))); else this.attr("img", t); }), (e.prototype.onAttrChange = function (e, n, r) { t.prototype.onAttrChange.call(this, e, n, r), "img" === e && this._setImage(n); }), (e.prototype.createPath = function (t) { var e = this.attr(), n = e.img, r = e.x, i = e.y, c = e.width, u = e.height, h = e.sx, l = e.sy, f = e.swidth, d = e.sheight; if (this.get("loading")) return this.set("toDraw", !0), void this.set("context", t); (null == s ? void 0 : s.isMini()) ? t.drawImage(n, r, i, c, u) : (n instanceof Image || a(n)) && (Object(o.h)(h) || Object(o.h)(l) || Object(o.h)(f) || Object(o.h)(d) ? t.drawImage(n, r, i, c, u) : t.drawImage(n, h, l, f, d, r, i, c, u)); }), e ); })(i.a); e.a = u; }, 9: function (t, e, n) { "use strict"; n.d(e, "e", function () { return y; }), n.d(e, "b", function () { return O; }), n.d(e, "a", function () { return A; }), n.d(e, "c", function () { return l; }), n.d(e, "d", function () { return D; }), n.d(e, "f", function () { return r; }); var r = {}; n.r(r), n.d(r, "distance", function () { return o; }), n.d(r, "isNumberEqual", function () { return a; }), n.d(r, "getBBoxByArray", function () { return s; }), n.d(r, "getBBoxRange", function () { return c; }), n.d(r, "piMod", function () { return u; }); var i = n(0); function o(t, e, n, r) { var i = t - n, o = e - r; return Math.sqrt(i * i + o * o); } function a(t, e) { return Math.abs(t - e) < 0.001; } function s(t, e) { var n = Object(i.min)(t), r = Object(i.min)(e); return { x: n, y: r, width: Object(i.max)(t) - n, height: Object(i.max)(e) - r, }; } function c(t, e, n, r) { return { minX: Object(i.min)([t, n]), maxX: Object(i.max)([t, n]), minY: Object(i.min)([e, r]), maxY: Object(i.max)([e, r]), }; } function u(t) { return (t + 2 * Math.PI) % (2 * Math.PI); } var h = n(53), l = { box: function (t, e, n, r) { return s([t, n], [e, r]); }, length: function (t, e, n, r) { return o(t, e, n, r); }, pointAt: function (t, e, n, r, i) { return { x: (1 - i) * t + i * n, y: (1 - i) * e + i * r }; }, pointDistance: function (t, e, n, r, i, a) { var s = (n - t) * (i - t) + (r - e) * (a - e); return s < 0 ? o(t, e, i, a) : s > (n - t) * (n - t) + (r - e) * (r - e) ? o(n, r, i, a) : this.pointToLine(t, e, n, r, i, a); }, pointToLine: function (t, e, n, r, i, o) { var a = [n - t, r - e]; if (h.exactEquals(a, [0, 0])) return Math.sqrt((i - t) * (i - t) + (o - e) * (o - e)); var s = [-a[1], a[0]]; h.normalize(s, s); var c = [i - t, o - e]; return Math.abs(h.dot(c, s)); }, tangentAngle: function (t, e, n, r) { return Math.atan2(r - e, n - t); }, }; function f(t, e, n, r, i, a) { var s, c = 1 / 0, u = [n, r], h = 20; a && a > 200 && (h = a / 10); for (var l = 1 / h, f = l / 10, d = 0; d <= h; d++) { var p = d * l, g = [i.apply(null, t.concat([p])), i.apply(null, e.concat([p]))]; (b = o(u[0], u[1], g[0], g[1])) < c && ((s = p), (c = b)); } if (0 === s) return { x: t[0], y: e[0] }; if (1 === s) { var v = t.length; return { x: t[v - 1], y: e[v - 1] }; } c = 1 / 0; for (d = 0; d < 32 && !(f < 1e-4); d++) { var y = s - f, m = s + f, b = ((g = [ i.apply(null, t.concat([y])), i.apply(null, e.concat([y])), ]), o(u[0], u[1], g[0], g[1])); if (y >= 0 && b < c) (s = y), (c = b); else { var x = [ i.apply(null, t.concat([m])), i.apply(null, e.concat([m])), ], S = o(u[0], u[1], x[0], x[1]); m <= 1 && S < c ? ((s = m), (c = S)) : (f *= 0.5); } } return { x: i.apply(null, t.concat([s])), y: i.apply(null, e.concat([s])), }; } function d(t, e, n, r) { var i = 1 - r; return i * i * t + 2 * r * i * e + r * r * n; } function p(t, e, n) { var r = t + n - 2 * e; if (a(r, 0)) return [0.5]; var i = (t - e) / r; return i <= 1 && i >= 0 ? [i] : []; } function g(t, e, n, r) { return 2 * (1 - r) * (e - t) + 2 * r * (n - e); } function v(t, e, n, r, i, o, a) { var s = d(t, n, i, a), c = d(e, r, o, a), u = l.pointAt(t, e, n, r, a), h = l.pointAt(n, r, i, o, a); return [ [t, e, u.x, u.y, s, c], [s, c, h.x, h.y, i, o], ]; } var y = { box: function (t, e, n, r, i, o) { var a = p(t, n, i)[0], c = p(e, r, o)[0], u = [t, i], h = [e, o]; return ( void 0 !== a && u.push(d(t, n, i, a)), void 0 !== c && h.push(d(e, r, o, c)), s(u, h) ); }, length: function (t, e, n, r, i, a) { return (function t(e, n, r, i, a, s, c) { if (0 === c) return (o(e, n, r, i) + o(r, i, a, s) + o(e, n, a, s)) / 2; var u = v(e, n, r, i, a, s, 0.5), h = u[0], l = u[1]; return ( h.push(c - 1), l.push(c - 1), t.apply(null, h) + t.apply(null, l) ); })(t, e, n, r, i, a, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s) { return f([t, n, i], [e, r, o], a, s, d); }, pointDistance: function (t, e, n, r, i, a, s, c) { var u = this.nearestPoint(t, e, n, r, i, a, s, c); return o(u.x, u.y, s, c); }, interpolationAt: d, pointAt: function (t, e, n, r, i, o, a) { return { x: d(t, n, i, a), y: d(e, r, o, a) }; }, divide: function (t, e, n, r, i, o, a) { return v(t, e, n, r, i, o, a); }, tangentAngle: function (t, e, n, r, i, o, a) { var s = g(t, n, i, a), c = g(e, r, o, a); return u(Math.atan2(c, s)); }, }; function m(t, e, n, r, i) { var o = 1 - i; return ( o * o * o * t + 3 * e * i * o * o + 3 * n * i * i * o + r * i * i * i ); } function b(t, e, n, r, i) { var o = 1 - i; return 3 * (o * o * (e - t) + 2 * o * i * (n - e) + i * i * (r - n)); } function x(t, e, n, r) { var i, o, s, c = -3 * t + 9 * e - 9 * n + 3 * r, u = 6 * t - 12 * e + 6 * n, h = 3 * e - 3 * t, l = []; if (a(c, 0)) a(u, 0) || ((i = -h / u) >= 0 && i <= 1 && l.push(i)); else { var f = u * u - 4 * c * h; a(f, 0) ? l.push(-u / (2 * c)) : f > 0 && ((o = (-u - (s = Math.sqrt(f))) / (2 * c)), (i = (-u + s) / (2 * c)) >= 0 && i <= 1 && l.push(i), o >= 0 && o <= 1 && l.push(o)); } return l; } function S(t, e, n, r, i, o, a, s, c) { var u = m(t, n, i, a, c), h = m(e, r, o, s, c), f = l.pointAt(t, e, n, r, c), d = l.pointAt(n, r, i, o, c), p = l.pointAt(i, o, a, s, c), g = l.pointAt(f.x, f.y, d.x, d.y, c), v = l.pointAt(d.x, d.y, p.x, p.y, c); return [ [t, e, f.x, f.y, g.x, g.y, u, h], [u, h, v.x, v.y, p.x, p.y, a, s], ]; } function w(t, e, n, r, i, a, s, c, u) { if (0 === u) return (function (t, e) { for (var n = 0, r = t.length, i = 0; i < r; i++) { n += o(t[i], e[i], t[(i + 1) % r], e[(i + 1) % r]); } return n / 2; })([t, n, i, s], [e, r, a, c]); var h = S(t, e, n, r, i, a, s, c, 0.5), l = h[0], f = h[1]; return ( l.push(u - 1), f.push(u - 1), w.apply(null, l) + w.apply(null, f) ); } var O = { extrema: x, box: function (t, e, n, r, i, o, a, c) { for ( var u = [t, a], h = [e, c], l = x(t, n, i, a), f = x(e, r, o, c), d = 0; d < l.length; d++ ) u.push(m(t, n, i, a, l[d])); for (d = 0; d < f.length; d++) h.push(m(e, r, o, c, f[d])); return s(u, h); }, length: function (t, e, n, r, i, o, a, s) { return w(t, e, n, r, i, o, a, s, 3); }, nearestPoint: function (t, e, n, r, i, o, a, s, c, u, h) { return f([t, n, i, a], [e, r, o, s], c, u, m, h); }, pointDistance: function (t, e, n, r, i, a, s, c, u, h, l) { var f = this.nearestPoint(t, e, n, r, i, a, s, c, u, h, l); return o(f.x, f.y, u, h); }, interpolationAt: m, pointAt: function (t, e, n, r, i, o, a, s, c) { return { x: m(t, n, i, a, c), y: m(e, r, o, s, c) }; }, divide: function (t, e, n, r, i, o, a, s, c) { return S(t, e, n, r, i, o, a, s, c); }, tangentAngle: function (t, e, n, r, i, o, a, s, c) { var h = b(t, n, i, a, c), l = b(e, r, o, s, c); return u(Math.atan2(l, h)); }, }; function M(t, e) { var n = Math.abs(t); return e > 0 ? n : -1 * n; } var k = function (t, e, n, r, i, o) { var a = n, s = r; if (0 === a || 0 === s) return { x: t, y: e }; for ( var c, u, h = i - t, l = o - e, f = Math.abs(h), d = Math.abs(l), p = a * a, g = s * s, v = Math.PI / 4, y = 0; y < 4; y++ ) { (c = a * Math.cos(v)), (u = s * Math.sin(v)); var m = ((p - g) * Math.pow(Math.cos(v), 3)) / a, b = ((g - p) * Math.pow(Math.sin(v), 3)) / s, x = c - m, S = u - b, w = f - m, O = d - b, k = Math.hypot(S, x), j = Math.hypot(O, w); (v += (k * Math.asin((x * O - S * w) / (k * j))) / Math.sqrt(p + g - c * c - u * u)), (v = Math.min(Math.PI / 2, Math.max(0, v))); } return { x: t + M(c, h), y: e + M(u, l) }; }; function j(t, e, n, r, i, o) { return ( n * Math.cos(i) * Math.cos(o) - r * Math.sin(i) * Math.sin(o) + t ); } function C(t, e, n, r, i, o) { return ( n * Math.sin(i) * Math.cos(o) + r * Math.cos(i) * Math.sin(o) + e ); } function E(t, e, n) { return { x: t * Math.cos(n), y: e * Math.sin(n) }; } function P(t, e, n) { var r = Math.cos(n), i = Math.sin(n); return [t * r - e * i, t * i + e * r]; } var A = { box: function (t, e, n, r, i, o, a) { for ( var s = (function (t, e, n) { return Math.atan((-e / t) * Math.tan(n)); })(n, r, i), c = 1 / 0, u = -1 / 0, h = [o, a], l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI ) { var f = s + l; o < a ? o < f && f < a && h.push(f) : a < f && f < o && h.push(f); } for (l = 0; l < h.length; l++) { var d = j(t, 0, n, r, i, h[l]); d < c && (c = d), d > u && (u = d); } var p = (function (t, e, n) { return Math.atan(e / (t * Math.tan(n))); })(n, r, i), g = 1 / 0, v = -1 / 0, y = [o, a]; for (l = 2 * -Math.PI; l <= 2 * Math.PI; l += Math.PI) { var m = p + l; o < a ? o < m && m < a && y.push(m) : a < m && m < o && y.push(m); } for (l = 0; l < y.length; l++) { var b = C(0, e, n, r, i, y[l]); b < g && (g = b), b > v && (v = b); } return { x: c, y: g, width: u - c, height: v - g }; }, length: function (t, e, n, r, i, o, a) {}, nearestPoint: function (t, e, n, r, i, o, a, s, c) { var u = P(s - t, c - e, -i), h = u[0], l = u[1], f = k(0, 0, n, r, h, l), d = (function (t, e, n, r) { return (Math.atan2(r * t, n * e) + 2 * Math.PI) % (2 * Math.PI); })(n, r, f.x, f.y); d < o ? (f = E(n, r, o)) : d > a && (f = E(n, r, a)); var p = P(f.x, f.y, i); return { x: p[0] + t, y: p[1] + e }; }, pointDistance: function (t, e, n, r, i, a, s, c, u) { var h = this.nearestPoint(t, e, n, r, c, u); return o(h.x, h.y, c, u); }, pointAt: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o; return { x: j(t, 0, n, r, i, c), y: C(0, e, n, r, i, c) }; }, tangentAngle: function (t, e, n, r, i, o, a, s) { var c = (a - o) * s + o, h = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.cos(i) * Math.sin(s) - r * Math.sin(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c), l = (function (t, e, n, r, i, o, a, s) { return ( -1 * n * Math.sin(i) * Math.sin(s) + r * Math.cos(i) * Math.cos(s) ); })(0, 0, n, r, i, 0, 0, c); return u(Math.atan2(l, h)); }, }; function I(t) { for (var e = 0, n = [], r = 0; r < t.length - 1; r++) { var i = t[r], a = t[r + 1], s = o(i[0], i[1], a[0], a[1]), c = { from: i, to: a, length: s }; n.push(c), (e += s); } return { segments: n, totalLength: e }; } function T(t) { if (t.length < 2) return 0; for (var e = 0, n = 0; n < t.length - 1; n++) { var r = t[n], i = t[n + 1]; e += o(r[0], r[1], i[0], i[1]); } return e; } function N(t, e) { if (e > 1 || e < 0 || t.length < 2) return null; var n = I(t), r = n.segments, i = n.totalLength; if (0 === i) return { x: t[0][0], y: t[0][1] }; for (var o = 0, a = null, s = 0; s < r.length; s++) { var c = r[s], u = c.from, h = c.to, f = c.length / i; if (e >= o && e <= o + f) { var d = (e - o) / f; a = l.pointAt(u[0], u[1], h[0], h[1], d); break; } o += f; } return a; } function B(t, e) { if (e > 1 || e < 0 || t.length < 2) return 0; for ( var n = I(t), r = n.segments, i = n.totalLength, o = 0, a = 0, s = 0; s < r.length; s++ ) { var c = r[s], u = c.from, h = c.to, l = c.length / i; if (e >= o && e <= o + l) { a = Math.atan2(h[1] - u[1], h[0] - u[0]); break; } o += l; } return a; } function L(t, e, n) { for (var r = 1 / 0, i = 0; i < t.length - 1; i++) { var o = t[i], a = t[i + 1], s = l.pointDistance(o[0], o[1], a[0], a[1], e, n); s < r && (r = s); } return r; } var D = { box: function (t) { for (var e = [], n = [], r = 0; r < t.length; r++) { var i = t[r]; e.push(i[0]), n.push(i[1]); } return s(e, n); }, length: function (t) { return T(t); }, pointAt: function (t, e) { return N(t, e); }, pointDistance: function (t, e, n) { return L(t, e, n); }, tangentAngle: function (t, e) { return B(t, e); }, }; }, 90: function (t, e, n) { "use strict"; n.d(e, "a", function () { return R; }); var r = {}; function i(t) { return +t; } function o(t) { return t * t; } function a(t) { return t * (2 - t); } function s(t) { return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2; } function c(t) { return t * t * t; } function u(t) { return --t * t * t + 1; } function h(t) { return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; } n.r(r), n.d(r, "easeLinear", function () { return i; }), n.d(r, "easeQuad", function () { return s; }), n.d(r, "easeQuadIn", function () { return o; }), n.d(r, "easeQuadOut", function () { return a; }), n.d(r, "easeQuadInOut", function () { return s; }), n.d(r, "easeCubic", function () { return h; }), n.d(r, "easeCubicIn", function () { return c; }), n.d(r, "easeCubicOut", function () { return u; }), n.d(r, "easeCubicInOut", function () { return h; }), n.d(r, "easePoly", function () { return d; }), n.d(r, "easePolyIn", function () { return l; }), n.d(r, "easePolyOut", function () { return f; }), n.d(r, "easePolyInOut", function () { return d; }), n.d(r, "easeSin", function () { return m; }), n.d(r, "easeSinIn", function () { return v; }), n.d(r, "easeSinOut", function () { return y; }), n.d(r, "easeSinInOut", function () { return m; }), n.d(r, "easeExp", function () { return w; }), n.d(r, "easeExpIn", function () { return x; }), n.d(r, "easeExpOut", function () { return S; }), n.d(r, "easeExpInOut", function () { return w; }), n.d(r, "easeCircle", function () { return k; }), n.d(r, "easeCircleIn", function () { return O; }), n.d(r, "easeCircleOut", function () { return M; }), n.d(r, "easeCircleInOut", function () { return k; }), n.d(r, "easeBounce", function () { return E; }), n.d(r, "easeBounceIn", function () { return C; }), n.d(r, "easeBounceOut", function () { return E; }), n.d(r, "easeBounceInOut", function () { return P; }), n.d(r, "easeBack", function () { return T; }), n.d(r, "easeBackIn", function () { return A; }), n.d(r, "easeBackOut", function () { return I; }), n.d(r, "easeBackInOut", function () { return T; }), n.d(r, "easeElastic", function () { return L; }), n.d(r, "easeElasticIn", function () { return B; }), n.d(r, "easeElasticOut", function () { return L; }), n.d(r, "easeElasticInOut", function () { return D; }); var l = (function t(e) { function n(t) { return Math.pow(t, e); } return (e = +e), (n.exponent = t), n; })(3), f = (function t(e) { function n(t) { return 1 - Math.pow(1 - t, e); } return (e = +e), (n.exponent = t), n; })(3), d = (function t(e) { function n(t) { return ( ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2 ); } return (e = +e), (n.exponent = t), n; })(3), p = Math.PI, g = p / 2; function v(t) { return 1 == +t ? 1 : 1 - Math.cos(t * g); } function y(t) { return Math.sin(t * g); } function m(t) { return (1 - Math.cos(p * t)) / 2; } function b(t) { return 1.0009775171065494 * (Math.pow(2, -10 * t) - 0.0009765625); } function x(t) { return b(1 - +t); } function S(t) { return 1 - b(t); } function w(t) { return ((t *= 2) <= 1 ? b(1 - t) : 2 - b(t - 1)) / 2; } function O(t) { return 1 - Math.sqrt(1 - t * t); } function M(t) { return Math.sqrt(1 - --t * t); } function k(t) { return ( ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2 ); } var j = 7.5625; function C(t) { return 1 - E(1 - t); } function E(t) { return (t = +t) < 4 / 11 ? j * t * t : t < 8 / 11 ? j * (t -= 6 / 11) * t + 3 / 4 : t < 10 / 11 ? j * (t -= 9 / 11) * t + 15 / 16 : j * (t -= 21 / 22) * t + 63 / 64; } function P(t) { return ((t *= 2) <= 1 ? 1 - E(1 - t) : E(t - 1) + 1) / 2; } var A = (function t(e) { function n(t) { return (t = +t) * t * (e * (t - 1) + t); } return (e = +e), (n.overshoot = t), n; })(1.70158), I = (function t(e) { function n(t) { return --t * t * ((t + 1) * e + t) + 1; } return (e = +e), (n.overshoot = t), n; })(1.70158), T = (function t(e) { function n(t) { return ( ((t *= 2) < 1 ? t * t * ((e + 1) * t - e) : (t -= 2) * t * ((e + 1) * t + e) + 2) / 2 ); } return (e = +e), (n.overshoot = t), n; })(1.70158), N = 2 * Math.PI, B = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return e * b(-(--t)) * Math.sin((r - t) / n); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), L = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return 1 - e * b((t = +t)) * Math.sin((t + r) / n); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), D = (function t(e, n) { var r = Math.asin(1 / (e = Math.max(1, e))) * (n /= N); function i(t) { return ( ((t = 2 * t - 1) < 0 ? e * b(-t) * Math.sin((r - t) / n) : 2 - e * b(t) * Math.sin((r + t) / n)) / 2 ); } return ( (i.amplitude = function (e) { return t(e, n * N); }), (i.period = function (n) { return t(e, n); }), i ); })(1, 0.3), _ = {}; function R(t) { return _[t.toLowerCase()] || r[t]; } }, 91: function (t, e, n) { "use strict"; var r = (function () { function t() { this._events = {}; } return ( (t.prototype.on = function (t, e, n) { return ( this._events[t] || (this._events[t] = []), this._events[t].push({ callback: e, once: !!n }), this ); }), (t.prototype.once = function (t, e) { return this.on(t, e, !0); }), (t.prototype.emit = function (t) { for (var e = this, n = [], r = 1; r < arguments.length; r++) n[r - 1] = arguments[r]; var i = this._events[t] || [], o = this._events["*"] || [], a = function (r) { for (var i = r.length, o = 0; o < i; o++) if (r[o]) { var a = r[o], s = a.callback; a.once && (r.splice(o, 1), 0 === r.length && delete e._events[t], i--, o--), s.apply(e, n); } }; a(i), a(o); }), (t.prototype.off = function (t, e) { if (t) if (e) { for ( var n = this._events[t] || [], r = n.length, i = 0; i < r; i++ ) n[i].callback === e && (n.splice(i, 1), r--, i--); 0 === n.length && delete this._events[t]; } else delete this._events[t]; else this._events = {}; return this; }), (t.prototype.getEvents = function () { return this._events; }), t ); })(); e.a = r; }, 92: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(93), a = n(6), s = {}; var c = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( Object(r.c)(e, t), (e.prototype.isCanvas = function () { return !1; }), (e.prototype.getBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], c = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( c.length > 0 ? (Object(a.a)(c, function (t) { var e = t.getBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.min)(o)), (e = Object(i.max)(o)), (n = Object(i.min)(s)), (r = Object(i.max)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getCanvasBBox = function () { var t = 1 / 0, e = -1 / 0, n = 1 / 0, r = -1 / 0, o = [], s = [], c = this.getChildren().filter(function (t) { return ( t.get("visible") && (!t.isGroup() || (t.isGroup() && t.getChildren().length > 0)) ); }); return ( c.length > 0 ? (Object(a.a)(c, function (t) { var e = t.getCanvasBBox(); o.push(e.minX, e.maxX), s.push(e.minY, e.maxY); }), (t = Object(i.min)(o)), (e = Object(i.max)(o)), (n = Object(i.min)(s)), (r = Object(i.max)(s))) : ((t = 0), (e = 0), (n = 0), (r = 0)), { x: t, y: n, minX: t, minY: n, maxX: e, maxY: r, width: e - t, height: r - n, } ); }), (e.prototype.getDefaultCfg = function () { var e = t.prototype.getDefaultCfg.call(this); return (e.children = []), e; }), (e.prototype.onAttrChange = function (e, n, r) { if ( (t.prototype.onAttrChange.call(this, e, n, r), "matrix" === e) ) { var i = this.getTotalMatrix(); this._applyChildrenMarix(i); } }), (e.prototype.applyMatrix = function (e) { var n = this.getTotalMatrix(); t.prototype.applyMatrix.call(this, e); var r = this.getTotalMatrix(); r !== n && this._applyChildrenMarix(r); }), (e.prototype._applyChildrenMarix = function (t) { var e = this.getChildren(); Object(a.a)(e, function (e) { e.applyMatrix(t); }); }), (e.prototype.addShape = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n = t[0], r = t[1]; Object(a.f)(n) ? (r = n) : (r.type = n); var i = s[r.type]; i || ((i = Object(a.k)(r.type)), (s[r.type] = i)); var o = this.getShapeBase(), c = new o[i](r); return this.add(c), c; }), (e.prototype.addGroup = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; var n, r = t[0], i = t[1]; if (Object(a.d)(r)) n = new r(i || { parent: this }); else { var o = r || {}, s = this.getGroupBase(); n = new s(o); } return this.add(n), n; }), (e.prototype.getCanvas = function () { return this.isCanvas() ? this : this.get("canvas"); }), (e.prototype.getShape = function (t, e, n) { if (!Object(a.b)(this)) return null; var r, i = this.getChildren(); if (this.isCanvas()) r = this._findShape(i, t, e, n); else { var o = [t, e, 1]; (o = this.invertFromMatrix(o)), this.isClipped(o[0], o[1]) || (r = this._findShape(i, o[0], o[1], n)); } return r; }), (e.prototype._findShape = function (t, e, n, r) { for (var i = null, o = t.length - 1; o >= 0; o--) { var s = t[o]; if ( (Object(a.b)(s) && (s.isGroup() ? (i = s.getShape(e, n, r)) : s.isHit(e, n) && (i = s)), i) ) break; } return i; }), (e.prototype.add = function (t) { var e = this.getCanvas(), n = this.getChildren(), r = this.get("timeline"), i = t.getParent(); i && (function (t, e, n) { void 0 === n && (n = !0), n ? e.destroy() : (e.set("parent", null), e.set("canvas", null)), Object(a.j)(t.getChildren(), e); })(i, t, !1), t.set("parent", this), e && (function t(e, n) { if ((e.set("canvas", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, e), r && (function t(e, n) { if ((e.set("timeline", n), e.isGroup())) { var r = e.get("children"); r.length && r.forEach(function (e) { t(e, n); }); } })(t, r), n.push(t), t.onCanvasChange("add"), this._applyElementMatrix(t); }), (e.prototype._applyElementMatrix = function (t) { var e = this.getTotalMatrix(); e && t.applyMatrix(e); }), (e.prototype.getChildren = function () { return this.get("children"); }), (e.prototype.sort = function () { var t, e = this.getChildren(); Object(a.a)(e, function (t, e) { return (t._INDEX = e), t; }), e.sort( ((t = function (t, e) { return t.get("zIndex") - e.get("zIndex"); }), function (e, n) { var r = t(e, n); return 0 === r ? e._INDEX - n._INDEX : r; }), ), this.onCanvasChange("sort"); }), (e.prototype.clear = function () { if ((this.set("clearing", !0), !this.destroyed)) { for (var t = this.getChildren(), e = t.length - 1; e >= 0; e--) t[e].destroy(); this.set("children", []), this.onCanvasChange("clear"), this.set("clearing", !1); } }), (e.prototype.destroy = function () { this.get("destroyed") || (this.clear(), t.prototype.destroy.call(this)); }), (e.prototype.getFirst = function () { return this.getChildByIndex(0); }), (e.prototype.getLast = function () { var t = this.getChildren(); return this.getChildByIndex(t.length - 1); }), (e.prototype.getChildByIndex = function (t) { return this.getChildren()[t]; }), (e.prototype.getCount = function () { return this.getChildren().length; }), (e.prototype.contain = function (t) { return this.getChildren().indexOf(t) > -1; }), (e.prototype.removeChild = function (t, e) { void 0 === e && (e = !0), this.contain(t) && t.remove(e); }), (e.prototype.findAll = function (t) { var e = [], n = this.getChildren(); return ( Object(a.a)(n, function (n) { t(n) && e.push(n), n.isGroup() && (e = e.concat(n.findAll(t))); }), e ); }), (e.prototype.find = function (t) { var e = null, n = this.getChildren(); return ( Object(a.a)(n, function (n) { if ((t(n) ? (e = n) : n.isGroup() && (e = n.find(t)), e)) return !1; }), e ); }), (e.prototype.findById = function (t) { return this.find(function (e) { return e.get("id") === t; }); }), (e.prototype.findByClassName = function (t) { return this.find(function (e) { return e.get("className") === t; }); }), (e.prototype.findAllByName = function (t) { return this.findAll(function (e) { return e.get("name") === t; }); }), e ); })(o.a); e.a = c; }, 93: function (t, e, n) { "use strict"; var r = n(1), i = n(0), o = n(4), a = n(6), s = n(25), c = n(87), u = o.a.transform, h = ["zIndex", "capture", "visible", "type"], l = ["repeat"]; function f(t, e) { var n = {}, r = e.attrs; for (var i in t) n[i] = r[i]; return n; } function d(t, e) { var n = {}, r = e.attr(); return ( Object(i.each)(t, function (t, e) { -1 !== l.indexOf(e) || Object(i.isEqual)(r[e], t) || (n[e] = t); }), n ); } function p(t, e) { if (e.onFrame) return t; var n = e.startTime, r = e.delay, o = e.duration, a = Object.prototype.hasOwnProperty; return ( Object(i.each)(t, function (t) { n + r < t.startTime + t.delay + t.duration && o > t.delay && Object(i.each)(e.toAttrs, function (e, n) { a.call(t.toAttrs, n) && (delete t.toAttrs[n], delete t.fromAttrs[n]); }); }), t ); } var g = (function (t) { function e(e) { var n = t.call(this, e) || this; n.attrs = {}; var r = n.getDefaultAttrs(); return ( Object(i.mix)(r, e.attrs), (n.attrs = r), n.initAttrs(r), n.initAnimate(), n ); } return ( Object(r.c)(e, t), (e.prototype.getDefaultCfg = function () { return { visible: !0, capture: !0, zIndex: 0 }; }), (e.prototype.getDefaultAttrs = function () { return { matrix: this.getDefaultMatrix(), opacity: 1 }; }), (e.prototype.onCanvasChange = function (t) {}), (e.prototype.initAttrs = function (t) {}), (e.prototype.initAnimate = function () { this.set("animable", !0), this.set("animating", !1); }), (e.prototype.isGroup = function () { return !1; }), (e.prototype.getParent = function () { return this.get("parent"); }), (e.prototype.getCanvas = function () { return this.get("canvas"); }), (e.prototype.attr = function () { for (var t, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n]; var r = e[0], o = e[1]; if (!r) return this.attrs; if (Object(i.isObject)(r)) { for (var a in r) this.setAttr(a, r[a]); return this.afterAttrsChange(r), this; } return 2 === e.length ? (this.setAttr(r, o), this.afterAttrsChange((((t = {})[r] = o), t)), this) : this.attrs[r]; }), (e.prototype.isClipped = function (t, e) { var n = this.getClip(); return n && !n.isHit(t, e); }), (e.prototype.setAttr = function (t, e) { var n = this.attrs[t]; n !== e && ((this.attrs[t] = e), this.onAttrChange(t, e, n)); }), (e.prototype.onAttrChange = function (t, e, n) { "matrix" === t && this.set("totalMatrix", null); }), (e.prototype.afterAttrsChange = function (t) { if (this.cfg.isClipShape) { var e = this.cfg.applyTo; e && e.onCanvasChange("clip"); } else this.onCanvasChange("attr"); }), (e.prototype.show = function () { return this.set("visible", !0), this.onCanvasChange("show"), this; }), (e.prototype.hide = function () { return this.set("visible", !1), this.onCanvasChange("hide"), this; }), (e.prototype.setZIndex = function (t) { this.set("zIndex", t); var e = this.getParent(); return e && e.sort(), this; }), (e.prototype.toFront = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.push(this), this.onCanvasChange("zIndex"); } }), (e.prototype.toBack = function () { var t = this.getParent(); if (t) { var e = t.getChildren(), n = (this.get("el"), e.indexOf(this)); e.splice(n, 1), e.unshift(this), this.onCanvasChange("zIndex"); } }), (e.prototype.remove = function (t) { void 0 === t && (t = !0); var e = this.getParent(); e ? (Object(a.j)(e.getChildren(), this), e.get("clearing") || this.onCanvasChange("remove")) : this.onCanvasChange("remove"), t && this.destroy(); }), (e.prototype.resetMatrix = function () { this.attr("matrix", this.getDefaultMatrix()), this.onCanvasChange("matrix"); }), (e.prototype.getMatrix = function () { return this.attr("matrix"); }), (e.prototype.setMatrix = function (t) { this.attr("matrix", t), this.onCanvasChange("matrix"); }), (e.prototype.getTotalMatrix = function () { var t = this.cfg.totalMatrix; if (!t) { var e = this.attr("matrix"), n = this.cfg.parentMatrix; (t = n && e ? Object(s.b)(n, e) : e || n), this.set("totalMatrix", t); } return t; }), (e.prototype.applyMatrix = function (t) { var e = this.attr("matrix"), n = null; (n = t && e ? Object(s.b)(t, e) : e || t), this.set("totalMatrix", n), this.set("parentMatrix", t); }), (e.prototype.getDefaultMatrix = function () { return null; }), (e.prototype.applyToMatrix = function (t) { var e = this.attr("matrix"); return e ? Object(s.c)(e, t) : t; }), (e.prototype.invertFromMatrix = function (t) { var e = this.attr("matrix"); if (e) { var n = Object(s.a)(e); if (n) return Object(s.c)(n, t); } return t; }), (e.prototype.setClip = function (t) { var e = this.getCanvas(), n = null; if (t) { var r = this.getShapeBase()[Object(i.upperFirst)(t.type)]; r && (n = new r({ type: t.type, isClipShape: !0, applyTo: this, attrs: t.attrs, canvas: e, })); } return this.set("clipShape", n), this.onCanvasChange("clip"), n; }), (e.prototype.getClip = function () { var t = this.cfg.clipShape; return t || null; }), (e.prototype.clone = function () { var t = this, e = this.attrs, n = {}; Object(i.each)(e, function (t, r) { Object(i.isArray)(e[r]) ? (n[r] = (function (t) { for (var e = [], n = 0; n < t.length; n++) Object(i.isArray)(t[n]) ? e.push([].concat(t[n])) : e.push(t[n]); return e; })(e[r])) : (n[r] = e[r]); }); var r = new (0, this.constructor)({ attrs: n }); return ( Object(i.each)(h, function (e) { r.set(e, t.get(e)); }), r ); }), (e.prototype.destroy = function () { this.destroyed || ((this.attrs = {}), t.prototype.destroy.call(this)); }), (e.prototype.isAnimatePaused = function () { return this.get("_pause").isPaused; }), (e.prototype.animate = function () { for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]; if (this.get("timeline") || this.get("canvas")) { this.set("animating", !0); var n = this.get("timeline"); n || ((n = this.get("canvas").get("timeline")), this.set("timeline", n)); var r = this.get("animations") || []; n.timer || n.initTimer(); var o, a, s, c, u, h = t[0], l = t[1], g = t[2], v = void 0 === g ? "easeLinear" : g, y = t[3], m = void 0 === y ? i.noop : y, b = t[4], x = void 0 === b ? 0 : b; Object(i.isFunction)(h) ? ((o = h), (h = {})) : Object(i.isObject)(h) && h.onFrame && ((o = h.onFrame), (a = h.repeat)), Object(i.isObject)(l) ? ((l = (u = l).duration), (v = u.easing || "easeLinear"), (x = u.delay || 0), (a = u.repeat || a || !1), (m = u.callback || i.noop), (s = u.pauseCallback || i.noop), (c = u.resumeCallback || i.noop)) : (Object(i.isNumber)(m) && ((x = m), (m = null)), Object(i.isFunction)(v) ? ((m = v), (v = "easeLinear")) : (v = v || "easeLinear")); var S = d(h, this), w = { fromAttrs: f(S, this), toAttrs: S, duration: l, easing: v, repeat: a, callback: m, pauseCallback: s, resumeCallback: c, delay: x, startTime: n.getTime(), id: Object(i.uniqueId)(), onFrame: o, pathFormatted: !1, }; r.length > 0 ? (r = p(r, w)) : n.addAnimator(this), r.push(w), this.set("animations", r), this.set("_pause", { isPaused: !1 }); } }), (e.prototype.stopAnimate = function (t) { var e = this; void 0 === t && (t = !0); var n = this.get("animations"); Object(i.each)(n, function (n) { t && (n.onFrame ? e.attr(n.onFrame(1)) : e.attr(n.toAttrs)), n.callback && n.callback(); }), this.set("animating", !1), this.set("animations", []); }), (e.prototype.pauseAnimate = function () { var t = this.get("timeline"), e = this.get("animations"), n = t.getTime(); return ( Object(i.each)(e, function (t) { (t._paused = !0), (t._pauseTime = n), t.pauseCallback && t.pauseCallback(); }), this.set("_pause", { isPaused: !0, pauseTime: n }), this ); }), (e.prototype.resumeAnimate = function () { var t = this.get("timeline").getTime(), e = this.get("animations"), n = this.get("_pause").pauseTime; return ( Object(i.each)(e, function (e) { (e.startTime = e.startTime + (t - n)), (e._paused = !1), (e._pauseTime = null), e.resumeCallback && e.resumeCallback(); }), this.set("_pause", { isPaused: !1 }), this.set("animations", e), this ); }), (e.prototype.emitDelegation = function (t, e) { var n, r = this, o = e.propagationPath; this.getEvents(); "mouseenter" === t ? (n = e.fromShape) : "mouseleave" === t && (n = e.toShape); for ( var s = function (t) { var s = o[t], u = s.get("name"); if (u) { if ( (s.isGroup() || (s.isCanvas && s.isCanvas())) && n && Object(a.g)(s, n) ) return "break"; Object(i.isArray)(u) ? Object(i.each)(u, function (t) { r.emitDelegateEvent(s, t, e); }) : c.emitDelegateEvent(s, u, e); } }, c = this, u = 0; u < o.length; u++ ) { if ("break" === s(u)) break; } }), (e.prototype.emitDelegateEvent = function (t, e, n) { var r = this.getEvents(), i = e + ":" + n.type; (r[i] || r["*"]) && ((n.name = i), (n.currentTarget = t), (n.delegateTarget = this), (n.delegateObject = t.get("delegateObject")), this.emit(i, n)); }), (e.prototype.translate = function (t, e) { void 0 === t && (t = 0), void 0 === e && (e = 0); var n = this.getMatrix(), r = u(n, [["t", t, e]]); return this.setMatrix(r), this; }), (e.prototype.move = function (t, e) { var n = this.attr("x") || 0, r = this.attr("y") || 0; return this.translate(t - n, e - r), this; }), (e.prototype.moveTo = function (t, e) { return this.move(t, e); }), (e.prototype.scale = function (t, e) { var n = this.getMatrix(), r = u(n, [["s", t, e || t]]); return this.setMatrix(r), this; }), (e.prototype.rotate = function (t) { var e = this.getMatrix(), n = u(e, [["r", t]]); return this.setMatrix(n), this; }), (e.prototype.rotateAtStart = function (t) { var e = this.attr(), n = e.x, r = e.y, i = this.getMatrix(), o = u(i, [ ["t", -n, -r], ["r", t], ["t", n, r], ]); return this.setMatrix(o), this; }), (e.prototype.rotateAtPoint = function (t, e, n) { var r = this.getMatrix(), i = u(r, [ ["t", -t, -e], ["r", n], ["t", t, e], ]); return this.setMatrix(i), this; }), e ); })(c.a); e.a = g; }, 94: function (t, e, n) { "use strict"; n.d(e, "b", function () { return u; }), n.d(e, "a", function () { return h; }); var r = n(3), i = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i, o = /^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i, a = /^p\s*\(\s*([axyn])\s*\)\s*(.*)/i, s = /[\d.]+:(#[^\s]+|[^\)]+\))/gi; function c(t, e) { var n = t.match(s); Object(r.b)(n, function (t) { var n = t.split(":"); e.addColorStop(n[0], n[1]); }); } function u(t, e, n) { if (Object(r.k)(n)) { if ("(" === n[1] || "(" === n[2]) { if ("l" === n[0]) return (function (t, e, n) { var r, o, a = i.exec(n), s = (parseFloat(a[1]) % 360) * (Math.PI / 180), u = a[2], h = e.getBBox(); s >= 0 && s < 0.5 * Math.PI ? ((r = { x: h.minX, y: h.minY }), (o = { x: h.maxX, y: h.maxY })) : 0.5 * Math.PI <= s && s < Math.PI ? ((r = { x: h.maxX, y: h.minY }), (o = { x: h.minX, y: h.maxY })) : Math.PI <= s && s < 1.5 * Math.PI ? ((r = { x: h.maxX, y: h.maxY }), (o = { x: h.minX, y: h.minY })) : ((r = { x: h.minX, y: h.maxY }), (o = { x: h.maxX, y: h.minY })); var l = Math.tan(s), f = l * l, d = (o.x - r.x + l * (o.y - r.y)) / (f + 1) + r.x, p = (l * (o.x - r.x + l * (o.y - r.y))) / (f + 1) + r.y, g = t.createLinearGradient(r.x, r.y, d, p); return c(u, g), g; })(t, e, n); if ("r" === n[0]) return (function (t, e, n) { var r = o.exec(n), i = parseFloat(r[1]), a = parseFloat(r[2]), u = parseFloat(r[3]), h = r[4]; if (0 === u) { var l = h.match(s); return l[l.length - 1].split(":")[1]; } var f = e.getBBox(), d = f.maxX - f.minX, p = f.maxY - f.minY, g = Math.sqrt(d * d + p * p) / 2, v = t.createRadialGradient( f.minX + d * i, f.minY + p * a, 0, f.minX + d / 2, f.minY + p / 2, u * g, ); return c(h, v), v; })(t, e, n); if ("p" === n[0]) return (function (t, e, n) { if (e.get("patternSource") && e.get("patternSource") === n) return e.get("pattern"); var r, i, o = a.exec(n), s = o[1], c = o[2]; function u() { (r = t.createPattern(i, s)), e.set("pattern", r), e.set("patternSource", n); } switch (s) { case "a": s = "repeat"; break; case "x": s = "repeat-x"; break; case "y": s = "repeat-y"; break; case "n": s = "no-repeat"; break; default: s = "no-repeat"; } return ( (i = new Image()), c.match(/^data:/i) || (i.crossOrigin = "Anonymous"), (i.src = c), i.complete ? u() : ((i.onload = u), (i.src = i.src)), r ); })(t, e, n); } return n; } } function h(t) { var e = 0, n = 0, i = 0, o = 0; return ( Object(r.f)(t) ? 1 === t.length ? (e = n = i = o = t[0]) : 2 === t.length ? ((e = i = t[0]), (n = o = t[1])) : 3 === t.length ? ((e = t[0]), (n = o = t[1]), (i = t[2])) : ((e = t[0]), (n = t[1]), (i = t[2]), (o = t[3])) : (e = n = i = o = t), [e, n, i, o] ); } }, 95: function (t, e, n) { "use strict"; n.r(e), n.d(e, "mixColor", function () { return B; }), n.d(e, "getColorsWithSubjectColor", function () { return L; }), n.d(e, "getColorSetsBySubjectColors", function () { return D; }); var r = n(55), i = n.n(r); function o(t, e) { (function (t) { return ( "string" == typeof t && -1 !== t.indexOf(".") && 1 === parseFloat(t) ); })(t) && (t = "100%"); var n = (function (t) { return "string" == typeof t && -1 !== t.indexOf("%"); })(t); return ( (t = 360 === e ? t : Math.min(e, Math.max(0, parseFloat(t)))), n && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (t = 360 === e ? (t < 0 ? (t % e) + e : t % e) / parseFloat(String(e)) : (t % e) / parseFloat(String(e))) ); } function a(t) { return Math.min(1, Math.max(0, t)); } function s(t) { return (t = parseFloat(t)), (isNaN(t) || t < 0 || t > 1) && (t = 1), t; } function c(t) { return t <= 1 ? "".concat(100 * Number(t), "%") : t; } function u(t) { return 1 === t.length ? "0" + t : String(t); } function h(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = 0, c = (r + i) / 2; if (r === i) (s = 0), (a = 0); else { var u = r - i; switch (((s = c > 0.5 ? u / (2 - r - i) : u / (r + i)), r)) { case t: a = (e - n) / u + (e < n ? 6 : 0); break; case e: a = (n - t) / u + 2; break; case n: a = (t - e) / u + 4; } a /= 6; } return { h: a, s: s, l: c }; } function l(t, e, n) { return ( n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + 6 * n * (e - t) : n < 0.5 ? e : n < 2 / 3 ? t + (e - t) * (2 / 3 - n) * 6 : t ); } function f(t, e, n) { (t = o(t, 255)), (e = o(e, 255)), (n = o(n, 255)); var r = Math.max(t, e, n), i = Math.min(t, e, n), a = 0, s = r, c = r - i, u = 0 === r ? 0 : c / r; if (r === i) a = 0; else { switch (r) { case t: a = (e - n) / c + (e < n ? 6 : 0); break; case e: a = (n - t) / c + 2; break; case n: a = (t - e) / c + 4; } a /= 6; } return { h: a, s: u, v: s }; } function d(t, e, n, r) { var i = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), ]; return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join(""); } function p(t) { return Math.round(255 * parseFloat(t)).toString(16); } function g(t) { return v(t) / 255; } function v(t) { return parseInt(t, 16); } var y = { aliceblue: "#f0f8ff", antiquewhite: "#faebd7", aqua: "#00ffff", aquamarine: "#7fffd4", azure: "#f0ffff", beige: "#f5f5dc", bisque: "#ffe4c4", black: "#000000", blanchedalmond: "#ffebcd", blue: "#0000ff", blueviolet: "#8a2be2", brown: "#a52a2a", burlywood: "#deb887", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", cornflowerblue: "#6495ed", cornsilk: "#fff8dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", darkkhaki: "#bdb76b", darkmagenta: "#8b008b", darkolivegreen: "#556b2f", darkorange: "#ff8c00", darkorchid: "#9932cc", darkred: "#8b0000", darksalmon: "#e9967a", darkseagreen: "#8fbc8f", darkslateblue: "#483d8b", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", darkturquoise: "#00ced1", darkviolet: "#9400d3", deeppink: "#ff1493", deepskyblue: "#00bfff", dimgray: "#696969", dimgrey: "#696969", dodgerblue: "#1e90ff", firebrick: "#b22222", floralwhite: "#fffaf0", forestgreen: "#228b22", fuchsia: "#ff00ff", gainsboro: "#dcdcdc", ghostwhite: "#f8f8ff", goldenrod: "#daa520", gold: "#ffd700", gray: "#808080", green: "#008000", greenyellow: "#adff2f", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", indianred: "#cd5c5c", indigo: "#4b0082", ivory: "#fffff0", khaki: "#f0e68c", lavenderblush: "#fff0f5", lavender: "#e6e6fa", lawngreen: "#7cfc00", lemonchiffon: "#fffacd", lightblue: "#add8e6", lightcoral: "#f08080", lightcyan: "#e0ffff", lightgoldenrodyellow: "#fafad2", lightgray: "#d3d3d3", lightgreen: "#90ee90", lightgrey: "#d3d3d3", lightpink: "#ffb6c1", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", lightskyblue: "#87cefa", lightslategray: "#778899", lightslategrey: "#778899", lightsteelblue: "#b0c4de", lightyellow: "#ffffe0", lime: "#00ff00", limegreen: "#32cd32", linen: "#faf0e6", magenta: "#ff00ff", maroon: "#800000", mediumaquamarine: "#66cdaa", mediumblue: "#0000cd", mediumorchid: "#ba55d3", mediumpurple: "#9370db", mediumseagreen: "#3cb371", mediumslateblue: "#7b68ee", mediumspringgreen: "#00fa9a", mediumturquoise: "#48d1cc", mediumvioletred: "#c71585", midnightblue: "#191970", mintcream: "#f5fffa", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", navajowhite: "#ffdead", navy: "#000080", oldlace: "#fdf5e6", olive: "#808000", olivedrab: "#6b8e23", orange: "#ffa500", orangered: "#ff4500", orchid: "#da70d6", palegoldenrod: "#eee8aa", palegreen: "#98fb98", paleturquoise: "#afeeee", palevioletred: "#db7093", papayawhip: "#ffefd5", peachpuff: "#ffdab9", peru: "#cd853f", pink: "#ffc0cb", plum: "#dda0dd", powderblue: "#b0e0e6", purple: "#800080", rebeccapurple: "#663399", red: "#ff0000", rosybrown: "#bc8f8f", royalblue: "#4169e1", saddlebrown: "#8b4513", salmon: "#fa8072", sandybrown: "#f4a460", seagreen: "#2e8b57", seashell: "#fff5ee", sienna: "#a0522d", silver: "#c0c0c0", skyblue: "#87ceeb", slateblue: "#6a5acd", slategray: "#708090", slategrey: "#708090", snow: "#fffafa", springgreen: "#00ff7f", steelblue: "#4682b4", tan: "#d2b48c", teal: "#008080", thistle: "#d8bfd8", tomato: "#ff6347", turquoise: "#40e0d0", violet: "#ee82ee", wheat: "#f5deb3", white: "#ffffff", whitesmoke: "#f5f5f5", yellow: "#ffff00", yellowgreen: "#9acd32", }; function m(t) { return (m = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function b(t) { var e, n, r, i = { r: 0, g: 0, b: 0 }, a = 1, u = null, h = null, f = null, d = !1, p = !1; return ( "string" == typeof t && (t = (function (t) { if (0 === (t = t.trim().toLowerCase()).length) return !1; var e = !1; if (y[t]) (t = y[t]), (e = !0); else if ("transparent" === t) return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var n = O.rgb.exec(t); if (n) return { r: n[1], g: n[2], b: n[3] }; if ((n = O.rgba.exec(t))) return { r: n[1], g: n[2], b: n[3], a: n[4] }; if ((n = O.hsl.exec(t))) return { h: n[1], s: n[2], l: n[3] }; if ((n = O.hsla.exec(t))) return { h: n[1], s: n[2], l: n[3], a: n[4] }; if ((n = O.hsv.exec(t))) return { h: n[1], s: n[2], v: n[3] }; if ((n = O.hsva.exec(t))) return { h: n[1], s: n[2], v: n[3], a: n[4] }; if ((n = O.hex8.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), a: g(n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex6.exec(t))) return { r: v(n[1]), g: v(n[2]), b: v(n[3]), format: e ? "name" : "hex", }; if ((n = O.hex4.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), a: g(n[4] + n[4]), format: e ? "name" : "hex8", }; if ((n = O.hex3.exec(t))) return { r: v(n[1] + n[1]), g: v(n[2] + n[2]), b: v(n[3] + n[3]), format: e ? "name" : "hex", }; return !1; })(t)), "object" === m(t) && (M(t.r) && M(t.g) && M(t.b) ? ((e = t.r), (n = t.g), (r = t.b), (i = { r: 255 * o(e, 255), g: 255 * o(n, 255), b: 255 * o(r, 255), }), (d = !0), (p = "%" === String(t.r).substr(-1) ? "prgb" : "rgb")) : M(t.h) && M(t.s) && M(t.v) ? ((u = c(t.s)), (h = c(t.v)), (i = (function (t, e, n) { (t = 6 * o(t, 360)), (e = o(e, 100)), (n = o(n, 100)); var r = Math.floor(t), i = t - r, a = n * (1 - e), s = n * (1 - i * e), c = n * (1 - (1 - i) * e), u = r % 6; return { r: 255 * [n, s, a, a, c, n][u], g: 255 * [c, n, n, s, a, a][u], b: 255 * [a, a, c, n, n, s][u], }; })(t.h, u, h)), (d = !0), (p = "hsv")) : M(t.h) && M(t.s) && M(t.l) && ((u = c(t.s)), (f = c(t.l)), (i = (function (t, e, n) { var r, i, a; if ( ((t = o(t, 360)), (e = o(e, 100)), (n = o(n, 100)), 0 === e) ) (i = n), (a = n), (r = n); else { var s = n < 0.5 ? n * (1 + e) : n + e - n * e, c = 2 * n - s; (r = l(c, s, t + 1 / 3)), (i = l(c, s, t)), (a = l(c, s, t - 1 / 3)); } return { r: 255 * r, g: 255 * i, b: 255 * a }; })(t.h, u, f)), (d = !0), (p = "hsl")), Object.prototype.hasOwnProperty.call(t, "a") && (a = t.a)), (a = s(a)), { ok: d, format: t.format || p, r: Math.min(255, Math.max(i.r, 0)), g: Math.min(255, Math.max(i.g, 0)), b: Math.min(255, Math.max(i.b, 0)), a: a, } ); } var x = "(?:" .concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:") .concat("[-\\+]?\\d+%?", ")"), S = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), w = "[\\s|\\(]+(" .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")[,|\\s]+(") .concat(x, ")\\s*\\)?"), O = { CSS_UNIT: new RegExp(x), rgb: new RegExp("rgb" + S), rgba: new RegExp("rgba" + w), hsl: new RegExp("hsl" + S), hsla: new RegExp("hsla" + w), hsv: new RegExp("hsv" + S), hsva: new RegExp("hsva" + w), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, }; function M(t) { return Boolean(O.CSS_UNIT.exec(String(t))); } var k = (function () { function t(e, n) { var r; if ( (void 0 === e && (e = ""), void 0 === n && (n = {}), e instanceof t) ) return e; "number" == typeof e && (e = (function (t) { return { r: t >> 16, g: (65280 & t) >> 8, b: 255 & t }; })(e)), (this.originalInput = e); var i = b(e); (this.originalInput = e), (this.r = i.r), (this.g = i.g), (this.b = i.b), (this.a = i.a), (this.roundA = Math.round(100 * this.a) / 100), (this.format = null !== (r = n.format) && void 0 !== r ? r : i.format), (this.gradientType = n.gradientType), this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), (this.isValid = i.ok); } return ( (t.prototype.isDark = function () { return this.getBrightness() < 128; }), (t.prototype.isLight = function () { return !this.isDark(); }), (t.prototype.getBrightness = function () { var t = this.toRgb(); return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3; }), (t.prototype.getLuminance = function () { var t = this.toRgb(), e = t.r / 255, n = t.g / 255, r = t.b / 255; return ( 0.2126 * (e <= 0.03928 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4)) + 0.7152 * (n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4)) + 0.0722 * (r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4)) ); }), (t.prototype.getAlpha = function () { return this.a; }), (t.prototype.setAlpha = function (t) { return ( (this.a = s(t)), (this.roundA = Math.round(100 * this.a) / 100), this ); }), (t.prototype.isMonochrome = function () { return 0 === this.toHsl().s; }), (t.prototype.toHsv = function () { var t = f(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, v: t.v, a: this.a }; }), (t.prototype.toHsvString = function () { var t = f(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.v); return 1 === this.a ? "hsv(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsva(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHsl = function () { var t = h(this.r, this.g, this.b); return { h: 360 * t.h, s: t.s, l: t.l, a: this.a }; }), (t.prototype.toHslString = function () { var t = h(this.r, this.g, this.b), e = Math.round(360 * t.h), n = Math.round(100 * t.s), r = Math.round(100 * t.l); return 1 === this.a ? "hsl(".concat(e, ", ").concat(n, "%, ").concat(r, "%)") : "hsla(" .concat(e, ", ") .concat(n, "%, ") .concat(r, "%, ") .concat(this.roundA, ")"); }), (t.prototype.toHex = function (t) { return void 0 === t && (t = !1), d(this.r, this.g, this.b, t); }), (t.prototype.toHexString = function (t) { return void 0 === t && (t = !1), "#" + this.toHex(t); }), (t.prototype.toHex8 = function (t) { return ( void 0 === t && (t = !1), (function (t, e, n, r, i) { var o = [ u(Math.round(t).toString(16)), u(Math.round(e).toString(16)), u(Math.round(n).toString(16)), u(p(r)), ]; return i && o[0].startsWith(o[0].charAt(1)) && o[1].startsWith(o[1].charAt(1)) && o[2].startsWith(o[2].charAt(1)) && o[3].startsWith(o[3].charAt(1)) ? o[0].charAt(0) + o[1].charAt(0) + o[2].charAt(0) + o[3].charAt(0) : o.join(""); })(this.r, this.g, this.b, this.a, t) ); }), (t.prototype.toHex8String = function (t) { return void 0 === t && (t = !1), "#" + this.toHex8(t); }), (t.prototype.toRgb = function () { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a, }; }), (t.prototype.toRgbString = function () { var t = Math.round(this.r), e = Math.round(this.g), n = Math.round(this.b); return 1 === this.a ? "rgb(".concat(t, ", ").concat(e, ", ").concat(n, ")") : "rgba(" .concat(t, ", ") .concat(e, ", ") .concat(n, ", ") .concat(this.roundA, ")"); }), (t.prototype.toPercentageRgb = function () { var t = function (t) { return "".concat(Math.round(100 * o(t, 255)), "%"); }; return { r: t(this.r), g: t(this.g), b: t(this.b), a: this.a }; }), (t.prototype.toPercentageRgbString = function () { var t = function (t) { return Math.round(100 * o(t, 255)); }; return 1 === this.a ? "rgb(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%)") : "rgba(" .concat(t(this.r), "%, ") .concat(t(this.g), "%, ") .concat(t(this.b), "%, ") .concat(this.roundA, ")"); }), (t.prototype.toName = function () { if (0 === this.a) return "transparent"; if (this.a < 1) return !1; for ( var t = "#" + d(this.r, this.g, this.b, !1), e = 0, n = Object.entries(y); e < n.length; e++ ) { var r = n[e], i = r[0]; if (t === r[1]) return i; } return !1; }), (t.prototype.toString = function (t) { var e = Boolean(t); t = null != t ? t : this.format; var n = !1, r = this.a < 1 && this.a >= 0; return e || !r || (!t.startsWith("hex") && "name" !== t) ? ("rgb" === t && (n = this.toRgbString()), "prgb" === t && (n = this.toPercentageRgbString()), ("hex" !== t && "hex6" !== t) || (n = this.toHexString()), "hex3" === t && (n = this.toHexString(!0)), "hex4" === t && (n = this.toHex8String(!0)), "hex8" === t && (n = this.toHex8String()), "name" === t && (n = this.toName()), "hsl" === t && (n = this.toHslString()), "hsv" === t && (n = this.toHsvString()), n || this.toHexString()) : "name" === t && 0 === this.a ? this.toName() : this.toRgbString(); }), (t.prototype.toNumber = function () { return ( (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b) ); }), (t.prototype.clone = function () { return new t(this.toString()); }), (t.prototype.lighten = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l += e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.brighten = function (e) { void 0 === e && (e = 10); var n = this.toRgb(); return ( (n.r = Math.max( 0, Math.min(255, n.r - Math.round((-e / 100) * 255)), )), (n.g = Math.max( 0, Math.min(255, n.g - Math.round((-e / 100) * 255)), )), (n.b = Math.max( 0, Math.min(255, n.b - Math.round((-e / 100) * 255)), )), new t(n) ); }), (t.prototype.darken = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.l -= e / 100), (n.l = a(n.l)), new t(n); }), (t.prototype.tint = function (t) { return void 0 === t && (t = 10), this.mix("white", t); }), (t.prototype.shade = function (t) { return void 0 === t && (t = 10), this.mix("black", t); }), (t.prototype.desaturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s -= e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.saturate = function (e) { void 0 === e && (e = 10); var n = this.toHsl(); return (n.s += e / 100), (n.s = a(n.s)), new t(n); }), (t.prototype.greyscale = function () { return this.desaturate(100); }), (t.prototype.spin = function (e) { var n = this.toHsl(), r = (n.h + e) % 360; return (n.h = r < 0 ? 360 + r : r), new t(n); }), (t.prototype.mix = function (e, n) { void 0 === n && (n = 50); var r = this.toRgb(), i = new t(e).toRgb(), o = n / 100; return new t({ r: (i.r - r.r) * o + r.r, g: (i.g - r.g) * o + r.g, b: (i.b - r.b) * o + r.b, a: (i.a - r.a) * o + r.a, }); }), (t.prototype.analogous = function (e, n) { void 0 === e && (e = 6), void 0 === n && (n = 30); var r = this.toHsl(), i = 360 / n, o = [this]; for (r.h = (r.h - ((i * e) >> 1) + 720) % 360; --e; ) (r.h = (r.h + i) % 360), o.push(new t(r)); return o; }), (t.prototype.complement = function () { var e = this.toHsl(); return (e.h = (e.h + 180) % 360), new t(e); }), (t.prototype.monochromatic = function (e) { void 0 === e && (e = 6); for ( var n = this.toHsv(), r = n.h, i = n.s, o = n.v, a = [], s = 1 / e; e--; ) a.push(new t({ h: r, s: i, v: o })), (o = (o + s) % 1); return a; }), (t.prototype.splitcomplement = function () { var e = this.toHsl(), n = e.h; return [ this, new t({ h: (n + 72) % 360, s: e.s, l: e.l }), new t({ h: (n + 216) % 360, s: e.s, l: e.l }), ]; }), (t.prototype.onBackground = function (e) { var n = this.toRgb(), r = new t(e).toRgb(); return new t({ r: r.r + (n.r - r.r) * n.a, g: r.g + (n.g - r.g) * n.a, b: r.b + (n.b - r.b) * n.a, }); }), (t.prototype.triad = function () { return this.polyad(3); }), (t.prototype.tetrad = function () { return this.polyad(4); }), (t.prototype.polyad = function (e) { for ( var n = this.toHsl(), r = n.h, i = [this], o = 360 / e, a = 1; a < e; a++ ) i.push(new t({ h: (r + a * o) % 360, s: n.s, l: n.l })); return i; }), (t.prototype.equals = function (e) { return this.toRgbString() === new t(e).toRgbString(); }), t ); })(); var j = [ { index: 7, opacity: 0.15 }, { index: 6, opacity: 0.25 }, { index: 5, opacity: 0.3 }, { index: 5, opacity: 0.45 }, { index: 5, opacity: 0.65 }, { index: 5, opacity: 0.85 }, { index: 4, opacity: 0.9 }, { index: 3, opacity: 0.95 }, { index: 2, opacity: 0.97 }, { index: 1, opacity: 0.98 }, ]; function C(t, e, n) { var r; return ( (r = Math.round(t.h) >= 60 && Math.round(t.h) <= 240 ? n ? Math.round(t.h) - 2 * e : Math.round(t.h) + 2 * e : n ? Math.round(t.h) + 2 * e : Math.round(t.h) - 2 * e) < 0 ? (r += 360) : r >= 360 && (r -= 360), r ); } function E(t, e, n) { return 0 === t.h && 0 === t.s ? t.s : ((r = n ? t.s - 0.16 * e : 4 === e ? t.s + 0.16 : t.s + 0.05 * e) > 1 && (r = 1), n && 5 === e && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Number(r.toFixed(2))); var r; } function P(t, e, n) { var r; return ( (r = n ? t.v + 0.05 * e : t.v - 0.15 * e) > 1 && (r = 1), Number(r.toFixed(2)) ); } function A(t) { for ( var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = [], r = new k(t), i = 5; i > 0; i -= 1 ) { var o = r.toHsv(), a = new k({ h: C(o, i, !0), s: E(o, i, !0), v: P(o, i, !0), }).toHexString(); n.push(a); } n.push(r.toHexString()); for (var s = 1; s <= 4; s += 1) { var c = r.toHsv(), u = new k({ h: C(c, s), s: E(c, s), v: P(c, s) }).toHexString(); n.push(u); } return "dark" === e.theme ? j.map(function (t) { var r = t.index, i = t.opacity; return new k(e.backgroundColor || "#141414") .mix(n[r], 100 * i) .toHexString(); }) : n; } var I = { red: "#F5222D", volcano: "#FA541C", orange: "#FA8C16", gold: "#FAAD14", yellow: "#FADB14", lime: "#A0D911", green: "#52C41A", cyan: "#13C2C2", blue: "#1890FF", geekblue: "#2F54EB", purple: "#722ED1", magenta: "#EB2F96", grey: "#666666", }, T = {}, N = {}; Object.keys(I).forEach(function (t) { (T[t] = A(I[t])), (T[t].primary = T[t][5]), (N[t] = A(I[t], { theme: "dark", backgroundColor: "#141414" })), (N[t].primary = N[t][5]); }); T.red, T.volcano, T.gold, T.orange, T.yellow, T.lime, T.green, T.cyan, T.blue, T.geekblue, T.purple, T.magenta, T.grey; var B = function (t, e, n) { var r = i()(t), o = i()(e); return i()([ (1 - n) * r.red() + n * o.red(), (1 - n) * r.green() + n * o.green(), (1 - n) * r.blue() + n * o.blue(), ]).rgb(); }, L = function (t, e, n, r) { return ( void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"), "default" === n ? (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "rgb(150, 150, 150)"); var r = B(e, t, 0.05).rgb().toString(), o = B(e, t, 0.1).rgb().toString(), a = B(e, t, 0.2).rgb().toString(), s = B(e, t, 0.4).rgb().toString(), c = B(e, n, 0.02).rgb().toString(), u = B(e, n, 0.05).rgb().toString(), h = B(e, n, 0.1).rgb().toString(), l = B(e, n, 0.2).rgb().toString(), f = B(e, n, 0.3).rgb().toString(), d = A(t, { theme: "default", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: t, mainFill: o, activeStroke: t, activeFill: r, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: e, highlightStroke: v, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: f, edgeActiveStroke: t, edgeInactiveStroke: l, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: f, comboMainFill: c, comboActiveStroke: t, comboActiveFill: r, comboInactiveStroke: f, comboInactiveFill: c, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: c, comboDisableStroke: l, comboDisableFill: u, } ); })(t, e, "rgb(150, 150, 150)") : (function (t, e, n) { void 0 === e && (e = "#fff"), void 0 === n && (n = "#777"); var r = B(e, t, 0.2).rgb().toString(), o = B(e, t, 0.3).rgb().toString(), a = B(e, t, 0.6).rgb().toString(), s = B(e, t, 0.8).rgb().toString(), c = B(e, n, 0.2).rgb().toString(), u = B(e, n, 0.25).rgb().toString(), h = B(e, n, 0.3).rgb().toString(), l = B(e, n, 0.4).rgb().toString(), f = B(e, n, 0.5).rgb().toString(), d = A(t, { theme: "dark", backgroundColor: e }), p = i()(t).hex().toLowerCase(), g = d.indexOf(p), v = t; return ( -1 !== g && (v = d[g + 1]), { mainStroke: s, mainFill: r, activeStroke: t, activeFill: o, inactiveStroke: s, inactiveFill: r, selectedStroke: t, selectedFill: r, highlightStroke: t, highlightFill: a, disableStroke: f, disableFill: u, edgeMainStroke: n, edgeActiveStroke: t, edgeInactiveStroke: n, edgeSelectedStroke: t, edgeHighlightStroke: t, edgeDisableStroke: h, comboMainStroke: l, comboMainFill: u, comboActiveStroke: t, comboActiveFill: c, comboInactiveStroke: l, comboInactiveFill: u, comboSelectedStroke: t, comboSelectedFill: c, comboHighlightStroke: v, comboHighlightFill: u, comboDisableStroke: l, comboDisableFill: c, } ); })(t, e, "#777") ); }, D = function (t, e, n, r) { void 0 === e && (e = "#fff"), void 0 === n && (n = "default"), void 0 === r && (r = "rgb(150, 150, 150)"); var i = []; return ( t.forEach(function (t) { i.push(L(t, e, n, r)); }), i ); }; }, 96: function (t, e, n) { "use strict"; n.d(e, "b", function () { return v; }); var r = n(1), i = n(65), o = n(5); var a = n(0), s = n(2), c = n(22), u = s.h.cloneEvent, h = s.h.isViewportChanged, l = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.extendEvents = []), (n.dragging = !1), (n.preItem = null), (n.graph = e), (n.destroyed = !1), n ); } return ( Object(r.c)(e, t), (e.prototype.initEvents = function () { var t = this.graph, e = (this.extendEvents, t.get("canvas")); (this.canvasHandler = Object(a.wrapBehavior)( this, "onCanvasEvents", )), e.off("*").on("*", this.canvasHandler); }), (e.getItemRoot = function (t) { for (; t && !t.get("item"); ) t = t.get("parent"); return t; }), (e.prototype.onCanvasEvents = function (t) { var n = this.graph, r = n.get("canvas"), i = t.target, o = t.type; (t.canvasX = t.x), (t.canvasY = t.y); var a = { x: t.canvasX, y: t.canvasY }, s = n.get("group").getMatrix(); if ( (s || (s = [1, 0, 0, 0, 1, 0, 0, 0, 1]), h(s) && (a = n.getPointByClient(t.clientX, t.clientY)), (t.x = a.x), (t.y = a.y), (t.currentTarget = n), i === r) ) return ( "panmove" === o && this.handleTouchMove(t, "canvas"), (t.target = r), (t.item = null), n.emit(o, t), void n.emit("canvas:" + o, t) ); var c = e.getItemRoot(i); if (c) { var u = c.get("item"); if (!u.destroyed) { var l = u.getType(); if ( ((t.target = i), (t.item = u), t.canvasX === t.x && t.canvasY === t.y) ) { var f = n.getCanvasByPoint(t.x, t.y); (t.canvasX = f.x), (t.canvasY = f.y); } n.emit(o, t), t.name && !t.name.includes(":") ? n.emit(l + ":" + o, t) : n.emit(t.name, t), "dragstart" === o && (this.dragging = !0), "dragend" === o && (this.dragging = !1), "panmove" === o && this.handleTouchMove(t, l); } } else n.emit(o, t); }), (e.prototype.onExtendEvents = function (t) { this.graph.emit(t.type, t); }), (e.prototype.emitCustomEvent = function (t, e, n) { (n.type = e), this.graph.emit(t + ":" + e, n); }), (e.prototype.destroy = function () { var t = this.graph, e = this.canvasHandler, n = this.extendEvents; t.get("canvas").off("*", e), Object(a.each)(n, function (t) { t.remove(); }), (this.dragging = !1), (this.preItem = null), (this.extendEvents.length = 0), (this.canvasHandler = null), (this.destroyed = !0); }), (e.prototype.handleTouchMove = function (t, e) { var n = this.graph, r = this.preItem, i = n.get("canvas"), o = t.target === i ? null : t.item; (t = u(t)), r && r !== o && !r.destroyed && ((t.item = r), this.emitCustomEvent(r.getType(), "touchleave", t), this.dragging && this.emitCustomEvent(r.getType(), "dragleave", t)), o && r !== o && ((t.item = o), this.emitCustomEvent(e, "touchenter", t), this.dragging && this.emitCustomEvent(e, "dragenter", t)), (this.preItem = o); }), e ); })(s.a), f = n(33), d = ["force", "grid", "circular"], p = (function (t) { function e(e) { var n = t.call(this, e) || this; return ( (n.graph = e), (n.layoutCfg = e.get("layout") || {}), (n.layoutType = n.getLayoutType()), n ); } return ( Object(r.c)(e, t), (e.prototype.updateLayoutCfg = function (t) { var e = this, n = this.graph, r = this.layoutMethods, i = Object(a.mix)({}, this.layoutCfg, t); if (((this.layoutCfg = i), null == r ? void 0 : r.length)) { (this.data = this.setDataFromGraph()), n.emit("beforelayout"); var o = Promise.resolve(); 1 === r.length ? (o = o.then(function () { return e.updateLayoutMethod(r[0], i); })) : null == r || r.forEach(function (t, n) { var r = i.pipes[n]; o = o.then(function () { return e.updateLayoutMethod(t, r); }); }), (this.data = this.setDataFromGraph()), o .then(function () { i.onAllLayoutEnd && i.onAllLayoutEnd(); }) .catch(function (t) { console.warn("layout failed", t); }); } else this.layout(); }), (e.prototype.layout = function (t) { var e = this, n = this.graph; this.data = this.setDataFromGraph(); var i = this.data, o = i.nodes, a = i.hiddenNodes; if (!o) return !1; var s = n.get("width"), c = n.get("height"), u = {}; Object.assign( u, { width: s, height: c, center: [s / 2, c / 2] }, this.layoutCfg, ), (this.layoutCfg = u), this.destoryLayoutMethods(), n.emit("beforelayout"), this.initPositions(u.center, o), this.initPositions(u.center, a); var h = u.onLayoutEnd, l = u.layoutEndFormatted, f = u.adjust; l || ((u.layoutEndFormatted = !0), (u.onAllLayoutEnd = function () { return Object(r.b)(e, void 0, void 0, function () { return Object(r.d)(this, function (t) { switch (t.label) { case 0: return ( h && h(), this.refreshLayout(), f && u.pipes ? [4, this.adjustPipesBox(this.data, f)] : [3, 2] ); case 1: t.sent(), this.refreshLayout(), (t.label = 2); case 2: return n.emit("afterlayout"), [2]; } }); }); })); var d = Promise.resolve(); return ( u.type ? (d = d.then(function () { return e.execLayoutMethod(u, 0); })) : u.pipes && u.pipes.forEach(function (t, n) { d = d.then(function () { return e.execLayoutMethod(t, n); }); }), d .then(function () { u.onAllLayoutEnd && u.onAllLayoutEnd(), t && t(); }) .catch(function (t) { console.warn("graph layout failed,", t); }), !1 ); }), (e.prototype.execLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = t.type; if ( ((t.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }), "force" === a || "g6force" === a || "gForce" === a) ) { var s = t.onTick, c = function () { s && s(), o.refreshPositions(); }; t.tick = c; } else "comboForce" === t.type && (t.comboTrees = o.get("comboTrees")); var u; try { u = new f.a(t); } catch (t) { console.warn( "The layout method: '" + a + "' does not exist! Please specify it first.", ), i(); } if (u.enableTick) { var h = t.onTick; c = function () { h && h(), o.refreshPositions(); }; u.tick = c; } var l = n.filterLayoutData(n.data, t); !(function (t, e) { var n; if ( !(null === (n = null == t ? void 0 : t.nodes) || void 0 === n ? void 0 : n.length) ) return; t.nodes.forEach(function (t) { t.layoutOrder = e; }); })(l, e), u.init(l), o.emit("beforesublayout", { type: a }), u.execute(), u.isCustomLayout && t.onLayoutEnd && t.onLayoutEnd(), n.layoutMethods.push(u); }); }), (e.prototype.updateLayoutMethod = function (t, e) { var n = this; return new Promise(function (r, i) { var o = n.graph, a = null == e ? void 0 : e.type; e.onLayoutEnd = function () { o.emit("aftersublayout", { type: a }), r(); }; var s = n.filterLayoutData(n.data, e); t.init(s), t.updateCfg(e), o.emit("beforesublayout", { type: a }), t.execute(), t.isCustomLayout && e.onLayoutEnd && e.onLayoutEnd(); }); }), (e.prototype.adjustPipesBox = function (t, e) { var n = this; return new Promise(function (r) { var i = t.nodes; (null == i ? void 0 : i.length) || r(), d.includes(e) || (console.warn( "The adjust type " + e + " is not supported yet, please assign it with 'force', 'grid', or 'circular'.", ), r()); var o = { center: n.layoutCfg.center, nodeSize: function (t) { return Math.max(t.height, t.width); }, preventOverlap: !0, onLayoutEnd: function () {}, }, s = n.getLayoutBBox(i), c = s.groupNodes, u = s.layoutNodes, h = Object(a.clone)(u); (o.onLayoutEnd = function () { null == u || u.forEach(function (t, e) { var n, r, i, o = t.x - (null === (n = h[e]) || void 0 === n ? void 0 : n.x), a = t.y - (null === (r = h[e]) || void 0 === r ? void 0 : r.y); null === (i = c[e]) || void 0 === i || i.forEach(function (t) { (t.x += o), (t.y += a); }); }), r(); }), new f.a(o).layout({ nodes: u }); }); }), (e.prototype.destroy = function () { this.destoryLayoutMethods(), (this.destroyed = !0), this.graph.set("layout", void 0), (this.layoutCfg = void 0), (this.layoutType = void 0), (this.layoutMethods = void 0), (this.graph = null); }), e ); })(s.c); var g = n(54), v = function (t, e, n) { return ( n[t] && console.warn( "The graph with the name " + t + " exists already, it will be overridden", ), (n[t] = e(n)), n ); }, y = (function (t) { function e(e) { var n = t.call(this, e) || this; n.get("renderer").startsWith("mini") && n.set("context", e.context), t.prototype.init.call(n); var r = n.get("defaultNode"); return ( r || n.set("defaultNode", { type: "circle" }), r.type || ((r.type = "circle"), n.set("defaultNode", r)), (n.destroyed = !1), n ); } return ( Object(r.c)(e, t), (e.prototype.init = function () {}), (e.prototype.emitEvent = function (t) { var e = this.get("canvas"); (t.type = t.type.toLowerCase()), e.registerEventCallback(t); }), (e.prototype.initLayoutController = function () { var t = new p(this); this.set({ layoutController: t }); }), (e.prototype.initEventController = function () { var t = new l(this); if ( (this.set({ eventController: t }), !this.get("renderer").startsWith("mini")) ) { var e = this.get("canvas"), n = e.get("el"); "touchstart touchmove touchend touchcancel" .split(" ") .forEach(function (t) { n.addEventListener(t, e.registerEventCallback.bind(e), !1); }); } }), (e.prototype.initCanvas = function () { var t = this.get("container"); null !== t && "string" == typeof t && ((t = document.getElementById(t)), this.set("container", t)); var e = this.get("renderer"); if (!t && !e.startsWith("mini")) throw new Error("invalid container"); var n = this.get("width"), r = this.get("height"), o = { container: t, context: this.get("context"), width: n, height: r, renderer: e, fitView: this.get("fitView"), }, a = this.get("pixelRatio"); a && (o.pixelRatio = a); var s = new i.Canvas(o); this.set("canvas", s); }), (e.prototype.initPlugins = function () { var t = this; Object(a.each)(t.get("plugins"), function (e) { !e.destroyed && e.initPlugin && e.initPlugin(t); }); }), (e.prototype.toDataURL = function (t, e) { var n = this.get("canvas"), r = n.getRenderer(), i = n.get("el"); t || (t = "image/png"); var o = ""; if ("svg" === r) { var a = i.cloneNode(!0), s = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), c = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", s, ); c.replaceChild(a, c.documentElement); var u = new XMLSerializer().serializeToString(c); o = "data:image/svg+xml;charset=utf8," + encodeURIComponent(u); } else { var h = void 0, l = i.getContext("2d"), f = this.get("width"), d = this.get("height"), p = void 0; if (e) { var g = "undefined" != typeof window ? window.devicePixelRatio : 1; (h = l.getImageData(0, 0, f * g, d * g)), (p = l.globalCompositeOperation), (l.globalCompositeOperation = "destination-over"), (l.fillStyle = e), l.fillRect(0, 0, f, d); } (o = i.toDataURL(t)), e && (l.clearRect(0, 0, f, d), l.putImageData(h, 0, 0), (l.globalCompositeOperation = p)); } return o; }), (e.prototype.toFullDataURL = function (t, e, n) { var r = this.get("group").getCanvasBBox(), s = r.height, c = r.width, u = this.get("renderer"), h = Object(g.a)(''), l = n ? n.backgroundColor : void 0, f = n ? n.padding : void 0; f ? Object(a.isNumber)(f) && (f = [f, f, f, f]) : (f = [0, 0, 0, 0]); var d = s + f[0] + f[2], p = c + f[1] + f[3], v = { container: h, height: d, width: p, quickHit: !0 }, y = new i.Canvas(v), m = this.get("group").clone(), b = Object(a.clone)(m.getMatrix()); b || (b = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var x = (r.maxX + r.minX) / 2, S = (r.maxY + r.minY) / 2; o.a.translate(b, b, [-x, -S]), o.a.translate(b, b, [c / 2 + f[3], s / 2 + f[0]]), m.resetMatrix(), m.setMatrix(b), y.add(m); var w = y.get("el"), O = ""; e || (e = "image/png"), setTimeout(function () { if ("svg" === u) { var n = w.cloneNode(!0), r = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), i = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", r, ); i.replaceChild(n, i.documentElement); var o = new XMLSerializer().serializeToString(i); O = "data:image/svg+xml;charset=utf8," + encodeURIComponent(o); } else { var a = void 0, s = w.getContext("2d"), c = void 0; if (l) { var h = "undefined" != typeof window ? window.devicePixelRatio : 1; (a = s.getImageData(0, 0, p * h, d * h)), (c = s.globalCompositeOperation), (s.globalCompositeOperation = "destination-over"), (s.fillStyle = l), s.fillRect(0, 0, p, d); } (O = w.toDataURL(e)), l && (s.clearRect(0, 0, p, d), s.putImageData(a, 0, 0), (s.globalCompositeOperation = c)); } t && t(O); }, 16); }), (e.prototype.downloadFullImage = function (t, e, n) { var r = this, s = this.get("group").getCanvasBBox(), c = s.height, u = s.width, h = this.get("renderer"), l = Object(g.a)(''), f = n ? n.backgroundColor : void 0, d = n ? n.padding : void 0; d ? Object(a.isNumber)(d) && (d = [d, d, d, d]) : (d = [0, 0, 0, 0]); var p = c + d[0] + d[2], v = u + d[1] + d[3], y = { container: l, height: p, width: v }, m = new i.Canvas(y), b = this.get("group").clone(), x = Object(a.clone)(b.getMatrix()); x || (x = [1, 0, 0, 0, 1, 0, 0, 0, 1]); var S = (s.maxX + s.minX) / 2, w = (s.maxY + s.minY) / 2; o.a.translate(x, x, [-S, -w]), o.a.translate(x, x, [u / 2 + d[3], c / 2 + d[0]]), b.resetMatrix(), b.setMatrix(x), m.add(b); var O = m.get("el"); e || (e = "image/png"), setTimeout(function () { var n = ""; if ("svg" === h) { var i = O.cloneNode(!0), o = document.implementation.createDocumentType( "svg", "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", ), a = document.implementation.createDocument( "http://www.w3.org/2000/svg", "svg", o, ); a.replaceChild(i, a.documentElement); var s = new XMLSerializer().serializeToString(a); n = "data:image/svg+xml;charset=utf8," + encodeURIComponent(s); } else { var c = void 0, u = O.getContext("2d"), l = void 0; if (f) { var d = "undefined" != typeof window ? window.devicePixelRatio : 1; (c = u.getImageData(0, 0, v * d, p * d)), (l = u.globalCompositeOperation), (u.globalCompositeOperation = "destination-over"), (u.fillStyle = f), u.fillRect(0, 0, v, p); } (n = O.toDataURL(e)), f && (u.clearRect(0, 0, v, p), u.putImageData(c, 0, 0), (u.globalCompositeOperation = l)); } var g = document.createElement("a"), y = (t || "graph") + ("svg" === h ? ".svg" : "." + e.split("/")[1]); r.dataURLToImage(n, h, g, y); var m = document.createEvent("MouseEvents"); m.initEvent("click", !1, !1), g.dispatchEvent(m); }, 16); }), (e.prototype.downloadImage = function (t, e, n) { var r = this, i = this; i.isAnimating() && i.stopAnimate(); var o = i.get("canvas").getRenderer(); e || (e = "image/png"); var a = (t || "graph") + ("svg" === o ? ".svg" : e.split("/")[1]), s = document.createElement("a"); setTimeout(function () { var t = i.toDataURL(e, n); r.dataURLToImage(t, o, s, a); var c = document.createEvent("MouseEvents"); c.initEvent("click", !1, !1), s.dispatchEvent(c); }, 16); }), (e.prototype.dataURLToImage = function (t, e, n, r) { if ("undefined" != typeof window) if (window.Blob && window.URL && "svg" !== e) { var i = t.split(","), o = ""; if (i && i.length > 0) { var a = i[0].match(/:(.*?);/); a && a.length >= 2 && (o = a[1]); } for ( var s = atob(i[1]), c = s.length, u = new Uint8Array(c); c--; ) u[c] = s.charCodeAt(c); var h = new Blob([u], { type: o }); window.navigator.msSaveBlob ? window.navigator.msSaveBlob(h, r) : n.addEventListener("click", function () { (n.download = r), (n.href = window.URL.createObjectURL(h)); }); } else n.addEventListener("click", function () { (n.download = r), (n.href = t); }); }), (e.prototype.addPlugin = function (t) { t.destroyed || (this.get("plugins").push(t), t.initPlugin(this)); }), (e.prototype.removePlugin = function (t) { var e = this.get("plugins"), n = e.indexOf(t); n >= 0 && (t.destroyPlugin(), e.splice(n, 1)); }), (e.prototype.isMiniNative = function () { return "mini-native" === this.get("renderer"); }), (e.prototype.isMini = function () { return this.get("renderer").startsWith("mini"); }), (e.prototype.isBrowser = function () { return "canvas" === this.get("renderer"); }), (e.prototype.setImageWaterMarker = function (t, e, n) { var r = this, i = Object(a.deepMix)({}, c.a.imageWaterMarkerConfig, e), o = i.width, s = i.height, u = i.image, h = u.rotate, l = (u.x, u.y, u.width), f = u.height; if ((this.isMini() && this.isMiniNative(), this.isMiniNative())) { (n.width = o || this.get("width")), (n.height = s || this.get("height")); var d = n.getContext("2d"), p = (0, this.get("extra").createImage)(); (p.crossOrigin = "anonymous"), (p.src = t), (p.onload = function () { if (!r.destroyed) { var t = l / p.width, e = f / p.height; d.rotate((-h * Math.PI) / 180); var i = d.createPattern(p, "repeat"); (d.fillStyle = i), d.scale(t, e), d.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ), r .get("waterGroup") .addShape("image", { attrs: { img: n } }); } }); } if (this.isBrowser()) { var g = document.createElement("canvas"); (g.width = o || this.get("width")), (g.height = s || this.get("height")); var v = g.getContext("2d"), y = new Image(); (y.crossOrigin = "anonymous"), (y.src = t), (y.onload = function () { if (!r.destroyed) { var t = l / y.width, e = f / y.height; v.rotate((-h * Math.PI) / 180); var n = v.createPattern(y, "repeat"); (v.fillStyle = n), v.scale(t, e), v.fillRect( 2 * -r.get("width"), -r.get("height"), 10 * r.get("width"), 10 * r.get("height"), ); var i = g.toDataURL(); r.get("waterGroup").addShape("image", { attrs: { img: i }, }); } }); } }), (e.prototype.setTextWaterMarker = function (t, e) { var n = this.get("container"); Object(a.isString)(n) && (n = document.getElementById(n)), n.style.position || (n.style.position = "relative"); var r = this.get("graphWaterMarker"), o = Object(a.deepMix)({}, c.a.textWaterMarkerConfig, e), s = o.width, u = o.height, h = o.compatible, l = o.text; if (!r) { var f = { container: n, width: s, height: u, capture: !1 }, d = this.get("pixelRatio"); d && (f.pixelRatio = d), (r = new i.Canvas(f)), this.set("graphWaterMarker", r); } r.get("el").style.display = "none"; var p = r.get("context"), g = l.rotate, v = l.fill, y = l.fontFamily, m = l.fontSize, b = l.baseline, x = l.x, S = l.y, w = l.lineHeight; p.rotate((-g * Math.PI) / 180), (p.font = m + "px " + y), (p.fillStyle = v), (p.textBaseline = b); for (var O = t.length - 1; O >= 0; O--) p.fillText(t[O], x, S + O * w); if ((p.rotate((g * Math.PI) / 180), h)) n.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;"; else { var M = document.querySelector(".g6-graph-watermarker"); M || ((M = document.createElement("div")).className = "g6-graph-watermarker"), (M.style.cssText = "background-image: url(" + r.get("el").toDataURL("image/png") + ");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"), n.appendChild(M); } }), (e.prototype.destroy = function () { var e; Object(a.each)(this.get("plugins"), function (t) { t.destroyPlugin(); }); var n = this.get("tooltips"); if (n) for (var r = 0; r < n.length; r++) { var i = n[r]; if (i) { var o = i.parentElement; o && o.removeChild(i); } } this.get("eventController").destroy(), null === (e = this.get("layoutController")) || void 0 === e || e.destroy(), this.get("graphWaterMarker") && this.get("graphWaterMarker").destroy(), "undefined" != typeof document && document.querySelector && document.querySelector(".g6-graph-watermarker") && document.querySelector(".g6-graph-watermarker").remove(), t.prototype.destroy.call(this); }), (e.prototype.initGroups = function () { var t = this.get("canvas"), e = t.addGroup({ id: "root", className: c.a.rootContainerClassName, }), n = t.addGroup({ id: "water", className: c.a.waterContainerClassName, }); if (this.get("groupByTypes")) { var r = e.addGroup({ id: "edge", className: c.a.edgeContainerClassName, }), i = e.addGroup({ id: "node", className: c.a.nodeContainerClassName, }), o = e.addGroup({ id: "combo", className: c.a.comboContainerClassName, }); o.toBack(), this.set({ nodeGroup: i, edgeGroup: r, comboGroup: o }); } var a = t.addGroup({ id: "uiGroup", className: c.a.uiContainerClassName, }), s = e.addGroup({ id: "delegate", className: c.a.delegateContainerClassName, }); this.set({ delegateGroup: s }), this.set("group", e), this.set("uiGroup", a), this.set("waterGroup", n); }), e ); })(s.b); e.a = y; }, 97: function (t, e, n) { "use strict"; function r(t) { return (r = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } function i(t) { return (i = "function" == typeof Symbol && "symbol" == r(Symbol.iterator) ? function (t) { return r(t); } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : r(t); })(t); } Object.defineProperty(e, "__esModule", { value: !0 }), (e.clearAnimationFrame = function (t) { return o.clearAnimationFrame ? o.clearAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.cancelAnimationFrame ? window.cancelAnimationFrame : clearTimeout)(t); }), (e.requestAnimationFrame = function (t) { return o.requestAnimationFrame ? o.requestAnimationFrame(t) : ("object" === ("undefined" == typeof window ? "undefined" : i(window)) && window.requestAnimationFrame ? window.requestAnimationFrame : function (t) { return setTimeout(t, 16); })(t); }), (e.setExtraFunction = function (t) { void 0 === t && (t = {}), (t = t); }); var o = {}; }, 98: function (t, e) { function n(t) { return (n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t; } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; })(t); } var r; r = (function () { return this; })(); try { r = r || new Function("return this")(); } catch (t) { "object" === ("undefined" == typeof window ? "undefined" : n(window)) && (r = window); } t.exports = r; }, 99: function (t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), (e.Layouts = e.Layout = void 0); var r = n(62), i = (function () { function t(t) { var e = r.getLayoutByName(t.type); this.layoutInstance = new e(t); } return ( (t.prototype.layout = function (t) { return this.layoutInstance.layout(t); }), (t.prototype.updateCfg = function (t) { this.layoutInstance.updateCfg(t); }), (t.prototype.init = function (t) { this.layoutInstance.init(t); }), (t.prototype.execute = function () { this.layoutInstance.execute(); }), (t.prototype.getDefaultCfg = function () { return this.layoutInstance.getDefaultCfg(); }), (t.prototype.destroy = function () { return this.layoutInstance.destroy(); }), t ); })(); (e.Layout = i), (e.Layouts = new Proxy( {}, { get: function (t, e) { return r.getLayoutByName(e); }, set: function (t, e, n) { return r.registerLayout(e, n), !0; }, }, )); }, }).default; }); //# sourceMappingURL=index.js.map ================================================ FILE: packages/hammer/CONTRIBUTING.md ================================================ # Contributing to Hammer.js Looking to contribute something to Hammer.js? **Here's how you can help.** ## Reporting issues We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that can be fixed within the Hammer.js. Please read the following guidelines before opening any issue. 1. [**Read the documentation**](https://hammerjs.github.io) 2. **Search for existing issues.** We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available. Also take a look if your problem is explained at the Wiki. 3. **Create an isolated and reproducible test case.** Be sure the problem exists in Hammer's code with a reduced test case that should be included in each bug report. 4. **Include a live example.** Make use of jsFiddle or jsBin to share your isolated test cases. Also, a screen capture would work, with tools like LICEcap. 5. **Share as much information as possible.** Include operating system and version, browser and version, version of Hammer.js, customized or vanilla build, etc. where appropriate. Also include steps to reproduce the bug. ## Pull requests 1. Changes must be done in `/src` files, never just the compiled files. Also, don't commit the compiled files. 2. Try not to pollute your pull request with unintended changes. Keep them simple and small 3. Try to share which browsers your code has been tested in before submitting a pull request 4. Write tests for your code, these can be found in `/tests`. ================================================ FILE: packages/hammer/LICENSE.md ================================================ The MIT License (MIT) Copyright (C) 2011-2017 by Jorik Tangelder (Eight Media) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: packages/hammer/package.json ================================================ { "name": "@antv/f6-hammerjs", "title": "Hammer.JS for F6", "description": "A javascript library for multi-touch gestures", "version": "0.0.2", "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "license": "MIT", "keywords": [ "touch", "gestures" ], "author": { "name": "openwayne", "email": "openwayne@gmail.com" }, "repository": { "type": "git", "url": "https://github.com/antvis/f6" }, "bugs": { "url": "https://github.com/antvis/f6/issues" }, "dependencies": { "lodash": "^4.17.20" }, "scripts": { "clean": "rimraf dist", "build": "vite build" }, "devDependencies": { "vite": "~5.3.1" } } ================================================ FILE: packages/hammer/src/hammer.js ================================================ import ifUndefined from "./utils/if-undefined"; import { TOUCH_ACTION_COMPUTE } from "./touchactionjs/touchaction-Consts"; import { DIRECTION_HORIZONTAL } from "./inputjs/input-consts"; import RotateRecognizer from "./recognizers/rotate"; import PinchRecognizer from "./recognizers/pinch"; import SwipeRecognizer from "./recognizers/swipe"; import PanRecognizer from "./recognizers/pan"; import TapRecognizer from "./recognizers/tap"; import PressRecognizer from "./recognizers/press"; import Manager from "./manager"; /** * @private * Simple way to create a manager with a default set of recognizers. * @param {Object} [options] * @constructor */ export default class Hammer { constructor(options) { options = options || {}; options.recognizers = ifUndefined( options.recognizers, Hammer.defaults.preset, ); return new Manager(options); } } /** * @private * default settings * @namespace */ Hammer.defaults = { /** * @private * set if DOM events are being triggered. * But this is slower and unused by simple implementations, so disabled by default. * @type {Boolean} * @default false */ domEvents: false, /** * @private * The value for the touchAction property/fallback. * When set to `compute` it will magically set the correct value based on the added recognizers. * @type {String} * @default compute */ touchAction: TOUCH_ACTION_COMPUTE, /** * @private * @type {Boolean} * @default true */ enable: true, /** * @private * force an input class * @type {Null|Function} * @default null */ inputClass: null, /** * @private * Default recognizer setup when calling `Hammer()` * When creating a new Manager these will be skipped. * @type {Array} */ preset: [ // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...] [RotateRecognizer, { enable: false }], [PinchRecognizer, { enable: false }, ["rotate"]], [SwipeRecognizer, { direction: DIRECTION_HORIZONTAL }], [PanRecognizer, { direction: DIRECTION_HORIZONTAL }, ["swipe"]], [TapRecognizer], [TapRecognizer, { event: "doubletap", taps: 2 }, ["tap"]], [PressRecognizer], ], }; ================================================ FILE: packages/hammer/src/index.js ================================================ import Hammer from "./hammer"; import assign from "./utils/assign"; import { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, } from "./inputjs/input-consts"; import { STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, } from "./recognizerjs/recognizer-consts"; import { DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, } from "./inputjs/input-consts"; import Manager from "./manager"; import Input from "./inputjs/input-constructor"; import TouchAction from "./touchactionjs/touchaction-constructor"; import TouchInput from "./input/touch"; import PointerEventInput from "./input/pointerevent"; import Recognizer from "./recognizerjs/recognizer-constructor"; import AttrRecognizer from "./recognizers/attribute"; import TapRecognizer from "./recognizers/tap"; import PanRecognizer from "./recognizers/pan"; import SwipeRecognizer from "./recognizers/swipe"; import PinchRecognizer from "./recognizers/pinch"; import RotateRecognizer from "./recognizers/rotate"; import PressRecognizer from "./recognizers/press"; import addEventListeners from "./utils/add-event-listeners"; import removeEventListeners from "./utils/remove-event-listeners"; import each from "./utils/each"; import merge from "./utils/merge"; import extend from "./utils/extend"; import inherit from "./utils/inherit"; import bindFn from "./utils/bind-fn"; import toArray from "./utils/to-array"; import uniqueArray from "./utils/unique-array"; import splitStr from "./utils/split-str"; import inArray from "./utils/in-array"; import boolOrFn from "./utils/bool-or-fn"; import hasParent from "./utils/has-parent"; // this prevents errors when Hammer is loaded in the presence of an AMD // style loader but by script tag, not by the loader. export { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, Manager, Input, TouchAction, TouchInput, PointerEventInput, Recognizer, AttrRecognizer, }; export default assign(Hammer, { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, Manager, Input, TouchAction, TouchInput, PointerEventInput, Recognizer, AttrRecognizer, Tap: TapRecognizer, Pan: PanRecognizer, Swipe: SwipeRecognizer, Pinch: PinchRecognizer, Rotate: RotateRecognizer, Press: PressRecognizer, on: addEventListeners, off: removeEventListeners, each, merge, extend, assign, inherit, bindFn, toArray, inArray, uniqueArray, splitStr, boolOrFn, hasParent, addEventListeners, removeEventListeners, }); ================================================ FILE: packages/hammer/src/input/pointerevent.js ================================================ import { INPUT_START, INPUT_END, INPUT_CANCEL, INPUT_MOVE, INPUT_TYPE_TOUCH, INPUT_TYPE_MOUSE, INPUT_TYPE_PEN, INPUT_TYPE_KINECT, } from "../inputjs/input-consts"; import Input from "../inputjs/input-constructor"; import inArray from "../utils/in-array"; const POINTER_INPUT_MAP = { pointerdown: INPUT_START, pointermove: INPUT_MOVE, pointerup: INPUT_END, pointercancel: INPUT_CANCEL, pointerout: INPUT_CANCEL, }; // in IE10 the pointer types is defined as an enum const IE10_POINTER_TYPE_ENUM = { 2: INPUT_TYPE_TOUCH, 3: INPUT_TYPE_PEN, 4: INPUT_TYPE_MOUSE, 5: INPUT_TYPE_KINECT, // see https://twitter.com/jacobrossi/status/480596438489890816 }; let POINTER_ELEMENT_EVENTS = "pointerdown"; let POINTER_WINDOW_EVENTS = "pointermove pointerup pointercancel"; /** * @private * Pointer events input * @constructor * @extends Input */ export default class PointerEventInput extends Input { constructor() { PointerEventInput.prototype.events = `${POINTER_ELEMENT_EVENTS} ${POINTER_WINDOW_EVENTS}`; super(...arguments); this.evEl = POINTER_ELEMENT_EVENTS; this.evWin = POINTER_WINDOW_EVENTS; this.store = this.manager.session.pointerEvents = []; } /** * @private * handle mouse events * @param {Object} ev */ handler(ev) { let { store } = this; let removePointer = false; let eventTypeNormalized = ev.type.toLowerCase().replace("ms", ""); let eventType = POINTER_INPUT_MAP[eventTypeNormalized]; let pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType; let isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store let storeIndex = inArray(store, ev.pointerId, "pointerId"); // start and mouse must be down if (eventType & INPUT_START && (ev.button === 0 || isTouch)) { if (storeIndex < 0) { store.push(ev); storeIndex = store.length - 1; } } else if (eventType & (INPUT_END | INPUT_CANCEL)) { removePointer = true; } // it not found, so the pointer hasn't been down (so it's probably a hover) if (storeIndex < 0) { return; } // update the event in the store store[storeIndex] = ev; this.callback(this.manager, eventType, { pointers: store, changedPointers: [ev], pointerType, srcEvent: ev, }); if (removePointer) { // remove from the store store.splice(storeIndex, 1); } } } ================================================ FILE: packages/hammer/src/input/touch.js ================================================ import { INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, INPUT_TYPE_TOUCH, } from "../inputjs/input-consts"; import Input from "../inputjs/input-constructor"; import toArray from "../utils/to-array"; import hasParent from "../utils/has-parent"; import uniqueArray from "../utils/unique-array"; const TOUCH_INPUT_MAP = { touchstart: INPUT_START, touchmove: INPUT_MOVE, touchend: INPUT_END, touchcancel: INPUT_CANCEL, }; const TOUCH_TARGET_EVENTS = "touchstart touchmove touchend touchcancel"; /** * @private * Multi-user touch events input * @constructor * @extends Input */ export default class TouchInput extends Input { constructor() { TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS; TouchInput.prototype.targetIds = {}; TouchInput.prototype.events = TOUCH_TARGET_EVENTS; super(...arguments); this.evTarget = TOUCH_TARGET_EVENTS; this.targetIds = {}; } handler(ev) { let type = TOUCH_INPUT_MAP[ev.type]; let touches = getTouches.call(this, ev, type); if (!touches) { return; } this.callback(this.manager, type, { pointers: touches[0], changedPointers: touches[1], pointerType: INPUT_TYPE_TOUCH, srcEvent: ev, }); } } /** * @private * @this {TouchInput} * @param {Object} ev * @param {Number} type flag * @returns {undefined|Array} [all, changed] */ function getTouches(ev, type) { let allTouches = toArray(ev.touches); let { targetIds } = this; // when there is only one touch, the process can be simplified if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) { targetIds[allTouches[0].identifier] = true; return [allTouches, allTouches]; } let i; let targetTouches; let changedTouches = toArray(ev.changedTouches); let changedTargetTouches = []; let { target } = this; //// get target touches from touches 小程序下targets是空,不太需要 //targetTouches = allTouches.filter((touch) => { // return hasParent(touch.target, target); //}); targetTouches = allTouches; // collect touches if (type === INPUT_START) { i = 0; while (i < targetTouches.length) { targetIds[targetTouches[i].identifier] = true; i++; } } // filter changed touches to only contain touches that exist in the collected target ids i = 0; while (i < changedTouches.length) { if (targetIds[changedTouches[i].identifier]) { changedTargetTouches.push(changedTouches[i]); } // cleanup removed touches if (type & (INPUT_END | INPUT_CANCEL)) { delete targetIds[changedTouches[i].identifier]; } i++; } if (!changedTargetTouches.length) { return; } return [ // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel' uniqueArray(targetTouches.concat(changedTargetTouches), "identifier", true), changedTargetTouches, ]; } ================================================ FILE: packages/hammer/src/inputjs/compute-delta-xy.js ================================================ import { INPUT_START, INPUT_END } from "./input-consts"; export default function computeDeltaXY(session, input) { let { center } = input; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session; // jscs throwing error on defalut destructured values and without defaults tests fail let offset = session.offsetDelta || {}; let prevDelta = session.prevDelta || {}; let prevInput = session.prevInput || {}; if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) { prevDelta = session.prevDelta = { x: prevInput.deltaX || 0, y: prevInput.deltaY || 0, }; offset = session.offsetDelta = { x: center.x, y: center.y, }; } input.deltaX = prevDelta.x + (center.x - offset.x); input.deltaY = prevDelta.y + (center.y - offset.y); } ================================================ FILE: packages/hammer/src/inputjs/compute-input-data.js ================================================ import { now } from "../utils/utils-consts"; import { abs } from "../utils/utils-consts"; import hasParent from "../utils/has-parent"; import simpleCloneInputData from "./simple-clone-input-data"; import getCenter from "./get-center"; import getDistance from "./get-distance"; import getAngle from "./get-angle"; import getDirection from "./get-direction"; import computeDeltaXY from "./compute-delta-xy"; import getVelocity from "./get-velocity"; import getScale from "./get-scale"; import getRotation from "./get-rotation"; import computeIntervalInputData from "./compute-interval-input-data"; /** * @private * extend the data with some usable properties like scale, rotate, velocity etc * @param {Object} manager * @param {Object} input */ export default function computeInputData(manager, input) { let { session } = manager; let { pointers } = input; let { length: pointersLength } = pointers; // store the first input to calculate the distance and direction if (!session.firstInput) { session.firstInput = simpleCloneInputData(input); } // to compute scale and rotation we need to store the multiple touches if (pointersLength > 1 && !session.firstMultiple) { session.firstMultiple = simpleCloneInputData(input); } else if (pointersLength === 1) { session.firstMultiple = false; } let { firstInput, firstMultiple } = session; let offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center; let center = (input.center = getCenter(pointers)); input.timeStamp = now(); input.deltaTime = input.timeStamp - firstInput.timeStamp; input.angle = getAngle(offsetCenter, center); input.distance = getDistance(offsetCenter, center); computeDeltaXY(session, input); input.offsetDirection = getDirection(input.deltaX, input.deltaY); let overallVelocity = getVelocity( input.deltaTime, input.deltaX, input.deltaY, ); input.overallVelocityX = overallVelocity.x; input.overallVelocityY = overallVelocity.y; input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y; input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1; input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0; input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers; computeIntervalInputData(session, input); } ================================================ FILE: packages/hammer/src/inputjs/compute-interval-input-data.js ================================================ import { INPUT_CANCEL, COMPUTE_INTERVAL } from "./input-consts"; import { abs } from "../utils/utils-consts"; import getVelocity from "./get-velocity"; import getDirection from "./get-direction"; /** * @private * velocity is calculated every x ms * @param {Object} session * @param {Object} input */ export default function computeIntervalInputData(session, input) { let last = session.lastInterval || input; let deltaTime = input.timeStamp - last.timeStamp; let velocity; let velocityX; let velocityY; let direction; if ( input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined) ) { let deltaX = input.deltaX - last.deltaX; let deltaY = input.deltaY - last.deltaY; let v = getVelocity(deltaTime, deltaX, deltaY); velocityX = v.x; velocityY = v.y; velocity = abs(v.x) > abs(v.y) ? v.x : v.y; direction = getDirection(deltaX, deltaY); session.lastInterval = input; } else { // use latest velocity info if it doesn't overtake a minimum period velocity = last.velocity; velocityX = last.velocityX; velocityY = last.velocityY; direction = last.direction; } input.velocity = velocity; input.velocityX = velocityX; input.velocityY = velocityY; input.direction = direction; } ================================================ FILE: packages/hammer/src/inputjs/create-input-instance.js ================================================ import inputHandler from "./input-handler"; import TouchInput from "../input/touch"; /** * @private * create new input type manager * called by the Manager constructor * @param {Hammer} manager * @returns {Input} */ export default function createInputInstance(manager) { let Type = TouchInput; if (manager.options.inputClass) { Type = inputClass; } return new Type(manager, inputHandler); } ================================================ FILE: packages/hammer/src/inputjs/get-angle.js ================================================ import { PROPS_XY } from "./input-consts"; /** * @private * calculate the angle between two coordinates * @param {Object} p1 * @param {Object} p2 * @param {Array} [props] containing x and y keys * @return {Number} angle */ export default function getAngle(p1, p2, props) { if (!props) { props = PROPS_XY; } let x = p2[props[0]] - p1[props[0]]; let y = p2[props[1]] - p1[props[1]]; return (Math.atan2(y, x) * 180) / Math.PI; } ================================================ FILE: packages/hammer/src/inputjs/get-center.js ================================================ import { round } from "../utils/utils-consts"; /** * @private * get the center of all the pointers * @param {Array} pointers * @return {Object} center contains `x` and `y` properties */ export default function getCenter(pointers) { let pointersLength = pointers.length; // no need to loop when only one touch if (pointersLength === 1) { return { x: round(pointers[0].clientX), y: round(pointers[0].clientY), }; } let x = 0; let y = 0; let i = 0; while (i < pointersLength) { x += pointers[i].clientX; y += pointers[i].clientY; i++; } return { x: round(x / pointersLength), y: round(y / pointersLength), }; } ================================================ FILE: packages/hammer/src/inputjs/get-direction.js ================================================ import { abs } from "../utils/utils-consts"; import { DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, } from "./input-consts"; /** * @private * get the direction between two points * @param {Number} x * @param {Number} y * @return {Number} direction */ export default function getDirection(x, y) { if (x === y) { return DIRECTION_NONE; } if (abs(x) >= abs(y)) { return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; } return y < 0 ? DIRECTION_UP : DIRECTION_DOWN; } ================================================ FILE: packages/hammer/src/inputjs/get-distance.js ================================================ import { PROPS_XY } from "./input-consts"; /** * @private * calculate the absolute distance between two points * @param {Object} p1 {x, y} * @param {Object} p2 {x, y} * @param {Array} [props] containing x and y keys * @return {Number} distance */ export default function getDistance(p1, p2, props) { if (!props) { props = PROPS_XY; } let x = p2[props[0]] - p1[props[0]]; let y = p2[props[1]] - p1[props[1]]; return Math.sqrt(x * x + y * y); } ================================================ FILE: packages/hammer/src/inputjs/get-rotation.js ================================================ import getAngle from "./get-angle"; import { PROPS_CLIENT_XY } from "./input-consts"; /** * @private * calculate the rotation degrees between two pointersets * @param {Array} start array of pointers * @param {Array} end array of pointers * @return {Number} rotation */ export default function getRotation(start, end) { return ( getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY) ); } ================================================ FILE: packages/hammer/src/inputjs/get-scale.js ================================================ import { PROPS_CLIENT_XY } from "./input-consts"; import getDistance from "./get-distance"; /** * @private * calculate the scale factor between two pointersets * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out * @param {Array} start array of pointers * @param {Array} end array of pointers * @return {Number} scale */ export default function getScale(start, end) { return ( getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY) ); } ================================================ FILE: packages/hammer/src/inputjs/get-velocity.js ================================================ /** * @private * calculate the velocity between two points. unit is in px per ms. * @param {Number} deltaTime * @param {Number} x * @param {Number} y * @return {Object} velocity `x` and `y` */ export default function getVelocity(deltaTime, x, y) { return { x: x / deltaTime || 0, y: y / deltaTime || 0, }; } ================================================ FILE: packages/hammer/src/inputjs/input-constructor.js ================================================ import boolOrFn from "../utils/bool-or-fn"; import { addManagerListeners } from "../utils/add-event-listeners"; /** * @private * create new input type manager * @param {Manager} manager * @param {Function} callback * @returns {Input} * @constructor */ export default class Input { constructor(manager, callback) { let self = this; this.manager = manager; this.callback = callback; // smaller wrapper around the handler, for the scope and the enabled state of the manager, // so when disabled the input events are completely bypassed. this.eventHandler = function (ev) { if (boolOrFn(manager.options.enable, [manager])) { self.handler(ev); } }; this.init(); } /** * @private * should handle the inputEvent data and trigger the callback * @virtual */ handler() {} /** * @private */ init() { addManagerListeners(this.manager, this.events || "", this.eventHandler); } /** * @private */ destroy() { removeManagerListeners(this.manager, this.events || "", this.eventHandler); } } ================================================ FILE: packages/hammer/src/inputjs/input-consts.js ================================================ const INPUT_TYPE_TOUCH = "touch"; const INPUT_TYPE_PEN = "pen"; const INPUT_TYPE_MOUSE = "mouse"; const INPUT_TYPE_KINECT = "kinect"; const COMPUTE_INTERVAL = 25; const INPUT_START = 1; const INPUT_MOVE = 2; const INPUT_END = 4; const INPUT_CANCEL = 8; const DIRECTION_NONE = 1; const DIRECTION_LEFT = 2; const DIRECTION_RIGHT = 4; const DIRECTION_UP = 8; const DIRECTION_DOWN = 16; const DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT; const DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN; const DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL; const PROPS_XY = ["x", "y"]; const PROPS_CLIENT_XY = ["clientX", "clientY"]; export { INPUT_TYPE_KINECT, INPUT_TYPE_MOUSE, INPUT_TYPE_PEN, INPUT_TYPE_TOUCH, COMPUTE_INTERVAL, INPUT_START, INPUT_MOVE, INPUT_END, INPUT_CANCEL, DIRECTION_NONE, DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_ALL, PROPS_XY, PROPS_CLIENT_XY, }; ================================================ FILE: packages/hammer/src/inputjs/input-handler.js ================================================ import { INPUT_START, INPUT_END, INPUT_CANCEL } from "./input-consts"; import computeInputData from "./compute-input-data"; /** * @private * handle input events * @param {Manager} manager * @param {String} eventType * @param {Object} input */ export default function inputHandler(manager, eventType, input) { let pointersLen = input.pointers.length; let changedPointersLen = input.changedPointers.length; let isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0; let isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0; input.isFirst = !!isFirst; input.isFinal = !!isFinal; if (isFirst) { manager.session = {}; } // source event is the normalized value of the domEvents // like 'touchstart, mouseup, pointerdown' input.eventType = eventType; // compute scale, rotation etc computeInputData(manager, input); // emit secret event manager.emit("hammer.input", input); manager.recognize(input); manager.session.prevInput = input; } ================================================ FILE: packages/hammer/src/inputjs/simple-clone-input-data.js ================================================ import { now, round } from "../utils/utils-consts"; import getCenter from "./get-center"; /** * @private * create a simple clone from the input used for storage of firstInput and firstMultiple * @param {Object} input * @returns {Object} clonedInputData */ export default function simpleCloneInputData(input) { // make a simple copy of the pointers because we will get a reference if we don't // we only need clientXY for the calculations let pointers = []; let i = 0; while (i < input.pointers.length) { pointers[i] = { clientX: round(input.pointers[i].clientX), clientY: round(input.pointers[i].clientY), }; i++; } return { timeStamp: now(), pointers, center: getCenter(pointers), deltaX: input.deltaX, deltaY: input.deltaY, }; } ================================================ FILE: packages/hammer/src/manager.js ================================================ import assign from "./utils/assign"; import Hammer from "./hammer"; import TouchAction from "./touchactionjs/touchaction-constructor"; import createInputInstance from "./inputjs/create-input-instance"; import each from "./utils/each"; import inArray from "./utils/in-array"; import invokeArrayArg from "./utils/invoke-array-arg"; import splitStr from "./utils/split-str"; import Recognizer from "./recognizerjs/recognizer-constructor"; import { STATE_BEGAN, STATE_ENDED, STATE_CHANGED, STATE_RECOGNIZED, } from "./recognizerjs/recognizer-consts"; const STOP = 1; const FORCED_STOP = 2; /** * @private * Manager * @param {Object} [options] * @constructor */ export default class Manager { constructor(options) { this.options = assign({}, Hammer.defaults, options || {}); this.handlers = {}; this.filters = []; this.session = {}; this.recognizers = []; this.input = createInputInstance(this); this.touchAction = new TouchAction(this, this.options.touchAction); each( this.options.recognizers, (item) => { let recognizer = this.add(new item[0](item[1])); item[2] && recognizer.recognizeWith(item[2]); item[3] && recognizer.requireFailure(item[3]); }, this, ); } /** * @private * set options * @param {Object} options * @returns {Manager} */ set(options) { assign(this.options, options); // Options that need a little more setup if (options.touchAction) { this.touchAction.update(); } return this; } /** * @private * stop recognizing for this session. * This session will be discarded, when a new [input]start event is fired. * When forced, the recognizer cycle is stopped immediately. * @param {Boolean} [force] */ stop(force) { this.session.stopped = force ? FORCED_STOP : STOP; } /** * @private * add event filters */ addFilter(filter) { if (typeof filter !== "function") { throw new Error("filter must be a function"); } this.filters.push(filter); } /** * @private * run the recognizers! * called by the inputHandler function on every movement of the pointers (touches) * it walks through all the recognizers and tries to detect the gesture that is being made * @param {Object} inputData */ recognize(inputData) { let { session } = this; if (session.stopped) { return; } // run the touch-action polyfill this.touchAction.preventDefaults(inputData); let recognizer; let { recognizers } = this; // this holds the recognizer that is being recognized. // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED // if no recognizer is detecting a thing, it is set to `null` let { curRecognizer } = session; // reset when the last recognizer is recognized // or when we're in a new session if ( !curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED) ) { curRecognizer = session.curRecognizer = null; } let i = 0; while (i < recognizers.length) { recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one. // 1. allow if the session is NOT forced stopped (see the .stop() method) // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one // that is being recognized. // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer. // this can be setup with the `recognizeWith()` method on the recognizer. if ( session.stopped !== FORCED_STOP && // 1 (!curRecognizer || recognizer === curRecognizer || // 2 recognizer.canRecognizeWith(curRecognizer)) ) { // 3 recognizer.recognize(inputData); } else { recognizer.reset(); } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the // current active recognizer. but only if we don't already have an active recognizer if ( !curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED) ) { curRecognizer = session.curRecognizer = recognizer; } i++; } } /** * @private * get a recognizer by its event name. * @param {Recognizer|String} recognizer * @returns {Recognizer|Null} */ get(recognizer) { if (recognizer instanceof Recognizer) { return recognizer; } let { recognizers } = this; for (let i = 0; i < recognizers.length; i++) { if (recognizers[i].options.event === recognizer) { return recognizers[i]; } } return null; } /** * @private add a recognizer to the manager * existing recognizers with the same event name will be removed * @param {Recognizer} recognizer * @returns {Recognizer|Manager} */ add(recognizer) { if (invokeArrayArg(recognizer, "add", this)) { return this; } // remove existing let existing = this.get(recognizer.options.event); if (existing) { this.remove(existing); } this.recognizers.push(recognizer); recognizer.manager = this; this.touchAction.update(); return recognizer; } /** * @private * remove a recognizer by name or instance * @param {Recognizer|String} recognizer * @returns {Manager} */ remove(recognizer) { if (invokeArrayArg(recognizer, "remove", this)) { return this; } recognizer = this.get(recognizer); // let's make sure this recognizer exists if (recognizer) { let { recognizers } = this; let index = inArray(recognizers, recognizer); if (index !== -1) { recognizers.splice(index, 1); this.touchAction.update(); } } return this; } /** * @private * bind event * @param {String} events * @param {Function} handler * @returns {EventEmitter} this */ on(events, handler) { if (events === undefined) { return; } if (handler === undefined) { return; } let { handlers } = this; each(splitStr(events), (event) => { handlers[event] = handlers[event] || []; handlers[event].push(handler); }); return this; } /** * @private unbind event, leave emit blank to remove all handlers * @param {String} events * @param {Function} [handler] * @returns {EventEmitter} this */ off(events, handler) { if (events === undefined) { return; } let { handlers } = this; each(splitStr(events), (event) => { if (!handler) { delete handlers[event]; } else { handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1); } }); return this; } /** * @private emit event to the listeners * @param {String} event * @param {Object} data */ emit(event, data) { // no handlers, so skip it all let handlers = this.handlers[event] && this.handlers[event].slice(); const { filters } = this; if (!handlers || !handlers.length) { return; } //let i = 0; //let newData = Object.assign(data); //data.type = event; //data.preventDefault = function() { // data.srcEvent.preventDefault(); //}; //while (i < filters.length) { // newData = filters[i](newData); // i++; //} // if (!event.startsWith("origin_input")) { data.type = event; data.preventDefault = function () { data.srcEvent.preventDefault && data.srcEvent.preventDefault(); }; } let i = 0; while (i < handlers.length) { handlers[i](data); i++; } } /** * @private * destroy the manager and unbinds all events * it doesn't unbind dom events, that is the user own responsibility */ destroy() { this.handlers = {}; this.filters = []; this.session = {}; this.input.destroy(); } } ================================================ FILE: packages/hammer/src/recognizerjs/direction-str.js ================================================ import { DIRECTION_LEFT, DIRECTION_RIGHT, DIRECTION_UP, DIRECTION_DOWN, } from "../inputjs/input-consts"; /** * @private * direction cons to string * @param {constant} direction * @returns {String} */ export default function directionStr(direction) { if (direction === DIRECTION_DOWN) { return "down"; } else if (direction === DIRECTION_UP) { return "up"; } else if (direction === DIRECTION_LEFT) { return "left"; } else if (direction === DIRECTION_RIGHT) { return "right"; } return ""; } ================================================ FILE: packages/hammer/src/recognizerjs/get-recognizer-by-name-if-manager.js ================================================ /** * @private * get a recognizer by name if it is bound to a manager * @param {Recognizer|String} otherRecognizer * @param {Recognizer} recognizer * @returns {Recognizer} */ export default function getRecognizerByNameIfManager( otherRecognizer, recognizer, ) { let { manager } = recognizer; if (manager) { return manager.get(otherRecognizer); } return otherRecognizer; } ================================================ FILE: packages/hammer/src/recognizerjs/recognizer-constructor.js ================================================ import { STATE_POSSIBLE, STATE_ENDED, STATE_FAILED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_BEGAN, STATE_CHANGED, } from "./recognizer-consts"; import assign from "../utils/assign"; import uniqueId from "../utils/unique-id"; import ifUndefined from "../utils/if-undefined"; import invokeArrayArg from "../utils/invoke-array-arg"; import inArray from "../utils/in-array"; import boolOrFn from "../utils/bool-or-fn"; import getRecognizerByNameIfManager from "./get-recognizer-by-name-if-manager"; import stateStr from "./state-str"; /** * @private * Recognizer flow explained; * * All recognizers have the initial state of POSSIBLE when a input session starts. * The definition of a input session is from the first input until the last input, with all it's movement in it. * * Example session for mouse-input: mousedown -> mousemove -> mouseup * * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed * which determines with state it should be. * * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to * POSSIBLE to give it another change on the next cycle. * * Possible * | * +-----+---------------+ * | | * +-----+-----+ | * | | | * Failed Cancelled | * +-------+------+ * | | * Recognized Began * | * Changed * | * Ended/Recognized */ /** * @private * Recognizer * Every recognizer needs to extend from this class. * @constructor * @param {Object} options */ export default class Recognizer { constructor(options) { this.options = assign({}, this.defaults, options || {}); this.id = uniqueId(); this.manager = null; // default is enable true this.options.enable = ifUndefined(this.options.enable, true); this.state = STATE_POSSIBLE; this.simultaneous = {}; this.requireFail = []; } /** * @private * set options * @param {Object} options * @return {Recognizer} */ set(options) { assign(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state this.manager && this.manager.touchAction.update(); return this; } /** * @private * recognize simultaneous with an other recognizer. * @param {Recognizer} otherRecognizer * @returns {Recognizer} this */ recognizeWith(otherRecognizer) { if (invokeArrayArg(otherRecognizer, "recognizeWith", this)) { return this; } let { simultaneous } = this; otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); if (!simultaneous[otherRecognizer.id]) { simultaneous[otherRecognizer.id] = otherRecognizer; otherRecognizer.recognizeWith(this); } return this; } /** * @private * drop the simultaneous link. it doesnt remove the link on the other recognizer. * @param {Recognizer} otherRecognizer * @returns {Recognizer} this */ dropRecognizeWith(otherRecognizer) { if (invokeArrayArg(otherRecognizer, "dropRecognizeWith", this)) { return this; } otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); delete this.simultaneous[otherRecognizer.id]; return this; } /** * @private * recognizer can only run when an other is failing * @param {Recognizer} otherRecognizer * @returns {Recognizer} this */ requireFailure(otherRecognizer) { if (invokeArrayArg(otherRecognizer, "requireFailure", this)) { return this; } let { requireFail } = this; otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); if (inArray(requireFail, otherRecognizer) === -1) { requireFail.push(otherRecognizer); otherRecognizer.requireFailure(this); } return this; } /** * @private * drop the requireFailure link. it does not remove the link on the other recognizer. * @param {Recognizer} otherRecognizer * @returns {Recognizer} this */ dropRequireFailure(otherRecognizer) { if (invokeArrayArg(otherRecognizer, "dropRequireFailure", this)) { return this; } otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this); let index = inArray(this.requireFail, otherRecognizer); if (index > -1) { this.requireFail.splice(index, 1); } return this; } /** * @private * has require failures boolean * @returns {boolean} */ hasRequireFailures() { return this.requireFail.length > 0; } /** * @private * if the recognizer can recognize simultaneous with an other recognizer * @param {Recognizer} otherRecognizer * @returns {Boolean} */ canRecognizeWith(otherRecognizer) { return !!this.simultaneous[otherRecognizer.id]; } /** * @private * You should use `tryEmit` instead of `emit` directly to check * that all the needed recognizers has failed before emitting. * @param {Object} input */ emit(input) { let self = this; let { state } = this; function emit(event) { self.manager.emit(event, input); } // 'panstart' and 'panmove' if (state < STATE_ENDED) { emit(self.options.event + stateStr(state)); } emit(self.options.event); // simple 'eventName' events if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...) emit(input.additionalEvent); } // panend and pancancel if (state >= STATE_ENDED) { emit(self.options.event + stateStr(state)); } } /** * @private * Check that all the require failure recognizers has failed, * if true, it emits a gesture event, * otherwise, setup the state to FAILED. * @param {Object} input */ tryEmit(input) { if (this.canEmit()) { return this.emit(input); } // it's failing anyway this.state = STATE_FAILED; } /** * @private * can we emit? * @returns {boolean} */ canEmit() { let i = 0; while (i < this.requireFail.length) { if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) { return false; } i++; } return true; } /** * @private * update the recognizer * @param {Object} inputData */ recognize(inputData) { // make a new copy of the inputData // so we can change the inputData without messing up the other recognizers let inputDataClone = assign({}, inputData); // is is enabled and allow recognizing? if (!boolOrFn(this.options.enable, [this, inputDataClone])) { this.reset(); this.state = STATE_FAILED; return; } // reset when we've reached the end if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) { this.state = STATE_POSSIBLE; } this.state = this.process(inputDataClone); // the recognizer has recognized a gesture // so trigger an event if ( this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED) ) { this.tryEmit(inputDataClone); } } /** * @private * return the state of the recognizer * the actual recognizing happens in this method * @virtual * @param {Object} inputData * @returns {constant} STATE */ /* jshint ignore:start */ process(inputData) {} /* jshint ignore:end */ /** * @private * return the preferred touch-action * @virtual * @returns {Array} */ getTouchAction() {} /** * @private * called when the gesture isn't allowed to recognize * like when another is being recognized or it is disabled * @virtual */ reset() {} } Recognizer.prototype.defaults = {}; ================================================ FILE: packages/hammer/src/recognizerjs/recognizer-consts.js ================================================ const STATE_POSSIBLE = 1; const STATE_BEGAN = 2; const STATE_CHANGED = 4; const STATE_ENDED = 8; const STATE_RECOGNIZED = STATE_ENDED; const STATE_CANCELLED = 16; const STATE_FAILED = 32; export { STATE_POSSIBLE, STATE_BEGAN, STATE_CHANGED, STATE_ENDED, STATE_RECOGNIZED, STATE_CANCELLED, STATE_FAILED, }; ================================================ FILE: packages/hammer/src/recognizerjs/state-str.js ================================================ import { STATE_CANCELLED, STATE_ENDED, STATE_CHANGED, STATE_BEGAN, } from "./recognizer-consts"; /** * @private * get a usable string, used as event postfix * @param {constant} state * @returns {String} state */ export default function stateStr(state) { if (state & STATE_CANCELLED) { return "cancel"; } else if (state & STATE_ENDED) { return "end"; } else if (state & STATE_CHANGED) { return "move"; } else if (state & STATE_BEGAN) { return "start"; } return ""; } ================================================ FILE: packages/hammer/src/recognizers/attribute.js ================================================ import Recognizer from "../recognizerjs/recognizer-constructor"; import { STATE_BEGAN, STATE_CHANGED, STATE_CANCELLED, STATE_ENDED, STATE_FAILED, } from "../recognizerjs/recognizer-consts"; import { INPUT_CANCEL, INPUT_END } from "../inputjs/input-consts"; /** * @private * This recognizer is just used as a base for the simple attribute recognizers. * @constructor * @extends Recognizer */ export default class AttrRecognizer extends Recognizer { constructor() { super(...arguments); } /** * @private * Used to check if it the recognizer receives valid input, like input.distance > 10. * @memberof AttrRecognizer * @param {Object} input * @returns {Boolean} recognized */ attrTest(input) { let optionPointers = this.options.pointers; return optionPointers === 0 || input.pointers.length === optionPointers; } /** * @private * Process the input and return the state for the recognizer * @memberof AttrRecognizer * @param {Object} input * @returns {*} State */ process(input) { let { state } = this; let { eventType } = input; let isRecognized = state & (STATE_BEGAN | STATE_CHANGED); let isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) { return state | STATE_CANCELLED; } else if (isRecognized || isValid) { if (eventType & INPUT_END) { return state | STATE_ENDED; } else if (!(state & STATE_BEGAN)) { return STATE_BEGAN; } return state | STATE_CHANGED; } return STATE_FAILED; } } AttrRecognizer.prototype.defaults = { /** * @private * @type {Number} * @default 1 */ pointers: 1, }; ================================================ FILE: packages/hammer/src/recognizers/pan.js ================================================ import AttrRecognizer from "./attribute"; import { DIRECTION_ALL, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, DIRECTION_NONE, DIRECTION_UP, DIRECTION_DOWN, DIRECTION_LEFT, DIRECTION_RIGHT, } from "../inputjs/input-consts"; import { STATE_BEGAN } from "../recognizerjs/recognizer-consts"; import { TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, } from "../touchactionjs/touchaction-Consts"; import directionStr from "../recognizerjs/direction-str"; /** * @private * Pan * Recognized when the pointer is down and moved in the allowed direction. * @constructor * @extends AttrRecognizer */ export default class PanRecognizer extends AttrRecognizer { constructor() { super(...arguments); this.pX = null; this.pY = null; } getTouchAction() { let { options: { direction }, } = this; let actions = []; if (direction & DIRECTION_HORIZONTAL) { actions.push(TOUCH_ACTION_PAN_Y); } if (direction & DIRECTION_VERTICAL) { actions.push(TOUCH_ACTION_PAN_X); } return actions; } directionTest(input) { let { options } = this; let hasMoved = true; let { distance } = input; let { direction } = input; let x = input.deltaX; let y = input.deltaY; // lock to axis? if (!(direction & options.direction)) { if (options.direction & DIRECTION_HORIZONTAL) { direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT; hasMoved = x !== this.pX; distance = Math.abs(input.deltaX); } else { direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN; hasMoved = y !== this.pY; distance = Math.abs(input.deltaY); } } input.direction = direction; return ( hasMoved && distance > options.threshold && direction & options.direction ); } attrTest(input) { return ( AttrRecognizer.prototype.attrTest.call(this, input) && // replace with a super call (this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input))) ); } emit(input) { this.pX = input.deltaX; this.pY = input.deltaY; let direction = directionStr(input.direction); if (direction) { input.additionalEvent = this.options.event + direction; } super.emit(input); } } PanRecognizer.prototype.defaults = { event: "pan", threshold: 10, pointers: 1, direction: DIRECTION_ALL, }; ================================================ FILE: packages/hammer/src/recognizers/pinch.js ================================================ import AttrRecognizer from "./attribute"; import { TOUCH_ACTION_NONE } from "../touchactionjs/touchaction-Consts"; import { STATE_BEGAN } from "../recognizerjs/recognizer-consts"; /** * @private * Pinch * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out). * @constructor * @extends AttrRecognizer */ export default class PinchRecognizer extends AttrRecognizer { constructor() { super(...arguments); } getTouchAction() { return [TOUCH_ACTION_NONE]; } attrTest(input) { return ( super.attrTest(input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN) ); } emit(input) { if (input.scale !== 1) { let inOut = input.scale < 1 ? "in" : "out"; input.additionalEvent = this.options.event + inOut; } super.emit(input); } } PinchRecognizer.prototype.defaults = { event: "pinch", threshold: 0, pointers: 2, }; ================================================ FILE: packages/hammer/src/recognizers/press.js ================================================ import Recognizer from "../recognizerjs/recognizer-constructor"; import { STATE_RECOGNIZED, STATE_FAILED, } from "../recognizerjs/recognizer-consts"; import { now } from "../utils/utils-consts"; import setTimeoutContext from "../utils/set-timeout-context"; import { TOUCH_ACTION_AUTO } from "../touchactionjs/touchaction-Consts"; import { INPUT_START, INPUT_END, INPUT_CANCEL } from "../inputjs/input-consts"; /** * @private * Press * Recognized when the pointer is down for x ms without any movement. * @constructor * @extends Recognizer */ export default class PressRecognizer extends Recognizer { constructor() { super(...arguments); this._timer = null; this._input = null; } getTouchAction() { return [TOUCH_ACTION_AUTO]; } process(input) { let { options } = this; let validPointers = input.pointers.length === options.pointers; let validMovement = input.distance < options.threshold; let validTime = input.deltaTime > options.time; this._input = input; // we only allow little movement // and we've reached an end event, so a tap is possible if ( !validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) ) { this.reset(); } else if (input.eventType & INPUT_START) { this.reset(); this._timer = setTimeoutContext( () => { this.state = STATE_RECOGNIZED; this.tryEmit(); }, options.time, this, ); } else if (input.eventType & INPUT_END) { return STATE_RECOGNIZED; } return STATE_FAILED; } reset() { clearTimeout(this._timer); this._timer = null; } emit(input) { if (this.state !== STATE_RECOGNIZED) { return; } if (input && input.eventType & INPUT_END) { this.manager.emit(`${this.options.event}up`, input); } else { this._input.timeStamp = now(); this.manager.emit(this.options.event, this._input); } } } PressRecognizer.prototype.defaults = { event: "press", pointers: 1, time: 251, // minimal time of the pointer to be pressed threshold: 9, // a minimal movement is ok, but keep it low }; ================================================ FILE: packages/hammer/src/recognizers/rotate.js ================================================ import AttrRecognizer from "./attribute"; import { TOUCH_ACTION_NONE } from "../touchactionjs/touchaction-Consts"; import { STATE_BEGAN } from "../recognizerjs/recognizer-consts"; /** * @private * Rotate * Recognized when two or more pointer are moving in a circular motion. * @constructor * @extends AttrRecognizer */ export default class RotateRecognizer extends AttrRecognizer { constructor() { super(...arguments); } getTouchAction() { return [TOUCH_ACTION_NONE]; } attrTest(input) { return ( super.attrTest(input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN) ); } } RotateRecognizer.prototype.defaults = { event: "rotate", threshold: 0, pointers: 2, }; ================================================ FILE: packages/hammer/src/recognizers/swipe.js ================================================ import AttrRecognizer from "../recognizers/attribute"; import { abs } from "../utils/utils-consts"; import { DIRECTION_HORIZONTAL, DIRECTION_VERTICAL, } from "../inputjs/input-consts"; import PanRecognizer from "./pan"; import { INPUT_END } from "../inputjs/input-consts"; import directionStr from "../recognizerjs/direction-str"; /** * @private * Swipe * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction. * @constructor * @extends AttrRecognizer */ export default class SwipeRecognizer extends AttrRecognizer { constructor() { super(...arguments); } getTouchAction() { return PanRecognizer.prototype.getTouchAction.call(this); } attrTest(input) { let { direction } = this.options; let velocity; if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) { velocity = input.overallVelocity; } else if (direction & DIRECTION_HORIZONTAL) { velocity = input.overallVelocityX; } else if (direction & DIRECTION_VERTICAL) { velocity = input.overallVelocityY; } return ( super.attrTest(input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END ); } emit(input) { let direction = directionStr(input.offsetDirection); if (direction) { this.manager.emit(this.options.event + direction, input); } this.manager.emit(this.options.event, input); } } SwipeRecognizer.prototype.defaults = { event: "swipe", threshold: 10, velocity: 0.3, direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL, pointers: 1, }; ================================================ FILE: packages/hammer/src/recognizers/tap.js ================================================ import setTimeoutContext from "../utils/set-timeout-context"; import Recognizer from "../recognizerjs/recognizer-constructor"; import { TOUCH_ACTION_MANIPULATION } from "../touchactionjs/touchaction-Consts"; import { INPUT_START, INPUT_END } from "../inputjs/input-consts"; import { STATE_RECOGNIZED, STATE_BEGAN, STATE_FAILED, } from "../recognizerjs/recognizer-consts"; import getDistance from "../inputjs/get-distance"; /** * @private * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur * between the given interval and position. The delay option can be used to recognize multi-taps without firing * a single tap. * * The eventData from the emitted event contains the property `tapCount`, which contains the amount of * multi-taps being recognized. * @constructor * @extends Recognizer */ export default class TapRecognizer extends Recognizer { constructor() { super(...arguments); // previous time and center, // used for tap counting this.pTime = false; this.pCenter = false; this._timer = null; this._input = null; this.count = 0; } getTouchAction() { return [TOUCH_ACTION_MANIPULATION]; } process(input) { let { options } = this; let validPointers = input.pointers.length === options.pointers; let validMovement = input.distance < options.threshold; let validTouchTime = input.deltaTime < options.time; this.reset(); if (input.eventType & INPUT_START && this.count === 0) { return this.failTimeout(); } // we only allow little movement // and we've reached an end event, so a tap is possible if (validMovement && validTouchTime && validPointers) { if (input.eventType !== INPUT_END) { return this.failTimeout(); } let validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true; let validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold; this.pTime = input.timeStamp; this.pCenter = input.center; if (!validMultiTap || !validInterval) { this.count = 1; } else { this.count += 1; } this._input = input; // if tap count matches we have recognized it, // else it has began recognizing... let tapCount = this.count % options.taps; if (tapCount === 0) { // no failing requirements, immediately trigger the tap event // or wait as long as the multitap interval to trigger if (!this.hasRequireFailures()) { return STATE_RECOGNIZED; } else { this._timer = setTimeoutContext( () => { this.state = STATE_RECOGNIZED; this.tryEmit(); }, options.interval, this, ); return STATE_BEGAN; } } } return STATE_FAILED; } failTimeout() { this._timer = setTimeoutContext( () => { this.state = STATE_FAILED; }, this.options.interval, this, ); return STATE_FAILED; } reset() { clearTimeout(this._timer); this._timer = null; } emit() { if (this.state === STATE_RECOGNIZED) { this._input.tapCount = this.count; this.manager.emit(this.options.event, this._input); } } } TapRecognizer.prototype.defaults = { event: "tap", pointers: 1, taps: 1, interval: 300, // max time between the multi-tap taps time: 250, // max time of the pointer to be down (like finger on the screen) threshold: 9, // a minimal movement is ok, but keep it low posThreshold: 10, // a multi-tap can be a bit off the initial position }; ================================================ FILE: packages/hammer/src/touchactionjs/clean-touch-actions.js ================================================ import inStr from "../utils/in-str"; import { TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, TOUCH_ACTION_MANIPULATION, TOUCH_ACTION_AUTO, } from "./touchaction-Consts"; /** * @private * when the touchActions are collected they are not a valid value, so we need to clean things up. * * @param {String} actions * @returns {*} */ export default function cleanTouchActions(actions) { // none if (inStr(actions, TOUCH_ACTION_NONE)) { return TOUCH_ACTION_NONE; } let hasPanX = inStr(actions, TOUCH_ACTION_PAN_X); let hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers // for different directions, e.g. horizontal pan but vertical swipe?) // we need none (as otherwise with pan-x pan-y combined none of these // recognizers will work, since the browser would handle all panning if (hasPanX && hasPanY) { return TOUCH_ACTION_NONE; } // pan-x OR pan-y if (hasPanX || hasPanY) { return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y; } // manipulation if (inStr(actions, TOUCH_ACTION_MANIPULATION)) { return TOUCH_ACTION_MANIPULATION; } return TOUCH_ACTION_AUTO; } ================================================ FILE: packages/hammer/src/touchactionjs/get-touchaction-props.js ================================================ export default function getTouchActionProps() { let touchMap = {}; ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach( (val) => { // If css.supports is not supported but there is native touch-action assume it supports // all values. This is the case for IE 10 and 11. return (touchMap[val] = true); }, ); return touchMap; } ================================================ FILE: packages/hammer/src/touchactionjs/touchaction-Consts.js ================================================ import getTouchActionProps from "./get-touchaction-props"; // magical touchAction value const TOUCH_ACTION_COMPUTE = "compute"; const TOUCH_ACTION_AUTO = "auto"; const TOUCH_ACTION_MANIPULATION = "manipulation"; // not implemented const TOUCH_ACTION_NONE = "none"; const TOUCH_ACTION_PAN_X = "pan-x"; const TOUCH_ACTION_PAN_Y = "pan-y"; const TOUCH_ACTION_MAP = getTouchActionProps(); export { TOUCH_ACTION_AUTO, TOUCH_ACTION_COMPUTE, TOUCH_ACTION_MANIPULATION, TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, TOUCH_ACTION_MAP, }; ================================================ FILE: packages/hammer/src/touchactionjs/touchaction-constructor.js ================================================ import { TOUCH_ACTION_COMPUTE, TOUCH_ACTION_MAP, TOUCH_ACTION_NONE, TOUCH_ACTION_PAN_X, TOUCH_ACTION_PAN_Y, } from "./touchaction-Consts"; import { DIRECTION_VERTICAL, DIRECTION_HORIZONTAL, } from "../inputjs/input-consts"; import each from "../utils/each"; import boolOrFn from "../utils/bool-or-fn"; import inStr from "../utils/in-str"; import cleanTouchActions from "./clean-touch-actions"; /** * @private * Touch Action * sets the touchAction property or uses the js alternative * @param {Manager} manager * @param {String} value * @constructor */ export default class TouchAction { constructor(manager, value) { this.manager = manager; this.set(value); } /** * @private * set the touchAction value on the element or enable the polyfill * @param {String} value */ set(value) { // find out the touch-action by the event handlers if (value === TOUCH_ACTION_COMPUTE) { value = this.compute(); } this.actions = value.toLowerCase().trim(); } /** * @private * just re-set the touchAction value */ update() { this.set(this.manager.options.touchAction); } /** * @private * compute the value for the touchAction property based on the recognizer's settings * @returns {String} value */ compute() { let actions = []; each(this.manager.recognizers, (recognizer) => { if (boolOrFn(recognizer.options.enable, [recognizer])) { actions = actions.concat(recognizer.getTouchAction()); } }); return cleanTouchActions(actions.join(" ")); } /** * @private * this method is called on each input cycle and provides the preventing of the browser behavior * @param {Object} input */ preventDefaults(input) { let { srcEvent } = input; let direction = input.offsetDirection; // if the touch action did prevented once this session if (this.manager.session.prevented) { srcEvent.preventDefault(); return; } let { actions } = this; let hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE]; let hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y]; let hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X]; if (hasNone) { // do not prevent defaults if this is a tap gesture let isTapPointer = input.pointers.length === 1; let isTapMovement = input.distance < 2; let isTapTouchTime = input.deltaTime < 250; if (isTapPointer && isTapMovement && isTapTouchTime) { return; } } if (hasPanX && hasPanY) { // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent return; } if ( hasNone || (hasPanY && direction & DIRECTION_HORIZONTAL) || (hasPanX && direction & DIRECTION_VERTICAL) ) { return this.preventSrc(srcEvent); } } /** * @private * call preventDefault to prevent the browser's default behavior (scrolling in most cases) * @param {Object} srcEvent */ preventSrc(srcEvent) { this.manager.session.prevented = true; srcEvent.preventDefault(); } } ================================================ FILE: packages/hammer/src/utils/add-event-listeners.js ================================================ import each from "./each"; import splitStr from "./split-str"; /** * @private * addEventListener with multiple events at once * @param {EventTarget} target * @param {String} types * @param {Function} handler */ export default function addEventListeners(target, types, handler) { each(splitStr(types), (type) => { target.addEventListener(type, handler, false); }); } export function addManagerListeners(manager, types, handler) { each(splitStr(types), (type) => { manager.on(`origin_input:${type}`, handler); }); } ================================================ FILE: packages/hammer/src/utils/assign.js ================================================ /** * @private * extend object. * means that properties in dest will be overwritten by the ones in src. * @param {Object} target * @param {...Object} objects_to_assign * @returns {Object} target */ let assign; if (typeof Object.assign !== "function") { assign = function assign(target) { if (target === undefined || target === null) { throw new TypeError("Cannot convert undefined or null to object"); } let output = Object(target); for (let index = 1; index < arguments.length; index++) { const source = arguments[index]; if (source !== undefined && source !== null) { for (const nextKey in source) { if (source.hasOwnProperty(nextKey)) { output[nextKey] = source[nextKey]; } } } } return output; }; } else { assign = Object.assign; } export default assign; ================================================ FILE: packages/hammer/src/utils/bind-fn.js ================================================ /** * @private * simple function bind * @param {Function} fn * @param {Object} context * @returns {Function} */ export default function bindFn(fn, context) { return function boundFn() { return fn.apply(context, arguments); }; } ================================================ FILE: packages/hammer/src/utils/bool-or-fn.js ================================================ import { TYPE_FUNCTION } from "./utils-consts"; /** * @private * let a boolean value also be a function that must return a boolean * this first item in args will be used as the context * @param {Boolean|Function} val * @param {Array} [args] * @returns {Boolean} */ export default function boolOrFn(val, args) { if (typeof val === TYPE_FUNCTION) { return val.apply(args ? args[0] || undefined : undefined, args); } return val; } ================================================ FILE: packages/hammer/src/utils/deprecate.js ================================================ /** * @private * wrap a method with a deprecation warning and stack trace * @param {Function} method * @param {String} name * @param {String} message * @returns {Function} A new function wrapping the supplied method. */ export default function deprecate(method, name, message) { let deprecationMessage = `DEPRECATED METHOD: ${name}\n${message} AT \n`; return function () { let e = new Error("get-stack-trace"); let stack = e && e.stack ? e.stack .replace(/^[^\(]+?[\n$]/gm, "") .replace(/^\s+at\s+/gm, "") .replace(/^Object.\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace"; let log = console.warn; if (log) { log(deprecationMessage, stack); } return method.apply(this, arguments); }; } ================================================ FILE: packages/hammer/src/utils/each.js ================================================ /** * @private * walk objects and arrays * @param {Object} obj * @param {Function} iterator * @param {Object} context */ export default function each(obj, iterator, context) { let i; if (!obj) { return; } if (obj.forEach) { obj.forEach(iterator, context); } else if (obj.length !== undefined) { i = 0; while (i < obj.length) { iterator.call(context, obj[i], i, obj); i++; } } else { for (i in obj) { obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj); } } } ================================================ FILE: packages/hammer/src/utils/extend.js ================================================ import deprecate from "./deprecate"; /** * @private * extend object. * means that properties in dest will be overwritten by the ones in src. * @param {Object} dest * @param {Object} src * @param {Boolean} [merge=false] * @returns {Object} dest */ const extend = deprecate( (dest, src, merge) => { let keys = Object.keys(src); let i = 0; while (i < keys.length) { if (!merge || (merge && dest[keys[i]] === undefined)) { dest[keys[i]] = src[keys[i]]; } i++; } return dest; }, "extend", "Use `assign`.", ); export default extend; ================================================ FILE: packages/hammer/src/utils/has-parent.js ================================================ /** * @private * find if a node is in the given parent * @method hasParent * @param {HTMLElement} node * @param {HTMLElement} parent * @return {Boolean} found */ export default function hasParent(node, parent) { while (node) { if (node === parent) { return true; } node = node.parentNode; } return false; } ================================================ FILE: packages/hammer/src/utils/if-undefined.js ================================================ /** * @private * use the val2 when val1 is undefined * @param {*} val1 * @param {*} val2 * @returns {*} */ export default function ifUndefined(val1, val2) { return val1 === undefined ? val2 : val1; } ================================================ FILE: packages/hammer/src/utils/in-array.js ================================================ /** * @private * find if a array contains the object using indexOf or a simple polyFill * @param {Array} src * @param {String} find * @param {String} [findByKey] * @return {Boolean|Number} false when not found, or the index */ export default function inArray(src, find, findByKey) { if (src.indexOf && !findByKey) { return src.indexOf(find); } else { let i = 0; while (i < src.length) { if ( (findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find) ) { // do not use === here, test fails return i; } i++; } return -1; } } ================================================ FILE: packages/hammer/src/utils/in-str.js ================================================ /** * @private * small indexOf wrapper * @param {String} str * @param {String} find * @returns {Boolean} found */ export default function inStr(str, find) { return str.indexOf(find) > -1; } ================================================ FILE: packages/hammer/src/utils/inherit.js ================================================ import assign from "./assign"; /** * @private * simple class inheritance * @param {Function} child * @param {Function} base * @param {Object} [properties] */ export default function inherit(child, base, properties) { let baseP = base.prototype; let childP; childP = child.prototype = Object.create(baseP); childP.constructor = child; childP._super = baseP; if (properties) { assign(childP, properties); } } ================================================ FILE: packages/hammer/src/utils/invoke-array-arg.js ================================================ import each from "./each"; /** * @private * if the argument is an array, we want to execute the fn on each entry * if it aint an array we don't want to do a thing. * this is used by all the methods that accept a single and array argument. * @param {*|Array} arg * @param {String} fn * @param {Object} [context] * @returns {Boolean} */ export default function invokeArrayArg(arg, fn, context) { if (Array.isArray(arg)) { each(arg, context[fn], context); return true; } return false; } ================================================ FILE: packages/hammer/src/utils/merge.js ================================================ import deprecate from "./deprecate"; import extend from "./extend"; /** * @private * merge the values from src in the dest. * means that properties that exist in dest will not be overwritten by src * @param {Object} dest * @param {Object} src * @returns {Object} dest */ const merge = deprecate( (dest, src) => { return extend(dest, src, true); }, "merge", "Use `assign`.", ); export default merge; ================================================ FILE: packages/hammer/src/utils/remove-event-listeners.js ================================================ import each from "./each"; import splitStr from "./split-str"; /** * @private * removeEventListener with multiple events at once * @param {EventTarget} target * @param {String} types * @param {Function} handler */ export default function removeEventListeners(target, types, handler) { each(splitStr(types), (type) => { target.removeEventListener(type, handler, false); }); } export function removeManagerListeners(manager, types, handler) { each(splitStr(types), (type) => { manager.off(`origin_input:${type}`, handler); }); } ================================================ FILE: packages/hammer/src/utils/set-timeout-context.js ================================================ import bindFn from "./bind-fn"; /** * @private * set a timeout with a given scope * @param {Function} fn * @param {Number} timeout * @param {Object} context * @returns {number} */ export default function setTimeoutContext(fn, timeout, context) { return setTimeout(bindFn(fn, context), timeout); } ================================================ FILE: packages/hammer/src/utils/split-str.js ================================================ /** * @private * split string on whitespace * @param {String} str * @returns {Array} words */ export default function splitStr(str) { return str.trim().split(/\s+/g); } ================================================ FILE: packages/hammer/src/utils/to-array.js ================================================ /** * @private * convert array-like objects to real arrays * @param {Object} obj * @returns {Array} */ export default function toArray(obj) { return Array.prototype.slice.call(obj, 0); } ================================================ FILE: packages/hammer/src/utils/unique-array.js ================================================ import inArray from "./in-array"; /** * @private * unique array with objects based on a key (like 'id') or just by the array's value * @param {Array} src [{id:1},{id:2},{id:1}] * @param {String} [key] * @param {Boolean} [sort=False] * @returns {Array} [{id:1},{id:2}] */ export default function uniqueArray(src, key, sort) { let results = []; let values = []; let i = 0; while (i < src.length) { let val = key ? src[i][key] : src[i]; if (inArray(values, val) < 0) { results.push(src[i]); } values[i] = val; i++; } if (sort) { if (!key) { results = results.sort(); } else { results = results.sort((a, b) => { return a[key] > b[key]; }); } } return results; } ================================================ FILE: packages/hammer/src/utils/unique-id.js ================================================ /** * @private * get a unique id * @returns {number} uniqueId */ let _uniqueId = 1; export default function uniqueId() { return _uniqueId++; } ================================================ FILE: packages/hammer/src/utils/utils-consts.js ================================================ const TYPE_FUNCTION = "function"; const { round, abs } = Math; const { now } = Date; export { TYPE_FUNCTION, round, abs, now }; ================================================ FILE: packages/hammer/vite.config.ts ================================================ import { defineConfig } from "vite"; import path from "path"; export default defineConfig({ plugins: [], resolve: { alias: { "@": path.resolve(__dirname, "src"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.js"), // 入口文件 name: "f6-hammer", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, sourcemap: true, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6-hammer", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/plugin/package.json ================================================ { "name": "@antv/f6-plugin", "version": "1.0.5", "description": "F6 plugin", "keywords": [ "antv", "f6", "graph", "graph analysis", "graph editor", "graph visualization", "relational data" ], "repository": { "type": "git", "url": "git+https://github.com/antvis/F6.git" }, "license": "MIT", "author": "https://github.com/orgs/antvis/people", "files": [ "package.json", "es", "lib", "dist", "LICENSE", "README.md" ], "main": "dist/cjs/index.cjs.js", "module": "dist/esm/index.es.js", "unpkg": "dist/umd/index.umd.js", "browser": "dist/umd/index.umd.js", "miniprogram": "dist", "types": "lib/index.d.ts", "bugs": { "url": "https://github.com/antvis/F6/issues" }, "homepage": "https://github.com/antvis/F6#readme", "scripts": { "clean": "rimraf dist", "build": "vite build" }, "dependencies": { "@antv/f6-core": "workspace:*", "@antv/f6-ui": "workspace:*", "@antv/g-mobile": "^0.0.13", "@antv/scale": "^0.3.1", "@antv/matrix-util": "^3.0.4", "@antv/path-util": "^2.0.3", "@antv/util": "~2.0.5" }, "devDependencies": { "vite": "~5.3.1" } } ================================================ FILE: packages/plugin/src/base.ts ================================================ import { wrapBehavior, each, deepMix } from "@antv/util"; import { IG6GraphEvent, IAbstractGraph as IGraph } from "@antv/f6-core"; export interface IPluginBaseConfig { container?: HTMLDivElement | string | null; className?: string; } export interface IPluginBaseConfig { graph?: IGraph; [key: string]: any; } interface EventMapType { [key: string]: any; } export default abstract class PluginBase { private _events: EventMapType; public _cfgs: IPluginBaseConfig; public destroyed: boolean; /** * 插件基类的构造函数 * @param cfgs 插件的配置项 */ constructor(cfgs?: IPluginBaseConfig) { this._cfgs = deepMix(this.getDefaultCfgs(), cfgs); this._events = {}; this.destroyed = false; } /** * 获取默认的插件配置 */ public getDefaultCfgs() { return {}; } /** * 初始化插件 * @param graph IGraph 实例 */ public initPlugin(graph: IGraph) { const self = this; self.set("graph", graph); const events = self.getEvents(); const bindEvents: EventMapType = {}; each(events, (v, k) => { const event = wrapBehavior(self, v) as (e: IG6GraphEvent) => void; bindEvents[k] = event; graph.on(k, event); }); this._events = bindEvents; this.init(); } /** * 初始化方法,供子类实现 */ public init() {} /** * 获取插件中的事件和事件处理方法,供子类实现 */ public getEvents() { return {}; } /** * 获取配置项中的某个值 * @param key 键值 */ public get(key: string) { return this._cfgs[key]; } /** * 将指定的值存储到 cfgs 中 * @param key 键值 * @param val 设置的值 */ public set(key: string, val: any) { this._cfgs[key] = val; } /** * 销毁方法,供子类复写 */ public destroy() {} /** * 销毁插件 */ public destroyPlugin() { this.destroy(); const graph = this.get("graph"); const events = this._events; each(events, (v, k) => { graph.off(k, v); }); (this._events as EventMapType | null) = null; (this._cfgs as IPluginBaseConfig | null) = null; this.destroyed = true; } } ================================================ FILE: packages/plugin/src/bundling/index.ts ================================================ import Base, { IPluginBaseConfig } from "../base"; import { IEdge, IAbstractGraph as IGraph, GraphData, NodeConfig, NodeConfigMap, EdgeConfig, } from "@antv/f6-core"; import { Point } from "@antv/g-base"; interface BundlingConfig extends IPluginBaseConfig { edgeBundles?: IEdge[]; edgePoints?: NodeConfig[]; K?: number; lambda?: number; divisions?: number; divRate?: number; cycles?: number; iterations?: number; iterRate?: number; bundleThreshold?: number; eps?: number; onLayoutEnd?: () => void; onTick?: () => void; } interface VectorPosition { source: { x: number; y: number; }; target: { x: number; y: number; }; vx: number; vy: number; length: number; } function getEucliDis(pointA: Point, pointB: Point, eps?: number): number { const vx = pointA.x - pointB.x; const vy = pointA.y - pointB.y; if (!eps || Math.abs(vx) > eps || Math.abs(vy) > eps) { return Math.sqrt(vx * vx + vy * vy); } return eps; } function getDotProduct(ei: Point, ej: Point): number { return ei.x * ej.x + ei.y * ej.y; } function projectPointToEdge(p: Point, e: VectorPosition): Point { const k = (e.source.y - e.target.y) / (e.source.x - e.target.x); const x = (k * k * e.source.x + k * (p.y - e.source.y) + p.x) / (k * k + 1); const y = k * (x - e.source.x) + e.source.y; return { x, y }; } export default class Bundling extends Base { constructor(config?: BundlingConfig) { super(config); } public getDefaultCfgs(): BundlingConfig { return { edgeBundles: [], // |edges| arrays, each one stores the related edges' id edgePoints: [], // |edges| * divisions edge points K: 0.1, // 边的强度 lambda: 0.1, // 初始步长 divisions: 1, // 初始切割点数 divRate: 2, // subdivision rate increase cycles: 6, // number of cycles to perform iterations: 90, // 每个 cycle 初始迭代次数 iterRate: 0.6666667, // 迭代下降率 bundleThreshold: 0.6, eps: 1e-6, onLayoutEnd() {}, // 布局完成回调 onTick() {}, // 每一迭代布局回调 }; } public init() { const graph: IGraph = this.get("graph"); const onTick = this.get("onTick"); const tick = () => { if (onTick) { onTick(); } graph.refreshPositions(); }; this.set("tick", tick); } public bundling(data: GraphData): void { const self = this; self.set("data", data); // 如果正在布局,忽略布局请求 if (self.isTicking()) { return; } const edges = data.edges || []; const nodes = data.nodes || []; const nodeIdMap: NodeConfigMap = {}; let error = false; nodes.forEach((node) => { if ( node.x === null || !node.y === null || node.x === undefined || !node.y === undefined ) { error = true; } nodeIdMap[node.id] = node; }); if (error) throw new Error( "please layout the graph or assign x and y for nodes first", ); self.set("nodeIdMap", nodeIdMap); // subdivide each edges let divisions: number = self.get("divisions"); const divRate: number = self.get("divRate"); let edgePoints: Point[][] = self.divideEdges(divisions); self.set("edgePoints", edgePoints); // compute the bundles const edgeBundles = self.getEdgeBundles(); self.set("edgeBundles", edgeBundles); // iterations const C: number = self.get("cycles"); let iterations: number = self.get("iterations"); const iterRate: number = self.get("iterRate"); let lambda: number = self.get("lambda"); for (let i = 0; i < C; i++) { for (let j = 0; j < iterations; j++) { const forces: Point[][] = []; edges.forEach((e, k) => { if (e.source === e.target) return; const source = nodeIdMap[e.source as string]; const target = nodeIdMap[e.target as string]; forces[k] = self.getEdgeForces( { source, target }, k, divisions, lambda, ); for (let p = 0; p < divisions + 1; p++) { edgePoints[k][p].x += forces[k][p].x; edgePoints[k][p].y += forces[k][p].y; } }); } // parameters for nex cycle lambda = lambda / 2; divisions *= divRate; iterations *= iterRate; edgePoints = self.divideEdges(divisions); self.set("edgePoints", edgePoints); } // change the edges according to edgePoints edges.forEach((e, i) => { if (e.source === e.target) return; e.type = "polyline"; e.controlPoints = edgePoints[i].slice(1, edgePoints[i].length - 1); }); const graph = self.get("graph"); graph.refresh(); } public updateBundling(cfg: BundlingConfig) { const self = this; const { data } = cfg; if (data) { self.set("data", data); } if (self.get("ticking")) { self.set("ticking", false); } Object.keys(cfg).forEach((key) => { self.set(key, cfg[key]); }); if (cfg.onTick) { const graph = this.get("graph"); self.set("tick", () => { cfg.onTick!(); graph.refresh(); }); } self.bundling(data); } public divideEdges(divisions: number): Point[][] { const self = this; const edges: EdgeConfig[] = self.get("data").edges; const nodeIdMap: NodeConfigMap = self.get("nodeIdMap"); let edgePoints = self.get("edgePoints"); if (!edgePoints || edgePoints === undefined) edgePoints = []; edges.forEach((edge, i) => { if (!edgePoints[i] || edgePoints[i] === undefined) { edgePoints[i] = []; } const source = nodeIdMap[edge.source as string]; const target = nodeIdMap[edge.target as string]; if (divisions === 1) { edgePoints[i].push({ x: source.x, y: source.y }); // source edgePoints[i].push({ x: 0.5 * (source.x! + target.x!), y: 0.5 * (source.y! + target.y!), }); // mid edgePoints[i].push({ x: target.x, y: target.y }); // target } else { let edgeLength = 0; if ( !edgePoints[i] || (Array.isArray(edgePoints[i]) && edgePoints[i].length === 0) ) { // it is a straight line edgeLength = getEucliDis( { x: source.x!, y: source.y! }, { x: target.x!, y: target.y! }, ); } else { edgeLength = self.getEdgeLength(edgePoints[i]); } const divisionLength = edgeLength / (divisions + 1); let currentDivisonLength = divisionLength; const newEdgePoints = [{ x: source.x, y: source.y }]; // source edgePoints[i].forEach((ep: Point, j: number) => { if (j === 0) return; let oriDivisionLength = getEucliDis(ep, edgePoints[i][j - 1]); while (oriDivisionLength > currentDivisonLength) { const ratio = currentDivisonLength / oriDivisionLength; const edgePoint = { x: edgePoints[i][j - 1].x, y: edgePoints[i][j - 1].y, }; edgePoint.x += ratio * (ep.x - edgePoints[i][j - 1].x); edgePoint.y += ratio * (ep.y - edgePoints[i][j - 1].y); newEdgePoints.push(edgePoint); oriDivisionLength -= currentDivisonLength; currentDivisonLength = divisionLength; } currentDivisonLength -= oriDivisionLength; }); newEdgePoints.push({ x: target.x, y: target.y }); // target edgePoints[i] = newEdgePoints; } }); return edgePoints; } /** * 计算边的长度 * @param points */ public getEdgeLength(points: Point[]): number { let length = 0; points.forEach((p, i) => { if (i === 0) return; length += getEucliDis(p, points[i - 1]); }); return length; } public getEdgeBundles(): number[] { const self = this; const data: GraphData = self.get("data"); const edges = data.edges || []; const bundleThreshold: number = self.get("bundleThreshold"); const nodeIdMap: NodeConfigMap = self.get("nodeIdMap"); let edgeBundles = self.get("edgeBundles"); if (!edgeBundles) edgeBundles = []; edges.forEach((e, i) => { if (!edgeBundles[i] || edgeBundles[i] === undefined) { edgeBundles[i] = []; } }); edges.forEach((ei, i) => { const iSource = nodeIdMap[ei.source as string]; const iTarget = nodeIdMap[ei.target as string]; edges.forEach((ej, j) => { if (j <= i) return; const jSource = nodeIdMap[ej.source as string]; const jTarget = nodeIdMap[ej.target as string]; const score = self.getBundleScore( { source: iSource, target: iTarget }, { source: jSource, target: jTarget }, ); if (score >= bundleThreshold) { edgeBundles[i].push(j); edgeBundles[j].push(i); } }); }); return edgeBundles; } public getBundleScore(ei: any, ej: any): number { const self = this; ei.vx = ei.target.x - ei.source.x; ei.vy = ei.target.y - ei.source.y; ej.vx = ej.target.x - ej.source.x; ej.vy = ej.target.y - ej.source.y; ei.length = getEucliDis( { x: ei.source.x, y: ei.source.y, }, { x: ei.target.x, y: ei.target.y, }, ); ej.length = getEucliDis( { x: ej.source.x, y: ej.source.y, }, { x: ej.target.x, y: ej.target.y, }, ); // angle score const aScore = self.getAngleScore(ei, ej); // scale score const sScore = self.getScaleScore(ei, ej); // position score const pScore = self.getPositionScore(ei, ej); // visibility socre const vScore = self.getVisibilityScore(ei, ej); return aScore * sScore * pScore * vScore; } protected getAngleScore(ei: VectorPosition, ej: VectorPosition): number { const dotProduct = getDotProduct( { x: ei.vx, y: ei.vy }, { x: ej.vx, y: ej.vy }, ); return dotProduct / (ei.length * ej.length); } protected getScaleScore(ei: VectorPosition, ej: VectorPosition): number { const aLength = (ei.length + ej.length) / 2; const score = 2 / (aLength / Math.min(ei.length, ej.length) + Math.max(ei.length, ej.length) / aLength); return score; } protected getPositionScore(ei: VectorPosition, ej: VectorPosition): number { const aLength = (ei.length + ej.length) / 2; const iMid = { x: (ei.source.x + ei.target.x) / 2, y: (ei.source.y + ei.target.y) / 2, }; const jMid = { x: (ej.source.x + ej.target.x) / 2, y: (ej.source.y + ej.target.y) / 2, }; const distance = getEucliDis(iMid, jMid); return aLength / (aLength + distance); } protected getVisibilityScore(ei: VectorPosition, ej: VectorPosition): number { const vij = this.getEdgeVisibility(ei, ej); const vji = this.getEdgeVisibility(ej, ei); return vij < vji ? vij : vji; } protected getEdgeVisibility(ei: VectorPosition, ej: VectorPosition): number { const ps = projectPointToEdge(ej.source, ei); const pt = projectPointToEdge(ej.target, ei); const pMid = { x: (ps.x + pt.x) / 2, y: (ps.y + pt.y) / 2, }; const iMid = { x: (ei.source.x + ei.target.x) / 2, y: (ei.source.y + ei.target.y) / 2, }; return Math.max(0, 1 - (2 * getEucliDis(pMid, iMid)) / getEucliDis(ps, pt)); } protected getEdgeForces( e: any, eidx: number, divisions: number, lambda: number, ): Point[] { const self = this; const edgePoints = self.get("edgePoints"); const K = self.get("K"); const kp = K / (getEucliDis(e.source, e.target) * (divisions + 1)); const edgePointForces = [{ x: 0, y: 0 }]; for (let i = 1; i < divisions; i++) { const force = { x: 0, y: 0 }; const spring = self.getSpringForce( { pre: edgePoints[eidx][i - 1], cur: edgePoints[eidx][i], next: edgePoints[eidx][i + 1], }, kp, ); const electrostatic = self.getElectrostaticForce(i, eidx); force.x = lambda * (spring.x + electrostatic.x); force.y = lambda * (spring.y + electrostatic.y); edgePointForces.push(force); } edgePointForces.push({ x: 0, y: 0 }); return edgePointForces; } protected getSpringForce(divisions: any, kp: number): Point { let x = divisions.pre.x + divisions.next.x - 2 * divisions.cur.x; let y = divisions.pre.y + divisions.next.y - 2 * divisions.cur.y; x *= kp; y *= kp; return { x, y }; } protected getElectrostaticForce(pidx: number, eidx: number): Point { const self = this; const eps = self.get("eps"); const edgeBundles = self.get("edgeBundles"); const edgePoints = self.get("edgePoints"); const edgeBundle = edgeBundles[eidx]; const resForce = { x: 0, y: 0 }; edgeBundle.forEach((eb: number) => { const force = { x: edgePoints[eb][pidx].x - edgePoints[eidx][pidx].x, y: edgePoints[eb][pidx].y - edgePoints[eidx][pidx].y, }; if (Math.abs(force.x) > eps || Math.abs(force.y) > eps) { const length = getEucliDis( edgePoints[eb][pidx], edgePoints[eidx][pidx], ); const diff = 1 / length; resForce.x += force.x * diff; resForce.y += force.y * diff; } }); return resForce; } public isTicking(): boolean { return this.get("ticking"); } public getSimulation() { return this.get("forceSimulation"); } public destroy() { if (this.get("ticking")) { this.getSimulation().stop(); } super.destroy(); } } ================================================ FILE: packages/plugin/src/edge-filter-lens/index.ts ================================================ import { clone } from "@antv/util"; import { IG6GraphEvent, ShapeStyle, IAbstractGraph as IGraph, Util, } from "@antv/f6-core"; import Base from "../base"; const { distance } = Util; const DELTA = 0.05; interface EdgeFilterLensConfig { trigger?: "tab" | "drag"; r?: number; delegateStyle?: ShapeStyle; showLabel?: "node" | "edge" | "both" | undefined; maxR?: number; minR?: number; type?: "one" | "both" | "only-source" | "only-target"; shouldShow?: (d?: unknown) => boolean; } const lensDelegateStyle = { stroke: "#000", strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 1, fill: "#fff", }; export default class EdgeFilterLens extends Base { isUp = true; scaleTimer = null; constructor(config?: EdgeFilterLensConfig) { super(config); } public getDefaultCfgs(): EdgeFilterLensConfig { return { type: "both", trigger: "drag", r: 60, delegateStyle: clone(lensDelegateStyle), showLabel: "edge", }; } // class-methods-use-this public getEvents() { let events; switch ((this as any).get("trigger")) { case "click": events = { tap: "filter", }; break; case "drag": events = { press: "createDelegate", }; break; default: events = { mousemove: "filter", }; break; } return events; } public init() { const self = this; const showLabel = self.get("showLabel"); const showNodeLabel = showLabel === "node" || showLabel === "both"; const showEdgeLabel = showLabel === "edge" || showLabel === "both"; self.set("showNodeLabel", showNodeLabel); self.set("showEdgeLabel", showEdgeLabel); const shouldShow = self.get("shouldShow"); if (!shouldShow) self.set("shouldShow", () => true); } // Create the delegate when the trigger is drag protected createDelegate(e: IG6GraphEvent) { const self = this; let lensDelegate = self.get("delegate"); if (!lensDelegate || lensDelegate.destroyed) { const graph = this.get("graph"); const pos = graph.getPointByClient(e.clientX, e.clientY); self.filter(pos); lensDelegate = self.get("delegate"); // drag to move the lens lensDelegate.on("dragstart", (evt) => {}); lensDelegate.on("drag", (e) => { const pos = graph.getPointByClient(e.clientX, e.clientY); self.filter(pos); }); lensDelegate.on("dragend", (e) => { this.clear(); }); } } /** * Scale the range by wheel * @param e mouse wheel event */ protected scaleRByWheel(e: IG6GraphEvent, isUp: boolean) { const self = this; if (!e) return; if (e.preventDefault) e.preventDefault(); const graph: IGraph = self.get("graph"); let ratio; const lensDelegate = self.get("delegate"); const lensCenter = lensDelegate ? { x: lensDelegate.attr("x"), y: lensDelegate.attr("y"), } : undefined; const mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY); if (isUp) { ratio = 1 / (1 - DELTA); } else { ratio = 1 - DELTA; } const maxR = self.get("maxR"); const minR = self.get("minR"); let r = self.get("r"); if ( (r > (maxR || graph.get("height")) && ratio > 1) || (r < (minR || graph.get("height") * 0.05) && ratio < 1) ) { ratio = 1; } r *= ratio; self.set("r", r); self.filter(e); } /** * Response function for mousemove, click, or drag to filter out the edges * @param e mouse event */ protected filter({ x, y }) { const self = this; const graph = self.get("graph"); const nodes = graph.getNodes(); const hitNodesMap = {}; const r = self.get("r"); const type = self.get("type"); const fCenter = { x, y }; self.updateDelegate(fCenter, r); const shouldShow = self.get("shouldShow"); let vShapes = self.get("vShapes"); if (vShapes) { vShapes.forEach((shape) => { shape.remove(); shape.destroy(); }); } vShapes = []; nodes.forEach((node) => { const model = node.getModel(); const { x, y } = model; if (distance({ x, y }, fCenter) < r) { hitNodesMap[model.id] = node; } }); const edges = graph.getEdges(); const hitEdges = []; edges.forEach((edge) => { const model = edge.getModel(); const sourceId = model.source; const targetId = model.target; if (shouldShow(model)) { if (type === "only-source" || type === "one") { if (hitNodesMap[sourceId] && !hitNodesMap[targetId]) hitEdges.push(edge); } else if (type === "only-target" || type === "one") { if (hitNodesMap[targetId] && !hitNodesMap[sourceId]) hitEdges.push(edge); } else if ( type === "both" && hitNodesMap[sourceId] && hitNodesMap[targetId] ) { hitEdges.push(edge); } } }); const showNodeLabel = self.get("showNodeLabel"); const showEdgeLabel = self.get("showEdgelabel"); // copy the shapes in hitEdges const group = graph.get("group"); hitEdges.forEach((edge) => { const shapes = edge.get("group").get("children"); shapes.forEach((shape) => { const shapeType = shape.get("type"); const vShape = group.addShape(shapeType, { attrs: shape.attr(), capture: false, }); vShapes.push(vShape); if (showNodeLabel && shapeType === "text") { vShape.set("visible", true); } }); }); // copy the shape sof hitNodes Object.keys(hitNodesMap).forEach((key) => { const node = hitNodesMap[key]; const clonedGroup = node.get("group").clone(); clonedGroup.set("capture", false); group.add(clonedGroup); vShapes.push(clonedGroup); if (showEdgeLabel) { const shapes = clonedGroup.get("children"); for (let j = 0; j < shapes.length; j++) { const shape = shapes[j]; if (shape.get("type") === "text") { shape.set("visible", true); } } } }); self.set("vShapes", vShapes); } /** * Adjust part of the parameters, including trigger, type, r, maxR, minR, shouldShow, showLabel, and scaleRBy * @param {EdgeFilterLensConfig} cfg */ public updateParams(cfg: EdgeFilterLensConfig) { const self = this; const { r, trigger, minR, maxR, showLabel, shouldShow } = cfg; if (!isNaN(cfg.r)) { self.set("r", r); } if (!isNaN(maxR)) { self.set("maxR", maxR); } if (!isNaN(minR)) { self.set("minR", minR); } if (trigger === "tab") { self.set("trigger", trigger); } if (showLabel === "node" || showLabel === "both") { self.set("showNodeLabel", true); } if (showLabel === "edge" || showLabel === "both") { self.set("showEdgeLabel", true); } if (shouldShow) { self.set("shouldShow", shouldShow); } } /** * Update the delegate shape of the lens * @param {Point} mCenter the center of the shape * @param {number} r the radius of the shape */ private updateDelegate(mCenter, r) { const self = this; const graph = self.get("graph"); let lensDelegate = self.get("delegate"); if (!lensDelegate || lensDelegate.destroyed) { // 拖动多个 const parent = graph.get("group"); const attrs = self.get("delegateStyle") || lensDelegateStyle; // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标 lensDelegate = parent.addShape("circle", { attrs: { r, x: mCenter.x, y: mCenter.y, ...attrs, }, name: "lens-shape", draggable: true, zIndex: 1000, }); } else { lensDelegate.attr({ x: mCenter.x, y: mCenter.y, r, }); } self.set("delegate", lensDelegate); } /** * Clear the filtering */ public clear() { const self = this; let vShapes = self.get("vShapes"); if (vShapes) { vShapes.forEach((shape) => { shape.remove(); shape.destroy(); }); } vShapes = []; self.set("vShapes", vShapes); const lensDelegate = self.get("delegate"); if (lensDelegate && !lensDelegate.destroyed) { lensDelegate.remove(); lensDelegate.destroy(); } } /** * Destroy the component */ public destroy() { this.clear(); } } ================================================ FILE: packages/plugin/src/fisheye/index.ts ================================================ import { clone, throttle } from "@antv/util"; import { IG6GraphEvent, ShapeStyle, IAbstractGraph as IGraph, } from "@antv/f6-core"; import Base from "../base"; const DELTA = 0.05; interface FisheyeConfig { trigger?: "mousemove" | "tap" | "drag"; d?: number; r?: number; delegateStyle?: ShapeStyle; showLabel?: boolean; scaleRBy?: "drag" | "unset" | undefined; scaleDBy?: "drag" | "unset" | undefined; maxR?: number; minR?: number; maxD?: number; minD?: number; showDPercent?: boolean; } const lensDelegateStyle = { stroke: "#000", strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 0.1, fill: "#ccc", }; export default class Fisheye extends Base { constructor(config?: FisheyeConfig) { super(config); } public getDefaultCfgs(): FisheyeConfig { return { trigger: "tap", d: 1.5, r: 300, delegateStyle: clone(lensDelegateStyle), showLabel: false, maxD: 5, minD: 0, scaleRBy: "unset", scaleDBy: "unset", showDPercent: true, }; } // class-methods-use-this public getEvents() { let events; switch ((this as any).get("trigger")) { case "tap": events = { tap: "magnify", }; break; case "drag": events = { press: "createDelegate", }; break; default: events = { tap: "magnify", }; break; } return events; } public init() { const self = this; const r = self.get("r"); self.set("cachedMagnifiedModels", []); self.set("cachedOriginPositions", {}); self.set("r2", r * r); const d = self.get("d"); self.set("molecularParam", (d + 1) * r); } // Create the delegate when the trigger is drag protected createDelegate(e: IG6GraphEvent) { const self = this; let lensDelegate = self.get("delegate"); if (!lensDelegate || lensDelegate.destroyed) { self.magnify(e); lensDelegate = self.get("delegate"); // drag to move the lens lensDelegate.on("dragstart", (evt) => { self.set("delegateCenterDiff", { x: lensDelegate.attr("x") - evt.x, y: lensDelegate.attr("y") - evt.y, }); }); const throMmagnify = throttle(self.magnify.bind(self), 100, { leading: false, trailing: false, }); lensDelegate.on("drag", throMmagnify); lensDelegate.on("dragend", (evt) => { this.clear(); }); // 绑定调整范围(r)和缩放系数(d)的监听 // 由于 drag 用于改变 lens 位置, 因此在此模式下, drag 不能用于调整 r 和 d // scaling d if (this.get("scaleDBy") === "wheel") { lensDelegate.on("mousewheel", (evt) => { this.scaleDByWheel(evt); }); } // scaling r if (this.get("scaleRBy") === "wheel") { lensDelegate.on("mousewheel", (evt) => { self.scaleRByWheel(evt); }); } } } /** * Scale the range by wheel * @param e mouse wheel event */ protected scaleRByWheel(e: IG6GraphEvent) { const self = this; if (!e || !e.originalEvent) return; if (e.preventDefault) e.preventDefault(); const graph: IGraph = self.get("graph"); let ratio; const lensDelegate = self.get("delegate"); const lensCenter = lensDelegate ? { x: lensDelegate.attr("x"), y: lensDelegate.attr("y"), } : undefined; const mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY); if ((e.originalEvent as any).wheelDelta < 0) { ratio = 1 - DELTA; } else { ratio = 1 / (1 - DELTA); } const maxR = self.get("maxR"); const minR = self.get("minR"); let r = self.get("r"); if ( (r > (maxR || graph.get("height")) && ratio > 1) || (r < (minR || graph.get("height") * 0.05) && ratio < 1) ) { ratio = 1; } r *= ratio; self.set("r", r); self.set("r2", r * r); const d = self.get("d"); self.set("molecularParam", (d + 1) * r); self.set("delegateCenterDiff", undefined); self.magnify(e, mousePos); } /** * Scale the range by dragging * @param e mouse event */ protected scaleRByDrag(e: IG6GraphEvent) { const self = this; if (!e) return; const dragPrePos = self.get("dragPrePos"); const graph: IGraph = self.get("graph"); let ratio; const mousePos = graph.getPointByClient(e.clientX, e.clientY); if (e.x - dragPrePos.x < 0) { ratio = 1 - DELTA; } else { ratio = 1 / (1 - DELTA); } const maxR = self.get("maxR"); const minR = self.get("minR"); let r = self.get("r"); if ( (r > (maxR || graph.get("height")) && ratio > 1) || (r < (minR || graph.get("height") * 0.05) && ratio < 1) ) { ratio = 1; } r *= ratio; self.set("r", r); self.set("r2", r * r); const d = self.get("d"); self.set("molecularParam", (d + 1) * r); self.magnify(e, mousePos); self.set("dragPrePos", { x: e.x, y: e.y }); } /** * Scale the magnifying factor by wheel * @param e mouse wheel event */ protected scaleDByWheel(evt: IG6GraphEvent) { const self = this; if (!evt && !evt.originalEvent) return; if (evt.preventDefault) evt.preventDefault(); let delta = 0; if ((evt.originalEvent as any).wheelDelta < 0) { delta = -0.1; } else { delta = 0.1; } const d = self.get("d"); const newD = d + delta; const maxD = self.get("maxD"); const minD = self.get("minD"); if (newD < maxD && newD > minD) { self.set("d", newD); const r = self.get("r"); self.set("molecularParam", (newD + 1) * r); const lensDelegate = self.get("delegate"); const lensCenter = lensDelegate ? { x: lensDelegate.attr("x"), y: lensDelegate.attr("y"), } : undefined; self.set("delegateCenterDiff", undefined); self.magnify(evt, lensCenter); } } /** * Scale the magnifying factor by dragging * @param e mouse event */ protected scaleDByDrag(e: IG6GraphEvent) { const self = this; const dragPrePos = self.get("dragPrePos"); const delta = e.x - dragPrePos.x > 0 ? 0.1 : -0.1; const d = self.get("d"); const newD = d + delta; const maxD = self.get("maxD"); const minD = self.get("minD"); if (newD < maxD && newD > minD) { self.set("d", newD); const r = self.get("r"); self.set("molecularParam", (newD + 1) * r); self.magnify(e); } self.set("dragPrePos", { x: e.x, y: e.y }); } /** * Response function for mousemove, tap, or drag to magnify * @param e mouse event */ protected magnify(e: IG6GraphEvent, mousePos?) { const self = this; self.restoreCache(); const graph: IGraph = self.get("graph"); const cachedMagnifiedModels = self.get("cachedMagnifiedModels"); const cachedOriginPositions = self.get("cachedOriginPositions"); const showLabel = self.get("showLabel"); const r = self.get("r"); const r2 = self.get("r2"); const d = self.get("d"); const molecularParam = self.get("molecularParam"); const nodes = graph.getNodes(); const nodeLength = nodes.length; let mCenter = mousePos ? { x: mousePos.x, y: mousePos.y } : { x: e.x, y: e.y }; if ( self.get("dragging") && (self.get("trigger") === "mousemove" || self.get("trigger") === "tap") ) { mCenter = self.get("cacheCenter"); // todo: pc端不需要,why mCenter = graph.getPointByClient(mCenter.x, mCenter.y); } const delegateCenterDiff = self.get("delegateCenterDiff"); if (delegateCenterDiff) { mCenter.x += delegateCenterDiff.x; mCenter.y += delegateCenterDiff.y; } self.updateDelegate(mCenter, r); for (let i = 0; i < nodeLength; i++) { const model = nodes[i].getModel(); const { x, y } = model; if (isNaN(x) || isNaN(y)) continue; // the square of the distance between the node and the magnified center const dist2 = (x - mCenter.x) * (x - mCenter.x) + (y - mCenter.y) * (y - mCenter.y); if (!isNaN(dist2) && dist2 < r2 && dist2 !== 0) { const dist = Math.sqrt(dist2); // (r * (d + 1) * (dist / r)) / (d * (dist / r) + 1); const magnifiedDist = (molecularParam * dist) / (d * dist + r); const cos = (x - mCenter.x) / dist; const sin = (y - mCenter.y) / dist; model.x = cos * magnifiedDist + mCenter.x; model.y = sin * magnifiedDist + mCenter.y; if (!cachedOriginPositions[model.id]) { cachedOriginPositions[model.id] = { x, y, texts: [] }; } cachedMagnifiedModels.push(model); if (showLabel && 2 * dist < r) { const node = nodes[i]; const nodeGroup = node.getContainer(); const shapes = nodeGroup.getChildren(); const shapeLength = shapes.length; for (let j = 0; j < shapeLength; j++) { const shape = shapes[j]; if (shape.get("type") === "text") { cachedOriginPositions[model.id].texts.push({ visible: shape.get("visible"), shape, }); shape.set("visible", true); } } } } } graph.refreshPositions(); } /** * Restore the cache nodes while magnifying */ protected restoreCache() { const self = this; const cachedMagnifiedModels = self.get("cachedMagnifiedModels"); const cachedOriginPositions = self.get("cachedOriginPositions"); const cacheLength = cachedMagnifiedModels.length; for (let i = 0; i < cacheLength; i++) { const node = cachedMagnifiedModels[i]; const id = node.id; const ori = cachedOriginPositions[id]; node.x = ori.x; node.y = ori.y; const textLength = ori.texts.length; for (let j = 0; j < textLength; j++) { const text = ori.texts[j]; text.shape.set("visible", text.visible); } } self.set("cachedMagnifiedModels", []); self.set("cachedOriginPositions", {}); } /** * Adjust part of the parameters, including trigger, d, r, maxR, minR, maxD, minD, scaleRBy, and scaleDBy * @param {FisheyeConfig} cfg */ public updateParams(cfg: FisheyeConfig) { const self = this; const { r, d, trigger, minD, maxD, minR, maxR, scaleDBy, scaleRBy } = cfg; if (!isNaN(cfg.r)) { self.set("r", r); self.set("r2", r * r); } if (!isNaN(d)) { self.set("d", d); } if (!isNaN(maxD)) { self.set("maxD", maxD); } if (!isNaN(minD)) { self.set("minD", minD); } if (!isNaN(maxR)) { self.set("maxR", maxR); } if (!isNaN(minR)) { self.set("minR", minR); } const nd = self.get("d"); const nr = self.get("r"); self.set("molecularParam", (nd + 1) * nr); if (trigger === "mousemove" || trigger === "tap" || trigger === "drag") { self.set("trigger", trigger); } if (scaleDBy === "drag" || scaleDBy === "unset") { self.set("scaleDBy", scaleDBy); self.get("delegate").remove(); self.get("delegate").destroy(); const dPercentText = self.get("dPercentText"); if (dPercentText) { dPercentText.remove(); dPercentText.destroy(); } } if (scaleRBy === "drag" || scaleRBy === "unset") { self.set("scaleRBy", scaleRBy); self.get("delegate").remove(); self.get("delegate").destroy(); const dPercentText = self.get("dPercentText"); if (dPercentText) { dPercentText.remove(); dPercentText.destroy(); } } } /** * Update the delegate shape of the lens * @param {Point} mCenter the center of the shape * @param {number} r the radius of the shape */ private updateDelegate(mCenter, r) { const self = this; const graph = self.get("graph"); let lensDelegate = self.get("delegate"); if (!lensDelegate || lensDelegate.destroyed) { // 拖动多个 const parent = graph.get("group"); const attrs = self.get("delegateStyle") || lensDelegateStyle; // model上的x, y是相对于图形中心的, delegateShape是g实例, x,y是绝对坐标 lensDelegate = parent.addShape("circle", { attrs: { r: r / 1.5, x: mCenter.x, y: mCenter.y, ...attrs, }, name: "lens-shape", draggable: true, }); if (this.get("trigger") !== "drag") { // 调整范围 r 的监听 if (this.get("scaleRBy") === "wheel") { // 使用滚轮调整 r lensDelegate.on("mousewheel", (evt) => { self.scaleRByWheel(evt); }); } else if (this.get("scaleRBy") === "drag") { // 使用拖拽调整 r lensDelegate.on("dragstart", (e) => { self.set("dragging", true); self.set("cacheCenter", { x: e.x, y: e.y }); self.set("dragPrePos", { x: e.x, y: e.y }); }); lensDelegate.on("drag", (evt) => { self.scaleRByDrag(evt); }); lensDelegate.on("dragend", (e) => { self.set("dragging", false); }); } // 调整缩放系数 d 的监听 if (this.get("scaleDBy") === "wheel") { // 使用滚轮调整 d lensDelegate.on("mousewheel", (evt) => { this.scaleDByWheel(evt); }); } else if (this.get("scaleDBy") === "drag") { // 使用拖拽调整 d lensDelegate.on("dragstart", (evt) => { self.set("dragging", true); self.set("cacheCenter", { x: evt.x, y: evt.y }); self.set("dragPrePos", { x: evt.x, y: evt.y }); }); lensDelegate.on("drag", (evt) => { this.scaleDByDrag(evt); }); lensDelegate.on("dragend", (evt) => { self.set("dragging", false); }); } } } else { lensDelegate.attr({ x: mCenter.x, y: mCenter.y, r: r / 1.5, }); } // 绘制缩放系数百分比文本 if (self.get("showDPercent")) { const percent = Math.round( ((self.get("d") - self.get("minD")) / (self.get("maxD") - self.get("minD"))) * 100, ); let dPercentText = self.get("dPercentText"); const textY = mCenter.y + r / 1.5 + 16; if (!dPercentText || dPercentText.destroyed) { const parent = graph.get("group"); dPercentText = parent.addShape("text", { attrs: { text: `${percent}%`, x: mCenter.x, y: textY, fill: "#aaa", stroke: "#fff", lineWidth: 1, fontSize: 12, }, }); self.set("dPercentText", dPercentText); } else { dPercentText.attr({ text: `${percent}%`, x: mCenter.x, y: textY, }); } } self.set("delegate", lensDelegate); } /** * Clear the fisheye lens */ public clear() { const graph = this.get("graph"); this.restoreCache(); graph.refreshPositions(); const lensDelegate = this.get("delegate"); if (lensDelegate && !lensDelegate.destroyed) { lensDelegate.remove(); lensDelegate.destroy(); } const dPercentText = this.get("dPercentText"); if (dPercentText && !dPercentText.destroyed) { dPercentText.remove(); dPercentText.destroy(); } this.set("delegateCenterDiff", undefined); } /** * Destroy the component */ public destroy() { this.clear(); } } ================================================ FILE: packages/plugin/src/index.ts ================================================ import TimeBar from "./time-bar"; import SnapLine from "./snap-line"; import Tooltip from "./tooltip"; import Legend from "./legend"; import ZoomSlider from "./zoom-slider"; import EdgeFilterLens from "./edge-filter-lens"; import Fisheye from "./fisheye"; import MiniMap from "./minimap"; import Bundling from "./bundling"; import Menu from "./menu"; const plugin = { TimeBar, SnapLine, Tooltip, Legend, ZoomSlider, EdgeFilterLens, Fisheye, MiniMap, Bundling, Menu, }; export { TimeBar, SnapLine, Tooltip, Legend, ZoomSlider, EdgeFilterLens, Fisheye, MiniMap, Bundling, Menu, }; export default plugin; ================================================ FILE: packages/plugin/src/legend/index.ts ================================================ import { IAbstractGraph as IGraph, GraphData, ShapeStyle } from "@antv/f6-core"; import Base from "../base"; import { isArray, isNumber, uniqueId } from "@antv/util"; import { createUI } from "@antv/f6-ui"; import { createItem } from "./item"; const ALLOW_EVENTS = ["click", "mouseenter"]; interface LegendConfig { data: GraphData; position?: | "top" | "top-left" | "top-right" | "right" | "right-top" | "right-bottom" | "left" | "left-top" | "left-bottom" | "bottom" | "bottom-left" | "bottom-right"; padding?: number | number[]; margin?: number | number[]; offsetX?: number; offsetY?: number; containerStyle?: ShapeStyle; layout?: "vertical" | "horizontal"; width?: number; height?: number; align?: "center" | "right" | "left"; title?: string; titleConfig?: { position?: "center" | "right" | "left"; offsetX?: number; offsetY?: number; [key: string]: unknown; }; itemConfig?: { width?: number; height?: number; fontSize?: number; margin?: "string"; }; filter?: { enable?: boolean; multiple?: boolean; trigger?: "click"; legendStateStyles?: { active?: ShapeStyle; inactive?: ShapeStyle; }; graphActiveState?: string; graphInactiveState?: string; filterFunctions?: { [key: string]: (d) => boolean; }; }; } /** * 不支持mouseenter */ export default class Legend extends Base { active = []; inActive = []; constructor(config?: LegendConfig) { super(config); } public getDefaultCfgs(): LegendConfig { return { data: {}, position: "top", padding: 0, margin: 0, offsetX: -10, offsetY: 0, layout: "horizontal", containerStyle: {}, align: undefined, filter: { enable: false, trigger: "click", }, itemConfig: { width: 100, height: 50, fontSize: 12, }, }; } public init() { this.formatArray("padding"); this.formatArray("margin"); const filter = this.get("filter") || {}; const multiple = filter.multiple; if (multiple) this.set("multiple", false); let align = this.get("align"); if (!align) { const positions = this.get("position").split("-"); if (positions.includes("left")) align = "left"; if (positions.includes("right")) align = "right"; else align = "center"; this.set("align", align); } setTimeout(() => { const size = this.render(); const pos = this.getContainerPos(size); this.get("graph").get("uiGroup").translate(pos.left, pos.top); this.bindEvents(); }); } protected getContainerPos(size: number[] = [0, 0]) { const self = this; const graph: IGraph = self.get("graph"); const offsetX = this.get("offsetX"); const offsetY = this.get("offsetY"); const margin = this.get("margin"); const positions = this.get("position").split("-"); const posIdxMap = { top: 0, right: 1, bottom: 2, left: 3 }; const x = 0, y = 0; const containerCSS: any = { left: (graph.getWidth() - size[0]) / 2 + x, top: (graph.getHeight() - size[1]) / 2 + y, }; positions.forEach((pos) => { let marginValue = margin[posIdxMap[pos]]; let key = pos; switch (pos) { case "top": marginValue += y; break; case "left": marginValue += x; break; case "bottom": marginValue = graph.getHeight() - size[1] - marginValue + y; key = "top"; break; default: marginValue = graph.getWidth() - size[0] - marginValue + x; key = "left"; break; } containerCSS[key] = marginValue; }); containerCSS.top += offsetY; containerCSS.left += offsetX; Object.keys(containerCSS).forEach((key) => { containerCSS[key] = `${containerCSS[key]}`; }); return containerCSS; } // class-methods-use-this public bindEvents() { const self = this; const filter = self.get("filter"); if (!filter || !filter.enable) return; let trigger = filter.trigger || "click"; if (!ALLOW_EVENTS.includes(trigger)) { console.warn( "Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default.", ); trigger = "click"; } const ui = this.get("legendUI"); ui.on("tap", (e) => { if (e?.uiNode?.getAttribute("class") === "node-container") { self.filterData(e.uiNode); } else { self.clearFilter(); self.clearActiveLegend(); } }); } /** * 更新 legend 数据,开放给用户控制 * @param param */ public changeData(data: GraphData) { this.set("data", data); const size = this.render(); const pos = this.getContainerPos(size); this.get("graph").get("uiGroup").translate(pos.left, pos.top); } goActive(node) { this.goDefault(node); const filter = this.get("filter"); const stateStyles = filter?.lengedStateStyles || {}; const legendActive = stateStyles?.active || { stroke: "#000", lineWidth: 2, "text-shape": { fontWeight: "bold", opacity: 1, }, }; node.query("shape").setStyle("borderColor", legendActive.stroke); node.query("shape").setStyle("borderWidth", legendActive.lineWidth); node .query("text") .setStyle("fontWeight", legendActive["text-shape"].fontWeight); node.query("text").setStyle("opacity", legendActive["text-shape"].opacity); this.active.push(node); this.inActive.includes(node) && this.inActive.splice(this.inActive.indexOf(node), 1); } goDefault(node) { const originStyle = node.getAttribute("orignStyle"); node.query("shape").setStyle("borderColor", originStyle.stroke); node.query("shape").setStyle("opacity", 1); node.query("shape").setStyle("borderWidth", originStyle.lineWidth || 1); node.query("text").setStyle("fontWeight", "normal"); node.query("text").setStyle("opacity", 1); } goInActive(node) { this.goDefault(node); const filter = this.get("filter"); const stateStyles = filter?.lengedStateStyles || {}; const legendInactive = stateStyles?.inactive || { opacity: 0.5, "text-shape": { opacity: 0.5, }, }; node.query("shape").setStyle("opacity", legendInactive.opacity); node .query("text") .setStyle("opacity", legendInactive["text-shape"].opacity); this.inActive.push(node); this.active.includes(node) && this.active.splice(this.active.indexOf(node), 1); } public activateLegend(node) { const filter = this.get("filter"); const multiple = filter?.multiple; if (!multiple) this.clearActiveLegend(); if (this.active.includes(node)) return; const ui = this.get("legendUI"); const nodes = ui.queryAll(".node-container"); this.goActive(node); nodes.forEach((node) => { if (this.active.includes(node)) return; this.goInActive(node); }); } public clearActiveLegend() { const ui = this.get("legendUI"); const nodes = ui.queryAll(".node-container"); nodes.forEach((node) => { this.goDefault(node); }); this.active = []; this.inActive = []; } /** * 高亮和置灰图例,并过滤主图元素 * @param param */ public filterData(activeNode) { const filter = this.get("filter"); const filterFunctions = filter?.filterFunctions; if (!filter || !filterFunctions) return; const graph = this.get("graph"); const activeState = filter.graphActiveState || "active"; const inactiveState = filter.graphInactiveState || "inactive"; const multiple = filter.multiple; this.clearFilter(); if (!multiple) this.clearActiveLegend(); if (this.active.includes(activeNode)) { this.goInActive(activeNode); } else { // 设置 legend 的高亮状态 this.activateLegend(activeNode); } if (this.active.length === 0) { const ui = this.get("legendUI"); ui.queryAll(".node-container").forEach((child) => this.goDefault(child)); } let activeCount = 0; const typeFuncs = ["getNodes", "getEdges"]; typeFuncs.forEach((typeFunc) => { graph[typeFunc]().forEach((graphItem) => { let active = false; this.active.forEach((node) => { const func = filterFunctions[node.getAttribute("legendId")]; active = active || func(graphItem.getModel()); }); if (active) { graph.setItemState(graphItem, inactiveState, false); graph.setItemState(graphItem, activeState, true); activeCount++; } else { graph.setItemState(graphItem, activeState, false); graph.setItemState(graphItem, inactiveState, true); } }); }); if (!activeCount) typeFuncs.forEach((typeFunc) => { graph[typeFunc]().forEach((graphItem) => { graph.clearItemStates(graphItem, [inactiveState]); }); }); } /** * 清除主图相关状态 * @param param */ public clearFilter() { // 清除 legend 的高亮状态 const graph = this.get("graph"); const filter = this.get("filter"); if (!filter) return; const activeState = filter.graphActiveState || "active"; const inactiveState = filter.graphInactiveState || "inactive"; graph.getNodes().forEach((node) => { graph.clearItemStates(node, [activeState, inactiveState]); }); graph.getEdges().forEach((edge) => { graph.clearItemStates(edge, [activeState, inactiveState]); }); } /** * 渲染 legend 图 * @param param */ protected render(): number[] { this.processData(); const itemsData = this.get("itemsData"); const itemTypes = ["nodes", "edges"]; // 创建单个节点 let nodes = [[], []]; itemTypes.forEach((itemType, i) => { itemsData[itemType].forEach((data) => { const style = this.getStyle(itemType.substr(0, 4), data); nodes[i].push(createItem(data, style, this.get("itemConfig"))); }); }); // 创建title const title = this.get("title"); const html = `
${title && `
${title}
`}
`; const defaultTitleStyle = { fontSize: 20, fontFamily: "Arial", fontWeight: 300, textBaseline: "top", textAlign: "center", fill: "#000", }; const titleConfig = this.get("titleConfig") || {}; const titleStyle = Object.assign( defaultTitleStyle, titleConfig.style || {}, ); const containerStyle = this.get("containerStyle"); const padding = this.get("padding"); const margin = this.get("margin"); // flex-direction: ${this.get('layout') === 'vertical' ? 'column' : 'row'}; const css = ` .g6-legend-container{ width: ${this.get("width")}; height: ${this.get("height")}; padding: ${padding.join(" ")}; margin: ${margin.join(" ")}; background: ${containerStyle.fill || "#f00"}; border: ${containerStyle.lineWidth || "1"} solid ${ containerStyle.stroke || "#000" }; opacity: ${containerStyle.opacity || "0.5"} } .text-container { font-size: ${titleStyle.fontSize}; font-family: ${titleStyle.fontFamily}; font-weight: ${titleStyle.fontWeight}; text-align: ${titleStyle.textAlign}; color: ${titleStyle.fill}; height: ${titleStyle.fontSize}; background-opacity: 0; top: ${titleConfig.offsetY}; left: ${titleConfig.offsetX}; } .edge-row, .node-row { display: flex; flex-direction: ${this.get("layout") === "vertical" ? "column" : "row"}; flex-wrap: nowrap; justify-content: space-between; background-opacity: 0; } .node-wrap { flex: 1; flex-direction: ${this.get("layout") === "vertical" ? "row" : "column"}; justify-content: space-between; background-opacity: 0; } `; const ui = createUI(html, css, this.get("graph").get("uiGroup")); ui.query(".node-row").appendChild(...nodes[0]); ui.query(".edge-row").appendChild(...nodes[1]); this.set("legendUI", ui); return [ui.width, ui.height]; } protected processData() { const data = this.get("data"); const itemsData = { nodes: [], edges: [] }; if (data.nodes) { data.nodes.sort((a, b) => a.order - b.order); data.nodes.forEach((node) => { const size = node.size || [ node.style?.width || node.style?.r || 8, node.style?.height || node.style?.r || 8, ]; const labelStyle = node.labelCfg?.style || {}; itemsData.nodes.push({ id: node.id || uniqueId(), type: node.type || "circle", style: { ...node.style, }, order: node.order, label: node.label, itemType: "node", size, labelCfg: { position: "right", style: { fontFamily: "Arial", ...labelStyle, }, }, }); }); } if (data.edges) { data.edges.sort((a, b) => a.order - b.order); data.edges.forEach((edge) => { let type = edge.type || "line"; if (edge.type === "cubic-horizontal") type = "cubic"; const labelStyle = edge.labelCfg?.style || {}; const size = edge.size || [edge.style?.width || 8, 1]; itemsData.edges.push({ id: edge.id || uniqueId(), type, size, style: { lineWidth: isArray(size) ? size[1] : 1, ...edge.style, }, order: edge.order, label: edge.label, itemType: "edge", labelCfg: { position: "right", style: { fontFamily: "Arial", ...labelStyle, }, }, }); }); } this.set("itemsData", itemsData); } protected formatArray(key: string) { const value = this.get(key); if (isNumber(value)) this.set(key, [value, value, value, value]); else if (isArray(value)) { switch (value.length) { case 0: this.set(key, [0, 0, 0, 0]); break; case 1: this.set(key, [value[0], value[0], value[0], value[0]]); break; case 2: this.set(key, [value[0], value[1], value[0], value[1]]); break; case 3: this.set(key, [value[0], value[1], value[2], value[1]]); break; default: break; } } return this.get(key); } private getStyle(type, data) { const defaultStyle = type === "node" ? { fill: "#ccc", lineWidth: 0, } : { stroke: "#000", lineWidth: 1, }; return { ...defaultStyle, ...(data.style || {}), }; } public destroy() { const graph: IGraph = this.get("graph"); const graphContainer = graph.get("container"); const container: HTMLDivElement = this.get("container"); graphContainer.removeChild(container); } } ================================================ FILE: packages/plugin/src/legend/item.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; export function createItem(data, style, itemConfig) { let attrs; let shapeType = data.type; const { width, height, r } = getShapeSize(data); switch (data.type) { case "circle": attrs = { r, x: 0, y: 0 }; break; case "rect": attrs = { width, height, x: -width / 2, y: -height / 2 }; break; case "ellipse": attrs = { r1: width, r2: height, x: 0, y: 0 }; break; case "line": attrs = { x1: -width / 2, y1: 0, x2: width / 2, y2: 0 }; shapeType = "line"; break; case "quadratic": attrs = { path: [ ["M", -width / 2, 0], ["Q", 0, width / 2, width / 2, 0], ], }; shapeType = "path"; break; case "cubic": attrs = { path: [ ["M", -width / 2, 0], ["C", -width / 6, width / 2, width / 6, -width / 2, width / 2, 0], ], }; shapeType = "path"; break; default: attrs = { r, x: 0, y: 0 }; break; } const html = `
(prev += ` ${cur[0]}=${cur[1]} `), "", )} /> ${data.label && `
${data.label}
`}
`; const labelStyle = { textAlign: "begin", fontSize: 12, fill: "#000", opacity: 1, fontWeight: "normal", ...data.labelStyle, }; const css = ` .node-container { width: ${itemConfig.width}; height: ${itemConfig.height || Math.max(height, itemConfig.fontSize)}; display: flex; flex-direction: row; justify-content: center; align-items: center; background-opacity: 0; font-size: ${labelStyle.fontSize}; margin: ${itemConfig.margin} } shape { top: ${height / 2}; left: ${width / 2}; width: ${width}; height: ${height}; background: ${style.fill}; border: ${style.lineWidth || "1"} solid ${style.stroke}; margin-right: 3; } .text { flex: 1; height: ${labelStyle.fontSize + 2}; color: ${labelStyle.fill}; background-opacity: 0; pointer-events: none; text-align: ${labelStyle.textAlign}; font-weight: ${labelStyle.fontWeight} } text { opacity: ${labelStyle.opacity}; white-space: nowrap; } `; const node = createSegmentNode(html, css); return node; } function getShapeSize(data) { let width, height, r; if (data.size) { if (Array.isArray(data.size)) { width = data.size[0]; height = data.size[1] || data.size[0]; r = data.size[0] / 2; } else if (typeof data.size === "number") { width = data.size; height = data.size; r = data.size / 2; } } if (data.style) { if (data.style.width) width = data.style.width; if (data.style.height) height = data.style.height; if (data.style.r) r = data.style.r; } if (!r) r = 5; if (!width) width = r; if (!height) height = r; return { width, height, r }; } ================================================ FILE: packages/plugin/src/menu/index.ts ================================================ import { IAbstractGraph as IGraph, IG6GraphEvent, Item } from "@antv/f6-core"; import Base, { IPluginBaseConfig } from "../base"; import { createUI } from "@antv/f6-ui"; interface MenuConfig extends IPluginBaseConfig { handleMenuClick?: (target: HTMLElement, item: Item) => void; getContent?: (evt?: IG6GraphEvent) => HTMLDivElement | string; // offsetX 与 offsetY 需要加上父容器的 padding offsetX?: number; offsetY?: number; shouldBegin?: (evt?: IG6GraphEvent) => boolean; // 允许出现 tooltip 的 item 类型 itemTypes?: string[]; } export default class Menu extends Base { constructor(config?: MenuConfig) { super(config); } public getDefaultCfgs(): MenuConfig { return { offsetX: 6, offsetY: 6, handleMenuClick: undefined, // 指定菜单内容,function(e) {...} getContent: (e) => { return `
菜单项1
菜单项2
`; }, getCss() { return ` .f6-contextmenu-ul { display: flex; width: 100; border: 1 solid #e2e2e2; border-radius: 4; font-size: 12; color: #545454; padding: 10 8; background-color: rgba(255, 255, 255, 0.9); } .f6-contextmenu-li { opacity: 0; justify-content: center; text-align: center; height: 50; } `; }, shouldBegin: (e) => { return true; }, // 菜单隐藏事件 onHide() { return true; }, itemTypes: ["node", "edge", "combo"], }; } // class-methods-use-this public getEvents() { return { press: "onMenuShow", }; } public init() { const graph: IGraph = this.get("graph"); graph.on("tap", () => { this.onMenuHide(); }); } protected onMenuShow(e: IG6GraphEvent) { const self = this; e.preventDefault(); const itemTypes = this.get("itemTypes"); if (!e.item) { if (itemTypes.indexOf("canvas") === -1) { self.onMenuHide(); return; } } else { if ( e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1 ) { self.onMenuHide(); return; } } const shouldBegin = this.get("shouldBegin"); if (!shouldBegin(e)) return; const className = this.get("className"); const graph: IGraph = this.get("graph"); const uiGroup = graph.get("uiGroup"); const getContent = this.get("getContent"); const getCss = this.get("getCss"); const css = ` root { display: flex; font-size: 12; color: #545454; } text { height: 12; opacity: 1; } ${getCss?.() ?? ""} `; const menuLiHtml = getContent(e, graph); const menu = createUI( `${menuLiHtml}`, css, uiGroup, ); this.get("menu")?.remove(); this.set("menu", menu); const handleMenuClick = this.get("handleMenuClick"); if (handleMenuClick) { const handleMenuClickWrapper = (evt) => { evt.stopPropagation(); handleMenuClick(evt.uiNode?.attributes, e.item, graph); }; this.set("handleMenuClickWrapper", handleMenuClickWrapper); menu.on("tap", handleMenuClickWrapper); } const width: number = graph.get("width"); const height: number = graph.get("height"); const bbox = { width: menu.width, height: menu.height, left: menu.left, right: menu.right, }; const offsetX = this.get("offsetX") || 0; const offsetY = this.get("offsetY") || 0; let x = e.canvasX + offsetX; let y = e.canvasY + offsetY; // when the menu is (part of) out of the canvas if (x + bbox.width > width) { x = e.canvasX - bbox.width - offsetX; } if (y + bbox.height > height) { y = e.canvasY - bbox.height - offsetY; } menu.setStyle("left", x); menu.setStyle("top", y); } private onMenuHide() { const menuDom = this.get("menu"); menuDom?.remove(); } public destroy() { const menu = this.get("menu"); menu?.remove(); } } ================================================ FILE: packages/plugin/src/minimap/index.ts ================================================ import { Canvas as GCanvas, Group } from "@antv/g-mobile"; import { Event as GraphEvent, Point } from "@antv/g-base"; import { isNil, each, debounce } from "@antv/util"; import { Matrix, ShapeStyle, IAbstractGraph as IGraph } from "@antv/f6-core"; import { ext } from "@antv/matrix-util"; import Base, { IPluginBaseConfig } from "../base"; import { createUI } from "@antv/f6-ui"; const { max } = Math; const { transform } = ext; const DEFAULT_MODE = "default"; const KEYSHAPE_MODE = "keyShape"; const DELEGATE_MODE = "delegate"; interface MiniMapConfig extends IPluginBaseConfig { viewportClassName?: string; className?: string; type?: "default" | "keyShape" | "delegate"; size?: number[]; delegateStyle?: ShapeStyle; refresh?: boolean; padding?: number; getCss?: Function; } export default class MiniMap extends Base { constructor(config?: MiniMapConfig) { super(config); } this: IGraph; public getDefaultCfgs(): MiniMapConfig { return { container: null, className: "", viewportClassName: "", // Minimap 中默认展示和主图一样的内容,KeyShape 只展示节点和边的 key shape 部分,delegate表示展示自定义的rect,用户可自定义样式 type: "default", padding: 50, size: [200, 120], delegateStyle: { fill: "#40a9ff", stroke: "#096dd9", }, refresh: true, }; } public getEvents() { return { beforepaint: "updateViewport", beforeanimate: "disableRefresh", afteranimate: "enableRefresh", viewportchange: "disableOneRefresh", }; } // 若是正在进行动画,不刷新缩略图 protected disableRefresh() { this.set("refresh", false); } protected enableRefresh() { this.set("refresh", true); this.updateCanvas(); } protected disableOneRefresh() { this.set("viewportChange", true); } private initViewport() { const cfgs: MiniMapConfig = this._cfgs as MiniMapConfig; const { size, graph } = cfgs; if (this.destroyed) return; // viewport 就是minimap的缩略图 拖拽方框 小程序模式下 不能使用createDom 使用createUi替代 const handleUI = this.get("container").query(".viewport"); // 计算拖拽水平方向距离 let x = 0; // 计算拖拽垂直方向距离 let y = 0; // 是否在拖拽minimap的视口 let dragging = false; // 缓存viewport当前对于画布的x let left = 0; // 缓存viewport当前对于画布的y let top = 0; // 缓存viewport当前宽度 let width = 0; // 缓存viewport当前高度 let height = 0; let ratio = 0; let zoom = 0; // 拖拽start事件 handleUI.on("panstart", (e: GraphEvent) => { cfgs.refresh = false; // 如果视口已经最大了,不需要拖拽 left = parseInt(handleUI.getStyle("left"), 10); top = parseInt(handleUI.getStyle("top"), 10); width = parseInt(handleUI.getStyle("width"), 10); height = parseInt(handleUI.getStyle("height"), 10); if (width > size[0] || height > size[1]) { return; } zoom = graph!.getZoom(); ratio = this.get("ratio"); dragging = true; x = e.x; y = e.y; }); handleUI.on( "panmove", (e: GraphEvent) => { if (!dragging || isNil(e.x) || isNil(e.y)) { return; } let dx = x - e.x; let dy = y - e.y; // 若视口移动到最左边或最右边了,仅移动到边界 if (left - dx < 0 || left - dx + width >= size[0]) { dx = 0; } // 若视口移动到最上或最下边了,仅移动到边界 if (top - dy < 0 || top - dy + height >= size[1]) { dy = 0; } left -= dx; top -= dy; // graph 移动需要偏移量 dx/dy * 缩放比例才会得到正确的移动距离 graph!.translate((dx * zoom) / ratio, (dy * zoom) / ratio); x = e.x; y = e.y; }, false, ); handleUI.on( "panend", () => { dragging = false; cfgs.refresh = true; }, false, ); this.set("viewport", handleUI); // 这里viewport的 key 先保留,下面继续使用 } /** * 更新 viewport 视图 */ private updateViewport() { if (this.destroyed) return; const ratio: number = this.get("ratio"); const totaldx: number = this.get("totaldx"); const totaldy: number = this.get("totaldy"); const graph: IGraph = this.get("graph"); const size: number[] = this.get("size"); const graphWidth = graph.get("width"); const graphHeight = graph.get("height"); const topLeft: Point = graph.getPointByCanvas(0, 0); const bottomRight: Point = graph.getPointByCanvas(graphWidth, graphHeight); const viewport = this.get("viewport"); // viewport宽高,左上角点的计算 let width = (bottomRight.x - topLeft.x) * ratio; let height = (bottomRight.y - topLeft.y) * ratio; let left = topLeft.x * ratio + totaldx; let top = topLeft.y * ratio + totaldy; const right = left + width; const bottom = top + height; if (left < 0) { width += left; left = 0; } if (right >= size[0]) { width = width - (right - size[0]); } if (top < 0) { height += top; top = 0; } if (bottom > size[1]) { height = height - (bottom - size[1]); } // 缓存目前缩放比,在移动 minimap 视窗时就不用再计算大图的移动量 this.set("ratio", ratio); if (viewport) { const borderWidth = viewport.getStyle("borderWidth"); if (Math.floor(width) >= borderWidth * 2) { viewport.setStyle("left", left); viewport.setStyle("width", width); } if (Math.floor(height) >= borderWidth * 2) { viewport.setStyle("top", top); viewport.setStyle("height", height); } } } /** * 将主图上的图形完全复制到小图 */ private updateGraphShapes() { const { graph } = this._cfgs; const graphGroup = graph!.get("group"); if (graphGroup.destroyed) return; const clonedGroup = graphGroup.clone(); const groupCanvas = this.get("groupCanvas"); clonedGroup.resetMatrix(); groupCanvas.clear(); groupCanvas.add(clonedGroup); } // 仅在 minimap 上绘制 keyShape // FIXME 如果用户自定义绘制了其他内容,minimap上就无法画出 private updateKeyShapes() { const { graph } = this._cfgs; const group = this.get("groupCanvas"); // canvas.get('children')[0] || canvas.addGroup(); each(graph!.getEdges(), (edge) => { this.updateOneEdgeKeyShape(edge, group); }); each(graph!.getNodes(), (node) => { this.updateOneNodeKeyShape(node, group); }); const combos = graph!.getCombos(); if (combos && combos.length) { const comboGroup = group.find((e) => e.get("name") === "comboGroup") || group.addGroup({ name: "comboGroup", }); setTimeout(() => { if (this.destroyed) return; each(combos, (combo) => { this.updateOneComboKeyShape(combo, comboGroup); }); comboGroup?.sort(); comboGroup?.toBack(); this.updateCanvas(); }, 250); } this.clearDestroyedShapes(); } /** * 增加/更新单个元素的 keyShape * @param item ICombo 实例 */ private updateOneComboKeyShape(item, comboGroup) { if (this.destroyed) return; const itemMap = this.get("itemMap") || {}; // 差量更新 minimap 上的一个节点,对应主图的 item let mappedItem = itemMap[item.get("id")]; const bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox const cKeyShape = item.get("keyShape").clone(); const keyShapeStyle = cKeyShape.attr(); let attrs: any = { x: bbox.centerX, y: bbox.centerY, }; if (!mappedItem) { mappedItem = cKeyShape; comboGroup.add(mappedItem); } else { attrs = Object.assign(keyShapeStyle, attrs); } const shapeType = mappedItem.get("type"); if (shapeType === "rect" || shapeType === "image") { attrs.x = bbox.minX; attrs.y = bbox.minY; } mappedItem.attr(attrs); if (!item.isVisible()) mappedItem.hide(); else mappedItem.show(); mappedItem.exist = true; const zIndex = item.getModel().depth; if (!isNaN(zIndex)) mappedItem.set("zIndex", zIndex); itemMap[item.get("id")] = mappedItem; this.set("itemMap", itemMap); } /** * 增加/更新单个元素的 keyShape * @param item INode 实例 */ private updateOneNodeKeyShape(item, group) { const itemMap = this.get("itemMap") || {}; // 差量更新 minimap 上的一个节点,对应主图的 item let mappedItem = itemMap[item.get("id")]; const bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox const cKeyShape = item.get("keyShape").clone(); const keyShapeStyle = cKeyShape.attr(); let attrs: any = { x: bbox.centerX, y: bbox.centerY, }; if (!mappedItem) { mappedItem = cKeyShape; group.add(mappedItem); } else { attrs = Object.assign(keyShapeStyle, attrs); } const shapeType = mappedItem.get("type"); if (shapeType === "rect" || shapeType === "image") { attrs.x = bbox.minX; attrs.y = bbox.minY; } mappedItem.attr(attrs); if (!item.isVisible()) mappedItem.hide(); else mappedItem.show(); mappedItem.exist = true; const zIndex = item.getModel().depth; if (!isNaN(zIndex)) mappedItem.set("zIndex", zIndex); itemMap[item.get("id")] = mappedItem; this.set("itemMap", itemMap); } /** * Minimap 中展示自定义的rect,支持用户自定义样式和节点大小 */ private updateDelegateShapes() { const { graph } = this._cfgs; const group = this.get("groupCanvas"); // 差量更新 minimap 上的节点和边 each(graph!.getEdges(), (edge) => { this.updateOneEdgeKeyShape(edge, group); }); each(graph!.getNodes(), (node) => { this.updateOneNodeDelegateShape(node, group); }); const combos = graph!.getCombos(); if (combos && combos.length) { const comboGroup = group.find((e) => e.get("name") === "comboGroup") || group.addGroup({ name: "comboGroup", }); setTimeout(() => { if (this.destroyed) return; each(combos, (combo) => { this.updateOneComboKeyShape(combo, comboGroup); }); comboGroup?.sort(); comboGroup?.toBack(); this.updateCanvas(); }, 250); } this.clearDestroyedShapes(); } private clearDestroyedShapes() { const itemMap = this.get("itemMap") || {}; const keys = Object.keys(itemMap); if (!keys || keys.length === 0) return; for (let i = keys.length - 1; i >= 0; i--) { const shape = itemMap[keys[i]]; const exist = shape.exist; shape.exist = false; if (!exist) { shape.remove(); delete itemMap[keys[i]]; } } } /** * 设置只显示 edge 的 keyShape * @param item IEdge 实例 */ private updateOneEdgeKeyShape(item, group) { const itemMap = this.get("itemMap") || {}; // 差量更新 minimap 上的一个节点,对应主图的 item let mappedItem = itemMap[item.get("id")]; if (mappedItem) { const path = item.get("keyShape").attr("path"); mappedItem.attr("path", path); } else { mappedItem = item.get("keyShape").clone(); group.add(mappedItem); } if (!item.isVisible()) mappedItem.hide(); else mappedItem.show(); mappedItem.exist = true; itemMap[item.get("id")] = mappedItem; this.set("itemMap", itemMap); } /** * Minimap 中展示自定义的 rect,支持用户自定义样式和节点大小 * 增加/更新单个元素 * @param item INode 实例 */ private updateOneNodeDelegateShape(item, group) { const delegateStyle = this.get("delegateStyle"); const itemMap = this.get("itemMap") || {}; // 差量更新 minimap 上的一个节点,对应主图的 item let mappedItem = itemMap[item.get("id")]; const bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox if (mappedItem) { const attrs = { x: bbox.minX, y: bbox.minY, width: bbox.width, height: bbox.height, }; mappedItem.attr(attrs); } else { mappedItem = group.addShape("rect", { attrs: { x: bbox.minX, y: bbox.minY, width: bbox.width, height: bbox.height, ...delegateStyle, }, name: "minimap-node-shape", }); } if (!item.isVisible()) mappedItem.hide(); else mappedItem.show(); mappedItem.exist = true; itemMap[item.get("id")] = mappedItem; this.set("itemMap", itemMap); } /** * 主图更新的监听函数,使用 debounce 减少渲染频率 * e.g. 拖拽节点只会在松手后的 100ms 后执行 updateCanvas * e.g. render 时大量 addItem 也只会执行一次 updateCanvas */ private handleUpdateCanvas = debounce( (event) => { const self = this; if (self.destroyed) return; self.updateCanvas(); }, 100, false, ); public init() { this.get("graph").on("afterupdateitem", this.handleUpdateCanvas); this.get("graph").on("afteritemstatechange", this.handleUpdateCanvas); this.get("graph").on("afteradditem", this.handleUpdateCanvas); this.get("graph").on("afterremoveitem", this.handleUpdateCanvas); this.get("graph").on("afterrender", this.handleUpdateCanvas); this.get("graph").on("afterlayout", this.handleUpdateCanvas); setTimeout(() => { this.initContainer(); }); } /** * 初始化 Minimap 的容器 */ public initContainer() { const self = this; const graph: IGraph = self.get("graph"); const size: number[] = self.get("size"); const className: string = self.get("className"); const viewportClassName: string = self.get("viewportClassName"); const getCss = self.get("getCss"); const containerHtml = `
`; const containerCss = ` root { width: ${graph.getWidth()}; height: ${graph.getHeight()}; opacity: 0; pointer-events: none; } .f6-minimap{ position: absolute; left: 0; bottom: 0; width: ${size[0]}; height: ${size[1]}; } .f6-minimap-container{ position: relative; background: rgba(0,0,0,0); width: ${size[0]}; height: ${size[1]}; } .viewport{ position: absolute; border: 3 solid blue; width: 100; height: 100; background: rgba(0,0,0,0); z-index: 1000; } ${getCss?.() ?? ""} `; const uiGroup = graph.get("uiGroup"); const miniMapContainerUI = createUI(containerHtml, containerCss, uiGroup); const background = miniMapContainerUI.query(".f6-minimap-container"); const group = background.gNode; const canvasGroup = group.addGroup(); this.set("groupCanvas", canvasGroup); this.set("container", miniMapContainerUI); self.updateCanvas(); this.initViewport(); } public updateCanvas() { if (this.destroyed) return; // 如果是在动画,则不刷新视图 const isRefresh: boolean = this.get("refresh"); if (!isRefresh) { return; } const graph: IGraph = this.get("graph"); if (graph.get("destroyed")) { return; } // 如果是视口变换,也不刷新视图,但是需要重置视口大小和位置 if (this.get("viewportChange")) { this.set("viewportChange", false); this.updateViewport(); } const size: number[] = this.get("size"); // 用户定义的 minimap size const type: string = this.get("type"); // minimap 的类型 const padding: number = this.get("padding"); // 用户额定义的 minimap 的 padding switch (type) { case DEFAULT_MODE: this.updateGraphShapes(); break; case KEYSHAPE_MODE: this.updateKeyShapes(); break; case DELEGATE_MODE: // 得到的节点直接带有 x 和 y,每个节点不存在父 group,即每个节点位置不由父 group 控制 this.updateDelegateShapes(); break; default: break; } const group = this.get("groupCanvas"); // canvas.get('children')[0]; if (!group) return; group.resetMatrix(); // 重新计算所有子节点的matrix,从group开始重新计算totalmatrix,重置传递下来的matrix,保证计算canvasBBox的时候,相对左上角 group.applyMatrix([1, 0, 0, 0, 1, 0, 0, 0, 1]); const bbox = group.getCanvasBBox(); const graphBBox = graph.get("group").getCanvasBBox(); // 主图的 bbox const graphZoom = graph.getZoom() || 1; let width = graphBBox.width / graphZoom; let height = graphBBox.height / graphZoom; if (Number.isFinite(bbox.width)) { // 刷新后bbox可能会变,需要重置画布矩阵以缩放到合适的大小 width = max(bbox.width, width); height = max(bbox.height, height); } width += 2 * padding; height += 2 * padding; const ratio = Math.min(size[0] / width, size[1] / height); let matrix: Matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; let minX = 0; let minY = 0; // 平移到左上角 if (Number.isFinite(bbox.minX)) { minX = -bbox.minX; } if (Number.isFinite(bbox.minY)) { minY = -bbox.minY; } // 缩放到适合视口后, 平移到画布中心 const dx = (size[0] - (width - 2 * padding) * ratio) / 2; const dy = (size[1] - (height - 2 * padding) * ratio) / 2; matrix = transform(matrix, [ ["t", minX, minY], // 平移到左上角 ["s", ratio, ratio], // 缩放到正好撑着 minimap ["t", dx, dy], // 移动到画布中心 ]); group.setMatrix(matrix); // 更新minimap视口 this.set("ratio", ratio); this.set("totaldx", dx + minX * ratio); this.set("totaldy", dy + minY * ratio); this.set("dx", dx); this.set("dy", dy); this.updateViewport(); } /** * 获取minimap的画布 * @return {GCanvas} G的canvas实例 */ public getCanvas(): GCanvas { return this.get("canvas"); } /** * 获取minimap的窗口 * @return {HTMLElement} 窗口的dom实例 */ public getViewport(): HTMLElement { return this.get("viewport"); } /** * 获取minimap的容器dom * @return {HTMLElement} dom */ public getContainer(): HTMLElement { return this.get("container"); } public destroy() { this.get("container")?.remove(); } } ================================================ FILE: packages/plugin/src/snap-line/index.ts ================================================ import { each, mix } from "@antv/util"; import { IAbstractGraph as IGraph, ShapeStyle, Util } from "@antv/f6-core"; import Base, { IPluginBaseConfig } from "../base"; const { pointLineDistance } = Util; interface SnapLineConfig extends IPluginBaseConfig { // 辅助线的样式 line?: ShapeStyle; // 辅助线类型,true 表示双向 itemAlignType?: boolean | "horizontal" | "vertical" | "center"; } // 对齐线样式 const alignLineStyle = { stroke: "#FA8C16", lineWidth: 1, }; export default class SnapLine extends Base { constructor(props?: SnapLineConfig) { super(props); } public getDefaultCfgs() { return { line: alignLineStyle, /** * item align type * @type {String|True|False} */ itemAlignType: "center", // true || false || 'horizontal' || 'vertical' || 'center', /** * tolerance to item force align * @type {String|True|False} */ tolerance: 5, horizontalLines: {}, verticalLines: {}, alignLines: [], }; } public init() {} // class-methods-use-this public getEvents() { return { "node:dragstart": "onDragStart", "node:drag": "onDrag", "node:dragend": "onDragEnd", }; } onDragStart() { this.initBoxLine(); } onDrag(e) { const { item } = e; // 计算辅助线位置,拖动过程中更新辅助线 const delegateShape = item.get("delegateShape") || item; const bbox = delegateShape.getBBox(); const model = item.getModel(); const dx = model.x - bbox.x; const dy = model.y - bbox.y; this.show( { x: bbox.minX + dx, y: bbox.minY + dy, }, { width: bbox.width, height: bbox.height, }, ); } onDragEnd() { // 拖动结束时候删除辅助线 this.destory(); } /** * 每次开始拖动之前,计算出所有节点在水平和垂直方向上,左中右三条中线,并缓存起来 * * @param {object} item Node节点 * @memberof AlignLine */ initBoxLine() { const { horizontalLines, verticalLines, itemAlignType } = this._cfgs; const graph: IGraph = this.get("graph"); const nodes = graph.getNodes(); nodes.forEach((item) => { const bbox = item.getBBox(); const nodeId = item.get("id"); // 设置水平方向辅助线 if (itemAlignType === true || itemAlignType === "horizontal") { // tltr: top left top right // lcrc: left center right center // blbr: bottom left bottom right horizontalLines[`${nodeId}tltr`] = [ bbox.minX, bbox.minY, bbox.maxX, bbox.minY, item, ]; horizontalLines[`${nodeId}lcrc`] = [ bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item, ]; horizontalLines[`${nodeId}blbr`] = [ bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY, item, ]; } else if (itemAlignType === "center") { horizontalLines[`${nodeId}lcrc`] = [ bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item, ]; } // 设置垂直方向辅助线 if (itemAlignType === true || itemAlignType === "vertical") { // tlbl: top left bottom left // tcbc: top center bottom center // trbr: top right bottom right verticalLines[`${nodeId}tlbl`] = [ bbox.minX, bbox.minY, bbox.minX, bbox.maxY, item, ]; verticalLines[`${nodeId}tcbc`] = [ bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item, ]; verticalLines[`${nodeId}trbr`] = [ bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY, item, ]; } else if (itemAlignType === "center") { verticalLines[`${nodeId}tcbc`] = [ bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item, ]; } }); } /** * 显示AlignLine * * @param {object} point 起始点 * @param {object} bbox BBox * @returns * @memberof AlignLine */ show(point, bbox) { const originPoint = mix({}, point); this.itemAlign(point, bbox, originPoint); return point; } /** * 拖动拖出中添加辅助线 * * @param {object} point 起始点 * @param {object} bbox 代理形状的bbox * @param {object} originPoint 原始点,同point * @memberof AlignLine */ private itemAlign(point, bbox, originPoint) { const { horizontalLines, verticalLines, tolerance } = this._cfgs; const tc = { x: originPoint.x + bbox.width / 2, y: originPoint.y, }; const cc = { x: originPoint.x + bbox.width / 2, y: originPoint.y + bbox.height / 2, }; const bc = { x: originPoint.x + bbox.width / 2, y: originPoint.y + bbox.height, }; const lc = { x: originPoint.x, y: originPoint.y + bbox.height / 2, }; const rc = { x: originPoint.x + bbox.width, y: originPoint.y + bbox.height / 2, }; const horizontalDis = []; const verticalDis = []; let alignCfg = null; this.clearAlignLine(); each(horizontalLines, (line) => { if (line[4].isVisible) { horizontalDis.push(this.getLineDisObject(line, tc)); horizontalDis.push(this.getLineDisObject(line, cc)); horizontalDis.push(this.getLineDisObject(line, bc)); } }); each(verticalLines, (line) => { if (line[4].isVisible) { verticalDis.push(this.getLineDisObject(line, lc)); verticalDis.push(this.getLineDisObject(line, cc)); verticalDis.push(this.getLineDisObject(line, rc)); } }); horizontalDis.sort((a, b) => { return a.dis - b.dis; }); verticalDis.sort((a, b) => { return a.dis - b.dis; }); if (horizontalDis.length !== 0 && horizontalDis[0].dis < tolerance) { point.y = horizontalDis[0].line[1] - horizontalDis[0].point.y + originPoint.y; alignCfg = { type: "item", horizontals: [horizontalDis[0]], }; for (let i = 1; i < 3; i++) { if (horizontalDis[0].dis === horizontalDis[i].dis) { alignCfg.horizontals.push(horizontalDis[i]); } } } if (verticalDis.length !== 0 && verticalDis[0].dis < tolerance) { point.x = verticalDis[0].line[0] - verticalDis[0].point.x + originPoint.x; if (!alignCfg) { alignCfg = { type: "item", verticals: [verticalDis[0]], }; } else { alignCfg.verticals = [verticalDis[0]]; } for (let i = 1; i < 3; i++) { if (verticalDis[0].dis === verticalDis[i].dis) { alignCfg.verticals.push(verticalDis[i]); } } } if (alignCfg) { alignCfg.bbox = bbox; this.addAlignLine(alignCfg); } } /** * 根据配置项添加辅助线 * * @param {object} cfg * @memberof AlignLine */ private addAlignLine(cfg) { const { bbox, type, horizontals, verticals } = cfg; const { line: lineStyle, alignLines } = this._cfgs; const graph: IGraph = this.get("graph"); const group = graph.get("group"); if (type === "item") { if (horizontals) { each(horizontals, (horizontal) => { const { line: refLine, point: refPoint } = horizontal; const lineCenterX = (refLine[0] + refLine[2]) / 2; let x1; let x2; if (refPoint.x < lineCenterX) { x1 = refPoint.x - bbox.width / 2; x2 = Math.max(refLine[0], refLine[2]); } else { x1 = refPoint.x + bbox.width / 2; x2 = Math.min(refLine[0], refLine[2]); } const lineAttrs = mix( { x1, y1: refLine[1], x2, y2: refLine[1], }, lineStyle, ); const line = group.addShape("line", { attrs: lineAttrs, capture: false, }); alignLines.push(line); }); } if (verticals) { each(verticals, (vertical) => { const { line: refLine, point: refPoint } = vertical; const lineCenterY = (refLine[1] + refLine[3]) / 2; let y1; let y2; if (refPoint.y < lineCenterY) { y1 = refPoint.y - bbox.height / 2; y2 = Math.max(refLine[1], refLine[3]); } else { y1 = refPoint.y + bbox.height / 2; y2 = Math.min(refLine[1], refLine[3]); } const lineAtts = mix( { x1: refLine[0], y1, x2: refLine[0], y2, }, lineStyle, ); const line = group.addShape("line", { attrs: lineAtts, capture: false, }); alignLines.push(line); }); } } } /** * 获取点到线的距离 * * @param {array} line [x1, y1, x2, y2] 线的四个点 * @param {object} point 点的x和y坐标点 {x, y} * @returns * @memberof AlignLine */ private getLineDisObject(line, point) { return { line, point, dis: pointLineDistance(line, point), }; } public getContainer(): HTMLDivElement { return this.get("container"); } /** * 拖动过程中,清楚上次绘制的线 * * @memberof AlignLine */ clearAlignLine() { const { alignLines } = this._cfgs; each(alignLines, (line) => { line.remove(); }); alignLines.length = 0; } /** * 拖动结束时候,情况缓存的节点的辅助线,同时删除绘制的线 * * @memberof AlignLine */ public destory() { const { horizontalLines, verticalLines } = this._cfgs; const graph: IGraph = this.get("graph"); const nodes = graph.getNodes(); nodes.forEach((node) => { const itemId = node.get("id"); delete horizontalLines[`${itemId}tltr`]; delete horizontalLines[`${itemId}lcrc`]; delete horizontalLines[`${itemId}blbr`]; delete verticalLines[`${itemId}tlbl`]; delete verticalLines[`${itemId}tcbc`]; delete verticalLines[`${itemId}trbr`]; }); this.clearAlignLine(); } } ================================================ FILE: packages/plugin/src/time-bar/dispatcher.ts ================================================ let events = {}; export function dispatch(key, ...args) { const fns = events[key]; fns?.forEach((fn) => { fn.apply(null, args); }); } export function subscribe(key, fn) { events[key] = [...(events[key] || []), fn]; } export function unsubscribe(key, fn) { if (!fn) { delete events[key]; return; } if (events[key]) { const index = events[key]?.indexOf(fn); index > -1 && events[key].splice(index, 1); } } export function unsubscribeAll() { events = {}; } ================================================ FILE: packages/plugin/src/time-bar/index.ts ================================================ import { createSimpleTimeBarUI, createTickUI, createTrendUI } from "./ui"; import PluginBase, { IPluginBaseConfig } from "../base"; import { throttle } from "@antv/util"; import { IAbstractGraph, TimeBarType } from "@antv/f6-core"; import { subscribe, unsubscribeAll } from "./dispatcher"; import { SLIDER_END, SLIDER_START } from "./utils/const"; import { SliderOption, SliderTick, TrendConfig } from "./type/slider"; import { TimeBarTickOption } from "./type/tick"; import { ControllerCfg } from "./type/control-bar"; interface TimeBarConfig extends IPluginBaseConfig { // position size readonly width?: number; readonly padding?: number; readonly type?: TimeBarType; // 趋势图配置项 readonly trend?: TrendConfig; // 滑块、及前后背景的配置 readonly slider?: SliderOption; // tick 类型配置项,或 trend 和 simple 类型的时间刻度配置项 readonly tick?: TimeBarTickOption; // 控制按钮 readonly controllerCfg?: ControllerCfg; readonly sliderTick?: SliderTick; // 是否过滤边,若为 true,则需要配合边数据上有 date 字段,过滤节点同时将不满足 date 在选中范围内的边也过滤出去 // 若为 false,则仅过滤节点以及两端节点都被过滤出去的边 readonly filterEdge?: boolean; rangeChange?: ( graph: IAbstractGraph, minValue: string, maxValue: string, ) => void; } export default class TimeBar extends PluginBase { private cacheGraphData; constructor(cfg: TimeBarConfig) { super(cfg); } public getDefaultCfgs(): TimeBarConfig { return { className: "f6-component-timebar", padding: 10, type: "trend", data: [], trend: { smooth: true, }, controllerCfg: { speed: 1, }, slider: { start: SLIDER_START, end: SLIDER_END, }, tick: { start: SLIDER_START, end: SLIDER_END, }, filterEdge: false, }; } init() { setTimeout(() => { this.render(); this.initEvent(); }); } filterData(evt) { const { value } = evt; let trendData = this.get("data"); if (!trendData || trendData.length === 0) { console.warn("请配置 TimeBar 组件的数据"); return; } const rangeChange = this.get("rangeChange"); const graph = this.get("graph"); let min = Math.round(trendData.length * value[0]); let max = Math.round(trendData.length * value[1]); max = max >= trendData.length ? trendData.length - 1 : max; min = min >= trendData.length ? trendData.length - 1 : min; const tickLabelFormatter = this._cfgs.tick?.tickLabelFormatter; const minText = tickLabelFormatter ? tickLabelFormatter(trendData[min]) : trendData[min].date; const maxText = tickLabelFormatter ? tickLabelFormatter(trendData[max]) : trendData[max].date; if (rangeChange) { rangeChange(graph, minText, maxText); } else { // 自动过滤数据,并渲染 graph if ( !this.cacheGraphData || (this.cacheGraphData.nodes && this.cacheGraphData.nodes.length === 0) ) { this.cacheGraphData = graph.get("data"); // graph.save() as GraphData; } // 过滤不在 min 和 max 范围内的节点 const filterData = this.cacheGraphData.nodes.filter( (d: any) => d.date >= trendData[min].date && d.date <= trendData[max].date, ); const nodeIds = filterData.map((node) => node.id); let fileterEdges = []; if (this.cacheGraphData.edges) { // 过滤 source 或 target 不在 min 和 max 范围内的边 fileterEdges = this.cacheGraphData.edges.filter( (edge) => nodeIds.includes(edge.source) && nodeIds.includes(edge.target), ); if (this.get("filterEdge")) { fileterEdges = fileterEdges.filter( (edge) => edge.date >= trendData[min].date && edge.date <= trendData[max].date, ); } } graph.changeData({ nodes: filterData, edges: fileterEdges, }); } } private render() { const { data, width, padding, type, trend, slider, controllerCfg, tick, sliderTick, } = this._cfgs; const graph = this.get("graph"); const group = graph.get("uiGroup"); let timebar = null; switch (type) { case "trend": timebar = createTrendUI({ group, width, padding, data, trend, slider, controllerCfg, sliderTick, }); break; case "tick": timebar = createTickUI({ group, width, padding, tick, data, controllerCfg, }); break; case "simple": timebar = createSimpleTimeBarUI({ group, width, padding, slider, data, controllerCfg, sliderTick, }); break; } // 移动到左下角 const graphHeight = graph.get("height"); group.translate(0, graphHeight - timebar.height); } private initEvent() { subscribe( "RANGE_CHANGE", throttle(this.filterData.bind(this), 200, { trailing: true, leading: true, }), ); } destroy() { unsubscribeAll(); } } ================================================ FILE: packages/plugin/src/time-bar/type/control-bar.ts ================================================ import { ShapeStyle } from "@antv/f6-core"; export type ControllerCfg = Partial<{ readonly wrapperWidth: number; readonly contentWidth: number; readonly height: number; /** 控制器背景的颜色和描边色 */ readonly fill?: string; readonly stroke?: string; /** 整个控制栏的字体样式,优先级低于各个子控制器的 text 内的 fontFamily */ readonly fontFamily?: string; /** 控制栏缩放比例 */ readonly scale?: number; /** 播放速度,1 个 tick 花费时间 */ readonly speed?: number; /** 是否循环播放 */ // readonly loop?: boolean; // readonly hideTimeTypeController: boolean; /** ‘上一帧’按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly preBtnStyle?: ShapeStyle; /** ‘下一帧’按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly nextBtnStyle?: ShapeStyle; /** ‘播放’ 与 ‘暂停’ 按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly playBtnStyle?: ShapeStyle; // /** 播放时间类型切换器单一文本时的文本,默认为‘单一时间’ */ // readonly timePointControllerText?: string; // /** 播放时间类型切换器单一文本时的文本,默认为‘时间范围’ */ // readonly timeRangeControllerText?: string; }>; ================================================ FILE: packages/plugin/src/time-bar/type/slider.ts ================================================ import { ShapeStyle } from "@antv/f6-core"; export type SliderOption = Partial<{ readonly width?: number; readonly height?: number; readonly backgroundStyle?: ShapeStyle; readonly foregroundStyle?: ShapeStyle; // 滑块样式 readonly handlerStyle?: ShapeStyle; readonly textStyle?: ShapeStyle; // 初始位置 readonly start: number; readonly end: number; }>; export interface SliderProgressBar { slider: SliderOption; } export interface Interval { data: number[]; style: ShapeStyle; } export interface TrendConfig { // 数据 readonly data?: number[]; // 样式 readonly smooth?: boolean; // readonly isArea?: boolean; readonly lineStyle?: ShapeStyle; // readonly areaStyle?: ShapeStyle; // readonly interval?: Interval; } export interface SliderTick { width?: number; lineStyle?: ShapeStyle; textStyle?: ShapeStyle; } ================================================ FILE: packages/plugin/src/time-bar/type/tick.ts ================================================ import { ShapeStyle } from "@antv/f6-core"; import { TimeBarData } from "./time-bar"; export interface TimeBarTickOption { // position size readonly width?: number; readonly padding?: number | string; readonly tickBoxHeight?: number; // styles readonly selectedTickStyle?: ShapeStyle; readonly unSelectedTickStyle?: ShapeStyle; readonly tooltipBackgroundColor?: string; // todo readonly tickLabelStyle?: ShapeStyle; readonly tickLineStyle?: ShapeStyle; readonly start?: number; readonly end?: number; // 自定义标签格式化函数 readonly tickLabelFormatter?: (d: any) => string | boolean; // 自定义 tooltip 内容格式化函数 readonly tooltipFomatter?: (d: any) => string; } export interface TimeBarTickContext { data: TimeBarData[]; width: number; padding: string | number; selectedFill: string; unSelectFill: string; gap: number; tickBoxHeight: number; lineStyle: ShapeStyle; textStyle: ShapeStyle; tickWidth: number; count: number; start: number; end: number; selects: any[]; tickBoxs: any; } ================================================ FILE: packages/plugin/src/time-bar/type/time-bar.ts ================================================ import { IGroup } from "@antv/g-base"; import { ControllerCfg } from "./control-bar"; import { SliderOption, SliderTick, TrendConfig } from "./slider"; import { TimeBarTickOption } from "./tick"; export interface TimeBarData { date: number; value: number; } export type TimeBarType = "trend" | "simple"; export interface TrendTimeBarOption { group: IGroup; width?: number; padding?: number; data?: TimeBarData[]; slider?: SliderOption; controllerCfg?: ControllerCfg; trend: TrendConfig; sliderTick?: SliderTick; } export interface SimpleTimeBarOption { group: IGroup; width?: number; padding?: number; data?: TimeBarData[]; slider?: SliderOption; controllerCfg?: ControllerCfg; sliderTick?: SliderTick; } export interface TickTimeBarOption { group: IGroup; width?: number; padding?: number; data?: TimeBarData[]; controllerCfg?: ControllerCfg; tick: TimeBarTickOption; } ================================================ FILE: packages/plugin/src/time-bar/ui/control-bar/control-btn.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; function createControlBtn(which, style) { const { height = 16, fill } = style; const len = height / 2; let html = ""; if (which === "next") { html = ` `; } if (which === "prev") { html = ` `; } const css = ` shape { margin-left: ${len}; width: ${len}; background: ${fill}; } `; return createSegmentNode(html, css); } export default createControlBtn; ================================================ FILE: packages/plugin/src/time-bar/ui/control-bar/index.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { dispatch } from "../../dispatcher"; import { ControllerCfg } from "../../type/control-bar"; import { CONTROL_NEXT, CONTROL_PREV, DEFAULT_CONTROLLER_CONFIG, SPEED_CHANGE, } from "../../utils/const"; import createControlBtn from "./control-btn"; import createPlayBtn from "./play-btn"; import { deepMix } from "@antv/util"; function createControlbar(option: ControllerCfg) { const mixOption: ControllerCfg = deepMix( {}, DEFAULT_CONTROLLER_CONFIG, option, ); const { wrapperWidth, contentWidth, height, fill, stroke, nextBtnStyle, preBtnStyle, playBtnStyle, speed, } = mixOption; const html = `
`; const css = ` .wrapper { display: flex; width: ${wrapperWidth}; height: ${height}; flex-wrap: nowrap; flex-direction: row; justify-content: center; align-items: center; background: ${fill}; ${stroke ? `border: 1 solid ${stroke};` : ""} } .content{ display: flex; width: ${contentWidth}; flex-wrap: nowrap; flex-direction: row; justify-content: space-between; align-items: center; background-opacity: 0; } `; const uiTree = createSegmentNode(html, css); const nextBtn = createControlBtn("next", nextBtnStyle); const prevBtn = createControlBtn("prev", preBtnStyle); const playBtn = createPlayBtn(playBtnStyle); dispatch(SPEED_CHANGE, speed); nextBtn.on("tap", () => { dispatch(CONTROL_NEXT); }); prevBtn.on("tap", () => { dispatch(CONTROL_PREV); }); uiTree.query(".content").appendChild(prevBtn, playBtn, nextBtn); return uiTree; } export default createControlbar; ================================================ FILE: packages/plugin/src/time-bar/ui/control-bar/play-btn.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { ShapeStyle } from "@antv/f6-core"; import { dispatch } from "../../dispatcher"; import { SLIDER_PAUSE, SLIDER_PLAY } from "../../utils/const"; function createPlayBtn(style: ShapeStyle) { const { radius = 15, fill } = style || {}; // 播放按钮中间三角形的高 const triH = (radius * Math.sqrt(3)) / 2; const html = `
`; const css = ` #play_Btn { width: ${radius * 2}; height: ${radius * 2}; background: #fff; border: 1 solid ${fill}; border-radius: ${radius}; } .start{ position: absolute; top: ${radius / 2}; left: ${radius - triH / 2 + 1} ; background: ${fill}; width: ${radius}; height: ${radius}; } .pause { display: none; } .pause shape { position: absolute; background: ${fill}; width: ${radius / 4}; height: ${radius}; } .pause_1 { left: ${(4 * radius) / 8}; } .pause { position: absolute; top: ${radius / 2}; left: ${(5 * radius) / 8}; } `; const node = createSegmentNode(html, css); const startNode = node.query(".start"); const pauseNode = node.query(".pause"); let isPause = true; function update() { startNode.setStyle("display", isPause ? "flex" : "none"); pauseNode.setStyle("display", isPause ? "none" : "flex"); } update(); node.on("tap", () => { dispatch(isPause ? SLIDER_PLAY : SLIDER_PAUSE); isPause = !isPause; update(); }); return node; } export default createPlayBtn; ================================================ FILE: packages/plugin/src/time-bar/ui/index.ts ================================================ import { createUI } from "@antv/f6-ui"; import createControlbar from "./control-bar"; import { createSimpleProgressBar, createTickProgressBar, createTrendProgressBar, } from "./progress-bar"; import { SimpleTimeBarOption, TickTimeBarOption, TrendTimeBarOption, } from "../type/time-bar"; /** * 创建简单模式的时间轴 */ export function createSimpleTimeBarUI({ width = 0, padding = 0, group, data = [], slider = {}, controllerCfg = {}, sliderTick = {}, }: SimpleTimeBarOption) { const timeBar = createSimpleProgressBar({ data, width, slider: { width: slider.width || width - padding * 2, // 实际padding paddingTop: 0, ...slider, }, sliderTick: { width: width - padding * 2, ...sliderTick, }, }); return createTimeBarUI( { width, group, control: { wrapperWidth: width, ...controllerCfg } }, timeBar, ); } /** * 创建刻度模式时间轴 */ export function createTickUI({ group, data = [], width, padding, controllerCfg = {}, tick = {}, }: TickTimeBarOption) { // 创建刻度progressBar const tickBar = createTickProgressBar({ data, tick: { width: width - padding, ...tick, }, }); return createTimeBarUI( { width, group, control: { wrapperWidth: width, ...controllerCfg } }, tickBar, ); } /** * 创建趋势时间轴 */ export function createTrendUI({ width = 0, padding = 0, group, data = [], slider = {}, controllerCfg = {}, trend = {}, sliderTick = {}, }: TrendTimeBarOption) { // 创建progressBar const progressBar = createTrendProgressBar({ data, width, slider: { width: slider.width || width - padding * 2, // 实际padding paddingTop: 0, ...(slider || {}), }, sliderTick: { width: width - padding * 2, ...(sliderTick || {}), }, trend: { data: data?.map((item) => item.value), ...(trend || {}) }, }); // 创建TimeBar const timeBar = createTimeBarUI( { width, group, control: { wrapperWidth: width, ...controllerCfg } }, progressBar, ); return timeBar; } /** * 时间轴创建函数 * @param param * @param progressBar // 进度条部分 * @returns */ function createTimeBarUI({ width, group, control }, progressBar) { const html = ``; const css = ` root { /** 盒模型 **/ width: ${width}; /** flex **/ display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: center; } `; const uiTree = createUI(html, css, group); const controlBar = createControlbar(control); uiTree.appendChild(progressBar, controlBar); return uiTree; } ================================================ FILE: packages/plugin/src/time-bar/ui/progress-bar/index.ts ================================================ import { createSimpleProgressBar, createTrendProgressBar } from "./trend"; import createTickProgressBar from "./tick"; export { createSimpleProgressBar, createTickProgressBar, createTrendProgressBar, }; ================================================ FILE: packages/plugin/src/time-bar/ui/progress-bar/tick.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { dispatch, subscribe } from "../../dispatcher"; import { CONTROL_NEXT, CONTROL_PREV, RANGE_CHANGE, SLIDER_PAUSE, SLIDER_PLAY, PROGRESS_TICK_SELECTED_STYLE, PROGRESS_TICK, PROGRESS_TICK_LINE_STYLE, PROGRESS_TICK_TEXT_STYLE, PROGRESS_TICK_UNSELECTED_STYLE, SLIDER_START, SLIDER_END, SPEED_CHANGE, } from "../../utils/const"; import { throttle } from "@antv/util"; import { createPlayer } from "../../utils/player"; import { TimeBarTickContext } from "../../type/tick"; const createTickProgressBar = function (option) { const { data } = option; const { start = SLIDER_START, end = SLIDER_END, width, padding, } = option.tick; console.log(option); const selectedTickStyle = Object.assign( {}, PROGRESS_TICK_SELECTED_STYLE, option?.tick?.selectedTickStyle, ); const unselectedTickStyle = Object.assign( {}, PROGRESS_TICK_UNSELECTED_STYLE, option?.tick?.unSelectedTickStyle, ); const context: TimeBarTickContext = {} as TimeBarTickContext; // 数据 context.data = data; // 整个bar的宽度 context.width = width; context.padding = padding || "10 0"; // 高亮 context.selectedFill = selectedTickStyle.fill; // 默认 context.unSelectFill = unselectedTickStyle.fill; // 每个刻度的间隔 context.gap = PROGRESS_TICK.gap; // 每个刻度的高度 context.tickBoxHeight = option?.tick?.tickBoxHeight || PROGRESS_TICK.tickBoxHeight; // 刻度下面的线的样式 context.lineStyle = Object.assign( {}, PROGRESS_TICK_LINE_STYLE, option?.tick?.tickLineStyle, ); // 刻度下面文本样式 context.textStyle = Object.assign( {}, PROGRESS_TICK_TEXT_STYLE, option?.tick?.tickLabelStyle, ); // 每个刻度的宽度 context.tickWidth = width / data.length; // 每个文本宽度相当于多少个刻度,用来布局文本 context.count = Math.floor(context.textStyle.width / context.tickWidth); context.start = start; context.end = end; context.selects = []; const node = createTickProgressBarNode(context); context.tickBoxs = node.queryAll(".tick-box"); initPlayer(context); bindEvents(node, context); return node; }; // 创建节点 function createTickProgressBarNode(context) { const { data, tickWidth, count, width, gap, tickBoxHeight, textStyle, lineStyle, start, end, unSelectFill, } = context; const html = `
${data.reduce((prev, cur, index) => { return (prev += `
${ index % count == 0 ? `
${cur.date}
` : "" }
`); }, "")}
`; const css = ` #slider { width: ${width}; display: flex; flex-direction: row; justify-content: space-between; align-items: flex-start; padding: ${context.padding}; } .ticker { width: ${tickWidth - gap}; display: flex; background-opacity: 0; align-items: center; } .tick-box { width: ${tickWidth - gap}; height: ${tickBoxHeight}; background: ${unSelectFill}; } .tick-desc { display: flex; align-items: center; } .text{ width: 0; height: ${textStyle.fontSize}; text-align:center; color: ${textStyle.fill}; font-size: ${textStyle.fontSize}; } .text text{ white-space: nowrap; } .line { width: ${lineStyle.width}; height: ${lineStyle.height}; background: ${lineStyle.fill}; margin: 2 0; } `; const node = createSegmentNode(html, css); node.didMount = function () { context.start = start * width; context.end = end * width; select(context.start, context.end, context); }; return node; } // 绑定事件 function bindEvents(node, context) { let startX = 0; let isStart = false; let startLeft = 0; const selectThrottle = throttle(select, 30, { trailing: true, leading: true, }); node.on("panstart", (e) => { isStart = false; if (!e.uiNode) return; if (e.uiNode.getAttribute("class") === "tick-box") { isStart = true; startX = e.clientX; startLeft = e.uiNode.getAttribute("disFromStart"); clearAllSelect(context); } }); node.on("panmove", (e) => { if (!isStart) return; const delta = e.clientX - startX; selectThrottle(startLeft, startLeft + delta, context); }); node.on("tap", (e) => { if (e.uiNode && e.uiNode.getAttribute("class") === "tick-box") { selectSingle(e.uiNode, context); } }); } // 初始化播放器 function initPlayer(context) { const goNext = () => { context.end += context.tickWidth; select(context.start, context.end, context); }; const goPrev = () => { context.end -= context.tickWidth; select(context.start, context.end, context); }; const player = createPlayer(goNext, 1000); subscribe(CONTROL_NEXT, goNext); subscribe(CONTROL_PREV, goPrev); subscribe(SLIDER_PLAY, player.play); subscribe(SLIDER_PAUSE, player.stop); subscribe(SPEED_CHANGE, player.setSpeed); } // 选中刻度函数 function select(start, end, context) { let max = Math.max(start, end); let min = Math.min(start, end); context.start = min; context.end = max; clearAllSelect(context); context.tickBoxs.forEach((tickBox) => { if (context.selects.includes(tickBox)) return; if ( tickBox.getAttribute("disFromStart") >= min && tickBox.getAttribute("disFromStart") <= max ) { tickBox.setStyle("backgroundColor", context.selectedFill); context.selects.push(tickBox); } }); if (context.selects.length > 0) { dispatch(RANGE_CHANGE, { value: [ context.selects[0].getAttribute("disFromStart") / context.width, context.selects[context.selects.length - 1].getAttribute( "disFromStart", ) / context.width, ], }); } } // 清除选中 function clearAllSelect(context) { context.selects.forEach((box) => { box.setStyle("backgroundColor", context.unSelectFill); }); context.selects = []; } // 选中单个box function selectSingle(tickBox, context) { clearAllSelect(context); context.selects.push(tickBox); context.start = context.end = tickBox.getAttribute("disFromStart"); dispatch(RANGE_CHANGE, { value: [ tickBox.getAttribute("disFromStart") / context.width, tickBox.getAttribute("disFromStart") / context.width, ], }); tickBox.setStyle("backgroundColor", context.selectedFill); } export default createTickProgressBar; ================================================ FILE: packages/plugin/src/time-bar/ui/progress-bar/trend.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import bindDragEvents from "../slider/slider-logic"; import createSimpleSlider from "../slider/simple-slider"; import createTrendSlider from "../slider/trend-slider"; import createTiker from "../slider/slide-ticker"; import { subscribe } from "../../dispatcher"; import { CONTROL_NEXT, CONTROL_PREV, SLIDER_END, SLIDER_PAUSE, SLIDER_PLAY, SLIDER_START, SPEED_CHANGE, } from "../../utils/const"; export function createSimpleProgressBar({ data = [], width, slider, sliderTick, }) { // 创建slider const nodes = createSimpleSlider(slider); // 创建progressBar const progressBar = createProgressBar( { data, width, start: slider.start, end: slider.end, sliderTick, }, nodes, ); return progressBar; } export function createTrendProgressBar({ data, width, slider, sliderTick, trend, }) { // 创建slider const nodes = createTrendSlider({ slider, trend }); // 创建progressBar const progressBar = createProgressBar( { data, width, start: slider.start, end: slider.end, sliderTick, }, nodes, ); return progressBar; } function createProgressBar( { data = [], width, start = SLIDER_START, end = SLIDER_END, sliderTick }, sliderNodes, ) { const { width: sliderTickWidth = 0 } = sliderTick; // 每个刻度宽度 const tickWidth = sliderTickWidth / data.length; const progressBar = createProgressBarNode(width); const { slideContainer, leftControl, rightControl, slideInner } = sliderNodes; const tiker = createTiker(data, tickWidth, sliderTick); progressBar.appendChild(slideContainer, tiker); const logic = bindDragEvents({ data, slideContainer, leftControl, rightControl, slideInner, tickWidth, delegateNode: progressBar, }); // 节点挂载之后初始化 slideContainer.didMount = () => { logic.goLeftPercent(start); logic.goRightPercent(end); }; subscribe(SLIDER_PLAY, logic.player.play); subscribe(SLIDER_PAUSE, logic.player.stop); subscribe(SPEED_CHANGE, logic.player.setSpeed); subscribe(CONTROL_NEXT, logic.goNext); subscribe(CONTROL_PREV, logic.goPrev); return progressBar; } function createProgressBarNode(width) { const html = `
`; const css = ` #slider { width: ${width}; display: flex; justify-content: center; align-items: center; } `; return createSegmentNode(html, css); } ================================================ FILE: packages/plugin/src/time-bar/ui/slider/simple-slider.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { SliderOption } from "../../type/slider"; import { SIMPLE_BACKGROUND_STYLE, SIMPLE_HANDLE_STYLE, FOREGROUND_STYLE, TEXT_STYLE, } from "../../utils/const"; export default function createSimpleSlider(option: SliderOption) { const { width, height = 4 } = option; const handlerStyle = Object.assign( {}, SIMPLE_HANDLE_STYLE, option.handlerStyle, ); const backgroundStyle = Object.assign( {}, SIMPLE_BACKGROUND_STYLE, option.backgroundStyle, ); const foregroundStyle = Object.assign( {}, FOREGROUND_STYLE, option.foregroundStyle, ); const textStyle = Object.assign({}, TEXT_STYLE, option.textStyle); const html = `
0
0
`; const css = ` .slider-bg { width: ${width}; height: ${height}; background: ${backgroundStyle.fill}; opacity: ${backgroundStyle.opacity}; border-radius: ${backgroundStyle.radius}; z-index: 10; margin-top: 30; } .slider-inner{ position: absolute; width: ${width}; height: ${height}; border-radius: ${height / 2}; background: ${foregroundStyle.fill}; background-opacity: ${foregroundStyle.opacity} z-index: 1; } .control { position: absolute; top: ${-handlerStyle.radius / 2 + height / 2}; width: ${handlerStyle.radius}; height: ${handlerStyle.radius}; border-radius: ${handlerStyle.radius / 2}; background: ${handlerStyle.fill}; border: ${handlerStyle.lineWidth} solid ${handlerStyle.stroke}; z-index: 2; } .text{ position: absolute; left: ${handlerStyle.radius / 2}; top: -${handlerStyle.radius / 2 + textStyle.fontSize / 2}; width: 0; color: ${textStyle.fill}; font-size: ${textStyle.fontSize}; text-align: center; } text{ opacity: ${textStyle.opacity}; white-space: nowrap; } .left-control { left: 0; } .right-control{ left: ${width - handlerStyle.radius}; } `; const node = createSegmentNode(html, css); return { slideContainer: node, leftControl: node.query(".left-control"), rightControl: node.query(".right-control"), slideInner: node.query(".slider-inner"), }; } ================================================ FILE: packages/plugin/src/time-bar/ui/slider/slide-ticker.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { SliderTick } from "../../type/slider"; import { TimeBarData } from "../../type/time-bar"; import { TICK_LABEL_STYLE, TICK_LINE_STYLE } from "../../utils/const"; export default function createTiker( data: TimeBarData[], tickWidth: number, sliderTick: SliderTick, ) { const { width = 0 } = sliderTick; const tickLabelStyle = Object.assign( {}, TICK_LABEL_STYLE, sliderTick.textStyle, ); const tickLineStyle = Object.assign( {}, TICK_LINE_STYLE, sliderTick.lineStyle, ); const count = Math.floor(tickLabelStyle.width / tickWidth); const html = `
${data.reduce((prev, cur, index) => { return (prev += `
${ index % count === 0 ? `
${cur.date}
` : "" }
`); }, "")}
`; const css = ` .tiker { width: ${width}; background-opacity: 0; display: flex; flex-direction: row; z-index: 1; color: black; } .single-tick { width: ${tickWidth}; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; } .single-tick shape{ width: ${tickLineStyle.width}; height: ${tickLineStyle.height}; background: ${tickLineStyle.fill}; } .single-tick .text { height: ${tickLabelStyle.fontSize}; text-align: center; font-size: ${tickLabelStyle.fontSize}; width: 0; color: ${tickLabelStyle.fill}; } text { opacity: ${tickLabelStyle.opacity};; white-space: nowrap; } `; return createSegmentNode(html, css); } ================================================ FILE: packages/plugin/src/time-bar/ui/slider/slider-logic.ts ================================================ import { dispatch } from "../../dispatcher"; import { createPlayer } from "../../utils/player"; export default function createLogicer(option) { const { delegateNode, leftControl, rightControl, slideInner, data, tickWidth, slideContainer, speed = 100, } = option; let start = 0; let end = 1; let cur = 0; function goLeftPercent(percent) { if (percent < 0 || percent > 1) return; const containerWidth = slideContainer.width; updateLeft(percent * containerWidth); } function goRightPercent(percent) { if (percent < 0 || percent > 1) return; const containerWidth = slideContainer.width; updateRight(percent * containerWidth); } function goNext() { const controlWidth = rightControl.width; const containerWidth = slideContainer.width; if (cur > containerWidth - controlWidth) return; cur += tickWidth; updateRight(cur); } function goPrev() { if (cur < 0) return; cur -= tickWidth; updateRight(cur); } const player = createPlayer(goNext, speed); function getSlideInnerWidth() { return rightControl.left - leftControl.left + leftControl.width; } function getDataItem(value) { const containerWidth = slideContainer.width; const index = (value / containerWidth) * data.length; return data[Math.floor(index)]; } function updateLeft(value, isChangeSliderWidth = true) { const controlWidth = leftControl.width; const containerWidth = slideContainer.width; if (value < 0) value = 0; if (value > containerWidth - controlWidth) value = containerWidth - controlWidth; leftControl.onLeftChange?.(value); leftControl.setStyle("left", value); isChangeSliderWidth && slideInner.setStyle("width", getSlideInnerWidth()); slideInner.setStyle("left", value < 0 ? 0 : value); const data = getDataItem(value); if (data) { leftControl.setText(data.date); start = value / containerWidth; dispatch("RANGE_CHANGE", { value: [start, end] }); } } function updateRight(value, isChangeSliderWidth = true) { const controlWidth = rightControl.width; const containerWidth = slideContainer.width; if (value < 0) value = 0; if (value >= containerWidth - controlWidth) value = containerWidth - controlWidth; rightControl.onLeftChange?.(value); rightControl.setStyle("left", value); isChangeSliderWidth && slideInner.setStyle("width", getSlideInnerWidth()); const data = getDataItem(value + controlWidth); if (data) { cur = value; rightControl.setText(data.date); end = (value + controlWidth) / containerWidth; dispatch("RANGE_CHANGE", { value: [start, end] }); } } function updateSlideInner(value) { const controlWidth = rightControl.width; const slideWidth = slideInner.width; const containerWidth = slideContainer.width; if (value < 0) value = 0; if (value > containerWidth - slideWidth) value = containerWidth - slideWidth; updateLeft(value, false); updateRight(value + slideWidth - controlWidth, false); } const map: any = new Map(); map.set(leftControl, { getStart: () => leftControl.left, handler: updateLeft, }); map.set(rightControl, { getStart: () => rightControl.left, handler: updateRight, }); map.set(slideInner, { getStart: () => slideInner.left, handler: updateSlideInner, }); let startX = 0; let startLeft = 0; let dragingNode; delegateNode.on("panstart", (e) => { if (!e.uiNode) return; dragingNode = undefined; const drager = map.get(e.uiNode); if (drager) { dragingNode = e.uiNode; startX = e.clientX; startLeft = drager.getStart(); } }); delegateNode.on("panmove", (e) => { if (!dragingNode) return; const drager = map.get(dragingNode); const delta = e.clientX - startX; drager.handler(startLeft + delta); }); return { goLeftPercent, goRightPercent, goNext, goPrev, player, }; } ================================================ FILE: packages/plugin/src/time-bar/ui/slider/trend-slider.ts ================================================ import { createSegmentNode } from "@antv/f6-ui"; import { SliderOption, TrendConfig } from "../../type/slider"; import { BACKGROUND_STYLE, FOREGROUND_STYLE, TREND_HANDLER_STYLE, TEXT_STYLE, TREND_SLIDER_HEIHGT, } from "../../utils/const"; import { dataToPath } from "../../utils/path"; export const TREND_LINE_STYLE = { stroke: "#C5C5C5", strokeOpacity: 0.85, }; export const AREA_STYLE = { fill: "#CACED4", opacity: 0.85, }; export default function createTrendSlider({ slider = {}, trend = {}, }: { slider: SliderOption; trend: TrendConfig; }) { const { width, height = TREND_SLIDER_HEIHGT } = slider; const { data: trendData = [], lineStyle, smooth = true } = trend; const handlerStyle = Object.assign( {}, TREND_HANDLER_STYLE, slider.handlerStyle, ); const backgroundStyle = Object.assign( {}, BACKGROUND_STYLE, slider.backgroundStyle, ); const foregroundStyle = Object.assign( {}, FOREGROUND_STYLE, slider.foregroundStyle, ); const textStyle = Object.assign({}, TEXT_STYLE, slider.textStyle); const trendLineStyle = Object.assign({}, TREND_LINE_STYLE, lineStyle); const mainRectWidth = handlerStyle.width; const circleR = mainRectWidth * 2; const controlWidth = circleR * 2 + 10; const html = `
1
1
`; const css = ` .slider-bg { width: ${width}; height: ${height}; background: ${backgroundStyle.fill}; opacity: ${backgroundStyle.opacity}; z-index: 10; } .trend-bg{ position: absolute; width: ${width}; height: ${height}; border: 1 solid ${trendLineStyle.stroke}; opacity: ${trendLineStyle.strokeOpacity}; } .slider-inner{ position: absolute; width: ${width}; height: ${height}; background: ${foregroundStyle.fill}; opacity: ${foregroundStyle.opacity}; } .control { position: absolute; width: ${controlWidth}; height: ${height}; font-size: 10; background-opacity: 0; } .handler{ position: absolute; height: ${handlerStyle.height}; width: ${mainRectWidth}; } .rect { position: absolute; width: ${mainRectWidth}; height: ${handlerStyle.height}; background: ${handlerStyle.fill}; } .circle { background: ${handlerStyle.fill}; position: absolute; left: ${mainRectWidth / 2} } .top-circle{ top: 0 } .bottom-circle{ bottom: 0 } .right-control .handler{ right: 0 } .control .text{ position: absolute; top: ${height / 2 - 5}; } .text{ color: ${textStyle.fill}; width: 40; text-align: center; } .text text{ opacity:${textStyle.opacity} } .left-control .text{ margin-left: 0; } .right-control .text{ } .left-control { left: 0; } .right-control{ left: ${width - controlWidth}; } `; const slideContainer = createSegmentNode(html, css); const path = dataToPath(trendData, width, height, smooth); const slideTrendBg = slideContainer.query(".trend-bg"); slideTrendBg.setAttribute("path", path); const leftControl = slideContainer.query(".left-control"); const rightControl = slideContainer.query(".right-control"); const leftControlText = leftControl.query(".text"); const rightControlText = rightControl.query(".text"); leftControl.onLeftChange = (value) => { if (value < leftControlText.width) { leftControlText.setStyle("marginLeft", 0); } else { leftControlText.setStyle("marginLeft", -leftControlText.width); } }; rightControl.onLeftChange = (value) => { if ( value > slideContainer.width - rightControl.width - rightControlText.width ) { rightControlText.setStyle("marginLeft", -rightControlText.width); } else { rightControlText.setStyle("marginLeft", 0); } }; return { slideContainer: slideContainer, leftControl: slideContainer.query(".left-control"), rightControl: slideContainer.query(".right-control"), slideInner: slideContainer.query(".slider-inner"), }; } ================================================ FILE: packages/plugin/src/time-bar/utils/const.ts ================================================ // event export const SLIDER_PLAY = "SLIDER_PLAY"; export const SLIDER_PAUSE = "SLIDER_PAUSE"; export const CONTROL_NEXT = "CONTROL_NEXT"; export const CONTROL_PREV = "CONTROL_PREV"; export const RANGE_CHANGE = "RANGE_CHANGE"; export const SPEED_CHANGE = "SPEED_CHANGE"; // slider export const BACKGROUND_STYLE = { fill: "#416180", opacity: 0.05, }; export const SIMPLE_BACKGROUND_STYLE = { fill: "#416180", opacity: 0.15, radius: 5, }; export const FOREGROUND_STYLE = { fill: "#5B8FF9", opacity: 0.3, cursor: "grab", }; export const TREND_SLIDER_HEIHGT = 24; export const TREND_HANDLER_STYLE = { width: 2, height: 26, fill: "#1890ff", stroke: "#1890ff", opacity: 1, cursor: "ew-resize", // 高亮的颜色 highLightFill: "#0050b3", }; export const SIMPLE_HANDLE_STYLE = { fill: "#fff", stroke: "#1890ff", radius: 15, opacity: 1, lineWidth: 2, cursor: "ew-resize", }; // sliderTick export const TEXT_STYLE = { textBaseline: "middle", fill: "#000", opacity: 0.45, fontSize: 12, }; export const TICK_LABEL_STYLE = { fill: "#607889", opacity: 0.35, fontSize: 12, width: 50, }; export const TICK_LINE_STYLE = { width: 1, height: 4, fill: "#ccc", }; export const PROGRESS_TICK = { gap: 2, tickBoxHeight: 18, }; export const PROGRESS_TICK_LINE_STYLE = { height: 4, width: 1, fill: "#BFBFBF", }; export const PROGRESS_TICK_TEXT_STYLE = { fill: "#8c8c8c", fontSize: 10, width: 50, }; export const PROGRESS_TICK_SELECTED_STYLE = { fill: "#5B8FF9", }; export const PROGRESS_TICK_UNSELECTED_STYLE = { fill: "#e6e8e9", }; export const SLIDER_START = 0.1; export const SLIDER_END = 0.9; export const DEFAULT_CONTROLLER_CONFIG = { speed: 1, contentWidth: 200, height: 60, fill: "#fff", stroke: "#fff", hideTimeTypeController: false, preBtnStyle: { fill: "#aaa", }, nextBtnStyle: { fill: "#aaa", }, playBtnStyle: { fill: "#aaa", }, }; ================================================ FILE: packages/plugin/src/time-bar/utils/path.ts ================================================ import * as pathUtil from "@antv/path-util"; import { Category, Linear } from "@antv/scale"; import { map, each, isEqual, head, isArray } from "@antv/util"; type Point = [number, number]; /** * 点数组转 path * @param points */ function pointsToPath(points: Point[]): any[][] { return map(points, (p: Point, idx: number) => { const command = idx === 0 ? "M" : "L"; const [x, y] = p; return [command, x, y]; }); } /** * 将点连接成路径 path * @param points */ export function getLinePath(points: Point[]): any[][] { return pointsToPath(points); } /** * 将点连成平滑的曲线 * @param points */ export function getSmoothLinePath(points: Point[]): any[][] { if (points.length <= 2) { // 两点以内直接绘制成路径 return getLinePath(points); } const data = []; each(points, (p) => { // 当前点和上一个点一样的时候,忽略掉 if (!isEqual(p, data.slice(data.length - 2))) { data.push(p[0], p[1]); } }); const path = pathUtil.catmullRom2Bezier(data, false); const [x, y] = head(points); path.unshift(["M", x, y]); return path; } /** * 将数据转成 path,利用 scale 的归一化能力 * @param data * @param width * @param height * @param smooth */ export function dataToPath( data: number[], width: number, height: number, smooth: boolean = true, ): any[][] { // 利用 scale 来获取 y 上的映射 const y = new Linear({ values: data, }); const x = new Category({ values: map(data, (v, idx) => idx), }); const points = map(data, (v: number, idx: number) => { return [x.scale(idx) * width, height - y.scale(v) * height] as [ number, number, ]; }); return smooth ? getSmoothLinePath(points) : getLinePath(points); } export function dataToRectPath( data: number[], width: number, height: number, barWidth: number = 5, ): any[][] { // 利用 scale 来获取 y 上的映射 const y = new Linear({ values: data, }); const x = new Category({ values: map(data, (v, idx) => idx), }); const points = map(data, (v: number, idx: number) => { return [x.scale(idx) * width, height - y.scale(v) * height] as [ number, number, ]; }); const rectPoints = []; for (let i = 0; i < points.length; i++) { const point = points[i]; const param = { x: point[0], y: point[1], y0: height, size: barWidth, }; const rectPoint = getRectPoints(param); rectPoints.push(...rectPoint); } return getRectPath(rectPoints); } /** * 获得 area 面积的横向连接线的 px 位置 * @param data * @param width * @param height */ export function getAreaLineY(data: number[], height: number): number { const y = new Linear({ values: data, }); const lineY = Math.max(0, y.min); return height - y.scale(lineY) * height; } /** * 线 path 转 area path * @param path * @param width * @param height */ export function linePathToAreaPath( path: any[][], width: number, height: number, data: number[], ): any[][] { const areaPath = [...path]; const lineYPx = getAreaLineY(data, height); areaPath.push(["L", width, lineYPx]); areaPath.push(["L", 0, lineYPx]); areaPath.push(["Z"]); return areaPath; } /** * @ignore * 根据数据点生成矩形的四个关键点 * @param pointInfo 数据点信息 * @returns rect points 返回矩形四个顶点信息 */ export function getRectPoints(pointInfo): { x: number; y: number }[] { const { x, y, y0, size } = pointInfo; // 有 4 种情况, // 1. x, y 都不是数组 // 2. y是数组,x不是 // 3. x是数组,y不是 // 4. x, y 都是数组 let yMin; let yMax; if (isArray(y)) { [yMin, yMax] = y; } else { yMin = y0; yMax = y; } let xMin; let xMax; if (isArray(x)) { [xMin, xMax] = x; } else { xMin = x - size / 2; xMax = x + size / 2; } const points = [ { x: xMin, y: yMin }, { x: xMin, y: yMax }, ]; // 矩形的四个关键点,结构如下(左下角顺时针连接) // 1 ---- 2 // | | // 0 ---- 3 points.push({ x: xMax, y: yMax }, { x: xMax, y: yMin }); return points; } /** * @ignore * 根据矩形关键点绘制 path * @param points 关键点数组 * @param isClosed path 是否需要闭合 * @returns 返回矩形的 path */ export function getRectPath( points: { x: number; y: number }[], isClosed: boolean = true, ) { const path = []; const firstPoint = points[0]; path.push(["M", firstPoint.x, firstPoint.y]); for (let i = 1, len = points.length; i < len; i++) { path.push(["L", points[i].x, points[i].y]); } // 对于 shape="line" path 不应该闭合,否则会造成 lineCap 绘图属性失效 if (isClosed) { path.push(["L", firstPoint.x, firstPoint.y]); // 需要闭合 path.push(["z"]); } return path; } ================================================ FILE: packages/plugin/src/time-bar/utils/player.ts ================================================ export function createPlayer(fn, time = 20) { let isStop = true; let timer = null; let maxTime = 800; let minTime = 300; let maxLevel = 10; let minLevel = 1; const loop = function () { if (isStop) { clearTimeout(timer); return; } fn?.(); timer = setTimeout(() => { loop(); }, time); }; return { play() { isStop = false; loop(); }, stop() { isStop = true; }, setSpeed(speed) { if (speed > maxLevel) speed = maxLevel; if (speed < minLevel) speed = minLevel; time = maxTime - ((maxTime - minTime) * speed) / (maxLevel - minLevel); }, }; } ================================================ FILE: packages/plugin/src/tooltip/css.ts ================================================ export function appendCss(cssString = "") { return ` text { opacity: 1 } ${cssString} `; } ================================================ FILE: packages/plugin/src/tooltip/html.ts ================================================ export default function getHtml(content = "") { return ` ${content} `; } ================================================ FILE: packages/plugin/src/tooltip/index.ts ================================================ import { isArray } from "@antv/util"; import { IG6GraphEvent, Item, IAbstractGraph as IGraph } from "@antv/f6-core"; import Base, { IPluginBaseConfig } from "../base"; import { createUI } from "@antv/f6-ui"; import getHtml from "./html"; import { appendCss } from "./css"; interface TooltipConfig extends IPluginBaseConfig { getContent?: (evt?: IG6GraphEvent) => HTMLDivElement | string; offsetX?: number; offsetY?: number; shouldBegin?: (evt?: IG6GraphEvent) => boolean; // 允许出现 tooltip 的 item 类型 itemTypes?: string[]; trigger?: "mouseenter" | "click"; fixToNode?: [number, number] | undefined; } export default class Tooltip extends Base { private currentTarget: Item; public getDefaultCfgs(): TooltipConfig { return { offsetX: 6, offsetY: 6, // 指定菜单内容,function(e) {...} getContent: (e) => { return `
类型:${e.item?.getType()}
ID:${e.item?.getID()}
`; }, getCss: () => ` .f6-tooltip-container { position: absolute; width: 200; border: 1 solid #e2e2e2; border-radius: 4; font-size: 12; color: #545454; background-color: rgba(255, 255, 255, 0.9); padding: 10 8; } .f6-tooltip-container div{ height: 20; } .tooltip-type { padding: 0; margin: 0; } .tooltip-id { color: #531dab; } `, shouldBegin: (e) => { return true; }, itemTypes: ["node", "edge", "combo"], trigger: "mouseenter", fixToNode: undefined, }; } // class-methods-use-this public getEvents() { if (this.get("trigger") === "click") { return { "node:tap": "onClick", "edge:tap": "onClick", "combo:tap": "onClick", "canvas:tap": "onMouseLeave", afterremoveitem: "onMouseLeave", contextmenu: "onMouseLeave", drag: "onMouseLeave", }; } return { "node:press": "onClick", "edge:press": "onClick", "combo:press": "onClick", "canvas:press": "onMouseLeave", "node:tap": "onMouseLeave", "edge:tap": "onMouseLeave", "combo:tap": "onMouseLeave", "canvas:tap": "onMouseLeave", afterremoveitem: "onMouseLeave", contextmenu: "onMouseLeave", drag: "onMouseLeave", }; } onClick(e: IG6GraphEvent) { const itemTypes = this.get("itemTypes"); if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return; const { item } = e; const graph: IGraph = this.get("graph"); // 若与上一次同一 item,隐藏该 tooltip if (this.currentTarget === item) { this.currentTarget = null; this.hideTooltip(); graph.emit("tooltipchange", { item: e.item, action: "hide" }); } else { this.currentTarget = item; this.showTooltip(e); graph.emit("tooltipchange", { item: e.item, action: "show" }); } } onMouseEnter(e: IG6GraphEvent) { const itemTypes = this.get("itemTypes"); if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return; const { item } = e; const graph: IGraph = this.get("graph"); this.currentTarget = item; this.showTooltip(e); graph.emit("tooltipchange", { item: e.item, action: "show" }); } onMouseMove(e: IG6GraphEvent) { const itemTypes = this.get("itemTypes"); if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return; if (!this.currentTarget || e.item !== this.currentTarget) { return; } this.showTooltip(e); } onMouseLeave() { this.hideTooltip(); const graph: IGraph = this.get("graph"); graph.emit("tooltipchange", { item: this.currentTarget, action: "hide" }); this.currentTarget = null; } showTooltip(e: IG6GraphEvent) { if (!e.item) { return; } const itemTypes = this.get("itemTypes"); if (e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return; const uiGroup = this.get("graph").get("uiGroup"); const html = getHtml(this.get("getContent")?.(e)); const css = appendCss(this.get("getCss")?.()); const tooltipUI = createUI(html, css, uiGroup); this.get("tooltip")?.remove(); this.set("tooltip", tooltipUI); this.updatePosition(e); } hideTooltip() { const tooltip = this.get("tooltip"); if (tooltip) { tooltip.setStyle("display", "none"); } } updatePosition(e: IG6GraphEvent) { const shouldBegin = this.get("shouldBegin"); const tooltip = this.get("tooltip"); if (!shouldBegin(e)) { this.hideTooltip(); return; } const graph: IGraph = this.get("graph"); const width: number = graph.get("width"); const height: number = graph.get("height"); const offsetX = this.get("offsetX") || 0; const offsetY = this.get("offsetY") || 0; // const mousePos = graph.getPointByClient(e.clientX, e.clientY); let point = graph.getPointByClient(e.clientX, e.clientY); const fixToNode = this.get("fixToNode"); const { item } = e; if ( item.getType && item.getType() === "node" && fixToNode && isArray(fixToNode) && fixToNode.length >= 2 ) { const itemBBox = item.getBBox(); point = { x: itemBBox.minX + itemBBox.width * fixToNode[0], y: itemBBox.minY + itemBBox.height * fixToNode[1], }; } const { x, y } = graph.getCanvasByPoint(point.x, point.y); const res = { x: x + offsetX, y: y + offsetY, }; // 先修改为 visible 方可正确计算 bbox tooltip.setStyle("display", "flex"); if (x + tooltip.width + offsetX > width) { res.x -= tooltip.width + offsetX; } if (y + tooltip.height + offsetY > height) { res.y -= tooltip.height + offsetY; } tooltip.setStyle("left", res.x); tooltip.setStyle("top", res.y); } public hide() { this.onMouseLeave(); } public destroy() { const tooltip = this.get("tooltip"); if (tooltip) { tooltip.remove(); } } } ================================================ FILE: packages/plugin/src/zoom-slider/index.ts ================================================ import { IAbstractGraph as IGraph } from "@antv/f6-core"; import Base, { IPluginBaseConfig } from "../base"; import { createUI } from "@antv/f6-ui"; interface ZoomSliderConfig extends IPluginBaseConfig { minZoom: number; maxZoom: number; // 滑块(竿)占屏幕宽度的比例 sliderWidthPercent: number; // 滑块拖拽的时间戳 dragTimestamp: number; sliderPosition: "bottom" | "top"; customizedStyle: string; } /** * 滑块缩放工具 */ export default class ZoomSlider extends Base { constructor(props?: ZoomSliderConfig) { super(props); } public getDefaultCfgs() { return { minZoom: 0.5, maxZoom: 3, sliderWidthPercent: 0.3, dragTimestamp: +new Date(), sliderPosition: "bottom", customizedStyle: "", getContent: () => { return `
1 times
`; }, getCss: () => { const graph: IGraph = this.get("graph"); const graphWidth = graph.get("width"); const graphHeight = graph.get("height"); const minZoom = this.get("minZoom"); const maxZoom = this.get("maxZoom"); const sliderWidthPercent = this.get("sliderWidthPercent"); const containerWidth = Math.floor(graphWidth * sliderWidthPercent); const resultX = containerWidth * ((1 - minZoom) / (maxZoom - minZoom)); const sliderPosition = this.get("sliderPosition"); const sliderToTop = sliderPosition === "top" ? 30 : graphHeight - 60; const customizedStyle = this.get("customizedStyle"); return ( ` .f6-zoom-slider { width: ${containerWidth}; height: 30; margin-left: ${Math.floor( (graphWidth * (1 - sliderWidthPercent)) / 2, )}; padding: 13 0; top: ${sliderToTop}; position: relative; opacity: 0; } .rail { width: ${containerWidth}; height: 4; background-color: #bcbcbc; border-radius: 2; opacity: 1; } .track { width: ${resultX + 2}; height: 4; background-color: #91d5ff; position: absolute; top: 13; border-radius: 2; opacity: 1; } .handle { height: 30; width: 40; position: absolute; top: 0; left: ${resultX - 9}; padding: 9; opacity: 0; } .circle { height: 13; width: 13; border-radius: 6.5; border: 2px solid #1890ff; background-color: #fff; opacity: 1; } .text { position: absolute; top: -9; margin-left: -12; color: #666; width: 45; } ` + customizedStyle ); }, }; } public getEvents() { return { dragstart: "onDragStart", dragend: "onDragEnd", pinchmove: "onDragStart", pinchend: "onDragEnd", }; } public init() { setTimeout(() => { this.initSlider(); }); } /** * 初始化滑块视图 */ initSlider() { console.log("initSlider", this); const graph: IGraph = this.get("graph"); const uiGroup = graph.get("uiGroup"); const html = this.get("getContent")(); const css = this.get("getCss")(); const zoomSliderUI = createUI(html, css, uiGroup); const handleUI = zoomSliderUI.query(".handle"); let startX = 0; handleUI.on("panstart", (e) => { startX = e.clientX; }); handleUI.on("panmove", (e) => { const distance = e.clientX - startX; startX = e.clientX; this.set("dragTimestamp", +new Date()); this.updateHandlePosition(distance); }); zoomSliderUI.setStyle("display", "none"); this.set("zoomSlider", zoomSliderUI); } /** * 开始拖动画布 */ onDragStart() { // 同步画布缩放比例到滑块工具 const graph: IGraph = this.get("graph"); const scale = graph.getZoom(); const graphWidth = graph.get("width"); const zoomSliderUI = this.get("zoomSlider"); const minZoom = this.get("minZoom"); const maxZoom = this.get("maxZoom"); const sliderWidthPercent = this.get("sliderWidthPercent"); const trackUI = zoomSliderUI.query(".track"); const containerWidth = Math.floor(graphWidth * sliderWidthPercent); const distance = containerWidth * ((scale - minZoom) / (maxZoom - minZoom)) - trackUI.getStyle("width"); this.updateHandlePosition(distance); // 显示滑块工具 clearInterval(this.get("clearHandle")); zoomSliderUI.setStyle("display", "block"); } /** * 停止拖动画布 */ async onDragEnd() { const zoomSliderUI = this.get("zoomSlider"); clearInterval(this.get("clearHandle")); const clearHandle = setInterval(() => { const dragBefore = +new Date() - this.get("dragTimestamp"); if (dragBefore > 3000) { clearInterval(this.get("clearHandle")); zoomSliderUI.setStyle("display", "none"); } }, 3000); this.set("clearHandle", clearHandle); } /** * 更新滑块拖动的位置 */ updateHandlePosition(distance) { const graph: IGraph = this.get("graph"); const zoomSliderUI = this.get("zoomSlider"); const sliderWidthPercent = this.get("sliderWidthPercent"); const minZoom = this.get("minZoom"); const maxZoom = this.get("maxZoom"); const trackUI = zoomSliderUI.query(".track"); const handleUI = zoomSliderUI.query(".handle"); const clientX = trackUI.getStyle("width"); const containerWidth = graph.get("width") * sliderWidthPercent; let resultX = clientX + distance; if (resultX < 0) { resultX = 0; } if (resultX > containerWidth) { resultX = containerWidth; } const scaleRatio = (maxZoom - minZoom) * (resultX / containerWidth) + minZoom; trackUI.setStyle("width", resultX); handleUI.setStyle("left", resultX - 9); // 9: handle 的 padding left handleUI.setText(`${Math.round(scaleRatio * 10) / 10} times`); this.updateScale(scaleRatio); } /** * 更新画布缩放 */ updateScale(scaleRatio) { const graph: IGraph = this.get("graph"); graph.zoom(scaleRatio / graph.getZoom()); } } ================================================ FILE: packages/plugin/vite.config.ts ================================================ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import path from "path"; export default defineConfig({ plugins: [react()], resolve: { alias: { "@": path.resolve(__dirname, "src"), }, }, build: { lib: { entry: path.resolve(__dirname, "src/index.ts"), // 入口文件 name: "f6-plugin", // UMD 构建时的全局变量名 fileName: (format) => `index.${format}.js`, // 输出文件名 }, rollupOptions: { // 确保 external 包不会被打包到库中 external: ["react", "react-dom"], output: [ { // CommonJS format: "cjs", dir: "dist/cjs", }, { // ESM format: "es", dir: "dist/esm", }, { // UMD format: "umd", dir: "dist/umd", name: "f6-plugin", globals: { react: "React", "react-dom": "ReactDOM", }, }, ], }, }, }); ================================================ FILE: packages/site/CNAME ================================================ f6.antv.vision ================================================ FILE: packages/site/api-extractor.json ================================================ { "mainEntryPointFilePath": "/lib/index.d.ts", "apiReport": { "enabled": false }, "docModel": { "enabled": false }, "dtsRollup": { "enabled": true }, "tsdocMetadata": { "enabled": false } } ================================================ FILE: packages/site/circle-dragging-i/989198863e10b38a@125.js ================================================ // https://observablehq.com/@d3/circle-dragging-i@125 export default function define(runtime, observer) { const main = runtime.module(); main.variable(observer()).define(["md"], function (md) { return md` # Drag (SVG) Each circle’s datum is an object with _x_ and _y_ properties. The circle is raised to the foreground at the start of a drag, and a temporary stroke is applied during drag for visual feedback. `; }); main .variable(observer("chart")) .define( "chart", ["d3", "width", "height", "radius", "drag"], function (d3, width, height, radius, drag) { const svg = d3 .create("svg") .attr("viewBox", [0, 0, width, height]) .attr("stroke-width", 2); const circles = d3.range(20).map((i) => ({ x: Math.random() * (width - radius * 2) + radius, y: Math.random() * (height - radius * 2) + radius, })); svg .selectAll("circle") .data(circles) .join("circle") .attr("cx", (d) => d.x) .attr("cy", (d) => d.y) .attr("r", radius) .attr("fill", (d, i) => d3.schemeCategory10[i % 10]) .call(drag); return svg.node(); }, ); main.variable(observer("drag")).define("drag", ["d3"], function (d3) { function dragstarted(event, d) { d3.select(this).raise().attr("stroke", "black"); } function dragged(event, d) { d3.select(this) .attr("cx", (d.x = event.x)) .attr("cy", (d.y = event.y)); } function dragended(event, d) { d3.select(this).attr("stroke", null); } return d3 .drag() .on("start", dragstarted) .on("drag", dragged) .on("end", dragended); }); main.variable(observer("height")).define("height", function () { return 600; }); main.variable(observer("radius")).define("radius", function () { return 32; }); main.variable(observer("d3")).define("d3", ["require"], function (require) { return require("d3@6"); }); return main; } ================================================ FILE: packages/site/circle-dragging-i/LICENSE.txt ================================================ Copyright 2019–2020 Observable, Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: packages/site/circle-dragging-i/index.html ================================================ Drag (SVG) ================================================ FILE: packages/site/circle-dragging-i/index.js ================================================ export { default } from "./989198863e10b38a@125.js"; ================================================ FILE: packages/site/circle-dragging-i/inspector.css ================================================ :root { --syntax_normal: #1b1e23; --syntax_comment: #a9b0bc; --syntax_number: #20a5ba; --syntax_keyword: #c30771; --syntax_atom: #10a778; --syntax_string: #008ec4; --syntax_error: #ffbedc; --syntax_unknown_variable: #838383; --syntax_known_variable: #005f87; --syntax_matchbracket: #20bbfc; --syntax_key: #6636b4; --mono_fonts: 82%/1.5 Menlo, Consolas, monospace; } .observablehq--collapsed, .observablehq--expanded, .observablehq--function, .observablehq--gray, .observablehq--import, .observablehq--string:after, .observablehq--string:before { color: var(--syntax_normal); } .observablehq--collapsed, .observablehq--inspect a { cursor: pointer; } .observablehq--field { text-indent: -1em; margin-left: 1em; } .observablehq--empty { color: var(--syntax_comment); } .observablehq--blue, .observablehq--keyword { color: #3182bd; } .observablehq--forbidden, .observablehq--pink { color: #e377c2; } .observablehq--orange { color: #e6550d; } .observablehq--boolean, .observablehq--null, .observablehq--undefined { color: var(--syntax_atom); } .observablehq--bigint, .observablehq--date, .observablehq--green, .observablehq--number, .observablehq--regexp, .observablehq--symbol { color: var(--syntax_number); } .observablehq--index, .observablehq--key { color: var(--syntax_key); } .observablehq--prototype-key { color: #aaa; } .observablehq--empty { font-style: oblique; } .observablehq--purple, .observablehq--string { color: var(--syntax_string); } .observablehq--error, .observablehq--red { color: #e7040f; } .observablehq--inspect { font: var(--mono_fonts); overflow-x: auto; display: block; white-space: pre; } .observablehq--error .observablehq--inspect { word-break: break-all; white-space: pre-wrap; } ================================================ FILE: packages/site/circle-dragging-i/package.json ================================================ { "name": "@d3/circle-dragging-i", "main": "989198863e10b38a@125.js", "version": "125.0.0", "homepage": "https://observablehq.com/@d3/circle-dragging-i", "author": { "name": "D3", "url": "https://observablehq.com/@d3" }, "type": "module", "peerDependencies": { "@observablehq/runtime": "4" } } ================================================ FILE: packages/site/circle-dragging-i/runtime.js ================================================ // @observablehq/runtime v4.10.0 Copyright 2021 Observable, Inc. function e(e, t, n) { n = n || {}; var r = e.ownerDocument, i = r.defaultView.CustomEvent; "function" == typeof i ? (i = new i(t, { detail: n })) : ((i = r.createEvent("Event")).initEvent(t, !1, !1), (i.detail = n)), e.dispatchEvent(i); } function t(e) { return ( Array.isArray(e) || e instanceof Int8Array || e instanceof Int16Array || e instanceof Int32Array || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Uint16Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array ); } function n(e) { return e === (0 | e) + ""; } function r(e) { const t = document.createElement("span"); return ( (t.className = "observablehq--cellname"), (t.textContent = `${e} = `), t ); } const i = Symbol.prototype.toString; function o(e) { return i.call(e); } const { getOwnPropertySymbols: a, prototype: { hasOwnProperty: s }, } = Object, { toStringTag: u } = Symbol, l = {}, c = a; function d(e, t) { return s.call(e, t); } function f(e) { return e[u] || (e.constructor && e.constructor.name) || "Object"; } function p(e, t) { try { const n = e[t]; return n && n.constructor, n; } catch (e) { return l; } } const h = [ { symbol: "@@__IMMUTABLE_INDEXED__@@", name: "Indexed", modifier: !0 }, { symbol: "@@__IMMUTABLE_KEYED__@@", name: "Keyed", modifier: !0 }, { symbol: "@@__IMMUTABLE_LIST__@@", name: "List", arrayish: !0 }, { symbol: "@@__IMMUTABLE_MAP__@@", name: "Map" }, { symbol: "@@__IMMUTABLE_ORDERED__@@", name: "Ordered", modifier: !0, prefix: !0, }, { symbol: "@@__IMMUTABLE_RECORD__@@", name: "Record" }, { symbol: "@@__IMMUTABLE_SET__@@", name: "Set", arrayish: !0, setish: !0 }, { symbol: "@@__IMMUTABLE_STACK__@@", name: "Stack", arrayish: !0 }, ]; function m(e) { try { let t = h.filter(({ symbol: t }) => !0 === e[t]); if (!t.length) return; const n = t.find((e) => !e.modifier), r = "Map" === n.name && t.find((e) => e.modifier && e.prefix), i = t.some((e) => e.arrayish), o = t.some((e) => e.setish); return { name: `${r ? r.name : ""}${n.name}`, symbols: t, arrayish: i && !o, setish: o, }; } catch (e) { return null; } } const { getPrototypeOf: v, getOwnPropertyDescriptors: b } = Object, _ = v({}); function w(n, i, o, a) { let s, u, l, c, d = t(n); n instanceof Map ? n instanceof n.constructor ? ((s = `Map(${n.size})`), (u = g)) : ((s = "Map()"), (u = j)) : n instanceof Set ? n instanceof n.constructor ? ((s = `Set(${n.size})`), (u = y)) : ((s = "Set()"), (u = j)) : d ? ((s = `${n.constructor.name}(${n.length})`), (u = x)) : (c = m(n)) ? ((s = `Immutable.${c.name}${"Record" === c.name ? "" : `(${n.size})`}`), (d = c.arrayish), (u = c.arrayish ? C : c.setish ? E : P)) : a ? ((s = f(n)), (u = N)) : ((s = f(n)), (u = j)); const p = document.createElement("span"); (p.className = "observablehq--expanded"), o && p.appendChild(r(o)); const h = p.appendChild(document.createElement("a")); (h.innerHTML = "\n \n "), h.appendChild(document.createTextNode(`${s}${d ? " [" : " {"}`)), h.addEventListener("mouseup", function (e) { e.stopPropagation(), ae(p, k(n, null, o, a)); }), (u = u(n)); for (let e = 0; !(l = u.next()).done && e < 20; ++e) p.appendChild(l.value); if (!l.done) { const t = p.appendChild(document.createElement("a")); (t.className = "observablehq--field"), (t.style.display = "block"), t.appendChild(document.createTextNode(" … more")), t.addEventListener("mouseup", function (t) { t.stopPropagation(), p.insertBefore(l.value, p.lastChild.previousSibling); for (let e = 0; !(l = u.next()).done && e < 19; ++e) p.insertBefore(l.value, p.lastChild.previousSibling); l.done && p.removeChild(p.lastChild.previousSibling), e(p, "load"); }); } return p.appendChild(document.createTextNode(d ? "]" : "}")), p; } function* g(e) { for (const [t, n] of e) yield M(t, n); yield* j(e); } function* y(e) { for (const t of e) yield L(t); yield* j(e); } function* E(e) { for (const t of e) yield L(t); } function* x(e) { for (let t = 0, n = e.length; t < n; ++t) t in e && (yield q(t, p(e, t), "observablehq--index")); for (const t in e) !n(t) && d(e, t) && (yield q(t, p(e, t), "observablehq--key")); for (const t of c(e)) yield q(o(t), p(e, t), "observablehq--symbol"); } function* C(e) { let t = 0; for (const n = e.size; t < n; ++t) yield q(t, e.get(t), !0); } function* N(e) { for (const t in b(e)) yield q(t, p(e, t), "observablehq--key"); for (const t of c(e)) yield q(o(t), p(e, t), "observablehq--symbol"); const t = v(e); t && t !== _ && (yield S(t)); } function* j(e) { for (const t in e) d(e, t) && (yield q(t, p(e, t), "observablehq--key")); for (const t of c(e)) yield q(o(t), p(e, t), "observablehq--symbol"); const t = v(e); t && t !== _ && (yield S(t)); } function* P(e) { for (const [t, n] of e) yield q(t, n, "observablehq--key"); } function S(e) { const t = document.createElement("div"), n = t.appendChild(document.createElement("span")); return ( (t.className = "observablehq--field"), (n.className = "observablehq--prototype-key"), (n.textContent = " "), t.appendChild(document.createTextNode(": ")), t.appendChild(oe(e, void 0, void 0, void 0, !0)), t ); } function q(e, t, n) { const r = document.createElement("div"), i = r.appendChild(document.createElement("span")); return ( (r.className = "observablehq--field"), (i.className = n), (i.textContent = ` ${e}`), r.appendChild(document.createTextNode(": ")), r.appendChild(oe(t)), r ); } function M(e, t) { const n = document.createElement("div"); return ( (n.className = "observablehq--field"), n.appendChild(document.createTextNode(" ")), n.appendChild(oe(e)), n.appendChild(document.createTextNode(" => ")), n.appendChild(oe(t)), n ); } function L(e) { const t = document.createElement("div"); return ( (t.className = "observablehq--field"), t.appendChild(document.createTextNode(" ")), t.appendChild(oe(e)), t ); } function $(e) { const t = window.getSelection(); return ( "Range" === t.type && (t.containsNode(e, !0) || t.anchorNode.isSelfOrDescendant(e) || t.focusNode.isSelfOrDescendant(e)) ); } function k(e, n, i, o) { let a, s, u, l, c = t(e); if ( (e instanceof Map ? e instanceof e.constructor ? ((a = `Map(${e.size})`), (s = O)) : ((a = "Map()"), (s = D)) : e instanceof Set ? e instanceof e.constructor ? ((a = `Set(${e.size})`), (s = T)) : ((a = "Set()"), (s = D)) : c ? ((a = `${e.constructor.name}(${e.length})`), (s = R)) : (l = m(e)) ? ((a = `Immutable.${l.name}${"Record" === l.name ? "" : `(${e.size})`}`), (c = l.arrayish), (s = l.arrayish ? U : l.setish ? A : I)) : ((a = f(e)), (s = D)), n) ) { const t = document.createElement("span"); return ( (t.className = "observablehq--shallow"), i && t.appendChild(r(i)), t.appendChild(document.createTextNode(a)), t.addEventListener("mouseup", function (n) { $(t) || (n.stopPropagation(), ae(t, k(e))); }), t ); } const d = document.createElement("span"); (d.className = "observablehq--collapsed"), i && d.appendChild(r(i)); const p = d.appendChild(document.createElement("a")); (p.innerHTML = "\n \n "), p.appendChild(document.createTextNode(`${a}${c ? " [" : " {"}`)), d.addEventListener( "mouseup", function (t) { $(d) || (t.stopPropagation(), ae(d, w(e, 0, i, o))); }, !0, ), (s = s(e)); for (let e = 0; !(u = s.next()).done && e < 20; ++e) e > 0 && d.appendChild(document.createTextNode(", ")), d.appendChild(u.value); return ( u.done || d.appendChild(document.createTextNode(", …")), d.appendChild(document.createTextNode(c ? "]" : "}")), d ); } function* O(e) { for (const [t, n] of e) yield B(t, n); yield* D(e); } function* T(e) { for (const t of e) yield oe(t, !0); yield* D(e); } function* A(e) { for (const t of e) yield oe(t, !0); } function* U(e) { let t = -1, n = 0; for (const r = e.size; n < r; ++n) n > t + 1 && (yield F(n - t - 1)), yield oe(e.get(n), !0), (t = n); n > t + 1 && (yield F(n - t - 1)); } function* R(e) { let t = -1, r = 0; for (const n = e.length; r < n; ++r) r in e && (r > t + 1 && (yield F(r - t - 1)), yield oe(p(e, r), !0), (t = r)); r > t + 1 && (yield F(r - t - 1)); for (const t in e) !n(t) && d(e, t) && (yield z(t, p(e, t), "observablehq--key")); for (const t of c(e)) yield z(o(t), p(e, t), "observablehq--symbol"); } function* D(e) { for (const t in e) d(e, t) && (yield z(t, p(e, t), "observablehq--key")); for (const t of c(e)) yield z(o(t), p(e, t), "observablehq--symbol"); } function* I(e) { for (const [t, n] of e) yield z(t, n, "observablehq--key"); } function F(e) { const t = document.createElement("span"); return ( (t.className = "observablehq--empty"), (t.textContent = 1 === e ? "empty" : `empty × ${e}`), t ); } function z(e, t, n) { const r = document.createDocumentFragment(), i = r.appendChild(document.createElement("span")); return ( (i.className = n), (i.textContent = e), r.appendChild(document.createTextNode(": ")), r.appendChild(oe(t, !0)), r ); } function B(e, t) { const n = document.createDocumentFragment(); return ( n.appendChild(oe(e, !0)), n.appendChild(document.createTextNode(" => ")), n.appendChild(oe(t, !0)), n ); } function H(e, t) { var n = e + "", r = n.length; return r < t ? new Array(t - r + 1).join(0) + n : n; } function W(e) { return e < 0 ? "-" + H(-e, 6) : e > 9999 ? "+" + H(e, 6) : H(e, 4); } var V = Error.prototype.toString; var G = RegExp.prototype.toString; function K(e) { return e.replace(/[\\`\x00-\x09\x0b-\x19]|\${/g, Y); } function Y(e) { var t = e.charCodeAt(0); switch (t) { case 8: return "\\b"; case 9: return "\\t"; case 11: return "\\v"; case 12: return "\\f"; case 13: return "\\r"; } return t < 16 ? "\\x0" + t.toString(16) : t < 32 ? "\\x" + t.toString(16) : "\\" + e; } function J(e, t) { for (var n = 0; t.exec(e); ) ++n; return n; } var X = Function.prototype.toString, Q = { prefix: "async ƒ" }, Z = { prefix: "async ƒ*" }, ee = { prefix: "class" }, te = { prefix: "ƒ" }, ne = { prefix: "ƒ*" }; function re(e, t, n) { var i = document.createElement("span"); (i.className = "observablehq--function"), n && i.appendChild(r(n)); var o = i.appendChild(document.createElement("span")); return ( (o.className = "observablehq--keyword"), (o.textContent = e.prefix), i.appendChild(document.createTextNode(t)), i ); } const { prototype: { toString: ie }, } = Object; function oe(e, t, n, i, a) { let s = typeof e; switch (s) { case "boolean": case "undefined": e += ""; break; case "number": e = 0 === e && 1 / e < 0 ? "-0" : e + ""; break; case "bigint": e += "n"; break; case "symbol": e = o(e); break; case "function": return (function (e, t) { var n, r, i = X.call(e); switch (e.constructor && e.constructor.name) { case "AsyncFunction": n = Q; break; case "AsyncGeneratorFunction": n = Z; break; case "GeneratorFunction": n = ne; break; default: n = /^class\b/.test(i) ? ee : te; } return n === ee ? re(n, "", t) : (r = /^(?:async\s*)?(\w+)\s*=>/.exec(i)) ? re(n, "(" + r[1] + ")", t) : (r = /^(?:async\s*)?\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec(i)) || (r = /^(?:async\s*)?function(?:\s*\*)?(?:\s*\w+)?\s*\(\s*(\w+(?:\s*,\s*\w+)*)?\s*\)/.exec( i, )) ? re(n, r[1] ? "(" + r[1].replace(/\s*,\s*/g, ", ") + ")" : "()", t) : re(n, "(…)", t); })(e, i); case "string": return (function (e, t, n, i) { if (!1 === t) { if (J(e, /["\n]/g) <= J(e, /`|\${/g)) { const t = document.createElement("span"); i && t.appendChild(r(i)); const n = t.appendChild(document.createElement("span")); return ( (n.className = "observablehq--string"), (n.textContent = JSON.stringify(e)), t ); } const o = e.split("\n"); if (o.length > 20 && !n) { const n = document.createElement("div"); i && n.appendChild(r(i)); const a = n.appendChild(document.createElement("span")); (a.className = "observablehq--string"), (a.textContent = "`" + K(o.slice(0, 20).join("\n"))); const s = n.appendChild(document.createElement("span")), u = o.length - 20; return ( (s.textContent = `Show ${u} truncated line${u > 1 ? "s" : ""}`), (s.className = "observablehq--string-expand"), s.addEventListener("mouseup", function (r) { r.stopPropagation(), ae(n, oe(e, t, !0, i)); }), n ); } const a = document.createElement("span"); i && a.appendChild(r(i)); const s = a.appendChild(document.createElement("span")); return ( (s.className = "observablehq--string" + (n ? " observablehq--expanded" : "")), (s.textContent = "`" + K(e) + "`"), a ); } const o = document.createElement("span"); i && o.appendChild(r(i)); const a = o.appendChild(document.createElement("span")); return ( (a.className = "observablehq--string"), (a.textContent = JSON.stringify( e.length > 100 ? `${e.slice(0, 50)}…${e.slice(-49)}` : e, )), o ); })(e, t, n, i); default: if (null === e) { (s = null), (e = "null"); break; } if (e instanceof Date) { (s = "date"), (u = e), (e = isNaN(u) ? "Invalid Date" : (function (e) { return ( 0 === e.getUTCMilliseconds() && 0 === e.getUTCSeconds() && 0 === e.getUTCMinutes() && 0 === e.getUTCHours() ); })(u) ? W(u.getUTCFullYear()) + "-" + H(u.getUTCMonth() + 1, 2) + "-" + H(u.getUTCDate(), 2) : W(u.getFullYear()) + "-" + H(u.getMonth() + 1, 2) + "-" + H(u.getDate(), 2) + "T" + H(u.getHours(), 2) + ":" + H(u.getMinutes(), 2) + (u.getMilliseconds() ? ":" + H(u.getSeconds(), 2) + "." + H(u.getMilliseconds(), 3) : u.getSeconds() ? ":" + H(u.getSeconds(), 2) : "")); break; } if (e === l) { (s = "forbidden"), (e = "[forbidden]"); break; } switch (ie.call(e)) { case "[object RegExp]": (s = "regexp"), (e = (function (e) { return G.call(e); })(e)); break; case "[object Error]": case "[object DOMException]": (s = "error"), (e = (function (e) { return e.stack || V.call(e); })(e)); break; default: return (n ? w : k)(e, t, i, a); } } var u; const c = document.createElement("span"); i && c.appendChild(r(i)); const d = c.appendChild(document.createElement("span")); return (d.className = `observablehq--${s}`), (d.textContent = e), c; } function ae(t, n) { t.classList.contains("observablehq--inspect") && n.classList.add("observablehq--inspect"), t.parentNode.replaceChild(n, t), e(n, "load"); } const se = /\s+\(\d+:\d+\)$/m; class ue { constructor(e) { if (!e) throw new Error("invalid node"); (this._node = e), e.classList.add("observablehq"); } pending() { const { _node: e } = this; e.classList.remove("observablehq--error"), e.classList.add("observablehq--running"); } fulfilled(t, n) { const { _node: r } = this; if ( ((!(t instanceof Element || t instanceof Text) || (t.parentNode && t.parentNode !== r)) && (t = oe( t, !1, r.firstChild && r.firstChild.classList && r.firstChild.classList.contains("observablehq--expanded"), n, )).classList.add("observablehq--inspect"), r.classList.remove("observablehq--running", "observablehq--error"), r.firstChild !== t) ) if (r.firstChild) { for (; r.lastChild !== r.firstChild; ) r.removeChild(r.lastChild); r.replaceChild(t, r.firstChild); } else r.appendChild(t); e(r, "update"); } rejected(t, n) { const { _node: i } = this; for ( i.classList.remove("observablehq--running"), i.classList.add("observablehq--error"); i.lastChild; ) i.removeChild(i.lastChild); var o = document.createElement("div"); (o.className = "observablehq--inspect"), n && o.appendChild(r(n)), o.appendChild(document.createTextNode((t + "").replace(se, ""))), i.appendChild(o), e(i, "error", { error: t }); } } ue.into = function (e) { if ("string" == typeof e && null == (e = document.querySelector(e))) throw new Error("container not found"); return function () { return new ue(e.appendChild(document.createElement("div"))); }; }; const le = new Map(), ce = [], de = ce.map, fe = ce.some, pe = ce.hasOwnProperty, he = "https://cdn.jsdelivr.net/npm/", me = /^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/, ve = /^\d+\.\d+\.\d+(-[\w-.+]+)?$/, be = /\.[^/]*$/, _e = ["unpkg", "jsdelivr", "browser", "main"]; class RequireError extends Error { constructor(e) { super(e); } } function we(e) { const t = me.exec(e); return t && { name: t[1], version: t[2], path: t[3] }; } function ge(e) { const t = `${he}${e.name}${e.version ? `@${e.version}` : ""}/package.json`; let n = le.get(t); return ( n || le.set( t, (n = fetch(t).then((e) => { if (!e.ok) throw new RequireError("unable to load package.json"); return e.redirected && !le.has(e.url) && le.set(e.url, n), e.json(); })), ), n ); } RequireError.prototype.name = RequireError.name; var ye = Ee(async function (e, t) { if ( (e.startsWith(he) && (e = e.substring(he.length)), /^(\w+:)|\/\//i.test(e)) ) return e; if (/^[.]{0,2}\//i.test(e)) return new URL(e, null == t ? location : t).href; if (!e.length || /^[\s._]/.test(e) || /\s$/.test(e)) throw new RequireError("illegal name"); const n = we(e); if (!n) return `${he}${e}`; if (!n.version && null != t && t.startsWith(he)) { const e = await ge(we(t.substring(he.length))); n.version = (e.dependencies && e.dependencies[n.name]) || (e.peerDependencies && e.peerDependencies[n.name]); } if ( (n.path && !be.test(n.path) && (n.path += ".js"), n.path && n.version && ve.test(n.version)) ) return `${he}${n.name}@${n.version}/${n.path}`; const r = await ge(n); return `${he}${r.name}@${r.version}/${ n.path || (function (e) { for (const t of _e) { const n = e[t]; if ("string" == typeof n) return be.test(n) ? n : `${n}.js`; } })(r) || "index.js" }`; }); function Ee(e) { const t = new Map(), n = i(null); function r(e) { if ("string" != typeof e) return e; let n = t.get(e); return ( n || t.set( e, (n = new Promise((t, n) => { const r = document.createElement("script"); (r.onload = () => { try { t(ce.pop()(i(e))); } catch (e) { n(new RequireError("invalid module")); } r.remove(); }), (r.onerror = () => { n(new RequireError("unable to load module")), r.remove(); }), (r.async = !0), (r.src = e), (window.define = je), document.head.appendChild(r); })), ), n ); } function i(t) { return (n) => Promise.resolve(e(n, t)).then(r); } function o(e) { return arguments.length > 1 ? Promise.all(de.call(arguments, n)).then(xe) : n(e); } return ( (o.alias = function (t) { return Ee((n, r) => n in t && ((r = null), "string" != typeof (n = t[n])) ? n : e(n, r), ); }), (o.resolve = e), o ); } function xe(e) { const t = {}; for (const n of e) for (const e in n) pe.call(n, e) && (null == n[e] ? Object.defineProperty(t, e, { get: Ce(n, e) }) : (t[e] = n[e])); return t; } function Ce(e, t) { return () => e[t]; } function Ne(e) { return "exports" === (e += "") || "module" === e; } function je(e, t, n) { const r = arguments.length; r < 2 ? ((n = e), (t = [])) : r < 3 && ((n = t), (t = "string" == typeof e ? [] : e)), ce.push( fe.call(t, Ne) ? (e) => { const r = {}, i = { exports: r }; return Promise.all( de.call(t, (t) => "exports" === (t += "") ? r : "module" === t ? i : e(t), ), ).then((e) => (n.apply(null, e), i.exports)); } : (e) => Promise.all(de.call(t, e)).then((e) => "function" == typeof n ? n.apply(null, e) : n, ), ); } async function Pe(e) { const t = await fetch(await e.url()); if (!t.ok) throw new Error(`Unable to load file: ${e.name}`); return t; } async function Se(e, t, { array: n = !1, typed: r = !1 } = {}) { const [i, o] = await Promise.all([ e.text(), ye("d3-dsv@2.0.0/dist/d3-dsv.min.js"), ]); return ( "\t" === t ? n ? o.tsvParseRows : o.tsvParse : n ? o.csvParseRows : o.csvParse )(i, r && o.autoType); } je.amd = {}; class FileAttachment { constructor(e, t) { Object.defineProperties(this, { _url: { value: e }, name: { value: t, enumerable: !0 }, }); } async url() { return (await this._url) + ""; } async blob() { return (await Pe(this)).blob(); } async arrayBuffer() { return (await Pe(this)).arrayBuffer(); } async text() { return (await Pe(this)).text(); } async json() { return (await Pe(this)).json(); } async stream() { return (await Pe(this)).body; } async csv(e) { return Se(this, ",", e); } async tsv(e) { return Se(this, "\t", e); } async image() { const e = await this.url(); return new Promise((t, n) => { const r = new Image(); new URL(e, document.baseURI).origin !== new URL(location).origin && (r.crossOrigin = "anonymous"), (r.onload = () => t(r)), (r.onerror = () => n(new Error(`Unable to load file: ${this.name}`))), (r.src = e); }); } } function qe(e) { throw new Error(`File not found: ${e}`); } var Me = { math: "http://www.w3.org/1998/Math/MathML", svg: "http://www.w3.org/2000/svg", xhtml: "http://www.w3.org/1999/xhtml", xlink: "http://www.w3.org/1999/xlink", xml: "http://www.w3.org/XML/1998/namespace", xmlns: "http://www.w3.org/2000/xmlns/", }; var Le = 0; function $e(e) { (this.id = e), (this.href = new URL(`#${e}`, location) + ""); } $e.prototype.toString = function () { return "url(" + this.href + ")"; }; var ke = { canvas: function (e, t) { var n = document.createElement("canvas"); return (n.width = e), (n.height = t), n; }, context2d: function (e, t, n) { null == n && (n = devicePixelRatio); var r = document.createElement("canvas"); (r.width = e * n), (r.height = t * n), (r.style.width = e + "px"); var i = r.getContext("2d"); return i.scale(n, n), i; }, download: function (e, t = "untitled", n = "Save") { const r = document.createElement("a"), i = r.appendChild(document.createElement("button")); async function o() { await new Promise(requestAnimationFrame), URL.revokeObjectURL(r.href), r.removeAttribute("href"), (i.textContent = n), (i.disabled = !1); } return ( (i.textContent = n), (r.download = t), (r.onclick = async (t) => { if (((i.disabled = !0), r.href)) return o(); i.textContent = "Saving…"; try { const t = await ("function" == typeof e ? e() : e); (i.textContent = "Download"), (r.href = URL.createObjectURL(t)); } catch (e) { i.textContent = n; } if (t.eventPhase) return o(); i.disabled = !1; }), r ); }, element: function (e, t) { var n, r = (e += ""), i = r.indexOf(":"); i >= 0 && "xmlns" !== (r = e.slice(0, i)) && (e = e.slice(i + 1)); var o = Me.hasOwnProperty(r) ? document.createElementNS(Me[r], e) : document.createElement(e); if (t) for (var a in t) (i = (r = a).indexOf(":")), (n = t[a]), i >= 0 && "xmlns" !== (r = a.slice(0, i)) && (a = a.slice(i + 1)), Me.hasOwnProperty(r) ? o.setAttributeNS(Me[r], a, n) : o.setAttribute(a, n); return o; }, input: function (e) { var t = document.createElement("input"); return null != e && (t.type = e), t; }, range: function (e, t, n) { 1 === arguments.length && ((t = e), (e = null)); var r = document.createElement("input"); return ( (r.min = e = null == e ? 0 : +e), (r.max = t = null == t ? 1 : +t), (r.step = null == n ? "any" : (n = +n)), (r.type = "range"), r ); }, select: function (e) { var t = document.createElement("select"); return ( Array.prototype.forEach.call(e, function (e) { var n = document.createElement("option"); (n.value = n.textContent = e), t.appendChild(n); }), t ); }, svg: function (e, t) { var n = document.createElementNS("http://www.w3.org/2000/svg", "svg"); return ( n.setAttribute("viewBox", [0, 0, e, t]), n.setAttribute("width", e), n.setAttribute("height", t), n ); }, text: function (e) { return document.createTextNode(e); }, uid: function (e) { return new $e("O-" + (null == e ? "" : e + "-") + ++Le); }, }; var Oe = { buffer: function (e) { return new Promise(function (t, n) { var r = new FileReader(); (r.onload = function () { t(r.result); }), (r.onerror = n), r.readAsArrayBuffer(e); }); }, text: function (e) { return new Promise(function (t, n) { var r = new FileReader(); (r.onload = function () { t(r.result); }), (r.onerror = n), r.readAsText(e); }); }, url: function (e) { return new Promise(function (t, n) { var r = new FileReader(); (r.onload = function () { t(r.result); }), (r.onerror = n), r.readAsDataURL(e); }); }, }; function Te() { return this; } function Ae(e, t) { let n = !1; if ("function" != typeof t) throw new Error("dispose is not a function"); return { [Symbol.iterator]: Te, next: () => (n ? { done: !0 } : ((n = !0), { done: !1, value: e })), return: () => ((n = !0), t(e), { done: !0 }), throw: () => ({ done: (n = !0) }), }; } function Ue(e) { let t, n, r = !1; const i = e(function (e) { n ? (n(e), (n = null)) : (r = !0); return (t = e); }); if (null != i && "function" != typeof i) throw new Error( "function" == typeof i.then ? "async initializers are not supported" : "initializer returned something, but not a dispose function", ); return { [Symbol.iterator]: Te, throw: () => ({ done: !0 }), return: () => (null != i && i(), { done: !0 }), next: function () { return { done: !1, value: r ? ((r = !1), Promise.resolve(t)) : new Promise((e) => (n = e)), }; }, }; } function Re(e) { switch (e.type) { case "range": case "number": return e.valueAsNumber; case "date": return e.valueAsDate; case "checkbox": return e.checked; case "file": return e.multiple ? e.files : e.files[0]; case "select-multiple": return Array.from(e.selectedOptions, (e) => e.value); default: return e.value; } } var De = { disposable: Ae, filter: function* (e, t) { for (var n, r = -1; !(n = e.next()).done; ) t(n.value, ++r) && (yield n.value); }, input: function (e) { return Ue(function (t) { var n = (function (e) { switch (e.type) { case "button": case "submit": case "checkbox": return "click"; case "file": return "change"; default: return "input"; } })(e), r = Re(e); function i() { t(Re(e)); } return ( e.addEventListener(n, i), void 0 !== r && t(r), function () { e.removeEventListener(n, i); } ); }); }, map: function* (e, t) { for (var n, r = -1; !(n = e.next()).done; ) yield t(n.value, ++r); }, observe: Ue, queue: function (e) { let t; const n = [], r = e(function (e) { n.push(e), t && (t(n.shift()), (t = null)); return e; }); if (null != r && "function" != typeof r) throw new Error( "function" == typeof r.then ? "async initializers are not supported" : "initializer returned something, but not a dispose function", ); return { [Symbol.iterator]: Te, throw: () => ({ done: !0 }), return: () => (null != r && r(), { done: !0 }), next: function () { return { done: !1, value: n.length ? Promise.resolve(n.shift()) : new Promise((e) => (t = e)), }; }, }; }, range: function* (e, t, n) { (e = +e), (t = +t), (n = (i = arguments.length) < 2 ? ((t = e), (e = 0), 1) : i < 3 ? 1 : +n); for (var r = -1, i = 0 | Math.max(0, Math.ceil((t - e) / n)); ++r < i; ) yield e + r * n; }, valueAt: function (e, t) { if (!(!isFinite((t = +t)) || t < 0 || (t != t) | 0)) for (var n, r = -1; !(n = e.next()).done; ) if (++r === t) return n.value; }, worker: function (e) { const t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = new Worker(t); return Ae(n, () => { n.terminate(), URL.revokeObjectURL(t); }); }, }; function Ie(e, t) { return function (n) { var r, i, o, a, s, u, l, c, d = n[0], f = [], p = null, h = -1; for (s = 1, u = arguments.length; s < u; ++s) { if ((r = arguments[s]) instanceof Node) (f[++h] = r), (d += "\x3c!--o:" + h + "--\x3e"); else if (Array.isArray(r)) { for (l = 0, c = r.length; l < c; ++l) (i = r[l]) instanceof Node ? (null === p && ((f[++h] = p = document.createDocumentFragment()), (d += "\x3c!--o:" + h + "--\x3e")), p.appendChild(i)) : ((p = null), (d += i)); p = null; } else d += r; d += n[s]; } if (((p = e(d)), ++h > 0)) { for ( o = new Array(h), a = document.createTreeWalker(p, NodeFilter.SHOW_COMMENT, null, !1); a.nextNode(); ) (i = a.currentNode), /^o:/.test(i.nodeValue) && (o[+i.nodeValue.slice(2)] = i); for (s = 0; s < h; ++s) (i = o[s]) && i.parentNode.replaceChild(f[s], i); } return 1 === p.childNodes.length ? p.removeChild(p.firstChild) : 11 === p.nodeType ? ((i = t()).appendChild(p), i) : p; }; } var Fe = Ie( function (e) { var t = document.createElement("template"); return (t.innerHTML = e.trim()), document.importNode(t.content, !0); }, function () { return document.createElement("span"); }, ); const ze = "https://cdn.jsdelivr.net/npm/@observablehq/highlight.js@2.0.0/"; function Be(e) { return function () { return e("marked@0.3.12/marked.min.js").then(function (t) { return Ie( function (n) { var r = document.createElement("div"); r.innerHTML = t(n, { langPrefix: "" }).trim(); var i = r.querySelectorAll("pre code[class]"); return ( i.length > 0 && e(ze + "highlight.min.js").then(function (t) { i.forEach(function (n) { function r() { t.highlightBlock(n), n.parentNode.classList.add("observablehq--md-pre"); } t.getLanguage(n.className) ? r() : e(ze + "async-languages/index.js") .then((r) => { if (r.has(n.className)) return e( ze + "async-languages/" + r.get(n.className), ).then((e) => { t.registerLanguage(n.className, e); }); }) .then(r, r); }); }), r ); }, function () { return document.createElement("div"); }, ); }); }; } function He(e) { let t; Object.defineProperties(this, { generator: { value: Ue((e) => { t = e; }), }, value: { get: () => e, set: (n) => t((e = n)) }, }), void 0 !== e && t(e); } function* We() { for (;;) yield Date.now(); } var Ve = new Map(); function Ge(e, t) { var n; return (n = Ve.get((e = +e))) ? n.then(() => t) : (n = Date.now()) >= e ? Promise.resolve(t) : (function (e, t) { var n = new Promise(function (n) { Ve.delete(t); var r = t - e; if (!(r > 0)) throw new Error("invalid time"); if (r > 2147483647) throw new Error("too long to wait"); setTimeout(n, r); }); return Ve.set(t, n), n; })(n, e).then(() => t); } var Ke = { delay: function (e, t) { return new Promise(function (n) { setTimeout(function () { n(t); }, e); }); }, tick: function (e, t) { return Ge(Math.ceil((Date.now() + 1) / e) * e, t); }, when: Ge, }; function Ye(e, t) { if (/^(\w+:)|\/\//i.test(e)) return e; if (/^[.]{0,2}\//i.test(e)) return new URL(e, null == t ? location : t).href; if (!e.length || /^[\s._]/.test(e) || /\s$/.test(e)) throw new Error("illegal name"); return "https://unpkg.com/" + e; } function Je(e) { return null == e ? ye : Ee(e); } var Xe = Ie( function (e) { var t = document.createElementNS("http://www.w3.org/2000/svg", "g"); return (t.innerHTML = e.trim()), t; }, function () { return document.createElementNS("http://www.w3.org/2000/svg", "g"); }, ), Qe = String.raw; function Ze(e) { return new Promise(function (t, n) { var r = document.createElement("link"); (r.rel = "stylesheet"), (r.href = e), (r.onerror = n), (r.onload = t), document.head.appendChild(r); }); } function et(e) { return function () { return Promise.all([ e("@observablehq/katex@0.11.1/dist/katex.min.js"), e.resolve("@observablehq/katex@0.11.1/dist/katex.min.css").then(Ze), ]).then(function (e) { var t = e[0], n = r(); function r(e) { return function () { var n = document.createElement("div"); return ( t.render(Qe.apply(String, arguments), n, e), n.removeChild(n.firstChild) ); }; } return (n.options = r), (n.block = r({ displayMode: !0 })), n; }); }; } function tt(e) { return async () => { const [t, n, r] = await Promise.all( [ "vega@5.20.2/build/vega.min.js", "vega-lite@5.1.0/build/vega-lite.min.js", "vega-lite-api@5.0.0/build/vega-lite-api.min.js", ].map((t) => e(t)), ); return r.register(t, n); }; } function nt() { return Ue(function (e) { var t = e(document.body.clientWidth); function n() { var n = document.body.clientWidth; n !== t && e((t = n)); } return ( window.addEventListener("resize", n), function () { window.removeEventListener("resize", n); } ); }); } var rt = Object.assign( function (e) { const t = Je(e); var n; Object.defineProperties( this, ((n = { DOM: () => ke, FileAttachment: () => qe, Files: () => Oe, Generators: () => De, Inputs: () => t("@observablehq/inputs@0.8.0/dist/inputs.umd.min.js"), Mutable: () => He, Plot: () => t("@observablehq/plot@0.1.0/dist/plot.umd.min.js"), Promises: () => Ke, _: () => t("lodash@4.17.21/lodash.min.js"), d3: () => t("d3@6.7.0/dist/d3.min.js"), dot: () => t("@observablehq/graphviz@0.2.1/dist/graphviz.min.js"), htl: () => t("htl@0.2.5/dist/htl.min.js"), html: () => Fe, md: Be(t), now: We, require: () => t, resolve: () => Ye, svg: () => Xe, tex: et(t), vl: tt(t), width: nt, }), Object.fromEntries(Object.entries(n).map(it))), ); }, { resolve: ye.resolve }, ); function it([e, t]) { return [e, { value: t, writable: !0, enumerable: !0 }]; } function ot(e, t) { (this.message = e + ""), (this.input = t); } (ot.prototype = Object.create(Error.prototype)), (ot.prototype.name = "RuntimeError"), (ot.prototype.constructor = ot); var at = Array.prototype, st = at.map, ut = at.forEach; function lt(e) { return function () { return e; }; } function ct(e) { return e; } function dt() {} var ft = {}; function pt(e, t, n) { var r; n || (n = ft), Object.defineProperties(this, { _observer: { value: n, writable: !0 }, _definition: { value: vt, writable: !0 }, _duplicate: { value: void 0, writable: !0 }, _duplicates: { value: void 0, writable: !0 }, _indegree: { value: NaN, writable: !0 }, _inputs: { value: [], writable: !0 }, _invalidate: { value: dt, writable: !0 }, _module: { value: t }, _name: { value: null, writable: !0 }, _outputs: { value: new Set(), writable: !0 }, _promise: { value: Promise.resolve(void 0), writable: !0 }, _reachable: { value: n !== ft, writable: !0 }, _rejector: { value: ((r = this), function (e) { if (e === vt) throw new ot(r._name + " is not defined", r._name); if (e instanceof Error && e.message) throw new ot(e.message, r._name); throw new ot(r._name + " could not be resolved", r._name); }), }, _type: { value: e }, _value: { value: void 0, writable: !0 }, _version: { value: 0, writable: !0 }, }); } function ht(e) { e._module._runtime._dirty.add(e), e._outputs.add(this); } function mt(e) { e._module._runtime._dirty.add(e), e._outputs.delete(this); } function vt() { throw vt; } function bt(e) { return function () { throw new ot(e + " is defined more than once"); }; } function _t(e, t, n) { var r = this._module._scope, i = this._module._runtime; if ( (this._inputs.forEach(mt, this), t.forEach(ht, this), (this._inputs = t), (this._definition = n), (this._value = void 0), n === dt ? i._variables.delete(this) : i._variables.add(this), e !== this._name || r.get(e) !== this) ) { var o, a; if (this._name) if (this._outputs.size) r.delete(this._name), ((a = this._module._resolve(this._name))._outputs = this._outputs), (this._outputs = new Set()), a._outputs.forEach(function (e) { e._inputs[e._inputs.indexOf(this)] = a; }, this), a._outputs.forEach(i._updates.add, i._updates), i._dirty.add(a).add(this), r.set(this._name, a); else if ((a = r.get(this._name)) === this) r.delete(this._name); else { if (3 !== a._type) throw new Error(); a._duplicates.delete(this), (this._duplicate = void 0), 1 === a._duplicates.size && ((a = a._duplicates.keys().next().value), (o = r.get(this._name)), (a._outputs = o._outputs), (o._outputs = new Set()), a._outputs.forEach(function (e) { e._inputs[e._inputs.indexOf(o)] = a; }), (a._definition = a._duplicate), (a._duplicate = void 0), i._dirty.add(o).add(a), i._updates.add(a), r.set(this._name, a)); } if (this._outputs.size) throw new Error(); e && ((a = r.get(e)) ? 3 === a._type ? ((this._definition = bt(e)), (this._duplicate = n), a._duplicates.add(this)) : 2 === a._type ? ((this._outputs = a._outputs), (a._outputs = new Set()), this._outputs.forEach(function (e) { e._inputs[e._inputs.indexOf(a)] = this; }, this), i._dirty.add(a).add(this), r.set(e, this)) : ((a._duplicate = a._definition), (this._duplicate = n), ((o = new pt(3, this._module))._name = e), (o._definition = this._definition = a._definition = bt(e)), (o._outputs = a._outputs), (a._outputs = new Set()), o._outputs.forEach(function (e) { e._inputs[e._inputs.indexOf(a)] = o; }), (o._duplicates = new Set([this, a])), i._dirty.add(a).add(o), i._updates.add(a).add(o), r.set(e, o)) : r.set(e, this)), (this._name = e); } return i._updates.add(this), i._compute(), this; } function wt(e, t = []) { Object.defineProperties(this, { _runtime: { value: e }, _scope: { value: new Map() }, _builtins: { value: new Map([["invalidation", Et], ["visibility", xt], ...t]), }, _source: { value: null, writable: !0 }, }); } function gt(e) { return e._name; } Object.defineProperties(pt.prototype, { _pending: { value: function () { this._observer.pending && this._observer.pending(); }, writable: !0, configurable: !0, }, _fulfilled: { value: function (e) { this._observer.fulfilled && this._observer.fulfilled(e, this._name); }, writable: !0, configurable: !0, }, _rejected: { value: function (e) { this._observer.rejected && this._observer.rejected(e, this._name); }, writable: !0, configurable: !0, }, define: { value: function (e, t, n) { switch (arguments.length) { case 1: (n = e), (e = t = null); break; case 2: (n = t), "string" == typeof e ? (t = null) : ((t = e), (e = null)); } return _t.call( this, null == e ? null : e + "", null == t ? [] : st.call(t, this._module._resolve, this._module), "function" == typeof n ? n : lt(n), ); }, writable: !0, configurable: !0, }, delete: { value: function () { return _t.call(this, null, [], dt); }, writable: !0, configurable: !0, }, import: { value: function (e, t, n) { arguments.length < 3 && ((n = t), (t = e)); return _t.call(this, t + "", [n._resolve(e + "")], ct); }, writable: !0, configurable: !0, }, }), Object.defineProperties(wt.prototype, { _copy: { value: function (e, t) { (e._source = this), t.set(this, e); for (const [o, a] of this._scope) { var n = e._scope.get(o); if (!n || 1 !== n._type) if (a._definition === ct) { var r = a._inputs[0], i = r._module; e.import( r._name, o, t.get(i) || (i._source ? i._copy(new wt(e._runtime, e._builtins), t) : i), ); } else e.define(o, a._inputs.map(gt), a._definition); } return e; }, writable: !0, configurable: !0, }, _resolve: { value: function (e) { var t, n = this._scope.get(e); if (!n) if (((n = new pt(2, this)), this._builtins.has(e))) n.define(e, lt(this._builtins.get(e))); else if (this._runtime._builtin._scope.has(e)) n.import(e, this._runtime._builtin); else { try { t = this._runtime._global(e); } catch (t) { return n.define( e, ((r = t), function () { throw r; }), ); } void 0 === t ? this._scope.set((n._name = e), n) : n.define(e, lt(t)); } var r; return n; }, writable: !0, configurable: !0, }, redefine: { value: function (e) { var t = this._scope.get(e); if (!t) throw new ot(e + " is not defined"); if (3 === t._type) throw new ot(e + " is defined more than once"); return t.define.apply(t, arguments); }, writable: !0, configurable: !0, }, define: { value: function () { var e = new pt(1, this); return e.define.apply(e, arguments); }, writable: !0, configurable: !0, }, derive: { value: function (e, t) { var n = new wt(this._runtime, this._builtins); return ( (n._source = this), ut.call(e, function (e) { "object" != typeof e && (e = { name: e + "" }), null == e.alias && (e.alias = e.name), n.import(e.name, e.alias, t); }), Promise.resolve().then(() => { const e = new Set([this]); for (const t of e) for (const n of t._scope.values()) if (n._definition === ct) { const t = n._inputs[0]._module, r = t._source || t; if (r === this) return void console.warn( "circular module definition; ignoring", ); e.add(r); } this._copy(n, new Map()); }), n ); }, writable: !0, configurable: !0, }, import: { value: function () { var e = new pt(1, this); return e.import.apply(e, arguments); }, writable: !0, configurable: !0, }, value: { value: async function (e) { var t = this._scope.get(e); if (!t) throw new ot(e + " is not defined"); t._observer === ft && ((t._observer = !0), this._runtime._dirty.add(t)); return await this._runtime._compute(), t._promise; }, writable: !0, configurable: !0, }, variable: { value: function (e) { return new pt(1, this, e); }, writable: !0, configurable: !0, }, builtin: { value: function (e, t) { this._builtins.set(e, t); }, writable: !0, configurable: !0, }, }); const yt = "function" == typeof requestAnimationFrame ? requestAnimationFrame : setImmediate; var Et = {}, xt = {}; function Ct(e = new rt(), t = Ot) { var n = this.module(); if ( (Object.defineProperties(this, { _dirty: { value: new Set() }, _updates: { value: new Set() }, _computing: { value: null, writable: !0 }, _init: { value: null, writable: !0 }, _modules: { value: new Map() }, _variables: { value: new Set() }, _disposed: { value: !1, writable: !0 }, _builtin: { value: n }, _global: { value: t }, }), e) ) for (var r in e) new pt(2, n).define(r, [], e[r]); } function Nt(e) { const t = new Set(e._inputs); for (const n of t) { if (n === e) return !0; n._inputs.forEach(t.add, t); } return !1; } function jt(e) { ++e._indegree; } function Pt(e) { --e._indegree; } function St(e) { return e._promise.catch(e._rejector); } function qt(e) { return new Promise(function (t) { e._invalidate = t; }); } function Mt(e, t) { let n, r, i = "function" == typeof IntersectionObserver && t._observer && t._observer._node, o = !i, a = dt, s = dt; return ( i && ((r = new IntersectionObserver( ([e]) => (o = e.isIntersecting) && ((n = null), a()), )), r.observe(i), e.then(() => (r.disconnect(), (r = null), s()))), function (e) { return o ? Promise.resolve(e) : r ? (n || (n = new Promise((e, t) => ((a = e), (s = t)))), n.then(() => e)) : Promise.reject(); } ); } function Lt(e) { e._invalidate(), (e._invalidate = dt), e._pending(); var t = e._value, n = ++e._version, r = null, i = (e._promise = Promise.all(e._inputs.map(St)) .then(function (i) { if (e._version === n) { for (var o = 0, a = i.length; o < a; ++o) switch (i[o]) { case Et: i[o] = r = qt(e); break; case xt: r || (r = qt(e)), (i[o] = Mt(r, e)); } return e._definition.apply(t, i); } }) .then(function (t) { return (function (e) { return ( e && "function" == typeof e.next && "function" == typeof e.return ); })(t) ? e._version !== n ? void t.return() : ((r || qt(e)).then( ((o = t), function () { o.return(); }), ), (function (e, t, n, r) { function i() { var n = new Promise(function (e) { e(r.next()); }).then(function (r) { return r.done ? void 0 : Promise.resolve(r.value).then(function (r) { if (e._version === t) return $t(e, r, n).then(i), e._fulfilled(r), r; }); }); n.catch(function (r) { e._version === t && ($t(e, void 0, n), e._rejected(r)); }); } return new Promise(function (e) { e(r.next()); }).then(function (e) { if (!e.done) return n.then(i), e.value; }); })(e, n, i, t)) : t; var o; })); i.then( function (t) { e._version === n && ((e._value = t), e._fulfilled(t)); }, function (t) { e._version === n && ((e._value = void 0), e._rejected(t)); }, ); } function $t(e, t, n) { var r = e._module._runtime; return ( (e._value = t), (e._promise = n), e._outputs.forEach(r._updates.add, r._updates), r._compute() ); } function kt(e, t) { e._invalidate(), (e._invalidate = dt), e._pending(), ++e._version, (e._indegree = NaN), (e._promise = Promise.reject(t)).catch(dt), (e._value = void 0), e._rejected(t); } function Ot(e) { return window[e]; } Object.defineProperties(Ct, { load: { value: function (e, t, n) { if ( ("function" == typeof t && ((n = t), (t = null)), "function" != typeof n) ) throw new Error("invalid observer"); null == t && (t = new rt()); const { modules: r, id: i } = e, o = new Map(), a = new Ct(t), s = u(i); function u(e) { let t = o.get(e); return t || o.set(e, (t = a.module())), t; } for (const e of r) { const t = u(e.id); let r = 0; for (const i of e.variables) i.from ? t.import(i.remote, i.name, u(i.from)) : t === s ? t.variable(n(i, r, e.variables)).define(i.name, i.inputs, i.value) : t.define(i.name, i.inputs, i.value), ++r; } return a; }, writable: !0, configurable: !0, }, }), Object.defineProperties(Ct.prototype, { _compute: { value: function () { return this._computing || (this._computing = this._computeSoon()); }, writable: !0, configurable: !0, }, _computeSoon: { value: function () { var e = this; return new Promise(function (t) { yt(function () { t(), e._disposed || e._computeNow(); }); }); }, writable: !0, configurable: !0, }, _computeNow: { value: function () { var e, t, n = []; (e = new Set(this._dirty)).forEach(function (t) { t._inputs.forEach(e.add, e); const n = (function (e) { if (e._observer !== ft) return !0; var t = new Set(e._outputs); for (const e of t) { if (e._observer !== ft) return !0; e._outputs.forEach(t.add, t); } return !1; })(t); n > t._reachable ? this._updates.add(t) : n < t._reachable && t._invalidate(), (t._reachable = n); }, this), (e = new Set(this._updates)).forEach(function (t) { t._reachable ? ((t._indegree = 0), t._outputs.forEach(e.add, e)) : ((t._indegree = NaN), e.delete(t)); }), (this._computing = null), this._updates.clear(), this._dirty.clear(), e.forEach(function (e) { e._outputs.forEach(jt); }); do { for ( e.forEach(function (e) { 0 === e._indegree && n.push(e); }); (t = n.pop()); ) Lt(t), t._outputs.forEach(r), e.delete(t); e.forEach(function (t) { Nt(t) && (kt(t, new ot("circular definition")), t._outputs.forEach(Pt), e.delete(t)); }); } while (e.size); function r(e) { 0 == --e._indegree && n.push(e); } }, writable: !0, configurable: !0, }, dispose: { value: function () { (this._computing = Promise.resolve()), (this._disposed = !0), this._variables.forEach((e) => { e._invalidate(), (e._version = NaN); }); }, writable: !0, configurable: !0, }, module: { value: function (e, t = dt) { let n; if (void 0 === e) return (n = this._init) ? ((this._init = null), n) : new wt(this); if (((n = this._modules.get(e)), n)) return n; (this._init = n = new wt(this)), this._modules.set(e, n); try { e(this, t); } finally { this._init = null; } return n; }, writable: !0, configurable: !0, }, fileAttachments: { value: function (e) { return Object.assign( (t) => { const n = e((t += "")); if (null == n) throw new Error(`File not found: ${t}`); return new FileAttachment(n, t); }, { prototype: FileAttachment.prototype }, ); }, writable: !0, configurable: !0, }, }); export { ue as Inspector, rt as Library, Ct as Runtime, ot as RuntimeError }; ================================================ FILE: packages/site/docs/api/Algorithm.zh.md ================================================ --- title: 图算法 Algorithm order: 15 --- 图算法提供了一种最有效的分析关联数据的方法,它们描述了如何处理图以发现一些定性或者定量的结论。图算法基于图论,利用节点之间的关系来推断复杂系统的结构和变化。我们可以使用这些算法来发现隐藏的信息,验证业务假设,并对行为进行预测。 如果你对数据结构及算法感兴趣,可以通过 [javascript-algorithms](https://github.com/trekhleb/javascript-algorithms) 来进一步学习。 ### GADDI 图模式匹配 「v4.2.2」新特性 [GADDI 图模式匹配]()算法是一种支持结构和语义的图模式匹配算法,给定一个模式,可通过在算法在原数据上查找结果和语义相同、相似的结构。[DEMO](/zh/docs/examples/algorithm/algoDemos#gaddi)。 img **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------------- | --------- | -------- | --------------------------------------------- | | graphData | GraphData | true | 原图数据 | | pattern | GraphData | true | 需要查找的模式图数据 | | k | number | false | 匹配算法的参数,设置为 `undefined` 则自动设置 | | length | number | false | 匹配算法的参数,设置为 `undefined` 则自动设置 | | nodeLabelProp | number | false | 节点聚类信息的属性名,默认为 `'cluster'` | | edgeLabelProp | number | false | 边聚类信息的属性名,默认为 `'cluster'` | **用法** ```javascript import F6, { Algorithm } from "@antv/g6"; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); const graphData = { nodes: [ { id: "A", cluster: "nc1" }, { id: "B", cluster: "nc1" }, { id: "C", cluster: "nc2" }, { id: "D", cluster: "nc1" }, { id: "E", cluster: "nc3" }, ], edges: [ { source: "A", target: "B", cluster: "ec1" }, { source: "B", target: "C", cluster: "ec2" }, { source: "A", target: "D", cluster: "ec1" }, { source: "A", target: "E", cluster: "ec2" }, ], }; graph.data(data); graph.render(); const { GADDI } = Algorithm; const patternData = { nodes: [ { id: "pn1", cluster: "nc1" }, { id: "pn2", cluster: "nc1" }, { id: "pn3", cluster: "nc3" }, ], edges: [ { source: "pn1", target: "pn2", cluster: "ec1" }, { source: "pn1", target: "pn3", cluster: "ec2" }, ], }; const resultMatches = GADDI( graphData, patternData, true, undefined, undefined, "cluster", "cluster", ); console.log(resultMatches); // output: // [{ // nodes: [ // { id: 'A', cluster: 'nc1' }, // { id: 'B', cluster: 'nc1' }, // { id: 'E', cluster: 'nc3' },], // edges: [ // { source: 'A', target: 'B', cluster: 'ec1' }, // { source: 'A', target: 'E', cluster: 'ec2' } // ] // }] ``` ### depthFirstSearch [深度优先搜索](https://zh.wikipedia.org/wiki/%E6%B7%B1%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2)(Depth First Search,简称 DFS)算法是一种用于遍历或搜索树或图的算法。沿着树的深度遍历树的节点,尽可能深的搜索树的分支。当节点 v 的所在边都己被探寻过,搜索将回溯到发现节点 v 的那条边的起始节点。这一过程一直进行到已发现从源节点可达的所有节点为止。 img [图片来源](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/depth-first-search) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----------- | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | startNodeId | string | true | 开始访问的节点的 ID | | callbacks | IAlgorithmCallbacks | false | 遍历的回调函数 | **用法** ``` import F6, { Algorithm } from '@antv/g6' const graph = new F6.Graph({ container: 'container', width: 500, height: 500 }) const data = { nodes: [ { id: 'A' }, { id: 'B' }, { id: 'C' }, { id: 'D' }, { id: 'E' }, { id: 'F' }, { id: 'G' }, ], edges: [ { source: 'A', target: 'B' }, { source: 'B', target: 'C' }, { source: 'C', target: 'G' }, { source: 'A', target: 'D' }, { source: 'A', target: 'E' }, { source: 'E', target: 'F' }, { source: 'F', target: 'D' }, { source: 'D', target: 'G' }, ] } graph.data(data) graph.render() const { depthFirstSearch } = Algorithm depthFirstSearch(data, 'A', { enter: ({ current, previous }) => { // 开始遍历点的回调 }, leave: ({ current, previous }) => { // 遍历完节点的回调 }, }) ``` ### breadthFirstSearch [广度优先搜索](https://zh.wikipedia.org/zh/%E5%B9%BF%E5%BA%A6%E4%BC%98%E5%85%88%E6%90%9C%E7%B4%A2)算法(Breadth First Search,简称 BFS),又译作宽度优先搜索,或横向优先搜索,是一种图搜索算法。简单的说,BFS 是从根节点开始,沿着树的宽度遍历树的节点。如果所有节点均被访问,则算法中止。广度优先搜索的实现一般采用 open-closed 表。 img [图片来源](https://camo.githubusercontent.com/b8073f26dfdf1644e8a92312fff100341987a8f5/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f352f35642f427265616474682d46697273742d5365617263682d416c676f726974686d2e676966) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----------------- | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | startNodeId | string | true | 开始访问的节点的 ID | | originalCallbacks | IAlgorithmCallbacks | false | 遍历的回调函数 | **用法** ``` import F6, { Algorithm } from '@antv/g6' const graph = new F6.Graph({ container: 'container', width: 500, height: 500 }) const data = { nodes: [ { id: 'A' }, { id: 'B' }, { id: 'C' }, { id: 'D' }, { id: 'E' }, { id: 'F' }, { id: 'G' }, ], edges: [ { source: 'A', target: 'B' }, { source: 'B', target: 'C' }, { source: 'C', target: 'G' }, { source: 'A', target: 'D' }, { source: 'A', target: 'E' }, { source: 'E', target: 'F' }, { source: 'F', target: 'D' }, { source: 'D', target: 'G' }, ] } graph.data(data) graph.render() const { breadthFirstSearch } = Algorithm breadthFirstSearch(data, 'A', { enter: ({ current, previous }) => { // 开始遍历点的回调 }, leave: ({ current, previous }) => { // 遍历完节点的回调 }, }) ``` ### labelPropagation 标签传播算法,自动为数据聚类。优势:速度较 LOUVAIN 快。 参考资料:https://en.wikipedia.org/wiki/Label_propagation_algorithm **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------------------ | --------- | -------- | ------------------------------------------------------------------------ | | data | GraphData | true | 图数据 | | directed | Boolean | false | 是否是有向图,默认为 false | | weightPropertyName | String | false | 边权重的属名称,默认为 `'weight',若数据中没有权重,则默认每条边权重为 1 | | maxIteration | Number | false | 最大迭代次数,默认为 1000 | **返回值** 返回聚合数据,并为输入的 `data` 中的每个节点数据加上 `clusterId` 字段。聚合数据 `ClusterData` 类型如下: ```typescript interface ClusterData { clusters: { // 聚类数组 id: string; // 聚类 Id nodes: NodeConfig[]; // 该聚类包含的节点 }[]; clusterEdges: { // 聚类与聚类之间的边数组 source: string; // 起点聚类 id target: string; // 终点聚类 id count: number; // 该边所包含的真实边个数 }[]; } ``` 返回值示例: ```javascript { clusters: [ {id: 'cluster1', nodes: [ {id: 'node1', clusterId: 'cluster1'}, {id: 'node2', clusterId: 'cluster1'} ]}, {id: 'cluster2', nodes: [ {id: 'node3', clusterId: 'cluster2'} ]}, ], clusterEdges: [ {source: 'cluster1', target: 'cluster2', count: 10}, {source: 'cluster1', target: 'cluster1', count: 3}, ] } ``` **用法** ```javascript import F6, { Algorithm } from "@antv/g6"; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); const data = { nodes: [ { id: "A" }, { id: "B" }, { id: "C" }, { id: "D" }, { id: "E" }, { id: "F" }, { id: "G" }, ], edges: [ { source: "A", target: "B" }, { source: "B", target: "C" }, { source: "A", target: "C" }, { source: "D", arget: "A" }, { source: "D", target: "E" }, { source: "E", target: "F" }, ], }; graph.data(data); graph.render(); const { labelPropagation } = Algorithm; // result 中包含 clusters 与 clusterEdges 数组。data 中的每个节点数据将带有 clusterId 字段 let result = labelPropagation(data); ``` ### louvain LOUVAIN 自动聚类算法。优势:根据节点间的紧密程度计算,较之于 Label Propagation 更准确。 参考资料:https://en.wikipedia.org/wiki/Louvain_method **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------------------ | --------- | -------- | ------------------------------------------------------------------------ | | data | GraphData | true | 图数据 | | directed | Boolean | false | 是否是有向图,默认为 false | | weightPropertyName | String | false | 边权重的属名称,默认为 `'weight',若数据中没有权重,则默认每条边权重为 1 | | threshold | Number | false | 停止迭代的阈值,默认为 0.0001 | **返回值** 返回聚合数据,并为输入的 `data` 中的每个节点数据加上 `clusterId` 字段。聚合数据 `ClusterData` 类型如下: ```typescript interface ClusterData { clusters: { // 聚类数组 id: string; // 聚类 Id nodes: NodeConfig[]; // 该聚类包含的节点 sumTot?: number; // 该聚类内部边总数 }[]; clusterEdges: { // 聚类与聚类之间的边数组 source: string; // 起点聚类 id target: string; // 终点聚类 id count: number; // 该边所包含的真实边个数 }[]; } ``` 返回值示例: ```javascript { clusters: [ {id: 'cluster1', sumTot: 8, nodes: [ {id: 'node1', clusterId: 'cluster1'}, {id: 'node2', clusterId: 'cluster1'} ]}, {id: 'cluster2', sumTot: 15, nodes: [ {id: 'node3', clusterId: 'cluster2'} ]}, ], clusterEdges: [ {source: 'cluster1', target: 'cluster2', count: 10}, {source: 'cluster1', target: 'cluster1', count: 3}, ] } ``` **用法** ```javascript import F6, { Algorithm } from "@antv/g6"; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); const data = { nodes: [ { id: "A" }, { id: "B" }, { id: "C" }, { id: "D" }, { id: "E" }, { id: "F" }, { id: "G" }, ], edges: [ { source: "A", target: "B" }, { source: "B", target: "C" }, { source: "A", target: "C" }, { source: "D", arget: "A" }, { source: "D", target: "E" }, { source: "E", target: "F" }, ], }; graph.data(data); graph.render(); const { louvain } = Algorithm; // result 中包含 clusters 与 clusterEdges 数组。data 中的每个节点数据将带有 clusterId 字段 let result = louvain(data); ``` ### detectDirectedCycle 在给定的有向图中,检查是否包括圈。如果给定的图中至少包括一个圈,则返回包括的第一个圈,否则返回 null。 参考资料: - [detect-cycle-in-a-graph](https://www.geeksforgeeks.org/detect-cycle-in-a-graph/) - [detect-cycle](https://github.com/trekhleb/javascript-algorithms/tree/master/src/algorithms/graph/detect-cycle) **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | **返回值** 返回检测到的圈,否则返回 null。 **用法** ```javascript import F6, { Algorithm } from "@antv/g6"; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); const data = { nodes: [ { id: "A" }, { id: "B" }, { id: "C" }, { id: "D" }, { id: "E" }, { id: "F" }, { id: "G" }, ], edges: [ { source: "A", target: "B" }, { source: "B", target: "C" }, { source: "A", target: "C" }, { source: "D", arget: "A" }, { source: "D", target: "E" }, { source: "E", target: "F" }, ], }; graph.data(data); graph.render(); const { detectDirectedCycle } = Algorithm; // 此时图中没有环,result 为 null let result = detectDirectedCycle(data); // 当数据中加入 F->D 这条边后,图中有一个环 data.edges.push({ source: "F", target: "D", }); graph.changeData(data); // 返回数据 /** * { D: Node, F: Node, E: Node, } */ result = detectDirectedCycle(data); ``` ### detectAllCycles(graphData, directed, nodeIds, include) 提供支持寻找图中所有环路的函数。对有向图来说返回所有简单环,简单环是指路径上的节点都只出现一次的闭合路径;对于无向图来说,返回一组完备的[基本环](https://en.wikipedia.org/wiki/Cycle_basis)。 参考资料: - [检测无向图中的所有环](https://www.geeksforgeeks.org/print-all-the-cycles-in-an-undirected-graph/) - 检测所有有向图中的简单环: [Johnson's algorithm ](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF) **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | directed | boolean | false | 是否考虑边的方向性,若不指定,则取图的 `directed` 属性 | | | nodeIds | string[] | false | 需包含或排除的节点 ID 的数组,若不指定,则返回图中所有的圈 | | | include | boolean | false | 若为 `true`, 则返回包含参数 `nodeIds` 中指定的节点的圈,否则,返回所有不包含 `nodeIds` 中指定的节点的圈。默认为 `true` | | **返回值** - 返回值类型:[{[key: string]: Node}] - 返回一个数组表示检测到的所有符合条件的圈,每个环用一个 Object 表示,其中 key 为节点 id,value 为该节点在环中指向的下一个节点。 **用法** ```javascript const { detectAllCycles } = Algorithm; // 检测有向图中的所有简单环 const allCycles = detectAllCycles(data, true); // 检测有向图中包含节点 B 的所有简单环 const allCycleIncludeB = detectAllCycles(data, true, ["B"]); // 检测无向图中所有不包含节点 B 的所有基本环 const allCycleExcludeB = detectAllCycles(data, false, ["B"], false); ``` ### findShortestPath(graphData, start, end, directed, weightPropertyName) 查找两点之间的最短路径。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------------------ | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | start | INode / string | true | F6 Node 实例或 ID,路径起始点 | | | end | INode / string | true | F6 Node 实例或 ID,路径终点 | | | directed | boolean | false | 是否考虑边的方向性,若不指定,则取图的 `directed` 属性 | | | weightPropertyName | string | false | 边的权重属性字段名,若不指定,则认为所有边权重相同 | | **返回值** - 返回值类型:Object, ``` { length: number, // 最短路径长度 path: string[], allPath: string[][] // start 到 end 的所有的最短路径 } ``` - 返回的对象中,length 属性代表最短路径的长度,path 属性为构成一条最短路径的节点数组。 **用法** ```javascript const data = { nodes: [ { id: "A", label: "A", }, { id: "B", label: "B", }, { id: "C", label: "C", }, { id: "D", label: "D", }, { id: "E", label: "E", }, { id: "F", label: "F", }, { id: "G", label: "G", }, { id: "H", label: "H", }, ], edges: [ { source: "A", target: "B", }, { source: "B", target: "C", }, { source: "C", target: "G", }, { source: "A", target: "D", }, { source: "A", target: "E", }, { source: "E", target: "F", }, { source: "F", target: "D", }, { source: "D", target: "E", }, ], }; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); graph.data(data); graph.render(); const { findShortestPath } = Algorithm; // 不考虑边的方向性,查找节点 A 和 节点 C 之间的最短路径 const { length, path, allPath } = findShortestPath(data, "A", "C"); console.log(length, path); // 期望输出:2, ['A', 'B', 'C'] ``` ### findAllPath(graphData, start, end, directed) 查找两点之间的所有路径。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | start | INode / string | true | F6 Node 实例或 ID,路径起始点 | | | end | INode / string | true | F6 Node 实例或 ID,路径终点 | | | directed | boolean | false | 是否考虑边的方向性,若不指定,则取图的 `directed` 属性 | | **返回值** - 返回值类型:string[][] - 返回包含两个节点之间所有路径的数组,每条路径由节点 ID 数组表示 **用法** ```javascript const data = { nodes: [ { id: "A", label: "A", }, { id: "B", label: "B", }, { id: "C", label: "C", }, { id: "D", label: "D", }, { id: "E", label: "E", }, { id: "F", label: "F", }, { id: "G", label: "G", }, { id: "H", label: "H", }, ], edges: [ { source: "A", target: "B", }, { source: "B", target: "C", }, { source: "C", target: "G", }, { source: "A", target: "D", }, { source: "A", target: "E", }, { source: "E", target: "F", }, { source: "F", target: "D", }, { source: "D", target: "E", }, ], }; const graph = new F6.Graph({ container: "container", width: 500, height: 500, }); graph.data(data); graph.render(); const { findAllPath } = Algorithm; const allPath = findAllPath(data, "A", "E"); console.log(allPath); // 期望输出值:[['A', 'D', 'F', 'E'], ['A', 'D', 'E'], ['A', 'E']] ``` ### getConnectedComponents 返回图中的连通分量。若为无向图,连通分量指图中的极大连通子图,连通子图中任何两个顶点之间通过路径相互连接;若为有向图,则返回所有强连通分量,强连通分量指有向图中的极大强连通子图,强连通子图中任何两个节点之间都存在一条可达到彼此的有向路径。 参考资料: - 检测有向图中的强连通分量:[Tarjan's Algorithm](http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm) **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | directed | boolean | false | 是否考虑边的方向性,若不指定,则取图的 `directed` 属性 | | **返回值** - 返回值类型:INode[][] - 返回一个数组表示检测到的所有连通分量,每个连通分量为节点数组。 **用法** ```javascript const data = { nodes: [ { id: "A", }, { id: "B", }, { id: "C", }, { id: "D", }, { id: "E", }, { id: "F", }, { id: "G", }, { id: "H", }, ], edges: [ { source: "A", target: "B", }, { source: "B", target: "C", }, { source: "A", target: "C", }, { source: "D", target: "A", }, { source: "D", target: "E", }, { source: "E", target: "F", }, { source: "F", target: "D", }, { source: "G", target: "H", }, { source: "H", target: "G", }, ], }; const graph = new F6.Graph({ container: "container", width: 500, height: 400, }); graph.data(data); graph.render(); // 图中的连通分量 const components = getConnectedComponents(data, false); components.forEach((component) => { console.log(component.map((node) => node.get("id"))); }); // 期望输出结果:['A', 'B', 'C', 'D', 'E', 'F'], ['G', 'H'] // 有向图中的强连通分量 const components2 = getConnectedComponents(data, true); components2.forEach((component) => { console.log(component.map((node) => node.get("id"))); }); // 期望输出结果:['A'], ['B'], ['C'], ['D', 'E', 'F'], ['G', 'H'] ``` ### pageRank PageRank 可以用来度量网络中节点的重要性,最初用于标识网页的重要性,对网页进行排序。PageRank 算法假设当前节点的重要性是由指向它的其他节点的重要性决定的,一个节点接收到的来自其他节点的入链 (inbound) 越多,则越重要,每个入链的权重由提供入链的节点的重要性决定。 因此 PageRank 除了考虑到入链数量,还参考了入链“质量”。PageRank 通过迭代递归计算来更新每个节点的得分,直到得分稳定为止。 参考资料: - [PageRank](https://en.wikipedia.org/wiki/PageRank) **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------- | | graphData | GraphData | true | 图数据,满足 F6 [数据格式](/zh/docs/manual/getting-started#step-2-数据准备)。注意,4.1 以前的版本该参数请传入图实例 | | epsilon | number | false | 判断 PageRank 得分是否稳定的精度值,默认 0.000001 | | | linkProb | number | false | 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点指向的节点的概率,默认 0.85。 | | **返回值** - 返回值类型:Object, {[key: string]: number} - 返回一个对象,表示节点 ID 对应的该节点的 PageRank 值。 ================================================ FILE: packages/site/docs/api/Behavior.zh.md ================================================ --- title: 复合交互及其自定义 Behavior order: 13 --- Behavior 指 F6 中的复合交互,一般 Behavior 包含一个或多个事件的监听与处理以及一系列对图中元素的操作。 Behavior 默认包含 `shouldBegin`,`shouldUpdate`,`shouldEnd` 三个回调,代表是否开始行为,是否更新元素,是否进行结束行为,当返回值为 `false` 时阻止默认行为。 所有内置 Behavior 及其参数参见 [内置的 Behavior 教程](/zh/docs/manual/middle/states/defaultBehavior)。当 [内置 Behavior](/zh/docs/manual/middle/states/defaultBehavior) 不能满足需求时,使用 `registerBehavior(behaviorName, behavior)` 方法注册自定义的交互行为。详见 [Behavior API](/zh/docs/api/Behavior)。本文将介绍如何自定义 Behavior。 ```ts // highlight-start F6.registerBehavior(behaviorName: string, behavior: BehaviorOption) // highlight-end // Custom a type of Behavior F6.registerBehavior('behaviorName', { // Bind the event and its callback getEvents() { return { 'node:tap': 'onTap', mousemove: 'onMousemove', 'edge:tap': 'onEdgeTap', }; }, /** * Handle the callback for node:tap * @override * @param {Object} evt The handler */ onTap(evt) { const node = evt.item; const graph = this.graph; const point = { x: evt.x, y: evt.y }; const model = node.getModel(); // TODO }, /** * Handle the callback for mousemove * @override * @param {Object} evt The handler */ onMousemove(evt) { // TODO }, /** * Handle the callback for :tap * @override * @param {Object} evt The handler */ onEdgeTap(evt) { // TODO }, }); ``` ## 参数 | 名称 | 类型 | 是否必选 | 描述 | | ------------ | -------------- | -------- | ------------------------------------------------------------------------------------------------------- | | behaviorName | String | true | 自定义 Behavior 的名称。 | | behavior | BehaviorOption | true | 自定义 behavior 时的配置项,配置项中包括的方法及作用具体请参考:[Behavior API](/zh/docs/api/Behavior)。 | ### BehaviorOption.getEvents() 自定义 Behavior 时,定义事件及处理事件的方法。 `getEvents()` 方法中可以使用的事件请参考[Event 文档](/zh/docs/api/Event)。 **用法** ```javascript F6.registerBehavior('behaviorName', { getEvents() { return { 'node:tap': 'onNodeTap', 'edge:tap': 'onEdgeTap', 'mousemove': 'onMouseMove' } } } ``` ### BehaviorOption.onNodeTap(evt) `onNodeTap`、`onEdgeTap` 和 `onMouseMove` 都属于自定义方法,用于处理 `node:tap`、`edge:tap`、`mousemove` 事件。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ----- | -------- | -------------------------------------- | | evt | Event | 否 | 包含事件句柄、当前操作对象及各坐标值等 | **参数 `evt` 包括以下属性:** | 名称 | 类型 | 描述 | | ---------------- | ---------- | ------------------ | | x | Number | 元素视口 x 坐标 | | y | Number | 元素视口 y 坐标 | | canvasX | Number | 元素 Canvas x 坐标 | | canvasY | Number | 元素 Canvas y 坐标 | | clientX | Number | 屏幕/页面 x 坐标 | | clientY | Number | 屏幕/页面 y 坐标 | | event | MouseEvent | 事件句柄 | | target | Shape | 当前对象 | | type | String | 操作类型 | | currentTarget | Object | | | item | Shape | 操作的目标元素 | | removed | Boolean | 是否删除/销毁 | | timeStamp | Number | 时间戳 | | bubbles | Boolean | 是否支持事件冒泡 | | defaultPrevented | Boolean | 是否阻止默认事件 | | cancelable | Boolean | 是否取消 | **用法** ```javascript F6.registerBehavior("behaviorName", { getEvents() { return { "node:tap": "onNodeTap", "edge:tap": "onEdgeTap", mousemove: "onMouseMove", }; }, onNodeTap(evt) { // TODO }, onEdgeTap(evt) { // TODO }, onMouseMove(evt) { // TODO }, }); ``` ### BehaviorOption.getDefaultCfg() 定义自定义 Behavior 时的默认参数,会与用户传入的参数进行合并。 **提示:该方法是可选的**。 **用法** ```javascript F6.registerBehavior('behaviorName', { getDefaultCfg() { return { trigger: 'click' // mouseneter or click } } } ``` ### BehaviorOption.shouldBegin(evt) 是否阻止行为发生,默认返回 `true`,不阻止行为,需要在处理逻辑中自行调用。 **用法** ```javascript F6.registerBehavior('behaviorName', { shouldBegin() { // 这里可以根据业务自定义 return true } } ``` ### BehaviorOption.shouldUpdate(evt) 是否更新数据及更改视图,默认返回 `true`,允许更新,如果返回 `false`,则不更新数据和视图。 **用法** ```javascript const graph = new F6.Graph({ ... width: 500, height: 500, modes: { default: [ 'drag-canvas', { type: 'self-behavior', shouldUpdate: (e) => { if (e.target.type !== 'text') { return false; } return true; }, }, ], }, }); ``` ### BehaviorOption.shouldEnd(evt) 是否结束行为,默认返回 `true`。 ================================================ FILE: packages/site/docs/api/Event.zh.md ================================================ --- title: 基础事件 Event order: 12 --- 本章介绍的事件可以通过 [graph.on](/zh/docs/api/graphFunc/on_off#graphoneventname-handler) 与 [graph.off](/zh/docs/api/graphFunc/on_off#graphoffeventname-handler) 进行绑定/解绑监听函数。 通用事件、Node 事件、Edge 事件及 Canvas 事件回调的参数请参考 [Behavior API](/zh/docs/api/Behavior)。 ## 交互事件 使用如下形式进行交互事件的监听: ``` graph.on(eventName, evt => { // 一些操作 }) ``` 其中,事件对象 `evt` 的属性值有: - `type`: 事件类型 - `name`: 事件名称 - `x`: 画布上的 x 坐标 - `y`: 画布上的 y 坐标 - `clientX`: 浏览器窗口上的 x 坐标 - `clientY`: 浏览器窗口上的 y 坐标 - `canvasX`: 画布父容器视口上的 x 坐标 - `canvasY`: 画布父容器视口上的 y 坐标 (x/y,clientX/clientY,canvasX/canvasY 三套坐标系详解见 [F6 坐标系深度解析](/zh/docs/manual/advanced/coordinate-system)) - `item`: 事件的触发元素(节点/边/ Combo) - `target`: 事件的触发图形 [Shape](/zh/docs/manual/middle/elements/shape/shape-keyshape) 或画布对象 - `bubbles`: 是否允许冒泡 - `defaultPrevented`: 是否阻止了原生事件 - `originalEvent`: 原始浏览器事件对象 - `timeStamp`: 触发事件的时间 - `propagationStopped`: 是否阻止传播(向上冒泡) - `propagationPath`: 触发事件的路径 `eventName` 见下方内容。 ### 通用交互事件 | 事件名称 | 描述 | | --------- | -------------------------------------------------------------------------------------------------- | | tap | 点击设备屏幕 | | dbltap | 快速点击两次设备屏幕 | | dragstart | 当拖拽元素开始被拖拽的时候触发的事件,此事件作用在被拖曳元素上 | | drag | 当拖拽元素在拖动过程中时触发的事件,此事件作用于被拖拽元素上 | | dragend | 当拖拽完成后触发的事件,此事件作用在被拖曳元素上 | | dragenter | 当拖曳元素进入目标元素的时候触发的事件,此事件作用在目标元素上 | | dragleave | 当拖曳元素离开目标元素的时候触发的事件,此事件作用在目标元素上 | | drop | 被拖拽的元素在目标元素上同时放开触发的事件,此事件作用在目标元素上 | | panstart | 当手指触摸屏幕时候触发,即使已经有一个手指放在屏幕上也会触发 | | panmove | 当手指在屏幕上滑动的时候连续地触发。在这个事件发生期间,调用 `preventDefault()` 事件可以阻止滚动。 | | panend | 当手指从屏幕上离开的时候触发 | ### Node 交互事件 | 事件名称 | 描述 | | -------------- | ------------------------------------------------------------------ | | node:tap | 点击设备屏幕触发 | | node:dbltap | 快速双击屏幕触发 | | node:dragstart | 当节点开始被拖拽的时候触发的事件,此事件作用在被拖曳节点上 | | node:drag | 当节点在拖动过程中时触发的事件,此事件作用于被拖拽节点上 | | node:dragend | 当拖拽完成后触发的事件,此事件作用在被拖曳节点上 | | node:dragenter | 当拖曳节点进入目标元素的时候触发的事件,此事件作用在目标元素上 | | node:dragleave | 当拖曳节点离开目标元素的时候触发的事件,此事件作用在目标元素上 | | node:dragover | 当拖曳节点在另一目标元素上移动时触发此事件,此事件作用在目标元素上 | | node:drop | 被拖拽的节点在目标元素上同时放开触发的事件,此事件作用在目标元素上 | | node:panstart | 在触控屏上,当节点开始被触碰的时候触发的事件 | | node:panmove | 在触控屏上,当节点开始被触碰过程中触发的事件 | | node:panend | 在触控屏上,当节点开始被触碰结束的时候触发的事件 | ### Edge 交互事件 | 事件名称 | 描述 | | -------------- | ---------------------------------------------------------------------- | | edge:tap | 点击设备屏幕触发 | | edge:dbltap | 快速双击屏幕触发 | | edge:dragenter | 当拖曳元素进入目标边元素的时候触发的事件,此事件作用在目标边元素上 | | edge:dragleave | 当拖曳元素离开目标边元素的时候触发的事件,此事件作用在目标边元素上 | | edge:dragover | 当拖曳元素在另一目标边上移动时触发此事件,此事件作用在目标边元素上 | | edge:drop | 被拖拽的元素在目标边元素上同时放开触发的事件,此事件作用在目标边元素上 | ### Combo 交互事件 Combo 继承所有 Node 事件。 ### Canvas 交互事件 | 事件名称 | 描述 | | ---------------- | ------------------------------------------------------------------ | | canvas:tap | 点击画布时触发 | | canvas:dbltap | 双击画布时触发 | | canvas:dragstart | 当画布开始被拖拽的时候触发的事件,此事件作用在被拖曳画布上 | | canvas:drag | 当画布在拖动过程中时触发的事件,此事件作用于被拖拽画布上 | | canvas:dragend | 当拖拽完成后触发的事件,此事件作用在被拖曳画布上 | | canvas:dragenter | 当拖曳画布进入目标元素的时候触发的事件,此事件作用在目标画布上 | | canvas:dragleave | 当拖曳画布离开目标元素的时候触发的事件,此事件作用在目标画布上 | | canvas:drop | 被拖拽的元素在空白画布上同时放开触发的事件,此事件作用在目标画布上 | | canvas:panstart | 在触控屏上,当画布开始被触碰的时候触发的事件 | | canvas:panmove | 在触控屏上,当画布开始被触碰过程中触发的事件 | | canvas:panend | 在触控屏上,当画布开始被触碰结束的时候触发的事件 | ## 时机事件 用于监听图的某方法调用前后的时机。使用如下形式进行交互事件的监听: ``` graph.on(timingEventName, evt => { // 一些操作 }) ``` `timingEventName` 见下方内容。 | 事件名称 | 描述 | | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | beforerender | 调用 `graph.render` / `graph.read` 方法之前触发 | | afterrender | 调用 `graph.render` / `graph.read` 方法之后触发 | | beforeadditem | 调用 `graph.add` / `graph.addItem` 方法之前触发 | | afteradditem | 调用 `graph.add` / `graph.addItem` 方法之后触发 | | beforeremoveitem | 调用 `graph.remove` / `graph.removeItem` 方法之前触发 | | afterremoveitem | 调用 `graph.remove` / `graph.removeItem` 方法之后触发 | | beforeupdateitem | 调用 `graph.update` / `graph.updateItem` 方法之前触发 | | afterupdateitem | 调用 `graph.update` / `graph.updateItem` 方法之后触发 | | beforeitemvisibilitychange | 调用 `graph.showItem` / `graph.hideItem` 方法之前触发 | | afteritemvisibilitychange | 调用 `graph.showItem` / `graph.hideItem` 方法之后触发 | | beforeitemstatechange | 调用 `graph.setItemState` 方法之前触发 | | afteritemstatechange | 调用 `graph.setItemState` 方法之后触发 | | beforeitemrefresh | 调用 `graph.refreshItem` 方法之前触发 | | afteritemrefresh | 调用 `graph.refreshItem` 方法之后触发 | | beforeitemstatesclear | 调用 `graph.clearItemStates` 方法之前触发 | | afteritemstatesclear | 调用 `graph.clearItemStates` 方法之后触发 | | beforemodechange | 调用 `graph.setMode` / `graph.addBehaviors` / `graph.removeBehaviors` 方法之前触发 | | aftermodechange | 调用 `graph.setMode` / `graph.addBehaviors` / `graph.removeBehaviors` 方法之后触发 | | beforelayout | 布局前触发。调用 `graph.render` 时会进行布局,因此 `render` 时会触发。或用户主动调用图的 `graph.layout` 时触发。 | | afterlayout | 布局完成后触发。调用 `graph.render` 时会进行布局,因此 `render` 时布局完成后会触发。或用户主动调用图的 `graph.layout` 时布局完成后触发。 | | beforegraphrefreshposition | `graph.refreshPositions` 被调用前触发 | | aftergraphrefreshposition | `graph.refreshPositions` 被调用后触发 | | beforegraphrefresh | `graph.refresh` 被调用前触发 | | aftergraphrefresh | `graph.refresh` 被调用后触发 | | beforeanimate | 全局动画发生前触发 | | afteranimate | 全局动画发生后触发 | | beforecreateedge | 使用内置交互 `create-edge`,创建边之前触发 | | aftercreateedge | 使用内置交互 `create-edge`,创建边之后触发 | | beforecollapseexpandcombo | 当一个 combo 被收起或展开之前被触发,参数 `action` 指明了是收起还是展开 | | aftercollapseexpandcombo | 当一个 combo 被收起或展开之后被触发,参数 `action` 指明了是收起还是展开 | | graphstatechange | 调用 `graph.updateItemState` 方法之后触发 | | afteractivaterelations | 使用了 `'activate-relations'` Behavior 并触发了该行为后,该事件被触发 | | nodeselectchange | 使用了 `'brush-select'` , `'click-select'` 或 `'lasso-select'` Behavior 且选中元素发生变化时,该事件被触发 | | itemcollapsed | 在 TreeGraph 上使用了 `'collapse-expand'` Behavior 并触发了该行为后,该事件被触发 | | tooltipchange | 使用了 `'tooltip'` 或 `'edge-tooltip'` Behavior 且 tooltip 的显示/隐藏被改变后,该事件被触发 | | wheelzoom | 使用了 `'zoom-canvas'` Behavior 并用滚轮对图进行缩放后,该事件被触发 | | viewportchange | 调用 `graph.moveTo`,`graph.translate`,或 `graph.zoom` 均会触发该事件 | | dragnodeend | 使用了 `'drag-node'` Behavior,当拖动结束时,该事件被触发 | | stackchange | 撤销/重做栈发生变化时,该事件触发 | **插件中的时机事件** TimeBar 插件: | 事件名称 | 描述 | | ---------------- | ------------------------------ | | valuechange | 时间轴的时间范围发生变化时触发 | | timebarstartplay | 时间轴开始播放时触发 | | timebarendplay | 时间轴播放结束时触发 | Tooltip 插件: | 事件名称 | 描述 | | ------------- | ---------------------- | | tooltipchange | Tooltip 发生变化时触发 | ### 回调参数 不同时机监听事件的回调参数不同,下面针对各个自定义事件的回调参数进行说明。 #### beforerender / afterrender 无参数 #### beforeadditem | 名称 | 类型 | 描述 | | ----- | ------ | -------------- | | type | String | 当前添加的类型 | | model | Object | item 数据模型 | #### afteradditem | 名称 | 类型 | 描述 | | ----- | ------ | -------------------- | | item | Item | 已经添加的 item 实例 | | model | Object | item 数据模型 | #### beforeremoveitem / afterremoveitem | 名称 | 类型 | 描述 | | ---- | ---- | ------------------ | | item | Item | 要删除的 item 实例 | #### beforeupdateitem / afterupdateitem | 名称 | 类型 | 描述 | | ----- | ------ | ------------------ | | item | Item | 要更新的 item 实例 | | model | Object | item 数据模型 | #### beforeitemvisibilitychange / afteritemvisibilitychange | 名称 | 类型 | 描述 | | ------- | ------- | ----------------------------------------- | | item | Item | 当前操作的 item 实例 | | visible | Boolean | 是否可见,`true` 为可见,`false` 为不可见 | #### beforeitemstatechange / afteritemstatechange | 名称 | 类型 | 描述 | | ------- | ------- | ----------------------------------------- | | item | Item | 当前操作的 item 实例 | | state | String | 状态 | | enalbed | Boolean | 状态是否可用,`true` 可用,`false` 不可用 | #### beforeitemstatesclear / afteritemstatesclear | 名称 | 类型 | 描述 | | ------ | -------------- | -------------------- | | item | Item | 当前操作的 item 实例 | | states | Array / String | 需要批量清除的状态 | #### beforemodechange / aftermodechange | 名称 | 类型 | 描述 | | ---- | ------ | -------------- | | mode | String | 当前的模式名称 | #### beforeitemrefresh / afteritemrefresh | 名称 | 类型 | 描述 | | ---- | ---- | -------------------- | | item | Item | 当前操作的 item 实例 | #### beforelayout / afterlayout 无参数 #### graphstatechange | 名称 | 类型 | 描述 | | ------ | ------ | ---------------------------------------------------------------------------- | | states | Object | 当前各个状态下的元素,格式举例 `{ hover: [Node, Node], selected: [ Node ] }` | #### afteractivaterelations | 名称 | 类型 | 描述 | | ------ | ------ | -------------------- | | item | Item | 当前操作的 item 实例 | | action | String | 当前操作名 | #### nodeselectchange | 名称 | 类型 | 描述 | | ------------- | ------ | ---------------------------------------------------------------- | | target | Item | 当前操作的 item 实例 | | selectedItems | Object | 当前被选中的所有 item 实例,形如 `{ nodes: [...], edges: [...]}` | #### beforecreateedge / aftercreateedge `beforecreateedge` 无参数。`aftercreateedge` 参数如下: | 名称 | 类型 | 描述 | | ---- | ---- | ------------------ | | edge | Item | 当前被创建的边实例 | #### beforecollapseexpandcombo / aftercollapseexpandcombo | 名称 | 类型 | 描述 | | ------ | ------ | --------------------------------------- | | action | string | 具体的操作, `'collapse'` 或 `'expand'` | | combo | Item | 被操作的 combo item | #### itemcollapsed | 名称 | 类型 | 描述 | | --------- | ------- | ------------------------------------- | | item | Item | 当前操作的 item 实例 | | collapsed | Boolean | 当前操作后,操作对象的 collapsed 状态 | #### tooltipchange | 名称 | 类型 | 描述 | | ------ | ------ | --------------------------------------------- | | item | Item | 当前操作的 item 实例 | | action | String | tooltip 当前是显示 `'show'` 还是隐藏 `'hide'` | #### wheelzoom | 名称 | 类型 | 描述 | | -------------------------- | ------ | ------------------------------------------------------------ | | deltaX | Number | 滚动的 x 方向,取值 `1`,`0`,`-1`,`0` 代表没有该方向的滚动 | | deltaY | Number | 滚动的 y 方向,取值 `1`,`0`,`-1`,`0` 代表没有该方向的滚动 | | ... 其他滚轮事件的回调参数 | | | #### viewportchange | 名称 | 类型 | 描述 | | ------ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | action | 'translate' / 'move' / 'zoom' | 视窗变换的类型,`'translate'`、`'move'`、`'zoom'` 分别标识该时机是由 `graph.translate`、`graph.move`、还是 `graph.zoom` 函数的调用而产生 | | matrix | Array | 视窗变换后的图的矩阵 | #### dragnodeend | 名称 | 类型 | 描述 | | ---------- | --------------- | ------------------------------------------------------- | | items | Item[] | 当前操作的 item 实例 | | targetItem | null/Node/Combo | 拖动节点结束后,节点是放到 canvas、Node 还是 Combo 上面 | #### stackchange | 名称 | 类型 | 描述 | | --------- | -------- | -------- | | redoStack | Object[] | 重做堆栈 | | undoStack | Object[] | 撤销堆栈 | #### valuechange | 名称 | 类型 | 描述 | | ----- | -------- | ------------------------------------------------------------ | | value | number[] | 时间轴当前时间范围,`value[0]` 为起始值,`value[1]` 为结束值 | #### timelinestart / timelineend 无参数 #### tooltipchange | 名称 | 类型 | 描述 | | ------ | --------------- | -------------------------------- | | item | Item | tooltip 所关联的元素(节点/边) | | action | 'show' / 'hide' | tooltip 当前的变化时显示还是隐藏 | ================================================ FILE: packages/site/docs/api/Graph.zh.md ================================================ --- title: 图配置 F6.Graph(cfg) order: 0 redirect_from: - /en/docs/api --- Graph 是 F6 图表的载体,所有的 F6 节点实例操作以及事件,行为监听都在 Graph 实例上进行。Graph 的初始化通过 new 进行实例化,实例化时需要传入需要的参数。 ```ts // highlight-start new F6.Graph(cfg: GraphOptions) => Graph // highlight-end const graph = new F6.Graph({ container: '', width: 500, height: 500, modes: { default: ['drag-canvas'], }, layout: { type: 'radial', unitRadius: 50, center: [500, 300], }, }); ``` ### GraphOptions.container _string | HTMLElement_ **required** 图的 DOM 容器,可以传入该 DOM 的 id 或者直接传入容器的 HTML 节点对象。 ### GraphOptions.width _Number_ **optional** 指定画布宽度,单位为 'px',默认为画布容器宽度。 ### GraphOptions.height _Number_ **optional** 指定画布高度,单位为 'px',默认为画布容器高度。 ### GraphOptions.fitView _Boolean_ **optional** _default:_ `false` 是否开启画布自适应。开启后图自动适配画布大小。 ### GraphOptions.fitViewPadding _Array | Number_ **optional** _default:_ `0` `fitView` 为 `true` 时生效。图适应画布时,指定四周的留白。
- 可以是一个值, 例如:`fitViewPadding: 20`
- 也可以是一个数组,例如:`fitViewPadding: [ 20, 40, 50, 20 ]`
当指定一个值时,四边的边距都相等,当指定数组时,数组内数值依次对应 上,右,下,左四边的边距。 ### GraphOptions.fitCenter _Boolean_ **optional** _default:_ `false` 开启后,图将会被平移,图的中心将对齐到画布中心,但不缩放。优先级低于 fitView。 ### GraphOptions.linkCenter _Boolean_ **optional** _default:_ `false` 指定边是否连入节点的中心。 ### GraphOptions.groupByTypes _Boolean_ **optional** _default:_ `true` 各种元素是否在一个分组内,决定节点和边的层级问题,默认情况下所有的节点在一个分组中,所有的边在一个分组中,当这个参数为 false 时,节点和边的层级根据生成的顺序确定。当使用 Combo 时,**必须**将其设置为 `false` 。 ### GraphOptions.autoPaint _Boolean_ **optional** _default:_ `true` 当图中元素更新,或视口变换时,是否自动重绘。建议在批量操作节点时关闭,以提高性能,完成批量操作后再打开,参见后面的 setAutoPaint() 方法。 ### GraphOptions.modes _Object_ **optional** _default:_ `{}` 设置画布的交互模式。详情可见 [交互模式 Mode](/zh/docs/manual/middle/states/mode) 文档。 #### GraphOptions.modes.default _Object_ **optional** _default:_ `[]` 画布默认的模式。详情可参见 [内置的 Behavior](/zh/docs/manual/middle/states/defaultBehavior) 文档。 ### GraphOptions.nodeStateStyles _Object_ **optional** _default:_ `{}` 各个状态下节点的样式,例如 `hover`、`selected`。 ### GraphOptions.edgeStateStyles _Object_ **optional** _default:_ `{}` 各个状态下边的样式,例如 `hover`、`selected`。 ### GraphOptions.comboStateStyles _Object_ **optional** _default:_ `{}` 各个状态下 Combo 的样式,例如 `hover`、`selected`。 ### GraphOptions.defaultNode _Object_ **optional** _default:_ `{}` 默认状态下节点的配置,比如 `type`, `size`, `color`。会被写入的 data 覆盖。 见 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 。 ### GraphOptions.defaultEdge _Object_ **optional** _default:_ `{}` 默认状态下边的配置,比如 `type`, `size`, `color`。会被写入的 data 覆盖。 见 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 。 ### GraphOptions.defaultCombo _Object_ **optional** _default:_ `{}` 默认状态下 Combo 的配置,比如 `type`, `color`。会被写入的 data 覆盖。见 [Combo 的通用属性](/zh/docs/manual/middle/elements/combos/defaultCombo#combo-的通用属性) 。 ### GraphOptions.plugins _Array _ **optional** _default:_ `[]` 向 graph 注册插件。插件机制请见:[插件](/zh/docs/manual/tutorial/plugins#插件) 。 ### GraphOptions.animate _Boolean _ **optional** _default:_ `false` 是否启用全局动画。 ### GraphOptions.animateCfg _Object_ **optional** _default:_ `{}` 动画配置项,仅在 `animate` 为 `true` 时有效。关于 `animateCfg` 的更多配置项参见[基础动画教程](/zh/docs/manual/advanced/animation#animatecfg)。 #### GraphOptions.animateCfg.onFrame _Function_ **optional** _default:_ `null` 回调函数,用于自定义节点运动路径,为空时线性运动。 #### GraphOptions.animateCfg.duration _Number_ **optional** _default:_ `500` 动画时长,单位为毫秒。 #### GraphOptions.animateCfg.easing _string_ **optional** _default:_ `easeLinear` 动画动效,可参见 d3 ease。 ### GraphOptions.minZoom _Number_ **optional** _default:_ `0.2` 最小缩放比例。 ### GraphOptions.maxZoom _Number_ **optional** _default:_ `10` 最大缩放比例。 ### GraphOptions.layout _Object_ **optional** _default:_ `{}` 布局配置项,使用 type 字段指定使用的布局方式,type 可取以下值:random, radial, mds, circular, fruchterman, force, gForce, forceAtlas2, dagre, concentric, grid。当实例化图时没有配置 `layout` 时: - 若数据中节点有位置信息(`x` 和 `y`),则按照数据的位置信息进行绘制; - 若数据中节点没有位置信息,则默认使用 Random Layout 进行布局。 每种布局方法的配置项不尽相同,具体参见 [Graph 内置布局](/zh/docs/api/F6/common/graphLayout)。 #### GraphOptions.layout.pipes **流水线子图布局** 在 `GraphOptions.layout` 中可配置 `pipes` 达到同时对不通过子图使用不同布局的目的。 img 在实例化图时配置 `layout.pipes` 数组,指定多个子图布局的布局类型(`type`)、布局参数、节点过滤函数(`nodesFilter`)。值得注意的是,若某些节点同时属于不同的子图(即这些节点在不同的子图的 `nodesFilter` 配置都返回为 `true`),则这些节点位置的计算将按照 `pipes` 数组顺序后者覆盖前者。 `pipes` 的数据类型为: ```javascript type Pipes = { // 该子图所使用的布局类型 type: | 'random' | 'radial' | 'mds' | 'circular' | 'fruchterman' | 'force' | 'gForce' | 'dagre' | 'concentric' | 'grid' | 'forceAtlas2', // 节点的筛选器,参数为节点数据,返回布尔值代表该节点是否在该子图中 nodesFilter: (node: NodeData) => boolean, // 布局对应的参数,详见各个布局的参数 ... }[]; ``` 使用方法如下: ```javascript layout: { pipes: [ { // 该子图所使用的布局类型 type: 'circular', // 根据节点的某个字段判断是否属于该子图 nodesFilter: (node) => node.subGraphId === '1' }, { type: 'grid', // 该 grid 布局的其他参数 begin: [100, 0], nodesFilter: (node) => node.subGraphId === '2' } ], }, ``` ### GraphOptions.renderer _'canvas' / 'svg' / 'mini' / 'mini-native' _ **optional** _default:_ `'canvas'` ### GraphOptions.enabledStack _boolean_ **optional** _default:_ `false` 是否启用 stack,即是否开启 redo & undo 功能。 ### GraphOptions.maxStep _number_ **optional** _default:_ `10` redo & undo 最大步数, 只有当 enabledStack 为 true 时才起作用。 ================================================ FILE: packages/site/docs/api/Group.zh.md ================================================ --- title: 图形分组 Graphics Group order: 10 --- 图形分组 Graphics Group(下文简称 Group) 类似于 SVG 中的 `` 标签:Group  是用来组合图形对象的容器。在 Group  上添加变换(例如剪裁、旋转、放缩、平移等)会应用到其所有的子元素上。在 Group  上添加属性(例如颜色、位置等)会被其所有的子元素继承。此外, Group 可以多层嵌套使用,因此可以用来定义复杂的对象。关于 Group 更详细的介绍请参考 [图形分组 Group](/zh/docs/manual/middle/elements/shape/graphics-group) 文档。 ## 获取元素的 group ```javascript // 获取元素(节点/边/Combo)的图形对象的容器 const group = item.getContainer(); // 等价于 const group = item.get("group"); ``` ## group 实例方法 ### group.addGroup(cfg) 向分组中添加新的分组。 **参数** | 名称 | 类型 | 说明 | | ---- | ------ | -------------------- | | cfg | Object | 分组到配置项,非必须 | 其中,`cfg` 不是必须指定到,它包括以下字段: | 名称 | 类型 | 说明 | | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | id | String | 图形分组的唯一标识,非必须指定,指定则必须唯一 | | name | String | 图形分组的标识,非必须指定,可以不唯一。在 F6 3.3 及以后版本中必须指定。另外,`name` 可以用于组内搜索到该元素:`const shape = group.find(element => element.get('name') === 'shape-name')`,find 函数用法见 [find(fn)](#findfn) | | capture | Boolean | 非必须指定,该图形分组是否可以被鼠标事件捕捉到,即是否能够响应各鼠标事件。非必须指定 | | visible | Boolean | 非必须指定,该图形分组是否可见。非必须指定,默认为 `true` | | draggable | Boolean | 非必须指定,该图形分组是否允许被拖拽。例如,自定义节点通过 `addGroup` 添加图形分组,当该图形分组的 `draggable` 值为 `true` 时,鼠标在该自定义节点的这个图形分组上才能够响应 `dragstart`,`drag`,与 `dragend` 事件;在实例化图时的 `modes` 中配置的 `'drag-node'` 交互才可以在该图形分组上进行拖拽时生效 | | zIndex | Number | 非必须指定,该图形分组的视觉层次 z-index。非必须指定。指定后,调用 `group.sort()` 可以对组内所有图形根据各自 zIndex 进行视觉层次的排序 | **用法** ```javascript // No configurations group.addGroup(); // Configured group.addGroup({ id: "groupId", draggable: true, // other configurations }); ``` ### group.addShape(type, cfgs) 向分组中添加新的图形。
⚠️ 注意: 在分组上添加的 clip, transform 等操作会影响到该分组中的所有图形。所有图形及其绘图属性请见 [Shape Doc](/zh/docs/manual/middle/elements/shape/shape-keyshape)。 **参数** | 名称 | 类型 | 说明 | | ---- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | type | String | 图元素类型,值可以为:`'rect'`、`'circle'`、`'fan'`、`'ellipse'`、`'marker'`、`'image'` 等,具体参考 [Shape 的类型及属性](/zh/docs/manual/middle/elements/shape/shape-and-properties) 教程 | | cfg | Object | 图元素的属性 | 其中,`cfg` 包括以下字段: | 名称 | 类型 | 说明 | | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | attrs | Object | 图形样式,必须配置,例如:`{x: 0, y: 10, fill: '#0f0'}` | | name | String | 图形的标识,可以不唯一。在 F6 3.3 及以后版本中必须指定。另外,`name` 可以用于组内搜索到该元素:`const shape = group.find(element => element.get('name') === 'shape-name')`,find 函数用法见 [find(fn)](#findfn) | | capture | Boolean | 该图形是否可以被鼠标事件捕捉到,即是否能够响应各鼠标事件。非必须指定 | | visible | Boolean | 该图形是否可见。非必须指定,默认为 `true` | | draggable | Boolean | 该图形是否允许被拖拽。例如,自定义节点通过 `addShape` 添加图形,当该图形的 `draggable` 值为 `true` 时,鼠标在该自定义节点的这个图形上才能够响应 `dragstart`,`drag`,与 `dragend` 事件;在实例化图时的 `modes` 中配置的 `'drag-node'` 交互才可以在该图形上进行拖拽时生效 | | zIndex | Number | 该图形的视觉层次 z-index。非必须指定。指定后,调用 `group.sort()` 可以对组内所有图形根据各自 zIndex 进行视觉层次的排序 | **用法** ```javascript group.addShape("rect", { attrs: { x: 0, // 必须配置 y: 0, // 必须配置 fill: "red", stroke: "red", shadowOffsetX: 10, shadowOffsetY: 10, shadowColor: "blue", shadowBlur: 10, opacity: 0.8, }, // must be assigned in F6. it can be any value you want name: "rect-shape", zIndex: 1, }); ``` ### group.contain(child) 该分组是否包含此元素。
返回值: Boolean **参数** | 名称 | 类型 | 说明 | | ----- | ------------- | ---------------------- | | child | Group / Shape | 子 Group 或 Shape 实例 | **用法** ```javascript const has = group.contain(child); ``` ### group.find(fn) 根据指定条件返回对应元素,**只返回符合条件的第一个元素**。 **参数** | 名称 | 类型 | 说明 | | ---- | -------- | -------------- | | fn | Function | 自定义回调函数 | **用法** ```javascript const child = group.find(function (item) { return item.attr("fill") === "red"; // 找到首个填充为红色的图形 }); ``` ### group.findById(id) 根据元素 ID 返回对应的实例。
返回值:Object。 **参数** | 名称 | 类型 | 说明 | | ---- | ------ | ------------- | | id | String | Group 实例 ID | **用法** ```javascript const group1 = group.findById("group1"); ``` ### group.findAll(fn) 返回所有符合条件的元素。
返回值: [ Object ] **参数** | 名称 | 类型 | 说明 | | ---- | -------- | -------------- | | fn | Function | 自定义回调函数 | **用法** ```javascript const children = group.findAll(function (item) { return item.get("id") < 10; // 获取所有id小于10的元素 }); ``` ### group.getShape(x,y) 返回该坐标点最上层的元素。
返回值: Object **参数** | 名称 | 类型 | 说明 | | ---- | ------ | ------ | | x | Number | x 坐标 | | y | Number | y 坐标 | **用法** ```javascript // 获取 (10, 30) 坐标点上层的元素 const element = group.getShape(10, 30); ``` ### group.getFirst() 获取该分组的第一个子元素。
返回值: Object **用法** ```javascript const child = group.getFirst(); // 等价于 const childrens = group.get("children"); const child = childrens[0]; ``` ### group.getLast() 获取该分组的最后一个子元素。
返回值: Object **用法** ```javascript const child = group.getLast(); // 等价于 const childrens = group.get("children"); const child = childrens[childrens.length - 1]; ``` ### group.getChildByIndex(index) 返回第 `index`  个子元素,从 `0` 开始计数。
返回值: Object **参数** | 名称 | 类型 | 说明 | | ----- | ------ | ------------------------ | | index | Number | 子元素的序号,默认为 `0` | **用法** ```javascript const child = group.getChildByIndex(2); ``` ### group.removeChild(child) 从分组中删除一个分组或一个图形。 **参数** | 名称 | 类型 | 说明 | | ----- | ------------- | ---------------------- | | child | Group / Shape | 子 group 或 Shape 实例 | **用法** ```javascript group.removeChild(child); ``` ### group.sort() 排序方法。
一般用于在设置子元素层叠顺序时使用。 典型使用场景:通过 `group.addShape()` 添加 `shape` 时,添加的每个 `shape` 都设置了 `index`,在最后调用 `group.sort()` 可以对添加的 `shape` 进行排序。 **用法** ```javascript group.sort(); ``` ### group.clear() 清除该组的所有子元素。 **用法** ```javascript group.clear(); ``` ================================================ FILE: packages/site/docs/api/Items/comboMethods.zh.md ================================================ --- title: combo 实例方法 order: 3 --- Combo 继承自 Node,具有 Node 的所有特性。本文仅介绍 Combo 类的通用方法,内置节点见 [内置 Combo 文档](/zh/docs/manual/middle/elements/combos/defaultCombo) 和 [demo](/zh/docs/examples/item/defaultCombos),自定义节点见 [自定义 Combo 文档](/zh/docs/manual/middle/elements/combos/custom-combo) 和 [demo](/zh/docs/examples/item/customCombo)。 ### combo.getChildren() 获取 Combo 中所有的子元素,包括 Combo 和 Node。 **返回值** - 返回值为子 node 和 combo 的集合:`{ nodes: INode[], combos: ICombo[] }` **用法** ```javascript const elements = combo.getChildren(); ``` ###combo. getNodes() 获取 Combo 中所有子节点。 **返回值** - 返回值类型为 `INode[]`。 ###combo. getCombos() 获取 Combo 中所有子 combo。 **返回值** - 返回值类型为 `ICombo[]`。 ###combo. addChild(item: INode | ICombo) 向 Combo 中添加子 Node 或子 Combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | -------------- | -------- | ------------------- | | item | INode / ICombo | 是 | 节点或 Combo 的实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示添加成功。 **用法** ```javascript const node = graph.findById("node1"); // 如果返回结果为 true,则说明添加成功 const result = combo.addChild(node); ``` ###combo. addNode(node: string | INode) 向 combo 中添加节点。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | -------------- | -------- | ------------------ | | node | string / INode | 是 | 节点 ID 或节点实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示添加成功。 ###combo. addCombo(combo: ICombo) 向 combo 中添加 combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ---------- | | combo | ICombo | 是 | combo 实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示添加成功。 ###combo. removeChild(item: ICombo | INode) 移除子元素(子节点或子 combo)。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | -------------- | -------- | ------------------- | | item | INode / ICombo | 是 | 节点或 Combo 的实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示移除成功。 ###combo. removeCombo(combo: ICombo) 移除指定的子 combo。注意:移除后 `combo` 不再属于该父 Combo,但没有被删除。需要删除 `combo` 请调用 [graph.removeItem](/zh/docs/api/Graph#removeitemitem) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ------------ | | combo | ICombo | 是 | Combo 的实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示移除成功。 ###combo. removeNode(node: INode) 移除指定的子 Node。注意:移除后该节点不再属于该 Combo,但没有被删除。需要删除节点请调用 [graph.removeItem](/zh/docs/api/Graph#removeitemitem) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ----- | -------- | ------------------ | | node | INode | 是 | 节点 ID 或节点实例 | **返回值** - 类型: `boolean`; - 含义:返回 `true` 表示移除成功。 ================================================ FILE: packages/site/docs/api/Items/comboProperties.zh.md ================================================ --- title: Combo 配置项 order: 8 --- ### id _String_ **required** 一个 Combo 的唯一标识,**必须是 string 类型,必须唯一**。 ### parentId _String_ **optional** 该 Combo 的父 Combo 的 ID。 ### size _String_ **optional** Combo 的最小大小,默认 'circle' 类型 Combo 的 size 为 20,'rect' 类型的为 [20, 5]。 ### padding _Number | Number[]_ **optional** 该 Combo 内边距。 ### style _Object_ **optional** 该 Combo 的样式配置项,详见[内置 Combo 配置文档](/zh/docs/manual/middle/elements/combos/defaultCombo#样式属性-style)。 ### label _String_ **optional** 该 Combo 的文本标签。 ### labelCfg _Object_ **optional** 该 Combo 的文本标签样式配置项,详见[内置 Combo 配置文档](/zh/docs/manual/middle/elements/combos/defaultCombo#标签文本-label-及其配置-labelcfg)及各类型 Combo 的文档。 ### type _Object_ **optional** 指定该 Combo 的类型,可以是内置 Combo 的类型名,也可以是自定义 Combo 的类型名。默认是 'circle'。 | 名称 | 描述 | 默认示例 | | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | circle | 圆形:
- `size` 是单个数字,表示直径
- 圆心位置对应 Combo 的位置
- `color` 字段默认在描边上生效
- 标签文本默认在 Combo 正上方
- 更多字段见 [Circle](/zh/docs/manual/middle/elements/combos/built-in/circle) Combo 教程
- Demo | img | | rect | 矩形:
- `size` 是数组,例如:[100, 50]
- 矩形的中心位置是 COmbo 的位置,而不是左上角
- `color` 字段默认在描边上生效
- 标签文本默认在 Combo 左上角
- 更多字段见 [Rect](/zh/docs/manual/middle/elements/combos/built-in/rect) Combo 教程
- Demo | img | ## 内置 Combo 的特有属性 内置各个内置 Combo 的特有属性见 [内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo) 目录下各文档。 ================================================ FILE: packages/site/docs/api/Items/edgeMethods.zh.md ================================================ --- title: edge 实例方法 order: 2 --- Edge 继承自 Item。所以 Item 的方法在 Edge 实例中都可以使用。本文仅介绍 Edge 类的通用方法,内置边见 [内置边文档](/zh/docs/manual/middle/elements/edges/defaultEdge) 和 [demo](/zh/docs/examples/item/defaultEdges),自定义节点见 [自定义边文档](/zh/docs/manual/middle/elements/edges/custom-edge) 和 [demo](/zh/docs/examples/item/customEdge)。 ### edge.setSource(source) 设置边的起始节点。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ---- | -------- | ------------ | | source | Node | true | 起始节点实例 | **用法** ```javascript const edge = new Edge({ // ... }); const node = new Node({ // .. }); edge.setSource(node); ``` ### edge.setTarget(target) 设置边的终止节点。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ---- | -------- | ------------ | | target | Node | true | 终止节点实例 | **用法** ```javascript edge.setTarget(node); ``` ### edge.getSource() 获取当前边的起始节点。 **返回值** - 返回值类型:Node; - 返回值为起始节点的实例。 **用法** ```javascript const node = edge.getSource(); ``` ### edge.getTarget() 获取当前边的终止节点。 **返回值** - 返回值类型:Node; - 返回值为终止节点的实例。 **用法** ```javascript const node = edge.getTarget(); ``` ================================================ FILE: packages/site/docs/api/Items/edgeProperties.zh.md ================================================ --- title: 边配置项 order: 7 --- ## 边通用属性 ### id _String_ **required** 边唯一 ID,**必须**是唯一的 string。 ### source _String | Number_ **optional** 起始点 id 。 ### target _String | Number_ **optional** 结束点 id 。 ### type _String_ **optional** _default:_ `'line'` 指定边的类型,可以是内置边的类型名称,也可以是自定义边的名称。默认为 `'line'`。 ### sourceAnchor _Number_ **optional** 边的起始节点上的锚点的索引值。 ### targetAnchor _Number_ **optional** 边的终止节点上的锚点的索引值。 ### style _Object_ **optional** 通过 `style` 配置来修改边的填充色、边框颜色、阴影等属性,具体配置属性见:[图形样式属性](/zh/docs/api/shapeProperties.zh.md)。 ### label _String_ **optional** 文本文字,如果没有则不会显示。 ### labelCfg `label` String 类型。标签文本的文字内容。
`labelCfg` Object 类型。配置标签文本。下面是 `labelCfg` 对象中的常用配置项: | 名称 | 是否必须 | 类型 | 备注 | | ---------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------ | | refX | false | Number | 标签在 x 方向的偏移量 | | refY | false | Number | 标签在 y 方向的偏移量 | | position | false | String | 文本相对于边的位置,目前支持的位置有:`'start'`,`'middle'`,`'end'`。默认为`'middle'`。 | | autoRotate | false | Boolean | 标签文字是否跟随边旋转,默认 `false` | | style | false | Object | 标签的样式属性,具体配置项参见统一整理在 [图形样式属性 - Text 图形](/zh/docs/api/shapeProperties/#文本-text) | ## 内置边的特有属性 各个内置节点的特有属性见 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge) 目录下各文档。 ================================================ FILE: packages/site/docs/api/Items/itemMethods.zh.md ================================================ --- title: 元素实例方法 order: 0 --- Item 是 F6 中绘图元素实例,目前包含节点和边的实例。对于实例的变更建议在 graph 上进行。 ## 更新 ### item.update(model) 根据元素数据项,更新元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | -------------------------- | | model | Object | true | 元素描述项,包括数据和样式 | 提示: 其中参数 model 可包括以下属性,下面属性的详细描述参见 [元素配置项](/zh/docs/api/Items/itemProperties): | 名称 | 类型 | 是否必选 | 描述 | | -------- | ------ | -------- | ------------------------------------------ | | style | Object | false | 元素样式 | | type | String | false | 元素的类型,不传则使用默认值 | | label | String | false | 元素的文本标签,有该字段时默认会渲染 label | | labelCfg | Object | false | 元素文本标签的样式 | **用法** ```javascript const model = { id: "node", type: "rect", label: "node", style: { fill: "red", }, }; item.update(model); ``` ### item.refresh() 刷新元素,包括更新元素位置,更新元素样式,清除之前的缓存。 一般在以下情况时,会刷新元素: - item model 被改变; - 边的位置发生改变,需要重新计算边。 **用法** ```javascript item.refresh(); ``` ### item.updatePosition(cfg) 更新元素位置,避免整体重新绘制。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | -------------------------------------------------------------------------------------- | | cfg | Object | true | 元素配置项,包括 `x`、`y` 属性,如果参数中无 `x`、`y` 属性,则更新时使用数据项中的值。 | **用法** ```javascript const cfg = { x: 100, y: 200, }; // 由于 cfg 中存在 x 与 y,则下面操作将会使用 cfg 中的 x、y 坐标 item.updatePosition(cfg); const cfg1 = { name: "abc", dept: "antv", }; // 由于 cfg 中不存在 x 与 y,下面才做将会使用 item.getModel() 中的 x、y 坐标值 item.updatePosition(cfg1); ``` ## 销毁 ### item.destroy() 销毁元素,主要包括停止动画、删除 group 中的所有元素、清空配置项、设置 `destroyed` 为 `true` 等操作。 **用法** ```javascript item.destroy(); ``` ## 通用 ### item.getBBox() 获取元素的包围盒。 **返回值** - 返回值类型:Object。 返回值对象包括以下属性: | 名称 | 类型 | 描述 | | ------- | ------ | ------------- | | x | number | 视口 x 坐标 | | y | number | 视口 y 坐标 | | width | number | bbox 宽度 | | height | number | bbox 高度 | | centerX | number | 中心点 x 坐标 | | centerY | number | 中心点 y 坐标 | **用法** ```javascript item.getBBox(); ``` ### item.getContainer() 获取元素的容器。 **返回值** - 返回值类型:G.Group; - 返回元素所在的 graphics group。 **用法** ```javascript // 获取元素的容器 const group = item.getContainer(); // 等价于 const group = item.get("group"); ``` ### item.getKeyShape() 获取元素的关键形状,用于计算节点大小、连线截距等。 **返回值** - 返回值类型:G.Shape; - 返回元素的 keyShape。 **用法** ```javascript // 获取元素的 keyShape const keyShape = item.getKeyShape(); // 等价于 const keyShape = item.get("keyShape"); ``` ### item.getModel() 获取元素的数据模型。 **返回值** - 返回值类型:Object; - 返回元素的数据模型。 **用法** ```javascript // 获取元素的数据模型 const model = item.getModel(); // 等价于 const model = item.get("model"); ``` ### item.getType() 获取元素的类型。 **返回值** - 返回值类型:String; - 返回元素的类型,可能是 `'node'` 或 `'edge'`。 **用法** ```javascript // 获取元素的类型 const type = item.getType(); // 等价于 const type = item.get("type"); ``` ### item.enableCapture(enable) 是否拾取及触发该元素的交互事件。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------- | -------- | --------------------------------------------------------------- | | enable | Boolean | true | 是否允许该元素响应事件的标识,如果为 `true`,则允许,否则不允许 | **用法** ```javascript // 不允许元素响应事件 item.enableCapture(false); // 允许元素响应事件 item.enableCapture(true); ``` ### item.clearCache() 更新或刷新等操作后,清除缓存。 **用法** ```javascript // 清除缓存 item.clearCache(); ``` ## 状态 ### item.show() 显示元素。只显示 item 自身,若需要在显示节点的同时显示相关边,应调用 [graph.showItem(item)](/zh/docs/api/Graph#showitemitem)。 **用法** ```javascript item.show(); ``` ### item.hide() 隐藏元素。只隐藏 item 自身,若需要在隐藏节点的同时隐藏相关边,应调用 [graph.hideItem(item)](/zh/docs/api/Graph#hideitemitem)。 **用法** ```javascript item.hide(); ``` ### item.changeVisibility(visible) 更改元素是否显示。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | ------- | -------- | ------------------------------------------- | | visible | Boolean | true | 是否显示元素,`true` 为显示,`false` 为隐藏 | **用法** ```javascript // 显示元素 item.changeVisibility(true); // 隐藏元素 item.changeVisibility(false); ``` ### item.isVisible() 查询元素显示状态。 **返回值** - 返回值类型:Boolean; - 返回值为 true,则表示当前元素处于显示状态,否则处于隐藏状态。 **用法** ```javascript const visible = item.isVisible(); ``` ### item.toFront() 将元素的层级设置到最上层,即当有元素重叠时,将元素置于顶层。 **用法** ```javascript item.toFront(); ``` ### item.toBack() 将元素的层级设置到最下层,即当有元素重叠时,将元素置于底层。 **用法** ```javascript item.toBack(); ``` ### item.setState(state, enable) 更新元素的状态。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------- | -------- | ---------------------------------------------------------- | | state | String | true | 元素的状态名,如 `'selected'`、`'hover'` | | enable | Boolean | true | 是否启用状态的标识,为 `true` 表示启用该状态,否则不启用。 | **用法** ```javascript item.setState("selected", true); item.setState("actived", false); ``` ### item.clearStates(states) 清除指定的状态,如果不传 states ,则默认清除**第一个**状态。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------------- | -------- | ------------------ | | states | String / Array | true | 要清除的元素状态名 | **用法** ```javascript // 清除 'selected' 状态 item.clearStates("selected"); // 清除 'active' 与 'hover' 状态 item.clearStates(["actived", "hover"]); ``` ### item.getStates() 获取当前元素的所有状态。 **返回值** - 返回值类型:Array; - 返回当前元素的所有状态,是一个字符串数组,数组中值表示元素的状态。 **用法** ```javascript // 获取元素的所有状态 const states = item.getStates(); ``` ### item.hasState(state) 判断元素是否具有某种指定的状态。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ------------ | | state | String | true | 元素的状态名 | **返回值** - 返回值类型:Boolean; - 返回值表示是否具有指定的状态,如果返回 `true`,则说明元素有指定的状态,否则没有。 **用法** ```javascript // 获取元素的 'hover' 状态值 const state = item.hasState("hover"); ``` ## 样式 ### item.getStateStyle(state) 获取元素指定状态的样式,返回的样式会将全局样式、默认样式和元素自定义样式合并。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ------------ | | state | String | true | 元素的状态名 | **返回值** - 返回值类型:Object; - 返回的样式会将全局样式、默认样式和元素自定义样式合并。 **用法** ```javascript // 获取元素的指定状态的样式 const style = item.getStateStyle("selected"); ``` ### item.getOriginStyle() 获取元素 keyShape 的样式。 **返回值** - 返回值类型:Object | undefined; - 如果存在 keyShape ,则返回 `keyShape` 的样式,否则返回 `undefined` 。 **用法** ```javascript const style = item.getOriginStyle(); ``` ### item.getCurrentStatesStyle() 获取当前元素的所有状态的样式。 **返回值** - 返回值类型:Object; - 返回值表示当前元素所有状态的样式。 **用法** ```javascript const styles = item.getCurrentStatesStyle(); ``` ================================================ FILE: packages/site/docs/api/Items/itemProperties.zh.md ================================================ --- title: 元素配置项 order: 5 --- F6 图上的元素包括节点、边、节点分组 Combo。每一个元素是一个 [item](/zh/docs/api/Items/itemMethods) 实例,而实例中的数据模型 `model` 定义了该元素的样式、配置等。在 [入门教程-元素及其配置](/zh/docs/manual/tutorial/mini/elements#配置属性) 中,我们知道配置元素属性有两种方式:实例化图时全局配置;在数据中配置。无论何种方式,都是在配置每个元素的数据模型 `model`。本文介绍节点、边、节点分组 Combo 的 `model` 配置项。 ### id _String_ **required** 说明: 元素的标识 ID,**必须**是唯一的 string ### style _Object_ **optional** 元素 [keyShape](/zh/docs/manual/middle/elements/shape-keyshape) 的样式属性,可配置内容与该 keyShape 的图形类型相关,各图形的具体属性参见[各图形样式属性](/zh/docs/api/shapeProperties) | ### type _String_ **optional** 元素的类型,不传则使用默认值,节点默认类型为 'circle',边默认类型为 'line',Combo 默认类型为 `circle`。 ### label _String_ **optional** 元素的文本标签,有该字段时默认会渲染 label 。 ### labelCfg _Object_ **optional** 元素文本标签的配置项,节点、Combo 与 边的配置不同,详见各子模块内容。 ================================================ FILE: packages/site/docs/api/Items/nodeMethods.zh.md ================================================ --- title: node 实例方法 order: 1 --- Node 继承自 Item。所以 Item 上面的方法在 Node 实例中都可以调用。本文仅介绍 Node 类的通用方法,内置节点见 [内置节点文档](/zh/docs/manual/middle/elements/nodes/defaultNode) 和 [demo](/zh/docs/examples/item/defaultNodes),自定义节点见 [自定义节点文档](/zh/docs/manual/middle/elements/nodes/custom-node) 和 [demo](/zh/docs/examples/item/customNode)。 ### node.lock() 锁定当前节点,锁定节点后,该节点不再响应拖动节点的事件。 提示:锁定节点后,拖动画布和缩放画布的操作依然对该节点有效。如果想在锁定节点后,不响应拖动画布和缩放的事件,需要自定义拖动画布和缩放的 Behavior,具体可参考 [锁定节点不响应拖动画布的事件](/zh/docs/manual/middle/elements/methods/lock-node#拖动画布时候不处理锁定的节点) 和 [锁定节点不响应缩放事件](/zh/docs/manual/middle/elements/methods/lock-node#缩放画布时不处理锁定的节点)。 **用法** ```javascript const node = graph.findById("node"); node.lock(); ``` ### node.unlock() 解锁锁定的节点。 **用法** ```javascript const node = graph.findById("node"); node.unlock(); ``` ### node.hasLocked() 检测节点是否处于锁定状态。 **返回值** - 返回值类型:Boolean; - 返回 true 表示当前解锁处于锁定状态,否则表示未锁定。 **用法** ```javascript const node = graph.findById("node"); const hasLocked = node.hasLocked(); ``` ### node.getNeighbors(type) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | type | 'source' / 'target' / undefined | false | 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居 | **返回值** - 返回值类型:Array; - 返回值符合要求的节点实例数组。 **用法** ```javascript const neighbors = node.getNeighbors("source"); ``` ### node.getEdges() 获取与当前节点有关联的所有边。 **返回值** - 返回值类型:Edge[]; - 返回边实例的集合。 **用法** ```javascript // 获取与 node 关联的所有边 const edges = node.getEdges(); ``` ### node.getInEdges() 获取与当前节点关联的所有入边。 **返回值** - 返回值类型:Edge[]; - 返回入边实例的集合。 **用法** ```javascript // 获取与 node 关联的所有入边 const edges = node.getInEdges(); ``` ### node.getOutEdges() 获取与当前节点关联的所有出边。 **返回值** - 返回值类型:Edge[]; - 返回出边实例的集合。 **用法** ```javascript // 获取与 node 关联的所有出边 const edges = node.getOutEdges(); ``` ### node.getAnchorPoints() 获取节点上面定义的锚点。 **返回值** - 返回值类型:Array; - 返回值的数据结构: ```javascript [ (0: { x: 100, y: 105, index: 0, }), (1: { x: 200, y: 105, index: 1, }), ]; ``` **用法** ```javascript // 获取定义在节点上的锚点数据 const anchor = node.getAnchorPoints(); ``` ### node.getLinkPoint(point) 获取距离指定坐标最近的一个锚点。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ------------------------------------------ | | point | Object | true | 节点外部的一个点,用于计算交点及最近的锚点 | **返回值** - 返回值类型:Object; - 返回值表示连接点的坐标 (x, y),如果没有合适的锚点和连接点,则返回中心点。 **用法** ```javascript const point = { x: 100, y: 105, }; // 获取连接点 const linkPoint = node.getLinkPoint(point); ``` ### node.getLinkPointByAnchor(index) 根据锚点索引获取连接点的 x、y 坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ---------- | | index | Number | true | 锚点的索引 | **返回值** - 返回值类型:Object; - 返回值表示连接点的坐标 (x, y)。 **用法** ```javascript // 获取定义在节点上的第一个锚点 const anchor = node.getLinkPointByAnchor(0); ``` ### node.addEdge(edge) 添加指定的边到当前节点上。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ---- | -------- | --------- | | edge | Edge | true | Edge 实例 | **用法** ```javascript const edge = new Edge({ // TODO }); node.addEdge(edge); ``` ### node.removeEdge(edge) 移除与当前节点相关的指定边。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ---- | -------- | --------- | | edge | Edge | true | Edge 实例 | **用法** ```javascript const edge = graph.findById("edge1"); node.removeEdge(edge); ``` ================================================ FILE: packages/site/docs/api/Items/nodeProperties.zh.md ================================================ --- title: 节点配置项 order: 6 --- 节点继承自元素类。除了[元素通用属性](/zh/docs/api/Items/itemProperties.zh.md)外,每种节点拥有一些特有的属性。 ## 内置节点的通用属性 ### id _String_ **required** 节点唯一 ID,**必须**是唯一的 string。 ### x _Number_ **optional** x 坐标。 ### y _Number_ **optional** y 坐标。 ### type _String_ **optional** _default:_: `'circle'` 指定节点类型,内置节点类型名称或自定义节点的名称。默认为 `'circle'`。 ### size _Number | Array_ **optional** _default:_: `20` 节点的大小。 ### anchorPoints _Array_ **optional** 指定边连入节点的连接点的位置(相对于该节点而言),可以为空。例如: `[0, 0]`,代表节点左上角的锚点,`[1, 1]`,代表节点右下角的锚点。 ### style _Object_ **optional** 通过 `style` 配置来修改节点关键图形的填充色、边框颜色、阴影等属性,具体配置属性见:[图形样式属性](/zh/docs/api/shapeProperties.zh.md)。 ### label _String_ **optional** 文本文字。 ### labelCfg | 名称 | 是否必须 | 类型 | 备注 | | -------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | position | false | String | 文本相对于节点的位置,目前支持的位置有:`'center'`,`'top'`,`'left'`,`'right'`,`'bottom'`。默认为 `'center'`。modelRect 节点不支持该属性 | | offset | false | Number | 文本的偏移,`position` 为 `'bottom'` 时,文本的上方偏移量;`position` 为 `'left'` 时,文本的右方偏移量;以此类推在其他 `position` 时的情况。modelRect 节点的 `offset` 为左边距 | | style | false | Object | 标签的样式属性,具体配置项参见统一整理在 [图形样式属性 - Text 图形](/zh/docs/api/shapeProperties/#文本-text) | ## 内置节点的特有属性 各个内置节点的特有属性见 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 目录下各文档。 ================================================ FILE: packages/site/docs/api/Plugins.zh.md ================================================ --- title: 插件 Plugins order: 14 --- F6 提供了一些可插拔的组件,包括: - [Legend](#legend) - [SnapLine](#snapline) - [Grid](#grid) - [Minimap](#minimap) - [ImageMinimap](#image-minimap) - [Edge Bundling](#edge-bundling) - [Menu](#menu) - [ToolBar](#toolbar) - [TimeBar](#timebar) - [Tooltip](#tooltip) - [Fisheye](#fisheye) - [EdgeFilterLens](#edge-filter-lens) ## 配置方法 引入 F6 后,首先实例化需要使用的某插件对象。然后,在实例化图时将其配置到 `plugins` 中: ```javascript // 实例化 Grid 插件 const grid = new F6.Grid(); const minimap = new F6.Minimap(); const graph = new F6.Graph({ //... 其他配置项 plugins: [grid, minimap], // 配置 Grid 插件和 Minimap 插件 }); ``` ## Legend Legend 是 F6 内置的图例插件。用于说明图中不同类型的节点和边所代表的含义,并可以通过与图例的交互做简单的高亮和过滤。 _v4.3.0 起支持_。 img ### 配置项 | 名称 | 类型 | 描述 | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | data | GraphData | 图例的数据,与图数据格式相同。节点图例目前支持 `'circle'`,`'rect'`,和 `'ellipse'`,边图例目前支持 `'line'`、`'cubic'`、`'quadratic'`。通过指定每个数据项中的 `type` 字段以确定图例元素的类型,每个数据项中的 `order` 字段可用于同组图例的排序 | | position | 'top' / 'top-left' / 'top-right' / 'right' / 'right-top' / 'right-bottom' / 'left' / 'left-top' / 'left-bottom' / 'bottom' / 'bottom-left' / 'bottom-right' | 图例在画布中的相对位置,默认为 `'top'`,代表在画布正上方 | | padding | number / number[] | 图例区域内部内容到边框的距离,四位数组分别代表上、右、下、左边距 | | margin | number / number[] | 图例区域与画布边界的距离,四位数组分别代表上、右、下、左边距。在 `position:'top'` 时只有上边距生效,其他情况类似 | | offsetX | number | 图例区域离 `position` 对应的默认位置的 x 方向的偏移量,可被用于图例位置的微调 | | offsetY | number | 图例区域离 `position` 对应的默认位置的 y 方向的偏移量,可被用于图例位置的微调 | | containerStyle | ShapeStyle | 图例背景框的样式,格式与 [rect 图形的样式](/zh/docs/api/shapeProperties#矩形图形-rect)相同 | | horiSep | number | 图例之间的水平间距 | | vertiSep | number | 图例之间的竖直间距 | | layout | 'vertical' / 'horizontal' | 图例的布局方式。默认为 `'horizontal'` 横向布局 | | align | 'center' / 'right' / 'left' | 图例的对齐方式,可以是居中、右对齐、左对齐。默认为 `'center'` 居中 | | title | string | 图例的标题文本内容,样式通过 `titleConfig` 设置 | | titleConfig | object | 图例标题的样式,具体配置项如下 | | titleConfig.position | 'center' / 'right' / 'left' | 图例标题的对齐方式,可以是居中、右对齐、左对齐。默认为 `'center'` 居中 | | titleConfig.offsetX | number | 图例标题的 x 方向偏移,用于微调标题位置 | | titleConfig.offsetY | number | 图例标题的 y 方向偏移,用于微调标题位置 | | titleConfig[key] | ShapeStyle | 其他对于文本本身的样式,支持的内容与 [text 图形的样式](/zh/docs/api/shapeProperties#文本-text)相同 | | filter | object | 通过图例的交互对主图元素进行过滤的配置项,具体配置如下 | | filter.enable | boolean | 是否允许通过图例的交互对主图元素过滤,默认为 `false` | | filter.multiple | boolean | 是否支持多种元素过滤,默认为 `false`。当它为 `true` 时,只有 `filter.trigger` 为 `'click'` 时方可多选图例 | | filter.trigger | 'click' / 'mouseenter' | 触发主图元素过滤的图例交互方式,默认为 `click` | | filter.legendStateStyles | { active?: ShapeStyle, inactive?: ShapeStyle | 在过滤时,图例本身的状态样式,包括 `filter.legendStateStyles.active` 和 `filter.legendStateStyles.inactive` 两种,每种的类型均为 ShapeStyle。类似图的 `nodeStateStyles` 配置 | | filter.graphActiveState | string | 主图元素过滤时,被选中的主图元素的状态名,将寻找主图元素的对应的状态样式进行主图元素的更新。默认值为 `'active'` | | filter.graphInactiveState | string | 主图元素过滤时,未被选中的主图元素的状态名,将寻找主图元素的对应的状态样式进行主图元素的更新。默认值为 `'inactive'` | | filter.filterFunctions | { [key: string]: (d) => boolean; } | 由于图例的数据与主图解耦,因此需要配置每种图例对应的主图过滤函数,`key` 为图例数据的 `type`,值为函数,函数的参数为主图元素的数据,返回值为布尔型,代表是否被选中 | ## SnapLine SnapLine 是 F6 内置的对齐线插件。 实例化时可以通过配置项调整 SnapLine 的样式和功能。 ### 配置项 | 名称 | 类型 | 描述 | | ------------- | --------------------------------------------- | ------------------------- | | line | ShapeStyle | 辅助线的样式 | | itemAlignType | boolean、'horizontal' 、'vertical'、'center'; | 辅助线类型,true 表示全部 | ## Grid Grid 插件在画布上绘制了网格。 img 使用 [配置方法](#配置方法) 中代码实例化时可以通过配置项调整 Grid 的图片。 ### 配置项 | 名称 | 类型 | 描述 | | ---- | ------ | ---------------------------- | | img | String | grid 图片,base64 格式字符串 | ## Minimap Minimap 是用于快速预览和探索图的工具。 img 实例化时可以通过配置项调整 Minimap 的样式和功能。 ### 配置项 | 名称 | 类型 | 描述 | | ----------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | container | Object | 放置 Minimap 的 DOM 容器。若不指定则自动生成 | | className | String | 生成的 DOM 元素的 className | | viewportClassName | String | Minimap 上视窗 DOM 元素的 className | | type | String | 选项:`'default'`:渲染图上所有图形;`'keyShape'`:只渲染图上元素的 keyShape,以减少渲染成本;`'delegate'`:只渲染图上元素的大致图形,以降低渲染成本。渲染成本 `'default'` > `'keyShape'` > `'delegate'`。默认为 `'default'` | | size | Array | Minimap 的大小 | | delegateStyle | Object | 在 `type` 为 `'delegate'` 时生效,代表元素大致图形的样式 | 其中,delegateStyle 可以设置如下属性: | 名称 | 类型 | 描述 | | ----------- | ------ | ---------- | | fill | String | 填充颜色 | | stroke | String | 描边颜色 | | lineWidth | Number | 描边宽度 | | opacity | Number | 透明度 | | fillOpacity | Number | 填充透明度 | ## Image Minimap 由于 [Minimap](#minimap) 的原理是将主画布内容复制到 minimap 的画布上,在大数据量下可能会造成双倍的绘制效率成本。为缓解该问题,Image Minimap 采用另一种机制,根据提供的图片地址或 base64 字符串 `graphImg` 绘制 `` 代替 minimap 上的 canvas。该方法可以大大减轻两倍 canvas 绘制的压力。但 `graphImg` 完全交由 F6 的用户控制,需要注意主画布更新时需要使用 `updateGraphImg` 方法替换 `graphImg`。 img 实例化时可以通过配置项调整 Image inimap 的样式和功能。 ### 配置项 | 名称 | 类型 | 是否必须 | 描述 | | ----------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | graphImg | String | true | minimap 的图片地址或 base64 文本 | | width | Number | false | minimap 的宽度。Image Minimap 的长宽比一定等于主图长宽比。因此,若设置了 `width`,则按照主画布容器长宽比确定 `height`,也就是说,`width` 的优先级高于 `height`。 | | height | Number | false | minimap 的高度。Image Minimap 的长宽比一定等于主图长宽比。若未设置了 `width`,但设置了 `height`,则按照主画布容器长宽比确定 `width`;若设置了 `width` 则以 `width` 为准 | | container | Object | false | 放置 Minimap 的 DOM 容器。若不指定则自动生成 | | className | String | false | 生成的 DOM 元素的 className | | viewportClassName | String | false | Minimap 上视窗 DOM 元素的 className | | delegateStyle | Object | false | 在 `type` 为 `'delegate'` 时生效,代表元素大致图形的样式 | 其中,`delegateStyle` 可以设置如下属性: | 名称 | 类型 | 描述 | | ----------- | ------ | ---------- | | fill | String | 填充颜色 | | stroke | String | 描边颜色 | | lineWidth | Number | 描边宽度 | | opacity | Number | 透明度 | | fillOpacity | Number | 填充透明度 | ### API #### updateGraphImg(img) 更新 minimap 图片。建议在主画布更新时使用该方法同步更新 minimap 图片。 参数: | 名称 | 类型 | 是否必须 | 描述 | | ---- | ------ | -------- | -------------------------------- | | img | String | true | minimap 的图片地址或 base64 文本 | ### 用法 实例化 Image Minimap 插件时,`graphImg` 是必要参数。 ``` // 实例化 Image Minimap 插件 const imageMinimap = new F6.ImageMinimap({ width: 200, graphImg: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ' }); const graph = new F6.Graph({ //... 其他配置项 plugins: [imageMinimap], // 配置 imageMinimap 插件 }); graph.data(data); graph.render() ... // 一些主画布更新操作 imageMinimap.updateGraphImg(img); // 使用新的图片(用户自己生成)替换 minimap 图片 ``` ## Edge Bundling 在关系复杂、繁多的大规模图上,通过边绑定可以降低视觉复杂度。 img 实例化时可以通过配置项调整边绑定的功能。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | --------------- | ------ | --------- | ---------------------------------------------------------------------------------- | | K | Number | 0.1 | 边绑定的强度 | | lambda | Number | 0.1 | 算法的初始步长 | | divisions | Number | 1 | 初始的切割点数,即每条边将会被切割成的份数。每次迭代将会被乘以 `divRate` | | divRate | Number | 2 | 切割增长率,每次迭代都会乘以该数字。数字越大,绑定越平滑,但计算量将增大 | | cycles | Number | 6 | 迭代次数 | | iterations | Number | 90 | 初始的内迭代次数,每次外迭代中将会被乘以 `iterRate` | | iterRate | Number | 0.6666667 | 迭代下降率 | | bundleThreshold | Number | 0.6 | 判定边是否应该绑定在一起的相似容忍度,数值越大,被绑在一起的边相似度越低,数量越多 | ## Menu Menu 用于配置节点上的右键菜单。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | --------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | className | string | null | menu 容器的 class 类名 | | getContent | (evt?: IF6GraphEvent) => HTMLDivElement / string | img | 菜单项内容,支持 DOM 元素或字符串 | | handleMenuClick | (target: HTMLElement, item: Item) => void | undefined | 点击菜单项的回调函数 | | shouldBegin | (evt: F6Event) => boolean | undefined | 是否允许 menu 出现,可以根据 `evt.item`(当前事件中的元素) 或 `evt.target`(当前鼠标事件中的图形)的内容判断此时是否允许 menu 出现 | | offsetX | number | 6 | menu 的 x 方向偏移值,需要考虑父级容器的 padding | | offsetY | number | 6 | menu 的 y 方向偏移值,需要考虑父级容器的 padding | | itemTypes | string[] | ['node', 'edge', 'combo'] | menu 作用在哪些类型的元素上,若只想在节点上显示,可将其设置为 ['node'] | ### 用法 实例化 Menu 插件时,如果不传参数,则使用 F6 默认提供的值,只能展示默认的菜单项,不能进行任何操作。 ``` // 实例化 Menu 插件 const menu = new F6.Menu(); const graph = new F6.Graph({ //... 其他配置项 plugins: [menu], // 配置 Menu 插件 }); ``` #### DOM Menu ``` const menu = new F6.Menu({ offsetX: 6, offsetX: 10, itemTypes: ['node'], getContent(e) { const outDiv = document.createElement('div'); outDiv.style.width = '180px'; outDiv.innerHTML = `
  • 测试01
  • 测试01
  • 测试01
  • 测试01
  • 测试01
` return outDiv }, handleMenuClick(target, item) { console.log(target, item) }, }); const graph = new F6.Graph({ //... 其他配置项 plugins: [menu], // 配置 Menu 插件 }); ``` #### String Menu ``` const menu = new F6.Menu({ getContent(evt) { return `
  • 测试02
  • 测试02
  • 测试02
  • 测试02
  • 测试02
`; }, handleMenuClick(target, item) { console.log(target, item) }, }); const graph = new F6.Graph({ //... 其他配置项 plugins: [menu], // 配置 Menu 插件 }); ``` ## ToolBar ToolBar 集成了以下常见的操作: - 重做; - 撤销; - 放大; - 缩小; - 适应屏幕; - 实际大小。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | ----------- | ------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | | container | HTMLDivElement | null | ToolBar 容器,如果不设置,则默认使用 canvas 的 DOM 容器 | | className | string | null | ToolBar 内容元素的 class 类名 | | getContent | (graph?: IGraph) => HTMLDivElement | string | img | ToolBar 内容,支持 DOM 元素或字符串 | | handleClick | (code: string, graph: IGraph) => void | undefined | 点击 ToolBar 中每个图标的回调函数 | | position | Point | null | ToolBar 的位置坐标 | ### 用法 #### 默认用法 默认的 ToolBar 提供了撤销、重做、放大等功能。 ``` const toolbar = new F6.ToolBar(); const graph = new F6.Graph({ //... 其他配置项 plugins: [toolbar], // 配置 ToolBar 插件 }); ``` #### 使用 String 自定义 ToolBar 功能 ``` const tc = document.createElement('div'); tc.id = 'toolbarContainer'; document.body.appendChild(tc); const toolbar = new F6.ToolBar({ container: tc, getContent: () => { return `
  • 增加节点
  • 撤销
` }, handleClick: (code, graph) => { if (code === 'add') { graph.addItem('node', { id: 'node2', label: 'node2', x: 300, y: 150 }) } else if (code === 'undo') { toolbar.undo() } } }); const graph = new F6.Graph({ //... 其他配置项 plugins: [toolbar], // 配置 ToolBar 插件 }); ``` #### 使用 DOM 自定义 ToolBar 功能 ``` const toolbar = new F6.ToolBar({ getContent: () => { const outDiv = document.createElement('div'); outDiv.style.width = '180px'; outDiv.innerHTML = `
  • 测试01
  • 测试02
  • 测试03
  • 测试04
  • 测试05
` return outDiv }, handleClick: (code, graph) => { } }); const graph = new F6.Graph({ //... 其他配置项 plugins: [toolbar], // 配置 ToolBar 插件 }); ``` ## Tooltip Tooltip 插件主要用于在节点和边上展示一些辅助信息,F6 4.0 以后,Tooltip 插件将会替换 Behavior 中的 tooltip。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | ----------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | className | string | null | tooltip 容器的 class 类名 | | container | HTMLDivElement | null | Tooltip 容器,如果不设置,则默认使用 canvas 的 DOM 容器 | | getContent | (evt?: IF6GraphEvent) => HTMLDivElement / string | img | tooltip 内容,支持 DOM 元素或字符串 | | shouldBegin | (evt: F6Event) => boolean | undefined | 是否允许 tooltip 出现,可以根据 `evt.item`(当前事件中的元素) 或 `evt.target`(当前鼠标事件中的图形)的内容判断此时是否允许 tooltip 出现 | | offsetX | number | 6 | tooltip 的 x 方向偏移值,需要考虑父级容器的 padding | | offsetY | number | 6 | tooltip 的 y 方向偏移值,需要考虑父级容器的 padding | | itemTypes | string[] | ['node', 'edge', 'combo'] | tooltip 作用在哪些类型的元素上,若只想在节点上显示,可将其设置为 ['node'] | | trigger | 'tap' | `tap` 触发方式为点击节点/边/combo | | fixToNode | boolean / [number, number] | false | v4.2.1 支持。是否固定出现在相对于目标节点的某个位置,在节点上方移动时不实时更新。`false` 代表不固定,`[number, number]` 类型的值用于指定固定位置,例如 `[1, 0.5]` 代表 tooltip 的左上角固定到目标节点的正右方(数组代表的类似 [Anchor Point](/zh/docs/manual/middle/nodes/anchorPoint) 的位置定义)。仅在节点上生效 | ### 用法 默认的 Tooltip 只展示元素类型和 ID,一般情况下都需要用户自己定义 Tooltip 上面展示的内容。 #### Dom Tooltip ``` const tooltip = new F6.Tooltip({ offsetX: 10, offsetY: 20, getContent(e) { const outDiv = document.createElement('div'); outDiv.style.width = '180px'; outDiv.innerHTML = `

自定义tooltip

  • Label: ${e.item.getModel().label || e.item.getModel().id}
` return outDiv }, itemTypes: ['node'] }); const graph = new F6.Graph({ //... 其他配置项 plugins: [tooltip], // 配置 Tooltip 插件 }); ``` #### String Tooltip ``` const tooltip = new F6.Tooltip({ getContent(e) { return `
`; }, }); const graph = new F6.Graph({ //... 其他配置项 plugins: [tooltip], // 配置 Tooltip 插件 }); ``` ### 事件监听 Tooltip 插件暴露除了几个时机事件,方便用户监听内部状态的变化。以下事件可通过 `graph.on('eventname', e => {})` 进行监听。 | 事件名称 | 描述 | | ------------- | ---------------------- | | tooltipchange | Tooltip 发生变化时触发 | ## Fisheye Fisheye 鱼眼放大镜是为 focus+context 的探索场景设计的,它能够保证在放大关注区域的同时,保证上下文以及上下文与关注中心的关系不丢失。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | ------------- | -------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | trigger | 'mousemove' / 'click' / 'drag' | 'mousemove' | 放大镜的触发事件 | | d | Number | 1.5 | 放大系数,数值越大,放大程度越大 | | r | Number | 300 | 放大区域的范围半径 | | delegateStyle | Object | { stroke: '#000', strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 0.1, fill: '#ccc' } | 放大镜蒙层样式 | | showLabel | Boolean | false | 若 label 默认被隐藏,是否在关注区域内展示 label | | maxR | Number | 图的高度 | 滚轮调整缩放范围的最大半径 | | minR | Number | 0.05 \* 图的高度 | 滚轮调整缩放范围的最小半径 | | maxD | Number | 5 | `trigger` 为 `'mousemove'` / `'click'` 时,可以在放大镜上左右拖拽调整缩放系数。maxD 指定了这种调整方式的最大缩放系数,建议取值范围 [0, 5]。若使用 `minimap.updateParam` 更新参数不受该系数限制 | | minD | Number | 0 | `trigger` 为 `'mousemove'` / `'click'` 时,可以在放大镜上左右拖拽调整缩放系数。maxD 指定了这种调整方式的最小缩放系数,建议取值范围 [0, 5]。若使用 `minimap.updateParam` 更新参数不受该系数限制 | | scaleRBy | 'wheel'/'drag'/'unset'/undefined | false | 'unset' | 终端用户调整放大镜范围大小的方式 | | scaleDBy | 'wheel'/'drag'/'unset'/undefined | false | 'unset' | 终端用户调整放大镜缩放系数的方式 | | showDPercent | Boolean | false | true | 是否在放大镜下方显示当前缩放系数的比例值(与 minD、maxD 相较) | ### 成员函数 #### updateParams(cfg) 用于更新该 FishEye 的部分配置项,包括 `trigger`,`d`,`r`,`maxR`,`minR`,`maxD`,`minD`,`scaleRBy`,`scaleDBy`。例如: ``` const fisheye = new F6.Fisheye({ trigger: 'mousemove' }); ... // 其他操作 fisheye.updateParams({ d: 2, r: 500, // ... }) ``` ### 用法 ``` const fisheye = new F6.Fisheye({ trigger: 'mousemove', d: 1.5, r: 300, delegateStyle: clone(lensDelegateStyle), showLabel: false }); const graph = new F6.Graph({ //... 其他配置项 plugins: [fisheye], // 配置 fisheye 插件 }); ``` ## Edge Filter Lens EdgeFilterLens 边过滤镜可以将关注的边保留在过滤镜范围内,其他边将在该范围内不显示。 ### 配置项 | 名称 | 类型 | 默认值 | 描述 | | ------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | trigger | 'drag' / 'mousemove' / 'click' | 'mousemove' | 过滤镜的触发事件 | | type | 'one' / 'both' / 'only-source' / 'only-target' | 'both' | 根据边两端点作为边过滤的简单条件。`'one'`:边至少有一个端点在过滤镜区域内,则在该区域内显示该边;`'both'`:两个端点都在过滤区域内,则在该区域显示该边;`'only-source'`:只有起始端在过滤镜区域内,则在该区域显示该边;`'only-target'`:只有结束端在过滤区域内,则在该区域显示该边。更复杂的条件可以使用 `shouldShow` 指定 | | shouldShow | (d?: unknown) => boolean | undefined | 边过滤的自定义条件。参数 `d` 为边每条边的数据,用户可以根据边的参数返回布尔值。返回 `true` 代表该边需要在过滤镜区域内显示,`false` 反之。 | | r | Number | 60 | 过滤镜的范围半径 | | delegateStyle | Object | { stroke: '#000', strokeOpacity: 0.8, lineWidth: 2, fillOpacity: 0.1, fill: '#ccc' } | 过滤镜蒙层样式 | | showLabel | 'edge' / 'node' / 'both' | 'edge' | 若 label 默认被隐藏,是否在关注区域内展示对应元素类型的 label。'both' 代表节点和边的 label 都在过滤镜区域显示 | | maxR | Number | 图的高度 | 滚轮调整过滤镜的最大半径 | | minR | Number | 0.05 \* 图的高度 | 滚轮调整过滤镜的最小半径 | | scaleRBy | 'wheel' / undefined | 'wheel' | 终端用户调整过滤镜大小的方式,undefined 代表不允许终端用户调整 | ### 成员函数 #### updateParams(cfg) 用于更新该过滤镜的部分配置项,包括 `trigger`,`type`,`r`,`maxR`,`minR`,`scaleRBy`,`showLabel`,`shouldShow`。例如: ``` const filterLens = new F6.EdgeFilterLens({ trigger: 'drag' }); ... // 其他操作 filterLens.updateParams({ r: 500, // ... }) ``` ### 用法 ``` const filterLens = new F6.EdgeFilterLens({ trigger: 'mousemove', r: 300, shouldShow: d => { return d.size > 10; } }); const graph = new F6.Graph({ //... 其他配置项 plugins: [filterLens], // 配置 filterLens 插件 }); ``` ## TimeBar [AntV F6](https://github.com/antvis/F6) 内置了三种形态的 TimeBar 组件: - 带有趋势图的 TimeBar 组件; - 简易版的 TimeBar 组件; - 刻度 TimeBar 组件。 并且每种类型的 TimeBar 组件都可以配合播放、快进、后退等控制按钮组使用。
趋势图 TimeBar 组件

简易版 TimeBar 组件

刻度 TimeBar 组件

在趋势图 TimeBar 基础上,我们可以通过配置数据,实现更加复杂的趋势图 TimeBar 组件,如下图所示。
虽然 F6 提供了各种不同类型的 TimeBar 组件,但在使用的方式却非常简单,通过配置字段就可以进行区分。 ### 使用 TimeBar 组件 使用 F6 内置的 TimeBar 组件,和使用其他组件的方式完全相同。 ```javascript import F6 from "@antv/g6"; const timebar = new F6.TimeBar({ width: 500, height: 150, padding: 10, type: "trend", trend: { data: timeBarData, }, }); const graph = new F6.Graph({ container: "container", width, height, plugins: [timebar], }); ```
通过上面的方式,我们就可以在图中使用 TimeBar 组件了,当实例化 TimeBar 时,type 参数值为 trend,表示我们实例化的是趋势图组件,效果如下图所示。
当设置 type 为 simple 时,就可以使用简易版的 TimeBar。
当设置 type 为 tick 时,表示我们要使用刻度 TimeBar 组件,但此时要注意的是,**刻度时间轴的配置项是通过 tick 对象配置而不是 trend 对象**,这也是刻度时间轴和趋势即简易时间轴不同的地方。 ```javascript const timebar = new F6.TimeBar({ width, height: 150, type: "tick", tick: { data: timeBarData, width, height: 42, tickLabelFormatter: (d) => { const dateStr = `${d.date}`; if ((count - 1) % 10 === 0) { return `${dateStr.substr(0, 4)}-${dateStr.substr( 4, 2, )}-${dateStr.substr(6, 2)}`; } return false; }, tooltipFomatter: (d) => { const dateStr = `${d}`; return `${dateStr.substr(0, 4)}-${dateStr.substr(4, 2)}-${dateStr.substr( 6, 2, )}`; }, }, }); ``` ### 事件监听 TimeBar 插件暴露除了几个时机事件,方便用户监听内部状态的变化。以下事件可通过 `graph.on('eventname', e => {})` 进行监听。 | 事件名称 | 描述 | | ---------------- | ------------------------------ | | valuechange | 时间轴的时间范围发生变化时触发 | | timebarstartplay | 时间轴开始播放时触发 | | timebarendplay | 时间轴播放结束时触发 | ### 参数定义 #### 接口定义 完整的 TimeBar 的接口定义如下: ```javascript interface TimeBarConfig extends IPluginBaseConfig { // position size readonly x?: number; readonly y?: number; readonly width?: number; readonly height?: number; readonly padding?: number; readonly type?: 'trend' | 'simple' | 'tick'; // 趋势图配置项 readonly trend?: TrendConfig; // 滑块、及前后背景的配置 readonly slider?: SliderOption; // 当 type 是 tick 时,这是 tick 类型时间轴的配置项 // 当 type 是 trend 或 simple 时,这是时间轴下方时间刻度文本的配置项 readonly tick?: TimeBarSliceOption | TickCfg; // 控制按钮 readonly controllerCfg?: ControllerCfg; // 是否过滤边,若为 true,则需要配合边数据上有 date 字段,过滤节点同时将不满足 date 在选中范围内的边也过滤出去;若为 false,则仅过滤节点以及两端节点都被过滤出去的边 readonly filterEdge?: boolean; rangeChange?: (graph: IGraph, minValue: string, maxValue: string) => void; valueChange?: (graph: IGraph, value: string) => void; } ``` #### 接口参数说明 | 名称 | 类型 | 默认值 | 描述 | | ------------- | ---------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | container | HTMLDivElement | null | TimeBar 容器,如果不设置,则默认创建 className 为 g6-component-timebar 的 DOM 容器 | | x | number | 0 | TimeBar 开始 x 坐标 | | y | number | 0 | TimeBar 开始 y 坐标 | | width | number | | **必选**,TimeBar 容器宽度 | | height | number | | **必选**,TimeBar 高度 | | padding | number/number[] | 10 | TimeBar 距离容器的间距值 | | type | 'trend' / 'simple' / 'tick' | trend | 默认的 TimeBar 类型,默认为趋势图样式 | | trend | TrendConfig | null | Timebar 中趋势图的配置项,当 type 为 trend 或 simple 时,该字段必选 | | slider | SliderOption | null | TimeBar 组件背景及控制调节范围的滑块的配置项 | | tick | TimeBarSliceOption / TickCfg | null | 当 type 是 tick 时,这是 tick 类型时间轴的配置项,该字段必须按;当 type 是 trend 或 simple 时,这是时间轴下方时间刻度文本的配置项 | | controllerCfg | ControllerCfg | null | 控制按钮组配置项 | | filterEdge | boolean | false | 是否过滤边,若为 true,则需要配合边数据上有 date 字段,过滤节点同时将不满足 date 在选中范围内的边也过滤出去;若为 false,则仅过滤节点以及两端节点都被过滤出去的边 | | rangeChange | Function | null | TimeBar 时间范围变化时的回调函数,当不定义该函数时,时间范围变化时默认过滤图上的数据 | #### TrendConfig 接口定义 > 暂不支持刻度文本的样式配置 ```javascript interface TrendConfig { // 数据 readonly data: { date: string; value: string; }[]; // 位置大小 readonly x?: number; readonly y?: number; readonly width?: number; readonly height?: number; // 样式 readonly smooth?: boolean; readonly isArea?: boolean; readonly lineStyle?: ShapeStyle; readonly areaStyle?: ShapeStyle; readonly interval?: Interval; } ``` #### TrendConfig 参数说明 | 名称 | 类型 | 默认值 | 描述 | | --------- | ---------- | ------------------------------------------------ | -------------------------------------------------------------------------------- | | x | number | 0 | 趋势图开始 x 坐标 | | y | number | 0 | 趋势图开始 y 坐标 | | width | number | TimeBar 容器宽度 | TimeBar 趋势图宽度,不建议自己设定,如果设定时需要同步设置 slider 中的 width 值 | | height | number | type=trend:默认为 28
type=simple:默认为 8 | TimeBar 趋势图高度,不建议自己设定,如果设定时需要同步设置 slider 中的 height 值 | | smooth | boolean | false | 是否是平滑的曲线 | | isArea | boolean | false | 是否显示面积图 | | lineStyle | ShapeStyle | null | 折线的样式配置 | | areaStyle | ShapeStyle | null | 面积的样式配置项,只有当 isArea 为 true 时生效 | | interval | Interval | null | 柱状图配置项,当配置了该项后,趋势图上会展现为混合图样式 | #### SliderOption 接口定义 ```javascript export type SliderOption = Partial<{ readonly width?: number; readonly height?: number; readonly backgroundStyle?: ShapeStyle; readonly foregroundStyle?: ShapeStyle; // 滑块样式 readonly handlerStyle?: { width?: number; height?: number; style?: ShapeStyle; }; readonly textStyle?: ShapeStyle; // 初始位置 readonly start: number; readonly end: number; // 滑块文本 readonly minText: string; readonly maxText: string; }>; ``` #### SliderOption 参数说明 | 名称 | 类型 | 默认值 | 描述 | | --------------- | ---------- | ----------------------------------- | ------------------------------------------------------------------------------- | | width | number | TimeBar 容器宽度 - 2 \* padding | 趋势图背景框宽度,不建议自己设定,如果设定时要同步修改 trend 中 width 值 | | height | number | 趋势图默认为 28
简易版默认为 8 | TimeBar 趋势图高度,不建议自己设定,如果设定时需要同步设置 trend 中的 height 值 | | backgroundStyle | ShapeStyle | null | 背景样式配置项 | | foregroundStyle | ShapeStyle | null | 前景色样式配置,即选中范围的样式配置项 | | handlerStyle | ShapeStyle | null | 滑块的样式配置项 | | textStyle | ShapeStyle | null | 滑块上文本的样式配置项 | | start | number | 0.1 | 开始位置 | | end | number | 0.9 | 结束位置 | | minText | string | min | 最小值文本 | | maxText | string | max | 最大值文本 | #### TimeBarSliceOption ```javascript export interface TimeBarSliceOption { // position size readonly x?: number; readonly y?: number; readonly width?: number; readonly height?: number; readonly padding?: number; // styles readonly selectedTickStyle?: TickStyle; readonly unselectedTickStyle?: TickStyle readonly tooltipBackgroundColor?: string; readonly start?: number; readonly end?: number; // 数据 readonly data: { date: string; value: string; }[]; // 自定义标签格式化函数 readonly tickLabelFormatter?: (d: any) => string | boolean; // 自定义 tooltip 内容格式化函数 readonly tooltipFomatter?: (d: any) => string; } ``` #### TimeBarSliceOption 参数说明 | 名称 | 类型 | 默认值 | 描述 | | ---------------------- | ----------------- | ------ | ------------------------------ | | x | number | 0 | 刻度 TimeBar 开始 x 坐标 | | y | number | 0 | 刻度 TimeBar 开始 y 坐标 | | width | number | | 必选,刻度 TimeBar 宽度 | | height | number | | 必选,刻度 TimeBar 高度 | | padding | number / number[] | 0 | 刻度 TimeBar 距离边界的间距 | | selectedTickStyle | ShapeStyle | null | 选中刻度的样式配置项 | | unselectedTickStyle | ShapeStyle | null | 未选中刻度的样式配置项 | | tooltipBackgroundColor | ShapeStyle | null | tooltip 背景框配置项 | | start | number | 0.1 | 开始位置 | | end | number | 0.9 | 结束位置 | | data | any[] | [] | 必选,刻度时间轴的刻度数据 | | tickLabelFormatter | Function | null | 刻度的格式化回调函数 | | tooltipFomatter | Function | null | tooltip 上内容格式化的回调函数 | #### TickCfg 接口定义 ```javascript export interface TickCfg { // 时间轴下方文本的格式化函数 readonly tickLabelFormatter?: (d: any) => string | undefined; // 时间轴下方文本的图形样式 readonly tickLabelStyle?: ShapeStyle; // 时间轴下方文本上的竖线图形样式 readonly tickLineStyle?: ShapeStyle; } ``` #### TickCfg 参数说明 | Name | Type | Default Value | Description | | ------------------ | ---------- | ------------- | ----------------------------------------------------------------------- | | tickLabelFormatter | Function | null | The formatter function for customing the labels of the ticks | | tickLabelStyle | ShapeStyle | {} | The shape style for the time tick labels | | tickLineStyle | ShapeStyle | {} | The shape style for the short vertical lines uppon the time tick labels | #### ControllerCfg 接口定义 > 暂不支持 > 控制按钮暂不支持配置样式 > 不支持循环播放 ```javascript type ControllerCfg = Partial<{ /** 控制栏的起始位置以及宽高,width height 将不缩放内部子控制器,仅影响它们的位置分布。需要缩放请使用 scale */ readonly x?: number; readonly y?: number; readonly width: number; readonly height: number; /** 控制栏缩放比例 */ readonly scale?: number; /** 控制器背景的颜色和描边色 */ readonly fill?: string; readonly stroke?: string; /** 整个控制栏的字体样式,优先级低于各个子控制器的 text 内的 fontFamily */ readonly fontFamily?: string; /** 播放速度,1 个 tick 花费时间 */ readonly speed?: number; /** 是否循环播放 */ readonly loop?: boolean; /** 是否隐藏右下角的 ’播放时间类型切换器‘ */ readonly hideTimeTypeController: boolean; /** ‘上一帧’按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly preBtnStyle?: ShapeStyle; /** ‘下一帧’按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly nextBtnStyle?: ShapeStyle; /** ‘播放’ 与 ‘暂停’ 按钮的样式,同时可以为其配置 scale、offsetX、offsetY 单独控制该控制器的缩放以及平移 */ readonly playBtnStyle?: ShapeStyle; /** ‘速度控制器’ 的样式,包括速度的指针、速度指示滚轮(横线)、文本的样式,同时可以为 speedControllerStyle 及其子图形样式配置 scale、offsetX、offsetY 单独控制该控制器及其子图形的缩放以及平移) */ readonly speedControllerStyle?: { offsetX?: number, offsetY?: number; scale?: number pointer?: ShapeStyle, scroller?: ShapeStyle, text?: ShapeStyle }; /** ‘播放时间类型切换器’ 的样式,包括 checkbox 的框、checkbox 的选中勾、文本的样式,同时可以为 timeTypeControllerStyle 及其子图形样式配置 scale、offsetX、offsetY 单独控制该控制器及其子图形的缩放以及平移 */ readonly timeTypeControllerStyle?: { offsetX?: number, offsetY?: number; scale?: number check?: ShapeStyle, box?: ShapeStyle, text?: ShapeStyle }; /** ‘播放时间类型切换器’单一文本时的文本,默认为‘单一时间’ */ readonly timePointControllerText?: string; /** ‘播放时间类型切换器’单一文本时的文本,默认为‘时间范围’ */ readonly timeRangeControllerText?: string; }> ``` #### ControllerCfg 参数说明 | 名称 | 类型 | 默认值 | 描述 | | ----------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | x | number | 0 | 控制栏开始 x 坐标 | | y | number | 0 | 控制栏开始 y 坐标 | | width | number | TimeBar 宽度 | 控制栏宽度,将不缩放内部子控制器,仅影响它们的位置分布 | | height | number | 40 | 控制栏高度,将不缩放内部子控制器,仅影响它们的位置分布 | | scale | number | 1 | 控制栏缩放比例 | | speed | number | 1 | 播放速度 | | loop | boolean | false | 暂不支持,是否循环播放 | | hideTimeTypeController | boolean | true | 是否隐藏时间类型切换 | | fill | string | | 控制栏背景框填充色 | | stroke | string | | 整个控制栏的字体样式,优先级低于各个子控制器的 text 内的 fontFamily | | preBtnStyle | string | null | 控制栏背景框边框色 | | preBtnStyle | ShapeStyle | null | ‘上一帧’按钮的样式,同时可以为其配置 `scale`、`offsetX`、`offsetY` 单独控制该控制器的缩放以及平移 | | nextBtnStyle | ShapeStyle | null | ‘下一帧’按钮的样式,同时可以为其配置 `scale`、`offsetX`、`offsetY` 单独控制该控制器的缩放以及平移 | | playBtnStyle | ShapeStyle | null | ‘播放’ 与 ‘暂停’ 按钮的样式,同时可以为其配置 `scale`、`offsetX`、`offsetY` 单独控制该控制器的缩放以及平移 | | speedControllerStyle | { offsetX?: number, offsetY?: number, scale?: number, pointer?: ShapeStyle, text?: ShapeStyle, scroller?: ShapeStyle} | null | ‘速度控制器’ 的样式,包括速度的指针、速度指示滚轮(横线)、文本的样式,同时可以为 `speedControllerStyle` 及其子图形样式配置 `scale`、`offsetX`、`offsetY` 单独控制该控制器及其子图形的缩放以及平移 | | timeTypeControllerStyle | { offsetX?: number, offsetY?: number, scale?: number, box?: ShapeStyle, check?: ShapeStyle, text?: ShapeStyle } | null | ‘播放时间类型切换器’ 的样式,包括 checkbox 的框、checkbox 的选中勾、文本的样式,同时可以为 `timeTypeControllerStyle` 及其子图形样式配置 `scale`、`offsetX`、`offsetY` 单独控制该控制器及其子图形的缩放以及平移 | | timePointControllerText | string | "单一时间" | 右下角“单一时间”文本,默认为”单一时间“ | | timePointControllerText | string | "时间范围" | 右下角“单一时间”文本,默认为”时间范围时间“ | ================================================ FILE: packages/site/docs/api/TreeGraph.zh.md ================================================ --- title: 树图配置 F6.TreeGraph(cfg) order: 3 --- 创建 TreeGraph 实例。 ```ts // highlight-start new F6.TreeGraph(cfg: GraphOptions) => TreeGraph // highlight-end const treeGraph = new F6.TreeGraph({ ... width: 800, height: 600, modes: { default: [ { type: 'collapse-expand', onChange(item, collapsed) { const icon = item.get('group').findByClassName('collapse-icon'); if (collapsed) { icon.attr('symbol', EXPAND_ICON); } else { icon.attr('symbol', COLLAPSE_ICON); } }, }, 'drag-canvas', 'zoom-canvas', ], }, layout: { type: 'dendrogram', direction: 'LR', // H / V / LR / RL / TB / BT nodeSep: 50, rankSep: 100, radial: true, }, }); ``` TreeGraph 是 F6 专门为树图场景打造的图。`F6.TreeGraph` 与 `F6.Graph` 最大的区别就是数据结构和内置布局计算。主要考虑: - 数据结构:树图的数据一般是嵌套结构,边的数据隐含在嵌套结构中,并不会特意指定 edge 。此布局要求数据中一个节点需要有 `id` 和 `children` 两个数据项,最精简的数据结构如下所示: ```javascript const data = { id: 'root', children: [ { id: 'subTree1', children: [...] }, { id: 'subTree2', children: [...] } ] }; ``` - 布局特殊性: - 树图的布局算法一般是不改变源数据的,而是重新生成一份数据,将源数据作为新数据的一个属性。如果每次都需要做次遍历转换数据到节点和边的数据增加了用户的实现复杂度。 - 树图的每次新增/删除/展开/收缩节点,都需要重新计算布局。遍历一份结构化数据对应到图上每个节点去做更新操作,也很麻烦。 TreeGraph 继承自 Graph,配置项参考 [F6.Graph(GraphOptions)](/zh/docs/api/Graph.zh.md)。其中, layout 配置项支持的布局类型 (`type` 属性) 和 Graph 中所支持的类型不同,TreeGraph 中 layout 目前支持 dendrogram、compactBox、mindmap 和 indeted 四种布局方式,具体配置方式见 [TreeGraph Layout](/zh/docs/api/treeGraphLayout/guide)。 ================================================ FILE: packages/site/docs/api/Util.zh.md ================================================ --- title: 工具方法 Util order: 15 --- F6 提供了一些工具方法,方便用户做数据的预处理、图形计算等。 ## 使用方法 引入 F6 后,可通过 `F6.Util.functionName` 调用到 F6 抛出的工具方法。下面代码演示了使用 `processParallelEdges` 处理两节点之间存在多条边的情况。 ```javascript import F6 from '@antv/f6'; const data = { nodes: [ { id: '1' }, { id: '2' } ] edges: [ { source: '1', target: '2' }, { source: '1', target: '2' }, ]; } const offsetDiff = 10; const multiEdgeType = 'quadratic'; const singleEdgeType = 'line'; const loopEdgeType = 'loop'; F6.Util.processParallelEdges(data.edges, offsetDiff, multiEdgeType, singleEdgeType, loopEdgeType); ``` ## 数据预处理 ### processParallelEdges 处理平行边 若两条边的两个端点相同,则称这两条边相互平行。当一对节点节点之间存在多条边,不做处理直接绘制可能会导致边相互重叠。该 Util 方法将找到数据中的平行边,为它们计算合理的贝塞尔曲线控制点偏移量 `curveOffset`,挂载到相应的边数据上,使得平行边在渲染时可以根据 `curveOffset` 绘制贝塞尔曲线,从而不相互重叠。因此该方法适用于将平行边处理为 `quadratic` 或基于 `quadratic` 自定义的边类型。 img #### 配置项 | 名称 | 类型 | 是否必须 | 描述 | | -------------- | ------------ | -------- | ---------------------------------------------------------------------------------------------- | | edges | EdgeConfig[] | true | 需要处理的边数据数组 | | offsetDiff | number | false | 两条平行边的之间的距离,默认为 15 | | multiEdgeType | string | false | 两节点之间若存在多条边时,这些边的类型,默认为 'quadratic' | | singleEdgeType | string | false | 两节点之间仅有一条边时,该边的类型,默认为 undefined,即不改变这种边的类型 | | loopEdgeType | string | false | 若一条边的起点和终点是同一个节点(自环边),该边的类型,默认为 undefined,即不改变这种边的类型 | #### 使用示例 [Demo](/zh/docs/examples/item/multiEdge#multiEdges) ### traverseTree 深度优先遍历树数据 从根节点到叶子节点的由上至下的深度优先遍历树数据。 #### 配置项 | 名称 | 类型 | 是否必须 | 描述 | | ---- | -------- | -------- | -------------------------- | | data | TreeData | true | 需要遍历的树数据 | | fn | function | true | 遍历到每个节点时的回调函数 | #### 使用示例 ```javascript const treeData = { id: "1", children: [ { id: "2", children: [{ id: "3" }, { id: "4" }], }, { id: "5", children: [ { id: "6" }, { id: "7", children: [{ id: "8" }, { id: "9" }], }, ], }, { id: "10", children: [{ id: "11" }], }, ], }; traverseTree(treeData, (subTree) => { subTree.color = "#f00"; return true; }); ``` ### traverseTreeUp 深度优先遍历树数据 从叶子节点到根节点的由下至上的深度优先遍历树数据。 #### 配置项 | 名称 | 类型 | 是否必须 | 描述 | | ---- | -------- | -------- | -------------------------- | | data | TreeData | true | 需要遍历的树数据 | | fn | function | true | 遍历到每个节点时的回调函数 | #### 使用示例 ```javascript const treeData = { id: "1", children: [ { id: "2", children: [{ id: "3" }, { id: "4" }], }, { id: "5", children: [ { id: "6" }, { id: "7", children: [{ id: "8" }, { id: "9" }], }, ], }, { id: "10", children: [{ id: "11" }], }, ], }; traverseTreeUp(treeData, (subTree) => { subTree.color = "#f00"; return true; }); ``` ## 包围盒计算 ### calculationItemsBBox 一组节点的总包围盒 | 名称 | 类型 | 是否必须 | 描述 | | ----- | ------ | -------- | -------- | | items | Item[] | true | 节点数组 | ================================================ FILE: packages/site/docs/api/graphFunc/animation.zh.md ================================================ --- title: 动画相关方法 order: 14 --- ### graph.positionsAnimate() 根据当前数据中的节点位置,动画更新节点位置。将会使用 graph 上的 `animateCfg` 配置项作为动画行为的依据。 ### graph.stopAnimate() 停止画布上的所有动画。 **用法** ```javascript graph.stopAnimate(); ``` ### graph.isAnimating() 判断当前是否有正在执行的动画。 ================================================ FILE: packages/site/docs/api/graphFunc/behaviors.zh.md ================================================ --- title: 增删复合交互 order: 10 --- ### graph.addBehaviors(behaviors, modes) 新增行为,将单个或多个行为添加到单个或多个模式中。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | -------------- | -------- | ---------------- | | behaviors | string / Array | true | 添加的行为的名称 | | modes | string / Array | true | 模式的名称 | **用法** ```javascript // 将单个 Behavior 添加到单个模式(默认的 default 模式)中 graph.addBehaviors("click-select", "default"); // 将多个 Behavior 添加到单个模式(默认的 default 模式)中 graph.addBehaviors(["brush-select", "click-select"], "default"); // 将单个 Behavior 添加到多个模式中 graph.addBehaviors("brush-select", ["default", "select"]); // 将多个 Behavior 添加到多个模式中 graph.addBehaviors(["brush-select", "click-select"], ["default", "select"]); ``` ### graph.removeBehaviors(behaviors, modes) 移除行为,将单个或多个行为从单个或多个模式中去除。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | -------------- | -------- | ---------------- | | behaviors | string / Array | true | 删除的行为的名称 | | modes | string / Array | true | 模式的名称 | **用法** ```javascript // 从单个模式中移除单个 Behavior graph.removeBehaviors("click-select", "default"); // 从单个模式中移除多个 Behavior graph.removeBehaviors(["brush-select", "click-select"], "default"); // 从多个模式中移除单个 Behavior graph.removeBehaviors("brush-select", ["default", "select"]); // 从多个模式中移除多个 Behavior graph.removeBehaviors(["brush-select", "click-select"], ["default", "select"]); ``` ### graph.updateBehavior(behavior, mode) 更新某个模式下的 behavior 的参数。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | ------ | -------- | ---------------------------------------------------- | | behavior | string | true | 需要更新的 behavior 类型名 | | newCfg | object | true | 新的配置项 | | mode | string | false | 需要修改的 behavior 所在的模式名称,默认为 'default' | **用法** ```javascript const graph = new Graph({ ... // 其他配置项 modes: { default: ['zoom-canvas', 'drag-canvas'], select: ['click-select'] } }) graph.data(data); graph.render(); // 更新 'default' 模式下的 behavior 'zoom-canvas' graph.updateBehavior('zoom-canvas', { sensitivity: 1.5, enableOptimize: true}, 'default'); // 更新 'select' 模式下的 behavior 'click-select' graph.updateBehavior('click-select', { trigger: 'ctrl' }, 'select'); ``` ================================================ FILE: packages/site/docs/api/graphFunc/calculation.zh.md ================================================ --- title: 图计算相关 order: 12 --- ### graph.getNodeDegree(node, degreeType, refresh) 获取节点的出度、入度、总度数,或同时获得以上三种。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---------- | -------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | node | string / INode | true | 节点 ID 或实例 | | degreeType | `'in'` \ `'out'` \ `'total'` \ `'all'` | false | 获取度数的类型。设置为 `'in'` 将返回入度;`'out'` 将返回出度;`'total'` 将返回总度数;`'all'` 将返回一个含有三种度数的对象:`{ inDegree, outDegree, degree}`;若不指定,将返回总度数 | | refresh | boolean | false | 是否强制更新整个图的度数缓存。默认为 `false`。当通过 `addItem` 添加边后,再使用 getNodeDegree 时应当将 `refresh` 设置为 `true` | **用法** ```javascript graph.getNodeDegree("node1", "in"); ``` ### graph.getShortestPathMatrix(cache, directed) 获取图中两两节点之间的最短路径矩阵。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | ------- | -------- | ------------------------------------------ | | cache | boolean | false | 是否使用缓存,默认为 true | | directed | boolean | false | 是否是有向图,默认取 graph.get('directed') | **返回值** 返回图的最短路径矩阵。 **用法** ```javascript const matrix = graph.getShortestPathMatrix(); ``` ### graph.getAdjMatrix(cache, directed) 获取邻接矩阵。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | ------- | -------- | ------------------------------------------ | | cache | boolean | false | 是否使用缓存,默认为 true | | directed | boolean | false | 是否是有向图,默认取 graph.get('directed') | **返回值** 返回图的邻接矩阵。 **用法** ```javascript const matrix = graph.getAdjMatrix(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/combo.zh.md ================================================ --- title: Combo 操作 order: 6 --- ### graph.collapseCombo(combo) 收起指定的 Combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ---------------------- | | combo | string / ICombo | true | combo ID 或 combo 实例 | **用法** ``` graph.collapseCombo('combo1') ``` ### graph.expandCombo(combo) 展开指定的 Combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ---------------------- | | combo | string / ICombo | true | combo ID 或 combo 实例 | **用法** ``` graph.expandCombo('combo1') ``` ### graph.collapseExpandCombo(combo) 展开或收缩指定的 Combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ---------------------- | | combo | string / ICombo | true | combo ID 或 combo 实例 | **用法** ``` graph.collapseExpandCombo('combo1') ``` ### graph.createCombo(combo, elements) 根据已经存在的节点或 combo 创建新的 combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | -------------------- | -------- | ------------------------------------------ | | combo | string / ComboConfig | true | combo ID 或 Combo 配置 | | elements | string[] | true | 添加到 Combo 中的元素 ID,包括节点和 combo | **用法** ``` // 第一个参数为 combo ID graph.createCombo('combo1', ['node1', 'node2', 'combo2']) // 第一个参数为 combo 配置 graph.createCombo({ id: 'combo1', style: { fill: '#f00' } }, ['node1', 'node2', 'combo2']) ``` ### graph.uncombo(combo) 拆解 Combo,即拆分组/解组。调用后,combo 本身将被删除,而该分组内部的子元素将会成为该分组父分组(若存在)的子元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ----------------------------- | | combo | string / ICombo | true | 需要被拆解的 Combo item 或 id | **用法** ``` graph.uncombo('combo1') ``` ================================================ FILE: packages/site/docs/api/graphFunc/coordinate.zh.md ================================================ --- title: 坐标转换 order: 15 --- 这部分主要是说明渲染坐标、Canvas 坐标和页面坐标之前的相互转换。三种坐标系的关系参见文档:[F6 坐标系深度解析](/zh/docs/manual/advanced/coordinate-system)。 img ### graph.getPointByClient(clientX, clientY) 将屏幕/页面坐标转换为渲染坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | ------ | -------- | ----------- | | clientX | Number | true | 屏幕 x 坐标 | | clientY | Number | true | 屏幕 y 坐标 | **返回值** - 返回值类型:Object; - 包含的属性:x 和 y 属性,分别表示渲染的 x 、y 坐标。 **用法** ```javascript const point = graph.getPointByClient(e.clientX, e.clientY); console.log("渲染坐标 x/y 分别为:", point.x, point.y); ``` ### graph.getClientByPoint(x, y) 将渲染坐标转换为屏幕/页面坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | --------------------- | | x | Number | true | 渲染坐标系下的 x 坐标 | | y | Number | true | 渲染坐标系下的 y 坐标 | **返回值** - 返回值类型:Object; - 包含的属性:`x` 和 `y` 属性,分别表示屏幕/页面的 x、y 坐标。 **用法** ```javascript const point = graph.getClientByPoint(100, 200); console.log("屏幕/页面x/y坐标分别为:", point.x, point.y); ``` ### graph.getPointByCanvas(canvasX, canvasY) 将 Canvas 画布坐标转换为渲染坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | ------ | -------- | ----------- | | canvasX | Number | true | 画布 x 坐标 | | canvasY | Number | true | 画布 y 坐标 | **返回值** - 返回值类型:Object; - 包含的属性:x 和 y 属性,分别表示渲染的 x、y 坐标。 **用法** ```javascript const point = graph.getPointByCanvas(100, 200); console.log("渲染坐标 x/y 分别为:", point.x, point.y); ``` ### graph.getCanvasByPoint(x, y) 将渲染坐标转换为 Canvas 画布坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | --------------------- | | x | Number | true | 渲染坐标系下的 x 坐标 | | y | Number | true | 渲染坐标系下的 y 坐标 | **返回值** - 返回值类型:Object; - 包含的属性:x 和 y 属性,分别表示 Canvas 画布的 x、y 坐标。 **用法** ```javascript const point = graph.getCanvasByPoint(100, 200); console.log("Canvas 画布的 x/y 坐标分别为:", point.x, point.y); ``` ### graph.getGraphCenterPoint() 获取图内容的中心绘制坐标。v4.2.1 支持。 **参数** 无 **返回值** - 返回值类型:Object; - 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。 **用法** ```javascript const point = graph.getGraphCenterPoint(); console.log("图内容中心的绘制坐标是", point.x, point.y); ``` ### graph.getViewPortCenterPoint() 获取视口中心绘制坐标。 **参数** 无 **返回值** - 返回值类型:Object; - 包含的属性:x 和 y 属性,分别表示渲染坐标下的 x、y 值。 **用法** ```javascript const point = graph.getViewPortCenterPoint(); console.log("视口中心的绘制坐标是", point.x, point.y); ``` ================================================ FILE: packages/site/docs/api/graphFunc/data.zh.md ================================================ --- title: 数据 order: 0 --- 设置图初始化数据。 ### graph.data(_data_) _Object_ **required** 初始化的图数据,是一个包括 nodes 数组和 edges 数组的对象。 **用法** ```javascript const data = { nodes: [ { id: "node1", label: "node1", }, { id: "node2", label: "node2", }, ], edges: [ { source: "node1", target: "node2", }, ], }; // graph 是 Graph 的实例 graph.data(data); ``` ### graph.save() 获取图数据。 该方法无参数。 **返回值** - 返回值类型:Object; - 返回值包括所有节点和边,数据结构如下下所示: ```javascript { nodes: [], edges: [], groups: [], } ``` **用法** ```javascript graph.save(); ``` ### graph.read(data) 接收数据,并进行渲染,read 方法的功能相当于 data 和 render 方法的结合。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------------------------------------------ | | data | Object | true | 初始化的图数据,是一个包括 nodes 和 edges 的对象 | **用法** ```javascript const data = { nodes: [ { id: "node1", label: "node1", }, { id: "node2", label: "node2", }, ], edges: [ { source: "node1", target: "node2", }, ], }; // graph是Graph的实例 graph.read(data); ``` ### graph.changeData(data, stack) 更新数据源,根据新的数据重新渲染视图。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | data | Object | false | 图数据,是一个包括 nodes 和 edges 的对象。若不指定该参数,则使用当前数据重新渲染 | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript const data = { nodes: [ { id: "node1", label: "node1", }, { id: "node2", label: "node2", }, ], edges: [ { source: "node1", target: "node2", }, ], }; // graph是Graph的实例 graph.changeData(data); // 若不指定该参数,则使用当前图上的数据重新渲染 graph.changeData(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/destroy.zh.md ================================================ --- title: 清除/销毁画布 order: 18 --- ### graph.clear() 清除画布元素。该方法一般用于清空数据源,重新设置数据源,重新 render 的场景,此时所有的图形都会被清除。 该方法无参数。 **用法** ```javascript graph.clear(); ``` ### graph.destroy() 销毁画布。 该方法无参数。 **用法** ```javascript graph.destroy(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/download.zh.md ================================================ --- title: 导出图片 order: 17 --- ### graph.downloadFullImage(name, type, imageConfig) 将画布上的元素导出为图片。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- | | name | String | false | 图片的名称,不指定则为 'graph' | | type | `'image/png'` / `'image/jpeg'` / `'image/webp'` / `'image/bmp'` | false | 图片的类型。图的 `renderer` 为默认的 `'canvas'` 时生效,图的 `renderer` 为 `'svg'` 时将导出 svg 文件 | | imageConfig | Object | false | 图片的配置项,可选,具体字段见下方 | 其中,imageConfig 为导出图片的配置参数: | 名称 | 类型 | 是否必选 | 描述 | | --------------- | ----------------- | -------- | --------------------------------------------------------------------------------- | | backgroundColor | String | false | 图片的背景色,可选,不传值时将导出透明背景的图片 | | padding | Number / Number[] | false | 导出图片的上左下右 padding 值。当 `padding` 为 number 类型时,四周 `padding` 相等 | **用法** ```javascript graph.downloadFullImage("tree-graph", { backgroundColor: "#ddd", padding: [30, 15, 15, 15], }); ``` ### graph.downloadImage(name, type, backgroundColor) 将画布上的元素导出为图片。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- | | name | String | false | 图片的名称,不指定则为 'graph' | | type | `'image/png'` / `'image/jpeg'` / `'image/webp'` / `'image/bmp'` | false | 图片的类型。图的 `renderer` 为默认的 `'canvas'` 时生效,图的 `renderer` 为 `'svg'` 时将导出 svg 文件 | | backgroundColor | String | false | 图片的背景色,可选,不传值时将导出透明背景的图片 | **用法** ```javascript graph.downloadImage(); ``` ### graph.toFullDataURL(callback, type, imageConfig) 将画布上元素生成为图片的 URL。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- | | callback | Function | true | 异步生成 dataUrl 完成后的回调函数,在这里处理生成的 dataUrl 字符串 | | type | `'image/png'` / `'image/jpeg'` / `'image/webp'` / `'image/bmp'` | false | 图片的类型。图的 `renderer` 为默认的 `'canvas'` 时生效,图的 `renderer` 为 `'svg'` 时将导出 svg 文件 | | imageConfig | Object | false | 图片的配置项,可选,具体字段见下方 | 其中,imageConfig 为导出图片的配置参数: | 名称 | 类型 | 是否必选 | 描述 | | --------------- | ----------------- | -------- | --------------------------------------------------------------------------------- | | backgroundColor | String | false | 图片的背景色,可选,不传值时将导出透明背景的图片 | | padding | Number / Number[] | false | 导出图片的上左下右 padding 值。当 `padding` 为 number 类型时,四周 `padding` 相等 | 无返回值,生成的结果请在 callback 中处理。如下示例: **用法** ```javascript graph.toFullDataUrl( // 第一个参数为 callback,必须 (res) => { // ... something console.log(res); // 打印出结果 }, // 后两个参数不是必须 'image/jpeg', (imageConfig: { backgroundColor: '#fff', padding: 10, }), ); ``` ### graph.toDataURL(type, backgroundColor) 将画布上元素生成为图片的 URL。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------------- | --------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- | | type | `'image/png'` / `'image/jpeg'` / `'image/webp'` / `'image/bmp'` | false | 图片的类型。图的 `renderer` 为默认的 `'canvas'` 时生效,图的 `renderer` 为 `'svg'` 时将导出 svg 文件 | | backgroundColor | String | false | 图片的背景色,可选,不传值时将导出透明背景的图片 | **返回值** - 返回值类型:String; - 返回值表示生成的图片的 URL。 **用法** ```javascript const dataURL = graph.toDataURL(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/find.zh.md ================================================ --- title: 查找元素 order: 5 --- ### graph.getNodes() 获取图中所有节点的实例。 ⚠️ 注意: 这里返回的是节点的实例,而不是节点的数据项。 **返回值** - 返回值类型:Array; - 返回值表示图中所有节点的实例。 **用法** ```javascript const nodes = graph.getNodes(); ``` ### graph.getEdges() 获取图中所有边的实例。 ⚠️ 注意: 这里返回的是边的实例,而不是边的数据项。 **返回值** - 返回值类型:Array; - 返回值表示图中所有边的实例。 **用法** ```javascript const edges = graph.getEdges(); ``` ### graph.getCombos() 获取当前图中所有 combo 的实例。 **返回值** - 返回值类型:Array; - 返回值表示图中所有 combo 的实例。 **用法** ```javascript const combos = graph.getCombos(); ``` ### graph.getComboChildren(combo) 获取指定 combo 中所有的子节点及子 combo。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ---------------------- | | combo | string / ICombo | true | Combo ID 或 combo 实例 | **返回值** - 返回值类型:Object,格式如下 ```javascript { nodes: INode[], edges: ICombo[] } ``` - 返回指定 combo 中的子元素(子节点及子 combo)。 **用法** ``` const elements: { nodes: INode[], combos: ICombo[] } = graph.getComboChildren('combo1') ``` ### graph.getNeighbors(node, type) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | node | string / INode | true | 节点 ID 或节点实例 | | type | 'source' / 'target' / undefined | false | 邻居类型, 'source' 只获取当前节点的源节点,'target' 只获取当前节点指向的目标节点, 若不指定则返回所有类型的邻居 | **返回值** - 返回值类型:Array; - 返回值符合要求的节点数组。 **用法** ```javascript const neighbors = graph.getNeighbors("node1", "source"); ``` ### graph.find(type, fn) 根据具体规则查找单个元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | -------- | -------- | ------------------------------------- | | type | string | true | 元素类型,可选值为 `'node'`、`'edge'` | | fn | Function | true | 查找的规则 | **返回值** - 返回值类型:Object; - 如果有符合规则的元素实例,则返回第一个匹配的元素实例,否则返回 `undefined` 。 **用法** ```javascript const findNode = graph.find("node", (node) => { return node.get("model").x === 100; }); ``` ### graph.findById(id) 根据 ID,查询对应的元素实例。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------- | | id | string | true | 元素 ID | **返回值** - 返回值类型:Object; - 如果有符合规则的元素实例,则返回该元素实例,否则返回 `undefined`。 **用法** ```javascript const node = graph.findById("node"); ``` ### graph.findAll(type, fn) 查询所有满足规则的元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | -------- | -------- | ------------------------------------- | | type | string | true | 元素类型,可选值为 `'node'`、`'edge'` | | fn | Function | true | 查找的规则 | **返回值** - 返回值类型:Array; - 如果有符合规则的元素实例,则返回所有元素实例,否则返回 `undefined`。 **用法** ```javascript const nodes = graph.findAll("node", (node) => { return node.get("model").x; }); ``` ### graph.findAllByState(type, state) 查找所有处于指定状态的元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | ------------------------------------- | | type | string | true | 元素类型,可选值为 `'node'`、`'edge'` | | state | string | true | 状态名称 | **返回值** - 返回值类型:Array; - 返回所有指定状态的元素实例。 **用法** ```javascript // 查询所有选中的元素 const nodes = graph.findAllByState("node", "selected"); ``` ================================================ FILE: packages/site/docs/api/graphFunc/get_set.zh.md ================================================ --- title: 获取/设置 order: 2 --- ### graph.get(key) 根据 key 获取属性值。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | -------- | | key | string | true | 属性的键 | **用法** ```javascript // 获取 group const group = graph.get("group"); // 获取 canvas 实例 const canvas = graph.get("canvas"); // 获取 autoPaint 值 const autoPaint = graph.get("autoPaint"); ``` ### graph.set(key, val) 设置属性值。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ----------------------- | -------- | -------- | | key | string | true | 属性的键 | | val | string / Object / Array | true | 属性的值 | **用法** ```javascript // 设置 capture 值为 false graph.set("capture", false); // 设置 customGroup 值为 group graph.set("customGroup", group); // 设置 nodeIdList 值为数组 graph.set("nodeIdList", [1, 3, 5]); ``` ### graph.getContainer() 获取 Graph 的 DOM 容器。 **参数** 无参数 **用法** ```javascript graph.getContainer(); ``` ### graph.getGroup() 获取 Graph 根[图形分组](/zh/docs/manual/middle/elements/shape/graphics-group)。 **参数** 无参数 **用法** ```javascript graph.getGroup(); ``` ### graph.getMinZoom() 获取 graph 当前允许的最小缩放比例。 **参数** 无参数 **用法** ```javascript graph.getMinZoom(); ``` ### graph.setMinZoom(ratio) 设置 graph 当前允许的最小缩放比例。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | -------------- | | ratio | number | true | 最小缩放比例值 | **用法** ```javascript graph.setMinZoom(0.001); ``` ### graph.getMaxZoom() 获取 graph 当前允许的最大缩放比例。 **参数** 无参数 **用法** ```javascript graph.getMaxZoom(); ``` ### graph.setMaxZoom(ratio) 设置 graph 当前允许的最大缩放比例。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------ | -------- | -------------- | | ratio | number | true | 最大缩放比例值 | **用法** ```javascript graph.setMaxZoom(1000); ``` ### graph.getWidth() 获取 graph 当前的宽度。 **参数** 无参数 **用法** ```javascript graph.getWidth(); ``` ### graph.getHeight() 获取 graph 当前的高度。 **参数** 无参数 **用法** ```javascript graph.getHeight(); ```
================================================ FILE: packages/site/docs/api/graphFunc/hull.zh.md ================================================ --- title: 聚类轮廓包裹 order: 11 --- ## createHull(cfg: HullCfg) **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------- | -------- | ---------- | | cfg | HullCfg | true | 轮廓配置项 | 轮廓包裹的形状支持 `round-convex` / `smooth-convex` / `bubble` 三种类型,默认为 `round-convex` 类型。`round-convex` 为圆角凸包轮廓,smooth-convex 为平滑曲线凸包轮廓,这两种凸包轮廓不可绕开配置项中的 nonMembers;bubble 为自由凹包轮廓,可以绕开 nonMembers。配置项( HullCfg)支持的配置参数详情如下: | 名称 | 类型 | 是否必选 | 描述 | | ---------- | ------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | id | string | true | 包裹的 id | | type | `round-convex` / `smooth-convex` / `bubble` | false | 包裹的类型:`round-convex` 生成圆角凸包轮廓,`smooth-convex` 生成平滑凸包轮廓 / `bubble` 产生一种可以避开 nonMembers 的平滑凹包轮廓([算法](http://vialab.science.uoit.ca/portfolio/bubblesets))。 默认值是 `round-convex`。 | | members | Item[] / string[] | true | 在包裹内部的节点实例或节点 Id 数组 | | nonMembers | Item[] / string[] | false | 不在轮廓内部的节点数组,只在 `bubble` 类型的包裹中生效 | | padding | number | false | 轮廓边缘和内部成员的间距 | | style | object | false | 轮廓的样式属性,属性包括 fill (填充颜色), stroke (描边颜色), opacity (透明度) | **用法** ```javascript let centerNodes = graph.getNodes().filter((node) => !node.getModel().isLeaf); graph.on("afterlayout", () => { const hull1 = graph.createHull({ id: "centerNode-hull", type: "bubble", members: centerNodes, padding: 10, }); const hull2 = graph.createHull({ id: "leafNode-hull1", members: ["node6", "node7"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); const hull3 = graph.createHull({ id: "leafNode-hull2", members: ["node8", "node9", "node10", "node11", "node12"], padding: 10, style: { fill: "lightgreen", stroke: "green", }, }); graph.on("afterupdateitem", (e) => { hull1.updateData(hull1.members); hull2.updateData(hull2.members); hull3.updateData(hull3.members); }); }); ``` ## getHulls() 获取图上所有的包裹轮廓。 **返回值** - 返回值类型:Object;对象中的 key 是字符串类型,代表 hull 的 ID ,对象中的 value 是对应的 hull 实例。 - 返回值表示当前 graph 中所有轮廓 ID 到 轮廓实例的映射。 **用法** ```javascript const hullMap = graph.getHulls(); ``` ## removeHull(hull: string | Hull) 移除指定 id 或指定实例的轮廓。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------------- | -------- | ------------------ | | hull | string / Hull | true | 轮廓 id 或轮廓实例 | **用法** ```javascript graph.removeHull("myHull"); ``` ## removeHulls() 移除当前图上所有轮廓实例。 **参数** 无参数。 **用法** ```javascript graph.removeHulls(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/item.zh.md ================================================ --- title: 元素操作 order: 4 --- ## 增删 ### graph.addItem(type, model, stack) 新增元素(节点和边)。 ⚠️ 注意: 将会直接使用 `model` 对象作为新增元素的数据模型,F6 内部可能会对其增加或修改一些必要的字段。若不希望原始参数被修改,建议在使用深拷贝后的 `model`。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | type | string | true | 元素类型,可选值为 `'node'`、`'edge'` | | model | Object | true | 元素的数据模型,具体内容参见[元素配置项](/zh/docs/api/Items/itemProperties)。 | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript const model = { id: "node", label: "node", address: "cq", x: 200, y: 150, style: { fill: "blue", }, }; graph.addItem("node", model); ``` ### graph.removeItem(item, stack) 删除元素,当 item 为 group ID 时候,则删除分组。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript // 通过 ID 查询节点实例 const item = graph.findById("node"); graph.removeItem(item); // 该操作不会进入到 undo & redo 栈,即 redo & undo 操作会忽略该操作 graph.removeItem(item, false); ``` ## 更新 ### graph.updateItem(item, model, stack) 更新元素,包括更新数据、样式等。若图上有 combo,使用该函数更新一个节点位置后,需要调用 [updateCombo(combo)](/zh/docs/api/Graph#updatecombocombo) 以更新相关 combo 的位置。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | model | Object | true | 需要更新的数据模型,具体内容参见[元素配置项](/zh/docs/api/Items/itemProperties) | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript const model = { id: "node", label: "node", address: "cq", x: 200, y: 150, style: { fill: "blue", }, }; // 通过 ID 查询节点实例 const item = graph.findById("node"); graph.updateItem(item, model); ``` ### graph.refreshItem(item) 刷新指定元素。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | --------------- | -------- | ------------------ | | item | string / Object | true | 元素 ID 或元素实例 | **用法** ```javascript // 通过 ID 查询节点实例 const item = graph.findById("node"); graph.refreshItem(item); ``` ### graph.refreshPositions() 当节点位置发生变化时,刷新所有节点位置,并重计算边的位置。 该方法无参数。 **用法** ```javascript graph.refreshPositions(); ``` ### graph.updateCombos() 根据子元素(子节点与子 combo)的 bbox 更新所有 combos 的绘制,包括 combos 的位置和范围。 **用法** ```javascript // 更新所有 combos graph.updateCombos(); ``` ### graph.updateCombo(combo) 仅更新 combo 及其所有祖先 combo。建议在使用 graph.updateItem 来更新节点位置时,调用该方法以更新节点的祖先 combos。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ---------------------- | | combo | string / ICombo | true | Combo ID 或 Combo 实例 | **用法** ```javascript // 更新了某个节点的位置 const node1 = graph.findById("node1"); graph.updateItem(node1, { x: 100, y: 100, }); const comboId = node1.getModel().comboId; // 更新 node1 所属的 combo 及其所有祖先 combo 的大小和位置 graph.updateCombo(comboId); ``` ### graph.updateComboTree(item, parentId) 更新 Combo 结构,例如移动子树等。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | ----------------------- | -------- | ------------------------------------------- | | item | string / INode / ICombo | true | 需要被更新的 Combo 或 节点 ID | | parentId | string / undefined | false | 新的父 combo ID,undefined 代表没有父 combo | **用法** ``` // 将 combo1 从父 combo 中移出,完成后同原父 combo 平级 graph.updateComboTree('combo1') // 将 combo1 移动到 Combo2 下面,作为 Combo2 的子元素 graph.updateComboTree('combo1', 'combo2') ``` ## 配置 ### graph.node(nodeFn) 设置各个节点样式及其他配置,以及在各个状态下节点的 KeyShape 的样式。 提示: 该方法必须**在 render 之前调用**,否则不起作用。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------- | -------- | ------------------ | | nodeFn | Function | true | 返回每个节点的配置 | **用法** ```javascript graph.node((node) => { return { id: node.id, type: "rect", style: { fill: "blue", }, }; }); graph.data(data); graph.render(); ``` ### graph.edge(edgeFn) 设置各个边样式及其他配置,以及在各个状态下节点的 KeyShape 的样式。 提示: 该方法必须**在 render 之前调用**,否则不起作用。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------- | -------- | ---------------- | | edgeFn | Function | true | 返回每条边的配置 | **用法** ```javascript graph.edge((edge) => { return { id: edge.id, type: "cubic-horizontal", style: { stroke: "green", }, }; }); graph.data(data); graph.render(); ``` ### graph.combo(comboFn) 设置各个 combo 样式及其他配置,以及在各个状态下节点的 KeyShape 的样式。 提示: 该方法必须**在 render 之前调用**,否则不起作用。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | -------- | -------- | --------------------- | | comboFn | Function | true | 返回每个 combo 的配置 | **用法** ```javascript graph.combo((combo) => { return { id: combo.id, type: "rect", style: { stroke: "green", }, }; }); graph.data(data); graph.render(); ``` ## 显示/隐藏 ### graph.showItem(item, stack) 显示指定的元素。若 item 为节点,则相关边也会随之显示。而 [item.show()](/zh/docs/api/Items/itemMethods#itemshow) 则将只显示自身。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript // 通过 ID 查询节点实例 const item = graph.findById("nodeId"); graph.showItem(item); // 等价于 graph.showItem("nodeId"); ``` ### graph.hideItem(item, stack) 隐藏指定元素。若 item 为节点,则相关边也会随之隐藏。而 [item.hide()](/zh/docs/api/Items/itemMethods#itemhide) 则将只隐藏自身。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | stack | boolean | false | 操作是否入 undo & redo 栈,当实例化 Graph 时设置 enableStack 为 true 时,默认情况下会自动入栈,入栈以后,就支持 undo & redo 操作,如果不需要,则设置该参数为 false 即可 | **用法** ```javascript // 通过 ID 查询节点实例 const item = graph.findById("nodeId"); graph.hideItem(item); // 等价于 graph.hideItem("nodeId"); ``` ================================================ FILE: packages/site/docs/api/graphFunc/layout.zh.md ================================================ --- title: 布局 order: 10 --- F6 内置了丰富的布局。关于如何使用 F6 中内置的布局,请参考  [图布局 API](/zh/docs/api/graphLayout/guide) 或 [树图布局 API](/zh/docs/api/treeGraphLayout/guide)。 ### graph.layout() 重新以当前配置的属性进行一次布局。 **用法** ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'force', }, modes: { default: ['drag-node'], }, }); graph.data({ nodes: data.nodes, edges: data.edges.map((edge, i) => { edge.id = 'edge' + i; return Object.assign({}, edge); }), }); graph.render(); function refreshDragedNodePosition(e) { const model = e.item.get('model'); model.fx = e.x; model.fy = e.y; } graph.on('node:dragstart', (e) => { // 拖动节点时重新布局 graph.layout(); refreshDragedNodePosition(e); }); graph.on('node:drag', (e) => { refreshDragedNodePosition(e); }); graph.on('node:dragend', (e) => { e.item.get('model').fx = null; e.item.get('model').fy = null; }); ``` ### graph.updateLayout(cfg) 更新布局配置项。 1. 如果参数 `cfg` 中含有 `type` 字段,`type` 字段类型为 String,且与现有布局方法不同,则更换布局; 1. 如果参数 `cfg` 中不包含 `type` 字段,则保持原有布局,仅更新布局配置项。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------ | | cfg | Object | true | 新布局配置项 | **用法** ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, modes: { default: ['drag-canvas', 'drag-node'], }, layout: { type: 'circular', center: [500, 300], }, animate: true, }); graph.data(data); graph.render(); // 实例化时通过 layout 指定布局,在合适的时候通过 updateLayout 更新布局配置 graph.updateLayout({ radius: 200, startAngle: Math.PI / 4, endAngle: Math.PI, divisions: 5, ordering: 'degree', }); ``` ### destroyLayout() 销毁布局方法,在此之后调用 `changeData` 等方法将不会按照原有的布局算法进行布局。 **用法** ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, modes: { default: ['drag-canvas', 'drag-node'], }, layout: { type: 'circular', center: [500, 300], }, animate: true, }); graph.data(data); graph.render(); graph.destroyLayout(); // 此时 changeData,若 data2 中的节点没有位置信息,将按照初始化计算方法被放置;若有位置信息,则按照该信息被放置 graph.changeData(data2); ``` ================================================ FILE: packages/site/docs/api/graphFunc/mode.zh.md ================================================ --- title: 行为模式 order: 8 --- ### graph.setMode(mode) 切换图行为模式。主要用于不同模式下的行为切换,如从编辑模式下切换到只读模式。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ---------- | | mode | string | true | 模式的名称 | **用法** ```javascript const graph = new F6.Graph({ container: div, width: 500, height: 500, modes: { default: [...], custom: [...] } }) graph.setMode('custom') ``` ### graph.getCurrentMode() 获取当前的行为模式。 该方法无参数。 **返回值** - 返回值类型:String; - 返回值表示当前的行为模式。 **用法** ```javascript // 返回值 mode 表示当前的行为模式 const mode = graph.getCurrentMode(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/on_off.zh.md ================================================ --- title: 事件绑定/解绑 order: 9 --- ### graph.on(eventName, handler) 为图绑定事件监听。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | -------- | -------- | -------------------------------------------------- | | eventName | string | true | 事件名,可选事件名参见 [Event](/zh/docs/api/Event) | | handler | Function | true | 监听函数 | 这里对 `handler` 的参数 `evt` 中 `item` 和 `target` 参数进行解释: | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------- | -------- | ------------------------------------------------------------------ | | item | string | true | 被操作的 item | | target | Function | true | 被操作的具体[图形](/zh/docs/manual/middle/elements/shape-keyshape) | **用法** ```javascript // 为图上的所有节点绑定点击监听 graph.on("node:tap", (evt) => { const item = evt.item; // 被操作的节点 item const target = evt.target; // 被操作的具体图形 // ... }); // 为画布绑定点击监听 graph.on("click", (evt) => { // ... }); ``` ### graph.off(eventName, handler) 为图解除指定的事件监听。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | -------- | -------- | -------------------------------------------------- | | eventName | string | true | 事件名,可选事件名参见 [Event](/zh/docs/api/Event) | | handler | Function | true | 监听函数 | 这里对 `handler` 的参数 `evt` 中 `item` 和 `target` 同 [`graph.on(eventName, handler)`](#oneventname-handler)。该 `handler` 必须与绑定该事件的 `handler` 是同一对象。 **用法** ```javascript // 监听函数 const fn = (evt) => { const item = evt.item; // 被操作的节点 item const target = evt.target; // 被操作的具体图形 // ... }; // 为图上的所有节点绑定点击监听 graph.on("node:tap", fn); // 解除上面的点击监听事件,注意 fn 必须是同一个对象 graph.off("node:tap", fn); ``` ### graph.off(eventName) 为图解除某事件的所有监听。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | ------ | -------- | -------------------------------------------------- | | eventName | string | true | 事件名,可选事件名参见 [Event](/zh/docs/api/Event) | **用法** ```javascript // 监听函数 const fn1 = (evt) => { const item = evt.item; // 被操作的节点 item const target = evt.target; // 被操作的具体图形 // ... }; const fn2 = (evt) => { // ... }; // 为图上的所有节点绑定点击监听 graph.on("node:tap", fn1); graph.on("node:tap", fn2); // 解除上面的所有节点点击监听事件 graph.off("node:tap"); ``` ### graph.off() 为图解除所有监听。该函数无参数。 **用法** ```javascript // 监听函数 const fn1 = (evt) => { // ... }; const fn2 = (evt) => { // ... }; // 为图上的所有节点绑定点击监听 graph.on("node:tap", fn1); graph.on("afteranimate", fn2); // 解除图上所有监听事件 graph.off(); ``` ================================================ FILE: packages/site/docs/api/graphFunc/render.zh.md ================================================ --- title: 渲染与更新 order: 1 --- ### graph.render() 根据提供的数据渲染视图。 **用法** ```javascript graph.render(); ``` ### graph.refresh() 当源数据中**现有**节点/边/ Combo 的数据项发生配置的变更时,根据新数据刷新视图。 注意:节点/边/ Combo 数据的增删需要使用 [graph.addItem](./Graph#additemtype-model) / [graph.removeItem](./Graph#removeitemitem) 或 [graph.changeData](./Graph#changedatadata)。 该方法无参数。 **用法** ```javascript graph.refresh(); ``` ### graph.paint() 仅重新绘制画布。当设置了元素样式或状态后,通过调用 `paint()` 方法,让修改生效。 该方法无参数。 **用法** ```javascript const item = e.item; const graph = this.graph; const autoPaint = graph.get("autoPaint"); graph.setAutoPaint(false); graph.setItemState(item, "selected", true); graph.paint(); graph.setAutoPaint(autoPaint); ``` ### graph.setAutoPaint(auto) 设置是否在更新/删除后自动重绘,一般搭配 `paint()` 方法使用。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------- | -------- | ------------ | | auto | Boolean | true | 是否自动重绘 | **用法** ```javascript const item = e.item; const graph = this.graph; const autoPaint = graph.get("autoPaint"); graph.setAutoPaint(false); graph.setItemState(item, "selected", true); graph.paint(); graph.setAutoPaint(autoPaint); ``` ================================================ FILE: packages/site/docs/api/graphFunc/stack.zh.md ================================================ --- title: 操作栈 order: 13 --- ## pushStack(action, data, stackType) 入栈操作。 实现 undo 功能,可参考[这里](https://github.com/antvis/F6/blob/master/packages/plugin/src/toolBar/index.ts#L208) 实现 redo 功能,可参考[这里](https://github.com/antvis/F6/blob/master/packages/plugin/src/toolBar/index.ts#L295) **参数** | 名称 | 类型 | 是否必选 | 描述 | | --------- | --------------- | -------- | ------------------------- | | action | string | false | 操作类型,默认值为 update | | data | unknown | false | 入栈的数据 | | stackType | 'redo' / 'undo' | false | 入栈类型,默认为 undo | ## getUndoStack() 获取 undo 栈。 ## getRedoStack() 获取 redo 栈。 ## getStackData() 获取栈中的数据。 返回值类型为: ``` { undoStack: StackData[]; redoStack: StackData[]; }; ``` ## clearStack() 清空栈中的数据。 ================================================ FILE: packages/site/docs/api/graphFunc/state.zh.md ================================================ --- title: 元素状态 order: 7 --- ### graph.setItemState(item, state, value) 设置元素状态。支持单个状态多值的情况,详情参考 [F6 状态管理最佳实践](/zh/docs/manual/middle/states/state-new)。 该方法在执行过程中会触发 `beforitemstatechange`,`afteritemstatechange` 事件。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ---------------- | -------- | ---------------------------------------------------- | | item | string / Item | true | 元素 ID 或元素实例 | | state | string | true | 状态值,支持自定义,如 selected、hover、actived 等。 | | value | Boolean / string | true | 是否启用状态 | **用法** ```javascript // 布尔状态 'selected' graph.setItemState("node1", "selected", true); // 多值状态 'body' graph.setItemState("node1", "body", "health"); graph.setItemState("node2", "body", "ill"); ``` ### graph.clearItemStates(item, states) 清除元素状态,可以一次性清除多个状态。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | --------------------- | -------- | ---------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | states | string / Array / null | false | 取值可以是单个状态值,也可以是状态值数组 | **用法** ```javascript // 清除单个状态 graph.clearItemStates(node, "a"); // 清除多个状态 graph.clearItemStates(node, ["a", "b"]); // 清除所有 graph.clearItemStates(node); ``` ### graph.priorityState(item, state) 将指定状态的优先级提升为最高优先级。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | --------------- | -------- | ------------------ | | item | string / Object | true | 元素 ID 或元素实例 | | states | string | true | 状态名称 | **用法** ```javascript // 将 node 的 a 状态调整为优先级最高 graph.priorityState(node, "a"); ``` ================================================ FILE: packages/site/docs/api/graphFunc/transform.zh.md ================================================ --- title: 视口操作 order: 3 --- ### graph.getZoom() 获取当前视口的缩放比例。 该方法无参数。 **返回值** - 返回值类型:Number; - 返回值表示当前视口的缩放比例, 默认值为 `1`。 **用法** ```javascript // 返回值zoom表示当前视口的缩放比例 const zoom = graph.getZoom(); ``` ### graph.zoom(ratio, center) 改变视口的缩放比例,在当前画布比例下缩放,是相对比例。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------ | -------- | -------------------------------------------------------------------------------------------- | | ratio | Number | true | 缩放比例 | | center | Object | false | 以 `center` 的 `x`、`y` 坐标为中心缩放,如果省略了 `center` 参数,则以元素当前位置为中心缩放 | **用法** ```javascript // 以 (100, 100) 为中心点,放大3倍 graph.zoom(3, { x: 100, y: 100 }); // 以当前元素位置为中心,缩小到 0.5 graph.zoom(0.5); ``` ### graph.zoomTo(toRatio, center) 缩放视窗窗口到一个固定比例。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | ------ | -------- | -------------------------------------------------------------------------------------------- | | toRatio | Number | true | 固定比例值 | | center | Object | false | 以 `center` 的 `x`、`y` 坐标为中心缩放,如果省略了 `center` 参数,则以元素当前位置为中心缩放 | **用法** ```javascript // 以 (100, 100) 为中心点,放大3倍 graph.zoomTo(3, { x: 100, y: 100 }); // 以当前元素位置为中心,缩小到 0.5 graph.zoomTo(0.5); ``` ### graph.changeSize(width, height) 改变画布大小。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------ | -------- | -------- | | width | Number | true | 画布宽度 | | height | Number | true | 画布高度 | **用法** ```javascript graph.changeSize(600, 350); ``` ### graph.translate(dx, dy) 采用**相对位移**来平移画布。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------ | | dx | Number | true | 水平方向位移 | | dy | Number | true | 垂直方向位移 | **用法** ```javascript graph.translate(100, 100); ``` ### graph.moveTo(x, y) 采用**绝对位移**将画布移动到指定坐标。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------ | | x | Number | true | 水平方向坐标 | | y | Number | true | 垂直方向坐标 | **用法** ```javascript graph.moveTo(200, 300); ``` ### graph.fitView(padding) 让画布内容适应视口。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | -------------- | -------- | --------------------------------------------- | | padding | Number / Array | false | [top, right, bottom, left] 四个方向上的间距值 | **用法** ```javascript // padding 只设置为一个值,则表示 top = right = bottom = left = 20 graph.fitView(20); // 等价于 graph.fitView(20) graph.fitView([20]); // padding 设置为数组,只传 2 个值,则 top = bottom = 20, right = left = 10 graph.fitView([20, 10]); // padding 设置为数组,四个方向值都指定 graph.fitView([20, 10, 20, 15]); ``` ### graph.fitCenter() 平移图到中心将对齐到画布中心,但不缩放。优先级低于 fitView。 **用法** ```javascript // 在渲染和动画完成后调用 graph.fitCenter(); ``` ### graph.focusItem(item, animate, animateCfg) 移动图,使得 item 对齐到视口中心,该方法可用于做搜索后的缓动动画。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---------- | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------- | | item | string / Object | true | 元素 ID 或元素实例 | | animate | boolean | false | 是否带有动画。若未配置,则跟随 graph 的 `animate` 参数 | | animateCfg | Object | false | 若带有动画,可配置动画,参见[基础动画教程](/zh/docs/manual/advanced/animation#animatecfg)。若未配置,则跟随 graph 的 `animateCfg` 参数 | **用法** ```javascript graph.focusItem(item); // 动画地移动 graph.focusItem(item, true); // 动画地移动,并配置动画 graph.focusItem(item, true, { easing: "easeCubic", duration: 400, }); ``` ================================================ FILE: packages/site/docs/api/graphFunc/watermarker.zh.md ================================================ --- title: 增加水印 order: 16 --- ### graph.setTextWaterMarker(texts, config) 为画布添加文字水印。注意,使用 `downloadImage` 或 `downloadFullImage` 下载图片将不会带有水印。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------- | -------- | ---------------------------------------- | | texts | String[] | true | 水印文字内容数组,数组中的不同项将会换行 | | config | Object | false | 文字水印配置项,可选,具体字段见下方 | 其中,config 为文字水印配置项,具体字段: | 名称 | 类型 | 是否必选 | 描述 | | ---------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | width | Number | false | 单个水印的宽,可控制单个水印之间的水平间距,默认 `150` | | height | Number | false | 单个水印的高,可控制单个水印之间的竖直间距,默认 `100` | | compatible | Boolean | false | 是否需要兼容不支持 `pointer-events` 属性的浏览器,默认为 `false` | | text | Object | false | 文本图形的样式属性,默认为:`{ x: 0, y: 60, lineHeight: 20, rotate: 20, fontSize: 14, fontFamily: 'Microsoft YaHei', fill: 'rgba(0, 0, 0, 0.1)', baseline: 'Middle', }` | **用法** ```javascript graph.setTextWaterMarker(["AntV", "F6"]); ``` ### graph.setImageWaterMarker(imgURL, config) 为画布添加图片水印。注意,使用 `downloadImage` 或 `downloadFullImage` 下载图片将不会带有水印。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | -------- | -------- | ---------------------------------------------------------------------------------------------------- | | imgURL | String[] | true | 水印图片,默认为 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg' | | config | Object | false | 图片水印配置项,可选,具体字段见下方 | 其中,config 为图片水印配置项,具体字段: | 名称 | 类型 | 是否必选 | 描述 | | ---------- | ------- | -------- | ------------------------------------------------------------------------------ | | width | Number | false | 单个水印的宽,可控制单个水印之间的水平间距,默认 `150` | | height | Number | false | 单个水印的高,可控制单个水印之间的竖直间距,默认 `130` | | compatible | Boolean | false | 是否需要兼容不支持 `pointer-events` 属性的浏览器,默认为 `false` | | image | Object | false | 图片图形的样式属性,默认为:`{ x: 0, y: 0, width: 30, height: 20, rotate: 0 }` | **用法** ```javascript graph.setImageWaterMarker( "https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg", { width: 300, height: 200, image: { rotate: Math.PI / 3 }, }, ); ``` ================================================ FILE: packages/site/docs/api/graphLayout/circular.zh.md ================================================ --- title: 环形 Circular order: 4 --- Circular 布局将所有节点布局在一个圆环上,可以选择节点在圆环上的排列顺序。可以通过参数的配置扩展出环的分组布局、螺旋形布局等。原文链接: A framework and algorithms for circular drawings of graphs
img img img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'circular', center: [200, 200], // 可选,默认为图的中心 radius: null, // 可选 startRadius: 10, // 可选 endRadius: 100, // 可选 clockwise: false, // 可选 divisions: 5, // 可选 ordering: 'degree', // 可选 angleRatio: 1, // 可选 }, }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.radius **类型**: Number
**默认值**:null
**是否必须**:false
**说明**:圆的半径。若设置了 radius,则 startRadius 与 endRadius 不生效 ## layoutCfg.startRadius **类型**: Number
**默认值**:null
**是否必须**:false
**说明**:螺旋状布局的起始半径 ## layoutCfg.endRadius **类型**:Number
**默认值**:null
**是否必须**:false
**说明**:螺旋状布局的结束半径 ## layoutCfg.clockwise **类型**:Boolean
**默认值**:true
**是否必须**:false
**说明**:是否顺时针排列 ## layoutCfg.divisions **类型**:Number
**默认值**:1
**是否必须**:false
**说明**:节点在环上的分段数(几个段将均匀分布),在 endRadius - startRadius != 0 时生效 ## layoutCfg.ordering **类型**:String
**默认值**:false
**可选值**:null | 'topology' | 'degree'
**是否必须**:false
**说明**:节点在环上排序的依据。默认 null 代表直接使用数据中的顺序。'topology' 按照拓扑排序。'degree' 按照度数大小排序 ## layoutCfg.angleRatio **类型**: Number
**默认值**:1
**是否必须**:false
**说明**:从第一个节点到最后节点之间相隔多少个 2\*PI ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互。 ================================================ FILE: packages/site/docs/api/graphLayout/comboForce.zh.md ================================================ --- title: Combo 力导向 ComboForce order: 11 --- ComboForce 是基于力导向的专用于带有 combo 的图的布局算法。通过自研改造经典力导向算法,将根据节点的 combo 信息,施加不同的力以达到同 combo 节点尽可能聚集,不同 combo 之间尽可能无重叠的布局。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, groupByTypes: false, // 若希望在带有 combo 的图上,节点、边、combo 的层级符合常规逻辑,需要将 groupByTypes 设置为 false layout: { type: 'comboForce', center: [ 200, 200 ], // 可选,默认为图的中心 linkDistance: 50, // 可选,边长 nodeStrength: 30, // 可选 edgeStrength: 0.1, // 可选 onTick: () => { // 可选 console.log('ticking'); }, onLayoutEnd: () => { // 可选 console.log('combo force layout done'); } } ); ``` ### layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ### layoutCfg.maxIteration **类型**: Number
**默认值**:100
**是否必须**:false
**说明**:最大迭代次数 ### layoutCfg.linkDistance **类型**: Number / Function
**默认值**:10
**是否必须**:false
**说明**:边长度 ### layoutCfg.nodeStrength **类型**: Number / Function
**默认值**:30
**是否必须**:false
**说明**:节点作用力 ### layoutCfg.edgeStrength **类型**:Number / Function
**默认值**:0.2
**是否必须**:false
**说明**:边的作用力 ### layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止节点之间以及 combo 之间的重叠,若开启,则 `preventNodeOverlap` 与 `preventComboOverlap` 将均被开启。详见 `preventNodeOverlap` 与 `preventComboOverlap` 介绍 ### layoutCfg.preventNodeOverlap **类型**:Boolean
**默认值**:true
**是否必须**:false
**说明**:是否防止节点之间的重叠。必须配合下面属性 `nodeSize` 或节点数据中的 `size` 属性,只有在数据中设置了 `size` 或在该布局中配置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ### layoutCfg.preventComboOverlap **类型**:Boolean
**默认值**:true
**是否必须**:false
**说明**:是否防止 combo 之间的重叠 ### layoutCfg.collideStrength **类型**:Number
**默认值**:undefined
**是否必须**:false
**说明**:统一设置防止节点之间以及 combo 之间重叠的力强度,范围 [0, 1]。若 `collideStrength` 不为 `undefined`,则 `nodeCollideStrength` 与 `comboCollideStrength` 将均被设置为统一的值 ### layoutCfg.nodeCollideStrength **类型**:Number
**默认值**:0.5
**是否必须**:false
**说明**:设置防止节点之间重叠的力强度,范围 [0, 1] ### layoutCfg.comboCollideStrength **类型**:Number
**默认值**:0.5
**是否必须**:false
**说明**:防止 combo 之间重叠的力强度,范围 [0, 1] ### layoutCfg.nodeSize **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:节点大小(直径)。用于碰撞检测。若不指定,则根据传入的节点的 size 属性计算。若即不指定,节点中也没有 `size`,则默认大小为 `10` ### layoutCfg.nodeSpacing **类型**: Number / Function
**默认值**: 0
**是否必须**: false
**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a node if (d.id === "node1") { return 100; } return 10; }; ```
**描述**: `preventNodeOverlap` 或 `preventOverlap` 为 `true` 时生效, 防止重叠时节点边缘间距的最小值。可以是回调函数, 为不同节点设置不同的最小间距, 如示例 2 所示 ### layoutCfg.comboSpacing **类型**: Number / Function
**默认值**: 0
**是否必须**: false
**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a combo if (d.id === "combo1") { return 100; } return 10; }; ```
**描述**: `preventComboOverlap` 或 `preventOverlap` 为 `true` 时生效, 防止重叠时 combo 边缘间距的最小值。可以是回调函数, 为不同节点设置不同的最小间距, 如示例 2 所示 ### layoutCfg.comboPadding **类型**: Number / Function
**默认值**: 10
**是否必须**: false
**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a combo if (d.id === "combo1") { return 100; } return 10; }; ```
**描述**: Combo 内部的 padding 值,不用于渲染,仅用于计算力。推荐设置为与视图上 combo 内部 padding 值相同的值 ### layoutCfg.alpha **类型**:Number
**默认值**:1
**是否必须**:false
**说明**:当前的迭代收敛阈值 ### layoutCfg.alphaDecay **类型**:Number
**默认值**:0.028
**是否必须**:false
**说明**:迭代阈值的衰减率。范围 [0, 1]。0.028 对应迭代数为 300 ### layoutCfg.alphaMin **类型**:Number
**默认值**:0.001
**是否必须**:false
**说明**:停止迭代的阈值 ### layoutCfg.onTick **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:每一次迭代的回调函数 ### layoutCfg.onLayoutEnd **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:布局完成后的回调函数 ### layoutCfg.gravity **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:重力的大小,影响布局的紧凑程度 ### layoutCfg.comboGravity **类型**: Number
**默认值**:30
**是否必须**:false
**说明**:每个 combo 内部的重力大小,影响聚类的紧凑程度 ### layoutCfg.optimizeRangeFactor **类型**: Number
**默认值**:1
**是否必须**:false
**说明**:优化计算性能,两节点间距超过 `optimizeRangeFactor * width` 则不再计算斥力和重叠斥力。通过合理设置该参数可以较少计算量 ### layoutCfg.depthAttractiveForceScale **类型**: Number
**默认值**:0.5
**是否必须**:false
**说明**:根据边两端节点层级差距的调整引力的系数的因子,取值范围 [0, 1]。层级差距越大,引力越小 ### layoutCfg.depthRepulsiveForceScale **类型**: Number
**默认值**:2
**是否必须**:false
**说明**:根据边两端节点层级差距的调整斥力系数的因子,取值范围 [1, Infinity]。层级差距越大,斥力越大 ### layoutCfg.velocityDecay **类型**: Number
**默认值**:0.6
**是否必须**:false
**说明**:节点运动速度衰减参数 ### layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/concentric.zh.md ================================================ --- title: 同心圆 Concentric order: 6 --- Concentric 布局为同心圆布局,用户可以指定节点某个属性为排序依据(默认为节点度数 degree),该属性值越高,则该节点布局后的位置中心。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'concentric', center: [ 200, 200 ], // 可选, linkDistance: 50, // 可选,边长 preventOverlap: true, // 可选,必须配合 nodeSize nodeSize: 30, // 可选 sweep: 10, // 可选 equidistant: false, // 可选 startAngle: 0, // 可选 clockwise: false, // 可选 maxLevelDiff: 10, // 可选 sortBy: 'degree' // 可选 workerEnabled: true // 可选,开启 web-worker } }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止重叠,必须配合下面属性 `nodeSize`,只有设置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ## layoutCfg.nodeSize **类型**: Number
**默认值**:30
**是否必须**:false
**说明**:节点大小(直径)。用于防止节点重叠时的碰撞检测 ## layoutCfg.minNodeSpacing **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:环与环之间最小间距,用于调整半径 ## layoutCfg.sweep **类型**: Number
**默认值**:undefined
**是否必须**:false
**说明**:第一个节点与最后一个节点之间的弧度差。若为 undefined ,则将会被设置为  2 _ Math.PI _ (1 - 1 / |level.nodes|) ,其中 level.nodes 为该算法计算出的每一层的节点,|level.nodes| 代表该层节点数量 ## layoutCfg.equidistant **类型**: Boolean
**默认值**:false
**是否必须**:false
**说明**:环与环之间的距离是否相等 ## layoutCfg.startAngle **类型**: Number
**默认值**:3 / 2 \* Math.PI
**是否必须**:false
**说明**:开始方式节点的弧度 ## layoutCfg.clockwise **类型**: Boolean
**默认值**:false
**是否必须**:false
**说明**:是否按照顺时针排列 ## layoutCfg.maxLevelDiff **类型**: Number
**默认值:**undefined
**是否必须**:false
**说明**:每一层同心值的求和。若为 undefined,则将会被设置为 maxValue / 4 ,其中 maxValue 为最大的排序依据的属性值。例如,若 `sortBy` 为 `'degree'`,则 maxValue 为所有节点中度数最大的节点的度数 ## layoutCfg.sortBy **类型**: String
**默认值**:undefined
**是否必须**:false
**说明**:指定排序的依据(节点属性名),数值越高则该节点被放置得越中心。若为 undefined,则会计算节点的度数,度数越高,节点将被放置得越中心 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/dagre.zh.md ================================================ --- title: 层次 Dagre order: 7 --- Dagre 是一种层次布局。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'dagre', rankdir: 'LR', // 可选,默认为图的中心 align: 'DL', // 可选 nodesep: 20, // 可选 ranksep: 50, // 可选 controlPoints: true, // 可选 }, }); ``` ## layoutCfg.rankdir **类型**: String
**可选值**:'TB' | 'BT' | 'LR' | 'RL'
**默认值**:'TB'
**是否必须**:false
**说明**:布局的方向。T:top(上);B:bottom(下);L:left(左);R:right(右)。 - 'TB':从上至下布局; - 'BT':从下至上布局; - 'LR':从左至右布局; - 'RL':从右至左布局。 ## layoutCfg.align **类型**: String
**可选值**:'UL' | 'UR' | 'DL' | 'DR' | undefined
**默认值**:'UL'
**是否必须**:false
**说明**:节点对齐方式。U:upper(上);D:down(下);L:left(左);R:right(右) - 'UL':对齐到左上角; - 'UR':对齐到右上角; - 'DL':对齐到左下角; - 'DR':对齐到右下角; - undefined:默认,中间对齐。 ## layoutCfg.nodesep **类型**: Number
**默认值**:50
**是否必须**:false
**说明**:节点间距(px)。在`rankdir` 为 `'TB'` 或 `'BT'` 时是节点的水平间距;在`rankdir` 为 `'LR'` 或 `'RL'` 时代表节点的竖直方向间距 ## layoutCfg.ranksep **类型**: Number
**默认值**:50
**是否必须**:false
**说明**:层间距(px)。在`rankdir` 为 `'TB'` 或 `'BT'` 时是竖直方向相邻层间距;在`rankdir` 为 `'LR'` 或 `'RL'` 时代表水平方向相邻层间距 ## layoutCfg.nodesepFunc **类型**: Function
**默认值**:undefined
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 100; return 10; }; ```
**是否必须**:false
**说明**:节点间距(px)的回调函数,通过该参数可以对不同节点设置不同的节点间距。在`rankdir` 为 'TB' 或 'BT' 时是节点的水平间距;在`rankdir` 为 'LR' 或 'RL' 时代表节点的竖直方向间距。优先级高于 `nodesep`,即若设置了 `nodesep`,则 `nodesepFunc` 不生效 ## layoutCfg.ranksepFunc **类型**: Function
**默认值**:undefined
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 100; return 10; }; ```
**是否必须**:false
**说明**:层间距(px)的回调函数,通过该参数可以对不同节点设置不同的层间距。在`rankdir` 为 'TB' 或 'BT' 时是竖直方向相邻层间距;在`rankdir` 为 'LR' 或 'RL' 时代表水平方向相邻层间距。优先级高于 `ranksep`,即若设置了 `ranksep`,则 `ranksepFunc` 不生效 ## layoutCfg.controlPoints **类型**: Boolean
**默认值**:false
**是否必须**:false
**说明**:是否保留布局连线的控制点 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ## layoutCfg.sortByCombo **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 同一层节点是否根据每个节点数据中的 `comboId` 进行排序,以防止 combo 重叠 ================================================ FILE: packages/site/docs/api/graphLayout/force.zh.md ================================================ --- title: Force 力导向 order: 3 --- Force 布局经典的力导向布局方法,与 d3 的力导向布局方法相对应。其属性也与 d3.js 的力导布局参数相对应。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'force', center: [ 200, 200 ], // 可选,默认为图的中心 linkDistance: 50, // 可选,边长 nodeStrength: 30, // 可选 edgeStrength: 0.1, // 可选 collideStrength: 0.8, // 可选 nodeSize: 30, // 可选 alpha: 0.3, // 可选 alphaDecay: 0.028, // 可选 alphaMin: 0.01, // 可选 forceSimulation: null, // 可选 onTick: () => { // 可选 console.log('ticking'); }, onLayoutEnd: () => { // 可选 console.log('force layout done'); } } ); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.linkDistance **类型**: Number / Function
**默认值**:50
**是否必须**:false
**说明**:边长度 ## layoutCfg.nodeStrength **类型**: Number / Function
**默认值**:null
**是否必须**:false
**说明**:节点作用力,正数代表节点之间的引力作用,负数代表节点之间的斥力作用 ## layoutCfg.edgeStrength **类型**:Number / Function
**默认值**:null
**是否必须**:false
**说明**:边的作用力,范围是 0 到 1,默认根据节点的出入度自适应 ## layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止重叠,必须配合下面属性 `nodeSize` 或节点数据中的 `size` 属性,只有在数据中设置了 `size` 或在该布局中配置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ## layoutCfg.collideStrength **类型**:Number
**默认值**:1
**是否必须**:false
**说明**:防止重叠的力强度,范围 [0, 1] ## layoutCfg.nodeSize **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:节点大小(直径)。用于碰撞检测。若不指定,则根据传入的节点的 size 属性计算。若即不指定,节点中也没有 `size`,则默认大小为 `10` ## layoutCfg.nodeSpacing **类型**: Number / Function
**默认值**: 0
**是否必须**: false

**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a node if (d.id === "node1") { return 100; } return 10; }; ```
**描述**: `preventOverlap` 为 `true` 时生效, 防止重叠时节点边缘间距的最小值。可以是回调函数, 为不同节点设置不同的最小间距, 如示例 2 所示 ## layoutCfg.alpha **类型**:Number
**默认值**:0.3
**是否必须**:false
**说明**:当前的迭代收敛阈值 ## layoutCfg.alphaDecay **类型**:Number
**默认值**:0.028
**是否必须**:false
**说明**:迭代阈值的衰减率。范围 [0, 1]。0.028 对应迭代数为 300 ## layoutCfg.alphaMin **类型**:Number
**默认值**:0.001
**是否必须**:false
**说明**:停止迭代的阈值 ## layoutCfg.clustering **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否按照聚类信息布局 ## layoutCfg.clusterNodeStrength **类型**:Number
**默认值**:-1
**是否必须**:false
**说明**:聚类节点作用力。负数代表斥力 ## layoutCfg.clusterEdgeStrength **类型**:Number
**默认值**:0.1
**是否必须**:false
**说明**:聚类边作用力 ## layoutCfg.clusterEdgeDistance **类型**:Number
**默认值**:100
**是否必须**:false
**说明**:聚类边长度 ## layoutCfg.clusterNodeSize **类型**:Number
**默认值**:10
**是否必须**:false
**说明**:聚类节点大小 / 直径,直径越大,越分散 ## layoutCfg.clusterFociStrength **类型**:Number
**默认值**:0.8
**是否必须**:false
**说明**:用于 foci 的力 ## layoutCfg.forceSimulation **类型**:Object
**默认值**:null
**是否必须**:false
**说明**:自定义 force 方法,若不指定,则使用 d3.js 的方法 ## layoutCfg.onTick **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:每一次迭代的回调函数 ## layoutCfg.onLayoutEnd **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:布局完成后的回调函数 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/forceAtlas2.zh.md ================================================ --- title: Force Atlas 2 order: 11 --- Force Atlas 2 是一种力导向布局的变形,比 force 收敛地更好,更紧凑。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'forceAtlas2', width: 300, height: 300, }, }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.width **类型**: Number
**默认值**:图的宽度
**是否必须**:false
**说明**:布局的宽度范围 ## layoutCfg.height **类型**: Number
**默认值**:图的高度
**是否必须**:false
**说明**:布局的高度范围 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ## layoutCfg.kr **类型**: Number
**默认值**:5
**是否必须**:false
**说明**:斥力系数,可用于调整布局的紧凑程度。kr 越大,布局越松散 ## layoutCfg.kg **类型**: Number
**默认值**:5
**是否必须**:false
**说明**:重力系数。kg 越大,布局越聚集在中心 ## layoutCfg.ks **类型**: Number
**默认值**:0.1
**是否必须**:false
**说明**:控制迭代过程中,节点移动的速度 ## layoutCfg.tao **类型**: Number
**默认值**:0.1
**是否必须**:false
**说明**:迭代接近收敛时停止震荡的容忍度 ## layoutCfg.mode **类型**: 'normal' | 'linlog'
**默认值**:'normal'
**是否必须**:false
**说明**:'linlog' 模式下,聚类将更加紧凑 ## layoutCfg.preventOverlap **类型**: boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止节点重叠 ## layoutCfg.dissuadeHubs **类型**: boolean
**默认值**:false
**是否必须**:false
**说明**:是否打开 hub 模式。若为 true,相比与出度大的节点,入度大的节点将会有更高的优先级被放置在中心位置 ## layoutCfg.barnesHut **类型**: boolean
**默认值**:false
**是否必须**:false
**说明**:是否打开 barnes hut 加速,即四叉树加速。由于每次迭代需要更新构建四叉树,建议在较大规模图上打开 ## layoutCfg.prune **类型**: boolean
**默认值**:false
**是否必须**:false
**说明**:是否开启自动剪枝模式。默认情况下,当节点数量大于 100 时它将会被激活。注意,剪枝能够提高收敛速度,但可能会降低图的布局质量 ## layoutCfg.maxIteration **类型**: number
**默认值**:0
**是否必须**:false
**说明**:最大迭代次数,若为 0 则将自动调整 ## layoutCfg.getWidth **类型**: function
**默认值**:undefined
**是否必须**:false
**说明**:节点宽度的函数,参数为节点数据 ## layoutCfg.getHeight **类型**: function
**默认值**:undefined
**是否必须**:false
**说明**:节点高度的函数,参数为节点数据 ## layoutCfg.onLayoutEnd **类型**: function
**默认值**:undefined
**是否必须**:false
**说明**:布局结束后的回调函数 ## layoutCfg.onTick **类型**: function
**默认值**:undefined
**是否必须**:false
**说明**:布局每次迭代的回调函数 ================================================ FILE: packages/site/docs/api/graphLayout/fruchterman.zh.md ================================================ --- title: Fruchterman order: 8 --- Fruchterman 布局是一种力导布局。算法原文: Graph Drawing by Force-directed Placement img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'fruchterman', center: [200, 200], // 可选,默认为图的中心 gravity: 20, // 可选 speed: 2, // 可选 clustering: true, // 可选 clusterGravity: 30, // 可选 maxIteration: 2000, // 可选,迭代次数 workerEnabled: true, // 可选,开启 web-worker gpuEnabled: true, // 可选,开启 GPU 并行计算,F6 4.0 支持 }, }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.maxIteration **类型**: Number
**默认值**:1000
**是否必须**:false
**说明**:最大迭代次数 ## layoutCfg.gravity **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:重力的大小,影响布局的紧凑程度 ## layoutCfg.speed **类型**: Number
**默认值**:1
**是否必须**:false
**说明**:每次迭代节点移动的速度。速度太快可能会导致强烈震荡 ## layoutCfg.clustering **类型**: Boolean
**默认值**:false
**是否必须**:false
**说明**:是否按照聚类布局 ## layoutCfg.clusterGravity **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:聚类内部的重力大小,影响聚类的紧凑程度,在 `clustering` 为 `true` 时生效 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ## layoutCfg.gpuEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 GPU 并行计算。若用户的机器或浏览器不支持 GPU 计算,将会自动降级为 CPU 计算。性能提升概览: ================================================ FILE: packages/site/docs/api/graphLayout/gforce.zh.md ================================================ --- title: GForce order: 2 --- GForce 实现了经典的力导向算法,F6 支持。能够更加自由地支持设置节点质量、群组中心力等。更重要的是,它支持 GPU 并行计算。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'gForce', center: [ 200, 200 ], // 可选,默认为图的中心 linkDistance: 50, // 可选,边长 nodeStrength: 30, // 可选 edgeStrength: 0.1, // 可选 nodeSize: 30, // 可选 onTick: () => { // 可选 console.log('ticking'); }, onLayoutEnd: () => { // 可选 console.log('force layout done'); }, workerEnabled: true, // 可选,开启 web-worker gpuEnabled: true // 可选,开启 GPU 并行计算,F6 4.0 支持 ... // 更多参数见下方 } }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.linkDistance **类型**: Number / Function
**默认值**1
**是否必须**:false
**说明**:边长度 ## layoutCfg.nodeStrength **类型**: Number / Function
**默认值**:1000
**是否必须**:false
**说明**:节点作用力,正数代表节点之间的斥力作用,负数代表节点之间的引力作用(注意与 'force' 相反) ## layoutCfg.edgeStrength **类型**:Number / Function
**默认值**:200
**是否必须**:false
**说明**:边的作用力(引力)大小 ## layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止重叠,必须配合下面属性 `nodeSize` 或节点数据中的 `size` 属性,只有在数据中设置了 `size` 或在该布局中配置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ## layoutCfg.nodeSize **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:节点大小(直径)。用于碰撞检测。若不指定,则根据传入的节点的 size 属性计算。若即不指定,节点中也没有 `size`,则默认大小为 `10` ## layoutCfg.nodeSpacing **类型**: Number / Function
**默认值**: 0
**是否必须**: false
**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a node if (d.id === "node1") { return 100; } return 10; }; ```
**描述**: `preventOverlap` 为 `true` 时生效, 防止重叠时节点边缘间距的最小值。可以是回调函数, 为不同节点设置不同的最小间距, 如示例 2 所示 ## layoutCfg.minMovement **类型**:Number
**默认值**:0.5
**是否必须**:false
**说明**:当一次迭代的平均移动长度小于该值时停止迭代。数字越小,布局越收敛,所用时间将越长 ## layoutCfg.maxIteration **类型**:Number
**默认值**:1000
**是否必须**:false
**说明**:最大迭代次数。当迭代次数超过该值,但平均移动长度仍然没有达到 minMovement,也将强制停止迭代 ## layoutCfg.damping **类型**:Number
**默认值**:0.9
**是否必须**:false
**说明**:阻尼系数,取值范围 [0, 1]。数字越大,速度降低得越慢 ## layoutCfg.maxSpeed **类型**:Number
**默认值**:1000
**是否必须**:false
**说明**:一次迭代的最大移动长度 ## layoutCfg.coulombDisScale **类型**:Number
**默认值**:0.005
**是否必须**:false
**说明**:库伦系数,斥力的一个系数,数字越大,节点之间的斥力越大 ## layoutCfg.getMass **类型**:Function
**默认值**:undefined
**是否必须**:false
**说明**:每个节点质量的回调函数,若不指定,则默认使用度数作为节点质量。使用方法与 `nodeSpacing` 类似,每个回调函数返回一个数值作为该节点的质量 ## layoutCfg.getCenter **类型**:Function
**默认值**:undefined
**是否必须**:false
**说明**:每个节点中心力的 x、y、强度的回调函数,若不指定,则没有额外中心力
**示例**: ```javascript (d, degree) => { // d is a node, degree is the degree of the node if (d.clusterId === "c1") return [100, 100, 10]; // x, y, strength if (degree === 0) return [250, 250, 15]; return [180, 180, 5]; // x, y, strength }; ``` ## layoutCfg.gravity **类型**:Number
**默认值**:10
**是否必须**:false
**说明**:中心力大小,指所有节点被吸引到 `center` 的力。数字越大,布局越紧凑 ## layoutCfg.onTick **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:每一次迭代的回调函数 ## layoutCfg.onLayoutEnd **类型**:Function
**默认值**:{}
**是否必须**:false
**说明**:布局完成后的回调函数 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ## layoutCfg.gpuEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 GPU 并行计算。若用户的机器或浏览器不支持 GPU 计算,将会自动降级为 CPU 计算。自 F6 4.0 起支持,性能提升概览: ================================================ FILE: packages/site/docs/api/graphLayout/grid.zh.md ================================================ --- title: 格子 Grid order: 10 --- Grid 布局是将所有节点通过某种指定属性排序后,整齐地放置在网格上。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'grid', begin: [ 0, 0 ], // 可选, preventOverlap: true, // 可选,必须配合 nodeSize preventOverlapPdding: 20, // 可选 nodeSize: 30, // 可选 condense: false, // 可选 rows: 5, // 可选 cols: 5, // 可选 sortBy: 'degree' // 可选 workerEnabled: true // 可选,开启 web-worker } }); ``` ## layoutCfg.begin **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:[ 0, 0 ]
**是否必须**:false
**说明**:网格开始位置(左上角) ## layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止重叠,必须配合下面属性 `nodeSize`,只有设置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ## layoutCfg.nodeSize **类型**: Number
**默认值**:30
**是否必须**:false
**说明**:节点大小(直径)。用于防止节点重叠时的碰撞检测 ## layoutCfg.preventOverlapPadding **类型**:Number
**默认值**:10
**是否必须**:false
**说明**:避免重叠时节点的间距 `padding`。`preventOverlap` 为 `true` 时生效 ## layoutCfg.condense **类型**: Boolean
**默认值**:false
**是否必须**:false
**说明**:为 `false` 时表示利用所有可用画布空间,为 `true` 时表示利用最小的画布空间 ## layoutCfg.rows **类型**: Number
**默认值**:undefined
**是否必须**:false
**说明**:网格的行数,为 undefined 时算法根据节点数量、布局空间、`cols`(若指定)自动计算 ## layoutCfg.cols **类型**: Number
**默认值**:undefined
**是否必须**:false
**说明**:网格的列数,为 undefined 时算法根据节点数量、布局空间、`rows`(若指定)自动计算 ## layoutCfg.sortBy **类型**: String
**默认值**:undefined
**是否必须**:false
**说明**:指定排序的依据(节点属性名),数值越高则该节点被放置得越中心。若为 undefined,则会计算节点的度数,度数越高,节点将被放置得越中心 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/guide.zh.md ================================================ --- title: 导览及使用 order: 0 --- ## 内置布局导览 F6 提供了以下内置布局算法。可以在[实例化图时配置](#实例化图时使用布局),或[独立使用](#单独使用布局)。当内置布局算法不满足需求时,还可以[自定义布局](/zh/docs/api/registerLayout)。 注意,Graph 布局与 TreeGaph 布局相互不通用。 - [Random Layout](./random):随机布局; - **[GForce Layout](./gforce):F6 支持的经典力导向布局,支持 GPU 并行计算:** > 力导向布局:一个布局网络中,粒子与粒子之间具有引力和斥力,从初始的随机无序的布局不断演变,逐渐趋于平衡稳定的布局方式称之为力导向布局。适用于描述事物间关系,比如人物关系、计算机网络关系等。 - [Force Layout](./force):引用 d3 的经典力导向布局; - [Force Atlas 2 Layout](./forceAtlas2):FA2 力导向布局,比 force 收敛地更好,更紧凑; - [Circular Layout](./circular):环形布局; - [Radial Layout](./radial):辐射状布局; - [MDS Layout](./mds):高维数据降维算法布局; - [Fruchterman Layout](./fruchterman):Fruchterman 布局,一种力导布局; - [Dagre Layout](./dagre):层次布局; - [Concentric Layout](./concentric):同心圆布局,将重要(默认以度数为度量)的节点放置在布局中心; - [Grid Layout](./grid):格子布局,将节点有序(默认是数据顺序)排列在格子上; - [Combo Force Layout](./combo-force):适用于带有 combo 图的力导向布局,推荐有 combo 的图使用该布局。 ## 实例化图时使用布局 在 F6 中使用布局,在实例化图时配置 `layout` 属性。例如: ```javascript const graph = new F6.Graph({ // ... // 其他配置项 layout: { // Object,可选,布局的方法及其配置项,默认为 random 布局。 type: 'force', preventOverlap: true, nodeSize: 30, // workerEnabled: true, // 是否启用 webworker // gpuEnabled: true // 是否使用 gpu 版本的布局算法,F6 4.0 支持,目前仅支持 gForce 及 fruchterman。若用户的机器或浏览器不支持 GPU 计算,将会自动降级为 CPU 计算 ... // 其他配置 } }); ``` 每种布局方法的配置项不尽相同,具体参见本目录下每种布局的 API。
当实例化图时没有配置 `layout` 时: - 若数据中节点有位置信息(`x` 和 `y`),则按照数据的位置信息进行绘制; - 若数据中节点没有位置信息,则默认使用 Random Layout 进行布局。 ## 单独使用布局 以下方法为通过 `const layout = new F6.Layout['layoutName']` 单独使用布局时,或自定义布局时可能需要复写的方法。如果上述两种情况,仅在实例化图时通过配置 `layout` 使用内置布局方法时,以下方法由 F6 控制并调用,用户不需要了解。 ### 初始化 #### init(data) 初始化布局。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ---------------- | | data | object | true | 布局中使用的数据 | #### getDefaultCfg() 返回布局的默认参数。 **返回值** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | -------------- | | cfg | object | true | 布局的默认参数 | ### 布局 #### execute() 执行布局算法。 #### layout(data) 根据传入的数据进行布局。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ---------------- | | data | object | true | 布局中使用的数据 | ### 更新 #### updateCfg(cfg) 更新布局参数。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------ | | cfg | object | true | 新的布局配置 | ### 销毁 #### destroy() 销毁布局。 ## AI 智能布局推荐 `markdown:docs/manual/middle/layout/ai-layout.zh.md` ================================================ FILE: packages/site/docs/api/graphLayout/mds.zh.md ================================================ --- title: 高维数据降维 MDS order: 9 --- MDS 布局是高维数据降维算法布局,该算法全称  Multidimensional Scaling 。
img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'mds', workerEnabled: true, // 可选,开启 web-worker }, }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.linkDistance **类型**: Number
**默认值**:50
**是否必须**:false
**说明**:边长度 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/radial.zh.md ================================================ --- title: 辐射形 Radial order: 5 --- Radial 布局是将图布局成辐射状的布局方法。以一个 focusNode 为中心,其余节点按照与 focusNode 的度数关系排列在不同距离的环上。距离 focusNode 一度的节点布局在与其最近的第一个环上,距离 focusNode 二度的节点布局在第二个环上,以此类推。算法原文链接: More Flexible Radial Layoutimg ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'radial', center: [ 200, 200 ], // 可选,默认为图的中心 linkDistance: 50, // 可选,边长 maxIteration: 1000, // 可选 focusNode: 'node11', // 可选 unitRadius: 100, // 可选 preventOverlap: true, // 可选,必须配合 nodeSize nodeSize: 30, // 可选 strictRadial: false // 可选 workerEnabled: true // 可选,开启 web-worker } }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.linkDistance **类型**: Number
**默认值**:50
**是否必须**:false
**说明**:边长度 ## layoutCfg.maxIteration **类型**: Number
**默认值**:1000
**是否必须**:false
**说明**:停止迭代到最大迭代数 ## layoutCfg.focusNode **类型**:String | Object
**默认值**:null
**是否必须**:false
**说明**:辐射的中心点,默认为数据中第一个节点。可以传入节点 id 或节点本身 ## layoutCfg.unitRadius **类型**:Number
**默认值**:100
**是否必须**:false
**说明**:每一圈距离上一圈的距离。默认填充整个画布,即根据图的大小决定 ## layoutCfg.preventOverlap **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否防止重叠,必须配合下面属性 `nodeSize`,只有设置了与当前图节点大小相同的 `nodeSize` 值,才能够进行节点重叠的碰撞检测 ## layoutCfg.nodeSize **类型**: Number
**默认值**:10
**是否必须**:false
**说明**:节点大小(直径)。用于防止节点重叠时的碰撞检测 ## layoutCfg.nodeSpacing **类型**: Number / Function
**默认值**: 0
**是否必须**: false
**示例**: Example 1: 10
Example 2: ```javascript (d) => { // d is a node if (d.id === "node1") { return 100; } return 10; }; ```
**描述**: `preventOverlap` 为 `true` 时生效, 防止重叠时节点边缘间距的最小值。可以是回调函数, 为不同节点设置不同的最小间距, 如示例 2 所示 ## layoutCfg.maxPreventOverlapIteration **类型**: Number
**默认值**:200
**是否必须**:false
**说明**:防止重叠步骤的最大迭代次数 ## layoutCfg.strictRadial **类型**: Boolean
**默认值**:true
**是否必须**:false
**说明**:是否必须是严格的 radial 布局,及每一层的节点严格布局在一个环上。`preventOverlap` 为 `true` 时生效。 - 当 `preventOverlap` 为 `true`,且 `strictRadial` 为 `false` 时,有重叠的节点严格沿着所在的环展开,但在一个环上若节点过多,可能无法完全避免节点重叠。 - 当 `preventOverlap` 为 `true`,且 `strictRadial` 为 `true`  时,允许同环上重叠的节点不严格沿着该环布局,可以在该环的前后偏移以避免重叠。 img img img > (左)preventOverlap = false。(中)preventOverlap = false,strictRadial = true。(右)preventOverlap = false,strictRadial = false。 ## layoutCfg.sortBy **类型**: String
**默认值**: undefined
**是否必须**: false
**说明**: 同层节点布局后相距远近的依据。默认 `undefined` ,表示根据数据的拓扑结构(节点间最短路径)排布,即关系越近/点对间最短路径越小的节点将会被尽可能排列在一起;`'data'` 表示按照节点在数据中的顺序排列,即在数据顺序上靠近的节点将会尽可能排列在一起;也可以指定为节点数据中的某个字段名,例如 `'cluster'`、`'name'` 等(必须在数据中存在) ## layoutCfg.sortStrength **类型**: Number
**默认值**: 10
**是否必须**: false
**说明**: 同层节点根据 `sortBy` 排列的强度,数值越大,`sortBy` 指定的方式计算出距离越小的越靠近。`sortBy` 不为 `undefined` 时生效 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/graphLayout/random.zh.md ================================================ --- title: Random 随机 order: 1 --- Random 布局是 F6 中的默认布局方法。当实例化图时没有指定布局方法,且数据中也不存在位置信息时,F6 将自动使用 Random 布局。 img ```javascript const graph = new F6.Graph({ ... width: 1000, height: 600, layout: { type: 'random', width: 300, height: 300, }, }); ``` ## layoutCfg.center **类型**: Array
**示例**:[ 0, 0 ]
**默认值**:图的中心
**是否必须**:false
**说明**:布局的中心 ## layoutCfg.width **类型**: Number
**默认值**:图的宽度
**是否必须**:false
**说明**:布局的宽度范围 ## layoutCfg.height **类型**: Number
**默认值**:图的高度
**是否必须**:false
**说明**:布局的高度范围 ## layoutCfg.workerEnabled **类型**: Boolean
**默认值**: false
**是否必须**: false
**说明**: 是否启用 web-worker 以防布局计算时间过长阻塞页面交互 ================================================ FILE: packages/site/docs/api/registerItem.zh.md ================================================ --- title: 自定义元素 F6.registerX order: 7 --- 本文介绍的相关方法是在自定义节点(registerNode)或自定义边(registerEdge)的过程中需要部分实现或复写的方法。 **友情提示:**以下属性和 API 方法,全部用于自定义节点和边时候使用,即作为 `F6.registerNode` / `F6.registerEdge` 的第二个参数中的方法。 本文介绍 F6 的自定义机制,包括自定义节点、自定义边、自定义 combo、自定义交互行为、自定义布局的相关方法。它们都被挂载在 F6 全局上,通过 `F6.registerXXX` 进行调用。 ## F6.registerNode(nodeName, options, extendedNodeName) 当内置节点不满足需求时,可以通过 `F6.registerNode(nodeName, options, extendedNodeName)` 方法自定义节点。 ### 参数 | 名称 | 类型 | 是否必选 | 描述 | | -------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | nodeName | String | true | 自定义节点名称,需保持唯一性。 | | options | Object | true | 自定义节点时的配置项,配置项中包括完整的生命周期方法,具体请参考:[Shape Doc](/zh/docs/manual/middle/elements/shape/shape-keyshape) 和 [自定义节点与边 API](/zh/docs/api/registerItem)。 | | extendNodeName | String | false | 自定义节点时可基于内置节点进行定义,该字段表示内置节点名称,所有内置节点请参考:[内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 教程。 | ### 用法 ```javascript F6.registerNode( "nodeName", { /** * 绘制节点,包含文本 * @param {Object} cfg 节点的配置项 * @param {G.Group} group 图形分组,节点中的图形对象的容器 * @return {G.Shape} 绘制的图形,通过 node.get('keyShape') 可以获取到 */ draw(cfg, group) {}, /** * 绘制后的附加操作,默认没有任何操作 * @param {Object} cfg 节点的配置项 * @param {G.Group} group 图形分组,节点中的图形对象的容器 */ afterDraw(cfg, group) {}, /** * 更新节点,包含文本 * @override * @param {Object} cfg 节点的配置项 * @param {Node} node 节点 */ update(cfg, node) {}, /** * 更新节点后的操作,一般同 afterDraw 配合使用 * @override * @param {Object} cfg 节点的配置项 * @param {Node} node 节点 */ afterUpdate(cfg, node) {}, /** * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现 * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法 * @param {String} name 状态名称 * @param {Object} value 状态值 * @param {Node} node 节点 */ setState(name, value, node) {}, /** * 获取锚点(相关边的连入点) * @param {Object} cfg 节点的配置项 * @return {Array|null} 锚点(相关边的连入点)的数组,如果为 null,则没有锚点 */ getAnchorPoints(cfg) {}, }, "extendedNodeName", ); ``` ## F6.registerEdge(edgeName, options, extendedEdgeName) 当内置的边不能满足需求时,可以通过 `registerEdge(edgeName, options, extendedEdgeName)` 方法注册自定义的边。 ### 参数 | 名称 | 类型 | 是否必选 | 描述 | | ---------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | edgeName | String | true | 自定义边的名称 | | options | Object | true | 自定义边时的配置项,配置项中包括完整的生命周期方法,具体请参考:[Shape Doc](/zh/docs/manual/middle/elements/shape/shape-keyshape) 和 [自定义节点与边 API](/zh/docs/api/registerItem)。 | | extendedEdgeName | String | false | 自定义边时可基于内置边进行定义,该字段表示内置边的名称,所有内置边请参考:[内置边](/zh/docs/manual/middle/elements/edges/defaultEdge) 教程。 | ### 用法 ```javascript F6.registerEdge( "edgeName", { /** * 绘制边,包含文本 * @param {Object} cfg 边的配置项 * @param {G.Group} group 图形分组,边中的图形对象的容器 * @return {G.Shape} 绘制的图形,通过 node.get('keyShape') 可以获取到 */ draw(cfg, group) {}, /** * 绘制后的附加操作,默认没有任何操作 * @param {Object} cfg 边的配置项 * @param {G.Group} group 图形分组,边中的图形对象的容器 */ afterDraw(cfg, group) {}, /** * 更新边,包含文本 * @override * @param {Object} cfg 边的配置项 * @param {Edge} edge 边 */ update(cfg, edge) {}, /** * 更新边后的操作,一般同 afterDraw 配合使用 * @override * @param {Object} cfg 边的配置项 * @param {Edge} edge 边 */ afterUpdate(cfg, edge) {}, /** * 设置边的状态,主要是交互状态,业务状态请在 draw 方法中实现 * 单图形的边仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法 * @param {String} name 状态名称 * @param {Object} value 状态值 * @param {Edge} edge 边 */ setState(name, value, edge) {}, }, "extendedEdgeName", ); ``` ## F6.registerCombo(comboName, options, extendedComboName) 当内置 Combo 不满足需求时,可以通过 `F6.registerCombo(comboName, options, extendedComboName)` 方法自定义 Combo。 ### 参数 | 名称 | 类型 | 是否必选 | 描述 | | ----------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | comboName | String | true | 自定义 combo 的名称,需保持唯一性。 | | options | Object | true | 自定义 combo 时的配置项,配置项中包括完整的生命周期方法,具体请参考:[Shape Doc](/zh/docs/manual/middle/elements/shape/shape-keyshape) 和 [自定义节点与边 API](/zh/docs/api/registerItem)。 | | extendedComboName | String | false | 自定义节点时可基于内置 combo 进行定义,该字段表示内置 combo 名称,所有内置 Combo 请参考:[内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo) 教程。 | ### 用法 ```javascript F6.registerCombo( "comboName", { /** * 绘制 combo,包含文本 * @param {Object} cfg combo 的配置项 * @param {G.Group} group 图形分组,combo 中的图形对象的容器 * @return {G.Shape} 绘制的图形,通过 combo.get('keyShape') 可以获取到 */ draw(cfg, group) {}, /** * 绘制后的附加操作,默认没有任何操作 * @param {Object} cfg combo 的配置项 * @param {G.Group} group 图形分组,combo 中的图形对象的容器 */ afterDraw(cfg, group) {}, /** * 更新 combo ,combo 文本 * @override * @param {Object} cfg combo 的配置项 * @param {Combo} combo combo item */ update(cfg, combo) {}, /** * 更新 combo 后的操作,一般同 afterDraw 配合使用 * @override * @param {Object} cfg combo 的配置项 * @param {Combo} combo combo item */ afterUpdate(cfg, combo) {}, /** * 设置 combo 的状态,主要是交互状态,业务状态请在 draw 方法中实现 * 单图形的 combo 仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法 * @param {String} name 状态名称 * @param {Object} value 状态值 * @param {Combo} combo combo item */ setState(name, value, combo) {}, /** * 获取锚点(相关边的连入点) * @param {Object} cfg combo 的配置项 * @return {Array|null} 锚点(相关边的连入点)的数组,如果为 null,则没有锚点 */ getAnchorPoints(cfg) {}, }, "extendedComboName", ); ``` ## 用法 下面以注册边为例: ```javascript import F6 from "@antv/f6"; F6.registerEdge( "edgeName", { labelPosition: "center", labelAutoRotate: true, draw(cfg, group) { // 定义的其他方法,都可以在draw里面调用, 如 drawShape、drawLabel 等。 this.drawShape(); const labelStyle = this.getLabelStyle(cfg); // ... }, drawShape(cfg, group) { // }, getLabelStyle(cfg) { // 根据业务返回 label 的样式 return {}; }, update(cfg, item) { // 更新绘制的元素 }, }, "line", ); ``` ## 属性 ### labelPosition 文本相对于图形的位置,默认值为 `'center'`。 - 当使用 `registerNode` 注册节点时,`labelPosition` 可选值包括:`'top'`、`'bottom'`、`'left'`、`'right'` 和 `'center'`; - 当使用 `registerEdge` 注册边时,`labelPosition` 可选值包括:`'start'`、`'end'` 和 `'center'`。 ### labelAutoRotate > 只有在 `registerEdge` 时生效。 文本是否跟着线自动旋转,默认值为 `false`。 **提示:edge 特有。** ## 绘制函数 绘制部分四个 API 的参数完全相同,参数说明部分参考 `draw()` 方法。 ### draw(cfg, group) 绘制节点和边,包括节点和边上的文本,返回图形的 `keyShape`。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------- | -------- | ---------------- | | cfg | Object | true | 节点或边的配置项 | | group | G.Group | true | 节点或边的容器 | ### afterDraw(cfg, group) 绘制完成以后的操作,用户可继承现有的节点或边,在 `afterDraw()` 方法中扩展图形或添加动画。可参考在 afterDraw 中添加动画的 [demo](/zh/docs/examples/scatter/edge)。图形动画 API 详见 F6 的渲染引擎 [G 的动画相关 API](https://g.antv.vision/zh/docs/api/general/element/#%E5%8A%A8%E7%94%BB%E6%96%B9%E6%B3%95)。 ## 更新函数 ### update(cfg, item) 更新节点或边,包括节点或边上的文本。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------- | -------- | ---------------- | | cfg | Object | true | 节点或边的配置项 | | item | F6.Item | true | 节点或边的实例 | ### afterUpdate(cfg, item) 更新完以后的操作,如扩展图形或添加动画。可参考添加动画的 [demo](/zh/docs/examples/scatter/edge)。图形动画 API 详见 F6 的渲染引擎 [G 的动画相关 API](https://g.antv.vision/zh/docs/api/general/element/#%E5%8A%A8%E7%94%BB%E6%96%B9%E6%B3%95)。 ### shouldUpdate(type) 是否允许更新。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------------------------ | | type | String | true | 元素类型,`'node'` 或 `'edge'` | **返回值** - 返回值类型:Boolean; - 返回 `true`,则允许更新,否则不允许更新。 ### setState(name, value, item) 用于响应外部对元素状态的改变。当外部调用 [`graph.setItemState(item, state, value)`](/zh/docs/api/graphFunc/state#graphsetitemstateitem-state-value) 时,该函数作出相关响应。主要是交互状态,业务状态请在 `draw()` 方法中实现。单图形的节点仅考虑 `'selected'` 、`'active'` 状态,有其他状态需求的用户可以复写该方法。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ----- | ------- | -------- | ------------------------------------------ | | name | String | true | 状态名称 | | value | Boolean | true | 状态是否可用,为 `true` 时可用,否则不可用 | | item | F6.Item | true | 节点或边的实例 | ================================================ FILE: packages/site/docs/api/registerLayout.zh.md ================================================ --- title: 自定义布局 F6.registerLayout order: 11 --- ## F6.registerLayout(layoutName, layout) 当内置布局不满足需求时,可以通过 `F6.registerLayout(layoutName, layout)` 方法自定义布局。 ### 参数 | 名称 | 类型 | 是否必选 | 描述 | | ---------- | ------ | -------- | ----------------------------------------------------------------------------------------------------- | | layoutName | String | true | 自定义布局名称。 | | layout | Object | true | 自定义布局的配置项,配置项中包括的方法及作用具体请参考:[Layout API](/zh/docs/manual/middle/layout)。 | ### 用法 ```javascript F6.registerLayout("layoutName", { /** * 定义自定义行为的默认参数,会与用户传入的参数进行合并 */ getDefaultCfg() { return {}; }, /** * 初始化 * @param {Object} data 数据 */ init(data) { const self = this; self.nodes = data.nodes; self.edges = data.edges; }, /** * 执行布局 */ execute() { // TODO }, /** * 根据传入的数据进行布局 * @param {Object} data 数据 */ layout(data) { const self = this; self.init(data); self.execute(); }, /** * 更新布局配置,但不执行布局 * @param {Object} cfg 需要更新的配置项 */ updateCfg(cfg) { const self = this; Util.mix(self, cfg); }, /** * 销毁 */ destroy() { const self = this; self.positions = null; self.nodes = null; self.edges = null; self.destroyed = true; }, }); ``` 以下方法为自定义布局时可能需要复写的方法。如果非自定义,使用内置布局方法时,以下方法由 F6 控制并调用,用户不需要了解。 ## 初始化 ### init(data) 初始化布局。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ---------------- | | data | object | true | 布局中使用的数据 | ### getDefaultCfg() 返回布局的默认参数。 **返回值** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | -------------- | | cfg | object | true | 布局的默认参数 | ## 布局 ### execute() 执行布局算法。 ### layout(data) 根据传入的数据进行布局。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ---------------- | | data | object | true | 布局中使用的数据 | ## 更新 ### updateCfg(cfg) 更新布局参数。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ------------ | | cfg | object | true | 新的布局配置 | ## 销毁 ### destroy() 销毁布局。 ================================================ FILE: packages/site/docs/api/shapeMethods.zh.md ================================================ --- title: 各图形的通用方法 Shape Func order: 9 --- ### attr() 设置或获取实例的绘图属性。 ### attr(name) 获取实例的属性值。 ``` const width = shape.attr('width'); ``` ### attr(name, value) 更新实例的单个绘图属性。 ### attr({...}) 批量更新实例绘图属性。 ``` rect.attr({ fill: '#999', stroke: '#666' }); ``` ### setClip(clipCfg) 设置并返回裁剪对象。 `clipCfg` 配置项 | 名称 | 含义 | 类型 | 备注 | | ------ | ------------------ | ------- | --------------------------------------------------------- | | type | 裁剪的图片形状 | String | 支持 `'circle'`、`'rect'`、`'ellipse'` | | x | 裁剪图形的 x 坐标 | Number | 默认为 0,类型为 `'circle'`、`'rect'`、`'ellipse'` 时生效 | | y | 裁剪图形的 y 坐标 | Number | 默认为 0,类型为 `'circle'`、`'rect'`、`'ellipse'` 时生效 | | show | 是否启用裁剪功能 | Boolean | 默认不裁剪,值为 `false` | | r | 剪裁圆形的半径 | Number | 剪裁 type 为  `'circle'` 时生效 | | width | 剪裁矩形的宽度 | Number | 剪裁 type 为 `'rect'` 时生效 | | height | 剪裁矩形的长度 | Number | 剪裁 type 为 `'rect'` 时生效 | | rx | 剪裁椭圆的长轴半径 | Number | 剪裁 type 为 `'ellipse'` 时生效 | | ry | 剪裁椭圆的短轴半径 | Number | 剪裁 type 为 `'ellipse'` 时生效 | 用法 ```javascript shape.setClip({ type: 'circle', // 支持 circle、rect、ellipse、Polygon 及自定义 path clip attrs: { r: 10, x: 0, y: 0, }, ``` ### getClip() 获取裁剪对象。 ================================================ FILE: packages/site/docs/api/shapeProperties.zh.md ================================================ --- title: 图形样式属性 Shape Attr order: 8 --- 图形是组成图上一个元素(节点/边)的基本单位。节点/边的 `style` 属性即对应了各自 keyShape(关键图形)的图形属性。节点或边上标签 `labelCfg` 中的 `style` 属性对应了 text 图形的图形属性。除一些[通用属性](#通用属性)外,不同图形有各自的特殊属性。 ```javascript group.addShape("rect", { attrs: { fill: "red", shadowOffsetX: 10, shadowOffsetY: 10, shadowColor: "blue", shadowBlur: 10, opacity: 0.8, }, // must be assigned in F6. it can be any value you want name: "rect-shape", }); ``` F6 支持以下图形: - [circle](#圆图形-circle):圆; - [rect](#矩形图形-rect):矩形; - [ellipse](#椭圆图形-ellipse):椭圆; - [polygon](#多边形图形-polygon):多边形; - [image](#图片图形-image):图片; - [marker](#标记图形-marker):标记; - [path](#路径-path):路径; - [text](#文本-text):文本; - [dom(svg)](#dom-svg):DOM(图渲染方式 `renderer` 为 `'svg'` 时可用)。 ## 通用属性 ### name _String_ **required** 图形名称标识,必须配置。 ### fill _String_ **optional** 设置用于填充绘画的颜色(RGB 或 16 进制)、[渐变](/zh/docs/manual/middle/elements/advanced-style/gradient)或模式,对应 Canvas 属性 `fillStyle` 。取值示例:`rgb(18, 150, 231)`,`#c193af`,`l(0) 0:#ffffff 0.5:#7ec2f3 1:#1890ff`, `r(0.5, 0.5, 0.1) 0:#ffffff 1:#1890ff`。 ### stroke _String_ **optional** 设置用于笔触的颜色(RGB 或 16 进制)、[渐变](/zh/docs/manual/middle/elements/advanced-style/gradient)或模式,对应 Canvas 属性 `strokeStyle`。取值示例:`rgb(18, 150, 231)`,`#c193af`,`l(0) 0:#ffffff 0.5:#7ec2f3 1:#1890ff`, `r(0.5, 0.5, 0.1) 0:#ffffff 1:#1890ff`。 ### lineWidth _Number_ **optional** 描边宽度。 ### lineDash _Number | Number[]_ **optional** 描边虚线,Number[] 类型中数组元素分别代表实、虚长度。 ### shadowColor _String_ **optional** 设置用于阴影的颜色。 ### shadowBlur _Number_ **optional** 设置用于阴影的模糊级别,数值越大,越模糊。 ### shadowOffsetX _Number_ **optional** 设置阴影距形状的水平距离。 ### shadowOffsetY _Number_ **optional** 设置阴影距形状的垂直距离。 ### opacity _Number_ **optional** 设置绘图的当前 alpha 或透明值,范围 [0, 1],对应 Canvas 属性 `globalAlpha`。 ### fillOpacity _Number_ **optional** 设置填充的 alpha 或透明值,优先级高于 opacity,范围 [0, 1]。 ### strokeOpacity _Number_ **optional** 设置描边的 alpha 或透明值,优先级高于 opacity,范围 [0, 1]。 ### cursor _String_ **optional** 鼠标在该节点上时的鼠标样式,[CSS 的 cursor](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor) 选项都支持。 ## 圆图形 Circle ```javascript group.addShape("circle", { attrs: { x: 100, y: 100, r: 50, fill: "blue", }, // must be assigned in F6. it can be any value you want name: "circle-shape", }); ``` ### x _Number_ **optional** 圆心的 x 坐标。 ### y _Number_ **optional** 圆心的 y 坐标。 ### r _Number_ **optional** 圆的半径。 ## 椭圆图形 Ellipse ```javascript group.addShape("ellipse", { attrs: { x: 100, y: 100, rx: 50, ry: 50, fill: "blue", }, // must be assigned in F6. it can be any value you want name: "ellipse-shape", }); ``` ### x _Number_ **optional** 圆心的 x 坐标。 ### y _Number_ **optional** 圆心的 y 坐标。 ### rx _Number_ **optional** 水平半径。 ### ry _Number_ **optional** 垂直半径。 ## 图片图形 Image ```javascript group.addShape("image", { attrs: { x: 0, y: 0, img: "https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png", }, // must be assigned in F6. it can be any value you want name: "image-shape", }); ``` ### x _Number_ **optional** 图片左上角的 x 坐标。 ### y _Number_ **optional** 图片左上角的 y 坐标。 ### width _Number_ **optional** 图片宽度。 ### height _Number_ **optional** 图片高度。 ### img _String_ **optional** 图片源,F6 支持多种格式的图片:url,ImageData,Image,canvas。 ## 标记图形 Marker ```javascript // 使用内置 symbol group.addShape("marker", { attrs: { x: 10, y: 10, r: 10, symbol: "triangle-down", }, // must be assigned in F6. it can be any value you want name: "marker-shape", }); // 使用路径自定义 symbol group.addShape("marker", { attrs: { x: 10, y: 10, r: 10, symbol: function (x, y, r) { return [["M", x, y], ["L", x + r, y + r], ["L", x + r * 2, y], ["Z"]]; }, }, // must be assigned in F6. it can be any value you want name: "marker-shape", }); ``` ### x _Number_ **optional** 标记图形左上角的 x 坐标。 ### y _Number_ **optional** 标记图形左上角的 y 坐标。 ### r _Number_ **optional** 形状半径。 ### symbol _String | Function_ **optional** 指定形状。我们已经内置了一些常用形状,如圆形 `'circle'`,矩形  `'square'`,菱形  `'diamond'`,三角形  `'triangle'`,倒三角形 `'triangle-down'`,这些内置形状只需要直接将响应 String 赋值给 symbol。也可以是自定义的 path 路径的函数。 ## 多边形图形 Polygon ### points ```javascript group.addShape("polygon", { attrs: { points: [ [30, 30], [40, 20], [30, 50], [60, 100], ], fill: "red", }, // must be assigned in F6. it can be any value you want name: "polygon-shape", }); ``` ### points _Array_ **optional** 多边形的所有端点坐标。 ## 矩形图形 Rect ```javascript group.addShape("rect", { attrs: { x: 150, y: 150, width: 150, height: 150, stroke: "black", radius: [2, 4], }, // must be assigned in F6. it can be any value you want name: "rect-shape", }); ``` ### x _Number_ **optional** 矩形左上角的 x 坐标。 ### y _Number_ **optional** 矩形左上角的 y 坐标。 ### width _Number_ **optional** 矩形的宽度。 ### height _Number_ **optional** 矩形的高度。 ### radius _Number | Number[]_ **optional** 定义圆角。支持整数或数组形式,分别对应左上、右上、右下、左下角的半径:
- radius 缩写为 1 或 [ 1 ] 相当于 [ 1, 1, 1, 1 ]
- radius 缩写为 [ 1, 2 ] 相当于 [ 1, 2, 1, 2 ]
- radius 缩写为 [ 1, 2, 3 ] 相当于 [ 1, 2, 3, 2 ]
。 ## 线条 Path ⚠️ 注意: 当边太细交互不易命中时,请设置 **lineAppendWidth** 属性值。 ```javascript group.addShape("path", { attrs: { startArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, }, endArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, }, path: [ ["M", 100, 100], ["L", 200, 200], ], stroke: "#000", lineWidth: 8, lineAppendWidth: 5, }, // must be assigned in F6. it can be any value you want name: "path-shape", }); ``` ### path _String | Array_ **optional** 线条路径,可以是 String 形式,也可以是线段的数组。格式参考:[SVG path](https://developer.mozilla.org/zh-CN/docs/Web/SVG/Tutorial/Paths)。 ### startArrow _Boolean | Object_ **optional** 起始端的箭头,为 `true` 时为默认的箭头效果,也可以是一个自定义箭头。 ### endArrow _Boolean | Object_ **optional** 末尾端的箭头,为 `true` 时为默认的箭头效果,也可以是一个自定义箭头。 ### lineAppendWidth _Number_ **optional** 边的击中范围。提升边的击中范围,扩展响应范围,数值越大,响应范围越广。 ### lineCap _String_ **optional** 设置线条的结束端点样式。可选:
- `'bevel'`: 斜角
- `'round'`: 圆角
- `'miter'`: 尖角 (默认)。 ### lineJoin _String_ **optional** 设置两条线相交时,所创建的拐角形状。可选:
- `'bevel'`: 斜角
- `'round'`: 圆角
- `'miter'`: 尖角 (默认)。 ### lineWidth _Number_ **optional** 设置当前的线条宽度。 ### miterLimit _Number_ **optional** 设置最大斜接长度。 ### lineDash _Number | Number[]_ **optional** 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。可参考[setLineDash](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash)。 ## 文本 Text ```javascript group.addShape("text", { attrs: { text: "test text", fill: "red", fontWeight: 400, shadowOffsetX: 10, shadowOffsetY: 10, shadowColor: "blue", shadowBlur: 10, }, // must be assigned in F6. it can be any value you wantPath name: "text-shape", }); ``` ### text _String_ **optional** 文本文字内容。 ### textAlign _String_ **optional** 设置文本内容的当前对齐方式。支持的属性:`center` / `end` / `left` / `right` / `start`,默认值为 `start`。 ### textBaseline _String_ **optional** 设置在绘制文本时使用的当前文本基线。支持的属性:
`top` / `middle` / `bottom` / `alphabetic` / `hanging`。默认值为 `bottom`。 ### fontStyle _String_ **optional** 字体样式。对应 `font-style`。 ### fontVariant _String_ **optional** 设置为小型大写字母字体。对应 `font-variant`。 ### fontWeight _Number_ **optional** 字体粗细。对应 `font-weight`。 ### fontSize _Number_ **optional** 字体大小。对应 `font-size`。 ### fontFamily _String_ **optional** 字体系列。对应 `font-family`。 ### lineHeight _Number_ **optional** 行高。对应 `line-height`。 ## DOM (svg) > 仅在 Graph 的 `renderer` 为 `'svg'` 时可以使用。 ⚠️ 注意: - 只支持原生 HTML DOM,不支持各类 react、vue 组件; - 使用 `'dom'` 进行自定义的节点或边,不支持 F6 的交互事件,请使用原生 DOM 的交互事件。 ```javascript group.addShape("dom", { attrs: { width: cfg.size[0], height: cfg.size[1], // DOM's html html: `
img
${ cfg.label }
`, }, // must be assigned in F6. it can be any value you want name: "dom-shape", draggable: true, }); ``` ### html _String_ **optional** DOM 的 HTML 值。 ================================================ FILE: packages/site/docs/api/treeGraphLayout/compactBox.zh.md ================================================ --- title: CompactBox 紧凑树 order: 1 --- 紧凑盒树布局。这是树图的默认布局,其特点是布局时统合考虑每个树节点的包围盒,由经典的 Reingold–Tilford tidy 布局算法演进而来,适合于脑图等应用场景。 img ### layoutCfg.direction **类型**:String
**可选值**:'LR' | 'RL' | 'TB' | 'BT' | 'H' | 'V'
**默认值**:'LR'
**是否必须**:false
**说明**:树布局的方向,其他选项说明 - TB —— 根节点在上,往下布局 img - BT —— 根节点在下,往上布局 img - LR —— 根节点在左,往右布局 img - RL —— 根节点在右,往左布局 img - H —— 根节点在中间,水平对称布局 img - V —— 根节点在中间,垂直对称布局 img ### layoutCfg.getSide **类型**: Function
**类型**: ```javascript (d) => { // d 是一个节点 if (d.id === "test-child-id") return "right"; return "left"; }; ``` **默认值**: 'right'
**是否必须**: false
**说明**: 节点排布在根节点的左侧/右侧。若设置了该值,则所有节点会在根节点同一侧,即 direction = 'H' 不再起效。若该参数为回调函数,则可以指定每一个节点在根节点的左/右侧。 ### layoutCfg.getId **类型**: Function
**示例**: ```javascript (d) => { // d is a node return d.id + "_node"; }; ``` **是否必须**: false
**说明**: 节点 id 的回调函数 ### layoutCfg.getWidth **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的宽度 ### layoutCfg.getHeight **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的高度 ### layoutCfg.getHGap **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **默认值**:18
**是否必须**:false
**说明**:每个节点的水平间隙 ### layoutCfg.getVGap **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **默认值**:18
**是否必须**:false
**说明**:每个节点的垂直间隙 ### layoutCfg.radial **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否按照辐射状布局。若 `radial` 为 `true`,建议 `direction` 设置为 `'LR'` 或 `'RL'`: img ================================================ FILE: packages/site/docs/api/treeGraphLayout/dendrogram.zh.md ================================================ --- title: Dendrogram 生态树 order: 2 --- 生态树布局的特点是所有子节点布局在同一层级,不考虑节点大小,每个节点被当成 1px 处理。适用于表示层次聚类。 img ### layoutCfg.direction **类型**:String
**可选值**:'LR' | 'RL' | 'TB' | 'BT' | 'H' | 'V'
**默认值**:'LR'
**是否必须**:false
**说明**:树布局的方向,默认为 `'LR'`,其他选项说明 - TB —— 根节点在上,往下布局 img - BT —— 根节点在下,往上布局 img - LR —— 根节点在左,往右布局 img - RL —— 根节点在右,往左布局 img - H —— 根节点在中间,水平对称布局 img - V —— 根节点在中间,垂直对称布局 img ### layoutCfg.nodeSep **类型**:Number
**默认值**:0
**是否必须**:false
**说明**:节点间距 ### layoutCfg.rankSep **类型**:Number
**默认值**:0
**是否必须**:false
**说明**:层与层之间的间距 ### layoutCfg.radial **类型**:Boolean
**默认值**:false
**是否必须**:false
**说明**:是否按照辐射状布局。若 `radial` 为 `true`,建议 `direction` 设置为 `'LR'` 或 `'RL'`: img ================================================ FILE: packages/site/docs/api/treeGraphLayout/guide.zh.md ================================================ --- title: 导览及使用 order: 0 --- ## 树图布局总览 与 [Graph 的布局](/zh/docs/api/graphLayout/guide) 类似,F6 为树图 TreeGraph 提供了一些内置布局算法。可以在[实例化图时配置](#使用方法)。与 [Graph 的布局](/zh/docs/api/graphLayout/guide) 不同的是: - 实例化树图时必须通过配置 `layout` 配置布局,而 Graph 不配置 `layout` 时将会使用数据中的位置信息或随机布局; - 树图布局不支持独立使用; - 树图布局不支持自定义。 注意,Graph 布局与 TreeGaph 布局相互不通用。 F6 的内置树图布局有: - [CompactBox 紧凑树布局](./compactBox) - [Dendrogram 生态树布局](./dendrogram) - [Indented 缩进树布局](./indented) - [Mindmap 脑图树布局](./mindmap) ## 使用方法 ```javascript const graph = new F6.TreeGraph({ // ... // 其他配置项 layout: { // Object,对于 TreeGraph 为必须字段 type: 'dendrogram', ... // 布局的其他配置 } }); ``` 每种布局方法的配置项不尽相同,具体参见本目录下每种布局的 API。 ## 通用配置项 | 名称 | 类型 | 默认值 | 描述 | | ----------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------- | | type | String | dendrogram | 布局类型,支持 dendrogram、compactBox、mindmap 和 indeted。 | | direction | String | LR | 布局方向,有  `LR` , `RL` , `TB` , `BT` , `H` , `V`  可选。
L:左;R:右;T:上;B:下;H:垂直;V:水平。 | | getChildren | Function | | 返回当前节点的所有子节点 | ⚠️ 注意: 当 `type='indeted'` 时,`direction` 只能取 `'LR'`、`'RL'` 和 `'H'` 这三个值。 ================================================ FILE: packages/site/docs/api/treeGraphLayout/indented.zh.md ================================================ --- title: Indented 缩进树 order: 3 --- 缩进树布局。树节点的层级通过水平方向的缩进量来表示。每个元素会占一行/一列。常用场景是文件目录结构。 img ### layoutCfg.direction **类型**:String
**可选值**:'LR' | 'RL' | 'H'
**默认值**:'LR'
**是否必须**:false
**说明**:树布局的方向,默认为 `'LR'`,其他选项说明: - LR —— 根节点在左,往右布局(下图左)
- RL —— 根节点在右,往左布局(下图中)
- H —— 根节点在中间,水平对称布局(下图右) img img img > (左)LR。(中)RL。(右)H。 ### layoutCfg.indent **类型**:Number
**默认值**:20
**是否必须**:false
**说明**:列间间距 ### layoutCfg.getWidth **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的宽度,`direction` 为 `'H'` 时有效 ### layoutCfg.getHeight **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的高度 ### layoutCfg.getSide **类型**:Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return "left"; return "right"; }; ``` ### layoutCfg.dropCap **类型**:Boolean
**是否必须**:false
**说明**:每个节点的第一个自节点是否位于下一行。默认为 `true` **是否必须**:false
**说明**:节点放置在根节点左侧或右侧的回调函数,仅对与根节点直接相连的节点有效,设置后将会影响被设置节点的所有子孙节点。 ================================================ FILE: packages/site/docs/api/treeGraphLayout/mindmap.zh.md ================================================ --- title: Mindmap 脑图树 order: 4 --- 深度相同的节点将会被放置在同一层,与 compactBox 不同的是,布局不会考虑节点的大小。 img ### layoutCfg.direction **类型**:String
**可选值**:'H' | 'V'
**默认值**:'H'
**是否必须**:false
**说明**:树布局的方向,默认为 `'H'`,其他选项说明 - H:horizontal(水平)—— 根节点的子节点分成两部分横向放置在根节点左右两侧 img - V:vertical (竖直)—— 将根节点的所有孩子纵向排列 img ### layoutCfg.getWidth **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的宽度 ### layoutCfg.getHeight **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **是否必须**:false
**说明**:每个节点的高度 ### layoutCfg.getHGap **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **默认值**:18
**是否必须**:false
**说明**:每个节点的水平间隙 ### layoutCfg.getVGap **类型**:Number | Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "testId") return 50; return 100; }; ``` **默认值**:18
**是否必须**:false
**说明**:每个节点的垂直间隙 ### layoutCfg.getSide **类型**:Function
**示例**: ```javascript (d) => { // d 是一个节点 if (d.id === "test-child-id") return "right"; return "left"; }; ``` **默认值**:'right'
**是否必须**:false
**说明**:节点排布在根节点的左侧/右侧。若设置了该值,则所有节点会在根节点同一侧,即 direction = 'H' 不再起效。若该参数为回调函数,则可以指定每一个节点在根节点的左/右侧。 ================================================ FILE: packages/site/docs/api/treeMethods.zh.md ================================================ --- title: TreeGraph 实例方法 order: 4 --- ### data() ### addChild(data, parent) 在指定的父节点下添加子树。 ⚠️ 注意: 将会直接使用 `data` 对象作为新增节点/边的数据模型,F6 内部可能会对其增加或修改一些必要的字段。若不希望原始参数被修改,建议在使用深拷贝后的 `data`。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------ | -------- | ---------- | ----------------- | | data | Object | true | 子树的数据 | | parent | Node | String | true | 父节点或父节点 ID | **用法** ```javascript const data = { id: 'sub1', children: [ { id: 'subTree1', children: [...] }, { id: 'subTree2', children: [...] } ] }; treeGraph.addChild(data, 'root') ``` ### updateChild(data, parentId) 更新数据,差量更新子树。data 是一个子树数据。若该子树的根节点不存在与当前树数据中,将该子树添加到 parentId 节点的子节点中。若该子树的根节点已经存在,则更新该子树数据。若希望更新或增加 parentId 节点下所有子节点,请使用 [updateChildren]()。二者区别图示如下: img img **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | -------- | -------- | ---------- | | data | TreeData | true | 子树的数据 | | parentId | String | false | 父节点 ID | ⚠️ 注意: 当 `parentId` 参数为空时,则全量更新。 **用法** ```javascript const data = { id: 'sub1', children: [ { id: 'subTree1', children: [...] }, { id: 'subTree2', children: [...] } ] }; treeGraph.updateChild(data, 'root') ``` ### updateChildren(data, parentId) 更新数据,差量更新子树中的所有子节点。data 是一个子树数据数组。若希望更新或增加一个 parentId 节点的子节点,请使用 [updateChild]()。二者区别图示如下:
img img **参数** | 名称 | 类型 | 是否必选 | 描述 | | -------- | ---------- | -------- | -------------- | | data | TreeData[] | true | 子树的数据数组 | | parentId | String | true | 父节点 ID | **用法** ```javascript const data = [ { id: 'subTree1', children: [...] }, { id: 'subTree2', children: [...] } ]; treeGraph.updateChildren(data, 'root') ``` ### removeChild(id) 删除指定的子树。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ---- | ------ | -------- | ----------------- | | id | String | true | 要删除的子树的 ID | **用法** ```javascript treeGraph.removeChild("sub"); ``` ## 布局 ### changeLayout(layout) 更改并应用指定的布局。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------ | -------- | ---------------------------------- | | layout | Object | false | 指定的布局配置,如不传,则不做变更 | **用法** ```javascript const layout = { type: "mindmap", dirction: "H", getSubTreeSep: () => 20, getVGap: () => 25, getHeight: () => 30, getWidth: () => 30, }; treeGraph.changeLayout(layout); ``` ### layout(fitView) 数据变更后,重新布局,刷新视图,并更新到画布。v4.x 废弃了 `refreshLayout`,请使用 `layout` 替代。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------- | ------- | -------- | ------------------------------ | | fitView | Boolean | false | 更新布局后,是否需要自适应窗口 | **用法** ```javascript treeGraph.layout(true); ``` ## 查找 ### findDataById(id, target) 根据指定的 ID 获取对应的源数据。 **参数** | 名称 | 类型 | 是否必选 | 描述 | | ------ | ------ | -------- | -------------------------------------------- | | id | String | true | 指定的元素 ID | | target | Object | false | 从指定的节点开始查找,为空时从根节点开始查找 | **返回值** - 返回值类型:Object; - 返回值为查找到的节点的源数据。 **用法** ```javascript const target = { id: 'sub1', children: [...] } // 从 target 节点开始查找 sub1.1 节点 const subData = treeGraph.findDataById('sub1.1', target) // 从根节点开始查找 sub1.1 节点 const subData = treeGraph.findDataById('sub1.1') ``` ================================================ FILE: packages/site/docs/examples/algorithm/algoDemos/index.zh.md ================================================ --- title: 算法示例 order: 1 --- F6 提供了一系列图算法,为分析复杂数据提供强有力辅助。 ## 使用指南 更多信息请参见 API 文档 [算法](/zh/docs/api/Algorithm)。 ================================================ FILE: packages/site/docs/examples/case/customTree/decisiontree.zh.md ================================================ --- title: 决策树 order: 0 --- ### 定义 决策树是在已知各种情况的基础上,通过事项构建树状图,根据自己的上下级进行关联,挂接到对应的分支,常用于项目风险评估,可行性的决策分析等场景,是直观运用概率分析的一种图解法。支持展开、收起、悬停、点击等交互。 ### 何时使用 一般用于决策分析场景,在金融领域,用于展示资金流向、月环比、同比等,助力高管进行决策,挖掘机会,各个分支通过不同形态展示当前节点的状态,可对关键指标进行预警、监控等操作。也常用于降本增收场景,指标展示各类降本渠道、以及运营渠道,通过分析各渠道之间的关系以及实际降本额进行渠道决策。 更详细的内容请参考 [快速上手](/zh/docs/manual/getting-started) 文档。 ## F6 图可视化交流群 欢迎各界 F6 使用者、图可视化爱好者加入 **F6 超级服务群**(钉钉群,使用钉钉扫一扫加入)讨论与交流。

## 如何贡献 请让我们知道您要解决或贡献什么,所以在贡献之前请先提交 issues 描述 bug 或建议。 成为一个贡献者前请阅读 代码贡献规范。 ## License MIT license。 ================================================ FILE: packages/site/docs/manual/middle/animation.zh.md ================================================ --- title: 基础动画 order: 5 --- F6 中的动画分为两个层次: - 全局动画:全局性的动画,图整体变化时的动画过渡; - 元素(边和节点)动画:节点或边上的独立动画。
## 全局动画 F6 的全局动画指通过图实例进行某些全局操作时,产生的动画效果。例如: - `graph.updateLayout(cfg)` 布局的变化 - `graph.changeData()` 数据的变化 通过实例化图时配置 `animate: true`,可以达到每次进行上述操作时,动画效果变化的目的。配合 `animateCfg` 配置动画参数,`animateCfg` 具体配置参见 [animateCfg](#animateCfg)
```javascript const graph = new F6.Graph({ // ... // 图的其他配置项 animate: true, // Boolean,切换布局时是否使用动画过度,默认为 false animateCfg: { duration: 500, // Number,一次动画的时长 easing: "linearEasing", // String,动画函数 }, }); ``` ## 元素动画 由于 F6 的内置节点和边是没有动画的,需要实现节点和边上的动画需要通过[自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node)、[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge)时复写  `afterDraw`  实现。 ### 节点动画 节点上的动画,即每一帧发生变化的是节点上的某一个图形。关于节点动画,以下面三个动画示例进行讲解: - 节点上图形的动画(如下图左); - 增加带有动画的背景图形(如下图中); - 节点上部分图形的旋转动画(如下图右)。 download download download
以上三个动画节点的 demo 代码见: 节点动画。 #### 节点上图形的动画
download 本例实现节点放大缩小,通过  `group.get('children')[0]` 找到需要更新的图形(这里找到该节点上第 0 个图形),然后调用该图形的 `animate` 方法指定动画的参数及每一帧的变化(  第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg))。 ```javascript // 放大、变小动画 F6.registerNode( "circle-animate", { afterDraw(cfg, group) { // 获取该节点上的第一个图形 const shape = group.get("children")[0]; // 该图形的动画 shape.animate( (ratio) => { // 每一帧的操作,入参 ratio:这一帧的比例值(Number)。返回值:这一帧需要变化的参数集(Object)。 // 先变大、再变小 const diff = ratio <= 0.5 ? ratio * 10 : (1 - ratio) * 10; let radius = cfg.size; if (isNaN(radius)) radius = radius[0]; // 返回这一帧需要变化的参数集,这里只包含了半径 return { r: radius / 2 + diff, }; }, { // 动画重复 repeat: true, duration: 3000, easing: "easeCubic", }, ); // 一次动画持续的时长为 3000,动画效果为 'easeCubic' }, }, "circle", ); // 该自定义节点继承了内置节点 'circle',除了被复写的 afterDraw 方法外,其他按照 'circle' 里的函数执行。 ``` #### 增加带有动画的背景图形 在 `afterDraw` 方法中为已有节点添加额外的 shape ,并为这些新增的图形设置动画。
本例在 `afterDraw` 方法中,绘制了三个背景 circle ,分别使用不同的颜色填充,再调用 `animate` 方法实现这三个 circle 逐渐变大、变淡的动画。本例中没有使用函数参数的形式,直接在 `animate` 函数的第一个参数中设置每次动画结束时的最终目标样式,即半径增大 10,透明度降为 0.1。第二个参数设置动画的配置,动画参数的具体配置参见 [animateCfg](#animateCfg)。
download ```javascript F6.registerNode( "background-animate", { afterDraw(cfg, group) { let r = cfg.size / 2; if (isNaN(r)) { r = cfg.size[0] / 2; } // 第一个背景圆 const back1 = group.addShape("circle", { zIndex: -3, attrs: { x: 0, y: 0, r, fill: cfg.color, opacity: 0.6, }, // must be assigned in F6. it can be any value you want name: "circle-shape1", }); // 第二个背景圆 const back2 = group.addShape("circle", { zIndex: -2, attrs: { x: 0, y: 0, r, fill: "blue", // 为了显示清晰,随意设置了颜色 opacity: 0.6, }, // must be assigned in F6. it can be any value you want name: "circle-shape2", }); // 第三个背景圆 const back3 = group.addShape("circle", { zIndex: -1, attrs: { x: 0, y: 0, r, fill: "green", opacity: 0.6, }, // must be assigned in F6. it can be any value you want name: "circle-shape3", }); group.sort(); // 排序,根据 zIndex 排序 // 第一个背景圆逐渐放大,并消失 back1.animate( { r: r + 10, opacity: 0.1, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: 0, // 无延迟 }, ); // 第二个背景圆逐渐放大,并消失 back2.animate( { r: r + 10, opacity: 0.1, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: 1000, // 1 秒延迟 }, ); // 1 秒延迟 // 第三个背景圆逐渐放大,并消失 back3.animate( { r: r + 10, opacity: 0.1, }, { repeat: true, // 循环 duration: 3000, easing: "easeCubic", delay: 2000, // 2 秒延迟 }, ); }, }, "circle", ); ``` #### 部分图形旋转动画 这一例也是在 `afterDraw` 方法中为已有节点添加额外的 shape (本例中为 image),并为这些新增的图形设置旋转动画。旋转动画较为复杂,需要通过矩阵的操作实现。`animate` 函数的第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg)。
download ```javascript F6.registerNode( "inner-animate", { afterDraw(cfg, group) { const size = cfg.size; const width = size[0] - 12; const height = size[1] - 12; // 添加图片 shape const image = group.addShape("image", { attrs: { x: -width / 2, y: -height / 2, width: width, height: height, img: cfg.img, }, // must be assigned in F6. it can be any value you want name: "image-shape", }); // 该图片 shape 的动画 image.animate( (ratio) => { // 每一帧的操作,入参 ratio:这一帧的比例值(Number)。返回值:这一帧需要变化的参数集(Object)。 // 旋转通过矩阵来实现 // 当前矩阵 const matrix = Util.mat3.create(); // 目标矩阵 const toMatrix = Util.transform(matrix, [["r", ratio * Math.PI * 2]]); // 返回这一帧需要的参数集,本例中只有目标矩阵 return { matrix: toMatrix, }; }, { repeat: true, // 动画重复 duration: 3000, easing: "easeCubic", }, ); }, }, "rect", ); ``` ### 边动画 关于边动画,以下面三个动画示例进行讲解: - 圆点在沿着线运动(下图左); - 虚线运动的效果(下图中,gif 图片的帧率问题导致看起来是静态的,可以访问下面的 demo 链接查看); - 线从无到有的效果(下图右)。 download download download 以上三个边动画的 demo 代码见:边动画。 #### 圆点运动 本例通过在 `afterDraw` 方法中为边增加了一个 circle 图形,该图形沿着线运动。沿着线运动的原理:设定每一帧中,该 circle 在线上的相对位置。`animate` 函数的第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg)。
download ```javascript F6.registerEdge( "circle-running", { afterDraw(cfg, group) { // 获得当前边的第一个图形,这里是边本身的 path const shape = group.get("children")[0]; // 边 path 的起点位置 const startPoint = shape.getPoint(0); // 添加红色 circle 图形 const circle = group.addShape("circle", { attrs: { x: startPoint.x, y: startPoint.y, fill: "red", r: 3, }, // must be assigned in F6. it can be any value you want name: "circle-shape", }); // 对红色圆点添加动画 circle.animate( (ratio) => { // 每一帧的操作,入参 ratio:这一帧的比例值(Number)。返回值:这一帧需要变化的参数集(Object)。 // 根据比例值,获得在边 path 上对应比例的位置。 const tmpPoint = shape.getPoint(ratio); // 返回需要变化的参数集,这里返回了位置 x 和 y return { x: tmpPoint.x, y: tmpPoint.y, }; }, { repeat: true, // 动画重复 duration: 3000, }, ); // 一次动画的时间长度 }, }, "cubic", ); // 该自定义边继承内置三阶贝塞尔曲线 cubic ``` #### 虚线运动的效果 虚线运动的效果是通过计算线的 `lineDash` ,并在每一帧中不断修改实现。`animate` 函数的第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg)。
download ```javascript // lineDash 的差值,可以在后面提供 util 方法自动计算 const lineDash = [4, 2, 1, 2]; F6.registerEdge( "line-dash", { afterDraw(cfg, group) { // 获得该边的第一个图形,这里是边的 path const shape = group.get("children")[0]; let index = 0; // 边 path 图形的动画 shape.animate( () => { index++; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // 返回需要修改的参数集,这里修改了 lineDash,lineDashOffset return res; }, { repeat: true, // 动画重复 duration: 3000, // 一次动画的时长为 3000 }, ); }, }, "cubic", ); // 该自定义边继承了内置三阶贝塞尔曲线边 cubic ``` #### 线从无到有 线从无到有的动画效果,同样可以通过计算 `lineDash` 来实现。`animate` 函数的第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg)。
download ```javascript F6.registerEdge( "line-growth", { afterDraw(cfg, group) { const shape = group.get("children")[0]; const length = group.getTotalLength(); shape.animate( (ratio) => { const startLen = ratio * length; // 计算 lineDash const cfg = { lineDash: [startLen, length - startLen], }; return cfg; }, { repeat: true, // 是否重复执行 duration: 2000, // 一次动画持续时长 }, ); }, }, "cubic", ); // 该自定义边继承了内置三阶贝塞尔曲线边 cubic ``` ### 交互动画 在交互的过程中也可以添加动画。如下图所示,当鼠标移到节点上时,所有与该节点相关联的边都展示虚线运动的动画。
![交互动画.gif](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*-90pSrm4hkUAAAAAAAAAAABkARQnAQ)
上图完整 demo 即代码参见:状态切换动画。 这种动画涉及到了边的 [状态](/zh/docs/manual/middle/states/state)。在自定义边时复写 `setState` 方法,可对边的各种状态进行监听。鼠标移动到节点上,相关边的某个状态被开启,`setState` 方法中监听到后开启动画效果。步骤如下: - 自定义边中复写 `setState` 方法监听该边的状态,以及某状态下的动画效果; - 监听中间的节点的 `mouseenter` 和 `mouseleave` 事件,触发相关边的状态变化。 下面代码节选自 demo 状态切换动画,请注意省略了部分代码,只展示了交互相关以及边动画相关的代码。`animate` 函数的第一个参数是返回每一帧需要变化的参数集的函数,其参数 `ratio` 是当前正在进行的一次动画的进度,范围 [0, 1];第二个参数是动画的参数,动画参数的具体配置参见 [animateCfg](#animateCfg)。 ```javascript // const data = ... // const graph = new F6.Graph({...}); const lineDash = [4, 2, 1, 2]; // 注册名为 'can-running' 的边 F6.registerEdge( "can-running", { // 复写setState方法 setState(name, value, item) { const shape = item.get("keyShape"); // 监听 running 状态 if (name === "running") { // running 状态为 true 时 if (value) { let index = 0; // 边 path 图形的动画 shape.animate( () => { index++; if (index > 9) { index = 0; } const res = { lineDash, lineDashOffset: -index, }; // 返回需要修改的参数集,这里修改了 lineDash,lineDashOffset return res; }, { repeat: true, // 动画重复 duration: 3000, // 一次动画的时长为 3000 }, ); } else { // running 状态为 false 时 // 结束动画 shape.stopAnimate(); // 清空 lineDash shape.attr("lineDash", null); } } }, }, "cubic-horizontal", ); // 该自定义边继承了内置横向三阶贝塞尔曲线边 cubic-horizontal // 监听节点的 tap 事件 graph.on("node:tap", (ev) => { // 获得当前鼠标操作的目标节点 const node = ev.item; // 获得目标节点的所有相关边 const edges = node.getEdges(); // 将所有相关边的 running 状态置为 true,此时将会触发自定义节点的 setState 函数 edges.forEach((edge) => graph.setItemState(edge, "running", true)); }); // 监听节点的 dbltap 事件 graph.on("node:dbltap", (ev) => { // 获得当前鼠标操作的目标节点 const node = ev.item; // 获得目标节点的所有相关边 const edges = node.getEdges(); // 将所有相关边的 running 状态置为 false,此时将会触发自定义节点的 setState 函数 edges.forEach((edge) => graph.setItemState(edge, "running", false)); }); // graph.data(data); // graph.render(); ```   ⚠️ 注意: `running` 为 `false` 时,要停止动画,同时把 `lineDash` 清空。 ## animateCfg | 配置项 | 类型 | 默认值 | 描述 | | -------------- | -------- | -------------- | ---------------------------------------- | | duration | Number | 500 | 一次动画的时长 | | easing | boolean | 'linearEasing' | 动画函数,见 [easing 函数](#easing-函数) | | delay | Number | 0 | 延迟一段时间后执行动画 | | repeat | boolean | false | 是否重复执行动画 | | callback | Function | undefined | 动画执行完时的回调函数 | | pauseCallback | Function | undefined | 动画暂停时(`shape.pause()`)的回调函数 | | resumeCallback | Function | undefined | 动画恢复时(`shape.resume()`)的回调函数 | ### easing 函数 easing 函数是指动画的函数。例如线性插值、先快后慢等。
F6 支持所有 d3.js 中的动画函数。因此,上面代码中 `animateCfg` 配置中的 String 类型的 `easing` 可以取值有:
`'easeLinear'` ,
`'easePolyIn'` ,`'easePolyOut'` , `'easePolyInOut'` ,
`'easeQuad'` ,`'easeQuadIn'` ,`'easeQuadOut'` , `'easeQuadInOut'` 。 更多取值及所有取值含义参见:d3 Easings。 ================================================ FILE: packages/site/docs/manual/middle/elements/advanced-style/gradient.zh.md ================================================ --- title: 设置渐变色 order: 4 --- F6 提供描边的**线性渐变**和填充的**环形渐变**两种形式。 ### 描边线性渐变 #### 示例 img > 说明:`l` 表示使用线性渐变,绿色的字体为可变量,由用户自己填写。 #### 用法 在[配置节点或边](/zh/docs/manual/tutorial/mini/elements)的样式时,指定 `stroke` 属性如下: ``` // 使用渐变色描边,渐变角度为 0,渐变的起始点颜色 #ffffff,中点的渐变色为 #7ec2f3,结束的渐变色为 #1890ff stroke: 'l(0) 0:#ffffff 0.5:#7ec2f3 1:#1890ff' ``` ### 填充环形渐变 #### 示例 img > 说明:r 表示使用放射状渐变,绿色的字体为可变量,由用户自己填写,开始圆的 x y r 值均为相对值,0 至 1 范围。 #### 用法 在[配置节点或边](/zh/docs/manual/tutorial/mini/elements)的样式时,指定 `fill` 属性如下: ``` // 使用渐变色填充,渐变起始圆的圆心坐标为被填充物体的包围盒中心点,半径为(包围盒对角线长度 / 2) 的 0.1 倍,渐变的起始点颜色 #ffffff,中点的渐变色为 #7ec2f3,结束的渐变色为 #1890ff fill: 'r(0.5, 0.5, 0.1) 0:#ffffff 1:#1890ff' ``` ================================================ FILE: packages/site/docs/manual/middle/elements/advanced-style/set-label-bg.zh.md ================================================ --- title: 设置节点或边的背景 order: 0 --- 用户可以直接通过以下配置为节点或边设置背景。 **特别说明:** 该功能是由 GitHub 用户 @zhanba 贡献 [feat: add label background](https://github.com/antvis/F6/pull/1354) 。 ``` const graph = new F6.Graph({ // ... defaultNode: { position: 'left', style: { background: { fill: '#ffffff', stroke: 'green', padding: [3, 2, 3, 2], radius: 2, lineWidth: 3, }, }, }, defaultEdge: { autoRotate: true, style: { background: { fill: '#ffffff', stroke: '#000000', padding: [2, 2, 2, 2], radius: 2, }, }, } }) ``` ================================================ FILE: packages/site/docs/manual/middle/elements/advanced-style/texture.zh.md ================================================ --- title: 设置纹理 order: 5 --- F6 支持用特定的纹理填充图形。F6 支持的纹理内容可以直接是**图片**或者 **Data URL**。 img > 说明:`p` 表示使用纹理;绿色的字体为可变量,您可以修改它们以满足您的需求;`a` 表示纹理的重复方式,可选值如下: > > - `a`: 该模式在水平和垂直方向重复; > - `x`: 该模式只在水平方向重复; > - `y`: 该模式只在垂直方向重复; > - `n`: 该模式只显示一次(不重复)。 在[配置节点或边](/zh/docs/manual/tutorial/mini/elements)的样式时,指定 `fill` 属性如下: ``` shape.attr('fill', 'p(a)https://gw.alipay.com/cube.png'); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/advanced-style/updateText.zh.md ================================================ --- title: 更新文本样式 order: 2 --- 在 F6 中,可以通过以下三种方式更新文本样式。 #### 实例化 Graph 实例化 Graph 时,可以通过在 `defaultNode` 或 `defaultEdge` 中指定 `labelCfg` 属性修改文本的样式。这种方式指定了全局的文本样式。 ```javascript const graph = new F6.Graph({ ... width: 1000, height: 800, defaultNode: { type: 'node', labelCfg: { style: { fill: '#fff', fontSize: 14, }, }, }, defaultEdge: { type: 'line-with-arrow', labelCfg: { style: { fill: '#fff', fontSize: 14, }, }, }, }); ``` #### 数据中指定 labelCfg 在数据中为每个节点和边指定 `labelCfg` 可以达到为不同节点或边定制不同文本样式的目的。 ```javascript const data = { nodes: [ { id: "node1", label: "node1", labelCfg: { style: { fill: "#fff", fontSize: 12, }, }, }, ], }; ``` #### 使用 update/updateItem 使用 `update/updateItem` 更新节点或边时,也可以更新节点或边上的文本。该方法用于动态更新文本样式。 ```javascript graph.updateItem(node, { // 节点的样式 style: { stroke: "blue", }, // 节点上文本的样式 labelCfg: { style: { fill: "#fff", fontSize: 12, }, }, }); ``` 想知道文本都可以设置哪些属性,请参考 [节点上的文本属性](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg) 或 [边上的文本属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。 ================================================ FILE: packages/site/docs/manual/middle/elements/combos/built-in/circle.zh.md ================================================ --- title: Circle order: 1 --- F6 内置了圆  Circle Combo,其默认样式如下。标签文本位于圆形上方。 Demo
img ## 使用方法 如 [内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo) 一节所示,配置 Combo 的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.combo(comboFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.combo(comboFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`parentId`、`label` 应当配置到每个 Combo 数据中外,其余的 [Combo 的通用属性](#/zh/docs/manual/middle/elements/combos/defaultCombo#combo-的通用属性) 以及各个 Combo 类型的特有属性(见内置 Combo 类型)均支持三种配置方式。 ⚠️ 注意: 使用 Combo 时,必须在示例化图时配置 `groupByTypes` 设置为 `false`,图中元素的视觉层级才能合理。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultCombo` 指定 `type` 为 `'circle'`,即可使用 `circle` Combo。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { type: 'circle', // Combo 类型 // ... 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同 Combo 有不同的配置,可以将配置写入到 Combo 数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [ ... // 边 ], combos: [ { id: 'combo1', type: 'circle', // Combo 类型 ... // 其他配置 }, ... // 其他 Combo ], } ``` ## 配置项说明 Circle Combo 支持 [Combo 通用配置](/zh/docs/manual/middle/elements/combos/defaultCombo#combo-的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解:
| 名称 | 含义 | 类型 | 备注 | | --------------- | ------------------------------------------------------------ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | size | 圆的最小直径(非固定直径),渲染大小由子元素的大小与分布决定 | number / number[] | `size` 为数组时,取第一个值 | | fixSize | 固定该 Combo 的直径 | number | 不指定时 Combo 大小由内部元素的分布和大小来决定。若指定了 `fixSize` 而没有指定 `fixCollapseSize`,则即使该 Combo 在收起状态下仍然保持 `fixSize` 指定的尺寸 | | fixCollapseSize | 固定该 Combo 收起时的直径 | number | 不指定时,若未指定 `fixSize` 则由 `size` 决定收起时的直径,否则统一为 `fixSize` 直径 | | | style | circle 默认样式 | Object | 参见下文 [样式属性  style](./circle#样式属性-style) 内容 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | 参见下文 [标签文本配置 labelCfg](./circle#标签文本配置-labelcfg) | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性  style Object 类型。支持 [Combo 通用样式](/zh/docs/manual/middle/elements/combos/defaultCombo#样式属性-style)。通过 `style` 配置来修改 Combo 的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { combos: [ { label: 'combo_circle', type: 'circle', label: 'Circle', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // type: 'circle', // 在数据中已经指定 type,这里无需再次指定 style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [Combo 通用标签配置](/zh/docs/manual/middle/elements/combos/defaultCombo/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultCombo` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // ... Combo 其他属性 labelCfg: { position: "left", refX: 5, style: { fill: "#bae637", fontSize: 15, // ... 其他文本样式的配置 }, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/combos/built-in/rect.zh.md ================================================ --- title: Rect order: 2 --- F6 内置了矩形 Rect Combo,其默认样式如下。标签文本位于矩形内部左上方。Demo
img ## 使用方法 如 [内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo) 一节所示,配置 Combo 的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.combo(comboFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.combo(comboFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`parentId`、`label` 应当配置到每个 Combo 数据中外,其余的 [Combo 的通用属性](#/zh/docs/manual/middle/elements/combos/defaultCombo#combo-的通用属性) 以及各个 Combo 类型的特有属性(见内置 Combo 类型)均支持三种配置方式。 ⚠️ 注意: 使用 Combo 时,必须在示例化图时配置 `groupByTypes` 设置为 `false`,图中元素的视觉层级才能合理。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultCombo` 指定 `type` 为 `'rect'`,即可使用 `rect` Combo。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { type: 'rect', // Combo 类型 // ... 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同 Combo 有不同的配置,可以将配置写入到 Combo 数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [ ... // 边 ], combos: [ { id: 'combo1', type: 'rect', // Combo 类型 ... // 其他配置 }, ... // 其他 Combo ], } ``` ## 配置项说明 Rect Combo 支持 [Combo 通用配置](/zh/docs/manual/middle/elements/combos/defaultCombo#combo-的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解:
| 名称 | 含义 | 类型 | 备注 | | --------------- | ------------------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | size | 矩形的最小长与宽(非固定大小) | number / number[] | `size` 为 Number 时,长宽相等 | | fixSize | 固定该 Combo 的长与宽 | number | 不指定时 Combo 大小由内部元素的分布和大小来决定。若指定了 `fixSize` 而没有指定 `fixCollapseSize`,则即使该 Combo 在收起状态下仍然保持 `fixSize` 指定的长与宽 | | fixCollapseSize | 固定该 Combo 收起时的直径 | number | 不指定时,若未指定 `fixSize` 则由 `size` 决定收起时的长与宽,否则统一为 `fixSize` 长与宽 | | | style | rect 图形的默认样式 | Object | 参见下文 [样式属性  style](./rect#样式属性-style) 内容 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | 参见下文 [标签文本配置 labelCfg](./rect#标签文本配置-labelcfg) | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性  style Object 类型。支持 [Combo 通用样式](/zh/docs/manual/middle/elements/combos/defaultCombo#样式属性-style)。通过 `style` 配置来修改 Combo 的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { combos: [ { label: 'combo_rect', type: 'rect', label: 'Rect', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // type: 'rect', // 在数据中已经指定 type,这里无需再次指定 style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置  labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [Combo 通用标签配置](/zh/docs/manual/middle/elements/combos/defaultCombo/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultCombo` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // ... Combo 其他属性 labelCfg: { position: "bottom", refX: -12, style: { fill: "#bae637", fontSize: 15, // ... 其他文本样式的配置 }, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/combos/custom-combo.zh.md ================================================ --- title: 自定义 Combo order: 2 --- F6 提供了一系列[内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo),包括 [circle](/zh/docs/manual/middle/elements/combos/built-in/circle)、[rect](/zh/docs/manual/middle/elements/combos/built-in/rect)。若内置 Combo 无法满足需求,用户还可以通过 `F6.registerCombo ('comboName', options, expendedComboName)` 进行**自定义扩展内置的 Combo**,方便用户开发更加定制化的 Combo,包括含有复杂图形的 Combo、复杂交互的 Combo、带有动画的 Combo 等。 在本章中,我们通过两个案例,讲解通过自定义扩展现有 Combo。 ## Combo 接口 通过 [图形 Shape](/zh/docs/manual/middle/elements/shape/shape-keyshape) 章节的学习,我们应该已经知道了自定义 Combo 时需要满足以下两点: - 控制 Combo 的生命周期; - 解析用户输入的数据,在图形上展示。 在自定义扩展内置 'circle' 或 'rect' Combo 时,API 中可以复写的方法如下: ```javascript F6.registerCombo( "comboName", { /** * 绘制 Combo 中的图形。不需要为默认的 label 增加图形,父类方法会自动增加 label * @param {Object} cfg Combo 的配置项 * @param {G.Group} group 图形分组,Combo 中的图形对象的容器 * @return {G.Shape} 返回一个绘制的图形作为 keyShape,通过 combo.get('keyShape') 可以获取。 * 关于 keyShape 可参考文档 核心概念-节点/边/Combo-图形 Shape 与 keyShape */ drawShape(cfg, group) {}, /** * 绘制后的附加操作,默认没有任何操作 * @param {Object} cfg Combo 的配置项 * @param {G.Group} group 图形分组,Combo 中的图形对象的容器 */ afterDraw(cfg, group) {}, /** * 更新节点后的操作,新增的图形需要在这里控制其更新逻辑 * @override * @param {Object} cfg 节点的配置项 * @param {Combo} combo 节点 */ afterUpdate(cfg, combo) {}, /** * 响应 Combo 的状态变化。 * 在需要使用动画来响应状态变化时需要被复写,其他样式的响应参见下文提及的 [配置状态样式] 文档 * @param {String} name 状态名称 * @param {Object} value 状态值 * @param {Combo} combo 节点 */ setState(name, value, combo) {}, }, // 被继承的 Combo 类型名,可选:'circle' 或 'rect' extendedComboName, ); ``` ## 注意事项(必读) 因 Combo 更新逻辑的特殊性(需要根据其子元素信息自动更新自身位置和大小),自定义 Combo 时,与自定义节点/边有所不同: 1. 不建议“从无到有”地自定义 Combo,**推荐使用继承的方式**扩展内置的 'circle' 或 'rect' Combo; 2. 在 `drawShape` 方法中不需要为 label 增加图形,父类方法将会自动增加默认的 label,可以通过配置的方式指定 label 的位置和样式; 3. 与自定义节点/边不同,这里**不建议复写 `update` 和 `draw` 方法**,否则会使 Combo 根据子元素更新的逻辑异常; 4. 复写的 `drawShape` 方法返回值与推荐继承内置的 'circle'、'rect' 的 keyShape 一致。即继承 'circle' 时,`drawShape` 方法应该返回一个 circle 图形;继承 'rect' 时,`drawShape` 方法应该返回一个 rect 图形; 5. 除 keyShape 外,自定义新增的图形需要**在 `afterUpdate` 中定义其位置更新逻辑**; 6. `setState` 只有在需要使用动画来响应状态变化时需要被复写,一般的样式响应状态变化可以通过 [配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) 实现。 ## 1. 自定义扩展内置 Rect Combo Demo。 ### 内置 Rect Combo 位置逻辑详解 首先,我们需要了解内置的 rect 类型的 Combo 内部的位置逻辑: - 下图灰色虚线框内部是子元素的分布范围,其宽高分别为 innerWidth 和 innerHeight; - 灰色虚线框上下左右可以配置 `padding` 值,该 Combo 的 keyShape 真实绘制大小 width 与 height 是 innerWidth 和 innerHeight 加上了 padding 后的值; - 一个 Combo 内部的图形以自身坐标系为参考,原点 (0, 0) 在灰色虚线框正中心; - padding 值的上与下、左与右可能不相等,这就导致了该矩形的左上角坐标不是简单的 (-width / 2, -height / 2),而是通过如图标注的计算获得; - rect 类型 Combo 的 label 默认位于矩形内部左上角,上边距为 refY,左边距为 refX。label 的位置(`position`)、`refX`、`refY` 可以在使用该类型 Combo 时配置。 img > Rect Combo 位置说明图 ### 绘制图形 现在,我们自己实现一个如下图所示的 Combo 类型(下图展示空 Combo): img 根据上述 [内置 Rect Combo 位置逻辑详解](./custom-combo#内置-rect-combo-位置逻辑详解),在扩展 rect 类型 Combo 时需要注意复写方法中 `x`、`y`、`width`、`height` 的设置 ```javascript F6.registerCombo( "cRect", { drawShape: function drawShape(cfg, group) { const self = this; // 获取配置中的 Combo 内边距 cfg.padding = cfg.padding || [50, 20, 20, 20]; // 获取样式配置,style.width 与 style.height 对应 rect Combo 位置说明图中的 width 与 height const style = self.getShapeStyle(cfg); // 绘制一个矩形作为 keyShape,与 'rect' Combo 的 keyShape 一致 const rect = group.addShape("rect", { attrs: { ...style, x: -style.width / 2 - (cfg.padding[3] - cfg.padding[1]) / 2, y: -style.height / 2 - (cfg.padding[0] - cfg.padding[2]) / 2, width: style.width, height: style.height, }, draggable: true, name: "combo-keyShape", }); // 增加右侧圆 group.addShape("circle", { attrs: { ...style, fill: "#fff", opacity: 1, // cfg.style.width 与 cfg.style.heigth 对应 rect Combo 位置说明图中的 innerWdth 与 innerHeight x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, r: 5, }, draggable: true, name: "combo-circle-shape", }); return rect; }, // 定义新增的右侧圆的位置更新逻辑 afterUpdate: function afterUpdate(cfg, combo) { const group = combo.get("group"); // 在该 Combo 的图形分组根据 name 找到右侧圆图形 const circle = group.find( (ele) => ele.get("name") === "combo-circle-shape", ); // 更新右侧圆位置 circle.attr({ // cfg.style.width 与 cfg.style.heigth 对应 rect Combo 位置说明图中的 innerWdth 与 innerHeight x: cfg.style.width / 2 + cfg.padding[1], y: (cfg.padding[2] - cfg.padding[0]) / 2, }); }, }, "rect", ); ``` 值得注意的是,F6 需要用户为自定义节点中的图形设置 `name` 和 `draggable`。其中,`name` 可以是不唯一的任意值。`draggable` 为 `true` 是表示允许该图形响应拖拽事件,只有 `draggable: true` 时,图上的交互行为 `'drag-combo'` 才能在该图形上生效。若上面代码仅在 keyShape 上设置了 `draggable: true`,而右侧圆图形上没有设置,则鼠标拖拽只能在 keyShape 上响应。 ### 使用自定义 Combo 现在,我们使用下面的代码使用 `'cRect'` 类型的 Combo: ```javascript const data = { nodes: [ { id: 'node1', x: 250, y: 100, comboId: 'combo1' }, { id: 'node2', x: 300, y: 100, comboId: 'combo1' }, ], combos: [ { id: 'combo1', label: 'Combo 1', parentId: 'combo2' }, { id: 'combo2', label: 'Combo 2' }, { id: 'combo3', label: 'Combo 3' }, ], }; const graph = new F6.Graph({ ... width: 800, height: 800, // 全局 Combo 配置 defaultCombo: { // 指定 Combo 类型,也可以将 type 写到 combo 数据中 type: 'cRect', // ... 此处可配置默认 Combo 的其他样式 }, }); graph.data(data); graph.render(); ``` img ## 2. 自定义扩展内置 Circle Combo Demo。 ### 内置 Circle Combo 位置逻辑详解 如下面 Circle Combo 位置说明图所示,circle 类型的 Combo 内部的位置逻辑比 rect 类型简单,其 (x, y) 为圆心,`padding` 为一个数值: - 下图灰色虚线圈内部是子元素的分布范围,其半径为 innerR; - 与 rect 不同的是,灰色虚线圈的 `padding` 是一个数值,即灰色虚线圈外围的 padding 是均匀的,该 Combo 的 keyShape 真实绘制半径 R = innerR + padding; - 一个 Combo 内部的图形以自身坐标系为参考,原点 (0, 0) 在灰色虚线框正中心(由于 padding 是均匀的,所以原点也在 keyShape 正中心); - circle 图形的 x 与 y 为其圆心 (0, 0); - circle 类型 Combo 的 label 默认位于圆形外部正上方,距离圆形上边缘 refY。label 的位置(`position`)、`refX`、`refY` 可以在使用该类型 Combo 时配置。 img > Circle Combo 位置说明图 ### 绘制图形 现在,我们自己实现一个如下图所示的 Combo 类型(下图展示空 Combo): img ```javascript // 定义下面需要使用的 symbol const collapseIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ]; }; const expandIcon = (x, y, r) => { return [ ["M", x - r, y], ["a", r, r, 0, 1, 0, r * 2, 0], ["a", r, r, 0, 1, 0, -r * 2, 0], ["M", x - r + 4, y], ["L", x - r + 2 * r - 4, y], ["M", x - r + r, y - r + 4], ["L", x, y + r - 4], ]; }; F6.registerCombo( "cCircle", { drawShape: function draw(cfg, group) { const self = this; // 获取样式配置,style.r 是加上了 padding 的半径 // 对应 Circle Combo 位置说明图中的 R const style = self.getShapeStyle(cfg); // 绘制一个 circle 作为 keyShape,与 'circle' Combo 的 keyShape 一致 const circle = group.addShape("circle", { attrs: { ...style, x: 0, y: 0, r: style.r, }, draggable: true, name: "combo-keyShape", }); // 增加下方 marker const marker = group.addShape("marker", { attrs: { ...style, fill: "#fff", opacity: 1, x: 0, y: style.r, r: 10, symbol: collapseIcon, }, draggable: true, name: "combo-marker-shape", }); return circle; }, // 定义新增的下方 marker 的位置更新逻辑 afterUpdate: function afterUpdate(cfg, combo) { const self = this; // 获取样式配置,style.r 是加上了 padding 的半径 // 对应 Circle Combo 位置说明图中的 R const style = self.getShapeStyle(cfg); const group = combo.get("group"); // 在该 Combo 的图形分组根据 name 找到下方 marker const marker = group.find( (ele) => ele.get("name") === "combo-marker-shape", ); // 更新 marker marker.attr({ x: 0, y: style.r, // 数据中的 collapsed 代表该 Combo 是否是收缩状态,根据该字段更新 symbol symbol: cfg.collapsed ? expandIcon : collapseIcon, }); }, }, "circle", ); ``` 值得注意的是,F6 需要用户为自定义节点中的图形设置 `name` 和 `draggable`。其中,`name` 可以是不唯一的任意值。`draggable` 为 `true` 是表示允许该图形响应拖拽事件,只有 `draggable: true` 时,图上的交互行为 `'drag-combo'` 才能在该图形上生效。若上面代码仅在 keyShape 上设置了 `draggable: true`,而右侧圆图形上没有设置,则鼠标拖拽只能在 keyShape 上响应。 ### 使用自定义 Combo 现在,我们使用下面的代码使用 `'cCircle'` 类型的 Combo: ```javascript const data = { nodes: [ { id: 'node1', x: 250, y: 100, comboId: 'combo1' }, { id: 'node2', x: 300, y: 100, comboId: 'combo1' }, ], combos: [ { id: 'combo1', label: 'Combo 1', parentId: 'combo2' }, { id: 'combo2', label: 'Combo 2' }, { id: 'combo3', label: 'Combo 3' }, ], }; const graph = new F6.Graph({ ... width: 800, height: 800, // 全局 Combo 配置 defaultCombo: { // 指定 Combo 类型,也可以将 type 写到 combo 数据中 type: 'cCircle', labelCfg: { refY: 2, }, // ... 此处可配置默认 Combo 的其他样式 }, modes: { default: [ // 配置展开/收缩 Combo 交互,双击 Combo 可以触发 // 将会修改响应 Combo 数据中的 collapsed 字段,从而标识该 Combo 是否处于收缩状态 'collapse-expand-combo', ], }, }); graph.data(data); graph.render(); ``` img ### 自定义交互 在上面代码中,实例化图时为图配置了 `'collapse-expand-combo'` 交互,即双击 Combo 可以展开和收起。若我们希望在单击 Combo 下方的 marker 时,展开/收起 Combo,则可以去掉 `'collapse-expand-combo'` 配置,并添加如下监听代码: ```javascript // collapse/expand when click the marker graph.on("combo:tap", (e) => { if (e.target.get("name") === "combo-marker-shape") { // Collapse or expand the combo graph.collapseExpandCombo(e.item); if (graph.get("layout")) graph.layout(); // If there is a layout configured on the graph, relayout else graph.refreshPositions(); // Refresh positions for items otherwise } }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/combos/defaultCombo.zh.md ================================================ --- title: Combo 总览 order: 0 --- 对于熟悉图可视化类库的用户来说,节点分组是非常实用的一个功能。支持带有节点分组的图布局、自定义 Combo、嵌套节点分组的均匀 padding、节点与分组的边、分组与分组的边、空的节点分组等。具体使用可以参考 Demo
img F6 的内置 Combo 包括 circle 和 rect 两种类型,分别如下图所示。
img 本文将概述 F6 中的 Combo 的数据结构、各个内置 Combo 类型、内置 Combo 的通用属性、配置方法。各类型 Combo 详细配置项及配置方法见本目录下相应文档。 ⚠️ 注意: 使用 Combo 时,必须在示例化图时配置 `groupByTypes` 设置为 `false`,图中元素的视觉层级才能合理。 ## 数据结构 为保持 F6 源数据数据结构的稳定性,我们在原来的数据结构上做了如下修改: 1. 新增 `combos` 数组,用于定义图上所有的 Combo 及其配置。`combos` 数组中的一个数据项有如下属性: | 属性名 | 类型 | 是否必须 | 示例 | 解释 | | --------------- | ----------------- | -------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | id | string | true | 'comboA' | 一个 Combo 的唯一标识,**必须是 string 类型,必须唯一** | | parentId | string | false | 'comboB' | 该 Combo 的父 Combo 的 ID | | padding | Number / Number[] | false | 10 或 [ 10, 20, 10, 20 ] | 该 Combo 内边距 | | size | number / number[] | false | 10 或 [ 10, 20 ] | 该 Combo 的最小尺寸(非固定尺寸),默认 'circle' 类型 Combo 的 size 为 20,'rect' 类型的为 [20, 5] | | fixSize | number / number[] | false | 10 或 [ 10, 20 ] | 固定该 Combo 的尺寸,不指定时 Combo 大小由内部元素的分布和大小来决定。若指定了 fixSize 而没有指定 fixCollapseSize,则即使该 Combo 在收起状态下仍然保持 fixSize 指定的尺寸 | | fixCollapseSize | number / number[] | false | 10 或 [ 10, 20 ] | 固定该 Combo 收起时的尺寸,不指定时,若未指定 fixSize 则由 size 决定收起时的尺寸,否则统一为 fixSize 尺寸 | | label | string | false | 'combo A' | 该 Combo 的文本标签 | | style | Object | false | | 该 Combo 的样式配置项,详见[内置 Combo 配置文档](/zh/docs/manual/middle/elements/combos/defaultCombo#样式属性-style)及各类型 Combo 的文档 | | labelCfg | Object | false | | 该 Combo 的文本标签样式配置项,详见[内置 Combo 配置文档](/zh/docs/manual/middle/elements/combos/defaultCombo#标签文本-label-及其配置-labelcfg)及各类型 Combo 的文档 | `combos` 数组中一个数据项的示例: ```javascript { id: 'comboA', label: 'A', parentId: 'comboC' }, ``` 2. 在 nodes 数组中的数据项内加入 `comboId` 属性,表示该节点与某个 Combo 的从属关系。 ```javascript { nodes: [ { id: 'node1', comboId: 'comboA' // node1 属于 comboA }, { id: 'node2', comboId: 'comboB' // node2 属于 comboB }, { id: 'node3' // node3 不属于任何 combo }, // ... ], edges: [ // ... ], combos: [ { // 定义 comboA id: 'comboA', label: 'A', parentId: 'comboC' }, { // 定义 comboB id: 'comboB', parentId: 'comboB' }, { // 定义 comboC,这是一个空的 combo id: 'comboC' }, // ... ] } ``` ## 内置 Combo 类型说明 下面表格中显示了内置的各类 Combo,同时对一些特殊的字段进行了说明: | 名称 | 描述 | 默认示例 | | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | circle | 圆形:
- `size` 是单个数字,表示直径
- 圆心位置对应 Combo 的位置
- `color` 字段默认在描边上生效
- 标签文本默认在 Combo 正上方
- 更多字段见 [Circle](/zh/docs/manual/middle/elements/combos/built-in/circle) Combo 教程
- Demo | img | | rect | 矩形:
- `size` 是数组,例如:[100, 50]
- 矩形的中心位置是 Combo 的位置,而不是左上角
- `color` 字段默认在描边上生效
- 标签文本默认在 Combo 左上角
- 更多字段见 [Rect](/zh/docs/manual/middle/elements/combos/built-in/rect) Combo 教程
- Demo | img | ## Combo 的通用属性 所有内置的 Combo 支持的通用属性: | 属性名 | 类型 | 是否必须 | 示例 | 说明 | | --------------- | ----------------- | -------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | id | string | true | 'comboA' | 一个 Combo 的唯一标识,**必须是 string 类型,必须唯一** | | type | string | false | 'rect' | 指定该 Combo 的类型,可以是内置 Combo 的类型名,也可以是自定义 Combo 的类型名。默认是 `'circle'` | | parentId | string | false | 'comboB' | 该 Combo 的父 Combo 的 ID | | size | false | Number / Array | 30 或 [30, 20] | Combo 的最小尺寸(非固定尺寸),默认 'circle' 类型 Combo 的 size 为 20,'rect' 类型的为 [20, 5] | | fixSize | number / number[] | false | 10 或 [ 10, 20 ] | 固定该 Combo 的尺寸,不指定时 Combo 大小由内部元素的分布和大小来决定。若指定了 fixSize 而没有指定 fixCollapseSize,则即使该 Combo 在收起状态下仍然保持 fixSize 指定的尺寸 | | fixCollapseSize | number / number[] | false | 10 或 [ 10, 20 ] | 固定该 Combo 收起时的尺寸,不指定时,若未指定 fixSize 则由 size 决定收起时的尺寸,否则统一为 fixSize 尺寸 | | | padding | Number / Number[] | false | 10 或 [ 10, 20, 10, 20 ] | 该 Combo 内边距,默认 'circle' 类型 Combo 的 padding 为 25,'rect' 类型的为 [25, 20, 15, 20] | | style | Object | false | | 该 Combo 的样式配置项 | | label | string | false | 'Combo A' | 该 Combo 的文本标签 | | labelCfg | Object | false | | 该 Combo 的文本标签样式配置项 | ### 样式属性 style Object 类型。通过 `style` 配置来修改 Combo 的填充色、边框颜色、阴影等属性。下表是 `style` 对象中常用的配置项: | 名称 | 是否必须 | 类型 | 备注 | | ------------- | -------- | ------ | ----------------------------- | | fill | false | String | Combo 填充色 | | stroke | false | String | Combo 的描边颜色 | | lineWidth | false | Number | 描边宽度 | | shadowColor | false | String | 阴影颜色 | | shadowBlur | false | Number | 阴影范围 | | shadowOffsetX | false | Number | 阴影 x 方向偏移量 | | shadowOffsetY | false | Number | 阴影 y 方向偏移量 | | opacity | false | Number | 设置绘图的当前 alpha 或透明值 | | fillOpacity | false | Number | 设置填充的 alpha 或透明值 | 下面代码演示在实例化图时全局配置方法中配置 `style`: ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // ... 其他属性 style: { fill: '#steelblue', stroke: '#eaff8f', lineWidth: 5, // ... 其他属性 }, }, }); ``` ### 标签文本 label 及其配置 labelCfg `label` String 类型。标签文本的文字内容。
`labelCfg` Object 类型。配置标签文本。下面是 `labelCfg` 对象中的常用配置项: | 名称 | 是否必须 | 类型 | 备注 | | -------- | -------- | ------ | ---------------------------------------------------------------------------------------------------------------- | | position | false | String | 文本相对于 Combo 的位置,目前支持的位置有:  `'center'`,`'top'`,`'left'`,`'right'`,`'bottom'`。默认为 `'top'` | | refX | false | Number | 文本的偏移,在 x 方向上的偏移量 | | refY | false | Number | 文本的偏移,在 y 方向上的偏移量 | | style | false | Object | 标签的样式属性。 | 上表中的标签的样式属性 `style` 的常用配置项如下: | 名称 | 是否必须 | 类型 | 备注 | | ------------------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | | fill | false | String | 文本颜色 | | stroke | false | String | 文本描边颜色 | | lineWidth | false | Number | 文本描边粗细 | | opacity | false | Number | 文本透明度 | | fontSize | false | Number | 文本字体大小 | | fontFamily | false | String | 文字字体 | | ... Combo 标签与节点、边标签样式属性相同,统一整理在 [Text 图形 API](/zh/docs/api/shapeProperties/#文本-text) | 下面代码演示在实例化图时全局配置方法中配置  `label` 和  `labelCfg`。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { // ... 其他属性 labelCfg: { position: 'top', offset: [10, 10, 10, 10], style: { fill: '#666', }, }, }, }); ``` ## Combo 的配置方法 配置 Combo 的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.combo(comboFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.combo(comboFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 即有相同的配置项时,优先级高的方式将会覆盖优先级低的。 ⚠️ 注意: 除 `id`、`parentId`、`label` 应当配置到每个 Combo 数据中外,其余的 [Combo 的通用属性](#combo-的通用属性) 以及各个 Combo 类型的特有属性(见内置 Combo 类型)均支持三种配置方式。 ### 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultCombo` 配置 Combo ,这里的配置是全局的配置,将会在所有 Combo 上生效。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, defaultCombo: { type: 'circle', // 其他配置 }, }); ``` ### 在数据中动态配置 如果需要为不同 Combo 进行不同的配置,可以将配置写入到 Combo 数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [ ... // 边 ], combos: [{ id: 'combo0', size: 100, type: 'circle', ... // 其他属性 style: { ... // 样式属性,每种 Combo 的详细样式属性参见各类型 Combo 文档 } },{ id: 'combo1', size: [50, 100], type: 'rect', ... // 其他属性 style: { ... // 样式属性,每种 Combo 的详细样式属性参见各类型 Combo 文档 } }, // 其他 combo ] } ``` ### 使用 graph.combos() 该方法可以为不同 combo 进行不同的配置。
**提示:** - 该方法必须**在 render 之前调用**,否则不起作用; - 由于该方法优先级最高,将覆盖其他地方对 combo 的配置,这可能将造成一些其他配置不生效的疑惑; - 该方法在增加元素、更新元素时会被调用,如果数据量大、每个 Combo 上需要更新的内容多时,可能会有性能问题。 ```javascript // const data = ... // const graph = ... graph.combo((combo) => { return { id: combo.id, type: "rect", style: { fill: "blue", }, }; }); graph.data(data); graph.render(); ``` ## Combo 交互 只是简单地将 Combo 渲染出来,并没有多大的实用价值,只有支持一系列的交互操作后,才能最大程度地体现 Combo 的价值。 在 F6 中,我们内置了 `drag-combo`、`collapse-expand-combo`、`drag-node` 三个 [Behavior](/zh/docs/manual/middle/states/defaultBehavior)。 #### drag-combo `drag-combo` Behavior,支持拖动 Combo ,拖动 Combo 过程中,会动态改变 Combo 中节点和边的位置,在拖拽完成以后,保持 Combo 和节点的相对位置不变。还可以通过拖拽改变 Combo 的从属关系。 img #### collapse-expand-combo `collapse-expand-combo` Behavior,支持双击 Combo 收起和展开 Combo ,收起 Combo 以后,隐藏 Combo 中的所有节点,外部节点和 Combo 中节点有连线的情况下,所有连接会连接到 Combo 上面。若图配置有布局且该 behavior 的 `relayout` 配置项为 `true`(默认为 `true`),则该 behavior 被触发后会触发图的重新布局。若希望避免重新布局,可以配置 `relayout` 为 `false` ,或通过监听 combo 点击事件和 [graph.collapseExpandCombo API](/zh/docs/api/Graph#collapseexpandcombocombo) 控制收缩展开逻辑。 img #### drag-node 拖拽节点过程中,动态改变节点与父 Combo 的从属关系。 img #### 配置交互 通过下面代码在实例化图时将三个 behavior 配置到图上即可使用上述交互: ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, modes: { default: ['drag-combo', 'collapse-expand-combo', 'drag-node'], }, }); ``` ## 示例 ```javascript const data = { nodes: [ { id: 'node1', label: 'Node1', comboId: 'rect_combo', }, { id: 'node2', label: 'Node 2', }, ], combos: [ { id: 'circle_combo', type: 'circle', label: 'Circle', }, { id: 'rect_combo', type: 'rect', label: 'Rect', }, ], }; const graph = new F6.Graph({ ... width: 1500, height: 300, // 必须将 groupByTypes 设置为 false,带有 combo 的图中元素的视觉层级才能合理 groupByTypes: false, }); graph.data(data); graph.render(); ``` 显示结果:
img ### 调整 Combo 配置 下面演示通过将配置写入数据的方式,调整 `id` 为 `'rect_combo'` 的文本位置、颜色、样式。将下面代码替换上面代码中 `id` 为  `'rect_combo'` 的 combo 数据即可生效。 ```javascript { id: 'rect_combo', type: 'rect', label: 'Rect Combo', labelCfg: { position: 'bottom', refX: 5, refY: -12, style: { fill: '#fff' } }, style: { fill: '#fa8c16', stroke: '#000', lineWidth: 2 } } ``` img ## 适用场景 1. 风控、反洗钱、保险骗保、网络诈骗、信用卡诈骗等场景下团伙分析; 2. 特征分析:同一个分组中的节点在某些特征上面比较相似; 3. 整理节点:当类似的节点放到一个分组中,只渲染分组,不渲染节点,减少干扰元素。 ## 相关阅读 - [状态 State](/zh/docs/manual/middle/states/state) —— 交互过程中的样式变化。 ================================================ FILE: packages/site/docs/manual/middle/elements/edges/arrow.zh.md ================================================ --- title: 箭头 order: 2 --- 无论是内置边还是[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge),都可以为其配置起始端箭头与结束端箭头。F6 中的箭头分为默认箭头、内置箭头、自定义箭头。
img ## 默认箭头 img ### 使用方法 在边的样式属性 `style` 中将 `endArrow` 或 `startArrow` 配置为 `true` 即可: ```javascript style: { endArrow: true, startArrow: true } ``` ## 内置箭头 ### 各箭头概览 | 名称 | 参数 | 使用方法 | 效果 | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | triangle |
依次为箭头宽度(默认 10)、长度(默认 15)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.triangle(10, 20, 25),
d: 25
} | img | | vee |
依次为箭头宽度(默认 15)、长度(默认 20)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.vee(10, 20, 25),
d: 25
} | img | | circle |
依次为箭头半径(默认 5)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.circle(10, 25),
d: 25
} | img | | diamond |
依次为箭头宽度(默认 15)、长度(默认 15)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.diamond(10, 20, 25),
d: 25
} | img | | rect |
依次为箭头宽度(默认 10)、长度(默认 10)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.rect(10, 20, 25),
d: 25
} | img | | triangleRect |
依次为箭头三角形宽度(默认 15)、三角形长度(默认 15)、矩形宽度(默认 15)、矩形长度(默认 3)、三角形与矩形间距(默认为 5)、偏移量(默认为 0,与 `d` 对应)
| endArrow: {
path: F6.Arrow.triangleRect(15, 15, 15, 3, 5, 25),
d: 25
} | img | ### 使用方法 调用 `F6.Arrow.arrowName` 配置边的样式属性 `style` 中 `endArrow` 或 `startArrow` 的 `path`: ```javascript style: { endArrow: { path: F6.Arrow.triangle(10, 20, 25), // 使用内置箭头路径函数,参数为箭头的 宽度、长度、偏移量(默认为 0,与 d 对应) d: 25 }, startArrow: { path: F6.Arrow.vee(15, 20, 15), // 使用内置箭头路径函数,参数为箭头的 宽度、长度、偏移量(默认为 0,与 d 对应) d: 15 }, } ``` ## 自定义箭头 参见高级指引 [自定义箭头](/zh/docs/manual/middle/elements/edges/custom-edge#4-自定义箭头)。 ## 配置箭头样式 只有内置箭头和自定义箭头可以配置样式。 #### 配置项 | 名称 | 是否必须 | 类型 | 备注 | | ------------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | fill | false | String | 填充颜色,默认无填充 | | stroke | false | String | 描边颜色,默认与边颜色相同 | | lineWidth | false | Number | 描边宽度,默认与边宽度相同 | | opacity | false | Number | 透明度 | | shadowColor | false | String | 阴影颜色 | | shadowBlur | false | Number | 阴影模糊程度 | | shadowOffsetX | false | Number | 阴影 x 方向偏移量 | | shadowOffsetY | false | Number | 阴影 y 方向偏移量 | | lineDash | false | Array | 描边的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。 | #### 使用方法 ```javascript // 内置箭头 style: { endArrow: { path: F6.Arrow.triangle(10, 20, 25), // 使用内置箭头路径函数,参数为箭头的 宽度、长度、偏移量(默认为 0,与 d 对应) d: 25, fill: '#f00', stroke: '#0f0', opacity: 0.5, lineWidth: 3, // ... }, } // 自定义箭头 style: { endArrow: { path: 'M 0,0 L 20,10 L 20,-10 Z', d: 5, fill: '#f00', stroke: '#0f0', opacity: 0.5, lineWidth: 3, // ... }, } ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/arc.zh.md ================================================ --- title: Arc order: 6 --- F6 内置了圆弧  arc  边,其默认样式如下。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'arc'`,即可使用 arc  边。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'arc', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'arc', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 arc 边支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明。其中 `curveOffset` 属性是 `arc` 特有的属性,它控制了圆弧的大小以及弯曲的方向。 ```javascript color: '#87e8de', curveOffset: 20, // 圆弧顶端距离两线中心位置的距离 style: { lineWidth: 2, stroke: '#87e8de' }, label: '边的标签文字', labelCfg: { refX: 10, // 文本在 x 方向偏移量 refY: 10, // 文本在 y 方向偏移量 style: { fill: '#595959' } } ``` | 名称 | 含义 | 类型 | 备注 | | --------------- | ---------------------------------- | ---------- | --------------------------------------------------------------------------------- | | color | 边的颜色 | String | 优先级低于 `style` 中的 `stroke` | | **curveOffset** | **圆弧顶端距离两线中心位置的距离** | **Number** | **数值绝对值大小控制圆弧的大小,正负控制圆弧弯曲的方向,默认为 `20`。arc 边特有** | | style | 边的样式 | Object | Canvas 支持的属性 | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 特殊属性:弧度  curveOffset `curveOffset` 属性是 `arc` 特有的属性,它控制了圆弧的大小以及弯曲的方向。下面代码演示在实例化图时全局配置方法中配置 `curveOffset`。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 200, size: 20, }, ], edges: [ { source: 'node0', target: 'node1', type: 'arc', label: 'arc', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, linkCenter: true, defaultEdge: { // type: 'arc', // 在数据中已经指定 type,这里无需再次指定 curveOffset: -80, }, }); graph.data(data); graph.render(); ``` ⚠️ 注意:
上面代码使用了 graph 的配置项  `linkCenter: true` 以设置 arc 边连入节点的中心,保证美观性。 ### 样式属性 style Object 类型。配置项与 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 相同。基于上面 [特殊属性:弧度  curveOffset](#特殊属性:弧度-curveoffset) 中的代码,下面代码在 `defaultEdge` 中增加了  `style`  配置项进行边的样式的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 style: { stroke: "#088", lineWidth: 3, }, }, }); // ... ``` ### 标签文本配置  labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。基于上面  [弧度 curveOffset](/zh/docs/manual/middle/elements/edges/built-in/arc/#特殊属性:弧度-curveoffset) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { autoRotate: true, refY: -30, refX: 30, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/cubic.zh.md ================================================ --- title: Cubic order: 5 --- F6 内置了  cubic  边,其默认样式如下。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'cubic'`,即可使用 cubic  边。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'cubic', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'cubic', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 cubic 边支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------------------------------------------------------------------------------------------- | | color | 边的颜色 | String | 优先级低于 `style` 中的 `stroke` | | style | 边的样式 | Object | Canvas 支持的属性 | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | controlPoints | 控制点数组 | Array | 不指定时将会使用默认的控制点:曲线 1/3 和 2/3 处。示例:`[{ x: 10, y: 20 }, { x: 15, y: 30 }]` | | curveOffset | 两个控制点距离两端点连线的距离,可理解为控制边的弯曲程度。为 Number 类型时两个控制点分别在连线两侧且与连线距离相等 | Number / Number[] | cubic、quadratic、cubic-vertical、cubic-horizontal 等贝塞尔曲线特有 | | minCurveOffset | 两个控制点距离两端点连线的最小距离距离,可理解为控制边的弯曲程度,用于防止过于“平缓”的曲线,当 `curveOffset` 未指定时生效。为 Number 类型时两个控制点分别在连线两侧且与连线距离相等 | Number / Number[] | cubic-vertical、cubic-horizontal 边特有 | | curvePosition | 两个控制点在两端点连线上的相对位置,范围 0 ~ 1 | Number / Number[] | cubic、quadratic、cubic-vertical、cubic-horizontal 等贝塞尔曲线特有 | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性 style Object 类型。配置项与 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 相同。下面代码演示在实例化图时全局配置方法中配置 `style`,以达到下图效果。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 200, size: 20, }, ], edges: [ { source: 'node0', target: 'node1', type: 'cubic', label: 'cubic', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // type: 'cubic', // 在数据中已经指定 type,这里无需再次指定 style: { endArrow: true, stroke: '#088', lineWidth: 3, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { autoRotate: true, refY: 10, refX: 40, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/line.zh.md ================================================ --- title: Line order: 2 --- F6 内置了直线 line  边,其默认样式如下。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有两种:配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'line'`,即可使用 line  边。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'line', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'line', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 line 边支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------- | ------ | ----------------------------------------------------------------------- | | color | 直线的颜色 | String | 优先级低于 `style` 中的 `stroke` | | style | 直线的样式 | Object | Canvas 支持的属性 | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性 style Object 类型。配置项与 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 相同。下面代码演示在实例化图时全局配置方法中配置 `style`,以达到下图效果。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 100, size: 20, }, ], edges: [ { source: 'node0', target: 'node1', type: 'line', label: 'line', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // type: 'line', // 在数据中已经指定 type,这里无需再次指定 style: { stroke: 'steelblue', lineWidth: 5, }, labelCfg: { position: 'end', refY: -10, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。
基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { position: "end", refY: -10, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/loop.zh.md ================================================ --- title: Loop order: 7 --- F6 内置了折线 loop  边,其默认样式如下。
img ⚠️ 注意:
loop 边适用于自环边,即起始点与结束点为相同节点的边,在不同端点的边上适用 loop 边将会出现异常效果。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有两种:配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'loop'`,即可使用 `loop`  边。需要注意的是,如果图上存在非自环边,loop 将会表现异常。因此不建议在存在非自环边的图上使用此全局配置方法。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'loop', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node0' type: 'loop', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 自环是指连接单个节点自身的边,是一种边的特殊情况。支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明。在通用属性基础上,支持了特殊的配置 `loopCfg`。 loop 边支持以下的配置项,对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | -------------- | ------------------ | ---------- | ---------------------------- | | color | 边的颜色 | String | 优先级低于 style 中的 stroke | | style | 边的样式 | Object | Canvas 支持的属性 | | style.endArrow | 边结束端是否有箭头 | Boolean | 默认为 false | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | **loopCfg** | **自环特殊配置** | **Object** | | ### 样式属性 style Object 类型。配置项与 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 相同。下面代码演示在实例化图时全局配置方法中配置 `style`,以达到下图效果。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, ], edges: [ { source: 'node0', target: 'node0', type: 'loop', label: 'loop', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // type: 'loop', // 在数据中已经指定 type,这里无需再次指定 style: { endArrow: true, stroke: '#088', lineWidth: 3, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { refY: -5, refX: 30, }, }, }); // ... ``` ### 自环特殊配置  loopCfg Object 类型。通过 `loopCfg`  配置自环的方位、高度、顺逆时针。 - `position`: 指定自环与节点的相对位置。默认为:`top`。支持的值有:`top`, `top-right`, `right`,`bottom-right`, `bottom`, `bottom-left`, `left`, `top-left` - `dist`: 从节点 keyShape 的边缘到自环最顶端的位置,用于指定自环的曲度,默认为节点的高度。 - `clockwise`: 指定是否顺时针画环,默认为  `true`。 基于上面 [样式属性 style](#XQFb2) 中的代码,下面代码在 `defaultEdge` 中增加了  `loopCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 loopCfg: { position: "left", dist: 100, clockwise: false, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/polyline.zh.md ================================================ --- title: Polyline order: 3 --- F6 内置了折线 polyline  边,其默认样式如下。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'polyline'`,即可使用 polyline  边。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'polyline', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'polyline', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 polyline 边支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明: ```javascript color: '#87e8de', style: { offset: 20, // 拐弯处距离节点最小距离 radius: 10, // 拐弯处的圆角弧度,若不设置则为直角 lineWidth: 2, stroke: '#87e8de' }, label: '边的标签文字', labelCfg: { refX: 10, // 文本在 x 方向偏移量 refY: 10, // 文本在 y 方向偏移量 style: { fill: '#595959' } } ``` | 名称 | 含义 | 类型 | 备注 | | ---------------- | -------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | color | 边的颜色 | String | 优先级低于 style 中的 stroke | | style | 边的样式 | Object | Canvas 支持的属性 | | **style.radius** | **拐弯处的圆角弧度** | **Number** | **若不设置则为直角,polyline 特有** | | **style.offset** | **拐弯处距离节点最小距离** | **Number** | **默认为 5,polyline 特有** | | controlPoints | 控制点数组 | Array | 不指定时根据 A\* 算法自动生成折线。若指定了,则按照 `controlPoints` 指定的位置进行弯折。示例:`[{ x: 10, y: 20 }, { x: 20, y: 25 }, ...]` | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性 style Object 类型。支持 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style)。与其他类型的边不同的是,polyline 的 `style`  含有两个特殊属性: - `radius` ,弯折处的圆角半径,不设置则默认为直角; - `offset` ,距离端点的最小距离,默认值为 5。 其它配置项与边的通用样式属性相同,见 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)
下面代码演示在实例化图时全局配置方法中配置 `style`,以达到下图效果。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 200, size: 20, }, ], edges: [ { source: 'node0', target: 'node1', type: 'polyline', label: 'polyline', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // type: 'polyline', // 在数据中已经指定 type,这里无需再次指定 style: { radius: 10, offset: 10, stroke: 'steelblue', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置  labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { refY: -10, refX: 60, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/built-in/quadratic.zh.md ================================================ --- title: Quadratic order: 4 --- F6 内置了  quadratic  边,其默认样式如下。
img ## 使用方法 如 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  一节所示,配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](/zh/docs/manual/middle/elements/edges/defaultEdge#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge` 指定 `type` 为 `'quadratic'`,即可使用 quadratic  边。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'quadratic', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'quadratic', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ## 配置项说明 quadratic 边支持 [边通用配置项](/zh/docs/manual/middle/elements/edges/defaultEdge/#边的通用属性),以下表格对部分常用配置项进行说明。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ------------- | ---------------------------------------------------- | ----------------- | ----------------------------------------------------------------------- | | color | 边的颜色 | String | 优先级低于 style 中的 stroke | | style | 边的样式 | Object | Canvas 支持的属性 | | label | 标签文本文字 | String | | | labelCfg | 标签文本配置项 | Object | | | controlPoints | 控制点数组 | Array | 不指定时将会使用默认的控制点:曲线中心附近。示例:`[{ x: 10, y: 20 }]` | | curveOffset | 控制点距离两端点连线的距离,可理解为控制边的弯曲程度 | Number / Number[] | cubic、horizontal、cubic-vertical、cubic-horizontal 等贝塞尔曲线特有 | | curvePosition | 控制点在两端点连线上的相对位置,范围 0 ~ 1 | Number / Number[] | cubic、horizontal、cubic-vertical、cubic-horizontal 等贝塞尔曲线特有 | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | ### 样式属性  style Object 类型。配置项与 [边通用样式属性](/zh/docs/manual/middle/elements/edges/defaultEdge/#样式属性-style) 相同。下面代码演示在实例化图时全局配置方法中配置 `style`。
img ```javascript const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 100, size: 20, }, ], edges: [ { source: 'node0', target: 'node1', type: 'quadratic', label: 'quadratic', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // type: 'quadratic', // 在数据中已经指定 type,这里无需再次指定 style: { stroke: '#088', endArrow: true, lineWidth: 3, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。支持 [边通用标签配置](/zh/docs/manual/middle/elements/edges/defaultEdge/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultEdge` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultEdge: { // ... 其他配置 labelCfg: { refY: 10, refX: 40, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/custom-edge.zh.md ================================================ --- title: 自定义边 order: 3 --- F6 除了提供丰富的 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge)  外,还提供了自定义边的机制,方便用户开发更加定制化的边,包括含有复杂图形的边、复杂交互的边、带有动画的边等。 用户可以通过 `F6.registerEdge(typeName: string, edgeDefinition: object, extendedTypeName?: string)` 注册一个新的边类型,其中: - `typeName`:该新边类型名称; - `extendedTypeName`:被继承的边类型,可以是内置边类型名,也可以是其他自定义边的类型名。`extendedTypeName` 未指定时代表不继承其他类型的边; - `edgeDefinition`:该新边类型的定义,其中必要函数详见 [自定义机制 API](/zh/docs/api/registerItem#g6registeredgeedgename-options-extendededgename)。当有 `extendedTypeName` 时,没被复写的函数将会继承 `extendedTypeName` 的定义。 **需要注意的是**,自定义边/节点时,若给定了 `extendedTypeName`,如 `draw`,`update`,`setState` 等必要的函数若不在 `edgeDefinition` 中进行复写,将会继承 `extendedTypeName` 中的相关定义。常见问题: - Q:边/节点更新时,没有按照在 `edgeDefinition` 中自定义实现的 `draw` 或 `drawShape` 逻辑更新。例如,有些图形没有被更新,增加了没有在 `draw` 或 `drawShape` 方法中定义的图形等。 - A:由于继承了 `extendedTypeName`,且在 `edgeDefinition` 中没有复写 `update` 方法,导致边/节点更新时执行了 `extendedTypeName` 中的 `update` 方法,从而与自定义的 `draw` 或 `drawShape` 有出入。可以通过复写 `update` 方法为 `undefined` 解决。当 `update` 方法为 `undefined` 时,边/节点的更新将会执行 `draw` 或 `drawShape` 进行重绘。 在本章中我们会通过四个案例,从简单到复杂讲解边的自定义:
1. 从无到有的定义边;
2. 扩展现有边;
3. 增加额外图形;
4. 边的交互样式;
5. 自定义带箭头的边。 ## 1. 从无到有定义边 我们来实现垂直的折线:
img img img > (左)直线边。(中)默认的折线边。(右)调整了节点的锚点(连入点)后的折线边。 ### 自定义边 ```javascript F6.registerEdge("hvh", { draw(cfg, group) { const startPoint = cfg.startPoint; const endPoint = cfg.endPoint; const shape = group.addShape("path", { attrs: { stroke: "#333", path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, startPoint.y], // 三分之一处 ["L", endPoint.x / 3 + (2 / 3) * startPoint.x, endPoint.y], // 三分之二处 ["L", endPoint.x, endPoint.y], ], }, // must be assigned in F6. it can be any value you want name: "path-shape", }); return shape; }, }); ``` - 上面自定义边中的 `startPoint` 和 `endPoint` 分别是是边两端与起始节点和结束节点的交点; - 可以通过修改节点的锚点(边连入点)来改变 `startPoint` 和 `endPoint` 的位置。 ### 在数据中修改 anchorPoints 通过以下的数据,使用自定义的 hvh 边,就可以实现上图最右边的效果。 ```javascript const data = { nodes: [ { id: "node1", x: 100, y: 200, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node2", x: 200, y: 100, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, { id: "node3", x: 200, y: 300, anchorPoints: [ [0, 0.5], [1, 0.5], ], }, ], edges: [ { id: "edge1", target: "node2", source: "node1", type: "hvh", }, { id: "edge2", target: "node3", source: "node1", type: "hvh", }, ], }; ``` ## 2. 扩展现有边 通过 `afterDraw` 接口给现有的曲线增加动画。 img ```javascript F6.registerEdge( "line-growth", { afterDraw(cfg, group) { const shape = group.get("children")[0]; const length = shape.getTotalLength(); shape.animate( (ratio) => { const startLen = ratio * length; const cfg = { lineDash: [startLen, length - startLen], }; return cfg; }, { repeat: true, duration: 2000, }, ); }, }, "cubic", ); ```
## 3. 增加额外图形 通过实现 `afterDraw` 增加额外图形,为找到边的主要图形 `path` 上的某个点,可以使用 `shape.getPoint(ratio)` 获得。 img ```javascript F6.registerEdge( "mid-point-edge", { afterDraw(cfg, group) { // 获取图形组中的第一个图形,在这里就是边的路径图形 const shape = group.get("children")[0]; // 获取路径图形的中点坐标 const midPoint = shape.getPoint(0.5); // 在中点增加一个矩形,注意矩形的原点在其左上角 group.addShape("rect", { attrs: { width: 10, height: 10, fill: "#f00", // x 和 y 分别减去 width / 2 与 height / 2,使矩形中心在 midPoint 上 x: midPoint.x - 5, y: midPoint.y - 5, }, }); }, update: undefined, }, "cubic", ); ```
## 4. 边的交互样式 以点击选中边为示例,实现如下需求: - 点击边时边变粗,再点击变成细; - 单击变成红色,双击变成 `'#333'` 。 效果如下图所示。
img
⚠️注意: 边过细时点击很难被击中,可以设置  `lineAppendWidth`  来提升击中范围。 ```javascript // 基于 line 扩展出新的边 F6.registerEdge( "custom-edge", { // 响应状态变化 setState(name, value, item) { const group = item.getContainer(); const shape = group.get("children")[0]; // 顺序根据 draw 时确定 if (name === "active") { if (value) { shape.attr("stroke", "red"); } else { shape.attr("stroke", "#333"); } } if (name === "selected") { if (value) { shape.attr("lineWidth", 3); } else { shape.attr("lineWidth", 2); } } }, }, "line", ); // 点击时选中,再点击时取消 graph.on("edge:tap", (ev) => { const edge = ev.item; graph.setItemState(edge, "selected", !edge.hasState("selected")); // 切换选中 }); graph.on("edge:tap", (ev) => { const edge = ev.item; graph.setItemState(edge, "active", true); }); graph.on("edge:dbltap", (ev) => { const edge = ev.item; graph.setItemState(edge, "active", false); }); ```
## 5. 自定义箭头 F6 为内置边、自定义边提供了[默认箭头和内置箭头](/zh/docs/manual/middle/elements/edges/arrow)。很多时候,F6 提供的箭头并不能满足业务上的需求,这个时候,就需要我们自定义箭头。
img > (左)F6 内置箭头。(右)自定义边带有自定义箭头。 ⚠️ 注意: F6 3.4.1 后的自定义箭头坐标系有所变化。如下图所示,左图为 F6 3.4.1 之前版本的演示,右图为 F6 3.4.1 及之后版本的演示。箭头由指向 x 轴负方向更正为指向 x 轴正方向。同时,偏移量 `d` 的方向也发生响应变化。不变的是,自定义箭头本身坐标系的原点都与相应边 / path 的端点重合,且自定义箭头的斜率与相应边 / path 端点处的微分斜率相同。 img F6 中有三种途径在边上配置自定义箭头: - 配置自定义箭头到边的全局配置中; - 在数据中为单条边配置; - 在自定义边中配置。 ### 方法 1: 全局配置 ```javascript const graph = new Graph({ // ... 图的其他配置项 defaultEdge: { style: { endArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, fill: "#333", stroke: "#666", opacity: 0.8, // ... }, }, }, }); ``` ### 方法 2: 在数据中配置 ```javascript const data = { nodes: [ { id: "node1" }, { id: "node2" }, // ... 其他节点 ], edges: [ { source: "node1", target: "node2", style: { endArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, fill: "#333", stroke: "#666", opacity: 0.8, // ... }, }, }, //... 其他边 ], }; ``` ### 方法 3: 自定义边中配置 ```javascript // 使用方法二:自定义边,并带有自定义箭头 F6.registerEdge("line-arrow", { draw(cfg, group) { const { startPoint, endPoint } = cfg; const keyShape = group.addShape("path", { attrs: { path: [ ["M", startPoint.x, startPoint.y], ["L", endPoint.x, endPoint.y], ], stroke: "steelblue", lineWidth: 3, startArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, fill: "#333", stroke: "#666", opacity: 0.8, // ... }, endArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, fill: "#333", stroke: "#666", opacity: 0.8, // ... }, }, // must be assigned in F6. it can be any value you want name: "path-shape", }); return keyShape; }, }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/edges/defaultEdge.zh.md ================================================ --- title: 边总览 order: 0 --- F6 提供了 9 种内置边: - line:直线,不支持控制点; - polyline:折线,支持多个控制点; - arc:圆弧线; - quadratic:二阶贝塞尔曲线; - cubic:三阶贝塞尔曲线; - cubic-vertical:垂直方向的三阶贝塞尔曲线,不考虑用户从外部传入的控制点; - cubic-horizontal:水平方向的三阶贝塞尔曲线,不考虑用户从外部传入的控制点; - loop:自环。 这些内置边的默认样式分别如下图所示。
img 本文将概述 F6 中的各个内置边类型、内置边的通用属性、配置方法。各类型边详细配置项及配置方法见本目录下相应文档。 ## 内置边类型说明 下面表格中显示了内置的各类边,同时对一些特殊的字段进行了说明: | 名称 | 描述 | | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | line | 连接两个节点的直线:
- `controlPoints` 不生效
- 更多配置详见 line 边的配置
| img | | polyline | 多段线段构成的折线,连接两个端点:
- `controlPoints` 表示所有线段的拐点,不指定时根据 A\* 算法自动生成折线
- 更多配置详见 polyline 边的配置
| img | | arc | 连接两个节点的一段圆弧:
- `controlPoints` 不生效
- 使用 curveOffset 指定弧的弯曲程度,其正负影响弧弯曲的方向
- 更多配置详见 arc 边的配置
| img | | quadratic | 只有一个控制点的曲线:
- `controlPoints` 不指定时,会默认线的一半处弯曲
- 更多配置详见 quadratic 边的配置
| img | | cubic | 有两个控制点的曲线:
- `controlPoints` 不指定时,会默认线的 1/3, 2/3 处弯曲
- 更多配置详见 cubic 边的配置
| img | | cubic-vertical | 垂直方向的三阶贝塞尔曲线,不考虑用户从外部传入的控制点 | img | | cubic-horizontal | 水平方向的三阶贝塞尔曲线,不考虑用户从外部传入的控制点 | img | | loop | 自环。更多配置详见 loop 边的配置 | img | ## 边的通用属性 所有内置的边支持的通用属性: | 名称 | 是否必须 | 类型 | 备注 | | ------------ | -------- | ------ | ----------------------------------------------------------------------------- | --------- | | id | false | String | 边唯一 ID,**必须**是唯一的 string | | source | true | String | Number | 起始点 id | | target | true | String | 结束点 id | | type | false | String | 指定边的类型,可以是内置边的类型名称,也可以是自定义边的名称。默认为 `'line'` | | sourceAnchor | false | Number | 边的起始节点上的锚点的索引值 | | targetAnchor | false | Number | 边的终止节点上的锚点的索引值 | | style | false | Object | 边的样式属性 | | label | false | String | 文本文字,如果没有则不会显示 | | labelCfg | false | Object | 文本配置项 | ### 样式属性  style Object 类型。通过 `style` 配置来修改边的颜色、线宽等属性。下表是 `style` 对象中常用的配置项: | 名称 | 是否必须 | 类型 | 备注 | | --------------- | -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | stroke | false | String | 边的颜色 | | lineWidth | false | Number | 边宽度 | | lineAppendWidth | false | Number | 边响应事件时的检测宽度,当 `lineWidth` 太小而不易选中时,可以通过该参数提升击中范围 | | endArrow | false | Boolean / Object | 为 `true` 时在边的结束端绘制默认箭头,为 `false` 时不绘制结束端箭头;也可以使用[内置箭头配置](),例如:
endArrow: {
path: F6.Arrow.vee(10, 20, 10), // 内置箭头,参数为箭头宽度、长度、偏移量 d(默认为 0)
d: 10 // 偏移量
} ;或通过 path 自定义的箭头,例如:
endArrow: {
path: 'M 0,0 L 20,10 L 20,-10 Z', // 自定义箭头路径
d: -2 // 偏移量
} | | startArrow | false | Boolean / Object | 为 `true` 时在边的开始端绘制默认箭头,为 `false` 时不绘制结束端箭头;也可以使用[内置箭头配置](),例如:
startArrow: {
path: F6.Arrow.vee(10, 20, 10), // 内置箭头,参数为箭头宽度、长度、偏移量 d(默认为 0)
d: 10 // 偏移量
} ;或通过 path 自定义的箭头,例如:
startArrow: {
path: 'M 0,0 L 20,10 L 20,-10 Z', // 自定义箭头路径
d: -2 // 偏移量
} | | strokeOpacity | false | Number | 边透明度 | | shadowColor | false | String | 阴影颜色 | | shadowBlur | false | Number | 阴影模糊程度 | | shadowOffsetX | false | Number | 阴影 x 方向偏移量 | | shadowOffsetY | false | Number | 阴影 y 方向偏移量 | | lineDash | false | Array | 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。 | 下面代码演示在实例化图时全局配置方法中配置 `style`: ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // ... 其他属性 style: { stroke: '#eaff8f', lineWidth: 5, // ... 其他样式属性 }, }, }); ``` ### 标签文本 label 及其配置  labelCfg `label` String 类型。标签文本的文字内容。
`labelCfg` Object 类型。配置标签文本。下面是 `labelCfg` 对象中的常用配置项: | 名称 | 是否必须 | 类型 | 备注 | | ---------- | -------- | ------- | ---------------------------------------------------------------------------------------- | | refX | false | Number | 标签在 x 方向的偏移量 | | refY | false | Number | 标签在 y 方向的偏移量 | | position | false | String | 文本相对于边的位置,目前支持的位置有:`'start'`,`'middle'`,`'end'`。默认为`'middle'`。 | | autoRotate | false | Boolean | 标签文字是否跟随边旋转,默认 `false` | | style | false | Object | 标签的样式属性 | 上表中的标签的样式属性 `style` 的常用配置项如下: | 名称 | 是否必须 | 类型 | 备注 | | ----------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | | fill | false | String | 文本颜色 | | stroke | false | String | 文本描边颜色 | | lineWidth | false | Number | 文本描边粗细 | | opacity | false | Number | 文本透明度 | | fontFamily | false | String | 文本字体 | | fontSize | false | Number | 文本字体大小 | | ... 节点标签与边标签样式属性相同,统一整理在 [Text 图形 API](/zh/docs/api/shapeProperties/#文本-text) | | | | 下面代码演示在实例化图时全局配置方法中配置  `label` 和  `labelCfg`。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { // ... 其他属性 label: 'edge-label', labelCfg: { refY: -10, refX: 60, }, }, }); ``` ## 边的配置方法 配置边的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.edge(edgeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 graph.edge(edgeFn) 配置 > 数据中动态配置 > 实例化图时全局配置 即有相同的配置项时,优先级高的方式将会覆盖优先级低的。 ⚠️ 注意: 除 `id`、`source`、`target`、`label` 应当配置到每条边数据中外,其余的 [边的通用属性](#边的通用属性) 以及各个边类型的特有属性(见内置边类型)均支持三种配置方式。 ### 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultEdge`  配置边,这里的配置是全局的配置,将会在所有边上生效。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultEdge: { type: 'line', // ... 其他配置 }, }); ``` ### 在数据中动态配置 如果需要使不同边有不同的配置,可以将配置写入到边数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ ... // 节点 ], edges: [{ source: 'node0', target: 'node1' type: 'polyline', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } },{ source: 'node1', target: 'node2' type: 'cubic', ... // 其他配置 style: { ... // 样式属性,每种边的详细样式属性参见各边文档 } }, ... // 其他边 ] } ``` ### 使用 graph.edge() 该方法可以为不同边进行不同的配置。
提示: - 该方法必须**在 render 之前调用**,否则不起作用; - 由于该方法优先级最高,将覆盖其他地方对边的配置,这可能将造成一些其他配置不生效的疑惑; - 该方法在增加元素、更新元素时会被调用,如果数据量大、每条边上需要更新的内容多时,可能会有性能问题。 ```javascript // const data = ... // const graph = ... graph.edge((edge) => { return { id: edge.id, type: "polyline", style: { fill: "steelblue", }, }; }); graph.data(data); graph.render(); ``` ## 实例演示 ```javascript const data = { nodes: [ { id: '1', x: 50, y: 50, size: 20 }, { id: '2', x: 150, y: 50, size: 20 }, { id: '3', x: 200, y: 50, size: 20 }, { id: '4', x: 300, y: 130, size: 20 }, { id: '5', x: 350, y: 50, size: 20 }, { id: '6', x: 450, y: 50, size: 20 }, { id: '7', x: 500, y: 50, size: 20 }, { id: '8', x: 600, y: 50, size: 20 }, { id: '9', x: 650, y: 50, size: 20 }, { id: '10', x: 750, y: 50, size: 20 }, { id: '11', x: 800, y: 50, size: 20 }, { id: '12', x: 900, y: 150, size: 20 }, { id: '13', x: 950, y: 50, size: 20 }, { id: '14', x: 1050, y: 150, size: 20 }, { id: '15', x: 1100, y: 50, size: 20 }, ], edges: [ { source: '1', target: '2', type: 'line', label: 'line' }, { source: '3', target: '4', type: 'polyline', label: 'polyline' }, { source: '5', target: '6', type: 'arc', label: 'arc' }, { source: '7', target: '8', type: 'quadratic', label: 'quadratic' }, { source: '9', target: '10', type: 'cubic', label: 'cubic' }, { source: '11', target: '12', type: 'cubic-vertical', label: 'cubic-vertical' }, { source: '13', target: '14', type: 'cubic-horizontal', label: 'cubic-horizontal' }, { source: '15', target: '15', type: 'loop', label: 'loop' }, ], }; const graph = new F6.Graph({ ... width: 1500, height: 300, linkCenter: true, // 使边连入节点的中心 }); graph.data(data); graph.render(); ``` 显示结果:
img ### 调整边的样式 可以在边上添加文本,修改边的样式。下面演示将配置写入数据的方式配置边。使用下面代码替换上面代码中的 9-10、11-12 两条边数据,修改这两条边的样式和其文本。 ```javascript // 使 9-10 的 cubic 边文本下移 15 像素 { source: '9', target: '10', type: 'cubic', label: 'cubic', labelCfg: { refY: -15 // refY 默认是顺时针方向向下,所以需要设置负值 } }, // 设置 11-12 的 cubic-vertical 边的颜色、虚线、粗细,并设置文本样式、随边旋转 { source: '11', target: '12', type: 'cubic-vertical', color: '#722ed1', // 边颜色 size: 5, // 边粗细 style: { lineDash: [2, 2] // 虚线边 }, label: 'cubic-vertical', labelCfg: { position: 'center', // 其实默认就是 center,这里写出来便于理解 autoRotate: true, // 使文本随边旋转 style: { stroke: 'white', // 给文本添加白边和白色背景 lineWidth: 5, // 文本白边粗细 fill: '#722ed1', // 文本颜色 } } } ``` img ## 相关阅读 - [状态 State](/zh/docs/manual/middle/states/state) —— 交互过程中的样式变化。 ================================================ FILE: packages/site/docs/manual/middle/elements/methods/edgeVisible.zh.md ================================================ --- title: 显示与隐藏 order: 5 --- ## 元素的显示/隐藏 使用下面六个函数可以实现节点、边、Combo 的显示/隐藏: ```javascript // 显示节点实例 nodeItem,该节点的 visible 属性值在该方法调用后被置为 true nodeItem.show(); // 隐藏节点实例 nodeItem,该节点的 visible 属性值在该方法调用后被置为 false nodeItem.hide(); // 显示边实例 edgeItem,该边的 visible 属性值在该方法调用后被置为 true edgeItem.show(); // 隐藏边实例 edgeItem,该边的 visible 属性值在该方法调用后被置为 false edgeItem.hide(); // 显示边实例 comboItem,该 Combo 的 visible 属性值在该方法调用后被置为 true comboItem.show(); // 隐藏边实例 comboItem,该 Combo 的 visible 属性值在该方法调用后被置为 false comboItem.hide(); ``` ## 示例 img 该示例摘取了元素显示/隐藏的相关操作部分,通过监听对节点、边、画布的点击事件,显示和隐藏元素: ```javascript // 点击节点,隐藏该节点 graph.on("node:tap", (ev) => { const node = ev.item; console.log("before hide(), the nodevisible = ", node.get("visible")); node.hide(); graph.paint(); console.log("after hide(), the node visible = ", node.get("visible")); }); // 点击边,隐藏该边 graph.on("edge:tap", (ev) => { const edge = ev.item; console.log("before hide(), the edge visible = ", edge.get("visible")); edge.hide(); graph.paint(); console.log("after hide(), the edge visible = ", edge.get("visible")); }); // 点击画布,显示所有节点和边 graph.on("canvas:tap", (ev) => { const nodes = graph.getNodes(); const edges = graph.getEdges(); nodes.forEach((node) => { node.show(); }); edges.forEach((edge) => { edge.show(); }); graph.paint(); }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/methods/elementIndex.zh.md ================================================ --- title: 节点与边的层级 order: 4 --- 节点与边在视觉上的层级涉及到了它们相对应的 [图形分组 Group](/zh/docs/manual/middle/elements/shape/graphics-group)。本文提到的所有分组 Group 都为 F6 的图形分组 Group,而非 F6 的  [节点分组 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo),其区别在 [图形分组 Group](/zh/docs/manual/middle/elements/shape/graphics-group)  中说明。 在 [图形分组 Group](/zh/docs/manual/middle/elements/shape/graphics-group) 中我们提到:在 F6 中,Graph 的一个实例中的所有节点属于同一个变量名为 `nodeGroup` 的 group,所有的边属于同一个变量名为 `edgeGroup` 的 group。节点 group 在视觉上的层级(zIndex)高于边 group,即所有节点会绘制在所有边的上层。 但有时,我们需要让边在视觉上在节点上层。例如,高亮节点及其相关边和邻居、高亮一条边等。可以通过配合图实例的配置项  `groupByTypes` 以及节点和边的 `toFront()` 与 `toBack()` 函数实现。为实现如下效果:进入节点时,提升相关边以及邻居节点的层级;离开节点时恢复;点击边时,提升边及其两端点的层级;双击边时恢复。Demo 完整代码
img 要实现上图效果,需要以下步骤: - Step 1:实例化图时配置 `groupByTypes` 为 `false`; - Step 2:将节点放置在边上层; - Step 3:监听事件并改变目标元素层级。 ## 前提代码 下面代码完成了引入 F6、数据设置、实例化图、渲染图的命令等。后文将修改下面这份代码中以达到上图高亮效果。 ```javascript // 数据源 const data = { nodes: [ { id: 'node0', x: 100, y: 100, size: 20, }, { id: 'node1', x: 200, y: 200, size: 20, }, { id: 'node2', x: 150, y: 150, size: 20, }, { id: 'node3', x: 150, y: 250, size: 20, }, { id: 'node4', x: 150, y: 200, size: 20, }, ], edges: [ { id: 'edge0', source: 'node0', target: 'node1', }, { id: 'edge1', source: 'node2', target: 'node3', }, ], }; // 实例化图 const graph = new F6.Graph({ ... width: 800, height: 600, // 为方便演示,加粗边 defaultEdge: { style: { lineWidth: 2, }, }, }); // 读取数据 graph.data(data); // 渲染图 graph.render(); ``` ## Step 1 实例化图时的配置 `groupByTypes` 是图的一个配置项,当其为默认值 `true` 时,所有节点在一个名为 `nodeGroup` 的分组,所有边在另一个名为 `edgeGroup` 的分组,且 `nodeGroup` 在 `edgeGroup` 上层。将其设置为 `false` 后,将不存在 `nodeGroup` 和 `edgeGroup`,所有节点和边在同一个分组,它们的层级根据生成的顺序决定。 ### 参数描述 | 名称 | 类型 | 默认值 | 描述 | | ------------ | ------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | groupByTypes | Boolean | true | 各种元素是否在一个分组内,决定节点和边的层级问题,默认情况下所有的节点在一个分组中,所有的边在一个分组中,当这个参数为 `false` 时,节点和边的层级根据生成的顺序确定。 | ### 使用方式 更改 前提代码 中实例化图部分代码,添加 `groupByTypes` 配置项,并设置为 `false`: ```javascript const graph = new F6.Graph({ // ... // 其他配置 groupByTypes: false, }); ``` 此时,将会得到如下效果:
img ## Step 2 将节点放置在边上层 上一步结果中节点在边的下层不符合常规,是由于 `groupByTypes` 为 `false` 时,节点和边的层级根据生成的顺序确定,而边的生成顺序在节点之后,因此所有边被绘制到了节点上方。为了使图符合常规——节点在上层,边在下层,可以在 `graph.render()` 之后将所有的节点通过 `toFront()` 函数提前。 ### 函数描述 ```javascript // 将节点实例 nodeItem 提前到其父级 group 的最前面 nodeItem.toFront(); // 将节点实例 nodeItem 放置到其父级 group 的最后面 nodeItem.toBack(); // 将边实例 edgeItem 提前到其父级 group 的最前面 edgeItem.toFront(); // 将边实例 edgeItem 放置到其父级 group 的最后面 edgeItem.toBack(); ``` ### 使用方法 ```javascript // const graph = ... graph.data(data); graph.render(); // 获取图上的所有节点实例 const nodes = graph.getNodes(); // 遍历节点实例,将所有节点提前。 nodes.forEach((node) => { node.toFront(); }); // 更改层级后需要重新绘制图 graph.paint(); ```
这样,所有节点被绘制在边上层:
img ## Step 3 监听事件并改变目标元素层级 在效果图中,点击节点,相关边和节点的层级被提升到最上层,双击节点恢复。边同理。这一步将实现这一交互效果。 ### 函数描述 ```javascript graph.on("node:tap", (ev) => { // ... }); graph.on("node:dbltap", (ev) => { // ... }); ``` ### 使用方法 ```javascript graph.on("edge:tap", (ev) => { const edge = ev.item; // 该边的起始点 const source = edge.getSource(); // 该边的结束点 const target = edge.getTarget(); // 先将边提前,再将端点提前。这样该边两个端点还是在该边上层,较符合常规。 edge.toFront(); source.toFront(); target.toFront(); // 注意:必须调用以根据新的层级顺序重绘 graph.paint(); }); graph.on("edge:dbltap", (ev) => { // 获得图上所有边实例 const edges = graph.getEdges(); // 遍历边,将所有边的层级放置在后方,以恢复原样 edges.forEach((edge) => { edge.toBack(); }); // 注意:必须调用以根据新的层级顺序重绘 graph.paint(); }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/methods/lock-node.zh.md ================================================ --- title: 锁定/解锁节点 order: 11 --- `lock()`、`unlock()` 和 `hasLocked()` 三个 API,方便用户锁定某个节点。默认情况下,当锁定某个节点后,拖动节点时锁定的节点不会有任何反应,但拖动画布和缩放画布时,仍然会对锁定的节点有影响,如果不想让锁定的节点收到拖动画布和缩放画布的影响,可以通过[自定义 Behavior](/zh/docs/manual/middle/states/custom-behavior) 的方式来实现。 ## 拖动画布时候不处理锁定的节点 F6 内置的 `drag-canvas` 不区分节点是否锁定,全部一视同仁。绝大数情况下,这种行为是完全没问题的,但某些业务可能会要求锁定的节点,拖动画布时也不能移动,对于这种情况,可以通过重新定义拖动画布的 Behavior 来实现。 ```javascript import F6 from "@antv/g6"; const Util = F6.Util; const abs = Math.abs; const DRAG_OFFSET = 10; const body = document.body; const ALLOW_EVENTS = [16, 17, 18]; F6.registerBehavior("drag-canvas-exclude-lockedNode", { getDefaultCfg() { return { direction: "both", }; }, getEvents() { return { "canvas:mousedown": "onMouseDown", "canvas:mousemove": "onMouseMove", "canvas:mouseup": "onTap", "canvas:tap": "onTap", "canvas:mouseleave": "onOutOfRange", keyup: "onKeyUp", keydown: "onKeyDown", }; }, updateViewport(e) { const origin = this.origin; const clientX = +e.clientX; const clientY = +e.clientY; if (isNaN(clientX) || isNaN(clientY)) { return; } let dx = clientX - origin.x; let dy = clientY - origin.y; if (this.get("direction") === "x") { dy = 0; } else if (this.get("direction") === "y") { dx = 0; } this.origin = { x: clientX, y: clientY, }; // 和内置 drag-canvas 不同的地方是在这里 const lockedNodes = this.graph.findAll("node", (node) => !node.hasLocked()); lockedNodes.forEach((node) => { node.get("group").translate(dx, dy); }); this.graph.paint(); }, onMouseDown(e) { if (this.keydown) { return; } this.origin = { x: e.clientX, y: e.clientY }; this.dragging = false; }, onMouseMove(e) { if (this.keydown) { return; } e = Util.cloneEvent(e); const graph = this.graph; if (!this.origin) { return; } if (this.origin && !this.dragging) { if ( abs(this.origin.x - e.clientX) + abs(this.origin.y - e.clientY) < DRAG_OFFSET ) { return; } if (this.shouldBegin.call(this, e)) { e.type = "dragstart"; graph.emit("canvas:dragstart", e); this.dragging = true; } } if (this.dragging) { e.type = "drag"; graph.emit("canvas:drag", e); } if (this.shouldUpdate.call(this, e)) { this.updateViewport(e); } }, onTap(e) { if (this.keydown) { return; } if (!this.dragging) { this.origin = null; return; } e = Util.cloneEvent(e); const graph = this.graph; if (this.shouldEnd.call(this, e)) { this.updateViewport(e); } e.type = "dragend"; graph.emit("canvas:dragend", e); this.endDrag(); }, endDrag() { if (this.dragging) { this.origin = null; this.dragging = false; // 终止时需要判断此时是否在监听画布外的 mouseup 事件,若有则解绑 const fn = this.fn; if (fn) { body.removeEventListener("mouseup", fn, false); this.fn = null; } } }, onOutOfRange(e) { if (this.dragging) { const self = this; const canvasElement = self.graph.get("canvas").get("el"); const fn = (ev) => { if (ev.target !== canvasElement) { self.onTap(e); } }; this.fn = fn; body.addEventListener("mouseup", fn, false); } }, onKeyDown(e) { const code = e.keyCode || e.which; if (!code) { return; } if (ALLOW_EVENTS.indexOf(code) > -1) { this.keydown = true; } else { this.keydown = false; } }, onKeyUp() { this.keydown = false; }, }); ``` ## 缩放画布时不处理锁定的节点 默认情况下,F6 内置的 `zoom-canvas` 在缩放画布时候也会对锁定的节点缩放,如果缩放过程中不需要操作锁定的节点,则可以通过下面的方式来实现。 ```javascript const DELTA = 0.05; F6.registerBehavior("zoom-canvas-exclude-lockedNode", { getDefaultCfg() { return { sensitivity: 2, minZoom: 0.1, maxZoom: 10, }; }, getEvents() { return { wheel: "onWheel", }; }, onWheel(e) { e.preventDefault(); if (!this.shouldUpdate.call(this, e)) { return; } const graph = this.graph; const canvas = graph.get("canvas"); const point = canvas.getPointByClient(e.clientX, e.clientY); const sensitivity = this.get("sensitivity"); let ratio = graph.getZoom(); // 兼容 IE、Firefox 及 Chrome if (e.wheelDelta < 0) { ratio = 1 - DELTA * sensitivity; } else { ratio = 1 + DELTA * sensitivity; } const zoom = ratio * graph.getZoom(); if (zoom > this.get("maxZoom") || zoom < this.get("minZoom")) { return; } graph.zoom(ratio, { x: point.x, y: point.y }); const lockedNodes = this.graph.findAll("node", (node) => !node.hasLocked()); lockedNodes.forEach((node) => { const matrix = Util.clone(node.get("group").getMatrix()); const center = node.getModel(); matrix = Util.transform(matrix, [ ["t", -center.x, -center.y], ["s", ratio, ratio], ["t", center.x, center.y], ]); node.get("group").setMatrix(matrix); }); graph.paint(); graph.emit("wheelzoom", e); }, }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/methods/multi-line.zh.md ================================================ --- title: 两节点间存在多条边 order: 8 --- ## 问题 有如下的一份数据,如何使用 F6 让两个节点之间显示多条边? ```javascript const data = { nodes: [ { id: "node1", x: 100, y: 150, label: "node1", }, { id: "node2", x: 300, y: 150, label: "node2", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node1", }, ], }; ``` 由于默认的边形状是直线,使用直线绘制同样两个端点之间的多条边时,会出现重叠的情况。因此我们使用以下代码将边绘制为二阶贝塞尔曲线 `'quadratic'`。 ```javascript const graph = new F6.Graph({ container: GRAPH_CONTAINER, width: 500, height: 500, defaultNode: { style: { fill: "#DEE9FF", stroke: "#5B8FF9", }, labelCfg: { style: { fontSize: 12, }, }, }, defaultEdge: { type: "quadratic", // 指定边的形状为二阶贝塞尔曲线 style: { stroke: "#e2e2e2", }, }, }); graph.data(data); graph.render(); ``` 结果如下: img 如果两个节点之间需要显示 3 条、4 条甚至更多条边,该怎么做呢? 我们把数据改成下面这样试试: ```javascript const data = { nodes: [ { id: "node1", x: 100, y: 150, label: "node1", }, { id: "node2", x: 300, y: 150, label: "node2", }, ], edges: [ { source: "node1", target: "node2", }, { source: "node2", target: "node1", }, { source: "node2", target: "node1", }, ], }; ``` 结果发现并不对。 img ## 解决方案 这个时候,需要借助 F6 的 [自定义边](/zh/docs/manual/middle/elements/edges/custom-edge) 功能。 有了这个黑科技,什么样的需求,那还不是分分钟的事。 在使用「自定义边」前,需要明确两件事: - **需要有个标识来区分两个节点之间是否超过一条同方向边**; - **需要有一个值控制边的弯曲度,以防边重叠**。 因此,我们在每条边的数据中添加一个 `edgeType` 属性以区分不同的边。有了这个约定以后,就可以开始动手撸码了。 完善的自定义边的代码如下。 至此,我们实现了让两个节点之间展示多条边的功能。 ================================================ FILE: packages/site/docs/manual/middle/elements/methods/updateElement.zh.md ================================================ --- title: 更新节点或边的样式 order: 1 --- F6 提供了三种修改节点样式的方法。 #### 实例化 Graph 实例化 Graph 时,可以通过在 `defaultNode` 或 `defaultEdge` 中指定  `style` 分别配置全局节点和全局边的样式属性。 ```javascript const graph = new F6.Graph({ ... width: 1000, height: 800, defaultNode: { type: 'circle', style: { fill: '#fff', fontSize: 14, }, }, defaultEdge: { type: 'line-with-arrow', style: { fill: '#fff', fontSize: 14, }, }, }); ``` #### 数据中指定 style 这种方式可以在数据中为不同的节点和边指定不同的样式。 ```javascript const data = { nodes: [ { id: "node1", label: "node1", style: { fill: "#fff", fontSize: 12, }, }, ], }; ``` #### 使用 update / updateItem 使用 `update` / `updateItem` 更新节点或边。此方法用于动态更新节点或边的 [keyShape](/zh/docs/manual/middle/elements/shape/shape-keyshape)。 ```javascript graph.updateItem(node, { // 节点的样式 style: { stroke: "blue", }, }); ``` 想要知道节点都支持哪些属性样式,请参考 [节点样式属性](/zh/docs/manual/middle/elements/nodes/defaultNode/#样式属性-style)。 ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/anchorpoint.zh.md ================================================ --- title: 节点的连接点 anchorPoint order: 3 --- 节点的连接点 anchorPoint 指的是边连入节点的相对位置,即节点与其相关边的交点位置。anchorPoints 是一个二维数组,每一项表示一个连接点的位置,在一个[图形 Shape](/zh/docs/manual/middle/elements/shape/shape-keyshape) 中,连接点的位置如下图所示,x 和 y 方向上范围都是 [0, 1]:
img 节点中有了 anchorPoints 之后,相关边可以分别选择连入起始点、结束点的哪一个 anchorPoint。当需要在节点之间连多条线时,这种机制能够使边的连入更美观。 边可以通过指定 `sourceAnchor` 和 `targetAnchor`  分别选择起始点、结束点的 anchorPoint。`sourceAnchor` 和 `targetAnchor` 取的值是相对应节点上 anchorPoints 数组的索引值。 下面数据演示了如何在节点上配置连接点、在边上指定连接点: ```javascript const data = { nodes: [ { id: "node1", label: "node1", x: 100, y: 200, // 该节点可选的连接点集合,该点有两个可选的连接点 anchorPoints: [ [0, 1], [0.5, 1], ], type: "rect", }, { id: "node2", label: "node2", x: 300, y: 400, // 该节点可选的连接点集合,该点有两个可选的连接点 anchorPoints: [ [0.5, 0], [1, 0.5], ], type: "rect", }, ], edges: [ { source: "node1", target: "node2", // 该边连入 source 点的第 0 个 anchorPoint, sourceAnchor: 0, // 该边连入 target 点的第 0 个 anchorPoint, targetAnchor: 0, style: { endArrow: true, }, }, { source: "node2", target: "node1", // 该边连入 source 点的第 1 个 anchorPoint, sourceAnchor: 1, // 该边连入 source 点的第 1 个 anchorPoint, targetAnchor: 1, style: { endArrow: true, }, }, ], }; ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/circle.zh.md ================================================ --- title: Circle order: 1 --- F6 内置了圆  Circle 节点,其默认样式如下。标签文本位于圆形中央。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'circle'`,即可使用 `circle` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'circle', // 节点类型 // ... 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ { id: 'node0', type: 'circle', // 节点类型 ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 circle 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解:
| 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | size | 圆的直径 | Number / Array | `size` 为数组时,取第一个值 | | style | circle 默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 圆上 icon 配置 | Object | 默认不显示 icon | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'circle', label: 'circle', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'circle', // 在数据中已经指定 type,这里无需再次指定 style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { position: "bottom", offset: 10, style: { // ... 文本样式的配置 }, }, }, }); // ... ``` ### linkPoints Object 类型。可以指定节点周围「上、下、左、右」四个方向上的四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的描边颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点描边的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, fill: "#fff", size: 5, }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在节点上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ----------------------------------- | | show | 是否显示 icon | Boolean | 默认为 `false`,不显示 | | width | icon 的宽度 | Number | 默认为 `16` | | height | icon 的高度 | Number | 默认为 `16` | | img | icon 的地址或 base64 | String | 若配置则表示使用图片作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `icon`  配置项进行图标的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 icon: { show: true, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont width: 25, height: 25, }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/diamond.zh.md ================================================ --- title: Diamond order: 4 --- ## Diamond F6 内置了菱形  Diamond  节点,其默认样式如下。标签文本位于菱形中央。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'diamond'`,即可使用 `diamond` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'diamond', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'diamond', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 Diamond 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | size | 菱形的宽高 | Number / Array | size 为一个数值时,宽高相同 | | style | diamond 默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 菱形上 icon 配置 | Object | 默认不显示 icon | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'diamond', label: 'diamond', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'diamond', // 数据中已指定 type,这里无需再次指定 size: [200, 80], style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { style: { fill: "#9254de", fontSize: 18, }, position: "bottom", }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定菱形周围「上、下、左、右」四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, size: 5, fill: "#fff", }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在圆上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ----------------------------------- | | show | 是否显示 icon | Boolean | 默认为 `false`,不显示 | | width | icon 的宽度 | Number | 默认为 `16` | | height | icon 的高度 | Number | 默认为 `16` | | img | icon 的地址或 base64 | String | 若配置则表示使用图片作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | 下面代码演示在实例化图时全局配置方法中配置 `icon`。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 icon: { show: true, width: 25, height: 25, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/donut.zh.md ================================================ --- title: Donut order: 9 --- F6 内置了甜甜圈  Donut 节点,其默认样式如下。标签文本位于圆形中央,圆形周围根据给定字段的占比绘制甜甜圈统计图。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'donut'`,并为 donut 节点配置 `donutAttrs` 指定参与统计的字段(需要包含两个及以上合法字段,合法是指每个字段格式为 `[key: string]: number`),即可使用 `donut` 节点。若 `donutAttrs` 未指定,或 `donutAttrs` 中的合法字段数少于 2,则该节点将被显示为 circle 节点。甜甜圈图的颜色将会使用默认色板,若需自定义,则传入 `donutColorMap` 字段。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'donut', // 节点类型 donutAttrs: { // 甜甜圈字段,每个字段必须为 [key: string]: number prop1: 10, prop2: 20, prop3: 25, prop5: 10, prop6: 20, }, // donutColorMap: { // 甜甜圈颜色映射,字段名与 donutAttrs 中的字段名对应。不指定则使用默认色板 // prop1: '#8eaade', // prop2: '#55a9f2', // prop3: '#0d47b5' // }, // ... 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [ { id: 'node0', type: 'donut', // 节点类型 donutAttrs: { // 甜甜圈字段,每个字段必须为 [key: string]: number prop1: 10, prop2: 20, prop3: 25, prop5: 10, prop6: 20, }, // donutColorMap: { // 甜甜圈颜色映射,字段名与 donutAttrs 中的字段名对应 // prop1: '#8eaade', // prop2: '#55a9f2', // prop3: '#0d47b5' // }, ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 donut 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解:
| 名称 | 含义 | 类型 | 备注 | | ------------- | ------------------------------------ | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | size | 圆的直径 | Number / Array | `size` 为数组时,取第一个值 | | style | 背景圆的默认样式,与 circle 节点类似 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | donutAttrs | 甜甜圈统计字段 | { [key: string]: number } | donut 节点特有。必须含有两个及以上的合法字段,才能够显示出甜甜圈图 | | donutColorMap | 甜甜圈色板 | { [key: string]: string } | donut 节点特有。不指定将使用默认色板。key 与 donutAttrs 中的字段名对应 | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 圆上 icon 配置 | Object | 默认不显示 icon | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'donut', label: 'donut', donutAttrs: { prop1: 10, prop2: 20, prop3: 25, prop5: 10, prop6: 20, }, }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'donut', // 在数据中已经指定 type,这里无需再次指定 style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, donutColorMap: { // 指定色板 prop1: '#8eaade', prop2: '#55a9f2', prop3: '#0d47b5', prop5: '#7b8085', prop6: '#003870' }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { position: "bottom", offset: 10, style: { // ... 文本样式的配置 }, }, }, }); // ... ``` ### linkPoints Object 类型。可以指定节点周围「上、下、左、右」四个方向上的四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的描边颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点描边的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, fill: "#fff", size: 5, }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在节点上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ----------------------------------- | | show | 是否显示 icon | Boolean | 默认为 `false`,不显示 | | width | icon 的宽度 | Number | 默认为 `16` | | height | icon 的高度 | Number | 默认为 `16` | | img | icon 的地址或 base64 | String | 若配置则表示使用图片作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `icon`  配置项进行图标的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 icon: { show: true, //img: '...', 可更换为其他图片地址 width: 25, height: 25, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/ellipse.zh.md ================================================ --- title: Ellipse order: 3 --- F6 内置了  ellipse 节点,其默认样式如下。标签文本位于椭圆中央。 img ## 使用方法 如 [内置节点](/en/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'ellipse'`,即可使用 `ellipse` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'ellipse', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'ellipse', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 ellipse  节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | size | 椭圆的大小 | Number / Array | size 为 Number 时,效果为一个圆形。为 Array 时,size[0] 为椭圆长轴长度,size[1] 为椭圆短轴长度 | | style | 椭圆的默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 椭圆上 icon 配置 | Object | 默认不显示 icon | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'ellipse', label: 'ellipse', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'ellipse', // 在数据中已经指定 type,这里可以不用再此指定 size: [130, 80], style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置  labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { offset: 20, style: { fill: "#9254de", fontSize: 18, }, }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定节点上「上、下、左、右」四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, size: 5, fill: "#fff", }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在圆上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ----------------------------------- | | show | 是否显示 icon | Boolean | 默认为 `false`,不显示 | | width | icon 的宽度 | Number | 默认为 `16` | | height | icon 的高度 | Number | 默认为 `16` | | img | icon 的地址或 base64 | String | 若配置则表示使用图片作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `icon`  配置项进行图标的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 icon: { show: true, width: 25, height: 25, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/image.zh.md ================================================ --- title: Image order: 7 --- ## Image F6 内置了 image 节点,其默认样式如下。标签文本位于图片下方。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'image'`,即可使用 `image` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'image', label: 'AntV Team', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', img: 'https://yyb.gtimg.com/aiplat/page/product/visionimgidy/img/demo6-16a47e5d31.jpg?max_age=31536000', type: 'image', size: 200, label: 'AntV Team', labelCfg: { position: 'bottom' }, // 裁剪图片配置 clipCfg: { show: false, type: 'circle', r: 15 } }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 image 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释: ```javascript img: 'https://yyb.gtimg.com/aiplat/page/product/visionimgidy/img/demo6-16a47e5d31.jpg?max_age=31536000', size: 200, labelCfg: { position: 'bottom' }, // 裁剪图片配置 clipCfg: { show: false, type: 'circle', // circle r: 15, // ellipse rx: 10, ry: 15, // rect width: 15, height: 15, // 坐标 x: 0, y: 0 } ``` | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | ---------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------- | | **img** | **图片 URL 地址** | **String** | **image 节点特有** | | size | 图片大小 | Number | Array | `size` 为单个值时,表示宽高相等 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | 支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。 | | **clipCfg** | **裁剪图片的配置项** | **Object** | **默认不裁剪,image 节点特有** | ### 剪裁 `clipCfg` | 名称 | 含义 | 类型 | 备注 | | ------ | ------------------ | ------- | --------------------------------------------------------- | | type | 裁剪的图片形状 | String | 支持 `'circle'`、`'rect'`、`'ellipse'` | | x | 裁剪图形的 x 坐标 | Number | 默认为 0,类型为 `'circle'`、`'rect'`、`'ellipse'` 时生效 | | y | 裁剪图形的 y 坐标 | Number | 默认为 0,类型为 `'circle'`、`'rect'`、`'ellipse'` 时生效 | | show | 是否启用裁剪功能 | Boolean | 默认不裁剪,值为 `false` | | r | 剪裁圆形的半径 | Number | 剪裁 type 为  `'circle'` 时生效 | | width | 剪裁矩形的宽度 | Number | 剪裁 type 为 `'rect'` 时生效 | | height | 剪裁矩形的长度 | Number | 剪裁 type 为 `'rect'` 时生效 | | rx | 剪裁椭圆的长轴半径 | Number | 剪裁 type 为 `'ellipse'` 时生效 | | ry | 剪裁椭圆的短轴半径 | Number | 剪裁 type 为 `'ellipse'` 时生效 | 所有的裁剪类型都提供了默认值。下面代码演示在实例化图时全局配置 `clipCfg` 的最简形式: ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'image', label: 'image', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'image', // 在数据中已经指定 type,这里无需再次指定 clipCfg: { show: true, type: 'circle', }, }, }); graph.data(data); graph.render(); ``` #### 裁剪类型 ##### 圆形剪裁 `circle` 当剪裁配置 `clipCfg` 中的裁剪类型 `type` 为 `'circle'` 时,如下配置可以得到下图效果: ```javascript clipCfg: { show: true, type: 'circle', r: 100 } ``` img ##### 矩形剪裁 `rect` 当剪裁配置 `clipCfg` 中的裁剪类型 `type` 为 `'rect'` 时,如下配置可以得到下图效果: ```javascript clipCfg: { show: true, type: 'rect', x: -50, y: -50, width: 100, height: 100 } ``` img ##### 椭圆剪裁 `ellipse` 当剪裁配置 `clipCfg` 中的裁剪类型 `type` 为 `'ellipse'` 时,如下配置可以得到下图效果: ```javascript clipCfg: { show: true, type: 'ellipse', rx: 100, ry: 60 } ``` img ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/modelRect.zh.md ================================================ --- title: ModelRect order: 8 --- F6 内置了方形卡片 modelRect  节点,其默认样式如下。标签文本位于卡片下方。
img img
**提示:**数据中无 `description` 字段时,则不显示描述信息。 ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'modelRect'`,即可使用 `modelRect` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'modelRect', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'modelRect', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 modelRect 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ------------------ | ------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | --- | | size | 卡片的大小 | Number | Array | | | style | 卡片的默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | **preRect** | **左侧的小矩形** | **Object** | **modelRect 节点特有** | | **logoIcon** | **左侧的 logo 图标** | **Object** | **modelRect 节点特有** | | **stateIcon** | **右侧的状态图标** | **Object** | **modelRect 节点特有** | | **description** | **节点主要文本下方的描述文本** | **String** | **modelRect 节点特有** | | **descriptionCfg** | **描述文本的配置项** | **Object** | **modelRect 节点特有** | ```javascript // 节点中 icon 配置 logoIcon: { // 是否显示 icon,值为 false 则不渲染 icon show: true, x: 0, y: 0, // icon 的地址,字符串类型 img: 'https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg', width: 16, height: 16, // 用于调整图标的左右位置 offset: 0 }, // 节点中表示状态的 icon 配置 stateIcon: { // 是否显示 icon,值为 false 则不渲染 icon show: true, x: 0, y: 0, // icon 的地址,字符串类型 img: 'https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg', width: 16, height: 16, // 用于调整图标的左右位置 offset: -5 } ``` ### 样式属性  style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'modelRect', label: 'modelRect', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'modelRect', // 在数据中已经指定 type,这里无需再次指定 size: [200, 80], style: { fill: '#f0f5ff', stroke: '#adc6ff', lineWidth: 2, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { style: { fill: "#9254de", fontSize: 18, }, }, }, }); // ... ``` ### 描述文本配置  descriptionCfg Object 类型。通过 `descriptionCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。此外,还有一个特殊属性: | 名称 | 含义 | 类型 | 备注 | | ---------- | -------------------------- | ------ | ---------- | | paddingTop | 距离上方标签文本的垂直距离 | Number | 默认为 `0` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `descriptionCfg`  配置项进行描述文本的配置。 ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 descriptionCfg: { style: { fill: "#f00", }, }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定 modelRect 周围「上、下、左、右」四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 1 | 基于上面 [样式属性 style](#819eF) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, size: 5, fill: "#fff", }, }, }); // ... ``` ### 左侧矩形 preRect 通过 `preRect` 可以配置左侧的小矩形形状。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ------------------- | | show | 是否显示左侧小矩形 | Boolean | 默认为 `true` | | width | 左侧小矩形的宽度 | Number | 默认为 4 | | fill | 左侧小矩形的填充色 | String | 默认为  `'#40a9ff'` | | radius | 左侧小矩形的圆角弧度 | Number | 默认为 2 | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `preRect`  配置项进行左侧小矩形的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 preRect: { // 设置为 false,则不显示 show: true, fill: "#f759ab", width: 8, }, }, }); // ... ``` ### 图标 logoIcon / stateIcon 通过 `logoIcon` 和 `stateIcon` 可以配置左侧的 logo 小图标和右边的状态小图标,这两个的配置项完全相同。 | 名称 | 含义 | 类型 | 备注 | | ------ | ---------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | show | 是否显示图标 | Boolean | 默认为 `true` | | img | 图标图片 | String |
- 左侧图标 `logoIcon` 的图片默认为  img
- 右侧图标 `stateIcon` 的图片默认为 img
| | width | 图标的宽度 | Number | 默认为 16 | | height | 图标的高度 | Number | 默认为 16 | | offset | 图标的左右偏移量 | Number |
- 左侧图标 `logoIcon` 的 `offset` 默认为 0
- 右侧图标 `stateIcon` 的 `offset`  默认为 -5
| 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `logoIcon` 和 `stateIcon` 配置项进行左右图标的配置,使之达到如下图效果,左侧图标不显示,右侧图标更换图片。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 logoIcon: { show: false, }, stateIcon: { show: true, img: "https://gw.alipayobjects.com/zos/basement_prod/c781088a-c635-452a-940c-0173663456d4.svg", }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/rect.zh.md ================================================ --- title: Rect order: 2 --- F6 内置了 rect 节点,其默认样式如下。标签文本位于矩形中央。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'rect'`,即可使用 `rect` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'rect', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'rect', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] }; ``` ## 配置项说明 rect 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释。对于 Object 类型的配置项将在后面有详细讲解: | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | | size | rect 的宽高 | Number | Array | `size` 为数组时:第一个值表示宽度,第二个表示高度;
`size` 为一个数值时:表示宽高相等 | | style | rect 默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 只对 `keyShape` 起作用 | | linkPoints | **视觉上的**四个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改 `rect` 的填充色、边框颜色、阴影等属性。 | 名称 | 含义 | 类型 | 备注 | | ----------- | -------- | ------ | -------------- | | radius | 圆角半径 | Number | 默认为直角矩形 | | stroke | 描边颜色 | String | | | lineWidth | 描边粗细 | Number | 默认为 `1` | | fill | 填充色 | String | | | fillOpacity | 透明度 | Number | 默认为 `1` | 下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'rect', label: 'rect', }, ], }; const graph = new F6.Graph({ ... width: 500, height: 300, defaultNode: { // type: 'rect', // 在数据中已经指定了 type,这里无需再次指定 style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, radius: 10, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultNode: { // ... 其他配置 labelCfg: { style: { fill: "#9254de", fontSize: 18, }, position: "bottom", }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定矩形周围「上、下、左、右」四个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | bottom | 是否显示底部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他配置 defaultNode: { // 其他配置 linkPoints: { top: true, bottom: true, left: true, right: true, size: 5, fill: "#fff", }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/star.zh.md ================================================ --- title: Star order: 6 --- F6 内置了星形  star 节点,其默认样式如下。标签文本位于星形中央。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'star'`,即可使用 `star` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'star', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'star', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 star 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释: | 名称 | 含义 | 类型 | 备注 | | ----------- | -------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------- | | size | 五角星的大小 | number | Array | size 表示外环的大小 | | **innerR** | **五角星内环大小** | **Number** | **默认为 size \* 3 / 8** | | style | 五角星的默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**五个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 五角星上 icon 配置 | Object | 默认不显示 icon | ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'star', label: 'star', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'star', // 在数据中已经指定 type,这里无需再次指定 size: 80, style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置  labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { style: { fill: "#9254de", fontSize: 18, }, }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定圆周围「上、左下、➡ 右下、左、右」五个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------------- | ------------------------ | ----------- | ----------------------------- | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | **leftBottom** | **是否显示左底部的圆点** | **Boolean** | **默认为 `false`,star 特有** | | **rightBottom** | **是否显示右底部的圆点** | **Boolean** | **默认为 `false`,star 特有** | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 3 | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 linkPoints: { top: true, left: true, right: true, leftBottom: true, rightBottom: true, size: 5, fill: "#fff", }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在圆上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ------ | -------------------- | ------- | ----------------------------------- | | show | 是否显示 icon | Boolean | 默认为 false,不显示 | | width | icon 的宽度 | Number | 默认为 16 | | height | icon 的高度 | Number | 默认为 16 | | img | icon 的地址或 base64 | String | 若配置则表示使用图片作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `icon`  配置项进行图标的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 icon: { show: true, width: 25, height: 25, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/built-in/triangle.zh.md ================================================ --- title: Triangle order: 5 --- ## Triangle F6 内置了三角形  Triangle 节点,其默认样式如下。标签文本位于三角形下方。
img ## 使用方法 如 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 一节所示,配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 1 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 指定 `type` 为 `'triangle'`,即可使用 `triangle` 节点。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'triangle', // 其他配置 }, }); ``` ### 2 在数据中动态配置 如果需要使不同节点有不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', type: 'triangle', ... // 其他配置 }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ## 配置项说明 triangle 节点支持 [节点通用配置](/zh/docs/manual/middle/elements/nodes/defaultNode#节点的通用属性),下表对部分属性进行解释: | 名称 | 含义 | 类型 | 备注 | | ------------- | -------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------- | | size | 三角形的边长 | Number | Array | size 为数组时取第一个值 | | **direction** | **三角形的方向** | **String** | **可取值:`'up'`,`'down'`,`'left'`,`'right'`。默认为 `'up'`** | | style | 三角形默认样式 | Object | Canvas 支持的属性 | | label | 标签文本内容 | String | | | labelCfg | 标签文本配置项 | Object | | | stateStyles | 各状态下的样式 | Object | 详见[配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) | | linkPoints | **视觉上的**三个锚点 | Object | 默认不显示,应与 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint) 配合使用。二者区别请看 [linkPoints](#linkpoints) | | icon | 三角形上 icon 配置 | Object | 默认不显示 icon | ### 三角形方向 direction String 类型。可取值有:`'``up'`、`'down'`、`'left'`、`'right'`。默认为  `'``up'`。通过设置 `direction`,可以修改三角形的方向。下面代码演示在实例化图时全局配置方法中配置 `direction`。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'triangle', direction: 'down', }, }); ``` img img img img > 上图分别是将 `direction` 配置为 `'up'`,`'down'`,`'left'`,`'right'` 的结果 ### 样式属性 style Object 类型。支持 [节点通用样式](/zh/docs/manual/middle/elements/nodes/defaultNode#样式属性-style)。通过 `style` 配置来修改节点的填充色、描边等属性。下面代码演示在实例化图时全局配置方法中配置 `style`,使之达到如下图效果。
img ```javascript const data = { nodes: [ { x: 100, y: 100, type: 'triangle', label: 'triangle', }, ], }; const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // type: 'triangle', // 在数据中已经指定 type,这里无需再次指定 direction: 'up', size: 100, style: { fill: '#bae637', stroke: '#eaff8f', lineWidth: 5, }, }, }); graph.data(data); graph.render(); ``` ### 标签文本配置 labelCfg Object 类型。通过 `labelCfg` 配置标签文本。支持 [节点通用标签配置](/zh/docs/manual/middle/elements/nodes/defaultNode/#标签文本-label-及其配置-labelcfg)。基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `labelCfg`  配置项进行文本的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 节点其他属性 labelCfg: { position: "center", style: { fill: "#9254de", fontSize: 18, }, }, }, }); // ... ``` ### linkPoints Object 类型。通过配置 `linkPoints` ,可以指定节点上「上、左、右」三个小圆点。 ⚠️ 注意: 区分于 `anchorPoints`: `anchorPoints` 是真正用于指定该节点相关边的连入位置的「**数组**」,见 [anchorPoints](/zh/docs/manual/middle/elements/nodes/anchorpoint);而 `linkPoints` 仅是指定是否「**绘制**」出四个圆点,不起实际的连接相关边的作用。二者常常配合使用。 | 名称 | 含义 | 类型 | 备注 | | --------- | ------------------ | ------- | ------------------ | | top | 是否显示上部的圆点 | Boolean | 默认为 `false` | | left | 是否显示左侧的圆点 | Boolean | 默认为 `false` | | right | 是否显示右侧的圆点 | Boolean | 默认为 `false` | | size | 圆点的大小 | Number | 默认为 `3` | | fill | 圆点的填充色 | String | 默认为 `'#72CC4A'` | | stroke | 圆点的边框颜色 | String | 默认为 `'#72CC4A'` | | lineWidth | 圆点边框的宽度 | Number | 默认为 `1` | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了  `linkPoints`  配置项进行连入点的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 linkPoints: { top: true, bottom: true, left: true, right: true, fill: "#fff", size: 5, }, }, }); // ... ``` ### 图标  icon Object 类型。通过配置 `icon`,可以在圆上显示小图标。 | 名称 | 含义 | 类型 | 备注 | | ---------- | -------------------- | ---------- | --------------------------------------------- | | show | 是否显示 icon | Boolean | 默认为 false,不显示 | | width | icon 的宽度 | Number | 默认为 16 | | height | icon 的高度 | Number | 默认为 16 | | img | icon 的地址或 base64 | String | 若配置则表示使用 iconfont 作为 icon | | text | icon 的 iconfont | String | 若配置则表示使用 iconfont 作为 icon | | **offset** | **icon 的偏移量** | **Number** | **默认为 0,triangle 节点的 icon 特有的配置** | 基于上面 [样式属性 style](#样式属性-style) 中的代码,下面代码在 `defaultNode` 中增加了 `icon`  配置项进行图标的配置,使之达到如下图效果。
img ```javascript const data = { // ... data 内容 }; const graph = new F6.Graph({ // ... 图的其他属性 defaultNode: { // ... 其他属性 icon: { show: true, width: 30, height: 30, offset: 20, // img: '...', 可更换为其他图片地址 // text: '...', 使用 iconfont }, }, }); // ... ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/custom-node.zh.md ================================================ --- title: 自定义节点 order: 2 --- F6 提供了一系列[内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode),包括 [circle](/zh/docs/manual/middle/elements/nodes/built-in/circle)、[rect](/zh/docs/manual/middle/elements/nodes/built-in/rect)、[diamond](/zh/docs/manual/middle/elements/nodes/built-in/diamond)、[triangle](/zh/docs/manual/middle/elements/nodes/built-in/triangle)、[star](/zh/docs/manual/middle/elements/nodes/built-in/star)、[image](/zh/docs/manual/middle/elements/nodes/built-in/image)、[modelRect](/zh/docs/manual/middle/elements/nodes/built-in/modelRect)。若内置节点无法满足需求,用户还可以通过 `F6.registerNode(typeName: string, nodeDefinition: object, extendedTypeName?: string)` 进行自定义节点,方便用户开发更加定制化的节点,包括含有复杂图形的节点、复杂交互的节点、带有动画的节点等。其参数: - `typeName`:该新节点类型名称; - `extendedTypeName`:被继承的节点类型,可以是内置节点类型名,也可以是其他自定义节点的类型名。`extendedTypeName` 未指定时代表不继承其他类型的节点; - `nodeDefinition`:该新节点类型的定义,其中必要函数详见 [自定义机制 API](/zh/docs/api/registerItem#g6registernodenodename-options-extendednodename)。当有 `extendedTypeName` 时,没被复写的函数将会继承 `extendedTypeName` 的定义。 **需要注意的是**,自定义节点/边时,若给定了 `extendedTypeName`,如 `draw`,`update`,`setState` 等必要的函数若不在 `nodeDefinition` 中进行复写,将会继承 `extendedTypeName` 中的相关定义。常见问题: - Q:节点/边更新时,没有按照在 `nodeDefinition` 中自定义实现的 `draw` 或 `drawShape` 逻辑更新。例如,有些图形没有被更新,增加了没有在 `draw` 或 `drawShape` 方法中定义的图形等。 - A:由于继承了 `extendedTypeName`,且在 `nodeDefinition` 中没有复写 `update` 方法,导致节点/边更新时执行了 `extendedTypeName` 中的 `update` 方法,从而与自定义的 `draw` 或 `drawShape` 有出入。可以通过复写 `update` 方法为 `undefined` 解决。当 `update` 方法为 `undefined` 时,节点/边的更新将会执行 `draw` 或 `drawShape` 进行重绘。 在本章中我们会通过五个案例,从简单到复杂讲解节点的自定义。这五个案例是:
1. 从无到有的定义节点:绘制图形;优化性能。
2. 扩展现有的节点:附加图形;增加动画。
3. 调整节点的锚点;
4. 调整节点的选中样式:样式变化响应;动画响应;
5. 使用 DOM 自定义节点。 通过 [图形 Shape](/zh/docs/manual/middle/elements/shape/shape-keyshape) 章节的学习,我们应该已经知道了自定义节点时需要满足以下两点: - 控制节点的生命周期; - 解析用户输入的数据,在图形上展示。 F6 中自定义节点的 API 如下: ```javascript F6.registerNode( "nodeName", { options: { style: {}, stateStyles: { hover: {}, selected: {}, }, }, /** * 绘制节点,包含文本 * @param {Object} cfg 节点的配置项 * @param {G.Group} group 图形分组,节点中图形对象的容器 * @return {G.Shape} 返回一个绘制的图形作为 keyShape,通过 node.get('keyShape') 可以获取。 * 关于 keyShape 可参考文档 核心概念-节点/边/Combo-图形 Shape 与 keyShape */ draw(cfg, group) {}, /** * 绘制后的附加操作,默认没有任何操作 * @param {Object} cfg 节点的配置项 * @param {G.Group} group 图形分组,节点中图形对象的容器 */ afterDraw(cfg, group) {}, /** * 更新节点,包含文本 * @override * @param {Object} cfg 节点的配置项 * @param {Node} node 节点 */ update(cfg, node) {}, /** * 更新节点后的操作,一般同 afterDraw 配合使用 * @override * @param {Object} cfg 节点的配置项 * @param {Node} node 节点 */ afterUpdate(cfg, node) {}, /** * 响应节点的状态变化。 * 在需要使用动画来响应状态变化时需要被复写,其他样式的响应参见下文提及的 [配置状态样式] 文档 * @param {String} name 状态名称 * @param {Object} value 状态值 * @param {Node} node 节点 */ setState(name, value, node) {}, /** * 获取锚点(相关边的连入点) * @param {Object} cfg 节点的配置项 * @return {Array|null} 锚点(相关边的连入点)的数组,如果为 null,则没有控制点 */ getAnchorPoints(cfg) {}, }, // 继承内置节点类型的名字,例如基类 'single-node',或 'circle', 'rect' 等 // 当不指定该参数则代表不继承任何内置节点类型 extendedNodeName, ); ```   ⚠️ 注意: - 如果不从任何现有的节点或从 `'single-node'` 扩展新节点时,`draw` 方法是必须的; - 节点内部所有图形**使用相对于节点自身的坐标系**,即 `(0, 0)` 是该节点的中心。而节点的坐标是相对于画布的,由该节点 group 上的矩阵控制,自定义节点中不需要用户感知。若在自定义节点内增加 `rect` 图形,要注意让它的 x 与 y 各减去其长与宽的一半。详见例子 [从无到有定义节点](#1-从无到有定义节点); - `update` 方法可以不定义: - 当 `update` 未定义:若指定了 `registerNode` 的第三个参数 `extendedNodeName`(即代表继承指定的内置节点类型),则节点更新时将执行被继承的内置节点类型的 `update` 逻辑;若未指定 `registerNode` 的第三个参数,则节点更新时会执行 `draw` 方法,所有图形清除重绘; - 当定义了 `update` 方法,则不论是否指定 `registerNode` 的第三个参数,在节点更新时都会执行复写的 `update` 函数逻辑。 - `afterDraw`,`afterUpdate` 方法一般用于扩展已有的节点,例如:在矩形节点上附加图片,圆节点增加动画等; - `setState` 只有在需要使用动画的方式来响应状态变化时需要复写,一般的样式响应状态变化可以通过 [配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式) 实现; - `getAnchorPoints` 方法仅在需要限制与边的连接点时才需要复写,也可以在数据中直接指定。 ## 1. 从无到有定义节点 ### 绘制图形 我们自己来实现一个菱形的节点,如下图所示。 > F6 有内置的菱形节点 diamond。为了演示,这里实现了一个自定义的菱形,相当于复写了内置的 diamond。 img   ⚠️ 注意: 从下面代码可以看出,自定义节点中所有通过 `addShape` 增加的图形的坐标都是**相对于节点自身的子坐标系**,即 `(0, 0)` 是该节点的中心。如 `'text'` 图形的 `x` 和 `y` 均为 0,代表该图形相对于该节点居中;`'path'` 图形 `path` 属性中的坐标也是以 `(0, 0)` 为原点计算的。换句话说,在**自定义节点时不需要感知相对于画布的节点坐标**,节点坐标由该节点所在 group 的矩阵控制。 ```javascript F6.registerNode("diamond", { draw(cfg, group) { // 如果 cfg 中定义了 style 需要同这里的属性进行融合 const keyShape = group.addShape("path", { attrs: { path: this.getPath(cfg), // 根据配置获取路径 stroke: cfg.color, // 颜色应用到描边上,如果应用到填充,则使用 fill: cfg.color }, // must be assigned in F6. it can be any value you want name: "path-shape", // 设置 draggable 以允许响应图拽事件 draggable: true, }); if (cfg.label) { // 如果有文本 // 如果需要复杂的文本配置项,可以通过 labeCfg 传入 // const style = (cfg.labelCfg && cfg.labelCfg.style) || {}; // style.text = cfg.label; const label = group.addShape("text", { // attrs: style attrs: { x: 0, // 居中 y: 0, textAlign: "center", textBaseline: "middle", text: cfg.label, fill: "#666", }, // must be assigned in F6. it can be any value you want name: "text-shape", // 设置 draggable 以允许响应图拽事件 draggable: true, }); } return keyShape; }, // 返回菱形的路径 getPath(cfg) { const size = cfg.size || [40, 40]; // 如果没有 size 时的默认大小 const width = size[0]; const height = size[1]; // / 1 \ // 4 2 // \ 3 / const path = [ ["M", 0, 0 - height / 2], // 上部顶点 ["L", width / 2, 0], // 右侧顶点 ["L", 0, height / 2], // 下部顶点 ["L", -width / 2, 0], // 左侧顶点 ["Z"], // 封闭 ]; return path; }, }); ``` 上面的代码自定义了一个菱形节点。值得注意的是,F6 需要用户为自定义节点中的图形设置 `name` 和 `draggable`。其中,`name` 可以是不唯一的任意值。`draggable` 为 `true` 是表示允许该图形响应拖拽事件,只有 `draggable: true` 时,图上的交互行为 `'drag-node'` 才能在该图形上生效。若上面代码仅在 keyShape 上设置了 `draggable: true`,而 label 图形上没有设置,则鼠标拖拽只能在 keyShape 上响应。 现在,我们使用下面的数据输入就会绘制出 diamond 这个节点。 ```javascript const data = { nodes: [ { id: 'node1', x: 50, y: 100, type: 'diamond' }, // 最简单的 { id: 'node2', x: 150, y: 100, type: 'diamond', size: [50, 100] }, // 添加宽高 { id: 'node3', x: 250, y: 100, color: 'red', type: 'diamond' }, // 添加颜色 { id: 'node4', x: 350, y: 100, label: '菱形', type: 'diamond' }, // 附加文本 ], }; const graph = new F6.Graph({ ... width: 500, height: 500, }); graph.data(data); graph.render(); ``` img ### 优化性能 当图中节点或边通过  `graph.update(item, cfg)` 重绘时,默认情况下会调用节点的 `draw` 方法进行重新绘制。在数据量大或节点上图形数量非常多(特别是文本多)的情况下,`draw` 方法中对所有图形、赋予样式将会非常消耗性能。 在自定义节点时,重写  `update` 方法,在更新时将会调用该方法替代 `draw`。我们可以在该方法中指定需要更新的图形,从而避免频繁调用  `draw` 、全量更新节点上的所有图形。当然,`update` 方法是可选的,如果没有性能优化的需求可以不重写该方法。 在实现 diamond 的过程中,重写  `update` 方法,找到需要更新的 shape 进行更新,从而优化性能。寻找需要更新的图形可以通过: - `group.get('children')[0]` 找到 [关键图形  keyShape](/zh/docs/manual/middle/elements/shape/shape-keyshape#keyshape),也就是 `draw` 方法返回的 shape; - `group.get('children')[1]` 找到 label 图形。 下面代码仅更新了 diamond 的关键图形的路径和颜色。 ```javascript F6.registerNode("diamond", { draw(cfg, group) { // ... // 见前面代码 }, getPath(cfg) { // ... // 见前面代码 }, update(cfg, node) { const group = node.getContainer(); // 获取容器 const shape = group.get("children")[0]; // 按照添加的顺序 const style = { path: this.getPath(cfg), stroke: cfg.color, }; shape.attr(style); // 更新属性 // 更新文本的逻辑类似,但是需要考虑 cfg.label 是否存在的问题 // 通过 label.attr() 更新文本属性即可 }, }); ``` ## 2. 扩展现有节点 ### 扩展 Shape F6 中已经[内置了一些节点](/zh/docs/manual/middle/elements/nodes/defaultNode),如果用户仅仅想对现有节点进行调整,复用原有的代码,则可以基于现有的节点进行扩展。同样实现 diamond ,可以基于  circle、ellipse、rect 等内置节点的进行扩展。single-node 是这些内置节点类型的基类,也可以基于它进行扩展。(single-edge 是所有内置边类型的基类。) 下面以基于 single-node 为例进行扩展。`update`,`setState` 方法在  single-node 中都有实现,这里仅需要复写 `draw` 方法即可。返回的对象中包含自定义图形的路径和其他样式。 ```javascript F6.registerNode( "diamond", { draw(cfg, group) { const size = this.getSize(cfg); // 转换成 [width, height] 的模式 const color = cfg.color; const width = size[0]; const height = size[1]; // / 1 \ // 4 2 // \ 3 / const path = [ ["M", 0, 0 - height / 2], // 上部顶点 ["L", width / 2, 0], // 右侧顶点 ["L", 0, height / 2], // 下部顶点 ["L", -width / 2, 0], // 左侧顶点 ["Z"], // 封闭 ]; const style = F6.Util.mix( {}, { path: path, stroke: color, }, cfg.style, ); // 增加一个 path 图形作为 keyShape const keyShape = group.addShape("path", { attrs: { ...style, }, draggable: true, name: "diamond-keyShape", }); // 返回 keyShape return keyShape; }, }, // 注意这里继承了 'single-node' "single-node", ); ``` ### 添加动画 通过 `afterDraw` 同样可以实现扩展,下面我们来看一个节点的动画场景,如下图所示。
img 上面的动画效果,可以通过以下方式实现: - 扩展内置的 rect,在 rect 中添加一个图形; - 反复执行新添加图形的旋转动画。 ```javascript // 自定义一个名为 inner-animate 的节点 F6.registerNode('inner-animate', { afterDraw(cfg, group) { const size = cfg.size; const width = size[0] - 14; const height = size[1] - 14; // 添加图片 const image = group.addShape('image', { attrs: { x: - width / 2, y: - height / 2, width: width, height: height, img: cfg.img }, // must be assigned in F6. it can be any value you want name: 'image-shape' }); // 执行旋转动画 image.animate((ratio) => { const matrix = Util.mat3.create(); const toMatrix = Util.transform(matrix, [ ['r', ratio * Math.PI * 2] ]) ; return { matrix: toMatrix }; }, { repeat: true duration: 3000, easing: 'easeCubic' }); } }, // 继承了 rect 节点 'rect'); ``` 更多关于动画的实现,请参考[基础动画](/zh/docs/manual/middle/animation)章节。
## 3. 调整锚点 anchorPoint 节点上的[锚点 anchorPoint](/zh/docs/manual/middle/elements/nodes/anchorpoint) 作用是**确定节点与边的相交的位置**,看下面的场景:
img img > (左)没有设置锚点时。(右)diamond 设置了锚点后。 有两种方式来调整节点上的锚点: - 在数据里面指定 `anchorPoints`。 **适用场景:**可以为不同节点配置不同的锚点,更定制化。 - 自定义节点中通过 `getAnchorPoints` 方法指定锚点。 **适用场景:**全局配置锚点,所有该自定义节点类型的节点都相同。 ### 数据中指定锚点 ```javascript const data = { nodes: [ { id: "node1", x: 100, y: 100, anchorPoints: [ [0, 0.5], // 左侧中间 [1, 0.5], // 右侧中间 ], }, //... // 其他节点 ], edges: [ //... // 边 ], }; ``` ### 自定义时指定锚点 ```javascript F6.registerNode( "diamond", { //... // 其他方法 getAnchorPoints() { return [ [0, 0.5], // 左侧中间 [1, 0.5], // 右侧中间 ]; }, }, "rect", ); ``` ## 4. 调整状态样式 常见的交互都需要节点和边通过样式变化做出反馈,例如点击选中节点/边、通过交互激活边上的交互等,都需要改变节点和边的样式,有两种方式来实现这种效果: 1. 在数据上添加标志字段,在自定义 shape 过程中根据约定进行渲染; 2. 将交互状态同原始数据和绘制节点的逻辑分开,仅更新节点。 我们推荐用户使用第二种方式来实现节点的状态调整,可以通过以下方式来实现: - 在 F6 中自定义节点/边时在 `setState` 方法中进行节点状态变化的响应; - 通过 `graph.setItemState()` 方法来设置状态。 基于 rect 扩展出一个 custom 图形,默认填充色为白色,当点击时变成红色,实现这一效果的示例代码如下: ```javascript // 基于 rect 扩展出新的图形 F6.registerNode( "custom", { // 响应状态变化 setState(name, value, item) { const group = item.getContainer(); const shape = group.get("children")[0]; // 顺序根据 draw 时确定 if (name === "selected") { if (value) { shape.attr("fill", "red"); } else { shape.attr("fill", "white"); } } }, }, "rect", ); // 点击时选中,再点击时取消 graph.on("node:tap", (ev) => { const node = ev.item; graph.setItemState(node, "selected", !node.hasState("selected")); // 切换选中 }); ``` F6 并未限定节点的状态,只要你在 `setState` 方法中进行处理你可以实现任何交互,如实现放到节点上后节点逐渐变大的效果。
img ```javascript F6.registerNode( "custom", { // 响应状态变化 setState(name, value, item) { const group = item.getContainer(); const shape = group.get("children")[0]; // 顺序根据 draw 时确定 if (name === "running") { if (value) { shape.animate( { r: 20, }, { repeat: true, duration: 1000, }, ); } else { shape.stopAnimate(); shape.attr("r", 10); } } }, }, "circle", ); graph.on("node:tap", (ev) => { const node = ev.item; graph.setItemState(node, "running", true); }); graph.on("node:dbltap", (ev) => { const node = ev.item; graph.setItemState(node, "running", false); }); ``` ## 5. 使用 DOM 自定义节点 > 小程序不支持该特性,且仅在 Graph 的 `renderer` 为 `'svg'` 时可以使用 DOM 自定义节点。 这里,我们演示使用 DOM 自定义一个名为 `'dom-node'` 的节点。在 `draw` 方法中使用 `group.addShape` 增加一个 `'dom'` 类型的图形,并设置其 `html` 为 DOM 的 `html` 值。 img ```javascript F6.registerNode( 'dom-node', { draw: (cfg: ModelConfig, group: Group) => { return group.addShape('dom', { attrs: { width: cfg.size[0], height: cfg.size[1], // 传入 DOM 的 html html: `
img
${cfg.label}
`, }, draggable: true, }); }, }, 'single-node', ); ``` 上面的代码自定义了一个名为 `'dom-node'` 的带有 DOM 的节点。值得注意的是,F6 需要用户为自定义节点中的图形设置 `name` 和 `draggable`。其中,`name` 可以是不唯一的任意值。`draggable` 为 `true` 是表示允许该图形响应拖拽事件,只有 `draggable: true` 时,图上的交互行为 `'drag-node'` 才能在该图形上生效。 现在,我们使用下面的数据输入就会绘制出带有 `'dom-node'` 节点的图。 img ```javascript const data = { nodes: [ { id: 'node1', x: 50, y: 100 }, { id: 'node2', x: 150, y: 100 }, ], edges: [(source: 'node1'), (target: 'node2')], }; const graph = new F6.Graph({ ... width: 500, height: 500, defaultNode: { type: 'dom-node', size: [120, 40], }, }); graph.data(data); graph.render(); ``` ⚠️ 注意: F6 的节点/边事件不支持 DOM 类型的图形。如果需要为 DOM 节点绑定事件,请使用原生 DOM 事件。例如: ```javascript F6.registerNode( 'dom-node', { draw: (cfg: ModelConfig, group: Group) => { return group.addShape('dom', { attrs: { width: cfg.size[0], height: cfg.size[1], // 传入 DOM 的 html,带有原生 onclick 事件 html: `
img
${cfg.label}
`, }, draggable: true, }); }, }, 'single-node', ); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/defaultNode.zh.md ================================================ --- title: 节点总览 order: 0 --- F6 的内置节点包括 circle,rect,ellipse,diamond,triangle,star,image,modelRect,donut。这些内置节点的默认样式分别如下图所示。
img img 本文将概述 F6 中的各个内置节点类型、内置节点的通用属性、配置方法。各类型节点详细配置项及配置方法见本目录下相应文档。 ## 内置节点类型说明 下面表格中显示了内置的各类节点,同时对一些特殊的字段进行了说明: | 名称 | 描述 | 默认示例 | | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | circle | 圆形:
- `size` 是单个数字,表示直径
- 圆心位置对应节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 更多字段见 [Circle](/zh/docs/manual/middle/elements/nodes/built-in/circle) 节点教程
| img | | rect | 矩形:
- `size` 是数组,例如:[100, 50]
- 矩形的中心位置是节点的位置,而不是左上角
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 更多字段见 [Rect](/zh/docs/manual/middle/elements/nodes/built-in/rect) 节点教程
| img | | ellipse | 椭圆:
- `size` 是数组,表示椭圆的长轴直径和短轴直径
- 椭圆的圆心是节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 更多字段见 [Ellipse](/zh/docs/manual/middle/elements/nodes/built-in/ellipse) 节点教程
| img | | diamond | 菱形:
- `size` 是数组,表示菱形的宽和高
- 菱形的中心位置是节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 更多字段见 [Diamond](/zh/docs/manual/middle/elements/nodes/built-in/diamond) 节点教程
| img | | triangle | 三角形:
- `size` 是数组,表示三角形的底和高
- 三角形的中心位置是节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点下方
- 更多字段见 [Triangle](/zh/docs/manual/middle/elements/nodes/built-in/triangle) 节点教程
| img | | star | 星形:
- `size` 是单个数字,表示星形的大小
- 星星的中心位置是节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 更多字段见 [Star](/zh/docs/manual/middle/elements/nodes/built-in/star) 节点教程
| img | | image | 图片:
- `size` 是数组,表示图片的宽和高
- 图片的中心位置是节点位置
- `img` 图片的路径,也可以在 `style` 里面设置
- `color` 字段不生效
- 标签文本默认在节点下方
- 更多字段见 [Image](/zh/docs/manual/middle/elements/nodes/built-in/image) 节点教程
| img | | modelRect | 卡片:
- `size` 是数组,表示卡片的宽和高
- 卡片的中心位置是节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 若有  `description` 字段则显示在标签文本下方显示  `description` 内容
- 更多字段见 [ModelRect](/zh/docs/manual/middle/elements/nodes/built-in/modelRect) 节点教程
| img
 img | | donut | 圆形:
- `size` 是单个数字,表示直径
- 圆心位置对应节点的位置
- `color` 字段默认在描边上生效
- 标签文本默认在节点中央
- 必须指定合法的 `donutAttrs` 字段
- 更多字段见 [Donut](/zh/docs/manual/middle/elements/nodes/built-in/donut) 节点教程
| img | ## 节点的通用属性 所有内置的节点支持的通用属性: | 名称 | 是否必须 | 类型 | 备注 | | ------------ | -------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------- | | id | true | String | 节点唯一 ID,**必须**是唯一的 string | | x | false | Number | x 坐标 | | y | false | Number | y 坐标 | | type | false | String | 指定节点类型,内置节点类型名称或自定义节点的名称。默认为 `'circle'` | | size | false | Number / Array | 节点的大小 | | anchorPoints | false | Array | 指定边连入节点的连接点的位置(相对于该节点而言),可以为空。例如: `[0, 0]`,代表节点左上角的锚点,`[1, 1]`,代表节点右下角的锚点 | | style | false | Object | 节点的样式属性。 | | label | false | String | 文本文字 | | labelCfg | false | Object | 文本配置项 | ### 样式属性 style Object 类型。通过 `style` 配置来修改节点的填充色、边框颜色、阴影等属性。下表是 `style` 对象中常用的配置项: | 名称 | 是否必须 | 类型 | 备注 | | ------------- | -------- | -------- | ----------------------------- | | fill | false | String | 节点填充色 | | stroke | false | String | 节点的描边颜色 | | lineWidth | false | Number | 描边宽度 | | lineDash | false | Number[] | 描边虚线,数组代表实、虚长度 | | shadowColor | false | String | 阴影颜色 | | shadowBlur | false | Number | 阴影范围 | | shadowOffsetX | false | Number | 阴影 x 方向偏移量 | | shadowOffsetY | false | Number | 阴影 y 方向偏移量 | | opacity | false | Number | 设置绘图的当前 alpha 或透明值 | | fillOpacity | false | Number | 设置填充的 alpha 或透明值 | 下面代码演示在实例化图时全局配置方法中配置 `style`: ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // ... 其他属性 style: { fill: '#steelblue', stroke: '#eaff8f', lineWidth: 5, // ... 其他属性 }, }, }); ``` ### 标签文本 label 及其配置  labelCfg `label` String 类型。标签文本的文字内容。
`labelCfg` Object 类型。配置标签文本。下面是 `labelCfg` 对象中的常用配置项: | 名称 | 是否必须 | 类型 | 备注 | | -------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | position | false | String | 文本相对于节点的位置,目前支持的位置有:`'center'`,`'top'`,`'left'`,`'right'`,`'bottom'`。默认为 `'center'`。modelRect 节点不支持该属性 | | offset | false | Number | 文本的偏移,`position` 为 `'bottom'` 时,文本的上方偏移量;`position` 为 `'left'` 时,文本的右方偏移量;以此类推在其他 `position` 时的情况。modelRect 节点的 `offset` 为左边距 | | style | false | Object | 标签的样式属性。 | 上表中的标签的样式属性 `style` 的常用配置项如下: | 名称 | 是否必须 | 类型 | 备注 | | ----------------------------------------------------------------------------------------------------- | -------- | ------ | ------------ | | fill | false | String | 文本颜色 | | stroke | false | String | 文本描边颜色 | | lineWidth | false | Number | 文本描边粗细 | | opacity | false | Number | 文本透明度 | | fontFamily | false | String | 文本字体 | | fontSize | false | Number | 文本字体大小 | | ... 节点标签与边标签样式属性相同,统一整理在 [Text 图形 API](/zh/docs/api/shapeProperties/#文本-text) | | | | 下面代码演示在实例化图时全局配置方法中配置  `label` 和  `labelCfg`。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { // ... 其他属性 label: 'node-label', labelCfg: { position: 'bottom', offset: 10, style: { fill: '#666', }, }, }, }); ``` ## 节点的配置方法 配置节点的方式有三种:实例化图时全局配置,在数据中动态配置,使用 `graph.node(nodeFn)` 函数配置。这几种配置方法可以同时使用,优先级: 使用 `graph.node(nodeFn)` 配置 > 数据中动态配置 > 实例化图时全局配置 即有相同的配置项时,优先级高的方式将会覆盖优先级低的。 ⚠️ 注意: 除 `id`、`label` 应当配置到每个节点数据中外,其余的 [节点的通用属性](#节点的通用属性) 以及各个节点类型的特有属性(见内置节点类型)均支持这三种配置方式。 ### 实例化图时全局配置 用户在实例化 Graph 时候可以通过 `defaultNode` 配置节点,这里的配置是全局的配置,将会在所有节点上生效。 ```javascript const graph = new F6.Graph({ ... width: 800, height: 600, defaultNode: { type: 'circle', // 其他配置 }, }); ``` ### 在数据中动态配置 如果需要为不同节点进行不同的配置,可以将配置写入到节点数据中。这种配置方式可以通过下面代码的形式直接写入数据,也可以通过遍历数据的方式写入。 ```javascript const data = { nodes: [{ id: 'node0', size: 100, type: 'rect', ... // 其他属性 style: { ... // 样式属性,每种节点的详细样式属性参见各节点文档 } },{ id: 'node1', size: [50, 100], type: 'ellipse', ... // 其他属性 style: { ... // 样式属性,每种节点的详细样式属性参见各节点文档 } }, ... // 其他节点 ], edges: [ ... // 边 ] } ``` ### 使用 graph.node() 该方法可以为不同节点进行不同的配置。
**提示:** - 该方法必须**在 render 之前调用**,否则不起作用; - 由于该方法优先级最高,将覆盖其他地方对节点的配置,这可能将造成一些其他配置不生效的疑惑; - 该方法在增加元素、更新元素时会被调用,如果数据量大、每个节点上需要更新的内容多时,可能会有性能问题。 ```javascript // const data = ... // const graph = ... graph.node((node) => { return { id: node.id, type: "rect", style: { fill: "blue", }, }; }); graph.data(data); graph.render(); ``` ## 示例 ```javascript const data = { nodes: [ { id: 'node_circle', x: 100, y: 100, type: 'circle', label: 'circle', }, { id: 'node_rect', x: 200, y: 100, type: 'rect', label: 'rect', }, { id: 'node-ellipse', x: 330, y: 100, type: 'ellipse', label: 'ellipse', }, { id: 'node-diamond', x: 460, y: 100, type: 'diamond', label: 'diamond', }, { id: 'node-triangle', x: 560, y: 100, //size: 80, type: 'triangle', label: 'triangle', }, { id: 'node-star', x: 660, y: 100, //size: [60, 30], type: 'star', label: 'star', }, { id: 'node-image', x: 760, y: 100, size: 50, type: 'image', img: 'https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg', label: 'image', }, { id: 'node-modelRect', x: 900, y: 100, type: 'modelRect', label: 'modelRect', }, ], }; const graph = new F6.Graph({ ... width: 1500, height: 300, }); graph.data(data); graph.render(); ``` 显示结果:
img - triangle 节点和 image 节点的标签文本默认位置为:`position:'bottom'` ,其他节点文本的默认位置都为:`position: 'center'`; ### 调整节点配置 下面演示通过将配置写入数据的方式,调整 `id` 为 `'node-ellipse'` 的椭圆节点的文本位置,颜色和样式。将下面代码替换上面代码中 `id` 为  `'node-ellipse'` 的节点数据即可生效。 ``` { id: 'node-ellipse', x: 330, y: 100, type: 'ellipse', size: [60, 30], label: 'ellipse', labelCfg: { position: 'bottom', offset: 5 }, style: { fill: '#fa8c16', stroke: '#000', lineWidth: 2 } } ``` img 再为  `id` 为 `'node-modelRect'` 的 modelRect 节点添加描述文字,使用下面代码替换  `id` 为  `'node-modelRect'` 的节点数据即可得到带有内容为 '描述文本 xxxxxxxxxxx' 的 modelRect 节点。 ``` { id: 'node-modelRect', x: 900, y: 100, description: '描述文本xxxxxxxxxxx', type: 'modelRect', label: 'modelRect' } ``` img ## 相关阅读 - [状态 State](/zh/docs/manual/middle/states/state) —— 交互过程中的样式变化。 ================================================ FILE: packages/site/docs/manual/middle/elements/nodes/jsx-node.zh.md ================================================ --- title: 使用类 JSX 语法定义 F6 节点 order: 4 --- ⚠️ 注意: 小程序不支持 用户以使用类似 JSX 的语法来定义节点。只需要在使用 F6.registerNode 自定义节点时,将第二个参数设置为字符串或一个返回值为 `string` 的 `function`。 #### 基础语法 ``` <[group|shape] [key]="value" style={{ [key]: value }}> <[more tag] /> ... value ``` 基础语法和大家熟悉的 HTML 标记语言基本相同,通过标签名来使用 shape 或者 group,同时定义 shape 需要填写 shape 的各个 attributes,而定义形状样式的 attrs 则由 style 属性来进行表达。style 里面的结构是一个 Object,对象的值可以是字符串,数字等 JSON 支持的数据类型(注意,这里不能够是函数,函数只会导致解析错误)。 自定义节点的类型和 style 参考:https://f6.antv.vision/zh/docs/api/shapeProperties 其中,为了相对定位,我们新加入了 marginTop 和 marginLeft 来定义左边和上面的间隔。 #### 推荐用法 - 在最外层包裹 `group` 标签,保证节点里面图形树结构完整 - 字符串最好使用单引号包裹,以免遇到解析错误 - `style` 中随 node 变化的变量推荐使用 \${} 的模板语法加入 - 图形内的相对定位推荐使用 `marginTop` 和 `marginLeft` 进行设置,`x` 与 `y` 会破坏层级关系定位 - 如果涉及到需要横向排列的元素,在上一个元素使用`next: inline`来实现下一个元素跟随在上个元素后方 #### 支持的标签 使用类 JSX 语法来定义 F6 节点时,支持使用以下的标签: - `` - `` - `` - `` - `` - `` - `` - `` - `` - `` 使用标签的形式来定义节点,所有的样式属性都写到 style 里面,name、keyShape 等和 style 同级,所支持的属性和 addShape 中完全一致。 **特别说明**:使用类 HTML 语法定义节点时,style 里面属性不支持 function,因此使用类 HTML 语法定义节点时,目前不支持 marker 标签。 #### 案例 我们先来看一下,使用类 JSX 语法来定义一个简单的矩形。 ```javascript F6.registerNode( "rect-xml", (cfg) => ` ${cfg.label || cfg.id} `, ); ``` 我们再来看一个稍微复杂的案例。 ```javascript const percentageBar = ({ width, used, height = 12 }) => ` `; const textXML = (cfg) => ` ${cfg.id} ${FULL} ${ cfg.metric }: ${cfg.cpuUsage}% ${percentageBar({ width: 80, used: cfg.cpuUsage })} `; F6.registerNode("test", { jsx: textXML, }); ``` 效果如下图所示: ================================================ FILE: packages/site/docs/manual/middle/elements/overview.zh.md ================================================ --- title: 图元素总览 order: 0 --- 图的元素(Item)包含图上的节点 Node 、边 Edge 和 Combo 三大类。每个图元素由一个或多个 [图形(Shape)](/zh/docs/manual/middle/elements/shape/shape-keyshape) 组成,且都会有自己的唯一关键图形(keyShape)。F6 内置了一系列具有不同基本图形样式的节点/边/ Combo,例如,节点可以是圆形、矩形、图片等。F6 中所有内置的元素样式详见 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode),[内置边](/zh/docs/manual/middle/elements/edges/defaultEdge),[内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo)。除了使用内置的节点/边/ Combo 外,F6 还允许用户通过自己搭配和组合 shape 进行节点/边/ Combo 的自定义,详见 [自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node),[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge),[自定义 Combo](/zh/docs/manual/middle/elements/combos/custom-combo)。 图元素具有公共的通用属性和通用方法。图元素的属性包括: - 样式属性,通过 `style` 字段对象进行配置,和元素的关键图形相关,例如 `fill`,`stroke`。可在[元素状态](/zh/docs/manual/middle/states/state)改变时被改变。 - 其他属性,例如 `id`、`type`,不能在元素状态改变是进行改变,可通过 [graph.updateItem](/zh/docs/api/graphFunc/item#graphupdateitemitem-model-stack) 进行手动更新。完整的元素属性列表参考:[元素配置项](/zh/docs/api/Items/itemProperties)。除了各类元素共有的通用属性外,每种节点/边/ Combo 都有各自的特有属性。 图元素实例上具有对元素进行更新、销毁、获取属性、修改状态等[通用方法](/zh/docs/api/Items/itemMethods),同时,对于实例的变更也可以通过调用 [graph](/zh/docs/api/Graph) 上的方法进行。 本章对三大类图元素的通用属性和方法进行了概览性介绍,每种图元素(节点/边/ Combo)各自的属性和使用方法将在后面章节中详述。 ================================================ FILE: packages/site/docs/manual/middle/elements/shape/graphics-group.zh.md ================================================ --- title: 图形分组 Group order: 2 ---   ⚠️ 注意:
图形分组 Group 与 [节点分组 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo) 属于不同层次的概念。 - 图形分组针对 [图形 Shape](/zh/docs/manual/middle/elements/shape/shape-keyshape) 层次的分组; - [节点分组 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo)  是针对 [节点](/zh/docs/manual/middle/elements/nodes/defaultNode) 的分组,与数据结构中的层次、分组对应。
## 什么是图形分组 Group 图形分组 group 类似于 SVG 中的 `` 标签:元素  `g`  是用来组合图形对象的容器。在 group  上添加变换(例如剪裁、旋转、放缩、平移等)会应用到其所有的子元素上。在 group  上添加属性(例如颜色、位置等)会被其所有的子元素继承。此外, group 可以多层嵌套使用,因此可以用来定义复杂的对象。 在 F6 中,Graph 的一个实例中的所有节点属于同一个变量名为 `nodeGroup` 的 group,所有的边属于同一个变量名为 `edgeGroup` 的 group。节点 group 在视觉上的层级(zIndex)高于边 group,即所有节点会绘制在所有边的上层。
如下图(左)三个节点属于  `nodeGroup` ,两条边属于 `edgeGroup` , `nodeGroup`  层级高于 `edgeGroup` ,三个节点绘制在两条边的上层。下图(右)是(左)图的节点降低透明度后的效果,可以更清晰看到边绘制在节点下方。
![image.png](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*oqKUSoRWMrcAAAAAAAAAAABkARQnAQ)![image.png](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cudnTqD-g_4AAAAAAAAAAABkARQnAQ) > (左)节点和边的图形分组 Group 演示。(右)给左图的节点降低了透明度。 ## 何时使用图形分组 Group [自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node)、[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge)时将会涉及到图形分组 Group 的概念。图形分组 Group 方便了用户对节点或边上元素的组合和管理。
例如,如下图中的节点 A 有一个包含节点 A 中所有图形的 group,该 group 中包含了一个 circle 图形和一个文本图形。节点 B 是一个自定义节点,有一个包含节点 B 中所有图形的 group,该 group 包含了 circle 图形、rect 图形、文本图形。
img img
## 如何使用图形分组 Group 图形分组一般会在[自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node)、[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge)时用到。Group 的完整实例方法请参考 [Graphics Group API](/zh/docs/api/Group)。 ### 获取元素的 group ```javascript // 获取元素(节点/边/Combo)的图形对象的容器 const group = item.getContainer(); // 等价于 const group = item.get("group"); ``` ### 实例方法 - addGroup(cfgs) 向分组中添加新的分组。 ```javascript const subGroup = group.addGroup({ id: "rect", }); ``` - addShape(type, cfgs) 向分组中添加新的图形。 ```javascript const keyShape = group.addShape("rect", { attrs: { stroke: "red", }, // must be assigned in F6. it can be any value you want name: "rect-shape", }); ``` 提示:在分组上添加的 `clip`, `transform` 等会影响到该分组中的所有元素(子分组或图形)。 ================================================ FILE: packages/site/docs/manual/middle/elements/shape/shape-and-properties.zh.md ================================================ --- title: 图形 Shape 及其属性 order: 1 --- F6 中的元素(节点/边)是**由一个或多个**[**图形 Shape**](/zh/docs/manual/middle/elements/shape/shape-keyshape) **组成**,主要通过自定义节点或自定义边时在 `draw` 方法中使用 `group.addShape` 添加,F6 中支持以下的图形 Shape: - [circle](#圆图形-circle):圆; - [rect](#矩形图形-rect):矩形; - [ellipse](#椭圆图形-ellipse):椭圆; - [polygon](#多边形图形-polygon):多边形; - [fan](#扇形图形-fan):扇形; - [image](#图片图形-image):图片; - [marker](#标记图形-marker):标记; - [path](#路径-path):路径; - [text](#文本-text):文本; - [dom(svg)](#dom-svg):DOM(图渲染方式 `renderer` 为 `'svg'` 时可用)。 ## 各图形 Shape 的通用属性 | 属性名 | 含义 | 备注 | | ------------- | ---------------------------------- | ------------------------------ | | fill | 设置用于填充绘画的颜色、渐变或模式 | 对应 Canvas 属性 `fillStyle` | | stroke | 设置用于笔触的颜色、渐变或模式 | 对应 Canvas 属性 `strokeStyle` | | lineWidth | 描边宽度 | | | lineDash | 描边虚线 | Number[] 类型代表实、虚长度 | | shadowColor | 设置用于阴影的颜色 | | | shadowBlur | 设置用于阴影的模糊级别 | 数值越大,越模糊 | | shadowOffsetX | 设置阴影距形状的水平距离 | | | shadowOffsetY | 设置阴影距形状的垂直距离 | | | opacity | 设置绘图的当前 alpha 或透明值 | 对应 Canvas 属性 `globalAlpha` | | fillOpacity | 设置填充的 alpha 或透明值 | | ### 用法 ```javascript group.addShape("rect", { attrs: { fill: "red", shadowOffsetX: 10, shadowOffsetY: 10, shadowColor: "blue", shadowBlur: 10, opacity: 0.8, }, // must be assigned in F6. it can be any value you want name: "rect-shape", }); ``` ## 各图形 Shape 的通用方法 ### attr() 设置或获取实例的绘图属性。 ### attr(name) 获取实例的属性值。 ``` const width = shape.attr('width'); ``` ### attr(name, value) 更新实例的单个绘图属性。 ### attr({...}) 批量更新实例绘图属性。 ``` rect.attr({ fill: '#999', stroke: '#666' }); ``` ## 圆图形 Circle ### 属性 | 属性名 | 含义 | | ------ | ------------- | | x | 圆心的 x 坐标 | | y | 圆心的 y 坐标 | | r | 圆的半径 | ### 用法 ```javascript group.addShape("circle", { attrs: { x: 100, y: 100, r: 50, fill: "blue", }, // must be assigned in F6. it can be any value you want name: "circle-shape", }); ``` ## 矩形图形 Rect ### 属性 | 属性名 | 含义 | 备注 | | ------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | x | 矩形左上角的 x 坐标 | | | y | 矩形左上角的 y 坐标 | | | width | 矩形的宽度 | | | height | 矩形的高度 | | | radius | 定义圆角 | 支持整数或数组形式, 分别对应左上、右上、右下、左下角的半径:
- radius 缩写为 1 或 [ 1 ] 相当于 [ 1, 1, 1, 1 ]
- radius 缩写为 [ 1, 2 ] 相当于 [ 1, 2, 1, 2 ]
- radius 缩写为 [ 1, 2, 3 ] 相当于 [ 1, 2, 3, 2 ]
| ### 用法 ```javascript group.addShape("rect", { attrs: { x: 150, y: 150, width: 150, height: 150, stroke: "black", radius: [2, 4], }, // must be assigned in F6. it can be any value you want name: "rect-shape", }); ``` ## 椭圆图形 Ellipse ### 属性 | 属性名 | 含义 | | ------ | ------------- | | x | 圆心的 x 坐标 | | y | 圆心的 y 坐标 | | rx | 水平半径 | | ry | 垂直半径 | ### 用法 ```javascript group.addShape("ellipse", { attrs: { x: 100, y: 100, rx: 50, ry: 50, fill: "blue", }, // must be assigned in F6. it can be any value you want name: "ellipse-shape", }); ``` ## 多边形图形 Polygon ### 属性 | 属性名 | 含义 | 备注 | | ------ | -------------------- | -------- | | points | 多边形的所有端点坐标 | 数组形式 | ### 用法 ```javascript group.addShape("polygon", { attrs: { points: [ [30, 30], [40, 20], [30, 50], [60, 100], ], fill: "red", }, // must be assigned in F6. it can be any value you want name: "polygon-shape", }); ``` ## 图片图形 Image ### 属性 | 属性名 | 含义 | 备注 | | ------ | ------------------- | ---------------------------------------------------- | | x | 图片左上角的 x 坐标 | | | y | 图片左上角的 y 坐标 | | | width | 图片宽度 | | | height | 图片高度 | | | img | 图片源 | F6 支持多种格式的图片:url、ImageData、Image、canvas | ### 用法 ```javascript group.addShape("image", { attrs: { x: 0, y: 0, img: "https://g.alicdn.com/cm-design/arms-trace/1.0.155/styles/armsTrace/images/TAIR.png", }, // must be assigned in F6. it can be any value you want name: "image-shape", }); ``` ## 标记图形 Marker ### 属性 | 属性名 | 含义 | 备注 | | ------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | x | 中心的 x 坐标 | | | y | 中心的 y 坐标 | | | r | 形状半径 | | | symbol | 指定形状 | 内置了一些常用形状,如圆形 `circle` , 矩形  `square` , 菱形  `diamond` ,三角形  `triangle` , 倒三角形 `triangle-down` ,也可以是自定义的 path 路径。 | ### 用法 ```javascript group.addShape("marker", { attrs: { x: 10, y: 10, r: 10, symbol: function (x, y, r) { return [["M", x, y], ["L", x + r, y + r], ["L", x + r * 2, y], ["Z"]]; }, }, // must be assigned in F6. it can be any value you want name: "marker-shape", }); ``` ## 路径 Path   ⚠️ 注意: 当边太细交互不易命中时,请设置 `lineAppendWidth` 属性值。 ### 属性 | 属性名 | 含义 | 备注 | | --------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | path | 线条路径 | 可以是 String 形式,也可以是线段的数组。 | | startArrow | 起始端的箭头 | 为 `true` 时在边的结束端绘制默认箭头,为 `false` 时不绘制结束端箭头。也可以是一个通过 path 自定义的箭头 | | endArrow | 末尾端的箭头 | 为 `true` 时在边的开始端绘制默认箭头,为 `false` 时不绘制开始端箭头。也可以是一个通过 path 自定义的箭头 | | lineAppendWidth | 边的击中范围 | 提升边的击中范围,扩展响应范围,数值越大,响应范围越广 | | lineCap | 设置线条的结束端点样式 | | | lineJoin | 设置两条线相交时,所创建的拐角形状 | | | lineWidth | 设置当前的线条宽度 | | | miterLimit | 设置最大斜接长度 | | | lineDash | 设置线的虚线样式,可以指定一个数组 | 一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。 | ### 用法 ```javascript group.addShape("path", { attrs: { startArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, }, endArrow: { // 自定义箭头指向(0, 0),尾部朝向 x 轴正方向的 path path: "M 0,0 L 20,10 L 20,-10 Z", // 箭头的偏移量,负值代表向 x 轴正方向移动 // d: -10, }, path: [ ["M", 100, 100], ["L", 200, 200], ], stroke: "#000", lineWidth: 8, lineAppendWidth: 5, }, // must be assigned in F6. it can be any value you want name: "path-shape", }); ``` ## 文本 Text ### 属性 | 属性名 | 含义 | 备注 | | ------------- | ---------------------------------- | ------------------------------------------------------------------------------------------ | | fill | 设置用于填充绘画的颜色、渐变或模式 | 对应 Canvas 属性 `fillStyle` | | stroke | 设置用于笔触的颜色、渐变或模式 | 对应 Canvas 属性 `strokeStyle` | | shadowColor | 设置用于阴影的颜色 | | | shadowBlur | 设置用于阴影的模糊级别 | 数值越大,越模糊 | | shadowOffsetX | 设置阴影距形状的水平距离 | | | shadowOffsetY | 设置阴影距形状的垂直距离 | | | opacity | 设置绘图的当前 alpha 或透明值 | 对应 Canvas 属性 `globalAlpha` | | textAlign | 设置文本内容的当前对齐方式 | 支持的属性:`center` / `end` / `left` / `right` / `start`,默认值为 `start` | | textBaseline | 设置在绘制文本时使用的当前文本基线 | 支持的属性:
`top` / `middle` / `bottom` / `alphabetic` / `hanging`。默认值为 `bottom` | | fontStyle | 字体样式 | 对应 `font-style` | | fontVariant | 设置为小型大写字母字体 | 对应 `font-variant` | | fontWeight | 字体粗细 | 对应 `font-weight` | | fontSize | 字体大小 | 对应 `font-size` | | fontFamily | 字体系列 | 对应 `font-family` | | lineHeight | 行高 | 对应 `line-height` | ### 用法 ```javascript group.addShape("text", { attrs: { text: "test text", x: 0, y: 10, fontSize: 14, textAlign: "left", textBaseline: "middle", fill: "#0000D9", }, // must be assigned in F6. it can be any value you want name: "text-shape", }); ``` ## DOM (svg) > 仅在 Graph 的 `renderer` 为 `'svg'` 时可以使用。 ⚠️ 注意: - 只支持原生 HTML DOM,不支持各类 react、vue 组件; - 使用 dom 进行自定义的节点或边,不支持 F6 的交互事件,请使用原生 DOM 的交互事件。 ### 特殊属性 | 属性名 | 含义 | 备注 | | ------ | -------------- | ---- | | html | DOM 的 html 值 | | ### 用法 ```javascript group.addShape("dom", { attrs: { width: cfg.size[0], height: cfg.size[1], // DOM's html html: `
img
${ cfg.label }
`, }, // must be assigned in F6. it can be any value you want name: "dom-shape", draggable: true, }); ``` ================================================ FILE: packages/site/docs/manual/middle/elements/shape/shape-keyshape.zh.md ================================================ --- title: 图形 Shape 与 keyShape order: 0 --- ## 图形 Shape Shape 指 F6 中的图形、形状,它可以是圆形、矩形、路径等。它一般与 F6 中的节点、边、Combo 相关。**F6 中的每一种节点/边/ Combo 由一个或多个 Shape 组成。节点、边、Combo、标签文本的配置都会被体现到对应的图形上。** 例如下图(左)的节点包含了一个圆形图形;下图(中)的节点含有有一个圆形和一个文本图形;下图(右)的节点中含有 5 个圆形(蓝绿色的圆和上下左右四个锚点)、一个文本图形。但每种节点/边/ Combo 都会有自己的唯一关键图形 keyShape,下图中三个节点的 keyShape 都是蓝绿色的圆,keyShape 主要用于交互检测、样式随[状态](/zh/docs/manual/middle/states/state)自动更新等,见  [keyShape](#keyshape)。
img     img      img > (左)只含有一个圆形图形的节点,keyShape 是该圆形。(中)含有圆形和文本图形的节点,keyShape 是圆形。(右)含有主要圆形、文本、上下左右四个小圆形的节点,keyShape 是圆形。 F6 使用不同的 shape 组合,设计了多种内置的节点/边/ Combo 。F6 内置节点的有 'circle', 'rect','ellipse',...(详见 [内置节点](/zh/docs/manual/middle/elements/nodes/defaultNode));内置边的有 'line','polyline','cubic',...(详见 [内置边](/zh/docs/manual/middle/elements/edges/defaultEdge));内置 Combo 有 'circle','rect',()详见 [内置 Combo](/zh/docs/manual/middle/elements/combos/defaultCombo))。 除了使用内置的节点/边/ Combo 外,F6 还允许用户通过自己搭配和组合 shape 进行节点/边/ Combo 的自定义,详见 [自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node),[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge),[自定义 Combo](/zh/docs/manual/middle/elements/combos/custom-combo)。 ## KeyShape 如上所述,每一种节点/边/ Combo 都有一个唯一的关键图形 keyShape。keyShape 是在节点/边/ Combo 的 `draw()` 方法或 `drawShape()` 方法中返回的图形对象。它有两个主要特点: ### 响应样式 内置节点/边/ Combo 配置项中的 `style` 只体现在它的 keyShape 上。而内置节点/边/ Combo 的状态样式 (图实例的 `nodeStateStyles` / `edgeStateStyles` / `comboStateStyles` 或元素自身的 `stateStyles`) 中需要体现在 keyShape 或其他图形上的写法有所不同,详见 [配置状态样式](/zh/docs/manual/middle/states/state#配置-state-样式)。 想要更自由地响应样式(绘制或状态变化时),可以 [自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node) / [自定义边](/zh/docs/manual/middle/elements/edges/custom-edge) / [自定义 Combo](/zh/docs/manual/middle/elements/combos/custom-combo)。 #### 示例 该示例使用了内置 rect 节点,节点的 keyShape 是中间的 rect,其他 Shape 包括上下左右四个 circle 以及一个 text。代码设置了节点的样式 `style`,仅在 rect 上生效,其他 Shape 都以默认样式渲染。该节点上的其他图形需要使用其他配置项进行配置。例如,上下左右四个 circle 的样式需要在 `linkPoints` 中配置,文本样式需要在 `labelCfg` 中配置。 keyshape-demo ```javascript const data = { nodes: [ { x: 100, y: 100, label: 'rect', type: 'rect', style: { // 仅在 keyShape 上生效 fill: 'lightblue', stroke: '#888', lineWidth: 1, radius: 7, }, linkPoints: { top: true, bottom: true, left: true, right: true, // ... 四个圆的样式可以在这里指定 }, // labelCfg: {...} // 标签的样式可以在这里指定 }, ], }; const graph = new F6.Graph({ ... width: 500, height: 300, nodeStateStyles: { // 各状态下的样式,平铺的配置项仅在 keyShape 上生效。需要在其他 shape 样式上响应状态变化则写法不同,参见上文提到的 配置状态样式 链接 tap: { fillOpacity: 0.1, lineWidth: 10, }, }, }); graph.data(data); graph.render(); graph.on('node:tap', (evt) => { const node = evt.item; // 激活该节点的 tap状态 graph.setItemState(node, 'tap', true); }); graph.on('node:dbltap', (evt) => { const node = evt.item; // 关闭该节点的 hover 状态 graph.setItemState(node, 'tap', false); }); ``` ### 包围盒确定 **确定节点 / Combo 的包围盒(Bounding Box) —— bbox(x, y, width, height)** ,从而计算相关边的连入点(与相关边的交点)。若 keyShape 不同,节点与边的交点计算结果不同。 #### 示例   本例中的一个节点由一个 rect 图形和一个带灰色描边、填充透明的 circle 图形构成。 - 当节点的 keyShape 为 circle 时: img - 当节点的 keyShape 为 rect 时: img ## Shape 的生命周期 > 当用户需要[自定义节点](/zh/docs/manual/middle/elements/nodes/custom-node)、[自定义边](/zh/docs/manual/middle/elements/edges/custom-edge)、[自定义 Combo](/zh/docs/manual/middle/elements/combos/custom-combo) 时,需要了解 Shape 的生命周期。使用内置节点/边/ Combo 则可以跳过这一部分内容。 从整体来看,Shape 的生命周期分为: - 初始化渲染; - 更新; - 操作; - 销毁。 Shape 作为 Graph 上的核心元素,这几个阶段都需要考虑,但是销毁可以交给 Graph 来处理,所以在定义 Shape 时不需要考虑,仅需要考虑三个阶段即可: - 绘制:从无到有的绘制 Shape 及文本; - 更新:数据发生改变导致 Shape 及文本发生变化; - 操作:给 Shape 添加状态,如:selected,active 等。 所以我们在设计自定义节点/边/ Combo 时,定义了三个方法,若需要自定义节点/边/ Combo ,需要有选择性地复写它们: - `draw(cfg, group)`: 绘制,提供了绘制的配置项(数据定义时透传过来)和图形容器,**必须**返回合理的图形作为 keyShape; - `update(cfg, n)`: 更新,更新时的配置项(更新的字段和原始字段的合并)和元素对象; - `setState(name, value, item)`: 响应节点/边/ Combo 状态的变化。 关于自定义节点和边的更多方法请参考 [自定义节点与边 API](/zh/docs/api/registerItem)。 ================================================ FILE: packages/site/docs/manual/middle/elements/shape/transform.zh.md ================================================ --- title: 图形或图形分组的变换 order: 3 --- ### F6 3.2 F6 3.2 及以下版本中,实现变换可通过以下方式。 #### transform(ts) 实例变换方法。参数以数组形式提供,按顺序执行。 例如画布上有以下的一个矩形实例。 ```javascript const rect = group.addShape("rect", { attrs: { width: 100, height: 100, x: 100, y: 100, fill: "#9EC9FF", stroke: "#5B8FF9", lineWidth: 3, }, // must be assigned in F6 3.3 and later versions. it can be any value you want name: "rect-shape", }); ``` 得到的结果如下图所示: img 对其进行如下操作: ```javascript rect.transform([ ["t", 10, 10], // x 方向平移 10, y 方向平移 10 ["s", 1.2], // 缩放 1.2 倍 ["r", Math.PI / 4], // 旋转 45 度 ]); ``` #### translate(x, y) 实例的相对位移方法。 #### move(x, y) 实例的相对位移方法。 #### rotate(radian) 根据旋转弧度值对图形进行旋转。 #### scale(sx, sy) 对图形进行缩放。 #### resetMatrix() 清除图形实例的所有变换效果。 #### getTotalMatrix() 获取应用到实例上的所有变换的矩阵。 ### F6 3.3 在 F6 3.3 及以上版本中,废弃了 Group / Canvas 上只适用于三阶矩阵的变换函数: - 🗑 平移函数 translate; - 🗑 移动函数 move; - 🗑 缩放函数 scale; - 🗑 旋转函数 rotate; - 🗑 以 (0, 0) 点为中心的旋转函数 rotateAtStart。 在 F6 3.3 版本中要应用矩阵变换的效果,需要手动设置矩阵的值: - 获取当前矩阵:getMatrix(); - 设置矩阵:setMatrix(matrix) 或 attr('matrix', matrix); - 重置矩阵:resetMatrix()。 为了方面使用,我们提供了矩阵变换的工具方法: ```javascript import { transform } from "@antv/matrix-util"; // 3*3 矩阵变换,用于二维渲染 transform(m, [ ["t", 100, 50], // translate (100, 50) ["r", Math.PI], // rotate Math.PI ["s", 2, 2], // scale 2 times at x-axis and y-axis ]); ``` #### 示例 以下方法实现了在自定义节点 example 中增加一个矩形,并将该矩形位移 `(100, 50)` 后,旋转 `Math.PI / 4`,最后在 x 方向放大 2 倍,并在 y 方向缩小 2 倍: ```javascript import { transform, mat3 } from "@antv/matrix-util"; F6.registerNode("example", { drawShape: (cfg, group) => { const rect = group.addShape("rect", { attrs: { width: 100, height: 100, x: 100, y: 100, fill: "#9EC9FF", stroke: "#5B8FF9", lineWidth: 3, }, // must be assigned in F6 3.3 and later versions. it can be any value you want name: "rect-shape", draggable: true, }); const matrix = rect.getMatrix(); // 图形或分组的初始矩阵时 null,为了避免变换一个 null 矩阵,需要通过 mat3.create() 将其初始化为单位矩阵 if (!matrix) matrix = mat3.create(); // 3*3 矩阵变换,用于二维渲染 const newMatrix = transform(matrix, [ ["t", 100, 50], // translate ["r", Math.PI / 4], // rotate ["s", 2, 0.5], // scale ]); rect.setMatrix(newMatrix); }, }); ``` ================================================ FILE: packages/site/docs/manual/middle/graph.zh.md ================================================ --- title: Graph 图 order: 1 --- ## 什么是 Graph 中文字“图”在大家的传统认知里指的是图画、图像,而图论与可视化中的“图”—— Graph 则有着更精确的定位:主体(objects)与关系(relationships)的组成。它甚至不局限于视觉,主体与关系的数据也可以称为图。
> —— 摘自 AntV 专栏文章:Graph Visualization · 知多少 之 《HelloWorld 图可视化》。 在 F6 中,Graph 对象是图的载体,它包含了图上的所有元素(节点、边等),同时挂载了图的相关操作(如交互监听、元素操作、渲染等)。
Graph 对象的生命周期为:初始化 —> 加载数据 —> 渲染 —> 更新 —> 销毁。 在 [快速上手](/zh/docs/manual/getting-started) 中,我们简单介绍了 初始化、加载数据、渲染图 的使用方法。本文将主要介绍初始化/实例化图。 ## 前提代码 本文的讲解将会基于下面这份内嵌 JavaScript 的 HTML 代码。该代码通过定义数据、实例化图、读取数据、渲染图等操作中完成了下图中简单的图:
img